diff options
| author | Sik | 2018-03-15 04:23:17 -0300 |
|---|---|---|
| committer | Sik | 2018-03-15 04:23:17 -0300 |
| commit | b51cc937b0ef7810d037824fd4f1a766e085a121 (patch) | |
| tree | 669e74dde08fb9e0b8a9c16b216d3c902de5d004 /src-68k | |
| parent | 2d5a5b6d0f6d7a6d513722708aa903899be23252 (diff) | |
Fixing bug regarding command queue (whoops)
Diffstat (limited to 'src-68k')
| -rw-r--r-- | src-68k/echo.68k | 29 |
1 files changed, 15 insertions, 14 deletions
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 |
