LDDE,(RTCIO*256)+SP_RTCIOMSK; AND ADDRESS AND DATA PORT
LDDE,(SPKPORT*256)+SPKMASK; AND ADDRESS AND DATA PORT
XORA
XORA
RET
RET
;
;
@ -283,7 +288,7 @@ SP_BEEPER:
LDB,$00
LDB,$00
LDIX,SPK_DLYADJ; The base address of the timing loop.
LDIX,SPK_DLYADJ; The base address of the timing loop.
ADDIX,BC; Alter the length of the timing loop. Use an earlier starting point for each '1' lost by taking INT (L/4).
ADDIX,BC; Alter the length of the timing loop. Use an earlier starting point for each '1' lost by taking INT (L/4).
LDA,(HB_RTCVAL); Fetch the present border colour from BORDCR and move it to bits 2, 1 and 0 of the A register.
LDA,(SPKSHADOW); Fetch the present border colour from BORDCR and move it to bits 2, 1 and 0 of the A register.
;
;
; The HL register holds the 'length of the timing loop' with 16 T states being used for each '1' in the L register and 1024 T states for each '1' in the H register.
; The HL register holds the 'length of the timing loop' with 16 T states being used for each '1' in the L register and 1024 T states for each '1' in the H register.
;
;
@ -302,8 +307,9 @@ BE_H_L_LP:
;
;
; The loudspeaker is now alternately activated and deactivated.
; The loudspeaker is now alternately activated and deactivated.
;
;
XORSP_RTCIOMSK; Flip bit 2.
OUT(RTCIO),A; Perform the 'OUT' operation, leaving other bits unchanged.
XORSPKMASK; Flip bit.
OUT(SPKPORT),A; Perform the 'OUT' operation, leaving other bits unchanged.
LDB,H; Reset the B register.
LDB,H; Reset the B register.
LDC,A; Save the A register.
LDC,A; Save the A register.
BIT4,A; Jump if at the half-cycle point.
BIT4,A; Jump if at the half-cycle point.
@ -333,8 +339,8 @@ BE_END:
; leaves the bit set to the opposite value it started at. This
; leaves the bit set to the opposite value it started at. This
; ensures that the bit is properly reset to its original value.
; ensures that the bit is properly reset to its original value.
;
;
LDA,(HB_RTCVAL); Get the current RTC latch value
OUT(RTCIO),A; Set it
LDA,(SPKSHADOW); Get the current port value (typically RTC latch)