]> git.sur5r.net Git - cc65/blob - libsrc/apple2/cgetc.s
Adjusted C declarations to the changed static driver names.
[cc65] / libsrc / apple2 / cgetc.s
1 ;
2 ; Kevin Ruland
3 ;
4 ; char cgetc (void);
5 ;
6 ; If open_apple key is pressed then the high-bit of the key is set.
7 ;
8
9         .export _cgetc
10
11         .include "apple2.inc"
12
13 _cgetc:
14         lda     KBD
15         bpl     _cgetc          ; If < 128, no key pressed
16
17         ; At this time, the high bit of the key pressed is set
18         bit     KBDSTRB         ; Clear keyboard strobe
19         .ifdef __APPLE2ENH__
20         bit     BUTN0           ; Check if OpenApple is down
21         bmi     done
22         .endif
23         and     #$7F            ; If not down, then clear high bit
24 done:   ldx     #$00
25         rts