1
0
Fork 0
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:
Roman971 2020-06-13 03:56:17 +02:00 committed by GitHub
parent 4e70a24274
commit df3bfbc168
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 16 deletions

View file

@ -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 (