From 9a1c3f792912b63b244fa188ba3246b3148aa0ac Mon Sep 17 00:00:00 2001 From: Wayne Warthen Date: Mon, 30 Oct 2023 11:41:31 -0700 Subject: [PATCH] Minor Fix in SPK Driver and Tick Counter Space Reservation - Fix ensures that the speaker control bit is set the same as it was initially after playing a tone. - Reserve 2 bytes in the proxy for a platform dependent tick counter value. Currently for HEATH platform. --- Source/HBIOS/hbios.asm | 3 ++- Source/HBIOS/spk.asm | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Source/HBIOS/hbios.asm b/Source/HBIOS/hbios.asm index 94b7c7a9..f524c444 100644 --- a/Source/HBIOS/hbios.asm +++ b/Source/HBIOS/hbios.asm @@ -993,7 +993,8 @@ HBX_BUF_END .EQU $ .DW 0 ; HB_DSTADR: BNKCPY DESTINATION ADDRESS .DB BID_USR ; HB_DSTBNK: BNKCPY DESTINATION BANK ID .DW 0 ; HB_CPYLEN: BNKCPY LENGTH - .FILL 4,0 ; FILLER, RESERVED FOR FUTURE HBIOS USE + .DW 0 ; RESERVED FOR OPTIONAL TICK CTR, PLATFORM DEPENDENT + .DW 0 ; RESERVED FOR FUTURE HBIOS USE .DB 0 ; SHADOW VALUE FOR RTC LATCH PORT .DB $FE ; HB_LOCK: HBIOS MUTEX LOCK JP HBX_INVOKE ; HB_INVOKE: FIXED ADR ENTRY FOR HBX_INVOKE (ALT FOR RST 08) diff --git a/Source/HBIOS/spk.asm b/Source/HBIOS/spk.asm index ee3b803c..67c9f7f5 100644 --- a/Source/HBIOS/spk.asm +++ b/Source/HBIOS/spk.asm @@ -303,6 +303,14 @@ BE_AGAIN: BE_END: HB_EI POP IX +; +; Above flow flips the speaker bit an odd number of times which +; leaves the bit set to the opposite value it started at. This +; ensures that the bit is properly reset to its original value. +; + LD A,(HB_RTCVAL) ; Get the current RTC latch value + OUT (RTCIO),A ; Set it +; RET ; ALWAYS EXITS WITH SUCCESS STATUS (A=0) ; ;======================================================================