added DEL key support to MEGA65 native text mode

This commit is contained in:
FeralChild64 committed 2020-08-31 19:07:05 +02:00
1 parent c1e0bfa0c9
commit 7582913021
7 files changed
+112 -7

No files matched your search

+2 -1
View File
@@ -52,7 +52,8 @@
.label M65_TXTWIN_X1 = $590 // text window - bottom-right X coordinate + 1
.label M65_TXTWIN_Y1 = $591 // text window - bottom-right Y coordinate + 1
.label M65_TXTROW_OFF = $592 // $592-$593 offset to the current text row from the viewport start
// $594-$5EB -- UNUSED --
.label M65_SCRCOLMAX = $594 // maximum allowed column
// $595-$5EB -- UNUSED --
.label M65_DMAGIC_LIST = $5EF // $5EF-$5FF reserved for DMAgic list, 17 bytes
.label M65_RS232_INBUF = $600 // $600-$6FF -- reserved for RS-232 input buffer --
.label M65_RS232_OUTBUF = $700 // $700-$7FF -- reserved for RS-232 output buffer --
File renamed without changes.
+2 -2
View File
@@ -270,7 +270,7 @@ m65_chrout_fix_scroll_up_scroll:
jsr m65_helper_scrlpnt_color
lda COLOR
and #$0F
ldz #$4F
ldz M65_SCRCOLMAX
!:
sta_lp (M65_LPNT_SCR), z
dez
@@ -278,7 +278,7 @@ m65_chrout_fix_scroll_up_scroll:
jsr m65_helper_scrlpnt_to_screen
lda #$20
ldz #$4F
ldz M65_SCRCOLMAX
!:
sta_lp (M65_LPNT_SCR), z
dez
@@ -93,8 +93,6 @@ m65_chrout_screen_ESC:
nop
m65_chrout_screen_BELL:
nop
m65_chrout_screen_DEL:
nop
m65_chrout_screen_GFX:
nop
m65_chrout_screen_TXT:
@@ -0,0 +1,102 @@
// #LAYOUT# M65 KERNAL_1 #TAKE
// #LAYOUT# * * #IGNORE
// 'DEL' key support
m65_chrout_screen_DEL:
// First check for window mode
lda M65_SCRWINMODE
bmi m65_chrout_screen_DEL_winmode
// Not a window mode; check if we are in the first column
lda M65__TXTCOL
beq m65_chrout_screen_DEL_1stcol
// Not a window mode, not a first column - we can safely
// delete the character and sroll back the rest of the row
phz
jsr m65_helper_scrlpnt_color
jsr m65_chrout_screen_DEL_copy
ldz M65_SCRCOLMAX
lda COLOR
and #$0F
sta_lp (M65_LPNT_SCR), z
jsr m65_helper_scrlpnt_to_screen
jsr m65_chrout_screen_DEL_copy
ldz M65_SCRCOLMAX
lda #$20
sta_lp (M65_LPNT_SCR), z
plz
// End by moving cursor one position left
jmp m65_chrout_screen_CRSR_LEFT
m65_chrout_screen_DEL_copy:
ldz M65__TXTCOL
dez
!:
cpz M65_SCRCOLMAX
beq !+
inz
lda_lp (M65_LPNT_SCR), z
dez
sta_lp (M65_LPNT_SCR), z
inz
jmp_8 !-
!:
rts
m65_chrout_screen_DEL_1stcol:
// Start by moving one position left
jsr m65_chrout_screen_CRSR_LEFT
// If we are still in the first column - nothing to do
lda M65__TXTCOL
beq !+
// Deleta character under cursor
phz
jsr m65_helper_scrlpnt_color
ldz M65__TXTCOL
lda COLOR
and #$0F
sta_lp (M65_LPNT_SCR), z
jsr m65_helper_scrlpnt_to_screen
lda #$20
sta_lp (M65_LPNT_SCR), z
plz
// End of character deletion
!:
jmp m65_chrout_screen_done
m65_chrout_screen_DEL_winmode:
// XXX provide implementation for window mode
jmp m65_chrout_screen_done
+6 -2
View File
@@ -88,8 +88,9 @@ m65_scrmodeset_internal: // entry point for M65_MODE65
stx VIC_COLPTR+1
// Set the following locations:
// - M65_SCRGUARD, M65_COLGUARD - for max lines of virtual screen
// - M65_COLVIEWMAX - as above, but depending on the mode
// - M65_SCRGUARD, M65_COLGUARD - guards for virtual screen end
// - M65_COLVIEWMAX - guard for viewport start
// - M65_SCRCOLMAX - maximum allowed column
ldx #<(MEMCONF_SCRBASE + 80 * MEMCONF_SCRROWS)
stx M65_SCRGUARD+0
@@ -106,5 +107,8 @@ m65_scrmodeset_internal: // entry point for M65_MODE65
sta M65_COLVIEWMAX+0
lda m65_scrtab_colviewmax_hi, x
sta M65_COLVIEWMAX+1
lda m65_scrtab_txtwidth,x
dec_a
sta M65_SCRCOLMAX
rts