Added support for arbitrarily wide and tall tiles

* common usage is probably 2x2 tiles, but can handle bigger
This commit is contained in:
Rob McMullen 2018-07-24 19:20:14 -07:00
parent c7601f83a0
commit 35a33f86e1
10 changed files with 3291 additions and 230 deletions

View File

@ -934,15 +934,16 @@ class BackingStoreDriver(Listing):
class FastFont(Listing):
def __init__(self, assembler, screen, font, double_buffer):
def __init__(self, assembler, screen, font, double_buffer, byte_width=1, byte_height=8):
Listing.__init__(self, assembler)
self.slug = "fastfont"
self.generate_table(screen, "H1", 0x2000)
self.row_slug = "TransposedFontRow"
self.generate_table(screen, "H1", 0x2000, byte_width, byte_height)
if double_buffer:
self.generate_table(screen, "H2", 0x4000)
self.generate_transposed_font(screen, font)
self.generate_table(screen, "H2", 0x4000, byte_width, byte_height)
self.generate_transposed_font(screen, font, byte_width, byte_height)
def generate_table(self, screen, suffix, hgrbase):
def generate_table(self, screen, suffix, hgrbase, byte_width, byte_height):
label = "FASTFONT_%s" % suffix
self.label(label)
@ -950,46 +951,51 @@ class FastFont(Listing):
# taking the hi/lo bytes of an address - 1
self.comment("A = character, X = column, Y = row; A is clobbered, X&Y are not")
self.asm("pha")
self.asm("lda %s_JMP_HI,y" % label)
self.asm("sta %s_JMP+2" % label)
self.asm("lda %s_JMP_LO,y" % label)
self.asm("sta %s_JMP+1" % label)
self.asm(f"lda {label}_JMP_HI,y")
self.asm(f"sta {label}_JMP+2")
self.asm(f"lda {label}_JMP_LO,y")
self.asm(f"sta {label}_JMP+1")
self.asm("sty scratch_0")
self.asm("pla")
self.asm("tay")
self.label("%s_JMP" % label)
self.label(f"{label}_JMP")
self.asm("jmp $ffff\n")
num_rows = screen.screen_height // byte_height
# Bit-shift jump table for generic 6502
self.out()
self.label("%s_JMP_HI" % label)
for r in range(24):
self.asm(".byte >%s_%d" % (label, r))
self.label("%s_JMP_LO" % label)
for r in range(24):
self.asm(".byte <%s_%d" % (label, r))
self.label(f"{label}_JMP_HI")
for r in range(num_rows):
self.asm(f".byte >{label}_{r}")
self.label(f"{label}_JMP_LO")
for r in range(num_rows):
self.asm(f".byte <{label}_{r}")
self.out()
hgr1 = screen.generate_row_addresses(hgrbase)
for r in range(24):
self.label("%s_%d" % (label, r))
for i in range(8):
self.asm("lda TransposedFontRow%d,y" % i)
self.asm("sta $%04x,x" % (hgr1[r*8 + i]))
for r in range(num_rows):
self.label(f"{label}_{r}")
for b in range(byte_width):
for h in range(byte_height):
self.asm(f"lda {self.row_slug}{b}_{h},y")
self.asm("sta $%04x,x" % (hgr1[r*byte_height + h] + b))
self.asm("ldy scratch_0")
self.asm("rts")
self.out()
def generate_transposed_font(self, screen, font):
def generate_transposed_font(self, screen, font, byte_width, byte_height):
with open(font, 'rb') as fh:
data = fh.read()
num_bytes = len(data)
num_chars = num_bytes // 8
for r in range(8):
self.label("TransposedFontRow%d" % r)
for i in range(num_chars):
index = i * 8 + r
self.byte("$%02x" % data[index], 16)
char_size = byte_height * byte_width
num_chars = num_bytes // char_size
for h in range(byte_height):
for b in range(byte_width):
self.label(f"{self.row_slug}{b}_{h}")
for i in range(num_chars):
index = i * char_size + (h * byte_width + b)
self.byte("$%02x" % data[index], 16)
class CompiledFastFont(Listing):
@ -1522,6 +1528,7 @@ if __name__ == "__main__":
parser.add_argument("-d", "--double-buffer", action="store_true", default=False, help="add code blit to either page (default: page 1 only)")
parser.add_argument("-g", "--damage", action="store_true", default=False, help="add code to report size of sprite upon return. Can be used in a damage list to restore an area from a pristine source.")
parser.add_argument("-f", "--font", action="store", default="", help="generate a fast font blitter for text on the hgr screen using the specified binary font file")
parser.add_argument("--font-size", "--fs", action="store", default="1x8", help="specify font dimensions in bytes (default: %(default)s)")
parser.add_argument("--compiled-font", action="store", default="", help="generate a font-compiled fairly fast font blitter for text on the hgr screen using the specified binary font file")
parser.add_argument("-o", "--output-prefix", default="", help="Base name to create a set of output files. If not supplied, all code will be sent to stdout.")
parser.add_argument("files", metavar="IMAGE", nargs="*", help="a PNG image [or a list of them]. PNG files must not have an alpha channel!")
@ -1603,8 +1610,16 @@ if __name__ == "__main__":
if options.cols:
listings.append(ColLookup(assembler, screen))
if options.font_size:
w, h = options.font_size.lower().split("x", 1)
w = int(w)
h = int(h)
else:
w = 1
h = 8
if options.font:
listings.append(FastFont(assembler, screen, options.font, options.double_buffer))
listings.append(FastFont(assembler, screen, options.font, options.double_buffer, w, h))
if options.compiled_font:
listings.append(CompiledFastFont(assembler, screen, options.compiled_font, options.double_buffer))

