From 612636992fbae430692bf5a92b2f5e5da150de98 Mon Sep 17 00:00:00 2001 From: Banjo Kazooie Date: Mon, 5 Dec 2022 13:37:58 -0600 Subject: [PATCH] core2/code_78E50.c done, misc documentation --- README.md | 2 +- decompressed.us.v10.yaml | 48 ++-- include/enums.h | 24 +- include/functions.h | 2 +- include/model.h | 8 +- progress/progress_core2.svg | 6 +- progress/progress_total.svg | 4 +- src/BGS/done/ch/code_8A60.c | 4 +- src/CC/code_1F70.c | 2 +- src/CCW/code_8670.c | 2 +- src/FP/code_2350.c | 4 +- src/FP/code_4400.c | 2 +- src/FP/code_45D0.c | 2 +- src/FP/code_6AE0.c | 2 +- src/FP/code_8E20.c | 8 +- src/FP/code_A40.c | 2 +- src/GV/code_230.c | 2 +- src/GV/code_7060.c | 2 +- src/MM/crc.c | 4 +- src/RBB/code_36A0.c | 2 +- src/RBB/code_5F80.c | 2 +- src/SM/code_2990.c | 2 +- src/TTC/code_10A0.c | 2 +- src/core1/code_10A00.c | 4 +- src/core1/done/code_CE60.c | 4 +- src/core2/{code_560F0.c => ch/bottlesbonus.c} | 264 +++++++++--------- .../{code_584D0.c => ch/bottlesbonuscursor.c} | 216 +++++++------- src/core2/{code_51C90.c => ch/collectable.c} | 58 ++-- src/core2/ch/gameSelect.c | 86 +++--- src/core2/ch/jiggy.c | 4 +- src/core2/ch/jinjo.c | 2 +- src/core2/ch/mole.c | 2 +- src/core2/ch/overlaycopyright.c | 55 ++++ .../overlaynocontroller.c} | 26 +- .../{code_55BC0.c => ch/overlaypressstart.c} | 28 +- src/core2/code_34790.c | 2 +- src/core2/code_3480.c | 10 +- src/core2/code_39EF0.c | 2 +- src/core2/code_3ECE0.c | 2 +- src/core2/code_41460.c | 2 +- src/core2/code_42CB0.c | 2 +- src/core2/code_47BD0.c | 2 +- src/core2/code_47C0.c | 14 +- src/core2/code_49A70.c | 55 ++-- src/core2/code_4A6F0.c | 145 +++++----- src/core2/code_4BD70.c | 14 +- src/core2/code_4C020.c | 2 +- src/core2/code_50490.c | 2 +- src/core2/code_55390.c | 2 +- src/core2/code_556C0.c | 2 +- src/core2/code_55850.c | 2 +- src/core2/code_55A90.c | 55 ---- src/core2/code_57C70.c | 8 +- src/core2/code_581D0.c | 4 +- src/core2/code_59A80.c | 4 +- src/core2/code_59D40.c | 2 +- src/core2/code_5B6A0.c | 2 +- src/core2/code_654C0.c | 117 ++++---- src/core2/code_7060.c | 4 +- src/core2/code_78E50.c | 182 ++++-------- src/core2/code_7AF80.c | 100 +++---- src/core2/code_851D0.c | 4 +- src/core2/code_857B0.c | 2 +- src/core2/code_935F0.c | 2 +- src/core2/code_99860.c | 35 --- src/core2/code_9B180.c | 4 +- src/core2/code_9E370.c | 2 +- src/core2/code_A5BC0.c | 20 +- src/core2/code_ABC00.c | 4 +- src/core2/code_AC520.c | 2 +- src/core2/code_AD110.c | 6 +- src/core2/code_B8080.c | 2 +- src/core2/code_B9770.c | 4 +- src/core2/code_C2F30.c | 2 +- src/core2/code_C4320.c | 16 +- src/core2/code_C8760.c | 4 +- src/core2/code_C9E70.c | 2 +- src/core2/code_C9F00.c | 2 +- src/core2/code_CC1E0.c | 2 +- src/core2/code_DA760.c | 2 +- src/core2/modelRender.c | 14 +- src/core2/quizquestionaskedbitfield.c | 35 +++ src/core2/spawnqueue.c | 16 +- src/fight/chbossjinjobase.c | 2 +- src/fight/chfinalboss.c | 2 +- src/fight/chspellbarrier.c | 2 +- src/fight/chspellfireball.c | 2 +- src/lair/code_0.c | 2 +- src/lair/code_5640.c | 2 +- src/lair/code_5ED0.c | 32 +-- src/lair/code_9C40.c | 2 +- src/lair/code_AD70.c | 2 +- subyaml/core2.us.v10.yaml | 8 +- symbol_addrs.us.v10.txt | 6 +- 94 files changed, 899 insertions(+), 970 deletions(-) rename src/core2/{code_560F0.c => ch/bottlesbonus.c} (61%) rename src/core2/{code_584D0.c => ch/bottlesbonuscursor.c} (60%) rename src/core2/{code_51C90.c => ch/collectable.c} (64%) create mode 100644 src/core2/ch/overlaycopyright.c rename src/core2/{code_55E70.c => ch/overlaynocontroller.c} (66%) rename src/core2/{code_55BC0.c => ch/overlaypressstart.c} (68%) delete mode 100644 src/core2/code_55A90.c delete mode 100644 src/core2/code_99860.c create mode 100644 src/core2/quizquestionaskedbitfield.c diff --git a/README.md b/README.md index 274efcf4..461cc55a 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# banjo (94.8627%) +# banjo (94.9689%) diff --git a/decompressed.us.v10.yaml b/decompressed.us.v10.yaml index bf191f93..e019b432 100644 --- a/decompressed.us.v10.yaml +++ b/decompressed.us.v10.yaml @@ -669,7 +669,7 @@ segments: - [0xFA6330, c, code_509D0] #DONE - [0xFA7100, c, code_517A0] #DONE - [0xFA72B0, c, code_51950] #DONE - - [0xFA75F0, c, code_51C90] #DONE + - [0xFA75F0, c, ch/collectable] #DONE - [0xFA7BF0, c, ch/mole] #DONE - [0xFA8F30, c, ch/molehill] #DONE - [0xFA9370, c, code_53A10] #DONE @@ -679,13 +679,13 @@ segments: - [0xFAACF0, c, code_55390] #DONE - [0xFAB020, c, code_556C0] #DONE - [0xFAB1B0, c, code_55850] #DONE - - [0xFAB3F0, c, code_55A90] #DONE - - [0xFAB520, c, code_55BC0] #DONE - - [0xFAB780, c, code_55E70] #DONE - - [0xFABA50, c, code_560F0] #DONE + - [0xFAB3F0, c, ch/overlaycopyright] #DONE + - [0xFAB520, c, ch/overlaypressstart] #DONE + - [0xFAB780, c, ch/overlaynocontroller] #DONE + - [0xFABA50, c, ch/bottlesbonus] #DONE - [0xFAD5D0, c, code_57C70] #DONE - [0xFADB30, c, code_581D0] #DONE - - [0xFADE30, c, code_584D0] #DONE + - [0xFADE30, c, ch/bottlesbonuscursor] #DONE - [0xFAF0E0, c, code_59780] #DONE - [0xFAF340, c, code_599E0] #DONE - [0xFAF3E0, c, code_59A80] #DONE @@ -744,7 +744,7 @@ segments: - [0xFCC6F0, c, code_76D90] #DONE - [0xFCD7B0, c, code_77E50] #DONE - [0xFCDA60, c, code_78100] - - [0xFCE7B0, c, code_78E50] + - [0xFCE7B0, c, code_78E50] #DONE - [0xFCF190, c, fxcommon3score] #DONE - [0xFCF5E0, c, code_79C80] #DONE - [0xFD00C0, c, code_7A760] #DONE @@ -769,7 +769,7 @@ segments: - [0xFEA380, c, code_94A20] #DONE - [0xFEB010, c, code_956B0] #DONE - [0xFEE610, c, code_98CB0] - - [0xFEF1C0, c, code_99860] #DONE + - [0xFEF1C0, c, quizquestionaskedbitfield] #DONE - [0xFEF300, c, code_999A0] #DONE - [0xFEF8E0, c, jiggyscore] #DONE - [0xFEFC80, c, code_9A320] #DONE @@ -966,7 +966,7 @@ segments: - [0x1036520, .data, code_509D0] - [0x1036630, .data, code_517A0] - [0x1036660, .data, code_51950] - - [0x10366D0, .data, code_51C90] + - [0x10366D0, .data, ch/collectable] - [0x1036740, .data, ch/mole] - [0x10367D0, .data, ch/molehill] - [0x1036840, .data, code_53A10] @@ -976,13 +976,13 @@ segments: - [0x1036A10, .data, code_55390] - [0x1036A40, .data, code_556C0] - [0x1036A70, .data, code_55850] - - [0x1036AA0, .data, code_55A90] - - [0x1036AD0, .data, code_55BC0] - - [0x1036B20, .data, code_55E70] - - [0x1036B70, .data, code_560F0] + - [0x1036AA0, .data, ch/overlaycopyright] + - [0x1036AD0, .data, ch/overlaypressstart] + - [0x1036B20, .data, ch/overlaynocontroller] + - [0x1036B70, .data, ch/bottlesbonus] - [0x1036CD0, .data, code_57C70] - [0x1036D30, .data, code_581D0] - - [0x1036D80, .data, code_584D0] + - [0x1036D80, .data, ch/bottlesbonuscursor] - [0x1036E10, .data, code_59780] - [0x1036F70, .data, code_59A80] - [0x1036FA0, .data, code_59D40] @@ -1230,12 +1230,12 @@ segments: - [0x10458A0, .rodata, code_54D50] - [0x10458C0, .rodata, code_55180] - [0x10458D0, .rodata, code_55390] - - [0x10458E0, .rodata, code_55BC0] - - [0x10458F0, .rodata, code_55E70] - - [0x1045900, .rodata, code_560F0] + - [0x10458E0, .rodata, ch/overlaypressstart] + - [0x10458F0, .rodata, ch/overlaynocontroller] + - [0x1045900, .rodata, ch/bottlesbonus] - [0x1045970, .rodata, code_57C70] - [0x1045990, .rodata, code_581D0] - - [0x10459A0, .rodata, code_584D0] + - [0x10459A0, .rodata, ch/bottlesbonuscursor] - [0x1045A00, .rodata, code_599E0] - [0x1045A10, .rodata, code_59A80] - [0x1045A20, .rodata, code_59D40] @@ -1482,13 +1482,13 @@ segments: - [0x1048560, .bss, code_55390] - [0x1048560, .bss, code_556C0] - [0x1048560, .bss, code_55850] - - [0x1048560, .bss, code_55A90] - - [0x1048560, .bss, code_55BC0] - - [0x1048560, .bss, code_55E70] - - [0x1048560, .bss, code_560F0] + - [0x1048560, .bss, ch/overlaycopyright] + - [0x1048560, .bss, ch/overlaypressstart] + - [0x1048560, .bss, ch/overlaynocontroller] + - [0x1048560, .bss, ch/bottlesbonus] - [0x1048560, .bss, code_57C70] - [0x1048560, .bss, code_581D0] - - [0x1048560, .bss, code_584D0] + - [0x1048560, .bss, ch/bottlesbonuscursor] - [0x1048560, .bss, code_59A80] - [0x1048560, .bss, code_59D40] - [0x1048560, .bss, code_5B6A0] @@ -1548,7 +1548,7 @@ segments: - [0x1048560, .bss, code_94780] - [0x1048560, .bss, code_956B0] - [0x1048560, .bss, code_98CB0] - - [0x1048560, .bss, code_99860] + - [0x1048560, .bss, quizquestionaskedbitfield] - [0x1048560, .bss, code_999A0] - [0x1048560, .bss, jiggyscore] - [0x1048560, .bss, code_9A320] diff --git a/include/enums.h b/include/enums.h index 344785a2..1cf026d0 100644 --- a/include/enums.h +++ b/include/enums.h @@ -1627,7 +1627,6 @@ enum actor_e ACTOR_124_SIR_SLUSH, ACTOR_125_SNOWBALL, ACTOR_126_SIR_SLUSH_HAT, - ACTOR_129_RED_FEATHER = 0x129, ACTOR_12B_TUTORIAL_BOTTLES = 0x12B, @@ -1708,6 +1707,10 @@ enum actor_e ACTOR_1DB_GAME_OVER = 0x1DB, + ACTOR_1DD_COPYRIGHT_OVERLAY = 0x1DD, + ACTOR_1DE_PRESS_START_OVERLAY, + ACTOR_1DF_NO_CONTROLLER_OVERLAY, + ACTOR_1E4_TOOTS = 0x1E4, ACTOR_1E9_SNARE_BEAR = 0x1E9, @@ -1845,6 +1848,7 @@ enum actor_e ACTOR_COLLYWOBBLE_B = 0x36D, ACTOR_BAWL_B = 0x36E, ACTOR_TOPPER_B = 0x36F, + ACTOR_370_GOLD_FEATHER = 0x370, ACTOR_375_GRUBLIN_HOOD = 0x375, @@ -3066,7 +3070,7 @@ enum asset_e // 54b (Big Fireball?) ASSET_54C_MODEL_GAME_OVER = 0x54C, // 54d Banjo-Kazooie Sign - // 54e Copyright Info (Title Screen) + ASSET_54E_MODEL_COPYRIGHT_OVERLAY = 0x54E, // 54f Cheato // 550 Large Door To Final Battle ASSET_551_MODEL_JINJONATOR = 0x551, @@ -3080,9 +3084,9 @@ enum asset_e // 559 Blast When Pink Jinjo Hits Gruntilda // 55a BK World Entry/Exit Pad // 55b FP Boggy's Igloo - // 55c Press Start Sign - // 55d No Controller Sign - ASSET_55E_MODEL_NAPPER = 0x55E, + ASSET_55C_MODEL_PRESS_START_OVERLAY = 0x55C, + ASSET_55D_MODEL_NO_CONTROLLER_OVERLAY, + ASSET_55E_MODEL_NAPPER, ASSET_55F_MODEL_FF_PRIZE_WASHING_CAULDRON, ASSET_560_MODEL_FF_PRIZE_GRUNTY_DOLL, ASSET_561_MODEL_GRUNTLING_BLUE = 0x561, @@ -3750,6 +3754,7 @@ enum marker_e{ MARKER_5F_MUSIC_NOTE = 0x5F, + MARKER_60_BLUE_EGG_COLLECTABLE = 0x60, MARKER_61_EXTRA_LIFE = 0x61, MARKER_62_RED_ARROW, MARKER_63_RED_QUESTION_MARK, @@ -3786,6 +3791,8 @@ enum marker_e{ MARKER_B0_MAGIC_CARPET_2, MARKER_B1_SIR_SLUSH, + MARKER_B5_RED_FEATHER_COLLECTABLE = 0xB5, + MARKER_B7_TUTORIAL_BOTTLES = 0xB7, MARKER_B9_FP_SNOWMAN_BUTTON = 0xB9, @@ -3869,6 +3876,10 @@ enum marker_e{ MARKER_173_CHUMP_FISH_2 = 0x173, MARKER_174_GAME_OVER = 0x174, + MARKER_176_COPYRIGHT_OVERLAY = 0x176, + MARKER_177_PRESS_START_OVERLAY, + MARKER_178_NO_CONTROLLER_OVERLAY, + MARKER_182_RBB_EGG_TOLL = 0x182, MARKER_185_MODEL_RUSTY_BUCKET_REAR_PROPELLER = 0x185, @@ -3914,7 +3925,8 @@ enum marker_e{ MARKER_1E2_GRUBLIN_HOOD = 0x1E2, - MARKER_1E6_TOPPER_B = 0x1E6, + MARKER_1E5_GOLD_FEATHER = 0x1E5, + MARKER_1E6_TOPPER_B, MARKER_1E7_BAWL_B, MARKER_1E8_COLLYWOBBLE_B, MARKER_1E9_MUMBO_COST_SIGN, diff --git a/include/functions.h b/include/functions.h index 608020cb..a80dcdff 100644 --- a/include/functions.h +++ b/include/functions.h @@ -479,7 +479,7 @@ Actor *func_8032A7AC(Actor *); Prop *func_8032F528(void); ActorMarker *func_8032FBE4(f32 *pos, MarkerDrawFunc arg1, int arg2, enum asset_e model_id); -void func_803300D8(ActorMarker *, void (*)(Actor *)); +void marker_setFreeMethod(ActorMarker *, void (*)(Actor *)); void marker_setCollisionScripts(ActorMarker *this, MarkerCollisionFunc ow_func, MarkerCollisionFunc arg2, MarkerCollisionFunc die_func); BKModelBin * func_80330B1C(ActorMarker *marker); BKVertexList *func_80330C74(Actor *actor); diff --git a/include/model.h b/include/model.h index 4138ddaa..7b72428f 100644 --- a/include/model.h +++ b/include/model.h @@ -33,11 +33,11 @@ typedef struct { } BKMeshList; typedef struct { - s16 minCoord_0[3]; - s16 maxCoord_6[3]; - s16 unkC[3]; + s16 minCoord[3]; + s16 maxCoord[3]; + s16 centerCoord[3]; s16 unk12; - s16 cnt_14; + s16 count; s16 unk16; Vtx vtx_18[]; } BKVertexList; diff --git a/progress/progress_core2.svg b/progress/progress_core2.svg index 5fd3316a..5279096b 100644 --- a/progress/progress_core2.svg +++ b/progress/progress_core2.svg @@ -9,7 +9,7 @@ - + @@ -17,7 +17,7 @@ core2 - 93.5776% - 93.5776% + 93.7629% + 93.7629% \ No newline at end of file diff --git a/progress/progress_total.svg b/progress/progress_total.svg index 5f6e8c0a..b663619c 100644 --- a/progress/progress_total.svg +++ b/progress/progress_total.svg @@ -17,7 +17,7 @@ Banjo-Kazooie (us.v10) - 94.8627% - 94.8627% + 94.9689% + 94.9689% \ No newline at end of file diff --git a/src/BGS/done/ch/code_8A60.c b/src/BGS/done/ch/code_8A60.c index 1e71b38f..badb5b6b 100644 --- a/src/BGS/done/ch/code_8A60.c +++ b/src/BGS/done/ch/code_8A60.c @@ -24,7 +24,7 @@ ActorInfo D_80390BFC = {MARKER_FD_BGS_MAZE_SWITCH, ACTOR_1FB_BGS_MAZ void func_8038EE50(void){ f32 sp24[3]; - if(func_80304E24(0x14d, sp24)){ + if(nodeProp_findPositionFromActorId(0x14d, sp24)){ jiggySpawn(JIGGY_20_BGS_ELEVATED_WALKWAY, sp24); __spawnQueue_add_4((GenMethod_4)func_802C4140, ACTOR_4C_STEAM, reinterpret_cast(s32, sp24[0]), @@ -67,7 +67,7 @@ void func_8038EEA4(Actor *this){ void func_8038F018(void){ f32 sp24[3]; - if(func_80304E24(0x1fc, sp24)){ + if(nodeProp_findPositionFromActorId(0x1fc, sp24)){ jiggySpawn(JIGGY_25_BGS_MAZE, sp24); __spawnQueue_add_4((GenMethod_4)func_802C4140, ACTOR_4C_STEAM, reinterpret_cast(s32, sp24[0]), diff --git a/src/CC/code_1F70.c b/src/CC/code_1F70.c index ee7bac49..d1e3bf2c 100644 --- a/src/CC/code_1F70.c +++ b/src/CC/code_1F70.c @@ -286,7 +286,7 @@ void func_80388D54(void){ D_80389FA0.unk28[2] = 0.0f; D_80389FA0.unk28[1] = 0.0f; func_80320B24(func_80388360, func_80388428, func_803884A8); - if(!func_80304E24(0x3B, D_80389FA0.unkC)){ + if(!nodeProp_findPositionFromActorId(0x3B, D_80389FA0.unkC)){ D_80389FA0.unkC[0] = 0.0f; D_80389FA0.unkC[1] =-1e+06f; D_80389FA0.unkC[2] = 0.0f; diff --git a/src/CCW/code_8670.c b/src/CCW/code_8670.c index 97c89cba..87aefc3b 100644 --- a/src/CCW/code_8670.c +++ b/src/CCW/code_8670.c @@ -14,7 +14,7 @@ bool func_8038EA60(s32 arg0, s32 arg1, s32 arg2) { s32 sp1C; s32 temp_v1; - func_8028EB3C(&sp1C); + player_getPosition_s32(&sp1C); temp_v1 = arg1 - sp24; temp_a0 = arg0 - sp1C; return ((temp_v1 * temp_v1) + (temp_a0 * temp_a0)) < (arg2 * arg2); diff --git a/src/FP/code_2350.c b/src/FP/code_2350.c index f29bfd0d..c3cc8fb4 100644 --- a/src/FP/code_2350.c +++ b/src/FP/code_2350.c @@ -385,8 +385,8 @@ void func_803895E0(void){ for (i = 0; i< 7; i++){ s0 = (i < 3) - ? func_803049CC(D_80391DB8[i].unk0, D_80391DA0) - : func_803049CC(D_80391DB8[i].unk0, D_80391DAC); + ? cubeList_findNodePropByActorId(D_80391DB8[i].unk0, D_80391DA0) + : cubeList_findNodePropByActorId(D_80391DB8[i].unk0, D_80391DAC); nodeprop_getPosition(s0, sp64); f20 = (f32)func_80304DA8(s0); diff --git a/src/FP/code_4400.c b/src/FP/code_4400.c index 4ef60418..a475dae5 100644 --- a/src/FP/code_4400.c +++ b/src/FP/code_4400.c @@ -25,7 +25,7 @@ void func_8038A7F0(void){ } D_80392F30.unk1C = 0; - if(func_80304E24(0x128, D_80392F30.spawn_pos)){ + if(nodeProp_findPositionFromActorId(0x128, D_80392F30.spawn_pos)){ D_80392F30.unk1C = 1; } D_80392F30.unk0 = 1; diff --git a/src/FP/code_45D0.c b/src/FP/code_45D0.c index 5884e6fb..24c365be 100644 --- a/src/FP/code_45D0.c +++ b/src/FP/code_45D0.c @@ -26,7 +26,7 @@ void FP_func_8038A9C0(void){ } D_80392F50.unk18 = 0; - if(func_80304E24(0x15E, D_80392F50.spawn_pos)){ + if(nodeProp_findPositionFromActorId(0x15E, D_80392F50.spawn_pos)){ D_80392F50.unk18 = 1; } D_80392F50.unk0 = 1; diff --git a/src/FP/code_6AE0.c b/src/FP/code_6AE0.c index a7e6fc03..3d6f7552 100644 --- a/src/FP/code_6AE0.c +++ b/src/FP/code_6AE0.c @@ -307,7 +307,7 @@ void func_8038D6C8(Actor *this){ if(!this->unk16C_4){ this->unk16C_4 = TRUE; - func_803300D8(this->marker, func_8038D3B0); + marker_setFreeMethod(this->marker, func_8038D3B0); marker_setCollisionScripts(this->marker, NULL, func_8038D5C8, NULL); this->unk38_31 = 0; this->unk1C[1] = 0.0f; diff --git a/src/FP/code_8E20.c b/src/FP/code_8E20.c index 73a61f7f..2300b2a2 100644 --- a/src/FP/code_8E20.c +++ b/src/FP/code_8E20.c @@ -197,10 +197,10 @@ void FP_func_8038F7AC(Actor *this){ func_8038F274(); } else{//L8038F8A0 - func_80304E24(0x359, local->unk24); - func_80304E24(0x35A, local->unk0); - func_80304E24(0x35B, local->unkC); - func_80304E24(0x35C, local->unk18); + nodeProp_findPositionFromActorId(0x359, local->unk24); + nodeProp_findPositionFromActorId(0x35A, local->unk0); + nodeProp_findPositionFromActorId(0x35B, local->unkC); + nodeProp_findPositionFromActorId(0x35C, local->unk18); this->position[0] = local->unkC[0];\ this->position[1] = local->unkC[1];\ this->position[2] = local->unkC[2]; diff --git a/src/FP/code_A40.c b/src/FP/code_A40.c index 4215ec50..f7f0c4a8 100644 --- a/src/FP/code_A40.c +++ b/src/FP/code_A40.c @@ -91,7 +91,7 @@ void chXmasTree_update(Actor *this){ this->unk16C_4 = TRUE; this->marker->propPtr->unk8_3 = TRUE; this->marker->collidable = FALSE; - func_803300D8(this->marker, func_80386EAC); + marker_setFreeMethod(this->marker, func_80386EAC); if(this->unk44_31 == 0){ this->unk44_31 = func_8030D90C(); sfxsource_setSfxId(this->unk44_31, SFX_415_UNKNOWN); diff --git a/src/GV/code_230.c b/src/GV/code_230.c index dc0c9bde..5c539a44 100644 --- a/src/GV/code_230.c +++ b/src/GV/code_230.c @@ -87,7 +87,7 @@ void func_803867CC(void){ void func_803867F4(void){ f32 sp24[3]; func_802BAFE4(4); - if(func_80304E24(0x148, sp24)){ + if(nodeProp_findPositionFromActorId(0x148, sp24)){ jiggySpawn(JIGGY_46_GV_ANCIENT_ONES, sp24); __spawnQueue_add_4((GenMethod_4)func_802C4140, 0x4C, reinterpret_cast(s32, sp24[0]), reinterpret_cast(s32, sp24[1]), reinterpret_cast(s32, sp24[2])); } diff --git a/src/GV/code_7060.c b/src/GV/code_7060.c index 410b0fa2..f95ef1c8 100644 --- a/src/GV/code_7060.c +++ b/src/GV/code_7060.c @@ -33,7 +33,7 @@ void func_8038D47C(Actor *this){ actor_collisionOff(this); func_80287784(this->animctrl, 0); if(!this->initialized){ - if(!func_80304E24(0x331, this->spawn_position)){ + if(!nodeProp_findPositionFromActorId(0x331, this->spawn_position)){ this->spawn_position_x = -2569.0f; this->spawn_position_y = 2997.0f; this->spawn_position_z = 5884.0f; diff --git a/src/MM/crc.c b/src/MM/crc.c index 01942d3f..dfaf8c47 100644 --- a/src/MM/crc.c +++ b/src/MM/crc.c @@ -9,13 +9,13 @@ u32 D_803899C0 = 0x000C740C; //MM.code CRC1 u32 D_803899C4 = 0xCD249CB3; //MM.code CRC2 u32 D_803899C8 = 0x0000D44F; //MM.data CRC1 (with this value = 0) -void func_802D1724(void); +void chmumbo_func_802D1724(void); void func_80387EC0(void) { u32 *temp_v0; u32 temp_a0; - temp_v0 = (u32* )func_802D1724; + temp_v0 = (u32* )chmumbo_func_802D1724; if (getGameMode() != 7) { temp_a0 = (temp_v0[2] & 0x03FFFFFF)*4; //get offset temp_a0 += (u32)&temp_v0[3] & 0xF0000000; //get region diff --git a/src/RBB/code_36A0.c b/src/RBB/code_36A0.c index f3399e9b..9d07c76e 100644 --- a/src/RBB/code_36A0.c +++ b/src/RBB/code_36A0.c @@ -73,7 +73,7 @@ void func_80389C78(Actor *this){ this->marker->propPtr->unk8_3 = 1; this->pitch = randf2(0.0f, 300.0f); func_803300C0(this->marker, func_80389B44); - func_803300D8(this->marker, func_80389C44); + marker_setFreeMethod(this->marker, func_80389C44); func_80389B80(this, 1.0f); if(this->unk78_13 == 0x1C){ local->unk8 = 0; diff --git a/src/RBB/code_5F80.c b/src/RBB/code_5F80.c index 9c098bdd..bd447c80 100644 --- a/src/RBB/code_5F80.c +++ b/src/RBB/code_5F80.c @@ -516,7 +516,7 @@ void func_8038D8BC(Actor *this){ this->yaw = 270.0f; } marker_setCollisionScripts(this->marker, func_8038D590, func_8038D5BC, func_8038D608); - func_803300D8(this->marker, func_8038D8B4); + marker_setFreeMethod(this->marker, func_8038D8B4); if(local->unk0->unk0 == ACTOR_281_BOSS_BOOM_BOX_LARGEST){ RBB_func_8038CC9C(this, 1); D_80391280 = 0; diff --git a/src/SM/code_2990.c b/src/SM/code_2990.c index 0d13c456..3502d6fc 100644 --- a/src/SM/code_2990.c +++ b/src/SM/code_2990.c @@ -376,7 +376,7 @@ void func_803899B0(Actor * this){ this->marker->propPtr->unk8_3 = 0; actor_collisionOff(this); this->initialized = 1; - func_803300D8(this->marker, func_80389984); + marker_setFreeMethod(this->marker, func_80389984); if(this->unkF4_8 == 1 || this->unkF4_8 == 8){//L80389A30 sp40 = func_80304C38(0x349, this); if(!sp40){ diff --git a/src/TTC/code_10A0.c b/src/TTC/code_10A0.c index 71222e88..c375e471 100644 --- a/src/TTC/code_10A0.c +++ b/src/TTC/code_10A0.c @@ -67,7 +67,7 @@ void func_80387520(ActorMarker *caller, enum asset_e text_id, s32 arg1){ void func_80387574(ActorMarker *caller, enum asset_e text_id, s32 arg1){ f32 sp24[3]; - if(func_80304E24(0x14b, sp24)){ + if(nodeProp_findPositionFromActorId(0x14b, sp24)){ jiggySpawn(JIGGY_14_TTC_BLUBBER, sp24); __spawnQueue_add_4((GenMethod_4)func_802C4140, ACTOR_4C_STEAM, reinterpret_cast(s32, sp24[0]), reinterpret_cast(s32, sp24[1]), reinterpret_cast(s32, sp24[2])); } diff --git a/src/core1/code_10A00.c b/src/core1/code_10A00.c index e5209754..bf53d675 100644 --- a/src/core1/code_10A00.c +++ b/src/core1/code_10A00.c @@ -334,12 +334,12 @@ int func_8024F12C(void){ void func_8024F150(void){ if(func_8024F12C()) - func_802DD008(0,0); + chOverlayNoController_spawn(0,0); } void func_8024F180(void){ if(func_8024F12C()) - func_802DD040(0,0); + chOverlayNoController_func_802DD040(0,0); } void func_8024F1B0(void){ diff --git a/src/core1/done/code_CE60.c b/src/core1/done/code_CE60.c index 183f20bf..5055682a 100644 --- a/src/core1/done/code_CE60.c +++ b/src/core1/done/code_CE60.c @@ -72,7 +72,7 @@ void func_8024AAB0(void){ f32 plyr_pos[3]; //sp34 f32 sp30; - func_8028EB3C(&D_802806F8); + player_getPosition_s32(&D_802806F8); player_getPosition(plyr_pos); D_80280708[0] = func_8032274C(); D_80280708[1] = func_80322758(); @@ -188,7 +188,7 @@ void func_8024AF48(void){ if(gctransition_8030BDC0()) return; if(getGameMode() == GAME_MODE_A_SNS_PICTURE) return; - func_8028EB3C(D_802806F8); + player_getPosition_s32(D_802806F8); func_8024AAB0(); switch(map_get()){ case MAP_2_MM_MUMBOS_MOUNTAIN: // L8024B000 diff --git a/src/core2/code_560F0.c b/src/core2/ch/bottlesbonus.c similarity index 61% rename from src/core2/code_560F0.c rename to src/core2/ch/bottlesbonus.c index d71ce24b..eebaf37c 100644 --- a/src/core2/code_560F0.c +++ b/src/core2/ch/bottlesbonus.c @@ -4,8 +4,8 @@ extern void func_8025982C(f32[3], f32[3], f32[3], f32); extern void func_8025A6CC(enum comusic_e arg0, s32 arg1); -extern void func_802DF99C(void); -extern f32 *func_802E05AC(s32); +extern void chBottlesBonusCursor_func_802DF99C(void); +extern f32 *chBottlesBonusCursor_func_802E05AC(s32); extern f32 func_802E4B38(void); extern void func_8033A8F0(s32, s32, f32[4]); extern f32 func_8033DDB8(void); @@ -27,8 +27,8 @@ typedef struct { }ActorLocal_core2_560F0; typedef struct{ - s32 unk0; - s32 unk4; //text_id + s32 time_seconds; + s32 text_id; //text_id s32 unk8; s32 anim_id; }Struct_core2_560F0_0; @@ -48,22 +48,22 @@ extern void item_set(enum item_e, s32); extern void func_80325794(ActorMarker *); extern void func_8024CE60(f32, f32); -Actor *func_802DD188(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); -void func_802DE4CC(Actor *this); +Actor *chBottlesBonus_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); +void chBottlesBonus_update(Actor *this); /* .data */ Struct_core2_560F0_0 D_803681A0[] = { - {0x00, 0x000, 0, 0x211}, - {0x63, 0xE27, 0, 0x2C1}, - {0x63, 0xE29, 0, 0x2C2}, - {0x63, 0xE2B, 0, 0x2C9}, - {0x63, 0xE2D, 0, 0x2C3}, - {0x63, 0xE2F, 0, 0x2C4}, - {0x63, 0xE31, 0, 0x2C5}, - {0x4B, 0xE34, 0, 0x007} + { 0, 0x000, 0, 0x211}, + {99, 0xE27, 0, 0x2C1}, + {99, 0xE29, 0, 0x2C2}, + {99, 0xE2B, 0, 0x2C9}, + {99, 0xE2D, 0, 0x2C3}, + {99, 0xE2F, 0, 0x2C4}, + {99, 0xE31, 0, 0x2C5}, + {75, 0xE34, 0, 0x007} }; -ActorAnimationInfo D_80368220[] ={ +ActorAnimationInfo chBottlesBonusAnimations[] ={ {0x000, 0.0f}, {0x211, 9000000000.0f}, {0x211, 2.0f}, @@ -86,18 +86,18 @@ s32 D_803682A4[4] = {0xD8, 0xD8, 0xD8, 0xFF}; s32 D_803682B4[4] = {0xFF, 0x60, 0x50, 0xFF}; f32 D_803682C4[3] = {0.0f, 0.0f, 0.0f}; -ActorInfo D_803682D0 = { +ActorInfo chBottlesBonusDescription = { 0x179, 0x1E0, 0x46C, - 0x1, D_80368220, - func_802DE4CC, func_80326224, func_802DD188, + 0x1, chBottlesBonusAnimations, + chBottlesBonus_update, func_80326224, chBottlesBonus_draw, 0, 0, 0.0f, 0 }; /* .bss */ -ActorMarker *D_8037DEA0; -BKModelBin *D_8037DEA4; +ActorMarker *chBottlesBonusMarker; +BKModelBin *chBottleBonusBookselfModelBin; BKModelBin *D_8037DEA8; BKModel *D_8037DEAC; s32 D_8037DEB0; @@ -108,19 +108,19 @@ Struct_core2_560F0_1 *D_8037DEC0; Struct_core2_560F0_1 *D_8037DEC4; f32 D_8037DEC8[20]; f32 D_8037DF18[20]; -s32 D_8037DF68; +s32 chBottleBonusPuzzleIndex; f32 D_8037DF70[3]; f32 D_8037DF80[3]; s32 D_8037DF90[20]; /* .code */ -void func_802DD080(Gfx **gfx, Mtx **mtx) { +void chBottlesBonus_func_802DD080(Gfx **gfx, Mtx **mtx) { f32 sp24[3]; f32 sp18[3]; func_8024E258(); func_8024CE60(50.0f, 2000.0f); - if (getGameMode() == 0xA) { + if (getGameMode() == GAME_MODE_A_SNS_PICTURE) { sp18[0] = 0.0f; sp18[1] = 0.0f; sp18[2] = 0.0f; @@ -141,12 +141,12 @@ void func_802DD080(Gfx **gfx, Mtx **mtx) { func_8024C904(gfx, mtx); } -void func_802DD158(Gfx **gfx, Mtx** mtx){ +void chBottlesBonus_func_802DD158(Gfx **gfx, Mtx** mtx){ func_8024E2FC(); func_8024C904(gfx, mtx); } -Actor *func_802DD188(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx) { +Actor *chBottlesBonus_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx) { Actor *sp6C; f32 sp60[3]; f32 sp54[3]; @@ -157,11 +157,11 @@ Actor *func_802DD188(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx) { if ((sp50 == NULL) || (getGameMode() != GAME_MODE_8_BOTTLES_BONUS)) return sp6C; - func_802DD080(gfx, mtx); + chBottlesBonus_func_802DD080(gfx, mtx); {sp60[0] = 0.0f; sp60[1] = 0.0f; sp60[2] = 0.0f;}; {sp54[0] = 0.0f; sp54[1] = 0.0f; sp54[2] = 0.0f;}; modelRender_setDepthMode(MODEL_RENDER_DEPTH_FULL); - modelRender_draw(gfx, mtx, sp60, NULL, 1.0f, sp54, D_8037DEA4); + modelRender_draw(gfx, mtx, sp60, NULL, 1.0f, sp54, chBottleBonusBookselfModelBin); modelRender_draw(gfx, mtx, sp60, NULL, 1.0f, sp54, D_8037DEA8); gDPSetTextureFilter((*gfx)++, G_TF_POINT); @@ -177,25 +177,25 @@ Actor *func_802DD188(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx) { modelRender_draw(gfx, mtx, sp60, NULL, D_80368250, sp54, func_80330B1C(marker)); gDPSetTextureFilter((*gfx)++, G_TF_BILERP); gDPSetColorDither((*gfx)++, G_CD_MAGICSQ); - func_802DF71C(gfx, mtx, vtx); - func_802DD158(gfx, mtx); + chBottlesBonusCursor_draw(gfx, mtx, vtx); + chBottlesBonus_func_802DD158(gfx, mtx); return sp6C; } -void func_802DD3CC(Actor *this) { +void chBottlesBonus_free(Actor *this) { ActorLocal_core2_560F0 * local; local = (ActorLocal_core2_560F0 *) &this->local; - D_8037DEA0 = 0; + chBottlesBonusMarker = 0; if (D_8037DEAC != 0) { func_8034CF6C(&local->unk0); model_free(D_8037DEAC); D_8037DEAC = 0; } - if (D_8037DEA4 != 0) { - assetcache_release(D_8037DEA4); - D_8037DEA4 = 0; + if (chBottleBonusBookselfModelBin != 0) { + assetcache_release(chBottleBonusBookselfModelBin); + chBottleBonusBookselfModelBin = 0; } if (D_8037DEA8 != 0) { @@ -208,7 +208,7 @@ void func_802DD3CC(Actor *this) { free(D_8037DEC4); } -void func_802DD484(f32 dst[3], f32 arg1, f32 avg, f32 range) { +void chBottlesBonus_func_802DD484(f32 dst[3], f32 arg1, f32 avg, f32 range) { s32 i; for(i = 0; i < 3; i++){ @@ -216,28 +216,27 @@ void func_802DD484(f32 dst[3], f32 arg1, f32 avg, f32 range) { } } -f32 *func_802DD584(s32 arg0){ +f32 *chBottlesBonus_func_802DD584(s32 arg0){ f64 temp_f0; BKAnimation *temp_v1; // temp_f0 = D_80376F48; sizeof(BKAnimationList); - temp_v1 = (BKAnimation*)(model_getAnimationList(func_80330B1C(D_8037DEA0)) + 1); + temp_v1 = (BKAnimation*)(model_getAnimationList(func_80330B1C(chBottlesBonusMarker)) + 1); D_8037DF70[0] = temp_v1[5 + arg0].unk0[0] * 0.01; D_8037DF70[1] = temp_v1[5 + arg0].unk0[1] * 0.01; D_8037DF70[2] = temp_v1[5 + arg0].unk0[2] * 0.01; return &D_8037DF70; } - -f32 *func_802DD60C(s32 arg0) { +f32 *chBottlesBonus_func_802DD60C(s32 arg0) { s32 temp_v0; - temp_v0 = func_802E0538(); + temp_v0 = chBottlesBonusCursor_func_802E0538(); if ((temp_v0 != 0) && (temp_v0 != 3)) { - D_8037DF80[0] = func_802E05AC(arg0)[0] * 0.01; - D_8037DF80[1] = func_802E05AC(arg0)[1] * 0.01; - D_8037DF80[2] = func_802E05AC(arg0)[2] * 0.01; + D_8037DF80[0] = chBottlesBonusCursor_func_802E05AC(arg0)[0] * 0.01; + D_8037DF80[1] = chBottlesBonusCursor_func_802E05AC(arg0)[1] * 0.01; + D_8037DF80[2] = chBottlesBonusCursor_func_802E05AC(arg0)[2] * 0.01; } else { D_8037DF80[0] = 0.0f; D_8037DF80[1] = 0.0f; @@ -246,33 +245,31 @@ f32 *func_802DD60C(s32 arg0) { return &D_8037DF80; } - -void func_802DD6E0(s32 arg0, s32 arg1, f32 arg2[3]) { +void chBottlesBonus_func_802DD6E0(s32 arg0, s32 arg1, f32 arg2[3]) { f32 sp1C[3]; - sp1C[0] = arg2[0] - func_802DD584(arg1)[0]; - sp1C[1] = arg2[1] - func_802DD584(arg1)[1]; - sp1C[2] = arg2[2] - func_802DD584(arg1)[2]; + sp1C[0] = arg2[0] - chBottlesBonus_func_802DD584(arg1)[0]; + sp1C[1] = arg2[1] - chBottlesBonus_func_802DD584(arg1)[1]; + sp1C[2] = arg2[2] - chBottlesBonus_func_802DD584(arg1)[2]; func_8033A968(arg0, D_80368254[arg1], sp1C); } - -void func_802DD778(s32 arg0, s32 arg1, f32 arg2[3]) { +void chBottlesBonus_func_802DD778(s32 arg0, s32 arg1, f32 arg2[3]) { f32 sp1C[3]; func_8033A6B0(arg0, D_80368254[arg1], sp1C); - arg2[0] = sp1C[0] + func_802DD584(arg1)[0]; - arg2[1] = sp1C[1] + func_802DD584(arg1)[1]; - arg2[2] = sp1C[2] + func_802DD584(arg1)[2]; + arg2[0] = sp1C[0] + chBottlesBonus_func_802DD584(arg1)[0]; + arg2[1] = sp1C[1] + chBottlesBonus_func_802DD584(arg1)[1]; + arg2[2] = sp1C[2] + chBottlesBonus_func_802DD584(arg1)[2]; } -f32 func_802DD804(f32 arg0) { +f32 chBottlesBonus_func_802DD804(f32 arg0) { arg0 = MAX(0.0, MIN(1.0, arg0)); return sinf(M_PI * arg0 / 2); } -void func_802DD8AC(s32 arg0, s32 arg1) { +void chBottlesBonus_func_802DD8AC(s32 arg0, s32 arg1) { s32 i; f32 spD8[3]; f32 spD4; @@ -285,7 +282,7 @@ void func_802DD8AC(s32 arg0, s32 arg1) { f32 sp7C[4]; - actor = marker_getActor(D_8037DEA0); + actor = marker_getActor(chBottlesBonusMarker); spD4 = func_802E4B38(); spD0 = func_8033DDB8(); if (D_8037DEB0 == 0) { @@ -293,8 +290,8 @@ void func_802DD8AC(s32 arg0, s32 arg1) { for(i = 0; i < 20; i++){ func_8033A57C(arg0, D_80368254[i], D_8037DEC4[i].unkC); func_8033A670(arg0, D_80368254[i], D_8037DEC4[i].unk1C); - func_802DD778(arg0, i, D_8037DEC4[i].unk0); - func_802DF460(i + 20, D_8037DEA0, D_8037DEC4[i].unk0); + chBottlesBonus_func_802DD778(arg0, i, D_8037DEC4[i].unk0); + chBottlesBonusCursor_func_802DF460(i + 20, chBottlesBonusMarker, D_8037DEC4[i].unk0); } } @@ -304,7 +301,7 @@ void func_802DD8AC(s32 arg0, s32 arg1) { for(i = 0; i < 20; i++){ func_8033A57C(arg0, D_80368254[i], D_8037DEB8[i].unkC); func_8033A670(arg0, D_80368254[i], D_8037DEB8[i].unk1C); - func_802DD778(arg0, i, D_8037DEB8[i].unk0); + chBottlesBonus_func_802DD778(arg0, i, D_8037DEB8[i].unk0); func_80345250(D_8037DEC0[i].unkC, D_8037DEB8[i].unkC); D_8037DEC0[i].unk0[0] = D_8037DEB8[i].unk0[0]; D_8037DEC0[i].unk0[1] = D_8037DEB8[i].unk0[1]; @@ -314,7 +311,7 @@ void func_802DD8AC(s32 arg0, s32 arg1) { D_8037DEC0[i].unk1C[1] = D_8037DEB8[i].unk1C[1]; D_8037DEC0[i].unk1C[2] = D_8037DEB8[i].unk1C[2]; - func_802DF460(i, D_8037DEA0, D_8037DEB8[i].unk0); + chBottlesBonusCursor_func_802DF460(i, chBottlesBonusMarker, D_8037DEB8[i].unk0); } } @@ -322,16 +319,16 @@ void func_802DD8AC(s32 arg0, s32 arg1) { spD8[0] = 1.0f; spD8[1] = 1.0f; spD8[2] = 1.0f; - switch(func_802E0538(i)){ + switch(chBottlesBonusCursor_func_802E0538(i)){ case 1://L802DDBB4 - func_802DD484(spD8, spD4, 1.0f, 0.2); - func_8025982C(D_8037DEBC[i].unk0, D_8037DEB8[i].unk0, func_802DD60C(i), func_802DD804(D_8037DEC8[i] / 0.2)); - func_8025982C(D_8037DEBC[i].unk1C, D_8037DEB8[i].unk1C, D_8037DEC4[i].unk1C, func_802DD804(D_8037DEC8[i]/ 0.2)); - func_80345D30(spAC, func_802E068C(i), D_8037DEB8[i].unkC); - func_803458E4(spBC, D_8037DEB8[i].unkC, spAC, func_802DD804(D_8037DEC8[i] / 0.4)); + chBottlesBonus_func_802DD484(spD8, spD4, 1.0f, 0.2); + func_8025982C(D_8037DEBC[i].unk0, D_8037DEB8[i].unk0, chBottlesBonus_func_802DD60C(i), chBottlesBonus_func_802DD804(D_8037DEC8[i] / 0.2)); + func_8025982C(D_8037DEBC[i].unk1C, D_8037DEB8[i].unk1C, D_8037DEC4[i].unk1C, chBottlesBonus_func_802DD804(D_8037DEC8[i]/ 0.2)); + func_80345D30(spAC, chBottlesBonusCursor_func_802E068C(i), D_8037DEB8[i].unkC); + func_803458E4(spBC, D_8037DEB8[i].unkC, spAC, chBottlesBonus_func_802DD804(D_8037DEC8[i] / 0.4)); - func_80345D30(spAC, func_802E0664(i), D_8037DEB8[i].unkC); - func_803458E4(D_8037DEBC[i].unkC, spBC, spAC, func_802DD804(D_8037DF18[i] / 0.2)); + func_80345D30(spAC, chBottlesBonusCursor_func_802E0664(i), D_8037DEB8[i].unkC); + func_803458E4(D_8037DEBC[i].unkC, spBC, spAC, chBottlesBonus_func_802DD804(D_8037DF18[i] / 0.2)); D_8037DEC0[i].unk0[0] = D_8037DEBC[i].unk0[0]; D_8037DEC0[i].unk0[1] = D_8037DEBC[i].unk0[1]; D_8037DEC0[i].unk0[2] = D_8037DEBC[i].unk0[2]; @@ -343,11 +340,11 @@ void func_802DD8AC(s32 arg0, s32 arg1) { func_80345250(D_8037DEC0[i].unkC, D_8037DEBC[i].unkC); break; case 2://L802DDD9C - func_802DD484(spD8, spD4, 1.0f, 0.2); - func_8025982C(D_8037DEBC[i].unk0, D_8037DEC4[func_802E0588(i)].unk0, func_802DD60C(i), func_802DD804(D_8037DEC8[i] / 0.2)); - func_80345D30(sp9C, func_802E068C(i), D_8037DEB8[i].unkC); - func_80345D30(sp8C, func_802E0664(i), D_8037DEB8[i].unkC); - func_803458E4(D_8037DEBC[i].unkC, sp9C, sp8C, func_802DD804(D_8037DF18[i] / 0.2)); + chBottlesBonus_func_802DD484(spD8, spD4, 1.0f, 0.2); + func_8025982C(D_8037DEBC[i].unk0, D_8037DEC4[chBottlesBonusCursor_func_802E0588(i)].unk0, chBottlesBonus_func_802DD60C(i), chBottlesBonus_func_802DD804(D_8037DEC8[i] / 0.2)); + func_80345D30(sp9C, chBottlesBonusCursor_func_802E068C(i), D_8037DEB8[i].unkC); + func_80345D30(sp8C, chBottlesBonusCursor_func_802E0664(i), D_8037DEB8[i].unkC); + func_803458E4(D_8037DEBC[i].unkC, sp9C, sp8C, chBottlesBonus_func_802DD804(D_8037DF18[i] / 0.2)); D_8037DEC0[i].unk0[0] = D_8037DEBC[i].unk0[0]; D_8037DEC0[i].unk0[1] = D_8037DEBC[i].unk0[1]; D_8037DEC0[i].unk0[2] = D_8037DEBC[i].unk0[2]; @@ -356,21 +353,21 @@ void func_802DD8AC(s32 arg0, s32 arg1) { D_8037DEC0[i].unk1C[1] = D_8037DEBC[i].unk1C[1]; D_8037DEC0[i].unk1C[2] = D_8037DEBC[i].unk1C[2]; func_80345250(D_8037DEC0[i].unkC, D_8037DEBC[i].unkC); - func_802DF460(40 + i, D_8037DEA0, D_803681A0); + chBottlesBonusCursor_func_802DF460(40 + i, chBottlesBonusMarker, D_803681A0); break; case 3://L802DDF48 - func_802DF460(40 + i, D_8037DEA0, D_8037DEC4[func_802E0588(i)].unk0); - func_8025982C(D_8037DEBC[i].unk0, D_8037DEC0[i].unk0, D_8037DEC4[func_802E0588(i)].unk0, func_802DD804(D_8037DEC8[i] / 0.4)); - func_8025982C(D_8037DEBC[i].unk1C, D_8037DEC0[i].unk1C, D_8037DEC4[func_802E0588(i)].unk1C, func_802DD804(D_8037DEC8[i] / 0.4)); - func_80345D30(sp7C, func_802E0664(i), D_8037DEB8[i].unkC); - func_803458E4(D_8037DEBC[i].unkC, D_8037DEC0[i].unkC, sp7C, func_802DD804(D_8037DF18[i] / 0.2)); + chBottlesBonusCursor_func_802DF460(40 + i, chBottlesBonusMarker, D_8037DEC4[chBottlesBonusCursor_func_802E0588(i)].unk0); + func_8025982C(D_8037DEBC[i].unk0, D_8037DEC0[i].unk0, D_8037DEC4[chBottlesBonusCursor_func_802E0588(i)].unk0, chBottlesBonus_func_802DD804(D_8037DEC8[i] / 0.4)); + func_8025982C(D_8037DEBC[i].unk1C, D_8037DEC0[i].unk1C, D_8037DEC4[chBottlesBonusCursor_func_802E0588(i)].unk1C, chBottlesBonus_func_802DD804(D_8037DEC8[i] / 0.4)); + func_80345D30(sp7C, chBottlesBonusCursor_func_802E0664(i), D_8037DEB8[i].unkC); + func_803458E4(D_8037DEBC[i].unkC, D_8037DEC0[i].unkC, sp7C, chBottlesBonus_func_802DD804(D_8037DF18[i] / 0.2)); break; case 0://L802DE084 - func_8025982C(D_8037DEBC[i].unk0, D_8037DEC0[i].unk0, D_8037DEB8[i].unk0, func_802DD804(D_8037DEC8[i] / 0.4)); - func_8025982C(D_8037DEBC[i].unk1C, D_8037DEC0[i].unk1C, D_8037DEB8[i].unk1C, func_802DD804(D_8037DEC8[i] / 0.4)); - func_803458E4(D_8037DEBC[i].unkC, D_8037DEC0[i].unkC, D_8037DEB8[i].unkC, func_802DD804(D_8037DEC8[i] / 0.4)); + func_8025982C(D_8037DEBC[i].unk0, D_8037DEC0[i].unk0, D_8037DEB8[i].unk0, chBottlesBonus_func_802DD804(D_8037DEC8[i] / 0.4)); + func_8025982C(D_8037DEBC[i].unk1C, D_8037DEC0[i].unk1C, D_8037DEB8[i].unk1C, chBottlesBonus_func_802DD804(D_8037DEC8[i] / 0.4)); + func_803458E4(D_8037DEBC[i].unkC, D_8037DEC0[i].unkC, D_8037DEB8[i].unkC, chBottlesBonus_func_802DD804(D_8037DEC8[i] / 0.4)); break; } @@ -379,31 +376,31 @@ void func_802DD8AC(s32 arg0, s32 arg1) { spD8[1] = spD8[1] * D_8037DEBC[i].unk1C[1]; spD8[2] = spD8[2] * D_8037DEBC[i].unk1C[2]; func_8033A928(arg0, D_80368254[i], spD8); - func_802DD6E0(arg0, i, D_8037DEBC[i].unk0); + chBottlesBonus_func_802DD6E0(arg0, i, D_8037DEBC[i].unk0); D_8037DEC8[i] += spD0; D_8037DF18[i] += spD0; } } } -void func_802DE224(ActorMarker *caller, enum asset_e text_id, s32 arg2){ +void chBottlesBonus_func_802DE224(ActorMarker *caller, enum asset_e text_id, s32 arg2){ func_8034BB08(0); } -void func_802DE250(u8 *arg0, enum asset_e text_id) { +void chBottlesBonus_lose(u8 *arg0, enum asset_e text_id) { Actor *actor; - actor = marker_getActor(D_8037DEA0); - func_802E06CC(); + actor = marker_getActor(chBottlesBonusMarker); + chBottlesBonusCursor_lose(); func_8025A6CC(COMUSIC_3C_MINIGAME_LOSS, 28000); actor->state = 5; item_set(ITEM_6_HOURGLASS, FALSE); func_802FAD64(0); if (*arg0 == 0) { *arg0 = 1; - timedFunc_set_0(2.0f, func_802DF99C); + timedFunc_set_0(2.0f, chBottlesBonusCursor_func_802DF99C); func_80311714(0); - func_80311480(text_id, 0x86, actor->position, D_8037DEA0, func_802DE224, NULL); + func_80311480(text_id, 0x86, actor->position, chBottlesBonusMarker, chBottlesBonus_func_802DE224, NULL); func_80311714(1); } else{ @@ -411,41 +408,41 @@ void func_802DE250(u8 *arg0, enum asset_e text_id) { } } -void func_802DE340(ActorMarker *caller, enum asset_e text_id, s32 arg2){ +void chBottlesBonus_IncrementPuzzle(ActorMarker *caller, enum asset_e text_id, s32 arg2){ timedFunc_set_1(0.5f, func_8034BB08, 1); - D_8037DF68++; + chBottleBonusPuzzleIndex++; } -void func_802DE38C(void) { +void chBottlesBonus_completedPuzzle(void) { Actor *actor; - actor = marker_getActor(D_8037DEA0); - D_8037DCC0[D_8037DF68] = TRUE; + actor = marker_getActor(chBottlesBonusMarker); + D_8037DCC0[chBottleBonusPuzzleIndex] = TRUE; func_80311714(0); - func_80311480(D_803681A0[D_8037DF68 + 1].unk4, 0x86, actor->position, D_8037DEA0, func_802DE340, NULL); + func_80311480(D_803681A0[chBottleBonusPuzzleIndex + 1].text_id, 0x86, actor->position, chBottlesBonusMarker, chBottlesBonus_IncrementPuzzle, NULL); func_80311714(1); } -s32 func_802DE41C(void){ - return D_8037DF68; +s32 chBottlesBonus_getPuzzleIndex(void){ + return chBottleBonusPuzzleIndex; } -void func_802DE428(s32 arg0, s32 arg1, s32 arg2) { +void chBottlesBonus_startTimer(s32 arg0, s32 arg1, s32 arg2) { Actor *actor; - actor = marker_getActor(D_8037DEA0); + actor = marker_getActor(chBottlesBonusMarker); actor->state = 4; actor->unk60 = 0.0f; timedFunc_set_2(0.25f, item_set, ITEM_6_HOURGLASS, TRUE); - timedFunc_set_2(0.25f, item_set, ITEM_0_HOURGLASS_TIMER, D_803681A0[D_8037DF68 + 1].unk0 * 60 - 1); + timedFunc_set_2(0.25f, item_set, ITEM_0_HOURGLASS_TIMER, D_803681A0[chBottleBonusPuzzleIndex + 1].time_seconds * 60 - 1); } -void func_802DE4CC(Actor *this) { +void chBottlesBonus_update(Actor *this) { ActorLocal_core2_560F0 *local; f32 sp50; s32 temp_v0_2; s32 sp48; - s32 sp44; + s32 cursor_state; s32 sp40; s32 phi_s0; s32 phi_s0_2; @@ -457,18 +454,18 @@ void func_802DE4CC(Actor *this) { actor_collisionOff(this); this->unk60 = 0.0f; D_8037DEB4 = D_8037DEB0 = 0; - func_803300D8(this->marker, func_802DD3CC); - if (D_8037DEA4 == 0) { - D_8037DEA4 = assetcache_get(0x470); + marker_setFreeMethod(this->marker, chBottlesBonus_free); + if (chBottleBonusBookselfModelBin == 0) { + chBottleBonusBookselfModelBin = assetcache_get(0x470); } if (D_8037DEA8 == 0) { D_8037DEA8 = assetcache_get(0x471); } if (D_8037DEAC == NULL) { - D_8037DEAC = func_8033F5F8(func_8033A0B0(D_8037DEA4), func_8033A148(D_8037DEA4)); + D_8037DEAC = func_8033F5F8(func_8033A0B0(chBottleBonusBookselfModelBin), func_8033A148(chBottleBonusBookselfModelBin)); func_8034CF74(local, 0, D_8037DEAC, 0xF0); } - func_8028746C(this->animctrl, func_802DD8AC); + func_8028746C(this->animctrl, chBottlesBonus_func_802DD8AC); for(phi_s0 = 0; phi_s0 < 0x14; phi_s0++){ func_8034DFB0(func_8034C2C4(this->marker, phi_s0 + 0x190), D_803682B4, D_803682A4, 0.0f); } @@ -478,12 +475,12 @@ void func_802DE4CC(Actor *this) { D_8037DEC4 = (Struct_core2_560F0_1 *) malloc(0x14*sizeof(Struct_core2_560F0_1)); } func_8034CF90(local, D_8037DEAC, 0xF0); - sp48 = func_802E06B4() - 1; - sp44 = func_802E055C(); + sp48 = chBottlesBonusCursor_func_802E06B4() - 1; + cursor_state = chBottlesBonusCursor_getState(); for(phi_s0_2 = 0; phi_s0_2 < 0x14; phi_s0_2++){ sp40 = D_8037DF90[phi_s0_2]; temp_v0_2 = func_8034C2C4(this->marker, phi_s0_2 + 0x190); - if ((phi_s0_2 == sp48) && (sp44 == 1) && !func_802E0538(phi_s0_2)) { + if ((phi_s0_2 == sp48) && (cursor_state == 1) && !chBottlesBonusCursor_func_802E0538(phi_s0_2)) { D_8037DF90[phi_s0_2] = TRUE; } else { D_8037DF90[phi_s0_2] = FALSE; @@ -519,12 +516,12 @@ void func_802DE4CC(Actor *this) { func_8025A7DC(COMUSIC_98_BBONUS_PIECES_SHUFFLE); if (D_8037DCC7 == 0) { func_80311714(0); - func_80311480(0xE24, 0x87, this->position, D_8037DEA0, func_802DE428, NULL); + func_80311480(0xE24, 0x87, this->position, chBottlesBonusMarker, chBottlesBonus_startTimer, NULL); func_80311714(1); D_8037DCC7 = 1; } else{ - func_802DE428(NULL, 0, 0); + chBottlesBonus_startTimer(NULL, 0, 0); } } break; @@ -532,9 +529,9 @@ void func_802DE4CC(Actor *this) { break; case 4: if (this->unk60 > 2.0) { - func_8025AEA0(COMUSIC_94_BBONUS, ((item_getCount(ITEM_0_HOURGLASS_TIMER) * 0x201D2) / (s32) ((D_803681A0[D_8037DF68 + 1].unk0 * 60) - 1)) + 330000); - if ((item_getCount(ITEM_6_HOURGLASS) == 0) && (func_802E06C0() == 0)) { - func_802DE250(&D_8037DCC9, 0xE26); + func_8025AEA0(COMUSIC_94_BBONUS, ((item_getCount(ITEM_0_HOURGLASS_TIMER) * 0x201D2) / (s32) ((D_803681A0[chBottleBonusPuzzleIndex + 1].time_seconds * 60) - 1)) + 330000); + if ((item_getCount(ITEM_6_HOURGLASS) == 0) && (chBottlesBonusCursor_isPuzzleCompleted() == 0)) { + chBottlesBonus_lose(&D_8037DCC9, 0xE26); } } break; @@ -543,60 +540,59 @@ void func_802DE4CC(Actor *this) { }//L802DE9A0 } -void func_802DE9C8(void){ +void __chBottlesBonus_spawn(void){ Actor *actor; - if(D_8037DEA0 == NULL){ + if(chBottlesBonusMarker == NULL){ actor = func_8032813C(0x1E0, D_803682C4, 0); - D_8037DEA0 = actor->marker; - func_802DF8EC(); + chBottlesBonusMarker = actor->marker; + chBottlesBonusCursor_spawn(); func_802DF270(); } } -void func_802DEA18(s32 arg0, s32 arg1){ - if(D_8037DEA0 == NULL){ - __spawnQueue_add_0(func_802DE9C8); +void chBottlesBonus_Spawn(s32 arg0, s32 arg1){ + if(chBottlesBonusMarker == NULL){ + __spawnQueue_add_0(__chBottlesBonus_spawn); } } -void func_802DEA50(s32 arg0){ +void chBottlesBonus_func_802DEA50(s32 arg0){ D_8037DEC8[arg0] = 0.0f; D_8037DF18[arg0] = 0.0f; } - -void func_802DEA74(s32 arg0){ +void chBottlesBonus_func_802DEA74(s32 arg0){ D_8037DF18[arg0] = 0.0f; } -void func_802DEA8C(s32 arg0, s32 arg1) { +void chBottlesBonus_func_802DEA8C(s32 arg0, s32 arg1) { ActorMarker *temp_a0; - temp_a0 = D_8037DEA0; + temp_a0 = chBottlesBonusMarker; if (temp_a0 != 0) { func_80326310(marker_getActor(temp_a0)); } } -s32 func_802DEACC(void){ - Actor *actor = marker_getActor(D_8037DEA0); +s32 chBottlesBonus_getState(void){ + Actor *actor = marker_getActor(chBottlesBonusMarker); return actor->state; } -f32 *func_802DEAF8(s32 arg0){ +f32 *chBottlesBonus_func_802DEAF8(s32 arg0){ return D_8037DEBC[arg0].unkC; } -Actor *func_802DEB18(s32 position[3], s32 yaw, ActorInfo *actor_info, u32 flags){ +Actor *chBottlesBonus_new(s32 position[3], s32 yaw, ActorInfo *actor_info, u32 flags){ int i; for(i = 1; i < 6; i++){ - D_80368220[i].index = D_803681A0[D_8037DF68].anim_id; + chBottlesBonusAnimations[i].index = D_803681A0[chBottleBonusPuzzleIndex].anim_id; } return actor_new(position, yaw, actor_info, flags); } -void func_802DEB80(void) { +void chBottlesBonus_func_802DEB80(void) { int i; for(i = 0; i < 7; i++){ D_8037DCC0[i] = 0; @@ -608,5 +604,5 @@ void func_802DEB80(void) { D_8037DCCB = 0; D_8037DCCC = 0; - D_8037DF68 = 0; + chBottleBonusPuzzleIndex = 0; } diff --git a/src/core2/code_584D0.c b/src/core2/ch/bottlesbonuscursor.c similarity index 60% rename from src/core2/code_584D0.c rename to src/core2/ch/bottlesbonuscursor.c index 1faaa142..16734672 100644 --- a/src/core2/code_584D0.c +++ b/src/core2/ch/bottlesbonuscursor.c @@ -14,15 +14,15 @@ extern void ml_vec3f_assign(f32[3], f32, f32, f32); extern void func_8025AABC(enum comusic_e); extern f32 func_8024E420(s32, s32, s32); extern f32 func_8033DDB8(void); -extern void func_802DEA50(s32); +extern void chBottlesBonus_func_802DEA50(s32); extern void func_80325794(ActorMarker *); -extern void func_802DE38C(void); +extern void chBottlesBonus_completedPuzzle(void); typedef struct { - s32 unk0; - s32 unk4; - f32 unk8; //rotation; + s32 state; //state + s32 piece_id; //piece_id + f32 rotation; //rotation; f32 unkC[4]; f32 unk1C[4]; }Struct_core2_584D0_0; @@ -32,8 +32,8 @@ typedef struct { f32 unk4; }Struct_core2_584D0_1; -void func_802DF99C(void); -void func_802DFA34(Actor *this); +void chBottlesBonusCursor_func_802DF99C(void); +void chBottlesBonusCursor_update(Actor *this); /* .data */ ActorAnimationInfo D_803683B0[] = { @@ -55,12 +55,12 @@ f32 D_8036840C[3] = {-11.28f, 3.92f, -52.96f}; ActorInfo D_80368418 = { 0x17A, 0x2B4, 0x565, 0x1, D_803683B0, - func_802DFA34, func_80326224, func_80325340, + chBottlesBonusCursor_update, func_80326224, func_80325340, 0, 0, 0.0f, 0 }; /* .bss */ -ActorMarker *D_8037E060; +ActorMarker *chBottlesBonusSursorMarker; f32 D_8037E068[20][2]; Struct_core2_584D0_0 D_8037E248[20]; u8 pad_8037E478[0x140]; @@ -70,9 +70,9 @@ struct { u8 pad4[0xC]; f32 unk10[2]; f32 unk18[2]; - u16 unk20; //buttons + u16 prev_button; //buttons //u8 pad22; - s32 unk24; + s32 is_completed; f32 unk28; f32 unk2C; } D_8037E5C0; @@ -81,7 +81,7 @@ f32 D_8037E5F4; f32 D_8037E5F8[3]; /* .code */ -void func_802DF460(s32 indx, ActorMarker *caller, f32 arg2[3]) { +void chBottlesBonusCursor_func_802DF460(s32 indx, ActorMarker *caller, f32 arg2[3]) { f32 sp1C[3]; sp1C[0] = arg2[0] * 100.0f; @@ -92,11 +92,11 @@ void func_802DF460(s32 indx, ActorMarker *caller, f32 arg2[3]) { } } -f32 func_802DF4E0(f32 arg0[2], f32 arg1[2]){ +static f32 __XY_dist_square(f32 arg0[2], f32 arg1[2]){ return (arg0[0] - arg1[0])*(arg0[0] - arg1[0]) + (arg0[1] - arg1[1])*(arg0[1] - arg1[1]); } -s32 func_802DF50C(void) { +s32 chBottlesBonusCursor_func_802DF50C(void) { s32 i; f32 min; f32 temp_f0; @@ -105,7 +105,7 @@ s32 func_802DF50C(void) { min = 1000.0f; min_index = -1; for(i = 0; i < 60; i++){ - temp_f0 = func_802DF4E0(D_8037E5C0.unk10, D_8037E068[i]); + temp_f0 = __XY_dist_square(D_8037E5C0.unk10, D_8037E068[i]); if (temp_f0 < ((f32)min + (f32)i)) { min_index = i; min = temp_f0; @@ -117,37 +117,37 @@ s32 func_802DF50C(void) { return -1; } -bool func_802DF5D0(void) { +bool chBottlesBonusCursor_checkPuzzleCompletion(void) { s32 i; - D_8037E5C0.unk24 = TRUE; - for(i = 0; i < 20 && D_8037E5C0.unk24 != 0; i++){ - if((D_8037E248[i].unk0 != 3) - || (i != D_8037E248[i].unk4) - || !func_803454D0(func_802DEAF8(i)) + D_8037E5C0.is_completed = TRUE; + for(i = 0; i < 20 && D_8037E5C0.is_completed != 0; i++){ + if((D_8037E248[i].state != 3) + || (i != D_8037E248[i].piece_id) + || !func_803454D0(chBottlesBonus_func_802DEAF8(i)) ) { - D_8037E5C0.unk24 = FALSE; + D_8037E5C0.is_completed = FALSE; } } - if (D_8037E5C0.unk24) { + if (D_8037E5C0.is_completed) { item_set(ITEM_6_HOURGLASS, FALSE); - timedFunc_set_3(0.25f, comusic_8025AB44, COMUSIC_94_BBONUS, 0, 0x7D0); - timedFunc_set_2(0.3f, func_8025A6EC, COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 0x55F0); - timedFunc_set_0(1.5f, func_802DF99C); - timedFunc_set_0(1.0f, func_802DE38C); + timedFunc_set_3(0.25f, comusic_8025AB44, COMUSIC_94_BBONUS, 0, 2000); + timedFunc_set_2(0.3f, func_8025A6EC, COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 22000); + timedFunc_set_0(1.5f, chBottlesBonusCursor_func_802DF99C); + timedFunc_set_0(1.0f, chBottlesBonus_completedPuzzle); } - return D_8037E5C0.unk24; + return D_8037E5C0.is_completed; } -void func_802DF71C(Gfx **gfx, Mtx **mtx, Vtx **vtx) { - f32 sp44[3]; +void chBottlesBonusCursor_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx) { + f32 rotation[3]; Actor *this; f32 sp3C; - this = marker_getActorAndRotation(D_8037E060, &sp44); + this = marker_getActorAndRotation(chBottlesBonusSursorMarker, &rotation); modelRender_preDraw((GenMethod_1)func_803253A0, (s32)this); - modelRender_postDraw((GenMethod_1)func_80325794, (s32)D_8037E060); + modelRender_postDraw((GenMethod_1)func_80325794, (s32)chBottlesBonusSursorMarker); modelRender_setDepthMode(MODEL_RENDER_DEPTH_FULL); actor_setOpacity(this, 0xB9); func_8024E030(this->position, D_8037E5C0.unk18); @@ -157,7 +157,7 @@ void func_802DF71C(Gfx **gfx, Mtx **mtx, Vtx **vtx) { (s32)sp3C, (s32)sp3C, D_803A5D00[func_8024BDA0()] ); - modelRender_draw(gfx, mtx, this->position, sp44, this->scale, NULL, func_80330B1C(D_8037E060)); + modelRender_draw(gfx, mtx, this->position, rotation, this->scale, NULL, func_80330B1C(chBottlesBonusSursorMarker)); func_8024E030(this->position, D_8037E5C0.unk10); if (this->state == 1) { D_8037E5C0.unk10[0] -= 24.0f; @@ -168,28 +168,28 @@ void func_802DF71C(Gfx **gfx, Mtx **mtx, Vtx **vtx) { } } -ActorMarker *func_802DF8EC(void){ +ActorMarker *chBottlesBonusCursor_spawn(void){ Actor *this = func_8032813C(0x2B4, D_80368400, 0); - D_8037E060 = this->marker; - return D_8037E060; + chBottlesBonusSursorMarker = this->marker; + return chBottlesBonusSursorMarker; } -void func_802DF928(s32 indx) { - f32 sp24[3]; +void chBottlesBonusCursor_func_802DF928(s32 indx) { + f32 rotation_3d[3]; func_80345250(D_8037E248[indx].unk1C, D_8037E248[indx].unkC); - sp24[0] = D_8037E248[indx].unk8; - sp24[1] = 0.0f; - sp24[2] = 0.0f; - func_80345C78(D_8037E248[indx].unkC, sp24); + rotation_3d[0] = D_8037E248[indx].rotation; + rotation_3d[1] = 0.0f; + rotation_3d[2] = 0.0f; + func_80345C78(D_8037E248[indx].unkC, rotation_3d); } -void func_802DF99C(void){ +void chBottlesBonusCursor_func_802DF99C(void){ func_803228D8(); func_8025A55C(-1, 2000, 7); } -void func_802DF9CC(Actor *this) { +void chBottlesBonusCursor_freeMethod(Actor *this) { func_8031FBF8(); func_8031FBA0(); if (func_8034BAFC() != -1) { @@ -197,21 +197,21 @@ void func_802DF9CC(Actor *this) { func_8033D13C(func_8034BAFC()); func_80347AA8(); } - D_8037E060 = 0; + chBottlesBonusSursorMarker = 0; } -void func_802DFA34(Actor *this) { +void chBottlesBonusCursor_update(Actor *this) { OSContPad *sp5C; f32 sp58; f32 sp54; f32 sp50; - Struct_core2_584D0_0 *sp4C; + Struct_core2_584D0_0 *held_piece; s32 i; s32 sp44; sp5C = func_8024F3F4(); sp58 = func_8033DDB8(); - sp4C = &D_8037E248[D_8037E5C0.unk0]; + held_piece = &D_8037E248[D_8037E5C0.unk0]; if (!this->initialized) { this->initialized = TRUE; this->scale = 0.18f; @@ -223,18 +223,18 @@ void func_802DFA34(Actor *this) { D_8037E5F0 = 0.0f; D_8037E5C0.unk0 = -1; D_8037E5B8 = -1; - D_8037E5C0.unk20 = sp5C->button; - D_8037E5C0.unk24 = 0; + D_8037E5C0.prev_button = sp5C->button; + D_8037E5C0.is_completed = 0; timedFunc_set_2(3.0f, func_8025A6EC, COMUSIC_94_BBONUS, 0x5DC0); timedFunc_set_1(3.0f, func_8025AABC, COMUSIC_94_BBONUS); for(i = 0; i < 20; i++){ bzero(&D_8037E248[i], sizeof(Struct_core2_584D0_0)); D_8037E068[40 + i][0] = D_8037E068[40 + i][1] = 0.0f; } - func_803300D8(this->marker, func_802DF9CC); + marker_setFreeMethod(this->marker, chBottlesBonusCursor_freeMethod); } - if (this->state != 8 && this->state != 9 && func_802DEACC() == 4) { + if (this->state != 8 && this->state != 9 && chBottlesBonus_getState() == 4) { if (this->state != 6) { sp54 = func_8024E420(sp5C->stick_x, 7, 0x3B); sp50 = func_8024E420(sp5C->stick_y, 7, 0x3D); @@ -263,62 +263,62 @@ void func_802DFA34(Actor *this) { this->position[2] = D_80368400[2] + this->unk1C[2]; } - if ( (sp5C->button & START_BUTTON) && !(D_8037E5C0.unk20 & START_BUTTON) - && func_802DEACC() == 4 + if ( (sp5C->button & START_BUTTON) && !(D_8037E5C0.prev_button & START_BUTTON) + && chBottlesBonus_getState() == 4 ) { - func_802DE250(&D_8037DCC8, 0xE25); + chBottlesBonus_lose(&D_8037DCC8, 0xE25); } if(this->state == 2 || this->state == 3 || this->state == 4){ - if((sp5C->button & L_CBUTTONS) && !(D_8037E5C0.unk20 & L_CBUTTONS)){ - sp4C->unk8 = mlNormalizeAngle(sp4C->unk8 - 90.0); - func_802DF928(D_8037E5C0.unk0); - func_802DEA74(D_8037E5C0.unk0); + if((sp5C->button & L_CBUTTONS) && !(D_8037E5C0.prev_button & L_CBUTTONS)){ + held_piece->rotation = mlNormalizeAngle(held_piece->rotation - 90.0); + chBottlesBonusCursor_func_802DF928(D_8037E5C0.unk0); + chBottlesBonus_func_802DEA74(D_8037E5C0.unk0); func_8030E58C(SFX_12D_CAMERA_ZOOM_CLOSEST, 0.9f); func_80328B8C(this, 3, 0.0f, 1); actor_playAnimationOnce(this); } - if((sp5C->button & R_CBUTTONS) && !(D_8037E5C0.unk20 & R_CBUTTONS)){ - sp4C->unk8 = mlNormalizeAngle(sp4C->unk8 + 90.0); - func_802DF928(D_8037E5C0.unk0); - func_802DEA74(D_8037E5C0.unk0); + if((sp5C->button & R_CBUTTONS) && !(D_8037E5C0.prev_button & R_CBUTTONS)){ + held_piece->rotation = mlNormalizeAngle(held_piece->rotation + 90.0); + chBottlesBonusCursor_func_802DF928(D_8037E5C0.unk0); + chBottlesBonus_func_802DEA74(D_8037E5C0.unk0); func_8030E58C(SFX_12D_CAMERA_ZOOM_CLOSEST, 1.0f); func_80328B8C(this, 4, 0.0f, 1); actor_playAnimationOnce(this); } } - D_8037E5B8 = func_802DF50C() + 1; + D_8037E5B8 = chBottlesBonusCursor_func_802DF50C() + 1; switch(this->state){ case 1://L802E00AC //no piece in hand if( (D_8037E5B8 > 0) && (D_8037E5B8 < 0x15) - && ((sp5C->button & A_BUTTON) && !(D_8037E5C0.unk20 & A_BUTTON)) + && ((sp5C->button & A_BUTTON) && !(D_8037E5C0.prev_button & A_BUTTON)) ){ - if(D_8037E248[D_8037E5B8 - 1].unk0 == 0) { + if(D_8037E248[D_8037E5B8 - 1].state == 0) { D_8037E5C0.unk0 = D_8037E5B8 - 1; - func_802DEA50(D_8037E5C0.unk0); - sp4C = &D_8037E248[D_8037E5C0.unk0]; - sp4C->unk0 = 1; - sp4C->unk8 = 0.0f; - func_802DF928(D_8037E5C0.unk0); - func_802DF928(D_8037E5C0.unk0); + chBottlesBonus_func_802DEA50(D_8037E5C0.unk0); + held_piece = &D_8037E248[D_8037E5C0.unk0]; + held_piece->state = 1; + held_piece->rotation = 0.0f; + chBottlesBonusCursor_func_802DF928(D_8037E5C0.unk0); + chBottlesBonusCursor_func_802DF928(D_8037E5C0.unk0); func_8025A6EC(COMUSIC_96_BBONUS_PICKUP_PIECE, -1); func_80328B8C(this, 2, 0.0f, 1); } } if( ((D_8037E5B8 >= 0x29) && (D_8037E5B8 < 0x3D)) - && ((sp5C->button & A_BUTTON) && !(D_8037E5C0.unk20 & A_BUTTON)) + && ((sp5C->button & A_BUTTON) && !(D_8037E5C0.prev_button & A_BUTTON)) ) { - if (D_8037E248[D_8037E5B8 - 41].unk0 == 3) { - if( D_8037E5B8 - 41 != D_8037E248[D_8037E5B8 - 41].unk4 - || !func_803454D0(func_802DEAF8(D_8037E5B8 - 41)) + if (D_8037E248[D_8037E5B8 - 41].state == 3) { + if( D_8037E5B8 - 41 != D_8037E248[D_8037E5B8 - 41].piece_id + || !func_803454D0(chBottlesBonus_func_802DEAF8(D_8037E5B8 - 41)) ) { D_8037E5C0.unk0 = D_8037E5B8 - 41; - func_802DEA50(D_8037E5C0.unk0); - sp4C = &D_8037E248[D_8037E5C0.unk0]; - sp4C->unk0 = 2; - func_802DF928(D_8037E5C0.unk0); + chBottlesBonus_func_802DEA50(D_8037E5C0.unk0); + held_piece = &D_8037E248[D_8037E5C0.unk0]; + held_piece->state = 2; + chBottlesBonusCursor_func_802DF928(D_8037E5C0.unk0); func_8030E484(SFX_112_TINKER_ATTENTION); func_80328B8C(this, 2, 0.0f, 1); } @@ -328,20 +328,20 @@ void func_802DFA34(Actor *this) { //holding piece case 2://L802E029C - if((sp5C->button & B_BUTTON) && !(D_8037E5C0.unk20 & B_BUTTON)){ - sp4C->unk0 = 0; + if((sp5C->button & B_BUTTON) && !(D_8037E5C0.prev_button & B_BUTTON)){ + held_piece->state = 0; func_80328B8C(this, 5, 0.0f, 1); func_8025A6EC(COMUISC_97_BBONUS_DROP_PIECE, -1); - func_802DEA50(D_8037E5C0.unk0); + chBottlesBonus_func_802DEA50(D_8037E5C0.unk0); D_8037E5C0.unk0 = -1; break; } - if((sp5C->button & A_BUTTON) && !(D_8037E5C0.unk20 & A_BUTTON)){ + if((sp5C->button & A_BUTTON) && !(D_8037E5C0.prev_button & A_BUTTON)){ if ((D_8037E5B8 >= 21) && (D_8037E5B8 < 41)) { - sp4C->unk0 = 3; - sp4C->unk4 = D_8037E5B8 - 21; - if ((D_8037E5C0.unk0 == sp4C->unk4) && func_803454D0(func_802DEAF8(D_8037E5C0.unk0))) { + held_piece->state = 3; + held_piece->piece_id = D_8037E5B8 - 21; + if ((D_8037E5C0.unk0 == held_piece->piece_id) && func_803454D0(chBottlesBonus_func_802DEAF8(D_8037E5C0.unk0))) { sp44 = COMUSIC_2B_DING_B; func_80328B8C(this, 6, 0.0f, 1); actor_playAnimationOnce(this); @@ -350,13 +350,13 @@ void func_802DFA34(Actor *this) { func_80328B8C(this, 1, 0.0f, 1); } - if (func_802DF5D0()) { + if (chBottlesBonusCursor_checkPuzzleCompletion()) { func_80328B8C(this, 8, 0.0f, 1); actor_playAnimationOnce(this); } timedFunc_set_2(0.25f, func_8025A6EC, sp44, 26000); - func_802DEA50(D_8037E5C0.unk0); + chBottlesBonus_func_802DEA50(D_8037E5C0.unk0); D_8037E5C0.unk0 = -1; } } @@ -402,58 +402,56 @@ void func_802DFA34(Actor *this) { case 9://L802E0510 break; } - D_8037E5C0.unk20 = sp5C->button; + D_8037E5C0.prev_button = sp5C->button; } } - -s32 func_802E0538(s32 indx){ - return D_8037E248[indx].unk0; +s32 chBottlesBonusCursor_func_802E0538(s32 indx){ + return D_8037E248[indx].state; } -//chHand_getState -s32 func_802E055C(void){ +s32 chBottlesBonusCursor_getState(void){ Actor *this; - this = marker_getActor(D_8037E060); + this = marker_getActor(chBottlesBonusSursorMarker); return this->state; } -s32 func_802E0588(s32 indx){ - return D_8037E248[indx].unk4; +s32 chBottlesBonusCursor_func_802E0588(s32 indx){ + return D_8037E248[indx].piece_id; } -f32 *func_802E05AC(s32 indx) { +f32 *chBottlesBonusCursor_func_802E05AC(s32 indx) { if (indx == D_8037E5C0.unk0) { - D_8037E5F8[0] = D_8036840C[0] + marker_getActor(D_8037E060)->position[0]; - D_8037E5F8[1] = D_8036840C[1] + marker_getActor(D_8037E060)->position[1]; - D_8037E5F8[2] = D_8036840C[2] + marker_getActor(D_8037E060)->position[2]; + D_8037E5F8[0] = D_8036840C[0] + marker_getActor(chBottlesBonusSursorMarker)->position[0]; + D_8037E5F8[1] = D_8036840C[1] + marker_getActor(chBottlesBonusSursorMarker)->position[1]; + D_8037E5F8[2] = D_8036840C[2] + marker_getActor(chBottlesBonusSursorMarker)->position[2]; } else { ml_vec3f_assign(&D_8037E5F8, 0, 0, 0); } return &D_8037E5F8; } -f32 *func_802E0664(s32 indx){ +f32 *chBottlesBonusCursor_func_802E0664(s32 indx){ return D_8037E248[indx].unkC; } -f32 *func_802E068C(s32 indx){ +f32 *chBottlesBonusCursor_func_802E068C(s32 indx){ return D_8037E248[indx].unk1C; } -s32 func_802E06B4(void){ +s32 chBottlesBonusCursor_func_802E06B4(void){ return D_8037E5B8; } -bool func_802E06C0(void){ - return D_8037E5C0.unk24; +bool chBottlesBonusCursor_isPuzzleCompleted(void){ + return D_8037E5C0.is_completed; } -void func_802E06CC(void){ +void chBottlesBonusCursor_lose(void){ Actor *this; - this = marker_getActor(D_8037E060); + this = marker_getActor(chBottlesBonusSursorMarker); func_80328B8C(this, 9, 0.0f, 1); actor_playAnimationOnce(this); } diff --git a/src/core2/code_51C90.c b/src/core2/ch/collectable.c similarity index 64% rename from src/core2/code_51C90.c rename to src/core2/ch/collectable.c index 840f91f3..b265023d 100644 --- a/src/core2/code_51C90.c +++ b/src/core2/ch/collectable.c @@ -6,35 +6,35 @@ extern void actor_setOpacity(Actor*,s32); extern void func_8035644C(u32); -bool func_802D8D48(Actor*, u32, enum asset_e, enum comusic_e, enum item_e, f32); -Actor *func_802D8F50(ActorMarker *this, Gfx **gdl, Mtx **mptr, Vtx **arg3); -void func_802D9018(Actor *this); +bool chcollectable_collectItem(Actor*, u32, enum asset_e, enum comusic_e, enum item_e, f32); +Actor *chCollectable_draw(ActorMarker *this, Gfx **gdl, Mtx **mptr, Vtx **arg3); +void chCollectable_update(Actor *this); /* .data */ extern ActorInfo D_80367D00 = { - 0x60, 0x52, 0x36D, + MARKER_60_BLUE_EGG_COLLECTABLE, ACTOR_52_BLUE_EGG, ASSET_36D_SPRITE_BLUE_EGG, 0, NULL, - func_802D9018, func_80326224, func_802D8F50, + chCollectable_update, func_80326224, chCollectable_draw, 0, 0, 0.7f, 0 }; extern ActorInfo D_80367D24 = { - 0xB5, 0x129, 0x580, + MARKER_B5_RED_FEATHER_COLLECTABLE, ACTOR_129_RED_FEATHER, ASSET_580_SPRITE_RED_FEATHER, 0, NULL, - func_802D9018, func_80326224, func_802D8F50, + chCollectable_update, func_80326224, chCollectable_draw, 0, 0, 0.5f, 0 }; extern ActorInfo D_80367D48 = { - 0x1E5, 0x370, 0x6D1, + MARKER_1E5_GOLD_FEATHER, ACTOR_370_GOLD_FEATHER, ASSET_6D1_SPRITE_GOLDFEATHTER, 0, NULL, - func_802D9018, func_80326224, func_802D8F50, + chCollectable_update, func_80326224, chCollectable_draw, 0, 0, 0.5f, 0 }; /* .code */ -void func_802D8C20(Actor *arg0, u32 arg1){ - switch(arg1){ +void chcollectable_setState(Actor *arg0, s32 next_state){ + switch(next_state){ default: break; case 1: @@ -47,7 +47,7 @@ void func_802D8C20(Actor *arg0, u32 arg1){ actor_collisionOn(arg0); break; } - func_80328A84(arg0, arg1); + func_80328A84(arg0, next_state); } void func_802D8C98(Actor *this, s32 arg1) { @@ -55,15 +55,15 @@ void func_802D8C98(Actor *this, s32 arg1) { switch (this->marker->unk14_20) { - case 0x60: + case MARKER_60_BLUE_EGG_COLLECTABLE: phi_v0 = TRUE; break; - case 0xB5: + case MARKER_B5_RED_FEATHER_COLLECTABLE: phi_v0 = (arg1 == 1) || (arg1 == 2) || (arg1 == 3); break; - case 0x1e5: + case MARKER_1E5_GOLD_FEATHER: phi_v0 = TRUE; break; @@ -73,11 +73,10 @@ void func_802D8C98(Actor *this, s32 arg1) { } this->unk10_12 = arg1; - func_802D8C20(this, (phi_v0 ) ? 2 : 3); + chcollectable_setState(this, (phi_v0 ) ? 2 : 3); } -//collectItem -bool func_802D8D48(Actor* actor, u32 arg1, enum asset_e dialogId, enum comusic_e sfxId, enum item_e itemId, f32 arg5){ +bool chcollectable_collectItem(Actor* actor, u32 arg1, enum asset_e dialogId, enum comusic_e sfxId, enum item_e itemId, f32 arg5){ func_8025A6EC(sfxId,32000); timedFunc_set_1(0.75f, (GenMethod_1)func_8035644C, arg1); if(!func_802FADD4(0x1b)){ @@ -90,40 +89,37 @@ bool func_802D8D48(Actor* actor, u32 arg1, enum asset_e dialogId, enum comusic_e return TRUE; actor->unk60 = arg5; - func_802D8C20(actor, 1); + chcollectable_setState(actor, 1); return FALSE; } -//egg_collision -s32 collect_egg(ActorProp *arg0){ +s32 chcollectable_collectEgg(ActorProp *arg0){ Actor *actPtr = NULL; if(arg0 != NULL){ func_802F3808(&arg0->x); if(arg0->unk8_0) actPtr = marker_getActor(arg0->marker); } - func_802D8D48(actPtr, 5, 0xD9E, COMUSIC_C_EGG_COLLECTED, 0xD, 2.0f); + chcollectable_collectItem(actPtr, 5, 0xD9E, COMUSIC_C_EGG_COLLECTED, 0xD, 2.0f); } -//readFeather_collision -void func_802D8E68(ActorProp *arg0){ +void chcollectable_collectRedFeather(ActorProp *arg0){ Actor *actPtr = NULL; func_802F38F0(&arg0->x); if(arg0->unk8_0) actPtr = marker_getActor(arg0->marker); - func_802D8D48(actPtr, 6, 0xD9F, COMUSIC_B_RED_FEATHER_COLLECTED, 0xF, 4.0f); + chcollectable_collectItem(actPtr, 6, 0xD9F, COMUSIC_B_RED_FEATHER_COLLECTED, 0xF, 4.0f); } -//goldFeather_collision -void func_802D8EDC(ActorProp *arg0){ +void chcollectable_collectGoldFeather(ActorProp *arg0){ Actor *actPtr = NULL; func_802F39D8(&arg0->x); if(arg0->unk8_0) actPtr = marker_getActor(arg0->marker); - func_802D8D48(actPtr, 7, 0xDA0, COMUSIC_14_GOLD_FEATHER_COLLECTED, ITEM_10_GOLD_FEATHER, 6.0f); + chcollectable_collectItem(actPtr, 7, 0xDA0, COMUSIC_14_GOLD_FEATHER_COLLECTED, ITEM_10_GOLD_FEATHER, 6.0f); } -Actor *func_802D8F50(ActorMarker *this, Gfx **gdl, Mtx **mptr, Vtx **arg3){ +Actor *chCollectable_draw(ActorMarker *this, Gfx **gdl, Mtx **mptr, Vtx **arg3){ Actor *thisActor = marker_getActor(this); if(thisActor->unk28 != 0.0f){ @@ -140,7 +136,7 @@ Actor *func_802D8F50(ActorMarker *this, Gfx **gdl, Mtx **mptr, Vtx **arg3){ return thisActor; } -void func_802D9018(Actor *this) { +void chCollectable_update(Actor *this) { f32 temp_f0; f32 temp_f0_2; f32 temp_f2; @@ -167,7 +163,7 @@ void func_802D9018(Actor *this) { if (this->unk60 > 0.0) { this->unk60 -= time_getDelta(); } else { - func_802D8C20(this, 2); + chcollectable_setState(this, 2); } /* fallthrough */ case 3: diff --git a/src/core2/ch/gameSelect.c b/src/core2/ch/gameSelect.c index b7b0d89c..57f47031 100644 --- a/src/core2/ch/gameSelect.c +++ b/src/core2/ch/gameSelect.c @@ -2,6 +2,8 @@ #include "functions.h" #include "variables.h" +#include "core2/modelRender.h" + #ifndef ABS #define ABS(d) ((d) >= 0) ? (d) : -(d) #endif @@ -86,8 +88,8 @@ struct { } D_8037DCE0; s32 D_8037DCE8; s32 D_8037DCEC; -gczoombox_t *D_8037DCF0; -gczoombox_t *D_8037DCF4; +gczoombox_t *chGameSelectTopZoombox; +gczoombox_t *chGameSelectBottomZoombox; f32 D_8037DCF8[2][3]; f32 D_8037DD10[2][3]; s32 D_8037DD28; @@ -98,7 +100,7 @@ f32 D_8037DD34; /* .code */ -Actor *func_802C4360(ActorMarker *marker, Gfx **arg1, Mtx **arg2, Vtx **arg3){ +Actor *func_802C4360(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ s32 sp1C = marker->unk14_20 - 0xe4; func_8033A45C(3, sp1C); func_8033A45C(1, 1); @@ -116,15 +118,15 @@ Actor *func_802C4360(ActorMarker *marker, Gfx **arg1, Mtx **arg2, Vtx **arg3){ else{ modelRender_setEnvColor(0x64, 0x64, 0x64, 0xFF); } - return func_80325888(marker, arg1, arg2, arg3); + return func_80325888(marker, gfx, mtx, vtx); } -Actor *func_802C4464(ActorMarker *marker, Gfx **arg1, Mtx **arg2, Vtx **arg3){ - Actor *ret_val = func_802C4360(marker, arg1, arg2, arg3); - if(D_8037DCF4) - gczoombox_draw(D_8037DCF4, arg1, arg2, arg3); - if(D_8037DCF0) - gczoombox_draw(D_8037DCF0, arg1, arg2, arg3); +Actor *func_802C4464(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + Actor *ret_val = func_802C4360(marker, gfx, mtx, vtx); + if(chGameSelectBottomZoombox) + gczoombox_draw(chGameSelectBottomZoombox, gfx, mtx, vtx); + if(chGameSelectTopZoombox) + gczoombox_draw(chGameSelectTopZoombox, gfx, mtx, vtx); return ret_val; } @@ -226,10 +228,10 @@ void func_802C4768(s32 gamenum){ }//L802C4A68 sp20[0] = D_8037DD48;\ sp20[1] = D_8037DD68; - func_8031877C(D_8037DCF4); - func_80318284(D_8037DCF4, 2, sp20); - gczoombox_maximize(D_8037DCF4); - gczoombox_resolve_minimize(D_8037DCF4); + func_8031877C(chGameSelectBottomZoombox); + func_80318284(chGameSelectBottomZoombox, 2, sp20); + gczoombox_maximize(chGameSelectBottomZoombox); + gczoombox_resolve_minimize(chGameSelectBottomZoombox); } void func_802C4AC8(s32 arg0){ @@ -240,14 +242,14 @@ void func_802C4AC8(s32 arg0){ void func_802C4AF0(Actor * this){ int i; - if(D_8037DCF0){ - gczoombox_free(D_8037DCF0); - D_8037DCF0 = NULL; + if(chGameSelectTopZoombox){ + gczoombox_free(chGameSelectTopZoombox); + chGameSelectTopZoombox = NULL; } - if(D_8037DCF4){ - gczoombox_free(D_8037DCF4); - D_8037DCF4 = NULL; + if(chGameSelectBottomZoombox){ + gczoombox_free(chGameSelectBottomZoombox); + chGameSelectBottomZoombox = NULL; } for(i = 0; i < 3; i++){ @@ -296,7 +298,7 @@ void func_802C4C14(Actor *this){ sp84 = this->marker->unk14_20 - 0xe4; sp80 = (sp84 == D_80365E00); sp50 = time_getDelta(); - if(!D_8037DCF4) + if(chGameSelectBottomZoombox == NULL) return; if(!this->initialized){ @@ -382,15 +384,15 @@ void func_802C4C14(Actor *this){ func_8025A6EC(COMUSIC_2B_DING_B, 22000); } func_80328A84(this, 2); - func_8031877C(D_8037DCF0); - func_80318284(D_8037DCF0, 2, &D_8037DCE0); + func_8031877C(chGameSelectTopZoombox); + func_80318284(chGameSelectTopZoombox, 2, &D_8037DCE0); D_8037DD34 = 0.0f; } break; case 3://L802C50C8 case 4://L802C50C8 if(animctrl_isStopped(this->animctrl)){ - func_802DEB80(); + chBottlesBonus_func_802DEB80(); if(!func_8033D1BC(sp84)){ timedFunc_set_3(0.0f, (GenMethod_3)func_802E4078, MAP_85_CS_SPIRAL_MOUNTAIN_3, 0, 1); } @@ -412,8 +414,8 @@ void func_802C4C14(Actor *this){ case 2://L802C51CC if(sp74[0] == 1){ if(func_8033D1BC(sp84)){ - func_8031877C(D_8037DCF0); - func_803183A4(D_8037DCF0, (&D_80365DFC)[func_8031B5B0()]); + func_8031877C(chGameSelectTopZoombox); + func_803183A4(chGameSelectTopZoombox, (&D_80365DFC)[func_8031B5B0()]); D_8037DD2C = 1; func_80328A84(this, 5); } @@ -508,8 +510,8 @@ void func_802C4C14(Actor *this){ if(D_8037DD2C == 0){ D_8037DD34 += sp50; if(20.0 < D_8037DD34){ - func_8031877C(D_8037DCF0); - func_80318284(D_8037DCF0, 2, &D_8037DCE0); + func_8031877C(chGameSelectTopZoombox); + func_80318284(chGameSelectTopZoombox, 2, &D_8037DCE0); D_8037DD34 = 0.0f; } } @@ -542,20 +544,20 @@ void func_802C5740(Actor * this){ if(!this->initialized){ func_8033CE40(); - if(D_8037DCF4 == NULL){ - D_8037DCF4 = gczoombox_new(0xA0, TALK_PIC_C_BANJO_2, 2, 0, NULL); - gczoombox_open(D_8037DCF4); - func_803184C8(D_8037DCF4, 30.0f, 5, 2, 0.4f, 0, 0); + if(chGameSelectBottomZoombox == NULL){ + chGameSelectBottomZoombox = gczoombox_new(0xA0, TALK_PIC_C_BANJO_2, 2, 0, NULL); + gczoombox_open(chGameSelectBottomZoombox); + func_803184C8(chGameSelectBottomZoombox, 30.0f, 5, 2, 0.4f, 0, 0); }//L802C57FC - if(D_8037DCF0 == NULL){ - D_8037DCF0 = gczoombox_new(0xA, TALK_PIC_D_KAZOOIE_1, 2, 1, func_802C44D0); - func_80318284(D_8037DCF0, 2, &D_8037DCE0); - gczoombox_open(D_8037DCF0); - gczoombox_maximize(D_8037DCF0); + if(chGameSelectTopZoombox == NULL){ + chGameSelectTopZoombox = gczoombox_new(0xA, TALK_PIC_D_KAZOOIE_1, 2, 1, func_802C44D0); + func_80318284(chGameSelectTopZoombox, 2, &D_8037DCE0); + gczoombox_open(chGameSelectTopZoombox); + gczoombox_maximize(chGameSelectTopZoombox); }//L802C5860 - func_803300D8(this->marker, func_802C4AF0); + marker_setFreeMethod(this->marker, func_802C4AF0); D_8037DCEC = 0; func_8031FBF8(); func_8031FBA0(); @@ -574,10 +576,10 @@ void func_802C5740(Actor * this){ func_8025A6EC(COMUSIC_73_GAMEBOY, 0); }//L802C5940 if(!func_8038AAB0()){ - if(D_8037DCF4) - gczoombox_update(D_8037DCF4); - if(D_8037DCF0) - gczoombox_update(D_8037DCF0); + if(chGameSelectBottomZoombox) + gczoombox_update(chGameSelectBottomZoombox); + if(chGameSelectTopZoombox) + gczoombox_update(chGameSelectTopZoombox); } func_802C4C14(this); } diff --git a/src/core2/ch/jiggy.c b/src/core2/ch/jiggy.c index 81fd85f7..9c508028 100644 --- a/src/core2/ch/jiggy.c +++ b/src/core2/ch/jiggy.c @@ -162,10 +162,10 @@ void chjiggy_update(Actor *this){ this->unk124_6 = 0; break; case JIGGY_41_GV_MAZE:// L802C7F7C - this->marker->unk14_10 = 0x1E; + this->marker->unk14_10 = 30; break; case JIGGY_13_TTC_LOCKUP: //L802C7F94 - this->marker->unk14_10 = 0x28; + this->marker->unk14_10 = 40; break; } } diff --git a/src/core2/ch/jinjo.c b/src/core2/ch/jinjo.c index 7694b713..bf8dcf76 100644 --- a/src/core2/ch/jinjo.c +++ b/src/core2/ch/jinjo.c @@ -115,7 +115,7 @@ void func_802CDD78(Actor * this){ local->unk4 = 0; local->unk8 = (this->position_y < func_80309B24(this->position)); this->marker->unkC = func_802CDBA8; - func_803300D8(this->marker, func_802CDD3C); + marker_setFreeMethod(this->marker, func_802CDD3C); if(func_803203FC(UNKFLAGS1_C1_IN_FINAL_CHARACTER_PARADE)){ marker_despawn(this->marker); } diff --git a/src/core2/ch/mole.c b/src/core2/ch/mole.c index 5b289123..4cacb147 100644 --- a/src/core2/ch/mole.c +++ b/src/core2/ch/mole.c @@ -303,7 +303,7 @@ void func_802D9D60(Actor *this){ if(!this->unk16C_4){ this->unk16C_4 = 1; - func_803300D8(this->marker, func_802D9C90); + marker_setFreeMethod(this->marker, func_802D9C90); if(this->initialized){ other = actorArray_findClosestActorFromActorId(this->position, ACTOR_12C_MOLEHILL, -1, &sp4C); this->unk100 = (other) ? other->marker : NULL; diff --git a/src/core2/ch/overlaycopyright.c b/src/core2/ch/overlaycopyright.c new file mode 100644 index 00000000..be9169de --- /dev/null +++ b/src/core2/ch/overlaycopyright.c @@ -0,0 +1,55 @@ +#include +#include "functions.h" +#include "variables.h" + +void chOverlayCopyright_update(Actor *this); + +/* .data */ +f32 D_803680D0[3] = {0.0f, 0.0f, 0.0f}; +ActorInfo chOverlayCopyrightDescription = { + MARKER_176_COPYRIGHT_OVERLAY, ACTOR_1DD_COPYRIGHT_OVERLAY, ASSET_54E_MODEL_COPYRIGHT_OVERLAY, + 0x1, NULL, + chOverlayCopyright_update, func_80326224, func_802DC7E0, + 0, 0, 0.0f, 0 +}; + +/* .bss */ +ActorMarker *chOverlayCopyrightMarker; + +/* .code */ +void chOverlayCopyright_freeMethod(Actor *this){ + chOverlayCopyrightMarker = NULL; +} + +void chOverlayCopyright_update(Actor *this){ + if(!this->initialized){ + this->initialized = TRUE; + this->depth_mode = MODEL_RENDER_DEPTH_NONE; + actor_collisionOff(this); + marker_setFreeMethod(this->marker, chOverlayCopyright_freeMethod); + } +} + + +void __chOverlayCopyright_spawn(void) { + Actor *actor; + if (chOverlayCopyrightMarker == 0) { + actor = func_8032813C(ACTOR_1DD_COPYRIGHT_OVERLAY, D_803680D0, 0); + chOverlayCopyrightMarker = actor->marker; + } +} + +void chOverlayCopyright_spawn(s32 arg0, s32 arg1){ + if(chOverlayCopyrightMarker == NULL){ + __spawnQueue_add_0(__chOverlayCopyright_spawn); + } +} + +void chOverlayCopyright_func_802DCB0C(s32 arg0, s32 arg1) { + ActorMarker *temp_a0; + + temp_a0 = chOverlayCopyrightMarker; + if (temp_a0 != 0) { + func_80326310(marker_getActor(temp_a0)); + } +} diff --git a/src/core2/code_55E70.c b/src/core2/ch/overlaynocontroller.c similarity index 66% rename from src/core2/code_55E70.c rename to src/core2/ch/overlaynocontroller.c index 20d51bca..a1ddc297 100644 --- a/src/core2/code_55E70.c +++ b/src/core2/ch/overlaynocontroller.c @@ -5,8 +5,8 @@ extern Actor *func_8032813C(enum actor_e, f32[3], s32); extern void func_80325794(ActorMarker *marker); -Actor *func_802DCE00(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); -void func_802DCF20(Actor *this); +Actor *chOverlayNoController_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); +void chOverlayNoController_update(Actor *this); /* .data */ ActorAnimationInfo D_80368150[] ={ @@ -16,9 +16,9 @@ ActorAnimationInfo D_80368150[] ={ }; f32 D_80368168[3] = {0.0f, 0.0f, 0.0f}; ActorInfo D_80368174 = { - 0x178, 0x1DF, 0x55D, + MARKER_178_NO_CONTROLLER_OVERLAY, ACTOR_1DF_NO_CONTROLLER_OVERLAY, ASSET_55D_MODEL_NO_CONTROLLER_OVERLAY, 0x0, D_80368150, - func_802DCF20, func_80326224, func_802DCE00, + chOverlayNoController_update, func_80326224, chOverlayNoController_draw, 0, 0, 0.0f, 0 }; @@ -26,7 +26,7 @@ ActorInfo D_80368174 = { ActorMarker *D_8037DE90; /* .code */ -Actor *func_802DCE00(ActorMarker *marker, Gfx **gdl, Mtx **mptr, Vtx **vptr){ +Actor *chOverlayNoController_draw(ActorMarker *marker, Gfx **gdl, Mtx **mptr, Vtx **vptr){ Actor * actor; f32 sp58[3]; f32 sp4C[3]; @@ -52,18 +52,18 @@ Actor *func_802DCE00(ActorMarker *marker, Gfx **gdl, Mtx **mptr, Vtx **vptr){ return actor; } -void func_802DCF10(Actor *this){ +void chOverlayNoController_freeMethod(Actor *this){ D_8037DE90 = NULL; } -void func_802DCF20(Actor *this) { +void chOverlayNoController_update(Actor *this) { if (!this->initialized) { this->initialized = TRUE; this->depth_mode = MODEL_RENDER_DEPTH_NONE; actor_collisionOff(this); func_80328B8C(this, 1, 0.0f, 1); actor_playAnimationOnce(this); - func_803300D8(this->marker, func_802DCF10); + marker_setFreeMethod(this->marker, chOverlayNoController_freeMethod); } if (animctrl_isStopped(this->animctrl) != 0) { func_80328B8C(this, 2, 0.0f, 1); @@ -71,19 +71,19 @@ void func_802DCF20(Actor *this) { } } -void func_802DCFC4(void){ +void __chOverlayNoController_spawn(void){ if(D_8037DE90 == NULL){ - D_8037DE90 = func_8032813C(0x1df, D_80368168, 0)->marker; + D_8037DE90 = func_8032813C(ACTOR_1DF_NO_CONTROLLER_OVERLAY, D_80368168, 0)->marker; } } -void func_802DD008(s32 arg0, s32 arg1){ +void chOverlayNoController_spawn(s32 arg0, s32 arg1){ if(D_8037DE90 == NULL){ - __spawnQueue_add_0(func_802DCFC4); + __spawnQueue_add_0(__chOverlayNoController_spawn); } } -void func_802DD040(s32 arg0, s32 arg1) { +void chOverlayNoController_func_802DD040(s32 arg0, s32 arg1) { ActorMarker *temp_a0; temp_a0 = D_8037DE90; diff --git a/src/core2/code_55BC0.c b/src/core2/ch/overlaypressstart.c similarity index 68% rename from src/core2/code_55BC0.c rename to src/core2/ch/overlaypressstart.c index 05936c5f..f367f12c 100644 --- a/src/core2/code_55BC0.c +++ b/src/core2/ch/overlaypressstart.c @@ -8,8 +8,8 @@ extern void func_80325794(ActorMarker *); extern Actor *func_8032813C(enum actor_e id, f32[3], s32); -Actor *func_802DCB50(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); -void func_802DCC90(Actor *this); +Actor *chOverlayPressStart_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); +void chOverlayPressStart_update(Actor *this); /* .data */ @@ -22,9 +22,9 @@ ActorAnimationInfo D_80368100[] = { f32 D_80368118[3] = {0.0f, 0.0f, 0.0f}; ActorInfo D_80368124 = { - 0x177, 0x1DE, 0x55C, + MARKER_177_PRESS_START_OVERLAY, ACTOR_1DE_PRESS_START_OVERLAY, ASSET_55C_MODEL_PRESS_START_OVERLAY, 0x0, D_80368100, - func_802DCC90, func_80326224, func_802DCB50, + chOverlayPressStart_update, func_80326224, chOverlayPressStart_draw, 0, 0, 0.0f, 0 }; @@ -33,7 +33,7 @@ ActorMarker *D_8037DE80; bool D_8037DE84; /* .code */ -Actor *func_802DCB50(ActorMarker *marker, Gfx **gdl, Mtx **mptr, Vtx **vptr){ +Actor *chOverlayPressStart_draw(ActorMarker *marker, Gfx **gdl, Mtx **mptr, Vtx **vptr){ Actor * actor; f32 sp58[3]; f32 sp4C[3]; @@ -62,19 +62,19 @@ Actor *func_802DCB50(ActorMarker *marker, Gfx **gdl, Mtx **mptr, Vtx **vptr){ return actor; } -void func_802DCC78(ActorMarker *this){ +void chOverlayPressStart_func_802DCC78(ActorMarker *this){ D_8037DE80 = 0; D_8037DE84 = 0; } -void func_802DCC90(Actor *this){ +void chOverlayPressStart_update(Actor *this){ if(!this->initialized){ this->initialized = 1; this->depth_mode = MODEL_RENDER_DEPTH_NONE; actor_collisionOff(this); func_80328B8C(this, 1, 0.0f, 1); actor_playAnimationOnce(this); - func_803300D8(this->marker, func_802DCC78); + marker_setFreeMethod(this->marker, chOverlayPressStart_func_802DCC78); } if(animctrl_isStopped(this->animctrl)){ @@ -83,23 +83,23 @@ void func_802DCC90(Actor *this){ } } -void func_802DCD34(void){ +void __chOverlayPressStart_spawn(void){ if(D_8037DE80 == NULL){ - D_8037DE80 = func_8032813C(0x1de, D_80368118, 0)->marker; + D_8037DE80 = func_8032813C(ACTOR_1DE_PRESS_START_OVERLAY, D_80368118, 0)->marker; } } -void func_802DCD78(s32 arg0, s32 arg1){ +void chOverlayPressStart_spawn(s32 arg0, s32 arg1){ if(D_8037DE80 == NULL){ - __spawnQueue_add_0(func_802DCD34); + __spawnQueue_add_0(__chOverlayPressStart_spawn); } } -void func_802DCDB0(void){ +void chOverlayPressStart_func_802DCDB0(void){ D_8037DE84 = TRUE; } -void func_802DCDC0(s32 arg0, s32 arg1) { +void chOverlayPressStart_func_802DCDC0(s32 arg0, s32 arg1) { ActorMarker *temp_a0; temp_a0 = D_8037DE80; diff --git a/src/core2/code_34790.c b/src/core2/code_34790.c index 8b8b7c78..b759de5d 100644 --- a/src/core2/code_34790.c +++ b/src/core2/code_34790.c @@ -55,7 +55,7 @@ bool func_802BB720(s32 arg0, f32 arg1[3], f32 arg2[3], s32 *arg3) { if ((arg0 >= 0x5B) && (arg0 < 0x63)) { arg0 -= 0x40; } - temp_v0 = func_803049CC(D_803657E0[arg0], 0); + temp_v0 = cubeList_findNodePropByActorId(D_803657E0[arg0], 0); if (temp_v0 != NULL) { nodeprop_getPosition(temp_v0, arg1); *arg3 = func_80304DB8(temp_v0); diff --git a/src/core2/code_3480.c b/src/core2/code_3480.c index 6d6d0e10..a2d3b524 100644 --- a/src/core2/code_3480.c +++ b/src/core2/code_3480.c @@ -67,7 +67,7 @@ void func_8028A558(s32 arg0, s32 arg1, s32 arg2){ void func_8028A584(s32 arg0, s32 arg1, s32 arg2){ func_803219F4(3); - func_8034B9BC(func_802DE41C()); + func_8034B9BC(chBottlesBonus_getPuzzleIndex()); } //snacker_update_bottlesBonusPuzzle @@ -78,21 +78,21 @@ s32 func_8028A5C0(void){ if(gctransition_8030BDC0() || getGameMode() != GAME_MODE_3_NORMAL) return 0; - if(func_8034BB48() && func_802DE41C() != 7){ - func_80311480(0xe26 + (func_802DE41C() << 1), 6, &D_80363610, 0, 0, 0); + if(func_8034BB48() && chBottlesBonus_getPuzzleIndex() != 7){ + func_80311480(0xe26 + (chBottlesBonus_getPuzzleIndex() << 1), 6, &D_80363610, 0, 0, 0); } if(!func_8028F25C() && func_80321960() == 3) func_803219F4(1); if(miscflag_isTrue(0x17) && !func_8028F25C()){ if(func_8028A41C(183.0f, -100.0f, 75.0f)){ - if(func_802DE41C() == 6){ + if(chBottlesBonus_getPuzzleIndex() == 6){ if(!D_8037DCCC){ func_8028F94C(4, &D_80363610); func_80311480(0xe33, 0x6, &D_80363610, 0, func_8028A584, NULL); } }//L8028A70C - else if(func_802DE41C() == 7){ + else if(chBottlesBonus_getPuzzleIndex() == 7){ func_8028F94C(4, &D_80363610); func_80311480(0xe35, 0x6, &D_80363610, 0, func_8028A558, NULL); D_8037DCCC = 1; diff --git a/src/core2/code_39EF0.c b/src/core2/code_39EF0.c index e63bd5ae..c7198883 100644 --- a/src/core2/code_39EF0.c +++ b/src/core2/code_39EF0.c @@ -232,7 +232,7 @@ void func_802C16CC(s32 arg0) { if(sp38 != D_8037DBE0.unk28 && D_8037DBE0.unk28 != -1){ player_getPosition(sp54); ml_vec3f_to_vec3w(sp48, sp54); - sp30 = func_803049CC(sp38, sp48); + sp30 = cubeList_findNodePropByActorId(sp38, sp48); if(sp30 != NULL) { nodeprop_getPosition(sp30, sp54); switch (func_80304DB8(sp30)) { /* irregular */ diff --git a/src/core2/code_3ECE0.c b/src/core2/code_3ECE0.c index 55648631..dc759b71 100644 --- a/src/core2/code_3ECE0.c +++ b/src/core2/code_3ECE0.c @@ -54,7 +54,7 @@ void func_802C5DDC(Actor *this){ if(!this->initialized){ this->initialized = TRUE; marker_setCollisionScripts(this->marker, func_802C5DA0, NULL, NULL); - func_803300D8(this->marker, func_802C5D54); + marker_setFreeMethod(this->marker, func_802C5D54); func_802F32C4(func_8032994C(), this->position, 200.0f, this->marker, func_802C5C70); this->unk60 = 10.0f; } diff --git a/src/core2/code_41460.c b/src/core2/code_41460.c index 2f086cec..ba7b1705 100644 --- a/src/core2/code_41460.c +++ b/src/core2/code_41460.c @@ -184,7 +184,7 @@ Actor *func_802C8580(s32 position[3], s32 yaw, ActorInfo* actorInfo, u32 flags){ ml_vec3f_yaw_rotate_copy(&s0->unk30, &s0->unk30, randf2(15.0f, 90.0f) + f24); }//L802C8A08 actor->unk40 = s1; - func_803300D8(actor->marker, func_802C83F0); + marker_setFreeMethod(actor->marker, func_802C83F0); return actor; } diff --git a/src/core2/code_42CB0.c b/src/core2/code_42CB0.c index 9d543a8b..e30ab527 100644 --- a/src/core2/code_42CB0.c +++ b/src/core2/code_42CB0.c @@ -118,7 +118,7 @@ void func_802C9E70(Actor *this){ if( this->marker->unk14_20 == MARKER_55_HONEYCOMB && !this->unk44_2 ){ - func_803300D8(this->marker, func_802C9CF4); + marker_setFreeMethod(this->marker, func_802C9CF4); D_8037DDC8++; if(D_8037DDC4 == NULL){ D_8037DDC4 = (array(s32) *) array_new(sizeof(s32), 10); diff --git a/src/core2/code_47BD0.c b/src/core2/code_47BD0.c index 74d6866c..7cf792fe 100644 --- a/src/core2/code_47BD0.c +++ b/src/core2/code_47BD0.c @@ -356,7 +356,7 @@ void chBeeSwarm_update(Actor *this) { } if (!this->unk16C_4) { this->unk16C_4 = TRUE; - func_803300D8(this->marker, chBeeSwarm_802CEBA8); + marker_setFreeMethod(this->marker, chBeeSwarm_802CEBA8); actor_collisionOff(this); local->unk20 = assetcache_get(ASSET_3BF_MODEL_PLAYER_SHADOW); if (sp78 == 0) { diff --git a/src/core2/code_47C0.c b/src/core2/code_47C0.c index 2f4ad5c3..14ff6f69 100644 --- a/src/core2/code_47C0.c +++ b/src/core2/code_47C0.c @@ -157,7 +157,7 @@ void func_8028B9A8(s32 arg0){ s16 *tmp_v0; s32 ideal_yaw[3]; - tmp_v0 = func_803049CC(0x1F6, 0); + tmp_v0 = cubeList_findNodePropByActorId(0x1F6, 0); func_80304D4C(tmp_v0, &ideal_yaw); func_802CA1CC(arg0); func_8032811C(0x47, &ideal_yaw, 0); @@ -296,7 +296,7 @@ void func_8028BCA0(Prop *prop){ case 0xB5: //L8028BEF4 if(func_8028BC20(marker) != HITBOX_0_NONE) return; - if(func_802D8E68(prop)){ + if(chcollectable_collectRedFeather(prop)){ marker_despawn(marker); } break; @@ -305,7 +305,7 @@ void func_8028BCA0(Prop *prop){ if(func_8028BC20(marker)) return; - if(func_802D8EDC(prop)){ + if(chcollectable_collectGoldFeather(prop)){ marker_despawn(marker); } break; @@ -680,7 +680,7 @@ void func_8028BCA0(Prop *prop){ case 0x60: //L8028CCF0 if(func_8028BC20(marker)) return; - if(collect_egg(prop)){ + if(chcollectable_collectEgg(prop)){ marker_despawn(marker); } break; @@ -835,19 +835,19 @@ void func_8028BCA0(Prop *prop){ case 0x6D7: //L8028D16C if(!func_8028BC60()){ prop->spriteProp.unk8_4 = 0; - collect_egg(prop); + chcollectable_collectEgg(prop); } break; case 0x580: //L8028D194 if(!func_8028BC60()){ prop->spriteProp.unk8_4 = 0; - func_802D8E68(prop); + chcollectable_collectRedFeather(prop); } break; case 0x6D1: //L8028D1BC if(!func_8028BC60()){ prop->spriteProp.unk8_4 = 0; - func_802D8EDC(prop); + chcollectable_collectGoldFeather(prop); } break; default: diff --git a/src/core2/code_49A70.c b/src/core2/code_49A70.c index 666324c3..e93a7743 100644 --- a/src/core2/code_49A70.c +++ b/src/core2/code_49A70.c @@ -9,12 +9,8 @@ extern f32 func_80309B24(f32[3]); /* .h */ void chshrapnel_update(Actor *this); -typedef struct { - s32 unk0; -}ActorLocal_core2_49A70; - /* .data */ -ActorAnimationInfo D_803673C0[] = { +ActorAnimationInfo chShrapnelAnimations[] = { {0, 0.0f}, {0x1F4, 1.0f}, {0x1F4, 1.0f}, @@ -26,19 +22,19 @@ ActorAnimationInfo D_803673C0[] = { s32 D_803673F8[3] = {0xDE, 0xA7, 0x71}; -ActorInfo D_80367404 = { +ActorInfo chShrapnelDescription = { MARKER_65_SHRAPNEL, ACTOR_56_SHRAPNEL, ASSET_3EC_MODEL_SHRAPNEL, - 0x1, D_803673C0, + 0x1, chShrapnelAnimations, chshrapnel_update, func_80326224, func_80325888, 2500, 0x333, 0.0f, 0 }; /* .code */ -void func_802D0A00(Actor *this) { +void chShrapnel_func_802D0A00(Actor *this) { this->unk28 = randf2(1.5f, 2.3f); } -void func_802D0A38(Actor *this){ +void chShrapnel_func_802D0A38(Actor *this){ if(this->unk38_31 != 0){ this->unk38_31--; } @@ -50,19 +46,19 @@ void func_802D0A38(Actor *this){ } } -void func_802D0AB8(Actor *this) { +void chShrapnel_func_802D0AB8(Actor *this) { func_80328B8C(this, 1, 0.0f, 0); - func_802D0A00(this); + chShrapnel_func_802D0A00(this); func_80328CEC(this, (s32) this->yaw_ideal, 0x87, 0xAF); this->unk38_31 = 0x1E; } -void func_802D0B24(s32 arg0){ +void chShrapnel_spawnExplodeActor(s32 arg0){ Actor *this = reinterpret_cast(Actor *, arg0); func_8032813C(0xF3, this->unk1C, 0); } -void func_802D0B54(Actor *this) { +void chShrapnel_emitExplosion(Actor *this) { ParticleEmitter *temp_v0; func_802BB3DC(0, 60.0f, 0.9f); @@ -81,8 +77,7 @@ void func_802D0B54(Actor *this) { particleEmitter_emitN(temp_v0, 1); } - -void func_802D0CB4(Actor *this) { +void chShrapnel_emitSmoke(Actor *this) { ParticleEmitter *temp_v0; temp_v0 = partEmitList_pushNew(6U); @@ -99,7 +94,7 @@ void func_802D0CB4(Actor *this) { particleEmitter_emitN(temp_v0, 6); } -void func_802D0DDC(Actor *this, enum model_e model_id, s32 n) { +void chShrapnel_emitBodyParts(Actor *this, enum model_e model_id, s32 n) { ParticleEmitter *temp_v0; temp_v0 = partEmitList_pushNew(n); @@ -116,30 +111,30 @@ void func_802D0DDC(Actor *this, enum model_e model_id, s32 n) { particleEmitter_emitN(temp_v0, n); } -void func_802D0F30(ActorMarker *marker, ActorMarker *other_marker) { +void chShrapnel_explode(ActorMarker *marker, ActorMarker *other_marker) { Actor *this; this = marker_getActor(marker); FUNC_8030E8B4(SFX_1B_EXPLOSION_1, 1.0f, 32736, this->position, 1250, 2500); - __spawnQueue_add_1((GenMethod_1)func_802D0B24, reinterpret_cast(s32, this)); - func_802D0B54(this); - func_802D0CB4(this); - func_802D0DDC(this, ASSET_53A_MODEL_SHRAPNAL_PIECE_EYE, 2); - func_802D0DDC(this, ASSET_53B_MODEL_SHRAPNAL_PIECE_SPIKE, 8); - func_802D0DDC(this, ASSET_53C_MODEL_SHRAPNAL_PIECE_PLATE, 8); + __spawnQueue_add_1((GenMethod_1)chShrapnel_spawnExplodeActor, reinterpret_cast(s32, this)); + chShrapnel_emitExplosion(this); + chShrapnel_emitSmoke(this); + chShrapnel_emitBodyParts(this, ASSET_53A_MODEL_SHRAPNAL_PIECE_EYE, 2); + chShrapnel_emitBodyParts(this, ASSET_53B_MODEL_SHRAPNAL_PIECE_SPIKE, 8); + chShrapnel_emitBodyParts(this, ASSET_53C_MODEL_SHRAPNAL_PIECE_PLATE, 8); marker_despawn(marker); } -void func_802D0FC8(Actor *this) { +void chShrapnel_func_802D0FC8(Actor *this) { this->unk4C += time_getDelta(); if (MAX(0.25, (12.0 - this->unk28) / 12.0) < this->unk4C) { *(s32 *)(&this->local) = NOT(*(s32 *)(&this->local)); this->unk4C = 0.0f; if (*(s32 *)(&this->local)) { - FUNC_8030E8B4(SFX_2A_CLOCK_TIC_1, 0.5f, 12000, this->position, 0x4E2, 0x9C4); + FUNC_8030E8B4(SFX_2A_CLOCK_TIC_1, 0.5f, 12000, this->position, 1250, 2500); } else{ - FUNC_8030E8B4(SFX_51_CLOCK_TIC_2, 0.5f, 12000, this->position, 0x4E2, 0x9C4); + FUNC_8030E8B4(SFX_51_CLOCK_TIC_2, 0.5f, 12000, this->position, 1250, 2500); } } } @@ -150,12 +145,12 @@ void chshrapnel_update(Actor *this) { tick = time_getDelta(); if (!this->initialized) { - marker_setCollisionScripts(this->marker, NULL, NULL, func_802D0F30); + marker_setCollisionScripts(this->marker, NULL, NULL, chShrapnel_explode); this->unk138_25 = TRUE; this->initialized = TRUE; this->unk4C = 0.0f; } - func_802D0FC8(this); + chShrapnel_func_802D0FC8(this); this->unk60 += tick; if (M_PI <= this->unk60) { this->unk60 -= M_PI; @@ -168,7 +163,7 @@ void chshrapnel_update(Actor *this) { _player_getPosition(player_position); switch (this->state) { case 1: - func_802D0A38(this); + chShrapnel_func_802D0A38(this); break; case 2: @@ -189,7 +184,7 @@ void chshrapnel_update(Actor *this) { func_80328FB0(this, this->unk28 / 2); this->unk28 = MIN( 50.0, (this->unk28 + tick)); if ((250.0 <= ABS(player_position[1] - this->unk1C[1])) || !func_80329054(this, 0)) { - func_802D0AB8(this); + chShrapnel_func_802D0AB8(this); } break; diff --git a/src/core2/code_4A6F0.c b/src/core2/code_4A6F0.c index ce2dd1d3..48876497 100644 --- a/src/core2/code_4A6F0.c +++ b/src/core2/code_4A6F0.c @@ -8,8 +8,8 @@ extern void func_803255FC(Actor *); extern void func_80325760(Actor *); -Actor *func_802D2964(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); -void func_802D1CF0(Actor *this); +Actor *chMumbo_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); +void chMumbo_update(Actor *this); /* .data */ ActorAnimationInfo D_80367490[] = { @@ -28,7 +28,7 @@ ActorAnimationInfo D_80367490[] = { ActorInfo D_803674E0 = { 0x6, 0x7, 0x3C6, 0x1, D_80367490, - func_802D1CF0, func_80326224, func_802D2964, + chMumbo_update, func_80326224, chMumbo_draw, 0, 0, 0.0f, 0 }; s32 D_80367504[3] = {0.0f, 0.0f, 0.0f}; @@ -42,39 +42,39 @@ u8 D_8037DDF2; u8 D_8037DDF3; /* .code */ -s32 func_802D1680(s32 arg0) { +static bool __chMumbo_actorExists(enum actor_e actorId) { f32 var[3]; - if (func_80304E24(arg0, var) != 0) { - return 1; + if (nodeProp_findPositionFromActorId(actorId, var) != 0) { + return TRUE; } - return 0; + return FALSE; } -s32 func_802D16AC(void) { - s32 ret = 2; +enum transformation_e func_802D16AC(void) { + s32 ret = TRANSFORM_2_TERMITE; - func_802D1680(0x1F); - if (func_802D1680(0x20) != 0) { - ret = 3; + __chMumbo_actorExists(0x1F); + if (__chMumbo_actorExists(0x20)) { + ret = TRANSFORM_3_PUMPKIN; } - if (func_802D1680(0x21) != 0) { - ret = 5; + if (__chMumbo_actorExists(0x21)) { + ret = TRANSFORM_5_CROC; } - if (func_802D1680(0x22) != 0) { - ret = 4; + if (__chMumbo_actorExists(0x22)) { + ret = TRANSFORM_4_WALRUS; } - if (func_802D1680(0x23) != 0) { - ret = 6; + if (__chMumbo_actorExists(0x23)) { + ret = TRANSFORM_6_BEE; } return ret; } -void func_802D1724(void){ +void chmumbo_func_802D1724(void){ D_8037DDF0 = func_802D16AC(); } -s32 func_802D1748(enum transformation_e trans_id){ +static s32 __transformation_getCost(enum transformation_e trans_id){ switch(trans_id){ case TRANSFORM_2_TERMITE: return 5; @@ -91,39 +91,39 @@ s32 func_802D1748(enum transformation_e trans_id){ } -enum bkprog_e func_802D17A0(enum transformation_e trans_id){ +static enum bkprog_e __bkProgId_from_transformationId(enum transformation_e trans_id){ return (trans_id - TRANSFORM_2_TERMITE) + BKPROG_90_PAID_TERMITE_COST; } -bool func_802D17A8(s32 x, s32 z, s32 dist) { - s32 sp1C[3]; +bool chMumbo_withinHorzDistToPlayer(s32 x, s32 z, s32 dist) { + s32 player_position[3]; - func_8028EB3C(sp1C); - return (x - sp1C[0]) * (x - sp1C[0]) + (z - sp1C[2]) * (z - sp1C[2]) < dist * dist; + player_getPosition_s32(player_position); + return (x - player_position[0]) * (x - player_position[0]) + (z - player_position[2]) * (z - player_position[2]) < dist * dist; } -bool func_802D181C(s32 arg0) { - s32 sp1C[3] = D_80367504; - return (func_803049CC(arg0, sp1C))? TRUE : FALSE; +bool chMumbo_func_802D181C(s32 arg0) { + s32 search_start_cube[3] = D_80367504; + return (cubeList_findNodePropByActorId(arg0, search_start_cube))? TRUE : FALSE; } -void func_802D186C(Actor *this) { +void chMumbo_func_802D186C(Actor *this) { if (this->unk44_31 == 0) { this->unk44_31 = func_8030ED2C(SFX_5F_MUMBO_BUGABUGOW_MUFFLED, 3); sfxsource_setSampleRate(this->unk44_31, 0x7FFF); } } -void func_802D18B4(Actor *this) { - s32 phi_v0; +void chMumbo_func_802D18B4(Actor *this) { + bool player_is_within_range; if (map_get() == MAP_7A_GL_CRYPT) { - phi_v0 = func_802D17A8(1107, 0, 188); + player_is_within_range = chMumbo_withinHorzDistToPlayer(1107, 0, 188); } else { - phi_v0 = func_802D17A8(0, -107, 188); + player_is_within_range = chMumbo_withinHorzDistToPlayer(0, -107, 188); } - if(phi_v0 || func_803203FC(1) || func_803203FC(UNKFLAGS1_1F_IN_CHARACTER_PARADE)){ + if(player_is_within_range || func_803203FC(1) || func_803203FC(UNKFLAGS1_1F_IN_CHARACTER_PARADE)){ func_80328AC8(this, 2); if( !func_8031FF1C(BKPROG_11_HAS_MET_MUMBO) || (!func_8031FF1C(BKPROG_DC_HAS_HAD_ENOUGH_TOKENS_BEFORE) && this->unk38_0) @@ -133,19 +133,18 @@ void func_802D18B4(Actor *this) { } } - -void func_802D1970(Actor *this){ +void chMumbo_func_802D1970(Actor *this){ actor_loopAnimation(this); - func_802D18B4(this); + chMumbo_func_802D18B4(this); } -void func_802D1998(ActorMarker *caller, enum asset_e text_id, s32 arg2){ +static void __chMumbo_textCallback(ActorMarker *caller, enum asset_e text_id, s32 arg2){ Actor *this; this = marker_getActor(caller); switch(text_id){ case 0xD8F: //L802D1A04 - func_80311480((this->unk38_0) ? 0xDAA : 0xDAB, 0xe, this->position, this->marker, func_802D1998, NULL); + func_80311480((this->unk38_0) ? 0xDAA : 0xDAB, 0xe, this->position, this->marker, __chMumbo_textCallback, NULL); return; case 0xd90: //L802D1A40 @@ -191,18 +190,18 @@ void func_802D1998(ActorMarker *caller, enum asset_e text_id, s32 arg2){ func_80328A84(this, 4); } -void func_802D1B8C(Actor *this, enum transformation_e transform_id) { +void chMumbo_func_802D1B8C(Actor *this, enum transformation_e transform_id) { if (this->unk10_12 != 0) { - func_80311480(func_8031FF44(BK_PROG_BB_MUMBO_MISTAKE_INDEX, 2) + 0xDAF, 0xE, this->position, this->marker, func_802D1998, NULL); + func_80311480(func_8031FF44(BK_PROG_BB_MUMBO_MISTAKE_INDEX, 2) + 0xDAF, 0xE, this->position, this->marker, __chMumbo_textCallback, NULL); return; } if (func_8031FF1C(BKPROG_12_HAS_TRANSFORMED_BEFORE)) { if (this->velocity[0] == 0.0f) { - func_80311480(transform_id + 0xD8F, 6, this->position, this->marker, func_802D1998, NULL); + func_80311480(transform_id + 0xD8F, 6, this->position, this->marker, __chMumbo_textCallback, NULL); return; } if (map_get() == MAP_7A_GL_CRYPT && transform_id == TRANSFORM_3_PUMPKIN && !func_8031FF1C(BKPROG_F7_HAS_TRANSFORMED_IN_CRYPT)) { - func_80311480(0xDAD, 6, this->position, this->marker, func_802D1998, NULL); + func_80311480(0xDAD, 6, this->position, this->marker, __chMumbo_textCallback, NULL); func_80320004(BKPROG_F7_HAS_TRANSFORMED_IN_CRYPT, TRUE); return; } @@ -210,11 +209,11 @@ void func_802D1B8C(Actor *this, enum transformation_e transform_id) { func_80328A84(this, 4U); return; } - func_80311480(0xD90, 0xE, this->position, this->marker, func_802D1998, NULL); + func_80311480(0xD90, 0xE, this->position, this->marker, __chMumbo_textCallback, NULL); } -void func_802D1CF0(Actor *this) { - s32 sp58[6]; +void chMumbo_update(Actor *this) { + s32 face_buttons[6]; f32 sp4C[3]; bool sp48; bool sp44; @@ -231,10 +230,10 @@ void func_802D1CF0(Actor *this) { this->initialized = TRUE; this->marker->propPtr->unk8_3 = FALSE; this->unk60 = 0.0f; - if (func_802D181C(0x201)) { + if (chMumbo_func_802D181C(0x201)) { this->unk60 = 1.0f; func_80328A84(this, 7U); - } else if (func_802D181C(0x202)) { + } else if (chMumbo_func_802D181C(0x202)) { this->unk60 = 2.0f; func_80328A84(this, 8U); } @@ -243,10 +242,10 @@ void func_802D1CF0(Actor *this) { if(!this->unk16C_4){ this->unk38_31 = 0; if( player_getTransformation() == TRANSFORM_1_BANJO - && !func_8031FF1C(func_802D17A0(D_8037DDF0)) + && !func_8031FF1C(__bkProgId_from_transformationId(D_8037DDF0)) && (map_get() != MAP_7A_GL_CRYPT) ){ - this->unk38_31 = func_802D1748(D_8037DDF0); + this->unk38_31 = __transformation_getCost(D_8037DDF0); } this->unk38_0 = (item_getCount(ITEM_1C_MUMBO_TOKEN) >= this->unk38_31); this->unk10_12 = 0; @@ -262,14 +261,14 @@ void func_802D1CF0(Actor *this) { switch(this->state){ case 1: //L802D1F2C this->unk130 = func_80325760; - func_802D186C(this); + chMumbo_func_802D186C(this); if (actor_animationIsAt(this, 0.1f) != 0) { FUNC_8030E624(SFX_5D_BANJO_RAAOWW, 1.0f, 6000); } if (actor_animationIsAt(this, 0.4f) != 0) { FUNC_8030E624(SFX_5E_BANJO_PHEWWW, 1.0f, 6000); } - func_802D1970(this); + chMumbo_func_802D1970(this); break; case 2: //L802D1F90 @@ -283,7 +282,7 @@ void func_802D1CF0(Actor *this) { && !func_803203FC(UNKFLAGS1_1F_IN_CHARACTER_PARADE) ) { func_80328A84(this, 3); - func_80311480(0xD8F, 0xE, this->position, this->marker, func_802D1998, NULL); + func_80311480(0xD8F, 0xE, this->position, this->marker, __chMumbo_textCallback, NULL); func_80320004(BKPROG_11_HAS_MET_MUMBO, TRUE); break; } @@ -294,7 +293,7 @@ void func_802D1CF0(Actor *this) { && this->unk38_0 ){ func_80328A84(this, 3); - func_80311480(0xDAA, 0xE, this->position, this->marker, func_802D1998, NULL); + func_80311480(0xDAA, 0xE, this->position, this->marker, __chMumbo_textCallback, NULL); func_80320004(BKPROG_DC_HAS_HAD_ENOUGH_TOKENS_BEFORE, TRUE); break; } @@ -309,18 +308,18 @@ void func_802D1CF0(Actor *this) { case 4: //L802D20E4 actor_loopAnimation(this); - sp48 = (map_get() == MAP_7A_GL_CRYPT) ? func_802D17A8(0x442, 0, 0x3C) : func_802D17A8(0, -0x5A, 0x3C); + sp48 = (map_get() == MAP_7A_GL_CRYPT) ? chMumbo_withinHorzDistToPlayer(0x442, 0, 0x3C) : chMumbo_withinHorzDistToPlayer(0, -0x5A, 0x3C); if( sp48 && func_8028ECAC() == 0 && func_8028F20C() && func_8028EFC8() ){ - func_8024E55C(0, &sp58); - if(sp58[FACE_BUTTON(BUTTON_B)] == 1){ + func_8024E55C(0, face_buttons); + if(face_buttons[FACE_BUTTON(BUTTON_B)] == 1){ if (D_8037DDF0 == TRANSFORM_7_WISHWASHY) { this->unk38_31 = 0; - } else if (player_getTransformation() == TRANSFORM_1_BANJO && !func_8031FF1C(func_802D17A0(D_8037DDF0)) && map_get() != MAP_7A_GL_CRYPT){ - this->unk38_31 = func_802D1748(D_8037DDF0); + } else if (player_getTransformation() == TRANSFORM_1_BANJO && !func_8031FF1C(__bkProgId_from_transformationId(D_8037DDF0)) && map_get() != MAP_7A_GL_CRYPT){ + this->unk38_31 = __transformation_getCost(D_8037DDF0); } this->unk38_0 = (D_8037DDF0 == TRANSFORM_7_WISHWASHY) || (item_getCount(ITEM_1C_MUMBO_TOKEN) >= this->unk38_31); if (this->unk38_0) { @@ -332,7 +331,7 @@ void func_802D1CF0(Actor *this) { && randf() < 0.01 && sp48 ) { - func_80311480(0xDAE, 6, NULL, this->marker, func_802D1998, NULL); + func_80311480(0xDAE, 6, NULL, this->marker, __chMumbo_textCallback, NULL); func_80320004(0xBA, 1); this->unk138_24 = TRUE; func_80328A84(this, 3); @@ -394,7 +393,7 @@ void func_802D1CF0(Actor *this) { func_8028FB88(TRANSFORM_1_BANJO); } else if (func_8028FB88(D_8037DDF0)) { if (D_8037DDF0 != TRANSFORM_7_WISHWASHY) { - if (func_8031FF74(func_802D17A0(D_8037DDF0), TRUE)) { + if (func_8031FF74(__bkProgId_from_transformationId(D_8037DDF0), TRUE)) { this->velocity[0] = 1.0f; } this->unk38_31 = 0; @@ -411,15 +410,15 @@ void func_802D1CF0(Actor *this) { if (!this->unk138_24) { func_8028F918(0); } - func_8025A7DC(0x1D); + func_8025A7DC(COMUSIC_1D_MUMBO_TRANSFORMATION); if (player_getTransformation() != TRANSFORM_1_BANJO) { func_80328A84(this, 3); - func_802D1B8C(this, D_8037DDF0); + chMumbo_func_802D1B8C(this, D_8037DDF0); break; } if (this->unk138_24) { func_80328A84(this, 3); - func_80311480(0xDAF, 6, NULL, this->marker, func_802D1998, NULL); + func_80311480(0xDAF, 6, NULL, this->marker, __chMumbo_textCallback, NULL); break; } gcpausemenu_80314AC8(1); @@ -428,12 +427,12 @@ void func_802D1CF0(Actor *this) { break; case 7: //L802D2704 - func_802D186C(this); + chMumbo_func_802D186C(this); if (func_803203FC(BKPROG_11_HAS_MET_MUMBO) == 0) { if (map_get() == MAP_7A_GL_CRYPT) { - sp48 = func_802D17A8(0x453, 0, 0xBC); + sp48 = chMumbo_withinHorzDistToPlayer(0x453, 0, 0xBC); } else { - sp48 = func_802D17A8(0, -0x6B, 0xBC); + sp48 = chMumbo_withinHorzDistToPlayer(0, -0x6B, 0xBC); } if (sp48 != 0) { func_80311480(0xDA7, 7, NULL, NULL, NULL, NULL); @@ -444,12 +443,12 @@ void func_802D1CF0(Actor *this) { break; case 8: //L802D2790 - func_802D186C(this); + chMumbo_func_802D186C(this); if (func_803203FC(BKPROG_12_HAS_TRANSFORMED_BEFORE) == 0) { if (map_get() == MAP_7A_GL_CRYPT) { - sp48 = func_802D17A8(0x453, 0, 0xBC); + sp48 = chMumbo_withinHorzDistToPlayer(0x453, 0, 0xBC); } else { - sp48 = func_802D17A8(0, -0x6B, 0xBC); + sp48 = chMumbo_withinHorzDistToPlayer(0, -0x6B, 0xBC); } if (sp48 != 0) { func_80311480(0xDA8, 7, NULL, NULL, NULL, NULL); @@ -478,7 +477,7 @@ void func_802D1CF0(Actor *this) { } } -Actor *func_802D2964(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx) { +Actor *chMumbo_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx) { Actor *this = marker_getActor(marker); Actor *out; f32 sp44[3]; @@ -503,7 +502,7 @@ Actor *func_802D2964(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx) { return out; } -void func_802D2B94(s32 this, s32 gfx){ +void func_802D2B94(s32 this, s32 arg1){ s32 xform; xform = player_getTransformation(); if(xform == TRANSFORM_1_BANJO || xform == TRANSFORM_7_WISHWASHY || D_8037DDF2) @@ -516,7 +515,7 @@ void func_802D2B94(s32 this, s32 gfx){ func_80311480(func_8031FF74(BKPROG_83_MAGIC_GET_WEAK_TEXT, TRUE) ? 0xf5C: 0xf5b, 0xe, NULL, NULL, NULL, NULL); } -void func_802D2C24(s32 this, s32 gfx){ +void func_802D2C24(s32 this, s32 arg1){ s32 xform; xform = player_getTransformation(); if(xform == TRANSFORM_1_BANJO || xform == TRANSFORM_7_WISHWASHY || D_8037DDF1) diff --git a/src/core2/code_4BD70.c b/src/core2/code_4BD70.c index 1ae889f0..29d10e56 100644 --- a/src/core2/code_4BD70.c +++ b/src/core2/code_4BD70.c @@ -2,16 +2,16 @@ #include "functions.h" #include "variables.h" -void func_802D2D00(Actor *this); +void chMumboSign_update(Actor *this); /* .data */ -ActorInfo D_80367530 = { MARKER_1E9_MUMBO_COST_SIGN, ACTOR_368_5_MUMBO_TOKEN_SIGN, ASSET_301_MODEL_5_MUMBO_TOKEN_SIGN, 0x0, 0x0, func_802D2D00, func_80326224, func_80325888, 0, 0, 0.0f, 0}; -ActorInfo D_80367554 = { MARKER_1E9_MUMBO_COST_SIGN, ACTOR_36B_10_MUMBO_TOKEN_SIGN, ASSET_302_MODEL_10_MUMBO_TOKEN_SIGN, 0x0, 0x0, func_802D2D00, func_80326224, func_80325888, 0, 0, 0.0f, 0}; -ActorInfo D_80367578 = { MARKER_1E9_MUMBO_COST_SIGN, ACTOR_36A_15_MUMBO_TOKEN_SIGN, ASSET_303_MODEL_15_MUMBO_TOKEN_SIGN, 0x0, 0x0, func_802D2D00, func_80326224, func_80325888, 0, 0, 0.0f, 0}; -ActorInfo D_8036759C = { MARKER_1E9_MUMBO_COST_SIGN, ACTOR_369_20_MUMBO_TOKEN_SIGN, ASSET_304_MODEL_20_MUMBO_TOKEN_SIGN, 0x0, 0x0, func_802D2D00, func_80326224, func_80325888, 0, 0, 0.0f, 0}; -ActorInfo D_803675C0 = { MARKER_1E9_MUMBO_COST_SIGN, ACTOR_36C_25_MUMBO_TOKEN_SIGN, ASSET_305_MODEL_25_MUMBO_TOKEN_SIGN, 0x0, 0x0, func_802D2D00, func_80326224, func_80325888, 0, 0, 0.0f, 0}; +ActorInfo D_80367530 = { MARKER_1E9_MUMBO_COST_SIGN, ACTOR_368_5_MUMBO_TOKEN_SIGN, ASSET_301_MODEL_5_MUMBO_TOKEN_SIGN, 0x0, 0x0, chMumboSign_update, func_80326224, func_80325888, 0, 0, 0.0f, 0}; +ActorInfo D_80367554 = { MARKER_1E9_MUMBO_COST_SIGN, ACTOR_36B_10_MUMBO_TOKEN_SIGN, ASSET_302_MODEL_10_MUMBO_TOKEN_SIGN, 0x0, 0x0, chMumboSign_update, func_80326224, func_80325888, 0, 0, 0.0f, 0}; +ActorInfo D_80367578 = { MARKER_1E9_MUMBO_COST_SIGN, ACTOR_36A_15_MUMBO_TOKEN_SIGN, ASSET_303_MODEL_15_MUMBO_TOKEN_SIGN, 0x0, 0x0, chMumboSign_update, func_80326224, func_80325888, 0, 0, 0.0f, 0}; +ActorInfo D_8036759C = { MARKER_1E9_MUMBO_COST_SIGN, ACTOR_369_20_MUMBO_TOKEN_SIGN, ASSET_304_MODEL_20_MUMBO_TOKEN_SIGN, 0x0, 0x0, chMumboSign_update, func_80326224, func_80325888, 0, 0, 0.0f, 0}; +ActorInfo D_803675C0 = { MARKER_1E9_MUMBO_COST_SIGN, ACTOR_36C_25_MUMBO_TOKEN_SIGN, ASSET_305_MODEL_25_MUMBO_TOKEN_SIGN, 0x0, 0x0, chMumboSign_update, func_80326224, func_80325888, 0, 0, 0.0f, 0}; -void func_802D2D00(Actor *this) { +void chMumboSign_update(Actor *this) { if (!this->unk16C_4) { if( func_8031FF1C(this->modelCacheIndex - ACTOR_368_5_MUMBO_TOKEN_SIGN + BKPROG_90_PAID_TERMITE_COST) || func_803203FC(UNKFLAGS1_1F_IN_CHARACTER_PARADE) diff --git a/src/core2/code_4C020.c b/src/core2/code_4C020.c index 01cd2d97..6a813bab 100644 --- a/src/core2/code_4C020.c +++ b/src/core2/code_4C020.c @@ -712,7 +712,7 @@ void func_802D4D3C(enum actor_e arg0, enum actor_e arg1) { s32 sp4C[4]; f32 sp40[3]; - if (func_80304E24(arg1, sp5C)) { + if (nodeProp_findPositionFromActorId(arg1, sp5C)) { func_803331D8(arg0, sp5C); func_8025A6EC(COMUSIC_3D_JIGGY_SPAWN, 0x7FFF); if (arg0 == 0x36) { diff --git a/src/core2/code_50490.c b/src/core2/code_50490.c index cbe76148..90377607 100644 --- a/src/core2/code_50490.c +++ b/src/core2/code_50490.c @@ -95,7 +95,7 @@ Actor * func_802D7610(s32 *arg0, s32 arg1, ActorInfo *arg2, u32 arg3) { void func_802D766C(Actor *this) { ActorLocal_core2_50490 * local = (ActorLocal_core2_50490 *)&this->local; if (!this->initialized) { - func_803300D8(this->marker, func_802D7420); + marker_setFreeMethod(this->marker, func_802D7420); this->initialized = TRUE; } if (func_802EE5F0(local->unk0) == 0) { diff --git a/src/core2/code_55390.c b/src/core2/code_55390.c index 71863dd6..d4a59c9f 100644 --- a/src/core2/code_55390.c +++ b/src/core2/code_55390.c @@ -67,7 +67,7 @@ void func_802DC45C(Actor *this){ this->depth_mode = MODEL_RENDER_DEPTH_NONE; func_803262E4(this); actor_collisionOff(this); - func_803300D8(this->marker, func_802DC430); + marker_setFreeMethod(this->marker, func_802DC430); } } diff --git a/src/core2/code_556C0.c b/src/core2/code_556C0.c index e2c7c0be..b2e590a2 100644 --- a/src/core2/code_556C0.c +++ b/src/core2/code_556C0.c @@ -30,7 +30,7 @@ void func_802DC67C(Actor *this){ this->depth_mode = MODEL_RENDER_DEPTH_NONE; func_803262E4(this); actor_collisionOff(this); - func_803300D8(this->marker, func_802DC650); + marker_setFreeMethod(this->marker, func_802DC650); } } diff --git a/src/core2/code_55850.c b/src/core2/code_55850.c index 231b6897..c060e638 100644 --- a/src/core2/code_55850.c +++ b/src/core2/code_55850.c @@ -62,7 +62,7 @@ void func_802DC900(Actor *this){ this->initialized = TRUE; this->depth_mode = MODEL_RENDER_DEPTH_NONE; actor_collisionOff(this); - func_803300D8(this->marker, func_802DC8F0); + marker_setFreeMethod(this->marker, func_802DC8F0); } } diff --git a/src/core2/code_55A90.c b/src/core2/code_55A90.c deleted file mode 100644 index 5e727325..00000000 --- a/src/core2/code_55A90.c +++ /dev/null @@ -1,55 +0,0 @@ -#include -#include "functions.h" -#include "variables.h" - -void func_802DCA30(Actor *this); - -/* .data */ -f32 D_803680D0[3] = {0.0f, 0.0f, 0.0f}; -ActorInfo D_803680DC = { - 0x176, 0x1DD, 0x54E, - 0x1, NULL, - func_802DCA30, func_80326224, func_802DC7E0, - 0, 0, 0.0f, 0 -}; - -/* .bss */ -ActorMarker *D_8037DE70; - -/* .code */ -void func_802DCA20(Actor *this){ - D_8037DE70 = NULL; -} - -void func_802DCA30(Actor *this){ - if(!this->initialized){ - this->initialized = TRUE; - this->depth_mode = MODEL_RENDER_DEPTH_NONE; - actor_collisionOff(this); - func_803300D8(this->marker, func_802DCA20); - } -} - - -void func_802DCA90(void) { - Actor *actor; - if (D_8037DE70 == 0) { - actor = func_8032813C(0x1DD, D_803680D0, 0); - D_8037DE70 = actor->marker; - } -} - -void func_802DCAD4(s32 arg0, s32 arg1){ - if(D_8037DE70 == NULL){ - __spawnQueue_add_0(func_802DCA90); - } -} - -void func_802DCB0C(s32 arg0, s32 arg1) { - ActorMarker *temp_a0; - - temp_a0 = D_8037DE70; - if (temp_a0 != 0) { - func_80326310(marker_getActor(temp_a0)); - } -} diff --git a/src/core2/code_57C70.c b/src/core2/code_57C70.c index 0e2958ea..9d839a2e 100644 --- a/src/core2/code_57C70.c +++ b/src/core2/code_57C70.c @@ -3,7 +3,7 @@ #include "variables.h" extern void func_80325794(ActorMarker *); -extern void func_802DD080(Gfx **, Mtx **); +extern void chBottlesBonus_func_802DD080(Gfx **, Mtx **); extern void func_80311714(s32); Actor *func_802DEC00(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); @@ -48,7 +48,7 @@ Actor *func_802DEC00(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ if ((sp48 == 0) || (getGameMode() != GAME_MODE_A_SNS_PICTURE)) return this; - func_802DD080(gfx, mtx); + chBottlesBonus_func_802DD080(gfx, mtx); sp58[0] = 0.0f; sp58[1] = 0.0f; sp58[2] = 50.0f; @@ -70,7 +70,7 @@ Actor *func_802DEC00(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ modelRender_draw(gfx, mtx, this->position, NULL, 4.5f, sp4C, func_80330B1C(marker)); gDPSetTextureFilter((*gfx)++, G_TF_BILERP); gDPSetColorDither((*gfx)++, G_CD_MAGICSQ); - func_802DD158(gfx, mtx); + chBottlesBonus_func_802DD158(gfx, mtx); return this; } @@ -92,7 +92,7 @@ void func_802DEE1C(Actor *this) { if (!this->initialized) { this->initialized = TRUE; actor_collisionOff(this); - func_803300D8(this->marker, func_802DEDDC); + marker_setFreeMethod(this->marker, func_802DEDDC); actor_playAnimationOnce(this); if (D_8037DFE8 == NULL) { D_8037DFE8 = assetcache_get(0x56E); diff --git a/src/core2/code_581D0.c b/src/core2/code_581D0.c index 138cdede..19cff21e 100644 --- a/src/core2/code_581D0.c +++ b/src/core2/code_581D0.c @@ -58,14 +58,14 @@ void func_802DF2C4(Actor *this) { s32 val; - temp_fp = func_802E06B4() - 0x15; + temp_fp = chBottlesBonusCursor_func_802E06B4() - 0x15; if (!this->initialized) { this->initialized = TRUE; actor_collisionOff(this); for(i = 0; i < 20; i++){ func_8034DFB0(func_8034C2C4(this->marker, i + 0x190), D_8036837C, D_8036836C, 0.0f); } - func_803300D8(this->marker, func_802DF2B4); + marker_setFreeMethod(this->marker, func_802DF2B4); } for( i = 0; i < 20; i++){ prev_val = D_8037E008[i]; diff --git a/src/core2/code_59A80.c b/src/core2/code_59A80.c index fc3768fa..fc4847b8 100644 --- a/src/core2/code_59A80.c +++ b/src/core2/code_59A80.c @@ -23,7 +23,7 @@ s32 func_802E0CB0(Actor *this); s32 D_8037E610; /* .code */ -void func_802E0A10(ActorMarker *marker, ActorMarker *other_marker){ +void chMumboToken_collect(ActorMarker *marker, ActorMarker *other_marker){ Actor *this; this = marker_getActor(marker); @@ -79,7 +79,7 @@ void func_802E0B10(Actor *this){ }//L802E0BD4 if(!func_8032BBE8(this)){ - marker_setCollisionScripts(this->marker, func_802E0A10, NULL, NULL); + marker_setCollisionScripts(this->marker, chMumboToken_collect, NULL, NULL); } if(this->marker->unk14_21 && randf() < 0.1){ diff --git a/src/core2/code_59D40.c b/src/core2/code_59D40.c index 85c80fd2..41766497 100644 --- a/src/core2/code_59D40.c +++ b/src/core2/code_59D40.c @@ -348,7 +348,7 @@ void func_802E17E8(void) { local->unk0 = 0; local->unk4 = 0; local->unk8 = 0.0f; - func_803300D8(D_8037E620, func_802E0FC4); + marker_setFreeMethod(D_8037E620, func_802E0FC4); if (func_8032CA80(snacker, D_8037E62C ? 0x10 : 0xC)) { marker_despawn(D_8037E620); return; diff --git a/src/core2/code_5B6A0.c b/src/core2/code_5B6A0.c index 0cb32382..7c1e180f 100644 --- a/src/core2/code_5B6A0.c +++ b/src/core2/code_5B6A0.c @@ -16,7 +16,7 @@ void func_802E28D0(Actor *this); /* .data */ ActorInfo D_80368710 = { - 0xB2, 0x125, 0x378, + 0xB2, 0x125, ASSET_378_MODEL_SNOWBALL, 0x1, NULL, func_802E28D0, func_80326224, func_802E2630, 0, 0x800, 0.8f, 0 diff --git a/src/core2/code_654C0.c b/src/core2/code_654C0.c index 2a65630c..5ead4413 100644 --- a/src/core2/code_654C0.c +++ b/src/core2/code_654C0.c @@ -20,41 +20,41 @@ Vtx *vtxList_getVertices(BKVertexList *vtxList){ } void vtxList_getBounds_s32(BKVertexList *vtxList, s32 min[3], s32 max[3]){ - min[0] = vtxList->minCoord_0[0]; - min[1] = vtxList->minCoord_0[1]; - min[2] = vtxList->minCoord_0[2]; + min[0] = vtxList->minCoord[0]; + min[1] = vtxList->minCoord[1]; + min[2] = vtxList->minCoord[2]; - max[0] = vtxList->maxCoord_6[0]; - max[1] = vtxList->maxCoord_6[1]; - max[2] = vtxList->maxCoord_6[2]; + max[0] = vtxList->maxCoord[0]; + max[1] = vtxList->maxCoord[1]; + max[2] = vtxList->maxCoord[2]; } void vtxList_getBounds_f32(BKVertexList *vtxList, f32 min[3], f32 max[3]){ - min[0] = (f32) vtxList->minCoord_0[0]; - min[1] = (f32) vtxList->minCoord_0[1]; - min[2] = (f32) vtxList->minCoord_0[2]; + min[0] = (f32) vtxList->minCoord[0]; + min[1] = (f32) vtxList->minCoord[1]; + min[2] = (f32) vtxList->minCoord[2]; - max[0] = (f32) vtxList->maxCoord_6[0]; - max[1] = (f32) vtxList->maxCoord_6[1]; - max[2] = (f32) vtxList->maxCoord_6[2]; + max[0] = (f32) vtxList->maxCoord[0]; + max[1] = (f32) vtxList->maxCoord[1]; + max[2] = (f32) vtxList->maxCoord[2]; } -void func_802EC508(BKVertexList *arg0, f32 arg1[3], f32 arg2[3]) { +void vtxList_getBoundsMlMtxTransformed(BKVertexList *self, f32 min[3], f32 max[3]) { Vtx *start_vtx; Vtx *end_vtx; Vtx *i_vtx; s32 i; f32 sp44[3]; - start_vtx = (Vtx *)(arg0 + 1); - end_vtx = start_vtx + arg0->cnt_14; - arg1[0] = (f32) start_vtx->v.ob[0]; - arg1[1] = (f32) start_vtx->v.ob[1]; - arg1[2] = (f32) start_vtx->v.ob[2]; - func_8025235C(arg1, arg1); - arg2[0] = arg1[0]; - arg2[1] = arg1[1]; - arg2[2] = arg1[2]; + start_vtx = (Vtx *)(self + 1); + end_vtx = start_vtx + self->count; + min[0] = (f32) start_vtx->v.ob[0]; + min[1] = (f32) start_vtx->v.ob[1]; + min[2] = (f32) start_vtx->v.ob[2]; + func_8025235C(min, min); + max[0] = min[0]; + max[1] = min[1]; + max[2] = min[2]; for( i_vtx = start_vtx + 1; i_vtx < end_vtx; i_vtx++){ sp44[0] = (f32) i_vtx->v.ob[0]; @@ -63,25 +63,25 @@ void func_802EC508(BKVertexList *arg0, f32 arg1[3], f32 arg2[3]) { func_8025235C(sp44, sp44); for(i = 0; i < 3; i++){ - if( sp44[i] < arg1[i]){ - arg1[i] = sp44[i]; + if( sp44[i] < min[i]){ + min[i] = sp44[i]; } - if( arg2[i] < sp44[i]){ - arg2[i] = sp44[i]; + if( max[i] < sp44[i]){ + max[i] = sp44[i]; } } } } -void func_802EC680(BKVertexList *arg0, s32 arg1, f32 arg2[3], f32 arg3[3]) { +void func_802EC680(BKVertexList *self, s32 arg1, f32 arg2[3], f32 arg3[3]) { Vtx *start_vtx; Vtx *end_vtx; Vtx *i_vtx; s32 i; f32 sp44[3]; - start_vtx = (Vtx*)(arg0 + 1); - end_vtx = start_vtx + arg0->cnt_14; + start_vtx = (Vtx*)(self + 1); + end_vtx = start_vtx + self->count; for(i_vtx = start_vtx; i_vtx < end_vtx; i_vtx++){ sp44[0] = (f32) i_vtx->v.ob[0]; @@ -129,25 +129,23 @@ void func_802EC680(BKVertexList *arg0, s32 arg1, f32 arg2[3], f32 arg3[3]) { } } -//vtxList_getBeginAndEndPtrs -void func_802EC8FC(BKVertexList *this, Vtx **vtx, Vtx **vtx_end){ +void vtxList_getVtxRange(BKVertexList *this, Vtx **vtx, Vtx **vtx_end){ *vtx = &this->vtx_18[0]; - *vtx_end = &(*vtx)[this->cnt_14]; + *vtx_end = &(*vtx)[this->count]; } -//vtxList_getVtxCount s32 vtxList_getVtxCount(BKVertexList *this){ - return this->cnt_14; + return this->count; } f32 func_802EC920(BKVertexList *this){ return (f32)this->unk16; } -void func_802EC930(BKVertexList *this, f32 arg1[3], f32 *arg2){ - arg1[0] = (f32)this->unkC[0]; - arg1[1] = (f32)this->unkC[1]; - arg1[2] = (f32)this->unkC[2]; +void func_802EC930(BKVertexList *this, f32 center[3], f32 *arg2){ + center[0] = (f32)this->centerCoord[0]; + center[1] = (f32)this->centerCoord[1]; + center[2] = (f32)this->centerCoord[2]; *arg2 = this->unk12; } @@ -163,14 +161,13 @@ BKVertexList *vtxList_clone(BKVertexList *vtxList){ BKVertexList *out_v0; size_t list_size; - list_size = sizeof(BKVertexList) + vtxList->cnt_14*sizeof(Vtx); + list_size = sizeof(BKVertexList) + vtxList->count*sizeof(Vtx); out_v0 = (BKVertexList *) malloc(list_size); func_80254630(out_v0, vtxList, list_size); return out_v0; } -// vtxList_copy_colors -void func_802EC9FC(BKVertexList *dst, BKVertexList *src) { +void vtxList_copyColors(BKVertexList *dst, BKVertexList *src) { Vtx *start_ptr; Vtx *end_ptr; Vtx *i_ptr; @@ -179,7 +176,7 @@ void func_802EC9FC(BKVertexList *dst, BKVertexList *src) { src_ptr = &src->vtx_18[0]; start_ptr = &dst->vtx_18[0]; - end_ptr = start_ptr + dst->cnt_14; + end_ptr = start_ptr + dst->count; for(i_ptr = start_ptr; i_ptr < end_ptr; i_ptr++, src_ptr++){ i_ptr->v.cn[0] = src_ptr->v.cn[0]; i_ptr->v.cn[1] = src_ptr->v.cn[1]; @@ -197,7 +194,7 @@ void vtxList_tint(BKVertexList *dst, s32 target_color[3], f32 amount, BKVertexLi s32 i; start_ptr = &dst->vtx_18[0]; - end_ptr = start_ptr + dst->cnt_14; + end_ptr = start_ptr + dst->count; for(i_ptr = start_ptr, src_ptr = &src->vtx_18[0]; i_ptr < end_ptr; i_ptr++, src_ptr++){ for(i = 0; i < 3; i++){ i_ptr->v.cn[i] = src_ptr->v.cn[i] + (target_color[i] - src_ptr->v.cn[i]) * amount; @@ -229,7 +226,7 @@ void func_802ECBD4(BKVertexList *dst, BKVertexList *src, f32 arg2[3], f32 arg3[3 func_8025235C(sp68, sp68); start_vtx = (Vtx *)(dst + 1); - end_vtx = start_vtx + dst->cnt_14; + end_vtx = start_vtx + dst->count; for(dst_vtx = start_vtx, src_vtx = (Vtx *)(src + 1); dst_vtx < end_vtx; dst_vtx++, src_vtx++){ sp4C[0] = dst_vtx->v.ob[0] - sp74[0]; sp4C[1] = dst_vtx->v.ob[1] - sp74[1]; @@ -243,14 +240,14 @@ void func_802ECBD4(BKVertexList *dst, BKVertexList *src, f32 arg2[3], f32 arg3[3 osWritebackDCache(start_vtx, (end_vtx - start_vtx) * sizeof(Vtx)); } -void func_802ECE30(BKVertexList *arg0) { +void vtxList_randColors(BKVertexList *self) { Vtx *start_ptr; Vtx *end_ptr; Vtx *i_ptr; s32 i; - start_ptr = &arg0->vtx_18[0]; - end_ptr = start_ptr + arg0->cnt_14; + start_ptr = &self->vtx_18[0]; + end_ptr = start_ptr + self->count; for(i_ptr = start_ptr; i_ptr < end_ptr; i_ptr++){ for(i = 0; i < 3; i++){ i_ptr->v.cn[i] = 0; @@ -260,15 +257,15 @@ void func_802ECE30(BKVertexList *arg0) { osWritebackDCache(start_ptr, ((s32)(end_ptr - start_ptr)) * sizeof(Vtx)); } -void func_802ECF64(BKVertexList *arg0) { +void vtxList_randWalkColor(BKVertexList *self) { Vtx *start_ptr; Vtx *end_ptr; Vtx *i_ptr; s32 i; s32 phi_s0; - start_ptr = &arg0->vtx_18[0]; - end_ptr = start_ptr + arg0->cnt_14; + start_ptr = &self->vtx_18[0]; + end_ptr = start_ptr + self->count; for(i_ptr = start_ptr; i_ptr < end_ptr; i_ptr++){ for(i = 0; i < 3; i++){ phi_s0 = i_ptr->v.cn[i]; @@ -281,15 +278,15 @@ void func_802ECF64(BKVertexList *arg0) { osWritebackDCache(start_ptr, ((s32)(end_ptr - start_ptr)) * sizeof(Vtx)); } -void vtxList_recolor(BKVertexList *arg0, s32 arg1[3]) { +void vtxList_recolor(BKVertexList *self, s32 arg1[3]) { Vtx *start_ptr; Vtx *end_ptr; Vtx *i_ptr; s32 i; s32 phi_s0; - start_ptr = &arg0->vtx_18[0]; - end_ptr = start_ptr + arg0->cnt_14; + start_ptr = &self->vtx_18[0]; + end_ptr = start_ptr + self->count; for(i_ptr = start_ptr; i_ptr < end_ptr; i_ptr++){ for(i = 0; i < 3; i++){ i_ptr->v.cn[i] = arg1[i]; @@ -321,7 +318,7 @@ void func_802ED138(f32 arg0[3], f32 arg1[3], f32 arg2){ D_803808C0.unk1C = arg2; } -void func_802ED180(BKVertexList *arg0, f32 arg1[3], f32 arg2[3], f32 arg3, f32 arg4[3]) { +void func_802ED180(BKVertexList *self, f32 arg1[3], f32 arg2[3], f32 arg3, f32 arg4[3]) { Vtx *phi_s0; f32 sp88[3]; f32 sp7C[3]; @@ -339,8 +336,8 @@ void func_802ED180(BKVertexList *arg0, f32 arg1[3], f32 arg2[3], f32 arg3, f32 a func_8025235C(sp7C, D_803808C0.unk4); temp_f20 = D_803808C0.unk1C / arg3; temp_f20 = temp_f20*temp_f20; - start = (Vtx*)(arg0 + 1); - phi_s1 = start + arg0->cnt_14; + start = (Vtx*)(self + 1); + phi_s1 = start + self->count; for(phi_s0 = start; phi_s0 < phi_s1; phi_s0++){ sp70[0] = (f32) phi_s0->v.ob[0]; sp70[1] = (f32) phi_s0->v.ob[1]; @@ -360,20 +357,20 @@ void func_802ED180(BKVertexList *arg0, f32 arg1[3], f32 arg2[3], f32 arg3, f32 a } } -void func_802ED340(BKVertexList *arg0, s32 indx, f32 dst[3]){ +void vtxList_getNthCoord(BKVertexList *self, s32 indx, f32 dst[3]){ Vtx *vtx; - vtx = (s32)(arg0 + 1) + (indx * sizeof(Vtx)); + vtx = (s32)(self + 1) + (indx * sizeof(Vtx)); dst[0] = (f32) vtx->v.ob[0]; dst[1] = (f32) vtx->v.ob[1]; dst[2] = (f32) vtx->v.ob[2]; } -void func_802ED38C(BKVertexList *arg0, s32 indx, f32 arg2[3]){ +void vtxList_setNthCoord(BKVertexList *self, s32 indx, f32 arg2[3]){ Vtx *vtx; s32 i; - vtx = (s32)(arg0 + 1) + (indx * sizeof(Vtx)); + vtx = (s32)(self + 1) + (indx * sizeof(Vtx)); for(i = 0; i < 3; i++){ vtx->v.ob[i] = (arg2[i] >= 0.0) ? arg2[i] + 0.5 : arg2[i] - 0.5; } diff --git a/src/core2/code_7060.c b/src/core2/code_7060.c index 7f94127b..bc30b75d 100644 --- a/src/core2/code_7060.c +++ b/src/core2/code_7060.c @@ -52,7 +52,7 @@ bool func_8028DFF0(s32 arg0, s32 arg1[3]) { return TRUE; } else{ - return func_80304DD0(func_803084F0(arg0), arg1); + return _nodeProp_findPositionFromActorId(func_803084F0(arg0), arg1); } } @@ -394,7 +394,7 @@ void func_8028E9C4(s32 arg0, f32 arg1[3]) { } -void func_8028EB3C(s32 arg0[3]){ +void player_getPosition_s32(s32 arg0[3]){ f32 plyr_pos[3]; player_getPosition(plyr_pos); arg0[0] = (s32)plyr_pos[0]; diff --git a/src/core2/code_78E50.c b/src/core2/code_78E50.c index fd30805a..73d27e1d 100644 --- a/src/core2/code_78E50.c +++ b/src/core2/code_78E50.c @@ -24,7 +24,7 @@ f32 D_80381EB8; f32 D_80381EBC; s32 D_80381EC0; s32 D_80381EC4; -u8 D_80381EC8[8]; +char D_80381EC8[8]; struct7s D_80381ED0; /* .code */ @@ -61,130 +61,64 @@ void func_802FFED4(s32 item_id, struct8s *arg1){ }; } -#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_78E50/func_802FFF34.s") -// void func_802FFF34(enum item_e item_id, struct8s *arg1, Gfx **gfx, Mtx **mtx, Vtx **vtx) { -// s32 sp10C; -// Vtx *sp108; -// s32 sp104; -// s32 spF0; -// s32 spEC; -// s32 spE8; -// s32 spE4; -// s32 spE0; -// s32 spDC; -// Gfx *temp_a0; -// Gfx *temp_v0; -// Gfx *temp_v0_2; -// Gfx *temp_v0_3; -// Gfx *temp_v0_4; -// Gfx *temp_v0_6; -// Gfx *temp_v0_7; -// Gfx *temp_v0_8; -// Gfx *temp_v0_9; -// f32 temp_f12; -// f32 temp_f14; -// f32 temp_f18; -// f32 temp_f18_2; -// f32 temp_f18_3; -// f32 temp_f18_4; -// f32 temp_f2; -// s32 temp_a1; -// s32 temp_lo; -// s32 temp_s2; -// s32 temp_s5; -// s32 temp_t4; -// s32 temp_t6; -// s32 temp_v0_5; -// s32 var_a1; -// s32 var_a1_2; -// s32 var_fp; -// s32 var_s2; -// s32 var_s4; -// s32 var_s6; -// s32 var_s7; -// s32 var_v0; -// s32 var_v0_2; -// s32 var_v1; +void func_802FFF34(enum item_e item_id, struct8s *arg1, Gfx **gfx, Mtx **mtx, Vtx **vtx) { + s32 sp10C; + Vtx *sp108; + s32 sp104; + s32 var_v0; + s32 var_v1; + s32 var_s5; + s32 var_s4; + s32 spF0; + s32 spEC; + s32 spE8; + s32 spE4; + s32 spE0; + s32 spDC; -// sp10C = -1; -// sp108 = *vtx; -// D_80381EC8[0] = 0; -// if (itemPrint_getValue() >= 10) { -// var_a1 = 9; -// } else { -// var_a1 = itemPrint_getValue(item_id); -// } -// strIToA(&D_80381EC8, var_a1); -// print_bold_spaced(0x4E, (s32) (func_802FB0E4(arg1) + -16.0f + 4.0f), D_80381EC8); -// if (*(&D_80381EB0 + (D_80381EC4 * 4)) != 0) { -// gSPDisplayList((*gfx)++, D_8036A278); -// func_8024C7B8(gfx, mtx); -// gDPPipeSync((*gfx)++); -// gDPSetCombineLERP((*gfx)++, 0, 0, 0, TEXEL0, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, TEXEL0, TEXEL0, 0, PRIMITIVE, 0); -// gDPSetPrimColor((*gfx)++, 0, 0, 0x00, 0x00, 0x00, 0xFF); -// var_s2 = 2; -// do { -// func_80348044(gfx, D_80381EB0[D_80381EC4], (s32) D_80381EBC % 4, 0, 0, 0, 0, var_s2, var_s2, &spF0, &spEC, &spE8, &spE4, &spE0, &spDC, &sp10C); -// temp_v0_5 = sp104 + 4; -// if (((*vtx - sp108) & 0xF) == 0) { -// var_s4 = 0; -// var_s6 = 2; -// sp104 = 0; -// var_s7 = 6; -// temp_t4 = (sp10C + 1) * 4; -// if (temp_t4 >= 0x11) { -// var_v0 = 0x10; -// } else { -// var_v0 = temp_t4; -// } -// if (temp_t4 >= 0x11) { -// var_a1_2 = 0x10; -// } else { -// var_a1_2 = temp_t4; -// } -// //var_a1_2 = n -// // temp_a0->words.w0 = ((((var_a1_2 * 0x10) - 1) | (var_v0 << 0xA)) & 0xFFFF) | 0x04000000; -// // temp_a0->words.w1 = *vtx; -// gSPVertex((*gfx)++, *vtx, var_a1_2, var_v0); -// var_fp = 4; -// } else { -// var_s4 = temp_v0_5 * 2; -// var_s6 = var_s4 + 2; -// var_s7 = var_s4 + 6; -// var_fp = var_s4 + 4; -// sp104 = temp_v0_5; -// } -// temp_s5 = (s32) ((40.0f - ((f32) framebuffer_width / 2.0f)) + (f32) spE0); -// temp_f12 = (f32) temp_s5; -// temp_f14 = (f32) (s32) (((((f32) framebuffer_height / 2.0f) - func_802FB0E4(arg1)) - -16.0f) - (f32) spDC); -// for(var_v1 = 0; var_v1 != var_s2; var_v1++){ -// temp_f2 = (f32) var_v1; -// temp_s2 = var_s2 - 1; -// for(var_v0_2 = 0; var_v0_2 != temp_s2; var_v0_2++) { -// (*vtx)->v.ob[0] = ((((f32) spF0 * D_80381EB8 * (f32) var_v0_2) - (((f32) spE8 * D_80381EB8) / 2.0f)) + temp_f12) * 4.0f; -// (*vtx)->v.ob[1] = (((((f32) spE4 * D_80381EB8) / 2.0f) - ((f32) spEC * D_80381EB8 * temp_f2)) + temp_f14) * 4.0f; -// (*vtx)->v.ob[2] = -20; -// (*vtx)->v.tc[0] = (s16) (((spF0 - 1) * var_v0_2) << 6); -// (*vtx)->v.tc[1] = (s16) (((spEC - 1) * var_v1) << 6); -// (*vtx)++; -// } -// temp_f18_3 = D_80381EB8; -// var_s2 = temp_s2 + 1; -// (*vtx)->v.ob[0] = (s16) (s32) (((((f32) spF0 * D_80381EB8 * (f32) var_v0_2) - (((f32) spE8 * D_80381EB8) / 2.0f)) + temp_f12) * 4.0f); -// (*vtx)->v.ob[1] = (s16) (s32) ((((((f32) spE4 * D_80381EB8) / 2.0f) - ((f32) spEC * D_80381EB8 * temp_f2)) + temp_f14) * 4.0f); -// (*vtx)->v.ob[2] = -20; -// (*vtx)->v.tc[0] = (s16) (((spF0 - 1) * var_v0_2) << 6); -// (*vtx)->v.tc[1] = (s16) (((spEC - 1) * var_v1) << 6); -// (*vtx)++; -// } - // gSP2Triangles((*gfx)++, var_s4/2, var_fp/2, var_s7/2, 0, var_s4/2, var_s7/2, var_fp/2, 0); -// } while (sp10C != 0); -// gDPPipeSync((*gfx)++); -// gDPSetTextureLUT((*gfx)++, G_TT_NONE); -// gDPPipelineMode((*gfx)++, G_PM_NPRIMITIVE); -// func_8024C904(gfx, mtx); -// } -// } + sp10C = -1; + sp108 = *vtx; + D_80381EC8[0] = '\0'; + strIToA(D_80381EC8, MIN(9, itemPrint_getValue(item_id))); + print_bold_spaced(0x4E, (s32) (func_802FB0E4(arg1) + -16.0f + 4.0f), (char *) &D_80381EC8); + if(1); //fake + if (D_80381EB0[D_80381EC4] != NULL) { + gSPDisplayList((*gfx)++, D_8036A278); + func_8024C7B8(gfx, mtx); + if(gfx); + gDPPipeSync((*gfx)++); + gDPSetCombineLERP((*gfx)++, 0, 0, 0, TEXEL0, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, TEXEL0, TEXEL0, 0, PRIMITIVE, 0); + gDPSetPrimColor((*gfx)++, 0, 0, 0x00, 0x00, 0x00, 0xFF); + do{ + func_80348044(gfx, D_80381EB0[D_80381EC4], (s32) D_80381EBC % 4, 0, 0, 0, 0, 2, 2, &spF0, &spEC, &spE8, &spE4, &spE0, &spDC, &sp10C); + + if (((*vtx - sp108) & 0xF) == 0) { + gSPVertex((*gfx)++, *vtx, MIN(0x10, (1 + sp10C) << 2), 0); + sp104 = 0; + } else { + sp104 = sp104 + 4; + } + + var_s5 = (40.0f - ((f32) framebuffer_width / 2)) + spE0; + var_s4 = (((((f32) framebuffer_height / 2) - func_802FB0E4(arg1)) - -16.0f) - spDC); + for(var_v1 = 0; var_v1 < 2; var_v1++){ + for(var_v0 = 0; var_v0 < 2; var_v0++){ + (*vtx)->v.ob[0] = (s16) (s32) (((((f32) spF0 * D_80381EB8 * (f32) var_v0) - (((f32) spE8 * D_80381EB8) / 2)) + var_s5) * 4.0f); + (*vtx)->v.ob[1] = (s16) (s32) ((((((f32) spE4 * D_80381EB8) / 2) - ((f32) spEC * D_80381EB8 * var_v1)) + var_s4) * 4.0f); + (*vtx)->v.ob[2] = -0x14; + (*vtx)->v.tc[0] = ((spF0 - 1) * var_v0) << 6; + (*vtx)->v.tc[1] = ((spEC - 1) * var_v1) << 6; + (*vtx)++; + } + } + gSP1Quadrangle((*gfx)++, sp104, sp104 + 1, sp104 + 3, sp104 + 2, 0); + }while(sp10C != 0); + gDPPipeSync((*gfx)++); + gDPSetTextureLUT((*gfx)++, G_TT_NONE); + gDPPipelineMode((*gfx)++, G_PM_NPRIMITIVE); + func_8024C904(gfx, mtx); + } +} void func_803005BC(enum item_e item_id, struct8s *arg1) { s32 var_v0; diff --git a/src/core2/code_7AF80.c b/src/core2/code_7AF80.c index 18f1ae8a..0812b64a 100644 --- a/src/core2/code_7AF80.c +++ b/src/core2/code_7AF80.c @@ -34,7 +34,7 @@ typedef struct { Struct_core2_7AF80_2 *unk8; } Struct_core2_7AF80_1; -NodeProp *func_803049CC(enum actor_e actor_id, s32 arg1[3]); +NodeProp *cubeList_findNodePropByActorId(enum actor_e actor_id, s32 arg1[3]); s32 func_80304FC4(enum actor_e *actor_id_list, NodeProp **node_list, s32 arg2); void cube_positionToIndices(s32 arg0[3], f32 arg1[3]); NodeProp *func_803080C8(s32 arg0); @@ -936,7 +936,7 @@ s32 func_803048E0(s32 arg0[3], s32 arg1[3], s32 arg2, s32 arg3, s32 arg4) { s32 func_80304984(s32 arg0, u32 *arg1) { NodeProp *temp_v0; - temp_v0 = func_803049CC(arg0, 0); + temp_v0 = cubeList_findNodePropByActorId(arg0, 0); if (temp_v0 != 0) { *arg1 = temp_v0->unk6.bit15; return 1; @@ -944,50 +944,50 @@ s32 func_80304984(s32 arg0, u32 *arg1) { return 0; } -NodeProp *func_803049CC(enum actor_e actor_id, s32 arg1[3]) { - s32 sp7C[3]; +NodeProp *cubeList_findNodePropByActorId(enum actor_e actor_id, s32 arg1[3]) { + s32 cube_indices[3]; s32 i; f32 sp6C[3]; - s32 sp60[3]; - s32 sp54[3]; + s32 cube_min[3]; + s32 cube_max[3]; s32 *var_a3; - NodeProp *temp_v0; + NodeProp *i_node_prop; if (arg1 != NULL) { sp6C[0] = (f32) arg1[0]; sp6C[1] = (f32) arg1[1]; sp6C[2] = (f32) arg1[2]; - cube_positionToIndices(sp7C, sp6C); + cube_positionToIndices(cube_indices, sp6C); for(i = 0; i < 3; i++){ - sp60[i] = sp7C[i] - 1; - sp54[i] = sp7C[i] + 1; - if (sp60[i] < D_80381FA0.min[i]) { - sp60[i] = D_80381FA0.min[i]; + cube_min[i] = cube_indices[i] - 1; + cube_max[i] = cube_indices[i] + 1; + if (cube_min[i] < D_80381FA0.min[i]) { + cube_min[i] = D_80381FA0.min[i]; } - if (D_80381FA0.max[i] < sp54[i]) { - sp54[i] = D_80381FA0.max[i]; + if (D_80381FA0.max[i] < cube_max[i]) { + cube_max[i] = D_80381FA0.max[i]; } } - for(sp7C[0] = sp60[0]; sp7C[0] <= sp54[0]; sp7C[0]++){ - for(sp7C[1] = sp60[1]; sp7C[1] <= sp54[1]; sp7C[1]++){ - for(sp7C[2] = sp60[2]; sp7C[2] <= sp54[2]; sp7C[2]++){ - temp_v0 = func_8032E230(cube_atIndices(sp7C), actor_id); - if (temp_v0 != NULL) { - return temp_v0; + for(cube_indices[0] = cube_min[0]; cube_indices[0] <= cube_max[0]; cube_indices[0]++){ + for(cube_indices[1] = cube_min[1]; cube_indices[1] <= cube_max[1]; cube_indices[1]++){ + for(cube_indices[2] = cube_min[2]; cube_indices[2] <= cube_max[2]; cube_indices[2]++){ + i_node_prop = cube_findNodePropByActorId(cube_atIndices(cube_indices), actor_id); + if (i_node_prop != NULL) { + return i_node_prop; } } } } } - for(sp7C[1] = D_80381FA0.min[1]; sp7C[1] <= D_80381FA0.max[1] ; sp7C[1]++) { - if (func_80305C30(sp7C[1] - D_80381FA0.min[1]) != 0) { - for(sp7C[0] = D_80381FA0.min[0]; sp7C[0] <= D_80381FA0.max[0] ; sp7C[0]++) { - for(sp7C[2] = D_80381FA0.min[2]; sp7C[2] <= D_80381FA0.max[2] ; sp7C[2]++) { - temp_v0 = func_8032E230(cube_atIndices(sp7C), actor_id); - if (temp_v0 != NULL) { - return temp_v0; + for(cube_indices[1] = D_80381FA0.min[1]; cube_indices[1] <= D_80381FA0.max[1] ; cube_indices[1]++) { + if (func_80305C30(cube_indices[1] - D_80381FA0.min[1]) != 0) { + for(cube_indices[0] = D_80381FA0.min[0]; cube_indices[0] <= D_80381FA0.max[0] ; cube_indices[0]++) { + for(cube_indices[2] = D_80381FA0.min[2]; cube_indices[2] <= D_80381FA0.max[2] ; cube_indices[2]++) { + i_node_prop = cube_findNodePropByActorId(cube_atIndices(cube_indices), actor_id); + if (i_node_prop != NULL) { + return i_node_prop; } } } @@ -1010,25 +1010,25 @@ NodeProp *func_80304C38(enum actor_e actor_id, Actor *arg1){ } else { phi_a1 = vec; } - return func_803049CC(actor_id, phi_a1); + return cubeList_findNodePropByActorId(actor_id, phi_a1); } NodeProp *func_80304CAC(s32 arg0, f32 *arg1) { s32 vec[3]; - vec[0] = arg1[0]; - vec[1] = arg1[1]; - vec[2] = arg1[2]; - return func_803049CC(arg0, vec); + vec[0] = (s32)arg1[0]; + vec[1] = (s32)arg1[1]; + vec[2] = (s32)arg1[2]; + return cubeList_findNodePropByActorId(arg0, vec); } NodeProp *func_80304D04(s32 arg0, s16 *arg1) { s32 arr[3]; - arr[0] = arg1[0]; - arr[1] = arg1[1]; - arr[2] = arg1[2]; - return func_803049CC(arg0, arr); + arr[0] = (s32)arg1[0]; + arr[1] = (s32)arg1[1]; + arr[2] = (s32)arg1[2]; + return cubeList_findNodePropByActorId(arg0, arr); } s32 nodeprop_getRadius(NodeProp *arg0) { @@ -1055,29 +1055,29 @@ s32 func_80304DB8(NodeProp *arg0) { return arg0->unkC_22; } -s32 func_80304DD0(enum actor_e actor_id, s32 *arg1) { - NodeProp *temp_v0; +bool _nodeProp_findPositionFromActorId(enum actor_e actor_id, s32 *position) { + NodeProp *node_prop; - temp_v0 = func_803049CC(actor_id, 0); - if (temp_v0 != 0) { - arg1[0] = (s32) temp_v0->x; - arg1[1] = (s32) temp_v0->y; - arg1[2] = (s32) temp_v0->z; - return 1; + node_prop = cubeList_findNodePropByActorId(actor_id, NULL); + if (node_prop != 0) { + position[0] = (s32) node_prop->x; + position[1] = (s32) node_prop->y; + position[2] = (s32) node_prop->z; + return TRUE; } - return 0; + return FALSE; } -s32 func_80304E24(s32 arg0, f32 *arg1) { +bool nodeProp_findPositionFromActorId(enum actor_e actor_id, f32 *arg1) { s32 vec[3]; - if (func_80304DD0(arg0, vec) == 0) { - return 0; + if (_nodeProp_findPositionFromActorId(actor_id, vec) == 0) { + return FALSE; } arg1[0] = vec[0]; arg1[1] = vec[1]; arg1[2] = vec[2]; - return 1; + return TRUE; } s32 func_80304E9C(s32 arg0, s32 arg1, s32 arg2){ @@ -1189,7 +1189,7 @@ bool func_80305290(bool (* arg0)(NodeProp *), bool (* arg1)(Prop *)){ bool func_80305344(s32 arg0, u32 *arg1) { NodeProp *temp_v0; - temp_v0 = func_803049CC(arg0, NULL); + temp_v0 = cubeList_findNodePropByActorId(arg0, NULL); if (temp_v0 != NULL) { *arg1 = temp_v0->unkC_31; return 1; diff --git a/src/core2/code_851D0.c b/src/core2/code_851D0.c index fe7b8187..0ffa85f3 100644 --- a/src/core2/code_851D0.c +++ b/src/core2/code_851D0.c @@ -69,7 +69,7 @@ void func_8030C204(void){ switch(getGameMode()){ case GAME_MODE_8_BOTTLES_BONUS: - func_802DEA8C(0, 0); + chBottlesBonus_func_802DEA8C(0, 0); break; case GAME_MODE_A_SNS_PICTURE: func_802DF11C(0, 0); @@ -80,7 +80,7 @@ void func_8030C204(void){ void func_8030C27C(void){ switch(getGameMode()){ case GAME_MODE_8_BOTTLES_BONUS: - func_802DEA18(0, 0); + chBottlesBonus_Spawn(0, 0); break; case GAME_MODE_A_SNS_PICTURE: func_802DF090(0, 0); diff --git a/src/core2/code_857B0.c b/src/core2/code_857B0.c index a1e23889..485a5f64 100644 --- a/src/core2/code_857B0.c +++ b/src/core2/code_857B0.c @@ -9,7 +9,7 @@ s32 D_80382460; void func_8030C740(void){ f32 sp1C[3]; D_80382460 = 1; - if(func_80304DD0(0x16, sp1C)){ + if(_nodeProp_findPositionFromActorId(0x16, sp1C)){ D_80382460 = 0; } } diff --git a/src/core2/code_935F0.c b/src/core2/code_935F0.c index a0acf83c..1a7b2fc6 100644 --- a/src/core2/code_935F0.c +++ b/src/core2/code_935F0.c @@ -154,7 +154,7 @@ void func_8031A9E4(Actor *this){ } func_8031A618(this); - func_803300D8(this->marker, func_8031A9BC); + marker_setFreeMethod(this->marker, func_8031A9BC); func_8028FAB0(this->position); this->unk1C[0] = 0.0f; this->unk1C[1] = this->yaw; this->unk1C[2] = 0.0f; func_8028FAEC(this->unk1C); diff --git a/src/core2/code_99860.c b/src/core2/code_99860.c deleted file mode 100644 index 1cda5428..00000000 --- a/src/core2/code_99860.c +++ /dev/null @@ -1,35 +0,0 @@ -#include -#include "functions.h" -#include "variables.h" - -#define CORE2_99860_ARRAY_SIZE 0x33 - -/* .bss */ -u8* D_80383220; - -/* .code */ -bool func_803207F0(s32 index){ - return func_803200A4(D_80383220, index); -} - -void func_80320818(void){ - free(D_80383220); - D_80383220 = NULL; -} - -void func_80320840(void){ - int i; - D_80383220 =(u8*) malloc(CORE2_99860_ARRAY_SIZE); - for(i = 0; i < CORE2_99860_ARRAY_SIZE; i++){ - D_80383220[i] = 0; - } -} - -void func_803208C0(s32 index, bool value){ - func_8032015C(D_80383220, index, value); -} - -void func_803208F0(void){ - if(D_80383220 != NULL) - D_80383220 = (u8*)defrag(D_80383220); -} diff --git a/src/core2/code_9B180.c b/src/core2/code_9B180.c index 4d2684e7..318428ce 100644 --- a/src/core2/code_9B180.c +++ b/src/core2/code_9B180.c @@ -112,7 +112,7 @@ void func_80322318(Struct_core2_9B180_0 * arg0){ bool func_80322340(s32 arg0) { f32 sp1C[3]; - if (func_80304E24(arg0, &sp1C)) { + if (nodeProp_findPositionFromActorId(arg0, &sp1C)) { return 1; } return 0; @@ -130,7 +130,7 @@ void func_803223AC(void) { func_80244A98(1); for(i_ptr = D_8036DE00; i_ptr != &D_8036DE00[6]; i_ptr++){ - i_ptr->unk4 = func_803049CC(i_ptr->unk0, 0); + i_ptr->unk4 = cubeList_findNodePropByActorId(i_ptr->unk0, 0); if(i_ptr->unk4 != 0 && i_ptr->unk8 != NULL){ i_ptr->unk8(i_ptr); } diff --git a/src/core2/code_9E370.c b/src/core2/code_9E370.c index 84661a59..16e91fc2 100644 --- a/src/core2/code_9E370.c +++ b/src/core2/code_9E370.c @@ -1956,7 +1956,7 @@ void func_8032A95C(Actor *arg0, s32 arg1, s32 arg2) { bool func_8032A9E4(s32 arg0, s32 arg1, s32 arg2) { s32 sp1C[3]; - func_8028EB3C(sp1C); + player_getPosition_s32(sp1C); return ((arg0 - sp1C[0])*(arg0 - sp1C[0]) + (arg1 - sp1C[2])*(arg1 - sp1C[2])) < (arg2 * arg2); } diff --git a/src/core2/code_A5BC0.c b/src/core2/code_A5BC0.c index b3548dac..82a11d3a 100644 --- a/src/core2/code_A5BC0.c +++ b/src/core2/code_A5BC0.c @@ -599,7 +599,7 @@ bool func_8032E178(Cube *arg0, s32 *arg1, s32 arg2) { return FALSE; } -NodeProp *func_8032E230(Cube *cube, s32 arg1) { +NodeProp *cube_findNodePropByActorId(Cube *cube, s32 arg1) { NodeProp *i_ptr; if (cube != NULL && cube->prop1Cnt != 0){ @@ -1206,7 +1206,7 @@ void func_803300D0(ActorMarker *marker, s32 arg1){ marker->unk34 = arg1; } -void func_803300D8(ActorMarker *marker, ActorFreeFunc method){ +void marker_setFreeMethod(ActorMarker *marker, ActorFreeFunc method){ marker->unk30 = method; } @@ -1945,22 +1945,22 @@ f32 func_80331F1C(Prop *arg0){ f32 func_80331F54(ActorMarker *marker) { f32 sp34; - f32 sp28[3]; + f32 model_center[3]; BKModelBin *model; model = func_80330B1C(marker); if (model == NULL) { return 1.0f; } - func_802EC930(func_8033A148(model), sp28, &sp34); + func_802EC930(func_8033A148(model), model_center, &sp34); if (marker->unk3E_0) { - sp28[0] = sp28[0] * marker_getActor(marker)->scale;\ - sp28[1] = sp28[1] * marker_getActor(marker)->scale;\ - sp28[2] = sp28[2] * marker_getActor(marker)->scale; + model_center[0] = model_center[0] * marker_getActor(marker)->scale;\ + model_center[1] = model_center[1] * marker_getActor(marker)->scale;\ + model_center[2] = model_center[2] * marker_getActor(marker)->scale; } - marker->unk38[0] = (s16) sp28[0];\ - marker->unk38[1] = (s16) sp28[1];\ - marker->unk38[2] = (s16) sp28[2]; + marker->unk38[0] = (s16) model_center[0];\ + marker->unk38[1] = (s16) model_center[1];\ + marker->unk38[2] = (s16) model_center[2]; return sp34 * 2; } diff --git a/src/core2/code_ABC00.c b/src/core2/code_ABC00.c index 85d80749..3c4a36e3 100644 --- a/src/core2/code_ABC00.c +++ b/src/core2/code_ABC00.c @@ -189,7 +189,7 @@ void func_80332D98(enum map_e map_id, enum jiggy_e jiggy_id, enum bkprog_e flag_ if ((map_get() == map_id) && func_8031FF1C(flag_id) && !jiggyscore_isSpawned(jiggy_id) - && func_80304E24(arg3, sp1C) + && nodeProp_findPositionFromActorId(arg3, sp1C) ) { func_803331D8(jiggy_id, sp1C); } @@ -311,7 +311,7 @@ void func_803333DC(Struct81s *arg0, Actor *arg1) { if (arg0->unk14 != NULL) { arg0->unk14(arg1, arg0->unk18); } - func_803300D8(arg1->marker, func_803332D0); + marker_setFreeMethod(arg1->marker, func_803332D0); jiggy_id = ((s32) ((s32)arg0 - (s32)&D_8036E834) / 0x2C) + 1; chjiggy_setJiggyId(arg1, jiggy_id); if ((jiggy_id == JIGGY_49_CCW_EYRIE) || (jiggy_id == JIGGY_39_LAIR_MMM_WITCH_SWITCH) || (jiggy_id == JIGGY_3C_LAIR_CCW_WITCH_SWITCH)) { diff --git a/src/core2/code_AC520.c b/src/core2/code_AC520.c index bf439cca..419a1be0 100644 --- a/src/core2/code_AC520.c +++ b/src/core2/code_AC520.c @@ -238,7 +238,7 @@ void func_80333D48(BKVertexList *arg0, f32 position[3], f32 rotation[3], f32 sca return; } ref_ptr = vtxList_getVertices(arg5); - func_802EC8FC(arg0, &i_ptr, &end_ptr); + vtxList_getVtxRange(arg0, &i_ptr, &end_ptr); for(i_ptr = i_ptr; i_ptr < end_ptr; i_ptr++, ref_ptr++){ sp68[0] = sp68[1] = sp68[2] = 0.0f; diff --git a/src/core2/code_AD110.c b/src/core2/code_AD110.c index 96925e50..156f4b6c 100644 --- a/src/core2/code_AD110.c +++ b/src/core2/code_AD110.c @@ -7,8 +7,8 @@ extern void func_802DC528(s32, s32); extern void func_802DC560(s32, s32); extern void func_802DC748(s32, s32); extern void func_802DC780(s32, s32); -extern void func_802DCD78(s32, s32); -extern void func_802DCDC0(s32, s32); +extern void chOverlayPressStart_spawn(s32, s32); +extern void chOverlayPressStart_func_802DCDC0(s32, s32); extern void func_8031D06C(s32, s32); extern void func_8031D09C(s32, s32); extern void func_8031D11C(s32, s32); @@ -333,7 +333,7 @@ Method_core2_AD110 D_8036F980[] = { func_8031ED70, func_8031ED94, func_8031EDB8, func_8031EDDC, func_8031EE00, func_8031EE24, func_8031DD10, func_8031DD44, func_80363388, func_8038A0E4, func_8038A150, func_80334430, - func_802DCD78, func_802DCDC0, func_802DC528, func_802DC560, + chOverlayPressStart_spawn, chOverlayPressStart_func_802DCDC0, func_802DC528, func_802DC560, func_8031EF20, func_8031EEFC, func_80334430, func_8031EED8, func_8031EEB4, func_8031EE90, func_8031EE6C, func_8031EE48, func_8031EB0C, func_8031EB30, func_8031EB54, func_8031EB78, diff --git a/src/core2/code_B8080.c b/src/core2/code_B8080.c index 2d561ec6..e7193d3b 100644 --- a/src/core2/code_B8080.c +++ b/src/core2/code_B8080.c @@ -181,7 +181,7 @@ BKModel *func_8033F5F8(BKMeshList *arg0, BKVertexList *arg1) { s32 phi_s1; s32 phi_s6; - sp40 = (BKModel *)malloc((func_802E9F60() * sizeof(BKVtxRef)) + (arg0->meshCount_0 * sizeof(BKMesh)) + sizeof(BKModel)); + sp40 = (BKModel *)malloc((func_802E9F60(arg0) * sizeof(BKVtxRef)) + (arg0->meshCount_0 * sizeof(BKMesh)) + sizeof(BKModel)); sp40->meshList_0 = arg0; sp40->vtxList_4 = arg1; phi_s3 = (BKMesh *)(arg0 + 1); diff --git a/src/core2/code_B9770.c b/src/core2/code_B9770.c index 5f46c35b..6abdf043 100644 --- a/src/core2/code_B9770.c +++ b/src/core2/code_B9770.c @@ -547,7 +547,7 @@ struct56s *func_80341EF0(f32 arg0[3]){ s32 func_80341F2C(s32 arg0){ s32 sp1C[3]; - if(!func_80304DD0(arg0, sp1C)){ + if(!_nodeProp_findPositionFromActorId(arg0, sp1C)){ return -1; } return func_80341C78(sp1C); @@ -555,7 +555,7 @@ s32 func_80341F2C(s32 arg0){ struct56s *func_80341F64(s32 arg0){ s32 sp1C[3]; - if(!func_80304DD0(arg0, sp1C)){ + if(!_nodeProp_findPositionFromActorId(arg0, sp1C)){ return NULL; } return D_80371E70[func_80341C78(sp1C)]; diff --git a/src/core2/code_C2F30.c b/src/core2/code_C2F30.c index 729c1a1d..b5691d9d 100644 --- a/src/core2/code_C2F30.c +++ b/src/core2/code_C2F30.c @@ -37,7 +37,7 @@ s32 D_803860DC;//total_inputs s32 func_80349EC0(s32 arg0){ s32 sp1C[3]; - return func_80304DD0(arg0 + 0x1CC, &sp1C); + return _nodeProp_findPositionFromActorId(arg0 + 0x1CC, &sp1C); } int demo_readInput(OSContPad* arg0, s32* arg1){ diff --git a/src/core2/code_C4320.c b/src/core2/code_C4320.c index 2e27e8b7..e0a2c10d 100644 --- a/src/core2/code_C4320.c +++ b/src/core2/code_C4320.c @@ -135,7 +135,7 @@ void func_8034B4E4(s32 arg0){ /* fall-through */ case 2: //L8034B550 case 7: //L8034B550 - func_802DCAD4(0,0); + chOverlayCopyright_spawn(0,0); break; case 5: //L8034B564 @@ -155,7 +155,7 @@ void func_8034B580(s32 arg0) { switch (arg0) { case 4: if ((D_80386128 >= 2.5) && (sp1C < 2.5) && (D_80371F9C == 0)) { - func_802DCB0C(0, 0); + chOverlayCopyright_func_802DCB0C(0, 0); } /* fallthrough */ case 3: @@ -163,19 +163,19 @@ void func_8034B580(s32 arg0) { func_802DC9DC(0, 0); } if ((D_80386128 >= 4.0) && (sp1C < 4.0) && (func_8024F12C() == 0)) { - func_802DCD78(0, 0); + chOverlayPressStart_spawn(0, 0); if (D_80371F9C != 0) { - func_802DCDB0(); + chOverlayPressStart_func_802DCDB0(); return; } } break; case 7: if ((D_80386128 >= 2.5) && (sp1C < 2.5)) { - func_802DCB0C(0, 0); + chOverlayCopyright_func_802DCB0C(0, 0); } if ((D_80386128 >= 4.0) && (sp1C < 4.0) && (func_8024F12C() == 0)) { - func_802DCD78(0, 0); + chOverlayPressStart_spawn(0, 0); } break; } @@ -184,8 +184,8 @@ void func_8034B580(s32 arg0) { void func_8034B7F0(s32 arg0) { func_802DC9DC(0, 0); - func_802DCB0C(0, 0); - func_802DCDC0(0, 0); + chOverlayCopyright_func_802DCB0C(0, 0); + chOverlayPressStart_func_802DCDC0(0, 0); D_80371F9C = 0; } diff --git a/src/core2/code_C8760.c b/src/core2/code_C8760.c index 5e946299..c149e190 100644 --- a/src/core2/code_C8760.c +++ b/src/core2/code_C8760.c @@ -33,8 +33,8 @@ void func_8034F774(void){ int s0; int s1; - s0 = func_80304E24(0x2F, &sp38); - s1 = func_80304E24(0x30, &sp2C); + s0 = nodeProp_findPositionFromActorId(0x2F, &sp38); + s1 = nodeProp_findPositionFromActorId(0x30, &sp2C); if( !s0 || !s1){ D_803720A0.unk0 = NULL; }else{ diff --git a/src/core2/code_C9E70.c b/src/core2/code_C9E70.c index a295746a..fe74d0c8 100644 --- a/src/core2/code_C9E70.c +++ b/src/core2/code_C9E70.c @@ -7,7 +7,7 @@ struct FF_StorageStruct *D_8037DCB8; void func_80350E00(void){ - func_803208F0(); + quizQuestionAskedBitfield_defrag(); func_8031A4CC(); if(D_8037DCB8 == NULL) return; diff --git a/src/core2/code_C9F00.c b/src/core2/code_C9F00.c index 32d70a41..7b04fb55 100644 --- a/src/core2/code_C9F00.c +++ b/src/core2/code_C9F00.c @@ -446,7 +446,7 @@ void func_80351C48(void) { temp_f20 = time_getDelta(); D_80386180.unk0 = NULL; if (D_80386180.unk2C != NULL) { - func_8028EB3C(&sp38); + player_getPosition_s32(&sp38); if ((sp38[0] == D_80386180.unk20[0]) && (sp38[1] == D_80386180.unk20[1]) && (sp38[2] == D_80386180.unk20[2])) { player_getPosition(sp4C); mlMtxIdent(); diff --git a/src/core2/code_CC1E0.c b/src/core2/code_CC1E0.c index 5791c0bd..b70ea87d 100644 --- a/src/core2/code_CC1E0.c +++ b/src/core2/code_CC1E0.c @@ -349,7 +349,7 @@ void fxegg_ass_update(void) { if (0.6 < func_8033EA14(1)) { projectile_getPosition(projectile_indx, sp80); if (fxegg_isCollidingWithPlayer(sp80)) { - collect_egg(NULL); + chcollectable_collectEgg(NULL); func_8033E984(); } } diff --git a/src/core2/code_DA760.c b/src/core2/code_DA760.c index 5a88b2f3..15c37122 100644 --- a/src/core2/code_DA760.c +++ b/src/core2/code_DA760.c @@ -42,7 +42,7 @@ void func_80361870(Actor *this){ s32 text_id; s32 sp28; if(!this->unk16C_4){ - func_803300D8(this->marker, func_80361828); + marker_setFreeMethod(this->marker, func_80361828); this->unk16C_4 = 1; } diff --git a/src/core2/modelRender.c b/src/core2/modelRender.c index 25501f42..d88ce137 100644 --- a/src/core2/modelRender.c +++ b/src/core2/modelRender.c @@ -612,7 +612,7 @@ BKGfxList * modelRenderDisplayList; struct58s * D_8038371C; static BKTextureList * modelRenderTextureList; s32 D_80383724; -static BKVertexList * modelRenderVextureList; +static BKVertexList * modelRendervertexList; BKModelUnk20List * D_8038372C; struct58s * D_80383730; f32 modelRenderScale; @@ -685,7 +685,7 @@ void modelRender_reset(void){ D_8038371C = NULL; modelRenderTextureList = NULL; D_80383724 = 0; - modelRenderVextureList = NULL; + modelRendervertexList = NULL; D_8038372C = 0; modelRenderCallback.pre_method = NULL; modelRenderCallback.post_method = NULL; @@ -1081,7 +1081,7 @@ BKModelBin *modelRender_draw(Gfx **gfx, Mtx **mtx, f32 position[3], f32 rotation } if(model_bin){ - verts = modelRenderVextureList ? modelRenderVextureList : (BKVertexList *)((s32)model_bin + model_bin->vtx_list_offset_10); + verts = modelRendervertexList ? modelRendervertexList : (BKVertexList *)((s32)model_bin + model_bin->vtx_list_offset_10); spD0 = verts->unk16; spD4 = verts->unk12; } @@ -1115,7 +1115,7 @@ BKModelBin *modelRender_draw(Gfx **gfx, Mtx **mtx, f32 position[3], f32 rotation modelRenderModelBin = model_bin; modelRenderDisplayList = modelRenderDisplayList ? modelRenderDisplayList : (BKGfxList *)((s32)modelRenderModelBin + modelRenderModelBin->gfx_list_offset_C), modelRenderTextureList = modelRenderTextureList ? modelRenderTextureList : (BKTextureList *)((s32)modelRenderModelBin + modelRenderModelBin->texture_list_offset_8), - modelRenderVextureList = modelRenderVextureList ? modelRenderVextureList : (BKVertexList *)((s32)modelRenderModelBin + modelRenderModelBin->vtx_list_offset_10), + modelRendervertexList = modelRendervertexList ? modelRendervertexList : (BKVertexList *)((s32)modelRenderModelBin + modelRenderModelBin->vtx_list_offset_10), D_8038372C = (modelRenderModelBin->unk20 == NULL) ? NULL : (BKModelUnk20List *)((u8*)model_bin + model_bin->unk20); if(D_80383710){ @@ -1138,7 +1138,7 @@ BKModelBin *modelRender_draw(Gfx **gfx, Mtx **mtx, f32 position[3], f32 rotation } // Set up segments 1 and 2 to point to vertices and textures respectively - gSPSegment((*gfx)++, 0x01, osVirtualToPhysical(&modelRenderVextureList->vtx_18)); + gSPSegment((*gfx)++, 0x01, osVirtualToPhysical(&modelRendervertexList->vtx_18)); gSPSegment((*gfx)++, 0x02, osVirtualToPhysical(&modelRenderTextureList->tex_8[modelRenderTextureList->cnt_4])); if(D_80383724){ @@ -1248,7 +1248,7 @@ BKModelBin *modelRender_draw(Gfx **gfx, Mtx **mtx, f32 position[3], f32 rotation } if(model_bin->unk28 != NULL && D_8038371C != NULL){ - func_802E6BD0((s32)modelRenderModelBin + modelRenderModelBin->unk28, modelRenderVextureList, D_8038371C); + func_802E6BD0((s32)modelRenderModelBin + modelRenderModelBin->unk28, modelRendervertexList, D_8038371C); } mlMtxIdent(); @@ -1506,7 +1506,7 @@ void func_8033A4A0(enum asset_e modelId, f32 arg1, f32 arg2){ } void modelRender_setVertexList(BKVertexList *vertexList){ - modelRenderVextureList = vertexList; + modelRendervertexList = vertexList; } void modelRender_setDepthMode(enum model_render_depth_mode_e renderMode){ diff --git a/src/core2/quizquestionaskedbitfield.c b/src/core2/quizquestionaskedbitfield.c new file mode 100644 index 00000000..14afb931 --- /dev/null +++ b/src/core2/quizquestionaskedbitfield.c @@ -0,0 +1,35 @@ +#include +#include "functions.h" +#include "variables.h" + +#define FF_QUESTION_ASKED_BITFIELD_SIZE 0x33 + +/* .bss */ +u8* quizQuestionAskedBitfield; + +/* .code */ +bool quizQuestionAskedBitfield_get(s32 index){ + return func_803200A4(quizQuestionAskedBitfield, index); +} + +void quizQuestionAskedBitfield_free(void){ + free(quizQuestionAskedBitfield); + quizQuestionAskedBitfield = NULL; +} + +void quizQuestionAskedBitfield_init(void){ + int i; + quizQuestionAskedBitfield =(u8*) malloc(FF_QUESTION_ASKED_BITFIELD_SIZE); + for(i = 0; i < FF_QUESTION_ASKED_BITFIELD_SIZE; i++){ + quizQuestionAskedBitfield[i] = 0; + } +} + +void quizQuestionAskedBitfield_set(s32 index, bool value){ + func_8032015C(quizQuestionAskedBitfield, index, value); +} + +void quizQuestionAskedBitfield_defrag(void){ + if(quizQuestionAskedBitfield != NULL) + quizQuestionAskedBitfield = (u8*)defrag(quizQuestionAskedBitfield); +} diff --git a/src/core2/spawnqueue.c b/src/core2/spawnqueue.c index 9bb7c719..3b4d2532 100644 --- a/src/core2/spawnqueue.c +++ b/src/core2/spawnqueue.c @@ -13,7 +13,7 @@ void spawnQueue_lock(void); Actor *func_802D7558(s32 *, s32, ActorInfo*, u32); Actor *func_802D75B4(s32 *, s32, ActorInfo*, u32); Actor *func_802D7610(s32 *, s32, ActorInfo*, u32); -Actor *func_802DEB18(s32 *, s32, ActorInfo*, u32); +Actor *chBottlesBonus_new(s32 *, s32, ActorInfo*, u32); extern ActorInfo D_80365E58; //banjo.without_right_hand extern ActorInfo D_80365EAC; //banjo.playing_gameboy @@ -54,7 +54,7 @@ extern ActorInfo D_80367290; //jingo_orange extern ActorInfo D_803672E0; //chbeehive extern ActorInfo D_80367310; //chswarm extern ActorInfo D_80367390; //chwaterfallfx -extern ActorInfo D_80367404; //scrapnel +extern ActorInfo chShrapnelDescription; //scrapnel extern ActorInfo chGloop; //gloop extern ActorInfo D_803674E0; //mumbo extern ActorInfo D_80367530; //mumbo_token_sign.5 @@ -103,10 +103,10 @@ extern ActorInfo D_80367F30; extern ActorInfo D_8036804C;//GAME_OVER extern ActorInfo D_8036807C;//THE_END extern ActorInfo D_803680AC;//player_KAZOOIE -extern ActorInfo D_803680DC;//copyright_info +extern ActorInfo chOverlayCopyrightDescription;//copyright_info extern ActorInfo D_80368124;//PRESS_START extern ActorInfo D_80368174;//NO_CONTROLLER) -extern ActorInfo D_803682D0; //jiggy_picture +extern ActorInfo chBottlesBonusDescription; //jiggy_picture extern ActorInfo D_8036833C; extern ActorInfo D_8036838C; extern ActorInfo D_80368418; //banjos_hand_BB @@ -189,7 +189,7 @@ void spawnQueue_reset(void){ loaded_asm_file = get_loaded_overlay_id(); spawnQueue_lock(); spawnQueueLength = 0; - func_802D1724(); + chmumbo_func_802D1724(); func_802E1790(); switch(loaded_asm_file){ case OVERLAY_2_WHALE: @@ -295,9 +295,9 @@ void spawnQueue_reset(void){ spawnableActorList_add(&D_8036804C, actor_new, 0x508604);//GAME_OVER spawnableActorList_add(&D_8036807C, actor_new, 0x508604);//THE_END spawnableActorList_add(&D_803680AC, actor_new, 0x508604);//player_KAZOOIE - spawnableActorList_add(&D_803680DC, actor_new, 0x508604);//copyright_info + spawnableActorList_add(&chOverlayCopyrightDescription, actor_new, 0x508604);//copyright_info spawnableActorList_add(&D_80368124, actor_new, 0x508604);//PRESS_START - spawnableActorList_add(&D_803682D0, func_802DEB18, 0x509604);//jiggy_picture + spawnableActorList_add(&chBottlesBonusDescription, chBottlesBonus_new, 0x509604);//jiggy_picture spawnableActorList_add(&D_8036833C, actor_new, 0x508604); spawnableActorList_add(&D_8036838C, actor_new, 0x509604); spawnableActorList_add(&D_80368418, actor_new, 0x508644);//banjos_hand_BB @@ -339,7 +339,7 @@ void spawnQueue_reset(void){ spawnableActorList_addIfMapVisited(&D_803730D8, actor_new, 0x2200021, MAP_1B_MMM_MAD_MONSTER_MANSION); //nibbly spawnableActorList_addIfMapVisited(&D_80367130, actor_new, 0x20009a9, MAP_D_BGS_BUBBLEGLOOP_SWAMP); //buzzbomb spawnableActorList_addIfMapVisited(&D_80372B80, actor_new, 0x2020141, MAP_27_FP_FREEZEEZY_PEAK); - spawnableActorList_addIfMapVisited(&D_80367404, actor_new, 0x2000101, MAP_7_TTC_TREASURE_TROVE_COVE); //scrapnel + spawnableActorList_addIfMapVisited(&chShrapnelDescription, actor_new, 0x2000101, MAP_7_TTC_TREASURE_TROVE_COVE); //scrapnel spawnableActorList_addIfMapVisited(&D_80372D78, actor_new, 0x3010121, MAP_1B_MMM_MAD_MONSTER_MANSION); //limbo spawnableActorList_addIfMapVisited(&D_80372DF8, actor_new, 0x2010121, MAP_31_RBB_RUSTY_BUCKET_BAY); //grublin_hood spawnableActorList_addIfMapVisited(&D_80372E78, actor_new, 0x3010129, MAP_12_GV_GOBIS_VALLEY); //mummum diff --git a/src/fight/chbossjinjobase.c b/src/fight/chbossjinjobase.c index 41381284..7217ed7b 100644 --- a/src/fight/chbossjinjobase.c +++ b/src/fight/chbossjinjobase.c @@ -102,7 +102,7 @@ void func_8038D568(Actor *this){ if(!this->unk16C_4){ this->unk16C_4 = 1; marker_setCollisionScripts(this->marker, NULL, func_8038D428, NULL); - func_803300D8(this->marker, fight_func_8038D510); + marker_setFreeMethod(this->marker, fight_func_8038D510); this->marker->propPtr->unk8_3 = 1; actor_collisionOn(this); this->unk38_31 = 0; diff --git a/src/fight/chfinalboss.c b/src/fight/chfinalboss.c index a917ac2b..3877dca3 100644 --- a/src/fight/chfinalboss.c +++ b/src/fight/chfinalboss.c @@ -2290,7 +2290,7 @@ void chfinalboss_update(Actor *this){ this->marker->propPtr->unk8_3 = 0; actor_collisionOn(this); for(i = 0x38C; i < 0x39F; i++){ - func_80304E24(i, D_803927D0[i - 0x38C]); + nodeProp_findPositionFromActorId(i, D_803927D0[i - 0x38C]); } __chFinalBossFlightPadMarker = NULL; __chFinalBossShadowMarker = NULL; diff --git a/src/fight/chspellbarrier.c b/src/fight/chspellbarrier.c index 8da8f28d..d79a7903 100644 --- a/src/fight/chspellbarrier.c +++ b/src/fight/chspellbarrier.c @@ -71,7 +71,7 @@ void chspellbarrier_update(Actor *this){ if(!this->unk16C_4){ this->unk16C_4 = 1; marker_setCollisionScripts(this->marker, NULL, func_8038E780, NULL); - func_803300D8(this->marker, func_8038E7EC); + marker_setFreeMethod(this->marker, func_8038E7EC); this->marker->propPtr->unk8_3 = 0; actor_collisionOn(this); local->unk0 = 0; diff --git a/src/fight/chspellfireball.c b/src/fight/chspellfireball.c index 938a80d3..c1a3781c 100644 --- a/src/fight/chspellfireball.c +++ b/src/fight/chspellfireball.c @@ -283,7 +283,7 @@ void func_8038F620(Actor *this){ this->scale = 0.1f; if( this->marker->unk14_20 == MARKER_280_GRUNTY_SPELL_GREEN_ATTACK){ actor_collisionOff(this); - func_803300D8(this->marker, func_8038F5F8); + marker_setFreeMethod(this->marker, func_8038F5F8); func_80324CFC(0.0f, COMUSIC_43_ENTER_LEVEL_GLITTER, 32000); timed_playSfx(0.0f, SFX_113_PAD_APPEARS, 1.0f, 32000); timed_playSfx(0.75f, 0x415, 1.0f, 32000); diff --git a/src/lair/code_0.c b/src/lair/code_0.c index 87908c3a..1551f965 100644 --- a/src/lair/code_0.c +++ b/src/lair/code_0.c @@ -818,7 +818,7 @@ void func_80387F1C(void) func_802BAFE4(0x7B); - if (func_80304E24(400, tmp)) + if (nodeProp_findPositionFromActorId(400, tmp)) { jiggySpawn(JIGGY_35_LAIR_CC_WITCH_SWITCH, tmp); // FIXME: macro? diff --git a/src/lair/code_5640.c b/src/lair/code_5640.c index 0fd68237..21de220d 100644 --- a/src/lair/code_5640.c +++ b/src/lair/code_5640.c @@ -97,7 +97,7 @@ void func_8038BCF0(Actor *this) { local = (ActorLocal_lair_5640 *)&this->local; if (!this->initialized) { - func_803300D8(this->marker, func_8038BBC0); + marker_setFreeMethod(this->marker, func_8038BBC0); actor_collisionOff(this); this->unk10_12 = 2; if (!func_8031FF1C(0x5C)) { diff --git a/src/lair/code_5ED0.c b/src/lair/code_5ED0.c index 2e4339ac..3640d47f 100644 --- a/src/lair/code_5ED0.c +++ b/src/lair/code_5ED0.c @@ -53,8 +53,8 @@ void lair_func_8038C6BC(void); /* extern */ extern void func_802FACA4(enum item_e); extern void func_8028FA14(enum map_e, s32); -extern void func_803208C0(u32, int); // ff_isAsked_flag_set -extern int func_803207F0(u32); // ff_isAsked_flag_get +extern void quizQuestionAskedBitfield_set(u32, int); // ff_isAsked_flag_set +extern int quizQuestionAskedBitfield_get(u32); // ff_isAsked_flag_get extern void func_8033F220(BKModel *model, s32 mesh_id, s16 [3]); //! $a2 type unk @@ -400,19 +400,19 @@ void func_8038C2D4(enum ff_question_type_e type) s32 i; for (i = 0; i < FF_QuestionTypeInfoArr[type].totalQuestionCount; i++) - func_803208C0(FF_QuestionTypeInfoArr[type].startingFlagIdx + i, FALSE); + quizQuestionAskedBitfield_set(FF_QuestionTypeInfoArr[type].startingFlagIdx + i, FALSE); } // FF: set isAsked flag for type and question void lair_func_8038C338(enum ff_question_type_e type, s32 questionIdx, int val) { - func_803208C0(FF_QuestionTypeInfoArr[type].startingFlagIdx + questionIdx, val); + quizQuestionAskedBitfield_set(FF_QuestionTypeInfoArr[type].startingFlagIdx + questionIdx, val); } // FF: get isAsked flag for type and question -int lair_func_8038C370(enum ff_question_type_e type, s32 questionIdx) +bool lair_func_8038C370(enum ff_question_type_e type, s32 questionIdx) { - return func_803207F0(FF_QuestionTypeInfoArr[type].startingFlagIdx + questionIdx); + return quizQuestionAskedBitfield_get(FF_QuestionTypeInfoArr[type].startingFlagIdx + questionIdx); } // i love stupid shit like this. these 3 lines of C compile into 150 lines of asm for type handling @@ -459,7 +459,7 @@ void lair_func_8038C640(s32 a0, Struct_lair_5ED0_0 *a1) a1->unk9 = 1; - func_803208C0(a0 - FF_QNF_CNT, TRUE); + quizQuestionAskedBitfield_set(a0 - FF_QNF_CNT, TRUE); } void lair_func_8038C6BC(void) @@ -472,7 +472,7 @@ void lair_func_8038C6BC(void) for (ptr = D_80393760, s1 = FF_QNF_START; s1 != FF_QNF_END; s1++, ptr++) { - ptr->unk9 = func_803207F0(s1 - FF_QNF_CNT) ? 1 : 0; + ptr->unk9 = quizQuestionAskedBitfield_get(s1 - FF_QNF_CNT) ? 1 : 0; if (ptr->unk9 == s3) { @@ -554,7 +554,7 @@ void func_8038CCEC(void) D_8037DCB8 = NULL; func_80319190(); - func_80320818(); + quizQuestionAskedBitfield_free(); func_802C5994(); } @@ -597,7 +597,7 @@ void func_8038CE28(void) func_80319050(); D_8037DCB8 = malloc(sizeof(struct FF_StorageStruct)); - func_80320840(); + quizQuestionAskedBitfield_init(); // dump currently unlocked moves to storage D_8037DCB8->unlockedMoves = func_802957F0(); @@ -633,8 +633,8 @@ void lair_func_8038CF18(void) if (func_803203FC(2) && !func_803203FC(4)) { - func_80320818(); - func_80320840(); + quizQuestionAskedBitfield_free(); + quizQuestionAskedBitfield_init(); for (i = 0; i < ARRLEN(D_8037DCB8->unk3C); i++) D_8037DCB8->unk3C[i] = 0; @@ -868,7 +868,7 @@ void func_8038D5A0(void) ptr->unk9 = 1; - func_803208C0(s0 - FF_QNF_CNT, TRUE); + quizQuestionAskedBitfield_set(s0 - FF_QNF_CNT, TRUE); } } @@ -961,9 +961,9 @@ void func_8038D670(enum FF_Action next_state) { D_8037DCB8->unk3C[D_8037DCB8->ffQuestionType] = 0; func_8038C2D4(D_8037DCB8->ffQuestionType); } - if (((s32) D_8037DCB8->unk4->unk8 >= 7) && (func_803207F0(func_8038D60C(D_8037DCB8->unk8)) == 0)) { + if (((s32) D_8037DCB8->unk4->unk8 >= 7) && (quizQuestionAskedBitfield_get(func_8038D60C(D_8037DCB8->unk8)) == 0)) { func_803463D4(ITEM_27_JOKER_CARD, D_8037DCB8->unk4->unk8 - 6); - func_803208C0(func_8038D60C(D_8037DCB8->unk8), TRUE); + quizQuestionAskedBitfield_set(func_8038D60C(D_8037DCB8->unk8), TRUE); func_80356540(0xA8); } if (D_8037DCB8->unk8 != 0x1EF) { @@ -997,7 +997,7 @@ void func_8038D670(enum FF_Action next_state) { func_8030E6D4(SFX_124_AUDIENCE_CHEERING_1); } if (D_8037DCB8->unk4->unk8 >= 7) { - func_803208C0(func_8038D60C(D_8037DCB8->unk8), TRUE); + quizQuestionAskedBitfield_set(func_8038D60C(D_8037DCB8->unk8), TRUE); lair_func_8038C640(D_8037DCB8->unk8, D_8037DCB8->unk4); } if (func_803203FC(0xA3)) { diff --git a/src/lair/code_9C40.c b/src/lair/code_9C40.c index 690495e9..44cc6f5b 100644 --- a/src/lair/code_9C40.c +++ b/src/lair/code_9C40.c @@ -90,7 +90,7 @@ void func_803902B8(Actor *this) { sp54 = this->marker->unk14_20 - 0x16D; if (!this->initialized) { - func_803300D8(this->marker, func_80390298); + marker_setFreeMethod(this->marker, func_80390298); this->unk138_24 = func_803203FC(UNKFLAGS1_1F_IN_CHARACTER_PARADE); this->initialized = TRUE; } diff --git a/src/lair/code_AD70.c b/src/lair/code_AD70.c index d3e1f814..ad043e68 100644 --- a/src/lair/code_AD70.c +++ b/src/lair/code_AD70.c @@ -232,7 +232,7 @@ void func_80391B04(Actor *this) { func_8038EA10(local->unk10, D_80394BC0); this->unk58_2 = FALSE; func_80391810(this, 1); - func_803300D8(this->marker, func_80391AE4); + marker_setFreeMethod(this->marker, func_80391AE4); this->unk16C_4 = TRUE; } diff --git a/subyaml/core2.us.v10.yaml b/subyaml/core2.us.v10.yaml index 8b79d71a..2501e552 100644 --- a/subyaml/core2.us.v10.yaml +++ b/subyaml/core2.us.v10.yaml @@ -217,7 +217,7 @@ segments: - [0x556C0, c, code_556C0] #DONE - [0x55850, c, code_55850] #DONE - [0x55A90, c, code_55A90] #DONE - - [0x55BC0, c, code_55BC0] #DONE + - [0x55BC0, c, ch/overlaypressstart] #DONE - [0x55E20, c, code_55E70] #DONE - [0x560F0, c, code_560F0] #DONE - [0x57C70, c, code_57C70] #DONE @@ -508,7 +508,7 @@ segments: - [0xE10E0, .data, code_556C0] - [0xE1110, .data, code_55850] - [0xE1140, .data, code_55A90] - - [0xE1170, .data, code_55BC0] + - [0xE1170, .data, ch/overlaypressstart] - [0xE11C0, .data, code_55E70] - [0xE1210, .data, code_560F0] - [0xE1370, .data, code_57C70] @@ -728,7 +728,7 @@ segments: - [0xEFF40, .rodata, code_54D50] - [0xEFF60, .rodata, code_55180] - [0xEFF70, .rodata, code_55390] - - [0xEFF80, .rodata, code_55BC0] + - [0xEFF80, .rodata, ch/overlaypressstart] - [0xEFF90, .rodata, code_55E70] - [0xEFFA0, .rodata, code_560F0] - [0xF0010, .rodata, code_57C70] @@ -981,7 +981,7 @@ segments: - [0xf2c00, .bss, code_556C0] - [0xf2c00, .bss, code_55850] - [0xf2c00, .bss, code_55A90] - - [0xf2c00, .bss, code_55BC0] + - [0xf2c00, .bss, ch/overlaypressstart] - [0xf2c00, .bss, code_55E70] - [0xf2c00, .bss, code_560F0] - [0xf2c00, .bss, code_57C70] diff --git a/symbol_addrs.us.v10.txt b/symbol_addrs.us.v10.txt index f84a3a08..e273979a 100644 --- a/symbol_addrs.us.v10.txt +++ b/symbol_addrs.us.v10.txt @@ -724,7 +724,7 @@ mapSpecificFlags_setN = 0x802CAE24; mapSpecificFlags_getAll = 0x802CAE8C; mapSpecificFlags_setAll = 0x802CAE98; mapSpecificFlags_validateCRC1 = 0x802CB00C; -func_802D1724 = 0x802D1724; +chmumbo_func_802D1724 = 0x802D1724; func_802D94B4 = 0x802D94B4; func_802DA498 = 0x802DA498; func_802DB548 = 0x802DB548; @@ -962,7 +962,7 @@ D_80366240 = 0x80366240; D_80366338 = 0x80366338; D_8036633C = 0x8036633C; D_80367DC4 = 0x80367DC4; -D_803682D0 = 0x803682D0; +chBottlesBonusDescription = 0x803682D0; D_803688E0 = 0x803688E0; D_803688E8 = 0x803688E8; D_8036A070 = 0x8036A070; @@ -1186,7 +1186,7 @@ __osCleanupThread = 0x8026ABE0; __osDisableInt = 0x8026ACB0; __osRestoreInt = 0x8026ACD0; D_A0000238 = 0xA0000238; -D_803682D0 = 0x803682D0; +chBottlesBonusDescription = 0x803682D0; D_80004FF4 = 0x80004FF4;