mirror of
https://github.com/wwarthen/RomWBW.git
synced 2026-02-06 14:11:48 -06:00
Implemented a shadow copy of the RTC port value to enable multiple drivers to share the port without causing side effects to other drivers that use other bits of the RTC port.
38 lines
727 B
NASM
38 lines
727 B
NASM
;
|
|
;======================================================================
|
|
; I/O BIT DRIVER FOR CONSOLE BELL FOR SBC V2 USING BIT 0 OF RTC DRIVER
|
|
;======================================================================
|
|
;
|
|
SPK_INIT:
|
|
CALL NEWLINE ; FORMATTING
|
|
PRTS("SPK: IO=0x$")
|
|
LD A,DSRTC_BASE
|
|
CALL PRTHEXBYTE
|
|
CALL SPK_BEEP
|
|
XOR A
|
|
RET
|
|
;
|
|
SPK_BEEP:
|
|
PUSH DE
|
|
PUSH HL
|
|
LD HL,400 ; CYCLES OF TONE
|
|
;LD B,%00000100 ; D2 MAPPED TO Q0
|
|
;LD A,DSRTC_RESET
|
|
LD A,(RTCVAL) ; GET RTC PORT VALUE FROM SHADOW
|
|
OR %00000100 ; D2 MAPPED TO Q0
|
|
LD B,A
|
|
SPK_BEEP1:
|
|
LD A,B
|
|
OUT (DSRTC_BASE),A
|
|
XOR %00000100
|
|
LD B,A
|
|
LD DE,17
|
|
CALL VDELAY
|
|
DEC HL
|
|
LD A,H
|
|
OR L
|
|
JR NZ,SPK_BEEP1
|
|
POP HL
|
|
POP DE
|
|
RET
|