]> git.sur5r.net Git - cc65/blob - libsrc/apple2/cgetc.s
This commit was generated by cvs2svn to compensate for changes in r2,
[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
7         ;; key is set.
8         
9         .export _cgetc
10
11         .include "apple2.inc"
12
13 _cgetc:
14         lda     KEY_STROBE
15         bpl     _cgetc          ; if < 128, no key pressed
16         ;; At this time, the high bit of the key pressed
17         ;; is set
18         sta     CLEAR_KEY_STROBE; clear keyboard strobe
19         bit     OPEN_APPLE      ; check if OpenApple is down
20         bmi     pressed 
21         and     #$7F            ; If not down, then clear high bit
22 pressed:        
23         ldx     #0
24         rts
25