From 6f7f6b5119344a4cb855b5ea0b849b96a91701a7 Mon Sep 17 00:00:00 2001 From: jede Date: Wed, 10 Jul 2019 21:44:07 +0200 Subject: [PATCH] Fix label, optimize code --- libsrc/telestrat/clrscr.s | 13 ++++++------- libsrc/telestrat/cputc.s | 2 +- libsrc/telestrat/gotoxy.s | 9 ++++++--- libsrc/telestrat/gotoy.s | 4 ---- libsrc/telestrat/textcolor.s | 4 ++-- 5 files changed, 15 insertions(+), 17 deletions(-) diff --git a/libsrc/telestrat/clrscr.s b/libsrc/telestrat/clrscr.s index a24647f86..22a880126 100644 --- a/libsrc/telestrat/clrscr.s +++ b/libsrc/telestrat/clrscr.s @@ -30,14 +30,13 @@ sta ADSCRH ; reset display position - lda #$01 - sta SCRY - lda #$00 - sta SCRX + ldx #$01 + stx SCRY + dex + stx SCRX - lda #$00 - sta CHARCOLOR_CHANGE - sta BGCOLOR_CHANGE + stx CHARCOLOR_CHANGE + stx BGCOLOR_CHANGE lda #$07 sta CHARCOLOR diff --git a/libsrc/telestrat/cputc.s b/libsrc/telestrat/cputc.s index 96763cafb..d313d7780 100644 --- a/libsrc/telestrat/cputc.s +++ b/libsrc/telestrat/cputc.s @@ -15,7 +15,7 @@ dec SCRX pha lda CHARCOLOR - BRK_TELEMON $4E ; Change color on the screen (foreground) + BRK_TELEMON XFWR ; Change color on the screen (foreground) lda #$00 sta CHARCOLOR_CHANGE inc SCRX diff --git a/libsrc/telestrat/gotoxy.s b/libsrc/telestrat/gotoxy.s index 8dcb69e89..7a53a77ab 100644 --- a/libsrc/telestrat/gotoxy.s +++ b/libsrc/telestrat/gotoxy.s @@ -23,14 +23,17 @@ gotoxy: jsr popa ; Get Y jsr update_adscr ; Update adress video ram position when SCRY et SCRX are modified ; Force to put again attribute when it moves on the screen - lda #$01 - sta CHARCOLOR_CHANGE - sta BGCOLOR_CHANGE + rts .endproc .proc update_adscr + + lda #$01 + sta CHARCOLOR_CHANGE + sta BGCOLOR_CHANGE + lda #