Fixed capslock on startup
git-svn-id: svn://svn.cc65.org/cc65/trunk@2051 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -11,6 +11,7 @@
|
|||||||
; ---------------------------------------------------------------------------
|
; ---------------------------------------------------------------------------
|
||||||
; Low memory
|
; Low memory
|
||||||
|
|
||||||
|
CAPSLOCK = $20C
|
||||||
CURS_Y = $268
|
CURS_Y = $268
|
||||||
CURS_X = $269
|
CURS_X = $269
|
||||||
STATUS = $26A
|
STATUS = $26A
|
||||||
|
|||||||
@@ -5,8 +5,7 @@
|
|||||||
;
|
;
|
||||||
|
|
||||||
.export _cgetc
|
.export _cgetc
|
||||||
.constructor cursoroff
|
.constructor initcgetc
|
||||||
.destructor cursoron
|
|
||||||
.import cursor
|
.import cursor
|
||||||
|
|
||||||
.include "atmos.inc"
|
.include "atmos.inc"
|
||||||
@@ -25,14 +24,17 @@
|
|||||||
|
|
||||||
lda cursor ; Cursor currently off?
|
lda cursor ; Cursor currently off?
|
||||||
beq @L1 ; Skip if so
|
beq @L1 ; Skip if so
|
||||||
jsr cursoron
|
lda STATUS
|
||||||
|
ora #%00000001 ; Cursor ON
|
||||||
|
sta STATUS
|
||||||
@L1: lda KEYBUF
|
@L1: lda KEYBUF
|
||||||
bpl @L1
|
bpl @L1
|
||||||
|
|
||||||
; If the cursor was enabled, disable it now
|
; If the cursor was enabled, disable it now
|
||||||
|
|
||||||
ldx cursor
|
ldx cursor
|
||||||
beq @L3
|
beq @L2
|
||||||
|
ldx #$00 ; Zero high byte
|
||||||
dec STATUS ; Clear bit zero
|
dec STATUS ; Clear bit zero
|
||||||
|
|
||||||
; We have the character, clear avail flag
|
; We have the character, clear avail flag
|
||||||
@@ -42,26 +44,18 @@
|
|||||||
|
|
||||||
; Done
|
; Done
|
||||||
|
|
||||||
@L3: ldx #$00
|
|
||||||
rts
|
rts
|
||||||
|
|
||||||
.endproc
|
.endproc
|
||||||
|
|
||||||
; ------------------------------------------------------------------------
|
; ------------------------------------------------------------------------
|
||||||
; Switch the cursor on
|
; Switch the cursor off, disable capslock
|
||||||
|
|
||||||
cursoron:
|
initcgetc:
|
||||||
lda STATUS
|
|
||||||
ora #%00000001
|
|
||||||
sta STATUS
|
|
||||||
rts
|
|
||||||
|
|
||||||
; ------------------------------------------------------------------------
|
|
||||||
; Switch the cursor off
|
|
||||||
|
|
||||||
cursoroff:
|
|
||||||
lda STATUS
|
lda STATUS
|
||||||
and #%11111110
|
and #%11111110
|
||||||
sta STATUS
|
sta STATUS
|
||||||
|
lda #$7F
|
||||||
|
sta CAPSLOCK
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user