1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-26 08:32:00 +00:00

New cgetc with apple2enh fix from Oliver Scmidt

git-svn-id: svn://svn.cc65.org/cc65/trunk@3454 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz 2005-04-08 19:27:07 +00:00
parent 1c5c974200
commit b0117e1e22

View File

@ -11,13 +11,15 @@
.include "apple2.inc"
_cgetc:
lda KBD
bpl _cgetc ; if < 128, no key pressed
lda KBD
bpl _cgetc ; if < 128, no key pressed
; At this time, the high bit of the key pressed is set
bit KBDSTRB ; clear keyboard strobe
bit BUTN0 ; check if OpenApple is down
bmi :+
and #$7F ; If not down, then clear high bit
: ldx #$00
bit KBDSTRB ; clear keyboard strobe
.ifdef __APPLE2ENH__
bit BUTN0 ; check if OpenApple is down
bmi done
.endif
and #$7F ; If not down, then clear high bit
done: ldx #$00
rts