Wildcard bss, ewram_data, and COMMON in modern toolchain

This commit is contained in:
PikalaxALT 2019-06-29 08:35:52 -04:00
parent e92e9a184c
commit 4b759da714
15 changed files with 42 additions and 60 deletions

View File

@ -222,11 +222,13 @@ $(OBJ_DIR)/sym_ewram.ld: sym_ewram.txt
ifeq ($(MODERN),0) ifeq ($(MODERN),0)
LD_SCRIPT := ld_script.txt LD_SCRIPT := ld_script.txt
LD_SCRIPT_DEPS := $(OBJ_DIR)/sym_bss.ld $(OBJ_DIR)/sym_common.ld $(OBJ_DIR)/sym_ewram.ld
else else
LD_SCRIPT := ld_script_modern.txt LD_SCRIPT := ld_script_modern.txt
LD_SCRIPT_DEPS :=
endif endif
$(OBJ_DIR)/ld_script.ld: $(LD_SCRIPT) $(OBJ_DIR)/sym_bss.ld $(OBJ_DIR)/sym_common.ld $(OBJ_DIR)/sym_ewram.ld $(OBJ_DIR)/ld_script.ld: $(LD_SCRIPT) $(LD_SCRIPT_DEPS)
cd $(OBJ_DIR) && sed "s#tools/#../../tools/#g" ../../$(LD_SCRIPT) > ld_script.ld cd $(OBJ_DIR) && sed "s#tools/#../../tools/#g" ../../$(LD_SCRIPT) > ld_script.ld
$(ELF): $(OBJ_DIR)/ld_script.ld $(OBJS) $(ELF): $(OBJ_DIR)/ld_script.ld $(OBJS)

View File

@ -0,0 +1 @@
gUnknown_03006370

6
common_syms/librfu.txt Normal file
View File

@ -0,0 +1,6 @@
gUnknown_03007870
gUnknown_03007880
gUnknown_03007890
gUnknown_03007894
gUnknown_03007898
gUnknown_030078A0

View File

@ -0,0 +1 @@
gRfuState

View File

