.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