View File

@ -3,7 +3,7 @@ ASSEMBLER = "mac65"
ASMGEN = python ../../asmgen.py
TARGETS = TEST1A.BIN TEST1B.BIN TEST1C.BIN TEST1D.BIN TEST2.BIN test3--transposed_font.s TEST3.BIN
TARGETS = TEST1A.BIN TEST1B.BIN TEST1C.BIN TEST1D.BIN TEST2.BIN test3--transposed_font.s TEST3.BIN tiles2x2a.s TILES2X2A.BIN tiles4x4a.s TILES4X4A.BIN
all: $(TARGETS)
@ -50,5 +50,23 @@ TEST3.BIN: driver.s test3--transposed_font.s
atrcopy . assemble -f -s temp.s -r 0x5000 -o $@
atrcopy asmsgen_font_compare.dsk add $@ -f
tiles2x2a.s: ../../tiles/tiles_ramp_2x2.dat
$(ASMGEN) -a $(ASSEMBLER) -f ../../tiles/tiles_ramp_2x2.dat --fs 2x16 > tiles2x2a.s
TILES2X2A.BIN: driver_2x2_tiles.s tiles2x2a.s
rm -f $@
cat $^ > temp.s
atrcopy . assemble -f -s temp.s -r 0x5000 -o $@
atrcopy asmsgen_font_compare.dsk add $@ -f
tiles4x4a.s: ../../tiles/tiles_ramp_4x4.dat
$(ASMGEN) -a $(ASSEMBLER) -f ../../tiles/tiles_ramp_4x4.dat --fs 4x32 > tiles4x4a.s
TILES4X4A.BIN: driver_4x4_tiles.s tiles4x4a.s
rm -f $@
cat $^ > temp.s
atrcopy . assemble -f -s temp.s -r 0x5000 -o $@
atrcopy asmsgen_font_compare.dsk add $@ -f
clean:
rm -f asmsgen_font_compare.dsk $(TARGETS) temp.s temp.s.lst temp.s.err

View File

@ -0,0 +1,111 @@
*= $0006
FIRST_CHAR_OF_SCREEN .ds 1
FIRST_CHAR_OF_LINE .ds 1
CURRENT_CHAR .ds 1
FRAME_COUNT .ds 1
*= $00eb
hgr_ptr .ds 2
font_ptr .ds 2
*= $00fa
scratch_0 .ds 1
scratch_x .ds 1
scratch_y .ds 1
*= $5000
start_set
jsr set_hires
jsr clrscr
jsr driver
jsr set_text
rts
brk
driver
lda #$00
sta FIRST_CHAR_OF_SCREEN
lda #64
sta FRAME_COUNT
page_loop
jsr page
dec FRAME_COUNT
bne page_loop
rts
; os memory map
KEYBOARD = $c000
KBDSTROBE = $c010
CLRTEXT = $c050
SETTEXT = $c051
CLRMIXED = $c052
SETMIXED = $c053
TXTPAGE1 = $c054
TXTPAGE2 = $c055
CLRHIRES = $c056
SETHIRES = $c057
set_hires bit CLRTEXT ; start with HGR page 1, full screen
bit CLRMIXED
bit TXTPAGE1
bit SETHIRES
rts
set_text bit SETTEXT
bit CLRMIXED
bit TXTPAGE1
bit CLRHIRES
rts
; clear hires page 1 only
clrscr lda #$20
sta clrscr_smc+2
lda #0
ldy #0
clrscr_smc sta $ff00,y
iny
bne clrscr_smc
inc clrscr_smc+2
ldx clrscr_smc+2
cpx #$40
bcc clrscr_smc
rts
*= $5074
page
inc FIRST_CHAR_OF_SCREEN
lda FIRST_CHAR_OF_SCREEN
sta FIRST_CHAR_OF_LINE
ldy #$00
line_loop
ldx #$00
lda FIRST_CHAR_OF_LINE
sta CURRENT_CHAR
char_loop
lda CURRENT_CHAR
jsr font_test
inc CURRENT_CHAR
lda CURRENT_CHAR
and #$1f
sta CURRENT_CHAR
inx
inx
cpx #40
bcc char_loop
inc FIRST_CHAR_OF_LINE
iny
cpy #12
bcc line_loop
rts
font_test

View File

