Files
RomWBW/Source/HBIOS/spk.asm
Wayne Warthen 31b2192f22 RTC Port Shadow Register
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.
2019-07-14 14:00:00 -07:00

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