mirror of
https://github.com/zeldaret/oot.git
synced 2024-12-25 22:26:12 +00:00
22 lines
425 B
Python
22 lines
425 B
Python
|
import struct
|
||
|
|
||
|
ROM_ADDR = 0xB94CC0
|
||
|
COUNT = 23
|
||
|
|
||
|
rom = open("../../baserom.z64", "rb")
|
||
|
rom.seek(ROM_ADDR)
|
||
|
data = bytearray(rom.read(0x20 * COUNT))
|
||
|
rom.close()
|
||
|
|
||
|
valFormat = "0x{:02X}"
|
||
|
sfmt = ""
|
||
|
for i in range(4):
|
||
|
sfmt += valFormat + ", "
|
||
|
|
||
|
for i in range(3):
|
||
|
sfmt += sfmt
|
||
|
|
||
|
sfmt = "{{ {{ " + sfmt + "}} }},"
|
||
|
for i in range(COUNT):
|
||
|
line = struct.unpack_from(">32B", data, i * 0x20)
|
||
|
print(sfmt.format(*line))
|