@ -0,0 +1,113 @@
*= $0006
FIRST_CHAR_OF_SCREEN .ds 1
FIRST_CHAR_OF_LINE .ds 1
CURRENT_CHAR .ds 1
FRAME_COUNT .ds 1
*= $00eb
hgr_ptr .ds 2
font_ptr .ds 2
*= $00fa
scratch_0 .ds 1
scratch_x .ds 1
scratch_y .ds 1
*= $5000
start_set
jsr set_hires
jsr clrscr
jsr driver
jsr set_text
rts
brk
driver
lda #$00
sta FIRST_CHAR_OF_SCREEN
lda #64
sta FRAME_COUNT
page_loop
jsr page
dec FRAME_COUNT
bne page_loop
rts
; os memory map
KEYBOARD = $c000
KBDSTROBE = $c010
CLRTEXT = $c050
SETTEXT = $c051
CLRMIXED = $c052
SETMIXED = $c053
TXTPAGE1 = $c054
TXTPAGE2 = $c055
CLRHIRES = $c056
SETHIRES = $c057
set_hires bit CLRTEXT ; start with HGR page 1, full screen
bit CLRMIXED
bit TXTPAGE1
bit SETHIRES
rts
set_text bit SETTEXT
bit CLRMIXED
bit TXTPAGE1
bit CLRHIRES
rts
; clear hires page 1 only
clrscr lda #$20
sta clrscr_smc+2
lda #0
ldy #0
clrscr_smc sta $ff00,y
iny
bne clrscr_smc
inc clrscr_smc+2
ldx clrscr_smc+2
cpx #$40
bcc clrscr_smc
rts
*= $5074
page
inc FIRST_CHAR_OF_SCREEN
lda FIRST_CHAR_OF_SCREEN
sta FIRST_CHAR_OF_LINE
ldy #$00
line_loop
ldx #$00
lda FIRST_CHAR_OF_LINE
sta CURRENT_CHAR
char_loop
lda CURRENT_CHAR
jsr font_test
inc CURRENT_CHAR
lda CURRENT_CHAR
and #$0f
sta CURRENT_CHAR
inx
inx
inx
inx
cpx #40
bcc char_loop
inc FIRST_CHAR_OF_LINE
iny
cpy #6
bcc line_loop
rts
font_test

View File

