From d583ad6f10c0b356bbc5b1965103f78e9dac185e Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Fri, 3 Jan 2020 21:16:34 +0100 Subject: [PATCH] reworked advancing to the next line --- c64/kernal/screen/chrout_screen_crsr.s | 8 +-- c64/kernal/screen/chrout_screen_del.s | 2 +- c64/kernal/screen/chrout_screen_ins.s | 2 +- c64/kernal/screen/chrout_screen_tab.s | 4 +- c64/kernal/screen/e50a.plot.s | 8 +-- .../screen/screen_advance_to_next_line.s | 50 ++++--------------- .../screen/screen_scroll_up_if_on_last_line.s | 5 +- 7 files changed, 23 insertions(+), 56 deletions(-) diff --git a/c64/kernal/screen/chrout_screen_crsr.s b/c64/kernal/screen/chrout_screen_crsr.s index 78bd2a71..1eb85249 100644 --- a/c64/kernal/screen/chrout_screen_crsr.s +++ b/c64/kernal/screen/chrout_screen_crsr.s @@ -5,13 +5,13 @@ chrout_screen_CRSR_UP: - rts + jmp chrout_screen_done chrout_screen_CRSR_DOWN: - rts + jmp chrout_screen_done chrout_screen_CRSR_LEFT: - rts + jmp chrout_screen_done chrout_screen_CRSR_RIGHT: - rts + jmp chrout_screen_done /* YYY disabled for rework chrout_screen_CRSR_UP: diff --git a/c64/kernal/screen/chrout_screen_del.s b/c64/kernal/screen/chrout_screen_del.s index c7bb1274..0a5521f8 100644 --- a/c64/kernal/screen/chrout_screen_del.s +++ b/c64/kernal/screen/chrout_screen_del.s @@ -4,7 +4,7 @@ // chrout_screen_DEL: - rts + jmp chrout_screen_done /* YYY disabled for rework chrout_screen_DEL: diff --git a/c64/kernal/screen/chrout_screen_ins.s b/c64/kernal/screen/chrout_screen_ins.s index 81493f88..311637f3 100644 --- a/c64/kernal/screen/chrout_screen_ins.s +++ b/c64/kernal/screen/chrout_screen_ins.s @@ -4,7 +4,7 @@ // chrout_screen_INS: - rts + jmp chrout_screen_done /* YYY disabled for rework chrout_screen_INS: diff --git a/c64/kernal/screen/chrout_screen_tab.s b/c64/kernal/screen/chrout_screen_tab.s index bd94c16f..80178e56 100644 --- a/c64/kernal/screen/chrout_screen_tab.s +++ b/c64/kernal/screen/chrout_screen_tab.s @@ -7,9 +7,9 @@ #if CONFIG_EDIT_TABULATORS chrout_screen_TAB_FW: - rts + jmp chrout_screen_done chrout_screen_TAB_BW: - rts + jmp chrout_screen_done /* YYY disabled for rework chrout_screen_TAB_FW: diff --git a/c64/kernal/screen/e50a.plot.s b/c64/kernal/screen/e50a.plot.s index 627eced5..014c5c07 100644 --- a/c64/kernal/screen/e50a.plot.s +++ b/c64/kernal/screen/e50a.plot.s @@ -9,11 +9,8 @@ // -plot_set: - rts +PLOT: - -PLOT: /* YYY disabled for rework bcs plot_get // Note: the 'set' part has to start from $E50C, as this is a known address @@ -26,7 +23,7 @@ plot_set: sty PNTR stx TBLX - jsr screen_calculate_line_pointer + jsr screen_calculate_PNT_USER // FALLTROUGH to save one byte on RTS @@ -35,4 +32,3 @@ plot_get: ldy PNTR ldx TBLX rts -*/ \ No newline at end of file diff --git a/c64/kernal/screen/screen_advance_to_next_line.s b/c64/kernal/screen/screen_advance_to_next_line.s index 6c12dc63..b55f7018 100644 --- a/c64/kernal/screen/screen_advance_to_next_line.s +++ b/c64/kernal/screen/screen_advance_to_next_line.s @@ -2,50 +2,18 @@ screen_advance_to_next_line: - jmp screen_advance_to_next_line - -/* YYY disabled for rework - - // Go to start of line + // Go to start of the line lda #0 sta PNTR - // Advance line number + + // Check if we are at the bottom of the screen ldy TBLX + cpy #$24 + bne !+ - // Do quick fix to line pointer to work out if it is off - // the bottom of the screen. - ldx #40 - lda LDTBL,y - bmi !+ - .byte $2c -!: ldx #80 - txa - clc - adc PNT+0 - sta PNT+0 - lda PNT+1 - adc #0 - sta PNT+1 - - inc TBLX - - // Check if it will trigger scrolling - // Work out if we have gone off the bottom of the screen? - // 1040 > 1024, so if high byte of screen pointer is >= (HIBASE+4), - // then we are off the bottom of the screen - lda PNT+1 - sec - sbc HIBASE - cmp #3 - bcc !+ - lda PNT+0 - cmp #$e7 - bcc !+ - - // Off the bottom of the screen - jsr scroll_screen_up + // We need to scroll the screen up + jsr screen_scroll_up + skip_2_bytes_trash_nvz !: - + inc TBLX jmp chrout_screen_calc_lptr_done - -*/ diff --git a/c64/kernal/screen/screen_scroll_up_if_on_last_line.s b/c64/kernal/screen/screen_scroll_up_if_on_last_line.s index 30008068..42888bca 100644 --- a/c64/kernal/screen/screen_scroll_up_if_on_last_line.s +++ b/c64/kernal/screen/screen_scroll_up_if_on_last_line.s @@ -1,5 +1,8 @@ -/* YYY disabled for rework +screen_scroll_up: + rts + +/* YYY disabled for rework, add CTRL and NO_SCROLL support not_last_line: rts