1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-01 13:41:34 +00:00

Fixed cgetc().

The GETIN function doesn't protect CPU registers.
This commit is contained in:
Greg King 2019-10-01 05:30:36 -04:00
parent 3cece61525
commit 9dfc8f84bc

View File

@ -1,5 +1,5 @@
;
; 2019-09-23, Greg King
; 2019-10-01, Greg King
;
; char cgetc (void);
; /* Return a character from the keyboard. */
@ -34,7 +34,9 @@ L1: lda KEY_COUNT
L3: ldy IN_DEV ; Save current input device
stz IN_DEV ; Keyboard
phy
jsr GETIN ; Read char, and return in .A
ply
sty IN_DEV ; Restore input device
ldx #>$0000
rts