diff --git a/include/variables.h b/include/variables.h index 6f9bdf4afe..92544ee41c 100644 --- a/include/variables.h +++ b/include/variables.h @@ -119,10 +119,21 @@ extern SaveData gCurrentSaveFile; extern s32 D_802D9CA4; extern u32* gMapFlags; extern u32* gMapVars; -extern s32 gNumScripts; extern f32 D_80286540; +extern u32 gWorldMapVars[MAX_MAPVARS]; +extern u32 gBattleMapVars[MAX_MAPVARS]; + +extern u32 gWorldMapFlags[MAX_MAPFLAGS]; +extern u32 gBattleMapFlags[MAX_MAPFLAGS]; + +extern s32 D_8009A5D8; + +extern s32 mapScriptLibStart; +extern s32 mapScriptLibEnd; +extern s32 mapScriptLibVram; + // Scripts extern Bytecode* SCRIPT_NpcDefeat; diff --git a/papermario.ld b/papermario.ld index 0f31c5ea24..89f062e225 100644 --- a/papermario.ld +++ b/papermario.ld @@ -319,16 +319,17 @@ SECTIONS build/bin/4200C0.o(.data); } - /* 0x80280000 7E0E80-7E4D00 (len 3E80) */ + /* 0x80280000 7E0E80-7E73A0 (len 6520) */ .text_7E0E80 0x80280000 : AT(0x7E0E80) { build/src/code_7e0e80.o(.text); build/src/code_7E2AA0.o(.text); build/src/code_7E3700.o(.text); + build/bin/code_7E4D00.o(.data); } - /* 0x00000000 7E4D00-E20EB0 [63C1B0] */ - .data_7E4D00 0x7E4D00 : AT(0x7E4D00) { - build/bin/7E4D00.o(.data); + /* 0x00000000 7E73A0-E20EB0 [639B10] */ + .data_7E73A0 0x7E73A0 : AT(0x7E73A0) { + build/bin/7E73A0.o(.data); } /* 0x802B7000 E20EB0-E215C0 (len 710) */ diff --git a/src/code_341d0_len_20d0.c b/src/code_341d0_len_20d0.c index ceae8aaa1c..7a5159b8b5 100644 --- a/src/code_341d0_len_20d0.c +++ b/src/code_341d0_len_20d0.c @@ -40,7 +40,9 @@ INCLUDE_ASM(s32, "code_341d0_len_20d0", remove_all_effects); INCLUDE_ASM(s32, "code_341d0_len_20d0", play_effect); -INCLUDE_ASM(s32, "code_341d0_len_20d0", load_map_script_lib); +void load_map_script_lib(void) { + dma_copy(&mapScriptLibStart, &mapScriptLibEnd, &mapScriptLibVram); +} INCLUDE_ASM(s32, "code_341d0_len_20d0", load_map_by_IDs); diff --git a/tools/n64splat b/tools/n64splat index fce3c89074..968477e3cc 160000 --- a/tools/n64splat +++ b/tools/n64splat @@ -1 +1 @@ -Subproject commit fce3c8907426d99597dd401f2843a9f54b199a31 +Subproject commit 968477e3cc7b26514196abae0ff0e3f10a45d31e diff --git a/tools/splat.yaml b/tools/splat.yaml index 70e746b790..583deaeac8 100644 --- a/tools/splat.yaml +++ b/tools/splat.yaml @@ -324,7 +324,8 @@ segments: - [0x7e0e80, "c", "code_7e0e80"] - [0x7E2AA0, "c", "code_7E2AA0"] - [0x7E3700, "c", "code_7E3700"] - - [0x7e4d00, "bin"] # todo split this further + - [0x7e4d00, "bin"] + - [0x7E73A0, "bin"] # todo split this further - name: code type: code start: 0xE20EB0 diff --git a/undefined_syms.txt b/undefined_syms.txt index f47e6a9706..edfcb69f2b 100644 --- a/undefined_syms.txt +++ b/undefined_syms.txt @@ -35,6 +35,10 @@ D_800D9620 = 0x800D9620; gBattleStatus = 0x800DC070; +mapScriptLibStart = 0x7E0E80; +mapScriptLibEnd = 0x7E73A0; +mapScriptLibVram = 0x80280000; + D_000759B0 = 0x000759B0; D_000759B0_end = 0x000A5DD0; D_000A5DD0 = 0x000A5DD0;