From fbcb8924e878e7eff93d444762c647e126cb8e3b Mon Sep 17 00:00:00 2001 From: Sik Date: Sat, 6 Jul 2019 20:05:48 -0300 Subject: Added PCM playback flag to Echo_GetStatus --- README | 4 ++-- c/echo.c | 2 ++ c/echo.h | 1 + src-68k/echo.68k | 5 +++++ 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/README b/README index dbcc995..d16b16c 100644 --- a/README +++ b/README @@ -10,8 +10,8 @@ ___ ___ _ _ ___ __ ___ ___ ___ _ ___ ___ _ ___ ___ | _| | | | | \ | _| | _| | | _| | | | _| _| | |_| | | | | | | | | | |_| | | |_| | | | |_ _ _ ___ ___ | | | |_| |_ - |_ | | | | | | | | | | _| | | | | | | | _| | | | __| _ \ | | | |_ | - _| | | | | | | | | | | |_| | | | | | | | |_ | | | __| /_ | |_| | |_| | + |_ | | | | | | | | | | _| | | | | | | | _| | | | __| _ \ | | | | | + _| | | | | | | | | | | |_| | | | | | | | |_ | | | __| /_ | |_| | | | | |___|___|___|_|_|__/ |___|_|_|___|_|_|_|___| \_/|___|_|_\_| |_|_|___|___| ============================================================================= diff --git a/c/echo.c b/c/echo.c index e2d68d9..61acf68 100644 --- a/c/echo.c +++ b/c/echo.c @@ -407,6 +407,8 @@ uint16_t echo_get_status(void) { status |= ECHO_STAT_BUSY; if (z80_ram[0x1F00] != 0xFF) status |= ECHO_STAT_DIRBUSY; + if (z80_ram[0x0008] != 0xC9) + status |= ECHO_STAT_PCM; // Look ahead in the queue for any pending commands // Adjust the flags accordingly if needed diff --git a/c/echo.h b/c/echo.h index 3812c46..809e735 100644 --- a/c/echo.h +++ b/c/echo.h @@ -21,6 +21,7 @@ enum { /* Echo status flags */ #define ECHO_STAT_BGM 0x0002 /* Background music is playing */ #define ECHO_STAT_SFX 0x0001 /* Sound effect is playing */ +#define ECHO_STAT_PCM 0x2000 /* PCM playback ongoing */ #define ECHO_STAT_DIRBUSY 0x4000 /* Echo isn't done with direct events */ #define ECHO_STAT_BUSY 0x8000 /* Echo still didn't parse command */ diff --git a/src-68k/echo.68k b/src-68k/echo.68k index 8810ab2..46fb361 100644 --- a/src-68k/echo.68k +++ b/src-68k/echo.68k @@ -416,6 +416,11 @@ Echo_GetStatus: bset.l #14, d0 ; If so, set the relevant flag @DirectEmpty: + cmpi.b #$C9, ($A00008) ; Check if ch6 is in FM or PCM mode + beq.s @PcmOff ; PCM playback active? (i.e. not RET) + bset.l #13, d0 ; If so, set the relevant flag +@PcmOff: + moveq #0, d1 ; Clear unused bits from index lea @AndTable(pc), a1 ; Get pointer to look-up tables -- cgit v1.2.3