mirror of
https://github.com/blondie7575/GSCats.git
synced 2024-06-07 21:29:31 +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)
|
print ("\tjmp renderCharJumpReturn_%s\n" % prefix)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
def scaleForFontWidth(charWidth):
|
||||||
|
output = ""
|
||||||
|
for i in range(0,(int)(charWidth/4)):
|
||||||
|
output = output + "\tasl\n"
|
||||||
|
return output
|
||||||
|
|
||||||
def addWrapperCode(prefix, charWidth, firstChar):
|
def addWrapperCode(prefix, charWidth, firstChar):
|
||||||
code = """
|
code = """
|
||||||
|
|
||||||
|
@ -167,7 +173,7 @@ def addWrapperCode(prefix, charWidth, firstChar):
|
||||||
; Draws a Pascal string for font "{:s}"
|
; Draws a Pascal string for font "{:s}"
|
||||||
;
|
;
|
||||||
; PARAML0 = Pointer to string
|
; 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
|
; Trashes SCRATCHL,X,Y,A
|
||||||
;
|
;
|
||||||
|
@ -181,6 +187,13 @@ renderString_{:s}:
|
||||||
BITS16
|
BITS16
|
||||||
phb
|
phb
|
||||||
|
|
||||||
|
; Advance VRAM pointer to end of string
|
||||||
|
{:s}
|
||||||
|
clc
|
||||||
|
adc SCRATCHL
|
||||||
|
dec
|
||||||
|
sta SCRATCHL
|
||||||
|
|
||||||
renderStringLoop_{:s}:
|
renderStringLoop_{:s}:
|
||||||
|
|
||||||
; Fetch and render next character in string
|
; 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
|
RESTORE_AXY
|
||||||
rts
|
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)
|
print (code)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
17
fonts.s
17
fonts.s
|
@ -20,6 +20,14 @@ renderString_tinyNum:
|
||||||
BITS16
|
BITS16
|
||||||
phb
|
phb
|
||||||
|
|
||||||
|
; Advance VRAM pointer to end of string
|
||||||
|
asl
|
||||||
|
|
||||||
|
clc
|
||||||
|
adc SCRATCHL
|
||||||
|
dec
|
||||||
|
sta SCRATCHL
|
||||||
|
|
||||||
renderStringLoop_tinyNum:
|
renderStringLoop_tinyNum:
|
||||||
|
|
||||||
; Fetch and render next character in string
|
; Fetch and render next character in string
|
||||||
|
@ -647,6 +655,15 @@ renderString_font8:
|
||||||
BITS16
|
BITS16
|
||||||
phb
|
phb
|
||||||
|
|
||||||
|
; Advance VRAM pointer to end of string
|
||||||
|
asl
|
||||||
|
asl
|
||||||
|
|
||||||
|
clc
|
||||||
|
adc SCRATCHL
|
||||||
|
dec
|
||||||
|
sta SCRATCHL
|
||||||
|
|
||||||
renderStringLoop_font8:
|
renderStringLoop_font8:
|
||||||
|
|
||||||
; Fetch and render next character in string
|
; Fetch and render next character in string
|
||||||
|
|
|
@ -131,7 +131,7 @@ renderInventoryItem_unselected:
|
||||||
; Render tiny numbers
|
; Render tiny numbers
|
||||||
pla
|
pla
|
||||||
clc
|
clc
|
||||||
adc #6*160+4
|
adc #6*160+2
|
||||||
tay
|
tay
|
||||||
lda #intToStringPrefix
|
lda #intToStringPrefix
|
||||||
sta PARAML0
|
sta PARAML0
|
||||||
|
|
6
player.s
6
player.s
|
@ -438,7 +438,7 @@ renderPlayerHeader:
|
||||||
adc #PD_NAME
|
adc #PD_NAME
|
||||||
sta PARAML0
|
sta PARAML0
|
||||||
phy
|
phy
|
||||||
ldy #$25c0
|
ldy #$25a1
|
||||||
lda #1
|
lda #1
|
||||||
jsl renderStringFar
|
jsl renderStringFar
|
||||||
ply
|
ply
|
||||||
|
@ -456,12 +456,12 @@ renderPlayerHeader:
|
||||||
; jsr DrawString
|
; jsr DrawString
|
||||||
|
|
||||||
lda playerData+PD_TREATS,y
|
lda playerData+PD_TREATS,y
|
||||||
ldx #$25f6
|
ldx #$25f0
|
||||||
jsr drawNumber
|
jsr drawNumber
|
||||||
|
|
||||||
lda #treatsStr
|
lda #treatsStr
|
||||||
sta PARAML0
|
sta PARAML0
|
||||||
ldy #$25f2
|
ldy #$25d0
|
||||||
lda #1
|
lda #1
|
||||||
jsl renderStringFar
|
jsl renderStringFar
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user