smol optimization by moving out a portion of a proc to a separate subroutine

This commit is contained in:
2023-06-03 23:27:06 -04:00
parent b97efd2f45
commit 790bfd51b5
6 changed files with 48 additions and 37 deletions
+1 -16
View File
@@ -1599,25 +1599,10 @@ NotHigher
; all text start from `talk` and end with an inverse.
; we go through the `talk`, count number of inverses.
; if equal to TextNumberOff, it is our text, printit
inverse_counter = temp+1
tya
tax ; save Y
mwa #0 inverse_counter
tay ; ldy #0
mwa #(talk-1) LineAddress4x4
@
inw LineAddress4x4
lda (LineAddress4x4),y
spl:inc inverse_counter
lda TextNumberOff
beq zeroth_talk ; special treatment of talk #0
cmp inverse_counter
bne @-
inw LineAddress4x4 ; we were pointing at the char with inverse, must go 1 further
zeroth_talk
jsr _calc_inverse_display
; now find length of the text
@