From d31aed21b27fbda68abe088d657ba18455607cc4 Mon Sep 17 00:00:00 2001 From: mrb0nk500 Date: Mon, 17 Aug 2020 20:37:44 -0400 Subject: - Fixed some bugs in the emulator's assembler. - Simplified the effective address functions. - Made SuBEditor a bit faster. - JSR, and RTS now support using the RS prefix, which is used to specify the return address size, with an RS prefix of 0 being a return address size of 64 bits, rather than 8 bits. --- programs/sub-suite/subeditor.s | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) (limited to 'programs/sub-suite/subeditor.s') diff --git a/programs/sub-suite/subeditor.s b/programs/sub-suite/subeditor.s index 476f1cf..e624990 100644 --- a/programs/sub-suite/subeditor.s +++ b/programs/sub-suite/subeditor.s @@ -402,11 +402,12 @@ printc: @update1: jsr findend ; Find the end of the line. sta rege ; Use it for redrawing the line. - sta scr_row ; Set the row position to to the end of the line. - jsr findst ; Find the start of the line. - lda scr_row ; Get the start of the line. +; sta scr_row ; Set the row position to to the end of the line. +; jsr findst ; Find the start of the line. +; lda scr_row ; Get the start of the line. + lda scr_trow ; Get the current row position. @update2: - sta regf ; Set the starting line, to the start of the line. + sta regf ; Set the starting line, to the current row position. jsr rdrw_ln ; Redraw the line. lda scr_trow ; Get the real row position back. sta scr_row ; @@ -620,7 +621,9 @@ back: jsr update_pos ; and update it's position. rts ; We are done. @update: - lda scr_row ; Set the line to start redrawing, to the start of the line. + lda (ptr3), y ; Are we at the end of the line? + beq @shift ; Yes, so skip redrawing. + lda scr_trow ; No, so set the line to start redrawing, to the line that the cursor is on. sta regf ; inc rege ; Set the redraw flag to true. bra @shift ; Start shifting the line back. @@ -939,10 +942,21 @@ update_ptr: clc ; Clear the carry flag. lda scr_row ; Add the cursor's line number, adc scr_str ; with the starting line number to get the absolute line number. - tay ; Place it in the Y regster for now. mul #maxcol+1 ; Multiply the line number by the screen's max column count, plus 1. clc ; Clear the carry flag. adc scr_col ; Add the cursor's column number to get the screen index. +; cmp.w #$2000 ; Is the index greater than, or equal to the end of the screen buffer? +; bcc @end ; No, so we're done. +;@wrap: +; and #0 ; Reset the screen's starting line. +; sta scr_str ; +; sta regf ; Setup the starting line for rdrw_ln. +; lda #maxrow ; Reset the screen's ending line. +; sta scr_end ; +; sta rege ; Setup the ending line for rdrw_ln. +; jsr rdrw_ln ; Redraw the entire screen. +; bra update_ptr ; Get the screen index. +@end: rts ; End of update_ptr. -- cgit v1.2.3-13-gbd6f