Files
pokestadiumgs/tools/dump_code_syms.py
Diamond Lewis aaa65d5098 Add JP Support
2026-07-08 13:36:45 -05:00

22 lines
471 B
Python
Executable File

#!/usr/bin/env python3
import mapfile_parser
from pathlib import Path
mapPath = Path("build") / f"pokestadiumgs-jp.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))