cc65/libsrc/atmos/capslock.s
Oliver Schmidt 419eb700b5 Renamed INITBSS to INIT and INIT to ONCE.
The way we want to use the INITBSS segment - and especially the fact that it won't have the type bss on all ROM based targets - means that the name INITBSS is misleading. After all INIT is the best name from my perspective as it serves several purposes and therefore needs a rather generic name.

Unfortunately this means that the current INIT segment needs to be renamed too. Looking for a short (ideally 4 letter) name I came up with ONCE as it contains all code (and data) accessed only once during initialization.
2016-03-06 21:27:19 +01:00

49 lines
1.1 KiB
ArmAsm

;
; When Oric computers are in BASIC's command mode, the keyboard is in CAPS lock
; mode (because Oric BASIC keywords must be typed in upper-case). This
; constructor disables that mode, so that text will be typed as lower-case
; (which is the default on other cc65 platforms).
; This module is linked by the conio and POSIX input functions.
;
; 2014-09-04, Greg King
;
.constructor disable_caps
.destructor restore_caps
.include "atmos.inc"
;--------------------------------------------------------------------------
; Put this constructor into a segment that can be re-used by programs.
;
.segment "ONCE"
; Turn the capitals lock off.
disable_caps:
lda CAPSLOCK
sta capsave
lda #$7F
sta CAPSLOCK
rts
;--------------------------------------------------------------------------
.code
; Restore the old capitals-lock state.
restore_caps:
lda capsave
sta CAPSLOCK
rts
;--------------------------------------------------------------------------
.bss
capsave:
.res 1