hp-saturn/gen_rom_hex.py

17 lines
295 B
Python
Raw Normal View History

#!/usr/bin/env python3
2019-02-06 10:40:55 +01:00
#
# licence: GPLv3 or later
#
f = open("../docs/gxrom-r", "rb")
count=0
filedata = f.read()
f.close()
for b in filedata:
print("%1x %1x "%(int(b&0x0f),int((b&0xf0)>>4)), end="")
count += 1
if count == 8:
print(end=" ")
if count == 16:
print(end="\n")
count = 0