mirror of
https://github.com/zeldaret/oot.git
synced 2025-07-16 04:44:44 +00:00
Fix sym_info.py and first_diff.py scripts to properly handle .bss (#205)
This commit is contained in:
parent
4e70a24274
commit
df3bfbc168
2 changed files with 15 additions and 16 deletions
|
@ -42,13 +42,15 @@ def search_address(target_addr):
|
|||
with open(mymap) as f:
|
||||
for line in f:
|
||||
if "load address" in line:
|
||||
if "noload" in line or "noload" in prev_line:
|
||||
# Ignore .bss sections if we're looking for a ROM address
|
||||
if not is_ram and (".bss" in line or ".bss" in prev_line):
|
||||
ram_offset = None
|
||||
continue
|
||||
ram = int(line[16 : 16 + 18], 0)
|
||||
rom = int(line[59 : 59 + 18], 0)
|
||||
ram_offset = ram - rom
|
||||
continue
|
||||
|
||||
prev_line = line
|
||||
|
||||
if (
|
||||
|
@ -91,13 +93,11 @@ def search_symbol(target_sym):
|
|||
with open(mymap) as f:
|
||||
for line in f:
|
||||
if "load address" in line:
|
||||
if "noload" in line or "noload" in prev_line:
|
||||
ram_offset = None
|
||||
continue
|
||||
ram = int(line[16 : 16 + 18], 0)
|
||||
rom = int(line[59 : 59 + 18], 0)
|
||||
ram_offset = ram - rom
|
||||
continue
|
||||
|
||||
prev_line = line
|
||||
|
||||
if (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue