diff --git a/ld_script.txt b/ld_script.txt index 904ca0fec1..bd9d7c4a35 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -27,7 +27,7 @@ SECTIONS { *libc.a:locale.o(.data); *libc.a:mallocr.o(.data); . = 0x40000; -} + } . = 0x3000000; diff --git a/ld_script_modern.txt b/ld_script_modern.txt index a988fe0cd5..549d040e1e 100644 --- a/ld_script_modern.txt +++ b/ld_script_modern.txt @@ -49,8 +49,11 @@ SECTIONS { ALIGN(4) { src/rom_header.o(.text*); - src/*.o(.text*); + src/rom_header_gf.o(.text.*); + src/crt0.o(.text); + src/main.o(.text); gflib/*.o(.text*); + src/*.o(.text*); asm/*.o(.text*); } =0 diff --git a/src/rom_header_gf.c b/src/rom_header_gf.c index 2723e1200e..472efe994a 100644 --- a/src/rom_header_gf.c +++ b/src/rom_header_gf.c @@ -6,6 +6,15 @@ #include "item.h" #include "pokeball.h" +// The purpose of this struct is for outside applications to be +// able to access parts of the ROM or its save file, like a public API. +// In vanilla, it was used by Colosseum and XD to access pokemon graphics. +// +// If this struct is rearranged in any way, it defeats the purpose of +// having it at all. Applications like PKHex or streaming HUDs may find +// these values useful, so there's some potential benefit to keeping it. +// If there's a compilation problem below, just comment out the assignment +// instead of changing this struct. struct GFRomHeader { u32 version;