mirror of
https://github.com/pmret/papermario.git
synced 2024-11-08 12:02:30 +01:00
0d70e3ecac
* Remove JP dump * Add new JP dump * Fix sort_symbol_addrs to only look at one version * Deduplicate and sort symbol_addrs * Clean up JP rom if conditions * Use /current dir for diffing * Fix state_step_logos * Add todo comments for unsplitted segments * Fix draw_merlee_message * rename background_gfx * Fix background_gfx * Fix JP build * Set unused data offsets to auto
28 lines
689 B
Python
Executable File
28 lines
689 B
Python
Executable File
#!/usr/bin/python3
|
|
|
|
from collections import OrderedDict
|
|
import os
|
|
import sys
|
|
|
|
script_dir = os.path.dirname(os.path.realpath(__file__))
|
|
|
|
|
|
for version in ["us", "jp"]:
|
|
syms = {}
|
|
file_path = os.path.join(script_dir, f"../ver/{version}/symbol_addrs.txt")
|
|
|
|
with open(file_path) as f:
|
|
symbol_lines = f.readlines()
|
|
|
|
for line in symbol_lines:
|
|
addr_text = line.split(" = ")[1][:10]
|
|
addr = int(addr_text, 0)
|
|
if addr in syms:
|
|
print("Duplicate address: " + addr_text)
|
|
sys.exit(55)
|
|
syms[addr] = line
|
|
|
|
with open(file_path, newline="\n", mode="w") as f:
|
|
for addr in sorted(syms):
|
|
f.write(syms[addr])
|