1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-07 23:29:39 +00:00
cc65/libsrc/atmos/capslock.s
Oliver Schmidt 1d1ba3ed3b Adjusted constructors.
The constructors are _NOT_ allowed anymore to access the BSS. Rather they must use the DATA segment or the INIT segment. The latter isn't cleared at any point so the constructors may use it to expose values to the main program. However they must make sure to always write the values as they are not pre-initialized.
2016-03-16 16:28:32 +01:00

50 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
;--------------------------------------------------------------------------
.segment "INIT"
capsave:
.res 1