diff --git a/decompressed.us.v10.yaml b/decompressed.us.v10.yaml index 31397d0f..69f79755 100644 --- a/decompressed.us.v10.yaml +++ b/decompressed.us.v10.yaml @@ -1942,85 +1942,85 @@ segments: follows_vram: core2 exclusive_ram_id: overlay subsegments: - - [0x10731B0, c, code_0] + - [0x10731B0, c, ch/eggtoll1] - [0x10737F0, c, code_640] - [0x1073E50, c, code_CA0] - [0x1074720, c, code_1570] - - [0x1075170, c, code_1FC0] - - [0x1075990, c, code_27E0] - - [0x1075C20, c, code_2A70] - - [0x1076040, c, code_2E90] - - [0x1076660, c, code_34B0] - - [0x1076850, c, code_36A0] - - [0x1076E60, c, code_3CB0] - - [0x10772A0, c, code_40F0] - - [0x1077980, c, code_47D0] - - [0x1077E20, c, code_4C70] - - [0x1078210, c, code_5060] - - [0x10784A0, c, code_52F0] - - [0x1078640, c, code_5490] - - [0x1078C60, c, code_5AB0] - - [0x1078DC0, c, code_5C10] - - [0x10790C0, c, code_5F10] - - [0x1079130, c, code_5F80] - - [0x107AC10, c, code_7A60] - - [0x107ACD0, c, code_7B20] - - [0x107B180, c, code_7FD0] - - [0x107B6D0, c, code_8520] + - [0x1075170, c, ch/grimlet] + - [0x1075990, c, ch/cog] + - [0x1075C20, c, ch/axle] + - [0x1076040, c, ch/enginefan] + - [0x1076660, c, ch/enginefanswitch] + - [0x1076850, c, ch/propellor] + - [0x1076E60, c, ch/propellorswitch] + - [0x10772A0, c, ch/engineparts] + - [0x1077980, c, ch/whistleswitch] + - [0x1077E20, c, ch/whistle] + - [0x1078210, c, ch/whistlectrl] + - [0x10784A0, c, ch/anchorswitch] + - [0x1078640, c, ch/dolphin] + - [0x1078C60, c, ch/anchor] + - [0x1078DC0, c, ch/anchorctrl] + - [0x10790C0, c, ch/rarewareflag] + - [0x1079130, c, ch/bossboombox] + - [0x107AC10, c, ch/bossboomboxctrl] + - [0x107ACD0, c, ch/bellbuoy] + - [0x107B180, c, ch/rowboat] + - [0x107B6D0, c, ch/boombox] - [0x107C820, c, code_9670] - [0x107C9F0, c, code_9840] - - [0x107CBA0, c, code_99F0] - - [0x107CE10, .data, code_0] + - [0x107CBA0, c, propellorctrl] + - [0x107CE10, .data, ch/eggtoll1] - [0x107CE90, .data, code_640] - [0x107CFC0, .data, code_CA0] - [0x107D030, .data, code_1570] - - [0x107D140, .data, code_1FC0] - - [0x107D170, .data, code_27E0] - - [0x107D1F0, .data, code_2A70] - - [0x107D2F0, .data, code_2E90] - - [0x107D470, .data, code_34B0] - - [0x107D4A0, .data, code_36A0] - - [0x107D4E0, .data, code_3CB0] - - [0x107D520, .data, code_40F0] - - [0x107D630, .data, code_47D0] - - [0x107D710, .data, code_4C70] - - [0x107D810, .data, code_5060] - - [0x107D840, .data, code_52F0] - - [0x107D870, .data, code_5490] - - [0x107D8A0, .data, code_5AB0] - - [0x107D8D0, .data, code_5C10] - - [0x107D900, .data, code_5F10] - - [0x107D930, .data, code_5F80] - - [0x107DAB0, .data, code_7A60] - - [0x107DAE0, .data, code_7B20] - - [0x107DB10, .data, code_7FD0] - - [0x107DB40, .data, code_8520] + - [0x107D140, .data, ch/grimlet] + - [0x107D170, .data, ch/cog] + - [0x107D1F0, .data, ch/axle] + - [0x107D2F0, .data, ch/enginefan] + - [0x107D470, .data, ch/enginefanswitch] + - [0x107D4A0, .data, ch/propellor] + - [0x107D4E0, .data, ch/propellorswitch] + - [0x107D520, .data, ch/engineparts] + - [0x107D630, .data, ch/whistleswitch] + - [0x107D710, .data, ch/whistle] + - [0x107D810, .data, ch/whistlectrl] + - [0x107D840, .data, ch/anchorswitch] + - [0x107D870, .data, ch/dolphin] + - [0x107D8A0, .data, ch/anchor] + - [0x107D8D0, .data, ch/anchorctrl] + - [0x107D900, .data, ch/rarewareflag] + - [0x107D930, .data, ch/bossboombox] + - [0x107DAB0, .data, ch/bossboomboxctrl] + - [0x107DAE0, .data, ch/bellbuoy] + - [0x107DB10, .data, ch/rowboat] + - [0x107DB40, .data, ch/boombox] - [0x107DBC0, .data, code_9670] - [0x107DBF0, .data, code_9840] - [0x107DC40, .rodata, code_640] - [0x107DC50, .rodata, code_CA0] - [0x107DC70, .rodata, code_1570] - - [0x107DCD0, .rodata, code_1FC0] - - [0x107DD30, .rodata, code_2A70] - - [0x107DD40, .rodata, code_34B0] - - [0x107DD50, .rodata, code_36A0] - - [0x107DD70, .rodata, code_3CB0] - - [0x107DD80, .rodata, code_4C70] - - [0x107DD90, .rodata, code_5060] - - [0x107DDB0, .rodata, code_5490] - - [0x107DE80, .rodata, code_5AB0] - - [0x107DE90, .rodata, code_5C10] - - [0x107DEA0, .rodata, code_5F80] - - [0x107DF30, .rodata, code_7B20] - - [0x107DF60, .rodata, code_7FD0] - - [0x107DFB0, .rodata, code_8520] + - [0x107DCD0, .rodata, ch/grimlet] + - [0x107DD30, .rodata, ch/axle] + - [0x107DD40, .rodata, ch/enginefanswitch] + - [0x107DD50, .rodata, ch/propellor] + - [0x107DD70, .rodata, ch/propellorswitch] + - [0x107DD80, .rodata, ch/whistle] + - [0x107DD90, .rodata, ch/whistlectrl] + - [0x107DDB0, .rodata, ch/dolphin] + - [0x107DE80, .rodata, ch/anchor] + - [0x107DE90, .rodata, ch/anchorctrl] + - [0x107DEA0, .rodata, ch/bossboombox] + - [0x107DF30, .rodata, ch/bellbuoy] + - [0x107DF60, .rodata, ch/rowboat] + - [0x107DFB0, .rodata, ch/boombox] - [0x107E020, .rodata, code_9670] - [0x107E030, .bss, bss_pad] - - [0x107E030, .bss, code_5F80] - - [0x107E030, .bss, code_8520] - - [0x107E030, .bss, code_8520] + - [0x107E030, .bss, ch/bossboombox] + - [0x107E030, .bss, ch/boombox] + - [0x107E030, .bss, ch/boombox] - [0x107E030, .bss, code_9670] - - [0x107E030, .bss, code_99F0] + - [0x107E030, .bss, propellorctrl] - name: FP dir: FP type: code diff --git a/src/RBB/code_5AB0.c b/src/RBB/ch/anchor.c similarity index 100% rename from src/RBB/code_5AB0.c rename to src/RBB/ch/anchor.c diff --git a/src/RBB/code_5C10.c b/src/RBB/ch/anchorctrl.c similarity index 70% rename from src/RBB/code_5C10.c rename to src/RBB/ch/anchorctrl.c index 84677a5e..621b50ff 100644 --- a/src/RBB/code_5C10.c +++ b/src/RBB/ch/anchorctrl.c @@ -3,19 +3,17 @@ #include "variables.h" -void func_8038C0FC(Actor *this, s32 new_state); +void __chAnchorCtrl_setState(Actor *this, s32 new_state); -void func_8038C204(Actor *this); +void chAnchorCtrl_update(Actor *this); /* .data */ ActorInfo RBB_D_80390B10 = { 0x199, 0x1CB, 0x0, 0x0, NULL, - func_8038C204, NULL, func_80325340, + chAnchorCtrl_update, NULL, func_80325340, 0, 0, 0.0f, 0 }; -f32 D_80390B34[3] = {-5100.0f, -2550.0f, 1470.0f}; - /* .code */ void func_8038C000(void){ s32 sp1C = func_802F9AA8(SFX_7D_ANCHOR_LIFTING); @@ -29,34 +27,36 @@ void func_8038C058(void){ func_8030E760(SFX_7F_HEAVYDOOR_SLAM, 1.0f, 0x55f0); } -void func_8038C0A8(ActorMarker *marker, s32 arg1, s32 arg2){ +void __chAnchorCtrl_spawnJiggy(ActorMarker *marker, s32 arg1, s32 arg2){ + static f32 D_80390B34[3] = {-5100.0f, -2550.0f, 1470.0f}; + Actor *actor = marker_getActor(marker); jiggySpawn(JIGGY_53_RBB_SNORKEL, &D_80390B34); timed_setCameraToNode(0.5f, 0xb); - func_8038C0FC(actor, 3); + __chAnchorCtrl_setState(actor, 3); } -void func_8038C0FC(Actor *this, s32 new_state){ +void __chAnchorCtrl_setState(Actor *this, s32 new_state){ if(new_state == 2){ set_camera_to_node(0xC); func_80324E38(0.0f, 3); timedFunc_set_0(1.0f, func_8038C000); timedFunc_set_2(1.0f, (GenMethod_2)mapSpecificFlags_set, 8, TRUE); - timed_playSfx(2.1f, SFX_3F6_UNKNOWN, 0.6f, 0x7fbc); + timed_playSfx(2.1f, SFX_3F6_UNKNOWN, 0.6f, 32700); timedFunc_set_2(2.7f, (GenMethod_2)mapSpecificFlags_set, 4, TRUE); timedFunc_set_0(3.0f, func_8038C058); - func_80324DBC(3.0f, 0xb9C, 7, NULL, this->marker, func_8038C0A8, NULL); + func_80324DBC(3.0f, 0xb9C, 7, NULL, this->marker, __chAnchorCtrl_spawnJiggy, NULL); }//L8038C1D8 this->state = new_state; } -void func_8038C204(Actor *this){ +void chAnchorCtrl_update(Actor *this){ if(!this->unk16C_4){ this->unk16C_4 = 1; if(levelSpecificFlags_getSet(0x30, FALSE)) - func_8038C0FC(this, 2); + __chAnchorCtrl_setState(this, 2); else - func_8038C0FC(this, 1); + __chAnchorCtrl_setState(this, 1); if(jiggyscore_isSpawned(JIGGY_53_RBB_SNORKEL)) marker_despawn(this->marker); diff --git a/src/RBB/code_52F0.c b/src/RBB/ch/anchorswitch.c similarity index 65% rename from src/RBB/code_52F0.c rename to src/RBB/ch/anchorswitch.c index 933637f9..08dc1ebe 100644 --- a/src/RBB/code_52F0.c +++ b/src/RBB/ch/anchorswitch.c @@ -2,17 +2,17 @@ #include "functions.h" #include "variables.h" -void func_8038B7E8(Actor *this); +void chAnchorSwitch_update(Actor *this); /* .data */ ActorInfo D_80390A80 = { 0x2F, 0x1C7, 0x41B, 0x0, NULL, - func_8038B7E8, NULL, func_80325888, + chAnchorSwitch_update, NULL, func_80325888, 0, 0, 0.0f, 0 }; /* .code */ -void func_8038B6E0(Actor *this, s32 arg1){ +void __chAnchorSwitch_setState(Actor *this, s32 arg1){ if(arg1 == 2){ if(this->state == 1){ func_8030E6D4(SFX_90_SWITCH_PRESS); @@ -29,19 +29,19 @@ void func_8038B6E0(Actor *this, s32 arg1){ this->state = arg1; } -void func_8038B7BC(ActorMarker *marker, s32 arg1){ +void __chAnchorSwitch_press(ActorMarker *marker, s32 arg1){ Actor *actor = marker_getActor(marker); - func_8038B6E0(actor, 2); + __chAnchorSwitch_setState(actor, 2); } -void func_8038B7E8(Actor *this){ +void chAnchorSwitch_update(Actor *this){ if(!this->unk16C_4){ this->unk16C_4 = 1; this->marker->propPtr->unk8_3 = 1; - marker_setCollisionScripts(this->marker, NULL, func_8038B7BC, NULL); + marker_setCollisionScripts(this->marker, NULL, __chAnchorSwitch_press, NULL); if(jiggyscore_isSpawned(JIGGY_53_RBB_SNORKEL)) - func_8038B6E0(this, 2); + __chAnchorSwitch_setState(this, 2); else - func_8038B6E0(this, 1); + __chAnchorSwitch_setState(this, 1); } } diff --git a/src/RBB/code_2A70.c b/src/RBB/ch/axle.c similarity index 100% rename from src/RBB/code_2A70.c rename to src/RBB/ch/axle.c diff --git a/src/RBB/code_7B20.c b/src/RBB/ch/bellbuoy.c similarity index 100% rename from src/RBB/code_7B20.c rename to src/RBB/ch/bellbuoy.c diff --git a/src/RBB/code_8520.c b/src/RBB/ch/boombox.c similarity index 100% rename from src/RBB/code_8520.c rename to src/RBB/ch/boombox.c diff --git a/src/RBB/code_5F80.c b/src/RBB/ch/bossboombox.c similarity index 100% rename from src/RBB/code_5F80.c rename to src/RBB/ch/bossboombox.c diff --git a/src/RBB/ch/bossboomboxctrl.c b/src/RBB/ch/bossboomboxctrl.c new file mode 100644 index 00000000..c69450b8 --- /dev/null +++ b/src/RBB/ch/bossboomboxctrl.c @@ -0,0 +1,31 @@ +#include +#include "functions.h" +#include "variables.h" + + +void chBossBoomBoxCtrl_update(Actor *this); + +/* .data */ +ActorInfo RBB_D_80390CF0 = { + 0x1C0, 0x2AD, 0x0, 0x0, NULL, + chBossBoomBoxCtrl_update, NULL, func_80325340, + 0, 0, 0.0f, 0 +}; + +/* .code */ +void __chBossBoomBoxCtrl_setState(Actor *this, s32 new_state){ + this->state = new_state; +} + +void chBossBoomBoxCtrl_update(Actor *this){ + if(!this->unk16C_4){ + + this->unk16C_4 = 1; + if(jiggyscore_isSpawned(JIGGY_56_RBB_BOSS_BOOM_BOX) && !func_803203FC(2)){ + marker_despawn(this->marker); + }else{ + __spawnQueue_add_4((GenMethod_4)func_802C4140, ACTOR_281_BOSS_BOOM_BOX_LARGEST, reinterpret_cast(s32,this->position_x), reinterpret_cast(s32,this->position_y), reinterpret_cast(s32,this->position_z)); + __chBossBoomBoxCtrl_setState(this, 1); + } + }//L8038DEF4 +} diff --git a/src/RBB/code_27E0.c b/src/RBB/ch/cog.c similarity index 100% rename from src/RBB/code_27E0.c rename to src/RBB/ch/cog.c diff --git a/src/RBB/code_5490.c b/src/RBB/ch/dolphin.c similarity index 100% rename from src/RBB/code_5490.c rename to src/RBB/ch/dolphin.c diff --git a/src/RBB/code_0.c b/src/RBB/ch/eggtoll1.c similarity index 100% rename from src/RBB/code_0.c rename to src/RBB/ch/eggtoll1.c diff --git a/src/RBB/code_2E90.c b/src/RBB/ch/enginefan.c similarity index 100% rename from src/RBB/code_2E90.c rename to src/RBB/ch/enginefan.c diff --git a/src/RBB/code_34B0.c b/src/RBB/ch/enginefanswitch.c similarity index 65% rename from src/RBB/code_34B0.c rename to src/RBB/ch/enginefanswitch.c index 5e28ade7..14601381 100644 --- a/src/RBB/code_34B0.c +++ b/src/RBB/ch/enginefanswitch.c @@ -2,12 +2,12 @@ #include "functions.h" #include "variables.h" -void RBB_func_803899C0(Actor *this); +void chEngineFanSwitch_update(Actor *this); /* .data */ ActorInfo D_803906B0 = { 0x194, 0x1BE, 0x412, 0x0, NULL, - RBB_func_803899C0, NULL, func_80325888, + chEngineFanSwitch_update, NULL, func_80325888, 0, 0, 0.0f, 0 }; @@ -16,7 +16,7 @@ void RBB_func_803898A0(void){ mapSpecificFlags_set(0, 1); } -void func_803898C4(Actor * this, s32 arg1){ +void chEngineFanSwitch_setState(Actor * this, s32 arg1){ this->state = arg1; if(this->state == 2){ func_8030E6D4(SFX_90_SWITCH_PRESS); @@ -29,25 +29,25 @@ void func_803898C4(Actor * this, s32 arg1){ } } -void func_80389980(ActorMarker *marker, s32 arg1){ +void __chEngineFanSwitch_pressCallback(ActorMarker *marker, s32 arg1){ Actor *actor = marker_getActor(marker); if(actor->state == 1){ - func_803898C4(actor, 2); + chEngineFanSwitch_setState(actor, 2); } } -void RBB_func_803899C0(Actor *this){ - if(!this->unk16C_4){ +void chEngineFanSwitch_update(Actor *this){ + if(!this->unk16C_4){ //initialize this->marker->propPtr->unk8_3 = 1; this->unk16C_4 = 1; mapSpecificFlags_set(0, 0); - marker_setCollisionScripts(this->marker, NULL, func_80389980, NULL); + marker_setCollisionScripts(this->marker, NULL, __chEngineFanSwitch_pressCallback, NULL); if(this->state == 0){ this->position_x = -3209.95f; this->position_y = 1164.5f; this->position_z = -2649.95f; this->yaw = -90.0f; - func_803898C4(this, 1); + chEngineFanSwitch_setState(this, 1); } } } diff --git a/src/RBB/code_40F0.c b/src/RBB/ch/engineparts.c similarity index 100% rename from src/RBB/code_40F0.c rename to src/RBB/ch/engineparts.c diff --git a/src/RBB/code_1FC0.c b/src/RBB/ch/grimlet.c similarity index 100% rename from src/RBB/code_1FC0.c rename to src/RBB/ch/grimlet.c diff --git a/src/RBB/code_36A0.c b/src/RBB/ch/propellor.c similarity index 84% rename from src/RBB/code_36A0.c rename to src/RBB/ch/propellor.c index 9d07c76e..f833c3e6 100644 --- a/src/RBB/code_36A0.c +++ b/src/RBB/ch/propellor.c @@ -10,28 +10,28 @@ typedef struct { f32 unkC; }ActorLocal_RBB_36A0; -void func_80389C78(Actor *this); +void chPropellor_update(Actor *this); /* .data */ ActorInfo D_803906E0 = { MARKER_185_MODEL_RUSTY_BUCKET_REAR_PROPELLER, ACTOR_175_MODEL_RUSTY_BUCKET_REAR_PROPELLER, ASSET_403_MODEL_RUSTY_BUCKET_REAR_PROPELLER, 0x0, NULL, - func_80389C78, NULL, func_80325888, + chPropellor_update, NULL, func_80325888, 0, 0, 0.0f, 0 }; s32 D_80390704[4] = {0x258, 0x12C, 0x12C, 0}; /*.code */ -f32 func_80389A90(void){ +f32 __chPropellor_getSpeed(void){ return (f32) D_80390704[2*levelSpecificFlags_get(0x27) + levelSpecificFlags_get(0x28)]; } -void func_80389ADC(Actor *this, s32 arg1){ +void __chPropellor_setState(Actor *this, s32 arg1){ ActorLocal_RBB_36A0 * local = (ActorLocal_RBB_36A0 *)&this->local; if(arg1 == 1){ - local->unkC = func_80389A90(); - local->unk4 = func_80389A90(); + local->unkC = __chPropellor_getSpeed(); + local->unk4 = __chPropellor_getSpeed(); } this->state = arg1; } @@ -56,14 +56,14 @@ void func_80389B80(Actor *this, f32 arg1){ } } -void func_80389C44(Actor *actor){ +void __chPropellor_free(Actor *actor){ ActorLocal_RBB_36A0 * local = (ActorLocal_RBB_36A0 *)&actor->local; if(func_802F9C0C(local->unk0)) func_802F9D38(local->unk0); } -void func_80389C78(Actor *this){ +void chPropellor_update(Actor *this){ ActorLocal_RBB_36A0 * local = (ActorLocal_RBB_36A0 *)&this->local; f32 tmp; f32 sp34 = time_getDelta(); @@ -73,7 +73,7 @@ void func_80389C78(Actor *this){ this->marker->propPtr->unk8_3 = 1; this->pitch = randf2(0.0f, 300.0f); func_803300C0(this->marker, func_80389B44); - marker_setFreeMethod(this->marker, func_80389C44); + marker_setFreeMethod(this->marker, __chPropellor_free); func_80389B80(this, 1.0f); if(this->unk78_13 == 0x1C){ local->unk8 = 0; @@ -89,7 +89,7 @@ void func_80389C78(Actor *this){ }//L80389D7C local->unk4 = 0.0f; local->unkC = 0.0f; - func_80389ADC(this, 1); + __chPropellor_setState(this, 1); if(levelSpecificFlags_get(local->unk8 ? 4 : 3)){ set_camera_to_node(9); func_80324E38(0.0f, 3); @@ -108,15 +108,15 @@ void func_80389C78(Actor *this){ || (180.0f < tmp && this->pitch <= 180.0f) ){ if(levelSpecificFlags_get(3) || levelSpecificFlags_get(4)) - func_8030E760(SFX_2_CLAW_SWIPE, 0.4f, 0x4e20); + func_8030E760(SFX_2_CLAW_SWIPE, 0.4f, 20000); else - func_8030E988(SFX_2_CLAW_SWIPE, 0.4f, 0x4e20, &this->position, 500.0f, 1000.0f); + func_8030E988(SFX_2_CLAW_SWIPE, 0.4f, 20000, &this->position, 500.0f, 1000.0f); }//L80389F94 if(this->pitch < 0.0f) this->pitch += 360.0f; if(this->state == 1){ - local->unk4 = func_80389A90(); + local->unk4 = __chPropellor_getSpeed(); if(local->unkC < local->unk4){ local->unkC += 75*sp34; local->unkC = MIN(local->unk4, local->unkC); diff --git a/src/RBB/code_3CB0.c b/src/RBB/ch/propellorswitch.c similarity index 80% rename from src/RBB/code_3CB0.c rename to src/RBB/ch/propellorswitch.c index a608e544..90f7f144 100644 --- a/src/RBB/code_3CB0.c +++ b/src/RBB/ch/propellorswitch.c @@ -18,8 +18,8 @@ typedef struct { void *unk4; }ActorLocal_RBB_3CB0; -void func_8038A324(Actor *this); -Actor *func_8038A224(ActorMarker *marker, Gfx **gdl, Mtx **mptr, s32 arg3); +void chPropellorSwitch_update(Actor *this); +Actor *chPropellorSwitch_draw(ActorMarker *marker, Gfx **gdl, Mtx **mptr, s32 arg3); /* .data */ Struct_RBB_3CB0 D_80390720[2] = { @@ -29,12 +29,12 @@ Struct_RBB_3CB0 D_80390720[2] = { ActorInfo D_80390738 = { 0x186, 0x176, 0x404, 0x0, NULL, - func_8038A324, NULL, func_8038A224, + chPropellorSwitch_update, NULL, chPropellorSwitch_draw, 0, 0, 0.0f, 0 }; /* .code */ -void RBB_func_8038A0A0(Actor *this, s32 arg1){ +void __chPropellorSwitch_setState(Actor *this, s32 arg1){ ActorLocal_RBB_3CB0 *local = (ActorLocal_RBB_3CB0 *)&this->local; if(arg1 == 1) @@ -61,14 +61,14 @@ void RBB_func_8038A0A0(Actor *this, s32 arg1){ void func_8038A1C8(ActorMarker *marker, s32 arg1){ Actor *actor = marker_getActor(marker); if(actor->state == 1){ - RBB_func_8038A0A0(actor, 2); + __chPropellorSwitch_setState(actor, 2); } else if(actor->state == 2){ - func_8038FF40(); + rbb_propellorCtrl_start(); } } -Actor *func_8038A224(ActorMarker *marker, Gfx **gdl, Mtx **mptr, s32 arg3){ +Actor *chPropellorSwitch_draw(ActorMarker *marker, Gfx **gdl, Mtx **mptr, s32 arg3){ Actor *actor = marker_getActor(marker); ActorLocal_RBB_3CB0 *local = (ActorLocal_RBB_3CB0 *)&actor->local; @@ -86,17 +86,17 @@ Actor *func_8038A224(ActorMarker *marker, Gfx **gdl, Mtx **mptr, s32 arg3){ return actor; } -void func_8038A2F8(Actor *actor){ +void chPropellorSwitch_free(Actor *actor){ ActorLocal_RBB_3CB0 *local = (ActorLocal_RBB_3CB0 *)&actor->local; if(local->unk4) assetcache_release(local->unk4); } -void func_8038A324(Actor *this){ +void chPropellorSwitch_update(Actor *this){ ActorLocal_RBB_3CB0 *local = (ActorLocal_RBB_3CB0 *)&this->local; if(!this->unk16C_4){ this->marker->propPtr->unk8_3 = 1; - this->marker->unk30 = func_8038A2F8; + this->marker->unk30 = chPropellorSwitch_free; this->unk16C_4 = 1; local->unk0 = &D_80390720[((this->unk78_13 == 2) ? 0:1)]; if(local->unk0->unk6 == 0) @@ -108,16 +108,16 @@ void func_8038A324(Actor *this){ this->position_y = (f32)local->unk0->unk0[1]; this->position_z = (f32)local->unk0->unk0[2]; if(levelSpecificFlags_get(local->unk0->unkA)) - RBB_func_8038A0A0(this, 2); + __chPropellorSwitch_setState(this, 2); else - RBB_func_8038A0A0(this, 1); + __chPropellorSwitch_setState(this, 1); }//L8038A47C if(this->state == 2){ if( !levelSpecificFlags_get(local->unk0->unkA) && !levelSpecificFlags_get(3) && !levelSpecificFlags_get(4) ){ - RBB_func_8038A0A0(this, 1); + __chPropellorSwitch_setState(this, 1); } } } diff --git a/src/RBB/code_5F10.c b/src/RBB/ch/rarewareflag.c similarity index 100% rename from src/RBB/code_5F10.c rename to src/RBB/ch/rarewareflag.c diff --git a/src/RBB/code_7FD0.c b/src/RBB/ch/rowboat.c similarity index 100% rename from src/RBB/code_7FD0.c rename to src/RBB/ch/rowboat.c diff --git a/src/RBB/code_4C70.c b/src/RBB/ch/whistle.c similarity index 100% rename from src/RBB/code_4C70.c rename to src/RBB/ch/whistle.c diff --git a/src/RBB/code_5060.c b/src/RBB/ch/whistlectrl.c similarity index 63% rename from src/RBB/code_5060.c rename to src/RBB/ch/whistlectrl.c index 512278a2..d2bacaa7 100644 --- a/src/RBB/code_5060.c +++ b/src/RBB/ch/whistlectrl.c @@ -10,46 +10,46 @@ typedef struct { u8 *unk4; }ActorLocal_RBB_5060; -void func_8038B654(Actor * this); +void chWhistleCtrl_update(Actor * this); /* .data */ ActorInfo D_80390A50 = { 0x2D, 0x1C5, 0x0, 0x0, NULL, - func_8038B654, NULL, func_80325340, + chWhistleCtrl_update, NULL, func_80325340, 0, 0, 0.0f, 0 }; f32 D_80390A74[3] = {-3820.0f, 850.0f, 0.0f}; //whistle jiggy spawn position /* .code */ -void func_8038B450(Actor *actor, s32 arg1){ +void __chWhistleCtrl_setState(Actor *actor, s32 arg1){ actor->state = arg1; } -void func_8038B468(void){ +void __chWhistleCtrl_soundWhistle(void){ func_802C8F70(225.0f); jiggySpawn(JIGGY_54_RBB_WHISTLE, D_80390A74); } -void func_8038B4A0(void){ +void __chWhistleCtrl_correct(void){ func_8025A6EC(COMUSIC_2B_DING_B, 28000); } -void func_8038B4C4(ActorMarker *marker){ +void __chWhistleCtrl_wrong(ActorMarker *marker){ func_8025A6EC(COMUSIC_2C_BUZZER, 28000); func_8028F530(0xD); } -void func_8038B4F4(void){ +void __chWhistleCtrl_complete(void){ func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 28000); func_80324E38(1.0f, 3); timed_setCameraToNode(2.0f, 10); - timedFunc_set_0(2.2f, func_8038B468); + timedFunc_set_0(2.2f, __chWhistleCtrl_soundWhistle); func_80324E88(5.0f); func_80324E38(5.0f, 0); } -s32 func_8038B56C(Actor *this, s32 whistle_id, Actor *other){ +s32 chWhistleCtrl_newEvent(Actor *this, s32 whistle_id, Actor *other){ ActorLocal_RBB_5060 *local = (ActorLocal_RBB_5060 *)&this->local; if(this->state != 1) @@ -57,22 +57,22 @@ s32 func_8038B56C(Actor *this, s32 whistle_id, Actor *other){ if(whistle_id + 0x30 == local->unk4[local->unk0]){ //correct if(local->unk4[++local->unk0] == 0){ //end of string - timedFunc_set_0(0.6f, func_8038B4F4); //spawn jiggy - func_8038B450(this, 2); + timedFunc_set_0(0.6f, __chWhistleCtrl_complete); //spawn jiggy + __chWhistleCtrl_setState(this, 2); return 3; }else{ - timedFunc_set_0(0.6f, func_8038B4A0); + timedFunc_set_0(0.6f, __chWhistleCtrl_correct); return 1; } } else{ //wrong - timedFunc_set_1(1.0f, func_8038B4C4, other->marker); + timedFunc_set_1(1.0f, __chWhistleCtrl_wrong, other->marker); local->unk0 = 0; return 2; } } -void func_8038B654(Actor *this){ +void chWhistleCtrl_update(Actor *this){ ActorLocal_RBB_5060 *local = (ActorLocal_RBB_5060 *)&this->local; if(!this->unk16C_4){ @@ -80,8 +80,8 @@ void func_8038B654(Actor *this){ local->unk2 = 1; local->unk4 = "312111"; if(jiggyscore_isSpawned(JIGGY_54_RBB_WHISTLE)) - func_8038B450(this, 2); + __chWhistleCtrl_setState(this, 2); else - func_8038B450(this, 1); + __chWhistleCtrl_setState(this, 1); } } diff --git a/src/RBB/code_47D0.c b/src/RBB/ch/whistleswitch.c similarity index 95% rename from src/RBB/code_47D0.c rename to src/RBB/ch/whistleswitch.c index d407e56f..cc89ef8c 100644 --- a/src/RBB/code_47D0.c +++ b/src/RBB/ch/whistleswitch.c @@ -65,7 +65,7 @@ Struct_RBB_47D0 *RBB_func_8038ABC0(Actor *arg0){ void func_8038AC18(Actor *this, s32 new_state){ ActorLocal_RBB_47D0 *local = (ActorLocal_RBB_47D0 *)&this->local; - Actor *other; + Actor *whistle_ctrl; local->unk8 = 0.0f; if(new_state == 2){ func_8030E6D4(SFX_90_SWITCH_PRESS); @@ -74,9 +74,9 @@ void func_8038AC18(Actor *this, s32 new_state){ mapSpecificFlags_set(local->unk4->unk10, TRUE); this->position_y -= 30.0f; local->unk8 = 1.0f; - other = actorArray_findActorFromActorId(0x1c5); - if(other){ - local->unk0 = func_8038B56C(other, this->modelCacheIndex - 0x1be, this); + whistle_ctrl = actorArray_findActorFromActorId(0x1c5); + if(whistle_ctrl){ + local->unk0 = chWhistleCtrl_newEvent(whistle_ctrl, this->modelCacheIndex - 0x1be, this); } }//L8038ACD0 diff --git a/src/RBB/code_7A60.c b/src/RBB/code_7A60.c deleted file mode 100644 index 18409cfb..00000000 --- a/src/RBB/code_7A60.c +++ /dev/null @@ -1,31 +0,0 @@ -#include -#include "functions.h" -#include "variables.h" - - -void func_8038DE68(Actor *this); - -/* .data */ -ActorInfo RBB_D_80390CF0 = { - 0x1C0, 0x2AD, 0x0, 0x0, NULL, - func_8038DE68, NULL, func_80325340, - 0, 0, 0.0f, 0 -}; - -/* .code */ -void func_8038DE50(Actor *this, s32 new_state){ - this->state = new_state; -} - -void func_8038DE68(Actor *this){ - if(!this->unk16C_4){ - - this->unk16C_4 = 1; - if(jiggyscore_isSpawned(JIGGY_56_RBB_BOSS_BOOM_BOX) && !func_803203FC(2)){ - marker_despawn(this->marker); - }else{ - __spawnQueue_add_4((GenMethod_4)func_802C4140, 0x281, reinterpret_cast(s32,this->position_x), reinterpret_cast(s32,this->position_y), reinterpret_cast(s32,this->position_z)); - func_8038DE50(this, 1); - } - }//L8038DEF4 -} diff --git a/src/RBB/code_99F0.c b/src/RBB/code_99F0.c deleted file mode 100644 index 07f677b5..00000000 --- a/src/RBB/code_99F0.c +++ /dev/null @@ -1,68 +0,0 @@ -#include -#include "functions.h" -#include "variables.h" - - -s32 pad_803912C0[2]; -u8 D_803912C8; - -void func_8038FDE0(s32 arg0){ - static f32 D_803912CC; - - D_803912CC = 0.0f; - if(arg0 == 1) - D_803912CC = 6.5f; - - if(arg0 == 2){ - item_set(ITEM_3_PROPELLOR_TIMER, 0xf3b); - item_set(ITEM_9_PROPELLOR, 1); - } - - if(arg0 == 3 || arg0 == 4){ - levelSpecificFlags_set(0x27, FALSE); - levelSpecificFlags_set(0x28, FALSE); - item_set(ITEM_9_PROPELLOR,0); - if(arg0 == 3 && !jiggyscore_isCollected(0x57)){ - timedFunc_set_1(0.5f, (GenMethod_1)func_802FAD64, 3); - func_80324DBC(1.0f, 0xb9d, 4, NULL, NULL, NULL, NULL); - } - else{ - func_802FAD64(3); - } - }//L8038FED4 - D_803912C8 = arg0; -} - -void func_8038FEE8(void){ - if(D_803912C8 == 2) - func_8038FDE0(4); -} - -void func_8038FF18(void){ - D_803912C8 = 0; - func_8038FDE0(0); -} - -void func_8038FF40(void){ - if(D_803912C8 == 2) - func_8038FDE0(2); -} - -void func_8038FF70(void){ - extern static f32 D_803912CC; - - if( D_803912C8 == 0) - if(levelSpecificFlags_get(0x27) && levelSpecificFlags_get(0x28)) - func_8038FDE0(1); - - if(D_803912C8 == 1) - if(ml_timer_update(&D_803912CC,time_getDelta())) - func_8038FDE0(2); - - if(D_803912C8 == 2) - if(item_getCount(ITEM_3_PROPELLOR_TIMER) == 0) - func_8038FDE0(3); - - if(D_803912C8 == 3) - func_8038FDE0(0); -} diff --git a/src/RBB/propellorctrl.c b/src/RBB/propellorctrl.c new file mode 100644 index 00000000..f18cbfe0 --- /dev/null +++ b/src/RBB/propellorctrl.c @@ -0,0 +1,68 @@ +#include +#include "functions.h" +#include "variables.h" + + +s32 pad_803912C0[2]; +u8 __propellorCtrlState; + +void __propellorCtrl_setState(s32 arg0){ + static f32 __propellorTimer; + + __propellorTimer = 0.0f; + if(arg0 == 1) + __propellorTimer = 6.5f; + + if(arg0 == 2){ + item_set(ITEM_3_PROPELLOR_TIMER, 3900 - 1); + item_set(ITEM_9_PROPELLOR, 1); + } + + if(arg0 == 3 || arg0 == 4){ + levelSpecificFlags_set(0x27, FALSE); + levelSpecificFlags_set(0x28, FALSE); + item_set(ITEM_9_PROPELLOR,0); + if(arg0 == 3 && !jiggyscore_isCollected(JIGGY_57_RBB_PROPELLOR)){ + timedFunc_set_1(0.5f, (GenMethod_1)func_802FAD64, 3); + func_80324DBC(1.0f, 0xb9d, 4, NULL, NULL, NULL, NULL); + } + else{ + func_802FAD64(3); + } + }//L8038FED4 + __propellorCtrlState = arg0; +} + +void rbb_propellorCtrl_stop(void){ + if(__propellorCtrlState == 2) + __propellorCtrl_setState(4); +} + +void rbb_propellorCtrl_reset(void){ + __propellorCtrlState = 0; + __propellorCtrl_setState(0); +} + +void rbb_propellorCtrl_start(void){ + if(__propellorCtrlState == 2) + __propellorCtrl_setState(2); +} + +void rbb_propellorCtrl_update(void){ + extern f32 __propellorTimer; + + if( __propellorCtrlState == 0) + if(levelSpecificFlags_get(0x27) && levelSpecificFlags_get(0x28)) + __propellorCtrl_setState(1); + + if(__propellorCtrlState == 1) + if(ml_timer_update(&__propellorTimer,time_getDelta())) + __propellorCtrl_setState(2); + + if(__propellorCtrlState == 2) + if(item_getCount(ITEM_3_PROPELLOR_TIMER) == 0) + __propellorCtrl_setState(3); + + if(__propellorCtrlState == 3) + __propellorCtrl_setState(0); +} diff --git a/src/core2/code_9A740.c b/src/core2/code_9A740.c index d1691577..56c624d9 100644 --- a/src/core2/code_9A740.c +++ b/src/core2/code_9A740.c @@ -2,7 +2,7 @@ #include "functions.h" #include "variables.h" -extern void func_8038FEE8(void); //rbb +extern void rbb_propellorCtrl_stop(void); //rbb typedef struct { u8 unk0; @@ -46,7 +46,7 @@ void func_803216D0(enum map_e map){ } if(D_80383300.level == LEVEL_9_RUSTY_BUCKET_BAY){ - func_8038FF18(); + rbb_propellorCtrl_reset(); } switch(map){ @@ -66,7 +66,7 @@ void func_803216D0(enum map_e map){ void func_80321854(void){ if(!func_802E4A8C()){ if( D_80383300.level == LEVEL_9_RUSTY_BUCKET_BAY){ - func_8038FEE8(); + rbb_propellorCtrl_stop(); } if( D_80383300.level == LEVEL_1_MUMBOS_MOUNTAIN @@ -97,6 +97,6 @@ void func_80321918(int arg0){ void func_80321924(void){ if(D_80383300.level == LEVEL_9_RUSTY_BUCKET_BAY){ - func_8038FF70(); + rbb_propellorCtrl_update(); } } diff --git a/symbol_addrs.us.v10.txt b/symbol_addrs.us.v10.txt index 4b3c5894..8cd2b31c 100644 --- a/symbol_addrs.us.v10.txt +++ b/symbol_addrs.us.v10.txt @@ -139,6 +139,7 @@ D_8037901C = 0x8037901C; D_8037DCB0 = 0x8037DCB0; print_sCurrentPtr = 0x80380AE4; print_sInFontFormatMode = 0x80380B08; +__propellorTimer = 0x803912CC; D_A00001D8 = 0xA00001D8; D_A0000238 = 0xA0000238;