From a353c4d954fb5b50c8b48fe3f9d67c95ccaab299 Mon Sep 17 00:00:00 2001 From: coco875 Date: Thu, 5 Sep 2024 21:23:52 +0200 Subject: [PATCH] rename to initiate_next_state --- .../update_objects/func_80082F1C.s | 2 +- src/update_objects.c | 5052 +++++++++-------- src/update_objects.h | 171 +- 3 files changed, 2759 insertions(+), 2466 deletions(-) diff --git a/asm/non_matchings/update_objects/func_80082F1C.s b/asm/non_matchings/update_objects/func_80082F1C.s index 8426d180d..8aa211698 100644 --- a/asm/non_matchings/update_objects/func_80082F1C.s +++ b/asm/non_matchings/update_objects/func_80082F1C.s @@ -25,7 +25,7 @@ glabel func_80082F1C /* 083B5C 80082F5C AFB00018 */ sw $s0, 0x18($sp) /* 083B60 80082F60 00808025 */ move $s0, $a0 /* 083B64 80082F64 AFA5002C */ sw $a1, 0x2c($sp) -/* 083B68 80082F68 0C01C922 */ jal reset_timer_go_next_state +/* 083B68 80082F68 0C01C922 */ jal initiate_next_state /* 083B6C 80082F6C E4440000 */ swc1 $f4, ($v0) /* 083B70 80082F70 8FA9002C */ lw $t1, 0x2c($sp) /* 083B74 80082F74 3C0B800E */ lui $t3, %hi(D_800E5DF4) # $t3, 0x800e diff --git a/src/update_objects.c b/src/update_objects.c index fd15c7151..4ef3aa031 100644 --- a/src/update_objects.c +++ b/src/update_objects.c @@ -37,73 +37,88 @@ #include "memory.h" //! @todo unused? -f32 D_800E43B0[] = { - 65536.0, 0.0, 1.0, 0.0, - 0.0, 65536.0, 0.0, 1.0, - 0.0, 0.0, 0.0, 0.0, - 0.0, 0.0, 0.0, 0.0 -}; +f32 D_800E43B0[] = { 65536.0, 0.0, 1.0, 0.0, 0.0, 65536.0, 0.0, 1.0, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; Vtx D_800E43F0[] = { - {{{ -24, -19, 0}, 0, { 0, 0}, { 0xFF, 0xFF, 0xFF, 0xFF}}}, - {{{ 23, -19, 0}, 0, { 3008, 0}, { 0xFF, 0xFF, 0xFF, 0xFF}}}, - {{{ 23, 20, 0}, 0, { 3008, 2496}, { 0xFF, 0xFF, 0xFF, 0xFF}}}, - {{{ -24, 20, 0}, 0, { 0, 2496}, { 0xFF, 0xFF, 0xFF, 0xFF}}}, - {{{ -24, -19, 0}, 0, { 3008, 0}, { 0xFF, 0xFF, 0xFF, 0xFF}}}, - {{{ 23, -19, 0}, 0, { 0, 0}, { 0xFF, 0xFF, 0xFF, 0xFF}}}, - {{{ 23, 20, 0}, 0, { 0, 2496}, { 0xFF, 0xFF, 0xFF, 0xFF}}}, - {{{ -24, 20, 0}, 0, { 3008, 2496}, { 0xFF, 0xFF, 0xFF, 0xFF}}}, + { { { -24, -19, 0 }, 0, { 0, 0 }, { 0xFF, 0xFF, 0xFF, 0xFF } } }, + { { { 23, -19, 0 }, 0, { 3008, 0 }, { 0xFF, 0xFF, 0xFF, 0xFF } } }, + { { { 23, 20, 0 }, 0, { 3008, 2496 }, { 0xFF, 0xFF, 0xFF, 0xFF } } }, + { { { -24, 20, 0 }, 0, { 0, 2496 }, { 0xFF, 0xFF, 0xFF, 0xFF } } }, + { { { -24, -19, 0 }, 0, { 3008, 0 }, { 0xFF, 0xFF, 0xFF, 0xFF } } }, + { { { 23, -19, 0 }, 0, { 0, 0 }, { 0xFF, 0xFF, 0xFF, 0xFF } } }, + { { { 23, 20, 0 }, 0, { 0, 2496 }, { 0xFF, 0xFF, 0xFF, 0xFF } } }, + { { { -24, 20, 0 }, 0, { 3008, 2496 }, { 0xFF, 0xFF, 0xFF, 0xFF } } }, }; Vtx D_800E4470[] = { - {{{ -24, -19, 0}, 0, { 0, 0}, { 0xFF, 0xFF, 0xFF, 0xFF}}}, - {{{ 23, -19, 0}, 0, { 3008, 0}, { 0xFF, 0xFF, 0xFF, 0xFF}}}, - {{{ 23, 20, 0}, 0, { 3008, 2496}, { 0xFF, 0xFF, 0xFF, 0xFF}}}, - {{{ -24, 20, 0}, 0, { 0, 2496}, { 0xFF, 0xFF, 0xFF, 0xFF}}}, + { { { -24, -19, 0 }, 0, { 0, 0 }, { 0xFF, 0xFF, 0xFF, 0xFF } } }, + { { { 23, -19, 0 }, 0, { 3008, 0 }, { 0xFF, 0xFF, 0xFF, 0xFF } } }, + { { { 23, 20, 0 }, 0, { 3008, 2496 }, { 0xFF, 0xFF, 0xFF, 0xFF } } }, + { { { -24, 20, 0 }, 0, { 0, 2496 }, { 0xFF, 0xFF, 0xFF, 0xFF } } }, }; Vtx D_800E44B0[] = { - {{{ -24, -19, 0}, 0, { 3008, 0}, { 0xFF, 0xFF, 0xFF, 0xFF}}}, - {{{ 23, -19, 0}, 0, { 0, 0}, { 0xFF, 0xFF, 0xFF, 0xFF}}}, - {{{ 23, 20, 0}, 0, { 0, 2496}, { 0xFF, 0xFF, 0xFF, 0xFF}}}, - {{{ -24, 20, 0}, 0, { 3008, 2496}, { 0xFF, 0xFF, 0xFF, 0xFF}}}, + { { { -24, -19, 0 }, 0, { 3008, 0 }, { 0xFF, 0xFF, 0xFF, 0xFF } } }, + { { { 23, -19, 0 }, 0, { 0, 0 }, { 0xFF, 0xFF, 0xFF, 0xFF } } }, + { { { 23, 20, 0 }, 0, { 0, 2496 }, { 0xFF, 0xFF, 0xFF, 0xFF } } }, + { { { -24, 20, 0 }, 0, { 3008, 2496 }, { 0xFF, 0xFF, 0xFF, 0xFF } } }, }; -u16 *gItemWindowTLUTs[] = { - common_tlut_item_window_none, common_tlut_item_window_banana, common_tlut_item_window_banana_bunch, common_tlut_item_window_green_shell, - common_tlut_item_window_triple_green_shell, common_tlut_item_window_red_shell, common_tlut_item_window_triple_red_shell, common_tlut_item_window_blue_shell, - common_tlut_item_window_thunder_bolt, common_tlut_item_window_fake_item_box, common_tlut_item_window_star, common_tlut_item_window_boo, - common_tlut_item_window_mushroom, common_tlut_item_window_double_mushroom, common_tlut_item_window_triple_mushroom, common_tlut_item_window_super_mushroom -}; +u16 *gItemWindowTLUTs[] = { common_tlut_item_window_none, + common_tlut_item_window_banana, + common_tlut_item_window_banana_bunch, + common_tlut_item_window_green_shell, + common_tlut_item_window_triple_green_shell, + common_tlut_item_window_red_shell, + common_tlut_item_window_triple_red_shell, + common_tlut_item_window_blue_shell, + common_tlut_item_window_thunder_bolt, + common_tlut_item_window_fake_item_box, + common_tlut_item_window_star, + common_tlut_item_window_boo, + common_tlut_item_window_mushroom, + common_tlut_item_window_double_mushroom, + common_tlut_item_window_triple_mushroom, + common_tlut_item_window_super_mushroom }; -u8 *gItemWindowTextures[] = { - common_texture_item_window_none, common_texture_item_window_banana, common_texture_item_window_banana_bunch, common_texture_item_window_green_shell, - common_texture_item_window_triple_green_shell, common_texture_item_window_red_shell, common_texture_item_window_triple_red_shell, common_texture_item_window_blue_shell, - common_texture_item_window_thunder_bolt, common_texture_item_window_fake_item_box, common_texture_item_window_star, common_texture_item_window_boo, - common_texture_item_window_mushroom, common_texture_item_window_double_mushroom, common_texture_item_window_triple_mushroom, common_texture_item_window_super_mushroom -}; +u8 *gItemWindowTextures[] = { common_texture_item_window_none, + common_texture_item_window_banana, + common_texture_item_window_banana_bunch, + common_texture_item_window_green_shell, + common_texture_item_window_triple_green_shell, + common_texture_item_window_red_shell, + common_texture_item_window_triple_red_shell, + common_texture_item_window_blue_shell, + common_texture_item_window_thunder_bolt, + common_texture_item_window_fake_item_box, + common_texture_item_window_star, + common_texture_item_window_boo, + common_texture_item_window_mushroom, + common_texture_item_window_double_mushroom, + common_texture_item_window_triple_mushroom, + common_texture_item_window_super_mushroom }; -u16 *gHudLapTextures[] = { - common_texture_hud_lap_1_on_3, common_texture_hud_lap_2_on_3, common_texture_hud_lap_3_on_3 -}; +u16 *gHudLapTextures[] = { common_texture_hud_lap_1_on_3, common_texture_hud_lap_2_on_3, + common_texture_hud_lap_3_on_3 }; -u16 *gPortraitTLUTs[] = { - common_tlut_portrait_mario, common_tlut_portrait_luigi, common_tlut_portrait_yoshi, common_tlut_portrait_toad, - common_tlut_portrait_donkey_kong, common_tlut_portrait_wario, common_tlut_portrait_peach, common_tlut_portrait_bowser -}; +u16 *gPortraitTLUTs[] = { common_tlut_portrait_mario, common_tlut_portrait_luigi, + common_tlut_portrait_yoshi, common_tlut_portrait_toad, + common_tlut_portrait_donkey_kong, common_tlut_portrait_wario, + common_tlut_portrait_peach, common_tlut_portrait_bowser }; -u8 *gPortraitTextures[] = { - common_texture_portrait_mario, common_texture_portrait_luigi, common_texture_portrait_yoshi, common_texture_portrait_toad, - common_texture_portrait_donkey_kong, common_texture_portrait_wario, common_texture_portrait_peach, common_texture_portrait_bowser -}; +u8 *gPortraitTextures[] = { common_texture_portrait_mario, common_texture_portrait_luigi, + common_texture_portrait_yoshi, common_texture_portrait_toad, + common_texture_portrait_donkey_kong, common_texture_portrait_wario, + common_texture_portrait_peach, common_texture_portrait_bowser }; -s32 find_unused_obj_index(s32* arg0) { +s32 find_unused_obj_index(s32 *arg0) { s32 temp_v0; s32 temp_v1; temp_v1 = objectListSize; - temp_v0 = 0; do - { + temp_v0 = 0; + do { ++temp_v1; ++temp_v0; @@ -152,9 +167,9 @@ s32 add_unused_obj_index(s32 *listIdx, s32 *nextFree, s32 size) { * @todo This HAS to be a for-loop of some variety, but I can't make a for-loop to match. * If you replace this with ```for(var_v1 = 0; var_v1 < size; var_v1++)``` * The diff gets massive. - */ + */ if (size > 0) { -loop_3: + loop_3: if (*id == NULL_OBJECT_ID) { objectIndex = find_unused_obj_index(id); *nextFree += 1; @@ -184,15 +199,15 @@ void func_80072120(s32 *arg0, s32 arg1) { s32 i; for (i = 0; i < arg1; i++) { - set_object_flag_status_false(*arg0, 0x00600000); - arg0++; + set_object_flag_status_false(*arg0, 0x00600000); + arg0++; } } void func_80072180(void) { if (gModeSelection == TIME_TRIALS) { - if (((gPlayerOne->type & PLAYER_EXISTS) != 0) && - ((gPlayerOne->type & (PLAYER_INVISIBLE_OR_BOMB | PLAYER_KART_AI)) == 0)) { + if (((gPlayerOne->type & PLAYER_EXISTS) != 0) + && ((gPlayerOne->type & (PLAYER_INVISIBLE_OR_BOMB | PLAYER_KART_AI)) == 0)) { D_80162DF8 = 1; } } @@ -283,8 +298,8 @@ void func_80072428(s32 objectIndex) { func_80086F60(objectIndex); } -void reset_timer_go_next_state(s32 objectIndex) { - set_object_timer_running(objectIndex, 0); +void initiate_next_state(s32 objectIndex) { + set_object_timer_running(objectIndex, 0); set_object_flag_status_false(objectIndex, 0x2000); gObjectList[objectIndex].state++; } @@ -307,7 +322,7 @@ void func_80072568(s32 objectIndex, s32 arg1) { set_object_timer_running(objectIndex, 0); set_object_flag_status_false(objectIndex, 0x2000); set_object_flag_status_false(objectIndex, 8); - reset_timer_go_next_state(objectIndex); + initiate_next_state(objectIndex); func_800724F8(objectIndex, gObjectList[objectIndex].state); gObjectList[objectIndex].state = arg1; } @@ -318,7 +333,7 @@ void func_800725E8(s32 objectIndex, s32 arg1, s32 arg2) { set_object_flag_status_false(objectIndex, 8); gObjectList[objectIndex].state = arg2; func_800724F8(objectIndex, gObjectList[objectIndex].state); - gObjectList[objectIndex].state = arg1; + gObjectList[objectIndex].state = arg1; } s16 func_80072530(s32); // extern @@ -344,7 +359,7 @@ UNUSED void func_8007271C(s32 objectIndex, s32 arg1) { UNUSED void func_8007274C(s32 objectIndex) { if (gObjectList[objectIndex].isTimerRunning == 0) { - reset_timer_go_next_state(objectIndex); + initiate_next_state(objectIndex); } } @@ -363,10 +378,10 @@ bool set_and_run_timer_object(s32 objectIndex, s32 timer) { gObjectList[objectIndex].timer--; if (gObjectList[objectIndex].timer < 0) { set_object_timer_running(objectIndex, false); - reset_timer_go_next_state(objectIndex); + initiate_next_state(objectIndex); phi_v1 = true; } - + return phi_v1; } @@ -382,10 +397,10 @@ UNUSED s32 func_8007281C(s32 objectIndex, s32 arg1) { gObjectList[objectIndex].timer--; if (gObjectList[objectIndex].timer < 0) { set_object_timer_running(objectIndex, 0); - reset_timer_go_next_state(objectIndex); + initiate_next_state(objectIndex); phi_a2 = 1; } - + return phi_a2; } @@ -401,10 +416,10 @@ UNUSED s32 func_800728B0(s32 objectIndex, s32 arg1, s32 arg2) { gObjectList[objectIndex].timer--; if (gObjectList[objectIndex].timer < 0) { set_object_timer_running(objectIndex, 0); - reset_timer_go_next_state(objectIndex); + initiate_next_state(objectIndex); phi_a3 = 1; } - + return phi_a3; } @@ -421,7 +436,7 @@ UNUSED void func_80072974(s32 objectIndex, s32 arg1, s32 arg2, s32 arg3) { } UNUSED void func_80072998(s32 objectIndex) { - gObjectList[objectIndex].unk_0CC = 0; + gObjectList[objectIndex].unk_0CC = 0; } void func_800729B4(s32 objectIndex, s32 arg1) { @@ -433,17 +448,17 @@ void set_type_object(s32 objectIndex, s32 arg1) { } void func_800729EC(s32 objectIndex) { - u32 temp_v1 = 1; + u32 temp_v1 = 1; s32 i; start_race(); - reset_timer_go_next_state(objectIndex); + initiate_next_state(objectIndex); D_8018D2BC = 1; D_8018D2A4 = 1; if (gCurrentCourseId != COURSE_YOSHI_VALLEY) { for (i = 0; i < gPlayerCount; i++) { - playerHUD[i].unk_81 = temp_v1; + playerHUD[i].unk_81 = temp_v1; } } func_8005AB20(); @@ -451,7 +466,7 @@ void func_800729EC(s32 objectIndex) { UNUSED void func_80072A78(s32 objectIndex, s32 arg1) { gObjectList[objectIndex].textureListIndex = arg1; - reset_timer_go_next_state(objectIndex); + initiate_next_state(objectIndex); } s32 func_80072AAC(s32 objectIndex, s32 arg1, s32 arg2) { @@ -468,7 +483,7 @@ s32 func_80072AAC(s32 objectIndex, s32 arg1, s32 arg2) { gObjectList[objectIndex].timer--; if (gObjectList[objectIndex].timer < 0) { set_object_timer_running(objectIndex, 0); - reset_timer_go_next_state(objectIndex); + initiate_next_state(objectIndex); phi_v1 = 1; } @@ -490,7 +505,7 @@ s32 func_80072B48(s32 objectIndex, s32 arg1) { if (gObjectList[objectIndex].timer < 0) { set_object_flag_status_false(objectIndex, 0x80000); set_object_timer_running(objectIndex, 0); - reset_timer_go_next_state(objectIndex); + initiate_next_state(objectIndex); phi_v1 = 1; } @@ -524,7 +539,7 @@ void func_80072C00(s32 objectIndex, s32 arg1, s32 arg2, s32 arg3) { if (gObjectList[objectIndex].unk_0CC == 0) { set_object_flag_status_false(objectIndex, 0x2000); - reset_timer_go_next_state(objectIndex); + initiate_next_state(objectIndex); } } } @@ -550,7 +565,7 @@ void func_80072D3C(s32 objectIndex, s32 arg1, s32 arg2, s32 arg3, s32 arg4) { } else { gObjectList[objectIndex].textureListIndex = arg2; } - + if (gObjectList[objectIndex].unk_0D4 < 0) { gObjectList[objectIndex].unk_0D4 = 1; if (gObjectList[objectIndex].unk_0CC > 0) { @@ -559,7 +574,7 @@ void func_80072D3C(s32 objectIndex, s32 arg1, s32 arg2, s32 arg3, s32 arg4) { if (gObjectList[objectIndex].unk_0CC == 0) { set_object_flag_status_false(objectIndex, 0x2000); - reset_timer_go_next_state(objectIndex); + initiate_next_state(objectIndex); } } } @@ -589,7 +604,7 @@ s32 func_80072E54(s32 objectIndex, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 a gObjectList[objectIndex].textureListIndex = arg2; set_object_flag_status_false(objectIndex, 0x2000); set_object_timer_running(objectIndex, 0); - reset_timer_go_next_state(objectIndex); + initiate_next_state(objectIndex); sp24 = 1; } else { gObjectList[objectIndex].textureListIndex = arg1; @@ -623,7 +638,7 @@ bool func_80072F88(s32 objectIndex, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 gObjectList[objectIndex].textureListIndex = arg2; set_object_flag_status_false(objectIndex, 0x2000); set_object_timer_running(objectIndex, 0); - reset_timer_go_next_state(objectIndex); + initiate_next_state(objectIndex); sp24 = true; } else { gObjectList[objectIndex].textureListIndex = arg1; @@ -638,7 +653,7 @@ bool func_800730BC(s32 objectIndex, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 s32 sp24; sp24 = false; - if (is_obj_index_flag_status_inactive(objectIndex ,0x2000) != 0) { + if (is_obj_index_flag_status_inactive(objectIndex, 0x2000) != 0) { gObjectList[objectIndex].textureListIndex = arg1; gObjectList[objectIndex].timer = arg4; gObjectList[objectIndex].unk_0CC = arg5; @@ -667,7 +682,7 @@ bool func_800730BC(s32 objectIndex, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 set_object_flag_status_false(objectIndex, 0x80); set_object_flag_status_false(objectIndex, 0x2000); set_object_timer_running(objectIndex, 0); - reset_timer_go_next_state(objectIndex); + initiate_next_state(objectIndex); sp24 = true; } else { set_object_flag_status_false(objectIndex, 0x4000); @@ -711,7 +726,7 @@ s32 func_8007326C(s32 objectIndex, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 a if (gObjectList[objectIndex].unk_0CC == 0) { set_object_flag_status_false(objectIndex, 0x2000); set_object_timer_running(objectIndex, 0); - reset_timer_go_next_state(objectIndex); + initiate_next_state(objectIndex); sp24 = 1; } else { set_object_flag_status_false(objectIndex, 0x4000); @@ -724,15 +739,15 @@ s32 func_8007326C(s32 objectIndex, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 a } void func_80073404(s32 objectIndex, u8 arg1, u8 arg2, Vtx *arg3) { - gObjectList[objectIndex].vertex = arg3; - gObjectList[objectIndex].textureWidth = arg1; - gObjectList[objectIndex].textureHeight = arg2; - gObjectList[objectIndex].textureListIndex = 0; - gObjectList[objectIndex].unk_0D3 = -1; - gObjectList[objectIndex].status = 0; + gObjectList[objectIndex].vertex = arg3; + gObjectList[objectIndex].textureWidth = arg1; + gObjectList[objectIndex].textureHeight = arg2; + gObjectList[objectIndex].textureListIndex = 0; + gObjectList[objectIndex].unk_0D3 = -1; + gObjectList[objectIndex].status = 0; } -void init_texture_object(s32 objectIndex, u8 *texture, u8* arg2, u8 arg3, u16 arg4) { +void init_texture_object(s32 objectIndex, u8 *texture, u8 *arg2, u8 arg3, u16 arg4) { gObjectList[objectIndex].tlutList = texture; gObjectList[objectIndex].textureList = arg2; gObjectList[objectIndex].textureWidth = arg3; @@ -758,13 +773,17 @@ UNUSED void func_800734D4() { void update_neon_texture(s32 objectIndex) { // I have no idea why this typecast works - gObjectList[objectIndex].activeTLUT = (u8*)((u32*)gObjectList[objectIndex].tlutList + (gObjectList[objectIndex].textureListIndex * 128)); + gObjectList[objectIndex].activeTLUT = (u8 *) ((u32 *) gObjectList[objectIndex].tlutList + + (gObjectList[objectIndex].textureListIndex * 128)); gObjectList[objectIndex].activeTexture = gObjectList[objectIndex].textureList; } void func_80073514(s32 objectIndex) { gObjectList[objectIndex].activeTLUT = gObjectList[objectIndex].tlutList; - gObjectList[objectIndex].activeTexture = gObjectList[objectIndex].textureList + (gObjectList[objectIndex].textureWidth * gObjectList[objectIndex].textureHeight * gObjectList[objectIndex].textureListIndex); + gObjectList[objectIndex].activeTexture = + gObjectList[objectIndex].textureList + + (gObjectList[objectIndex].textureWidth * gObjectList[objectIndex].textureHeight + * gObjectList[objectIndex].textureListIndex); } UNUSED void func_80073568() { @@ -778,13 +797,13 @@ UNUSED void func_80073570(s32 objectIndex) { D_8018D1EC = 0; } (*test)++; -} +} void func_800735BC(s32 objectIndex, Gfx *arg1, f32 arg2) { gObjectList[objectIndex].status = 0; gObjectList[objectIndex].model = arg1; gObjectList[objectIndex].sizeScaling = arg2; - reset_timer_go_next_state(objectIndex); + initiate_next_state(objectIndex); } void func_80073600(s32 objectIndex) { @@ -849,7 +868,7 @@ void func_80073884(s32 objectIndex) { gObjectList[objectIndex].unk_0CF = 0; } -s32 func_800738A8(s32 objectIndex, s16* arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6) { +s32 func_800738A8(s32 objectIndex, s16 *arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6) { s32 phi_t0; phi_t0 = 0; @@ -883,17 +902,17 @@ s32 func_800738A8(s32 objectIndex, s16* arg1, s32 arg2, s32 arg3, s32 arg4, s32 return phi_t0; } -void func_80073998(s32 arg0, s16* arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6) { +void func_80073998(s32 arg0, s16 *arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6) { func_800738A8(arg0, arg1, arg2, arg3, arg4, arg5, arg6); } -UNUSED void func_800739CC(s32 arg0, s16* arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6) { +UNUSED void func_800739CC(s32 arg0, s16 *arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6) { if (*arg1 < arg3) { func_800738A8(arg0, arg1, arg2, arg3, arg4, arg5, arg6); } } -bool func_80073A10(s32 objectIndex, s16* arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6) { +bool func_80073A10(s32 objectIndex, s16 *arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6) { bool phi_t0; phi_t0 = false; @@ -927,17 +946,18 @@ bool func_80073A10(s32 objectIndex, s16* arg1, s32 arg2, s32 arg3, s32 arg4, s32 return phi_t0; } -s32 func_80073B00(s32 arg0, s16* arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6) { +s32 func_80073B00(s32 arg0, s16 *arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6) { return func_80073A10(arg0, arg1, arg2, arg3, arg4, arg5, arg6); } -s32 func_80073B34(s32 arg0, s16* arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6) { +s32 func_80073B34(s32 arg0, s16 *arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6) { if (arg3 < *arg1) { return func_80073A10(arg0, arg1, arg2, arg3, arg4, arg5, arg6); } } -bool func_80073B78(s32 arg0, s32 objectIndex, s16* arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6, s32 arg7) { +bool func_80073B78(s32 arg0, s32 objectIndex, s16 *arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6, + s32 arg7) { s32 phi_t0; phi_t0 = false; @@ -980,15 +1000,15 @@ bool func_80073B78(s32 arg0, s32 objectIndex, s16* arg2, s32 arg3, s32 arg4, s32 return phi_t0; } -bool func_80073CB0(s32 objectIndex, s16* arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6) { +bool func_80073CB0(s32 objectIndex, s16 *arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6) { return func_80073B78(1, objectIndex, arg1, arg2, arg3, arg4, arg5, arg6); } -bool func_80073D0C(s32 objectIndex, s16* arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6) { +bool func_80073D0C(s32 objectIndex, s16 *arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6) { return func_80073B78(0, objectIndex, arg1, arg2, arg3, arg4, arg5, arg6); } -UNUSED void func_80073D68(s32 objectIndex, s16* arg1, s16 arg2, s32 arg3) { +UNUSED void func_80073D68(s32 objectIndex, s16 *arg1, s16 arg2, s32 arg3) { *arg1 = *arg1 + arg3; if (*arg1 >= arg2) { *arg1 = arg2; @@ -997,7 +1017,7 @@ UNUSED void func_80073D68(s32 objectIndex, s16* arg1, s16 arg2, s32 arg3) { } } -void func_80073DC0(s32 objectIndex, s16* arg1, s16 arg2, s32 arg3) { +void func_80073DC0(s32 objectIndex, s16 *arg1, s16 arg2, s32 arg3) { *arg1 = *arg1 - arg3; if (arg2 >= *arg1) { *arg1 = arg2; @@ -1006,7 +1026,7 @@ void func_80073DC0(s32 objectIndex, s16* arg1, s16 arg2, s32 arg3) { } } -bool func_80073E18(s32 objectIndex, u16* arg1, u16 arg2, s32 arg3) { +bool func_80073E18(s32 objectIndex, u16 *arg1, u16 arg2, s32 arg3) { bool phi_t0; s32 temp_v1; @@ -1025,11 +1045,11 @@ bool func_80073E18(s32 objectIndex, u16* arg1, u16 arg2, s32 arg3) { *arg1 += arg2; gObjectList[objectIndex].unk_048 = temp_v1; } - + return phi_t0; } -UNUSED bool func_80073ED4(s32 objectIndex, u16* arg1, u16 arg2, s32 arg3) { +UNUSED bool func_80073ED4(s32 objectIndex, u16 *arg1, u16 arg2, s32 arg3) { bool phi_t0; s32 temp_v1; @@ -1065,10 +1085,9 @@ void func_80073FD4(s32 objectIndex) { } UNUSED void func_80074014(void) { - } -bool func_8007401C(s32 objectIndex, f32* arg1, f32 arg2, f32 arg3, f32 arg4, s32 arg5, s32 arg6) { +bool func_8007401C(s32 objectIndex, f32 *arg1, f32 arg2, f32 arg3, f32 arg4, s32 arg5, s32 arg6) { bool phi_a3; phi_a3 = false; @@ -1097,21 +1116,21 @@ bool func_8007401C(s32 objectIndex, f32* arg1, f32 arg2, f32 arg3, f32 arg4, s32 } } } - + return phi_a3; } -s32 func_80074118(s32 objectIndex, f32* arg1, f32 arg2, f32 arg3, f32 arg4, s32 arg5, s32 arg6) { +s32 func_80074118(s32 objectIndex, f32 *arg1, f32 arg2, f32 arg3, f32 arg4, s32 arg5, s32 arg6) { return func_8007401C(objectIndex, arg1, arg2, arg3, arg4, arg5, arg6); } -s32 func_8007415C(s32 objectIndex, f32* arg1, f32 arg2, f32 arg3, f32 arg4, s32 arg5, s32 arg6) { +s32 func_8007415C(s32 objectIndex, f32 *arg1, f32 arg2, f32 arg3, f32 arg4, s32 arg5, s32 arg6) { if (*arg1 < arg3) { return func_8007401C(objectIndex, arg1, arg2, arg3, arg4, arg5, arg6); } } -s32 func_800741B4(s32 objectIndex, f32* arg1, f32 arg2, f32 arg3, f32 arg4, s32 arg5, s32 arg6) { +s32 func_800741B4(s32 objectIndex, f32 *arg1, f32 arg2, f32 arg3, f32 arg4, s32 arg5, s32 arg6) { if (gObjectList[objectIndex].unk_0CD == 0) { *arg1 = arg2; gObjectList[objectIndex].unk_0AA = arg5; @@ -1136,22 +1155,23 @@ s32 func_800741B4(s32 objectIndex, f32* arg1, f32 arg2, f32 arg3, f32 arg4, s32 } } } - + return 0; } - -UNUSED void func_800742A8(s32 objectIndex, f32* arg1, f32 arg2, f32 arg3, f32 arg4, s32 arg5, s32 arg6) { +UNUSED void func_800742A8(s32 objectIndex, f32 *arg1, f32 arg2, f32 arg3, f32 arg4, s32 arg5, + s32 arg6) { func_800741B4(objectIndex, arg1, arg2, arg3, arg4, arg5, arg6); } -UNUSED void func_800742EC(s32 objectIndex, f32* arg1, f32 arg2, f32 arg3, f32 arg4, s32 arg5, s32 arg6) { +UNUSED void func_800742EC(s32 objectIndex, f32 *arg1, f32 arg2, f32 arg3, f32 arg4, s32 arg5, + s32 arg6) { if (arg3 < *arg1) { func_800741B4(objectIndex, arg1, arg2, arg3, arg4, arg5, arg6); } } -void func_80074344(s32 objectIndex, f32* arg1, f32 arg2, f32 arg3, f32 arg4, s32 arg5, s32 arg6) { +void func_80074344(s32 objectIndex, f32 *arg1, f32 arg2, f32 arg3, f32 arg4, s32 arg5, s32 arg6) { if (gObjectList[objectIndex].unk_0CD == 0) { *arg1 = arg2; gObjectList[objectIndex].unk_0AA = arg5; @@ -1203,7 +1223,7 @@ void func_800744CC(void) { } } -void func_80074510(uintptr_t devAddr, void * vaddr, size_t nbytes) { +void func_80074510(uintptr_t devAddr, void *vaddr, size_t nbytes) { func_800744CC(); osPiStartDma(&gDmaIoMesg, OS_MESG_PRI_NORMAL, OS_READ, devAddr, vaddr, nbytes, &gDmaMesgQueue); D_8018D224 = 1; @@ -1227,8 +1247,11 @@ void func_800745C8(s32 objectIndex, s32 arg1) { if ((gObjectList[objectIndex].status & 2) != 0) { phi_a1 = 1; } - - gObjectList[objectIndex].activeTexture = (u8 *) (gObjectList[objectIndex].textureWidth * gObjectList[objectIndex].textureHeight * phi_a1) + arg1; + + gObjectList[objectIndex].activeTexture = + (u8 *) (gObjectList[objectIndex].textureWidth * gObjectList[objectIndex].textureHeight + * phi_a1) + + arg1; func_800744A0(objectIndex); } } @@ -1238,20 +1261,24 @@ void func_8007466C(s32 objectIndex, s32 arg1) { if ((gObjectList[objectIndex].status & 1) != 0) { // I have no idea why this typecase works - gObjectList[objectIndex].activeTLUT = (u8*) ((u32*)gObjectList[objectIndex].tlutList + (gObjectList[objectIndex].unk_0D3 << 7)) ; + gObjectList[objectIndex].activeTLUT = (u8 *) ((u32 *) gObjectList[objectIndex].tlutList + + (gObjectList[objectIndex].unk_0D3 << 7)); gObjectList[objectIndex].status ^= 2; phi_a1 = 0; if ((gObjectList[objectIndex].status & 2) != 0) { phi_a1 = 1; } - gObjectList[objectIndex].activeTexture = (u8 *) (gObjectList[objectIndex].textureWidth * gObjectList[objectIndex].textureHeight * phi_a1) + arg1; + gObjectList[objectIndex].activeTexture = + (u8 *) (gObjectList[objectIndex].textureWidth * gObjectList[objectIndex].textureHeight + * phi_a1) + + arg1; func_800744A0(objectIndex); } } void func_80074704(s32 objectIndex, s32 arg1) { s32 phi_a1; - + if ((gObjectList[objectIndex].status & 1) != 0) { gObjectList[objectIndex].activeTLUT = gObjectList[objectIndex].tlutList; gObjectList[objectIndex].status ^= 2; @@ -1259,7 +1286,10 @@ void func_80074704(s32 objectIndex, s32 arg1) { if ((gObjectList[objectIndex].status & 2) != 0) { phi_a1 = 1; } - gObjectList[objectIndex].activeTexture = (u8 *) (gObjectList[objectIndex].textureWidth * gObjectList[objectIndex].textureHeight * phi_a1) + arg1; + gObjectList[objectIndex].activeTexture = + (u8 *) (gObjectList[objectIndex].textureWidth * gObjectList[objectIndex].textureHeight + * phi_a1) + + arg1; func_800744A0(objectIndex); } } @@ -1272,14 +1302,18 @@ u8 *func_80074790(s32 objectIndex, u8 *arg1) { if ((gObjectList[objectIndex].status & 4) != 0) { phi_a2 = 1; } - return (gObjectList[objectIndex].textureWidth * gObjectList[objectIndex].textureHeight * phi_a2) + arg1; + return (gObjectList[objectIndex].textureWidth * gObjectList[objectIndex].textureHeight * phi_a2) + + arg1; } void func_800747F0(s32 objectIndex, u8 *arg1) { u8 *sp24; if (gObjectList[objectIndex].textureListIndex != gObjectList[objectIndex].unk_0D3) { - sp24 = gObjectList[objectIndex].textureList + (gObjectList[objectIndex].textureWidth * gObjectList[objectIndex].textureHeight * gObjectList[objectIndex].textureListIndex); - func_80074574(sp24, (void *) func_80074790(objectIndex, arg1), gObjectList[objectIndex].textureWidth, gObjectList[objectIndex].textureHeight); + sp24 = gObjectList[objectIndex].textureList + + (gObjectList[objectIndex].textureWidth * gObjectList[objectIndex].textureHeight + * gObjectList[objectIndex].textureListIndex); + func_80074574(sp24, (void *) func_80074790(objectIndex, arg1), + gObjectList[objectIndex].textureWidth, gObjectList[objectIndex].textureHeight); gObjectList[objectIndex].unk_0D3 = gObjectList[objectIndex].textureListIndex; func_80074478(objectIndex); } @@ -1287,17 +1321,17 @@ void func_800747F0(s32 objectIndex, u8 *arg1) { void func_80074894(s32 objectIndex, u8 *arg1) { func_800747F0(objectIndex, arg1); - func_800745C8(objectIndex, (s32)arg1); + func_800745C8(objectIndex, (s32) arg1); } void func_800748C4(s32 objectIndex, u8 *arg1) { func_800747F0(objectIndex, arg1); - func_8007466C(objectIndex, (s32)arg1); + func_8007466C(objectIndex, (s32) arg1); } void func_800748F4(s32 objectIndex, u8 *arg1) { func_800747F0(objectIndex, arg1); - func_80074704(objectIndex, (s32)arg1); + func_80074704(objectIndex, (s32) arg1); } void func_80074924(s32 objectIndex) { @@ -1312,34 +1346,37 @@ void func_80074924(s32 objectIndex) { object = &gObjectList[objectIndex]; object->sizeScaling = 0.15f; temp_v0 = gCurrentCourseId; - switch (temp_v0) { /* irregular */ - case COURSE_MARIO_RACEWAY: - sp2C = random_int(0x00C8U); - sp28 = random_int(D_80165748); - sp24 = random_int(0x0096U); - sp20 = random_int(0x2000U); - object->origin_pos[0] = (f32) ((((f64) D_80165718 + 100.0) - (f64) sp2C) * (f64) xOrientation); - object->origin_pos[1] = (f32) (D_80165720 + sp28); - object->origin_pos[2] = (f32) (((f64) D_80165728 + 200.0) - (f64) sp24); - break; - case COURSE_ROYAL_RACEWAY: - sp2C = random_int(0x0168U); - sp28 = random_int(D_80165748); - sp24 = random_int(0x00B4U); - sp20 = random_int(0x2000U); - object->origin_pos[0] = (f32) ((((f64) D_80165718 + 180.0) - (f64) sp2C) * (f64) xOrientation); - object->origin_pos[1] = (f32) (D_80165720 + sp28); - object->origin_pos[2] = (f32) (((f64) D_80165728 + 200.0) - (f64) sp24); - break; - case COURSE_LUIGI_RACEWAY: - sp2C = random_int(0x012CU); - sp28 = random_int(D_80165748); - sp24 = random_int(0x0096U); - sp20 = random_int(0x2000U); - object->origin_pos[0] = (f32) ((((f64) D_80165718 + 150.0) - (f64) sp2C) * (f64) xOrientation); - object->origin_pos[1] = (f32) (D_80165720 + sp28); - object->origin_pos[2] = (f32) (((f64) D_80165728 + 200.0) - (f64) sp24); - break; + switch (temp_v0) { /* irregular */ + case COURSE_MARIO_RACEWAY: + sp2C = random_int(0x00C8U); + sp28 = random_int(D_80165748); + sp24 = random_int(0x0096U); + sp20 = random_int(0x2000U); + object->origin_pos[0] = + (f32) ((((f64) D_80165718 + 100.0) - (f64) sp2C) * (f64) xOrientation); + object->origin_pos[1] = (f32) (D_80165720 + sp28); + object->origin_pos[2] = (f32) (((f64) D_80165728 + 200.0) - (f64) sp24); + break; + case COURSE_ROYAL_RACEWAY: + sp2C = random_int(0x0168U); + sp28 = random_int(D_80165748); + sp24 = random_int(0x00B4U); + sp20 = random_int(0x2000U); + object->origin_pos[0] = + (f32) ((((f64) D_80165718 + 180.0) - (f64) sp2C) * (f64) xOrientation); + object->origin_pos[1] = (f32) (D_80165720 + sp28); + object->origin_pos[2] = (f32) (((f64) D_80165728 + 200.0) - (f64) sp24); + break; + case COURSE_LUIGI_RACEWAY: + sp2C = random_int(0x012CU); + sp28 = random_int(D_80165748); + sp24 = random_int(0x0096U); + sp20 = random_int(0x2000U); + object->origin_pos[0] = + (f32) ((((f64) D_80165718 + 150.0) - (f64) sp2C) * (f64) xOrientation); + object->origin_pos[1] = (f32) (D_80165720 + sp28); + object->origin_pos[2] = (f32) (((f64) D_80165728 + 200.0) - (f64) sp24); + break; } set_obj_origin_offset(objectIndex, 0, 0, 0); if (gPlayerCount == 1) { @@ -1361,12 +1398,13 @@ void func_80074924(s32 objectIndex) { object->unk_084[7] = -0x100 - (sp20 / 32); } object->primAlpha = 0x00E6; - reset_timer_go_next_state(objectIndex); + initiate_next_state(objectIndex); } void func_80074D94(s32 objectIndex) { if (gObjectList[objectIndex].unk_0AE == 1) { - if ((D_80165740 <= gObjectList[objectIndex].offset[1]) && (s16_step_down_towards(&gObjectList[objectIndex].primAlpha, 0, 8) != 0)) { + if ((D_80165740 <= gObjectList[objectIndex].offset[1]) + && (s16_step_down_towards(&gObjectList[objectIndex].primAlpha, 0, 8) != 0)) { func_80086F60(objectIndex); } object_add_velocity_offset_y(objectIndex); @@ -1376,22 +1414,23 @@ void func_80074D94(s32 objectIndex) { void func_80074E28(s32 objectIndex) { switch (gObjectList[objectIndex].state) { - case 1: - func_80074924(objectIndex); - break; - case 2: - if (set_and_run_timer_object(objectIndex, 1) != false) { - func_80086E70(objectIndex); + case 1: + func_80074924(objectIndex); + break; + case 2: + if (set_and_run_timer_object(objectIndex, 1) != false) { + func_80086E70(objectIndex); + break; + } + case 0: + break; + case 3: + func_80041480(&gObjectList[objectIndex].unk_084[6], -0x1000, 0x1000, + &gObjectList[objectIndex].unk_084[7]); + if (gObjectList[objectIndex].unk_0AE == 0) { + func_80072428(objectIndex); + } break; - } - case 0: - break; - case 3: - func_80041480(&gObjectList[objectIndex].unk_084[6], -0x1000, 0x1000, &gObjectList[objectIndex].unk_084[7]); - if (gObjectList[objectIndex].unk_0AE == 0) { - func_80072428(objectIndex); - } - break; } } @@ -1422,22 +1461,25 @@ void func_80074EE8(void) { } void func_80074FD8(s32 objectIndex) { - switch (gObjectList[objectIndex].state) { /* irregular */ - case 0: - break; - case 1: - if (func_80087E08(objectIndex, gObjectList[objectIndex].velocity[1], 0.12f, gObjectList[objectIndex].unk_034, gObjectList[objectIndex].direction_angle[1], 0x00000064) != 0) { - reset_timer_go_next_state(objectIndex); - } - object_calculate_new_pos_offset(objectIndex); - gObjectList[objectIndex].orientation[0] += D_8016582C[0]; - gObjectList[objectIndex].orientation[1] += D_8016582C[1]; - gObjectList[objectIndex].orientation[2] += D_8016582C[2]; - break; - case 2: - func_80086F60(objectIndex); - func_80072428(objectIndex); - break; + switch (gObjectList[objectIndex].state) { /* irregular */ + case 0: + break; + case 1: + if (func_80087E08(objectIndex, gObjectList[objectIndex].velocity[1], 0.12f, + gObjectList[objectIndex].unk_034, + gObjectList[objectIndex].direction_angle[1], 0x00000064) + != 0) { + initiate_next_state(objectIndex); + } + object_calculate_new_pos_offset(objectIndex); + gObjectList[objectIndex].orientation[0] += D_8016582C[0]; + gObjectList[objectIndex].orientation[1] += D_8016582C[1]; + gObjectList[objectIndex].orientation[2] += D_8016582C[2]; + break; + case 2: + func_80086F60(objectIndex); + func_80072428(objectIndex); + break; } } @@ -1454,7 +1496,7 @@ void func_800750D8(s32 objectIndex, s32 arg1, Vec3f arg2, s32 arg3, s32 arg4) { object->sizeScaling = ((f64) (f32) sp24 * 0.0005) + 0.05; // ALL HAIL THE FAKE MATCH GODS!!!!! object->velocity[1] = ((f64) (f32) temp_v0 * (0.05 * 1.0)) + 2.0; - object->unk_034 = ((f64) (f32)(temp_v0 % 5) * 0.1) + 1.0; + object->unk_034 = ((f64) (f32) (temp_v0 % 5) * 0.1) + 1.0; object->direction_angle[1] = (arg1 << 0x10) / arg4; object->origin_pos[0] = (arg2[0] + (temp_v0 / 2)) - 12.0f; object->origin_pos[1] = (arg2[1] - 10.0) + random_int(0x000AU); @@ -1469,18 +1511,22 @@ void func_80075304(Vec3f arg0, s32 arg1, s32 arg2, s32 arg3) { s32 objectIndex; for (var_s1 = 0; var_s1 < arg3; var_s1++) { - switch (arg1) { /* irregular */ - case 1: - objectIndex = add_unused_obj_index(gObjectParticle1, &gNextFreeObjectParticle1, gObjectParticle1_SIZE); - break; - case 2: - objectIndex = add_unused_obj_index(gObjectParticle2, &gNextFreeObjectParticle2, gObjectParticle2_SIZE); - break; - case 3: - objectIndex = add_unused_obj_index(gObjectParticle3, &gNextFreeObjectParticle3, gObjectParticle3_SIZE); - break; + switch (arg1) { /* irregular */ + case 1: + objectIndex = add_unused_obj_index(gObjectParticle1, &gNextFreeObjectParticle1, + gObjectParticle1_SIZE); + break; + case 2: + objectIndex = add_unused_obj_index(gObjectParticle2, &gNextFreeObjectParticle2, + gObjectParticle2_SIZE); + break; + case 3: + objectIndex = add_unused_obj_index(gObjectParticle3, &gNextFreeObjectParticle3, + gObjectParticle3_SIZE); + break; } - if (objectIndex == NULL_OBJECT_ID) break; + if (objectIndex == NULL_OBJECT_ID) + break; func_800750D8(objectIndex, var_s1, arg0, arg2, arg3); } } @@ -1495,16 +1541,16 @@ void func_8007542C(s32 arg0) { D_8016582C[1] += 0x1000; D_8016582C[2] += 0x1800; for (var_s2 = 0; var_s2 < 0x80; var_s2++) { - switch (arg0) { /* irregular */ - case 1: - var_s3 = gObjectParticle1; - break; - case 2: - var_s3 = gObjectParticle2; - break; - case 3: - var_s3 = gObjectParticle3; - break; + switch (arg0) { /* irregular */ + case 1: + var_s3 = gObjectParticle1; + break; + case 2: + var_s3 = gObjectParticle2; + break; + case 3: + var_s3 = gObjectParticle3; + break; } objectIndex = var_s3[var_s2]; if (objectIndex != DELETED_OBJECT_ID) { @@ -1516,7 +1562,6 @@ void func_8007542C(s32 arg0) { } } } - } } @@ -1537,12 +1582,14 @@ s32 func_800755FC(s32 arg0, Vec3f arg1, f32 arg2) { s32 objectIndex; if (arg0 == 0) { - objectIndex = add_unused_obj_index(gObjectParticle2, &gNextFreeObjectParticle2, gObjectParticle2_SIZE); + objectIndex = + add_unused_obj_index(gObjectParticle2, &gNextFreeObjectParticle2, gObjectParticle2_SIZE); if (objectIndex != NULL_OBJECT_ID) { func_80075574(objectIndex, arg1, arg2); } } else { - objectIndex = add_unused_obj_index(gObjectParticle3, &gNextFreeObjectParticle3, gObjectParticle3_SIZE); + objectIndex = + add_unused_obj_index(gObjectParticle3, &gNextFreeObjectParticle3, gObjectParticle3_SIZE); if (objectIndex != NULL_OBJECT_ID) { func_80075574(objectIndex, arg1, arg2); } @@ -1562,29 +1609,31 @@ void func_80075698(s32 objectIndex) { gObjectList[objectIndex].offset[1] = 0.0f; gObjectList[objectIndex].offset[2] = 0.0f; gObjectList[objectIndex].sizeScaling = 0.5f; - reset_timer_go_next_state(objectIndex); + initiate_next_state(objectIndex); } void func_80075714(s32 objectIndex) { switch (gObjectList[objectIndex].state) { - case 1: - func_80075698(objectIndex); - break; - case 2: - gObjectList[objectIndex].velocity[1] -= 0.03; - f32_step_up_towards(&gObjectList[objectIndex].offset[1], 100.0f, gObjectList[objectIndex].velocity[1]); - func_8007415C(objectIndex, &gObjectList[objectIndex].sizeScaling, 0.55f, 1.0f, 0.1f, 1, 0); - if (func_80073B00(objectIndex, &gObjectList[objectIndex].primAlpha, 0xFF, 0x1E, 7, 0, 0) != 0) { - reset_timer_go_next_state(objectIndex); - } - break; - case 3: - func_80072428(objectIndex); - break; - case 0: - break; + case 1: + func_80075698(objectIndex); + break; + case 2: + gObjectList[objectIndex].velocity[1] -= 0.03; + f32_step_up_towards(&gObjectList[objectIndex].offset[1], 100.0f, + gObjectList[objectIndex].velocity[1]); + func_8007415C(objectIndex, &gObjectList[objectIndex].sizeScaling, 0.55f, 1.0f, 0.1f, 1, 0); + if (func_80073B00(objectIndex, &gObjectList[objectIndex].primAlpha, 0xFF, 0x1E, 7, 0, 0) + != 0) { + initiate_next_state(objectIndex); + } + break; + case 3: + func_80072428(objectIndex); + break; + case 0: + break; } - + object_calculate_new_pos_offset(objectIndex); } @@ -1601,7 +1650,7 @@ void update_train_smoke(void) { D_80165790 -= 1; } if ((gTrainList[0].someFlags != 0) || (D_8016578C != 0)) { - count = 0; + count = 0; for (i = 0; i < 128; i++) { temp_a0 = gObjectParticle2[i]; if (temp_a0 != -1) { @@ -1636,7 +1685,7 @@ void update_train_smoke(void) { } if (count != 0) { D_80165790 = 100; - } + } } } @@ -1657,17 +1706,19 @@ s32 func_80075A6C(s32 arg0, Vec3f arg1, f32 arg2) { s32 objectIndex; if (arg0 == 0) { - objectIndex = add_unused_obj_index(gObjectParticle2, &gNextFreeObjectParticle2, gObjectParticle2_SIZE); + objectIndex = + add_unused_obj_index(gObjectParticle2, &gNextFreeObjectParticle2, gObjectParticle2_SIZE); if (objectIndex != NULL_OBJECT_ID) { func_800759EC(objectIndex, arg1, arg2); } } else { - objectIndex = add_unused_obj_index(gObjectParticle3, &gNextFreeObjectParticle3, gObjectParticle3_SIZE); + objectIndex = + add_unused_obj_index(gObjectParticle3, &gNextFreeObjectParticle3, gObjectParticle3_SIZE); if (objectIndex != NULL_OBJECT_ID) { func_800759EC(objectIndex, arg1, arg2); } } - + return objectIndex; } @@ -1683,27 +1734,29 @@ void func_80075B08(s32 objectIndex) { gObjectList[objectIndex].offset[1] = 0.0f; gObjectList[objectIndex].offset[2] = 0.0f; gObjectList[objectIndex].sizeScaling = 0.5f; - reset_timer_go_next_state(objectIndex); + initiate_next_state(objectIndex); } void func_80075B84(s32 objectIndex) { switch (gObjectList[objectIndex].state) { - case 1: - func_80075B08(objectIndex); - break; - case 2: - gObjectList[objectIndex].velocity[1] -= 0.03; - f32_step_up_towards(&gObjectList[objectIndex].offset[1], 100.0f, gObjectList[objectIndex].velocity[1]); - func_8007415C(objectIndex, &gObjectList[objectIndex].sizeScaling, 0.55f, 1.0f, 0.1f, 1, 0); - if (func_80073B00(objectIndex, &gObjectList[objectIndex].primAlpha, 0xFF, 0x1E, 7, 0, 0) != 0) { - reset_timer_go_next_state(objectIndex); - } - break; - case 3: - func_80072428(objectIndex); - break; - case 0: - break; + case 1: + func_80075B08(objectIndex); + break; + case 2: + gObjectList[objectIndex].velocity[1] -= 0.03; + f32_step_up_towards(&gObjectList[objectIndex].offset[1], 100.0f, + gObjectList[objectIndex].velocity[1]); + func_8007415C(objectIndex, &gObjectList[objectIndex].sizeScaling, 0.55f, 1.0f, 0.1f, 1, 0); + if (func_80073B00(objectIndex, &gObjectList[objectIndex].primAlpha, 0xFF, 0x1E, 7, 0, 0) + != 0) { + initiate_next_state(objectIndex); + } + break; + case 3: + func_80072428(objectIndex); + break; + case 0: + break; } object_calculate_new_pos_offset(objectIndex); @@ -1757,7 +1810,7 @@ void update_ferries_smoke_particle(void) { } if (count != 0) { D_80165790 = 100; - } + } } } @@ -1783,7 +1836,8 @@ void func_80075E5C(s32 objectIndex, Vec3f arg1, u16 arg2, f32 arg3, s32 arg4) { s32 func_80075F28(Vec3f arg0, u16 arg1, f32 arg2, s32 arg3) { s32 objectIndex; - objectIndex = add_unused_obj_index(gObjectParticle1, &gNextFreeObjectParticle1, gObjectParticle1_SIZE); + objectIndex = + add_unused_obj_index(gObjectParticle1, &gNextFreeObjectParticle1, gObjectParticle1_SIZE); if (objectIndex != NULL_OBJECT_ID) { func_80075E5C(objectIndex, arg0, arg1, arg2, arg3); } @@ -1794,7 +1848,8 @@ void func_80075F98(Vec3f arg0, u16 arg1, f32 arg2) { s32 someIndex; for (someIndex = 0; someIndex < 10; someIndex++) { - if (func_80075F28(arg0, arg1, arg2, someIndex) == -1) break; + if (func_80075F28(arg0, arg1, arg2, someIndex) == -1) + break; } } @@ -1815,10 +1870,13 @@ void func_8007601C(s32 objectIndex) { if (gObjectList[objectIndex].unk_04C == 0) { func_8008A6DC(objectIndex, 300.0f); - if ((is_obj_flag_status_active(objectIndex, VISIBLE) != 0) && (func_80072354(objectIndex, 1) != 0)) { + if ((is_obj_flag_status_active(objectIndex, VISIBLE) != 0) + && (func_80072354(objectIndex, 1) != 0)) { func_800722A4(objectIndex, 1); - func_80075F98(gObjectList[objectIndex].pos, gObjectList[objectIndex].direction_angle[1], 1.0f); - func_800C9D80(gObjectList[objectIndex].pos, gObjectList[objectIndex].velocity, SOUND_ARG_LOAD(0x51, 0x02, 0x80, 0x0A)); + func_80075F98(gObjectList[objectIndex].pos, gObjectList[objectIndex].direction_angle[1], + 1.0f); + func_800C9D80(gObjectList[objectIndex].pos, gObjectList[objectIndex].velocity, + SOUND_ARG_LOAD(0x51, 0x02, 0x80, 0x0A)); if (gObjectList[objectIndex].type > 0) { gObjectList[objectIndex].type--; gObjectList[objectIndex].unk_04C = 0x5A; @@ -1868,7 +1926,8 @@ void func_80076194(s32 objectIndex, Vec3f arg1, f32 arg2, s32 arg3) { s32 func_80076278(Vec3f arg0, f32 arg1, s32 arg2) { s32 objectIndex; - objectIndex = add_unused_obj_index(gObjectParticle1, &gNextFreeObjectParticle1, gObjectParticle1_SIZE); + objectIndex = + add_unused_obj_index(gObjectParticle1, &gNextFreeObjectParticle1, gObjectParticle1_SIZE); if (objectIndex != NULL_OBJECT_ID) { func_80076194(objectIndex, arg0, arg1, arg2); } @@ -1879,7 +1938,8 @@ void func_800762DC(Vec3f arg0, f32 arg1) { s32 someIndex; for (someIndex = 0; someIndex < 0x14; someIndex++) { - if (func_80076278(arg0, arg1, someIndex) == -1) break; + if (func_80076278(arg0, arg1, someIndex) == -1) + break; } } @@ -1892,63 +1952,67 @@ void func_8007634C(s32 objectIndex) { object->primAlpha = 0x00FF; set_obj_orientation(objectIndex, 0U, 0U, 0U); set_obj_origin_offset(objectIndex, 0.0f, 0.0f, 0.0f); - reset_timer_go_next_state(objectIndex); + initiate_next_state(objectIndex); } void func_800763CC(s32 objectIndex) { Object *object; - if(objectIndex){} + if (objectIndex) { + } object = &gObjectList[objectIndex]; switch (object->state) { - case 1: - func_8007634C(objectIndex); - break; - case 2: - if (set_and_run_timer_object(objectIndex, object->unk_048) != 0) { - func_80086E70(objectIndex); - } - break; - case 3: - if (object->unk_0D5 == 4) { - f32_step_towards(&object->sizeScaling, 4.0f, 0.1f); - s16_step_towards(&object->type, 0, 0x0018); - s16_step_towards(&object->unk_0A2, 0x0080, 0x000C); - } else { - f32_step_towards(&object->sizeScaling, 1.0f, 0.1f); - s16_step_towards(&object->type, 0, 0x0018); - s16_step_towards(&object->unk_0A2, 0x0080, 0x000C); - } - if ((object->unk_0AE >= 2) && (func_80073B00(objectIndex, &object->primAlpha, 0x000000FF, 0x00000050, 0x00000020, 0, 0) != 0)) { - reset_timer_go_next_state(objectIndex); - } - break; - case 4: - func_80072428(objectIndex); - func_80086F60(objectIndex); - break; - case 0: - default: - break; + case 1: + func_8007634C(objectIndex); + break; + case 2: + if (set_and_run_timer_object(objectIndex, object->unk_048) != 0) { + func_80086E70(objectIndex); + } + break; + case 3: + if (object->unk_0D5 == 4) { + f32_step_towards(&object->sizeScaling, 4.0f, 0.1f); + s16_step_towards(&object->type, 0, 0x0018); + s16_step_towards(&object->unk_0A2, 0x0080, 0x000C); + } else { + f32_step_towards(&object->sizeScaling, 1.0f, 0.1f); + s16_step_towards(&object->type, 0, 0x0018); + s16_step_towards(&object->unk_0A2, 0x0080, 0x000C); + } + if ((object->unk_0AE >= 2) + && (func_80073B00(objectIndex, &object->primAlpha, 0x000000FF, 0x00000050, 0x00000020, + 0, 0) + != 0)) { + initiate_next_state(objectIndex); + } + break; + case 4: + func_80072428(objectIndex); + func_80086F60(objectIndex); + break; + case 0: + default: + break; } } void func_80076538(s32 objectIndex) { switch (gObjectList[objectIndex].unk_0AE) { - case 0: - break; - case 1: - if ((u8) gObjectList[objectIndex].unk_0D5 == 4) { - if (func_80087060(objectIndex, 0x0000000E) != 0) { + case 0: + break; + case 1: + if ((u8) gObjectList[objectIndex].unk_0D5 == 4) { + if (func_80087060(objectIndex, 0x0000000E) != 0) { + func_80086FD4(objectIndex); + } + } else if (func_80087060(objectIndex, 2) != 0) { func_80086FD4(objectIndex); } - } else if (func_80087060(objectIndex, 2) != 0) { - func_80086FD4(objectIndex); - } - break; - case 2: - u16_step_down_towards(&gObjectList[objectIndex].direction_angle[0], 0, 0x00000400); - break; + break; + case 2: + u16_step_down_towards(&gObjectList[objectIndex].direction_angle[0], 0, 0x00000400); + break; } if (gObjectList[objectIndex].unk_0AE > 0) { func_80087844(objectIndex); @@ -1974,7 +2038,8 @@ void func_8007661C(void) { } if (gObjectList[objectIndex].unk_04C == 0) { func_8008A6DC(objectIndex, 750.0f); - if ((is_obj_flag_status_active(objectIndex, VISIBLE) != 0) && (func_80072354(objectIndex, 1) != 0)) { + if ((is_obj_flag_status_active(objectIndex, VISIBLE) != 0) + && (func_80072354(objectIndex, 1) != 0)) { func_800722A4(objectIndex, 1); func_800762DC(gObjectList[objectIndex].pos, 1.0f); func_800C9D80(gObjectList[objectIndex].pos, gObjectList[objectIndex].velocity, 0x51038009U); @@ -2015,7 +2080,8 @@ void func_8007675C(s32 objectIndex, Vec3s arg1, s32 arg2) { s32 func_80076828(Vec3s arg0, s32 arg1) { s32 objectIndex; - objectIndex = add_unused_obj_index(gObjectParticle1, &gNextFreeObjectParticle1, gObjectParticle1_SIZE); + objectIndex = + add_unused_obj_index(gObjectParticle1, &gNextFreeObjectParticle1, gObjectParticle1_SIZE); if (objectIndex != NULL_OBJECT_ID) { func_8007675C(objectIndex, arg0, arg1); } @@ -2028,27 +2094,23 @@ void func_80076884(s32 arg0) { s32 temp_v0; s16 *var_s2; temp_v0 = random_int(0x000FU); - switch (arg0) - { + switch (arg0) { case 0: - var_s2 = D_800E5740 + (temp_v0 * 3); - break; + var_s2 = D_800E5740 + (temp_v0 * 3); + break; case 1: - var_s2 = D_800E579C + (temp_v0 * 3); - break; + var_s2 = D_800E579C + (temp_v0 * 3); + break; case 2: - var_s2 = D_800E57F8 + (temp_v0 * 3); - break; - + var_s2 = D_800E57F8 + (temp_v0 * 3); + break; } - for (i = 0; i < 1; i++) - { - if (func_80076828(var_s2, i) == (-1)) - { - break; + for (i = 0; i < 1; i++) { + if (func_80076828(var_s2, i) == (-1)) { + break; } } } @@ -2062,7 +2124,7 @@ void func_80076958(s32 objectIndex) { object->primAlpha = 0x00FF; set_obj_orientation(objectIndex, 0U, 0U, 0U); set_obj_origin_offset(objectIndex, 0.0f, 0.0f, 0.0f); - reset_timer_go_next_state(objectIndex); + initiate_next_state(objectIndex); } void func_800769D8(s32 objectIndex) { @@ -2083,8 +2145,11 @@ void func_800769D8(s32 objectIndex) { case 3: f32_step_towards(&object->sizeScaling, 2.0f, 0.05f); s16_step_towards(&object->type, 0, 0x0018); - if ((object->unk_0AE >= 2) && (func_80073B00(objectIndex, &object->primAlpha, 0x000000FF, 0x00000050, 0x00000020, 0, 0) != 0)) { - reset_timer_go_next_state(objectIndex); + if ((object->unk_0AE >= 2) + && (func_80073B00(objectIndex, &object->primAlpha, 0x000000FF, 0x00000050, 0x00000020, + 0, 0) + != 0)) { + initiate_next_state(objectIndex); } break; case 4: @@ -2097,7 +2162,8 @@ void func_800769D8(s32 objectIndex) { void func_80076AEC(s32 objectIndex) { s32 thing; thing = gObjectList[objectIndex].unk_0AE; - if(thing) {} + if (thing) { + } if (thing != 0) { if (thing == 1) { if (func_80087060(objectIndex, 0x0000000A) != 0) { @@ -2114,7 +2180,6 @@ void func_80076AEC(s32 objectIndex) { } void func_80076B7C(void) { - } void update_flame_particle(void) { @@ -2163,14 +2228,15 @@ void init_object_smoke_paticle(s32 objectIndex, Vec3f arg1, s16 arg2) { void init_smoke_particle(Vec3f arg0, UNUSED f32 arg1, s16 arg2) { s32 objectIndex; - objectIndex = add_unused_obj_index(gObjectParticle4, &gNextFreeObjectParticle4, gObjectParticle4_SIZE); + objectIndex = + add_unused_obj_index(gObjectParticle4, &gNextFreeObjectParticle4, gObjectParticle4_SIZE); if (objectIndex != NULL_OBJECT_ID) { init_object_smoke_paticle(objectIndex, arg0, arg2); } } void func_80076DC4(s32 objectIndex) { - reset_timer_go_next_state(objectIndex); + initiate_next_state(objectIndex); if (gObjectList[objectIndex].unk_0D5 != 0x0B) { func_80086E70(objectIndex); } @@ -2182,8 +2248,11 @@ void func_80076E14(s32 objectIndex) { func_80076DC4(objectIndex); break; case 2: - if ((gObjectList[objectIndex].unk_0AE >= 2) && (func_80073B00(objectIndex, &gObjectList[objectIndex].primAlpha, 0x000000FF, 0x00000050, 0x00000020, 0, 0) != 0)) { - reset_timer_go_next_state(objectIndex); + if ((gObjectList[objectIndex].unk_0AE >= 2) + && (func_80073B00(objectIndex, &gObjectList[objectIndex].primAlpha, 0x000000FF, + 0x00000050, 0x00000020, 0, 0) + != 0)) { + initiate_next_state(objectIndex); } break; case 0: @@ -2230,9 +2299,10 @@ void init_object_smoke_particle(s32 objectIndex, s32 flameIndex) { gObjectList[objectIndex].textureList = common_texture_particle_smoke[0]; gObjectList[objectIndex].sizeScaling = 0.8f; - gObjectList[objectIndex].origin_pos[0] = (f32)*(gTorchSpawns + (flameIndex * 3) + 0) * xOrientation; - gObjectList[objectIndex].origin_pos[1] = (f32)*(gTorchSpawns + (flameIndex * 3) + 1); - gObjectList[objectIndex].origin_pos[2] = (f32)*(gTorchSpawns + (flameIndex * 3) + 2); + gObjectList[objectIndex].origin_pos[0] = + (f32) * (gTorchSpawns + (flameIndex * 3) + 0) * xOrientation; + gObjectList[objectIndex].origin_pos[1] = (f32) * (gTorchSpawns + (flameIndex * 3) + 1); + gObjectList[objectIndex].origin_pos[2] = (f32) * (gTorchSpawns + (flameIndex * 3) + 2); gObjectList[objectIndex].unk_034 = 0; gObjectList[objectIndex].type = 255; gObjectList[objectIndex].unk_0A2 = 255; @@ -2244,7 +2314,8 @@ void init_object_smoke_particle(s32 objectIndex, s32 flameIndex) { void init_smoke_particles(s32 arg0) { s32 objectIndex; - objectIndex = add_unused_obj_index(gObjectParticle4, &gNextFreeObjectParticle4, gObjectParticle4_SIZE); + objectIndex = + add_unused_obj_index(gObjectParticle4, &gNextFreeObjectParticle4, gObjectParticle4_SIZE); if (objectIndex != NULL_OBJECT_ID) { init_object_smoke_particle(objectIndex, arg0); } @@ -2294,20 +2365,22 @@ void func_80077138(s32 objectIndex, Vec3f arg1, s32 arg2) { } gObjectList[objectIndex].primAlpha = 0x00FF; gObjectList[objectIndex].unk_084[3] = random_int(0x0800U) + 0x400; - if ((gObjectList[objectIndex].direction_angle[1] < 0x3000) || (gObjectList[objectIndex].direction_angle[1] >= 0xB001)) { + if ((gObjectList[objectIndex].direction_angle[1] < 0x3000) + || (gObjectList[objectIndex].direction_angle[1] >= 0xB001)) { gObjectList[objectIndex].unk_084[3] = -gObjectList[objectIndex].unk_084[3]; } } void func_800773D8(f32 *arg0, s32 arg1) { - s32 objectIndex = add_unused_obj_index(gObjectParticle3, &gNextFreeObjectParticle3, gObjectParticle3_SIZE); + s32 objectIndex = + add_unused_obj_index(gObjectParticle3, &gNextFreeObjectParticle3, gObjectParticle3_SIZE); if (objectIndex != NULL_OBJECT_ID) { func_80077138(objectIndex, arg0, arg1); } } void func_80077428(s32 arg0) { - reset_timer_go_next_state(arg0); + initiate_next_state(arg0); func_80086E70(arg0); } @@ -2325,14 +2398,18 @@ void func_80077450(s32 objectIndex) { break; case 2: f32_step_up_towards(&gObjectList[objectIndex].sizeScaling, 0.1f, 0.01f); - if ((gObjectList[objectIndex].pos[1] <= gObjectList[objectIndex].unk_084[5]) && (func_80073B00(objectIndex, &gObjectList[objectIndex].primAlpha, 0x000000FF, 0, 0x00000010, 0, 0) != 0)) { + if ((gObjectList[objectIndex].pos[1] <= gObjectList[objectIndex].unk_084[5]) + && (func_80073B00(objectIndex, &gObjectList[objectIndex].primAlpha, 0x000000FF, 0, + 0x00000010, 0, 0) + != 0)) { func_80086F60(objectIndex); func_80072428(objectIndex); } break; } if (gObjectList[objectIndex].unk_048 != 0) { - gObjectList[objectIndex].unk_084[4] = (s16) ((s32) (gObjectList[objectIndex].unk_084[4] + 1) % 3); + gObjectList[objectIndex].unk_084[4] = + (s16) ((s32) (gObjectList[objectIndex].unk_084[4] + 1) % 3); func_8005C6B4(gObjectList[objectIndex].unk_084[4], &sp3C, &sp3A, &sp38); gObjectList[objectIndex].unk_084[0] = sp3C; gObjectList[objectIndex].unk_084[1] = sp3A; @@ -2362,7 +2439,7 @@ void func_80077640(void) { s32 objectIndex; Object *object; - for(someIndex = 0; someIndex < gObjectParticle3_SIZE; someIndex++) { + for (someIndex = 0; someIndex < gObjectParticle3_SIZE; someIndex++) { objectIndex = gObjectParticle3[someIndex]; if (objectIndex != DELETED_OBJECT_ID) { object = &gObjectList[objectIndex]; @@ -2386,28 +2463,32 @@ void init_object_leaf_particle(s32 objectIndex, Vec3f arg1, s32 num) { init_object(objectIndex, 0); gObjectList[objectIndex].unk_0D5 = 7; - gObjectList[objectIndex].activeTLUT = (u8*) common_texture_particle_leaf; - gObjectList[objectIndex].tlutList = (u8*) common_texture_particle_leaf; + gObjectList[objectIndex].activeTLUT = (u8 *) common_texture_particle_leaf; + gObjectList[objectIndex].tlutList = (u8 *) common_texture_particle_leaf; gObjectList[objectIndex].sizeScaling = 0.1f; gObjectList[objectIndex].surfaceHeight = arg1[1]; switch (gCurrentCourseId) { case COURSE_MARIO_RACEWAY: - object_origin_pos_randomize_around_xyz(objectIndex, arg1[0], arg1[1] + 25.0, arg1[2], 0x14, 0x1E, 0x14); + object_origin_pos_randomize_around_xyz(objectIndex, arg1[0], arg1[1] + 25.0, arg1[2], 0x14, + 0x1E, 0x14); gObjectList[objectIndex].unk_034 = 1.5f; gObjectList[objectIndex].velocity[1] = 1.5f; break; case COURSE_YOSHI_VALLEY: - object_origin_pos_randomize_around_xyz(objectIndex, arg1[0], arg1[1] + 25.0, arg1[2], 0x14, 0x1E, 0x14); + object_origin_pos_randomize_around_xyz(objectIndex, arg1[0], arg1[1] + 25.0, arg1[2], 0x14, + 0x1E, 0x14); gObjectList[objectIndex].unk_034 = 2.0f; gObjectList[objectIndex].velocity[1] = 2.0f; break; case COURSE_ROYAL_RACEWAY: - object_origin_pos_randomize_around_xyz(objectIndex, arg1[0], arg1[1] + 30.0, arg1[2], 0x10, 0x28, 0x10); + object_origin_pos_randomize_around_xyz(objectIndex, arg1[0], arg1[1] + 30.0, arg1[2], 0x10, + 0x28, 0x10); gObjectList[objectIndex].unk_034 = 2.0f; gObjectList[objectIndex].velocity[1] = 2.0f; break; case COURSE_LUIGI_RACEWAY: - object_origin_pos_randomize_around_xyz(objectIndex, arg1[0], arg1[1] + 25.0, arg1[2], 0x14, 0x1E, 0x14); + object_origin_pos_randomize_around_xyz(objectIndex, arg1[0], arg1[1] + 25.0, arg1[2], 0x14, + 0x1E, 0x14); gObjectList[objectIndex].unk_034 = 1.5f; gObjectList[objectIndex].velocity[1] = 1.0f; break; @@ -2433,12 +2514,13 @@ void spawn_leaf(Vec3f arg0, UNUSED s32 arg1) { s32 i; for (i = 0; i < gLeafParticle_SPAWN_SIZE; i++) { - if (init_leaf_particle(arg0, i) == NULL_OBJECT_ID) break; + if (init_leaf_particle(arg0, i) == NULL_OBJECT_ID) + break; } } void func_80077B14(s32 arg0) { - reset_timer_go_next_state(arg0); + initiate_next_state(arg0); func_80086E70(arg0); } @@ -2454,7 +2536,7 @@ void func_80077B3C(s32 objectIndex) { break; case 2: if (object->unk_0AE == 0) { - reset_timer_go_next_state(objectIndex); + initiate_next_state(objectIndex); } break; case 3: @@ -2466,7 +2548,9 @@ void func_80077B3C(s32 objectIndex) { void func_80077BCC(s32 objectIndex) { switch (gObjectList[objectIndex].unk_0AE) { case 1: - func_80087E08(objectIndex, gObjectList[objectIndex].velocity[1], 0.2f, gObjectList[objectIndex].unk_034, (s16) (s32) gObjectList[objectIndex].direction_angle[1], 0x0000000A); + func_80087E08(objectIndex, gObjectList[objectIndex].velocity[1], 0.2f, + gObjectList[objectIndex].unk_034, + (s16) (s32) gObjectList[objectIndex].direction_angle[1], 0x0000000A); break; case 2: if (func_80087B84(objectIndex, 0.4f, gObjectList[objectIndex].surfaceHeight) != 0) { @@ -2484,7 +2568,7 @@ void update_leaf(void) { s32 leafIndex; Object *object; - for(someIndex = 0; someIndex < gLeafParticle_SIZE; someIndex++) { + for (someIndex = 0; someIndex < gLeafParticle_SIZE; someIndex++) { leafIndex = gLeafParticle[someIndex]; if (leafIndex != DELETED_OBJECT_ID) { object = &gObjectList[leafIndex]; @@ -2534,7 +2618,7 @@ void func_80077E20(s32 objectIndex) { object->primAlpha = 0x00FF; object->unk_0D5 = 0; object->type = 0; - reset_timer_go_next_state(objectIndex); + initiate_next_state(objectIndex); } void func_80077EB8(s32 objectIndex, u16 arg1, Camera *camera) { @@ -2553,9 +2637,10 @@ void func_80077F64(s32 objectIndex, Camera *camera) { f64 rand; - switch (gObjectList[objectIndex].unk_0AE) { /* irregular */ + switch (gObjectList[objectIndex].unk_0AE) { /* irregular */ case 1: - gObjectList[objectIndex].direction_angle[1] = (camera->rot[1] + random_int(0x4000U)) - 0x2000; + gObjectList[objectIndex].direction_angle[1] = + (camera->rot[1] + random_int(0x4000U)) - 0x2000; object_origin_pos_randomize_around_y(objectIndex, 0x00B4, 0x0014U); rand = random_int(0x0064U); @@ -2582,21 +2667,21 @@ void func_80077F64(s32 objectIndex, Camera *camera) { } void func_800780CC(s32 objectIndex, Camera *camera) { - switch (gObjectList[objectIndex].state) { /* irregular */ - case 1: - func_80077E20(objectIndex); - return; - case 2: - func_80077F64(objectIndex, camera); - if (gObjectList[objectIndex].unk_0AE == 0) { - reset_timer_go_next_state(objectIndex); + switch (gObjectList[objectIndex].state) { /* irregular */ + case 1: + func_80077E20(objectIndex); return; - } - case 0: - return; - case 3: - func_80072428(objectIndex); - break; + case 2: + func_80077F64(objectIndex, camera); + if (gObjectList[objectIndex].unk_0AE == 0) { + initiate_next_state(objectIndex); + return; + } + case 0: + return; + case 3: + func_80072428(objectIndex); + break; } } @@ -2622,7 +2707,7 @@ void func_80078220(s32 objectIndex) { object->vertex = common_vtx_rectangle; object->sizeScaling = 0.15f; func_80086EF0(objectIndex); - reset_timer_go_next_state(objectIndex); + initiate_next_state(objectIndex); } void func_80078288(s32 objectIndex) { @@ -2632,70 +2717,76 @@ void func_80078288(s32 objectIndex) { UNUSED u16 pad; u16 temp_t6; - switch (gObjectList[objectIndex].unk_0AE) { /* irregular */ - case 0: - break; - case 1: - if (gGamestate != 9) { - sp3A = ((gPlayerOneCopy->unk_094 / 18) * 216) / 2; - sp3E = (random_int(0x000FU) - sp3A) + 0x2D; - sp3C = random_int(0x012CU) + 0x1E; - temp_t6 = camera1->rot[1] + ((s32) (random_int(0x3000U) - 0x1800) / (s16) ((sp3A / 15) + 1)); - gObjectList[objectIndex].origin_pos[0] = gPlayerOneCopy->pos[0] + (sins(temp_t6) * sp3C); - gObjectList[objectIndex].origin_pos[1] = sp3E + gPlayerOneCopy->unk_074; - gObjectList[objectIndex].origin_pos[2] = gPlayerOneCopy->pos[2] + (coss(temp_t6) * sp3C); - gObjectList[objectIndex].unk_0C4 = random_int(0x0400U) + 0x100; - gObjectList[objectIndex].unk_01C[0] = (f32) (((f32) random_int(0x0064U) * 0.03) + 2.0); - gObjectList[objectIndex].velocity[1] = (f32) (-0.3 - (f64) (f32) (random_int(0x0032U) * 0.01)); - gObjectList[objectIndex].offset[0] = 0.0f; - gObjectList[objectIndex].offset[1] = 0.0f; - func_80086FD4(objectIndex); - } else { - sp3C = random_int(0x0064U) + 0x28; - temp_t6 = camera1->rot[1] + random_int(0x3000U) - 0x1800; - gObjectList[objectIndex].origin_pos[0] = camera1->pos[0] + (sins(temp_t6) * sp3C); - gObjectList[objectIndex].origin_pos[1] = camera1->pos[1] + 45.0; - gObjectList[objectIndex].origin_pos[2] = camera1->pos[2] + (coss(temp_t6) * sp3C); - gObjectList[objectIndex].unk_0C4 = random_int(0x0400U) + 0x100; - gObjectList[objectIndex].unk_01C[0] = (f32) (((f32) random_int(0x0064U) * 0.03) + 2.0); - gObjectList[objectIndex].velocity[1] = (f32) (-0.6 - (f64) (f32) (random_int(0x0032U) * 0.01)); - gObjectList[objectIndex].offset[0] = 0.0f; - gObjectList[objectIndex].offset[1] = 0.0f; - func_80086FD4(objectIndex); - } - break; - case 2: - object_add_velocity_offset_y(objectIndex); - gObjectList[objectIndex].direction_angle[0] += gObjectList[objectIndex].unk_0C4; - gObjectList[objectIndex].offset[0] = sins(gObjectList[objectIndex].direction_angle[0]) * gObjectList[objectIndex].unk_01C[0]; - object_calculate_new_pos_offset(objectIndex); - if ((f64) gObjectList[objectIndex].pos[1] <= 0.0) { - func_80086FD4(objectIndex); - } - gObjectList[objectIndex].orientation[1] = angle_between_object_camera(objectIndex, camera1); - break; - case 3: - func_80086F60(objectIndex); - break; + switch (gObjectList[objectIndex].unk_0AE) { /* irregular */ + case 0: + break; + case 1: + if (gGamestate != 9) { + sp3A = ((gPlayerOneCopy->unk_094 / 18) * 216) / 2; + sp3E = (random_int(0x000FU) - sp3A) + 0x2D; + sp3C = random_int(0x012CU) + 0x1E; + temp_t6 = + camera1->rot[1] + ((s32) (random_int(0x3000U) - 0x1800) / (s16) ((sp3A / 15) + 1)); + gObjectList[objectIndex].origin_pos[0] = + gPlayerOneCopy->pos[0] + (sins(temp_t6) * sp3C); + gObjectList[objectIndex].origin_pos[1] = sp3E + gPlayerOneCopy->unk_074; + gObjectList[objectIndex].origin_pos[2] = + gPlayerOneCopy->pos[2] + (coss(temp_t6) * sp3C); + gObjectList[objectIndex].unk_0C4 = random_int(0x0400U) + 0x100; + gObjectList[objectIndex].unk_01C[0] = (f32) (((f32) random_int(0x0064U) * 0.03) + 2.0); + gObjectList[objectIndex].velocity[1] = + (f32) (-0.3 - (f64) (f32) (random_int(0x0032U) * 0.01)); + gObjectList[objectIndex].offset[0] = 0.0f; + gObjectList[objectIndex].offset[1] = 0.0f; + func_80086FD4(objectIndex); + } else { + sp3C = random_int(0x0064U) + 0x28; + temp_t6 = camera1->rot[1] + random_int(0x3000U) - 0x1800; + gObjectList[objectIndex].origin_pos[0] = camera1->pos[0] + (sins(temp_t6) * sp3C); + gObjectList[objectIndex].origin_pos[1] = camera1->pos[1] + 45.0; + gObjectList[objectIndex].origin_pos[2] = camera1->pos[2] + (coss(temp_t6) * sp3C); + gObjectList[objectIndex].unk_0C4 = random_int(0x0400U) + 0x100; + gObjectList[objectIndex].unk_01C[0] = (f32) (((f32) random_int(0x0064U) * 0.03) + 2.0); + gObjectList[objectIndex].velocity[1] = + (f32) (-0.6 - (f64) (f32) (random_int(0x0032U) * 0.01)); + gObjectList[objectIndex].offset[0] = 0.0f; + gObjectList[objectIndex].offset[1] = 0.0f; + func_80086FD4(objectIndex); + } + break; + case 2: + object_add_velocity_offset_y(objectIndex); + gObjectList[objectIndex].direction_angle[0] += gObjectList[objectIndex].unk_0C4; + gObjectList[objectIndex].offset[0] = + sins(gObjectList[objectIndex].direction_angle[0]) * gObjectList[objectIndex].unk_01C[0]; + object_calculate_new_pos_offset(objectIndex); + if ((f64) gObjectList[objectIndex].pos[1] <= 0.0) { + func_80086FD4(objectIndex); + } + gObjectList[objectIndex].orientation[1] = angle_between_object_camera(objectIndex, camera1); + break; + case 3: + func_80086F60(objectIndex); + break; } } void func_800786EC(s32 objectIndex) { - switch (gObjectList[objectIndex].state) { /* irregular */ - case 0: - break; - case 1: - func_80078220(objectIndex); - break; - case 2: - func_80078288(objectIndex); - if (gObjectList[objectIndex].unk_0AE == 0) { - reset_timer_go_next_state(objectIndex); - } - break; - case 3: - func_80072428(objectIndex); - break; + switch (gObjectList[objectIndex].state) { /* irregular */ + case 0: + break; + case 1: + func_80078220(objectIndex); + break; + case 2: + func_80078288(objectIndex); + if (gObjectList[objectIndex].unk_0AE == 0) { + initiate_next_state(objectIndex); + } + break; + case 3: + func_80072428(objectIndex); + break; } } @@ -2769,26 +2860,30 @@ void update_stars(s32 arg0, Camera *camera, StarData *starList) { func_800788F8(objectIndex, star->rotY, camera); switch (starIndex % 5U) { case 0: - func_80073CB0(objectIndex, &gObjectList[objectIndex].primAlpha, 0x00000028, 0x000000B4, 0x000000FF, 0, -1); + func_80073CB0(objectIndex, &gObjectList[objectIndex].primAlpha, 0x00000028, 0x000000B4, + 0x000000FF, 0, -1); break; case 1: - func_80073CB0(objectIndex, &gObjectList[objectIndex].primAlpha, 0x00000080, 0x000000FF, 0x000000FF, 0, -1); + func_80073CB0(objectIndex, &gObjectList[objectIndex].primAlpha, 0x00000080, 0x000000FF, + 0x000000FF, 0, -1); break; case 2: - func_80073CB0(objectIndex, &gObjectList[objectIndex].primAlpha, 0x00000050, 0x000000C8, 0x000000FF, 0, -1); + func_80073CB0(objectIndex, &gObjectList[objectIndex].primAlpha, 0x00000050, 0x000000C8, + 0x000000FF, 0, -1); break; case 3: - func_80073CB0(objectIndex, &gObjectList[objectIndex].primAlpha, 0, 0x0000009B, 0x000000FF, 0, -1); + func_80073CB0(objectIndex, &gObjectList[objectIndex].primAlpha, 0, 0x0000009B, + 0x000000FF, 0, -1); break; case 4: - func_80073CB0(objectIndex, &gObjectList[objectIndex].primAlpha, 0x0000005A, 0x00000080, 0x000000FF, 0, -1); + func_80073CB0(objectIndex, &gObjectList[objectIndex].primAlpha, 0x0000005A, 0x00000080, + 0x000000FF, 0, -1); break; } } } UNUSED void func_80078C68() { - } void func_80078C70(s32 arg0) { @@ -2796,74 +2891,74 @@ void func_80078C70(s32 arg0) { Camera *camera; if (D_801657C8 == 0) { - switch (arg0) { /* switch 1 */ - case 0: /* switch 1 */ - sp1C = 0; - camera = camera1; - D_8018D200 = gCameraZoom[0] + 40.0f; - break; - case 1: /* switch 1 */ - sp1C = 0; - camera = camera1; - D_8018D200 = gCameraZoom[0] + 40.0f; - break; - case 2: /* switch 1 */ - camera = camera2; - sp1C = D_8018D1F0; - D_8018D200 = gCameraZoom[1] + 40.0f; - break; - case 3: /* switch 1 */ - sp1C = 0; - camera = camera1; - D_8018D200 = gCameraZoom[0] + 40.0f; - break; - case 4: /* switch 1 */ - camera = camera2; - sp1C = D_8018D1F0; - D_8018D200 = gCameraZoom[1] + 40.0f; - break; + switch (arg0) { /* switch 1 */ + case 0: /* switch 1 */ + sp1C = 0; + camera = camera1; + D_8018D200 = gCameraZoom[0] + 40.0f; + break; + case 1: /* switch 1 */ + sp1C = 0; + camera = camera1; + D_8018D200 = gCameraZoom[0] + 40.0f; + break; + case 2: /* switch 1 */ + camera = camera2; + sp1C = D_8018D1F0; + D_8018D200 = gCameraZoom[1] + 40.0f; + break; + case 3: /* switch 1 */ + sp1C = 0; + camera = camera1; + D_8018D200 = gCameraZoom[0] + 40.0f; + break; + case 4: /* switch 1 */ + camera = camera2; + sp1C = D_8018D1F0; + D_8018D200 = gCameraZoom[1] + 40.0f; + break; } - D_8018D208 = ( (D_8018D200 / 2) * 0xB6) + 0x71C; + D_8018D208 = ((D_8018D200 / 2) * 0xB6) + 0x71C; D_8018D210 = (-(D_8018D200 / 2) * 0xB6) - 0x71C; D_8018D1E8 = 1.7578125 / D_8018D200; D_8018D218 = 0xA0; - switch (gCurrentCourseId) { /* switch 2 */ - case COURSE_MARIO_RACEWAY: /* switch 2 */ + switch (gCurrentCourseId) { /* switch 2 */ + case COURSE_MARIO_RACEWAY: /* switch 2 */ // Uses Luigi Raceway's clouds for display purposes? update_clouds(sp1C, camera, gLuigiRacewayClouds); break; - case COURSE_YOSHI_VALLEY: /* switch 2 */ + case COURSE_YOSHI_VALLEY: /* switch 2 */ update_clouds(sp1C, camera, gYoshiValleyMooMooFarmClouds); break; - case COURSE_FRAPPE_SNOWLAND: /* switch 2 */ + case COURSE_FRAPPE_SNOWLAND: /* switch 2 */ func_80078170(sp1C, camera); break; - case COURSE_KOOPA_BEACH: /* switch 2 */ + case COURSE_KOOPA_BEACH: /* switch 2 */ update_clouds(sp1C, camera, gKoopaTroopaBeachClouds); break; - case COURSE_ROYAL_RACEWAY: /* switch 2 */ + case COURSE_ROYAL_RACEWAY: /* switch 2 */ update_clouds(sp1C, camera, gRoyalRacewayClouds); break; - case COURSE_LUIGI_RACEWAY: /* switch 2 */ + case COURSE_LUIGI_RACEWAY: /* switch 2 */ update_clouds(sp1C, camera, gLuigiRacewayClouds); break; - case COURSE_MOO_MOO_FARM: /* switch 2 */ + case COURSE_MOO_MOO_FARM: /* switch 2 */ update_clouds(sp1C, camera, gYoshiValleyMooMooFarmClouds); break; - case COURSE_TOADS_TURNPIKE: /* switch 2 */ + case COURSE_TOADS_TURNPIKE: /* switch 2 */ update_stars(sp1C, camera, gToadsTurnpikeRainbowRoadStars); break; - case COURSE_KALAMARI_DESERT: /* switch 2 */ + case COURSE_KALAMARI_DESERT: /* switch 2 */ update_clouds(sp1C, camera, gKalimariDesertClouds); break; - case COURSE_SHERBET_LAND: /* switch 2 */ + case COURSE_SHERBET_LAND: /* switch 2 */ update_clouds(sp1C, camera, gSherbetLandClouds); break; - case COURSE_RAINBOW_ROAD: /* switch 2 */ + case COURSE_RAINBOW_ROAD: /* switch 2 */ update_stars(sp1C, camera, gToadsTurnpikeRainbowRoadStars); break; - case COURSE_WARIO_STADIUM: /* switch 2 */ + case COURSE_WARIO_STADIUM: /* switch 2 */ update_stars(sp1C, camera, gWarioStadiumStars); break; } @@ -2871,24 +2966,24 @@ void func_80078C70(s32 arg0) { } void func_80078F64(void) { - switch (gScreenModeSelection) { /* irregular */ - case SCREEN_MODE_1P: - init_object(gIndexLakituList[0], 1); - break; - case SCREEN_MODE_2P_SPLITSCREEN_VERTICAL: - init_object(gIndexLakituList[0], 1); - init_object(gIndexLakituList[1], 1); - break; - case SCREEN_MODE_2P_SPLITSCREEN_HORIZONTAL: - init_object(gIndexLakituList[0], 1); - init_object(gIndexLakituList[1], 1); - break; - case SCREEN_MODE_3P_4P_SPLITSCREEN: - init_object(gIndexLakituList[0], 1); - init_object(gIndexLakituList[1], 1); - init_object(gIndexLakituList[2], 1); - init_object(gIndexLakituList[3], 1); - break; + switch (gScreenModeSelection) { /* irregular */ + case SCREEN_MODE_1P: + init_object(gIndexLakituList[0], 1); + break; + case SCREEN_MODE_2P_SPLITSCREEN_VERTICAL: + init_object(gIndexLakituList[0], 1); + init_object(gIndexLakituList[1], 1); + break; + case SCREEN_MODE_2P_SPLITSCREEN_HORIZONTAL: + init_object(gIndexLakituList[0], 1); + init_object(gIndexLakituList[1], 1); + break; + case SCREEN_MODE_3P_4P_SPLITSCREEN: + init_object(gIndexLakituList[0], 1); + init_object(gIndexLakituList[1], 1); + init_object(gIndexLakituList[2], 1); + init_object(gIndexLakituList[3], 1); + break; } } @@ -2911,7 +3006,7 @@ void func_800790E4(s32 playerId) { void func_80079114(s32 objectIndex, s32 arg1, s32 arg2) { s32 a; if (gObjectList[objectIndex].state >= 2) { - if ((u8)gObjectList[objectIndex].unk_0D8 == 1) { + if ((u8) gObjectList[objectIndex].unk_0D8 == 1) { if (arg1 == 0) { func_80074894(objectIndex, D_8018C028); return; @@ -2919,7 +3014,8 @@ void func_80079114(s32 objectIndex, s32 arg1, s32 arg2) { a = gIndexLakituList[0]; gObjectList[objectIndex].activeTLUT = gObjectList[a].activeTLUT; gObjectList[objectIndex].activeTexture = gObjectList[a].activeTexture; - if (0) { } + if (0) { + } return; } switch (arg2) { @@ -2959,11 +3055,12 @@ void init_obj_lakitu_red_flag_countdown(s32 objectIndex, s32 arg1) { D_801656F0 = 0; D_8018D168 = 0; } - init_texture_object(objectIndex, (u8 *) common_tlut_lakitu_countdown, gTextureLakituNoLights1, 0x38U, (u16) 0x00000048); + init_texture_object(objectIndex, (u8 *) common_tlut_lakitu_countdown, gTextureLakituNoLights1, + 0x38U, (u16) 0x00000048); gObjectList[objectIndex].vertex = common_vtx_lakitu; gObjectList[objectIndex].sizeScaling = 0.15f; set_object_flag_status_false(objectIndex, 0x00000010); - reset_timer_go_next_state(objectIndex); + initiate_next_state(objectIndex); gObjectList[objectIndex].unk_048 = D_8018D180; } @@ -2984,10 +3081,11 @@ void update_object_lakitu_countdown(s32 objectIndex, s32 arg1) { case 3: set_object_flag_status_true(objectIndex, 0x00000010); func_80086F10(objectIndex, 1, &D_800E67B8); // set a spline - reset_timer_go_next_state(objectIndex); + initiate_next_state(objectIndex); break; case 4: - if ((set_and_run_timer_object(objectIndex, 0x0000001E) != false) && (gPlayerCount != 3) && (arg1 == 0)) { + if ((set_and_run_timer_object(objectIndex, 0x0000001E) != false) && (gPlayerCount != 3) + && (arg1 == 0)) { D_8018D168 = 1; } break; @@ -3035,7 +3133,7 @@ void update_object_lakitu_countdown(s32 objectIndex, s32 arg1) { D_8018D160 = 1; break; } - reset_timer_go_next_state(objectIndex); + initiate_next_state(objectIndex); break; case 14: set_and_run_timer_object(objectIndex, 0x00000078); @@ -3050,7 +3148,8 @@ void init_obj_lakitu_red_flag(s32 objectIndex, s32 playerIndex) { Object *object; func_800791F0(objectIndex, playerIndex); - init_texture_object(objectIndex, (u8*) common_tlut_lakitu_checkered_flag, gTextureLakituCheckeredFlag01, 0x48U, (u16) 0x00000038); + init_texture_object(objectIndex, (u8 *) common_tlut_lakitu_checkered_flag, + gTextureLakituCheckeredFlag01, 0x48U, (u16) 0x00000038); object = &gObjectList[objectIndex]; object->activeTexture = D_8018C028; object->vertex = common_vtx_also_lakitu; @@ -3060,7 +3159,7 @@ void init_obj_lakitu_red_flag(s32 objectIndex, s32 playerIndex) { object->sizeScaling = 0.15f; func_80086F10(objectIndex, 2, &D_800E6834); set_object_flag_status_false(objectIndex, 0x00000010); - reset_timer_go_next_state(objectIndex); + initiate_next_state(objectIndex); } void update_object_lakitu_red_flag(s32 objectIndex, s32 playerIndex) { @@ -3072,7 +3171,7 @@ void update_object_lakitu_red_flag(s32 objectIndex, s32 playerIndex) { break; case 2: set_object_flag_status_true(objectIndex, 0x00000010); - reset_timer_go_next_state(objectIndex); + initiate_next_state(objectIndex); break; case 3: func_80072E54(objectIndex, 0, 0x0000001F, 1, 2, -1); @@ -3104,13 +3203,11 @@ void func_80079860(s32 playerId) { objectIndex = gIndexLakituList[playerId]; player = &gPlayerOne[playerId]; - if ((func_80072354(objectIndex, 1) != 0) && - ( - ((func_802ABDF4(player->collision.meshIndexZX) != 0) && (player->collision.surfaceDistance[2] <= 3.0f)) || - (player->unk_0CA & 1) || - ((player->surfaceType == OUT_OF_BOUNDS) && !(player->effects & 8)) - ) - ) { + if ((func_80072354(objectIndex, 1) != 0) + && (((func_802ABDF4(player->collision.meshIndexZX) != 0) + && (player->collision.surfaceDistance[2] <= 3.0f)) + || (player->unk_0CA & 1) + || ((player->surfaceType == OUT_OF_BOUNDS) && !(player->effects & 8)))) { func_80090778(player); func_800797AC(playerId); } @@ -3127,57 +3224,58 @@ void func_8007993C(s32 objectIndex, Player *player) { void init_obj_lakitu_red_flag_fishing(s32 objectIndex, s32 arg1) { func_800791F0(objectIndex, arg1); - init_texture_object(objectIndex, (u8*) common_tlut_lakitu_fishing, gTextureLakituFishing1, 0x38U, (u16) 0x00000048); + init_texture_object(objectIndex, (u8 *) common_tlut_lakitu_fishing, gTextureLakituFishing1, 0x38U, + (u16) 0x00000048); gObjectList[objectIndex].vertex = D_0D005F30; gObjectList[objectIndex].sizeScaling = 0.15f; func_80086E70(objectIndex); set_object_flag_status_false(objectIndex, 0x00000010); func_80073720(objectIndex); - reset_timer_go_next_state(objectIndex); - func_800C8F80((u8)arg1, 0x0100FA28); + initiate_next_state(objectIndex); + func_800C8F80((u8) arg1, 0x0100FA28); } void func_80079A5C(s32 objectIndex, UNUSED Player *player) { switch (gObjectList[objectIndex].unk_0AE) { - case 0: - break; - case 1: - gObjectList[objectIndex].origin_pos[2] = 0.0f; - gObjectList[objectIndex].origin_pos[1] = 0.0f; - gObjectList[objectIndex].origin_pos[0] = 0.0f; - gObjectList[objectIndex].offset[2] = 0.0f; - gObjectList[objectIndex].offset[0] = 0.0f; - gObjectList[objectIndex].offset[1] = 80.0f; - func_80086FD4(objectIndex); - break; - case 2: - if (f32_step_down_towards(&gObjectList[objectIndex].offset[1], 5.0f, 1.0f) != 0) { - func_80086F60(objectIndex); - } - break; - case 3: - if (f32_step_up_towards(&gObjectList[objectIndex].offset[1], 100.0f, 1.0f) != 0) { - func_80086F60(objectIndex); - } - break; + case 0: + break; + case 1: + gObjectList[objectIndex].origin_pos[2] = 0.0f; + gObjectList[objectIndex].origin_pos[1] = 0.0f; + gObjectList[objectIndex].origin_pos[0] = 0.0f; + gObjectList[objectIndex].offset[2] = 0.0f; + gObjectList[objectIndex].offset[0] = 0.0f; + gObjectList[objectIndex].offset[1] = 80.0f; + func_80086FD4(objectIndex); + break; + case 2: + if (f32_step_down_towards(&gObjectList[objectIndex].offset[1], 5.0f, 1.0f) != 0) { + func_80086F60(objectIndex); + } + break; + case 3: + if (f32_step_up_towards(&gObjectList[objectIndex].offset[1], 100.0f, 1.0f) != 0) { + func_80086F60(objectIndex); + } + break; } } void update_object_lakitu_fishing(s32 objectIndex, s32 playerId) { Player *player = &gPlayerOne[playerId]; - switch (gObjectList[objectIndex].state) { /* switch 1; irregular */ - case 0: /* switch 1 */ + switch (gObjectList[objectIndex].state) { /* switch 1; irregular */ + case 0: /* switch 1 */ break; - case 1: /* switch 1 */ + case 1: /* switch 1 */ init_obj_lakitu_red_flag_fishing(objectIndex, playerId); break; - case 2: /* switch 1 */ + case 2: /* switch 1 */ set_object_flag_status_true(objectIndex, 0x00000010); func_800736E0(objectIndex); - reset_timer_go_next_state(objectIndex); + initiate_next_state(objectIndex); break; - case 3: /* switch 1 */ + case 3: /* switch 1 */ func_800730BC(objectIndex, 0, 3, 1, 2, -1); break; } @@ -3220,19 +3318,19 @@ void update_object_lakitu_fishing(s32 objectIndex, s32 playerId) { void update_object_lakitu_fishing2(s32 objectIndex, s32 playerId) { Player *player = &gPlayerOne[playerId]; - switch (gObjectList[objectIndex].state) { /* switch 1; irregular */ - case 0: /* switch 1 */ + switch (gObjectList[objectIndex].state) { /* switch 1; irregular */ + case 0: /* switch 1 */ break; - case 1: /* switch 1 */ + case 1: /* switch 1 */ init_obj_lakitu_red_flag_fishing(objectIndex, playerId); break; - case 2: /* switch 1 */ + case 2: /* switch 1 */ set_object_flag_status_true(objectIndex, 0x00000010); func_800736E0(objectIndex); player->unk_0CA |= 0x80; - reset_timer_go_next_state(objectIndex); + initiate_next_state(objectIndex); break; - case 3: /* switch 1 */ + case 3: /* switch 1 */ func_800730BC(objectIndex, 0, 3, 1, 2, -1); break; } @@ -3249,7 +3347,8 @@ void update_object_lakitu_fishing2(s32 objectIndex, s32 playerId) { func_80073654(objectIndex); break; case 3: - if ((player->surfaceType == ICE) && !(player->unk_0CA & 1) && ((f64) player->collision.surfaceDistance[2] <= 30.0)) { + if ((player->surfaceType == ICE) && !(player->unk_0CA & 1) + && ((f64) player->collision.surfaceDistance[2] <= 30.0)) { func_800722A4(objectIndex, 8); } if (!(player->unk_0CA & 2)) { @@ -3298,7 +3397,8 @@ void func_8007A060(s32 objectIndex, s32 playerIndex) { Object *object; func_800791F0(objectIndex, playerIndex); - init_texture_object(objectIndex, (u8*) common_tlut_lakitu_second_lap, gTextureLakituSecondLap01, 0x48U, (u16) 0x00000038); + init_texture_object(objectIndex, (u8 *) common_tlut_lakitu_second_lap, gTextureLakituSecondLap01, + 0x48U, (u16) 0x00000038); object = &gObjectList[objectIndex]; object->activeTexture = D_8018C028; object->vertex = common_vtx_also_lakitu; @@ -3308,7 +3408,7 @@ void func_8007A060(s32 objectIndex, s32 playerIndex) { object->sizeScaling = 0.15f; set_object_flag_status_false(objectIndex, 0x00000010); func_80086F10(objectIndex, 5, &D_800E694C); - reset_timer_go_next_state(objectIndex); + initiate_next_state(objectIndex); } void update_object_lakitu_second_lap(s32 objectIndex, s32 playerIndex) { @@ -3320,7 +3420,7 @@ void update_object_lakitu_second_lap(s32 objectIndex, s32 playerIndex) { break; case 2: set_object_flag_status_true(objectIndex, 0x00000010); - reset_timer_go_next_state(objectIndex); + initiate_next_state(objectIndex); break; case 3: set_and_run_timer_object(objectIndex, 0x00000014); @@ -3346,7 +3446,8 @@ void func_8007A228(s32 objectIndex, s32 playerIndex) { Object *object; func_800791F0(objectIndex, playerIndex); - init_texture_object(objectIndex, (u8*) common_tlut_lakitu_final_lap, gTextureLakituFinalLap01, 0x48U, (u16) 0x00000038); + init_texture_object(objectIndex, (u8 *) common_tlut_lakitu_final_lap, gTextureLakituFinalLap01, + 0x48U, (u16) 0x00000038); object = &gObjectList[objectIndex]; object->activeTexture = D_8018C028; object->vertex = common_vtx_also_lakitu; @@ -3356,7 +3457,7 @@ void func_8007A228(s32 objectIndex, s32 playerIndex) { object->sizeScaling = 0.15f; set_object_flag_status_false(objectIndex, 0x00000010); func_80086F10(objectIndex, 5, &D_800E694C); - reset_timer_go_next_state(objectIndex); + initiate_next_state(objectIndex); } void update_object_lakitu_final_lap(s32 objectIndex, s32 playerIndex) { @@ -3368,7 +3469,7 @@ void update_object_lakitu_final_lap(s32 objectIndex, s32 playerIndex) { break; case 2: set_object_flag_status_true(objectIndex, 0x00000010); - reset_timer_go_next_state(objectIndex); + initiate_next_state(objectIndex); break; case 3: set_and_run_timer_object(objectIndex, 0x00000014); @@ -3393,7 +3494,8 @@ void update_object_lakitu_final_lap(s32 objectIndex, s32 playerIndex) { void func_8007A3F0(s32 objectIndex, s32 arg1) { f32 var = 5000.0f; func_800791F0(objectIndex, arg1); - init_texture_object(objectIndex, (u8*) common_tlut_lakitu_reverse, gTextureLakituReverse01, 0x48U, (u16) 0x00000038); + init_texture_object(objectIndex, (u8 *) common_tlut_lakitu_reverse, gTextureLakituReverse01, 0x48U, + (u16) 0x00000038); gObjectList[objectIndex].activeTexture = D_8018C028; gObjectList[objectIndex].vertex = common_vtx_also_lakitu; gObjectList[objectIndex].pos[2] = var; @@ -3403,8 +3505,8 @@ void func_8007A3F0(s32 objectIndex, s32 arg1) { set_object_flag_status_false(objectIndex, 0x00000010); func_80086F10(objectIndex, 6, &D_800E69B0); gObjectList[objectIndex].unk_0D6 = 0; - reset_timer_go_next_state(objectIndex); - func_800C8F80((u8)arg1, 0x0100FA28); + initiate_next_state(objectIndex); + func_800C8F80((u8) arg1, 0x0100FA28); } void update_object_lakitu_reverse(s32 objectIndex, s32 playerId) { @@ -3419,7 +3521,7 @@ void update_object_lakitu_reverse(s32 objectIndex, s32 playerId) { case 2: set_object_flag_status_true(objectIndex, 0x00000010); gObjectList[objectIndex].unk_0D6 = 1; - reset_timer_go_next_state(objectIndex); + initiate_next_state(objectIndex); break; case 3: func_800730BC(objectIndex, 0, 0x0000000F, 1, 2, -1); @@ -3428,8 +3530,8 @@ void update_object_lakitu_reverse(s32 objectIndex, s32 playerId) { func_80072428(objectIndex); break; } - switch (gObjectList[objectIndex].unk_0D6) { /* switch 1; irregular */ - case 1: /* switch 1 */ + switch (gObjectList[objectIndex].unk_0D6) { /* switch 1; irregular */ + case 1: /* switch 1 */ if ((gObjectList[objectIndex].state >= 3) && (!(sp2C->effects & 0x400000))) { func_80086F10(objectIndex, 6, &D_800E69F4); gObjectList[objectIndex].unk_0D6 = 2; @@ -3438,10 +3540,10 @@ void update_object_lakitu_reverse(s32 objectIndex, s32 playerId) { return; } return; - case 2: /* switch 1 */ + case 2: /* switch 1 */ gObjectList[objectIndex].unk_04C--; if (gObjectList[objectIndex].unk_04C == 0) { - reset_timer_go_next_state(objectIndex); + initiate_next_state(objectIndex); gObjectList[objectIndex].unk_0D6 = 0; } break; @@ -3452,22 +3554,43 @@ void func_8007A66C(s32 objectIndex, Player *player, Camera *camera) { u16 temp_t8; temp_t8 = 0x8000 - camera->rot[1]; - gObjectList[objectIndex].pos[0] = (player->pos[0] + (coss(temp_t8) * (gObjectList[objectIndex].origin_pos[0] + gObjectList[objectIndex].offset[0]))) - (sins(temp_t8) * (gObjectList[objectIndex].origin_pos[2] + gObjectList[objectIndex].offset[2])); - gObjectList[objectIndex].pos[1] = player->unk_074 + gObjectList[objectIndex].origin_pos[1] + gObjectList[objectIndex].offset[1]; - gObjectList[objectIndex].pos[2] = (player->pos[2] + (sins(temp_t8) * (gObjectList[objectIndex].origin_pos[0] + gObjectList[objectIndex].offset[0]))) + (coss(temp_t8) * (gObjectList[objectIndex].origin_pos[2] + gObjectList[objectIndex].offset[2])); + gObjectList[objectIndex].pos[0] = + (player->pos[0] + + (coss(temp_t8) + * (gObjectList[objectIndex].origin_pos[0] + gObjectList[objectIndex].offset[0]))) + - (sins(temp_t8) + * (gObjectList[objectIndex].origin_pos[2] + gObjectList[objectIndex].offset[2])); + gObjectList[objectIndex].pos[1] = + player->unk_074 + gObjectList[objectIndex].origin_pos[1] + gObjectList[objectIndex].offset[1]; + gObjectList[objectIndex].pos[2] = + (player->pos[2] + + (sins(temp_t8) + * (gObjectList[objectIndex].origin_pos[0] + gObjectList[objectIndex].offset[0]))) + + (coss(temp_t8) + * (gObjectList[objectIndex].origin_pos[2] + gObjectList[objectIndex].offset[2])); } void func_8007A778(s32 objectIndex, Player *player, Camera *camera) { u16 temp_t8; temp_t8 = 0x8000 - camera->rot[1]; - gObjectList[objectIndex].pos[0] = (player->pos[0] + (coss(temp_t8) * (gObjectList[objectIndex].origin_pos[0] + gObjectList[objectIndex].offset[0]))) - (sins(temp_t8) * (gObjectList[objectIndex].origin_pos[2] + gObjectList[objectIndex].offset[2])); - gObjectList[objectIndex].pos[1] = player->pos[1] + gObjectList[objectIndex].origin_pos[1] + gObjectList[objectIndex].offset[1]; - gObjectList[objectIndex].pos[2] = (player->pos[2] + (sins(temp_t8) * (gObjectList[objectIndex].origin_pos[0] + gObjectList[objectIndex].offset[0]))) + (coss(temp_t8) * (gObjectList[objectIndex].origin_pos[2] + gObjectList[objectIndex].offset[2])); + gObjectList[objectIndex].pos[0] = + (player->pos[0] + + (coss(temp_t8) + * (gObjectList[objectIndex].origin_pos[0] + gObjectList[objectIndex].offset[0]))) + - (sins(temp_t8) + * (gObjectList[objectIndex].origin_pos[2] + gObjectList[objectIndex].offset[2])); + gObjectList[objectIndex].pos[1] = + player->pos[1] + gObjectList[objectIndex].origin_pos[1] + gObjectList[objectIndex].offset[1]; + gObjectList[objectIndex].pos[2] = + (player->pos[2] + + (sins(temp_t8) + * (gObjectList[objectIndex].origin_pos[0] + gObjectList[objectIndex].offset[0]))) + + (coss(temp_t8) + * (gObjectList[objectIndex].origin_pos[2] + gObjectList[objectIndex].offset[2])); } UNUSED void func_8007A884(void) { - } void func_8007A88C(s32 playerId) { @@ -3531,37 +3654,37 @@ void func_8007AA44(s32 playerId) { objectIndex = gIndexLakituList[playerId]; D_8018C028 = D_80183FA8[playerId]; switch (gObjectList[objectIndex].unk_0D8) { - case 1: - func_80079114(objectIndex, playerId, 2); - func_8007A66C(objectIndex, D_8018CF1C, D_8018CF14); - break; - case 2: - func_80079114(objectIndex, playerId, 0); - func_8007A66C(objectIndex, D_8018CF1C, D_8018CF14); - break; - case 3: - func_80079114(objectIndex, playerId, 0); - func_8007A778(objectIndex, D_8018CF1C, D_8018CF14); - break; - case 4: - func_80079114(objectIndex, playerId, 0); - func_8007A66C(objectIndex, D_8018CF1C, D_8018CF14); - break; - case 5: - func_80079114(objectIndex, playerId, 0); - func_8007A66C(objectIndex, D_8018CF1C, D_8018CF14); - break; - case 6: - func_80079114(objectIndex, playerId, 0); - func_8007A66C(objectIndex, D_8018CF1C, D_8018CF14); - break; - case 7: - func_80079114(objectIndex, playerId, 0); - func_8007A778(objectIndex, D_8018CF1C, D_8018CF14); - break; - case 0: - default: - break; + case 1: + func_80079114(objectIndex, playerId, 2); + func_8007A66C(objectIndex, D_8018CF1C, D_8018CF14); + break; + case 2: + func_80079114(objectIndex, playerId, 0); + func_8007A66C(objectIndex, D_8018CF1C, D_8018CF14); + break; + case 3: + func_80079114(objectIndex, playerId, 0); + func_8007A778(objectIndex, D_8018CF1C, D_8018CF14); + break; + case 4: + func_80079114(objectIndex, playerId, 0); + func_8007A66C(objectIndex, D_8018CF1C, D_8018CF14); + break; + case 5: + func_80079114(objectIndex, playerId, 0); + func_8007A66C(objectIndex, D_8018CF1C, D_8018CF14); + break; + case 6: + func_80079114(objectIndex, playerId, 0); + func_8007A66C(objectIndex, D_8018CF1C, D_8018CF14); + break; + case 7: + func_80079114(objectIndex, playerId, 0); + func_8007A778(objectIndex, D_8018CF1C, D_8018CF14); + break; + case 0: + default: + break; } } @@ -3610,8 +3733,7 @@ void consume_item(s32 playerId) { } //! @todo Cleanup this function to use array access and struct if possible. -u8 gen_random_item(s16 rank, s16 isCpu) -{ +u8 gen_random_item(s16 rank, s16 isCpu) { u16 rand = random_int(100); u8 *curve; u8 randomItem; @@ -3639,11 +3761,10 @@ u8 gen_random_item(s16 rank, s16 isCpu) } else { // GP Mode if (isCpu == 0) { curve = segmented_to_virtual((void *) common_grand_prix_human_item_curve); - } - else { + } else { curve = segmented_to_virtual((void *) common_grand_prix_kart_ai_item_curve); } - randomItem = *((rank * 100) + curve + sRandomItemIndex); + randomItem = *((rank * 100) + curve + sRandomItemIndex); } return randomItem; } @@ -3661,7 +3782,7 @@ s16 func_8007AFB0(s32 objectIndex, s32 arg1) { s16 randomItem; randomItem = gen_random_item_human(gLapCountByPlayerId[arg1], gGPCurrentRaceRankByPlayerId[arg1]); - + if (playerHUD[arg1].itemOverride != 0) { randomItem = (s16) playerHUD[arg1].itemOverride; playerHUD[arg1].itemOverride = 0; @@ -3689,7 +3810,8 @@ s32 func_8007B040(s32 objectIndex, s32 playerId) { var_t3 = 0; if (gModeSelection == GRAND_PRIX) { if (random_int(0x0064U) < 0x51) { - var_v1 = gen_random_item_human(gLapCountByPlayerId[playerId], gGPCurrentRaceRankByPlayerId[playerId]); + var_v1 = gen_random_item_human(gLapCountByPlayerId[playerId], + gGPCurrentRaceRankByPlayerId[playerId]); } else { var_v1 = 0; func_800C9060(playerId, 0x1900A058U); @@ -3776,124 +3898,124 @@ void func_8007B34C(s32 playerId) { } object = &gObjectList[temp_s0]; switch (object->state) { - case 1: - func_8007B254(temp_s0, playerId); - break; - case 2: - if (gActiveScreenMode == 0) { - s16_step_up_towards(&playerHUD[playerId].slideItemBoxY, 0x0040, 4); - if (playerHUD[playerId].slideItemBoxY == 0x0040) { - reset_timer_go_next_state(temp_s0); - } - } else if (gActiveScreenMode == 3) { - if ((playerId == 0) || (playerId == 2)) { + case 1: + func_8007B254(temp_s0, playerId); + break; + case 2: + if (gActiveScreenMode == 0) { + s16_step_up_towards(&playerHUD[playerId].slideItemBoxY, 0x0040, 4); + if (playerHUD[playerId].slideItemBoxY == 0x0040) { + initiate_next_state(temp_s0); + } + } else if (gActiveScreenMode == 3) { + if ((playerId == 0) || (playerId == 2)) { + s16_step_up_towards(&playerHUD[playerId].slideItemBoxX, 0x0080, 8); + if (playerHUD[playerId].slideItemBoxX == 0x0080) { + initiate_next_state(temp_s0); + } + } else { + s16_step_down_towards(&playerHUD[playerId].slideItemBoxX, -0x0080, 8); + if (playerHUD[playerId].slideItemBoxX == -0x0080) { + initiate_next_state(temp_s0); + } + } + } else { s16_step_up_towards(&playerHUD[playerId].slideItemBoxX, 0x0080, 8); if (playerHUD[playerId].slideItemBoxX == 0x0080) { - reset_timer_go_next_state(temp_s0); + initiate_next_state(temp_s0); } + } + break; + case 3: + func_80072E54(temp_s0, 1, 0x0000000F, 1, 2, 2); + break; + case 4: + func_80072E54(temp_s0, 1, 6, 1, 8, 1); + break; + case 5: + func_80072E54(temp_s0, 1, 4, 1, 0x00000010, 1); + break; + case 6: + object->textureListIndex = func_8007AFB0(temp_s0, playerId); + object->unk_04C = 8; + object->unk_0D6 = 2; + initiate_next_state(temp_s0); + func_800C9018((u8) playerId, SOUND_ARG_LOAD(0x01, 0x00, 0xFE, 0x1C)); + func_800C8F80((u8) playerId, SOUND_ARG_LOAD(0x01, 0x00, 0xFE, 0x47)); + break; + case 7: + func_80072D3C(temp_s0, (s32) object->unk_0A2, 0, 8, 0x0000000A); + break; + case 9: + func_800722CC(temp_s0, 4); + func_80073600(temp_s0); + object->textureListIndex = 0; + initiate_next_state(temp_s0); + break; + case 10: + set_and_run_timer_object(temp_s0, 0x00000014); + break; + case 11: + if (gActiveScreenMode == 0) { + if (s16_step_down_towards(&playerHUD[playerId].slideItemBoxY, 0, 4) != 0) { + initiate_next_state(temp_s0); + } + } else if (gActiveScreenMode == 3) { + if ((playerId == 0) || (playerId == 2)) { + s16_step_down_towards(&playerHUD[playerId].slideItemBoxX, 0, 8); + if (playerHUD[playerId].slideItemBoxX == 0) { + initiate_next_state(temp_s0); + } + } else { + s16_step_up_towards(&playerHUD[playerId].slideItemBoxX, 0, 8); + if (playerHUD[playerId].slideItemBoxX == 0) { + initiate_next_state(temp_s0); + } + } + } else if (s16_step_down_towards(&playerHUD[playerId].slideItemBoxX, 0, 8) != 0) { + initiate_next_state(temp_s0); + } + break; + case 12: + func_80072428(temp_s0); + break; + case 20: + if (object->unk_0A2 == 0x000B) { + func_80072D3C(temp_s0, object->unk_0A2, 0, 8, 0x0000000A); } else { - s16_step_down_towards(&playerHUD[playerId].slideItemBoxX, -0x0080, 8); - if (playerHUD[playerId].slideItemBoxX == -0x0080) { - reset_timer_go_next_state(temp_s0); - } + func_80072D3C(temp_s0, object->unk_0A2, 0x0000000B, 8, 0x0000000A); } - } else { - s16_step_up_towards(&playerHUD[playerId].slideItemBoxX, 0x0080, 8); - if (playerHUD[playerId].slideItemBoxX == 0x0080) { - reset_timer_go_next_state(temp_s0); - } - } - break; - case 3: - func_80072E54(temp_s0, 1, 0x0000000F, 1, 2, 2); - break; - case 4: - func_80072E54(temp_s0, 1, 6, 1, 8, 1); - break; - case 5: - func_80072E54(temp_s0, 1, 4, 1, 0x00000010, 1); - break; - case 6: - object->textureListIndex = func_8007AFB0(temp_s0, playerId); - object->unk_04C = 8; - object->unk_0D6 = 2; - reset_timer_go_next_state(temp_s0); - func_800C9018((u8) playerId, SOUND_ARG_LOAD(0x01, 0x00, 0xFE, 0x1C)); - func_800C8F80((u8) playerId, SOUND_ARG_LOAD(0x01, 0x00, 0xFE, 0x47)); - break; - case 7: - func_80072D3C(temp_s0, (s32) object->unk_0A2, 0, 8, 0x0000000A); - break; - case 9: - func_800722CC(temp_s0, 4); - func_80073600(temp_s0); - object->textureListIndex = 0; - reset_timer_go_next_state(temp_s0); - break; - case 10: - set_and_run_timer_object(temp_s0, 0x00000014); - break; - case 11: - if (gActiveScreenMode == 0) { - if (s16_step_down_towards(&playerHUD[playerId].slideItemBoxY, 0, 4) != 0) { - reset_timer_go_next_state(temp_s0); - } - } else if (gActiveScreenMode == 3) { - if ((playerId == 0) || (playerId == 2)) { - s16_step_down_towards(&playerHUD[playerId].slideItemBoxX, 0, 8); - if (playerHUD[playerId].slideItemBoxX == 0) { - reset_timer_go_next_state(temp_s0); - } + break; + case 21: + func_800726CC(temp_s0, 8); + object->unk_0D6 = 2; + break; + case 30: + if (object->unk_0A2 == 0x000B) { + func_80072D3C(temp_s0, object->unk_0A2, 0, 8, 0x0000000A); } else { - s16_step_up_towards(&playerHUD[playerId].slideItemBoxX, 0, 8); - if (playerHUD[playerId].slideItemBoxX == 0) { - reset_timer_go_next_state(temp_s0); - } + func_80072D3C(temp_s0, object->unk_0A2, 0x0000000B, 8, 0x0000000A); } - } else if (s16_step_down_towards(&playerHUD[playerId].slideItemBoxX, 0, 8) != 0) { - reset_timer_go_next_state(temp_s0); - } - break; - case 12: - func_80072428(temp_s0); - break; - case 20: - if (object->unk_0A2 == 0x000B) { - func_80072D3C(temp_s0, object->unk_0A2, 0, 8, 0x0000000A); - } else { - func_80072D3C(temp_s0, object->unk_0A2, 0x0000000B, 8, 0x0000000A); - } - break; - case 21: - func_800726CC(temp_s0, 8); - object->unk_0D6 = 2; - break; - case 30: - if (object->unk_0A2 == 0x000B) { - func_80072D3C(temp_s0, object->unk_0A2, 0, 8, 0x0000000A); - } else { - func_80072D3C(temp_s0, object->unk_0A2, 0x0000000B, 8, 0x0000000A); - } - break; - case 31: - func_800726CC(temp_s0, 9); - break; - case 40: - if (object->unk_0A2 == 0x000D) { - func_80072D3C(temp_s0, object->unk_0A2, 0x0000000E, 8, 0x0000000A); - } else { - func_80072D3C(temp_s0, object->unk_0A2, 0x0000000D, 8, 0x0000000A); - } - break; - case 41: - func_800726CC(temp_s0, 8); - break; - case 50: - func_80072D3C(temp_s0, (s32) object->unk_0A2, 0, 8, 0x00000064); - break; - case 0: - default: - break; + break; + case 31: + func_800726CC(temp_s0, 9); + break; + case 40: + if (object->unk_0A2 == 0x000D) { + func_80072D3C(temp_s0, object->unk_0A2, 0x0000000E, 8, 0x0000000A); + } else { + func_80072D3C(temp_s0, object->unk_0A2, 0x0000000D, 8, 0x0000000A); + } + break; + case 41: + func_800726CC(temp_s0, 8); + break; + case 50: + func_80072D3C(temp_s0, (s32) object->unk_0A2, 0, 8, 0x00000064); + break; + case 0: + default: + break; } if (func_80072320(temp_s0, 2) != 0) { if (object->animationTimer == 0) { @@ -3906,46 +4028,46 @@ void func_8007B34C(s32 playerId) { if (object->unk_04C > 0) { object->unk_04C--; } else { - switch (object->unk_0D6) { /* switch 1; irregular */ - case 1: /* switch 1 */ - if (sp40 != 0) { - func_80073600(temp_s0); - func_800726CC(temp_s0, 6); - } - break; - case 2: /* switch 1 */ - set_type_object(temp_s0, (s32) object->unk_0A2); - object->unk_0D6 = 3; - break; - case 3: /* switch 1 */ - if (object->type == 0) { - if (func_80072354(temp_s0, 1) != 0) { - if (object->unk_0A2 == 0x000B) { - if (func_8007B040(temp_s0, playerId) != 0) { - func_800726CC(temp_s0, 0x00000014); - object->unk_0D6 = 0; + switch (object->unk_0D6) { /* switch 1; irregular */ + case 1: /* switch 1 */ + if (sp40 != 0) { + func_80073600(temp_s0); + func_800726CC(temp_s0, 6); + } + break; + case 2: /* switch 1 */ + set_type_object(temp_s0, (s32) object->unk_0A2); + object->unk_0D6 = 3; + break; + case 3: /* switch 1 */ + if (object->type == 0) { + if (func_80072354(temp_s0, 1) != 0) { + if (object->unk_0A2 == 0x000B) { + if (func_8007B040(temp_s0, playerId) != 0) { + func_800726CC(temp_s0, 0x00000014); + object->unk_0D6 = 0; + } else { + func_800726CC(temp_s0, 9); + } + } else if ((object->unk_0A2 == 0x000D) || (object->unk_0A2 == 0x000E)) { + object->unk_0A2--; + set_type_object(temp_s0, (s32) object->unk_0A2); + object->unk_0D6 = 3; + func_800726CC(temp_s0, 0x00000028); } else { func_800726CC(temp_s0, 9); } - } else if ((object->unk_0A2 == 0x000D) || (object->unk_0A2 == 0x000E)) { - object->unk_0A2--; - set_type_object(temp_s0, (s32) object->unk_0A2); - object->unk_0D6 = 3; - func_800726CC(temp_s0, 0x00000028); } else { - func_800726CC(temp_s0, 9); + func_800722CC(temp_s0, 1); + func_800726CC(temp_s0, 0x0000001E); + object->unk_0D6 = 0; } - } else { - func_800722CC(temp_s0, 1); - func_800726CC(temp_s0, 0x0000001E); - object->unk_0D6 = 0; } - } - break; + break; } } } - object->activeTLUT = (u8*) gItemWindowTLUTs[object->textureListIndex]; + object->activeTLUT = (u8 *) gItemWindowTLUTs[object->textureListIndex]; object->activeTexture = gItemWindowTextures[object->textureListIndex]; sp38->currentItemCopy = object->type; } @@ -3959,31 +4081,31 @@ void func_8007BBBC(s32 objectIndex) { Object *object; object = &gObjectList[objectIndex]; - switch (object->state) { /* irregular */ - case 1: - func_800735BC(objectIndex, d_course_banshee_boardwalk_dl_cheep_cheep, 2.0f); - set_object_flag_status_true(objectIndex, 0x00000010); - object->unk_0D5 = 0; - break; - case 2: - if (gIsMirrorMode != 0) { - func_80087E08(objectIndex, 18.0f, 0.7f, 25.0f, (s16) -0x00005800, 0x0000012C); - } else { - func_80087E08(objectIndex, 18.0f, 0.7f, 25.0f, (s16) 0x00005800, 0x0000012C); - } - if (object->velocity[2] < 0.0f) { - var_f14 = -object->velocity[2]; - } else { - var_f14 = object->velocity[2]; - } - object->direction_angle[0] = func_80041658(object->velocity[1], var_f14); - set_and_run_timer_object(objectIndex, 0x00000046); - break; - case 3: - func_80072428(objectIndex); - break; - case 0: - break; + switch (object->state) { /* irregular */ + case 1: + func_800735BC(objectIndex, d_course_banshee_boardwalk_dl_cheep_cheep, 2.0f); + set_object_flag_status_true(objectIndex, 0x00000010); + object->unk_0D5 = 0; + break; + case 2: + if (gIsMirrorMode != 0) { + func_80087E08(objectIndex, 18.0f, 0.7f, 25.0f, (s16) -0x00005800, 0x0000012C); + } else { + func_80087E08(objectIndex, 18.0f, 0.7f, 25.0f, (s16) 0x00005800, 0x0000012C); + } + if (object->velocity[2] < 0.0f) { + var_f14 = -object->velocity[2]; + } else { + var_f14 = object->velocity[2]; + } + object->direction_angle[0] = func_80041658(object->velocity[1], var_f14); + set_and_run_timer_object(objectIndex, 0x00000046); + break; + case 3: + func_80072428(objectIndex); + break; + case 0: + break; } } @@ -3992,7 +4114,8 @@ void func_8007BD04(s32 playerId) { objectIndex = indexObjectList2[0]; if (gObjectList[objectIndex].state == 0) { - if (((s32) gNearestWaypointByPlayerId[playerId] >= 0xA0) && ((s32) gNearestWaypointByPlayerId[playerId] < 0xAB)) { + if (((s32) gNearestWaypointByPlayerId[playerId] >= 0xA0) + && ((s32) gNearestWaypointByPlayerId[playerId] < 0xAB)) { set_obj_origin_pos(objectIndex, xOrientation * -1650.0, -200.0f, -1650.0f); init_object(objectIndex, 1); } @@ -4017,7 +4140,7 @@ void init_var_cheep_cheep(s32 objectIndex) { object->status = 0; object->model = d_course_banshee_boardwalk_dl_cheep_cheep; object->sizeScaling = 0.2f; - reset_timer_go_next_state(objectIndex); + initiate_next_state(objectIndex); set_obj_origin_pos(objectIndex, D_800E634C[0][0], D_800E634C[0][1] + 55.0, D_800E634C[0][2]); set_obj_origin_offset(objectIndex, 0.0f, 30.0f, 0.0f); set_obj_direction_angle(objectIndex, 0U, 0x3800U, 0U); @@ -4028,33 +4151,33 @@ void func_8007BEC8(s32 objectIndex) { object = &gObjectList[objectIndex]; switch (object->state) { - case 1: - init_var_cheep_cheep(objectIndex); - break; - case 2: - if (set_and_run_timer_object(objectIndex, 0x0000003C) != 0) { - set_object_flag_status_true(objectIndex, 0x00000010); - func_80086E70(objectIndex); - } - break; - case 3: - if (object->unk_0AE == 0) { - reset_timer_go_next_state(objectIndex); - } - break; - case 4: - if (set_and_run_timer_object(objectIndex, 0x0000000A) != 0) { - func_8008701C(objectIndex, 2); - } - break; - case 5: - if (object->unk_0AE == 0) { - func_80072428(objectIndex); - } - break; - case 0: - default: - break; + case 1: + init_var_cheep_cheep(objectIndex); + break; + case 2: + if (set_and_run_timer_object(objectIndex, 0x0000003C) != 0) { + set_object_flag_status_true(objectIndex, 0x00000010); + func_80086E70(objectIndex); + } + break; + case 3: + if (object->unk_0AE == 0) { + initiate_next_state(objectIndex); + } + break; + case 4: + if (set_and_run_timer_object(objectIndex, 0x0000000A) != 0) { + func_8008701C(objectIndex, 2); + } + break; + case 5: + if (object->unk_0AE == 0) { + func_80072428(objectIndex); + } + break; + case 0: + default: + break; } } @@ -4063,64 +4186,64 @@ void func_8007BFB0(s32 objectIndex) { object = &gObjectList[objectIndex]; switch (object->unk_0AE) { - case 0: - break; - case 1: - object->velocity[1] = -0.2f; - if ((f64) object->offset[1] <= 0.0) { - object->offset[1] = 0.0f; - object->velocity[1] = 0.0f; + case 0: + break; + case 1: + object->velocity[1] = -0.2f; + if ((f64) object->offset[1] <= 0.0) { + object->offset[1] = 0.0f; + object->velocity[1] = 0.0f; + func_80086F60(objectIndex); + } + break; + case 2: + if (func_800871AC(objectIndex, 0x00000014) != 0) { + object->unk_084[7] = 0x0040; + } + break; + case 3: + object->sizeScaling = (f32) ((f64) object->sizeScaling - 0.0015); + if ((s32) object->direction_angle[0] >= 0xA01) { + object->unk_084[7] -= 4; + } + if (u16_step_up_towards(object->direction_angle, 0x0C00U, (u16) object->unk_084[7]) != 0) { + func_80086FD4(objectIndex); + } + break; + case 4: + object->sizeScaling = (f32) ((f64) object->sizeScaling - 0.0015); + object->unk_034 = 0.001f; + func_80086FD4(objectIndex); + object->unk_084[7] = 0; + break; + case 5: + if (object->unk_034 <= 0.004) { + object->unk_034 += 0.0002; + } + object->sizeScaling += object->unk_034; + s16_step_up_towards(&object->unk_084[7], 0x0100, 0x0010); + object->direction_angle[0] -= object->unk_084[7]; + if (func_80087060(objectIndex, 0x00000035) != 0) { + func_80086FD4(objectIndex); + } + break; + case 6: + if (func_80087060(objectIndex, 0x0000000F) != 0) { + func_80086FD4(objectIndex); + D_801658CE = 1; + } + break; + case 7: + object->sizeScaling = (f32) ((f64) object->sizeScaling - 0.05); + if ((f64) object->sizeScaling <= 0.01) { + set_object_flag_status_false(objectIndex, 0x00000010); + object->sizeScaling = 0.000001f; + func_80086FD4(objectIndex); + } + break; + case 8: func_80086F60(objectIndex); - } - break; - case 2: - if (func_800871AC(objectIndex, 0x00000014) != 0) { - object->unk_084[7] = 0x0040; - } - break; - case 3: - object->sizeScaling = (f32) ((f64) object->sizeScaling - 0.0015); - if ((s32) object->direction_angle[0] >= 0xA01) { - object->unk_084[7] -= 4; - } - if (u16_step_up_towards(object->direction_angle, 0x0C00U, (u16) object->unk_084[7]) != 0) { - func_80086FD4(objectIndex); - } - break; - case 4: - object->sizeScaling = (f32) ((f64) object->sizeScaling - 0.0015); - object->unk_034 = 0.001f; - func_80086FD4(objectIndex); - object->unk_084[7] = 0; - break; - case 5: - if (object->unk_034 <= 0.004) { - object->unk_034 += 0.0002; - } - object->sizeScaling += object->unk_034; - s16_step_up_towards(&object->unk_084[7], 0x0100, 0x0010); - object->direction_angle[0] -= object->unk_084[7]; - if (func_80087060(objectIndex, 0x00000035) != 0) { - func_80086FD4(objectIndex); - } - break; - case 6: - if (func_80087060(objectIndex, 0x0000000F) != 0) { - func_80086FD4(objectIndex); - D_801658CE = 1; - } - break; - case 7: - object->sizeScaling = (f32) ((f64) object->sizeScaling - 0.05); - if ((f64) object->sizeScaling <= 0.01) { - set_object_flag_status_false(objectIndex, 0x00000010); - object->sizeScaling = 0.000001f; - func_80086FD4(objectIndex); - } - break; - case 8: - func_80086F60(objectIndex); - break; + break; } if (object->unk_0AE < 0xA) { func_80074344(objectIndex, &object->sizeScaling, 0.2f, 0.21f, 0.001f, 0, -1); @@ -4159,9 +4282,9 @@ void wrapper_update_boos(void) { } // Updates the display status on an object based on its relative direction to the camera -void func_8007C360(s32 objectIndex, Camera* camera) { +void func_8007C360(s32 objectIndex, Camera *camera) { u16 rot = camera->rot[1]; - u16 temp = ((u16)(gObjectList[objectIndex].direction_angle[1] - rot + 0x8000) * 0x24) / 0x10000; + u16 temp = ((u16) (gObjectList[objectIndex].direction_angle[1] - rot + 0x8000) * 0x24) / 0x10000; if (temp < 0x13) { set_object_flag_status_false(objectIndex, 0x80); @@ -4170,7 +4293,6 @@ void func_8007C360(s32 objectIndex, Camera* camera) { set_object_flag_status_true(objectIndex, 0x80); gObjectList[objectIndex].textureListIndex = 0x24 - temp; } - } void func_8007C420(s32 objectIndex, Player *player, Camera *camera) { @@ -4179,12 +4301,12 @@ void func_8007C420(s32 objectIndex, Player *player, Camera *camera) { x = player->pos[0] - gObjectList[objectIndex].pos[0]; z = player->pos[2] - gObjectList[objectIndex].pos[2]; - gObjectList[objectIndex].direction_angle[1] = func_800417B4(gObjectList[objectIndex].direction_angle[1], atan2s(x, z)); + gObjectList[objectIndex].direction_angle[1] = + func_800417B4(gObjectList[objectIndex].direction_angle[1], atan2s(x, z)); func_8007C360(objectIndex, camera); } UNUSED void func_8007C49C(void) { - } void func_8007C4A4(s32 objectIndex) { @@ -4202,7 +4324,9 @@ void func_8007C4A4(s32 objectIndex) { } void func_8007C550(s32 objectIndex) { - gObjectList[objectIndex].direction_angle[1] = func_800417B4(gObjectList[objectIndex].direction_angle[1], atan2s(gObjectList[objectIndex].velocity[0], gObjectList[objectIndex].velocity[2])); + gObjectList[objectIndex].direction_angle[1] = func_800417B4( + gObjectList[objectIndex].direction_angle[1], + atan2s(gObjectList[objectIndex].velocity[0], gObjectList[objectIndex].velocity[2])); func_8007C4A4(objectIndex); } @@ -4215,7 +4339,7 @@ void func_8007C5B4(s32 objectIndex) { object->pos[1] = 0.0f; object->pos[2] = 0.0f; set_object_flag_status_true(objectIndex, 0x00000020); - reset_timer_go_next_state(objectIndex); + initiate_next_state(objectIndex); object->primAlpha = 0; func_80073844(objectIndex); object->sizeScaling = 0.15f; @@ -4228,31 +4352,32 @@ void func_8007C5B4(s32 objectIndex) { } void func_8007C684(s32 objectIndex) { - switch(gObjectList[objectIndex].state) { - case 0: - break; - case 1: - func_8007C5B4(objectIndex); - break; - } - if (gObjectList[objectIndex].state >= 2) { - switch (gObjectList[objectIndex].unk_0DC) { + switch (gObjectList[objectIndex].state) { case 0: break; case 1: - func_80073998(objectIndex, &gObjectList[objectIndex].primAlpha, 0, 0x00000050, 2, 1, 0); - break; - case 2: - func_80073CB0(objectIndex, &gObjectList[objectIndex].primAlpha, 0x00000050, 0x00000078, 1, 0, -1); - break; - case 3: - func_80073DC0(objectIndex, &gObjectList[objectIndex].primAlpha, 0, 2); - break; - case 4: - func_80072428(objectIndex); - func_80086F60(objectIndex); - func_80073884(objectIndex); + func_8007C5B4(objectIndex); break; + } + if (gObjectList[objectIndex].state >= 2) { + switch (gObjectList[objectIndex].unk_0DC) { + case 0: + break; + case 1: + func_80073998(objectIndex, &gObjectList[objectIndex].primAlpha, 0, 0x00000050, 2, 1, 0); + break; + case 2: + func_80073CB0(objectIndex, &gObjectList[objectIndex].primAlpha, 0x00000050, 0x00000078, + 1, 0, -1); + break; + case 3: + func_80073DC0(objectIndex, &gObjectList[objectIndex].primAlpha, 0, 2); + break; + case 4: + func_80072428(objectIndex); + func_80086F60(objectIndex); + func_80073884(objectIndex); + break; } func_80073514(objectIndex); } @@ -4316,15 +4441,15 @@ s32 func_8007C9F8(void) { first = gGPCurrentRaceRankByPlayerId[0]; second = gGPCurrentRaceRankByPlayerId[1]; if (first < second) { - ret = 0; + ret = 0; } else { - ret = 1; + ret = 1; } } else { - ret = gGPCurrentRacePlayerIdByRank[0]; + ret = gGPCurrentRacePlayerIdByRank[0]; } } else { - ret = gGPCurrentRacePlayerIdByRank[0]; + ret = gGPCurrentRacePlayerIdByRank[0]; } } return ret; @@ -4391,9 +4516,13 @@ void update_boos(void) { player = &gPlayerOne[object->unk_0D1]; camera = &camera1[object->unk_0D1]; temp_t4 = (0x8000 - camera->rot[1]); - object->pos[0] = player->pos[0] + (coss(temp_t4) * (object->origin_pos[0] + object->offset[0])) - (sins(temp_t4) * (object->origin_pos[2] + object->offset[2])); + object->pos[0] = player->pos[0] + + (coss(temp_t4) * (object->origin_pos[0] + object->offset[0])) + - (sins(temp_t4) * (object->origin_pos[2] + object->offset[2])); object->pos[1] = 6.5 + player->unk_074 + object->origin_pos[1] + object->offset[1]; - object->pos[2] = player->pos[2] + (sins(temp_t4) * (object->origin_pos[0] + object->offset[0])) + (coss(temp_t4) * (object->origin_pos[2] + object->offset[2])); + object->pos[2] = player->pos[2] + + (sins(temp_t4) * (object->origin_pos[0] + object->offset[0])) + + (coss(temp_t4) * (object->origin_pos[2] + object->offset[2])); func_8007C550(objectIndex); if (is_obj_flag_status_active(objectIndex, 0x00000080) != 0) { object->vertex = D_800E44B0; @@ -4407,65 +4536,67 @@ void update_boos(void) { void func_8007CE0C(s32 objectIndex) { Object *object; - init_texture_object(objectIndex, d_course_banshee_boardwalk_boo_tlut, gTextureGhosts, 0x30U, (u16) 0x00000028); + init_texture_object(objectIndex, d_course_banshee_boardwalk_boo_tlut, gTextureGhosts, 0x30U, + (u16) 0x00000028); object = &gObjectList[objectIndex]; object->textureListIndex = 0x1C; object->pos[0] = 0.0f; object->pos[1] = 0.0f; object->pos[2] = 0.0f; object->sizeScaling = 0.15f; - reset_timer_go_next_state(objectIndex); + initiate_next_state(objectIndex); object->primAlpha = 0; func_80073844(objectIndex); func_80086EF0(objectIndex); object->direction_angle[2] = 0x8000; - object->direction_angle[1] = atan2s(D_8018CF1C->pos[0] - object->origin_pos[0], D_8018CF1C->pos[2] - object->origin_pos[2]); + object->direction_angle[1] = + atan2s(D_8018CF1C->pos[0] - object->origin_pos[0], D_8018CF1C->pos[2] - object->origin_pos[2]); } void func_8007CEDC(s32 objectIndex) { Object *object; object = &gObjectList[objectIndex]; - switch (object->state) { /* switch 1 */ - case 0: /* switch 1 */ - break; - case 1: /* switch 1 */ - func_8007CE0C(objectIndex); - break; - case 2: /* switch 1 */ - set_and_run_timer_object(objectIndex, 0x0000001E); - break; - case 3: /* switch 1 */ - set_and_run_timer_object(objectIndex, 0x000003E8); - break; - case 4: /* switch 1 */ - func_80072428(objectIndex); - break; - default: /* switch 2 */ - break; + switch (object->state) { /* switch 1 */ + case 0: /* switch 1 */ + break; + case 1: /* switch 1 */ + func_8007CE0C(objectIndex); + break; + case 2: /* switch 1 */ + set_and_run_timer_object(objectIndex, 0x0000001E); + break; + case 3: /* switch 1 */ + set_and_run_timer_object(objectIndex, 0x000003E8); + break; + case 4: /* switch 1 */ + func_80072428(objectIndex); + break; + default: /* switch 2 */ + break; } if (object->state >= 2) { func_80072950(objectIndex, (s32) object->unk_0DC, 0, 4); func_80073514(objectIndex); - switch (object->unk_0DC) { /* switch 2 */ - case 1: /* switch 2 */ - func_80073998(objectIndex, &object->primAlpha, 0x00000028, 0x00000050, 4, 0, 0); - break; - case 2: /* switch 2 */ - func_80073CB0(objectIndex, &object->primAlpha, 0x00000050, 0x000000B4, 2, 0, -1); - if ((object->unk_0AE == 0) || (object->state == 3)) { - object->unk_0DC += 1; - } - break; - case 3: /* switch 2 */ - func_80073DC0(objectIndex, &object->primAlpha, 0, 4); - break; - case 4: /* switch 2 */ - func_80073884(objectIndex); - break; - case 0: - default: /* switch 2 */ - break; + switch (object->unk_0DC) { /* switch 2 */ + case 1: /* switch 2 */ + func_80073998(objectIndex, &object->primAlpha, 0x00000028, 0x00000050, 4, 0, 0); + break; + case 2: /* switch 2 */ + func_80073CB0(objectIndex, &object->primAlpha, 0x00000050, 0x000000B4, 2, 0, -1); + if ((object->unk_0AE == 0) || (object->state == 3)) { + object->unk_0DC += 1; + } + break; + case 3: /* switch 2 */ + func_80073DC0(objectIndex, &object->primAlpha, 0, 4); + break; + case 4: /* switch 2 */ + func_80073884(objectIndex); + break; + case 0: + default: /* switch 2 */ + break; } } } @@ -4481,10 +4612,12 @@ void func_8007D070(void) { s32 objectIndex; var_v0 = 0; - if ((D_8016559C == 0) && (D_8018D2A4 != 0) && (D_8018CF68[0] < 0x1D) && (D_800E5DB4[D_8018CF68[0]] == 1)) { + if ((D_8016559C == 0) && (D_8018D2A4 != 0) && (D_8018CF68[0] < 0x1D) + && (D_800E5DB4[D_8018CF68[0]] == 1)) { while (gObjectList[gObjectParticle1[var_v0 + 10]].state != 0) { var_v0++; - if (var_v0 == 30) break; + if (var_v0 == 30) + break; } objectIndex = gObjectParticle1[var_v0 + 10]; if (var_v0 != 30) { @@ -4507,9 +4640,13 @@ void func_8007D070(void) { if (gObjectList[objectIndex].state != 0) { func_8007CEDC(objectIndex); func_8008B724(objectIndex); - gObjectList[objectIndex].pos[0] = gObjectList[objectIndex].origin_pos[0] + gObjectList[objectIndex].offset[0]; - gObjectList[objectIndex].pos[1] = D_8018CF1C->unk_074 + gObjectList[objectIndex].origin_pos[1] + gObjectList[objectIndex].offset[1]; - gObjectList[objectIndex].pos[2] = gObjectList[objectIndex].origin_pos[2] + gObjectList[objectIndex].offset[2]; + gObjectList[objectIndex].pos[0] = + gObjectList[objectIndex].origin_pos[0] + gObjectList[objectIndex].offset[0]; + gObjectList[objectIndex].pos[1] = D_8018CF1C->unk_074 + + gObjectList[objectIndex].origin_pos[1] + + gObjectList[objectIndex].offset[1]; + gObjectList[objectIndex].pos[2] = + gObjectList[objectIndex].origin_pos[2] + gObjectList[objectIndex].offset[2]; func_8007C420(objectIndex, D_8018CF1C, D_8018CF14); if (is_obj_flag_status_active(objectIndex, 0x00000080) != 0) { gObjectList[objectIndex].vertex = D_800E44B0; @@ -4522,7 +4659,8 @@ void func_8007D070(void) { void func_8007D360(s32 objectIndex, s32 arg1) { if (arg1 == 1) { - gObjectList[objectIndex].origin_pos[0] = (f32) ((-1775.0 - random_int(0x001EU)) * (f64) xOrientation); + gObjectList[objectIndex].origin_pos[0] = + (f32) ((-1775.0 - random_int(0x001EU)) * (f64) xOrientation); gObjectList[objectIndex].origin_pos[1] = (f32) (random_int(0x0019U) + 25.0); gObjectList[objectIndex].origin_pos[2] = (f32) (random_int(0x001EU) + 130.0); gObjectList[objectIndex].unk_01C[0] = (f32) ((f64) xOrientation * -2500.0); @@ -4541,12 +4679,14 @@ void func_8007D360(s32 objectIndex, s32 arg1) { gObjectList[objectIndex].direction_angle[0] = 0; gObjectList[objectIndex].unk_0C6 = 0; } - gObjectList[objectIndex].direction_angle[1] = get_angle_between_xy(gObjectList[objectIndex].origin_pos[0], gObjectList[objectIndex].unk_01C[0], gObjectList[objectIndex].origin_pos[2], gObjectList[objectIndex].unk_01C[2]); + gObjectList[objectIndex].direction_angle[1] = get_angle_between_xy( + gObjectList[objectIndex].origin_pos[0], gObjectList[objectIndex].unk_01C[0], + gObjectList[objectIndex].origin_pos[2], gObjectList[objectIndex].unk_01C[2]); gObjectList[objectIndex].direction_angle[2] = 0; set_obj_origin_offset(objectIndex, 0.0f, 0.0f, 0.0f); gObjectList[objectIndex].unk_0B0 = 0; if (gCCSelection < CC_150) { - gObjectList[objectIndex].unk_034 = (random_int(4U) + 4.0); + gObjectList[objectIndex].unk_034 = (random_int(4U) + 4.0); } else { gObjectList[objectIndex].unk_034 = (random_int(4U) + 5.0); } @@ -4602,39 +4742,39 @@ s32 func_8007D804(s32 objectIndex) { } void func_8007D8AC(s32 arg0) { - reset_timer_go_next_state(arg0); + initiate_next_state(arg0); func_80086E70(arg0); } void func_8007D8D4(s32 objectIndex, s32 arg1) { switch (gObjectList[objectIndex].state) { - case 1: - func_8007D8AC(objectIndex); - break; - case 2: - if (func_8007D804(objectIndex) == 0) { - func_80072428(objectIndex); - } - if (arg1 == 1) { - if (gIsMirrorMode != 0) { - if (gObjectList[objectIndex].pos[0] >= 2540.0) { + case 1: + func_8007D8AC(objectIndex); + break; + case 2: + if (func_8007D804(objectIndex) == 0) { + func_80072428(objectIndex); + } + if (arg1 == 1) { + if (gIsMirrorMode != 0) { + if (gObjectList[objectIndex].pos[0] >= 2540.0) { + func_80072428(objectIndex); + } + } else if (gObjectList[objectIndex].pos[0] <= -2540.0) { + func_80072428(objectIndex); + } + } else if (gIsMirrorMode != 0) { + if (gObjectList[objectIndex].pos[0] >= 2150.0) { + func_80072428(objectIndex); + } + } else { + if (gObjectList[objectIndex].pos[0] <= -2150.0) { func_80072428(objectIndex); } - } else if (gObjectList[objectIndex].pos[0] <= -2540.0) { - func_80072428(objectIndex); } - } else if (gIsMirrorMode != 0) { - if (gObjectList[objectIndex].pos[0] >= 2150.0) { - func_80072428(objectIndex); - } - } else { - if (gObjectList[objectIndex].pos[0] <= -2150.0) { - func_80072428(objectIndex); - } - } - break; - case 0: - break; + break; + case 0: + break; } } @@ -4650,19 +4790,20 @@ void func_8007DA74(s32 objectIndex) { gObjectList[objectIndex].unk_0C6 = 0U; } } - gObjectList[objectIndex].direction_angle[0] = func_800417B4(gObjectList[objectIndex].direction_angle[0], gObjectList[objectIndex].unk_0C6); + gObjectList[objectIndex].direction_angle[0] = + func_800417B4(gObjectList[objectIndex].direction_angle[0], gObjectList[objectIndex].unk_0C6); func_80087844(objectIndex); object_calculate_new_pos_offset(objectIndex); } void func_8007DAF8(s32 objectIndex, s32 arg1) { - switch (arg1) { /* irregular */ - case 1: - func_8007DA74(objectIndex); - return; - case 2: - func_8007DA4C(objectIndex); - return; + switch (arg1) { /* irregular */ + case 1: + func_8007DA74(objectIndex); + return; + case 2: + func_8007DA4C(objectIndex); + return; } } @@ -4687,10 +4828,12 @@ void update_bat(void) { D_8018CFD8 = 0; for (var_s2 = 0; var_s2 < 40; var_s2++) { temp_s0 = gObjectParticle2[var_s2]; - if (temp_s0 == -1) continue; + if (temp_s0 == -1) + continue; object = &gObjectList[temp_s0]; - if (object->state == 0) continue; + if (object->state == 0) + continue; func_8007D8D4(temp_s0, 1); func_8007DAF8(temp_s0, 1); @@ -4708,10 +4851,12 @@ void update_bat(void) { D_8018D010 = 0; for (var_s2 = 0; var_s2 < 30; var_s2++) { temp_s0 = gObjectParticle3[var_s2]; - if (temp_s0 == -1) continue; + if (temp_s0 == -1) + continue; object = &gObjectList[temp_s0]; - if (object->state == 0) continue; + if (object->state == 0) + continue; func_8007D8D4(temp_s0, 2); func_8007DAF8(temp_s0, 2); @@ -4745,11 +4890,13 @@ void func_8007DDC0(s32 objectIndex) { } } if (object->unk_04C == 0) { - if ((gCCSelection == CC_50) || (gCCSelection == CC_100) || (gCCSelection == CC_150) || (gCCSelection == CC_EXTRA)) { + if ((gCCSelection == CC_50) || (gCCSelection == CC_100) || (gCCSelection == CC_150) + || (gCCSelection == CC_EXTRA)) { sp2C = 1150.0f; } func_8008A6DC(objectIndex, sp2C); - if ((is_obj_flag_status_active(objectIndex, VISIBLE) != 0) && (func_80072354(objectIndex, 1) != 0)) { + if ((is_obj_flag_status_active(objectIndex, VISIBLE) != 0) + && (func_80072354(objectIndex, 1) != 0)) { func_800722A4(objectIndex, 1); func_800C9D80(object->pos, object->velocity, SOUND_ARG_LOAD(0x51, 0x02, 0x80, 0x06)); func_800726CC(objectIndex, 3); @@ -4784,56 +4931,59 @@ void init_bb_trash_bin(s32 objectIndex) { gObjectList[objectIndex].pos[1] = 45.0f; set_obj_velocity(objectIndex, 0.0f, 0.0f, 0.0f); gObjectList[objectIndex].type = 0; - reset_timer_go_next_state(objectIndex); + initiate_next_state(objectIndex); } void func_8007E00C(s32 objectIndex) { switch (gObjectList[objectIndex].state) { - case 1: - init_bb_trash_bin(objectIndex); - break; - case 3: - D_8018CFB0 = 1; - reset_timer_go_next_state(objectIndex); - break; - case 4: - set_and_run_timer_object(objectIndex, 0x000000D2); - if (D_80165594 == 0) { - if (gCCSelection < CC_150) { - func_8007D714(1); - func_8007D714(1); - } else { - func_8007D714(1); - func_8007D714(1); - func_8007D714(1); - func_8007D714(1); + case 1: + init_bb_trash_bin(objectIndex); + break; + case 3: + D_8018CFB0 = 1; + initiate_next_state(objectIndex); + break; + case 4: + set_and_run_timer_object(objectIndex, 0x000000D2); + if (D_80165594 == 0) { + if (gCCSelection < CC_150) { + func_8007D714(1); + func_8007D714(1); + } else { + func_8007D714(1); + func_8007D714(1); + func_8007D714(1); + func_8007D714(1); + } } - } - func_80073CB0(objectIndex, &gObjectList[objectIndex].primAlpha, -0x00002000, 0, 0x00000400, 0, -1); - gObjectList[objectIndex].orientation[2] = gObjectList[objectIndex].primAlpha; - if (gObjectList[objectIndex].unk_084[7] == 0) { - func_800C98B8(gObjectList[objectIndex].pos, gObjectList[objectIndex].velocity, SOUND_ARG_LOAD(0x19, 0x01, 0x90, 0x4E)); - gObjectList[objectIndex].unk_084[7] = 0x0014; - } else { - gObjectList[objectIndex].unk_084[7]--; - } - break; - case 5: - gObjectList[objectIndex].orientation[2] = func_800417B4(gObjectList[objectIndex].orientation[2], 0U); - if (gObjectList[objectIndex].orientation[2] == 0) { - reset_timer_go_next_state(objectIndex); - } - break; - case 6: - gObjectList[objectIndex].orientation[2] = 0; - gObjectList[objectIndex].unk_084[7] = 0; - reset_timer_go_next_state(objectIndex); - D_8018CFB0 = 0; - break; - case 0: - case 2: - default: - break; + func_80073CB0(objectIndex, &gObjectList[objectIndex].primAlpha, -0x00002000, 0, 0x00000400, + 0, -1); + gObjectList[objectIndex].orientation[2] = gObjectList[objectIndex].primAlpha; + if (gObjectList[objectIndex].unk_084[7] == 0) { + func_800C98B8(gObjectList[objectIndex].pos, gObjectList[objectIndex].velocity, + SOUND_ARG_LOAD(0x19, 0x01, 0x90, 0x4E)); + gObjectList[objectIndex].unk_084[7] = 0x0014; + } else { + gObjectList[objectIndex].unk_084[7]--; + } + break; + case 5: + gObjectList[objectIndex].orientation[2] = + func_800417B4(gObjectList[objectIndex].orientation[2], 0U); + if (gObjectList[objectIndex].orientation[2] == 0) { + initiate_next_state(objectIndex); + } + break; + case 6: + gObjectList[objectIndex].orientation[2] = 0; + gObjectList[objectIndex].unk_084[7] = 0; + initiate_next_state(objectIndex); + D_8018CFB0 = 0; + break; + case 0: + case 2: + default: + break; } } @@ -4863,11 +5013,13 @@ void func_8007E1F4(s32 objectIndex) { } } if (object->unk_04C == 0) { - if ((gCCSelection == CC_50) || (gCCSelection == CC_100) || (gCCSelection == CC_150) || (gCCSelection == CC_EXTRA)) { + if ((gCCSelection == CC_50) || (gCCSelection == CC_100) || (gCCSelection == CC_150) + || (gCCSelection == CC_EXTRA)) { sp2C = 700.0f; } func_8008A6DC(objectIndex, sp2C); - if ((is_obj_flag_status_active(objectIndex, VISIBLE) != 0) && (func_80072354(objectIndex, 1) != 0)) { + if ((is_obj_flag_status_active(objectIndex, VISIBLE) != 0) + && (func_80072354(objectIndex, 1) != 0)) { func_800722A4(objectIndex, 1); func_800C9D80(object->pos, object->velocity, SOUND_ARG_LOAD(0x51, 0x02, 0x80, 0x06)); func_800726CC(objectIndex, 3); @@ -4893,38 +5045,38 @@ void func_8007E358(s32 objectIndex) { gObjectList[objectIndex].type = 0; gObjectList[objectIndex].unk_04C = 0; gObjectList[objectIndex].unk_084[7] = 0; - reset_timer_go_next_state(objectIndex); + initiate_next_state(objectIndex); } void func_8007E3EC(s32 objectIndex) { switch (gObjectList[objectIndex].state) { - case 1: - func_8007E358(objectIndex); - break; - case 3: - D_8018CFE8 = 1; - reset_timer_go_next_state(objectIndex); - break; - case 4: - set_and_run_timer_object(objectIndex, 0x000000D2); - if (D_80165598 == 0) { - if (gCCSelection < CC_150) { - func_8007D714(2); - } else { - func_8007D714(2); - func_8007D714(2); + case 1: + func_8007E358(objectIndex); + break; + case 3: + D_8018CFE8 = 1; + initiate_next_state(objectIndex); + break; + case 4: + set_and_run_timer_object(objectIndex, 0x000000D2); + if (D_80165598 == 0) { + if (gCCSelection < CC_150) { + func_8007D714(2); + } else { + func_8007D714(2); + func_8007D714(2); + } } - } - break; - case 5: - D_8018CFE8 = 0; - reset_timer_go_next_state(objectIndex); - break; - case 0: - case 2: - default: - break; + break; + case 5: + D_8018CFE8 = 0; + initiate_next_state(objectIndex); + break; + case 0: + case 2: + default: + break; } } @@ -4940,7 +5092,10 @@ s32 func_8007E50C(s32 objectIndex, Player *player, Camera *camera) { s32 sp24; sp24 = 0; - if ((func_80072354(objectIndex, 4) != 0) && (is_within_horizontal_distance_of_player(objectIndex, player, 300.0f) != 0) && (func_8008A0B4(objectIndex, player, camera, 0x4000U) != 0) && (func_8008A060(objectIndex, camera, 0x1555U) != 0)) { + if ((func_80072354(objectIndex, 4) != 0) + && (is_within_horizontal_distance_of_player(objectIndex, player, 300.0f) != 0) + && (func_8008A0B4(objectIndex, player, camera, 0x4000U) != 0) + && (func_8008A060(objectIndex, camera, 0x1555U) != 0)) { func_800722A4(objectIndex, 4); sp24 = 1; } @@ -4958,144 +5113,154 @@ s32 func_8007E59C(s32 objectIndex) { camera = camera1; for (someIndex = 0; someIndex < gPlayerCountSelection1; someIndex++) { temp_v0 = func_8007E50C(objectIndex, player++, camera++); - if (temp_v0 != 0) break; + if (temp_v0 != 0) + break; } return temp_v0; } void func_8007E63C(s32 objectIndex) { - switch (gObjectList[objectIndex].state) { /* irregular */ - case 0x32: - if (f32_step_up_towards(&gObjectList[objectIndex].offset[1], gObjectList[objectIndex].unk_01C[1] + 15.0, 1.5f) != 0) { - set_object_flag_status_true(objectIndex, 0x00000200); - func_800722A4(objectIndex, 1); - func_800722CC(objectIndex, 2); - reset_timer_go_next_state(objectIndex); - } - break; - case 0x33: - if (f32_step_down_towards(&gObjectList[objectIndex].offset[1], 0.0f, 2.0f) != 0) { - if (gObjectList[objectIndex].offset[1] >= 16.0f) { + switch (gObjectList[objectIndex].state) { /* irregular */ + case 0x32: + if (f32_step_up_towards(&gObjectList[objectIndex].offset[1], + gObjectList[objectIndex].unk_01C[1] + 15.0, 1.5f) + != 0) { + set_object_flag_status_true(objectIndex, 0x00000200); + func_800722A4(objectIndex, 1); + func_800722CC(objectIndex, 2); + initiate_next_state(objectIndex); + } + break; + case 0x33: + if (f32_step_down_towards(&gObjectList[objectIndex].offset[1], 0.0f, 2.0f) != 0) { + if (gObjectList[objectIndex].offset[1] >= 16.0f) { + gObjectList[objectIndex].textureListIndex = 0; + } else if (gObjectList[objectIndex].offset[1] >= 8.0f) { + gObjectList[objectIndex].textureListIndex = 1; + } else { + gObjectList[objectIndex].textureListIndex = 2; + } + func_800722CC(objectIndex, 1); + if (is_obj_flag_status_active(objectIndex, 0x00010000) != 0) { + func_800722A4(objectIndex, 0x00000010); + if (is_obj_flag_status_active(objectIndex, VISIBLE) != 0) { + func_800722A4(objectIndex, 0x00000020); + } + } + if (func_80072320(objectIndex, 2) != 0) { + func_800726CC(objectIndex, 0x00000064); + } else { + initiate_next_state(objectIndex); + } + } + break; + case 0x34: + func_80072AAC(objectIndex, 3, 6); + break; + case 0x35: + func_80072AAC(objectIndex, 2, 0x00000032); + break; + case 0x36: + if (gObjectList[objectIndex].offset[1] >= 20.0f) { gObjectList[objectIndex].textureListIndex = 0; - } else if (gObjectList[objectIndex].offset[1] >= 8.0f) { + } else if (gObjectList[objectIndex].offset[1] >= 18.0f) { gObjectList[objectIndex].textureListIndex = 1; - } else { + } + if (f32_step_up_towards(&gObjectList[objectIndex].offset[1], + gObjectList[objectIndex].unk_01C[1], 0.5f) + != 0) { + set_object_flag_status_false(objectIndex, 0x00000200); + func_8007266C(objectIndex); + } + break; + case 0x64: + func_80072E54(objectIndex, 3, 5, 1, 8, 0); + break; + case 0x65: + set_and_run_timer_object(objectIndex, 0x0000001E); + break; + case 0x66: + if (f32_step_up_towards(&gObjectList[objectIndex].offset[1], 20.0f, 1.5f) != 0) { + initiate_next_state(objectIndex); + } + break; + case 0x67: + if (f32_step_down_towards(&gObjectList[objectIndex].offset[1], 0.0f, 1.5f) != 0) { + if (is_obj_flag_status_active(objectIndex, 0x00020000) != 0) { + func_800722A4(objectIndex, 0x00000010); + if (is_obj_flag_status_active(objectIndex, VISIBLE) != 0) { + func_800722A4(objectIndex, 0x00000020); + } + } + initiate_next_state(objectIndex); + } + break; + case 0x68: + if (f32_step_up_towards(&gObjectList[objectIndex].offset[1], 12.0f, 1.5f) != 0) { + initiate_next_state(objectIndex); + } + break; + case 0x69: + if (f32_step_down_towards(&gObjectList[objectIndex].offset[1], 0.0f, 1.5f) != 0) { + if (is_obj_flag_status_active(objectIndex, 0x00020000) != 0) { + func_800722A4(objectIndex, 0x00000010); + if (is_obj_flag_status_active(objectIndex, VISIBLE) != 0) { + func_800722A4(objectIndex, 0x00000020); + } + } + func_800C98B8(gObjectList[objectIndex].pos, gObjectList[objectIndex].velocity, + SOUND_ARG_LOAD(0x19, 0x01, 0x80, 0x45)); + initiate_next_state(objectIndex); + } + break; + case 0x6A: + if (func_8007326C(objectIndex, 5, 3, 1, 6, 3) != 0) { + func_80080DE4(objectIndex); + } + break; + case 0x6B: + if (gObjectList[objectIndex].offset[1] >= 22.0f) { + gObjectList[objectIndex].textureListIndex = 0; + } else if (gObjectList[objectIndex].offset[1] >= 20.0f) { + gObjectList[objectIndex].textureListIndex = 1; + } else if (gObjectList[objectIndex].offset[1] >= 18.0f) { gObjectList[objectIndex].textureListIndex = 2; - } - func_800722CC(objectIndex, 1); - if (is_obj_flag_status_active(objectIndex, 0x00010000) != 0) { - func_800722A4(objectIndex, 0x00000010); - if (is_obj_flag_status_active(objectIndex, VISIBLE) != 0) { - func_800722A4(objectIndex, 0x00000020); - } - } - if (func_80072320(objectIndex, 2) != 0) { - func_800726CC(objectIndex, 0x00000064); + } else if (gObjectList[objectIndex].offset[1] >= 16.0f) { + gObjectList[objectIndex].textureListIndex = 3; + } else if (gObjectList[objectIndex].offset[1] >= 14.0f) { + gObjectList[objectIndex].textureListIndex = 4; } else { - reset_timer_go_next_state(objectIndex); + func_800730BC(objectIndex, 3, 5, 1, 6, -1); } - } - break; - case 0x34: - func_80072AAC(objectIndex, 3, 6); - break; - case 0x35: - func_80072AAC(objectIndex, 2, 0x00000032); - break; - case 0x36: - if (gObjectList[objectIndex].offset[1] >= 20.0f) { - gObjectList[objectIndex].textureListIndex = 0; - } else if (gObjectList[objectIndex].offset[1] >= 18.0f) { - gObjectList[objectIndex].textureListIndex = 1; - } - if (f32_step_up_towards(&gObjectList[objectIndex].offset[1], gObjectList[objectIndex].unk_01C[1], 0.5f) != 0) { - set_object_flag_status_false(objectIndex, 0x00000200); - func_8007266C(objectIndex); - } - break; - case 0x64: - func_80072E54(objectIndex, 3, 5, 1, 8, 0); - break; - case 0x65: - set_and_run_timer_object(objectIndex, 0x0000001E); - break; - case 0x66: - if (f32_step_up_towards(&gObjectList[objectIndex].offset[1], 20.0f, 1.5f) != 0) { - reset_timer_go_next_state(objectIndex); - } - break; - case 0x67: - if (f32_step_down_towards(&gObjectList[objectIndex].offset[1], 0.0f, 1.5f) != 0) { - if (is_obj_flag_status_active(objectIndex, 0x00020000) != 0) { - func_800722A4(objectIndex, 0x00000010); - if (is_obj_flag_status_active(objectIndex, VISIBLE) != 0) { - func_800722A4(objectIndex, 0x00000020); - } + if (f32_step_up_towards(&gObjectList[objectIndex].offset[1], + gObjectList[objectIndex].unk_01C[1], 0.5f) + != 0) { + set_object_timer_running(objectIndex, 0); + initiate_next_state(objectIndex); } - reset_timer_go_next_state(objectIndex); - } - break; - case 0x68: - if (f32_step_up_towards(&gObjectList[objectIndex].offset[1], 12.0f, 1.5f) != 0) { - reset_timer_go_next_state(objectIndex); - } - break; - case 0x69: - if (f32_step_down_towards(&gObjectList[objectIndex].offset[1], 0.0f, 1.5f) != 0) { - if (is_obj_flag_status_active(objectIndex, 0x00020000) != 0) { - func_800722A4(objectIndex, 0x00000010); - if (is_obj_flag_status_active(objectIndex, VISIBLE) != 0) { - func_800722A4(objectIndex, 0x00000020); - } + break; + case 0x6C: + if (set_and_run_timer_object(objectIndex, 0x00000064) != 0) { + func_800722CC(objectIndex, 2); + set_object_flag_status_false(objectIndex, 0x00000200); + func_8007266C(objectIndex); } - func_800C98B8(gObjectList[objectIndex].pos, gObjectList[objectIndex].velocity, SOUND_ARG_LOAD(0x19, 0x01, 0x80, 0x45)); - reset_timer_go_next_state(objectIndex); - } - break; - case 0x6A: - if (func_8007326C(objectIndex, 5, 3, 1, 6, 3) != 0) { - func_80080DE4(objectIndex); - } - break; - case 0x6B: - if (gObjectList[objectIndex].offset[1] >= 22.0f) { - gObjectList[objectIndex].textureListIndex = 0; - } else if (gObjectList[objectIndex].offset[1] >= 20.0f) { - gObjectList[objectIndex].textureListIndex = 1; - } else if (gObjectList[objectIndex].offset[1] >= 18.0f) { - gObjectList[objectIndex].textureListIndex = 2; - } else if (gObjectList[objectIndex].offset[1] >= 16.0f) { - gObjectList[objectIndex].textureListIndex = 3; - } else if (gObjectList[objectIndex].offset[1] >= 14.0f) { - gObjectList[objectIndex].textureListIndex = 4; - } else { - func_800730BC(objectIndex, 3, 5, 1, 6, -1); - } - if (f32_step_up_towards(&gObjectList[objectIndex].offset[1], gObjectList[objectIndex].unk_01C[1], 0.5f) != 0) { - set_object_timer_running(objectIndex, 0); - reset_timer_go_next_state(objectIndex); - } - break; - case 0x6C: - if (set_and_run_timer_object(objectIndex, 0x00000064) != 0) { - func_800722CC(objectIndex, 2); - set_object_flag_status_false(objectIndex, 0x00000200); - func_8007266C(objectIndex); - } - break; - case 0xC8: - if (set_and_run_timer_object(objectIndex, 0x0000012C) != 0) { - func_80072320(objectIndex, 0x00000080); - func_80072428(objectIndex); - func_800726CC(objectIndex, 1); - } - break; - case 0x12C: - if (func_80073E18(objectIndex, &gObjectList[objectIndex].orientation[1], 0x0400U, 0x00008000) != 0) { - func_800722CC(objectIndex, 4); - func_8007266C(objectIndex); - } - break; + break; + case 0xC8: + if (set_and_run_timer_object(objectIndex, 0x0000012C) != 0) { + func_80072320(objectIndex, 0x00000080); + func_80072428(objectIndex); + func_800726CC(objectIndex, 1); + } + break; + case 0x12C: + if (func_80073E18(objectIndex, &gObjectList[objectIndex].orientation[1], 0x0400U, + 0x00008000) + != 0) { + func_800722CC(objectIndex, 4); + func_8007266C(objectIndex); + } + break; } } @@ -5113,7 +5278,8 @@ void func_8007EC30(s32 objectIndex) { set_obj_direction_angle(objectIndex, 0U, 0xC000U, 0U); set_obj_orientation(objectIndex, 0U, 0xC000U, 0U); } - init_texture_object(objectIndex, d_course_bowsers_castle_thwomp_tlut, (u8*) d_course_bowsers_castle_thwomp_faces, 0x10U, (u16) 0x00000040); + init_texture_object(objectIndex, d_course_bowsers_castle_thwomp_tlut, + (u8 *) d_course_bowsers_castle_thwomp_faces, 0x10U, (u16) 0x00000040); object->model = d_course_bowsers_castle_dl_thwomp; object->boundingBoxSize = 0x000C; object->sizeScaling = 1.0f; @@ -5122,30 +5288,30 @@ void func_8007EC30(s32 objectIndex) { object->type = 0; object->unk_0DF = 6; func_800724DC(objectIndex); - reset_timer_go_next_state(objectIndex); + initiate_next_state(objectIndex); } void func_8007ED6C(s32 objectIndex) { UNUSED s32 stackPadding[4]; switch (gObjectList[objectIndex].state) { - case 0: - break; - case 1: - func_8007EC30(objectIndex); - break; - case 2: - set_and_run_timer_object(objectIndex, 0x0000003C); - break; - case 3: - func_80072568(objectIndex, 0x00000032); - break; - case 4: - if (func_8007E59C(objectIndex) != 0) { - func_800725E8(objectIndex, 0x0000012C, 2); - } else { - func_800726CC(objectIndex, 2); - } - break; + case 0: + break; + case 1: + func_8007EC30(objectIndex); + break; + case 2: + set_and_run_timer_object(objectIndex, 0x0000003C); + break; + case 3: + func_80072568(objectIndex, 0x00000032); + break; + case 4: + if (func_8007E59C(objectIndex) != 0) { + func_800725E8(objectIndex, 0x0000012C, 2); + } else { + func_800726CC(objectIndex, 2); + } + break; } func_8007E63C(objectIndex); object_calculate_new_pos_offset(objectIndex); @@ -5156,7 +5322,8 @@ void func_8007ED6C(s32 objectIndex) { void func_8007EE5C(s32 objectIndex) { Object *object; - init_texture_object(objectIndex, d_course_bowsers_castle_thwomp_tlut, (u8*) d_course_bowsers_castle_thwomp_faces, 0x10U, (u16) 0x00000040); + init_texture_object(objectIndex, d_course_bowsers_castle_thwomp_tlut, + (u8 *) d_course_bowsers_castle_thwomp_faces, 0x10U, (u16) 0x00000040); object = &gObjectList[objectIndex]; object->sizeScaling = 1.0f; object->model = d_course_bowsers_castle_dl_thwomp; @@ -5182,187 +5349,223 @@ void func_8007EE5C(s32 objectIndex) { } else { object->unk_0DD = 2; } - reset_timer_go_next_state(objectIndex); + initiate_next_state(objectIndex); } void func_8007EFBC(s32 objectIndex) { switch (gObjectList[objectIndex].unk_0AE) { - case 1: - if (func_80073E18(objectIndex, (u16 *) &gObjectList[objectIndex].orientation[1], 0x0800U, 0x00008000) != 0) { - gObjectList[objectIndex].unk_01C[0] = (f32) ((f64) xOrientation * 200.0); - func_80086FD4(objectIndex); - } - break; - case 2: - if (f32_step_towards(gObjectList[objectIndex].offset, gObjectList[objectIndex].unk_01C[0], 4.0f) != 0) { - func_80086FD4(objectIndex); - } - break; - case 3: - if (func_80073E18(objectIndex, (u16 *) &gObjectList[objectIndex].orientation[1], 0x0400U, 0x00008000) != 0) { - func_800726CC(objectIndex, 3); - func_80086FD4(objectIndex); - } - break; - case 5: - if (func_80073E18(objectIndex, (u16 *) &gObjectList[objectIndex].orientation[1], 0x0400U, 0x0000C000) != 0) { - func_80086FD4(objectIndex); - } - break; - case 6: - if (f32_step_down_towards(&gObjectList[objectIndex].offset[2], -100.0f, 2.0f) != 0) { - func_80086FD4(objectIndex); - } - break; - case 7: - if (func_80073E18(objectIndex, (u16 *) &gObjectList[objectIndex].orientation[1], 0x0400U, 0x00004000) != 0) { - func_80086FD4(objectIndex); - func_800726CC(objectIndex, 3); - } - break; - case 9: - if (func_80073E18(objectIndex, (u16 *) &gObjectList[objectIndex].orientation[1], 0x0400U, 0x00010000) != 0) { - func_80086FD4(objectIndex); - } - break; - case 10: - if (f32_step_towards(gObjectList[objectIndex].offset, 0.0f, 4.0f) != 0) { - func_80086FD4(objectIndex); - } - break; - case 11: - if (func_80073E18(objectIndex, (u16 *) &gObjectList[objectIndex].orientation[1], 0x0400U, 0x00010000) != 0) { - func_80086FD4(objectIndex); - func_800726CC(objectIndex, 3); - } - break; - case 13: - if (func_80073E18(objectIndex, (u16 *) &gObjectList[objectIndex].orientation[1], 0x0400U, 0x00014000) != 0) { - func_80086FD4(objectIndex); - } - break; - case 14: - if (f32_step_up_towards(&gObjectList[objectIndex].offset[2], 0.0f, 2.0f) != 0) { - func_80086FD4(objectIndex); - } - break; - case 15: - if (func_80073E18(objectIndex, (u16 *) &gObjectList[objectIndex].orientation[1], 0x0400U, 0x0000C000) != 0) { - func_80086FD4(objectIndex); - func_800726CC(objectIndex, 3); - } - break; - case 17: - func_8008701C(objectIndex, 1); - break; - case 0: - default: - break; + case 1: + if (func_80073E18(objectIndex, (u16 *) &gObjectList[objectIndex].orientation[1], 0x0800U, + 0x00008000) + != 0) { + gObjectList[objectIndex].unk_01C[0] = (f32) ((f64) xOrientation * 200.0); + func_80086FD4(objectIndex); + } + break; + case 2: + if (f32_step_towards(gObjectList[objectIndex].offset, gObjectList[objectIndex].unk_01C[0], + 4.0f) + != 0) { + func_80086FD4(objectIndex); + } + break; + case 3: + if (func_80073E18(objectIndex, (u16 *) &gObjectList[objectIndex].orientation[1], 0x0400U, + 0x00008000) + != 0) { + func_800726CC(objectIndex, 3); + func_80086FD4(objectIndex); + } + break; + case 5: + if (func_80073E18(objectIndex, (u16 *) &gObjectList[objectIndex].orientation[1], 0x0400U, + 0x0000C000) + != 0) { + func_80086FD4(objectIndex); + } + break; + case 6: + if (f32_step_down_towards(&gObjectList[objectIndex].offset[2], -100.0f, 2.0f) != 0) { + func_80086FD4(objectIndex); + } + break; + case 7: + if (func_80073E18(objectIndex, (u16 *) &gObjectList[objectIndex].orientation[1], 0x0400U, + 0x00004000) + != 0) { + func_80086FD4(objectIndex); + func_800726CC(objectIndex, 3); + } + break; + case 9: + if (func_80073E18(objectIndex, (u16 *) &gObjectList[objectIndex].orientation[1], 0x0400U, + 0x00010000) + != 0) { + func_80086FD4(objectIndex); + } + break; + case 10: + if (f32_step_towards(gObjectList[objectIndex].offset, 0.0f, 4.0f) != 0) { + func_80086FD4(objectIndex); + } + break; + case 11: + if (func_80073E18(objectIndex, (u16 *) &gObjectList[objectIndex].orientation[1], 0x0400U, + 0x00010000) + != 0) { + func_80086FD4(objectIndex); + func_800726CC(objectIndex, 3); + } + break; + case 13: + if (func_80073E18(objectIndex, (u16 *) &gObjectList[objectIndex].orientation[1], 0x0400U, + 0x00014000) + != 0) { + func_80086FD4(objectIndex); + } + break; + case 14: + if (f32_step_up_towards(&gObjectList[objectIndex].offset[2], 0.0f, 2.0f) != 0) { + func_80086FD4(objectIndex); + } + break; + case 15: + if (func_80073E18(objectIndex, (u16 *) &gObjectList[objectIndex].orientation[1], 0x0400U, + 0x0000C000) + != 0) { + func_80086FD4(objectIndex); + func_800726CC(objectIndex, 3); + } + break; + case 17: + func_8008701C(objectIndex, 1); + break; + case 0: + default: + break; } } void func_8007F280(s32 objectIndex) { switch (gObjectList[objectIndex].unk_0AE) { - case 1: - if (func_80073E18(objectIndex, (u16 *) &gObjectList[objectIndex].orientation[1], 0x0400U, 0x00010000) != 0) { - gObjectList[objectIndex].unk_01C[0] = (f32) ((f64) xOrientation * -200.0); - func_80086FD4(objectIndex); - } - break; - case 2: - if (f32_step_towards(gObjectList[objectIndex].offset, gObjectList[objectIndex].unk_01C[0], 4.0f) != 0) { - func_80086FD4(objectIndex); - } - break; - case 3: - if (func_80073E18(objectIndex, (u16 *) &gObjectList[objectIndex].orientation[1], 0x0400U, 0x00010000) != 0) { - func_800726CC(objectIndex, 3); - func_80086FD4(objectIndex); - } - break; - case 5: - if (func_80073E18(objectIndex, (u16 *) &gObjectList[objectIndex].orientation[1], 0x0400U, 0x00004000) != 0) { - func_80086FD4(objectIndex); - } - break; - case 6: - if (f32_step_up_towards(&gObjectList[objectIndex].offset[2], 100.0f, 2.0f) != 0) { - func_80086FD4(objectIndex); - } - break; - case 7: - if (func_80073E18(objectIndex, (u16 *) &gObjectList[objectIndex].orientation[1], 0x0400U, 0x0000C000) != 0) { - func_80086FD4(objectIndex); - func_800726CC(objectIndex, 3); - } - break; - case 9: - if (func_80073E18(objectIndex, (u16 *) &gObjectList[objectIndex].orientation[1], 0x0400U, 0x00008000) != 0) { - func_80086FD4(objectIndex); - } - break; - case 10: - if (f32_step_towards(gObjectList[objectIndex].offset, 0.0f, 4.0f) != 0) { - func_80086FD4(objectIndex); - } - break; - case 11: - if (func_80073E18(objectIndex, (u16 *) &gObjectList[objectIndex].orientation[1], 0x0400U, 0x00008000) != 0) { - func_80086FD4(objectIndex); - func_800726CC(objectIndex, 3); - } - break; - case 13: - if (func_80073E18(objectIndex, (u16 *) &gObjectList[objectIndex].orientation[1], 0x0400U, 0x0000C000) != 0) { - func_80086FD4(objectIndex); - } - break; - case 14: - if (f32_step_down_towards(&gObjectList[objectIndex].offset[2], 0.0f, 2.0f) != 0) { - func_80086FD4(objectIndex); - } - break; - case 15: - if (func_80073E18(objectIndex, (u16 *) &gObjectList[objectIndex].orientation[1], 0x0400U, 0x00014000) != 0) { - func_80086FD4(objectIndex); - func_800726CC(objectIndex, 3); - } - break; - case 17: - func_8008701C(objectIndex, 1); - break; - case 0: - default: - break; + case 1: + if (func_80073E18(objectIndex, (u16 *) &gObjectList[objectIndex].orientation[1], 0x0400U, + 0x00010000) + != 0) { + gObjectList[objectIndex].unk_01C[0] = (f32) ((f64) xOrientation * -200.0); + func_80086FD4(objectIndex); + } + break; + case 2: + if (f32_step_towards(gObjectList[objectIndex].offset, gObjectList[objectIndex].unk_01C[0], + 4.0f) + != 0) { + func_80086FD4(objectIndex); + } + break; + case 3: + if (func_80073E18(objectIndex, (u16 *) &gObjectList[objectIndex].orientation[1], 0x0400U, + 0x00010000) + != 0) { + func_800726CC(objectIndex, 3); + func_80086FD4(objectIndex); + } + break; + case 5: + if (func_80073E18(objectIndex, (u16 *) &gObjectList[objectIndex].orientation[1], 0x0400U, + 0x00004000) + != 0) { + func_80086FD4(objectIndex); + } + break; + case 6: + if (f32_step_up_towards(&gObjectList[objectIndex].offset[2], 100.0f, 2.0f) != 0) { + func_80086FD4(objectIndex); + } + break; + case 7: + if (func_80073E18(objectIndex, (u16 *) &gObjectList[objectIndex].orientation[1], 0x0400U, + 0x0000C000) + != 0) { + func_80086FD4(objectIndex); + func_800726CC(objectIndex, 3); + } + break; + case 9: + if (func_80073E18(objectIndex, (u16 *) &gObjectList[objectIndex].orientation[1], 0x0400U, + 0x00008000) + != 0) { + func_80086FD4(objectIndex); + } + break; + case 10: + if (f32_step_towards(gObjectList[objectIndex].offset, 0.0f, 4.0f) != 0) { + func_80086FD4(objectIndex); + } + break; + case 11: + if (func_80073E18(objectIndex, (u16 *) &gObjectList[objectIndex].orientation[1], 0x0400U, + 0x00008000) + != 0) { + func_80086FD4(objectIndex); + func_800726CC(objectIndex, 3); + } + break; + case 13: + if (func_80073E18(objectIndex, (u16 *) &gObjectList[objectIndex].orientation[1], 0x0400U, + 0x0000C000) + != 0) { + func_80086FD4(objectIndex); + } + break; + case 14: + if (f32_step_down_towards(&gObjectList[objectIndex].offset[2], 0.0f, 2.0f) != 0) { + func_80086FD4(objectIndex); + } + break; + case 15: + if (func_80073E18(objectIndex, (u16 *) &gObjectList[objectIndex].orientation[1], 0x0400U, + 0x00014000) + != 0) { + func_80086FD4(objectIndex); + func_800726CC(objectIndex, 3); + } + break; + case 17: + func_8008701C(objectIndex, 1); + break; + case 0: + default: + break; } } void func_8007F544(s32 objectIndex) { - switch (gObjectList[objectIndex].unk_0DD) { /* irregular */ - case 1: - func_8007EFBC(objectIndex); - break; - case 2: - func_8007F280(objectIndex); - break; + switch (gObjectList[objectIndex].unk_0DD) { /* irregular */ + case 1: + func_8007EFBC(objectIndex); + break; + case 2: + func_8007F280(objectIndex); + break; } } void func_8007F5A8(s32 objectIndex) { - switch (gObjectList[objectIndex].state) { /* irregular */ - case 0: - break; - case 1: - func_8007EE5C(objectIndex); - break; - case 3: - func_80072568(objectIndex, 0x00000032); - break; - case 4: - func_80086FD4(objectIndex); - reset_timer_go_next_state(objectIndex); - break; + switch (gObjectList[objectIndex].state) { /* irregular */ + case 0: + break; + case 1: + func_8007EE5C(objectIndex); + break; + case 3: + func_80072568(objectIndex, 0x00000032); + break; + case 4: + func_80086FD4(objectIndex); + initiate_next_state(objectIndex); + break; } func_8007E63C(objectIndex); func_8007F544(objectIndex); @@ -5432,7 +5635,7 @@ void func_8007F8D8(void) { player = gPlayerOne; var_s4 = 1; - for (someIndex = 0; someIndex < gNumActiveThwomps; someIndex++){ + for (someIndex = 0; someIndex < gNumActiveThwomps; someIndex++) { objectIndex = indexObjectList1[someIndex]; object = &gObjectList[objectIndex]; if (object->unk_0D5 == 3) { @@ -5444,9 +5647,10 @@ void func_8007F8D8(void) { } } if (var_s4 != 0) { - for (var_s0 = 0; var_s0 < 4; var_s0++, player++){ + for (var_s0 = 0; var_s0 < 4; var_s0++, player++) { if ((player->type & PLAYER_EXISTS) && !(player->type & PLAYER_KART_AI)) { - if (func_8007F75C(var_s0) != 0) break; + if (func_8007F75C(var_s0) != 0) + break; } } } @@ -5455,7 +5659,8 @@ void func_8007F8D8(void) { void func_8007FA08(s32 objectIndex) { Object *object; - init_texture_object(objectIndex, d_course_bowsers_castle_thwomp_tlut, (u8*) d_course_bowsers_castle_thwomp_faces, 0x10U, (u16) 0x00000040); + init_texture_object(objectIndex, d_course_bowsers_castle_thwomp_tlut, + (u8 *) d_course_bowsers_castle_thwomp_faces, 0x10U, (u16) 0x00000040); object = &gObjectList[objectIndex]; object->model = d_course_bowsers_castle_dl_thwomp; object->boundingBoxSize = 0x000C; @@ -5477,7 +5682,7 @@ void func_8007FA08(s32 objectIndex) { object->unk_0DF = 8; object->offset[1] = 15.0f; object->unk_01C[1] = 15.0f; - reset_timer_go_next_state(objectIndex); + initiate_next_state(objectIndex); } void func_8007FB48(s32 objectIndex) { @@ -5487,72 +5692,76 @@ void func_8007FB48(s32 objectIndex) { player = &gPlayerOne[gObjectList[objectIndex].unk_0D1]; switch (gObjectList[objectIndex].unk_0AE) { - case 1: - gObjectList[objectIndex].unk_0B0 = 0x00A0; - gObjectList[objectIndex].offset[0] = 0.0f; - gObjectList[objectIndex].offset[2] = 0.0f; - gObjectList[objectIndex].velocity[2] = 0.0f; - func_80086FD4(objectIndex); - break; - case 2: - gObjectList[objectIndex].velocity[0] = player->unk_094 * xOrientation * 1.25; - if (gObjectList[objectIndex].unk_048 >= gObjectList[objectIndex].unk_0B0) { - if (gObjectList[objectIndex].unk_0B0 == gObjectList[objectIndex].unk_048) { - if (D_8018D400 & 1) { + case 1: + gObjectList[objectIndex].unk_0B0 = 0x00A0; + gObjectList[objectIndex].offset[0] = 0.0f; + gObjectList[objectIndex].offset[2] = 0.0f; + gObjectList[objectIndex].velocity[2] = 0.0f; + func_80086FD4(objectIndex); + break; + case 2: + gObjectList[objectIndex].velocity[0] = player->unk_094 * xOrientation * 1.25; + if (gObjectList[objectIndex].unk_048 >= gObjectList[objectIndex].unk_0B0) { + if (gObjectList[objectIndex].unk_0B0 == gObjectList[objectIndex].unk_048) { + if (D_8018D400 & 1) { + gObjectList[objectIndex].velocity[2] = 1.5f; + } else { + gObjectList[objectIndex].velocity[2] = -1.5f; + } + } + if (gObjectList[objectIndex].velocity[2] >= 0.0) { + if (gObjectList[objectIndex].offset[2] >= 40.0) { + gObjectList[objectIndex].velocity[2] = -1.5f; + } + } else if ((f64) gObjectList[objectIndex].offset[2] <= -40.0) { gObjectList[objectIndex].velocity[2] = 1.5f; - } else { - gObjectList[objectIndex].velocity[2] = -1.5f; } } - if (gObjectList[objectIndex].velocity[2] >= 0.0) { - if (gObjectList[objectIndex].offset[2] >= 40.0) { - gObjectList[objectIndex].velocity[2] = -1.5f; + object_add_velocity_offset_xz(objectIndex); + if (gObjectList[objectIndex].unk_0B0 < 0x65) { + gObjectList[objectIndex].orientation[1] = + func_800417B4(gObjectList[objectIndex].orientation[1], + (gObjectList[objectIndex].direction_angle[1] + 0x8000)); + if (gObjectList[objectIndex].unk_0B0 == 0x0064) { + gObjectList[objectIndex].textureListIndex = 1; } - } else if ((f64) gObjectList[objectIndex].offset[2] <= -40.0) { - gObjectList[objectIndex].velocity[2] = 1.5f; } - } - object_add_velocity_offset_xz(objectIndex); - if (gObjectList[objectIndex].unk_0B0 < 0x65) { - gObjectList[objectIndex].orientation[1] = func_800417B4(gObjectList[objectIndex].orientation[1], (gObjectList[objectIndex].direction_angle[1] + 0x8000)); - if (gObjectList[objectIndex].unk_0B0 == 0x0064) { - gObjectList[objectIndex].textureListIndex = 1; - } - } - var_v0 = 0; - if (gIsMirrorMode != 0) { - if (gObjectList[objectIndex].offset[0] <= -1000.0) { + var_v0 = 0; + if (gIsMirrorMode != 0) { + if (gObjectList[objectIndex].offset[0] <= -1000.0) { + var_v0 = 1; + } + } else if (gObjectList[objectIndex].offset[0] >= 1000.0) { var_v0 = 1; } - } else if (gObjectList[objectIndex].offset[0] >= 1000.0) { - var_v0 = 1; - } - gObjectList[objectIndex].unk_0B0--; - if ((gObjectList[objectIndex].unk_0B0 == 0) || (var_v0 != 0)) { - gObjectList[objectIndex].unk_034 = 0.0f; - func_800726CC(objectIndex, 3); - func_80086FD4(objectIndex); - } - break; - case 4: - f32_step_towards(&gObjectList[objectIndex].offset[2], 0.0f, 2.0f); - f32_step_towards(gObjectList[objectIndex].offset, 0.0f, 5.0f); - if ((gObjectList[objectIndex].offset[0] + gObjectList[objectIndex].offset[2]) == 0.0) { - func_80086FD4(objectIndex); - } - break; - case 5: - gObjectList[objectIndex].orientation[1] = func_800417B4(gObjectList[objectIndex].orientation[1], gObjectList[objectIndex].direction_angle[1]); - if (gObjectList[objectIndex].orientation[1] == gObjectList[objectIndex].direction_angle[1]) { - func_800722CC(objectIndex, 8); - func_80086FD4(objectIndex); - gObjectList[objectIndex].textureListIndex = 0; - } - break; - case 0: - case 3: - default: - break; + gObjectList[objectIndex].unk_0B0--; + if ((gObjectList[objectIndex].unk_0B0 == 0) || (var_v0 != 0)) { + gObjectList[objectIndex].unk_034 = 0.0f; + func_800726CC(objectIndex, 3); + func_80086FD4(objectIndex); + } + break; + case 4: + f32_step_towards(&gObjectList[objectIndex].offset[2], 0.0f, 2.0f); + f32_step_towards(gObjectList[objectIndex].offset, 0.0f, 5.0f); + if ((gObjectList[objectIndex].offset[0] + gObjectList[objectIndex].offset[2]) == 0.0) { + func_80086FD4(objectIndex); + } + break; + case 5: + gObjectList[objectIndex].orientation[1] = func_800417B4( + gObjectList[objectIndex].orientation[1], gObjectList[objectIndex].direction_angle[1]); + if (gObjectList[objectIndex].orientation[1] + == gObjectList[objectIndex].direction_angle[1]) { + func_800722CC(objectIndex, 8); + func_80086FD4(objectIndex); + gObjectList[objectIndex].textureListIndex = 0; + } + break; + case 0: + case 3: + default: + break; } } @@ -5561,27 +5770,26 @@ void func_8007FEA4(s32 objectIndex) { object = &gObjectList[objectIndex]; switch (object->unk_0AE) { - case 1: - if (f32_step_towards(&object->offset[0], object->unk_01C[0], 5.0f) != 0) { - func_800726CC(objectIndex, 3); - func_80086FD4(objectIndex); + case 1: + if (f32_step_towards(&object->offset[0], object->unk_01C[0], 5.0f) != 0) { + func_800726CC(objectIndex, 3); + func_80086FD4(objectIndex); + break; + } + case 0: + case 2: + break; + case 3: + if (f32_step_towards(&object->offset[0], 0.0f, 5.0f) != 0) { + func_80086FD4(objectIndex); + func_800722CC(objectIndex, 8); + } break; - } - case 0: - case 2: - break; - case 3: - if (f32_step_towards(&object->offset[0], 0.0f, 5.0f) != 0) { - func_80086FD4(objectIndex); - func_800722CC(objectIndex, 8); - } - break; } } -void func_8007FF5C(s32 objectIndex) -{ - switch(gObjectList[objectIndex].unk_0DD) { +void func_8007FF5C(s32 objectIndex) { + switch (gObjectList[objectIndex].unk_0DD) { case 1: func_8007FB48(objectIndex); break; @@ -5592,7 +5800,7 @@ void func_8007FF5C(s32 objectIndex) } void func_8007FFC0(s32 objectIndex) { - switch (gObjectList[objectIndex].state) { /* irregular */ + switch (gObjectList[objectIndex].state) { /* irregular */ case 0: break; case 1: @@ -5602,7 +5810,7 @@ void func_8007FFC0(s32 objectIndex) { func_80072568(objectIndex, 0x00000032); break; case 4: - reset_timer_go_next_state(objectIndex); + initiate_next_state(objectIndex); func_80086FD4(objectIndex); break; } @@ -5615,7 +5823,8 @@ void func_8007FFC0(s32 objectIndex) { void func_80080078(s32 objectIndex) { Object *object; - init_texture_object(objectIndex, d_course_bowsers_castle_thwomp_tlut, (u8*) d_course_bowsers_castle_thwomp_faces, 0x10U, (u16) 0x00000040); + init_texture_object(objectIndex, d_course_bowsers_castle_thwomp_tlut, + (u8 *) d_course_bowsers_castle_thwomp_faces, 0x10U, (u16) 0x00000040); object = &gObjectList[objectIndex]; object->model = d_course_bowsers_castle_dl_thwomp; object->boundingBoxSize = 0x000C; @@ -5633,22 +5842,22 @@ void func_80080078(s32 objectIndex) { } else { set_obj_orientation(objectIndex, 0U, 0xC000U, 0U); } - switch (object->primAlpha) { /* irregular */ - case 0: - object->timer = 2; - break; - case 1: - object->timer = 0x0000003C; - break; - case 2: - object->timer = 0x00000078; - break; - case 3: - object->timer = 0x000000B4; - break; + switch (object->primAlpha) { /* irregular */ + case 0: + object->timer = 2; + break; + case 1: + object->timer = 0x0000003C; + break; + case 2: + object->timer = 0x00000078; + break; + case 3: + object->timer = 0x000000B4; + break; } func_800724DC(objectIndex); - reset_timer_go_next_state(objectIndex); + initiate_next_state(objectIndex); } void func_800801FC(s32 objectIndex) { @@ -5656,21 +5865,21 @@ void func_800801FC(s32 objectIndex) { object = &gObjectList[objectIndex]; switch (object->state) { - case 0: - break; - case 1: - func_80080078(objectIndex); - break; - case 2: - set_and_run_timer_object(objectIndex, object->timer); - break; - case 3: - func_80072568(objectIndex, 0x00000032); - break; - case 4: - object->timer = 0x0000003C; - func_800726CC(objectIndex, 2); - break; + case 0: + break; + case 1: + func_80080078(objectIndex); + break; + case 2: + set_and_run_timer_object(objectIndex, object->timer); + break; + case 3: + func_80072568(objectIndex, 0x00000032); + break; + case 4: + object->timer = 0x0000003C; + func_800726CC(objectIndex, 2); + break; } func_8007E63C(objectIndex); object_calculate_new_pos_offset(objectIndex); @@ -5682,7 +5891,8 @@ void func_800802C0(s32 objectIndex) { object = &gObjectList[objectIndex]; object->unk_0D8 = 0; - init_texture_object(objectIndex, d_course_bowsers_castle_thwomp_tlut, (u8*) d_course_bowsers_castle_thwomp_faces, 0x10U, (u16) 0x00000040); + init_texture_object(objectIndex, d_course_bowsers_castle_thwomp_tlut, + (u8 *) d_course_bowsers_castle_thwomp_faces, 0x10U, (u16) 0x00000040); object->model = d_course_bowsers_castle_dl_thwomp; object->textureListIndex = 0; object->boundingBoxSize = 0x000C; @@ -5704,33 +5914,34 @@ void func_800802C0(s32 objectIndex) { object->offset[0] = 0.0f; object->offset[2] = 0.0f; func_800724DC(objectIndex); - reset_timer_go_next_state(objectIndex); + initiate_next_state(objectIndex); } void func_80080408(s32 objectIndex) { switch (gObjectList[objectIndex].state) { - case 0: - break; - case 1: - func_800802C0(objectIndex); - break; - case 2: - func_8008A6DC(objectIndex, 100.0f); - if (is_obj_flag_status_active(objectIndex, VISIBLE) != 0) { - func_800C98B8(gObjectList[objectIndex].pos, gObjectList[objectIndex].velocity, SOUND_ARG_LOAD(0x19, 0x01, 0x80, 0x45)); - reset_timer_go_next_state(objectIndex); - } - break; - case 3: - if (func_800730BC(objectIndex, 3, 5, 1, 6, 6) != 0) { - gObjectList[objectIndex].textureListIndex = 0; - } - break; - case 4: - if (set_and_run_timer_object(objectIndex, 0x0000012C) != 0) { - func_800726CC(objectIndex, 2); - } - break; + case 0: + break; + case 1: + func_800802C0(objectIndex); + break; + case 2: + func_8008A6DC(objectIndex, 100.0f); + if (is_obj_flag_status_active(objectIndex, VISIBLE) != 0) { + func_800C98B8(gObjectList[objectIndex].pos, gObjectList[objectIndex].velocity, + SOUND_ARG_LOAD(0x19, 0x01, 0x80, 0x45)); + initiate_next_state(objectIndex); + } + break; + case 3: + if (func_800730BC(objectIndex, 3, 5, 1, 6, 6) != 0) { + gObjectList[objectIndex].textureListIndex = 0; + } + break; + case 4: + if (set_and_run_timer_object(objectIndex, 0x0000012C) != 0) { + func_800726CC(objectIndex, 2); + } + break; } object_calculate_new_pos_offset(objectIndex); func_80073514(objectIndex); @@ -5739,7 +5950,8 @@ void func_80080408(s32 objectIndex) { void func_80080524(s32 objectIndex) { Object *object; - init_texture_object(objectIndex, d_course_bowsers_castle_thwomp_tlut, (u8*) d_course_bowsers_castle_thwomp_faces, 0x10U, (u16) 0x00000040); + init_texture_object(objectIndex, d_course_bowsers_castle_thwomp_tlut, + (u8 *) d_course_bowsers_castle_thwomp_faces, 0x10U, (u16) 0x00000040); object = &gObjectList[objectIndex]; object->model = d_course_bowsers_castle_dl_thwomp; object->boundingBoxSize = 0x000C; @@ -5759,80 +5971,88 @@ void func_80080524(s32 objectIndex) { } else { set_obj_orientation(objectIndex, 0U, 0x4000U, 0U); } - switch (object->primAlpha) { /* irregular */ - case 0: - object->unk_0DD = 2; - object->velocity[2] = -1.0f; - break; - case 1: - object->unk_0DD = 2; - object->velocity[2] = -1.5f; - break; + switch (object->primAlpha) { /* irregular */ + case 0: + object->unk_0DD = 2; + object->velocity[2] = -1.0f; + break; + case 1: + object->unk_0DD = 2; + object->velocity[2] = -1.5f; + break; } func_800722A4(objectIndex, 0x00000080); - reset_timer_go_next_state(objectIndex); + initiate_next_state(objectIndex); } void func_800806BC(s32 objectIndex) { switch (gObjectList[objectIndex].unk_0AE) { - case 0: - break; - case 1: - if (f32_step_towards(&gObjectList[objectIndex].offset[2], 250.0f, gObjectList[objectIndex].velocity[2]) != 0) { - gObjectList[objectIndex].velocity[2] = -gObjectList[objectIndex].velocity[2]; - func_80086FD4(objectIndex); - } - break; - case 2: - if (f32_step_towards(&gObjectList[objectIndex].offset[2], 0.0f, gObjectList[objectIndex].velocity[2]) != 0) { - gObjectList[objectIndex].velocity[2] = -gObjectList[objectIndex].velocity[2]; - func_8008701C(objectIndex, 1); - } - break; + case 0: + break; + case 1: + if (f32_step_towards(&gObjectList[objectIndex].offset[2], 250.0f, + gObjectList[objectIndex].velocity[2]) + != 0) { + gObjectList[objectIndex].velocity[2] = -gObjectList[objectIndex].velocity[2]; + func_80086FD4(objectIndex); + } + break; + case 2: + if (f32_step_towards(&gObjectList[objectIndex].offset[2], 0.0f, + gObjectList[objectIndex].velocity[2]) + != 0) { + gObjectList[objectIndex].velocity[2] = -gObjectList[objectIndex].velocity[2]; + func_8008701C(objectIndex, 1); + } + break; } } void func_8008078C(s32 objectIndex) { switch (gObjectList[objectIndex].unk_0AE) { - case 0: - break; - case 1: - if (f32_step_towards(&gObjectList[objectIndex].offset[2], -250.0f, gObjectList[objectIndex].velocity[2]) != 0) { - gObjectList[objectIndex].velocity[2] = -gObjectList[objectIndex].velocity[2]; - func_80086FD4(objectIndex); - } - break; - case 2: - if (f32_step_towards(&gObjectList[objectIndex].offset[2], 0.0f, gObjectList[objectIndex].velocity[2]) != 0) { - gObjectList[objectIndex].velocity[2] = -gObjectList[objectIndex].velocity[2]; - func_8008701C(objectIndex, 1); - } - break; + case 0: + break; + case 1: + if (f32_step_towards(&gObjectList[objectIndex].offset[2], -250.0f, + gObjectList[objectIndex].velocity[2]) + != 0) { + gObjectList[objectIndex].velocity[2] = -gObjectList[objectIndex].velocity[2]; + func_80086FD4(objectIndex); + } + break; + case 2: + if (f32_step_towards(&gObjectList[objectIndex].offset[2], 0.0f, + gObjectList[objectIndex].velocity[2]) + != 0) { + gObjectList[objectIndex].velocity[2] = -gObjectList[objectIndex].velocity[2]; + func_8008701C(objectIndex, 1); + } + break; } } void func_8008085C(s32 objectIndex) { switch (gObjectList[objectIndex].unk_0DD) { - case 1: - func_800806BC(objectIndex); - break; - case 2: - func_8008078C(objectIndex); - break; + case 1: + func_800806BC(objectIndex); + break; + case 2: + func_8008078C(objectIndex); + break; } object_calculate_new_pos_offset(objectIndex); } void func_800808CC(s32 objectIndex) { - switch (gObjectList[objectIndex].state) { /* irregular */ - case 0: - break; - case 1: - func_80080524(objectIndex); - break; - case 2: - func_800730BC(objectIndex, 3, 5, 1, 6, -1); - break; + switch (gObjectList[objectIndex].state) { /* irregular */ + case 0: + break; + case 1: + func_80080524(objectIndex); + break; + case 2: + func_800730BC(objectIndex, 3, 5, 1, 6, -1); + break; } if (gObjectList[objectIndex].state >= 2) { func_8007E63C(objectIndex); @@ -5840,10 +6060,12 @@ void func_800808CC(s32 objectIndex) { func_80073514(objectIndex); if (gGamestate != 9) { if ((D_8018D40C == 0) && (gObjectList[objectIndex].state == 2)) { - func_800C98B8(gObjectList[objectIndex].pos, gObjectList[objectIndex].velocity, SOUND_ARG_LOAD(0x19, 0x03, 0x60, 0x45)); + func_800C98B8(gObjectList[objectIndex].pos, gObjectList[objectIndex].velocity, + SOUND_ARG_LOAD(0x19, 0x03, 0x60, 0x45)); } } else if ((gCutsceneShotTimer < 0xBF) && (((s16) gCutsceneShotTimer % 88) == 0x0000001E)) { - func_800C98B8(gObjectList[objectIndex].pos, gObjectList[objectIndex].velocity, SOUND_ARG_LOAD(0x19, 0x03, 0x60, 0x45)); + func_800C98B8(gObjectList[objectIndex].pos, gObjectList[objectIndex].velocity, + SOUND_ARG_LOAD(0x19, 0x03, 0x60, 0x45)); } } } @@ -5859,9 +6081,11 @@ void func_80080A4C(s32 objectIndex, s32 cameraPlayerId) { Player *player = &gPlayerOne[cameraPlayerId]; if (gScreenModeSelection != SCREEN_MODE_3P_4P_SPLITSCREEN) { - if ((func_80072320(objectIndex, 0x00000010) != 0) && (is_within_horizontal_distance_of_player(objectIndex, player, 500.0f) != false)) { + if ((func_80072320(objectIndex, 0x00000010) != 0) + && (is_within_horizontal_distance_of_player(objectIndex, player, 500.0f) != false)) { func_8001CA10(camera); - func_800C98B8(gObjectList[objectIndex].pos, gObjectList[objectIndex].velocity, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x0F)); + func_800C98B8(gObjectList[objectIndex].pos, gObjectList[objectIndex].velocity, + SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x0F)); } } } @@ -5874,13 +6098,16 @@ void func_80080B28(s32 objectIndex, s32 playerId) { if (is_obj_flag_status_active(objectIndex, 0x00000200) != 0) { if (!(temp_s0->soundEffects & 0x100)) { temp_f0 = func_80088F54(objectIndex, temp_s0); - if ((temp_f0 <= 9.0) && !(temp_s0->effects & 0x04000000) && (has_collided_horizontally_with_player(objectIndex, temp_s0) != 0)) { + if ((temp_f0 <= 9.0) && !(temp_s0->effects & 0x04000000) + && (has_collided_horizontally_with_player(objectIndex, temp_s0) != 0)) { if ((temp_s0->type & 0x8000) && !(temp_s0->type & 0x100)) { if (!(temp_s0->effects & 0x200)) { - func_80089474(objectIndex, playerId, 1.4f, 1.1f, SOUND_ARG_LOAD(0x19, 0x00, 0xA0, 0x4C)); + func_80089474(objectIndex, playerId, 1.4f, 1.1f, + SOUND_ARG_LOAD(0x19, 0x00, 0xA0, 0x4C)); } else if (func_80072354(objectIndex, 0x00000040) != 0) { if (temp_s0->type & 0x1000) { - func_800C98B8(temp_s0->pos, temp_s0->velocity, SOUND_ARG_LOAD(0x19, 0x01, 0xA2, 0x4A)); + func_800C98B8(temp_s0->pos, temp_s0->velocity, + SOUND_ARG_LOAD(0x19, 0x01, 0xA2, 0x4A)); } else { func_800C9060((u8) playerId, SOUND_ARG_LOAD(0x19, 0x01, 0xA2, 0x4A)); } @@ -5892,7 +6119,10 @@ void func_80080B28(s32 objectIndex, s32 playerId) { func_800726CC(objectIndex, 0x000000C8); } } - } else if ((temp_f0 <= 17.5) && (func_80072320(objectIndex, 1) != 0) && (is_within_horizontal_distance_of_player(objectIndex, temp_s0, (temp_s0->unk_094 * 0.5) + 7.0) != 0)) { + } else if ((temp_f0 <= 17.5) && (func_80072320(objectIndex, 1) != 0) + && (is_within_horizontal_distance_of_player(objectIndex, temp_s0, + (temp_s0->unk_094 * 0.5) + 7.0) + != 0)) { if ((temp_s0->type & 0x8000) && !(temp_s0->type & 0x100)) { if (is_obj_flag_status_active(objectIndex, 0x04000000) != 0) { func_80072180(); @@ -5954,8 +6184,10 @@ void func_80080FEC(s32 arg0) { s32 i; for (i = 0; i < 6; i++) { - objectIndex = add_unused_obj_index(gObjectParticle2, &gNextFreeObjectParticle2, gObjectParticle2_SIZE); - if (objectIndex == NULL_OBJECT_ID) break; + objectIndex = + add_unused_obj_index(gObjectParticle2, &gNextFreeObjectParticle2, gObjectParticle2_SIZE); + if (objectIndex == NULL_OBJECT_ID) + break; func_80080E8C(objectIndex, arg0, i); } } @@ -5974,34 +6206,35 @@ void func_80081080(s32 objectIndex) { object->offset[1] = 0.0f; object->offset[2] = 0.0f; object->sizeScaling = 0.25f; - reset_timer_go_next_state(objectIndex); + initiate_next_state(objectIndex); } void func_800810F4(s32 objectIndex) { - switch (gObjectList[objectIndex].state) { /* irregular */ - case 0: - break; - case 1: - func_80081080(objectIndex); - break; - case 2: - object_add_velocity_offset_xz(objectIndex); - f32_step_up_towards(&gObjectList[objectIndex].offset[1], 14.0f, 0.5f); - func_8007415C(objectIndex, &gObjectList[objectIndex].sizeScaling, 0.25f, 0.75f, 0.025f, 1, 0); - if (func_80073B00(objectIndex, &gObjectList[objectIndex].primAlpha, 0x000000FF, 0, 4, 0, 0) != 0) { - reset_timer_go_next_state(objectIndex); - } - break; - case 3: - func_80072428(objectIndex); - break; + switch (gObjectList[objectIndex].state) { /* irregular */ + case 0: + break; + case 1: + func_80081080(objectIndex); + break; + case 2: + object_add_velocity_offset_xz(objectIndex); + f32_step_up_towards(&gObjectList[objectIndex].offset[1], 14.0f, 0.5f); + func_8007415C(objectIndex, &gObjectList[objectIndex].sizeScaling, 0.25f, 0.75f, 0.025f, 1, + 0); + if (func_80073B00(objectIndex, &gObjectList[objectIndex].primAlpha, 0x000000FF, 0, 4, 0, 0) + != 0) { + initiate_next_state(objectIndex); + } + break; + case 3: + func_80072428(objectIndex); + break; } object_calculate_new_pos_offset(objectIndex); } // update twomp I think void func_80081208(void) { - } void func_80081210(void) { @@ -6022,24 +6255,24 @@ void func_80081210(void) { objectIndex = indexObjectList1[var_s4]; if (gObjectList[objectIndex].state != 0) { switch (gObjectList[objectIndex].unk_0D5) { - case 1: - func_8007ED6C(objectIndex); - break; - case 2: - func_8007F5A8(objectIndex); - break; - case 3: - func_8007FFC0(objectIndex); - break; - case 4: - func_800801FC(objectIndex); - break; - case 6: - func_80080408(objectIndex); - break; - case 5: - func_800808CC(objectIndex); - break; + case 1: + func_8007ED6C(objectIndex); + break; + case 2: + func_8007F5A8(objectIndex); + break; + case 3: + func_8007FFC0(objectIndex); + break; + case 4: + func_800801FC(objectIndex); + break; + case 6: + func_80080408(objectIndex); + break; + case 5: + func_800808CC(objectIndex); + break; } } } @@ -6063,17 +6296,21 @@ void func_80081210(void) { func_8007542C(3); for (var_s4 = 0; var_s4 < gNumActiveThwomps; var_s4++) { objectIndex = indexObjectList1[var_s4]; - if (func_80072320(objectIndex, 0x00000020) == 0) continue; + if (func_80072320(objectIndex, 0x00000020) == 0) + continue; func_800722CC(objectIndex, 0x00000020); func_80080FEC(objectIndex); } for (var_s4 = 0; var_s4 < gObjectParticle2_SIZE; var_s4++) { objectIndex = gObjectParticle2[var_s4]; - if (objectIndex == DELETED_OBJECT_ID) continue; - if (gObjectList[objectIndex].state == 0) continue; + if (objectIndex == DELETED_OBJECT_ID) + continue; + if (gObjectList[objectIndex].state == 0) + continue; func_800810F4(objectIndex); - if (gObjectList[objectIndex].state != 0) continue; + if (gObjectList[objectIndex].state != 0) + continue; delete_object_wrapper(&gObjectParticle2[var_s4]); } } @@ -6095,14 +6332,16 @@ void func_8008153C(s32 objectIndex) { for (var_s1 = 0; var_s1 < gObjectParticle2_SIZE; var_s1++) { loopObjectIndex = gObjectParticle2[var_s1]; - if (gObjectList[loopObjectIndex].state != 0) continue; + if (gObjectList[loopObjectIndex].state != 0) + continue; init_object(loopObjectIndex, 0); gObjectList[loopObjectIndex].activeTLUT = d_course_moo_moo_farm_mole_dirt; gObjectList[loopObjectIndex].tlutList = d_course_moo_moo_farm_mole_dirt; gObjectList[loopObjectIndex].sizeScaling = 0.15f; gObjectList[loopObjectIndex].velocity[1] = random_int(0x000AU); - gObjectList[loopObjectIndex].velocity[1] = (gObjectList[loopObjectIndex].velocity[1] * 0.1) + 4.8; + gObjectList[loopObjectIndex].velocity[1] = + (gObjectList[loopObjectIndex].velocity[1] * 0.1) + 4.8; gObjectList[loopObjectIndex].unk_034 = random_int(5U); gObjectList[loopObjectIndex].unk_034 = (gObjectList[loopObjectIndex].unk_034 * 0.01) + 0.8; gObjectList[loopObjectIndex].orientation[1] = (0x10000 / sp70) * var_s1; @@ -6115,24 +6354,28 @@ void func_8008153C(s32 objectIndex) { } void func_80081790(s32 objectIndex) { - switch (gObjectList[objectIndex].state) { - case 0: - break; /* irregular */ - case 1: - if (func_80087E08(objectIndex, gObjectList[objectIndex].velocity[1], 0.3f, gObjectList[objectIndex].unk_034, gObjectList[objectIndex].orientation[1], 0x00000032) != 0) { - reset_timer_go_next_state(objectIndex); - } - object_calculate_new_pos_offset(objectIndex); - break; - case 2: - func_80072428(objectIndex); - func_80086F60(objectIndex); - break; + switch (gObjectList[objectIndex].state) { + case 0: + break; /* irregular */ + case 1: + if (func_80087E08(objectIndex, gObjectList[objectIndex].velocity[1], 0.3f, + gObjectList[objectIndex].unk_034, gObjectList[objectIndex].orientation[1], + 0x00000032) + != 0) { + initiate_next_state(objectIndex); + } + object_calculate_new_pos_offset(objectIndex); + break; + case 2: + func_80072428(objectIndex); + func_80086F60(objectIndex); + break; } } void func_80081848(s32 objectIndex) { - init_texture_object(objectIndex, d_course_moo_moo_farm_mole_tlut, (u8*) d_course_moo_moo_farm_mole_frames, 0x20U, (u16) 0x00000040); + init_texture_object(objectIndex, d_course_moo_moo_farm_mole_tlut, + (u8 *) d_course_moo_moo_farm_mole_frames, 0x20U, (u16) 0x00000040); gObjectList[objectIndex].sizeScaling = 0.15f; gObjectList[objectIndex].textureListIndex = 0; set_obj_origin_offset(objectIndex, 0.0f, 0.0f, 0.0f); @@ -6141,55 +6384,55 @@ void func_80081848(s32 objectIndex) { gObjectList[objectIndex].boundingBoxSize = 6; gObjectList[objectIndex].velocity[1] = 4.0f; set_object_flag_status_true(objectIndex, 0x04000000); - reset_timer_go_next_state(objectIndex); + initiate_next_state(objectIndex); } void func_80081924(s32 objectIndex) { switch (gObjectList[objectIndex].unk_0AE) { - case 1: - if (f32_step_up_towards(&gObjectList[objectIndex].offset[1], 9.0f, 0.7f) != 0) { - func_80086FD4(objectIndex); - } - break; - case 2: - func_800871AC(objectIndex, 0x0000000A); - break; - case 3: - if (f32_step_down_towards(&gObjectList[objectIndex].offset[1], 3.0f, 1.0f) != 0) { + case 1: + if (f32_step_up_towards(&gObjectList[objectIndex].offset[1], 9.0f, 0.7f) != 0) { + func_80086FD4(objectIndex); + } + break; + case 2: + func_800871AC(objectIndex, 0x0000000A); + break; + case 3: + if (f32_step_down_towards(&gObjectList[objectIndex].offset[1], 3.0f, 1.0f) != 0) { + func_80086F60(objectIndex); + } + break; + case 4: + func_80087D24(objectIndex, 3.6f, 0.25f, 0.0f); + break; + case 5: func_80086F60(objectIndex); - } - break; - case 4: - func_80087D24(objectIndex, 3.6f, 0.25f, 0.0f); - break; - case 5: - func_80086F60(objectIndex); - break; - case 10: - gObjectList[objectIndex].orientation[2] += 0x1000; - gObjectList[objectIndex].velocity[1] -= 0.184; - func_8008751C(objectIndex); - object_add_velocity_offset_xyz(objectIndex); - if (gObjectList[objectIndex].pos[1] <= -10.0) { - func_80086F60(objectIndex); - } - break; - case 0: - default: - break; + break; + case 10: + gObjectList[objectIndex].orientation[2] += 0x1000; + gObjectList[objectIndex].velocity[1] -= 0.184; + func_8008751C(objectIndex); + object_add_velocity_offset_xyz(objectIndex); + if (gObjectList[objectIndex].pos[1] <= -10.0) { + func_80086F60(objectIndex); + } + break; + case 0: + default: + break; } } void func_80081A88(s32 objectIndex) { - switch (gObjectList[objectIndex].unk_0DD) { /* irregular */ - case 0: - break; - case 1: - func_8008B724(objectIndex); - break; - case 2: - func_80081924(objectIndex); - break; + switch (gObjectList[objectIndex].unk_0DD) { /* irregular */ + case 0: + break; + case 1: + func_8008B724(objectIndex); + break; + case 2: + func_80081924(objectIndex); + break; } object_calculate_new_pos_offset(objectIndex); } @@ -6199,59 +6442,59 @@ void func_80081AFC(s32 objectIndex, s32 arg1) { Object *object; object = &gObjectList[objectIndex]; - switch (object->state) { /* irregular */ - case 0x1: - func_80081848(objectIndex); - break; - case 0x2: - if (object->unk_04C == 0) { - func_80086EAC(objectIndex, 2, 1); - reset_timer_go_next_state(objectIndex); - set_object_flag_status_true(objectIndex, 0x00000200); - } else { - object->unk_04C--; - } - break; - case 0x3: - if (object->unk_0AE == 0) { - func_80086EAC(objectIndex, 2, 4); - func_8008153C(objectIndex); - reset_timer_go_next_state(objectIndex); - func_800C98B8(object->pos, object->velocity, SOUND_ARG_LOAD(0x19, 0x01, 0x80, 0x07)); - } - break; - case 0x4: - if (func_80072E54(objectIndex, 1, 6, 1, 2, 0) != 0) { - func_800726CC(objectIndex, 0x00000064); - } - break; - case 0xA: - func_80072E54(objectIndex, 1, 6, 1, 0, -1); - if (object->unk_0AE == 0) { - func_800726CC(objectIndex, 0x00000064); - } - break; - case 0x64: - if (object->unk_0AE == 0) { - set_object_flag_status_false(objectIndex, 0x00000200); - func_80072428(objectIndex); - switch (arg1) { /* switch 1; irregular */ - case 1: /* switch 1 */ - sp2C = D_8018D198; - break; - case 2: /* switch 1 */ - sp2C = D_8018D1A8; - break; - case 3: /* switch 1 */ - sp2C = D_8018D1B8; - break; + switch (object->state) { /* irregular */ + case 0x1: + func_80081848(objectIndex); + break; + case 0x2: + if (object->unk_04C == 0) { + func_80086EAC(objectIndex, 2, 1); + initiate_next_state(objectIndex); + set_object_flag_status_true(objectIndex, 0x00000200); + } else { + object->unk_04C--; } - sp2C[object->type] = 0; - } - break; - case 0: - default: - break; + break; + case 0x3: + if (object->unk_0AE == 0) { + func_80086EAC(objectIndex, 2, 4); + func_8008153C(objectIndex); + initiate_next_state(objectIndex); + func_800C98B8(object->pos, object->velocity, SOUND_ARG_LOAD(0x19, 0x01, 0x80, 0x07)); + } + break; + case 0x4: + if (func_80072E54(objectIndex, 1, 6, 1, 2, 0) != 0) { + func_800726CC(objectIndex, 0x00000064); + } + break; + case 0xA: + func_80072E54(objectIndex, 1, 6, 1, 0, -1); + if (object->unk_0AE == 0) { + func_800726CC(objectIndex, 0x00000064); + } + break; + case 0x64: + if (object->unk_0AE == 0) { + set_object_flag_status_false(objectIndex, 0x00000200); + func_80072428(objectIndex); + switch (arg1) { /* switch 1; irregular */ + case 1: /* switch 1 */ + sp2C = D_8018D198; + break; + case 2: /* switch 1 */ + sp2C = D_8018D1A8; + break; + case 3: /* switch 1 */ + sp2C = D_8018D1B8; + break; + } + sp2C[object->type] = 0; + } + break; + case 0: + default: + break; } if (object->state >= 2) { func_80073514(objectIndex); @@ -6269,7 +6512,8 @@ void func_80081D34(s32 objectIndex) { player = gPlayerOne; var_s4 = camera1; for (var_s2 = 0; var_s2 < D_8018D158; var_s2++, player++, var_s4++) { - if ((is_obj_flag_status_active(objectIndex, 0x00000200) != 0) && !(player->effects & 0x80000000) && (has_collided_with_player(objectIndex, player) != 0)) { + if ((is_obj_flag_status_active(objectIndex, 0x00000200) != 0) && !(player->effects & 0x80000000) + && (has_collided_with_player(objectIndex, player) != 0)) { if ((player->type & 0x8000) && !(player->type & 0x100)) { var_s5 = 1; object = &gObjectList[objectIndex]; @@ -6315,24 +6559,24 @@ void func_80081FF4(s32 objectIndex, s32 arg1) { init_object(objectIndex, 0); gObjectList[objectIndex].unk_04C = random_int(0x001EU) + 5; - switch (arg1) { /* irregular */ - case 1: - var_a2 = D_8018D198; - moleCount = NUM_GROUP1_MOLES; - offset = 0; - break; - case 2: - var_a2 = D_8018D1A8; - moleCount = NUM_GROUP2_MOLES; - offset = 24; - // offset = NUM_GROUP1_MOLES; - break; - case 3: - var_a2 = D_8018D1B8; - moleCount = NUM_GROUP3_MOLES; - offset = 57; - // offset = NUM_GROUP1_MOLES + NUM_GROUP2_MOLES; - break; + switch (arg1) { /* irregular */ + case 1: + var_a2 = D_8018D198; + moleCount = NUM_GROUP1_MOLES; + offset = 0; + break; + case 2: + var_a2 = D_8018D1A8; + moleCount = NUM_GROUP2_MOLES; + offset = 24; + // offset = NUM_GROUP1_MOLES; + break; + case 3: + var_a2 = D_8018D1B8; + moleCount = NUM_GROUP3_MOLES; + offset = 57; + // offset = NUM_GROUP1_MOLES + NUM_GROUP2_MOLES; + break; } var_v1 = random_int(moleCount); for (var_a0 = 0; var_a0 < moleCount; var_a0++) { @@ -6354,7 +6598,8 @@ void func_80081FF4(s32 objectIndex, s32 arg1) { gObjectList[objectIndex].origin_pos[1] = gMoleSpawns.asVec3sList[offset + var_v1][1] - 9.0; gObjectList[objectIndex].origin_pos[2] = gMoleSpawns.asVec3sList[offset + var_v1][2]; */ - gObjectList[objectIndex].origin_pos[0] = gMoleSpawns.asFlatList[offset + (var_v1 * 3) + 0] * xOrientation; + gObjectList[objectIndex].origin_pos[0] = + gMoleSpawns.asFlatList[offset + (var_v1 * 3) + 0] * xOrientation; gObjectList[objectIndex].origin_pos[1] = gMoleSpawns.asFlatList[offset + (var_v1 * 3) + 1] - 9.0; gObjectList[objectIndex].origin_pos[2] = gMoleSpawns.asFlatList[offset + (var_v1 * 3) + 2]; } @@ -6439,37 +6684,40 @@ void func_8008241C(s32 objectIndex, s32 arg1) { func_80086EF0(objectIndex); gObjectList[objectIndex].spline = D_800E633C[arg1 % 4]; set_object_flag_status_true(objectIndex, 0x00000800); - reset_timer_go_next_state(objectIndex); + initiate_next_state(objectIndex); } void func_80082714(s32 objectIndex, s32 arg1) { - switch(gObjectList[objectIndex].state) { - case 1: - func_8008241C(objectIndex , arg1); - break; - case 0: - default: - break; + switch (gObjectList[objectIndex].state) { + case 1: + func_8008241C(objectIndex, arg1); + break; + case 0: + default: + break; } } void func_8008275C(s32 objectIndex) { UNUSED s32 stackPadding; - switch (gObjectList[objectIndex].unk_0DD) { /* irregular */ - case 1: - func_8008B78C(objectIndex); - object_calculate_new_pos_offset(objectIndex); - break; - case 2: - func_8008B78C(objectIndex); - vec3f_copy(gObjectList[objectIndex].unk_01C, gObjectList[objectIndex].pos); - func_8000D940(gObjectList[objectIndex].origin_pos, (s16 *) &gObjectList[objectIndex].unk_0C6, gObjectList[objectIndex].unk_034, 0.0f, 0); - gObjectList[objectIndex].offset[0] *= 2.0; - gObjectList[objectIndex].offset[1] *= 2.5; - gObjectList[objectIndex].offset[2] *= 2.0; - object_calculate_new_pos_offset(objectIndex); - gObjectList[objectIndex].direction_angle[1] = get_angle_between_two_vectors(gObjectList[objectIndex].unk_01C, gObjectList[objectIndex].pos); - break; + switch (gObjectList[objectIndex].unk_0DD) { /* irregular */ + case 1: + func_8008B78C(objectIndex); + object_calculate_new_pos_offset(objectIndex); + break; + case 2: + func_8008B78C(objectIndex); + vec3f_copy(gObjectList[objectIndex].unk_01C, gObjectList[objectIndex].pos); + func_8000D940(gObjectList[objectIndex].origin_pos, + (s16 *) &gObjectList[objectIndex].unk_0C6, gObjectList[objectIndex].unk_034, + 0.0f, 0); + gObjectList[objectIndex].offset[0] *= 2.0; + gObjectList[objectIndex].offset[1] *= 2.5; + gObjectList[objectIndex].offset[2] *= 2.0; + object_calculate_new_pos_offset(objectIndex); + gObjectList[objectIndex].direction_angle[1] = get_angle_between_two_vectors( + gObjectList[objectIndex].unk_01C, gObjectList[objectIndex].pos); + break; } func_800873F4(objectIndex); } @@ -6484,7 +6732,8 @@ void update_seagulls(void) { temp_s0 = indexObjectList2[var_s3]; object = &gObjectList[temp_s0]; - if (object->state == 0) continue; + if (object->state == 0) + continue; func_80082714(temp_s0, var_s3); func_8008275C(temp_s0); @@ -6525,11 +6774,12 @@ void update_seagulls(void) { void init_ktb_crab(s32 objectIndex) { Object *object; - init_texture_object(objectIndex, d_course_koopa_troopa_beach_crab_tlut, (u8*) d_course_koopa_troopa_beach_crab_frames, 0x40U, (u16) 0x00000040); + init_texture_object(objectIndex, d_course_koopa_troopa_beach_crab_tlut, + (u8 *) d_course_koopa_troopa_beach_crab_frames, 0x40U, (u16) 0x00000040); object = &gObjectList[objectIndex]; object->sizeScaling = 0.15f; object->textureListIndex = 0; - reset_timer_go_next_state(objectIndex); + initiate_next_state(objectIndex); object->boundingBoxSize = 1; set_object_flag_status_true(objectIndex, 0x04000420); func_80086EAC(objectIndex, 0, 1); @@ -6540,18 +6790,18 @@ void init_ktb_crab(s32 objectIndex) { } void func_80082B34(s32 objectIndex, UNUSED s32 unused) { - switch (gObjectList[objectIndex].state) { /* irregular */ - case 0: - break; - case 1: - init_ktb_crab(objectIndex); - break; - case 2: - func_80072E54(objectIndex, 0, 3, 1, 2, -1); - break; - case 3: - func_80072E54(objectIndex, 4, 6, 1, 2, -1); - break; + switch (gObjectList[objectIndex].state) { /* irregular */ + case 0: + break; + case 1: + init_ktb_crab(objectIndex); + break; + case 2: + func_80072E54(objectIndex, 0, 3, 1, 2, -1); + break; + case 3: + func_80072E54(objectIndex, 4, 6, 1, 2, -1); + break; } if (gObjectList[objectIndex].state >= 2) { func_80073514(objectIndex); @@ -6560,37 +6810,41 @@ void func_80082B34(s32 objectIndex, UNUSED s32 unused) { void func_80082C30(s32 objectIndex) { switch (gObjectList[objectIndex].unk_0AE) { - case 1: - if (func_80087A0C(objectIndex, gObjectList[objectIndex].origin_pos[0], gObjectList[objectIndex].unk_01C[0], gObjectList[objectIndex].origin_pos[2], gObjectList[objectIndex].unk_01C[2]) != 0) { - func_800726CC(objectIndex, 3); - func_80086FD4(objectIndex); - } - break; - case 2: - if (func_80087104(objectIndex, 0x003CU) != 0) { - gObjectList[objectIndex].unk_034 = 0.8f; - func_800726CC(objectIndex, 2); - func_80086FD4(objectIndex); - } - break; - case 3: - if (func_80087954(objectIndex, 0x0000003C) != 0) { - func_80086FD4(objectIndex); - func_800726CC(objectIndex, 3); - } - break; - case 4: - if (func_80087104(objectIndex, 0x003CU) != 0) { - func_800726CC(objectIndex, 2); - func_80086FD4(objectIndex); - } - break; - case 5: - if (func_8008789C(objectIndex, 0x0000003C) != 0) { - func_800726CC(objectIndex, 3); - func_8008701C(objectIndex, 2); - } - break; + case 1: + if (func_80087A0C(objectIndex, gObjectList[objectIndex].origin_pos[0], + gObjectList[objectIndex].unk_01C[0], + gObjectList[objectIndex].origin_pos[2], + gObjectList[objectIndex].unk_01C[2]) + != 0) { + func_800726CC(objectIndex, 3); + func_80086FD4(objectIndex); + } + break; + case 2: + if (func_80087104(objectIndex, 0x003CU) != 0) { + gObjectList[objectIndex].unk_034 = 0.8f; + func_800726CC(objectIndex, 2); + func_80086FD4(objectIndex); + } + break; + case 3: + if (func_80087954(objectIndex, 0x0000003C) != 0) { + func_80086FD4(objectIndex); + func_800726CC(objectIndex, 3); + } + break; + case 4: + if (func_80087104(objectIndex, 0x003CU) != 0) { + func_800726CC(objectIndex, 2); + func_80086FD4(objectIndex); + } + break; + case 5: + if (func_8008789C(objectIndex, 0x0000003C) != 0) { + func_800726CC(objectIndex, 3); + func_8008701C(objectIndex, 2); + } + break; } object_calculate_new_pos_offset(objectIndex); if (is_obj_flag_status_active(objectIndex, VISIBLE) != 0) { @@ -6628,9 +6882,10 @@ void func_80082F1C(s32 objectIndex, s32 arg1) { gObjectList[objectIndex].model = (Gfx *) d_course_yoshi_valley_unk5; gObjectList[objectIndex].vertex = (Vtx *) d_course_yoshi_valley_unk4; gObjectList[objectIndex].sizeScaling = 0.027f; - if (test->rot && test->rot) {} + if (test->rot && test->rot) { + } test = &D_800E5DF4[arg1]; - reset_timer_go_next_state(objectIndex); + initiate_next_state(objectIndex); set_obj_origin_pos(objectIndex, test->pos[0] * xOrientation, test->pos[1], test->pos[2]); set_obj_origin_offset(objectIndex, 0.0f, 0.0f, 0.0f); set_obj_direction_angle(objectIndex, 0U, test->rot, 0U); @@ -6640,13 +6895,13 @@ GLOBAL_ASM("asm/non_matchings/update_objects/func_80082F1C.s") #endif void func_80083018(s32 objectIndex, s32 arg1) { - switch(gObjectList[objectIndex].state) { - case 1: - func_80082F1C(objectIndex , arg1); - break; - case 0: - default: - break; + switch (gObjectList[objectIndex].state) { + case 1: + func_80082F1C(objectIndex, arg1); + break; + case 0: + default: + break; } } @@ -6670,14 +6925,15 @@ void func_80083080(void) { void func_8008311C(s32 objectIndex, s32 arg1) { Object *object; - init_texture_object(objectIndex, d_course_yoshi_valley_hedgehog_tlut, d_course_yoshi_valley_hedgehog, 0x40U, (u16) 0x00000040); + init_texture_object(objectIndex, d_course_yoshi_valley_hedgehog_tlut, + d_course_yoshi_valley_hedgehog, 0x40U, (u16) 0x00000040); object = &gObjectList[objectIndex]; object->activeTLUT = d_course_yoshi_valley_hedgehog_tlut; object->activeTexture = d_course_yoshi_valley_hedgehog; object->vertex = common_vtx_hedgehog; object->sizeScaling = 0.2f; object->textureListIndex = 0; - reset_timer_go_next_state(objectIndex); + initiate_next_state(objectIndex); set_obj_origin_offset(objectIndex, 0.0f, 0.0f, 0.0f); set_obj_orientation(objectIndex, 0U, 0U, 0x8000U); object->unk_034 = ((arg1 % 6) * 0.1) + 0.5; @@ -6688,26 +6944,32 @@ void func_8008311C(s32 objectIndex, s32 arg1) { void func_80083248(s32 objectIndex) { switch (gObjectList[objectIndex].unk_0AE) { - case 0: - break; - case 1: - if (func_80087A0C(objectIndex, gObjectList[objectIndex].origin_pos[0], gObjectList[objectIndex].unk_09C, gObjectList[objectIndex].origin_pos[2], gObjectList[objectIndex].unk_09E) != 0) { - func_80086FD4(objectIndex); - } - break; - case 2: - func_800871AC(objectIndex, 0x0000003C); - break; - case 3: - if (func_80087A0C(objectIndex, gObjectList[objectIndex].unk_09C, gObjectList[objectIndex].origin_pos[0], gObjectList[objectIndex].unk_09E, gObjectList[objectIndex].origin_pos[2]) != 0) { - func_80086FD4(objectIndex); - } - break; - case 4: - if (func_80087060(objectIndex, 0x0000003C) != 0) { - func_8008701C(objectIndex, 1); - } - break; + case 0: + break; + case 1: + if (func_80087A0C(objectIndex, gObjectList[objectIndex].origin_pos[0], + gObjectList[objectIndex].unk_09C, gObjectList[objectIndex].origin_pos[2], + gObjectList[objectIndex].unk_09E) + != 0) { + func_80086FD4(objectIndex); + } + break; + case 2: + func_800871AC(objectIndex, 0x0000003C); + break; + case 3: + if (func_80087A0C(objectIndex, gObjectList[objectIndex].unk_09C, + gObjectList[objectIndex].origin_pos[0], gObjectList[objectIndex].unk_09E, + gObjectList[objectIndex].origin_pos[2]) + != 0) { + func_80086FD4(objectIndex); + } + break; + case 4: + if (func_80087060(objectIndex, 0x0000003C) != 0) { + func_8008701C(objectIndex, 1); + } + break; } object_calculate_new_pos_offset(objectIndex); if (is_obj_flag_status_active(objectIndex, 0x00200000) != 0) { @@ -6719,15 +6981,15 @@ void func_80083248(s32 objectIndex) { } void func_800833D0(s32 objectIndex, s32 arg1) { - switch (gObjectList[objectIndex].state) { /* irregular */ - case 0: - break; - case 1: - func_8008311C(objectIndex, arg1); - break; - case 2: - func_80072D3C(objectIndex, 0, 1, 4, -1); - break; + switch (gObjectList[objectIndex].state) { /* irregular */ + case 0: + break; + case 1: + func_8008311C(objectIndex, arg1); + break; + case 2: + func_80072D3C(objectIndex, 0, 1, 4, -1); + break; } if (gObjectList[objectIndex].textureListIndex == 0) { gObjectList[objectIndex].vertex = common_vtx_hedgehog; @@ -6769,7 +7031,7 @@ void func_80083538(s32 objectIndex, Vec3f arg1, s32 arg2, s32 arg3) { object->velocity[1] = random_int(0x0014U); object->velocity[1] = (object->velocity[1] * 0.5) + 2.6; object->unk_034 = random_int(0x000AU); - object->unk_034 = (object->unk_034 *0.1) + 4.5; + object->unk_034 = (object->unk_034 * 0.1) + 4.5; object->direction_angle[1] = (arg2 << 0x10) / arg3; object->origin_pos[0] = arg1[0]; object->origin_pos[1] = arg1[1]; @@ -6782,25 +7044,30 @@ void func_800836F0(Vec3f arg0) { s32 i; for (i = 0; i < D_8018D3BC; i++) { - objectIndex = add_unused_obj_index(&gObjectParticle2[0], &gNextFreeObjectParticle2, gObjectParticle2_SIZE); - if (objectIndex == NULL_OBJECT_ID) break; + objectIndex = add_unused_obj_index(&gObjectParticle2[0], &gNextFreeObjectParticle2, + gObjectParticle2_SIZE); + if (objectIndex == NULL_OBJECT_ID) + break; func_80083538(objectIndex, arg0, i, D_8018D3BC); } } void func_8008379C(s32 objectIndex) { switch (gObjectList[objectIndex].state) { - case 0: - break; - case 1: - if (func_80087E08(objectIndex, gObjectList[objectIndex].velocity[1], 0.74f, gObjectList[objectIndex].unk_034, gObjectList[objectIndex].direction_angle[1], 0x00000064) != 0) { - reset_timer_go_next_state(objectIndex); - } - break; - case 2: - func_80086F60(objectIndex); - func_80072428(objectIndex); - break; + case 0: + break; + case 1: + if (func_80087E08(objectIndex, gObjectList[objectIndex].velocity[1], 0.74f, + gObjectList[objectIndex].unk_034, + gObjectList[objectIndex].direction_angle[1], 0x00000064) + != 0) { + initiate_next_state(objectIndex); + } + break; + case 2: + func_80086F60(objectIndex); + func_80072428(objectIndex); + break; } object_calculate_new_pos_offset(objectIndex); gObjectList[objectIndex].orientation[2] += gObjectList[objectIndex].primAlpha; @@ -6809,12 +7076,13 @@ void func_8008379C(s32 objectIndex) { void func_80083868(s32 objectIndex) { Object *object; - init_texture_object(objectIndex, d_course_frappe_snowland_snowman_tlut, d_course_frappe_snowland_snowman_head, 0x40U, (u16) 0x00000040); + init_texture_object(objectIndex, d_course_frappe_snowland_snowman_tlut, + d_course_frappe_snowland_snowman_head, 0x40U, (u16) 0x00000040); object = &gObjectList[objectIndex]; object->vertex = D_0D0061B0; object->sizeScaling = 0.1f; object->textureListIndex = 0; - reset_timer_go_next_state(objectIndex); + initiate_next_state(objectIndex); set_obj_origin_offset(objectIndex, 0.0f, 0.0f, 0.0f); object->orientation[0] = 0; object->orientation[1] = 0; @@ -6827,43 +7095,44 @@ void func_80083868(s32 objectIndex) { void func_80083948(s32 objectIndex) { switch (gObjectList[objectIndex].unk_0AE) { - case 1: - func_80086FD4(objectIndex); - break; - case 2: - func_800871AC(objectIndex, 0x00000014); - break; - case 3: - func_8008701C(objectIndex, 1); - break; - case 10: - func_80087C48(objectIndex, 10.0f, 0.5f, 0x0000000A); - break; - case 11: - func_80087D24(objectIndex, 0.0f, 0.2f, -7.0f); - break; - case 20: - if (f32_step_up_towards(&gObjectList[objectIndex].offset[1], 0.0f, 0.2f) != 0) { - func_80073800(objectIndex, 0); + case 1: + func_80086FD4(objectIndex); + break; + case 2: + func_800871AC(objectIndex, 0x00000014); + break; + case 3: func_8008701C(objectIndex, 1); - } - break; - case 0: - default: - break; + break; + case 10: + func_80087C48(objectIndex, 10.0f, 0.5f, 0x0000000A); + break; + case 11: + func_80087D24(objectIndex, 0.0f, 0.2f, -7.0f); + break; + case 20: + if (f32_step_up_towards(&gObjectList[objectIndex].offset[1], 0.0f, 0.2f) != 0) { + func_80073800(objectIndex, 0); + func_8008701C(objectIndex, 1); + } + break; + case 0: + default: + break; } object_calculate_new_pos_offset(objectIndex); - func_80073D0C(objectIndex, &gObjectList[objectIndex].primAlpha, -0x00001000, 0x00001000, 0x00000400, 1, -1); + func_80073D0C(objectIndex, &gObjectList[objectIndex].primAlpha, -0x00001000, 0x00001000, 0x00000400, + 1, -1); gObjectList[objectIndex].orientation[2] = gObjectList[objectIndex].primAlpha + 0x8000; } void func_80083A94(s32 objectIndex) { switch (gObjectList[objectIndex].state) { - case 0: - break; - case 1: - func_80083868(objectIndex); - break; + case 0: + break; + case 1: + func_80083868(objectIndex); + break; } if (gObjectList[objectIndex].state >= 2) { func_80073514(objectIndex); @@ -6872,11 +7141,12 @@ void func_80083A94(s32 objectIndex) { } void func_80083B0C(s32 objectIndex) { - init_texture_object(objectIndex, d_course_frappe_snowland_snowman_tlut, d_course_frappe_snowland_snowman_body, 0x40U, (u16) 0x00000040); + init_texture_object(objectIndex, d_course_frappe_snowland_snowman_tlut, + d_course_frappe_snowland_snowman_body, 0x40U, (u16) 0x00000040); gObjectList[objectIndex].vertex = common_vtx_hedgehog; gObjectList[objectIndex].sizeScaling = 0.1f; gObjectList[objectIndex].textureListIndex = 0; - reset_timer_go_next_state(objectIndex); + initiate_next_state(objectIndex); set_obj_origin_offset(objectIndex, 0.0f, 0.0f, 0.0f); gObjectList[objectIndex].orientation[0] = 0; gObjectList[objectIndex].orientation[1] = 0; @@ -6895,34 +7165,34 @@ void func_80083C04(s32 objectIndex) { object = &gObjectList[objectIndex]; switch (object->state) { - case 0: - break; - case 1: - func_80083B0C(objectIndex); - break; - case 2: - set_and_run_timer_object(objectIndex, 0x00000096); - break; - case 10: - if (set_and_run_timer_object(objectIndex, 0x0000012C) != 0) { - func_800722A4(objectIndex, 2); - } - break; - case 11: - if (set_and_run_timer_object(objectIndex, 0x0000000A) != 0) { - set_object_flag_status_true(objectIndex, 0x00000010); - object->sizeScaling = 0.001f; - } - break; - case 12: - if (func_80074118(objectIndex, &object->sizeScaling, 0.001f, 0.1f, 0.0025f, 0, 0) != 0) { - reset_timer_go_next_state(objectIndex); - } - break; - case 13: - func_800726CC(objectIndex, 2); - set_object_flag_status_false(objectIndex, 0x00001000); - break; + case 0: + break; + case 1: + func_80083B0C(objectIndex); + break; + case 2: + set_and_run_timer_object(objectIndex, 0x00000096); + break; + case 10: + if (set_and_run_timer_object(objectIndex, 0x0000012C) != 0) { + func_800722A4(objectIndex, 2); + } + break; + case 11: + if (set_and_run_timer_object(objectIndex, 0x0000000A) != 0) { + set_object_flag_status_true(objectIndex, 0x00000010); + object->sizeScaling = 0.001f; + } + break; + case 12: + if (func_80074118(objectIndex, &object->sizeScaling, 0.001f, 0.1f, 0.0025f, 0, 0) != 0) { + initiate_next_state(objectIndex); + } + break; + case 13: + func_800726CC(objectIndex, 2); + set_object_flag_status_false(objectIndex, 0x00001000); + break; } if (object->state >= 2) { func_80073514(objectIndex); @@ -6940,13 +7210,17 @@ void update_snowmen(void) { for (var_s0 = 0; var_s0 < gObjectParticle2_SIZE; var_s0++) { objectIndex = gObjectParticle2[var_s0]; - if (objectIndex == DELETED_OBJECT_ID) continue; + if (objectIndex == DELETED_OBJECT_ID) + continue; - if (gObjectList[objectIndex].state == 0) continue; + if (gObjectList[objectIndex].state == 0) + continue; func_8008379C(objectIndex); - if (gObjectList[objectIndex].state != 0) continue; + if (gObjectList[objectIndex].state != 0) + continue; delete_object_wrapper(&gObjectParticle2[var_s0]); - if (var_s0) {} // ?? + if (var_s0) { + } // ?? } for (var_s0 = 0; var_s0 < NUM_SNOWMEN; var_s0++) { @@ -6956,7 +7230,8 @@ void update_snowmen(void) { func_80083C04(var_s4); if (is_obj_index_flag_status_inactive(var_s4, 0x00001000) != 0) { object = &gObjectList[var_s4]; - if ((func_8008A8B0(object->unk_0D5 - 1, object->unk_0D5 + 1) != 0) && (func_80089B50(var_s4) != 0)) { + if ((func_8008A8B0(object->unk_0D5 - 1, object->unk_0D5 + 1) != 0) + && (func_80089B50(var_s4) != 0)) { set_object_flag_status_true(var_s4, 0x00001000); set_object_flag_status_false(var_s4, 0x00000010); func_800726CC(var_s4, 0x0000000A); @@ -6972,18 +7247,21 @@ void update_snowmen(void) { void func_80083F18(s32 objectIndex) { switch (gObjectList[objectIndex].state) { - case 0: - break; - case 1: - if (func_80087E08(objectIndex, gObjectList[objectIndex].velocity[1], 0.12f, gObjectList[objectIndex].unk_034, gObjectList[objectIndex].direction_angle[1], 0x00000064) != 0) { - reset_timer_go_next_state(objectIndex); - } - object_calculate_new_pos_offset(objectIndex); - break; - case 2: - func_80086F60(objectIndex); - func_80072428(objectIndex); - break; + case 0: + break; + case 1: + if (func_80087E08(objectIndex, gObjectList[objectIndex].velocity[1], 0.12f, + gObjectList[objectIndex].unk_034, + gObjectList[objectIndex].direction_angle[1], 0x00000064) + != 0) { + initiate_next_state(objectIndex); + } + object_calculate_new_pos_offset(objectIndex); + break; + case 2: + func_80086F60(objectIndex); + func_80072428(objectIndex); + break; } } @@ -6996,10 +7274,10 @@ void func_80083FD0(s32 objectIndex, s32 arg1, s32 playerId) { object->unk_084[7] = playerId; init_object(objectIndex, 0); object->activeTLUT = d_course_sherbet_land_ice; - object->tlutList = d_course_sherbet_land_ice; + object->tlutList = d_course_sherbet_land_ice; object->sizeScaling = ((f32) random_int(0x01F4U) * 0.0002) + 0.04; - object->velocity[1] = ((f32) random_int(0x0032U) * 0.05) + 1.0; - object->unk_034 = ((f32) random_int(0x000AU) * 0.1) + 1.0; + object->velocity[1] = ((f32) random_int(0x0032U) * 0.05) + 1.0; + object->unk_034 = ((f32) random_int(0x000AU) * 0.1) + 1.0; object->direction_angle[1] = D_801657A2 * arg1; object->origin_pos[0] = (sp20->pos[0] + random_int(0x0014U)) - 10.0f; object->origin_pos[1] = (sp20->pos[1] - 10.0) + random_int(0x000AU); @@ -7011,8 +7289,10 @@ void func_8008421C(UNUSED s32 arg0, s32 playerId) { s32 var_s0; for (var_s0 = 0; var_s0 < D_8018D3C0; var_s0++) { - objectIndex = add_unused_obj_index(gObjectParticle2, &gNextFreeObjectParticle2, gObjectParticle2_SIZE); - if (objectIndex == NULL_OBJECT_ID) break; + objectIndex = + add_unused_obj_index(gObjectParticle2, &gNextFreeObjectParticle2, gObjectParticle2_SIZE); + if (objectIndex == NULL_OBJECT_ID) + break; func_80083FD0(objectIndex, var_s0, playerId); } } @@ -7064,21 +7344,21 @@ void func_80084430(s32 objectIndex, UNUSED s32 arg1) { object->spline = D_800E672C[0]; set_object_flag_status_true(objectIndex, 0x04000800); object->type = func_80004EAC(d_course_sherbet_land_unk_data11, 0); - reset_timer_go_next_state(objectIndex); + initiate_next_state(objectIndex); } void func_8008453C(s32 objectIndex, s32 arg1) { - switch (gObjectList[objectIndex].state) { /* irregular */ - case 0: - break; - case 1: - if (gPlayerCountSelection1 == 1) { - func_80084430(objectIndex, arg1); - } - break; - case 2: - func_80072E54(objectIndex, 0, gObjectList[objectIndex].type, 1, 0, -1); - break; + switch (gObjectList[objectIndex].state) { /* irregular */ + case 0: + break; + case 1: + if (gPlayerCountSelection1 == 1) { + func_80084430(objectIndex, arg1); + } + break; + case 2: + func_80072E54(objectIndex, 0, gObjectList[objectIndex].type, 1, 0, -1); + break; } } @@ -7117,62 +7397,62 @@ void func_800845C8(s32 objectIndex, s32 arg1) { object->unk_0DD = 2; func_800722A4(objectIndex, 8); } else if ((arg1 > 8) && (arg1 < 15)) { - switch (arg1) { /* irregular */ - case 9: - if (gGamestate != 9) { - set_obj_origin_pos(objectIndex, xOrientation * 146.0, 0.0f, -380.0f); - } else { - set_obj_origin_pos(objectIndex, xOrientation * 380.0, 0.0f, -535.0f); - object->sizeScaling = 0.15f; - } - object->unk_0C6 = 0x9000; - if (gIsMirrorMode != 0) { - object->unk_0C6 -= 0x4000; - } - object->unk_0DD = 3; - break; - case 10: - set_obj_origin_pos(objectIndex, xOrientation * 380.0, 0.0f, -766.0f); - object->unk_0C6 = 0x5000; - if (gIsMirrorMode != 0) { - object->unk_0C6 += 0x8000; - } - object->unk_0DD = 4; - break; - case 11: - set_obj_origin_pos(objectIndex, xOrientation * -2300.0, 0.0f, -210.0f); - object->unk_0C6 = 0xC000; - object->unk_0DD = 6; - if (gIsMirrorMode != 0) { - object->unk_0C6 += 0x8000; - } - break; - case 12: - set_obj_origin_pos(objectIndex, xOrientation * -2500.0, 0.0f, -250.0f); - object->unk_0C6 = 0x4000; - object->unk_0DD = 6; - if (gIsMirrorMode != 0) { - object->unk_0C6 += 0x8000; - } - break; - case 13: - set_obj_origin_pos(objectIndex, xOrientation * -535.0, 0.0f, 875.0f); - object->unk_0C6 = 0x8000; - object->unk_0DD = 6; - if (gIsMirrorMode != 0) { - object->unk_0C6 -= 0x4000; - } - break; - case 14: - set_obj_origin_pos(objectIndex, xOrientation * -250.0, 0.0f, 953.0f); - object->unk_0C6 = 0x9000; - object->unk_0DD = 6; - if (gIsMirrorMode != 0) { - object->unk_0C6 -= 0x4000; - } - break; - default: - break; + switch (arg1) { /* irregular */ + case 9: + if (gGamestate != 9) { + set_obj_origin_pos(objectIndex, xOrientation * 146.0, 0.0f, -380.0f); + } else { + set_obj_origin_pos(objectIndex, xOrientation * 380.0, 0.0f, -535.0f); + object->sizeScaling = 0.15f; + } + object->unk_0C6 = 0x9000; + if (gIsMirrorMode != 0) { + object->unk_0C6 -= 0x4000; + } + object->unk_0DD = 3; + break; + case 10: + set_obj_origin_pos(objectIndex, xOrientation * 380.0, 0.0f, -766.0f); + object->unk_0C6 = 0x5000; + if (gIsMirrorMode != 0) { + object->unk_0C6 += 0x8000; + } + object->unk_0DD = 4; + break; + case 11: + set_obj_origin_pos(objectIndex, xOrientation * -2300.0, 0.0f, -210.0f); + object->unk_0C6 = 0xC000; + object->unk_0DD = 6; + if (gIsMirrorMode != 0) { + object->unk_0C6 += 0x8000; + } + break; + case 12: + set_obj_origin_pos(objectIndex, xOrientation * -2500.0, 0.0f, -250.0f); + object->unk_0C6 = 0x4000; + object->unk_0DD = 6; + if (gIsMirrorMode != 0) { + object->unk_0C6 += 0x8000; + } + break; + case 13: + set_obj_origin_pos(objectIndex, xOrientation * -535.0, 0.0f, 875.0f); + object->unk_0C6 = 0x8000; + object->unk_0DD = 6; + if (gIsMirrorMode != 0) { + object->unk_0C6 -= 0x4000; + } + break; + case 14: + set_obj_origin_pos(objectIndex, xOrientation * -250.0, 0.0f, 953.0f); + object->unk_0C6 = 0x9000; + object->unk_0DD = 6; + if (gIsMirrorMode != 0) { + object->unk_0C6 -= 0x4000; + } + break; + default: + break; } set_obj_direction_angle(objectIndex, 0U, object->unk_0C6 + 0x8000, 0U); object->surfaceHeight = 5.0f; @@ -7182,7 +7462,7 @@ void func_800845C8(s32 objectIndex, s32 arg1) { func_80086EF0(objectIndex); object->unk_034 = 0.0f; object->type = func_80004EAC(d_course_sherbet_land_unk_data11, 0); - reset_timer_go_next_state(objectIndex); + initiate_next_state(objectIndex); } void func_80084B7C(s32 objectIndex, s32 arg1) { @@ -7190,29 +7470,29 @@ void func_80084B7C(s32 objectIndex, s32 arg1) { object = &gObjectList[objectIndex]; switch (object->state) { - case 0: - break; - case 1: - func_800845C8(objectIndex, arg1); - break; - case 2: - func_80072E54(objectIndex, 0, (s32) object->type, (s32) object->unk_09C, 0, -1); - if (func_80072354(objectIndex, 0x00000020) != 0) { - if (object->unk_084[6] == 0) { - object->unk_084[6] = random_int(0x005AU) + 0x5A; - func_800722A4(objectIndex, 0x00000080); - } else { - object->unk_084[6]--; + case 0: + break; + case 1: + func_800845C8(objectIndex, arg1); + break; + case 2: + func_80072E54(objectIndex, 0, (s32) object->type, (s32) object->unk_09C, 0, -1); + if (func_80072354(objectIndex, 0x00000020) != 0) { + if (object->unk_084[6] == 0) { + object->unk_084[6] = random_int(0x005AU) + 0x5A; + func_800722A4(objectIndex, 0x00000080); + } else { + object->unk_084[6]--; + } } - } - break; - case 3: - func_80072E54(objectIndex, 0, object->type, 1, 0, 0); - break; - case 4: - func_800722CC(objectIndex, 2); - reset_timer_go_next_state(objectIndex); - break; + break; + case 3: + func_80072E54(objectIndex, 0, object->type, 1, 0, 0); + break; + case 4: + func_800722CC(objectIndex, 2); + initiate_next_state(objectIndex); + break; } if (func_80072320(objectIndex, 0x00000020) != 0) { if (object->unk_084[6] == 0) { @@ -7236,86 +7516,89 @@ void func_80084D2C(s32 objectIndex, s32 arg1) { f32 sp24; switch (gObjectList[objectIndex].unk_0AE) { - case 0: - break; - case 1: - gObjectList[objectIndex].direction_angle[1] = func_800417B4(gObjectList[objectIndex].direction_angle[1], gObjectList[objectIndex].unk_0C6); - if (gObjectList[objectIndex].direction_angle[1] == gObjectList[objectIndex].unk_0C6) { - gObjectList[objectIndex].unk_09C = 4; - gObjectList[objectIndex].unk_034 = 0.4f; - func_80086FD4(objectIndex); - } - break; - case 2: - f32_step_towards(&gObjectList[objectIndex].unk_034, 0.8f, 0.02f); - if (func_80087060(objectIndex, 0x0000000F) != 0) { - func_800722A4(objectIndex, 1); - func_800722A4(objectIndex, 2); - gObjectList[objectIndex].unk_09C = 1; - gObjectList[objectIndex].unk_0D8 = 1; - gObjectList[objectIndex].textureListIndex = 0; - gObjectList[objectIndex].type = func_80004EAC(d_course_sherbet_land_unk_data11, gObjectList[objectIndex].unk_0D8); - func_800726CC(objectIndex, 3); - func_80086FD4(objectIndex); - if (func_80072354(objectIndex, 0x00000020) != 0) { - func_800722A4(objectIndex, 0x00000080); + case 0: + break; + case 1: + gObjectList[objectIndex].direction_angle[1] = func_800417B4( + gObjectList[objectIndex].direction_angle[1], gObjectList[objectIndex].unk_0C6); + if (gObjectList[objectIndex].direction_angle[1] == gObjectList[objectIndex].unk_0C6) { + gObjectList[objectIndex].unk_09C = 4; + gObjectList[objectIndex].unk_034 = 0.4f; + func_80086FD4(objectIndex); } - } - break; - case 3: - switch (arg1) { /* switch 1; irregular */ - case 0: /* switch 1 */ - sp24 = 1.0f; break; - case 1: /* switch 1 */ - sp24 = 1.5f; + case 2: + f32_step_towards(&gObjectList[objectIndex].unk_034, 0.8f, 0.02f); + if (func_80087060(objectIndex, 0x0000000F) != 0) { + func_800722A4(objectIndex, 1); + func_800722A4(objectIndex, 2); + gObjectList[objectIndex].unk_09C = 1; + gObjectList[objectIndex].unk_0D8 = 1; + gObjectList[objectIndex].textureListIndex = 0; + gObjectList[objectIndex].type = + func_80004EAC(d_course_sherbet_land_unk_data11, gObjectList[objectIndex].unk_0D8); + func_800726CC(objectIndex, 3); + func_80086FD4(objectIndex); + if (func_80072354(objectIndex, 0x00000020) != 0) { + func_800722A4(objectIndex, 0x00000080); + } + } break; - case 2: /* switch 1 */ - sp24 = 2.0f; + case 3: + switch (arg1) { /* switch 1; irregular */ + case 0: /* switch 1 */ + sp24 = 1.0f; + break; + case 1: /* switch 1 */ + sp24 = 1.5f; + break; + case 2: /* switch 1 */ + sp24 = 2.0f; + break; + case 3: /* switch 1 */ + sp24 = 2.5f; + break; + } + f32_step_towards(&gObjectList[objectIndex].unk_034, sp24, 0.15f); + if ((func_80072354(objectIndex, 2) != 0) && (sp24 == gObjectList[objectIndex].unk_034)) { + func_80086FD4(objectIndex); + } break; - case 3: /* switch 1 */ - sp24 = 2.5f; + case 4: + if (func_80087060(objectIndex, 0x0000001E) != 0) { + func_800722CC(objectIndex, 1); + func_80086FD4(objectIndex); + } + break; + case 5: + f32_step_towards(&gObjectList[objectIndex].unk_034, 0.4f, 0.2f); + if (func_80087060(objectIndex, 0x0000000A) != 0) { + func_800722A4(objectIndex, 2); + gObjectList[objectIndex].unk_0D8 = 2; + gObjectList[objectIndex].textureListIndex = 0; + gObjectList[objectIndex].type = + func_80004EAC(d_course_sherbet_land_unk_data11, gObjectList[objectIndex].unk_0D8); + func_800726CC(objectIndex, 3); + func_80086FD4(objectIndex); + } + break; + case 6: + if (func_80072354(objectIndex, 2) != 0) { + gObjectList[objectIndex].unk_0D8 = 0; + gObjectList[objectIndex].textureListIndex = 0; + gObjectList[objectIndex].type = + func_80004EAC(d_course_sherbet_land_unk_data11, gObjectList[objectIndex].unk_0D8); + gObjectList[objectIndex].unk_0C6 += 0x8000; + func_800726CC(objectIndex, 2); + func_8008701C(objectIndex, 1); + } break; - } - f32_step_towards(&gObjectList[objectIndex].unk_034, sp24, 0.15f); - if ((func_80072354(objectIndex, 2) != 0) && (sp24 == gObjectList[objectIndex].unk_034)) { - func_80086FD4(objectIndex); - } - break; - case 4: - if (func_80087060(objectIndex, 0x0000001E) != 0) { - func_800722CC(objectIndex, 1); - func_80086FD4(objectIndex); - } - break; - case 5: - f32_step_towards(&gObjectList[objectIndex].unk_034, 0.4f, 0.2f); - if (func_80087060(objectIndex, 0x0000000A) != 0) { - func_800722A4(objectIndex, 2); - gObjectList[objectIndex].unk_0D8 = 2; - gObjectList[objectIndex].textureListIndex = 0; - gObjectList[objectIndex].type = func_80004EAC(d_course_sherbet_land_unk_data11, gObjectList[objectIndex].unk_0D8); - func_800726CC(objectIndex, 3); - func_80086FD4(objectIndex); - } - break; - case 6: - if (func_80072354(objectIndex, 2) != 0) { - gObjectList[objectIndex].unk_0D8 = 0; - gObjectList[objectIndex].textureListIndex = 0; - gObjectList[objectIndex].type = func_80004EAC(d_course_sherbet_land_unk_data11, gObjectList[objectIndex].unk_0D8); - gObjectList[objectIndex].unk_0C6 += 0x8000; - func_800726CC(objectIndex, 2); - func_8008701C(objectIndex, 1); - } - break; } func_8008781C(objectIndex); object_calculate_new_pos_offset(objectIndex); } void func_80085024(void) { - } void func_8008502C(s32 objectIndex, UNUSED s32 arg1) { @@ -7335,24 +7618,24 @@ void func_800850B0(s32 objectIndex, s32 arg1) { object = &gObjectList[objectIndex]; switch (object->unk_0DD) { - case 1: - func_80085080(objectIndex); - break; - case 2: - func_8008502C(objectIndex, arg1); - break; - case 3: - func_80084D2C(objectIndex, 0); - break; - case 4: - func_80084D2C(objectIndex, 1); - break; - case 5: - func_80084D2C(objectIndex, 2); - break; - case 6: - func_80084D2C(objectIndex, 3); - break; + case 1: + func_80085080(objectIndex); + break; + case 2: + func_8008502C(objectIndex, arg1); + break; + case 3: + func_80084D2C(objectIndex, 0); + break; + case 4: + func_80084D2C(objectIndex, 1); + break; + case 5: + func_80084D2C(objectIndex, 2); + break; + case 6: + func_80084D2C(objectIndex, 3); + break; } if (func_80072320(objectIndex, 0x00000020) != 0) { if (func_80072320(objectIndex, 0x00000040) != 0) { @@ -7397,7 +7680,8 @@ void update_penguins(void) { } else { func_80089820(objectIndex, 1.5f, 1.25f, 0x1900A046U); } - if ((is_obj_flag_status_active(objectIndex, 0x02000000) != 0) && (func_80072354(objectIndex, 0x00000020) != 0)) { + if ((is_obj_flag_status_active(objectIndex, 0x02000000) != 0) + && (func_80072354(objectIndex, 0x00000020) != 0)) { func_800722A4(objectIndex, 0x00000060); set_object_flag_status_false(objectIndex, 0x02000000); } @@ -7419,68 +7703,68 @@ void init_hot_air_balloon(s32 objectIndex) { func_80086EF0(objectIndex); gObjectList[objectIndex].velocity[1] = -2.0f; init_actor_hot_air_balloon_item_box(0.0f, 0.0f, 0.0f); - reset_timer_go_next_state(objectIndex); + initiate_next_state(objectIndex); } void func_80085534(s32 objectIndex) { switch (gObjectList[objectIndex].unk_0AE) { - case 1: - if (gObjectList[objectIndex].offset[1] <= 18.0) { - func_80086FD4(objectIndex); - } - break; - case 2: - f32_step_towards(&gObjectList[objectIndex].velocity[1], 0.0f, 0.05f); - if (gObjectList[objectIndex].velocity[1] == 0.0) { - func_80086FD4(objectIndex); - } - break; - case 3: - func_800871AC(objectIndex, 1); - break; - case 4: - f32_step_towards(&gObjectList[objectIndex].velocity[1], 1.0f, 0.05f); - if (gObjectList[objectIndex].velocity[1] == 1.0) { - func_80086FD4(objectIndex); - } - break; - case 5: - func_800871AC(objectIndex, 0x0000005A); - break; - case 6: - f32_step_towards(&gObjectList[objectIndex].velocity[1], 0.0f, 0.05f); - if (gObjectList[objectIndex].velocity[1] == 0.0) { - func_80086FD4(objectIndex); - } - break; - case 7: - f32_step_towards(&gObjectList[objectIndex].velocity[1], -1.0f, 0.05f); - if (gObjectList[objectIndex].velocity[1] == -1.0) { - func_80086FD4(objectIndex); - } - break; - case 8: - func_800871AC(objectIndex, 0x0000005A); - break; - case 9: - f32_step_towards(&gObjectList[objectIndex].velocity[1], 0.0f, 0.05f); - if (func_80087060(objectIndex, 0x0000005A) != 0) { - func_8008701C(objectIndex, 3); - } - break; + case 1: + if (gObjectList[objectIndex].offset[1] <= 18.0) { + func_80086FD4(objectIndex); + } + break; + case 2: + f32_step_towards(&gObjectList[objectIndex].velocity[1], 0.0f, 0.05f); + if (gObjectList[objectIndex].velocity[1] == 0.0) { + func_80086FD4(objectIndex); + } + break; + case 3: + func_800871AC(objectIndex, 1); + break; + case 4: + f32_step_towards(&gObjectList[objectIndex].velocity[1], 1.0f, 0.05f); + if (gObjectList[objectIndex].velocity[1] == 1.0) { + func_80086FD4(objectIndex); + } + break; + case 5: + func_800871AC(objectIndex, 0x0000005A); + break; + case 6: + f32_step_towards(&gObjectList[objectIndex].velocity[1], 0.0f, 0.05f); + if (gObjectList[objectIndex].velocity[1] == 0.0) { + func_80086FD4(objectIndex); + } + break; + case 7: + f32_step_towards(&gObjectList[objectIndex].velocity[1], -1.0f, 0.05f); + if (gObjectList[objectIndex].velocity[1] == -1.0) { + func_80086FD4(objectIndex); + } + break; + case 8: + func_800871AC(objectIndex, 0x0000005A); + break; + case 9: + f32_step_towards(&gObjectList[objectIndex].velocity[1], 0.0f, 0.05f); + if (func_80087060(objectIndex, 0x0000005A) != 0) { + func_8008701C(objectIndex, 3); + } + break; } object_add_velocity_offset_y(objectIndex); gObjectList[objectIndex].direction_angle[1] += 0x100; } void func_80085768(s32 objectIndex) { - switch (gObjectList[objectIndex].state) { /* irregular */ - case 1: - init_hot_air_balloon(objectIndex); - break; - case 0: - case 2: - break; + switch (gObjectList[objectIndex].state) { /* irregular */ + case 1: + init_hot_air_balloon(objectIndex); + break; + case 0: + case 2: + break; } } @@ -7513,27 +7797,27 @@ void func_80085878(s32 objectIndex, s32 arg1) { set_object_flag_status_true(objectIndex, 0x04000200); object->unk_084[8] = (arg1 * 0x12C) + 0x1F4; set_obj_origin_pos(objectIndex, 0.0f, -15.0f, 0.0f); - temp_v0 = &D_80164490[(u16)object->unk_084[8]]; + temp_v0 = &D_80164490[(u16) object->unk_084[8]]; set_obj_origin_offset(objectIndex, temp_v0->posX, temp_v0->posY, temp_v0->posZ); set_obj_direction_angle(objectIndex, 0U, 0U, 0U); object->unk_034 = 4.0f; object->type = func_80004EAC(d_rainbow_road_unk3, 0); - reset_timer_go_next_state(objectIndex); + initiate_next_state(objectIndex); } void func_800859C8(s32 objectIndex, s32 arg1) { Object *object; object = &gObjectList[objectIndex]; - switch (object->state) { /* irregular */ - case 0: - break; - case 1: - func_80085878(objectIndex, arg1); - break; - case 2: - func_80072E54(objectIndex, 0, (s32) object->type, 1, 0, -1); - break; + switch (object->state) { /* irregular */ + case 0: + break; + case 1: + func_80085878(objectIndex, arg1); + break; + case 2: + func_80072E54(objectIndex, 0, (s32) object->type, 1, 0, -1); + break; } if (D_8018D40C == 0) { func_800C98B8(object->pos, object->velocity, SOUND_ARG_LOAD(0x19, 0x01, 0x80, 0x57)); @@ -7552,7 +7836,8 @@ void update_chain_chomps(void) { if (object->state != 0) { func_800859C8(objectIndex, var_s4); vec3f_copy(object->unk_01C, object->offset); - func_8000D940(object->offset, &object->unk_084[8], object->unk_034, object->surfaceHeight, 0); + func_8000D940(object->offset, &object->unk_084[8], object->unk_034, object->surfaceHeight, + 0); object->direction_angle[1] = get_angle_between_two_vectors(object->unk_01C, object->offset); object_calculate_new_pos_offset(objectIndex); func_80089CBC(objectIndex, 30.0f); @@ -7564,12 +7849,13 @@ void func_80085BB4(s32 objectIndex) { gObjectList[objectIndex].sizeScaling = 8.0f; set_obj_origin_offset(objectIndex, 0.0f, 0.0f, 0.0f); set_obj_orientation(objectIndex, 0U, 0U, 0x8000U); - reset_timer_go_next_state(objectIndex); + initiate_next_state(objectIndex); } void init_obj_neon_mushroom(s32 objectIndex) { set_obj_origin_pos(objectIndex, xOrientation * -1431.0, 827.0f, -2957.0f); - init_texture_object(objectIndex, (u8*) d_course_rainbow_road_neon_mushroom_tlut_list, d_course_rainbow_road_neon_mushroom, 0x40U, (u16) 0x00000040); + init_texture_object(objectIndex, (u8 *) d_course_rainbow_road_neon_mushroom_tlut_list, + d_course_rainbow_road_neon_mushroom, 0x40U, (u16) 0x00000040); func_80085BB4(objectIndex); } @@ -7607,68 +7893,70 @@ void func_80085CA0(s32 objectIndex) { void func_80085DB8(s32 objectIndex) { set_obj_origin_pos(objectIndex, xOrientation * 799.0, 1193.0f, -5891.0f); - init_texture_object(objectIndex, (u8*) d_course_rainbow_road_neon_mario_tlut_list, d_course_rainbow_road_neon_mario, 0x40U, (u16) 0x00000040); + init_texture_object(objectIndex, (u8 *) d_course_rainbow_road_neon_mario_tlut_list, + d_course_rainbow_road_neon_mario, 0x40U, (u16) 0x00000040); func_80085BB4(objectIndex); } void func_80085E38(s32 objectIndex) { switch (gObjectList[objectIndex].state) { - case 1: - func_80085DB8(objectIndex); - break; - case 2: - func_80072E54(objectIndex, 0, 4, 1, 0x0000000C, 1); - break; - case 3: - func_80072D3C(objectIndex, 3, 4, 0x0000000C, 1); - break; - case 4: - func_80072B48(objectIndex, 0x0000000C); - break; - case 5: - func_800726CC(objectIndex, 2); - break; - case 0: - default: - break; + case 1: + func_80085DB8(objectIndex); + break; + case 2: + func_80072E54(objectIndex, 0, 4, 1, 0x0000000C, 1); + break; + case 3: + func_80072D3C(objectIndex, 3, 4, 0x0000000C, 1); + break; + case 4: + func_80072B48(objectIndex, 0x0000000C); + break; + case 5: + func_800726CC(objectIndex, 2); + break; + case 0: + default: + break; } } void func_80085EF8(s32 objectIndex) { set_obj_origin_pos(objectIndex, xOrientation * -2013.0, 555.0f, 0.0f); - init_texture_object(objectIndex, (u8*) d_course_rainbow_road_neon_boo_tlut_list, d_course_rainbow_road_neon_boo, 0x40U, (u16) 0x00000040); + init_texture_object(objectIndex, (u8 *) d_course_rainbow_road_neon_boo_tlut_list, + d_course_rainbow_road_neon_boo, 0x40U, (u16) 0x00000040); func_80085BB4(objectIndex); } void func_80085F74(s32 objectIndex) { switch (gObjectList[objectIndex].state) { - case 1: - func_80085EF8(objectIndex); - break; - case 2: - func_80072E54(objectIndex, 0, 4, 1, 5, 1); - break; - case 3: - set_and_run_timer_object(objectIndex, 0x0000001E); - break; - case 4: - func_80072C00(objectIndex, 4, 0, 7); - break; - case 5: - set_and_run_timer_object(objectIndex, 0x0000001E); - break; - case 6: - func_80072F88(objectIndex, 3, 0, 1, 5, 1); - break; - case 7: - func_80072B48(objectIndex, 0x0000000F); - break; - case 8: - func_800726CC(objectIndex, 2); - break; - case 0: - default: - break; + case 1: + func_80085EF8(objectIndex); + break; + case 2: + func_80072E54(objectIndex, 0, 4, 1, 5, 1); + break; + case 3: + set_and_run_timer_object(objectIndex, 0x0000001E); + break; + case 4: + func_80072C00(objectIndex, 4, 0, 7); + break; + case 5: + set_and_run_timer_object(objectIndex, 0x0000001E); + break; + case 6: + func_80072F88(objectIndex, 3, 0, 1, 5, 1); + break; + case 7: + func_80072B48(objectIndex, 0x0000000F); + break; + case 8: + func_800726CC(objectIndex, 2); + break; + case 0: + default: + break; } } @@ -7677,11 +7965,13 @@ void func_80085F74(s32 objectIndex) { * arg1 is pushed onto the stack prior to set_obj_origin_pos, which is correct. * But then it get popped back into v0 when its supposed to be popped into t0. * I really, really don't get why that's happening and the permuter hasn't found anything -**/ + **/ void func_80086074(s32 objectIndex, s32 arg1) { - set_obj_origin_pos(objectIndex, D_800E6734[arg1][0] * xOrientation, D_800E6734[arg1][1], D_800E6734[arg1][2]); - init_texture_object(objectIndex, d_course_rainbow_road_static_tluts[arg1], d_course_rainbow_road_static_textures[arg1], 64, 64); + set_obj_origin_pos(objectIndex, D_800E6734[arg1][0] * xOrientation, D_800E6734[arg1][1], + D_800E6734[arg1][2]); + init_texture_object(objectIndex, d_course_rainbow_road_static_tluts[arg1], + d_course_rainbow_road_static_textures[arg1], 64, 64); func_80085BB4(objectIndex); } #else @@ -7690,16 +7980,16 @@ GLOBAL_ASM("asm/non_matchings/update_objects/func_80086074.s") void func_80086110(s32 objectIndex, s32 arg1) { switch (gObjectList[objectIndex].state) { - case 1: - func_80086074(objectIndex, arg1); - break; - case 0: - break; + case 1: + func_80086074(objectIndex, arg1); + break; + case 0: + break; } } void update_object_neon(s32 objectIndex, s32 id) { - switch (id) { /* irregular */ + switch (id) { /* irregular */ case 0: func_80085CA0(objectIndex); break; @@ -7732,73 +8022,73 @@ void update_neon(void) { } void func_8008629C(s32 objectIndex, s32 arg1) { - switch (arg1) { /* irregular */ - case 0: - gObjectList[objectIndex].model = podium_dl3; - gObjectList[objectIndex].unk_04C = 0x00000038; - break; - case 1: - gObjectList[objectIndex].model = podium2_dl3; - gObjectList[objectIndex].unk_04C = 0x0000002B; - break; - case 2: - gObjectList[objectIndex].model = podium3_dl3; - gObjectList[objectIndex].unk_04C = 0x0000001E; - break; - default: - break; + switch (arg1) { /* irregular */ + case 0: + gObjectList[objectIndex].model = podium_dl3; + gObjectList[objectIndex].unk_04C = 0x00000038; + break; + case 1: + gObjectList[objectIndex].model = podium2_dl3; + gObjectList[objectIndex].unk_04C = 0x0000002B; + break; + case 2: + gObjectList[objectIndex].model = podium3_dl3; + gObjectList[objectIndex].unk_04C = 0x0000001E; + break; + default: + break; } gObjectList[objectIndex].sizeScaling = 1.0f; set_obj_origin_pos(objectIndex, D_800E634C[0][0] - 1.5, D_800E634C[0][1], D_800E634C[0][2]); set_obj_origin_offset(objectIndex, 0.0f, -10.0f, 0.0f); set_obj_direction_angle(objectIndex, 0U, 0xF8E4U, 0U); gObjectList[objectIndex].unk_048 = 0; - reset_timer_go_next_state(objectIndex); + initiate_next_state(objectIndex); } void func_80086424(s32 objectIndex) { switch (gObjectList[objectIndex].unk_0AE) { - case 0: - break; - case 1: - gObjectList[objectIndex].velocity[1] = 0.75f; - func_80086FD4(objectIndex); - break; - case 2: - if (gObjectList[objectIndex].offset[1] >= -2.0) { - gObjectList[objectIndex].velocity[1] -= 0.1; - } - object_add_velocity_offset_y(objectIndex); - if (gObjectList[objectIndex].offset[1] >= 0.0) { - gObjectList[objectIndex].offset[1] = 0.0f; - gObjectList[objectIndex].velocity[1] = 0.0f; - func_80086F60(objectIndex); - } - break; + case 0: + break; + case 1: + gObjectList[objectIndex].velocity[1] = 0.75f; + func_80086FD4(objectIndex); + break; + case 2: + if (gObjectList[objectIndex].offset[1] >= -2.0) { + gObjectList[objectIndex].velocity[1] -= 0.1; + } + object_add_velocity_offset_y(objectIndex); + if (gObjectList[objectIndex].offset[1] >= 0.0) { + gObjectList[objectIndex].offset[1] = 0.0f; + gObjectList[objectIndex].velocity[1] = 0.0f; + func_80086F60(objectIndex); + } + break; } object_calculate_new_pos_offset(objectIndex); } void func_80086528(s32 objectIndex, s32 arg1) { - switch (gObjectList[objectIndex].state) { /* irregular */ - case 1: - func_8008629C(objectIndex, arg1); - break; - case 2: - if (set_and_run_timer_object(objectIndex, gObjectList[objectIndex].unk_04C) != 0) { - func_80091440(arg1); - func_80086E70(objectIndex); - reset_timer_go_next_state(objectIndex); - } - break; - case 0: - break; - case 3: - if (gObjectList[objectIndex].unk_0AE == 0) { - gObjectList[objectIndex].unk_048 = 1; - reset_timer_go_next_state(objectIndex); - } - break; + switch (gObjectList[objectIndex].state) { /* irregular */ + case 1: + func_8008629C(objectIndex, arg1); + break; + case 2: + if (set_and_run_timer_object(objectIndex, gObjectList[objectIndex].unk_04C) != 0) { + func_80091440(arg1); + func_80086E70(objectIndex); + initiate_next_state(objectIndex); + } + break; + case 0: + break; + case 3: + if (gObjectList[objectIndex].unk_0AE == 0) { + gObjectList[objectIndex].unk_048 = 1; + initiate_next_state(objectIndex); + } + break; } } @@ -7808,15 +8098,15 @@ void func_80086604(void) { if ((D_8016347C != 0) && (D_802874D8.unk1D < 3)) { if (D_801658C6 == 0) { - for(var_s1 = 0; var_s1 < 3; var_s1++) { - objectIndex = indexObjectList1[var_s1]; + for (var_s1 = 0; var_s1 < 3; var_s1++) { + objectIndex = indexObjectList1[var_s1]; init_object(objectIndex, 0); } D_801658C6 = 1; } } - for(var_s1 = 0; var_s1 != 3; var_s1++) { - objectIndex = indexObjectList1[var_s1]; + for (var_s1 = 0; var_s1 != 3; var_s1++) { + objectIndex = indexObjectList1[var_s1]; if (gObjectList[objectIndex].state != 0) { func_80086528(objectIndex, var_s1); func_80086424(objectIndex); @@ -7826,40 +8116,42 @@ void func_80086604(void) { void func_80086700(s32 objectIndex) { if (gCCSelection < CC_150) { - switch (D_802874D8.unk1D) { /* switch 1; irregular */ - case 0: /* switch 1 */ - gObjectList[objectIndex].model = gold_trophy_dl10; - break; - case 1: /* switch 1 */ - gObjectList[objectIndex].model = gold_trophy_dl12; - break; - case 2: /* switch 1 */ - gObjectList[objectIndex].model = gold_trophy_dl14; - break; - default: /* switch 1 */ - break; + switch (D_802874D8.unk1D) { /* switch 1; irregular */ + case 0: /* switch 1 */ + gObjectList[objectIndex].model = gold_trophy_dl10; + break; + case 1: /* switch 1 */ + gObjectList[objectIndex].model = gold_trophy_dl12; + break; + case 2: /* switch 1 */ + gObjectList[objectIndex].model = gold_trophy_dl14; + break; + default: /* switch 1 */ + break; } } else { - switch (D_802874D8.unk1D) { /* irregular */ - case 0: - gObjectList[objectIndex].model = gold_trophy_dl11; - break; - case 1: - gObjectList[objectIndex].model = gold_trophy_dl13; - break; - case 2: - gObjectList[objectIndex].model = gold_trophy_dl15; - break; - default: - break; + switch (D_802874D8.unk1D) { /* irregular */ + case 0: + gObjectList[objectIndex].model = gold_trophy_dl11; + break; + case 1: + gObjectList[objectIndex].model = gold_trophy_dl13; + break; + case 2: + gObjectList[objectIndex].model = gold_trophy_dl15; + break; + default: + break; } } gObjectList[objectIndex].sizeScaling = 0.005f; - set_obj_origin_pos(objectIndex, gObjectList[indexObjectList2[0]].pos[0], gObjectList[indexObjectList2[0]].pos[1] + 16.0, gObjectList[indexObjectList2[0]].pos[2]); + set_obj_origin_pos(objectIndex, gObjectList[indexObjectList2[0]].pos[0], + gObjectList[indexObjectList2[0]].pos[1] + 16.0, + gObjectList[indexObjectList2[0]].pos[2]); set_obj_origin_offset(objectIndex, 0.0f, 0.0f, 0.0f); set_obj_direction_angle(objectIndex, 0U, 0U, 0U); gObjectList[objectIndex].unk_084[1] = 0x0200; - reset_timer_go_next_state(objectIndex); + initiate_next_state(objectIndex); func_80086E70(objectIndex); } @@ -7868,58 +8160,58 @@ void func_80086940(s32 objectIndex) { object = &gObjectList[objectIndex]; switch (object->unk_0AE) { - case 0: - break; - case 1: - func_80086FD4(objectIndex); - break; - case 2: - f32_step_towards(&object->sizeScaling, 0.025f, 0.001f); - func_80087C48(objectIndex, 6.0f, 0.1f, 0x000000C8); - if ((f64) object->velocity[1] <= 0.0) { - func_8008701C(objectIndex, 3); - } - break; - case 3: - func_800871AC(objectIndex, 0x00000064); - break; - case 4: - D_801658D6 = 1; - object->velocity[1] = -0.4f; - func_80086FD4(objectIndex); - object->origin_pos[1] = 90.0f; - object->offset[1] = 60.0f; - switch (D_802874D8.unk1D) { /* switch 1; irregular */ - case 1: /* switch 1 */ - object->origin_pos[0] -= 3.0; - object->origin_pos[2] += 15.0; + case 0: break; - case 2: /* switch 1 */ - object->origin_pos[0] -= 2.0; - object->origin_pos[2] -= 15.0; - break; - } - break; - case 5: - if ((f64) object->offset[1] <= 8.0) { - f32_step_towards(&object->velocity[1], -0.1f, -0.01f); - } - object_add_velocity_offset_y(objectIndex); - if ((f64) object->offset[1] <= 0.0) { + case 1: func_80086FD4(objectIndex); - } - break; - case 6: - if (func_800871AC(objectIndex, 0x00000041) != 0) { - D_801658F4 = 1; - } - break; - case 7: - if (func_800871AC(objectIndex, 0x00000064) != 0) { - func_8009265C(); - func_80086F60(objectIndex); - } - break; + break; + case 2: + f32_step_towards(&object->sizeScaling, 0.025f, 0.001f); + func_80087C48(objectIndex, 6.0f, 0.1f, 0x000000C8); + if ((f64) object->velocity[1] <= 0.0) { + func_8008701C(objectIndex, 3); + } + break; + case 3: + func_800871AC(objectIndex, 0x00000064); + break; + case 4: + D_801658D6 = 1; + object->velocity[1] = -0.4f; + func_80086FD4(objectIndex); + object->origin_pos[1] = 90.0f; + object->offset[1] = 60.0f; + switch (D_802874D8.unk1D) { /* switch 1; irregular */ + case 1: /* switch 1 */ + object->origin_pos[0] -= 3.0; + object->origin_pos[2] += 15.0; + break; + case 2: /* switch 1 */ + object->origin_pos[0] -= 2.0; + object->origin_pos[2] -= 15.0; + break; + } + break; + case 5: + if ((f64) object->offset[1] <= 8.0) { + f32_step_towards(&object->velocity[1], -0.1f, -0.01f); + } + object_add_velocity_offset_y(objectIndex); + if ((f64) object->offset[1] <= 0.0) { + func_80086FD4(objectIndex); + } + break; + case 6: + if (func_800871AC(objectIndex, 0x00000041) != 0) { + D_801658F4 = 1; + } + break; + case 7: + if (func_800871AC(objectIndex, 0x00000064) != 0) { + func_8009265C(); + func_80086F60(objectIndex); + } + break; } if (D_801658D6 != 0) { object->direction_angle[0] += 0x400; @@ -7933,13 +8225,13 @@ void func_80086940(s32 objectIndex) { } void func_80086C14(s32 objectIndex) { - switch (gObjectList[objectIndex].state) { /* irregular */ - case 1: - func_80086700(objectIndex); - break; - case 0: - case 2: - break; + switch (gObjectList[objectIndex].state) { /* irregular */ + case 1: + func_80086700(objectIndex); + break; + case 0: + case 2: + break; } } diff --git a/src/update_objects.h b/src/update_objects.h index bd56c6ba1..a4b0af44f 100644 --- a/src/update_objects.h +++ b/src/update_objects.h @@ -9,109 +9,109 @@ /** @cond */ void func_80077D5C(s32); -s32 find_unused_obj_index(s32*); -void delete_object(s32*); -s32 func_80071FBC(void); -s32 add_unused_obj_index(s32*, s32*, s32); -void delete_object_wrapper(s32*); -void func_80072120(s32*, s32); +s32 find_unused_obj_index(s32 *); +void delete_object(s32 *); +s32 func_80071FBC(void); +s32 add_unused_obj_index(s32 *, s32 *, s32); +void delete_object_wrapper(s32 *); +void func_80072120(s32 *, s32); void func_80072180(void); void set_object_flag_status_true(s32, s32); void set_object_flag_status_false(s32, s32); void func_80072214(s32, s32); -s32 is_obj_flag_status_active(s32, s32); -s32 is_obj_index_flag_status_inactive(s32, s32); +s32 is_obj_flag_status_active(s32, s32); +s32 is_obj_index_flag_status_inactive(s32, s32); void func_800722A4(s32, s32); void func_800722CC(s32, s32); void func_800722F8(s32, s32); -s32 func_80072320(s32, s32); -s32 func_80072354(s32, s32); +s32 func_80072320(s32, s32); +s32 func_80072354(s32, s32); void set_object_timer_running(s32, s32); void init_object(s32, s32); void func_80072408(s32); void func_80072428(s32); -void reset_timer_go_next_state(s32); +void initiate_next_state(s32); void func_800724DC(s32); void func_800724F8(s32, s32); -s16 func_80072530(s32); +s16 func_80072530(s32); void func_80072568(s32, s32); void func_800725E8(s32, s32, s32); -s16 func_80072530(s32); +s16 func_80072530(s32); void func_8007266C(s32); void func_800726CC(s32, s32); void func_8007271C(s32, s32); void func_8007274C(s32); -s32 set_and_run_timer_object(s32, s32); -s32 func_8007281C(s32, s32); -s32 func_800728B0(s32, s32, s32); +s32 set_and_run_timer_object(s32, s32); +s32 func_8007281C(s32, s32); +s32 func_800728B0(s32, s32, s32); void func_80072950(s32, s32, s32, s32); void func_80072974(s32, s32, s32, s32); void func_80072998(s32); void func_800729B4(s32, s32); void set_type_object(s32, s32); void func_80072A78(s32, s32); -s32 func_80072AAC(s32, s32, s32); -s32 func_80072B48(s32, s32); +s32 func_80072AAC(s32, s32, s32); +s32 func_80072B48(s32, s32); void func_80072C00(s32, s32, s32, s32); void func_80072D3C(s32, s32, s32, s32, s32); -s32 func_80072E54(s32, s32, s32, s32, s32, s32); -s32 func_80072F88(s32, s32, s32, s32, s32, s32); -s32 func_800730BC(s32, s32, s32, s32, s32, s32); -s32 func_8007326C(s32, s32, s32, s32, s32, s32); -void func_80073404(s32, u8, u8, Vtx*); -void init_texture_object(s32, u8*, u8*, u8, u16); -void func_8007348C(s32, u8*, u8, u8, Vtx *); +s32 func_80072E54(s32, s32, s32, s32, s32, s32); +s32 func_80072F88(s32, s32, s32, s32, s32, s32); +s32 func_800730BC(s32, s32, s32, s32, s32, s32); +s32 func_8007326C(s32, s32, s32, s32, s32, s32); +void func_80073404(s32, u8, u8, Vtx *); +void init_texture_object(s32, u8 *, u8 *, u8, u16); +void func_8007348C(s32, u8 *, u8, u8, Vtx *); void func_800734D4(void); void update_neon_texture(s32); void func_80073514(s32); void func_80073568(void); -void func_800735BC(s32, Gfx*, f32); +void func_800735BC(s32, Gfx *, f32); void func_80073600(s32); void func_80073654(s32); void func_8007369C(s32, s32); void func_800736E0(s32); void func_80073720(s32); -s32 func_8007375C(s32, s32); +s32 func_8007375C(s32, s32); void func_80073800(s32, s32); void func_8007381C(s32); void func_80073844(s32); void func_80073884(s32); -s32 func_800738A8(s32, s16*, s32, s32, s32, s32, s32); -void func_80073998(s32, s16*, s32, s32, s32, s32, s32); -void func_800739CC(s32, s16*, s32, s32, s32, s32, s32); -s32 func_80073A10(s32, s16*, s32, s32, s32, s32, s32); -s32 func_80073B00(s32, s16*, s32, s32, s32, s32, s32); -s32 func_80073B34(s32, s16*, s32, s32, s32, s32, s32); -s32 func_80073B78(s32, s32, s16*, s32, s32, s32, s32, s32); -bool func_80073CB0(s32, s16*, s32, s32, s32, s32, s32); -bool func_80073D0C(s32, s16*, s32, s32, s32, s32, s32); -void func_80073D68(s32, s16*, s16, s32); -void func_80073DC0(s32, s16*, s16, s32); -s32 func_80073E18(s32, u16*, u16, s32); -s32 func_80073ED4(s32, u16*, u16, s32); +s32 func_800738A8(s32, s16 *, s32, s32, s32, s32, s32); +void func_80073998(s32, s16 *, s32, s32, s32, s32, s32); +void func_800739CC(s32, s16 *, s32, s32, s32, s32, s32); +s32 func_80073A10(s32, s16 *, s32, s32, s32, s32, s32); +s32 func_80073B00(s32, s16 *, s32, s32, s32, s32, s32); +s32 func_80073B34(s32, s16 *, s32, s32, s32, s32, s32); +s32 func_80073B78(s32, s32, s16 *, s32, s32, s32, s32, s32); +bool func_80073CB0(s32, s16 *, s32, s32, s32, s32, s32); +bool func_80073D0C(s32, s16 *, s32, s32, s32, s32, s32); +void func_80073D68(s32, s16 *, s16, s32); +void func_80073DC0(s32, s16 *, s16, s32); +s32 func_80073E18(s32, u16 *, u16, s32); +s32 func_80073ED4(s32, u16 *, u16, s32); void func_80073F90(s32, s32); void func_80073FAC(s32); void func_80073FD4(s32); void func_80074014(void); -s32 func_8007401C(s32, f32*, f32, f32, f32, s32, s32); -s32 func_80074118(s32, f32*, f32, f32, f32, s32, s32); -s32 func_8007415C(s32, f32*, f32, f32, f32, s32, s32); -s32 func_800741B4(s32, f32*, f32, f32, f32, s32, s32); -void func_800742A8(s32, f32*, f32, f32, f32, s32, s32); -void func_800742EC(s32, f32*, f32, f32, f32, s32, s32); -void func_80074344(s32, f32*, f32, f32, f32, s32, s32); +s32 func_8007401C(s32, f32 *, f32, f32, f32, s32, s32); +s32 func_80074118(s32, f32 *, f32, f32, f32, s32, s32); +s32 func_8007415C(s32, f32 *, f32, f32, f32, s32, s32); +s32 func_800741B4(s32, f32 *, f32, f32, f32, s32, s32); +void func_800742A8(s32, f32 *, f32, f32, f32, s32, s32); +void func_800742EC(s32, f32 *, f32, f32, f32, s32, s32); +void func_80074344(s32, f32 *, f32, f32, f32, s32, s32); void func_80074478(s32); void func_800744A0(s32); void func_800744CC(void); -void func_80074510(uintptr_t, void*, size_t); +void func_80074510(uintptr_t, void *, size_t); void func_800745C8(s32, s32); void func_8007466C(s32, s32); void func_80074704(s32, s32); -u8 *func_80074790(s32, u8*); -void func_800747F0(s32, u8*); -void func_80074894(s32, u8*); -void func_800748C4(s32, u8*); -void func_800748F4(s32, u8*); +u8 *func_80074790(s32, u8 *); +void func_800747F0(s32, u8 *); +void func_80074894(s32, u8 *); +void func_800748C4(s32, u8 *); +void func_800748F4(s32, u8 *); void func_80074924(s32); void func_80074D94(s32); void func_80074E28(s32); @@ -121,30 +121,30 @@ void func_800750D8(s32, s32, Vec3f, s32, s32); void func_80075304(Vec3f, s32, s32, s32); void func_8007542C(s32); void func_80075574(s32, Vec3f, f32); -s32 func_800755FC(s32, Vec3f, f32); +s32 func_800755FC(s32, Vec3f, f32); void func_80075698(s32); void func_80075714(s32); void update_train_smoke(void); void func_80075838(void); void func_800759EC(s32, Vec3f, f32); -s32 func_80075A6C(s32, Vec3f, f32); +s32 func_80075A6C(s32, Vec3f, f32); void func_80075B08(s32); void func_80075B84(s32); void update_ferries_smoke_particle(void); void func_80075E5C(s32, Vec3f, u16, f32, s32); -s32 func_80075F28(Vec3f, u16, f32, s32); +s32 func_80075F28(Vec3f, u16, f32, s32); void func_80075F98(Vec3f, u16, f32); void func_8007601C(s32); void func_8007614C(void); void func_80076194(s32, Vec3f, f32, s32); -s32 func_80076278(Vec3f, f32, s32); +s32 func_80076278(Vec3f, f32, s32); void func_800762DC(Vec3f, f32); void func_8007634C(s32); void func_800763CC(s32); void func_80076538(s32); void func_8007661C(void); void func_8007675C(s32, Vec3s, s32); -s32 func_80076828(Vec3s, s32); +s32 func_80076828(Vec3s, s32); void func_80076884(s32); void func_80076958(s32); void func_800769D8(s32); @@ -159,13 +159,13 @@ void func_80076ED8(s32); void func_80076F2C(void); void init_object_smoke_particle(s32, s32); void init_smoke_particles(s32); -void func_800773D8(f32*, s32); +void func_800773D8(f32 *, s32); void func_80077428(s32); void func_80077450(s32); void func_80077584(s32); void func_80077640(void); void init_object_leaf_particle(s32, Vec3f, s32); -s32 init_leaf_particle(Vec3f, s32); +s32 init_leaf_particle(Vec3f, s32); void spawn_leaf(Vec3f, s32); void func_80077B14(s32); void func_80077B3C(s32); @@ -177,9 +177,9 @@ void func_80078288(s32); void func_800786EC(s32); void func_80078790(void); void update_snowflakes(void); -void func_800788F8(s32, u16, Camera*); -void update_clouds(s32, Camera*, CloudData*); -void update_stars(s32, Camera*, StarData*); +void func_800788F8(s32, u16, Camera *); +void update_clouds(s32, Camera *, CloudData *); +void update_stars(s32, Camera *, StarData *); void func_80078C68(void); void func_80078C70(s32); void func_80078F64(void); @@ -191,10 +191,10 @@ void func_80079114(s32, s32, s32); void func_800791F0(s32, s32); void func_800797AC(s32); void func_80079860(s32); -void func_8007993C(s32, Player*); -void func_80079A5C(s32, Player*); -void func_8007A66C(s32, Player*, Camera*); -void func_8007A778(s32, Player*, Camera*); +void func_8007993C(s32, Player *); +void func_80079A5C(s32, Player *); +void func_8007A66C(s32, Player *, Camera *); +void func_8007A778(s32, Player *, Camera *); void func_8007A884(void); void func_8007A88C(s32); void func_8007A910(s32); @@ -202,11 +202,11 @@ void update_object_lakitu(s32); void func_8007AA44(s32); void func_8007ABFC(s32, s32); void consume_item(s32); -u8 gen_random_item(s16, s16); -u8 gen_random_item_human(s16, s16); -u8 kart_ai_gen_random_item(s32, s16); -s16 func_8007AFB0(s32, s32); -s32 func_8007B040(s32, s32); +u8 gen_random_item(s16, s16); +u8 gen_random_item_human(s16, s16); +u8 kart_ai_gen_random_item(s32, s16); +s16 func_8007AFB0(s32, s32); +s32 func_8007B040(s32, s32); void func_8007B254(s32, s32); void func_8007B34C(s32); void func_8007BB9C(s32); @@ -219,8 +219,8 @@ void func_8007BFB0(s32); void update_cheep_cheep_ending(void); void update_cheep_cheep(s32); void wrapper_update_boos(void); -void func_8007C360(s32, Camera*); -void func_8007C420(s32, Player*, Camera*); +void func_8007C360(s32, Camera *); +void func_8007C420(s32, Player *, Camera *); void func_8007C4A4(s32); void func_8007C550(s32); void func_8007C5B4(s32); @@ -228,7 +228,7 @@ void func_8007C684(s32); void func_8007C49C(void); void func_8007C7B4(s32, s32); void func_8007C91C(s32); -s32 func_8007C9F8(void); +s32 func_8007C9F8(void); void func_8007CA70(void); void update_boos(void); void func_8007CE0C(s32); @@ -238,7 +238,7 @@ void func_8007D360(s32, s32); void func_8007D6A8(s32, s32); void func_8007D714(s32); void func_8007D794(s32); -s32 func_8007D804(s32); +s32 func_8007D804(s32); void func_8007D8AC(s32); void func_8007D8D4(s32, s32); void func_8007DA4C(s32); @@ -253,8 +253,8 @@ void func_8007E1F4(s32); void func_8007E358(s32); void func_8007E3EC(s32); void func_8007E4C4(void); -s32 func_8007E50C(s32, Player*, Camera*); -s32 func_8007E59C(s32); +s32 func_8007E50C(s32, Player *, Camera *); +s32 func_8007E59C(s32); void func_8007E63C(s32); void func_8007EC30(s32); void func_8007ED6C(s32); @@ -265,7 +265,7 @@ void func_8007F544(s32); void func_8007F5A8(s32); void func_8007F660(s32, s32, s32); void func_8007F6C4(s32, s32); -s32 func_8007F75C(s32); +s32 func_8007F75C(s32); void func_8007F8D8(void); void func_8007FA08(s32); void func_8007FB48(s32); @@ -281,7 +281,7 @@ void func_800806BC(s32); void func_8008078C(s32); void func_8008085C(s32); void func_800808CC(s32); -void func_80080A14(s32, Player*); +void func_80080A14(s32, Player *); void func_80080A4C(s32, s32); void func_80080B28(s32, s32); void func_80080DE4(s32); @@ -371,8 +371,9 @@ void func_80086C14(s32); void func_80086C6C(s32); void func_80086D80(void); -s32 osPiStartDma(OSIoMesg *mb, s32 priority, s32 direction, uintptr_t devAddr, void *vAddr, size_t nbytes, OSMesgQueue *mq); -s32 osRecvMesg(OSMesgQueue*, OSMesg*, s32); +s32 osPiStartDma(OSIoMesg *mb, s32 priority, s32 direction, uintptr_t devAddr, void *vAddr, + size_t nbytes, OSMesgQueue *mq); +s32 osRecvMesg(OSMesgQueue *, OSMesg *, s32); extern f32 D_800E43B0[]; extern Vtx D_800E43F0[]; @@ -389,9 +390,9 @@ extern s16 D_8016347C; extern s32 D_80165594; extern s32 D_80165598; extern s16 D_8018D018; -extern s8 D_8018D198[]; -extern s8 D_8018D1A8[]; -extern s8 D_8018D1B8[]; +extern s8 D_8018D198[]; +extern s8 D_8018D1A8[]; +extern s8 D_8018D1B8[]; /** @endcond */