diff --git a/CompileFont.py b/CompileFont.py index 1596d22..197534f 100755 --- a/CompileFont.py +++ b/CompileFont.py @@ -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 diff --git a/fonts.s b/fonts.s index 0f0bc95..c263ce3 100644 --- a/fonts.s +++ b/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 diff --git a/inventory.s b/inventory.s index 965627f..55a340b 100644 --- a/inventory.s +++ b/inventory.s @@ -131,7 +131,7 @@ renderInventoryItem_unselected: ; Render tiny numbers pla clc - adc #6*160+4 + adc #6*160+2 tay lda #intToStringPrefix sta PARAML0 diff --git a/player.s b/player.s index cf483c6..bff8fcb 100644 --- a/player.s +++ b/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