From 6f7f6b5119344a4cb855b5ea0b849b96a91701a7 Mon Sep 17 00:00:00 2001 From: jede Date: Wed, 10 Jul 2019 21:44:07 +0200 Subject: [PATCH 022/170] Fix label, optimize code --- libsrc/telestrat/clrscr.s | 15 +++++++-------- libsrc/telestrat/cputc.s | 2 +- libsrc/telestrat/gotoxy.s | 9 ++++++--- libsrc/telestrat/gotoy.s | 4 ---- libsrc/telestrat/textcolor.s | 4 ++-- 5 files changed, 16 insertions(+), 18 deletions(-) diff --git a/libsrc/telestrat/clrscr.s b/libsrc/telestrat/clrscr.s index a24647f8..22a88012 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 - - lda #$00 - sta CHARCOLOR_CHANGE - sta BGCOLOR_CHANGE + ldx #$01 + stx SCRY + dex + stx SCRX + + stx CHARCOLOR_CHANGE + stx BGCOLOR_CHANGE lda #$07 sta CHARCOLOR diff --git a/libsrc/telestrat/cputc.s b/libsrc/telestrat/cputc.s index 96763caf..d313d778 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 8dcb69e8..7a53a77a 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 #