From 8e96c87f2d2bac7207718fd211f29fc085d31bc3 Mon Sep 17 00:00:00 2001 From: Sik Date: Sun, 7 Jul 2019 03:35:06 -0300 Subject: Fixing bugs with Echo_PlayDirect (oof) --- src-z80/core/direct.z80 | 6 ++++++ src-z80/core/vars.z80 | 1 + 2 files changed, 7 insertions(+) (limited to 'src-z80') diff --git a/src-z80/core/direct.z80 b/src-z80/core/direct.z80 index d796ddf..570175f 100644 --- a/src-z80/core/direct.z80 +++ b/src-z80/core/direct.z80 @@ -10,6 +10,9 @@ ProcessDirect: inc a ret z + ld a, $FF ; Put bogus length for direct stream + ld (RAM_DirectLen), a ; so 68000 knows to wait + PollPCM ld hl, ProcessDirectEnd ; Override $FF event @@ -24,7 +27,10 @@ ProcessDirect: ProcessDirectEnd: ld hl, StopBGMEvent ; Restore $FF event ld (ProcessBGMEventFF+1), hl + ld a, $FF ; Reset the stream ld ($1F00), a + inc a + ld (RAM_DirectLen), a ret ; Return to the main loop diff --git a/src-z80/core/vars.z80 b/src-z80/core/vars.z80 index 23b15b5..054106b 100644 --- a/src-z80/core/vars.z80 +++ b/src-z80/core/vars.z80 @@ -77,6 +77,7 @@ RAM_PointerList: equ $1C00 ; 68000 communication variables ;**************************************************************************** +RAM_DirectLen: equ $1F80 ; Length of direct event stream RAM_Stack: equ $1FE0 ; Where stack starts RAM_GlobalVol: equ $1FE0 ; Global volume for all channels -- cgit v1.2.3