Fix width calculation for bitmap font output. Use new 8x16 multiplication
routines to save some cycles. git-svn-id: svn://svn.cc65.org/cc65/trunk@5080 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -8,7 +8,7 @@
|
|||||||
.include "zeropage.inc"
|
.include "zeropage.inc"
|
||||||
|
|
||||||
.import _strlen, _toascii
|
.import _strlen, _toascii
|
||||||
.import umul16x16r32
|
.import umul8x16r16
|
||||||
|
|
||||||
;-----------------------------------------------------------------------------
|
;-----------------------------------------------------------------------------
|
||||||
; Aliases for zero page locations
|
; Aliases for zero page locations
|
||||||
@@ -36,12 +36,13 @@ Text := ptr3
|
|||||||
|
|
||||||
; Return the width of the string for the bitmap font
|
; Return the width of the string for the bitmap font
|
||||||
|
|
||||||
jsr _strlen
|
ldy _tgi_charwidth
|
||||||
sta ptr1
|
sta ptr1
|
||||||
stx ptr1+1
|
jsr _strlen
|
||||||
lda _tgi_charwidth
|
jsr umul8x16r16
|
||||||
ldx #0
|
ldy _tgi_textscalew+2 ; Get rounded scale factor
|
||||||
jmp umul16x16r32
|
sta ptr1
|
||||||
|
jmp umul8x16r16
|
||||||
|
|
||||||
; Return the width of the string for the vector font. To save some code, we
|
; Return the width of the string for the vector font. To save some code, we
|
||||||
; will add up all the character widths and then multiply by the scale factor.
|
; will add up all the character widths and then multiply by the scale factor.
|
||||||
@@ -77,7 +78,7 @@ Text := ptr3
|
|||||||
tay
|
tay
|
||||||
lda (WTab),y ; Get width of this char
|
lda (WTab),y ; Get width of this char
|
||||||
clc
|
clc
|
||||||
adc Width
|
adc Width
|
||||||
sta Width
|
sta Width
|
||||||
bcc @L3
|
bcc @L3
|
||||||
inc Width+1
|
inc Width+1
|
||||||
|
|||||||
Reference in New Issue
Block a user