]> git.sur5r.net Git - cc65/blob - libsrc/atmos/capslock.s
lseek: Return EINVAL if new position is less than 0 or greater than 2^24 - 1.
[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 whose space
19 ; will be re-used by BSS, the heap, and the C stack.
20 ;
21 .segment        "ONCE"
22
23 ; Turn the capitals lock off.
24
25 disable_caps:
26         lda     CAPSLOCK
27         sta     capsave
28         lda     #$7F
29         sta     CAPSLOCK
30         rts
31
32
33 ;--------------------------------------------------------------------------
34
35 .code
36
37 ; Restore the old capitals-lock state.
38
39 restore_caps:
40         lda     capsave
41         sta     CAPSLOCK
42         rts
43
44
45 ;--------------------------------------------------------------------------
46
47 .segment        "INIT"
48
49 capsave:
50         .res    1