1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-27 15:29:46 +00:00

Add blinking cursor

This commit is contained in:
Karri Kaksonen 2022-04-07 08:17:36 +03:00 committed by mrdudz
parent ff8d2e84bf
commit 7e7f9ffa58
2 changed files with 24 additions and 2 deletions

View File

@ -10,7 +10,7 @@ SYMBOLS {
__ENCRYPT_BOTTOM__: value = $ff7a, type = export;
__ENCRYPT_SIZE__: value = $80, type = export;
__MEMORY_TOP__: value = __ENCRYPT_BOTTOM__, type = export;
__INIT_SIZE__: value = 139+9, type = export;
__INIT_SIZE__: value = 154, type = export;
__MEMORY_INIT__: value = __MEMORY_TOP__ - __INIT_SIZE__, type = export;
__MEMORY_BOTTOM__: value = $10000 - __CARTSIZE__, type = weak;
__FREE_ROM_SIZE__: value = __MEMORY_INIT__ - __MEMORY_BOTTOM__, type = export;

View File

@ -27,6 +27,7 @@
.export gotoxy, _gotoxy, _gotox, _gotoy, _wherex, _wherey
.export CURS_X, CURS_Y
.constructor init_cursor
.interruptor blink_cursor
.importzp sp
.import _zones
@ -47,6 +48,8 @@ CURS_Y:
.byte 0
_cursor_visible:
.byte 1
blink_time:
.byte 140
.code
@ -208,7 +211,26 @@ umula0:
; Initialize cursorzone at startup
; Offset to cursor zone 5.
;
; .segment "ONCE"
.proc blink_cursor
inc blink_time
bne @L3
lda #140
sta blink_time
ldy #0
lda (cursorzone),y
bne @L1
lda #254
bne @L2
@L1: lda #0
@L2: sta (cursorzone),y
@L3: rts
.endproc
;-----------------------------------------------------------------------------
; Initialize cursorzone at startup
; Offset to cursor zone 5.
;
.segment "ONCE"
init_cursor:
lda #0
jsr calccursorzone