@ -74,463 +74,463 @@ FASTFONT_H1_JMP_LO
.byte <FASTFONT_H1_23
FASTFONT_H1_0
lda TransposedFontRow0,y
lda TransposedFontRow0_0,y
sta $2000,x
lda TransposedFontRow1,y
lda TransposedFontRow0_1,y
sta $2400,x
lda TransposedFontRow2,y
lda TransposedFontRow0_2,y
sta $2800,x
lda TransposedFontRow3,y
lda TransposedFontRow0_3,y
sta $2c00,x
lda TransposedFontRow4,y
lda TransposedFontRow0_4,y
sta $3000,x
lda TransposedFontRow5,y
lda TransposedFontRow0_5,y
sta $3400,x
lda TransposedFontRow6,y
lda TransposedFontRow0_6,y
sta $3800,x
lda TransposedFontRow7,y
lda TransposedFontRow0_7,y
sta $3c00,x
ldy scratch_0
rts
FASTFONT_H1_1
lda TransposedFontRow0,y
lda TransposedFontRow0_0,y
sta $2080,x
lda TransposedFontRow1,y
lda TransposedFontRow0_1,y
sta $2480,x
lda TransposedFontRow2,y
lda TransposedFontRow0_2,y
sta $2880,x
lda TransposedFontRow3,y
lda TransposedFontRow0_3,y
sta $2c80,x
lda TransposedFontRow4,y
lda TransposedFontRow0_4,y
sta $3080,x
lda TransposedFontRow5,y
lda TransposedFontRow0_5,y
sta $3480,x
lda TransposedFontRow6,y
lda TransposedFontRow0_6,y
sta $3880,x
lda TransposedFontRow7,y
lda TransposedFontRow0_7,y
sta $3c80,x
ldy scratch_0
rts
FASTFONT_H1_2
lda TransposedFontRow0,y
lda TransposedFontRow0_0,y
sta $2100,x
lda TransposedFontRow1,y
lda TransposedFontRow0_1,y
sta $2500,x
lda TransposedFontRow2,y
lda TransposedFontRow0_2,y
sta $2900,x
lda TransposedFontRow3,y
lda TransposedFontRow0_3,y
sta $2d00,x
lda TransposedFontRow4,y
lda TransposedFontRow0_4,y
sta $3100,x
lda TransposedFontRow5,y
lda TransposedFontRow0_5,y
sta $3500,x
lda TransposedFontRow6,y
lda TransposedFontRow0_6,y
sta $3900,x
lda TransposedFontRow7,y
lda TransposedFontRow0_7,y
sta $3d00,x
ldy scratch_0
rts
FASTFONT_H1_3
lda TransposedFontRow0,y
lda TransposedFontRow0_0,y
sta $2180,x
lda TransposedFontRow1,y
lda TransposedFontRow0_1,y
sta $2580,x
lda TransposedFontRow2,y
lda TransposedFontRow0_2,y
sta $2980,x
lda TransposedFontRow3,y
lda TransposedFontRow0_3,y
sta $2d80,x
lda TransposedFontRow4,y
lda TransposedFontRow0_4,y
sta $3180,x
lda TransposedFontRow5,y
lda TransposedFontRow0_5,y
sta $3580,x
lda TransposedFontRow6,y
lda TransposedFontRow0_6,y
sta $3980,x
lda TransposedFontRow7,y
lda TransposedFontRow0_7,y
sta $3d80,x
ldy scratch_0
rts
FASTFONT_H1_4
lda TransposedFontRow0,y
lda TransposedFontRow0_0,y
sta $2200,x
lda TransposedFontRow1,y
lda TransposedFontRow0_1,y
sta $2600,x
lda TransposedFontRow2,y
lda TransposedFontRow0_2,y
sta $2a00,x
lda TransposedFontRow3,y
lda TransposedFontRow0_3,y
sta $2e00,x
lda TransposedFontRow4,y
lda TransposedFontRow0_4,y
sta $3200,x
lda TransposedFontRow5,y
lda TransposedFontRow0_5,y
sta $3600,x
lda TransposedFontRow6,y
lda TransposedFontRow0_6,y
sta $3a00,x
lda TransposedFontRow7,y
lda TransposedFontRow0_7,y
sta $3e00,x
ldy scratch_0
rts
FASTFONT_H1_5
lda TransposedFontRow0,y
lda TransposedFontRow0_0,y
sta $2280,x
lda TransposedFontRow1,y
lda TransposedFontRow0_1,y
sta $2680,x
lda TransposedFontRow2,y
lda TransposedFontRow0_2,y
sta $2a80,x
lda TransposedFontRow3,y
lda TransposedFontRow0_3,y
sta $2e80,x
lda TransposedFontRow4,y
lda TransposedFontRow0_4,y
sta $3280,x
lda TransposedFontRow5,y
lda TransposedFontRow0_5,y
sta $3680,x
lda TransposedFontRow6,y
lda TransposedFontRow0_6,y
sta $3a80,x
lda TransposedFontRow7,y
lda TransposedFontRow0_7,y
sta $3e80,x
ldy scratch_0
rts
FASTFONT_H1_6
lda TransposedFontRow0,y
lda TransposedFontRow0_0,y
sta $2300,x
lda TransposedFontRow1,y
lda TransposedFontRow0_1,y
sta $2700,x
lda TransposedFontRow2,y
lda TransposedFontRow0_2,y
sta $2b00,x
lda TransposedFontRow3,y
lda TransposedFontRow0_3,y
sta $2f00,x
lda TransposedFontRow4,y
lda TransposedFontRow0_4,y
sta $3300,x
lda TransposedFontRow5,y
lda TransposedFontRow0_5,y
sta $3700,x
lda TransposedFontRow6,y
lda TransposedFontRow0_6,y
sta $3b00,x
lda TransposedFontRow7,y
lda TransposedFontRow0_7,y
sta $3f00,x
ldy scratch_0
rts
FASTFONT_H1_7
lda TransposedFontRow0,y
lda TransposedFontRow0_0,y
sta $2380,x
lda TransposedFontRow1,y
lda TransposedFontRow0_1,y
sta $2780,x
lda TransposedFontRow2,y
lda TransposedFontRow0_2,y
sta $2b80,x
lda TransposedFontRow3,y
lda TransposedFontRow0_3,y
sta $2f80,x
lda TransposedFontRow4,y
lda TransposedFontRow0_4,y
sta $3380,x
lda TransposedFontRow5,y
lda TransposedFontRow0_5,y
sta $3780,x
lda TransposedFontRow6,y
lda TransposedFontRow0_6,y
sta $3b80,x
lda TransposedFontRow7,y
lda TransposedFontRow0_7,y
sta $3f80,x
ldy scratch_0
rts
FASTFONT_H1_8
lda TransposedFontRow0,y
lda TransposedFontRow0_0,y
sta $2028,x
lda TransposedFontRow1,y
lda TransposedFontRow0_1,y
sta $2428,x
lda TransposedFontRow2,y
lda TransposedFontRow0_2,y
sta $2828,x
lda TransposedFontRow3,y
lda TransposedFontRow0_3,y
sta $2c28,x
lda TransposedFontRow4,y
lda TransposedFontRow0_4,y
sta $3028,x
lda TransposedFontRow5,y
lda TransposedFontRow0_5,y
sta $3428,x
lda TransposedFontRow6,y
lda TransposedFontRow0_6,y
sta $3828,x
lda TransposedFontRow7,y
lda TransposedFontRow0_7,y
sta $3c28,x
ldy scratch_0
rts
FASTFONT_H1_9
lda TransposedFontRow0,y
lda TransposedFontRow0_0,y
sta $20a8,x
lda TransposedFontRow1,y
lda TransposedFontRow0_1,y
sta $24a8,x
lda TransposedFontRow2,y
lda TransposedFontRow0_2,y
sta $28a8,x
lda TransposedFontRow3,y
lda TransposedFontRow0_3,y
sta $2ca8,x
lda TransposedFontRow4,y
lda TransposedFontRow0_4,y
sta $30a8,x
lda TransposedFontRow5,y
lda TransposedFontRow0_5,y
sta $34a8,x
lda TransposedFontRow6,y
lda TransposedFontRow0_6,y
sta $38a8,x
lda TransposedFontRow7,y
lda TransposedFontRow0_7,y
sta $3ca8,x
ldy scratch_0
rts
FASTFONT_H1_10
lda TransposedFontRow0,y
lda TransposedFontRow0_0,y
sta $2128,x
lda TransposedFontRow1,y
lda TransposedFontRow0_1,y
sta $2528,x
lda TransposedFontRow2,y
lda TransposedFontRow0_2,y
sta $2928,x
lda TransposedFontRow3,y
lda TransposedFontRow0_3,y
sta $2d28,x
lda TransposedFontRow4,y
lda TransposedFontRow0_4,y
sta $3128,x
lda TransposedFontRow5,y
lda TransposedFontRow0_5,y
sta $3528,x
lda TransposedFontRow6,y
lda TransposedFontRow0_6,y
sta $3928,x
lda TransposedFontRow7,y
lda TransposedFontRow0_7,y
sta $3d28,x
ldy scratch_0
rts
FASTFONT_H1_11
lda TransposedFontRow0,y
lda TransposedFontRow0_0,y
sta $21a8,x
lda TransposedFontRow1,y
lda TransposedFontRow0_1,y
sta $25a8,x
lda TransposedFontRow2,y
lda TransposedFontRow0_2,y
sta $29a8,x
lda TransposedFontRow3,y
lda TransposedFontRow0_3,y
sta $2da8,x
lda TransposedFontRow4,y
lda TransposedFontRow0_4,y
sta $31a8,x
lda TransposedFontRow5,y
lda TransposedFontRow0_5,y
sta $35a8,x
lda TransposedFontRow6,y
lda TransposedFontRow0_6,y
sta $39a8,x
lda TransposedFontRow7,y
lda TransposedFontRow0_7,y
sta $3da8,x
ldy scratch_0
rts
FASTFONT_H1_12
lda TransposedFontRow0,y
lda TransposedFontRow0_0,y
sta $2228,x
lda TransposedFontRow1,y
lda TransposedFontRow0_1,y
sta $2628,x
lda TransposedFontRow2,y
lda TransposedFontRow0_2,y
sta $2a28,x
lda TransposedFontRow3,y
lda TransposedFontRow0_3,y
sta $2e28,x
lda TransposedFontRow4,y
lda TransposedFontRow0_4,y
sta $3228,x
lda TransposedFontRow5,y
lda TransposedFontRow0_5,y
sta $3628,x
lda TransposedFontRow6,y
lda TransposedFontRow0_6,y
sta $3a28,x
lda TransposedFontRow7,y
lda TransposedFontRow0_7,y
sta $3e28,x
ldy scratch_0
rts
FASTFONT_H1_13
lda TransposedFontRow0,y
lda TransposedFontRow0_0,y
sta $22a8,x
lda TransposedFontRow1,y
lda TransposedFontRow0_1,y
sta $26a8,x
lda TransposedFontRow2,y
lda TransposedFontRow0_2,y
sta $2aa8,x
lda TransposedFontRow3,y
lda TransposedFontRow0_3,y
sta $2ea8,x
lda TransposedFontRow4,y
lda TransposedFontRow0_4,y
sta $32a8,x
lda TransposedFontRow5,y
lda TransposedFontRow0_5,y
sta $36a8,x
lda TransposedFontRow6,y
lda TransposedFontRow0_6,y
sta $3aa8,x
lda TransposedFontRow7,y
lda TransposedFontRow0_7,y
sta $3ea8,x
ldy scratch_0
rts
FASTFONT_H1_14
lda TransposedFontRow0,y
lda TransposedFontRow0_0,y
sta $2328,x
lda TransposedFontRow1,y
lda TransposedFontRow0_1,y
sta $2728,x
lda TransposedFontRow2,y
lda TransposedFontRow0_2,y
sta $2b28,x
lda TransposedFontRow3,y
lda TransposedFontRow0_3,y
sta $2f28,x
lda TransposedFontRow4,y
lda TransposedFontRow0_4,y
sta $3328,x
lda TransposedFontRow5,y
lda TransposedFontRow0_5,y
sta $3728,x
lda TransposedFontRow6,y
lda TransposedFontRow0_6,y
sta $3b28,x
lda TransposedFontRow7,y
lda TransposedFontRow0_7,y
sta $3f28,x
ldy scratch_0
rts
FASTFONT_H1_15
lda TransposedFontRow0,y
lda TransposedFontRow0_0,y
sta $23a8,x
lda TransposedFontRow1,y
lda TransposedFontRow0_1,y
sta $27a8,x
lda TransposedFontRow2,y
lda TransposedFontRow0_2,y
sta $2ba8,x
lda TransposedFontRow3,y
lda TransposedFontRow0_3,y
sta $2fa8,x
lda TransposedFontRow4,y
lda TransposedFontRow0_4,y
sta $33a8,x
lda TransposedFontRow5,y
lda TransposedFontRow0_5,y
sta $37a8,x
lda TransposedFontRow6,y
lda TransposedFontRow0_6,y
sta $3ba8,x
lda TransposedFontRow7,y
lda TransposedFontRow0_7,y
sta $3fa8,x
ldy scratch_0
rts
FASTFONT_H1_16
lda TransposedFontRow0,y
lda TransposedFontRow0_0,y
sta $2050,x
lda TransposedFontRow1,y
lda TransposedFontRow0_1,y
sta $2450,x
lda TransposedFontRow2,y
lda TransposedFontRow0_2,y
sta $2850,x
lda TransposedFontRow3,y
lda TransposedFontRow0_3,y
sta $2c50,x
lda TransposedFontRow4,y
lda TransposedFontRow0_4,y
sta $3050,x
lda TransposedFontRow5,y
lda TransposedFontRow0_5,y
sta $3450,x
lda TransposedFontRow6,y
lda TransposedFontRow0_6,y
sta $3850,x
lda TransposedFontRow7,y
lda TransposedFontRow0_7,y
sta $3c50,x
ldy scratch_0
rts
FASTFONT_H1_17
lda TransposedFontRow0,y
lda TransposedFontRow0_0,y
sta $20d0,x
lda TransposedFontRow1,y
lda TransposedFontRow0_1,y
sta $24d0,x
lda TransposedFontRow2,y
lda TransposedFontRow0_2,y
sta $28d0,x
lda TransposedFontRow3,y
lda TransposedFontRow0_3,y
sta $2cd0,x
lda TransposedFontRow4,y
lda TransposedFontRow0_4,y
sta $30d0,x
lda TransposedFontRow5,y
lda TransposedFontRow0_5,y
sta $34d0,x
lda TransposedFontRow6,y
lda TransposedFontRow0_6,y
sta $38d0,x
lda TransposedFontRow7,y
lda TransposedFontRow0_7,y
sta $3cd0,x
ldy scratch_0
rts
FASTFONT_H1_18
lda TransposedFontRow0,y
lda TransposedFontRow0_0,y
sta $2150,x
lda TransposedFontRow1,y
lda TransposedFontRow0_1,y
sta $2550,x
lda TransposedFontRow2,y
lda TransposedFontRow0_2,y
sta $2950,x
lda TransposedFontRow3,y
lda TransposedFontRow0_3,y
sta $2d50,x
lda TransposedFontRow4,y
lda TransposedFontRow0_4,y
sta $3150,x
lda TransposedFontRow5,y
lda TransposedFontRow0_5,y
sta $3550,x
lda TransposedFontRow6,y
lda TransposedFontRow0_6,y
sta $3950,x
lda TransposedFontRow7,y
lda TransposedFontRow0_7,y
sta $3d50,x
ldy scratch_0
rts
FASTFONT_H1_19
lda TransposedFontRow0,y
lda TransposedFontRow0_0,y
sta $21d0,x
lda TransposedFontRow1,y
lda TransposedFontRow0_1,y
sta $25d0,x
lda TransposedFontRow2,y
lda TransposedFontRow0_2,y
sta $29d0,x
lda TransposedFontRow3,y
lda TransposedFontRow0_3,y
sta $2dd0,x
lda TransposedFontRow4,y
lda TransposedFontRow0_4,y
sta $31d0,x
lda TransposedFontRow5,y
lda TransposedFontRow0_5,y
sta $35d0,x
lda TransposedFontRow6,y
lda TransposedFontRow0_6,y
sta $39d0,x
lda TransposedFontRow7,y
lda TransposedFontRow0_7,y
sta $3dd0,x
ldy scratch_0
rts
FASTFONT_H1_20
lda TransposedFontRow0,y
lda TransposedFontRow0_0,y
sta $2250,x
lda TransposedFontRow1,y
lda TransposedFontRow0_1,y
sta $2650,x
lda TransposedFontRow2,y
lda TransposedFontRow0_2,y
sta $2a50,x
lda TransposedFontRow3,y
lda TransposedFontRow0_3,y
sta $2e50,x
lda TransposedFontRow4,y
lda TransposedFontRow0_4,y
sta $3250,x
lda TransposedFontRow5,y
lda TransposedFontRow0_5,y
sta $3650,x
lda TransposedFontRow6,y
lda TransposedFontRow0_6,y
sta $3a50,x
lda TransposedFontRow7,y
lda TransposedFontRow0_7,y
sta $3e50,x
ldy scratch_0
rts
FASTFONT_H1_21
lda TransposedFontRow0,y
lda TransposedFontRow0_0,y
sta $22d0,x
lda TransposedFontRow1,y
lda TransposedFontRow0_1,y
sta $26d0,x
lda TransposedFontRow2,y
lda TransposedFontRow0_2,y
sta $2ad0,x
lda TransposedFontRow3,y
lda TransposedFontRow0_3,y
sta $2ed0,x
lda TransposedFontRow4,y
lda TransposedFontRow0_4,y
sta $32d0,x
lda TransposedFontRow5,y
lda TransposedFontRow0_5,y
sta $36d0,x
lda TransposedFontRow6,y
lda TransposedFontRow0_6,y
sta $3ad0,x
lda TransposedFontRow7,y
lda TransposedFontRow0_7,y
sta $3ed0,x
ldy scratch_0
rts
FASTFONT_H1_22
lda TransposedFontRow0,y
lda TransposedFontRow0_0,y
sta $2350,x
lda TransposedFontRow1,y
lda TransposedFontRow0_1,y
sta $2750,x
lda TransposedFontRow2,y
lda TransposedFontRow0_2,y
sta $2b50,x
lda TransposedFontRow3,y
lda TransposedFontRow0_3,y
sta $2f50,x
lda TransposedFontRow4,y
lda TransposedFontRow0_4,y
sta $3350,x
lda TransposedFontRow5,y
lda TransposedFontRow0_5,y
sta $3750,x
lda TransposedFontRow6,y
lda TransposedFontRow0_6,y
sta $3b50,x
lda TransposedFontRow7,y
lda TransposedFontRow0_7,y
sta $3f50,x
ldy scratch_0
rts
FASTFONT_H1_23
lda TransposedFontRow0,y
lda TransposedFontRow0_0,y
sta $23d0,x
lda TransposedFontRow1,y
lda TransposedFontRow0_1,y
sta $27d0,x
lda TransposedFontRow2,y
lda TransposedFontRow0_2,y
sta $2bd0,x
lda TransposedFontRow3,y
lda TransposedFontRow0_3,y
sta $2fd0,x
lda TransposedFontRow4,y
lda TransposedFontRow0_4,y
sta $33d0,x
lda TransposedFontRow5,y
lda TransposedFontRow0_5,y
sta $37d0,x
lda TransposedFontRow6,y
lda TransposedFontRow0_6,y
sta $3bd0,x
lda TransposedFontRow7,y
lda TransposedFontRow0_7,y
sta $3fd0,x
ldy scratch_0
rts
TransposedFontRow0
TransposedFontRow0_0
.byte $00, $00, $00, $14, $00, $00, $14, $14, $00, $00, $14, $14, $00, $00, $14, $00
.byte $00, $00, $00, $1c, $00, $00, $1c, $1c, $00, $00, $1c, $1c, $00, $00, $1c, $00
.byte $80, $87, $b6, $aa, $d5, $b7, $86, $8c, $b8, $87, $98, $8c, $80, $80, $80, $e0
@ -539,7 +539,7 @@ TransposedFontRow0
.byte $9f, $9e, $9f, $9e, $bf, $b3, $b3, $b3, $33, $b3, $bf, $bc, $83, $8f, $8c, $80
.byte $86, $80, $83, $80, $b0, $80, $9c, $80, $83, $80, $b0, $83, $8e, $80, $80, $80
.byte $80, $80, $80, $80, $86, $80, $80, $80, $80, $80, $80, $9c, $8c, $8e, $86, $00
TransposedFontRow1
TransposedFontRow0_1
.byte $00, $00, $00, $14, $00, $00, $14, $14, $00, $00, $14, $14, $00, $00, $14, $00
.byte $00, $00, $00, $1c, $00, $00, $1c, $1c, $00, $00, $1c, $1c, $00, $00, $1c, $00
.byte $80, $87, $b6, $aa, $d5, $b7, $8f, $8c, $9c, $8e, $8e, $8c, $80, $80, $80, $f0
@ -548,7 +548,7 @@ TransposedFontRow1
.byte $bf, $bf, $bf, $bf, $bf, $b3, $b3, $b3, $9b, $b3, $bf, $bc, $87, $8f, $9e, $80
.byte $8c, $80, $83, $80, $b0, $80, $b6, $80, $83, $8c, $80, $83, $8c, $80, $80, $80
.byte $80, $80, $80, $80, $86, $80, $80, $80, $80, $80, $80, $9e, $8c, $9e, $bf, $00
TransposedFontRow2
TransposedFontRow0_2
.byte $00, $00, $00, $14, $00, $00, $14, $14, $00, $00, $14, $14, $00, $00, $14, $00
.byte $00, $00, $00, $1c, $00, $00, $1c, $1c, $00, $00, $1c, $1c, $00, $00, $1c, $00
.byte $80, $87, $a4, $aa, $d5, $98, $86, $88, $8e, $9c, $bf, $bf, $80, $be, $80, $b8
@ -557,7 +557,7 @@ TransposedFontRow2
.byte $b3, $a3, $b3, $87, $8c, $b3, $b3, $b3, $1e, $b3, $98, $8c, $8e, $8c, $bf, $80
.byte $98, $9e, $9f, $9e, $be, $9e, $86, $9e, $9f, $80, $b0, $b3, $8c, $b3, $9f, $9e
.byte $9f, $be, $9f, $9e, $9f, $b3, $b3, $b3, $b3, $b3, $bf, $86, $8c, $98, $98, $00
TransposedFontRow3
TransposedFontRow0_3
.byte $00, $00, $00, $14, $00, $54, $54, $54, $00, $15, $15, $15, $55, $55, $55, $2a
.byte $00, $00, $00, $1c, $00, $7c, $7c, $7c, $00, $1f, $1f, $1f, $7f, $7f, $7f, $00
.byte $80, $87, $b6, $aa, $d5, $8c, $8f, $8c, $8e, $9c, $9f, $bf, $80, $be, $80, $9c
@ -566,7 +566,7 @@ TransposedFontRow3
.byte $bf, $a3, $bf, $9e, $8c, $b3, $b3, $b3, $8e, $9e, $8c, $8c, $9c, $8c, $80, $80
.byte $80, $b0, $b3, $b3, $b3, $b3, $9f, $b3, $b3, $8c, $b0, $9b, $8c, $bf, $b3, $b3
.byte $b3, $b3, $b3, $83, $86, $b3, $b3, $b3, $9e, $b3, $98, $87, $8c, $b8, $80, $00
TransposedFontRow4
TransposedFontRow0_4
.byte $00, $00, $00, $14, $00, $54, $54, $54, $00, $15, $15, $15, $55, $55, $55, $2a
.byte $00, $00, $00, $1c, $00, $7c, $7c, $7c, $00, $1f, $1f, $1f, $7f, $7f, $7f, $00
.byte $80, $80, $80, $aa, $d5, $86, $bb, $80, $8e, $9c, $9f, $8c, $80, $80, $80, $8e
@ -575,7 +575,7 @@ TransposedFontRow4
.byte $9f, $ab, $9f, $b8, $8c, $b3, $b3, $b3, $1e, $8c, $86, $8c, $b8, $8c, $80, $80
.byte $80, $be, $b3, $83, $b3, $9f, $86, $b3, $b3, $8c, $b0, $8f, $8c, $b3, $b3, $b3
.byte $b3, $b3, $83, $9e, $86, $b3, $b3, $b3, $8c, $b3, $8c, $86, $8c, $98, $80, $00
TransposedFontRow5
TransposedFontRow0_5
.byte $00, $00, $00, $14, $00, $14, $00, $14, $00, $14, $00, $14, $00, $14, $00, $00
.byte $00, $00, $00, $1c, $00, $1c, $00, $1c, $00, $1c, $00, $1c, $00, $1c, $00, $00
.byte $80, $87, $80, $aa, $d5, $bb, $9b, $80, $9c, $8e, $bf, $8c, $87, $80, $87, $87
@ -584,7 +584,7 @@ TransposedFontRow5
.byte $83, $93, $bb, $bf, $8c, $bf, $9e, $bf, $9b, $8c, $bf, $bc, $f0, $8f, $80, $ff
.byte $80, $b3, $b3, $b3, $b3, $83, $86, $be, $b3, $8c, $b3, $9b, $8c, $b3, $b3, $b3
.byte $9f, $be, $83, $b0, $b6, $b3, $9e, $bf, $9e, $be, $86, $9e, $8c, $9e, $80, $00
TransposedFontRow6
TransposedFontRow0_6
.byte $00, $00, $00, $14, $00, $14, $00, $14, $00, $14, $00, $14, $00, $14, $00, $00
.byte $00, $00, $00, $1c, $00, $1c, $00, $1c, $00, $1c, $00, $1c, $00, $1c, $00, $00
.byte $80, $87, $80, $aa, $d5, $bb, $ae, $80, $b8, $87, $9e, $80, $86, $80, $87, $83
@ -593,7 +593,7 @@ TransposedFontRow6
.byte $83, $ae, $b3, $9e, $8c, $9e, $8c, $b3, $33, $8c, $bf, $bc, $e0, $8f, $80, $ff
.byte $80, $be, $9f, $9e, $be, $9e, $86, $b0, $b3, $8c, $b3, $b3, $9e, $b3, $b3, $9e
.byte $83, $b0, $83, $9e, $9c, $be, $8c, $b3, $b3, $b0, $bf, $9c, $8c, $8e, $80, $00
TransposedFontRow7
TransposedFontRow0_7
.byte $00, $00, $00, $14, $00, $14, $00, $14, $00, $14, $00, $14, $00, $14, $00, $00
.byte $00, $00, $00, $1c, $00, $1c, $00, $1c, $00, $1c, $00, $1c, $00, $1c, $00, $00
.byte $80, $80, $80, $aa, $d5, $80, $80, $80, $80, $80, $80, $80, $83, $80, $80, $80

