Text operations speedup

This commit is contained in:
Pecusx
2023-06-06 15:20:07 +02:00
parent f2826159c4
commit 7b0f87cf60
3 changed files with 21 additions and 11 deletions
+20 -10
View File
@@ -2026,7 +2026,7 @@ AngleDisplay
; nr of weapon in A, address to put in weaponPointer ; nr of weapon in A, address to put in weaponPointer
@weapon_index = TextNumberOff @weapon_index = TextNumberOff
sta @weapon_index ;get back number of the weapon sta @weapon_index ;get back number of the weapon
mwa #(NamesOfWeapons-1) LineAddress4x4 mwa #NamesOfWeapons LineAddress4x4
jsr _calc_inverse_display jsr _calc_inverse_display
; now copy text to screen ; now copy text to screen
dey ; ldy #-1 dey ; ldy #-1
@@ -2038,9 +2038,9 @@ AngleDisplay
and #%01111111 ; remove reverse and #%01111111 ; remove reverse
clearingOnly clearingOnly
sta (weaponPointer),y sta (weaponPointer),y
lda #0 ; clean the rest ; lda #0 ; clean the rest
iny:cpy #16 ; weapon name is max 16 chars ; iny:cpy #16 ; weapon name is max 16 chars
bne clearingonly ; bne clearingonly
rts rts
.endp .endp
;------------------------------------------------- ;-------------------------------------------------
@@ -2050,19 +2050,29 @@ clearingOnly
@weapon_index = TextNumberOff @weapon_index = TextNumberOff
@inverse_counter = temp+1 @inverse_counter = temp+1
mwa #0 @inverse_counter mva #0 @inverse_counter
tay ; ldy #0 ldy LineAddress4x4 ; lower byte to Y
@ sta LineAddress4x4 ; #0
inw LineAddress4x4 loop
lda (LineAddress4x4),y lda (LineAddress4x4),y
spl:inc @inverse_counter spl:inc @inverse_counter
lda @weapon_index lda @weapon_index
beq zeroth_talk ; special treatment of talk #0 beq zeroth_talk ; special treatment of talk #0
cmp @inverse_counter cmp @inverse_counter
bne @- beq lets_talk
iny
bne loop
inc LineAddress4x4+1
bne loop
inw LineAddress4x4 ; we were pointing at the char with inverse, must go 1 further lets_talk
iny
bne @+
inc LineAddress4x4+1
@
zeroth_talk zeroth_talk
sty LineAddress4x4
ldy #0
rts rts
.endp .endp
+1 -1
View File
@@ -1604,7 +1604,7 @@ notZero
sta plot4x4color sta plot4x4color
tya tya
tax ; save Y tax ; save Y
mwa #(talk-1) LineAddress4x4 mwa #talk LineAddress4x4
jsr _calc_inverse_display jsr _calc_inverse_display
; now find length of the text ; now find length of the text
BIN
View File
Binary file not shown.