1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-07 23:29:39 +00:00

Added BEL -> beep() functionality

This commit is contained in:
Wayne Parham 2021-06-10 16:07:39 -05:00
parent 7d6541274d
commit 24f5bac899

View File

@ -30,10 +30,13 @@ begin: dec ptr2
getch: jsr INTCHR ; Get character using Monitor ROM call
jsr OUTCHR ; Echo it
and #$7F ; Clear hi bit and check for '\r'
cmp #$0D
bne putch
lda #$0A ; Replace with '\n' and set count to zero
and #$7F ; Clear hi bit
cmp #$07 ; Check for '\a'
bne chkcr ; ...if BEL character
jsr BEEP ; Make beep sound
chkcr: cmp #$0D ; Check for '\r'
bne putch ; ...if CR character
lda #$0A ; Replace with '\n'
putch: ldy #$00 ; Put char into return buffer
sta (ptr1),y