aboutsummaryrefslogtreecommitdiff
path: root/src-z80/core/main.z80
diff options
context:
space:
mode:
authorJavier Degirolmo2012-08-27 07:58:24 -0300
committerJavier Degirolmo2012-08-27 07:58:24 -0300
commit6266e3e5577bc7c11d300a873c150b6a7900376a (patch)
tree82b14ee437f6f802cd5cd896dd66c58c29ea7ec0 /src-z80/core/main.z80
parent2f83b4822b5825d58ab4a74e4e9e5f0be2cc78f2 (diff)
Fuck it, we're doing it live
Diffstat (limited to 'src-z80/core/main.z80')
-rw-r--r--src-z80/core/main.z8078
1 files changed, 20 insertions, 58 deletions
diff --git a/src-z80/core/main.z80 b/src-z80/core/main.z80
index 3a5a441..82c6bb0 100644
--- a/src-z80/core/main.z80
+++ b/src-z80/core/main.z80
@@ -225,69 +225,33 @@ LoadList:
xor a ; Command parsed
ld (RAM_Command), a
- ld a, c ; Do initial bank switch
- ld de, $6000
- ex de, hl
- BankSwitch
- ex de, hl
-
ld de, RAM_PointerList ; Where the pointer list starts
.loop:
- ld a, (hl) ; Get high address byte
- or a ; Is it the end of the list?
- jp z, .end ; If so, stop parsing list
- ld (de), a ; Nope, store it in list
-
- inc d ; Get address for next byte
- inc l
- jr nz, .noswitch1
- inc h
- jr nz, .noswitch1
- inc c
- ld a, c
- ld h, $60
- BankSwitch
- ld h, $80
-.noswitch1:
-
- ld a, (hl) ; Get low address byte
- ld (de), a ; Store it in pointer list
-
- inc d ; Get address for next byte
- inc l
- jr nz, .noswitch2
- inc h
- jr nz, .noswitch2
- inc c
- ld a, c
- ld h, $60
- BankSwitch
- ld h, $80
-.noswitch2:
-
- ld a, (hl) ; Get bank byte
- ld (de), a ; Store it in pointer list
-
- dec d ; Get address for next byte
+ call GetParam ; Get high byte address
+
+ ld a, b ; Is it the end of the list?
+ or a
+ jp z, .end
+
+ ld (de), a ; Store high byte address
+ inc d
+
+ call GetParam ; Get low address byte
+ ld a, b
+ ld (de), a
+ inc d
+
+ call GetParam ; Get bank byte
+ ld a, b
+ ld (de), a
+
+ dec d ; Go for next byte
dec d
inc e
- inc l
- jr nz, .noswitch3
- inc h
- jr nz, .noswitch3
- inc c
- ld a, c
- ld h, $60
- BankSwitch
- ld h, $80
-.noswitch3:
-
- jp .loop ; Go for next byte
+ jp .loop
.end:
- ld a, c ; Store current bank
- ld (RAM_LastBank), a
jp IdleLoop ; End of subroutine
;****************************************************************************
@@ -307,8 +271,6 @@ GetParam:
.noswitchp:
ld b, (hl) ; Get volume
- ;PollPCM
-
inc l ; Get next address
jp nz, .nonewbankp
inc h