1
0
mirror of https://github.com/cc65/cc65.git synced 2025-01-25 11:30:06 +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 sta ADSCRH
; reset display position ; reset display position
lda #$01 ldx #$01
sta SCRY stx SCRY
lda #$00 dex
sta SCRX stx SCRX
lda #$00 stx CHARCOLOR_CHANGE
sta CHARCOLOR_CHANGE stx BGCOLOR_CHANGE
sta BGCOLOR_CHANGE
lda #$07 lda #$07
sta CHARCOLOR sta CHARCOLOR

View File

@ -15,7 +15,7 @@
dec SCRX dec SCRX
pha pha
lda CHARCOLOR lda CHARCOLOR
BRK_TELEMON $4E ; Change color on the screen (foreground) BRK_TELEMON XFWR ; Change color on the screen (foreground)
lda #$00 lda #$00
sta CHARCOLOR_CHANGE sta CHARCOLOR_CHANGE
inc SCRX 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 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 ; Force to put again attribute when it moves on the screen
lda #$01
sta CHARCOLOR_CHANGE
sta BGCOLOR_CHANGE
rts rts
.endproc .endproc
.proc update_adscr .proc update_adscr
lda #$01
sta CHARCOLOR_CHANGE
sta BGCOLOR_CHANGE
lda #<SCREEN lda #<SCREEN
sta ADSCRL sta ADSCRL

View File

@ -2,7 +2,6 @@
; jede jede@oric.org 2017-02-25 ; jede jede@oric.org 2017-02-25
; ;
.export _gotoy .export _gotoy
.import CHARCOLOR_CHANGE, BGCOLOR_CHANGE
.import update_adscr .import update_adscr
@ -14,8 +13,5 @@
; We change the current line, it means that we need to put color attributes again. ; 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 ; 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 rts
.endproc .endproc

View File

@ -9,11 +9,11 @@
.proc _textcolor .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 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 bne out ; yes
ldy #$00 ldy #$00
sty CHARCOLOR_CHANGE sty CHARCOLOR_CHANGE
lda CHARCOLOR ; Return last color ; Return last color
rts rts
out: out: