Moved the CAPS LOCK code out of the startup file, and into its own file.
This commit is contained in:
47
libsrc/atmos/capslock.s
Normal file
47
libsrc/atmos/capslock.s
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
;
|
||||||
|
; 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-08-22, Greg King
|
||||||
|
;
|
||||||
|
|
||||||
|
.destructor restore_caps
|
||||||
|
.constructor disable_caps
|
||||||
|
|
||||||
|
.include "atmos.inc"
|
||||||
|
|
||||||
|
|
||||||
|
;--------------------------------------------------------------------------
|
||||||
|
|
||||||
|
; Restore the old capitals-lock state.
|
||||||
|
|
||||||
|
restore_caps:
|
||||||
|
lda capsave
|
||||||
|
sta CAPSLOCK
|
||||||
|
rts
|
||||||
|
|
||||||
|
|
||||||
|
;--------------------------------------------------------------------------
|
||||||
|
; Put this constructor into a segment that can be re-used by programs.
|
||||||
|
;
|
||||||
|
.segment "INIT"
|
||||||
|
|
||||||
|
; Turn the capitals lock off.
|
||||||
|
|
||||||
|
disable_caps:
|
||||||
|
lda CAPSLOCK
|
||||||
|
sta capsave
|
||||||
|
lda #$7F
|
||||||
|
sta CAPSLOCK
|
||||||
|
rts
|
||||||
|
|
||||||
|
|
||||||
|
;--------------------------------------------------------------------------
|
||||||
|
|
||||||
|
.bss
|
||||||
|
|
||||||
|
capsave:
|
||||||
|
.res 1
|
||||||
@@ -1,13 +1,15 @@
|
|||||||
;
|
;
|
||||||
; 2003-04-13, Ullrich von Bassewitz
|
; 2003-04-13, Ullrich von Bassewitz
|
||||||
; 2014-08-21, Greg King
|
; 2014-08-22, Greg King
|
||||||
;
|
;
|
||||||
; char cgetc (void);
|
; char cgetc (void);
|
||||||
;
|
;
|
||||||
|
|
||||||
.export _cgetc
|
.export _cgetc
|
||||||
.constructor initcgetc
|
.constructor initcgetc
|
||||||
|
|
||||||
.import cursor
|
.import cursor
|
||||||
|
.forceimport disable_caps
|
||||||
|
|
||||||
.include "atmos.inc"
|
.include "atmos.inc"
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
; Startup code for cc65 (Oric version)
|
; Startup code for cc65 (Oric version)
|
||||||
;
|
;
|
||||||
; By Debrune J<>r<EFBFBD>me <jede@oric.org> and Ullrich von Bassewitz <uz@cc65.org>
|
; By Debrune J<>r<EFBFBD>me <jede@oric.org> and Ullrich von Bassewitz <uz@cc65.org>
|
||||||
; 2014-08-15, Greg King
|
; 2014-08-22, Greg King
|
||||||
;
|
;
|
||||||
|
|
||||||
.export _exit
|
.export _exit
|
||||||
@@ -40,7 +40,7 @@
|
|||||||
|
|
||||||
.segment "STARTUP"
|
.segment "STARTUP"
|
||||||
|
|
||||||
; Save the zero-page area we're about to use.
|
; Save the zero-page area that we're about to use.
|
||||||
|
|
||||||
ldx #zpspace-1
|
ldx #zpspace-1
|
||||||
L1: lda sp,x
|
L1: lda sp,x
|
||||||
@@ -52,13 +52,6 @@ L1: lda sp,x
|
|||||||
|
|
||||||
jsr zerobss
|
jsr zerobss
|
||||||
|
|
||||||
; Turn capitals lock off.
|
|
||||||
|
|
||||||
lda CAPSLOCK
|
|
||||||
sta capsave
|
|
||||||
lda #$7F
|
|
||||||
sta CAPSLOCK
|
|
||||||
|
|
||||||
; Unprotect screen columns 0 and 1.
|
; Unprotect screen columns 0 and 1.
|
||||||
|
|
||||||
lda STATUS
|
lda STATUS
|
||||||
@@ -66,7 +59,7 @@ L1: lda sp,x
|
|||||||
and #%11011111
|
and #%11011111
|
||||||
sta STATUS
|
sta STATUS
|
||||||
|
|
||||||
; Save system stuff; and, set up the stack.
|
; Save some system stuff; and, set up the stack.
|
||||||
|
|
||||||
tsx
|
tsx
|
||||||
stx spsave ; Save system stk ptr
|
stx spsave ; Save system stk ptr
|
||||||
@@ -76,30 +69,25 @@ L1: lda sp,x
|
|||||||
lda #>(__RAM_START__ + __RAM_SIZE__ + __STACKSIZE__)
|
lda #>(__RAM_START__ + __RAM_SIZE__ + __STACKSIZE__)
|
||||||
sta sp+1 ; Set argument stack ptr
|
sta sp+1 ; Set argument stack ptr
|
||||||
|
|
||||||
; Call module constructors.
|
; Call the module constructors.
|
||||||
|
|
||||||
jsr initlib
|
jsr initlib
|
||||||
|
|
||||||
; Push arguments; and, call main().
|
; Push the command-line arguments; and, call main().
|
||||||
|
|
||||||
jsr callmain
|
jsr callmain
|
||||||
|
|
||||||
; Call module destructors. This is also the exit() entry.
|
; Call the module destructors. This is also the exit() entry.
|
||||||
|
|
||||||
_exit: jsr donelib ; Run module destructors
|
_exit: jsr donelib ; Run module destructors
|
||||||
|
|
||||||
; Restore system stuff.
|
; Restore the system stuff.
|
||||||
|
|
||||||
ldx spsave
|
ldx spsave
|
||||||
txs
|
txs
|
||||||
lda stsave
|
lda stsave
|
||||||
sta STATUS
|
sta STATUS
|
||||||
|
|
||||||
; Restore capitals lock.
|
|
||||||
|
|
||||||
lda capsave
|
|
||||||
sta CAPSLOCK
|
|
||||||
|
|
||||||
; Copy back the zero-page stuff.
|
; Copy back the zero-page stuff.
|
||||||
|
|
||||||
ldx #zpspace-1
|
ldx #zpspace-1
|
||||||
@@ -124,5 +112,3 @@ zpsave: .res zpspace
|
|||||||
|
|
||||||
spsave: .res 1
|
spsave: .res 1
|
||||||
stsave: .res 1
|
stsave: .res 1
|
||||||
capsave:
|
|
||||||
.res 1
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
;
|
;
|
||||||
; 2013-12-24, Greg King
|
; 2014-08-22, Greg King
|
||||||
;
|
;
|
||||||
; int read (int fd, void* buf, unsigned count);
|
; int read (int fd, void* buf, unsigned count);
|
||||||
;
|
;
|
||||||
@@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
.import popax
|
.import popax
|
||||||
.importzp ptr1, ptr2, ptr3
|
.importzp ptr1, ptr2, ptr3
|
||||||
|
.forceimport disable_caps
|
||||||
|
|
||||||
.macpack generic
|
.macpack generic
|
||||||
.include "atmos.inc"
|
.include "atmos.inc"
|
||||||
|
|||||||
Reference in New Issue
Block a user