diff --git a/c64/kernal/screen/chrout_screen.s b/c64/kernal/screen/chrout_screen.s index 81c00842..673fb4c3 100644 --- a/c64/kernal/screen/chrout_screen.s +++ b/c64/kernal/screen/chrout_screen.s @@ -100,36 +100,36 @@ chrout_screen_literal: lda COLOR sta (USER),y + // Advance the column - jmp !- - - - /* YYY disabled for rework - - // Advance the column, and scroll screen down if we need - // to insert a 2nd line in this logical line. - // (eg Compute's Mapping the 64 p41) - ldx TBLX + ldy PNTR iny sty PNTR + + // Scroll down (extend logical line) if needed + cpy #40 bne !+ jsr screen_grow_logical_line ldy PNTR !: + // If not the 80th character of the logical row, we are done + cpy #80 bcc chrout_screen_done + + // Advance to the next line + lda #0 sta PNTR - jmp chrout_screen_advance_to_next_line - + jmp screen_advance_to_next_line chrout_screen_calc_lptr_done: - jsr screen_calculate_line_pointer + jsr screen_calculate_PNT_USER // FALLTROUGH -*/ + chrout_screen_done: jsr cursor_show_if_enabled diff --git a/c64/kernal/screen/chrout_screen_advance_to_next_line.s b/c64/kernal/screen/screen_advance_to_next_line.s similarity index 94% rename from c64/kernal/screen/chrout_screen_advance_to_next_line.s rename to c64/kernal/screen/screen_advance_to_next_line.s index ee417668..fce5a5a5 100644 --- a/c64/kernal/screen/chrout_screen_advance_to_next_line.s +++ b/c64/kernal/screen/screen_advance_to_next_line.s @@ -1,8 +1,11 @@ + +screen_advance_to_next_line: +.break + rts + /* YYY disabled for rework -chrout_screen_advance_to_next_line: - // Go to start of line lda #0 sta PNTR diff --git a/c64/kernal/screen/screen_grow_logical_line.s b/c64/kernal/screen/screen_grow_logical_line.s index 59a49a09..49546a66 100644 --- a/c64/kernal/screen/screen_grow_logical_line.s +++ b/c64/kernal/screen/screen_grow_logical_line.s @@ -1,12 +1,16 @@ -/* YYY disabled for rework screen_grow_logical_line_done: rts + screen_grow_logical_line: - +.break + rts + +/* YYY disabled for rework + // Do not grow line if it is already grown ldy TBLX lda LDTBL,y