small code size optimization

This commit is contained in:
FeralChild64 committed 2020-12-30 22:16:08 +01:00
1 parent cded5a0264
commit 018ae9725b
5 files changed
+20 -29

No files matched your search

@@ -272,6 +272,8 @@ m65_chrout_fix_scroll_up_scroll:
phz
; XXX try to shorten code by using m65_screen_put_space
jsr m65_helper_scrlpnt_color
lda COLOR
and #$0F
@@ -150,7 +150,7 @@ m65_chrout_screen_INS:
jsr m65_chrout_screen_INS_copy
; Store space in the current character cell
; Store space in the current character cell XXX try to shorten code using m65_screen_put_space
lda #$20
sta [M65_LPNT_SCR], z
@@ -72,20 +72,12 @@ m65_chrout_screen_DEL_1stcol:
lda M65__TXTCOL
beq @3
; Deleta character under cursor
; Delete character under cursor
phz
jsr m65_helper_scrlpnt_color
ldz M65__TXTCOL
lda COLOR
and #$0F
sta [M65_LPNT_SCR], z
jsr m65_helper_scrlpnt_to_screen
lda #$20
sta [M65_LPNT_SCR], z
jsr m65_screen_put_space
plz
@@ -98,15 +98,7 @@ m65_chrout_esc_P: ; erase everything from start of the line to cursor XXX u
ldz #$FF
@1:
inz
; XXX common part - deduplicate, find other places
lda #$20
sta [M65_LPNT_SCR], z
jsr m65_helper_scrlpnt_color
lda COLOR
and #$0F
sta [M65_LPNT_SCR], z
jsr m65_helper_scrlpnt_to_screen
; XXX end common part
jsr m65_screen_put_space
cpz M65__TXTCOL
bne @1
@@ -121,15 +113,7 @@ m65_chrout_esc_Q: ; erase everything from cursor till the end of line XXX u
taz
@1:
dez
; XXX common part - deduplicate, find other places
lda #$20
sta [M65_LPNT_SCR], z
jsr m65_helper_scrlpnt_color
lda COLOR
and #$0F
sta [M65_LPNT_SCR], z
jsr m65_helper_scrlpnt_to_screen
; XXX end common part
jsr m65_screen_put_space
cpz M65__TXTCOL
bne @1
@@ -20,6 +20,19 @@ m65_screen_clear_special_modes: ; XXX consider integrating with 'm65_screen_clea
rts
m65_screen_put_space:
; Puts space in current line, position .Z
lda #$20
sta [M65_LPNT_SCR], z
jsr m65_helper_scrlpnt_color
lda COLOR
and #$0F
sta [M65_LPNT_SCR], z
jmp m65_helper_scrlpnt_to_screen
m65_screen_upd_txtrow_off:
ldy M65__TXTROW