View File

@ -0,0 +1,953 @@
; AUTOGENERATED FILE; DO NOT EDIT!
;
; This file was generated by asmgen.py, a 6502 code generator sponsored by
; the Player/Missile Podcast. (The sprite compiler is based on HiSprite by
; Quinn Dunki).
;
; The code produced by asmgen is licensed under the Creative Commons
; Attribution 4.0 International (CC BY 4.0), so you are free to use the code in
; this file for any purpose. (The code generator itself is licensed under the
; GPLv3.)
FASTFONT_H1 ; A = character, X = column, Y = row; A is clobbered, X&Y are not
pha
lda FASTFONT_H1_JMP_HI,y
sta FASTFONT_H1_JMP+2
lda FASTFONT_H1_JMP_LO,y
sta FASTFONT_H1_JMP+1
sty scratch_0
pla
tay
FASTFONT_H1_JMP
jmp $ffff
FASTFONT_H1_JMP_HI
.byte >FASTFONT_H1_0
.byte >FASTFONT_H1_1
.byte >FASTFONT_H1_2
.byte >FASTFONT_H1_3
.byte >FASTFONT_H1_4
.byte >FASTFONT_H1_5
.byte >FASTFONT_H1_6
.byte >FASTFONT_H1_7
.byte >FASTFONT_H1_8
.byte >FASTFONT_H1_9
.byte >FASTFONT_H1_10
.byte >FASTFONT_H1_11
FASTFONT_H1_</