4cade/bin/packhgrfile.py
Tom Greene 854425b416
Pack HGR title graphics into screen holes to save space (#434)
* Pack HGR title graphics into screen holes to save space

* Rename TITLE.HGR folder to TITLE.HGR.UNPACKED

* Add packed HGR files
2021-11-12 01:22:14 -05:00

22 lines
325 B
Python
Executable File

#!/usr/bin/env python3
import sys
infile = sys.argv[1]
outfile = sys.argv[2]
i = open(infile,"rb")
filedata = i.read()
i.close
outdata = bytearray(filedata[0:7680])
for h in range(60):
oh = h*128+120
ih = h*8+7680+(int(h/15)*8)
outdata[oh:oh+8] = filedata[ih:ih+8]
o = open(outfile,"wb")
o.write(outdata)
o.close