1
0
mirror of https://github.com/cc65/cc65.git synced 2025-01-11 11:30:13 +00:00

Fix label, optimize code

This commit is contained in:
jede 2019-07-10 21:44:07 +02:00 committed by greg-king5
parent a0a6537bda
commit 6f7f6b5119
5 changed files with 15 additions and 17 deletions

View File

@ -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

View File

@ -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

View File

@ -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 #<SCREEN
sta ADSCRL

View File

@ -2,7 +2,6 @@
; jede jede@oric.org 2017-02-25
;
.export _gotoy
.import CHARCOLOR_CHANGE, BGCOLOR_CHANGE
.import update_adscr
@ -14,8 +13,5 @@
; We change the current line, it means that we need to put color attributes again.
; That is not the case with _gotox because, it's on the same line attribute are already set
lda #$01
sta CHARCOLOR_CHANGE
sta BGCOLOR_CHANGE
rts
.endproc

View File

@ -9,11 +9,11 @@
.proc _textcolor
cmp CHARCOLOR ; Do we set the same color? If we don't detect it, we loose one char on the screen for each textcolor call with the same color
bne out ; yes
ldy #$00
sty CHARCOLOR_CHANGE
lda CHARCOLOR ; Return last color
; Return last color
rts
out: