aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSik2018-03-15 04:23:17 -0300
committerSik2018-03-15 04:23:17 -0300
commitb51cc937b0ef7810d037824fd4f1a766e085a121 (patch)
tree669e74dde08fb9e0b8a9c16b216d3c902de5d004
parent2d5a5b6d0f6d7a6d513722708aa903899be23252 (diff)
Fixing bug regarding command queue (whoops)
-rw-r--r--README12
-rw-r--r--c/echo.c1
-rw-r--r--src-68k/echo.68k29
3 files changed, 22 insertions, 20 deletions
diff --git a/README b/README
index c38e043..28aac4b 100644
--- a/README
+++ b/README
@@ -7,12 +7,12 @@
| | |_ |_ ___ | | | | | | | |
| |_______ |_ |___| _| | | | | |_ |_____| _|
|___________| |________| |___| |___| |_________|
- ___ ___ _ _ ___ __ ___ ___ ___ _ ___ ___ _ ___
- | _| | | | | \ | _| | _| | | _| | | | _|
- | |_| | | | | | | | | | |_| | | |_| | | | |_ _ _ ___ ___ | | | |_
- |_ | | | | | | | | | | _| | | | | | | | _| | | | __| _ \ | | | |
- _| | | | | | | | | | | |_| | | | | | | | |_ | | | __| /_ | |_| | |
- |___|___|___|_|_|__/ |___|_|_|___|_|_|_|___| \_/|___|_|_\_| |_|_|___|
+ ___ ___ _ _ ___ __ ___ ___ ___ _ ___ ___ _ ___ _
+ | _| | | | | \ | _| | _| | | _| | | | _| |
+ | |_| | | | | | | | | | |_| | | |_| | | | |_ _ _ ___ ___ | | | |_| |
+ |_ | | | | | | | | | | _| | | | | | | | _| | | | __| _ \ | | | | |
+ _| | | | | | | | | | | |_| | | | | | | | |_ | | | __| /_ | |_| | | |
+ |___|___|___|_|_|__/ |___|_|_|___|_|_|_|___| \_/|___|_|_\_| |_|_|___|_|
=============================================================================
diff --git a/c/echo.c b/c/echo.c
index ed634db..e2d68d9 100644
--- a/c/echo.c
+++ b/c/echo.c
@@ -62,6 +62,7 @@ void echo_init(const void* const* list) {
// would tell it to load the instrument list, but we can't do that here
// due to linker shenanigans)
z80_ram[0x1FFF] = 0x00;
+ z80_ram[0x1FFB] = 0x00;
// Direct stream is empty yet
z80_ram[0x1F00] = 0xFF;
diff --git a/src-68k/echo.68k b/src-68k/echo.68k
index e755d19..ac3b702 100644
--- a/src-68k/echo.68k
+++ b/src-68k/echo.68k
@@ -123,7 +123,7 @@ Echo_SendCommandEx:
;****************************************************************************
Echo_SendCommandByte:
- movem.l d1/a1, -(sp) ; Save registers
+ movem.l d1-2/a1, -(sp) ; Save registers
Echo_Z80Request ; We need the Z80 bus
lea ($A01FFF), a1 ; First try the 1st slot
@@ -135,8 +135,8 @@ Echo_SendCommandByte:
tst.b (a1) ; Check if 2nd slot is ready
beq.s @Ready ; Too busy?
Echo_Z80Release ; Let Echo continue
- move.w #$FF, d1 ; Give it some time
- dbf d1, * ; ...
+ move.w #$FF, d2 ; Give it some time
+ dbf d2, * ; ...
Echo_Z80Request ; Get Z80 bus back
bra.s @Try ; Try again
@@ -145,7 +145,7 @@ Echo_SendCommandByte:
move.b d1, -3(a1) ; Write parameter
Echo_Z80Release ; We're done with the Z80 bus
- movem.l (sp)+, d1/a1 ; Restore registers
+ movem.l (sp)+, d1-d2/a1 ; Restore registers
rts ; End of subroutine
;****************************************************************************
@@ -403,7 +403,7 @@ Echo_SetVolumeEx:
;****************************************************************************
Echo_GetStatus:
- movem.l d1/a1, -(sp) ; Save registers
+ movem.l d1-d2/a1, -(sp) ; Save registers
clr.w d0 ; Set all needed bits to 0
Echo_Z80Request ; We need the Z80 bus
@@ -424,21 +424,21 @@ Echo_GetStatus:
move.b ($A01FFF), d1 ; Get next pending command (if any)
beq.s @QueueChecked ; No commands left to process?
- move.b (a1,d1.w), d1 ; Get mask of flags to leave
- and.b d1, d0 ; Remove flags that should be clear
- move.b @OrTable-@AndTable(a1,d1.w), d1 ; Get mask of flags to set
- or.b d1, d0 ; Insert flags that should be set
+ move.b (a1,d1.w), d2 ; Get mask of flags to leave
+ and.b d2, d0 ; Remove flags that should be clear
+ move.b @OrTable-@AndTable(a1,d1.w), d2 ; Get mask of flags to set
+ or.b d2, d0 ; Insert flags that should be set
move.b ($A01FFB), d1 ; Repeat that with 2nd pending command
beq.s @QueueChecked
- move.b (a1,d1.w), d1
- and.b d1, d0
- move.b @OrTable-@AndTable(a1,d1.w), d1
- or.b d1, d0
+ move.b (a1,d1.w), d2
+ and.b d2, d0
+ move.b @OrTable-@AndTable(a1,d1.w), d2
+ or.b d2, d0
@QueueChecked:
Echo_Z80Release ; Let the Z80 go!
- movem.l (sp)+, d1/a1 ; Restore registers
+ movem.l (sp)+, d1-d2/a1 ; Restore registers
rts ; End of subroutine
;----------------------------------------------------------------------------
@@ -545,6 +545,7 @@ Echo_Init:
Echo_Z80Request ; We need the Z80 bus
move.b #$01, ($A01FFF) ; Command: load pointer list
+ move.b #$00, ($A01FFB) ; No other command yet
move.l a0, d0 ; Easier to manipulate here
move.b d0, ($A01FFD) ; Store low address byte