diff --git a/.gitmodules b/.gitmodules index 0d026c88..0567f0e0 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,3 @@ -[submodule "tools/libyaz0"] - path = tools/libyaz0 - url = https://github.com/aboood40091/libyaz0 [submodule "tools/ppcdis"] path = tools/ppcdis url = https://github.com/SeekyCt/ppcdis diff --git a/README.MD b/README.MD index a6d823a6..b96c2225 100644 --- a/README.MD +++ b/README.MD @@ -4,7 +4,7 @@ Decompilation in progress of Animal Crossing (GAFE01) ## Cloning -Use `--recursive` when cloning to have ppcdis and libyaz0 in the repository. +Use `--recursive` when cloning to have ppcdis in the repository. ## Build @@ -13,7 +13,7 @@ Use `--recursive` when cloning to have ppcdis and libyaz0 in the repository. ### Building - Dump a copy of the game and extract **main.dol** and **foresta.rel.szs**. -- Decompress **foresta.rel.szs** with libyaz0 found in *tools/libyaz0*. +- Decompress **foresta.rel.szs** with yaz0 found in *tools/*. - Place **main.dol** and **foresta.rel** in *dump/*. - Place CodeWarrior 1.3.2 in *tools/1.3.2/*. - Install DevkitPPC, Ninja and Python: diff --git a/config/rel_slices.yml b/config/rel_slices.yml index d18dade3..3c324ff4 100644 --- a/config/rel_slices.yml +++ b/config/rel_slices.yml @@ -8,12 +8,16 @@ zurumode/zurumode_cleanup.c: .text: [0x8040efc4, 0x8040f008] # zurumode/zurumode_init.c: # .text: [0x8040ef58, 0x8040efc4] -# zurumode/zurumode_update.c: - # .text: [0x8040EDA8 , 0x8040ee74] Won't really bother at the moment with this one. + # .bss: [0x812f9670, 0x812f9680] +#zurumode/zurumode_update.c: + #.text: [0x8040EDA8, 0x8040ee74] m_random_field/mRF_MakePerfectBit.c: .text: [0x8050B1AC, 0x8050B1D4] m_random_field/mRF_GetRandomStepMode.c: .text: [0x8050B284, 0x8050B2C0] m_room_type/mRmTp_FtrItemNo2FtrIdx.c: .text: [0x803E7878, 0x803E78BC] - +# zurumode/zurumode.c: + # .text: [0x8040eb38, 0x8040f008] + # .bss: [0x812f9670, 0x812f9680] + # .data: [0x8065F9F0, 0x8065FA20] \ No newline at end of file diff --git a/include/zurumode.h b/include/zurumode.h index 10f29cd4..455a1133 100644 --- a/include/zurumode.h +++ b/include/zurumode.h @@ -8,14 +8,14 @@ #include "JSystem/JUT/JUTAssertion.h" #include "JSystem/JUT/JUTDbPrint.h" -typedef struct zuru_keycheck_s { +typedef struct zuru_keycheck { u8 state; u8 progressing; u16 last_controller; u8 zurumode_enabled; } zuru_keycheck; -typedef struct { // This needs to be researched and in its corresponding file tbh +typedef struct { u8 pad_pattern; void (*callback)(void*); void* callback_param; @@ -24,12 +24,11 @@ typedef struct { // This needs to be researched and in its corresponding file tb } padmgr; extern padmgr padmgr_class; -extern zuru_keycheck zuruKeyCheck; - +extern s32 zurumode_flag; void zurumode_cleanup(void); int zerucheck_init(zuru_keycheck* key_check); -void zurumode_update(void); +s32 zurumode_update(void); void zurumode_callback(void* padmgr); int zerucheck_key_check(zuru_keycheck* key_check, u32 controller); diff --git a/rel/zurumode/zurumode.c b/rel/zurumode/zurumode.c index 822dd95e..8d1ce770 100644 --- a/rel/zurumode/zurumode.c +++ b/rel/zurumode/zurumode.c @@ -1,5 +1,8 @@ #include "zurumode.h" +static zuru_keycheck zuruKeyCheck; +static s32 zurumode_flag; + int zerucheck_init(zuru_keycheck* key_check) { key_check->zurumode_enabled = FALSE; key_check->state = ZURUMODE_STAGE_BEGIN_e; @@ -224,7 +227,7 @@ void zurumode_callback(padmgr* padmgr) { zurumode_update(); } -// Padmgr struct might be huge lol, anyway I think it's matched, +// Padmgr struct is unknown, anyway I think it's matched, //just that the struct that is declared here it's not that accurate //and pad_pattern is at 0x42E @@ -237,7 +240,7 @@ void zurumode_init(void){ zurumode_update(); } -void zurumode_cleanup(void) { // Hm, this looks like PADMGR_UNSET_RETRACE_CALLBACK macro lol +void zurumode_cleanup(void) { // Hm, this looks like PADMGR_UNSET_RETRACE_CALLBACK macro if ((padmgr_class.callback2 == &zurumode_callback) && (padmgr_class.callback2_param == &padmgr_class)) { padmgr_class.callback2 = NULL; padmgr_class.callback2_param = NULL; diff --git a/rel/zurumode/zurumode_cleanup.c b/rel/zurumode/zurumode_cleanup.c index 328f3b4c..3c213677 100644 --- a/rel/zurumode/zurumode_cleanup.c +++ b/rel/zurumode/zurumode_cleanup.c @@ -1,6 +1,5 @@ #include "zurumode.h" -extern s32 zurumode_flag; void zurumode_cleanup(void) { // Hm, this looks like PADMGR_UNSET_RETRACE_CALLBACK macro lol if ((padmgr_class.callback2 == &zurumode_callback) && (padmgr_class.callback2_param == &padmgr_class)) { padmgr_class.callback2 = NULL; diff --git a/rel/zurumode/zurumode_init.c b/rel/zurumode/zurumode_init.c index 6943ac32..1ef8cd96 100644 --- a/rel/zurumode/zurumode_init.c +++ b/rel/zurumode/zurumode_init.c @@ -1,6 +1,5 @@ #include "zurumode.h" -extern s32 zurumode_flag; void zurumode_init(void){ zurumode_flag = 0; zerucheck_init(&zuruKeyCheck); diff --git a/rel/zurumode/zurumode_update.c b/rel/zurumode/zurumode_update.c index 776aa048..b81a1836 100644 --- a/rel/zurumode/zurumode_update.c +++ b/rel/zurumode/zurumode_update.c @@ -1,6 +1,5 @@ #include "zurumode.h" -extern s32 zurumode_flag; s32 zurumode_update() { s32 flag_now; s32 zurumode_now; diff --git a/tools/libyaz0 b/tools/libyaz0 deleted file mode 160000 index 5b598640..00000000 --- a/tools/libyaz0 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 5b5986401dbdc39fee9011b8848a095ca7646f77 diff --git a/tools/yaz0 b/tools/yaz0 new file mode 100644 index 00000000..0298c726 Binary files /dev/null and b/tools/yaz0 differ