mirror of
https://github.com/zeldaret/oot.git
synced 2025-02-10 14:35:46 +00:00
In fix_bss.py, really always use BSS section start from map file (#2085)
This commit is contained in:
parent
7056423e5b
commit
7c2e0383f3
3 changed files with 11 additions and 7 deletions
|
@ -69,3 +69,5 @@ u8 gSoundModeList[] = {
|
||||||
u8 gAudioSpecId = 0;
|
u8 gAudioSpecId = 0;
|
||||||
|
|
||||||
u8 D_80133418 = 0;
|
u8 D_80133418 = 0;
|
||||||
|
|
||||||
|
u8 D_8016F0E0[0xA0]; // unused
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
|
|
||||||
u8 D_8016F0E0[0xA0]; // unused
|
|
||||||
AudioContext gAudioCtx;
|
AudioContext gAudioCtx;
|
||||||
AudioCustomUpdateFunction gAudioCustomUpdateFunction;
|
AudioCustomUpdateFunction gAudioCustomUpdateFunction;
|
||||||
s32 D_801755D8[3]; // unused
|
s32 D_801755D8[3]; // unused
|
||||||
|
|
|
@ -401,9 +401,6 @@ def determine_base_bss_ordering(
|
||||||
build_bss_symbols: list[BssSymbol],
|
build_bss_symbols: list[BssSymbol],
|
||||||
bss_section: BssSection,
|
bss_section: BssSection,
|
||||||
) -> list[BssSymbol]:
|
) -> list[BssSymbol]:
|
||||||
# For the baserom, assume that the lowest address is the start of the BSS section. This might
|
|
||||||
# not be true if the first BSS variable is not referenced, but in practice this doesn't seem
|
|
||||||
# to happen for the files which typically have BSS ordering issues.
|
|
||||||
base_start_address = min(p.base_value for p in bss_section.pointers)
|
base_start_address = min(p.base_value for p in bss_section.pointers)
|
||||||
|
|
||||||
found_symbols: dict[str, BssSymbol] = {}
|
found_symbols: dict[str, BssSymbol] = {}
|
||||||
|
@ -775,10 +772,16 @@ def main():
|
||||||
for file, bss_section in bss_sections.items():
|
for file, bss_section in bss_sections.items():
|
||||||
if not bss_section.pointers:
|
if not bss_section.pointers:
|
||||||
continue
|
continue
|
||||||
# Try to detect if the section is shifted by comparing the lowest
|
# The following heuristic doesn't work for z_locale, since the first pointer into BSS is not
|
||||||
# address among any pointer into the section between base and build
|
# at the start of the section. Fortunately z_locale either has one BSS variable (in GC versions)
|
||||||
|
# or none (in N64 versions), so we can just skip it.
|
||||||
|
if str(file) == "src/boot/z_locale.c":
|
||||||
|
continue
|
||||||
|
# For the baserom, assume that the lowest address is the start of the BSS section. This might
|
||||||
|
# not be true if the first BSS variable is not referenced, but in practice this doesn't happen
|
||||||
|
# (except for z_locale above).
|
||||||
base_min_address = min(p.base_value for p in bss_section.pointers)
|
base_min_address = min(p.base_value for p in bss_section.pointers)
|
||||||
build_min_address = min(p.build_value for p in bss_section.pointers)
|
build_min_address = bss_section.start_address
|
||||||
if not all(
|
if not all(
|
||||||
p.build_value - build_min_address == p.base_value - base_min_address
|
p.build_value - build_min_address == p.base_value - base_min_address
|
||||||
for p in bss_section.pointers
|
for p in bss_section.pointers
|
||||||
|
|
Loading…
Add table
Reference in a new issue