]> git.sur5r.net Git - cc65/blob - libsrc/atmos/capslock.s
0260b3f9f355c188394d96483cb8bb4d2968f971
[cc65] / libsrc / atmos / capslock.s
1 ;
2 ; When Oric computers are in BASIC's command mode, the keyboard is in CAPS lock
3 ; mode (because Oric BASIC keywords must be typed in upper-case).  This
4 ; constructor disables that mode, so that text will be typed as lower-case
5 ; (which is the default on other cc65 platforms).
6 ; This module is linked by the conio and POSIX input functions.
7 ;
8 ; 2014-09-04, Greg King
9 ;
10
11         .constructor    disable_caps
12         .destructor     restore_caps
13
14         .include        "atmos.inc"
15
16
17 ;--------------------------------------------------------------------------
18 ; Put this constructor into a segment that can be re-used by programs.
19 ;
20 .segment        "ONCE"
21
22 ; Turn the capitals lock off.
23
24 disable_caps:
25         lda     CAPSLOCK
26         sta     capsave
27         lda     #$7F
28         sta     CAPSLOCK
29         rts
30
31
32 ;--------------------------------------------------------------------------
33
34 .code
35
36 ; Restore the old capitals-lock state.
37
38 restore_caps:
39         lda     capsave
40         sta     CAPSLOCK
41         rts
42
43
44 ;--------------------------------------------------------------------------
45
46 .segment        "INIT"
47
48 capsave:
49         .res    1