mirror of
https://github.com/cc65/cc65.git
synced 2024-12-28 06:30:16 +00:00
Added BEL -> beep() functionality
This commit is contained in:
parent
7d6541274d
commit
24f5bac899
@ -30,10 +30,13 @@ begin: dec ptr2
|
|||||||
|
|
||||||
getch: jsr INTCHR ; Get character using Monitor ROM call
|
getch: jsr INTCHR ; Get character using Monitor ROM call
|
||||||
jsr OUTCHR ; Echo it
|
jsr OUTCHR ; Echo it
|
||||||
and #$7F ; Clear hi bit and check for '\r'
|
and #$7F ; Clear hi bit
|
||||||
cmp #$0D
|
cmp #$07 ; Check for '\a'
|
||||||
bne putch
|
bne chkcr ; ...if BEL character
|
||||||
lda #$0A ; Replace with '\n' and set count to zero
|
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
|
putch: ldy #$00 ; Put char into return buffer
|
||||||
sta (ptr1),y
|
sta (ptr1),y
|
||||||
|
Loading…
Reference in New Issue
Block a user