Skip to content

Commit

Permalink
Minor Fix in SPK Driver and Tick Counter Space Reservation
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
wwarthen committed Oct 30, 2023
1 parent ef53675 commit 9a1c3f7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Source/HBIOS/hbios.asm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 8 additions & 0 deletions Source/HBIOS/spk.asm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
;
;======================================================================
Expand Down

0 comments on commit 9a1c3f7

Please sign in to comment.