]> git.sur5r.net Git - cc65/blob - libsrc/pet/kbrepeat.s
Replace hard returns with an "else", add an error for non-IDENT tokens, and test...
[cc65] / libsrc / pet / kbrepeat.s
1 ;
2 ; unsigned char __fastcall__ kbrepeat (unsigned char mode);
3 ;
4 ; 2017-06-16, Groepaz
5 ; 2017-09-05, Greg King
6 ;
7
8         .export         _kbrepeat
9
10         .include        "pet.inc"
11
12 _kbrepeat:
13         ldx     #>$0000
14         ldy     SCR_LINELEN
15         cpy     #40 + 1
16         bcc     L1              ; branch if screen is 40 columns wide
17
18         ldy     KBDREPEAT80     ; get old value
19         sta     KBDREPEAT80     ; store new value
20         tya                     ; return old value
21         rts
22
23 L1:     tay
24         lda     KBDREPEAT40B    ; get REPEAT-key flag (used by some editor ROMs)
25         lsr     a               ; move bit 0 into bit 7
26         ror     a
27         ora     KBDREPEAT40     ; combine with old key-REPEAT flags
28         sty     KBDREPEAT40
29         rts