@ -13,7 +13,7 @@ SECTIONS {
. = 0x1C000; . = 0x1C000;
INCLUDE "sym_ewram.ld" src/*.o(ewram_data);
. = 0x40000; . = 0x40000;
} }
@ -24,13 +24,14 @@ SECTIONS {
ALIGN(4) ALIGN(4)
{ {
/* .bss starts at 0x3000000 */ /* .bss starts at 0x3000000 */
INCLUDE "sym_bss.ld" src/*.o(.bss);
asm/m4a_1.o(.bss);
/* .bss.code starts at 0x3001AA8 */ /* .bss.code starts at 0x3001AA8 */
src/m4a.o(.bss.code); src/m4a.o(.bss.code);
/* COMMON starts at 0x30022A8 */ /* COMMON starts at 0x30022A8 */
INCLUDE "sym_common.ld" src/*.o(COMMON);
*libc.a:sbrkr.o(COMMON); *libc.a:sbrkr.o(COMMON);
end = .; end = .;
. = 0x8000; . = 0x8000;
@ -49,14 +50,7 @@ SECTIONS {
script_data : script_data :
ALIGN(4) ALIGN(4)
{ {
data/event_scripts.o(script_data); data/*.o(script_data);
data/battle_anim_scripts.o(script_data);
data/battle_scripts_1.o(script_data);
data/field_effect_scripts.o(script_data);
data/battle_scripts_2.o(script_data);
data/battle_ai_scripts.o(script_data);
data/contest_ai_scripts.o(script_data);
data/mystery_event_script_cmd_table.o(script_data);
} =0 } =0
lib_text : lib_text :

View File

@ -38,7 +38,7 @@ struct Unk03006370
static void sub_81D5084(u8); static void sub_81D5084(u8);
extern struct Unk03006370 gUnknown_03006370; struct Unk03006370 gUnknown_03006370;
extern const u8 gUnknown_089A3470[]; extern const u8 gUnknown_089A3470[];
extern const u8 gMultiBootProgram_BerryGlitchFix_Start[]; extern const u8 gMultiBootProgram_BerryGlitchFix_Start[];

9
src/librfu.c Normal file
View File

@ -0,0 +1,9 @@
#include "global.h"
#include "librfu.h"
struct RfuUnk1* gUnknown_03007870[4];
struct RfuUnk2* gUnknown_03007880[4];
struct RfuUnk5 *gUnknown_03007890;
u32 *gUnknown_03007894;
struct RfuUnk3* gUnknown_03007898;
u8 gUnknown_030078A0[12];

View File

@ -1,4 +1,5 @@
#include "global.h" #include "global.h"
#include "main.h" #include "main.h"
#include "librfu.h"
//TODO: decompile asm/librfu_intr.s to here //TODO: decompile asm/librfu_intr.s to here

View File

@ -1,6 +1,8 @@
#include "global.h" #include "global.h"
#include "librfu.h" #include "librfu.h"
struct RfuStruct *gRfuState;
extern IntrFunc IntrSIO32(void); extern IntrFunc IntrSIO32(void);
extern void STWI_stop_timer(void); extern void STWI_stop_timer(void);

View File

@ -250,8 +250,8 @@ bool32 sub_802E2D0(struct PokemonJump1_82E4 *, int);
int sub_802E354(int, u16, u16); int sub_802E354(int, u16, u16);
void sub_802E3A8(void); void sub_802E3A8(void);
extern struct PokemonJump1 *gUnknown_02022CFC; EWRAM_DATA struct PokemonJump1 *gUnknown_02022CFC = NULL;
extern struct PokemonJump2 *gUnknown_02022D00; EWRAM_DATA struct PokemonJump2 *gUnknown_02022D00 = NULL;
const struct PokemonJumpMons gPkmnJumpSpecies[] = const struct PokemonJumpMons gPkmnJumpSpecies[] =
{ {

View File

@ -36,8 +36,8 @@ extern const u8 gText_RibbonsF700[];
extern const u8 *const gRibbonDescriptionPointers[][2]; extern const u8 *const gRibbonDescriptionPointers[][2];
extern const u8 *const gGiftRibbonDescriptionPointers[][2]; extern const u8 *const gGiftRibbonDescriptionPointers[][2];
extern u32 gUnknown_030012C0; static u32 gUnknown_030012C0;
extern u32 gUnknown_030012C4; static u32 gUnknown_030012C4;
void sub_81D0E84(struct Pokenav10Struct2 *structPtr); void sub_81D0E84(struct Pokenav10Struct2 *structPtr);
void sub_81D0FF0(struct Pokenav10Struct2 *structPtr); void sub_81D0FF0(struct Pokenav10Struct2 *structPtr);

3
src/pokenav_unk_7.c Normal file
View File

@ -0,0 +1,3 @@
#include "global.h"
BSS_DATA u8 gUnknown_030012BC;

View File

@ -47,17 +47,8 @@
.include "src/multiboot.o" .include "src/multiboot.o"
.include "src/mirage_tower.o" .include "src/mirage_tower.o"
.include "src/berry_fix_program.o" .include "src/berry_fix_program.o"
.include "src/pokenav_unk_7.o"
@ pokenav .include "src/pokenav_unk_10.o"
gUnknown_030012BC: @ 30012BC
.space 0x4
gUnknown_030012C0: @ 30012C0
.space 0x4
gUnknown_030012C4: @ 30012C4
.space 0x4
.include "src/ereader_helpers.o" .include "src/ereader_helpers.o"
.include "src/faraway_island.o" .include "src/faraway_island.o"
.include "asm/m4a_1.o" .include "asm/m4a_1.o"

View File

@ -45,29 +45,8 @@
.space 0x44 .space 0x44
gUnknown_03006370: @ 3006370 .include "ereader_screen.o"
.space 0x10
.include "m4a.o" .include "m4a.o"
.include "agb_flash.o" .include "agb_flash.o"
.include "librfu_stwi.o"
gRfuState: @ 3007868 .include "librfu.o"
.space 0x8
gUnknown_03007870: @ 3007870
.space 0x10
gUnknown_03007880: @ 3007880
.space 0x10
gUnknown_03007890: @ 3007890
.space 0x4
gUnknown_03007894: @ 3007894
.space 0x4
gUnknown_03007898: @ 3007898
.space 0x8
gUnknown_030078A0: @ 30078A0
.space 0xC

View File

@ -18,14 +18,7 @@
.include "src/berry_crush.o" .include "src/berry_crush.o"
.include "src/berry_powder.o" .include "src/berry_powder.o"
.include "src/dodrio_berry_picking.o" .include "src/dodrio_berry_picking.o"
.include "src/pokemon_jump.o"
@ pokemon_jump
gUnknown_02022CFC: @ 2022CFC
.space 0x4
gUnknown_02022D00: @ 2022D00
.space 0x4
.include "src/main_menu.o" .include "src/main_menu.o"
.include "src/battle_controllers.o" .include "src/battle_controllers.o"
.include "src/rom_8034C54.o" .include "src/rom_8034C54.o"