mirror of
https://github.com/cc65/cc65.git
synced 2025-01-11 11:30:13 +00:00
Add the build tools for the font
This commit is contained in:
parent
f5c24be572
commit
646997ed43
30
libsrc/atari7800/buildfont160.py
Normal file
30
libsrc/atari7800/buildfont160.py
Normal file
@ -0,0 +1,30 @@
|
||||
blen = 0
|
||||
|
||||
def gb(val):
|
||||
b = val[0] << 6
|
||||
b = b + (val[1] << 4)
|
||||
b = b + (val[2] << 2)
|
||||
b = b + val[3]
|
||||
return '$' + hex(b)[2:4]
|
||||
|
||||
def printline(f, val):
|
||||
f.write(" .byte " +
|
||||
gb(val[0:4]) + ', ' +
|
||||
gb(val[4:8]) + ', ' +
|
||||
gb(val[8:12]) + ', ' +
|
||||
gb(val[12:16]) + ', ' +
|
||||
gb(val[16:20]) + ', ' +
|
||||
gb(val[20:24]) + ', ' +
|
||||
gb(val[24:28]) + ', ' +
|
||||
gb(val[28:32]) + '\n')
|
||||
|
||||
fname='font160'
|
||||
with open(fname + '.data', 'rb') as f:
|
||||
data = f.read()
|
||||
fname= fname + '.s'
|
||||
with open(fname, 'w') as f:
|
||||
f.write(" .export _font160\n")
|
||||
f.write(' .rodata\n')
|
||||
f.write("_font160:\n")
|
||||
for i in range(0, int(len(data)/32)):
|
||||
printline(f, data[i * 32:i * 32 + 32])
|
BIN
libsrc/atari7800/font160.data
Normal file
BIN
libsrc/atari7800/font160.data
Normal file
Binary file not shown.
BIN
libsrc/atari7800/font160flipped.png
Normal file
BIN
libsrc/atari7800/font160flipped.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.9 KiB |
Loading…
x
Reference in New Issue
Block a user