From cded5a0264e42dca5d2daf2d862c520ee361090b Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Wed, 30 Dec 2020 21:14:51 +0100 Subject: [PATCH] implemented solid cursor --- src/aliases/,aliases_ram_lowmem_m65.s | 7 ++++--- .../mega65_chrout_screen_control_escmode.s | 20 +++++++++++++++---- src/kernal/screen_m65/mega65_cursor_blink.s | 8 ++++++-- 3 files changed, 26 insertions(+), 9 deletions(-) diff --git a/src/aliases/,aliases_ram_lowmem_m65.s b/src/aliases/,aliases_ram_lowmem_m65.s index 15aeacd2..18235f66 100644 --- a/src/aliases/,aliases_ram_lowmem_m65.s +++ b/src/aliases/,aliases_ram_lowmem_m65.s @@ -59,9 +59,10 @@ !addr M65_KB_PRESSED = $5A0 ; $5A0-$5A2 keys pressed, used during scanning keyboard !addr M65_KB_PRESSED_OLD = $5A3 ; $5A3-$5A5 keys pressed during previous scan !addr M65_KB_PRESSED_NEW = $5A6 ; $5A6-$5A8 set of M65_KB_PRESSED minus M65_KB_PRESSED_OLD - !addr M65_BELLDSBL = $5A9 ; flag - if set, disable the bell - !addr M65_JOYCRSR = $5AA ; joystick to be used for cursor movement - ; $5AB-$5EB -- UNUSED -- + !addr M65_BELLDSBL = $5A9 ; flag - if set, disable the bell + !addr M65_SOLIDCRSR = $5AA ; flag - if set, cursor is solid (does not flash) + !addr M65_JOYCRSR = $5AB ; joystick to be used for cursor movement + ; $5AC-$5EB -- UNUSED -- !addr M65_DMAGIC_LIST = $5F1 ; $5EF-$5FF reserved for DMAgic list, 15 bytes (modulo bytes are not needed) !addr M65_RS232_INBUF = $600 ; $600-$6FF -- reserved for RS-232 input buffer -- !addr M65_RS232_OUTBUF = $700 ; $700-$7FF -- reserved for RS-232 output buffer -- diff --git a/src/kernal/screen_m65/mega65_chrout_screen_control_escmode.s b/src/kernal/screen_m65/mega65_chrout_screen_control_escmode.s index b2763de0..f885c808 100644 --- a/src/kernal/screen_m65/mega65_chrout_screen_control_escmode.s +++ b/src/kernal/screen_m65/mega65_chrout_screen_control_escmode.s @@ -185,6 +185,22 @@ m65_chrout_esc_R: ; 'reversed' screen colors and #$F0 bra m65_chrout_esc_COLOR_done +m65_chrout_esc_E: ; disable cursor flashing + + lda #$FF + +skip_2_bytes_trash_nvz + + ; FALLTROUGH + +m65_chrout_esc_F: ; enable cursor flashing + + lda #$00 + sta M65_SOLIDCRSR + + jmp m65_chrout_screen_done + + + ; XXX: implement screen routines below: @@ -199,10 +215,6 @@ m65_chrout_esc_C: ; disable auto-insert mode +nop m65_chrout_esc_D: ; delete current line, move content up +nop -m65_chrout_esc_E: ; disable cursor flashing - +nop -m65_chrout_esc_F: ; enable cursor flashing - +nop m65_chrout_esc_I: ; insert empty line, move content down +nop m65_chrout_esc_L: ; enable screen scrolling diff --git a/src/kernal/screen_m65/mega65_cursor_blink.s b/src/kernal/screen_m65/mega65_cursor_blink.s index c380301c..74bd61be 100644 --- a/src/kernal/screen_m65/mega65_cursor_blink.s +++ b/src/kernal/screen_m65/mega65_cursor_blink.s @@ -49,7 +49,7 @@ m65_cursor_blink: ; Check if cursor was visible or not, and toggle lda BLNON - bne m65_cursor_blink_undraw + bne m65_cursor_blink_check_undraw ; FALLTROUGH @@ -85,7 +85,11 @@ m65_cursor_blink_end: plz rts -m65_cursor_blink_undraw: +m65_cursor_blink_check_undraw: + + ; Check if cursor should blink at all + lda M65_SOLIDCRSR + bne m65_cursor_blink_timer_reset ; Cursor undraw - color lda GDCOL