1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-22 12:30:41 +00:00

Fixed capslock on startup

git-svn-id: svn://svn.cc65.org/cc65/trunk@2051 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz 2003-04-14 14:45:47 +00:00
parent 21c7002bed
commit c3b242339c
2 changed files with 13 additions and 18 deletions

View File

@ -11,6 +11,7 @@
; ---------------------------------------------------------------------------
; Low memory
CAPSLOCK = $20C
CURS_Y = $268
CURS_X = $269
STATUS = $26A

View File

@ -5,8 +5,7 @@
;
.export _cgetc
.constructor cursoroff
.destructor cursoron
.constructor initcgetc
.import cursor
.include "atmos.inc"
@ -25,14 +24,17 @@
lda cursor ; Cursor currently off?
beq @L1 ; Skip if so
jsr cursoron
lda STATUS
ora #%00000001 ; Cursor ON
sta STATUS
@L1: lda KEYBUF
bpl @L1
; If the cursor was enabled, disable it now
ldx cursor
beq @L3
beq @L2
ldx #$00 ; Zero high byte
dec STATUS ; Clear bit zero
; We have the character, clear avail flag
@ -42,26 +44,18 @@
; Done
@L3: ldx #$00
rts
.endproc
; ------------------------------------------------------------------------
; Switch the cursor on
; Switch the cursor off, disable capslock
cursoron:
lda STATUS
ora #%00000001
sta STATUS
rts
; ------------------------------------------------------------------------
; Switch the cursor off
cursoroff:
initcgetc:
lda STATUS
and #%11111110
sta STATUS
lda #$7F
sta CAPSLOCK
rts