From 59bbc7b2950f2224f2a5fde4f3f60fcb2c0473ec Mon Sep 17 00:00:00 2001 From: shy Date: Wed, 16 Jul 2025 17:31:37 -0400 Subject: [PATCH] renaming on fragments 3 18 19 20 and 21 --- include/global.h | 6 +- linker_scripts/us/symbol_addrs.txt | 6 +- linker_scripts/us/symbol_addrs_code.txt | 22 +- src/fragments/18/fragment18.c | 619 ++++++++++++------------ src/fragments/18/fragment18.h | 64 +-- src/fragments/19/fragment19.c | 20 +- src/fragments/20/fragment20.c | 146 +++--- src/fragments/20/fragment20.h | 38 +- src/fragments/21/fragment21.c | 136 +++--- src/fragments/21/fragment21.h | 24 +- src/fragments/3/fragment3.h | 94 ++-- src/fragments/3/fragment3_1189B0.c | 176 +++---- src/fragments/3/fragment3_1193E0.c | 88 ++-- src/fragments/3/fragment3_11BBF0.c | 2 +- src/fragments/3/fragment3_11BF90.c | 24 +- 15 files changed, 728 insertions(+), 737 deletions(-) diff --git a/include/global.h b/include/global.h index a37350c..39a5006 100644 --- a/include/global.h +++ b/include/global.h @@ -245,10 +245,10 @@ typedef struct unk_D_86002F34_00C_0CC { typedef struct unk_D_86002F34_00C { /* 0x00 */ GraphNode unk_00; - /* 0x18 */ unk_D_86002F34_00C_018 unk_18; - /* 0x24 */ unk_D_86002F34_00C_024 unk_24; + /* 0x18 */ unk_D_86002F34_00C_018 unk_18; // viewPort + /* 0x24 */ unk_D_86002F34_00C_024 unk_24; // projection /* 0x40 */ unk_D_86002F34_00C_040 unk_40; - /* 0x60 */ unk_D_86002F34_00C_060 unk_60; + /* 0x60 */ unk_D_86002F34_00C_060 unk_60; // camera /* 0xCC */ unk_D_86002F34_00C_0CC unk_CC; /* 0xEC */ char unkEC[0x4]; } unk_D_86002F34_00C; // size = 0xF0 diff --git a/linker_scripts/us/symbol_addrs.txt b/linker_scripts/us/symbol_addrs.txt index 8550aa1..b584422 100644 --- a/linker_scripts/us/symbol_addrs.txt +++ b/linker_scripts/us/symbol_addrs.txt @@ -72,7 +72,7 @@ gEepromMesgQueue = 0x800A7400; gEepromMesgBuf = 0x800A73FC; .L8120A860 = 0x8120A860; D_8780FA30 = 0x8780FA30; // size:0x8 -D_87906044 = 0x87906044; +showMinigameHUD = 0x87906044; D_87906048 = 0x87906048; D_87906060 = 0x87906060; D_87906064 = 0x87906064; @@ -308,7 +308,7 @@ gGeoLayoutStackIndex = 0x800ABDFA; // size:0x2 gGeoLayoutReturnIndex = 0x800ABDFE; // size:0x2 gCurGraphNodeList = 0x800ABD78; // size:0x80 gCurGraphNodeIndex = 0x800ABDF8; // size:0x2 -D_8790606C = 0x8790606C; // size:0x6 +minigameCameraCoords = 0x8790606C; // size:0x6 D_87906088 = 0x87906088; // size:0xC D_8790609C = 0x8790609C; // size:0x6 D_879060AC = 0x879060AC; // size:0x6 @@ -355,7 +355,7 @@ D_86A06248 = 0x86A06248; // size:0xC D_86C0E480 = 0x86C0E480; // size:0x1854 D_86C0FCD8 = 0x86C0FCD8; // size:0x1854 D_86C11530 = 0x86C11530; // size:0xAD0 -D_879060BC = 0x879060BC; // size:0x2 +tempControllerPtr = 0x879060BC; // size:0x2 D_86E04D60 = 0x86E04D60; // size:0xAD0 D_86E05830 = 0x86E05830; // size:0x3610 D_4006A60 = 0x4006A60; diff --git a/linker_scripts/us/symbol_addrs_code.txt b/linker_scripts/us/symbol_addrs_code.txt index a1a6fa2..2b010f2 100644 --- a/linker_scripts/us/symbol_addrs_code.txt +++ b/linker_scripts/us/symbol_addrs_code.txt @@ -2091,8 +2091,8 @@ func_87804320 = 0x87804320; // type:func func_87804AD0 = 0x87804AD0; // type:func func_87804FD4 = 0x87804FD4; // type:func func_87900020 = 0x87900020; // type:func -func_8790002C = 0x8790002C; // type:func -func_87900070 = 0x87900070; // type:func +getVec3Distance_xz = 0x8790002C; // type:func +getVec3Distance_xyz = 0x87900070; // type:func func_879000C4 = 0x879000C4; // type:func func_879001A4 = 0x879001A4; // type:func func_879002B8 = 0x879002B8; // type:func @@ -2115,9 +2115,9 @@ func_87900920 = 0x87900920; // type:func func_879009B4 = 0x879009B4; // type:func func_87900A50 = 0x87900A50; // type:func func_87900B64 = 0x87900B64; // type:func -func_87900C5C = 0x87900C5C; // type:func -func_87900F44 = 0x87900F44; // type:func -func_879010A4 = 0x879010A4; // type:func +minigameDebuggModeControll = 0x87900C5C; // type:func +showDebuggCameraInfo = 0x87900F44; // type:func +showDebuggJoystickInfo = 0x879010A4; // type:func func_87901200 = 0x87901200; // type:func func_87901620 = 0x87901620; // type:func func_8790168C = 0x8790168C; // type:func @@ -2747,7 +2747,7 @@ func_86C022D8 = 0x86C022D8; // type:func func_86C02324 = 0x86C02324; // type:func func_86C02514 = 0x86C02514; // type:func func_86C02610 = 0x86C02610; // type:func -func_86C026F0 = 0x86C026F0; // type:func +initDiglettHole = 0x86C026F0; // type:func func_86C0276C = 0x86C0276C; // type:func func_86C027BC = 0x86C027BC; // type:func func_86C02804 = 0x86C02804; // type:func @@ -2761,7 +2761,7 @@ func_86C030EC = 0x86C030EC; // type:func func_86C03128 = 0x86C03128; // type:func func_86C031E4 = 0x86C031E4; // type:func func_86C03258 = 0x86C03258; // type:func -func_86C03344 = 0x86C03344; // type:func +ekansMinigameNextStep = 0x86C03344; // type:func func_86C03500 = 0x86C03500; // type:func func_86C035E0 = 0x86C035E0; // type:func func_86C03608 = 0x86C03608; // type:func @@ -2772,11 +2772,11 @@ func_86C03E4C = 0x86C03E4C; // type:func func_86C03E8C = 0x86C03E8C; // type:func func_86C03ED4 = 0x86C03ED4; // type:func func_86C040B4 = 0x86C040B4; // type:func -func_86C04170 = 0x86C04170; // type:func -func_86C041E8 = 0x86C041E8; // type:func -func_86C043C4 = 0x86C043C4; // type:func +initEkansMinigameAssets = 0x86C04170; // type:func +showTutorialScreenEkansMinigame = 0x86C041E8; // type:func +ekansMinigameUpdate = 0x86C043C4; // type:func func_86C044B4 = 0x86C044B4; // type:func -func_86C046B0 = 0x86C046B0; // type:func +startSkansMinigame = 0x86C046B0; // type:func func_86D00020 = 0x86D00020; // type:func func_86D000A8 = 0x86D000A8; // type:func func_86D000D0 = 0x86D000D0; // type:func diff --git a/src/fragments/18/fragment18.c b/src/fragments/18/fragment18.c index 3cdd29f..dbf17d1 100644 --- a/src/fragments/18/fragment18.c +++ b/src/fragments/18/fragment18.c @@ -39,25 +39,25 @@ extern u8 D_030426E0[]; extern u8 D_03042E00[]; typedef struct unk_D_86C12008 { - /* 0x00 */ s16 unk_00; - /* 0x02 */ s16 unk_02; + /* 0x00 */ s16 unk_00; // -1 + /* 0x02 */ s16 unk_02; // 0 /* 0x04 */ s16 unk_04; - /* 0x06 */ s16 unk_06; - /* 0x08 */ s16 unk_08; - /* 0x0A */ s16 unk_0A; + /* 0x06 */ s16 unk_06; // 0 + /* 0x08 */ s16 unk_08; // 0 + /* 0x0A */ s16 unk_0A; // 0 /* 0x0C */ s16 unk_0C; } unk_D_86C12008; // size = 0xE -typedef struct unk_D_86C0E1CC { - /* 0x00 */ Vec3f unk_00; +typedef struct actorInitialPosition { + /* 0x00 */ Vec3f pos; /* 0x0C */ char unk0C[0x6]; /* 0x12 */ s16 unk_12; /* 0x12 */ s16 unk_14; -} unk_D_86C0E1CC; // size = 0x18 +} actorInitialPosition; // size = 0x18 -static unk_func_8790002C D_86C0E480[9]; -static unk_func_8790002C D_86C0FCD8[9]; -static unk_func_8790002C D_86C11530[4]; +static minigameActor D_86C0E480[9]; +static minigameActor D_86C0FCD8[9]; +static minigameActor D_86C11530[4]; static unk_D_800AC870* D_86C12000; static unk_D_86C12008 D_86C12008[3]; static s32 D_86C12034; @@ -85,7 +85,7 @@ static u32 D_86C049D0[] = { 0x00010000, 0x00000000, 0x00050050, D_86C049D0, D_86C04840, }; -static u32 D_86C049F8[] = { +static u32 redDiglettTileTexture[] = { 0xD5EDD62D, 0xD5EDD5ED, 0xD5EDD5ED, 0xD5EDD5ED, 0xD5EDD5ED, 0xD5EDD5ED, 0xD5EDD5EB, 0xD5EDD5ED, 0xD5EDD5ED, 0xD5EDD5ED, 0xD5EDD5ED, 0xD5EDD5ED, 0xD5EDD5ED, 0xD5EDD5ED, 0xD5EDD5ED, 0xD5EDD5ED, 0xD5EDD5EB, 0xD5ABD5AB, 0xD5ABD5AB, 0xD5ABD5A9, 0xD5A9D5A9, 0xD5A9D5A9, 0xD5A9D5A9, 0xD5A9D5A9, 0xD5A9D5A9, 0xD5A9D5A9, 0xD5A9D5A9, @@ -202,7 +202,7 @@ static u32 D_86C049F8[] = { 0xD5EBD5EB, 0xD5EBD5EB, 0xD5EBD5EB, 0xD5EBD5EB, 0xD5EBD5EB, 0xD5EBD5EB, 0xD5EBD5EB, }; -static u32 D_86C059F8[] = { +static u32 yellowDiglettTileTexture[] = { 0xD66DD66D, 0xD66DD66D, 0xD66DD66D, 0xD66DD66D, 0xD66DD66D, 0xD66DD66D, 0xD66DD66B, 0xD66DD66D, 0xD66DD66D, 0xD66DD66D, 0xD66DD66D, 0xD66DD66D, 0xD66DD66D, 0xD66DD66D, 0xD66DD66D, 0xD66DD66D, 0xD66DD66B, 0xD66BD66B, 0xD66BD66B, 0xD66BD669, 0xD629D669, 0xD669D669, 0xD669D669, 0xD669D669, 0xD669D669, 0xD669D669, 0xD669D669, @@ -319,7 +319,7 @@ static u32 D_86C059F8[] = { 0xD66BD66B, 0xD66BD66B, 0xD66BD66B, 0xD66BD66B, 0xD66BD66B, 0xD66BD66B, 0xD66BD66B, }; -static u32 D_86C069F8[] = { +static u32 blueDiglettTileTexture[] = { 0xCE37CE37, 0xC637C637, 0xC637C637, 0xC637C637, 0xC637C637, 0xC5F7C5F7, 0xC5F7C5F7, 0xC5F7C5F7, 0xC5F7C5F7, 0xC5F7C5F7, 0xC5F7C5F7, 0xC5F7C5F7, 0xC5F7C5F7, 0xC5F7C5F7, 0xC5F7C5F7, 0xC5F7C5F7, 0xC637C5F7, 0xC5F7C5F7, 0xC5F7C5F7, 0xC5F7C5F7, 0xBDF7C5F7, 0xC5F7BDF7, 0xBDB7BDB7, 0xBDB7BDB7, 0xBDB7BDB7, 0xBDB7BDB7, 0xBDB7BDB7, @@ -436,7 +436,7 @@ static u32 D_86C069F8[] = { 0xC5F7C5F7, 0xC5F7C5F7, 0xC5F7C5F7, 0xC5F7C5F7, 0xC5F7C5F7, 0xC5F7C5F7, 0xC5F7C5F7, }; -static u32 D_86C079F8[] = { +static u32 floorTexture1[] = { 0x8AE18AE1, 0x8AE18AE1, 0x8AE18AE1, 0x8AE18AE1, 0x8AE18AE1, 0x8AE18AE1, 0x8AE182E1, 0x82A1CD9F, 0xCD9F82A1, 0x82E18AE1, 0x8AE18AE1, 0x8AE18AE1, 0x8AE18AE1, 0x8AE18AE1, 0x8AE18AE1, 0x8AE18AE1, 0x8AE18AE1, 0x8AE18AE1, 0x8AE18AE1, 0x8AE18AE1, 0x8AE18AE1, 0x8AE18AE1, 0x82E182A1, 0xC55FFFDF, 0xFFDFC55F, 0x82A182E1, 0x8AE18AE1, @@ -496,7 +496,7 @@ static u32 D_86C079F8[] = { 0xCD9F82A1, 0x82E18AE1, 0x8AE18AE1, 0x8AE18AE1, 0x8AE18AE1, 0x8AE18AE1, 0x8AE18AE1, 0x8AE18AE1, }; -static u32 D_86C081F8[] = { +static u32 floorTexture2[] = { 0xFF7070FF, 0xFF7070FF, 0xFF7070FF, 0xFF7070FF, 0xFF7070FF, 0xFF7070FF, 0xFF7070FF, 0xFF7070FF, 0xFF7070FF, 0xFF7070FF, 0xFF7070FF, 0xFF7070FF, 0xFF7070FF, 0xFF7070FF, 0xFF7070FF, 0xFF7070FF, 0xFF7070FF, 0xFF7070FF, 0xFF7070FF, 0xFF7070FF, 0xFF7070FF, 0xFF7070FF, 0xFF7070FF, 0xFF7070FF, 0xFF7070FF, 0xFF7070FF, 0xFF7070FF, @@ -613,7 +613,7 @@ static u32 D_86C081F8[] = { 0xFF7070FF, 0xFF7070FF, 0xFF7070FF, 0xFF7070FF, 0xFF7070FF, 0xFF7070FF, 0xFF7070FF, }; -static u32 D_86C091F8[] = { +static u32 sceneDecorationTextureBlue[] = { 0xCCF1CCF1, 0xCCF1CCF1, 0xCCF1CCF1, 0xCCF1C4F1, 0xC4EFBCAD, 0xAC2993E5, 0x83617B1D, 0x72DB6A9B, 0x6ADB72DB, 0x7B1D8B61, 0x9BE5AC69, 0xBCADC4EF, 0xC4F1CCF1, 0xCCF1CCF1, 0xCCF1CCF1, 0xCCF1CCF1, 0xCCF1CCF1, 0xCCF1CCF1, 0xCCF1CCF1, 0xC4EFBCAD, 0xA4298B61, 0x6A995A57, 0x5A576257, 0x6A996ADB, 0x6A9B6A99, 0x62595A57, 0x5A576A99, @@ -673,7 +673,7 @@ static u32 D_86C091F8[] = { 0x62996A99, 0x72DB831F, 0x93A5AC29, 0xB4ADC4AF, 0xC4EFCCF1, 0xCCF1CCF1, 0xCCF1CCF1, 0xCCF1CCF1, }; -static u32 D_86C099F8[] = { +static u32 sceneDecorationTextureGreen[] = { 0xCCF1CCF1, 0xCCF1CCF1, 0xCCF1CCF1, 0xCCF1C4F1, 0xC4EFBCAD, 0xAC2993E5, 0x83617B1D, 0x72DB6A9B, 0x6ADB72DB, 0x7B1D8B61, 0x9BE5AC69, 0xBCADC4EF, 0xC4F1CCF1, 0xCCF1CCF1, 0xCCF1CCF1, 0xCCF1CCF1, 0xCCF1CCF1, 0xCCF1CCF1, 0xCCF1CCF1, 0xC4EFBCAD, 0xA4298B61, 0x6A995A57, 0x5A576257, 0x6A996ADB, 0x6A9B6A99, 0x62595A57, 0x5A576A99, @@ -733,7 +733,7 @@ static u32 D_86C099F8[] = { 0x62996A99, 0x72DB831F, 0x93A5AC29, 0xB4ADC4AF, 0xC4EFCCF1, 0xCCF1CCF1, 0xCCF1CCF1, 0xCCF1CCF1, }; -static u32 D_86C0A1F8[] = { +static u32 sceneDecorationTextureRed[] = { 0xCCF1CCF1, 0xCCF1CCF1, 0xCCF1CCF1, 0xCCF1C4F1, 0xC4EFBCAD, 0xAC2993E5, 0x83617B1D, 0x72DB6A9B, 0x6ADB72DB, 0x7B1D8B61, 0x9BE5AC69, 0xBCADC4EF, 0xC4F1CCF1, 0xCCF1CCF1, 0xCCF1CCF1, 0xCCF1CCF1, 0xCCF1CCF1, 0xCCF1CCF1, 0xCCF1CCF1, 0xC4EFBCAD, 0xA4298B61, 0x6A995A57, 0x5A576257, 0x6A996ADB, 0x6A9B6A99, 0x62595A57, 0x5A576A99, @@ -793,7 +793,7 @@ static u32 D_86C0A1F8[] = { 0x62996A99, 0x72DB831F, 0x93A5AC29, 0xB4ADC4AF, 0xC4EFCCF1, 0xCCF1CCF1, 0xCCF1CCF1, 0xCCF1CCF1, }; -static u32 D_86C0A9F8[] = { +static u32 sceneDecorationTextureYellow[] = { 0xCCF1CCF1, 0xCCF1CCF1, 0xCCF1CCF1, 0xCCF1C4F1, 0xC4EFBCAD, 0xAC2993E5, 0x83617B1D, 0x72DB6A9B, 0x6ADB72DB, 0x7B1D8B61, 0x9BE5AC69, 0xBCADC4EF, 0xC4F1CCF1, 0xCCF1CCF1, 0xCCF1CCF1, 0xCCF1CCF1, 0xCCF1CCF1, 0xCCF1CCF1, 0xCCF1CCF1, 0xC4EFBCAD, 0xA4298B61, 0x6A995A57, 0x5A576257, 0x6A996ADB, 0x6A9B6A99, 0x62595A57, 0x5A576A99, @@ -853,6 +853,7 @@ static u32 D_86C0A9F8[] = { 0x62996A99, 0x72DB831F, 0x93A5AC29, 0xB4ADC4AF, 0xC4EFCCF1, 0xCCF1CCF1, 0xCCF1CCF1, 0xCCF1CCF1, }; +// unused or unshown decoration texture? static u32 D_86C0B1F8[] = { 0xCCF1CCF1, 0xCCF1CCF1, 0xCCF1CCF1, 0xCCF1C4F1, 0xC4EFBCAD, 0xAC2993E5, 0x83617B1D, 0x72DB6A9B, 0x6ADB72DB, 0x7B1D8B61, 0x9BE5AC69, 0xBCADC4EF, 0xC4F1CCF1, 0xCCF1CCF1, 0xCCF1CCF1, 0xCCF1CCF1, 0xCCF1CCF1, 0xCCF1CCF1, @@ -912,14 +913,15 @@ static u32 D_86C0B1F8[] = { 0xCCF1CCF1, 0xCCF1CCF1, 0xCCF1CCF1, 0xCCF1CCF1, 0xCCF1C4F1, 0xC4EFB4AD, 0xAC2993A5, 0x831F72DB, 0x6A996299, 0x62996A99, 0x72DB831F, 0x93A5AC29, 0xB4ADC4AF, 0xC4EFCCF1, 0xCCF1CCF1, 0xCCF1CCF1, 0xCCF1CCF1, }; -static unk_D_86002F34_018 D_86C0B9F8[] = { + +static unk_D_86002F34_018 sceneTextures[] = { { 0x00, unk_D_86002F34_018_GFX_TYPE_2, 32, 64, 2048, - D_86C049F8, + redDiglettTileTexture, }, { 0x00, @@ -927,7 +929,7 @@ static unk_D_86002F34_018 D_86C0B9F8[] = { 32, 64, 2048, - D_86C059F8, + yellowDiglettTileTexture, }, { 0x00, @@ -935,7 +937,7 @@ static unk_D_86002F34_018 D_86C0B9F8[] = { 32, 64, 2048, - D_86C069F8, + blueDiglettTileTexture, }, { 0x00, @@ -943,7 +945,7 @@ static unk_D_86002F34_018 D_86C0B9F8[] = { 32, 32, 1024, - D_86C079F8, + floorTexture1, }, { 0x00, @@ -951,7 +953,7 @@ static unk_D_86002F34_018 D_86C0B9F8[] = { 32, 32, 1024, - D_86C081F8, + floorTexture2, }, { 0x00, @@ -959,7 +961,7 @@ static unk_D_86002F34_018 D_86C0B9F8[] = { 32, 32, 1024, - D_86C091F8, + sceneDecorationTextureBlue, }, { 0x00, @@ -967,7 +969,7 @@ static unk_D_86002F34_018 D_86C0B9F8[] = { 32, 32, 1024, - D_86C099F8, + sceneDecorationTextureGreen, }, { 0x00, @@ -975,7 +977,7 @@ static unk_D_86002F34_018 D_86C0B9F8[] = { 32, 32, 1024, - D_86C0A1F8, + sceneDecorationTextureRed, }, { 0x00, @@ -983,7 +985,7 @@ static unk_D_86002F34_018 D_86C0B9F8[] = { 32, 32, 1024, - D_86C0A9F8, + sceneDecorationTextureYellow, }, { 0x00, @@ -1046,7 +1048,8 @@ static Gfx D_86C0BB28[] = { gsSPEndDisplayList(), }; -static Vtx D_86C0BB68[] = { +// red quads +static Vtx sceneGeometry_1[] = { VTX(880, 0, 880, 10240, 10239, 0x00, 0x78, 0x00, 0xFF), VTX(440, 0, 880, 8191, 10239, 0x00, 0x78, 0x00, 0xFF), VTX(440, 0, 1320, 8191, 12287, 0x00, 0x78, 0x00, 0xFF), VTX(880, 0, 1320, 10240, 12287, 0x00, 0x78, 0x00, 0xFF), VTX(-880, 0, -880, 2048, 2047, 0x00, 0x78, 0x00, 0xFF), VTX(-1320, 0, -880, 0, 2047, 0x00, 0x78, 0x00, 0xFF), @@ -1065,7 +1068,8 @@ static Vtx D_86C0BB68[] = { VTX(0, 0, 0, 6144, 6143, 0x00, 0x78, 0x00, 0xFF), VTX(-440, 0, 440, 4096, 8191, 0x00, 0x78, 0x00, 0xFF), }; -static Vtx D_86C0BD68[] = { +// red quads +static Vtx sceneGeometry_2[] = { VTX(0, 0, 0, 6144, 6143, 0x00, 0x78, 0x00, 0xFF), VTX(-440, 0, 440, 4096, 8191, 0x00, 0x78, 0x00, 0xFF), VTX(0, 0, 440, 6144, 8191, 0x00, 0x78, 0x00, 0xFF), VTX(440, 0, 440, 8191, 8191, 0x00, 0x78, 0x00, 0xFF), VTX(0, 0, 880, 6144, 10239, 0x00, 0x78, 0x00, 0xFF), VTX(440, 0, 880, 8191, 10239, 0x00, 0x78, 0x00, 0xFF), @@ -1075,7 +1079,8 @@ static Vtx D_86C0BD68[] = { VTX(880, 0, 0, 10240, 6143, 0x00, 0x78, 0x00, 0xFF), }; -static Vtx D_86C0BE38[] = { +// yellow quads +static Vtx sceneGeometry_3[] = { VTX(-440, 0, -880, 4096, 2048, 0x00, 0x78, 0x00, 0xFF), VTX(-880, 0, -880, 2048, 2048, 0x00, 0x78, 0x00, 0xFF), VTX(-880, 0, -440, 2048, 4096, 0x00, 0x78, 0x00, 0xFF), VTX(-440, 0, -440, 4096, 4096, 0x00, 0x78, 0x00, 0xFF), VTX(880, 0, 440, 10240, 8191, 0x00, 0x78, 0x00, 0xFF), VTX(440, 0, 440, 8191, 8191, 0x00, 0x78, 0x00, 0xFF), @@ -1094,7 +1099,8 @@ static Vtx D_86C0BE38[] = { VTX(-880, 0, 440, 2048, 8191, 0x00, 0x78, 0x00, 0xFF), }; -static Vtx D_86C0C028[] = { +// yellow quads +static Vtx sceneGeometry_4[] = { VTX(440, 0, -1320, 8191, 0, 0x00, 0x78, 0x00, 0xFF), VTX(0, 0, -1320, 6144, 0, 0x00, 0x78, 0x00, 0xFF), VTX(0, 0, -880, 6144, 2048, 0x00, 0x78, 0x00, 0xFF), VTX(440, 0, -880, 8191, 2048, 0x00, 0x78, 0x00, 0xFF), VTX(880, 0, -880, 10240, 2048, 0x00, 0x78, 0x00, 0xFF), VTX(440, 0, -440, 8191, 4096, 0x00, 0x78, 0x00, 0xFF), @@ -1103,7 +1109,8 @@ static Vtx D_86C0C028[] = { VTX(-440, 0, 880, 4096, 10240, 0x00, 0x78, 0x00, 0xFF), }; -static Vtx D_86C0C0D8[] = { +// blue quads +static Vtx sceneGeometry_5[] = { VTX(-880, 0, -440, 2048, 4096, 0x00, 0x78, 0x00, 0xFF), VTX(-1320, 0, -440, 0, 4096, 0x00, 0x78, 0x00, 0xFF), VTX(-1320, 0, 0, 0, 6144, 0x00, 0x78, 0x00, 0xFF), VTX(-880, 0, 0, 2048, 6144, 0x00, 0x78, 0x00, 0xFF), VTX(0, 0, 440, 6144, 8191, 0x00, 0x78, 0x00, 0xFF), VTX(-440, 0, 440, 4096, 8191, 0x00, 0x78, 0x00, 0xFF), @@ -1122,7 +1129,8 @@ static Vtx D_86C0C0D8[] = { VTX(-880, 0, 1320, 2048, 12288, 0x00, 0x78, 0x00, 0xFF), }; -static Vtx D_86C0C2C8[] = { +// blue quads +static Vtx sceneGeometry_6[] = { VTX(880, 0, -1320, 10240, 0, 0x00, 0x78, 0x00, 0xFF), VTX(440, 0, -1320, 8191, 0, 0x00, 0x78, 0x00, 0xFF), VTX(440, 0, -880, 8191, 2048, 0x00, 0x78, 0x00, 0xFF), VTX(880, 0, -880, 10240, 2048, 0x00, 0x78, 0x00, 0xFF), VTX(0, 0, -880, 6144, 2048, 0x00, 0x78, 0x00, 0xFF), VTX(-440, 0, -880, 4096, 2048, 0x00, 0x78, 0x00, 0xFF), @@ -1131,7 +1139,8 @@ static Vtx D_86C0C2C8[] = { VTX(1320, 0, -880, 12288, 2048, 0x00, 0x78, 0x00, 0xFF), }; -static Vtx D_86C0C378[] = { +// second floor +static Vtx sceneGeometry_7[] = { VTX(584, 50, -1431, 14262, 5137, 0xF1, 0x61, 0x44, 0xFF), VTX(673, 750, -1822, 14262, 358, 0xE9, 0x3B, 0x65, 0xFF), VTX(-673, 750, -1822, 16457, 358, 0x17, 0x3B, 0x65, 0xFF), @@ -1150,7 +1159,8 @@ static Vtx D_86C0C378[] = { VTX(1636, 50, -924, 12068, 5137, 0xD5, 0x61, 0x36, 0xFF), }; -static Vtx D_86C0C478[] = { +// yellow stairs +static Vtx sceneGeometry_8[] = { VTX(-2624, 50, 1128, 2560, -71, 0x45, 0x60, 0x0F, 0xFF), VTX(-2375, 0, 1128, 2560, 1066, 0x17, 0x75, 0x05, 0xFF), VTX(-2140, 0, 97, 2194, 1066, 0x15, 0x75, 0x0A, 0xFF), VTX(-2364, 50, -11, 2194, -71, 0x3E, 0x61, 0x1E, 0xFF), VTX(2364, 50, -11, 5485, -71, 0xC2, 0x61, 0x1E, 0xFF), VTX(2140, 0, 97, 5485, 1066, 0xEB, 0x75, 0x0A, 0xFF), @@ -1162,7 +1172,8 @@ static Vtx D_86C0C478[] = { VTX(-1636, 50, -924, 1828, -71, 0x2B, 0x61, 0x36, 0xFF), VTX(-1481, 0, -729, 1828, 1066, 0x0E, 0x75, 0x12, 0xFF), }; -static Vtx D_86C0C598[] = { +// red decoration +static Vtx sceneGeometry_9[] = { VTX(27, 262, -1502, 693, 149, 0x29, 0x6E, 0x12, 0xFF), VTX(53, 240, -1542, 874, 149, 0x53, 0x4B, 0xD5, 0xFF), VTX(0, 259, -1553, 512, 0, 0x00, 0x67, 0xC4, 0xFF), VTX(38, 226, -1459, 768, 511, 0x3C, 0x33, 0x59, 0xFF), VTX(75, 194, -1515, 1024, 511, 0x78, 0x00, 0x00, 0xFF), VTX(27, 171, -1449, 693, 874, 0x29, 0xD9, 0x69, 0xFF), @@ -1172,7 +1183,8 @@ static Vtx D_86C0C598[] = { VTX(-75, 194, -1515, 0, 511, 0x88, 0x00, 0x00, 0xFF), VTX(-53, 148, -1488, 149, 874, 0xAD, 0xB5, 0x2B, 0xFF), }; -static Vtx D_86C0C678[] = { +// green decoration +static Vtx sceneGeometry_10[] = { VTX(588, 262, -1502, 693, 149, 0x29, 0x6E, 0x12, 0xFF), VTX(615, 240, -1542, 874, 149, 0x53, 0x4B, 0xD5, 0xFF), VTX(562, 259, -1553, 512, 0, 0x00, 0x67, 0xC4, 0xFF), VTX(599, 226, -1459, 768, 511, 0x3C, 0x33, 0x59, 0xFF), VTX(637, 194, -1515, 1024, 511, 0x78, 0x00, 0x00, 0xFF), VTX(588, 171, -1449, 693, 874, 0x29, 0xD9, 0x69, 0xFF), @@ -1182,7 +1194,8 @@ static Vtx D_86C0C678[] = { VTX(486, 194, -1515, 0, 511, 0x88, 0x00, 0x00, 0xFF), VTX(508, 148, -1488, 149, 874, 0xAD, 0xB5, 0x2B, 0xFF), }; -static Vtx D_86C0C758[] = { +// yellow decoration +static Vtx sceneGeometry_11[] = { VTX(-535, 262, -1502, 693, 149, 0x29, 0x6E, 0x12, 0xFF), VTX(-508, 240, -1542, 874, 149, 0x53, 0x4B, 0xD5, 0xFF), VTX(-562, 259, -1553, 512, 0, 0x00, 0x67, 0xC4, 0xFF), VTX(-524, 226, -1459, 768, 511, 0x3C, 0x33, 0x59, 0xFF), VTX(-486, 194, -1515, 1024, 511, 0x78, 0x00, 0x00, 0xFF), VTX(-535, 171, -1449, 693, 874, 0x29, 0xD9, 0x69, 0xFF), @@ -1192,7 +1205,8 @@ static Vtx D_86C0C758[] = { VTX(-637, 194, -1515, 0, 511, 0x88, 0x00, 0x00, 0xFF), VTX(-615, 148, -1488, 149, 874, 0xAD, 0xB5, 0x2B, 0xFF), }; -static Vtx D_86C0C838[] = { +// blue right decoration +static Vtx sceneGeometry_12[] = { VTX(1093, 262, -1268, 693, 149, 0x20, 0x6E, 0x20, 0xFF), VTX(1132, 240, -1297, 874, 149, 0x5C, 0x4B, 0xF4, 0xFF), VTX(1086, 259, -1325, 512, 0, 0x14, 0x67, 0xC8, 0xFF), VTX(1089, 226, -1224, 768, 511, 0x19, 0x33, 0x69, 0xFF), VTX(1143, 194, -1264, 1024, 511, 0x70, 0x00, 0x29, 0xFF), VTX(1075, 171, -1219, 693, 874, 0x02, 0xD9, 0x71, 0xFF), @@ -1202,7 +1216,8 @@ static Vtx D_86C0C838[] = { VTX(1003, 194, -1316, 0, 511, 0x90, 0x00, 0xD7, 0xFF), VTX(1014, 148, -1283, 149, 874, 0xA4, 0xB5, 0x0C, 0xFF), }; -static Vtx D_86C0C918[] = { +// blue left decoration +static Vtx sceneGeometry_13[] = { VTX(-1044, 262, -1287, 693, 149, 0x2D, 0x6E, 0x03, 0xFF), VTX(-1032, 240, -1333, 874, 149, 0x3F, 0x4B, 0xBB, 0xFF), VTX(-1086, 259, -1325, 512, 0, 0xEC, 0x67, 0xC8, 0xFF), @@ -1220,95 +1235,60 @@ static Vtx D_86C0C918[] = { }; static Gfx D_86C0C9F8[] = { - gsSPVertex(D_86C0C918, 14, 0), - gsSPSetGeometryMode(G_CULL_BACK), - gsSP2Triangles(0, 1, 2, 0, 3, 4, 1, 0), - gsSP2Triangles(3, 1, 0, 0, 5, 6, 4, 0), - gsSP2Triangles(5, 4, 3, 0, 6, 5, 7, 0), - gsSP2Triangles(8, 0, 2, 0, 9, 3, 0, 0), - gsSP2Triangles(9, 0, 8, 0, 10, 5, 3, 0), - gsSP2Triangles(10, 3, 9, 0, 5, 10, 7, 0), - gsSP2Triangles(11, 8, 2, 0, 12, 9, 8, 0), - gsSP2Triangles(12, 8, 11, 0, 13, 10, 9, 0), - gsSP2Triangles(13, 9, 12, 0, 10, 13, 7, 0), - gsSPEndDisplayList(), + gsSPVertex(sceneGeometry_13, 14, 0), gsSPSetGeometryMode(G_CULL_BACK), + gsSP2Triangles(0, 1, 2, 0, 3, 4, 1, 0), gsSP2Triangles(3, 1, 0, 0, 5, 6, 4, 0), + gsSP2Triangles(5, 4, 3, 0, 6, 5, 7, 0), gsSP2Triangles(8, 0, 2, 0, 9, 3, 0, 0), + gsSP2Triangles(9, 0, 8, 0, 10, 5, 3, 0), gsSP2Triangles(10, 3, 9, 0, 5, 10, 7, 0), + gsSP2Triangles(11, 8, 2, 0, 12, 9, 8, 0), gsSP2Triangles(12, 8, 11, 0, 13, 10, 9, 0), + gsSP2Triangles(13, 9, 12, 0, 10, 13, 7, 0), gsSPEndDisplayList(), }; static Gfx D_86C0CA58[] = { - gsSPVertex(D_86C0C838, 14, 0), - gsSPSetGeometryMode(G_CULL_BACK), - gsSP2Triangles(0, 1, 2, 0, 3, 4, 1, 0), - gsSP2Triangles(3, 1, 0, 0, 5, 6, 4, 0), - gsSP2Triangles(5, 4, 3, 0, 6, 5, 7, 0), - gsSP2Triangles(8, 0, 2, 0, 9, 3, 0, 0), - gsSP2Triangles(9, 0, 8, 0, 10, 5, 3, 0), - gsSP2Triangles(10, 3, 9, 0, 5, 10, 7, 0), - gsSP2Triangles(11, 8, 2, 0, 12, 9, 8, 0), - gsSP2Triangles(12, 8, 11, 0, 13, 10, 9, 0), - gsSP2Triangles(13, 9, 12, 0, 10, 13, 7, 0), - gsSPEndDisplayList(), + gsSPVertex(sceneGeometry_12, 14, 0), gsSPSetGeometryMode(G_CULL_BACK), + gsSP2Triangles(0, 1, 2, 0, 3, 4, 1, 0), gsSP2Triangles(3, 1, 0, 0, 5, 6, 4, 0), + gsSP2Triangles(5, 4, 3, 0, 6, 5, 7, 0), gsSP2Triangles(8, 0, 2, 0, 9, 3, 0, 0), + gsSP2Triangles(9, 0, 8, 0, 10, 5, 3, 0), gsSP2Triangles(10, 3, 9, 0, 5, 10, 7, 0), + gsSP2Triangles(11, 8, 2, 0, 12, 9, 8, 0), gsSP2Triangles(12, 8, 11, 0, 13, 10, 9, 0), + gsSP2Triangles(13, 9, 12, 0, 10, 13, 7, 0), gsSPEndDisplayList(), }; static Gfx D_86C0CAB8[] = { - gsSPVertex(D_86C0C758, 14, 0), - gsSPSetGeometryMode(G_CULL_BACK), - gsSP2Triangles(0, 1, 2, 0, 3, 4, 1, 0), - gsSP2Triangles(3, 1, 0, 0, 5, 6, 4, 0), - gsSP2Triangles(5, 4, 3, 0, 6, 5, 7, 0), - gsSP2Triangles(8, 0, 2, 0, 9, 3, 0, 0), - gsSP2Triangles(9, 0, 8, 0, 10, 5, 3, 0), - gsSP2Triangles(10, 3, 9, 0, 5, 10, 7, 0), - gsSP2Triangles(11, 8, 2, 0, 12, 9, 8, 0), - gsSP2Triangles(12, 8, 11, 0, 13, 10, 9, 0), - gsSP2Triangles(13, 9, 12, 0, 10, 13, 7, 0), - gsSPEndDisplayList(), + gsSPVertex(sceneGeometry_11, 14, 0), gsSPSetGeometryMode(G_CULL_BACK), + gsSP2Triangles(0, 1, 2, 0, 3, 4, 1, 0), gsSP2Triangles(3, 1, 0, 0, 5, 6, 4, 0), + gsSP2Triangles(5, 4, 3, 0, 6, 5, 7, 0), gsSP2Triangles(8, 0, 2, 0, 9, 3, 0, 0), + gsSP2Triangles(9, 0, 8, 0, 10, 5, 3, 0), gsSP2Triangles(10, 3, 9, 0, 5, 10, 7, 0), + gsSP2Triangles(11, 8, 2, 0, 12, 9, 8, 0), gsSP2Triangles(12, 8, 11, 0, 13, 10, 9, 0), + gsSP2Triangles(13, 9, 12, 0, 10, 13, 7, 0), gsSPEndDisplayList(), }; static Gfx D_86C0CB18[] = { - gsSPVertex(D_86C0C678, 14, 0), - gsSPSetGeometryMode(G_CULL_BACK), - gsSP2Triangles(0, 1, 2, 0, 3, 4, 1, 0), - gsSP2Triangles(3, 1, 0, 0, 5, 6, 4, 0), - gsSP2Triangles(5, 4, 3, 0, 6, 5, 7, 0), - gsSP2Triangles(8, 0, 2, 0, 9, 3, 0, 0), - gsSP2Triangles(9, 0, 8, 0, 10, 5, 3, 0), - gsSP2Triangles(10, 3, 9, 0, 5, 10, 7, 0), - gsSP2Triangles(11, 8, 2, 0, 12, 9, 8, 0), - gsSP2Triangles(12, 8, 11, 0, 13, 10, 9, 0), - gsSP2Triangles(13, 9, 12, 0, 10, 13, 7, 0), - gsSPEndDisplayList(), + gsSPVertex(sceneGeometry_10, 14, 0), gsSPSetGeometryMode(G_CULL_BACK), + gsSP2Triangles(0, 1, 2, 0, 3, 4, 1, 0), gsSP2Triangles(3, 1, 0, 0, 5, 6, 4, 0), + gsSP2Triangles(5, 4, 3, 0, 6, 5, 7, 0), gsSP2Triangles(8, 0, 2, 0, 9, 3, 0, 0), + gsSP2Triangles(9, 0, 8, 0, 10, 5, 3, 0), gsSP2Triangles(10, 3, 9, 0, 5, 10, 7, 0), + gsSP2Triangles(11, 8, 2, 0, 12, 9, 8, 0), gsSP2Triangles(12, 8, 11, 0, 13, 10, 9, 0), + gsSP2Triangles(13, 9, 12, 0, 10, 13, 7, 0), gsSPEndDisplayList(), }; static Gfx D_86C0CB78[] = { - gsSPVertex(D_86C0C598, 14, 0), - gsSPSetGeometryMode(G_CULL_BACK), - gsSP2Triangles(0, 1, 2, 0, 3, 4, 1, 0), - gsSP2Triangles(3, 1, 0, 0, 5, 6, 4, 0), - gsSP2Triangles(5, 4, 3, 0, 6, 5, 7, 0), - gsSP2Triangles(8, 0, 2, 0, 9, 3, 0, 0), - gsSP2Triangles(9, 0, 8, 0, 10, 5, 3, 0), - gsSP2Triangles(10, 3, 9, 0, 5, 10, 7, 0), - gsSP2Triangles(11, 8, 2, 0, 12, 9, 8, 0), - gsSP2Triangles(12, 8, 11, 0, 13, 10, 9, 0), - gsSP2Triangles(13, 9, 12, 0, 10, 13, 7, 0), - gsSPEndDisplayList(), + gsSPVertex(sceneGeometry_9, 14, 0), gsSPSetGeometryMode(G_CULL_BACK), + gsSP2Triangles(0, 1, 2, 0, 3, 4, 1, 0), gsSP2Triangles(3, 1, 0, 0, 5, 6, 4, 0), + gsSP2Triangles(5, 4, 3, 0, 6, 5, 7, 0), gsSP2Triangles(8, 0, 2, 0, 9, 3, 0, 0), + gsSP2Triangles(9, 0, 8, 0, 10, 5, 3, 0), gsSP2Triangles(10, 3, 9, 0, 5, 10, 7, 0), + gsSP2Triangles(11, 8, 2, 0, 12, 9, 8, 0), gsSP2Triangles(12, 8, 11, 0, 13, 10, 9, 0), + gsSP2Triangles(13, 9, 12, 0, 10, 13, 7, 0), gsSPEndDisplayList(), }; static Gfx D_86C0CBD8[] = { - gsSPVertex(D_86C0C378, 16, 0), - gsSPSetGeometryMode(G_CULL_BACK), - gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0), - gsSP2Triangles(3, 2, 4, 0, 3, 4, 5, 0), - gsSP2Triangles(5, 4, 6, 0, 5, 6, 7, 0), - gsSP2Triangles(7, 6, 8, 0, 7, 8, 9, 0), - gsSP2Triangles(10, 11, 12, 0, 10, 12, 13, 0), - gsSP2Triangles(13, 12, 14, 0, 13, 14, 15, 0), - gsSP2Triangles(15, 14, 1, 0, 15, 1, 0, 0), - gsSPEndDisplayList(), + gsSPVertex(sceneGeometry_7, 16, 0), gsSPSetGeometryMode(G_CULL_BACK), + gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0), gsSP2Triangles(3, 2, 4, 0, 3, 4, 5, 0), + gsSP2Triangles(5, 4, 6, 0, 5, 6, 7, 0), gsSP2Triangles(7, 6, 8, 0, 7, 8, 9, 0), + gsSP2Triangles(10, 11, 12, 0, 10, 12, 13, 0), gsSP2Triangles(13, 12, 14, 0, 13, 14, 15, 0), + gsSP2Triangles(15, 14, 1, 0, 15, 1, 0, 0), gsSPEndDisplayList(), }; static Gfx D_86C0CC28[] = { - gsSPVertex(D_86C0C478, 18, 0), + gsSPVertex(sceneGeometry_8, 18, 0), gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0), gsSP2Triangles(4, 5, 6, 0, 4, 6, 7, 0), gsSP2Triangles(8, 9, 10, 0, 8, 10, 11, 0), @@ -1320,7 +1300,7 @@ static Gfx D_86C0CC28[] = { }; static Gfx D_86C0CC70[] = { - gsSPVertex(D_86C0BB68, 32, 0), + gsSPVertex(sceneGeometry_1, 32, 0), gsSPSetGeometryMode(G_CULL_BACK), gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0), gsSP2Triangles(4, 5, 6, 0, 4, 6, 7, 0), @@ -1331,7 +1311,7 @@ static Gfx D_86C0CC70[] = { gsSP2Triangles(23, 7, 24, 0, 23, 24, 25, 0), gsSP2Triangles(26, 27, 28, 0, 26, 28, 29, 0), gsSP1Triangle(30, 25, 31, 0), - gsSPVertex(D_86C0BD68, 13, 0), + gsSPVertex(sceneGeometry_2, 13, 0), gsSP2Triangles(0, 1, 2, 0, 3, 2, 4, 0), gsSP2Triangles(3, 4, 5, 0, 6, 7, 8, 0), gsSP2Triangles(6, 8, 9, 0, 10, 9, 11, 0), @@ -1340,7 +1320,7 @@ static Gfx D_86C0CC70[] = { }; static Gfx D_86C0CCF8[] = { - gsSPVertex(D_86C0BE38, 32, 0), + gsSPVertex(sceneGeometry_3, 32, 0), gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0), gsSP2Triangles(4, 5, 6, 0, 4, 6, 7, 0), gsSP2Triangles(8, 9, 10, 0, 8, 10, 1, 0), @@ -1350,7 +1330,7 @@ static Gfx D_86C0CCF8[] = { gsSP2Triangles(22, 23, 24, 0, 22, 24, 7, 0), gsSP2Triangles(25, 13, 26, 0, 25, 26, 5, 0), gsSP2Triangles(27, 28, 29, 0, 27, 29, 30, 0), - gsSPVertex(D_86C0C028, 11, 0), + gsSPVertex(sceneGeometry_4, 11, 0), gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0), gsSP2Triangles(4, 3, 5, 0, 4, 5, 6, 0), gsSP2Triangles(7, 8, 9, 0, 7, 9, 10, 0), @@ -1358,7 +1338,7 @@ static Gfx D_86C0CCF8[] = { }; static Gfx D_86C0CD70[] = { - gsSPVertex(D_86C0C0D8, 32, 0), + gsSPVertex(sceneGeometry_5, 32, 0), gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0), gsSP2Triangles(4, 5, 6, 0, 4, 6, 7, 0), gsSP2Triangles(8, 3, 9, 0, 8, 9, 5, 0), @@ -1368,7 +1348,7 @@ static Gfx D_86C0CD70[] = { gsSP2Triangles(21, 22, 23, 0, 21, 23, 14, 0), gsSP2Triangles(24, 25, 26, 0, 24, 26, 16, 0), gsSP2Triangles(27, 28, 29, 0, 27, 29, 30, 0), - gsSPVertex(D_86C0C2C8, 11, 0), + gsSPVertex(sceneGeometry_6, 11, 0), gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0), gsSP2Triangles(4, 5, 6, 0, 4, 6, 7, 0), gsSP2Triangles(8, 9, 10, 0, 8, 10, 3, 0), @@ -1395,11 +1375,11 @@ static u32 D_86C0CDE8[] = { }; static u32 D_86C0D008[] = { - 0x1700000A, 0x000000E9, D_86C0B9F8, 0x00000000, D_86C0BB68, 0x05000000, 0x1C000000, 0x000023D7, - 0x000023D7, 0x000023D7, 0x05000000, 0x03000000, D_86C0CDE8, 0x06000000, 0x06000000, 0x01000000, + 0x1700000A, 0x000000E9, sceneTextures, 0x00000000, sceneGeometry_1, 0x05000000, 0x1C000000, 0x000023D7, + 0x000023D7, 0x000023D7, 0x05000000, 0x03000000, D_86C0CDE8, 0x06000000, 0x06000000, 0x01000000, }; -static u32 D_86C0D048[] = { +static u32 ekansShadowTexture[] = { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000101, 0x01010101, 0x01010101, 0x01010000, 0x00000000, @@ -1516,9 +1496,9 @@ static u32 D_86C0D048[] = { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, }; -static unk_func_8790002C* D_86C0E048 = &D_86C0E480[0]; -static unk_func_8790002C* D_86C0E04C = &D_86C0FCD8[0]; -static unk_func_8790002C* D_86C0E050 = &D_86C11530[0]; +static minigameActor* D_86C0E048 = &D_86C0E480[0]; +static minigameActor* D_86C0E04C = &D_86C0FCD8[0]; +static minigameActor* D_86C0E050 = &D_86C11530[0]; static s16 D_86C0E054[] = { 0x0000, 0x0001, 0x0002, 0x0000, 0x0003, 0x0006, 0x0000, 0x0004, 0x0008, 0x0001, 0x0004, 0x0007, @@ -1563,14 +1543,14 @@ static u32 D_86C0E0D0[] = { 0x06000000, 0x06000000, 0x06000000, 0x03000000, D_87806398, 0x06000000, 0x01000000, }; -static unk_D_86C0E1CC D_86C0E16C[] = { +static actorInitialPosition skansActorInfo[] = { { { -45.0f, 0.0f, 50.0f }, { 0, 0, 0, 0, 0, 0 }, 0, 0x8C }, { { -15.0f, 0.0f, 50.0f }, { 0, 0, 0, 0, 0, 0 }, 0, 0x8C }, { { 15.0f, 0.0f, 50.0f }, { 0, 0, 0, 0, 0, 0 }, 0, 0x8C }, { { 45.0f, 0.0f, 50.0f }, { 0, 0, 0, 0, 0, 0 }, 0, 0x8C }, }; -static unk_D_86C0E1CC D_86C0E1CC[] = { +static actorInitialPosition diglettActorInfo[] = { { { -75.0f, 0.0f, -75.0f }, { 0, 0, 0, 0, 0, 0 }, 0xA, 0x23 }, { { 0.0f, 0.0f, -75.0f }, { 0, 0, 0, 0, 0, 0 }, 0xA, 0x23 }, { { 75.0f, 0.0f, -75.0f }, { 0, 0, 0, 0, 0, 0 }, 0xA, 0x23 }, @@ -1593,13 +1573,17 @@ static unk_func_87801684 D_86C0E33C[] = { { D_03042E00, 0xE }, { D_03043520, 4 }, { D_03043C40, 8 }, { D_03043520, 4 }, { D_03042E00, 0xE }, { D_03041FC0, 4 }, { D_030426E0, 8 }, { D_03041FC0, 4 }, { NULL, 0 }, }; -static s16 D_86C0E384[] = { 0x32, 0x6E, 0xAA, 0xE6 }; -static Color_RGB8 D_86C0E38C[] = { - { 0, 0, 0xB4 }, { 0, 0x82, 0 }, { 0xA0, 0, 0 }, { 0x8C, 0x8C, 0 }, { 0xFF, 0xFF, 0xFF }, { 0xFA, 0, 0 }, - { 0, 0x28, 0xFF }, { 0xFF, 0xFF, 0xE2 }, { 0, 0, 0 }, { 0x11, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, +static s16 playerGUIScoreXPositions[] = { 0x32, 0x6E, 0xAA, 0xE6 }; +static Color_RGB8 playerColors[] = { + { 0, 0, 0xB4 }, // player 1 skans shadow color + { 0, 0x82, 0 }, // player 2 skans shadow color + { 0xA0, 0, 0 }, // player 3 skans shadow color + { 0x8C, 0x8C, 0 }, // player 4 skans shadow color + { 0xFF, 0xFF, 0xFF }, { 0xFA, 0, 0 }, { 0, 0x28, 0xFF }, { 0xFF, 0xFF, 0xE2 }, + { 0, 0, 0 }, { 0x11, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, }; -s32 func_86C00020(unk_func_8790002C* arg0) { +s32 func_86C00020(minigameActor* arg0) { f32 tmp = arg0->unk_274; s32 var_v1 = 0; @@ -1740,77 +1724,77 @@ void func_86C00368(s16 arg0, s16 arg1) { } } -void func_86C003AC(unk_func_8790002C* arg0) { +void func_86C003AC(minigameActor* arg0) { s16 idx = arg0 - D_86C11530; - arg0->unk_1A8.x = arg0->unk_1D8.x = D_86C0E16C[idx].unk_00.x; - arg0->unk_1A8.y = arg0->unk_1D8.y = D_86C0E16C[idx].unk_00.y; - arg0->unk_1A8.z = arg0->unk_1D8.z = D_86C0E16C[idx].unk_00.z; + arg0->unk_1A8.x = arg0->unk_1D8.x = skansActorInfo[idx].pos.x; + arg0->unk_1A8.y = arg0->unk_1D8.y = skansActorInfo[idx].pos.y; + arg0->unk_1A8.z = arg0->unk_1D8.z = skansActorInfo[idx].pos.z; arg0->unk_1C0.x = 0.0f; arg0->unk_1C0.y = -30.0f; arg0->unk_1C0.z = 0.0f; } -void func_86C00424(unk_func_8790002C* arg0, s16 arg1) { +void initEkans(minigameActor* ekans, s16 player) { s32 i; - func_8790060C(arg0); - arg0->unk_16C.x = 1.0f; - arg0->unk_16C.y = 1.0f; - arg0->unk_16C.z = 1.0f; + func_8790060C(ekans); + ekans->scale.x = 1.0f; + ekans->scale.y = 1.0f; + ekans->scale.z = 1.0f; - arg0->unk_1A8.x = arg0->unk_1D8.x = D_86C0E16C[arg1].unk_00.x; - arg0->unk_1A8.y = arg0->unk_1D8.y = D_86C0E16C[arg1].unk_00.y; - arg0->unk_1A8.z = arg0->unk_1D8.z = D_86C0E16C[arg1].unk_00.z; + ekans->unk_1A8.x = ekans->unk_1D8.x = skansActorInfo[player].pos.x; + ekans->unk_1A8.y = ekans->unk_1D8.y = skansActorInfo[player].pos.y; + ekans->unk_1A8.z = ekans->unk_1D8.z = skansActorInfo[player].pos.z; - arg0->unk_1C0.y = 10.0f; - arg0->unk_288 = 50.0f; - arg0->unk_28C = 140.0f; + ekans->unk_1C0.y = 10.0f; + ekans->unk_288 = 50.0f; + ekans->unk_28C = 140.0f; - arg0->unk_21C = -0x8000; - arg0->unk_25C = 0x64; - arg0->unk_258 = arg0->unk_25C; + ekans->unk_21C = -0x8000; + ekans->unk_25C = 0x64; + ekans->unk_258 = ekans->unk_25C; - func_8001BD04(&arg0->unk_000, 0); + func_8001BD04(&ekans->unk_000, 0); - arg0->unk_000.unk_000.unk_01 |= 1; - arg0->unk_000.unk_000.unk_02 |= 0x20; + ekans->unk_000.unk_000.unk_01 |= 1; + ekans->unk_000.unk_000.unk_02 |= 0x20; - func_800173DC(&arg0->unk_000, 0, arg0->unk_000.unk_040.unk_04, 0x10000); - func_80017464(&arg0->unk_000, arg0->unk_26E); + func_800173DC(&ekans->unk_000, 0, ekans->unk_000.unk_040.unk_04, 0x10000); + func_80017464(&ekans->unk_000, ekans->unk_26E); - arg0->unk_000.unk_000.unk_02 &= ~0x40; - arg0->unk_2AC = D_879060C4[arg1]; - arg0->unk_266 = -1; + ekans->unk_000.unk_000.unk_02 &= ~0x40; + ekans->unk_2AC = D_879060C4[player]; + ekans->unk_266 = -1; if (D_86C12088 == 0) { - arg0->unk_2AE = D_86C0E084[D_87906046][arg1]; + ekans->unk_2AE = D_86C0E084[D_87906046][player]; } else { - arg0->unk_2AE = D_86C0E0A4[arg1]; + ekans->unk_2AE = D_86C0E0A4[player]; } // clang-format off - for (i = 0; i < 9; i++) { D_86C12040[i][arg1] = 0; } + for (i = 0; i < 9; i++){ D_86C12040[i][player] = 0; } // clang-format on } -void func_86C005D0(void) { +void initEkanses(void) { s32 i; D_86C0E050 = D_86C11530; for (i = 0; i < 4; i++) { - func_86C00424(D_86C0E050, i); + initEkans(D_86C0E050, i); D_86C0E050++; } } -f32 func_86C0063C(unk_func_8790002C* arg0) { +f32 func_86C0063C(minigameActor* arg0) { return (arg0->unk_284 <= arg0->unk_280) ? arg0->unk_280 : arg0->unk_284; } -s16 func_86C00668(unk_func_8790002C* arg0, s16 arg1) { +s16 func_86C00668(minigameActor* arg0, s16 arg1) { s32 var_v1 = arg1 ^ 0; switch (arg0 - D_86C11530) { @@ -1857,32 +1841,32 @@ s16 func_86C00668(unk_func_8790002C* arg0, s16 arg1) { return var_v1; } -void func_86C00770(unk_func_8790002C* arg0) { - f32 sp34; +void func_86C00770(minigameActor* arg0) { + f32 stickMagnitude; f32 temp_fa0; f32 temp_fv1; - s32 sp1C; + s32 direction; s16 var_v1; - s16 sp24; + s16 stickY; f32 var_ft4; s32 var_v0; - sp1C = 0; - sp34 = D_879060BC->stickMag; - sp24 = D_879060BC->stickY; + direction = 0; + stickMagnitude = tempControllerPtr->stickMag; + stickY = tempControllerPtr->stickY; if (arg0->unk_23E == 0) { - if (D_879060BC->buttonDown & 0x200) { - sp1C = 1; - } else if (D_879060BC->buttonDown & 0x100) { - sp1C = -1; - } else if (D_879060BC->buttonDown & 2) { - sp1C = 1; - } else if (D_879060BC->buttonDown & 1) { - sp1C = -1; + if ( BTN_IS_DOWN(tempControllerPtr, BTN_DLEFT) ) { + direction = 1; + } else if ( BTN_IS_DOWN(tempControllerPtr, BTN_DRIGHT) ) { + direction = -1; + } else if ( BTN_IS_DOWN(tempControllerPtr, BTN_CLEFT) ) { + direction = 1; + } else if ( BTN_IS_DOWN(tempControllerPtr, BTN_CRIGHT) ) { + direction = -1; } - if (sp1C != 0) { + if (direction != 0) { arg0->unk_2A0++; if (arg0->unk_2A0 >= 0xB) { arg0->unk_2A0 = 0xA; @@ -1899,39 +1883,39 @@ void func_86C00770(unk_func_8790002C* arg0) { var_v1 = 0x1E0; } - arg0->unk_228 += sp1C * (var_v1 + 0x180); + arg0->unk_228 += direction * (var_v1 + 0x180); arg0->unk_228 = func_86C00668(arg0, arg0->unk_228); } - if (sp24 >= 0) { - sp34 = 0.0f; + if (stickY >= 0) { + stickMagnitude = 0.0f; } if (arg0->unk_23E == 0) { var_v0 = 0; var_ft4 = 0.0f; - temp_fv1 = arg0->unk_280 - sp34; + temp_fv1 = arg0->unk_280 - stickMagnitude; temp_fa0 = arg0->unk_284 - arg0->unk_280; if (temp_fa0 <= temp_fv1) { - if ((arg0->unk_280 <= 12.0f) && (temp_fv1 >= 5.0f) && (sp34 == 0.0f)) { + if ((arg0->unk_280 <= 12.0f) && (temp_fv1 >= 5.0f) && (stickMagnitude == 0.0f)) { var_v0 = 1; var_ft4 = arg0->unk_280; } if (arg0->unk_280 <= 30.0f) { if (temp_fv1 >= 10.0f) { - sp1C = 1; + direction = 1; var_v0 = 1; var_ft4 = func_86C0063C(arg0); } } else if (arg0->unk_280 < 50.0f) { if (temp_fv1 >= 15.0f) { - sp1C = 1; + direction = 1; var_v0 = 1; var_ft4 = func_86C0063C(arg0); } } else if (temp_fv1 >= 20.0f) { - sp1C = 1; + direction = 1; var_v0 = 1; var_ft4 = func_86C0063C(arg0); } @@ -1941,7 +1925,7 @@ void func_86C00770(unk_func_8790002C* arg0) { } if (var_v0 != 0) { - sp34 = 0.0f; + stickMagnitude = 0.0f; if (var_ft4 < 24.0f) { var_ft4 = 24.0f; @@ -1956,12 +1940,12 @@ void func_86C00770(unk_func_8790002C* arg0) { } arg0->unk_284 = arg0->unk_280; - arg0->unk_280 = sp34; + arg0->unk_280 = stickMagnitude; } } void func_86C00AA4(void) { - unk_func_8790002C* ptr = D_86C11530; + minigameActor* ptr = D_86C11530; s32 i; for (i = 0; i < 4; i++) { @@ -1972,7 +1956,7 @@ void func_86C00AA4(void) { } } -s32 func_86C00B0C(unk_func_8790002C* arg0) { +s32 func_86C00B0C(minigameActor* arg0) { s32 ret = 0; s32 idx = arg0->unk_266; s32 i; @@ -2009,7 +1993,7 @@ s16 func_86C00BB4(void) { return var_t0; } -s16 func_86C00C40(unk_func_8790002C* arg0) { +s16 func_86C00C40(minigameActor* arg0) { s32 i; s32 var_a0; s16 sp1E = -1; @@ -2047,13 +2031,13 @@ s16 func_86C00C40(unk_func_8790002C* arg0) { return sp1E; } -s16 func_86C00D50(unk_func_8790002C* arg0) { +s16 func_86C00D50(minigameActor* arg0) { s32 i; s32 j; s32 sp1C; s16 var_a0; s32 var_v1; - unk_func_8790002C* var_v0 = D_86C11530; + minigameActor* var_v0 = D_86C11530; sp1C = 1; @@ -2098,7 +2082,7 @@ s16 func_86C00D50(unk_func_8790002C* arg0) { return var_a0; } -s32 func_86C00EF8(unk_func_8790002C* arg0) { +s32 func_86C00EF8(minigameActor* arg0) { switch (arg0->unk_2AE) { case 0: arg0->unk_266 = func_86C00BB4(); @@ -2116,9 +2100,9 @@ s32 func_86C00EF8(unk_func_8790002C* arg0) { return arg0->unk_266; } -void func_86C00F70(unk_func_8790002C* arg0) { +void func_86C00F70(minigameActor* arg0) { Vec3f sp3C; - unk_func_8790002C* temp_v0; + minigameActor* temp_v0; s16 sp36; s16 sp34; s16 sp32; @@ -2157,7 +2141,7 @@ void func_86C00F70(unk_func_8790002C* arg0) { arg0->unk_22E = func_878001E8(sp32) + sp34; } -void func_86C01100(unk_func_8790002C* arg0) { +void func_86C01100(minigameActor* arg0) { s16 temp_v1 = D_86C12008[arg0->unk_266].unk_00; f32 var_fv0; @@ -2253,7 +2237,7 @@ s16 func_86C014A0(void) { return sp1E; } -void func_86C01538(unk_func_8790002C* arg0) { +void func_86C01538(minigameActor* arg0) { switch (arg0->unk_242) { case 1: if (func_86C00EF8(arg0) >= 0) { @@ -2308,7 +2292,7 @@ void func_86C01538(unk_func_8790002C* arg0) { } } -void func_86C016C8(unk_func_8790002C* arg0) { +void func_86C016C8(minigameActor* arg0) { arg0->unk_210 = 1.0f; arg0->unk_1F8 = (SINS(arg0->unk_214.y) * (26.0f + arg0->unk_274)) / 10.0f; arg0->unk_1FC = (arg0->unk_274 + 70.0f) * 0.125f; @@ -2318,7 +2302,7 @@ void func_86C016C8(unk_func_8790002C* arg0) { void func_86C01748(void) { } -void func_86C01750(unk_func_8790002C* arg0, s32 arg1, s32 arg2, f32 arg3, f32 arg4, f32 arg5) { +void func_86C01750(minigameActor* arg0, s32 arg1, s32 arg2, f32 arg3, f32 arg4, f32 arg5) { if (arg3 > 0.0f) { if (arg4 >= 0.0f) { arg0->unk_1F8 *= 0.25f; @@ -2349,7 +2333,7 @@ void func_86C01750(unk_func_8790002C* arg0, s32 arg1, s32 arg2, f32 arg3, f32 ar arg0->unk_22E = 0x1000; } -void func_86C018B8(unk_func_8790002C* arg0, s32 arg1) { +void func_86C018B8(minigameActor* arg0, s32 arg1) { s32 i; f32 temp_fa0; f32 temp_fa1; @@ -2393,8 +2377,8 @@ void func_86C01AF8(void) { Vec3f sp70; s32 i; s32 j; - unk_func_8790002C* temp_s1; - unk_func_8790002C* var_s6 = D_86C11530; + minigameActor* temp_s1; + minigameActor* var_s6 = D_86C11530; for (i = 0; i < 4; i++, var_s6++) { if (var_s6->unk_25E != 0) { @@ -2425,13 +2409,13 @@ void func_86C01AF8(void) { } } -void func_86C01D2C(unk_func_8790002C* arg0, s32 arg1) { +void func_86C01D2C(minigameActor* arg0, s32 arg1) { Vec3f sp3C; Vec3f sp30; f32 temp_fa0; f32 temp_fv1; s32 idx; - unk_func_8790002C* sp20; + minigameActor* sp20; unk_D_86C12008* sp18; if (arg0->unk_260 != 2) { @@ -2496,7 +2480,7 @@ void func_86C01D2C(unk_func_8790002C* arg0, s32 arg1) { } } -void func_86C01FAC(unk_func_8790002C* arg0, s32 arg1) { +void func_86C01FAC(minigameActor* arg0, s32 arg1) { if (arg0->unk_260 == 3) { func_81400760(&arg0->unk_1A8.x, arg0->unk_1B4.x, arg0->unk_1CC); func_81400760(&arg0->unk_1A8.z, arg0->unk_1B4.z, arg0->unk_1D4); @@ -2568,7 +2552,7 @@ void func_86C01FAC(unk_func_8790002C* arg0, s32 arg1) { arg0->unk_234 += arg0->unk_22E; } -void func_86C021FC(unk_func_8790002C* arg0) { +void func_86C021FC(minigameActor* arg0) { if (arg0->unk_280 > 5.0f) { func_81400760(&arg0->unk_1C0.x, (-SINS(arg0->unk_214.y) * arg0->unk_280) / 3.0f, 4.0f); func_81400760(&arg0->unk_1C0.z, (-COSS(arg0->unk_214.y) * arg0->unk_280) / 3.0f, 4.0f); @@ -2578,8 +2562,8 @@ void func_86C021FC(unk_func_8790002C* arg0) { } } -void func_86C022D8(unk_func_8790002C* arg0) { - if (D_87903DA4 != 0) { +void func_86C022D8(minigameActor* arg0) { + if (minigameInputLock != 0) { if (arg0->unk_2AC == 0) { func_86C00770(arg0); } else { @@ -2588,13 +2572,13 @@ void func_86C022D8(unk_func_8790002C* arg0) { } } -void func_86C02324(unk_func_8790002C* arg0, s32 arg1) { +void func_86C02324(minigameActor* arg0, s32 arg1) { switch (arg0->unk_23E) { case 0x0: func_86C021FC(arg0); break; - case 0x1: + case 0x1: // on ekans launch func_86C016C8(arg0); func_879002B8(arg0, 1, -1, 0); arg0->unk_262 = 1; @@ -2608,7 +2592,7 @@ void func_86C02324(unk_func_8790002C* arg0, s32 arg1) { func_86C01FAC(arg0, arg1); break; - case 0x3: + case 0x3: // on ekans return ? func_879002B8(arg0, 0, -1, 1); func_86C003AC(arg0); arg0->unk_23E++; @@ -2652,7 +2636,7 @@ void func_86C0250C(void) { void func_86C02514(void) { s32 i; - D_879060BC = gPlayer1Controller; + tempControllerPtr = gPlayer1Controller; D_86C0E050 = D_86C11530; for (i = 0; i < 4; i++) { @@ -2664,7 +2648,7 @@ void func_86C02514(void) { } D_86C0E050++; - D_879060BC++; + tempControllerPtr++; } func_86C01AF8(); @@ -2680,40 +2664,40 @@ void func_86C02514(void) { } } -void func_86C02610(unk_func_8790002C* arg0, s32 arg1) { - func_8790060C(arg0); +void initDiglett(minigameActor* diglett, s32 arg1) { + func_8790060C(diglett); - arg0->unk_16C.x = 1.0f; - arg0->unk_16C.y = 1.0f; - arg0->unk_16C.z = 1.0f; + diglett->scale.x = 1.0f; + diglett->scale.y = 1.0f; + diglett->scale.z = 1.0f; - arg0->unk_1A8.x = D_86C0E1CC[arg1].unk_00.x; - arg0->unk_1A8.y = D_86C0E1CC[arg1].unk_00.y; - arg0->unk_1A8.z = D_86C0E1CC[arg1].unk_00.z; + diglett->unk_1A8.x = diglettActorInfo[arg1].pos.x; + diglett->unk_1A8.y = diglettActorInfo[arg1].pos.y; + diglett->unk_1A8.z = diglettActorInfo[arg1].pos.z; - arg0->unk_288 = D_86C0E1CC[arg1].unk_12; - arg0->unk_28C = D_86C0E1CC[arg1].unk_14; + diglett->unk_288 = diglettActorInfo[arg1].unk_12; + diglett->unk_28C = diglettActorInfo[arg1].unk_14; - arg0->unk_258 = arg0->unk_25C = 0x64; - arg0->unk_1E4 = arg0->unk_28C * 0.5f; + diglett->unk_258 = diglett->unk_25C = 0x64; + diglett->unk_1E4 = diglett->unk_28C * 0.5f; - func_8001BD04(&arg0->unk_000, 1); - func_879004F8(&arg0->unk_000); + func_8001BD04(&diglett->unk_000, 1); + func_879004F8(&diglett->unk_000); - arg0->unk_000.unk_01C = 0; - arg0->unk_000.unk_000.unk_02 &= ~0x40; + diglett->unk_000.unk_01C = 0; + diglett->unk_000.unk_000.unk_02 &= ~0x40; } -void func_86C026F0(unk_func_8790002C* arg0, s32 arg1) { +void initDiglettHole(minigameActor* arg0, s32 arg1) { func_8790060C(arg0); - arg0->unk_16C.x = 1.0f; - arg0->unk_16C.y = 1.0f; - arg0->unk_16C.z = 1.0f; + arg0->scale.x = 1.0f; + arg0->scale.y = 1.0f; + arg0->scale.z = 1.0f; - arg0->unk_1A8.x = D_86C0E1CC[arg1].unk_00.x; - arg0->unk_1A8.y = D_86C0E1CC[arg1].unk_00.y; - arg0->unk_1A8.z = D_86C0E1CC[arg1].unk_00.z; + arg0->unk_1A8.x = diglettActorInfo[arg1].pos.x; + arg0->unk_1A8.y = diglettActorInfo[arg1].pos.y; + arg0->unk_1A8.z = diglettActorInfo[arg1].pos.z; arg0->unk_000.unk_000.unk_02 &= ~0x40; } @@ -2750,16 +2734,16 @@ void func_86C027BC(void) { } } -void func_86C02804(void) { +void initDigletts(void) { s32 i; D_86C0E048 = D_86C0E480; D_86C0E04C = D_86C0FCD8; for (i = 0; i < 9; i++) { - func_86C02610(D_86C0E048, i); + initDiglett(D_86C0E048, i); func_87900770(D_86C0E048); - func_86C026F0(D_86C0E04C, i); + initDiglettHole(D_86C0E04C, i); func_87900770(D_86C0E04C); func_87900808(D_86C0E04C); D_86C0E048 = &D_86C0E048[1]; @@ -2816,7 +2800,7 @@ s16 func_86C028C0(s16 arg0) { return var_a1; } -void func_86C02A1C(unk_func_8790002C* arg0) { +void func_86C02A1C(minigameActor* arg0) { s32 temp_v0; s32 sp18 = 0; @@ -2853,7 +2837,7 @@ void func_86C02A1C(unk_func_8790002C* arg0) { } } -void func_86C02B78(unk_func_8790002C* arg0, s32 arg1) { +void func_86C02B78(minigameActor* arg0, s32 arg1) { u8 var_s0 = 0; u8 var_a2 = 0; u8 var_a3 = 0; @@ -2989,10 +2973,11 @@ void func_86C03008(void) { } } +// init game objects void func_86C03080(void) { func_87900854(); - func_86C005D0(); - func_86C02804(); + initEkanses(); + initDigletts(); func_86C03500(); D_879060C2 = 0x3C; @@ -3002,7 +2987,7 @@ void func_86C03080(void) { } s32 func_86C030EC(void) { - unk_func_8790002C* var_v0 = D_86C11530; + minigameActor* var_v0 = D_86C11530; s32 ret = 1; s32 i; @@ -3018,7 +3003,7 @@ s32 func_86C030EC(void) { void func_86C03128(void) { s32 i; s32 var_s2; - unk_func_8790002C* var_s0; + minigameActor* var_s0; var_s2 = -1; for (i = 0, var_s0 = D_86C11530; i < 4; i++, var_s0++) { @@ -3082,55 +3067,55 @@ s32 func_86C03258(void) { return sp1C; } -void func_86C03344(void) { - switch (D_87903DA0) { - case 1: - D_87906040 = 0xF; - D_87903DA0++; +void ekansMinigameNextStep(void) { + switch (minigameState) { + case 1: // after pressing start + minigameInputLockTimer = 0xF; + minigameState++; break; - case 2: - D_87906040 -= 1; - if (D_87906040 < 0) { + case 2: // waits for some frames before starting the main countdown + minigameInputLockTimer -= 1; + if (minigameInputLockTimer < 0) { func_8780295C(1); - D_87903DA0++; + minigameState++; } break; - case 3: + case 3: // state 3: when the main countdown finishes, game starts if (func_86C031E4() != 0) { func_86C027BC(); func_86C00AA4(); - D_87903DA4 = 1; - D_87903DA0++; + minigameInputLock = 1; + minigameState++; } break; - case 4: + case 4: // state 4: main countdown ends, adds a little wait if (func_86C03258() != 0) { D_87903DC4 = 4; - D_87906040 = 0x32; - D_87903DA4 = 0; - D_87903DA0++; + minigameInputLockTimer = 0x32; + minigameInputLock = 0; + minigameState++; } break; - case 5: - D_87906040--; - if (D_87906040 < 0) { - D_87906040 = 0; + case 5: // state 5: after the wait, ends the minigame + minigameInputLockTimer--; + if (minigameInputLockTimer < 0) { + minigameInputLockTimer = 0; } - if ((func_86C030EC() != 0) && (D_87906040 == 0)) { + if ((func_86C030EC() != 0) && (minigameInputLockTimer == 0)) { func_86C03128(); func_87802EB8(1); func_87903294(); - D_87903DA0++; + minigameState++; } break; case 6: if (D_8780FC96 != 0) { - D_87903DA0++; + minigameState++; D_87903DAC = 1; } break; @@ -3152,9 +3137,9 @@ void func_86C03500(void) { D_87906068 = 0x32; D_8790606A = 0x7D0; - D_8790606C.x = 0; - D_8790606C.y = 0x56; - D_8790606C.z = 0; + minigameCameraCoords.x = 0; + minigameCameraCoords.y = 0x56; + minigameCameraCoords.z = 0; func_87900B64(); @@ -3170,7 +3155,7 @@ void func_86C03500(void) { } void func_86C035E0(void) { - func_87900C5C(); + minigameDebuggModeControll(); func_87900B64(); } @@ -3261,7 +3246,7 @@ void func_86C03BE8(void) { } void func_86C03C64(void) { - unk_func_8790002C* var_s4 = D_86C11530; + minigameActor* var_s4 = D_86C11530; s32 i; func_8001F3F4(); @@ -3278,7 +3263,7 @@ void func_86C03C64(void) { } for (i = 0; i < 4; i++, var_s4++) { - s16 tmp = D_86C0E384[i]; + s16 tmp = playerGUIScoreXPositions[i]; if (D_86C12088 == 0) { if (var_s4->unk_2AC != 0) { @@ -3299,7 +3284,7 @@ void func_86C03E4C(void) { func_87903260(); func_86C03AB8(); - if (D_87906044 != 0) { + if (showMinigameHUD != 0) { func_86C03C64(); } } @@ -3315,7 +3300,7 @@ void func_86C03E8C(s32 arg0) { } void func_86C03ED4(void) { - unk_func_8790002C* var_s0 = D_86C11530; + minigameActor* actor = D_86C11530; s32 i; Vec3f sp7C; Vec3s sp74; @@ -3326,14 +3311,14 @@ void func_86C03ED4(void) { sp74.y = 0; sp74.z = 0; - func_8140419C(D_86C0D048, 0x40, 0x40); + func_8140419C(ekansShadowTexture, 0x40, 0x40); - for (i = 0; i < 4; i++, var_s0++) { - if (var_s0->unk_23E == 2) { + for (i = 0; i < 4; i++, actor++) { + if (actor->unk_23E == 2) { gSPDisplayList(gDisplayListHead++, D_8140DD58); - func_81405B70(D_86C0E38C[i].r, D_86C0E38C[i].g, D_86C0E38C[i].b, (var_s0->unk_000.unk_01D / 2) & 0xFF); - func_80015390(&var_s0->unk_000, 0xA, &sp7C); + func_81405B70(playerColors[i].r, playerColors[i].g, playerColors[i].b, (actor->unk_000.unk_01D / 2) & 0xFF); + func_80015390(&actor->unk_000, 0xA, &sp7C); sp7C.y = 5.0f; @@ -3356,13 +3341,13 @@ void func_86C040B4(s32 arg0) { func_87901C98(); func_86C03ED4(); - if (D_87903DB0 == 0) { + if (minigameDebuggMode == 0) { func_86C03E8C(arg0); } - if (D_87903DB0 != 0) { - func_87900F44(); - func_879010A4(); + if (minigameDebuggMode != 0) { + showDebuggCameraInfo(); + showDebuggJoystickInfo(); } if (D_86C12088 != 0) { @@ -3372,55 +3357,55 @@ void func_86C040B4(s32 arg0) { func_80007778(); } -void func_86C04170(void) { - func_86C03080(); - func_87900558(); +void initEkansMinigameAssets(void) { + func_86C03080(); // init game objects + func_87900558(); // change a global something func_87901620(); func_800077B4(0xA); func_80006C6C(0x10); if (D_86C12088 != 0) { D_87903DC4 = 1; - D_87906044 = 1; - D_87903DA0 = 1; + showMinigameHUD = 1; + minigameState = 1; } else { D_87903DC4 = 3; } } -void func_86C041E8(void) { +void showTutorialScreenEkansMinigame(void) { s32 var_s1 = 1; while (var_s1 != 0) { - func_87900528(); + func_87900528(); // input - if ((D_87903DB0 == 0) && (func_80007604() == 0)) { + if ((minigameDebuggMode == 0) && (func_80007604() == 0)) { if (D_86C12088 != 0) { if ((gPlayer1Controller->buttonPressed != 0) || (D_879060C2 == 0x28)) { - func_87802EB8(2); + func_87802EB8(2); // D_8780FC92 = 1 } - } else if (D_87906044 == 0) { - if (gPlayer1Controller->buttonPressed & 0x1000) { - D_87903DC4 = 1; - D_87903DA0 = 1; - D_87906044 = 1; + } else if (showMinigameHUD == 0) { + if (BTN_IS_PRESSED(gPlayer1Controller, BTN_START)) { + D_87903DC4 = 1; // takes off the tutorial screen + minigameState = 1; + showMinigameHUD = 1; func_86C00368(0x10, 0); - } else if ((D_8780FA2A == 0) && (gPlayer1Controller->buttonPressed & 0x4000)) { + } else if ((D_8780FA2A == 0) && (BTN_IS_PRESSED(gPlayer1Controller, BTN_B))) { func_86C00368(0x11, 0); - func_87802EB8(2); + func_87802EB8(2); // D_8780FC92 = 1 } } } if (D_8780FC94 == 0) { func_8140C5D0(); - func_86C03344(); + ekansMinigameNextStep(); func_86C02514(); func_86C03008(); func_86C035E0(); } - if ((D_87903DB0 == 0) && ((D_87903DAC != 0) || (D_8780FC92 != 0))) { + if ((minigameDebuggMode == 0) && ((D_87903DAC != 0) || (D_8780FC92 != 0))) { var_s1 = 0; } @@ -3428,7 +3413,7 @@ void func_86C041E8(void) { } } -void func_86C043C4(void) { +void ekansMinigameUpdate(void) { s32 i; func_80006CB4(0x1E); @@ -3440,10 +3425,10 @@ void func_86C043C4(void) { } for (i = 0; i < 30; i++) { - func_87900528(); + func_87900528(); // input if (D_8780FC94 == 0) { func_8140C5D0(); - func_86C03344(); + ekansMinigameNextStep(); func_86C02514(); func_86C03008(); func_86C035E0(); @@ -3503,7 +3488,7 @@ void func_86C044B4(void) { } } -s32 func_86C046B0(s32 arg0, UNUSED s32 arg1) { +s32 startSkansMinigame(s32 arg0, UNUSED s32 arg1) { unk_func_80007444* sp24; if (arg0 == 1) { @@ -3528,12 +3513,12 @@ s32 func_86C046B0(s32 arg0, UNUSED s32 arg1) { func_86C044B4(); func_80007678(sp24); - func_86C04170(); - func_86C041E8(); - func_86C043C4(); + initEkansMinigameAssets(); + showTutorialScreenEkansMinigame(); + ekansMinigameUpdate(); func_800076C0(); - func_8001E9CC(); - func_80005EAC(); + func_8001E9CC(); // main_pool_try_free(D_800AC870); + func_80005EAC(); // main_pool_try_free(D_800A7428.unk4); main_pool_try_free(D_800A7428.unk0); main_pool_pop_state('MINI'); diff --git a/src/fragments/18/fragment18.h b/src/fragments/18/fragment18.h index bf21195..2d7d2f6 100644 --- a/src/fragments/18/fragment18.h +++ b/src/fragments/18/fragment18.h @@ -4,50 +4,50 @@ #include "global.h" #include "src/fragments/3/fragment3.h" -s32 func_86C00020(unk_func_8790002C* arg0); +s32 func_86C00020(minigameActor* arg0); void func_86C00090(s16 arg0, s32* arg1, s32* arg2); void func_86C00110(s16 arg0, s16 arg1); void func_86C00368(s16 arg0, s16 arg1); -void func_86C003AC(unk_func_8790002C* arg0); -void func_86C00424(unk_func_8790002C* arg0, s16 arg1); -void func_86C005D0(void); -f32 func_86C0063C(unk_func_8790002C* arg0); -s16 func_86C00668(unk_func_8790002C* arg0, s16 arg1); -void func_86C00770(unk_func_8790002C* arg0); +void func_86C003AC(minigameActor* arg0); +void initEkans(minigameActor* ekans, s16 player); +void initEkanses(void); +f32 func_86C0063C(minigameActor* arg0); +s16 func_86C00668(minigameActor* arg0, s16 arg1); +void func_86C00770(minigameActor* arg0); void func_86C00AA4(void); -s32 func_86C00B0C(unk_func_8790002C* arg0); +s32 func_86C00B0C(minigameActor* arg0); s16 func_86C00BB4(void); -s16 func_86C00C40(unk_func_8790002C* arg0); -s16 func_86C00D50(unk_func_8790002C* arg0); -s32 func_86C00EF8(unk_func_8790002C* arg0); -void func_86C00F70(unk_func_8790002C* arg0); -void func_86C01100(unk_func_8790002C* arg0); +s16 func_86C00C40(minigameActor* arg0); +s16 func_86C00D50(minigameActor* arg0); +s32 func_86C00EF8(minigameActor* arg0); +void func_86C00F70(minigameActor* arg0); +void func_86C01100(minigameActor* arg0); s16 func_86C01408(void); s16 func_86C014A0(void); -void func_86C01538(unk_func_8790002C* arg0); -void func_86C016C8(unk_func_8790002C* arg0); +void func_86C01538(minigameActor* arg0); +void func_86C016C8(minigameActor* arg0); void func_86C01748(void); -void func_86C01750(unk_func_8790002C* arg0, s32 arg1, s32 arg2, f32 arg3, f32 arg4, f32 arg5); -void func_86C018B8(unk_func_8790002C* arg0, s32 arg1); +void func_86C01750(minigameActor* arg0, s32 arg1, s32 arg2, f32 arg3, f32 arg4, f32 arg5); +void func_86C018B8(minigameActor* arg0, s32 arg1); void func_86C01AF8(void); -void func_86C01D2C(unk_func_8790002C* arg0, s32 arg1); -void func_86C01FAC(unk_func_8790002C* arg0, s32 arg1); -void func_86C021FC(unk_func_8790002C* arg0); -void func_86C022D8(unk_func_8790002C* arg0); -void func_86C02324(unk_func_8790002C* arg0, s32 arg1); +void func_86C01D2C(minigameActor* arg0, s32 arg1); +void func_86C01FAC(minigameActor* arg0, s32 arg1); +void func_86C021FC(minigameActor* arg0); +void func_86C022D8(minigameActor* arg0); +void func_86C02324(minigameActor* arg0, s32 arg1); void func_86C0250C(void); void func_86C02514(void); -void func_86C02610(unk_func_8790002C* arg0, s32 arg1); -void func_86C026F0(unk_func_8790002C* arg0, s32 arg1); +void initDiglett(minigameActor* diglett, s32 arg1); +void initDiglettHole(minigameActor* arg0, s32 arg1); void func_86C0276C(void); void func_86C027A4(void); void func_86C027AC(void); void func_86C027B4(void); void func_86C027BC(void); -void func_86C02804(void); +void initDigletts(void); s16 func_86C028C0(s16 arg0); -void func_86C02A1C(unk_func_8790002C* arg0); -void func_86C02B78(unk_func_8790002C* arg0, s32 arg1); +void func_86C02A1C(minigameActor* arg0); +void func_86C02B78(minigameActor* arg0, s32 arg1); void func_86C02C28(void); void func_86C03008(void); void func_86C03080(void); @@ -55,7 +55,7 @@ s32 func_86C030EC(void); void func_86C03128(void); s32 func_86C031E4(void); s32 func_86C03258(void); -void func_86C03344(void); +void ekansMinigameNextStep(void); void func_86C034F8(void); void func_86C03500(void); void func_86C035E0(void); @@ -67,10 +67,10 @@ void func_86C03E4C(void); void func_86C03E8C(s32 arg0); void func_86C03ED4(void); void func_86C040B4(s32 arg0); -void func_86C04170(void); -void func_86C041E8(void); -void func_86C043C4(void); +void initEkansMinigameAssets(void); +void showTutorialScreenEkansMinigame(void); +void ekansMinigameUpdate(void); void func_86C044B4(void); -s32 func_86C046B0(s32 arg0, UNUSED s32 arg1); +s32 startSkansMinigame(s32 arg0, UNUSED s32 arg1); #endif // _FRAGMENT18_H_ diff --git a/src/fragments/19/fragment19.c b/src/fragments/19/fragment19.c index 1261ba7..c17b782 100644 --- a/src/fragments/19/fragment19.c +++ b/src/fragments/19/fragment19.c @@ -28,15 +28,15 @@ void func_86D00020(void) { D_87906068 = 0x32; D_8790606A = 0x1900; - D_8790606C.x = 0; - D_8790606C.y = 0x1E; - D_8790606C.z = 0; + minigameCameraCoords.x = 0; + minigameCameraCoords.y = 0x1E; + minigameCameraCoords.z = 0; func_87900B64(); } void func_86D000A8(void) { - func_87900C5C(); + minigameDebuggModeControll(); func_87900B64(); } @@ -46,8 +46,8 @@ void func_86D000D0(UNUSED s32 arg0) { func_80015348(); func_80015094(&D_87906050->unk_00); - if (D_87903DB0 != 0) { - func_87900F44(); + if (minigameDebuggMode != 0) { + showDebuggCameraInfo(); } func_80007778(); @@ -77,17 +77,17 @@ void func_86D0015C(void) { } if (BTN_IS_PRESSED(gPlayer1Controller, BTN_Z)) { - D_87903DB0 = (D_87903DB0 + 1) & 1; + minigameDebuggMode = (minigameDebuggMode + 1) & 1; } - if ((D_87903DB0 == 0) && BTN_IS_PRESSED(gPlayer1Controller, BTN_START)) { - D_87903DA0 = 1; + if ((minigameDebuggMode == 0) && BTN_IS_PRESSED(gPlayer1Controller, BTN_START)) { + minigameState = 1; } func_8790370C(); func_86D000A8(); - if ((D_87903DB0 == 0) && BTN_IS_PRESSED(gPlayer1Controller, BTN_CDOWN)) { + if ((minigameDebuggMode == 0) && BTN_IS_PRESSED(gPlayer1Controller, BTN_CDOWN)) { var_s1 = 0; } diff --git a/src/fragments/20/fragment20.c b/src/fragments/20/fragment20.c index a2a207b..f69c7d6 100644 --- a/src/fragments/20/fragment20.c +++ b/src/fragments/20/fragment20.c @@ -37,8 +37,8 @@ typedef struct unk_D_86E04BFC { /* 0x16 */ s16 unk_16; } unk_D_86E04BFC; // size = 0x18 -static unk_func_8790002C D_86E04D60[4]; -static unk_func_8790002C D_86E05830[20]; +static minigameActor D_86E04D60[4]; +static minigameActor D_86E05830[20]; static s16 D_86E08E40; static unk_D_800AC870* D_86E08E44; @@ -455,8 +455,8 @@ static u32 D_86E04AE0[] = { static s16 D_86E04B20 = 0; static s16 D_86E04B24 = 1; static s16 D_86E04B28 = 0; -static unk_func_8790002C* D_86E04B2C = D_86E04D60; -static unk_func_8790002C* D_86E04B30 = D_86E05830; +static minigameActor* D_86E04B2C = D_86E04D60; +static minigameActor* D_86E04B30 = D_86E05830; static u32 D_86E04B34[] = { 0x0C00FFFF, 0x05000000, 0x0B00001E, 0x00000000, 0x014000F0, 0xFFE20032, 0x00000000, 0x00000000, 0x05000000, 0x0D000000, 0x05000000, 0x14000000, 0x002B0012, 0xFFFFFF32, 0x16FFFFFF, 0x0F000003, @@ -568,12 +568,12 @@ void func_86E001A0(s16 arg0, s16 arg1) { } } -void func_86E001E4(unk_func_8790002C* arg0, s32 arg1) { +void func_86E001E4(minigameActor* arg0, s32 arg1) { func_8790060C(arg0); - arg0->unk_16C.x = 1.0f; - arg0->unk_16C.y = 1.0f; - arg0->unk_16C.z = 1.0f; + arg0->scale.x = 1.0f; + arg0->scale.y = 1.0f; + arg0->scale.z = 1.0f; arg0->unk_1A8.x = D_86E04BCC[arg1].x; arg0->unk_1A8.y = D_86E04BCC[arg1].y; @@ -608,18 +608,18 @@ void func_86E002E4(void) { } } -void func_86E0034C(unk_func_8790002C* arg0) { +void func_86E0034C(minigameActor* arg0) { arg0->unk_25A++; arg0->unk_272 = 4; arg0->unk_000.unk_01C = 1; } -void func_86E0036C(unk_func_8790002C* arg0) { +void func_86E0036C(minigameActor* arg0) { if (arg0->unk_29A != 0) { arg0->unk_29A--; } - if ((D_879060BC->buttonDown & 0x8000) && (arg0->unk_23E == 0) && (arg0->unk_240 == 0) && (arg0->unk_2AA == 0) && + if ((tempControllerPtr->buttonDown & 0x8000) && (arg0->unk_23E == 0) && (arg0->unk_240 == 0) && (arg0->unk_2AA == 0) && (arg0->unk_29A == 0)) { arg0->unk_23E = 1; } @@ -637,24 +637,24 @@ void func_86E0036C(unk_func_8790002C* arg0) { arg0->unk_000.unk_000.unk_02 &= ~0x20; } - if (!(D_879060BC->buttonDown & 0x8000) || (arg0->unk_2AA != 0)) { + if (!(tempControllerPtr->buttonDown & 0x8000) || (arg0->unk_2AA != 0)) { arg0->unk_23E = 0; arg0->unk_000.unk_000.unk_02 |= 0x20; - } else if ((D_879060BC->buttonDown & 0x8000) != 0) { + } else if ((tempControllerPtr->buttonDown & 0x8000) != 0) { func_86E0034C(arg0); } break; } } -void func_86E004FC(unk_func_8790002C* arg0) { +void func_86E004FC(minigameActor* arg0) { if (arg0->unk_2AC != 0) { arg0->unk_244 = 0; arg0->unk_242 = 0; } } -s32 func_86E00518(unk_func_8790002C* arg0, s32 arg1) { +s32 func_86E00518(minigameActor* arg0, s32 arg1) { s32 sp1C; s32 sp18; s32 var_v1; @@ -712,7 +712,7 @@ s32 func_86E00518(unk_func_8790002C* arg0, s32 arg1) { return var_v1; } -void func_86E0063C(unk_func_8790002C* arg0, s32 arg1) { +void func_86E0063C(minigameActor* arg0, s32 arg1) { s32 sp2C; s32 sp28; u32 sp24; @@ -753,7 +753,7 @@ void func_86E0063C(unk_func_8790002C* arg0, s32 arg1) { arg0->unk_2B2 = sp24; } -void func_86E0073C(unk_func_8790002C* arg0, s32 arg1) { +void func_86E0073C(minigameActor* arg0, s32 arg1) { u32 sp2C; UNUSED s32 pad[3]; u32 sp1C; @@ -778,13 +778,13 @@ void func_86E0073C(unk_func_8790002C* arg0, s32 arg1) { arg0->unk_2B2 = var_a2; } -void func_86E007BC(unk_func_8790002C* arg0, s32 arg1) { +void func_86E007BC(minigameActor* arg0, s32 arg1) { arg0->unk_244 = arg1; arg0->unk_29E = 0; arg0->unk_2B2 = 0; } -void func_86E007CC(unk_func_8790002C* arg0, s32 arg1) { +void func_86E007CC(minigameActor* arg0, s32 arg1) { s32 i; s32 sp20; s32 var_t0 = 0; @@ -842,7 +842,7 @@ void func_86E007CC(unk_func_8790002C* arg0, s32 arg1) { } } -void func_86E00924(unk_func_8790002C* arg0, s32 arg1) { +void func_86E00924(minigameActor* arg0, s32 arg1) { if (arg0->unk_242 == 0) { func_86E007CC(arg0, arg1); } @@ -896,14 +896,14 @@ void func_86E00924(unk_func_8790002C* arg0, s32 arg1) { void func_86E00AF4(void) { s32 i; - D_879060BC = gPlayer1Controller; + tempControllerPtr = gPlayer1Controller; D_86E04B2C = D_86E04D60; for (i = 0; i < 4; i++) { D_86E04B2C->unk_000.unk_01C = 0; D_86E04B2C->unk_272 = 0; - if (D_87903DA4 != 0) { + if (minigameInputLock != 0) { if (D_86E04B2C->unk_2AC == 0) { func_86E0036C(D_86E04B2C); } else { @@ -915,7 +915,7 @@ void func_86E00AF4(void) { func_87900808(D_86E04B2C); D_86E04B2C++; - D_879060BC++; + tempControllerPtr++; } } @@ -940,7 +940,7 @@ s32 func_86E00C34(s32 arg0) { return sp1C; } -void func_86E00CAC(unk_func_8790002C* arg0, s32 arg1) { +void func_86E00CAC(minigameActor* arg0, s32 arg1) { s32 i; s32 temp_v0; @@ -963,7 +963,7 @@ void func_86E00CAC(unk_func_8790002C* arg0, s32 arg1) { } } -void func_86E00D78(unk_func_8790002C* arg0, s32 arg1) { +void func_86E00D78(minigameActor* arg0, s32 arg1) { if ((D_86E04B2C->unk_25A > 0) && (arg0->unk_2A8 == 0)) { if (D_86E04B2C->unk_25A >= 0x28) { D_86E04B2C->unk_258 -= D_86E04B2C->unk_25A; @@ -1009,7 +1009,7 @@ void func_86E00ED0(void) { D_86E04B2C = D_86E04D60; for (i = 0; i < 4; i++) { - if (D_87903DA4 != 0) { + if (minigameInputLock != 0) { func_86E00CAC(D_86E04B2C, i); func_86E00D78(D_86E04B2C, i); } @@ -1040,7 +1040,7 @@ void func_86E00FD8(void) { } } -void func_86E0103C(unk_func_8790002C* arg0, s32 arg1) { +void func_86E0103C(minigameActor* arg0, s32 arg1) { func_8790060C(arg0); arg0->unk_266 = arg1; @@ -1052,9 +1052,9 @@ void func_86E0103C(unk_func_8790002C* arg0, s32 arg1) { arg0->unk_288 = D_86E04BFC[arg1].unk_12; arg0->unk_28C = D_86E04BFC[arg1].unk_14; - arg0->unk_16C.x = 0.5f; - arg0->unk_16C.y = 0.5f; - arg0->unk_16C.z = 0.5f; + arg0->scale.x = 0.5f; + arg0->scale.y = 0.5f; + arg0->scale.z = 0.5f; arg0->unk_000.unk_000.unk_01 &= ~1; @@ -1084,7 +1084,7 @@ void func_86E01188(void) { s32 var_s1; s32 sp40; s32 var_s5; - unk_func_8790002C* ptr; + minigameActor* ptr; switch (D_87906046) { default: @@ -1127,7 +1127,7 @@ void func_86E01188(void) { } } -void func_86E01310(unk_func_8790002C* arg0) { +void func_86E01310(minigameActor* arg0) { s16 temp_v1 = (D_86E04B20 * 4) + 0x28; s16 temp_a1 = arg0->unk_266; @@ -1146,12 +1146,12 @@ void func_86E01310(unk_func_8790002C* arg0) { func_8001BD04(&arg0->unk_000, 0); } -void func_86E01414(unk_func_8790002C* arg0) { +void func_86E01414(minigameActor* arg0) { arg0->unk_23E = 0; arg0->unk_000.unk_000.unk_01 &= ~1; } -void func_86E01428(unk_func_8790002C* arg0) { +void func_86E01428(minigameActor* arg0) { UNUSED s32 pad[3]; s16 temp_a1 = arg0->unk_266; Vec3f sp3C; @@ -1224,7 +1224,7 @@ void func_86E01428(unk_func_8790002C* arg0) { } } -void func_86E016EC(unk_func_8790002C* arg0) { +void func_86E016EC(minigameActor* arg0) { f32 temp_fv0; f32 temp_fv0_2; f32 temp_fv0_3; @@ -1234,7 +1234,7 @@ void func_86E016EC(unk_func_8790002C* arg0) { arg0->unk_190.z = arg0->unk_19C.z = arg0->unk_1A8.z + arg0->unk_1C0.z; } -void func_86E0172C(unk_func_8790002C* arg0) { +void func_86E0172C(minigameActor* arg0) { if (arg0->unk_23E != 0) { arg0->unk_1F8 += arg0->unk_204; arg0->unk_1FC += arg0->unk_208 - arg0->unk_210; @@ -1258,12 +1258,12 @@ void func_86E017C0(void) { } } -void func_86E0182C(unk_func_8790002C* arg0) { +void func_86E0182C(minigameActor* arg0) { func_879003A0(arg0); - arg0->unk_000.unk_030.x = arg0->unk_16C.x; - arg0->unk_000.unk_030.y = arg0->unk_16C.y; - arg0->unk_000.unk_030.z = arg0->unk_16C.z; + arg0->unk_000.unk_030.x = arg0->scale.x; + arg0->unk_000.unk_030.y = arg0->scale.y; + arg0->unk_000.unk_030.z = arg0->scale.z; arg0->unk_000.unk_024.x = arg0->unk_190.x; arg0->unk_000.unk_024.y = arg0->unk_190.y; @@ -1297,15 +1297,15 @@ void func_86E01904(void) { D_87906068 = 0x32; D_8790606A = 0x1900; - D_8790606C.x = 0; - D_8790606C.y = 0x2A; - D_8790606C.z = 0; + minigameCameraCoords.x = 0; + minigameCameraCoords.y = 0x2A; + minigameCameraCoords.z = 0; func_87900B64(); } void func_86E01990(void) { - func_87900C5C(); + minigameDebuggModeControll(); func_87900B64(); } @@ -1314,7 +1314,7 @@ void func_86E019B8(void) { func_86E010E8(); func_86E002E4(); func_86E01904(); - D_87903DA4 = 0; + minigameInputLock = 0; } void func_86E019F4(void) { @@ -1453,7 +1453,7 @@ s32 func_86E01B08(void) { s32 func_86E01E34(void) { s32 i; s32 var_s3 = 0; - unk_func_8790002C* var_s0; + minigameActor* var_s0; for (i = 0, var_s0 = D_86E04D60; i < 4; i++, var_s0++) { if (var_s0->unk_2A8 != 0) { @@ -1497,7 +1497,7 @@ s32 func_86E01EE8(void) { s32 func_86E01F50(void) { s32 i; s32 ret = 1; - unk_func_8790002C* var_v0 = D_86E05830; + minigameActor* var_v0 = D_86E05830; for (i = 0; i < 20; i++, var_v0++) { if (var_v0->unk_23E != 0) { @@ -1509,26 +1509,26 @@ s32 func_86E01F50(void) { } void func_86E01F8C(void) { - switch (D_87903DA0) { + switch (minigameState) { case 1: - D_87906040 = 0xF; - D_87903DA0++; + minigameInputLockTimer = 0xF; + minigameState++; break; case 2: - D_87906040--; - if (D_87906040 < 0) { + minigameInputLockTimer--; + if (minigameInputLockTimer < 0) { func_8780295C(1); - D_87903DA0++; + minigameState++; } break; case 3: if (func_86E01EE8() != 0) { D_86E04B28 = 1; - D_87903DA4 = 1; + minigameInputLock = 1; D_87903DC4 = 0; - D_87903DA0++; + minigameState++; } break; @@ -1536,7 +1536,7 @@ void func_86E01F8C(void) { if (1) {} if (func_86E01B08() != 0) { - D_87903DA0++; + minigameState++; } else { func_86E019F4(); } @@ -1544,23 +1544,23 @@ void func_86E01F8C(void) { case 5: if (func_86E01F50() != 0) { - D_87906040 = 0xA; - D_87903DA0++; + minigameInputLockTimer = 0xA; + minigameState++; } break; case 6: - D_87906040--; - if (D_87906040 < 0) { + minigameInputLockTimer--; + if (minigameInputLockTimer < 0) { func_86E01E34(); func_87802EB8(1); - D_87903DA0++; + minigameState++; } break; case 7: if (D_8780FC96 != 0) { - D_87903DA0++; + minigameState++; D_87903DAC = 1; } break; @@ -1680,7 +1680,7 @@ void func_86E027FC(s32 arg0) { func_86E027D4(); func_8001F444(); - if (D_87906044 != 0) { + if (showMinigameHUD != 0) { func_86E02170(); func_86E021D8(); } @@ -1697,13 +1697,13 @@ void func_86E02880(s32 arg0) { func_80015094(&D_87906050->unk_00); func_87901C98(); - if (D_87903DB0 == 0) { + if (minigameDebuggMode == 0) { if (D_8780FC98 == 0) { func_86E027FC(arg0); } func_87804FD4(); } else { - func_87900F44(); + showDebuggCameraInfo(); } func_80007778(); @@ -1721,13 +1721,13 @@ void func_86E0296C(void) { } void func_86E02974(void) { - if ((D_87903DB0 == 0) && (D_87906044 == 0) && (func_80007604() == 0)) { - if (gPlayer1Controller->buttonPressed & 0x1000) { + if ((minigameDebuggMode == 0) && (showMinigameHUD == 0) && (func_80007604() == 0)) { + if (BTN_IS_PRESSED(gPlayer1Controller, BTN_START)) { D_87903DC4 = 1; - D_87903DA0 = 1; - D_87906044 = 1; + minigameState = 1; + showMinigameHUD = 1; func_86E001A0(0xB, 0); - } else if ((D_8780FA2A == 0) && (gPlayer1Controller->buttonPressed & 0x4000)) { + } else if ((D_8780FA2A == 0) && (BTN_IS_PRESSED(gPlayer1Controller, BTN_B))) { func_86E001A0(0xD, 0); func_87802EB8(2); } @@ -1735,9 +1735,9 @@ void func_86E02974(void) { } void func_86E02A28(void) { - unk_func_8790002C* ptr = D_86E04D60; + minigameActor* ptr = D_86E04D60; - if ((gPlayer1Controller->buttonPressed & 0x8000) && (ptr->unk_23E == 0)) { + if (BTN_IS_PRESSED(gPlayer1Controller, BTN_A) && (ptr->unk_23E == 0)) { ptr->unk_29A = 4; } } @@ -1753,7 +1753,7 @@ void func_86E02A64(void) { while (var_s1 != 0) { func_87900528(); - if (D_87903DA0 == 0) { + if (minigameState == 0) { D_87906042 += 1; if (D_87906042 < 0) { D_87906042 = 0; diff --git a/src/fragments/20/fragment20.h b/src/fragments/20/fragment20.h index 089b7fd..c09368c 100644 --- a/src/fragments/20/fragment20.h +++ b/src/fragments/20/fragment20.h @@ -6,35 +6,35 @@ void func_86E00020(s16 arg0, s16 arg1); void func_86E001A0(s16 arg0, s16 arg1); -void func_86E001E4(unk_func_8790002C* arg0, s32 arg1); +void func_86E001E4(minigameActor* arg0, s32 arg1); void func_86E002E4(void); -void func_86E0034C(unk_func_8790002C* arg0); -void func_86E0036C(unk_func_8790002C* arg0); -void func_86E004FC(unk_func_8790002C* arg0); -s32 func_86E00518(unk_func_8790002C* arg0, s32 arg1); -void func_86E0063C(unk_func_8790002C* arg0, s32 arg1); -void func_86E0073C(unk_func_8790002C* arg0, s32 arg1); -void func_86E007BC(unk_func_8790002C* arg0, s32 arg1); -void func_86E007CC(unk_func_8790002C* arg0, s32 arg1); -void func_86E00924(unk_func_8790002C* arg0, s32 arg1); +void func_86E0034C(minigameActor* arg0); +void func_86E0036C(minigameActor* arg0); +void func_86E004FC(minigameActor* arg0); +s32 func_86E00518(minigameActor* arg0, s32 arg1); +void func_86E0063C(minigameActor* arg0, s32 arg1); +void func_86E0073C(minigameActor* arg0, s32 arg1); +void func_86E007BC(minigameActor* arg0, s32 arg1); +void func_86E007CC(minigameActor* arg0, s32 arg1); +void func_86E00924(minigameActor* arg0, s32 arg1); void func_86E00AF4(void); s32 func_86E00BDC(void); s32 func_86E00C34(s32 arg0); -void func_86E00CAC(unk_func_8790002C* arg0, s32 arg1); -void func_86E00D78(unk_func_8790002C* arg0, s32 arg1); +void func_86E00CAC(minigameActor* arg0, s32 arg1); +void func_86E00D78(minigameActor* arg0, s32 arg1); void func_86E00ED0(void); void func_86E00F60(void); void func_86E00FD8(void); -void func_86E0103C(unk_func_8790002C* arg0, s32 arg1); +void func_86E0103C(minigameActor* arg0, s32 arg1); void func_86E010E8(void); void func_86E01188(void); -void func_86E01310(unk_func_8790002C* arg0); -void func_86E01414(unk_func_8790002C* arg0); -void func_86E01428(unk_func_8790002C* arg0); -void func_86E016EC(unk_func_8790002C* arg0); -void func_86E0172C(unk_func_8790002C* arg0); +void func_86E01310(minigameActor* arg0); +void func_86E01414(minigameActor* arg0); +void func_86E01428(minigameActor* arg0); +void func_86E016EC(minigameActor* arg0); +void func_86E0172C(minigameActor* arg0); void func_86E017C0(void); -void func_86E0182C(unk_func_8790002C* arg0); +void func_86E0182C(minigameActor* arg0); void func_86E01898(void); void func_86E01904(void); void func_86E01990(void); diff --git a/src/fragments/21/fragment21.c b/src/fragments/21/fragment21.c index 73dc282..5271f21 100644 --- a/src/fragments/21/fragment21.c +++ b/src/fragments/21/fragment21.c @@ -31,9 +31,9 @@ extern u8 D_03049020[]; extern u8 D_030483A0[]; extern u8 D_03047720[]; -static unk_func_8790002C D_86F0B1F0[4]; -static unk_func_8790002C D_86F0BCC0[4]; -static unk_func_8790002C D_86F0C790[4]; +static minigameActor D_86F0B1F0[4]; +static minigameActor D_86F0BCC0[4]; +static minigameActor D_86F0C790[4]; static s16 D_86F0D260; static unk_D_800AC870* D_86F0D264; @@ -1455,9 +1455,9 @@ static u32 D_86F0AFB8[] = { 0x000023D7, 0x000023D7, 0x05000000, 0x03000000, D_86F0ACE0, 0x06000000, 0x06000000, 0x01000000, }; -static unk_func_8790002C* D_86F0AFF8 = D_86F0B1F0; -static unk_func_8790002C* D_86F0AFFC = D_86F0BCC0; -static unk_func_8790002C* D_86F0B000 = D_86F0C790; +static minigameActor* D_86F0AFF8 = D_86F0B1F0; +static minigameActor* D_86F0AFFC = D_86F0BCC0; +static minigameActor* D_86F0B000 = D_86F0C790; static u32 D_86F0B004[] = { 0x0C00FFFF, 0x05000000, 0x0B00001E, 0x00000000, 0x014000F0, 0x0000000F, 0x00000000, 0x00000000, @@ -1583,10 +1583,10 @@ void func_86F00188(s16 arg0, s16 arg1) { } } -void func_86F001CC(unk_func_8790002C* arg0, s32 arg1) { - arg0->unk_16C.x = 1.0f; - arg0->unk_16C.y = 1.0f; - arg0->unk_16C.z = 1.0f; +void func_86F001CC(minigameActor* arg0, s32 arg1) { + arg0->scale.x = 1.0f; + arg0->scale.y = 1.0f; + arg0->scale.z = 1.0f; arg0->unk_1A8.x = D_86F0B0A0[arg1].x; arg0->unk_1A8.y = D_86F0B0A0[arg1].y; @@ -1635,32 +1635,32 @@ void func_86F002F4(void) { } } -void func_86F0035C(unk_func_8790002C* arg0) { - arg0->unk_222 = D_879060BC->angle; +void func_86F0035C(minigameActor* arg0) { + arg0->unk_222 = tempControllerPtr->angle; } void func_86F00370(void) { s32 i; - D_879060BC = gPlayer1Controller; + tempControllerPtr = gPlayer1Controller; D_86F0AFF8 = D_86F0B1F0; for (i = 0; i < 4; i++) { func_86F0035C(D_86F0AFF8); D_86F0AFF8++; - D_879060BC++; + tempControllerPtr++; } } -void func_86F003FC(unk_func_8790002C* arg0, s32 arg1) { +void func_86F003FC(minigameActor* arg0, s32 arg1) { func_8001BD04(&arg0->unk_000, arg1); func_800173DC(&arg0->unk_000, 0, arg0->unk_000.unk_040.unk_04, 0x10000); func_80017464(&arg0->unk_000, 0); func_80017454(&arg0->unk_000, 0x10000); } -void func_86F00450(unk_func_8790002C* arg0, f32 arg1) { +void func_86F00450(minigameActor* arg0, f32 arg1) { arg0->unk_280 -= arg1; if (arg0->unk_280 < 1.0f) { arg0->unk_280 = 1.0f; @@ -1668,7 +1668,7 @@ void func_86F00450(unk_func_8790002C* arg0, f32 arg1) { arg0->unk_27C = arg0->unk_280; } -void func_86F0048C(unk_func_8790002C* arg0, s32 arg1) { +void func_86F0048C(minigameActor* arg0, s32 arg1) { if (arg1 == -1) { arg0->unk_29A = 0; arg0->unk_2B0 = 0; @@ -1689,21 +1689,21 @@ void func_86F0048C(unk_func_8790002C* arg0, s32 arg1) { } } -void func_86F0050C(unk_func_8790002C* arg0) { +void func_86F0050C(minigameActor* arg0) { s32 var_v0; var_v0 = 0; - if (D_879060BC->buttonPressed & 0x20 && (D_879060BC->buttonPressed & 0x10)) { + if (tempControllerPtr->buttonPressed & 0x20 && (tempControllerPtr->buttonPressed & 0x10)) { var_v0 = 3; } else if (arg0->unk_29A == 1) { - if (D_879060BC->buttonPressed & 0x20) { + if (tempControllerPtr->buttonPressed & 0x20) { var_v0 = 1; - } else if (D_879060BC->buttonPressed & 0x10) { + } else if (tempControllerPtr->buttonPressed & 0x10) { var_v0 = 2; } - } else if (D_879060BC->buttonPressed & 0x10) { + } else if (tempControllerPtr->buttonPressed & 0x10) { var_v0 = 2; - } else if (D_879060BC->buttonPressed & 0x20) { + } else if (tempControllerPtr->buttonPressed & 0x20) { var_v0 = 1; } @@ -1756,7 +1756,7 @@ void func_86F0050C(unk_func_8790002C* arg0) { arg0->unk_274 += arg0->unk_27C; } -void func_86F00778(unk_func_8790002C* arg0) { +void func_86F00778(minigameActor* arg0) { switch (D_87906046) { case 0: arg0->unk_27C = (func_81400A78(0xA) * 0.1f) + 3.0f; @@ -1781,7 +1781,7 @@ void func_86F00778(unk_func_8790002C* arg0) { } } -void func_86F00920(unk_func_8790002C* arg0) { +void func_86F00920(minigameActor* arg0) { UNUSED s32 pad; Vec3f sp48; f32 temp_fv0; @@ -1867,14 +1867,14 @@ void func_86F00920(unk_func_8790002C* arg0) { void func_86F00D04(void) { s32 i; - D_879060BC = gPlayer1Controller; + tempControllerPtr = gPlayer1Controller; D_86F0AFF8 = D_86F0B1F0; D_86F0AFFC = D_86F0BCC0; D_86F0B000 = D_86F0C790; for (i = 0; i < 4; i++) { - if (D_87903DA4 != 0) { + if (minigameInputLock != 0) { if (D_86F0AFF8->unk_2AC == 0) { func_86F0050C(D_86F0AFF8); } else { @@ -1890,16 +1890,16 @@ void func_86F00D04(void) { D_86F0AFFC++; D_86F0B000++; - D_879060BC++; + tempControllerPtr++; } } -void func_86F00E34(unk_func_8790002C* a0, s32 arg1) { - unk_func_8790002C* arg0 = a0; +void func_86F00E34(minigameActor* a0, s32 arg1) { + minigameActor* arg0 = a0; - arg0->unk_16C.x = 1.0f; - arg0->unk_16C.y = 1.0f; - arg0->unk_16C.z = 1.0f; + arg0->scale.x = 1.0f; + arg0->scale.y = 1.0f; + arg0->scale.z = 1.0f; arg0->unk_1A8.x = D_86F0B0A0[arg1].x; arg0->unk_1A8.y = D_86F0B0A0[arg1].y; @@ -1933,7 +1933,7 @@ void func_86F00F00(void) { } } -void func_86F00F68(unk_func_8790002C* arg0, unk_func_8790002C* arg1) { +void func_86F00F68(minigameActor* arg0, minigameActor* arg1) { s32 var_a1; if ((arg1->unk_274 > 300.0f) && (arg0->unk_23E == 0)) { @@ -1968,12 +1968,12 @@ void func_86F01014(void) { } } -void func_86F010B4(unk_func_8790002C* a0, s32 arg1) { - unk_func_8790002C* arg0 = a0; +void func_86F010B4(minigameActor* a0, s32 arg1) { + minigameActor* arg0 = a0; - arg0->unk_16C.x = 1.0f; - arg0->unk_16C.y = 1.0f; - arg0->unk_16C.z = 1.0f; + arg0->scale.x = 1.0f; + arg0->scale.y = 1.0f; + arg0->scale.z = 1.0f; arg0->unk_1A8.x = D_86F0B0A0[arg1].x; arg0->unk_1A8.y = D_86F0B0A0[arg1].y; @@ -2012,7 +2012,7 @@ void func_86F01180(void) { } } -void func_86F011E8(unk_func_8790002C* arg0) { +void func_86F011E8(minigameActor* arg0) { switch (arg0->unk_23E) { case 1: func_86F003FC(arg0, 0); @@ -2056,9 +2056,9 @@ void func_86F0132C(void) { D_87906068 = 0x32; D_8790606A = 0x1900; - D_8790606C.x = 0; - D_8790606C.y = -2; - D_8790606C.z = 0; + minigameCameraCoords.x = 0; + minigameCameraCoords.y = -2; + minigameCameraCoords.z = 0; func_87900B64(); } @@ -2085,7 +2085,7 @@ void func_86F013B8(void) { void func_86F01488(void) { func_86F013B8(); - func_87900C5C(); + minigameDebuggModeControll(); func_87900B64(); } @@ -2164,52 +2164,52 @@ s32 func_86F016D8(void) { } void func_86F0174C(void) { - switch (D_87903DA0) { + switch (minigameState) { case 1: - D_87906040 = 0xF; - D_87903DA0++; + minigameInputLockTimer = 0xF; + minigameState++; break; case 2: - D_87906040--; - if (D_87906040 < 0) { + minigameInputLockTimer--; + if (minigameInputLockTimer < 0) { func_8780295C(1); - D_87903DA0++; + minigameState++; } break; case 3: if (func_86F016D8() != 0) { - D_87903DA4 = 1; + minigameInputLock = 1; D_87903DC4 = 0; func_86F00370(); - D_87903DA0++; + minigameState++; } break; case 4: if (func_86F014F8() != 0) { func_86F0164C(); - D_87903DA4 = 0; + minigameInputLock = 0; D_87906072 = 1; - D_87903DA0++; - D_87906040 = 0x28; + minigameState++; + minigameInputLockTimer = 0x28; } break; case 5: - D_87906040--; - if (D_87906040 == 0) { + minigameInputLockTimer--; + if (minigameInputLockTimer == 0) { func_87802EB8(1); func_87903294(); func_86F00188(0xC, 0xB4); - D_87903DA0++; + minigameState++; } break; case 6: if (D_8780FC96 != 0) { - D_87903DA0++; + minigameState++; D_87903DAC = 1; } break; @@ -2312,7 +2312,7 @@ void func_86F01EB4(void) { func_87903260(); func_86F01C40(); - if (D_87906044 != 0) { + if (showMinigameHUD != 0) { func_86F01D78(); } } @@ -2345,14 +2345,14 @@ void func_86F01F58(s32 arg0) { func_80015094(&D_87906050->unk_00); func_87901C98(); - if (D_87903DB0 == 0) { + if (minigameDebuggMode == 0) { if (D_8780FC98 == 0) { func_86F01EF4(arg0); } func_87804FD4(); } else { - func_87900F44(); - func_879010A4(); + showDebuggCameraInfo(); + showDebuggJoystickInfo(); } func_80007778(); @@ -2375,18 +2375,18 @@ void func_86F0204C(void) { while (var_s5 != 0) { func_87900528(); - if (D_87903DA0 == 0) { + if (minigameState == 0) { D_87906042 += 1; if (D_87906042 < 0) { D_87906042 = 0; } } - if ((D_87903DB0 == 0) && (D_87906044 == 0) && (func_80007604() == 0)) { + if ((minigameDebuggMode == 0) && (showMinigameHUD == 0) && (func_80007604() == 0)) { if (gPlayer1Controller->buttonPressed & 0x1000) { D_87903DC4 = 1; - D_87903DA0 = 1; - D_87906044 = 1; + minigameState = 1; + showMinigameHUD = 1; func_86F00188(7, 0); } else if ((D_8780FA2A == 0) && (gPlayer1Controller->buttonPressed & 0x4000)) { func_86F00188(8, 0); @@ -2404,7 +2404,7 @@ void func_86F0204C(void) { func_86F01488(); } - if ((D_87903DB0 == 0) && ((D_87903DAC != 0) || (D_8780FC92 != 0))) { + if ((minigameDebuggMode == 0) && ((D_87903DAC != 0) || (D_8780FC92 != 0))) { var_s5 = 0; } diff --git a/src/fragments/21/fragment21.h b/src/fragments/21/fragment21.h index 02844b3..273045b 100644 --- a/src/fragments/21/fragment21.h +++ b/src/fragments/21/fragment21.h @@ -6,24 +6,24 @@ void func_86F00020(s16 arg0, s16 arg1); void func_86F00188(s16 arg0, s16 arg1); -void func_86F001CC(unk_func_8790002C* arg0, s32 arg1); +void func_86F001CC(minigameActor* arg0, s32 arg1); void func_86F002F4(void); -void func_86F0035C(unk_func_8790002C* arg0); +void func_86F0035C(minigameActor* arg0); void func_86F00370(void); -void func_86F003FC(unk_func_8790002C* arg0, s32 arg1); -void func_86F00450(unk_func_8790002C* arg0, f32 arg1); -void func_86F0048C(unk_func_8790002C* arg0, s32 arg1); -void func_86F0050C(unk_func_8790002C* arg0); -void func_86F00778(unk_func_8790002C* arg0); -void func_86F00920(unk_func_8790002C* arg0); +void func_86F003FC(minigameActor* arg0, s32 arg1); +void func_86F00450(minigameActor* arg0, f32 arg1); +void func_86F0048C(minigameActor* arg0, s32 arg1); +void func_86F0050C(minigameActor* arg0); +void func_86F00778(minigameActor* arg0); +void func_86F00920(minigameActor* arg0); void func_86F00D04(void); -void func_86F00E34(unk_func_8790002C* a0, s32 arg1); +void func_86F00E34(minigameActor* a0, s32 arg1); void func_86F00F00(void); -void func_86F00F68(unk_func_8790002C* arg0, unk_func_8790002C* arg1); +void func_86F00F68(minigameActor* arg0, minigameActor* arg1); void func_86F01014(void); -void func_86F010B4(unk_func_8790002C* a0, s32 arg1); +void func_86F010B4(minigameActor* a0, s32 arg1); void func_86F01180(void); -void func_86F011E8(unk_func_8790002C* arg0); +void func_86F011E8(minigameActor* arg0); void func_86F012B8(void); void func_86F0132C(void); void func_86F013B8(void); diff --git a/src/fragments/3/fragment3.h b/src/fragments/3/fragment3.h index 36da038..6758db7 100644 --- a/src/fragments/3/fragment3.h +++ b/src/fragments/3/fragment3.h @@ -6,21 +6,21 @@ #include "src/3FB0.h" #include "src/controller.h" -typedef struct unk_func_8790002C { +typedef struct minigameActor { /* 0x000 */ unk_D_86002F58_004_000 unk_000; /* 0x168 */ unk_D_86002F30* unk_168; - /* 0x16C */ Vec3f unk_16C; + /* 0x16C */ Vec3f scale; /* 0x178 */ char unk178[0x18]; /* 0x190 */ Vec3f unk_190; - /* 0x19C */ Vec3f unk_19C; - /* 0x1A8 */ Vec3f unk_1A8; + /* 0x19C */ Vec3f unk_19C; // position? + /* 0x1A8 */ Vec3f unk_1A8; // position on skans' minigame, most probable one /* 0x1B4 */ Vec3f unk_1B4; /* 0x1C0 */ Vec3f unk_1C0; /* 0x1CC */ f32 unk_1CC; /* 0x1D0 */ f32 unk_1D0; /* 0x1D4 */ f32 unk_1D4; - /* 0x1D8 */ Vec3f unk_1D8; - /* 0x1E4 */ f32 unk_1E4; + /* 0x1D8 */ Vec3f unk_1D8; // also position on skans' minigame but nothing reads this ? + /* 0x1E4 */ f32 unk_1E4; // double of 28C /* 0x1E8 */ char unk1E8[0x4]; /* 0x1EC */ f32 unk_1EC; /* 0x1F0 */ f32 unk_1F0; @@ -32,7 +32,7 @@ typedef struct unk_func_8790002C { /* 0x208 */ f32 unk_208; /* 0x20C */ f32 unk_20C; /* 0x210 */ f32 unk_210; - /* 0x214 */ Vec3s unk_214; + /* 0x214 */ Vec3s unk_214; // rotation? /* 0x21A */ s16 unk_21A; /* 0x21C */ s16 unk_21C; /* 0x21E */ s16 unk_21E; @@ -40,7 +40,7 @@ typedef struct unk_func_8790002C { /* 0x222 */ s16 unk_222; /* 0x224 */ s16 unk_224; /* 0x226 */ s16 unk_226; - /* 0x228 */ s16 unk_228; + /* 0x228 */ s16 unk_228; // y angle? /* 0x22A */ s16 unk_22A; /* 0x22C */ s16 unk_22C; /* 0x22E */ s16 unk_22E; @@ -51,14 +51,14 @@ typedef struct unk_func_8790002C { /* 0x238 */ s16 unk_238; /* 0x23A */ s16 unk_23A; /* 0x23A */ s16 unk_23C; - /* 0x23E */ s16 unk_23E; + /* 0x23E */ s16 unk_23E; // animation id or state? /* 0x240 */ s16 unk_240; /* 0x242 */ s16 unk_242; /* 0x244 */ s16 unk_244; /* 0x246 */ char unk246[0x2]; - /* 0x248 */ s16 unk_248; - /* 0x24A */ s16 unk_24A; - /* 0x24C */ s16 unk_24C; + /* 0x248 */ s16 unk_248; // 0,1,2 - colliding? visibility? animation id? + /* 0x24A */ s16 unk_24A; // some flag related to collisions + /* 0x24C */ s16 unk_24C; // some flag related to collisions /* 0x24E */ char unk24E[0x6]; /* 0x254 */ s32 unk_254; /* 0x258 */ s16 unk_258; @@ -70,18 +70,18 @@ typedef struct unk_func_8790002C { /* 0x264 */ s16 unk_264; /* 0x264 */ s16 unk_266; /* 0x268 */ s16 unk_268; - /* 0x26A */ s16 unk_26A; - /* 0x26C */ s16 unk_26C; + /* 0x26A */ s16 unk_26A; // some flag related to collisions + /* 0x26C */ s16 unk_26C; // animation id or state? /* 0x26E */ s16 unk_26E; /* 0x270 */ s16 unk_270; /* 0x272 */ s16 unk_272; /* 0x274 */ f32 unk_274; /* 0x278 */ char unk278[0x4]; /* 0x27C */ f32 unk_27C; - /* 0x280 */ f32 unk_280; + /* 0x280 */ f32 unk_280; // intensity of rotation? /* 0x284 */ f32 unk_284; - /* 0x288 */ f32 unk_288; - /* 0x28C */ f32 unk_28C; + /* 0x288 */ f32 unk_288; // bottom of the hitbox? bounding box? + /* 0x28C */ f32 unk_28C; // top of the hitbox? boundin box? ; half of 1E4 /* 0x290 */ s16 unk_290; /* 0x292 */ s16 unk_292; /* 0x294 */ s16 unk_294; @@ -90,7 +90,7 @@ typedef struct unk_func_8790002C { /* 0x29A */ s16 unk_29A; /* 0x29C */ s16 unk_29C; /* 0x29E */ s16 unk_29E; - /* 0x2A0 */ s16 unk_2A0; + /* 0x2A0 */ s16 unk_2A0; // ammount of frames some button was pressed? /* 0x2A2 */ s16 unk_2A2; /* 0x2A4 */ s16 unk_2A4; /* 0x2A6 */ s16 unk_2A6; @@ -100,7 +100,7 @@ typedef struct unk_func_8790002C { /* 0x2AE */ s16 unk_2AE; /* 0x2B0 */ s16 unk_2B0; /* 0x2B2 */ s16 unk_2B2; -} unk_func_8790002C; // size = 0x2B4 +} minigameActor; // size = 0x2B4 // Possibly unk_D_86002F34_alt7, unk_D_86002F34_alt8, // unk_D_86002F34_alt9 or unk_D_86002F34_alt2 @@ -121,8 +121,8 @@ typedef struct unk_D_87903E10 { /* 0x04 */ unk_D_87903E00* unk_04; } unk_D_87903E10; // size = 0x8 -extern s16 D_87903DA0; -extern s16 D_87903DA4; +extern s16 minigameState; +extern s16 minigameInputLock; extern s16 D_87903DA8; extern s16 D_87903DAC; extern s16 D_87903DBC; @@ -137,9 +137,9 @@ extern unk_D_87903E10 D_87903E10; extern unk_D_87903E10 D_87903E28; extern unk_D_87903E10 D_87903E40; extern unk_D_87903E10 D_87903E58; -extern s16 D_87906040; +extern s16 minigameInputLockTimer; extern s16 D_87906042; -extern s16 D_87906044; +extern s16 showMinigameHUD; // game state? extern s16 D_87906046; extern s16 D_87906048; extern s16 D_8790604A; @@ -151,7 +151,7 @@ extern s16 D_87906064; extern s16 D_87906066; extern s16 D_87906068; extern s16 D_8790606A; -extern Vec3s D_8790606C; +extern Vec3s minigameCameraCoords; extern s16 D_87906072; extern s16 D_87906076; extern s16 D_87906078; @@ -170,9 +170,9 @@ extern s16 D_879060A6; extern s16 D_879060A8; extern Vec3s D_879060AC; -extern s16 D_87903DB0; +extern s16 minigameDebuggMode; extern s16 D_87903DB8; -extern Controller* D_879060BC; +extern Controller* tempControllerPtr; extern s16 D_879060C0; extern s16 D_879060C2; extern s8 D_879060C4[4]; @@ -184,34 +184,34 @@ extern Vec3f D_87906100; extern Vec3f D_87906110; ret_func_80004454 func_87900020(void); -void func_8790002C(unk_func_8790002C* arg0, unk_func_8790002C* arg1); -void func_87900070(unk_func_8790002C* arg0, unk_func_8790002C* arg1); -s32 func_879000C4(unk_func_8790002C* arg0, unk_func_8790002C* arg1); -s32 func_879001A4(unk_func_8790002C* arg0, unk_func_8790002C* arg1); -void func_879002B8(unk_func_8790002C* arg0, s16 arg1, s16 arg2, s16 arg3); -void func_879002FC(unk_func_8790002C* arg0, s16 arg1, s16 arg2, s16 arg3, s16 arg4); -void func_87900344(unk_func_8790002C* arg0, s16 arg1, s16 arg2, s16 arg3); -s32 func_87900384(unk_func_8790002C* arg0); -void func_879003A0(unk_func_8790002C* arg0); +float getVec3Distance_xz(minigameActor* arg0, minigameActor* arg1); +void getVec3Distance_xyz(minigameActor* arg0, minigameActor* arg1); +s32 func_879000C4(minigameActor* arg0, minigameActor* arg1); +s32 func_879001A4(minigameActor* arg0, minigameActor* arg1); +void func_879002B8(minigameActor* arg0, s16 arg1, s16 arg2, s16 arg3); +void func_879002FC(minigameActor* arg0, s16 arg1, s16 arg2, s16 arg3, s16 arg4); +void func_87900344(minigameActor* arg0, s16 arg1, s16 arg2, s16 arg3); +s32 func_87900384(minigameActor* arg0); +void func_879003A0(minigameActor* arg0); void func_879004F8(unk_D_86002F58_004_000* arg0); void func_87900528(void); void func_87900558(void); -void func_87900564(unk_func_8790002C* arg0); -void func_87900594(unk_func_8790002C* arg0); -void func_879005AC(unk_func_8790002C* arg0); -void func_879005C4(unk_func_8790002C* arg0); -void func_8790060C(unk_func_8790002C* arg0); -void func_87900770(unk_func_8790002C* arg0); -void func_87900808(unk_func_8790002C* arg0); +void func_87900564(minigameActor* arg0); +void func_87900594(minigameActor* arg0); +void func_879005AC(minigameActor* arg0); +void func_879005C4(minigameActor* arg0); +void func_8790060C(minigameActor* arg0); +void func_87900770(minigameActor* arg0); +void func_87900808(minigameActor* arg0); void func_87900854(void); void func_87900920(void); void func_879009B4(void); void func_87900A50(void); void func_87900B64(void); -s32 func_87900C5C(void); -void func_87900F44(void); -void func_879010A4(void); +s32 minigameDebuggModeControll(void); +void showDebuggCameraInfo(void); +void showDebuggJoystickInfo(void); void func_87901200(void); void func_87901620(void); @@ -252,11 +252,11 @@ void func_87903260(void); void func_87903294(void); void func_879032BC(s16 arg0); void func_87903358(s16 arg0, s16 arg1); -void func_879033FC(unk_func_8790002C* arg0); +void func_879033FC(minigameActor* arg0); void func_8790354C(void); void func_87903600(void); -void func_879036B4(unk_func_8790002C* arg0); +void func_879036B4(minigameActor* arg0); void func_8790370C(void); void func_879037D0(f32 arg0, f32 arg1, f32 arg2, f32 arg3, s16 arg4, s16 arg5, s16 arg6); void func_87903838(f32 arg0, f32 arg1, f32 arg2, f32 arg3, s16 arg4, s16 arg5, s16 arg6); diff --git a/src/fragments/3/fragment3_1189B0.c b/src/fragments/3/fragment3_1189B0.c index b66708a..6081004 100644 --- a/src/fragments/3/fragment3_1189B0.c +++ b/src/fragments/3/fragment3_1189B0.c @@ -4,15 +4,15 @@ #include "src/18140.h" #include "src/1C720.h" #include "src/20330.h" -#include "src/3FB0.h" +// #include "src/3FB0.h" #include "src/controller.h" #include "src/fragments/2/fragment2.h" -s16 D_87903DA0 = 0; -s16 D_87903DA4 = 0; +s16 minigameState = 0; +s16 minigameInputLock = 0; s16 D_87903DA8 = 0; s16 D_87903DAC = 0; -s16 D_87903DB0 = 0; +s16 minigameDebuggMode = 0; s32 pad_D_87903DB4 = 0; s16 D_87903DB8 = 0; s16 D_87903DBC = 0; @@ -27,86 +27,90 @@ ret_func_80004454 func_87900020(void) { return func_87900020; } -void func_8790002C(unk_func_8790002C* arg0, unk_func_8790002C* arg1) { - sqrtf(SQ(arg1->unk_19C.x - arg0->unk_19C.x) + SQ(arg1->unk_19C.z - arg0->unk_19C.z)); +// func_8790002C +float getVec3Distance_xz(minigameActor* arg0, minigameActor* arg1) { + return sqrtf(SQ(arg1->unk_19C.x - arg0->unk_19C.x) + SQ(arg1->unk_19C.z - arg0->unk_19C.z)); } - -void func_87900070(unk_func_8790002C* arg0, unk_func_8790002C* arg1) { +// func_87900070 +void getVec3Distance_xyz(minigameActor* arg0, minigameActor* arg1) { sqrtf(SQ(arg1->unk_19C.x - arg0->unk_19C.x) + SQ(arg1->unk_19C.y - arg0->unk_19C.y) + SQ(arg1->unk_19C.z - arg0->unk_19C.z)); } -s32 func_879000C4(unk_func_8790002C* arg0, unk_func_8790002C* arg1) { - f32 var_fv0 = arg1->unk_19C.x - arg0->unk_19C.x; - f32 var_fv1 = arg1->unk_19C.y - arg0->unk_19C.y; - f32 var_fa0 = arg1->unk_19C.z - arg0->unk_19C.z; - f32 var_fa1 = (arg0->unk_288 * arg0->unk_16C.y) + (arg1->unk_288 * arg1->unk_16C.y); - s32 ret = 0; +// unused, +s32 func_879000C4(minigameActor* arg0, minigameActor* arg1) { + f32 totalX = arg1->unk_19C.x - arg0->unk_19C.x; + f32 totalY = arg1->unk_19C.y - arg0->unk_19C.y; + f32 totalZ = arg1->unk_19C.z - arg0->unk_19C.z; + f32 var_fa1 = (arg0->unk_288 * arg0->scale.y) + (arg1->unk_288 * arg1->scale.y); + s32 ret = FALSE; - if (var_fv0 < 0.0f) { - var_fv0 = -var_fv0; + if (totalX < 0.0f) { + totalX = -totalX; } - if (var_fv1 < 0.0f) { - var_fv1 = -var_fv1; + if (totalY < 0.0f) { + totalY = -totalY; } - if (var_fa0 < 0.0f) { - var_fa0 = -var_fa0; + if (totalZ < 0.0f) { + totalZ = -totalZ; } if (var_fa1 < 0.0f) { var_fa1 = -var_fa1; } - if (CB(var_fa0) < ((CB(var_fa1) - CB(var_fv0)) - CB(var_fv1))) { + if (CB(totalZ) < ((CB(var_fa1) - CB(totalX)) - CB(totalY))) { + ret = TRUE; + } + + return ret; +} + +// Collition detection on metapod's minigame +s32 func_879001A4(minigameActor* arg0, minigameActor* arg1) { + f32 totalX; + f32 totalY; + f32 totalZ; + f32 var_fa1; + f32 var_fs0; + f32 tmp; + s32 ret; + + totalX = arg1->unk_19C.x - arg0->unk_19C.x; + totalY = arg1->unk_19C.y - arg0->unk_19C.y; + totalZ = arg1->unk_19C.z - arg0->unk_19C.z; + ret = 0; + + var_fa1 = (arg0->unk_288 * arg0->scale.y) + (arg1->unk_288 * arg1->scale.y); // bottom + var_fs0 = ((arg0->unk_28C * arg0->scale.y) + (arg1->unk_28C * arg1->scale.y)) / 2.0f; // top + + totalX = ABS(totalX); + totalY = ABS(totalY); + totalZ = ABS(totalZ); + var_fa1 = ABS(var_fa1); + var_fs0 = ABS(var_fs0); + tmp = var_fs0 - totalY; + + if ((SQ(totalZ) < (SQ(var_fa1) - SQ(totalX))) && (tmp > 0)) { ret = 1; } return ret; } -s32 func_879001A4(unk_func_8790002C* arg0, unk_func_8790002C* arg1) { - f32 var_fa0; - f32 var_fa1; - f32 var_fs0; - f32 var_fv0; - f32 var_fv1; - f32 tmp; - s32 var_v1; - - var_fv0 = arg1->unk_19C.x - arg0->unk_19C.x; - var_fv1 = arg1->unk_19C.y - arg0->unk_19C.y; - var_fa0 = arg1->unk_19C.z - arg0->unk_19C.z; - var_v1 = 0; - - var_fa1 = (arg0->unk_288 * arg0->unk_16C.y) + (arg1->unk_288 * arg1->unk_16C.y); - var_fs0 = ((arg0->unk_28C * arg0->unk_16C.y) + (arg1->unk_28C * arg1->unk_16C.y)) * 0.5f; - - var_fv0 = ABS(var_fv0); - var_fv1 = ABS(var_fv1); - var_fa0 = ABS(var_fa0); - var_fa1 = ABS(var_fa1); - var_fs0 = ABS(var_fs0); - tmp = var_fs0 - var_fv1; - - if ((SQ(var_fa0) < (SQ(var_fa1) - SQ(var_fv0))) && (tmp > 0)) { - var_v1 = 1; - } - - return var_v1; -} - -void func_879002B8(unk_func_8790002C* arg0, s16 arg1, s16 arg2, s16 arg3) { - arg0->unk_248 = 1; +// change animation on ekans' and metapod's minigames ? +void func_879002B8(minigameActor* arg0, s16 arg1, s16 arg2, s16 arg3) { + arg0->unk_248 = 1; // animation flag ? arg0->unk_24A = arg1; arg0->unk_24C = arg2; arg0->unk_26A = arg3; - arg0->unk_26C = 0; + arg0->unk_26C = 0; // animation flag ? arg0->unk_26E = 0; } -void func_879002FC(unk_func_8790002C* arg0, s16 arg1, s16 arg2, s16 arg3, s16 arg4) { +void func_879002FC(minigameActor* arg0, s16 arg1, s16 arg2, s16 arg3, s16 arg4) { arg0->unk_248 = 1; arg0->unk_24A = arg1; arg0->unk_24C = arg2; @@ -115,15 +119,17 @@ void func_879002FC(unk_func_8790002C* arg0, s16 arg1, s16 arg2, s16 arg3, s16 ar arg0->unk_26E = arg4; } -void func_87900344(unk_func_8790002C* arg0, s16 arg1, s16 arg2, s16 arg3) { - arg0->unk_248 = 1; - arg0->unk_24A = arg1; - arg0->unk_24C = arg2; - arg0->unk_26A = arg3; - arg0->unk_26C = 1; +// diglett's pop out the ground on diglett's minigame +void func_87900344(minigameActor* arg0, s16 arg1, s16 arg2, s16 arg3) { + arg0->unk_248 = 1; // colliding ? + arg0->unk_24A = arg1; // 1 + arg0->unk_24C = arg2; // -1 + arg0->unk_26A = arg3; // 1 + arg0->unk_26C = 1; // animation id? } -s32 func_87900384(unk_func_8790002C* arg0) { +// just checks an object colliding flag? +s32 func_87900384(minigameActor* arg0) { s32 var_v1 = 0; if (arg0->unk_248 == 0) { @@ -132,7 +138,7 @@ s32 func_87900384(unk_func_8790002C* arg0) { return var_v1; } -void func_879003A0(unk_func_8790002C* arg0) { +void func_879003A0(minigameActor* arg0) { switch (arg0->unk_248) { case 1: func_8001BD04(&arg0->unk_000, arg0->unk_24A); @@ -179,14 +185,14 @@ void func_879004F8(unk_D_86002F58_004_000* arg0) { void func_87900528(void) { Cont_StartReadInputs(); Cont_ReadInputs(); - func_8001F730(); + func_8001F730(); // nothing } void func_87900558(void) { - D_87906044 = 0; + showMinigameHUD = 0; } -void func_87900564(unk_func_8790002C* arg0) { +void func_87900564(minigameActor* arg0) { arg0->unk_1C0.x = 0.0f; arg0->unk_1A8.x = 0.0f; arg0->unk_190.x = 0.0f; @@ -198,26 +204,26 @@ void func_87900564(unk_func_8790002C* arg0) { arg0->unk_190.z = 0.0f; } -void func_87900594(unk_func_8790002C* arg0) { +void func_87900594(minigameActor* arg0) { arg0->unk_1A8.x = 0.0f; arg0->unk_1A8.y = 0.0f; arg0->unk_1A8.z = 0.0f; } -void func_879005AC(unk_func_8790002C* arg0) { +void func_879005AC(minigameActor* arg0) { arg0->unk_1C0.x = 0.0f; arg0->unk_1C0.y = 0.0f; arg0->unk_1C0.z = 0.0f; } -void func_879005C4(unk_func_8790002C* arg0) { +void func_879005C4(minigameActor* arg0) { arg0->unk_1FC = arg0->unk_1FC - arg0->unk_210; arg0->unk_1C0.x = arg0->unk_1C0.x + arg0->unk_1F8; arg0->unk_1C0.y = arg0->unk_1C0.y + (arg0->unk_1FC - arg0->unk_210); arg0->unk_1C0.z = arg0->unk_1C0.z + arg0->unk_200; } -void func_8790060C(unk_func_8790002C* arg0) { +void func_8790060C(minigameActor* arg0) { arg0->unk_214.x = arg0->unk_214.y = arg0->unk_214.z = 0; arg0->unk_21A = arg0->unk_21C = arg0->unk_21E = 0; arg0->unk_220 = arg0->unk_222 = arg0->unk_224 = 0; @@ -241,7 +247,7 @@ void func_8790060C(unk_func_8790002C* arg0) { arg0->unk_296 = 0; arg0->unk_298 = 0; - arg0->unk_16C.x = arg0->unk_16C.y = arg0->unk_16C.z = 1.0f; + arg0->scale.x = arg0->scale.y = arg0->scale.z = 1.0f; arg0->unk_190.x = arg0->unk_190.y = arg0->unk_190.z = 0.0f; arg0->unk_1A8.x = arg0->unk_1A8.y = arg0->unk_1A8.z = 0.0f; @@ -273,7 +279,7 @@ void func_8790060C(unk_func_8790002C* arg0) { arg0->unk_290 = arg0->unk_292 = arg0->unk_294 = 0; } -void func_87900770(unk_func_8790002C* arg0) { +void func_87900770(minigameActor* arg0) { arg0->unk_190.x = arg0->unk_19C.x = arg0->unk_1A8.x + arg0->unk_1C0.x; arg0->unk_190.y = arg0->unk_19C.y = arg0->unk_1A8.y + arg0->unk_1C0.y; arg0->unk_190.z = arg0->unk_19C.z = arg0->unk_1A8.z + arg0->unk_1C0.z; @@ -285,10 +291,10 @@ void func_87900770(unk_func_8790002C* arg0) { arg0->unk_214.z = arg0->unk_21E + arg0->unk_22A + arg0->unk_236; } -void func_87900808(unk_func_8790002C* arg0) { - arg0->unk_000.unk_030.x = arg0->unk_16C.x; - arg0->unk_000.unk_030.y = arg0->unk_16C.y; - arg0->unk_000.unk_030.z = arg0->unk_16C.z; +void func_87900808(minigameActor* arg0) { + arg0->unk_000.unk_030.x = arg0->scale.x; + arg0->unk_000.unk_030.y = arg0->scale.y; + arg0->unk_000.unk_030.z = arg0->scale.z; arg0->unk_000.unk_024.x = arg0->unk_190.x; arg0->unk_000.unk_024.y = arg0->unk_190.y; @@ -302,10 +308,10 @@ void func_87900808(unk_func_8790002C* arg0) { void func_87900854(void) { s16* ptr = D_8780FA30; - D_87903DA4 = 0; + minigameInputLock = 0; D_87903DA8 = 0; D_87903DAC = 0; - D_87906040 = 0; + minigameInputLockTimer = 0; D_87906048 = 0; D_8790604A = 0; D_87903DC0 = 0; @@ -330,9 +336,9 @@ void func_87900920(void) { D_8790607C = D_87906064; D_87906080 = D_87906066; - D_87906088.x = D_8790606C.x; - D_87906088.y = D_8790606C.y; - D_87906088.z = D_8790606C.z; + D_87906088.x = minigameCameraCoords.x; + D_87906088.y = minigameCameraCoords.y; + D_87906088.z = minigameCameraCoords.z; D_87906076 = D_87906060; D_87906078 = D_87906062; @@ -342,9 +348,9 @@ void func_879009B4(void) { D_87906064 = D_8790607C; D_87906066 = D_87906080; - D_8790606C.x = D_87906088.x; - D_8790606C.y = D_87906088.y; - D_8790606C.z = D_87906088.z; + minigameCameraCoords.x = D_87906088.x; + minigameCameraCoords.y = D_87906088.y; + minigameCameraCoords.z = D_87906088.z; D_87906060 = D_87906076; D_87906062 = D_87906078; diff --git a/src/fragments/3/fragment3_1193E0.c b/src/fragments/3/fragment3_1193E0.c index 6d64c42..34127c9 100644 --- a/src/fragments/3/fragment3_1193E0.c +++ b/src/fragments/3/fragment3_1193E0.c @@ -3,9 +3,9 @@ #include "src/20470.h" #include "src/F420.h" -s16 D_87906040; +s16 minigameInputLockTimer; s16 D_87906042; -s16 D_87906044; +s16 showMinigameHUD; s16 D_87906046; s16 D_87906048; s16 D_8790604A; @@ -19,7 +19,7 @@ s16 D_87906064; s16 D_87906066; s16 D_87906068; s16 D_8790606A; -Vec3s D_8790606C; +Vec3s minigameCameraCoords; s16 D_87906072; s16 pad_D_87906074; s16 D_87906076; @@ -40,7 +40,7 @@ s16 D_879060A8; Vec3s D_879060AC; s32 pad_D_879060B4; s32 pad_D_879060B8; -Controller* D_879060BC; +Controller* tempControllerPtr; s16 D_879060C0; s16 D_879060C2; s8 D_879060C4[4]; @@ -56,9 +56,9 @@ void func_87900A50(void) { D_87906060 = D_879060A2 + D_87906094; D_87906062 = D_879060A4 + D_87906096; - D_8790606C.x = D_879060AC.x + D_8790609C.x; - D_8790606C.y = D_879060AC.y + D_8790609C.y; - D_8790606C.z = D_879060AC.z + D_8790609C.z; + minigameCameraCoords.x = D_879060AC.x + D_8790609C.x; + minigameCameraCoords.y = D_879060AC.y + D_8790609C.y; + minigameCameraCoords.z = D_879060AC.z + D_8790609C.z; D_87906064 = D_879060A6 + D_87906098; D_87906066 = D_879060A8 + D_8790609A; @@ -74,40 +74,40 @@ void func_87900A50(void) { } } -void func_87900B64(void) { +void func_87900B64(void) { // fix the camera on minigames ? D_87906054->unk_24.fovy = D_87906066; D_87906054->unk_24.near = D_87906068; D_87906054->unk_24.far = D_8790606A; - D_87906054->unk_60.at.x = D_8790606C.x; - D_87906054->unk_60.at.y = D_8790606C.y; - D_87906054->unk_60.at.z = D_8790606C.z; + D_87906054->unk_60.at.x = minigameCameraCoords.x; + D_87906054->unk_60.at.y = minigameCameraCoords.y; + D_87906054->unk_60.at.z = minigameCameraCoords.z; func_80010354(&D_87906054->unk_60.at, &D_87906054->unk_60.eye, D_87906064, D_87906060, D_87906062); } -s32 func_87900C5C(void) { +s32 minigameDebuggModeControll(void) { s16 sp6; - if (D_87903DB0 == 0) { + if (minigameDebuggMode == 0) { return; } - if (gPlayer1Controller->buttonPressed & 0x20) { + if (BTN_IS_PRESSED(gPlayer1Controller, BTN_L)) { D_87903DB8++; if (D_87903DB8 == 1) { D_87903DB8 = 0; } } - if (gPlayer1Controller->buttonPressed & 0x10) { + if (BTN_IS_PRESSED(gPlayer1Controller, BTN_R)) { D_87903DB8--; if (D_87903DB8 < 0) { D_87903DB8 = 0; } } - if (gPlayer1Controller->buttonPressed & 0x1000) { + if (BTN_IS_PRESSED(gPlayer1Controller, BTN_START)) { D_8790609C.x = 0; D_8790609C.y = 0; D_8790609C.z = 0; @@ -119,28 +119,28 @@ s32 func_87900C5C(void) { } if (D_87903DB8 == 0) { - if (gPlayer1Controller->buttonDown & 0xCF00) { - if (gPlayer1Controller->buttonDown & 0x800) { + if (BTN_IS_DOWN(gPlayer1Controller, 0xCF00)) { + if (BTN_IS_DOWN(gPlayer1Controller, BTN_DUP)) { sp6 = D_87906062 + 0x8000; } - if (gPlayer1Controller->buttonDown & 0x400) { + if (BTN_IS_DOWN(gPlayer1Controller, BTN_DDOWN)) { sp6 = D_87906062; } - if (gPlayer1Controller->buttonDown & 0x200) { + if (BTN_IS_DOWN(gPlayer1Controller, BTN_DLEFT)) { sp6 = D_87906062 + 0xC000; } - if (gPlayer1Controller->buttonDown & 0x100) { + if (BTN_IS_DOWN(gPlayer1Controller, BTN_DRIGHT)) { sp6 = D_87906062 + 0x4000; } - if (gPlayer1Controller->buttonDown & 0x8000) { + if (BTN_IS_DOWN(gPlayer1Controller, BTN_A)) { sp6 = D_87906062 + 0x8000; } - if (gPlayer1Controller->buttonDown & 0x4000) { + if (BTN_IS_DOWN(gPlayer1Controller, BTN_B)) { sp6 = D_87906062; } @@ -151,25 +151,25 @@ s32 func_87900C5C(void) { D_87906096 += gPlayer1Controller->stickX * 4.0f; D_87906094 += gPlayer1Controller->stickY * 4.0f; - if (gPlayer1Controller->buttonDown & 8) { + if ( BTN_IS_DOWN(gPlayer1Controller, BTN_CUP) ) { D_8790609C.y += 4; } - if (gPlayer1Controller->buttonDown & 4) { + if ( BTN_IS_DOWN(gPlayer1Controller, BTN_CDOWN) ) { D_8790609C.y -= 4; } - if (gPlayer1Controller->buttonDown & 1) { + if ( BTN_IS_DOWN(gPlayer1Controller, BTN_CRIGHT) ) { D_87906098 += 0xA; } - if (gPlayer1Controller->buttonDown & 2) { + if ( BTN_IS_DOWN(gPlayer1Controller, BTN_CLEFT) ) { D_87906098 -= 0xA; } } } -void func_87900F44(void) { +void showDebuggCameraInfo(void) { u8 sp24[3] = { 0, 0, 30 }; // D_87903DE0 u8 sp20[3] = { 0, 0, 250 }; // D_87903DE4 @@ -182,16 +182,16 @@ void func_87900F44(void) { func_8001F1E8(0x19, 0x1C, "TRANSRATE"); } - func_8001F1E8(0x19, 0x28, "CAMERA X:%d", D_8790606C.x); - func_8001F1E8(0x19, 0x34, "CAMERA Y:%d", D_8790606C.y); - func_8001F1E8(0x19, 0x40, "CAMERA Z:%d", D_8790606C.z); + func_8001F1E8(0x19, 0x28, "CAMERA X:%d", minigameCameraCoords.x); + func_8001F1E8(0x19, 0x34, "CAMERA Y:%d", minigameCameraCoords.y); + func_8001F1E8(0x19, 0x40, "CAMERA Z:%d", minigameCameraCoords.z); func_8001F1E8(0xA7, 0x28, "CAMERA D:%d", D_87906064); func_8001F1E8(0xA7, 0x34, "CAMERA F:%d", D_87906066); func_8001F1E8(0xA7, 0x40, "X:%04hX Y:%04hX", D_87906060, D_87906062); func_8001F444(); } -void func_879010A4(void) { +void showDebuggJoystickInfo(void) { u8 sp2C[3] = { 0, 0, 30 }; // D_87903DE8 u8 sp28[3] = { 0, 0, 250 }; // D_87903DEC @@ -213,14 +213,14 @@ void func_87901200(void) { u8 sp30[3] = { 0, 0, 30 }; // D_87903DF0 u8 sp2C[3] = { 0, 0, 250 }; // D_87903DF4 - if (gPlayer1Controller->buttonPressed & 8) { + if (BTN_IS_PRESSED(gPlayer1Controller, BTN_CUP)) { D_879060CA--; if (D_879060CA < 0) { D_879060CA = 4; } } - if (gPlayer1Controller->buttonPressed & 4) { + if (BTN_IS_PRESSED(gPlayer1Controller, BTN_CDOWN)) { D_879060CA++; if (D_879060CA >= 5) { D_879060CA = 0; @@ -229,46 +229,46 @@ void func_87901200(void) { switch (D_879060CA) { case 0: - if (gPlayer1Controller->buttonPressed & 2) { + if (BTN_IS_PRESSED(gPlayer1Controller, BTN_CLEFT)) { D_87906100.x -= 0.1f; } - if (gPlayer1Controller->buttonPressed & 1) { + if (BTN_IS_PRESSED(gPlayer1Controller, BTN_CRIGHT)) { D_87906100.x += 0.1f; } break; case 1: - if (gPlayer1Controller->buttonPressed & 2) { + if (BTN_IS_PRESSED(gPlayer1Controller, BTN_CLEFT)) { D_87906100.y -= 0.1; } - if (gPlayer1Controller->buttonPressed & 1) { + if (BTN_IS_PRESSED(gPlayer1Controller, BTN_CRIGHT)) { D_87906100.y += 0.1; } break; case 2: - if (gPlayer1Controller->buttonPressed & 2) { + if (BTN_IS_PRESSED(gPlayer1Controller, BTN_CLEFT)) { D_879060E0.x -= 1.0; } - if (gPlayer1Controller->buttonPressed & 1) { + if (BTN_IS_PRESSED(gPlayer1Controller, BTN_CRIGHT)) { D_879060E0.x += 1.0; } break; case 3: - if (gPlayer1Controller->buttonPressed & 2) { + if (BTN_IS_PRESSED(gPlayer1Controller, BTN_CLEFT)) { D_879060E0.y -= 1.0; } - if (gPlayer1Controller->buttonPressed & 1) { + if (BTN_IS_PRESSED(gPlayer1Controller, BTN_CRIGHT)) { D_879060E0.y += 1.0; } break; case 4: - if (gPlayer1Controller->buttonPressed & 2) { + if (BTN_IS_PRESSED(gPlayer1Controller, BTN_CLEFT)) { D_87906110.y -= 0.02; } - if (gPlayer1Controller->buttonPressed & 1) { + if (BTN_IS_PRESSED(gPlayer1Controller, BTN_CRIGHT)) { D_87906110.y += 0.02; } break; diff --git a/src/fragments/3/fragment3_11BBF0.c b/src/fragments/3/fragment3_11BBF0.c index 90841fa..a14a3d1 100644 --- a/src/fragments/3/fragment3_11BBF0.c +++ b/src/fragments/3/fragment3_11BBF0.c @@ -357,7 +357,7 @@ void func_87903358(s16 arg0, s16 arg1) { } } -void func_879033FC(unk_func_8790002C* arg0) { +void func_879033FC(minigameActor* arg0) { s32 i; s16 temp_a2; s32 var_s2; diff --git a/src/fragments/3/fragment3_11BF90.c b/src/fragments/3/fragment3_11BF90.c index 9d45184..bb4d32b 100644 --- a/src/fragments/3/fragment3_11BF90.c +++ b/src/fragments/3/fragment3_11BF90.c @@ -4,13 +4,13 @@ #include "src/12D80.h" #include "src/memory.h" -static unk_func_8790002C* D_87906120; +static minigameActor* D_87906120; void func_87903600(void) { s32 i; - unk_func_8790002C* ptr; + minigameActor* ptr; - D_87906120 = main_pool_alloc(sizeof(unk_func_8790002C) * 3, 0); + D_87906120 = main_pool_alloc(sizeof(minigameActor) * 3, 0); ptr = D_87906120; for (i = 0; i < 3; i++, ptr++) { @@ -23,7 +23,7 @@ void func_87903600(void) { } } -void func_879036B4(unk_func_8790002C* arg0) { +void func_879036B4(minigameActor* arg0) { if (arg0->unk_23E == 1) { arg0->unk_000.unk_000.unk_01 |= 1; func_879002B8(arg0, 0, -1, 0); @@ -33,7 +33,7 @@ void func_879036B4(unk_func_8790002C* arg0) { void func_8790370C(void) { s32 i; - unk_func_8790002C* ptr = D_87906120; + minigameActor* ptr = D_87906120; func_8140C5D0(); @@ -45,11 +45,11 @@ void func_8790370C(void) { } } -void func_87903778(unk_func_8790002C* arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, s16 arg5, s16 arg6, s16 arg7, +void func_87903778(minigameActor* arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, s16 arg5, s16 arg6, s16 arg7, s16 arg8) { - arg0->unk_16C.x = arg1; - arg0->unk_16C.y = arg1; - arg0->unk_16C.z = arg1; + arg0->scale.x = arg1; + arg0->scale.y = arg1; + arg0->scale.z = arg1; arg0->unk_1A8.x = arg2; arg0->unk_1A8.y = arg3; @@ -62,21 +62,21 @@ void func_87903778(unk_func_8790002C* arg0, f32 arg1, f32 arg2, f32 arg3, f32 ar } void func_879037D0(f32 arg0, f32 arg1, f32 arg2, f32 arg3, s16 arg4, s16 arg5, s16 arg6) { - unk_func_8790002C* sp34 = D_87906120; + minigameActor* sp34 = D_87906120; func_87903778(sp34, arg0, arg1, arg2, arg3, arg4, arg5, arg6, 0); sp34->unk_000.unk_000.unk_14 = 0; } void func_87903838(f32 arg0, f32 arg1, f32 arg2, f32 arg3, s16 arg4, s16 arg5, s16 arg6) { - unk_func_8790002C* sp34 = &D_87906120[1]; + minigameActor* sp34 = &D_87906120[1]; func_87903778(sp34, arg0, arg1, arg2, arg3, arg4, arg5, arg6, 1); sp34->unk_000.unk_000.unk_14 = 1; } void func_879038AC(f32 arg0, f32 arg1, f32 arg2, f32 arg3, s16 arg4, s16 arg5, s16 arg6) { - unk_func_8790002C* sp34 = &D_87906120[2]; + minigameActor* sp34 = &D_87906120[2]; func_87903778(sp34, arg0, arg1, arg2, arg3, arg4, arg5, arg6, 2); sp34->unk_000.unk_000.unk_14 = 2;