further CHROUT fixes and optimizations

This commit is contained in:
FeralChild64 committed 2019-10-09 22:10:13 +02:00
1 parent e53dcaf345
commit d3ef25c441
6 files changed
+44 -43

No files matched your search

+2 -5
View File
@@ -43,12 +43,11 @@ chrout_iec:
lda SCHAR lda SCHAR
jsr JCIOUT jsr JCIOUT
bcc chrout_done bcc chrout_done_success
// FALLTROUGH // FALLTROUGH
chrout_done_fail: chrout_done_fail:
jsr cursor_show_if_enabled
plp plp
@@ -68,7 +67,6 @@ chrout_done_fail:
rts rts
chrout_done_unknown_device: chrout_done_unknown_device:
jsr cursor_show_if_enabled
plp plp
@@ -87,8 +85,7 @@ chrout_done_unknown_device:
// End wioth error // End wioth error
jmp lvs_device_not_found_error jmp lvs_device_not_found_error
chrout_done: chrout_done_success:
jsr cursor_show_if_enabled
plp plp
+13 -4
View File
@@ -99,10 +99,19 @@ not_quote:
ldy PNTR ldy PNTR
!: !:
cpy #80 cpy #80
bcc no_screen_advance_to_next_line bcc chrout_screen_done
lda #0 lda #0
sta PNTR sta PNTR
jmp screen_advance_to_next_line jmp chrout_screen_advance_to_next_line
no_screen_advance_to_next_line:
jmp chrout_done chrout_screen_calc_lptr_done:
jsr screen_calculate_line_pointer
// FALLTROUGH
chrout_screen_done:
jsr cursor_show_if_enabled
jmp chrout_done_success
@@ -1,5 +1,5 @@
screen_advance_to_next_line: chrout_screen_advance_to_next_line:
// jsr cursor_hide_if_visible // jsr cursor_hide_if_visible
@@ -43,5 +43,4 @@ screen_advance_to_next_line:
jsr scroll_screen_up jsr scroll_screen_up
!: !:
jsr screen_calculate_line_pointer jmp chrout_screen_calc_lptr_done
jmp chrout_done
+21 -27
View File
@@ -23,7 +23,7 @@ chrout_try_RETURN:
sta QTSW sta QTSW
sta INSRT sta INSRT
sta RVS sta RVS
jmp screen_advance_to_next_line jmp chrout_screen_advance_to_next_line
!: !:
chrout_try_DEL: chrout_try_DEL:
@@ -49,8 +49,7 @@ chrout_try_CRSR_UP:
sec sec
sbc #40 sbc #40
sta PNTR sta PNTR
jsr screen_calculate_line_pointer jmp chrout_screen_calc_lptr_done
jmp chrout_done
!: !:
chrout_try_CRSR_DOWN: chrout_try_CRSR_DOWN:
@@ -66,8 +65,7 @@ chrout_try_CRSR_DOWN:
// so that we can tell if we really are on the bottom phys // so that we can tell if we really are on the bottom phys
// screen line or not // screen line or not
jsr screen_scroll_up_if_on_last_line jsr screen_scroll_up_if_on_last_line
jsr screen_calculate_line_pointer jmp chrout_screen_calc_lptr_done
jmp chrout_done
!: !:
chrout_try_CRSR_LEFT: chrout_try_CRSR_LEFT:
@@ -76,9 +74,11 @@ chrout_try_CRSR_LEFT:
lda TBLX lda TBLX
ora PNTR ora PNTR
beq chrout_screen_control_done // if top-left screen character bne position_not_top_left
jmp chrout_screen_done
position_not_top_left:
dec PNTR dec PNTR
jmp chrout_screen_control_calcptr_done jmp chrout_screen_calc_lptr_done
!: !:
chrout_try_CRSR_RIGHT: chrout_try_CRSR_RIGHT:
@@ -86,17 +86,16 @@ chrout_try_CRSR_RIGHT:
bne !+ bne !+
inc PNTR inc PNTR
jsr screen_calculate_line_pointer jmp chrout_screen_calc_lptr_done
jmp chrout_done
!: !:
chrout_try_RVS_ON: chrout_try_RVS_ON: // XXX deduplicate with RVS_OFF
cmp #$12 cmp #$12
bne !+ bne !+
lda #$80 lda #$80
sta RVS sta RVS
bne chrout_screen_control_done // branch always jmp chrout_screen_done
!: !:
chrout_try_RVS_OFF: chrout_try_RVS_OFF:
@@ -105,7 +104,7 @@ chrout_try_RVS_OFF:
lda #$00 lda #$00
sta RVS sta RVS
beq chrout_screen_control_done // branch always jmp chrout_screen_done
!: !:
chrout_try_MODE_TXT: chrout_try_MODE_TXT:
@@ -114,7 +113,7 @@ chrout_try_MODE_TXT:
// XXX // XXX
jmp chrout_done jmp chrout_screen_done
!: !:
chrout_try_MODE_GFX: chrout_try_MODE_GFX:
@@ -123,7 +122,7 @@ chrout_try_MODE_GFX:
// XXX // XXX
jmp chrout_done jmp chrout_screen_done
!: !:
chrout_try_COLOR: chrout_try_COLOR:
@@ -132,7 +131,7 @@ colour_check_loop:
cmp colour_codes,x cmp colour_codes,x
bne !+ bne !+
stx COLOR stx COLOR
jmp chrout_done jmp chrout_screen_done
!: !:
dex dex
bpl colour_check_loop bpl colour_check_loop
@@ -144,7 +143,7 @@ chrout_try_SHIFT_ENABLE:
// XXX // XXX
jmp chrout_done jmp chrout_screen_done
!: !:
chrout_try_SHIFT_DISABLE: chrout_try_SHIFT_DISABLE:
@@ -153,7 +152,7 @@ chrout_try_SHIFT_DISABLE:
// XXX // XXX
jmp chrout_done jmp chrout_screen_done
!: !:
chrout_try_HOME: chrout_try_HOME:
@@ -164,7 +163,7 @@ chrout_try_HOME:
lda #$00 lda #$00
sta PNTR sta PNTR
sta TBLX sta TBLX
beq chrout_screen_control_calcptr_done // branch always jmp chrout_screen_calc_lptr_done
!: !:
chrout_try_CLR: chrout_try_CLR:
@@ -172,7 +171,7 @@ chrout_try_CLR:
bne !+ bne !+
jsr clear_screen jsr clear_screen
jmp chrout_done jmp chrout_screen_done
!: !:
chrout_try_INS: chrout_try_INS:
@@ -188,7 +187,7 @@ chrout_try_RUN_STOP:
// XXX // XXX
jmp chrout_done jmp chrout_screen_done
!: !:
chrout_try_FKEY: chrout_try_FKEY:
@@ -196,11 +195,6 @@ chrout_try_FKEY:
// FALLTROUGH // FALLTROUGH
chrout_screen_control_done: // unknown, LF, or no more actions required // XXX to !csc_done !: // unknown, LF, or no more actions required // XXX to !csc_done
jmp chrout_done jmp chrout_screen_done
chrout_screen_control_calcptr_done: // XXX to !csc_calcptr_done
jsr screen_calculate_line_pointer
jmp chrout_done
+4 -2
View File
@@ -28,7 +28,7 @@ chrout_screen_del_column_0:
lda LNMX lda LNMX
sta PNTR sta PNTR
jmp chrout_screen_control_calcptr_done jmp chrout_screen_calc_lptr_done
chrout_screen_del_column_non_0: chrout_screen_del_column_non_0:
@@ -59,5 +59,7 @@ chrout_screen_del_column_non_0:
!: !:
dec PNTR dec PNTR
// FALLTROUGH
chrout_screen_del_done: chrout_screen_del_done:
jmp chrout_done jmp chrout_screen_done
+2 -2
View File
@@ -17,7 +17,7 @@ chrout_screen_ins:
beq !+ beq !+
// Line is too long to extend // Line is too long to extend
jmp chrout_done jmp chrout_screen_done
!: !:
// Work out if line needs to be expanded, and if so expand it // Work out if line needs to be expanded, and if so expand it
@@ -61,4 +61,4 @@ chrout_screen_ins:
lda #$20 lda #$20
sta (PNT),y sta (PNT),y
jmp chrout_done jmp chrout_screen_done