mirror of
https://github.com/blondie7575/GSCats.git
synced 2025-02-19 14:30:58 +00:00
Font rendering is now left justified
This commit is contained in:
parent
1d3bfeba8f
commit
080ab768b8
@ -158,6 +158,12 @@ def main(argv):
|
||||
print ("\tjmp renderCharJumpReturn_%s\n" % prefix)
|
||||
return
|
||||
|
||||
def scaleForFontWidth(charWidth):
|
||||
output = ""
|
||||
for i in range(0,(int)(charWidth/4)):
|
||||
output = output + "\tasl\n"
|
||||
return output
|
||||
|
||||
def addWrapperCode(prefix, charWidth, firstChar):
|
||||
code = """
|
||||
|
||||
@ -167,7 +173,7 @@ def addWrapperCode(prefix, charWidth, firstChar):
|
||||
; Draws a Pascal string for font "{:s}"
|
||||
;
|
||||
; PARAML0 = Pointer to string
|
||||
; Y = VRAM position of lower right corner of string at which to draw
|
||||
; Y = VRAM position of lower left corner of string at which to draw
|
||||
;
|
||||
; Trashes SCRATCHL,X,Y,A
|
||||
;
|
||||
@ -181,6 +187,13 @@ renderString_{:s}:
|
||||
BITS16
|
||||
phb
|
||||
|
||||
; Advance VRAM pointer to end of string
|
||||
{:s}
|
||||
clc
|
||||
adc SCRATCHL
|
||||
dec
|
||||
sta SCRATCHL
|
||||
|
||||
renderStringLoop_{:s}:
|
||||
|
||||
; Fetch and render next character in string
|
||||
@ -234,7 +247,7 @@ renderCharJumpReturn_{:s}: ; Compiled glyphs jump back here. Can't rts because s
|
||||
RESTORE_AXY
|
||||
rts
|
||||
|
||||
""".format(prefix,prefix,prefix,prefix,prefix,prefix,charWidth,prefix,prefix,prefix,prefix,prefix,firstChar,prefix,prefix)
|
||||
""".format(prefix,prefix,prefix,scaleForFontWidth(charWidth),prefix,prefix,prefix,charWidth,prefix,prefix,prefix,prefix,prefix,firstChar,prefix,prefix)
|
||||
print (code)
|
||||
return
|
||||
|
||||
|
17
fonts.s
17
fonts.s
@ -20,6 +20,14 @@ renderString_tinyNum:
|
||||
BITS16
|
||||
phb
|
||||
|
||||
; Advance VRAM pointer to end of string
|
||||
asl
|
||||
|
||||
clc
|
||||
adc SCRATCHL
|
||||
dec
|
||||
sta SCRATCHL
|
||||
|
||||
renderStringLoop_tinyNum:
|
||||
|
||||
; Fetch and render next character in string
|
||||
@ -647,6 +655,15 @@ renderString_font8:
|
||||
BITS16
|
||||
phb
|
||||
|
||||
; Advance VRAM pointer to end of string
|
||||
asl
|
||||
asl
|
||||
|
||||
clc
|
||||
adc SCRATCHL
|
||||
dec
|
||||
sta SCRATCHL
|
||||
|
||||
renderStringLoop_font8:
|
||||
|
||||
; Fetch and render next character in string
|
||||
|
@ -131,7 +131,7 @@ renderInventoryItem_unselected:
|
||||
; Render tiny numbers
|
||||
pla
|
||||
clc
|
||||
adc #6*160+4
|
||||
adc #6*160+2
|
||||
tay
|
||||
lda #intToStringPrefix
|
||||
sta PARAML0
|
||||
|
6
player.s
6
player.s
@ -438,7 +438,7 @@ renderPlayerHeader:
|
||||
adc #PD_NAME
|
||||
sta PARAML0
|
||||
phy
|
||||
ldy #$25c0
|
||||
ldy #$25a1
|
||||
lda #1
|
||||
jsl renderStringFar
|
||||
ply
|
||||
@ -456,12 +456,12 @@ renderPlayerHeader:
|
||||
; jsr DrawString
|
||||
|
||||
lda playerData+PD_TREATS,y
|
||||
ldx #$25f6
|
||||
ldx #$25f0
|
||||
jsr drawNumber
|
||||
|
||||
lda #treatsStr
|
||||
sta PARAML0
|
||||
ldy #$25f2
|
||||
ldy #$25d0
|
||||
lda #1
|
||||
jsl renderStringFar
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user