From a8d2b7310624634384a2cf2ed2544be8a1a2c5f2 Mon Sep 17 00:00:00 2001 From: gamemasterplc Date: Thu, 23 Nov 2023 21:24:57 -0600 Subject: [PATCH 1/2] Static-ize WireDraw --- src/game/printfunc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game/printfunc.c b/src/game/printfunc.c index f62322eb..f679e038 100644 --- a/src/game/printfunc.c +++ b/src/game/printfunc.c @@ -302,7 +302,7 @@ void pfDrawFonts(void) } } -void WireDraw(void) //Is not private to prevent linker error due to analysis bug of refMapData0 +static void WireDraw(void) { Mtx44 proj; Mtx modelview; From 47f2bb30b9d3e87d06875cce5f6a9ff4515612a8 Mon Sep 17 00:00:00 2001 From: gamemasterplc Date: Thu, 23 Nov 2023 21:58:33 -0600 Subject: [PATCH 2/2] Dump overlay list --- config/GMPE01_00/splits.txt | 3 + config/GMPE01_00/symbols.txt | 2 +- configure.py | 1 + include/common.h | 1 + include/common_enums.h | 15 +++++ include/common_structs.h | 5 ++ include/functions.h | 4 +- include/ovl_table.h | 99 +++++++++++++++++++++++++++++ include/variables.h | 2 + src/REL/subchrselDll/subchrselDll.c | 2 +- src/game/ovllist.c | 11 ++++ 11 files changed, 142 insertions(+), 3 deletions(-) create mode 100644 include/common_enums.h create mode 100644 include/ovl_table.h create mode 100644 src/game/ovllist.c diff --git a/config/GMPE01_00/splits.txt b/config/GMPE01_00/splits.txt index 7be80bd4..4763ee59 100644 --- a/config/GMPE01_00/splits.txt +++ b/config/GMPE01_00/splits.txt @@ -89,6 +89,9 @@ game/sprput.c: .sbss start:0x801D3B50 end:0x801D3B58 .sdata2 start:0x801D49F0 end:0x801D4A28 +game/ovllist.c: + .data start:0x8012F790 end:0x80130100 + Runtime.PPCEABI.H/global_destructor_chain.c: .text start:0x800E2008 end:0x800E2068 .dtors start:0x8011DCE8 end:0x8011DCEC diff --git a/config/GMPE01_00/symbols.txt b/config/GMPE01_00/symbols.txt index b08ee403..d3235d0a 100644 --- a/config/GMPE01_00/symbols.txt +++ b/config/GMPE01_00/symbols.txt @@ -5020,7 +5020,7 @@ lbl_8012FDA1 = .data:0x8012FDA1; // type:object size:0xF data:string lbl_8012FDB0 = .data:0x8012FDB0; // type:object size:0xF data:string lbl_8012FDBF = .data:0x8012FDBF; // type:object size:0xF data:string lbl_8012FDCE = .data:0x8012FDCE; // type:object size:0x12 -lbl_8012FDE0 = .data:0x8012FDE0; // type:object size:0x320 +_ovltbl = .data:0x8012FDE0; // type:object size:0x320 lbl_80130100 = .data:0x80130100; // type:object size:0x20 lbl_80130120 = .data:0x80130120; // type:object size:0xC lbl_8013012C = .data:0x8013012C; // type:object size:0x14 diff --git a/configure.py b/configure.py index 436473b1..fb49a2ff 100755 --- a/configure.py +++ b/configure.py @@ -242,6 +242,7 @@ config.libs = [ Object(Matching, "game/process.c"), Object(NonMatching, "game/sprman.c"), Object(NonMatching, "game/sprput.c"), + Object(Matching, "game/ovllist.c"), ], }, { diff --git a/include/common.h b/include/common.h index 4875c13a..a46fcdea 100644 --- a/include/common.h +++ b/include/common.h @@ -3,6 +3,7 @@ #include "types.h" #include "common_structs.h" +#include "common_enums.h" #include "functions.h" #include "variables.h" diff --git a/include/common_enums.h b/include/common_enums.h new file mode 100644 index 00000000..27a2129a --- /dev/null +++ b/include/common_enums.h @@ -0,0 +1,15 @@ +#ifndef _COMMON_ENUMS_H +#define _COMMON_ENUMS_H + +#include "types.h" + +#define OVL_DEFINE(name, path) name, + +typedef enum { + #include "ovl_table.h" + OVL_COUNT +} OverlayID; + +#undef OVL_DEFINE + +#endif diff --git a/include/common_structs.h b/include/common_structs.h index c17271d7..ab27ba9d 100644 --- a/include/common_structs.h +++ b/include/common_structs.h @@ -57,4 +57,9 @@ typedef struct wipe_state { u8 unk2[20]; } WipeState; +typedef struct file_list_entry { + char *name; + s32 file_id; +} FileListEntry; + #endif diff --git a/include/functions.h b/include/functions.h index fc92a0bb..08e015b3 100644 --- a/include/functions.h +++ b/include/functions.h @@ -3,6 +3,8 @@ #include "types.h" #include "common_structs.h" +#include "common_enums.h" + #include "dolphin/gx/GXStruct.h" void Hu3DBGColorSet(u8, u8, u8); @@ -64,7 +66,7 @@ void HuPrcResetStat(Process *process, u16 value); void HuPrcAllPause(int flag); void HuPrcAllUPause(int flag); -void omOvlGotoEx(int id, s16 end_mode, int stat, int event); +void omOvlGotoEx(OverlayID overlay, s16 end_mode, int stat, int event); void omOvlReturnEx(int level, s16 end_mode); void WipeCreate(char dir, char type, short duration); diff --git a/include/ovl_table.h b/include/ovl_table.h new file mode 100644 index 00000000..4f66a2d2 --- /dev/null +++ b/include/ovl_table.h @@ -0,0 +1,99 @@ +OVL_DEFINE(OVL__MINI, "dll/_minigameDLL.rel") +OVL_DEFINE(OVL_BOOT, "dll/bootdll.rel") +OVL_DEFINE(OVL_E3SETUP, "dll/e3setupDLL.rel") +OVL_DEFINE(OVL_INST, "dll/instdll.rel") +OVL_DEFINE(OVL_M300, "dll/m300dll.rel") +OVL_DEFINE(OVL_M302, "dll/m302dll.rel") +OVL_DEFINE(OVL_M303, "dll/m303dll.rel") +OVL_DEFINE(OVL_M330, "dll/m330dll.rel") +OVL_DEFINE(OVL_M333, "dll/m333dll.rel") +OVL_DEFINE(OVL_M401, "dll/m401dll.rel") +OVL_DEFINE(OVL_M402, "dll/m402dll.rel") +OVL_DEFINE(OVL_M403, "dll/m403dll.rel") +OVL_DEFINE(OVL_M404, "dll/m404dll.rel") +OVL_DEFINE(OVL_M405, "dll/m405dll.rel") +OVL_DEFINE(OVL_M406, "dll/m406dll.rel") +OVL_DEFINE(OVL_M407, "dll/m407dll.rel") +OVL_DEFINE(OVL_M408, "dll/m408dll.rel") +OVL_DEFINE(OVL_M409, "dll/m409dll.rel") +OVL_DEFINE(OVL_M410, "dll/m410dll.rel") +OVL_DEFINE(OVL_M411, "dll/m411dll.rel") +OVL_DEFINE(OVL_M412, "dll/m412dll.rel") +OVL_DEFINE(OVL_M413, "dll/m413dll.rel") +OVL_DEFINE(OVL_M414, "dll/m414dll.rel") +OVL_DEFINE(OVL_M415, "dll/m415dll.rel") +OVL_DEFINE(OVL_M416, "dll/m416dll.rel") +OVL_DEFINE(OVL_M417, "dll/m417dll.rel") +OVL_DEFINE(OVL_M418, "dll/m418dll.rel") +OVL_DEFINE(OVL_M419, "dll/m419dll.rel") +OVL_DEFINE(OVL_M420, "dll/m420dll.rel") +OVL_DEFINE(OVL_M421, "dll/m421dll.rel") +OVL_DEFINE(OVL_M422, "dll/m422dll.rel") +OVL_DEFINE(OVL_M423, "dll/m423dll.rel") +OVL_DEFINE(OVL_M424, "dll/m424dll.rel") +OVL_DEFINE(OVL_M425, "dll/m425dll.rel") +OVL_DEFINE(OVL_M426, "dll/m426dll.rel") +OVL_DEFINE(OVL_M427, "dll/m427dll.rel") +OVL_DEFINE(OVL_M428, "dll/m428dll.rel") +OVL_DEFINE(OVL_M429, "dll/m429dll.rel") +OVL_DEFINE(OVL_M430, "dll/m430dll.rel") +OVL_DEFINE(OVL_M431, "dll/m431dll.rel") +OVL_DEFINE(OVL_M432, "dll/m432dll.rel") +OVL_DEFINE(OVL_M433, "dll/m433dll.rel") +OVL_DEFINE(OVL_M434, "dll/m434dll.rel") +OVL_DEFINE(OVL_M435, "dll/m435dll.rel") +OVL_DEFINE(OVL_M436, "dll/m436dll.rel") +OVL_DEFINE(OVL_M437, "dll/m437dll.rel") +OVL_DEFINE(OVL_M438, "dll/m438dll.rel") +OVL_DEFINE(OVL_M439, "dll/m439dll.rel") +OVL_DEFINE(OVL_M440, "dll/m440dll.rel") +OVL_DEFINE(OVL_M441, "dll/m441dll.rel") +OVL_DEFINE(OVL_M442, "dll/m442dll.rel") +OVL_DEFINE(OVL_M443, "dll/m443dll.rel") +OVL_DEFINE(OVL_M444, "dll/m444dll.rel") +OVL_DEFINE(OVL_M445, "dll/m445dll.rel") +OVL_DEFINE(OVL_M446, "dll/m446dll.rel") +OVL_DEFINE(OVL_M447, "dll/m447dll.rel") +OVL_DEFINE(OVL_M448, "dll/m448dll.rel") +OVL_DEFINE(OVL_M449, "dll/m449dll.rel") +OVL_DEFINE(OVL_M450, "dll/m450dll.rel") +OVL_DEFINE(OVL_M451, "dll/m451dll.rel") +OVL_DEFINE(OVL_M453, "dll/m453dll.rel") +OVL_DEFINE(OVL_M455, "dll/m455dll.rel") +OVL_DEFINE(OVL_M456, "dll/m456dll.rel") +OVL_DEFINE(OVL_M457, "dll/m457dll.rel") +OVL_DEFINE(OVL_M458, "dll/m458dll.rel") +OVL_DEFINE(OVL_M459, "dll/m459dll.rel") +OVL_DEFINE(OVL_M460, "dll/m460dll.rel") +OVL_DEFINE(OVL_M461, "dll/m461dll.rel") +OVL_DEFINE(OVL_M462, "dll/m462dll.rel") +OVL_DEFINE(OVL_M463, "dll/m463dll.rel") +OVL_DEFINE(OVL_MENT, "dll/mentdll.rel") +OVL_DEFINE(OVL_MESS, "dll/messdll.rel") +OVL_DEFINE(OVL_MGMODE, "dll/mgmodedll.rel") +OVL_DEFINE(OVL_MODELTEST, "dll/modeltestdll.rel") +OVL_DEFINE(OVL_MODESEL, "dll/modeseldll.rel") +OVL_DEFINE(OVL_MPEX, "dll/mpexdll.rel") +OVL_DEFINE(OVL_MSETUP, "dll/msetupdll.rel") +OVL_DEFINE(OVL_MSTORY2, "dll/mstory2dll.rel") +OVL_DEFINE(OVL_MSTORY3, "dll/mstory3dll.rel") +OVL_DEFINE(OVL_MSTORY4, "dll/mstory4dll.rel") +OVL_DEFINE(OVL_MSTORY, "dll/mstorydll.rel") +OVL_DEFINE(OVL_NIS, "dll/nisdll.rel") +OVL_DEFINE(OVL_OPTION, "dll/option.rel") +OVL_DEFINE(OVL_PRESENT, "dll/present.rel") +OVL_DEFINE(OVL_RESULT, "dll/resultdll.rel") +OVL_DEFINE(OVL_SAF, "dll/safdll.rel") +OVL_DEFINE(OVL_SELMENU, "dll/selmenuDLL.rel") +OVL_DEFINE(OVL_STAFF, "dll/staffdll.rel") +OVL_DEFINE(OVL_SUBCHRSEL, "dll/subchrseldll.rel") +OVL_DEFINE(OVL_W01, "dll/w01dll.rel") +OVL_DEFINE(OVL_W02, "dll/w02dll.rel") +OVL_DEFINE(OVL_W03, "dll/w03dll.rel") +OVL_DEFINE(OVL_W04, "dll/w04dll.rel") +OVL_DEFINE(OVL_W05, "dll/w05dll.rel") +OVL_DEFINE(OVL_W06, "dll/w06dll.rel") +OVL_DEFINE(OVL_W10, "dll/w10dll.rel") +OVL_DEFINE(OVL_W20, "dll/w20dll.rel") +OVL_DEFINE(OVL_W21, "dll/w21dll.rel") +OVL_DEFINE(OVL_ZTAR, "dll/ztardll.rel") \ No newline at end of file diff --git a/include/variables.h b/include/variables.h index b2ccb5c0..bf9bc29f 100644 --- a/include/variables.h +++ b/include/variables.h @@ -22,4 +22,6 @@ extern WipeState wipeData; extern PlayerConfig gPlayerConfig[4]; +extern FileListEntry _ovltbl[]; + #endif diff --git a/src/REL/subchrselDll/subchrselDll.c b/src/REL/subchrselDll/subchrselDll.c index 20b9801f..32bdc533 100644 --- a/src/REL/subchrselDll/subchrselDll.c +++ b/src/REL/subchrselDll/subchrselDll.c @@ -97,7 +97,7 @@ static void SubchrMain() WipeCreate(2, 0, -1); HuPrcSleep(wipeData.duration+1.0f); fn_80035A0C(); - omOvlGotoEx(41, 1, 0, 0); + omOvlGotoEx(OVL_M433, 1, 0, 0); do { HuPrcVSleep(); } while(1); diff --git a/src/game/ovllist.c b/src/game/ovllist.c new file mode 100644 index 00000000..a4538483 --- /dev/null +++ b/src/game/ovllist.c @@ -0,0 +1,11 @@ +#include "common.h" + + +#define OVL_DEFINE(name, path) { path, 0 }, + +FileListEntry _ovltbl[OVL_COUNT+1] = { + #include "ovl_table.h" + { NULL, -1 } +}; + +#undef OVL_DEFINE \ No newline at end of file