]> git.sur5r.net Git - cc65/blob - libsrc/atmos/capslock.s
6811862c650e7e1a926d2ab942f9970e7487c5d5
[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-08-22, Greg King
9 ;
10
11         .destructor     restore_caps
12         .constructor    disable_caps
13
14         .include        "atmos.inc"
15
16
17 ;--------------------------------------------------------------------------
18
19 ; Restore the old capitals-lock state.
20
21 restore_caps:
22         lda     capsave
23         sta     CAPSLOCK
24         rts
25
26
27 ;--------------------------------------------------------------------------
28 ; Put this constructor into a segment that can be re-used by programs.
29 ;
30 .segment        "INIT"
31
32 ; Turn the capitals lock off.
33
34 disable_caps:
35         lda     CAPSLOCK
36         sta     capsave
37         lda     #$7F
38         sta     CAPSLOCK
39         rts
40
41
42 ;--------------------------------------------------------------------------
43
44 .bss
45
46 capsave:
47         .res    1