From: Greg King Date: Thu, 21 Aug 2014 14:46:25 +0000 (-0400) Subject: Disable the Atmos keyboard's CAPS LOCK for both conio and stdio. X-Git-Tag: V2.15~46^2~2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=58b73a2842745dc4dc96166e35b948821ec75df8;p=cc65 Disable the Atmos keyboard's CAPS LOCK for both conio and stdio. --- diff --git a/libsrc/atmos/cgetc.s b/libsrc/atmos/cgetc.s index e13d143d2..0c6fb4c7a 100644 --- a/libsrc/atmos/cgetc.s +++ b/libsrc/atmos/cgetc.s @@ -1,6 +1,6 @@ ; ; 2003-04-13, Ullrich von Bassewitz -; 2013-07-26, Greg King +; 2014-08-21, Greg King ; ; char cgetc (void); ; @@ -22,11 +22,11 @@ ; No character, enable cursor and wait - lda cursor ; Cursor currently off? + lda cursor ; Should cursor be off? beq @L1 ; Skip if so - lda STATUS - ora #%00000001 ; Cursor ON - sta STATUS + lsr STATUS + sec ; Cursor ON + rol STATUS @L1: lda KEYBUF bpl @L1 @@ -34,13 +34,13 @@ ldx cursor beq @L2 - ldx #$00 ; Zero high byte dec STATUS ; Clear bit zero ; We have the character, clear avail flag @L2: and #$7F ; Mask out avail flag sta KEYBUF + ldx #>0 ldy MODEKEY cpy #FUNCTKEY bne @L3 @@ -53,16 +53,12 @@ .endproc ; ------------------------------------------------------------------------ -; Switch the cursor off, disable capslock. Code goes into the INIT segment +; Switch the cursor off. Code goes into the INIT segment ; which may be reused after it is run. .segment "INIT" initcgetc: - lda STATUS - and #%11111110 - sta STATUS - lda #$7F - sta CAPSLOCK + lsr STATUS + asl STATUS ; Clear bit zero rts - diff --git a/libsrc/atmos/crt0.s b/libsrc/atmos/crt0.s index 1588cbec0..2c7e9dc41 100644 --- a/libsrc/atmos/crt0.s +++ b/libsrc/atmos/crt0.s @@ -2,6 +2,7 @@ ; Startup code for cc65 (Oric version) ; ; By Debrune Jérôme and Ullrich von Bassewitz +; 2014-08-15, Greg King ; .export _exit @@ -39,26 +40,33 @@ .segment "STARTUP" -; Save the zero page area we're about to use +; Save the zero-page area we're about to use. ldx #zpspace-1 L1: lda sp,x - sta zpsave,x ; Save the zero page locations we need + sta zpsave,x dex bpl L1 -; Clear the BSS data +; Clear the BSS data. jsr zerobss -; Unprotect columns 0 and 1 +; Turn capitals lock off. + + lda CAPSLOCK + sta capsave + lda #$7F + sta CAPSLOCK + +; Unprotect screen columns 0 and 1. lda STATUS sta stsave and #%11011111 sta STATUS -; Save system stuff and setup the stack +; Save system stuff; and, set up the stack. tsx stx spsave ; Save system stk ptr @@ -68,26 +76,31 @@ L1: lda sp,x lda #>(__RAM_START__ + __RAM_SIZE__ + __STACKSIZE__) sta sp+1 ; Set argument stack ptr -; Call module constructors +; Call module constructors. jsr initlib -; Push arguments and call main() +; Push arguments; and, call main(). jsr callmain -; Call module destructors. This is also the _exit entry. +; Call module destructors. This is also the exit() entry. _exit: jsr donelib ; Run module destructors -; Restore system stuff +; Restore system stuff. ldx spsave txs lda stsave sta STATUS -; Copy back the zero page stuff +; Restore capitals lock. + + lda capsave + sta CAPSLOCK + +; Copy back the zero-page stuff. ldx #zpspace-1 L2: lda zpsave,x @@ -95,7 +108,7 @@ L2: lda zpsave,x dex bpl L2 -; Back to BASIC +; Back to BASIC. rts @@ -111,3 +124,5 @@ zpsave: .res zpspace spsave: .res 1 stsave: .res 1 +capsave: + .res 1