mirror of
https://github.com/cc65/cc65.git
synced 2024-10-04 03:56:13 +00:00
5723cfed0c
git-svn-id: svn://svn.cc65.org/cc65/trunk@944 b7a2c559-68d2-44c3-8de9-860c34a00d81
57 lines
1.3 KiB
ArmAsm
57 lines
1.3 KiB
ArmAsm
;
|
|
; Ullrich von Bassewitz, 16.09.2001
|
|
;
|
|
|
|
.export k_blncur
|
|
|
|
.include "zeropage.inc"
|
|
|
|
|
|
; ------------------------------------------------------------------------
|
|
; Blink the cursor in the interrupt
|
|
|
|
.proc k_blncur
|
|
|
|
lda CURS_FLAG ; Is the cursor on?
|
|
bne curend ; Jump if not
|
|
dec CURS_BLINK
|
|
bne curend
|
|
|
|
; Re-initialize the blink counter
|
|
|
|
lda #20 ; Initial value
|
|
sta CURS_BLINK
|
|
|
|
; Switch to the system bank, load Y with the cursor X coordinate
|
|
|
|
lda #$0F
|
|
sta IndReg ; Access system bank
|
|
ldy CURS_X
|
|
|
|
; Check if the cursor state was on or off before
|
|
|
|
lda CURS_COLOR ; Load color behind cursor
|
|
lsr CURS_STATE ; Cursor currently displayed?
|
|
bcs curset ; Jump if yes
|
|
|
|
; Cursor was off before, switch it on
|
|
|
|
inc CURS_STATE ; Mark as displayed
|
|
lda (CRAM_PTR),y ; Get color behind cursor...
|
|
sta CURS_COLOR ; ...and remember it
|
|
lda CHARCOLOR ; Use character color
|
|
|
|
; Set the cursor with color in A
|
|
|
|
curset: sta (CRAM_PTR),y ; Store cursor color
|
|
lda ExecReg
|
|
sta IndReg ; Switch to our segment
|
|
lda (SCREEN_PTR),y
|
|
eor #$80 ; Toggle reverse flag
|
|
sta (SCREEN_PTR),y
|
|
curend: rts
|
|
|
|
.endproc
|
|
|
|
|