diff --git a/src/basic/basic_commands/cmd_go_goto_run.s b/src/basic/basic_commands/cmd_go_goto_run.s index 2600b80f..2665c9a6 100644 --- a/src/basic/basic_commands/cmd_go_goto_run.s +++ b/src/basic/basic_commands/cmd_go_goto_run.s @@ -50,7 +50,16 @@ cmd_go_syntax_error: jsr helper_ask_if_sure bcs cmd_go_rts jsr M65_MODE65 - jmp do_clr + // XXX test code, replace by jmp do_clr + + jsr do_clr + + lda #$41 + jsr JCHROUT +testx: + jmp testx + + !: jmp do_ILLEGAL_QUANTITY_error @@ -82,6 +91,8 @@ cmd_run: cmd_goto: // GOTO requires line number + // XXX in case of no parameter, go to line 0 - checked with original ROMs + jsr fetch_line_number #if !ROM_LAYOUT_M65 diff --git a/src/kernal/screen_m65/mega65_chrout_screen.s b/src/kernal/screen_m65/mega65_chrout_screen.s index 9998a91b..fa09e070 100644 --- a/src/kernal/screen_m65/mega65_chrout_screen.s +++ b/src/kernal/screen_m65/mega65_chrout_screen.s @@ -32,9 +32,65 @@ m65_chrout_screen_literal: // entry point for m65_chrout_screen_quote tax // store screen code, we need .A for calculations - // XXX continue the implementation + // Preserve .Z on stack, use it toi store screen columnt + phz + ldz M65__TXTCOL + // Start from setting M65_SCRSEG to point colour memory (starts from $FF80000) + lda #$0F + sta M65_SCRSEG+3 + lda #$F8 + sta M65_SCRSEG+2 + + lda M65_COLVIEW+1 + sta M65_SCRSEG+1 + lda M65_COLVIEW+0 + sta M65_SCRSEG+0 + + // Add screen row to the address + + ldy M65__TXTROW + clc + lda m65_scrtab_rowoffset_lo,y + adc M65_SCRSEG+0 + sta M65_SCRSEG+0 + lda m65_scrtab_rowoffset_hi,y + adc M65_SCRSEG+1 + sta M65_SCRSEG+1 + + // Store the new color in screen memory + + lda COLOR + sta_lp (M65_LPNT_SCR),z + + // Now change M65_LPNT_SCRb to point to screen memory + + // XXX deduplicate this part + lda M65_SCRSEG+1 + sta M65_LPNT_SCR+3 + lda M65_SCRSEG+0 + sta M65_LPNT_SCR+2 + + clc + lda M65_SCRBASE+0 + adc M65_LPNT_SCR+0 + sta M65_LPNT_SCR+0 + lda M65_SCRBASE+1 + adc M65_LPNT_SCR+1 + sta M65_LPNT_SCR+1 + + // Store the new character in screen memory, restore .Z + + txa + sta_lp (M65_LPNT_SCR),z + plz + + // Increment screen column by 1 + + inc M65__TXTCOL + + // XXX continue the implementation - fix the cursor position rts diff --git a/src/kernal/screen_m65/mega65_clrscr.s b/src/kernal/screen_m65/mega65_clrscr.s index 4a109977..6c252914 100644 --- a/src/kernal/screen_m65/mega65_clrscr.s +++ b/src/kernal/screen_m65/mega65_clrscr.s @@ -23,7 +23,7 @@ m65_clrscr_takeover: // - M65_SCRVIEW, M65_COLVIEW // To clear the screen, two zeropage long pointers will be used, initialize them too // - M65_LPNT_SCR for screen memory - // - M65_LPNT_KERN for colour memory (starts from $FF80000) + // - M65_LPNT_KERN for colour memory (starts from $FF80000) // XXX preserve this on stack, restore afterwards sta M65_COLVIEW+0 sta M65_COLVIEW+1 diff --git a/src/kernal/screen_m65/mega65_clrwin.s b/src/kernal/screen_m65/mega65_clrwin.s index fdd782b9..34d88a3c 100644 --- a/src/kernal/screen_m65/mega65_clrwin.s +++ b/src/kernal/screen_m65/mega65_clrwin.s @@ -18,7 +18,7 @@ M65_CLRWIN: // To clear the window, two zeropage long pointers will be used: // - M65_LPNT_SCR for screen memory - // - M65_LPNT_KERN for colour memory (starts from $FF80000) + // - M65_LPNT_KERN for colour memory (starts from $FF80000) // XXX preserve this on stack, restore afterwards // First initialize both pointers