mirror of
https://github.com/pret/pokestadium.git
synced 2026-03-21 17:24:20 -05:00
22 lines
469 B
Python
Executable File
22 lines
469 B
Python
Executable File
#!/usr/bin/env python3
|
|
|
|
import mapfile_parser
|
|
from pathlib import Path
|
|
|
|
mapPath = Path("build") / f"pokestadium-us.map"
|
|
mapFile = mapfile_parser.MapFile()
|
|
mapFile.readMapFile(mapPath)
|
|
|
|
str_syms = []
|
|
|
|
for segment in mapFile:
|
|
for file in segment:
|
|
if file.sectionType != ".text":
|
|
continue
|
|
|
|
for symbol in file:
|
|
str_syms.append(f"{symbol.name} = 0x{symbol.vram:X}; // type:func")
|
|
|
|
with open("tools/symbol_addrs_code.txt", "w") as f:
|
|
f.write("\n".join(str_syms))
|