The first commit

This commit is contained in:
Banjo Kazooie
2022-07-15 17:09:41 -05:00
commit dd13d34074
1087 changed files with 391897 additions and 0 deletions

87
src/GV/code_0.c Normal file
View File

@@ -0,0 +1,87 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
void chtoots_update(Actor *this);
/* .data */
ActorAnimationInfo D_80390BD0[] = {
{0x000, 0.0f},
{ASSET_162_ANIM_TOOTS_IDLE, 5.0f},
{ASSET_162_ANIM_TOOTS_IDLE, 2.5f},
{ASSET_164_ANIM_TOOTS_SING, 1.0f}
};
ActorInfo D_80390BF0 = { MARKER_1F4_TOOTS, ACTOR_1E4_TOOTS, ASSET_434_MODEL_TOOTS,
0x1, D_80390BD0,
chtoots_update, func_80326224, func_80325888,
2000, 0, 0.5f, 0
};
/*.bss */
s32 D_80391A30;
s32 D_80391A34;
/* .code */
void func_803863F0(Actor *this){
func_80328B8C(this, 1, 0.0001f, 1);
D_80391A30 = FALSE;
}
void func_80386420(Actor *this){
func_80328B8C(this, 2, 0.0001f, 1);
this->unk38_31 = 0x23;
}
void func_80386464(Actor *this){
func_80328B8C(this, 3, 0.0001f, 1);
}
void chtoots_update(Actor *this){
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
D_80391A30 = 0;
D_80391A34 = 0;
}
switch(this->state){
case 1://L80386500
if(D_80391A34){
func_80386464(this);
}
else if(D_80391A30 == TRUE){
func_80386420(this);
}
break;
case 2://L80386540
if(D_80391A34){
func_80386464(this);
}
else if(this->unk38_31 != 0){
this->unk38_31--;
if(this->unk38_31 == 6){
FUNC_8030E8B4(SFX_DD_JINJO_TALKING, 1.0f, 20000, this->position, 1500, 4500);
}
}
else{
func_803863F0(this);
}
break;
case 3://L803865C8
if(!D_80391A34)
func_803863F0(this);
break;
}//L803865DC
}
void func_803865E8(void){
D_80391A30 = TRUE;
}
void func_803865F8(void){
D_80391A34 = TRUE;
}
void func_80386608(void){
D_80391A34 = FALSE;
}

237
src/GV/code_1570.c Normal file
View File

@@ -0,0 +1,237 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
typedef struct {
u8 pad0[4];
Struct80s *unk4;
BKModelBin *unk8;
}ActorLocal_Gobi2;
void chgobi2_setState(Actor *this, s32 next_state);
void chgobi2_update(Actor *this);
Actor *chgobi2_draw(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
/* .data */
ActorInfo D_80390CB0 = { MARKER_BF_GOBI_2, ACTOR_131_GOBI_2, ASSET_3E0_MODEL_GOBI,
0x0, NULL,
NULL, chgobi2_update, chgobi2_draw,
0, 0x533, 0.0f, 0
};
f32 D_80390CD4[3] = {1475.0f, 442.0f, 8870.0f};
f32 chgobi2_jiggy_position[3] = {1150.0f, 1150.0f, 9200.0f}; //jiggy spawn position
f32 D_80390CEC[3] = {1145.0f, 443.0f, 9197.0f};
/* .bss */
extern u8 D_80391A50;
/* .code */
void func_80387960(void){
func_8028F490(D_80390CD4);
}
void func_80387984(ActorMarker *this){
mapSpecificFlags_set(0xC, 1);
}
void __chgobi2_spawnJIggy(void){
jiggySpawn(JIGGY_45_GV_GOBI_2, chgobi2_jiggy_position);
}
void func_803879D4(ActorMarker *this_marker){
Actor *this = marker_getActor(reinterpret_cast(ActorMarker *, this_marker));
chgobi2_setState(this, 4);
}
void func_80387A00(ActorMarker *this_marker){
Actor *this = marker_getActor(reinterpret_cast(ActorMarker *, this_marker));
chgobi2_setState(this, 7);
}
void func_80387A2C(ActorMarker *caller, enum asset_e text_id, s32 arg2){
timed_setCameraToNode(0.0f, 0xC);
timedFunc_set_1(0.5f, (TFQM1) func_80387984, reinterpret_cast(s32, caller));
timed_playSfx(0.5f, SFX_2C_PULLING_NOISE, 0.9f, 32000);
timed_playSfx(1.8f, SFX_2C_PULLING_NOISE, 1.0f, 32000);
timed_playSfx(2.5f, SFX_2C_PULLING_NOISE, 1.1f, 32000);
timed_setCameraToNode(3.0f, 0xd);
timedFunc_set_0(3.5f, __chgobi2_spawnJIggy);
func_80324E88(6.0f);
timedFunc_set_1(6.0f, (TFQM1) func_80387A00, reinterpret_cast(s32, caller));
func_80324E38(6.0f, 0);
}
void chgobi2_setState(Actor *this, s32 next_state){
ActorLocal_Gobi2 *local = (ActorLocal_Gobi2 *)&this->local;
if(next_state == 1)
actor_collisionOff(this);
if(this->state == 1)
actor_collisionOn(this);
if(next_state == 2){
this->marker->propPtr->unk8_3 = TRUE;
func_80335924(this->unk148, ASSET_F4_ANIM_GOBI_IDLE, 0.5f, 12.0f);
}
if(next_state == 3){
timedFunc_set_0(0.05f, func_80387960);
timed_playSfx(0.05f, SFX_84_GOBI_CRYING, 1.1f, 32000);
func_80324E38(0.051f, 1);
timedFunc_set_1(0.06f, (TFQM1)func_803879D4, reinterpret_cast(s32, this->marker));
timed_setCameraToNode(0.86f, 0xb);
timed_playSfx(0.8f, SFX_4B_GULPING, 0.8f, 28000);
timed_playSfx(1.4f, SFX_4B_GULPING, 0.8f, 28000);
timed_playSfx(2.0f, SFX_4B_GULPING, 0.8f, 28000);
func_80324DBC(3.0f, ASSET_A72_TEXT_TRUNKER_HELPED, 0x2A, D_80390CEC, this->marker, func_80387A2C, NULL);
}//L80387C94
if(next_state == 4){
func_80335924(this->unk148, ASSET_FC_ANIM_GOBI_SPITTING, 0.2f, 3.0f);
func_80335924(local->unk4, ASSET_100_ANIM_GOBI_SPIT, 0.0f, 3.0f);
}
if(next_state == 5){
func_80335924(this->unk148, ASSET_FD_ANIM_GOBI2_GETTING_UP, 0.43f, 0.5f);
func_80335A8C(this->unk148, 2);
}
if(next_state == 6){
func_80335924(this->unk148, ASSET_F8_ANIM_GOBI_RUNNING, 0.4f, 0.71f);
func_80335A8C(this->unk148, 1);
}
if(next_state == 7){
marker_despawn(this->marker);
}
if(next_state == 8){
FUNC_8030E8B4(SFX_84_GOBI_CRYING, 0.9f, 20000, this->position, 1500, 2500);
func_80335924(this->unk148, ASSET_242_ANIM_GOBI_RELAXING, 0.2f, 0.5f);
}
this->state = next_state;
}
Actor *chgobi2_draw(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
Actor *this = marker_getActor(this_marker);
ActorLocal_Gobi2 *local = (ActorLocal_Gobi2 *)&this->local;
f32 sp3C[3];
if(this->state == 0 || this->state == 1){
return this;
}
if(this->state == 6)
func_8033A280(2.0f);
sp3C[0] = this->pitch;
sp3C[1] = this->yaw;
sp3C[2] = this->roll;
func_8033A238(func_803356A0(this->unk148));
func_8033A2D4(func_803253A0, this);
func_803391A4(gfx, mtx, this->position, sp3C, 1.0f, NULL, func_80330B1C(this_marker));
if(this->state == 4){
func_8033A238(func_803356A0(local->unk4));
set_model_render_mode(2);
func_803391A4(gfx, mtx, this->position, sp3C, 1.0f, NULL, local->unk8);
}
return this;
}
void __chgobi2_80387EFC(Actor *this){
ActorLocal_Gobi2 *local = (ActorLocal_Gobi2 *)&this->local;
chgobi2_setState(this, 0);
func_80335874(local->unk4);
assetcache_release(local->unk8);
}
void __chgobi2_ow(ActorMarker *this_marker, ActorMarker *other_marker){
Actor *this = marker_getActor(this_marker);
enum hitbox_e hitbox;
hitbox = player_getActiveHitbox(NULL);
if(hitbox == HITBOX_1_BEAK_BUSTER)
D_80391A50 = TRUE;
else if(hitbox == HITBOX_A_FAST_FALLING){
this->unk1C[0] = 1.0f;
}
}
void chgobi2_update(Actor *this){
ActorMarker *sp34;
ActorLocal_Gobi2 *local = (ActorLocal_Gobi2 *)&this->local;
f32 sp2C;
sp34 = this->marker;
sp2C = time_getDelta();
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
marker_setCollisionScripts(this->marker, __chgobi2_ow, NULL, NULL);
sp34->unk30 = __chgobi2_80387EFC;
local->unk4 = func_803358B4();
local->unk8 = (BKModelBin*) assetcache_get(ASSET_3F3_MODEL_GOBI_SPIT);
D_80391A50 = 0;
this->unk1C[0] = 0.0f;
this->unk1C[1] = 0.0f;
chgobi2_setState(this, 1);
if(jiggyscore_isSpawned(JIGGY_45_GV_GOBI_2))
marker_despawn(this->marker);
return;
}//L80388060
if(this->state == 1){
if(jiggyscore_isCollected(JIGGY_44_GV_GOBI_1))
chgobi2_setState(this, 2);
}
if(this->state == 2){
if(this->unk1C[0] != 0.0f && this->unk1C[1] == 0){
chgobi2_setState(this, 8);
}
else if(D_80391A50){
chgobi2_setState(this, 3);
}
}//L80388114
if(this->state == 2){
if(!this->unk138_24){
if(func_80329530(this, 0xFA) && !func_80329530(this, 0x50)){
if(func_8028F2A0()){
if(func_80311480(ASSET_A75_TEXT_GOBI2_MEET, 0, this->position, NULL, NULL, NULL))
this->unk138_24 = TRUE;
}
}
}
}//L80388194
if(this->state == 4){
func_80335A94(local->unk4, sp2C, 1);
if(func_80335794(this->unk148) > 0){
chgobi2_setState(this, 5);
}
}
if(this->state == 5){
if(func_80335794(this->unk148) > 0){
chgobi2_setState(this, 6);
}
}
if(this->state == 6){
func_80326224(this);
}
if(this->state == 8){
if(func_80335794(this->unk148) > 0){
chgobi2_setState(this, 2);
}
}
D_80391A50 = FALSE;
this->unk1C[1] = this->unk1C[0];
this->unk1C[0] = 0.0f;
}

158
src/GV/code_1E80.c Normal file
View File

@@ -0,0 +1,158 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
void chgobi3_setState(Actor *this, s32 next_state);
void chgobi3_update(Actor *this);
Actor *chgobi3_draw(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
/* .data */
ActorInfo D_80390D00 = { MARKER_C3_GOBI_3, ACTOR_135_GOBI_3, ASSET_3E0_MODEL_GOBI,
0, NULL,
NULL, chgobi3_update, chgobi3_draw,
0, 0, 0.0f, 0
};
/* .code */
void func_80388270(Actor *this){
func_8028F428(2, this->marker);
}
void func_80388298(Actor *this){
s32 pad24;
f32 sp18[3];
TUPLE_ASSIGN(sp18, -6885.0f, 2383.0f, 1335.0f);
func_802C8F70(this->yaw);
func_802CA1CC(HONEYCOMB_C_GV_GOBI_3);
func_802C937C(0xd, sp18);
}
void func_803882F0(ActorMarker *caller, enum asset_e text_id, s32 arg2){
Actor *this = marker_getActor(caller);
chgobi3_setState(this, 4);
timed_playSfx(0.0f, SFX_2E_BIGBUTT_RUNNING, 1.0f, 20000);
timed_playSfx(0.0f, SFX_2E_BIGBUTT_RUNNING, 1.0f, 20000);
timed_playSfx(0.65f, SFX_2E_BIGBUTT_RUNNING, 1.0f, 20000);
timed_playSfx(0.65f, SFX_2E_BIGBUTT_RUNNING, 1.0f, 20000);
timed_playSfx(1.25f, SFX_2E_BIGBUTT_RUNNING, 1.0f, 15000);
timed_playSfx(1.25f, SFX_2E_BIGBUTT_RUNNING, 1.0f, 15000);
timed_playSfx(1.81f, SFX_2E_BIGBUTT_RUNNING, 1.0f, 10000);
timed_playSfx(1.81f, SFX_2E_BIGBUTT_RUNNING, 1.0f, 10000);
timed_playSfx(2.6f, SFX_2E_BIGBUTT_RUNNING, 1.0f, 5000);
timed_playSfx(2.6f, SFX_2E_BIGBUTT_RUNNING, 1.0f, 5000);
func_80324E88(3.0f);
func_80324E38(3.0f, 0);
}
void chgobi3_setState(Actor *this, s32 next_state){
if(next_state == 1)
actor_collisionOff(this);
if(this->state == 1)
actor_collisionOn(this);
if(next_state == 2){
this->marker->propPtr->unk8_3 = TRUE;
func_80335924(this->unk148, ASSET_F4_ANIM_GOBI_IDLE, 0.5f, 12.0f);
}
if(next_state == 3){
func_80324E38(0.0f, 3);
timedFunc_set_1(0.02f, (TFQM1)func_80388270, (s32)this);
timed_setCameraToNode(0.1f, 0x12);
timed_playSfx(0.2f, SFX_4C_LIP_SMACK, 1.0f, 32000);
timedFunc_set_1(0.2f, (TFQM1)func_80388298, (s32)this);
func_80335924(this->unk148, ASSET_FC_ANIM_GOBI_SPITTING, 0.2f, 1.0f);
}
if(next_state == 5){
func_80335924(this->unk148, 0xd9, 0.5f, 4.0f);
func_80311480(ASSET_A77_TEXT_GOBI3_DONE, 0xe, this->position, this->marker, func_803882F0, NULL);
}
if(next_state == 4){
this->marker->propPtr->unk8_3 = FALSE;
func_80335924(this->unk148, ASSET_F8_ANIM_GOBI_RUNNING, 0.3f, 0.71f);
}
if(next_state == 6){
marker_despawn(this->marker);
}
if(next_state == 7){
FUNC_8030E8B4(SFX_84_GOBI_CRYING, 0.9f, 20000, this->position, 1500, 2500);
func_80335924(this->unk148, ASSET_242_ANIM_GOBI_RELAXING, 0.2f, 0.5f);
}
this->state = next_state;
}
Actor *chgobi3_draw(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
Actor *this = marker_getActor(this_marker);
if(this->state == 0 || this->state == 1) return this;
return func_80325888(this_marker, gfx, mtx, vtx);
}
void chgobi3_ow(ActorMarker *this_marker, ActorMarker *other_marker){
Actor *this = marker_getActor(this_marker);
enum hitbox_e hitbox;
hitbox = player_getActiveHitbox(NULL);
if(hitbox == HITBOX_1_BEAK_BUSTER){
if(this->state == 2)
chgobi3_setState(this, 3);
}
else if(hitbox == HITBOX_A_FAST_FALLING){
this->unk1C[0] = 1.0f;
}
}
void chgobi3_update(Actor *this){
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
marker_setCollisionScripts(this->marker, chgobi3_ow, NULL, NULL);
this->unk1C[0] = 0.0f;
this->unk1C[1] = 0.0f;
chgobi3_setState(this, 1);
if(honeycombscore_get(HONEYCOMB_C_GV_GOBI_3))
marker_despawn(this->marker);
return;
}
if(this->state == 1){
if(jiggyscore_isSpawned(JIGGY_45_GV_GOBI_2))
chgobi3_setState(this, 2);
}
if(this->state == 2){
if(this->unk1C[0] != 0.0f && this->unk1C[1] == 0){
chgobi3_setState(this, 7);
}
}
if(this->state == 3){
if(func_80335794(this->unk148) > 0)
chgobi3_setState(this, 5);
}
if(this->state == 4){
func_80326224(this);
if(timedFuncQueue_is_empty())
chgobi3_setState(this, 6);
}
if(this->state == 7){
if(func_80335794(this->unk148) > 0)
chgobi3_setState(this, 2);
}
this->unk1C[1] = this->unk1C[0];
this->unk1C[0] = 0.0f;
}

267
src/GV/code_230.c Normal file
View File

@@ -0,0 +1,267 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
extern void func_80244BB0(s32, s32, s32, f32);
typedef struct {
f32 unk0[3];
u32 unk4_31:1;
u32 unk4_30:31;
f32 unk10[3];
f32 unk1C;
}ActorLocal_GV_230;
#define LOCAL_GV_230(s) ((ActorLocal_GV_230 *)&s->local)
void chancientone_update(Actor *this);
Actor *chancientone_draw(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
/* .data */
s16 D_80390C20[4] = {5, 6, 7, 8};
ActorMarker *D_80390C28[5] = {NULL};
ActorAnimationInfo D_80390C3C[] = {
{0, 0.0f},
{0, 0.0f},
{ASSET_ED_ANIM_ANCIENT_ONE, 2.0f},
{ASSET_ED_ANIM_ANCIENT_ONE, 33000000.f}
};
ActorInfo D_80390C5C = { MARKER_F4_ANCIENT_ONE, ACTOR_147_ANCIENT_ONE, ASSET_3E8_MODEL_ANCIENT_ONE,
0x1, D_80390C3C,
chancientone_update, func_80326224, chancientone_draw,
0, 0x100, 0.0f, 0
};
/* .code */
void func_80386620(Actor *this){
int i;
s32 *temp_v0;
ActorMarker *temp_a0;
s32 temp_a1;
Actor *temp_v0_3;
s32 phi_s2;
s32 phi_s1;
s32 phi_s3;
for(i = 0; i <5; i++){
if(D_80390C28[i] == NULL)
return;
}
D_80390C20[0] = 5;
D_80390C20[1] = 6;
D_80390C20[2] = 7;
D_80390C20[3] = 8;
phi_s3 = (randf() * 1.0737418e9f);
phi_s2 = 1;
phi_s1 = 0;
while(phi_s2 != 0x40000000){
if ((phi_s3 & phi_s2) != 0) {
temp_a1 = D_80390C20[phi_s1];
D_80390C20[phi_s1] = D_80390C20[phi_s1 + 1];
D_80390C20[phi_s1 + 1] = temp_a1;
temp_a0 = D_80390C28[phi_s1 + 1];
D_80390C28[phi_s1 + 1] = D_80390C28[phi_s1 + 2];
D_80390C28[phi_s1 + 2] = temp_a0;
temp_v0_3 = marker_getActor(D_80390C28[phi_s1 + 1]);
temp_v0_3->unkF4_8 = phi_s1 + 2;
temp_v0_3 = marker_getActor(D_80390C28[phi_s1 + 2]);
temp_v0_3->unkF4_8 = phi_s1 + 3;
}
phi_s1 = (phi_s1 == 2) ? 0 : phi_s1 + 1;
phi_s2 <<= 1;
};
}
void func_8038678C(void){
func_80244BB0(3, 0x85, 0x7ff8, 1.0f);
func_80244BB0(4, 0x85, 0x7ff8, 1.0f);
}
void func_803867CC(void){
func_80244C78(3);
func_80244C78(4);
}
void func_803867F4(void){
f32 sp24[3];
func_802BAFE4(4);
if(func_80304E24(0x148, sp24)){
jiggySpawn(JIGGY_46_GV_ANCIENT_ONES, sp24);
func_802C3F04((GenMethod_4)func_802C4140, 0x4C, reinterpret_cast(s32, sp24[0]), reinterpret_cast(s32, sp24[1]), reinterpret_cast(s32, sp24[2]));
}
}
void func_80386850(ActorMarker *caller_marker, enum asset_e text_id, s32 arg2){
Actor *caller = marker_getActor(caller_marker);
if(text_id == 0xA80){
func_80328B8C(caller, 2, 0.0f, 1);
actor_playAnimationOnce(caller);
func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 0x7fff);
timedFunc_set_0(1.0f, func_803867F4);
}
}
void chancientone_update(Actor *this){
f32 sp44[3];
s32 sp40;
s32 sp38;
s32 pad;
f32 sp34;
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
if(jiggyscore_isSpawned(JIGGY_46_GV_ANCIENT_ONES)){
marker_despawn(this->marker);
return;
}
}
if(!this->initialized){
if(D_80390C28[this->unkF4_8 - 1])
return;
LOCAL_GV_230(this)->unk1C = this->position_y;
this->position_y -= 1100.0f;
D_80390C28[this->unkF4_8 - 1] = this->marker;
if(this->unkF4_8 != 1){
this->marker->propPtr->unk8_4 = FALSE;
}
this->marker->propPtr->unk8_3 = TRUE;
actor_collisionOff(this);
func_80386620(this);
}
else{//L803869B4
switch(this->state){
case 1: //L803869E4
player_getPosition(sp44);
sp44[0] -= LOCAL_GV_230(this)->unk10[0];
sp44[1] -= LOCAL_GV_230(this)->unk10[1];
sp44[2] -= LOCAL_GV_230(this)->unk10[2];
sp40 = (0.0f <= sp44[0]*LOCAL_GV_230(this)->unk0[0] + sp44[1]*LOCAL_GV_230(this)->unk0[1] + sp44[2]*LOCAL_GV_230(this)->unk0[2]) ? 0 : 1;
if(LOCAL_GV_230(this)->unk1C <= this->position_y){
this->position_y = LOCAL_GV_230(this)->unk1C;
if( sp40 == (LOCAL_GV_230(this)->unk4_31 ^ 1)){
if((sp44[0]*sp44[0] + sp44[1]*sp44[1] + sp44[2]*sp44[2]) < (f32)LOCAL_GV_230(this)->unk4_30){
func_8025A6EC(COMUSIC_2B_DING_B, 28000);
for(sp38= 7; sp38< 0xC && mapSpecificFlags_get(sp38);sp38++);
mapSpecificFlags_set(sp38, TRUE);
if(sp38== 0xB){
if(!jiggyscore_isCollected(JIGGY_46_GV_ANCIENT_ONES)){
func_80311480(ASSET_A80_TEXT_ANICIENT_ONES_DONE, 0xE, NULL, this->marker, func_80386850, NULL);
}
else{
func_80386850(this->marker, 0xA80, -1);
}
}//L80386B98
else {
if(sp38== 7){
if(!jiggyscore_isCollected(JIGGY_46_GV_ANCIENT_ONES)){
func_80311480(ASSET_A7F_TEXT_ANICIENT_ONES_MEET, 0x4, NULL, NULL, NULL, NULL);
}
}
func_80328B8C(this, 2, 0.0f, 1);
actor_playAnimationOnce(this);
if(this->unkF4_8 < 5){
D_80390C28[this->unkF4_8]->propPtr->unk8_4 = TRUE;
func_802BAFE4(D_80390C20[this->unkF4_8 - 1]);
func_80244BB0(2, 0x86, 0x7ff8, 0.3f);
timedFunc_set_0(0.45f, func_8038678C);
}//L80386DB0
}
}
}
}
else{//L80386C64
sp38 = func_8023DB5C() & 0xF;
sp34 = LOCAL_GV_230(this)->unk1C + 40.0f;
this->position_y += 18.0;
this->position_x += (sp38 & 1) ? 0x17 : -0x17;
this->position_z += (sp38 & 2) ? 0xC : -0xC;
if(this->unkF4_8 != 1){
if(sp38 == 6){
func_802C3F04((GenMethod_4)func_802C4140, 0x4C, reinterpret_cast(s32, this->position_x), reinterpret_cast(s32, sp34), reinterpret_cast(s32, this->position_z));
}
if(sp38 == 4 && this->position_y < LOCAL_GV_230(this)->unk1C - 600.0f){
func_802C3F04((GenMethod_4)func_802C4140, 0x11f, reinterpret_cast(s32, this->position_x), reinterpret_cast(s32, sp34), reinterpret_cast(s32, this->position_z));
}//L80386D80
}
if(LOCAL_GV_230(this)->unk1C <= this->position_y){
func_80244C78(2);
timedFunc_set_0(0.5f, func_803867CC);
}
}//L80386DB0
LOCAL_GV_230(this)->unk4_31 = sp40;
break;
case 2: //L80386DCC
if(actor_animationIsAt(this, 0.999f)){
func_80328B8C(this, 3, 0.9999f, 1);
actor_playAnimationOnce(this);
}
break;
case 3: //L80386E04
if(LOCAL_GV_230(this)->unk1C - 1100.0f < this->position_y){
this->position_y -= 10.0;
}
else{
this->marker->propPtr->unk8_4 = FALSE;
}
break;
}//L80386E60
}//L80386E60
}
Actor *chancientone_draw(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
Actor *this = marker_getActor(this_marker);
int sp58;
s32 sp4C[3];
s32 sp40[3];
s32 sp34[3];
f32 sp28[3];
s32 tmp_v0;
sp58 = (this->state == 3) ? 0 : 1;
func_8033A45C(3, sp58);
func_8033A45C(4, sp58);
func_80325888(this_marker, gfx, mtx, vtx);
if( !this->initialized && this_marker->unk14_21){
func_8034A1B4(func_80329934(), 5, sp4C);
func_8034A1B4(func_80329934(), 6, sp40);
func_8034A1B4(func_80329934(), 7, sp34);
sp4C[1] += 1100;
sp40[1] += 1100;
sp34[1] += 1100;
LOCAL_GV_230(this)->unk0[0] = (sp4C[0] - sp40[0]);
LOCAL_GV_230(this)->unk0[1] = (sp4C[1] - sp40[1]);
LOCAL_GV_230(this)->unk0[2] = (sp4C[2] - sp40[2]);
player_getPosition(sp28);
sp28[0] -= sp40[0];
sp28[1] -= sp40[1];
sp28[2] -= sp40[2];
if(0.0f <= sp28[0] *LOCAL_GV_230(this)->unk0[0] + sp28[1]*LOCAL_GV_230(this)->unk0[1] + sp28[2]*LOCAL_GV_230(this)->unk0[2])
LOCAL_GV_230(this)->unk4_31 = FALSE;
else
LOCAL_GV_230(this)->unk4_31 = TRUE;
LOCAL_GV_230(this)->unk10[0] = (f32)sp40[0];
LOCAL_GV_230(this)->unk10[1] = (f32)sp40[1];
LOCAL_GV_230(this)->unk10[2] = (f32)sp40[2];
tmp_v0 = (sp34[1]- sp40[1]);
LOCAL_GV_230(this)->unk4_30 = (s32)(0.95*(f32)(tmp_v0*tmp_v0));
this->initialized = TRUE;
}
return this;
}
void func_80387118(void){
int i;
for(i = 0; i < 5; i++){
D_80390C28[i] = NULL;
}
}

76
src/GV/code_24D0.c Normal file
View File

@@ -0,0 +1,76 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
void chgobirope_update(Actor *this);
/* .data */
ActorInfo D_80390D30 = { MARKER_BD_GOBI_ROPE, ACTOR_12F_GOBI_ROPE, ASSET_3E3_MODEL_GOBI_ROPE,
0, NULL,
chgobirope_update, func_80326224, func_80325888,
0, 0x533, 0.0f, 0
};
/* .code */
void chgobirope_setState(Actor *this, s32 next_state){
this->state = next_state;
if(this->state == 1){
func_80335924(this->unk148, ASSET_DD_ANIM_GOBI_ROPE, 0.5f, 4.0f);
}
if(this->state == 2){
func_80335924(this->unk148, ASSET_DC_ANIM_GOBI_ROPE_PULLING, 1.0f, 5.0f);
}
if(this->state == 3){
func_80335924(this->unk148, 0xF5, 0.1f, 1.0f);
func_80335A8C(this->unk148, 2);
}
if(this->state == 4){
marker_despawn(this->marker);
}
}
void chgobirope_update(Actor *this){
Actor *sp2C;
f32 sp28;
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
this->marker->propPtr->unk8_3 = TRUE;
actor_collisionOff(this);
sp2C = func_80326D68(this->position, ACTOR_12E_GOBI_1, -1, &sp28);
if(sp2C){
this->position_x = sp2C->position_x;
this->position_y = sp2C->position_y;
this->position_z = sp2C->position_z;
}
chgobirope_setState(this, 1);
if( jiggyscore_isSpawned(JIGGY_44_GV_GOBI_1)
&& !func_803203FC(1)
){
marker_despawn(this->marker);
}
}
else{
if(this->state == 1 || this->state == 2){
if(this->state == 1 && func_80387354()){
chgobirope_setState(this, 2);
}
else{
if(func_80387360())
chgobirope_setState(this, 4);
}
}//L80388AB4
if(this->state == 2){
if(func_80335794(this->unk148) > 0)
chgobirope_setState(this, 1);
}
if(this->state == 3){
if(func_80335794(this->unk148) > 0)
chgobirope_setState(this, 4);
}
}
}

131
src/GV/code_2730.c Normal file
View File

@@ -0,0 +1,131 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
extern void func_802EF3A8(ParticleEmitter *, Gfx **, Mtx **, Vtx**);
typedef struct {
f32 unk0[3];
ParticleEmitter *unkC;
ParticleEmitter *unk10;
f32 unk14;
}ActorLocal_GV_2730;
void func_80388DC8(Actor *this);
Actor *func_80388C64(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
/* .data */
ActorInfo D_80390D60 = { 0xBE, 0x130, 0x3E4,
0, NULL,
func_80388DC8, func_80326224, func_80388C64,
0, 0x533, 0.0f, 0
};
f32 D_80390D84[3] = {5644.0f, 2930.0f, -3258.0f};
/*.bss */
u8 D_80391A60;
/* .code */
void func_80388B20(Actor *this, s32 next_state){
ActorLocal_GV_2730 *local = (ActorLocal_GV_2730 *)&this->local;
this->state = next_state;
local->unk14 = 0.0f;
D_80391A60 = FALSE;
if(this->state == 2){
this->marker->propPtr->unk8_3 = FALSE;
local->unk14 = 2.6f;
D_80391A60 = TRUE;
func_8028F428(2, this->marker);
FUNC_8030E624(SFX_9B_BOULDER_BREAKING_1, 0.3f, 9000);
FUNC_8030E624(SFX_9B_BOULDER_BREAKING_1, 0.5f, 9000);
FUNC_8030E624(SFX_9B_BOULDER_BREAKING_1, 0.7f, 9000);
FUNC_8030E624(SFX_9B_BOULDER_BREAKING_1, 0.9f, 9000);
func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 28000);
func_802F066C(local->unkC, local->unk0);
particleEmitter_emitN(local->unkC, 10);
func_802F053C(local->unk10, local->unk0);
particleEmitter_emitN(local->unk10, 10);
}
}
void func_80388C24(ActorMarker *this_marker, ActorMarker *other_marker){
Actor *this = marker_getActor(this_marker);
if(this->state == 1)
func_80388B20(this, 2);
}
Actor *func_80388C64(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
Actor *this = marker_getActor(this_marker);
ActorLocal_GV_2730 *local = (ActorLocal_GV_2730 *)&this->local;
f32 sp3C[3];
func_802EF3A8(local->unkC, gfx, mtx, vtx);
func_802EF3A8(local->unk10, gfx, mtx, vtx);
if(this->state == 0 || this->state == 2)
return this;
sp3C[0] = this->pitch;
sp3C[1] = this->yaw;
sp3C[2] = this->roll;
func_8033A2D4(func_803253A0, this);
func_8033A450(func_80329934());
func_803391A4(gfx, mtx, this->position, sp3C, 1.0f, NULL,func_80330B1C(this_marker));
func_8034A174(func_80329934(), 5, local->unk0);
return this;
}
s32 func_80388D78(void){
return D_80391A60;
}
void func_80388D84(Actor *this){
ActorLocal_GV_2730 *local = (ActorLocal_GV_2730 *)&this->local;
func_80388B20(this, 0);
func_802EF684(local->unkC);
func_802EF684(local->unk10);
}
void func_80388DC8(Actor *this){
ActorMarker *sp34 = this->marker;
ActorLocal_GV_2730 *local = (ActorLocal_GV_2730 *)&this->local;
f32 sp2C;
Actor *sp28;
f32 sp24 = time_getDelta();
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
sp34->unk30 = func_80388D84;
sp34->propPtr->unk8_3 = TRUE;
marker_setCollisionScripts(this->marker, NULL, NULL, func_80388C24);
local->unkC = particleEmitter_new(20);
local->unk10 = particleEmitter_new(30);
D_80391A60 = FALSE;
sp28 = func_80326D68(this->position, ACTOR_12E_GOBI_1, -1, &sp2C);
if(sp28){
this->position_x = sp28->position_x;
this->position_y = sp28->position_y;
this->position_z = sp28->position_z;
}
func_80388B20(this, 1);
if(jiggyscore_isSpawned(JIGGY_44_GV_GOBI_1) && !func_803203FC(1)){
marker_despawn(this->marker);
}
}
else{//L80388ED0
particleEmitter_update(local->unkC);
particleEmitter_update(local->unk10);
if(func_8025773C(&local->unk14, sp24)){
jiggySpawn(JIGGY_44_GV_GOBI_1, D_80390D84);
func_802BB3DC(0, 60.0f, 0.65f);
}
if(this->state == 2){
if(func_802EF648(local->unkC) && func_802EF648(local->unk10)){
marker_despawn(sp34);
}
}
}
}

91
src/GV/code_2B80.c Normal file
View File

@@ -0,0 +1,91 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
void func_80389144(Actor *this);
Actor *func_80389050(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
/* .data */
ActorInfo D_80390D90 = {
MARKER_C0_TRUNKER, ACTOR_132_TRUNKER, ASSET_3DF_MODEL_TRUNKER,
0, NULL,
func_80389144, NULL, func_80389050,
0, 0x599, 2.0f, 0
};
/* .code */
void func_80388F70(Actor *this, s32 next_state){
this->state = next_state;
if(this->state == 1){
func_80335924(this->unk148, ASSET_FE_ANIM_TRUCKER_SHORT, 0.1f, 2.5f);
}
if(this->state == 2){
func_80335924(this->unk148, ASSET_FF_ANIM_TRUCKER_GROW, 0.1f, 2.5f);
func_80335A8C(this->unk148, 2);
}
if(this->state == 3){
func_80335924(this->unk148, ASSET_FF_ANIM_TRUCKER_GROW, 0.0f, 2.5f);
func_80335A74(this->unk148, 0.999f);
func_80335A8C(this->unk148, 2);
}
}
Actor *func_80389050(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
Actor *this = marker_getActor(this_marker);
f32 sp38[3];
f32 sp2C[3];
if(this->state == 0) return this;
this = func_80325888(this_marker, gfx, mtx, vtx);
sp38[0] = this->position_x - 150.0f;
sp38[1] = this->position_y + 2.0f;
sp38[2] = this->position_z - 170.0f;
sp2C[0] = this->pitch;
sp2C[1] = this->yaw + 220.0f;
sp2C[2] = this->roll;
set_model_render_mode(2);
func_803391A4(gfx, mtx, sp38, sp2C, 1.0f, NULL, func_8030A428(3));
return this;
}
void func_80389144(Actor *this){
ActorMarker *marker = this->marker;
s32 sp28 = 0;
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
marker->propPtr->unk8_3 = TRUE;
actor_collisionOff(this);
mapSpecificFlags_set(0xC, FALSE);
if(jiggyscore_isSpawned(JIGGY_45_GV_GOBI_2) && !func_803203FC(1)){
func_80388F70(this, 3);
}
else{//L803891CC
func_80388F70(this, 1);
}
}//L803891D8
if( this->state == 1
&& !this->unk138_24
&& func_80329530(this, 250)
&& !func_80329530(this, 80)
&& func_8028F2A0()
){
func_80311480(ASSET_A71_TEXT_TRUNKER_MEET, 0xe, this->position, NULL, NULL, NULL);
this->unk138_24 = 1;
}//L80389254
if(this->state == 1 && mapSpecificFlags_get(0xC)){
sp28 = 2;
}
if(this->state == 2 && func_80335794(this->unk148) > 0){
sp28 = 3;
}
if(sp28)
func_80388F70(this, sp28);
}

50
src/GV/code_2EE0.c Normal file
View File

@@ -0,0 +1,50 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
void func_8038938C(Actor *this);
Actor *func_803892D0(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
/* .data */
extern ActorAnimationInfo D_80390DC0[]={
{0, 0.0f},
{ASSET_F1_ANIM_MAGIC_CARPET, 2.0f}
};
extern ActorInfo D_80390DD0 = { MARKER_AF_MAGIC_CARPET_SHADOW, ACTOR_122_MAGIC_CARPET_SHADOW, ASSET_3E7_MODEL_MAGIC_CARPET_SHADOW,
0x1, D_80390DC0,
func_8038938C, func_80326224, func_803892D0,
2500, 0, 0.0f, 0
};
/* .code */
Actor *func_803892D0(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
f32 rotation[3];
f32 position[3];
Actor *this;
this = func_80325300(this_marker, rotation);
if(this->unk1C[2] != 0.0f){
position[0] = this->position_x;
position[1] = this->position_y;
position[2] = this->position_z;
position[1] += 8.0f;
func_8033A2D4(func_803253A0, this);
func_803391A4(gfx, mtx, position, rotation, this->unk1C[0], NULL, func_80330B1C(this_marker));
}
return this;
}
void func_8038938C(Actor *this){
if(!this->initialized){
this->initialized = TRUE;
this->unk124_11 = 3;
this->unk1C[2] = 1.0f;
this->velocity[0] = 0.0f;
actor_collisionOff(this);
}
if(this->velocity[0] != 0.0f){
this->alpha_124_19 = this->velocity[1];
}
}

152
src/GV/code_30C0.c Normal file
View File

@@ -0,0 +1,152 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
extern void func_802EE6CC(f32[3], s32[4], s32[4], s32, f32, f32, s32, s32, s32);
void func_80389634(Actor *this);
void func_803898B8(Actor *this);
/* .data */
ActorAnimationInfo D_80390E00[] = {
{0x00, 0.0f},
{0xCD, 8000000.0f},
{0xCD, 2.5f},
{0xCD, 8000000.0f},
{0xCD, 1.6f},
{0xCD, 4.5f},
};
ActorInfo D_80390E30 = { 0xA8, 0x11A, 0x33D,
0x1, D_80390E00,
func_80389634, func_80326224, func_80325888,
2500, 0, 0.0f, 0
};
ActorInfo D_80390E54 = { 0x23B, 0x244, 0x33D,
0x1, D_80390E00,
func_803898B8, func_80326224, func_80325888,
0, 0, 0.0f, 0
};
s32 D_80390E78[4] = {0xff, 0xd0, 0x5d, 0xb4};
s32 D_80390E88[4] = {0, 0, 0, 0};
/* .code */
void func_803894B0(Actor *this){
this->marker->propPtr->unk8_3 = TRUE;
actor_collisionOff(this);
func_80328B8C(this, 1, 0.01f, 1);
this->unk38_31 = 0;
this->initialized = TRUE;
}
void func_80389518(Actor *this){
func_802EE6CC(this->unk1C, D_80390E88, D_80390E78, 0,
0.55f, 50.0f, 0xDC, 0x168, 0
);
}
int func_8038957C(Actor *this){
f32 f0;
f0 = this->yaw - func_80329784(this);
if(180.0f <= f0)
f0 -= 360;
else if(f0 < -180.0f)
f0 += 360;
if(f0 <= 0.0f && -180.0f <= f0){
return 1;
}
return 0;
}
void func_80389634(Actor *this){
int i;
switch(this->state){
case 1: //L80389680
if(!this->initialized){
func_803894B0(this);
}
if(func_80329530(this, 500) && func_8038957C(this)){
func_80328B8C(this, 2, 0.01f, 1);
FUNC_8030E8B4(SFX_6B_LOCKUP_OPENING, 1.0f, 32000, this->position, 1250, 2500);
FUNC_8030E8B4(SFX_3F6_UNKNOWN, 1.0f, 32000, this->position, 1250, 2500);
}
break;
case 2: //L8038970C
if( this->unk38_31 == 0
&& actor_animationIsAt(this, 0.1f)
&& !jiggyscore_isCollected(JIGGY_41_GV_MAZE)
){
func_8025A6EC(COMUSIC_3D_JIGGY_SPAWN, 0x7fff);
this->unk38_31 = 1;
}
if(actor_animationIsAt(this, 0.5f)){
func_80328B8C(this, 3, 0.5f, 1);
}
break;
case 3: //L80389788
if(!func_80329530(this, 0x2bc)){
func_80328B8C(this, 4, 0.5f, 1);
FUNC_8030E8B4(SFX_6B_LOCKUP_OPENING, 1.0f, 32000, this->position, 1250, 2500);
FUNC_8030E8B4(SFX_3F6_UNKNOWN, 1.0f, 32000, this->position, 1250, 2500);
}
break;
case 4: //L803897E4
if(actor_animationIsAt(this, 0.9f) && this->marker->unk14_21){
i = 6;
do{
func_8034A174((struct5Bs*)this->marker->unk44, i, this->unk1C);
func_80389518(this);
i++;
}while(i < 17);
}
if(actor_animationIsAt(this, 0.99f)){
func_80328B8C(this, 1, 0.01f, 1);
}
else if(actor_animationIsAt(this, 0.9f)){
FUNC_8030E8B4(SFX_7F_HEAVYDOOR_SLAM, 1.0f, 32000, this->position, 1250, 2500);
}
break;
}//L803898A8
}
void func_803898B8(Actor *this){
if(!this->initialized){
func_803894B0(this);
if(func_8031FF1C(BKPROG_A4_UNKOWN))
func_80328B8C(this, 3, 0.5f, 1);
this->unk1C[0] = 0.0f;
}
switch(this->state){
case 1://L80389934
if(this->unk1C[0] != 0.0f){
this->unk1C[0] -= 1.0f;
if(this->unk1C[0] == 0.0f){
func_80328B8C(this, 5, 0.01f, 1);
FUNC_8030E8B4(SFX_6B_LOCKUP_OPENING, 0.5f, 32000, this->position, 1250, 2500);
FUNC_8030E8B4(SFX_3F6_UNKNOWN, 0.5f, 32000, this->position, 1250, 2500);
}
}
else{//L803899C0
if(func_8031FF1C(BKPROG_A3_UNKOWN)){
this->unk1C[0] = 33.0f;
}
}
break;
case 5://L803899DC
if(actor_animationIsAt(this, 0.5f)){
func_80328B8C(this, 3, 0.5f, 1);
FUNC_8030E624(SFX_7F_HEAVYDOOR_SLAM, 1.0f, 25000);
}
break;
}//L80389A0C
}

117
src/GV/code_3630.c Normal file
View File

@@ -0,0 +1,117 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
void func_80389B1C(Actor *this);
/* .data */
ActorAnimationInfo D_80390EA0[] = {
{0x00, 0.0f},
{0xDF, 4.5f},
{0xE3, 2.0f},
{0xE4, 1.95f},
{0xCE, 2.4f},
{0xDF, 4.5f}
};
ActorInfo D_80390ED0 = { MARKER_A9_RUBEE, ACTOR_11B_RUBEE, ASSET_3DD_MODEL_RUBEE,
0x2, D_80390EA0,
func_80389B1C, func_80326224, func_80325888,
2500, 0, 1.6f, 0
};
/* .code */
void func_80389A20(ActorMarker *caller, enum asset_e text_id, s32 arg2){
Actor *this = marker_getActor(caller);
func_8038E18C();
func_80328B8C(this, 3, 0.0f, 1);
}
void func_80389A60(Actor *this){
func_80311480(ASSET_A70_TEXT_CHARMER_HELPED, 4, NULL, this->marker, func_80389A20, NULL);
this->unk138_24 = TRUE;
func_80328A84(this, 5);
}
void func_80389ABC(Actor *this){
if(this->unk138_23){
func_80389A20(this->marker, ASSET_A70_TEXT_CHARMER_HELPED, -1);
}
else{
this->unk138_23 = TRUE;
mapSpecificFlags_set(2, TRUE);
func_80389A60(this);
}
}
void func_80389B1C(Actor *this){
if(!this->unk16C_4){
this->unk60 = (f32) func_8038E184();
this->unk138_24 = jiggyscore_isCollected(JIGGY_43_GV_HISTUP) || mapSpecificFlags_get(0);
this->unk138_23 = jiggyscore_isCollected(JIGGY_43_GV_HISTUP) || mapSpecificFlags_get(2);
this->unk16C_4 = TRUE;
}
if(!this->initialized){
this->marker->propPtr->unk8_3 = TRUE;
actor_collisionOff(this);
this->initialized = TRUE;
}
animctrl_setTransitionDuration(this->animctrl, 0.15f);
if(this->state == 1 || this->state == 2){
if(! this->unk138_24 && func_80329530(this, 250) && !func_80329530(this, 0x50)){
func_80311480(ASSET_A6F_TEXT_CHARMER_MEET, 0xe, this->position, NULL, NULL, NULL);
this->unk138_24 = TRUE;
mapSpecificFlags_set(0, TRUE);
}
}
switch(this->state){
case 1://L80389CC4
if(this->unk60 <= (f32)func_8038E178()){
func_80389ABC(this);
}
else if(actor_animationIsAt(this, 0.99f)){
func_80328B38(this, 2, 0.9f);
}
if( actor_animationIsAt(this, 0.42f)
|| actor_animationIsAt(this, 0.46f)
|| actor_animationIsAt(this, 0.51f)
|| actor_animationIsAt(this, 0.57f)
){
FUNC_8030E8B4(SFX_8_BANJO_LANDING_04, 3.802f, 8000, this->position, 1500, 4500);
}
if( actor_animationIsAt(this, 0.4f)){
func_803865E8();
}
break;
case 2: //L80389DB0
if(this->unk60 <= (f32)func_8038E178()){
func_80389ABC(this);
}
else if(actor_animationIsAt(this, 0.99f)){
func_80328B38(this, 1, 0.4f);
}
break;
case 3: //L80389E14
if( actor_animationIsAt(this, 0.2f)){
func_8025A58C(500, 400);
func_8025A6EC(COMUSIC_27_GV_RUBEES_SONG, 28000);
}
if( actor_animationIsAt(this, 0.99f)){
func_80328A84(this, 4);
}
break;
case 4: //L80389E64
if(!func_8038E178())
func_80328A84(this, 2);
break;
}//L80389E80
}

25
src/GV/code_3AA0.c Normal file
View File

@@ -0,0 +1,25 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
void func_80389E90(Actor *this);
void func_80389EA8(Actor *this);
/* .data */
ActorInfo D_80390F00 = { MARKER_AB_RUBEES_EGG_POT, ACTOR_11D_RUBEES_EGG_POT, ASSET_3E1_MODEL_RUBEES_EGG_POT,
0x1, NULL,
func_80389E90, func_80389EA8, func_80325888,
2500, 0, 0.9f, 0
};
/* .code */
void func_80389E90(Actor *this){
this->marker->propPtr->unk8_3 = FALSE;
}
void func_80389EA8(Actor *this){
this->marker->propPtr->unk8_3 = FALSE;
this->unk4C = 100 + 40*func_8038E178();
func_80343DEC(this);
}

28
src/GV/code_3B10.c Normal file
View File

@@ -0,0 +1,28 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
extern void func_8028F710(s32, f32);
/* .data */
u8 D_80390F30[] = {
0x00, 0x27, 0x45, 0x30,
0xAA, 0x18, 0xBB, 0xF3,
0x00, 0x03, 0x03, 0x1C,
0x00, 0x00, 0x00, 0x00
};
/* .code */
void func_80389F00(void){
if(getGameMode() != GAME_MODE_7_ATTRACT_DEMO && 2.0f < func_8028E80C(3)){
func_8028F710(3, 2.0f);
}
}
void func_80389F5C(void){
u32 sp1C;
osPiReadIo(0x800, &sp1C);
sp1C <<= 0x10;
if(sp1C != 0x10000)
func_80389F00();
}

63
src/GV/code_3BB0.c Normal file
View File

@@ -0,0 +1,63 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
extern int func_8024DB50(f32[3], f32);
void func_8038A084(Actor *this);
/* .data */
ActorInfo D_80390F40 = { 0x24F, 0x37C, 0x0,
0, NULL,
func_8038A084, func_80326224, func_80325340,
2000, 0, 0.0f, 0
};
struct40s D_80390F64 = {
{ {2.5f, 2.8f},
{4.0f, 5.0f},
{0.0f, 0.01f},
{2.0f, 2.5f},
0.1f, 0.4f
},
4.0f,
1.0f
};
s32 D_80390F94[3] = {0xFF, 0xFF, 0x9B};
/* .code */
void func_80389FA0(f32 position[3]){
ParticleEmitter *pCtrl = partEmitList_pushNew(1);
particleEmitter_setSprite(pCtrl, ASSET_70D_SPRITE_SMOKE_1);
particleEmitter_setStartingFrameRange(pCtrl, 1, 6);
func_802EFFA8(pCtrl, D_80390F94);
func_802EF9E4(pCtrl, 100);
particleEmitter_setPosition(pCtrl, position);
particleEmitter_setParticleSpawnPositionRange( pCtrl,
-700.0f, 0.0f, -700.0f,
700.0f, 0.0f, 700.0f
);
particleEmitter_setParticleVelocityRange(pCtrl,
0.0f, 40.0f, 0.0f,
0.0f, 90.0f, 0.0f
);
func_802EFC28(pCtrl, &D_80390F64);
}
void func_8038A084(Actor *this){
if(this->unkF4_8 == 6 && !this->unk16C_4){
this->unk16C_4 = TRUE;
if( jiggyscore_isCollected(JIGGY_42_GV_WATER_PYRAMID) && this->yaw == 1.0f){
this->unk38_31 = TRUE;
}
}
if(this->unkF4_8 == 6
&& func_8024DB50(this->position, 50.0f)
&& !this->unk38_31
&& randf() < 0.2
){
func_80389FA0(this->position);
}
}

158
src/GV/code_3D90.c Normal file
View File

@@ -0,0 +1,158 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
extern f32 func_80309724(f32[3]);
void func_80329904(ActorMarker *, s32, void *);
void func_8038A314(Actor *this);
void func_8038A31C(Actor *this);
Actor *func_8038A180(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
/* .data */
ActorAnimationInfo D_80390FA0[] = {
{0, 0.0f},
{0xC9, 2.0f},
{0xC9, 2.0f},
{0xC9, 2.0f},
{0xC9, 2.0f},
{0xC9, 2.0f},
};
ActorInfo D_80390FD0 = { MARKER_B0_MAGIC_CARPET_2, ACTOR_123_MAGIC_CARPET_2, ASSET_3DC_MODEL_MAGIC_CARPET,
0x1, D_80390FA0,
func_8038A314, func_8038A31C, func_8038A180,
0, 0, 0.0f, 0
};
u8 D_80390FF4[6] = {0,0,0,1,1,1};
/* .code */
Actor *func_8038A180(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
Actor * this = marker_getActor(this_marker);
if(this->unk1C[0] != 0.0f){
this = func_80325888(this_marker, gfx, mtx, vtx);
if( this->unk54 == 0.0f
&& this->unk48 != this->unk1C[1]
&& this_marker->unk14_21
&& func_80329530(this, 0xbb8)
){
func_8033E73C(this->marker, 6, func_80329904);
func_8033E3F0(0xc, this->marker->unk14_21);
}
}
return this;
}
f32 func_8038A264(Actor *shadow, Actor* this){
if(this && shadow){
return ml_map_f(this->position_y - shadow->position_y, 0.0f, 2200.0f, 1.0f, 0.35f);
}
else{
return 0.0;
}
}
void func_8038A2C0(void *this_marker){
Actor *this = marker_getActor(reinterpret_cast(ActorMarker *, this_marker));
Actor *shadow = spawn_child_actor(ACTOR_122_MAGIC_CARPET_SHADOW, &this);
s32 pad;
func_8032AA58(shadow, this->scale);
this->unk100 = shadow->marker;
}
void func_8038A314(Actor *this){}
void func_8038A31C(Actor *this){
Actor *sp24;
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
actor_collisionOff(this);
func_802C3C88((GenMethod_1)func_8038A2C0, reinterpret_cast(s32, this->marker));
this->velocity[0] = 0.0f;
}
if(this->unk100)
sp24 = func_80329980(this);
this->unk1C[1] = this->unk48;
;
switch(func_8038F4C0(this, 3))
{
case 1: //L8038A3C0
func_80343DEC(this);
this->marker->propPtr->unk8_3 = TRUE;
this->unk1C[0] = 1.0;
this->alpha_124_19 = 0xff;
if(this->unk54 != 0.0f){
func_80328B8C(this, 2, 0.02f, 1);
animctrl_setPlaybackType(this->animctrl, ANIMCTRL_STOPPED);
}
break;
case 2: //L8038A440
this->marker->propPtr->unk8_3 = TRUE;
this->unk1C[0] = 1.0;
if(45.0f <= this->velocity[0]){
func_80328B8C(this, 3, 0.02f, 1);
this->velocity[0] = 0.0f;
}
else{
if(D_80390FF4[((s32)this->velocity[0])%6] == 0){
this->alpha_124_19 -= 0x55;
}
else{
this->alpha_124_19 += 0x55;
}
this->velocity[0] += 1.0f;
}
break;
case 3: //L8038A534
func_80343DEC(this);
this->marker->propPtr->unk8_3 = FALSE;
this->unk1C[0] = 0.0;
this->alpha_124_19 = 0;
if(this->unk54 == 0.0f){
func_80328B8C(this, 4, 0.02f, 1);
}
break;
case 4: //L8038A5A4
this->marker->propPtr->unk8_3 = TRUE;
this->unk1C[0] = 1.0;
if(45.0f <= this->velocity[0]){
func_80328B8C(this, 1, 0.02f, 1);
animctrl_setPlaybackType(this->animctrl, ANIMCTRL_LOOP);
this->velocity[0] = 0.0f;
}
else{
if(D_80390FF4[5 - ((s32)this->velocity[0])%6 ] != 0){
this->alpha_124_19 += 0x55;
}
else{
this->alpha_124_19 -= 0x55;
}
this->velocity[0] += 1.0f;
}
break;
}//L8038A6A4
this->unk124_11 = 0x3;
this->pitch = 0.0f;
if(this->unk100 && sp24 && this->unk100->unk14_20 == MARKER_AF_MAGIC_CARPET_SHADOW){
sp24->position_x = this->position_x;
sp24->position_y = func_80309724(this->position) + 60.0f;
sp24->position_z = this->position_z;
sp24->unk1C[0] = func_8038A264(sp24, this);
sp24->yaw = this->yaw;
sp24->velocity[0] = 1.0;
sp24->velocity[1] = this->alpha_124_19;
if (0.0f != this->unk1C[0])
sp24->unk1C[2] = 1.0;
else
sp24->unk1C[2] = 0.0f;
}//L8038A780
}

110
src/GV/code_43B0.c Normal file
View File

@@ -0,0 +1,110 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
extern f32 func_80309724(f32[3]);
void func_80329904(ActorMarker *, s32, void *);
void func_8038A948(Actor *this);
void func_8038A9C0(Actor *this);
Actor *func_8038A7A0(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
/* .data */
ActorAnimationInfo D_80391000[] = {
{0, 0.0f},
{0xC9, 2.0f}
};
ActorInfo D_80391010 = { MARKER_A7_MAGIC_CARPET_1, ACTOR_119_MAGIC_CARPET_1, ASSET_3DC_MODEL_MAGIC_CARPET,
0x1, D_80391000,
func_8038A948, func_8038A9C0, func_8038A7A0,
2500, 0, 0.0f, 0
};
/* .code */
Actor *func_8038A7A0(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
Actor * this;
this = func_80325888(this_marker, gfx, mtx, vtx);
if( this->velocity_y != 0.0f
&& this_marker->unk14_21
&& this->unk48 != this->unk1C[2]
){
func_8033E73C(this->marker, 5, func_80329904);
func_8033E3F0(0xa, this->marker->unk14_21);
this->unk38_31++;
}
return this;
}
f32 func_8038A860(Actor *shadow, Actor* this){
f32 out = 0.0f;
if(this && shadow){
out = this->scale * ml_map_f(this->position_y - shadow->position_y, 0.0f, 2200.0f, 1.2f, 0.35f);
}
return out;
}
void func_8038A8CC(ActorMarker *this_marker){
Actor *this = marker_getActor(reinterpret_cast(ActorMarker *, this_marker));
Actor *shadow = spawn_child_actor(ACTOR_122_MAGIC_CARPET_SHADOW, &this);
s32 pad;
this->unk100 = shadow->marker;
shadow->position_y = func_80309724(this->position);
shadow->unk1C[0] = func_8038A860(shadow, this);
shadow->yaw = this->yaw;
func_8032AA58(shadow, this->scale);
}
void func_8038A948(Actor *this){
if(!this->initialized){
this->initialized = TRUE;
this->marker->propPtr->unk8_3 = TRUE;
actor_collisionOff(this);
func_802C3C88((GenMethod_1)func_8038A8CC, (s32)this->marker);
this->velocity_y = 0.0f;
}
}
void func_8038A9C0(Actor *this){
Actor * sp24;
if(!this->initialized){
this->initialized = TRUE;
this->velocity_y = 0.0f;
}
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
this->marker->propPtr->unk8_3 = TRUE;
actor_collisionOff(this);
func_802C3C88((GenMethod_1)func_8038A8CC, (s32)this->marker);
sp24 = func_80329980(this);
this->unk1C[1] = this->unk48;
this->pitch = 0.0f;
this->yaw = 90.0f;
}
if(this->unk100)
sp24 = func_80329980(this);
if(this->velocity_y != 0.0f){
func_80343DEC(this);
if(this->unk48 < this->unk1C[1]){
this->velocity_y = 0.0f;
}
this->unk1C[2] = this->unk1C[1];
this->unk1C[1] = this->unk48;
if(this->unk100 && sp24 && this->unk100->unk14_20 == MARKER_AF_MAGIC_CARPET_SHADOW){
sp24->unk1C[0] = func_8038A860(sp24, this);
}
}
this->pitch = 0.0f;
this->yaw = 90.0f;
}

325
src/GV/code_4740.c Normal file
View File

@@ -0,0 +1,325 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
f32 func_80257204(f32, f32, f32, f32);
void func_8038B124(Actor *this);
/* .data */
ActorAnimationInfo D_80391040[] ={
{0x00, 0.0f},
{0xE9, 800000.0f},
{0xE9, 0.8f},
{0xEA, 1.0f},
{0xEA, 2.0f},
{0xEB, 0.8f},
{0xEB, 800000.0f},
{0xEC, 1.2f},
{0xEF, 1.4f},
{0xEE, 1.4f},
{0xEE, 1.4f}
};
ActorInfo D_80391098 = { MARKER_AD_SLAPPA, ACTOR_120_SLAPPA, ASSET_376_MODEL_SLAPPA,
0x1, D_80391040,
func_8038B124, func_80326224, func_80325888,
0, 0, 0.0f, 0
};
s32 D_803910BC[3] = {175, 100, 0};
s32 D_803910C8[3] = {175, 140, 0};
struct43s D_803910D4 = {
{{-120.0f, 550.0f, -120.0f}, {120.0f, 950.0f, 120.0f}},
{{0.0f, -1400.0f, 0.0f}, {0.0f, -1400.0f, 0.0f}},
{{-100.0f, 0.0f, -100.0f}, {100.0f, 30.0f, 100.0f}}
};
/* .bss */
f32 D_80391A70[3];
/* .code */
void func_8038AB30(ParticleEmitter *pCtrl, f32 position[3], s32 cnt){
if(map_get() != MAP_1A_GV_INSIDE_JINXY)
func_802EFFA8(pCtrl, D_803910BC);
else
func_802EFFA8(pCtrl, D_803910C8);
func_802EF9E4(pCtrl, 0xBE);
particleEmitter_setSprite(pCtrl, ASSET_700_SPRITE_DUST);
func_802EFA5C(pCtrl, 0.0f, 0.01f);
particleEmitter_setStartingFrameRange(pCtrl, 0, 7);
particleEmitter_setPosition(pCtrl, position);
}
void func_8038ABD8(f32 position[3], s32 cnt){
ParticleEmitter *pCtrl = partEmitList_pushNew(cnt);
func_8038AB30(pCtrl, position, cnt);
particleEmitter_setParticleSpawnPositionRange(pCtrl,
-40.0f, -5.0f, -40.0f,
60.0f, 20.0f, 60.0f
);
particleEmitter_setParticleVelocityRange(pCtrl,
-100.0f, 10.0f, -100.0f,
100.0f, 60.0f, 100.0f
);
func_802EFB70(pCtrl, 0.1f, 0.5f);
func_802EFB84(pCtrl, 1.2f, 2.6f);
particleEmitter_setSpawnIntervalRange(pCtrl, 0.0f, 0.01f);
func_802EFEC0(pCtrl, 0.5f, 1.4f);
particleEmitter_emitN(pCtrl, cnt);
}
void func_8038ACEC(f32 pos[3], s32 cnt){
ParticleEmitter *pCtrl = partEmitList_pushNew(cnt);
func_8038AB30(pCtrl, pos, cnt);
particleEmitter_setParticleSpawnPositionRange(pCtrl,
-80.0f, 20.0f, -80.0f,
120.0f, 120.0f, 120.0f
);
particleEmitter_setParticleVelocityRange(pCtrl,
-200.0f, 20.0f, -200.0f,
300.0f, 120.0f, 200.0f
);
func_802EFB70(pCtrl, 1.0f, 2.6f);
func_802EFB84(pCtrl, 3.0f, 5.5f);
particleEmitter_setSpawnIntervalRange(pCtrl, 0.0f, 0.01f);
func_802EFEC0(pCtrl, 1.2f, 3.2f);
particleEmitter_emitN(pCtrl, cnt);
}
void func_8038ADFC(f32 pos[3], s32 cnt){
ParticleEmitter *pCtrl = partEmitList_pushNew(cnt);
particleEmitter_setModel(pCtrl, 0x389);
particleEmitter_setPosition(pCtrl, pos);
particleEmitter_setPositionVelocityAndAccelerationRanges(pCtrl, &D_803910D4);
func_802EFE24(pCtrl, -500.0f, -500.0f, -500.0f, 500.0f, 500.0f, 500.0f);
func_802EF9F8(pCtrl, 0.6f);
func_802EFA18(pCtrl, 2);
func_802EFB70(pCtrl, 1.0f, 1.0f);
func_802EFA70(pCtrl, 2);
particleEmitter_setSpawnIntervalRange(pCtrl, 0.0f, 0.01f);
func_802EFEC0(pCtrl, 4.0f, 6.0f);
func_802EFA5C(pCtrl, 0.0f, 0.05f);
particleEmitter_emitN(pCtrl, cnt);
}
void func_8038AF10(Actor *this){
animctrl_setSmoothTransition(this->animctrl, TRUE);
func_80328B8C(this, 3, 0.00001f, 1);
actor_loopAnimation(this);
this->unk28 = 16.0f;
this->unk1C[0] = 1.0f;
}
int func_8038AF78(Actor *this, f32 arg1, f32 arg2){
this->unk28 = arg2;
this->yaw_moving = (f32)func_80329784(this);
func_80328FB0(this, arg1);
if(!func_80329030(this, 0) && func_80329480(this))
return 0;
return 1;
}
void func_8038AFF4(ActorMarker *this_marker, ActorMarker *other_marker){
Actor *this = marker_getActor(this_marker);
func_8032B4DC(this, other_marker, 0xC);
actor_collisionOff(this);
func_80328B8C(this, ASSET_9_ANIM_BANJO_DIE, 0.00001f, 1);
actor_playAnimationOnce(this);
this->unk1C[0] = 0.0f;
func_8030E878(SFX_D7_GRABBA_DEATH, 1.0f, 32000, this->position, 2250.0f, 4500.0f);
}
void func_8038B08C(ActorMarker *this_marker, ActorMarker *other_marker){
Actor *this = marker_getActor(this_marker);
func_8032B4DC(this, other_marker, 0xC);
}
void func_8038B0BC(ActorMarker *this_marker, ActorMarker *other_marker){
Actor *this = marker_getActor(this_marker);
func_8030E878(SFX_3F5_UNKNOWN, randf2(0.95f, 1.05f), 32000, this->position, 2250.0f, 4500.0f);
}
void func_8038B124(Actor *this){
if(!this->initialized){
this->initialized = TRUE;
this->unk38_31 = 0;
this->unk1C[0] = 0.0f;
this->unk1C[2] = 240.0f;
this->velocity_x = this->position_x;
this->velocity_y = this->position_y;
this->velocity_z = this->position_z;
}
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
if(this->state == 0xa)
marker_despawn(this->marker);
marker_setCollisionScripts(this->marker, func_8038B0BC, func_8038B08C, func_8038AFF4);
this->marker->propPtr->unk8_3 = TRUE;
actor_collisionOn(this);
this->unk138_27 = 1;
this->unk1C[1] = 0.0f;
if(this->unk44_31 == 0){
this->unk44_31 = func_8030D90C();
sfxsource_setSfxId(this->unk44_31, SFX_3EC_CCW_DOOR_OPENING);
func_8030DD14(this->unk44_31, 2);
func_8030DBB4(this->unk44_31, 0.1f);
sfxsource_setSampleRate(this->unk44_31, 32000);
}
}//L8038B25C
if(!actor_playerIsWithinDist(this, 4500)) return;
this->unk58_0 = TRUE;
switch(this->state){
case 1: //L8038B2A4
this->unk58_0 = FALSE;
if(0.0 < this->unk1C[1]){
this->unk1C[1] = MAX((f64)(this->unk1C[1] - time_getDelta()), 0.0);
}//L8038B33C
if( this->unk1C[1] == 0.0
&& func_80329530(this, 0x320)
&& func_803292E0(this)
){
animctrl_setSmoothTransition(this->animctrl, 0);
func_80328B8C(this, 2, 0.00001f, 1);
actor_playAnimationOnce(this);
this->yaw = (f32)func_80329784(this);
this->unk28 = 0.0f;
this->unk1C[0] = 1.0f;
func_802BB3DC(0, 14.0f, 0.92f);
func_8038ABD8(this->position, 8);
}
else{//L8038B3E0
this->yaw_moving = func_80257204(this->position_x, this->position_z, this->velocity_x, this->velocity_z);
func_80328FB0(this, 18.0f);
this->unk28 = 18.0f;
func_80329030(this, 0);
animctrl_setAnimTimer(this->animctrl, 0.0f);
}
break;
case 2: //L8038B430
func_8030E2C4(this->unk44_31);
if(0.98 < animctrl_getAnimTimer(this->animctrl)){
func_8038AF10(this);
}
else{
this->yaw_moving = func_80329784(this);
func_80328FB0(this, 8.0f);
}
break;
case 3: //L8038B494
func_8030E2C4(this->unk44_31);
if(func_80329530(this, 175)){
func_80328B8C(this, 4, 0.00001f, 1);
actor_loopAnimation(this);
this->unk1C[0] = 1.0f;
}
else if(!func_80329530(this, 1100) || !func_8038AF78(this, 8.0f, 16.0f)){
func_80328B8C(this, 8, 0.00001f, 1);
actor_playAnimationOnce(this);
this->unk1C[0] = 1.0f;
func_802BB3DC(0, 6.0f, 0.92f);
func_8038ABD8(this->position, 8);
}
else{
D_80391A70[0] = 2*this->unk28;
D_80391A70[1] = 0.0f;
D_80391A70[2] = 0.0f;
ml_vec3f_yaw_rotate_copy(D_80391A70, D_80391A70, this->yaw - 90.0);
D_80391A70[0] = D_80391A70[0] + this->position[0];
D_80391A70[1] = D_80391A70[1] + this->position[1];
D_80391A70[2] = D_80391A70[2] + this->position[2];
func_8038ABD8(D_80391A70, 1);
}
break;
case 4: //L8038B5F0
this->yaw_moving = func_80329784(this);
func_80328FB0(this, 8.0f);
if(this->unk38_31 >= 20){
func_80328B8C(this, 5, 0.00001f, 1);
actor_playAnimationOnce(this);
this->unk38_31 = 0;
this->unk1C[0] = 1.0f;
}
else{//L8038B660
this->unk38_31++;
}
break;
case 5: //L8038B67C
if(this->marker->unk14_21 && actor_animationIsAt(this, 0.79f)){
func_8034A174(this->marker->unk44, 5, D_80391A70);
func_8038ACEC(D_80391A70, 2);
func_8034A174(this->marker->unk44, 6, D_80391A70);
func_8038ACEC(D_80391A70, 3);
func_802BB3DC(0, 18.0f, 0.92f);
func_8030E878(SFX_3_DULL_CANNON_SHOT, 1.0f, 32000, this->position, 2250.0f, 4500.0f);
}//L8038B734
if(0.98 < animctrl_getAnimTimer(this->animctrl)){
func_80328B8C(this, 6, 0.99f, 0);
actor_playAnimationOnce(this);
this->unk60 = 0.0f;
this->unk1C[0] = 1.0f;
}
break;
case 6: //L8038B78C
if(75.0f <= this->unk60){
func_80328B8C(this, 7, 0.00001f, 1);
actor_playAnimationOnce(this);
this->unk1C[0] = 1.0f;
}
else{
this->unk60 += 1.0f;
}
break;
case 7: //L8038B7EC
if(0.98 < animctrl_getAnimTimer(this->animctrl)){
func_8038AF10(this);
}
break;
case 8: //L8038B820
if(0.98 < animctrl_getAnimTimer(this->animctrl)){
func_80328B8C(this, 1, 0.00001f, 1);
this->unk1C[0] = 0.0f;
this->unk1C[1] = 2.0f;
}
break;
case 9: //L8038B870
func_80328A84(this, 0xA);
func_8038ACEC(this->position, 2);
func_8034A174(this->marker->unk44, 5, D_80391A70);
func_8038ACEC(D_80391A70, 2);
func_8038ADFC(D_80391A70, 3);
func_8034A174(this->marker->unk44, 6, D_80391A70);
func_8038ACEC(D_80391A70, 3);
func_8038ADFC(D_80391A70, 2);
break;
case 10: //L8038B900
this->unk58_0 = FALSE;
if(0.0f != this->unk1C[2]){
this->unk1C[2] -= 1.0f;
}
else{
marker_despawn(this->marker);
}
break;
}
}

323
src/GV/code_5570.c Normal file
View File

@@ -0,0 +1,323 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
extern void func_8025AE50(s32, f32);
extern void func_8028F710(s32, f32);
typedef struct {
s32 unk0;
}ActorLocal_Grabba;
void func_8038BEA0(Actor *this);
/* .data */
ActorAnimationInfo D_80391120[] ={
{0x00, 0.0f},
{ASSET_C5_ANIM_GRABBA_APPEAR, 8000000.0f},
{ASSET_C5_ANIM_GRABBA_APPEAR, 1.6f},
{ASSET_C7_ANIM_GRABBA_IDLE, 1.8f},
{ASSET_C6_ANIM_GRABBA_HIDE, 0.55f},
{ASSET_C8_ANIM_GRABBA_DEFEATED, 0.8f},
{ASSET_C7_ANIM_GRABBA_IDLE, 1.8f}
};
ActorInfo D_80391158 = { MARKER_A6_GRABBA, ACTOR_118_GRABBA, ASSET_371_MODEL_GRABBA,
0x1, D_80391120,
func_8038BEA0, func_80326224, func_80325888,
0, 0, 0.0f, 0
};
s32 D_8039117C[3] = {160, 100, 0};
/* .bss */
extern s32 D_80391A80;
/* .code */
void func_8038B960(void){
func_8025AE50(5000, 3.19f);
}
/* .bss */
extern s32 D_80391A80;
/* .code */
void func_8038B988(ActorMarker *caller, enum asset_e text_id, s32 arg2){
Actor *this = marker_getActor(caller);
func_80328B8C(this, 5, 0.01f, 1);
actor_loopAnimation(this);
func_802BAFE4(0x13);
FUNC_8030E624(SFX_8D_BOGGY_OHWW, 0.9f, 32000);
timedFunc_set_0(2.5f, func_8038B960);
D_80391A80 = this->state;
}
void func_8038BA08(Actor *this){
func_80328B8C(this, 6, 0.01f, 1);
actor_loopAnimation(this);
this->unk100 = NULL;
D_80391A80 = 3;
if(func_8028ECAC() == BSGROUP_6_TURBO_TALON_TRAINERS)
func_8028F710(3, 0.0f);
func_80311480(ASSET_A79_TEXT_GRABBA_DEFEAT, 0xf, this->position, this->marker, func_8038B988, NULL);
comusic_8025AB44(COMUSIC_57_TURBO_TRAINERS, 7000, 700);
}
s32 func_8038BAA4(Actor *jiggy){
s32 tmp_v0;
s32 sp18[3];
map_get();
sp18[0] = (s32)jiggy->position_x;
sp18[1] = (s32)jiggy->position_y;
sp18[2] = (s32)jiggy->position_z;
tmp_v0 = func_80307164(sp18, jiggy);
if( tmp_v0 < 0)
return 0;
else
return func_80306DBC(tmp_v0) + 1;
}
int func_8038BB24(Actor *this){
if(func_80329530(this, 1560) && !func_80329530(this, 1380)){
return TRUE;
}
else{
return FALSE;
}
}
void func_8038BB6C(Actor *jiggy, ActorMarker * grabba_marker)
{
Actor *grabba;
ActorLocal_Grabba *grabba_local;
ActorMarker *tmp = reinterpret_cast(ActorMarker *, grabba_marker);
grabba = marker_getActor(tmp);
grabba_local = (ActorLocal_Grabba *)&grabba->local;
grabba->unk100 = jiggy->marker;
grabba_local->unk0 = grabba->unk100->unk5C;
jiggy->unk10_1 = TRUE;
grabba->unk1C[2] = (f32)func_8038BAA4(jiggy);
if(jiggyscore_isCollected((s32)grabba->unk1C[2])){
func_8038C748();
marker_despawn(grabba->marker);
}
}
void func_8038BBFC(ParticleEmitter *pCtrl, f32 position[3], s32 cnt){
func_802EFFA8(pCtrl, D_8039117C);
func_802EF9E4(pCtrl, 0x96);
particleEmitter_setSprite(pCtrl, ASSET_700_SPRITE_DUST);
func_802EFA5C(pCtrl, 0.0f, 0.01f);
particleEmitter_setStartingFrameRange(pCtrl, 0, 7);
particleEmitter_setPosition(pCtrl, position);
}
void func_8038BC7C(f32 position[3], s32 cnt){
ParticleEmitter *pCtrl = partEmitList_pushNew(cnt);
func_8038BBFC(pCtrl, position, cnt);
particleEmitter_setParticleSpawnPositionRange(pCtrl,
-60.0f, 0.0f, -60.0f,
60.0f, 30.0f, 60.0f
);
particleEmitter_setParticleVelocityRange(pCtrl,
-250.0f, 10.0f, -250.0f,
250.0f, 110.0f, 250.0f
);
func_802EFB70(pCtrl, 0.1f, 0.5f);
func_802EFB84(pCtrl, 2.0f, 2.6f);
particleEmitter_setSpawnIntervalRange(pCtrl, 0.0f, 0.01f);
func_802EFEC0(pCtrl, 0.5f, 1.4f);
particleEmitter_emitN(pCtrl, cnt);
}
void func_8038BD8C(f32 position[3], s32 cnt){
ParticleEmitter *pCtrl = partEmitList_pushNew(cnt);
func_8038BBFC(pCtrl, position, cnt);
particleEmitter_setParticleSpawnPositionRange(pCtrl,
-40.0f, 0.0f, -40.0f,
40.0f, 30.0f, 40.0f
);
particleEmitter_setParticleVelocityRange(pCtrl,
-100.0f, 20.0f, -100.0f,
100.0f, 60.0f, 100.0f
);
func_802EFB70(pCtrl, 0.1f, 0.5f);
func_802EFB84(pCtrl, 1.2, 1.6f);
particleEmitter_setSpawnIntervalRange(pCtrl, 0.0f, 0.01f);
func_802EFEC0(pCtrl, 0.5f, 1.4f);
particleEmitter_emitN(pCtrl, cnt);
}
void func_8038BEA0(Actor *this){
ActorLocal_Grabba *local = (ActorLocal_Grabba *)&this->local;
f32 sp38[3];
if(!this->initialized){
this->initialized = TRUE;
this->marker->propPtr->unk8_3 = TRUE;
actor_collisionOff(this);
this->unk38_31 = 0;
this->unk1C[1] = this->position_y;
D_80391A80 = this->state;
func_80333270(JIGGY_3E_GV_GRABBA, this->position, func_8038BB6C, this->marker);
}//L8038BF24
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
if(this->unk44_31 == 0){
this->unk44_31 = func_8030D90C();
sfxsource_setSfxId(this->unk44_31, SFX_3EC_CCW_DOOR_OPENING);
func_8030DD14(this->unk44_31, 2);
func_8030DBB4(this->unk44_31, 0.1f);
sfxsource_setSampleRate(this->unk44_31, 32000);
}
if(this->unk100 == NULL){
this->unk100 = func_8032B16C(JIGGY_3E_GV_GRABBA);
local->unk0 = this->unk100 != NULL ? this->unk100->unk5C : NULL;
}
func_80328B8C(this, this->state, 0.01f, 1);
this->unk58_0 = FALSE;
this->marker->propPtr->unk8_3 = FALSE;
}//L8038BFF4
if(actor_playerIsWithinDist(this, 4000) || this->state == 5){
this->unk58_0 = TRUE;
this->marker->propPtr->unk8_3 = TRUE;
switch(this->state){
case 1: //L8038C064
this->unk58_0 = FALSE;
this->marker->propPtr->unk8_3 = FALSE;
if(func_8038BB24(this)){
func_80328B8C(this, 2, 0.01f, 1);
actor_playAnimationOnce(this);
this->unk38_31 = 0;
D_80391A80 = this->state;
func_802BB3DC(0, 14.0f, 0.92f);
func_802C3F04((GenMethod_4)func_802C4140, 0x11f,
reinterpret_cast(s32, this->position_x), reinterpret_cast(s32, this->position_y), reinterpret_cast(s32, this->position_z)
);
}
break;
case 2: //L8038C108
if(actor_animationIsAt(this, 0.69f)){
func_80328B8C(this, 3, 0.01f, 1);
actor_loopAnimation(this);
D_80391A80 = this->state;
if(this->unk100){
this->unk100->collidable = TRUE;
}
}
else{
if(animctrl_getAnimTimer(this->animctrl) < 0.55){
func_8030E2C4(this->unk44_31);
if(randf() < 0.6){
func_8038BC7C(this->position, 0xA);
}
}
}
break;
case 3: //L8038C1CC
if(this->unk100 && this->unk100->unk5C != local->unk0){
func_8038BA08(this);
}
else if(this->unk38_31 >= 0xC){
func_80328B8C(this, 4, 0.01f, 1);
actor_playAnimationOnce(this);
D_80391A80 = this->state;
func_802BB3DC(0, 12.0f, 0.92f);
}
else if(func_80329530(this, 600)){
if(func_8028ECAC() == BSGROUP_6_TURBO_TALON_TRAINERS){
this->unk38_31++;
}
else{
this->unk38_31 += 4;
}
}
else{
if(!this->unk138_24){
if(func_80311480(ASSET_A78_TEXT_GRABBA_MEET, 0, NULL, NULL, NULL, NULL)){
this->unk138_24 = TRUE;
}
}
}
break;
case 4: //L8038C304
if(this->unk100 && this->unk100->unk5C != local->unk0){
func_8038BA08(this);
}
else if(actor_animationIsAt(this, 0.89f)){
func_80328B8C(this, 1, 0.01f, 1);
actor_loopAnimation(this);
D_80391A80 = this->state;
}
else{
if(0.35 < animctrl_getAnimTimer(this->animctrl)){
func_8030E2C4(this->unk44_31);
if(randf() < 0.6){
func_8038BC7C(this->position, 5);
}
}
if(actor_animationIsAt(this, 0.4f)){
if(this->unk100){
this->unk100->collidable = FALSE;
func_8030E878(SFX_3F5_UNKNOWN, randf2(0.95f, 1.05f), 32000, this->position, 1250.0f, 2500.0f);
}
if(!this->unk138_23){
if(func_80311480(ASSET_A7A_TEXT_GRABBA_TOO_FAST, 0, NULL, NULL, NULL, NULL)){
this->unk138_23 = TRUE;
}
}
}
}
break;
case 5: //L8038C488
if(this->position_y <= this->unk1C[1] - 330.0f){
marker_despawn(this->marker);
func_8038C748();
}
else{
func_8030E2C4(this->unk44_31);
this->position_y -= 7.0;
if(func_8023DB5C() & 1){
sp38[0] = this->position_x;
sp38[1] = this->position_y;
sp38[2] = this->position_z;
sp38[1] = this->unk1C[1];
func_8038BD8C(sp38, 1);
}
}
break;
}//L8038C528
if(this->unk100 && this->unk100->unk5C == local->unk0){
Actor *tmp_v0;
tmp_v0 = func_80329980(this);
if(this->marker->unk14_21){
func_8034A174(this->marker->unk44, 5, tmp_v0->position);
}
else{
tmp_v0->position_x = this->position_x;
tmp_v0->position_y = this->position_y;
tmp_v0->position_z = this->position_z;
tmp_v0->position_y -= 200.0f;
}
}
}//L8038C5AC
}
s32 func_8038C5BC(void){
return D_80391A80;
}

63
src/GV/code_61E0.c Normal file
View File

@@ -0,0 +1,63 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
void func_8038C658(Actor *this);
Actor *func_8038C5D0(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
/* .data */
ActorAnimationInfo D_80391190[] = {
{0x00, 0.0f},
{0xE5, 80000000.0f},
{0xE6, 1.6f},
{0xE5, 1.8f},
{0xE7, 0.55f},
{0xE8, 0.8f}
};
ActorInfo D_803911C0 = { 0xAC, 0x11E, 0x3E5,
0, D_80391190,
func_8038C658, func_80326224, func_8038C5D0,
0, 0, 0.0f, 0
};
/* .bss */
s32 D_80391A90;
/* .code */
Actor *func_8038C5D0(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
Actor *this = marker_getActor(this_marker);
if( this->state == 2
|| this->state == 3
|| this->state == 4
|| this->state == 5
){
if(!D_80391A90)
return func_80325888(this_marker, gfx, mtx, vtx);
}
return this;
}
void func_8038C658(Actor *this){
s32 sp24;
if(!this->initialized){
actor_collisionOff(this);
D_80391A90 = FALSE;
this->initialized = TRUE;
this->position_y += 4.0f;
}
if(!this->unk16C_4 && this->initialized){
this->unk16C_4 = TRUE;
func_80328B8C(this, this->state, 0.01f, 1);
}
sp24 = func_8038C5BC();
if(D_80391A90)
marker_despawn(this->marker);
if(this->state != sp24)
func_80328A84(this, sp24);
}
void func_8038C748(void){
D_80391A90 = TRUE;
}

295
src/GV/code_6370.c Normal file
View File

@@ -0,0 +1,295 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
typedef struct {
s32 unk0;
u8 unk4;
//u8 pad5[3];
u8 *unk8;
f32 unkC;
u8 unk10;
//u8 pad11[3];
ActorMarker *unk14;
f32 unk18[3];
f32 unk24;
}ActorLocal_GV_6370;
void func_8038C8A0(Actor *this, s32 next_state);
void func_8038CC98(Actor *this);
Actor *func_8038CC40(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
/* .data */
u8 D_803911F0[3] = {0, 1, 2};
ActorInfo D_803911F4 = { 0xBB, 0x285, 0x3E6,
0, NULL,
func_8038CC98, func_80326224, func_8038CC40,
0, 0, 0.0f, 0
};
ActorInfo D_80391218 = { 0xBB, 0x286, 0x3E6,
0, NULL,
func_8038CC98, func_80326224, func_8038CC40,
0, 0, 0.0f, 0
};
ActorInfo D_8039123C = { 0xBB, 0x287, 0x3E6,
0, NULL,
func_8038CC98, func_80326224, func_8038CC40,
0, 0, 0.0f, 0
};
/* .code */
void func_8038C760(Actor *this, s32 arg1){
ActorLocal_GV_6370 *local = (ActorLocal_GV_6370 *)&this->local;
func_8038FD50(local->unk14, arg1);
FUNC_8030E624(SFX_3F6_UNKNOWN, 0.7f, 28000);
FUNC_8030E624(SFX_3F6_UNKNOWN, 0.9f, 29000);
FUNC_8030E624(SFX_3F6_UNKNOWN, 1.0f, 30000);
timed_setCameraToNode(0.0f, 8);
if(arg1 < 3){
timed_setCameraToNode(3.5f, arg1 + 0x15);
timedFunc_set_3(3.5f, (TFQM3)func_80320044, BKPROG_F8_KING_SANDYBUTT_PYRAMID_STATE, arg1, 2);
func_80324E88(6.5f);
func_80324E38(6.5f, 0);
}
else{
timedFunc_set_2(3.5f, (TFQM2)func_8025A6EC, COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 0x7fff);
timedFunc_set_3(3.5f, (TFQM3)func_80320044, BKPROG_F8_KING_SANDYBUTT_PYRAMID_STATE, arg1, 2);
func_80324E88(6.0f);
func_80324E38(6.0f, 0);
}
}
void func_8038C880(Actor *this){
func_8038C8A0(this, 0);
}
void func_8038C8A0(Actor *this, s32 next_state){
ActorLocal_GV_6370 *local = (ActorLocal_GV_6370 *)&this->local;
local->unk0 = 0;
local->unk24 = 0.0f;
this->marker->propPtr->unk8_3 = (next_state == 1) ? FALSE : TRUE;
this->marker->collidable = (next_state == 1) ? FALSE : TRUE;
if(this->state == 4 || this->state == 5)
func_8030DA44(local->unk4);
if(next_state == 4 || next_state == 5){
local->unk4 = func_8030D90C();
sfxsource_setSfxId(local->unk4, SFX_3EC_CCW_DOOR_OPENING);
func_8030DD14(local->unk4, 3);
func_8030DBB4(local->unk4, 0.8f);
sfxsource_setSampleRate(local->unk4, 0);
func_8030E2C4(local->unk4);
}//L8038C9B8
if(next_state == 2){
func_80335924(this->unk148, ASSET_F0_ANIM_MINI_SHPYNX_EATING, 1.0f, 3.0f);
func_80335A74(this->unk148, 0.27f);
func_80335A8C(this->unk148, 4);
local->unkC = 0.0f;
local->unk18[0] = this->position_x;
local->unk18[1] = this->position_y;
local->unk18[2] = this->position_z;
if(this->state == 1){
func_80250E94(0.0f, 0.6f, 1.0f, 0, 1.3f, 0.0f);
timed_playSfx(1.0f, SFX_3F6_UNKNOWN, 0.8f, 30000);
}
}//L8038CA6C
if(next_state == 3){
local->unk24 = 3.0f;
func_80335924(this->unk148, ASSET_F0_ANIM_MINI_SHPYNX_EATING, 1.0f, 3.0f);
func_80335A74(this->unk148, 0.27f);
func_80335A8C(this->unk148, 4);
}//L8038CAB4
if(this->state == 3){
func_80335924(this->unk148, ASSET_F0_ANIM_MINI_SHPYNX_EATING, 0.5f, 3.0f);
func_80335A74(this->unk148, 0.99f);
func_80335A8C(this->unk148, 2);
if(next_state == 4 || next_state == 5)
FUNC_8030E8B4(SFX_DE_WOOD_SQUEAK, 1.0f, 32675, this->position, 500, 1500);
}//L8038CB20
if(next_state == 6){
func_80324E38(0.0f, 3);
func_80335924(this->unk148, ASSET_F0_ANIM_MINI_SHPYNX_EATING, 0.0f, 3.0f);
func_8025A6EC(COMUSIC_2B_DING_B, 28000);
}
if(next_state == 7){
local->unkC = 0.0f;
local->unk18[0] = this->position_x;
local->unk18[1] = this->position_y;
local->unk18[2] = this->position_z;
func_80250D94(0.7f, 0.5f, 1.3f);
FUNC_8030E624(SFX_3F6_UNKNOWN, 0.8f, 30000);
}
if(next_state == 8){
if(this->state == 7){
func_80250D94(0.8f, 0.7f, 3.0f);
func_8038C760(this, *local->unk8 + 1);
}
marker_despawn(this->marker);
}
this->state = next_state;
}
Actor *func_8038CC40(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
Actor *this = marker_getActor(this_marker);
if(this->state == 1) return this;
return func_80325888(this_marker, gfx, mtx, vtx);
}
void func_8038CC98(Actor *this){
ActorLocal_GV_6370 *local = (ActorLocal_GV_6370 *)&this->local;
f32 sp80 = time_getDelta();
s32 sp7C;
f32 pad70;
f32 sp6C[3];
f32 f12;
f32 sp5C[3];
f32 sp58;
f32 sp54;
f32 sp48[3];
if(!this->unk16C_4){
sp7C = func_8031FF44(BKPROG_F8_KING_SANDYBUTT_PYRAMID_STATE, 2);
this->unk16C_4 = TRUE;
this->marker->unk30 = func_8038C880;
local->unk8 = &D_803911F0[this->modelCacheIndex - 0x285];
local->unk10 = 0;
local->unk14 = 0;
local->unkC = 0.0f;
local->unk18[0] = this->position_x;
local->unk18[1] = this->position_y;
local->unk18[2] = this->position_z;
if(*local->unk8 < sp7C){
func_8038C8A0(this, 8);
}
else if(sp7C == *local->unk8){
func_8038C8A0(this, 2);
}
else{
func_8038C8A0(this, 1);
}
return;
}
if(!local->unk14){
local->unk14 = func_80326EEC(ACTOR_31D_SANDYBUTT_PYRAMID)->marker;
}
if(this->state == 1){
if(func_8031FF44(BKPROG_F8_KING_SANDYBUTT_PYRAMID_STATE, 2) == *local->unk8){
func_8038C8A0(this, 2);
}
}
if(this->state == 2){
local->unkC += 0.5*sp80;
if(1.0f <= local->unkC){
local->unkC = 1.0f;
func_8038C8A0(this, 3);
}
sp6C[0] = 0.0f;
sp6C[1] = 0.0f;
sp6C[2] = (1.0f - local->unkC) * -600.0f;
ml_vec3f_yaw_rotate_copy(sp6C, sp6C, this->yaw);
this->position_x = local->unk18[0] + sp6C[0];
this->position_y = local->unk18[1] + sp6C[1];
this->position_z = local->unk18[2] + sp6C[2];
}//L8038CECC
if(this->state == 3){
if(0.0f < local->unk24){
local->unk24 -= sp80;
}
else{
if(func_8038D388())
func_8038C8A0(this, 5);
}
}//L8038CF1C
if(this->state == 4 || this->state == 5){
local->unkC += ((this->state == 4)? -1 : 1) * sp80;
if(1.0f < local->unkC){
local->unkC = 1.0f;
func_8038C8A0(this, 4);
return;
}
else if(local->unkC < -1.0f){
local->unkC = -1.0f;
func_8038C8A0(this, 5);
return;
}
sp5C[0] = local->unkC*300.0f;
sp5C[1] = 0.0f;
sp5C[2] = 0.0f;
ml_vec3f_yaw_rotate_copy(sp5C, sp5C, this->yaw);
this->position_x = local->unk18[0] + sp5C[0];
this->position_y = local->unk18[1] + sp5C[1];
this->position_z = local->unk18[2] + sp5C[2];
if(0.8 <= local->unkC){
f12 = 1.0 - (local->unkC - 0.8)/0.2;
}
else if(local->unkC <= -0.8){
f12 = 1.0 - (-local->unkC - 0.8)/0.2;
}
else{
f12 = 1.0f;
}
func_8030DB04(local->unk4, f12*24000.0f, this->position, 200.0f, 1500.0f);
if(!func_8038D388()){
func_8038C8A0(this, 3);
}
}//L8038D110
if(this->state == 6){
func_8033568C(this->unk148, &sp58, &sp54);
if(sp58 < 0.28 && 0.28 <= sp54){
FUNC_8030E624(SFX_4C_LIP_SMACK, 1.0f, 28000);
}
if(sp58 < 0.52 && 0.52 <= sp54){
FUNC_8030E624(SFX_4C_LIP_SMACK, 0.9f, 28000);
}
if(sp58 < 0.7 && 0.7 <= sp54){
FUNC_8030E624(SFX_4C_LIP_SMACK, 1.0f, 28000);
}
if(0.81 <= sp54){
FUNC_8030E624(SFX_97_BLUBBER_BURPS, 1.0f, 28000);
func_8038C8A0(this, 7);
}
}//L8038D228
if(this->state == 7){
local->unkC += 0.5*sp80;
if(1.0f < local->unkC){
func_8038C8A0(this, 8);
}
sp48[0] = 0.0f;
sp48[1] = 0.0f;
sp48[2] = local->unkC*-600.0f;
ml_vec3f_yaw_rotate_copy(sp48, sp48, this->yaw);
this->position_x = local->unk18[0] + sp48[0];
this->position_y = local->unk18[1] + sp48[1];
this->position_z = local->unk18[2] + sp48[2];
}//L8038D2F0
if(local->unk0){
if(this->state == 4 || this->state == 5){
local->unk0 = 0;
local->unk10++;
if(local->unk10 == 3){
func_8038C8A0(this, 6);
}
else{
func_8025A6EC(COMUSIC_2B_DING_B, 28000);
}
}
}
}

40
src/GV/code_6F80.c Normal file
View File

@@ -0,0 +1,40 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
void func_8038D3AC(Actor *this);
/* .data */
ActorInfo D_80391260 = { 0x1A5, 0x288, 0x402,
0, NULL,
func_8038D3AC, NULL, func_80325340,
0, 0, 0.0f, 0
};
/* .bss */
u8 D_80391AA0;
/* .code */
void func_8038D370(ActorMarker *this_marker, ActorMarker *other_marker){
D_80391AA0 = 5;
}
int func_8038D388(void){
return D_80391AA0 ? 1 : 0;
}
void func_8038D3AC(Actor *this){
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
marker_setCollisionScripts(this->marker, func_8038D370, NULL, NULL);
D_80391AA0 = 0;
if(func_8031FF44(BKPROG_F8_KING_SANDYBUTT_PYRAMID_STATE, 2) == 3){
marker_despawn(this->marker);
}
}
else{
if(D_80391AA0 > 0){
D_80391AA0--;
}
}
}

135
src/GV/code_7060.c Normal file
View File

@@ -0,0 +1,135 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include "prop.h"
void func_8038D47C(Actor *this);
/* .data */
ActorAnimationInfo D_80391290[] = {
{0, 0.0f},
{0x144, 32000000.0f},
{0x144, 0.95f},
{0x145, 1.92f},
{0x144, 32000000.0f}
};
ActorInfo D_803912B8 = { MARKER_F9_JINXY, ACTOR_1F7_JINXY, ASSET_422_MODEL_JINXY,
0x1, D_80391290,
func_8038D47C, func_80326224, func_80325888,
0, 0, 0.0f, 0
};
/* .code */
void func_8038D450(ActorMarker *this_marker){
Actor *this = marker_getActor(this_marker);
func_80328AC8(this, 3);
}
void func_8038D47C(Actor *this){
f32 sp3C[3];
NodeProp *tmp_v0;
this->marker->propPtr->unk8_3 = TRUE;
actor_collisionOff(this);
func_80287784(this->animctrl, 0);
if(!this->initialized){
if(!func_80304E24(0x331, this->spawn_position)){
this->spawn_position_x = -2569.0f;
this->spawn_position_y = 2997.0f;
this->spawn_position_z = 5884.0f;
}//L8038D4FC
tmp_v0 = func_80304CAC(0x32f, this->spawn_position);
if(!tmp_v0){
this->unk1C_x = -1394.0f;
this->unk1C_y = 2811.0f;
this->unk1C_z = 6277.0f;
}
else{
nodeprop_getPosition(tmp_v0, this->unk1C);
}
tmp_v0 = func_80304CAC(0x330, this->spawn_position);
if(!tmp_v0){
this->velocity_x = -1424.0f;
this->velocity_y = 2811.0f;
this->velocity_z = 5463.0f;
}
else{
nodeprop_getPosition(tmp_v0, this->velocity);
}
this->initialized = TRUE;
}//L8038D590
if(!this->unk16C_4){
mapSpecificFlags_set(0x10, 0);
this->unk16C_4 = TRUE;
if(func_803203FC(0xC1) && func_8031B4F4() == -3){
timedFunc_set_1(1.5f, (TFQM1)func_8038D450, reinterpret_cast(s32, this->marker));
}
}//L8038D5EC
if(!mapSpecificFlags_get(0x14)){
player_getPosition(sp3C);
if(func_8028ECAC() == 0){
if( ml_vec3f_distance(sp3C, this->unk1C) < 100.0f || ml_vec3f_distance(sp3C, this->velocity) < 100.0f){
if(func_80311480(ASSET_A7B_TEXT_JINXY_MEET, 0, NULL, NULL, NULL, NULL)){
mapSpecificFlags_set(0x14, 1);
}
}
}
}//L8038D688
switch(this->state){
case 1: //L8038D6C0
if(!mapSpecificFlags_get(0xE) && mapSpecificFlags_get(0) + mapSpecificFlags_get(1) == 1){
mapSpecificFlags_set(0xE, TRUE);
func_80328AC8(this, 2);
this->unk38_31 = 1;
}
else if(!mapSpecificFlags_get(0xF) && mapSpecificFlags_get(0) + mapSpecificFlags_get(1) == 2){
mapSpecificFlags_set(0xF, TRUE);
func_8028F918(2);
func_80328AC8(this, 3);
func_802BAFE4(0);
}
break;
case 2: //L8038D78C
if( actor_animationIsAt(this, 0.2f)
|| actor_animationIsAt(this, 0.45f)
|| actor_animationIsAt(this, 0.8f)
){
FUNC_8030E624(SFX_D4_JINXIE_SNIFFLING_2, 0.8f, 32000);
}
if( actor_animationIsAt(this, 0.99f) ){
if(--this->unk38_31 == 0){
func_80311480(ASSET_A7C_TEXT_JINXY_ONE_EGG, 4, NULL, NULL, NULL, NULL);
mapSpecificFlags_set(0x14, TRUE);
func_80328AC8(this, 1);
}
}
break;
case 3: //L8038D84C
if( actor_animationIsAt(this, 0.135f)
|| actor_animationIsAt(this, 0.3f)
){
FUNC_8030E624(SFX_D4_JINXIE_SNIFFLING_2, 0.8f, 32000);
}
if(actor_animationIsAt(this, 0.63f)){
FUNC_8030E624(SFX_D5_JINXIE_SNEEZING, 0.8f, 32750);
}
if(actor_animationIsAt(this, 0.83f)){
FUNC_8030E624(SFX_D6_UGH, 0.8f, 32750);
}
if(actor_animationIsAt(this, 0.94f)){
if(!func_803203FC(0xC1)){
mapSpecificFlags_set(0x10, 1);
}
}
if(actor_animationIsAt(this, 0.99f)){
func_80328AC8(this, 1);
}
break;
case 4: //L8038D910
break;
}//L8038D910
}

230
src/GV/code_7530.c Normal file
View File

@@ -0,0 +1,230 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
extern void func_8028F738(f32[3], f32[3], f32, s32);
extern int func_8030E3FC(u8);
void func_8038DBDC(Actor *this);
Actor *func_8038DA18(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
/* .data */
ActorAnimationInfo D_803912E0[] = {
{0x00, 0.0f},
{0xD1, 800000.0f},
{0xE2, 2.0f},
{0xD1, 800000.0f},
{0xD0, 6.0f},
{0xCF, 2.0f},
{0xD1, 1.6f},
};
ActorInfo D_80391318 = { 0xAA, 0x11C, 0x3DE,
0x1, D_803912E0,
func_8038DBDC, func_80326224, func_8038DA18,
2500, 0, 1.7f, 0
};
/* .bss */
extern struct {
s32 unk0;
s32 unk4;
}D_80391AB0;
extern s32 D_80391AB8;
/* .code */
int func_8038D920(Actor *this, f32 arg1){
f32 sp2C[3];
f32 sp20[3];
f32 sp1C;
this->unkF4_8 = 20;
sp1C = (f32)(this->unkF4_8 + 25);
player_getPosition(sp20);
ml_vec3f_diff_copy(sp2C, this->position, sp20);
return this->position_y < sp20[1] && sp20[1] <= arg1 && sp2C[0]*sp2C[0] + sp2C[2]*sp2C[2] < sp1C*sp1C;
}
Actor *func_8038DA18(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
Actor *this;
f32 sp38[3];
f32 sp2C[3];
this = func_80325888(this_marker, gfx, mtx, vtx);
if(!this_marker->unk14_21) return this;
sp2C[0] = this->position_x;
sp2C[1] = this->position_y + 100.0f;
sp2C[2] = this->position_z;
func_8034A174(func_80329934(), 5, sp38);
if(this->state == 1 || this->state == 2){
sp38[1] = this->position_y;
}
if(func_8038D920(this, sp38[1])){
func_8028F738(sp2C, sp38, (f32)this->unkF4_8, 2);
}
return this;
}
void func_8038DB0C(Actor *this){
func_80328B8C(this, 1, 0.99f, 0);
animctrl_setPlaybackType(this->animctrl, ANIMCTRL_STOPPED);
}
void func_8038DB4C(s32 arg0){
D_80391AB0.unk0 = arg0;
}
void func_8038DB58(s32 arg0){
D_80391AB0.unk4 = arg0;
}
s32 func_8038DB64(void){
return D_80391AB0.unk4;
}
void func_8038DB70(void){
D_80391AB0.unk4++;
}
void func_8038DB88(Actor *this){
u8 tmp;
tmp = this->unk44_31;
if(tmp){
if(func_8030E3FC(tmp)){
func_8030E394(this->unk44_31);
}
func_8030DA44(this->unk44_31);
this->unk44_31 = 0;
}
}
void func_8038DBDC(Actor *this){
u8 tmp;
switch(this->state){
case 1: //8038DC18
if(!this->initialized){
this->initialized = TRUE;
this->marker->propPtr->unk8_3 = TRUE;
actor_collisionOff(this);
func_80328B8C(this, 1, 0.99f, 0);
animctrl_setPlaybackType(this->animctrl, ANIMCTRL_STOPPED);
D_80391AB8 = 0;
func_8038DB4C(0);
this->unk1C[0] = 0.0f;
}//L8038DC90
if(func_8038E178() != (s32)this->unk1C[0] || func_803203FC(0xC1)){
if(15.0f <= this->unk60){
func_80328B8C(this, 2, 0.01f, 1);
animctrl_setPlaybackType(this->animctrl, ANIMCTRL_ONCE);
animctrl_setDuration(this->animctrl, 2.0f);
this->unk1C[0] = (f32)func_8038E178();
this->unk60 = 0.0f;
}
else{//L8038DD2C
this->unk60 += 1.0f;
}
}
break;
case 2: //8038DD3C
if(!(func_8038E178() < 5)){
func_8038DB88(this);
if(D_80391AB8){
func_80328B8C(this, 3, 0.99f, 0);
animctrl_setPlaybackType(this->animctrl, ANIMCTRL_STOPPED);
this->unk1C[0] = 0.0f;
}
}
else if(actor_animationIsAt(this, 0.99f)){//L8038DD94
func_8038DB0C(this);
func_8038DB88(this);
}
else{ //L8038DDC0
if(actor_animationIsAt(this, 0.2f) && this->unk44_31 == 0){
this->unk44_31 = func_8030ED2C(0x3F7, 3);
this->unk1C[1] = 1.0f;
func_8030E2C4(this->unk44_31);
}//L8038DE08
if(actor_animationIsAt(this, 0.7f)){
func_8038DB88(this);
FUNC_8030E8B4(SFX_3F8_UNKNOWN, 1.0f, 32000, this->position, 1250, 2500);
}
}
break;
case 3: //8038DE44
if(!(this->unk38_31 < 0x21)){
func_80328B8C(this, 4, 0.01f, 1);
animctrl_setPlaybackType(this->animctrl, ANIMCTRL_ONCE);
animctrl_setDuration(this->animctrl, 3.0f);
func_803865F8();
this->unk38_31 = 0;
}
else{//L8038DEA0
this->unk38_31++;
}
break;
case 4: //8038DEBC
if(actor_animationIsAt(this, 0.99f)){
func_80328B8C(this, 5, 0.01f, 1);
animctrl_setPlaybackType(this->animctrl, ANIMCTRL_LOOP);
animctrl_setDuration(this->animctrl, 2.0f);
func_8038DB58(0);
}
else{
if(actor_animationIsAt(this, 0.04f))
FUNC_8030E8B4(SFX_7C_CHEBOOF, 1.0f, 32000, this->position, 1250, 2500);
if(actor_animationIsAt(this, 0.04f))
FUNC_8030E8B4(SFX_2C_PULLING_NOISE, 1.0f, 32000, this->position, 1250, 2500);
if(actor_animationIsAt(this, 0.33f))
FUNC_8030E8B4(SFX_2C_PULLING_NOISE, 1.2f, 32000, this->position, 1250, 2500);
if(actor_animationIsAt(this, 0.66f))
FUNC_8030E8B4(SFX_2C_PULLING_NOISE, 1.4f, 32000, this->position, 1250, 2500);
}
break;
case 5: //8038DFC8
if(func_8038DB64() == 0x127){
func_80328B8C(this, 6, 0.01f, 1);
animctrl_setPlaybackType(this->animctrl, ANIMCTRL_LOOP);
animctrl_setDuration(this->animctrl, 1.6f);
func_80386608();
func_8038DB4C(0);
D_80391AB8 = FALSE;
func_8025A58C(-1, 0x190);
func_8025A7DC(COMUSIC_27_GV_RUBEES_SONG);
if(!this->unk44_31){
this->unk44_31 = func_8030ED2C(SFX_2C_PULLING_NOISE, 3);
this->unk1C[1] = 1.9f;
func_8030E2C4(this->unk44_31);
}
}
else{//L8038E070
func_8038DB70();
}
break;
case 6: //8038E080
if(actor_animationIsAt(this, 0.89f)){
func_8038DB0C(this);
func_8038DB88(this);
}
else{
if(actor_animationIsAt(this, 0.42f))
func_8030E510(SFX_7C_CHEBOOF, 32000);
tmp = this->unk44_31;
if(tmp && func_8030E3FC(tmp)){
if(1.0 < this->unk1C[1]){
this->unk1C[1] -= 0.1;
}
func_8030DBB4(this->unk44_31, this->unk1C[1]);
}
}
break;
}//L8038E12C
}

27
src/GV/code_7D50.c Normal file
View File

@@ -0,0 +1,27 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
struct {
s32 unk0;
u8 pad4[4];
s32 unk8;
}D_80391AB0;
/* .code */
void func_8038E140(void){
D_80391AB0.unk0++;
func_8025A6EC(COMUSIC_2B_DING_B, 26000);
}
s32 func_8038E178(void){
return D_80391AB0.unk0;
}
s32 func_8038E184(void){
return 5;
}
void func_8038E18C(void){
D_80391AB0.unk8 = TRUE;
}

75
src/GV/code_7DB0.c Normal file
View File

@@ -0,0 +1,75 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
void func_8038E1A0(Actor *this);
void func_8038E1A8(Actor *this);
/* .data */
ActorAnimationInfo D_80391340[] ={
{0x00, 0.0f},
{0xF0, 80000000.0f},
{0xF0, 1.6f},
};
ActorInfo D_80391358 = { 0xAE, 0x121, 0x3E6,
0x1, D_80391340,
func_8038E1A0, func_8038E1A8, func_80325888,
2500, 0, 0.0f, 0
};
/* .code */
void func_8038E1A0(Actor *this){}
void func_8038E1A8(Actor *this){
Actor *sp24 = func_8032A7AC(this);
this->marker->propPtr->unk8_3 = TRUE;
switch(this->state){
case 1:
break;
case 2:
if(actor_animationIsAt(this, 0.98f)){
if(sp24){
sp24->velocity_y = 1.0f;
}
func_80328B8C(this, 1, 0.02f, 1);
}
else{
if(actor_animationIsAt(this, 0.2f))
FUNC_8030E8B4(SFX_4C_LIP_SMACK, 1.0f, 32000, this->position, 1250, 2500);
if(actor_animationIsAt(this, 0.4f))
FUNC_8030E8B4(SFX_4C_LIP_SMACK, 1.0f, 26000, this->position, 1250, 2500);
if(actor_animationIsAt(this, 0.6f))
FUNC_8030E8B4(SFX_4C_LIP_SMACK, 1.0f, 20000, this->position, 1250, 2500);
if(actor_animationIsAt(this, 0.8f))
FUNC_8030E8B4(SFX_97_BLUBBER_BURPS, 1.0f, 32000, this->position, 1250, 2500);
}
break;
}//L8038E2E8
}
void func_8038E2FC(ActorMarker *this_marker){
Actor *this = marker_getActor(this_marker);
Actor *other = func_8032A7AC(this);
if(other){
func_80328B8C(this, 2, 0.02f, 1);
}
}
int func_8038E344(ActorMarker *this_marker){
Actor *this = marker_getActor(this_marker);
Actor *other = func_8032A7AC(this);
if(other){
if(0.0f == other->velocity_y){
if(this->state != 2)
return 1;
}
}
return 0;
}

28
src/GV/code_7FC0.c Normal file
View File

@@ -0,0 +1,28 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
void func_8038E3B0(Actor *this);
/* .data */
ActorAnimationInfo D_80391380[] = {
{0, 0.0f},
{0, 0.0f}
};
ActorInfo D_80391390 = { 0xFA, 0x1F8, 0x423,
0x1, D_80391380,
func_8038E3B0, func_80326224, func_80325888,
0, 0x100, 0.0f, 0
};
ActorInfo D_803913B4 = { 0xFB, 0x1F9, 0x424,
0x1, D_80391380,
func_8038E3B0, func_80326224, func_80325888,
0, 0x100, 0.0f, 0
};
/* .code */
void func_8038E3B0(Actor *this){
this->marker->propPtr->unk8_3 = TRUE;
actor_collisionOff(this);
}

522
src/GV/code_7FF0.c Normal file
View File

@@ -0,0 +1,522 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include "SnS.h"
extern void func_80244BB0(s32, s32, s32, f32);
extern void func_802D3D54(Actor *this);
extern void func_802D3D74(Actor *this);
extern Actor *func_80325F2C(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
extern void func_8032BC3C(Actor *, f32);
extern void func_80343E20(s32, s32, f32, s32);
extern ActorInfo D_80390BF0;
extern ActorInfo D_80390C5C;
extern ActorInfo D_80390C80;
extern ActorInfo D_80390D30;
extern ActorInfo D_80390D60;
extern ActorInfo D_80390CB0;
extern ActorInfo D_80390D00;
extern ActorInfo D_80390D90;
extern ActorInfo D_80390DD0;
extern ActorInfo D_80390E30;
extern ActorInfo D_80390E54;
extern ActorInfo D_80390ED0;
extern ActorInfo D_80390F00;
extern ActorInfo D_80390FD0;
extern ActorInfo D_80391010;
extern ActorInfo D_80391098;
extern ActorInfo D_80391158;
extern ActorInfo D_803911C0;
extern ActorInfo D_803911F4;
extern ActorInfo D_80391218;
extern ActorInfo D_8039123C;
extern ActorInfo D_80391260;
extern ActorInfo D_80391318;
extern ActorInfo D_80391358;
extern ActorInfo D_803912B8;
extern ActorInfo D_80391390;
extern ActorInfo D_803913B4;
extern ActorInfo D_80390F40;
extern ActorInfo D_80391494;
extern ActorInfo D_803915C0;
extern ActorInfo D_80391620;
extern ActorInfo D_803914B8;
extern ActorInfo D_803914DC;
extern ActorInfo D_80391500;
extern ActorInfo D_80391524;
extern ActorInfo D_8039156C;
extern ActorInfo D_80391428;
extern ActorInfo D_8039144C;
extern ActorInfo D_80391470;
extern ActorInfo D_80391548;
extern ActorInfo D_80391590;
void func_8038E460(Actor *this);
void func_8038E4DC(Actor *this);
void func_8038E648(Actor *this);
void func_8038E914(Actor *this);
void func_8038E97C(Actor *this);
void chKazooieDoor_update(Actor *this);
void chSunSwitch_update(Actor *this);
void chStarSwitch_update(Actor *this);
void chHoneycombSwitch_update(Actor *this);
void func_8038EF14(Actor *this);
void chKazooieTarget_update(Actor *this);
/* .data */
ActorAnimationInfo D_803913E0[] = {
{0, 0.0f},
{0, 0.0f},
{ASSET_D4_ANIM_SWITCH_DOWN, 0.15f},
{ASSET_D5_ANIM_SWITCH_UP, 0.5f},
{0, 0.0f},
{0, 0.0f},
{0, 0.0f},
{0, 0.0f},
{0, 0.0f}
};
ActorInfo D_80391428 = { MARKER_EC_GV_SUN_SWITCH, ACTOR_13F_GV_SUN_SWITCH, ASSET_400_MODEL_SUN_SWITCH,
0x1, D_803913E0,
chSunSwitch_update, func_80326224, func_80325888,
0, 0, 0.0f, 0
};
ActorInfo D_8039144C = { MARKER_F1_GV_STAR_SWITCH, ACTOR_144_GV_STAR_SWITCH, ASSET_3D7_MODEL_STAR_SWITCH,
0x1, D_803913E0,
chStarSwitch_update, func_80326224, func_80325888,
0, 0, 0.0f, 0
};
ActorInfo D_80391470 = { MARKER_F2_HONEYCOMB_SWITCH, ACTOR_145_HONEYCOMB_SWITCH, ASSET_438_MODEL_HONEYCOMB_SWITCH,
0x1, D_803913E0,
chHoneycombSwitch_update, func_80326224, func_80325888,
0, 0, 0.0f, 0
};
ActorInfo D_80391494 = { MARKER_23C_GV_SNS_SWITCH, ACTOR_245_GV_SNS_SWITCH, ASSET_515_MODEL_GV_SNS_SWITCH,
0x1, D_803913E0,
func_8038EF14, func_80326224, func_80325888,
0, 0, 0.0f, 0
};
ActorInfo D_803914B8 = { MARKER_EB_GV_BANJO_DOOR, ACTOR_6D_GV_BANJO_DOOR, ASSET_3D8_MODEL_GV_BANJO_DOOR,
0x1, 0x0,
func_802D3D54, func_8038E460, func_80325F2C,
0, 0, 0.0f, 0
};
ActorInfo D_803914DC = { MARKER_ED_GV_SUN_DOOR, ACTOR_140_GV_SUN_DOOR, ASSET_3FF_MODEL_GV_SUN_DOOR,
0x1, 0x0,
func_802D3D54, func_8038E4DC, func_80325F2C,
0, 0, 0.0f, 0
};
ActorInfo D_80391500 = { MARKER_F0_GV_KAZOOIE_DOOR, ACTOR_143_GV_KAZOOIE_DOOR, ASSET_3D9_MODEL_GV_KAZOOIE_DOOR,
0x1, 0x0,
chKazooieDoor_update, func_80326224, func_80325F2C,
0, 0, 0.0f, 0
};
ActorInfo D_80391524 = { MARKER_EF_GV_STAR_HATCH, ACTOR_142_GV_STAR_HATCH, ASSET_3DB_MODEL_GV_STAR_HATCH,
0x1, 0x0,
func_8038E648, func_80326224, func_80325F2C,
0, 0, 0.0f, 0
};
ActorInfo D_80391548 = { MARKER_F3_GV_KAZOOIE_TARGET, ACTOR_146_GV_KAZOOIE_TARGET, ASSET_3E2_MODEL_GV_KAZOOIE_TARGET,
0x1, 0x0,
chKazooieTarget_update, func_80326224, func_80325E78,
0, 0x400, 0.0f, 0
};
ActorInfo D_8039156C = { MARKER_F8_GV_KAZOOIE_DOOR, ACTOR_1F5_GV_KAZOOIE_DOOR, ASSET_3D9_MODEL_GV_KAZOOIE_DOOR,
0x1, 0x0,
func_8038E97C, func_80326224, func_80325F2C,
0, 0, 0.0f, 0
};
ActorInfo D_80391590 = { MARKER_23A_GV_SNS_CHAMBER_DOOR, ACTOR_243_GV_SNS_CHAMBER_DOOR, ASSET_514_MODEL_GV_SNS_CHAMBER_DOOR,
0x1, 0x0,
func_8038E914, func_80326224, func_80325F2C,
0, 0, 0.0f, 0
};
/* .bss */
extern f32 D_80391AC0;
extern f32 D_80391AC4;
extern f32 D_80391AC8;
/* .code */
void func_8038E3E0(Actor *this){
D_80391AC0 = this->yaw;
D_80391AC4 = this->pitch;
D_80391AC8 = this->roll;
}
void func_8038E408(Actor *this){
this->yaw = D_80391AC0;
this->pitch = D_80391AC4;
this->roll = D_80391AC8;
}
void func_8038E430(Actor *this){
func_8038E3E0(this);
func_80343DEC(this);
func_8038E408(this);
}
void func_8038E460(Actor *this){//banjo_door
func_802D3D74(this);
if(mapSpecificFlags_get(0x10)){
func_8038E430(this);
if(!mapSpecificFlags_get(2)){
mapSpecificFlags_set(2, TRUE);
func_8028F918(0);
func_80324DBC(4.0f, ASSET_A7D_TEXT_JINXY_HELPED, 4, NULL, NULL, NULL, NULL);
}
}
}
void func_8038E4DC(Actor *this){
f32 sp24;
func_802D3D74(this);
if(!this->initialized){
this->initialized = TRUE;
this->unk1C[0] = this->unk48;
}
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
if(func_803348CC() == 3){
if(0.65 < this->unk48 && this->unk48 < 0.95){
func_80343E20(0x6a, 0x7ff8, 0.32842f, 0x34);
}
}
else{//L8038E594
func_8032BC3C(this, this->unk1C[0]);
mapSpecificFlags_set(3, FALSE);
mapSpecificFlags_set(4, FALSE);
return;
}
}//L8038E5BC
if(!mapSpecificFlags_get(3)) return;
sp24 = this->unk48;
func_8038E430(this);
if(this->unk48 < sp24){
mapSpecificFlags_set(3, FALSE);
mapSpecificFlags_set(4, FALSE);
}
else{
if(!mapSpecificFlags_get(4)){
mapSpecificFlags_set(4, TRUE);
func_802BAFE4(1);
}
}
}
void func_8038E648(Actor *this){
f32 tmp_f18;
func_802D3D74(this);
switch(this->state){
case 1: //L8038E690
this->pitch = 0.0f;
if(mapSpecificFlags_get(5)){
func_802BAFE4(2);
func_80328A84(this, 6);
this->unk38_31 = 600;
func_80244BB0(0, 0x6A, 0x7ff8, 0.3f);
func_802D68F0(25);
item_set(ITEM_6_HOURGLASS, 1);
}
break;
case 6: //L8038E700
this->pitch += (this->pitch < 1.0) ? 0.017 : 1.09;
if(90.0f <= this->pitch){
func_80328A84(this, 7);
this->pitch = 90.0f;
func_8030E540(SFX_7F_HEAVYDOOR_SLAM);
func_80244C78(0);
}
break;
case 7: //L8038E78C
this->unk38_31 -= time_getDelta();
if(this->unk38_31 == 0){
func_80328A84(this, 8);
func_80244BB0(0, 0x6A, 0x7ff8, 0.3f);
}
break;
case 8: //L8038E894
this->pitch -= 1.5;
if(this->pitch <= 0.0f){
func_80328A84(this, 1);
this->pitch = 0.0f;
func_8030E540(SFX_7F_HEAVYDOOR_SLAM);
mapSpecificFlags_set(5, FALSE);
func_80244C78(0);
func_80356520(0xAC);
}
break;
}//L8038E904:
}
void func_8038E914(Actor *this){
func_80389F5C(this);
if(!this->initialized){
func_802D3D74(this);
this->initialized = TRUE;
if(sns_get_item_state(SNS_ITEM_EGG_BLUE, 1))
marker_despawn(this->marker);
}
}
void func_8038E97C(Actor *this){
f32 tmp_f0;
if(!this->initialized){
this->initialized = TRUE;
this->scale = 1.35f;
func_802D3D74(this);
this->unk1C[0] = this->position_y;
this->position_y += -300.0f;
}
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
if(func_803348CC() == 7){
this->position_z += 117.0;
this->position_y += 130.0;
this->unk38_31 = 30;
func_80328A84(this, 8);
func_80244BB0(1, 0x6A, 0x7ff8, 0.3f);
}
}//L8038EA6C
if(this->position_y == this->unk1C[0] + -300.0f){
if(func_8031FF44(BKPROG_F8_KING_SANDYBUTT_PYRAMID_STATE, 2) == 3){
this->position_y = this->unk1C[0];
}
}
if(this->state == 8){
this->position_z = this->position_z - (f32)117.0/30.0f;
tmp_f0 = this->position_y;
this->position_y = tmp_f0 - (f32)130.0/30.0f;
this->unk38_31 -= 1;
if(this->unk38_31 == 0){
func_80328A84(this, 1);
func_80244C78(1);
func_8030E540(SFX_7F_HEAVYDOOR_SLAM);
}
}
}
void chKazooieDoor_update(Actor *this){
func_802D3D74(this);
func_8032AA58(this, 1.3f);
switch(this->state){
case 1: //L8038EB98
if(mapSpecificFlags_get(6)){
func_8025A6EC(COMUSIC_2B_DING_B, -1);
func_802BAFE4(3);
func_80328A84(this, 6);
func_80244BB0(1, 0x6a, 0x7ff8, 0.3f);
this->unk1C[1] = this->position_y + 210.0f;
this->unk1C[0] = this->position_y;
}
break;
case 6: //L8038EBF8
this->position_y += 1.8;
this->position_z -= 1.3319999999999999;
if(this->unk1C[1] <= this->position_y){
func_80328A84(this, 7);
func_8030E540(SFX_7F_HEAVYDOOR_SLAM);
func_80244C78(1);
this->unk38_31 = 450;
}
break;
case 7: //L8038EC70
this->unk38_31--;
if(this->unk38_31 == 0){
func_80328A84(this, 8);
func_80244BB0(1, 0x6a, 0x7ff8, 0.3f);
}
break;
case 8: //L8038ECD0
this->position_y -= 1.8;
this->position_z += 1.3319999999999999;
if(this->position_y <= this->unk1C[0]){
this->position_y = this->unk1C[0];
func_80328A84(this, 1);
func_8030E540(SFX_7F_HEAVYDOOR_SLAM);
func_80244C78(1);
mapSpecificFlags_set(6, FALSE);
}
break;
}//L8038ED40
}
void chSunSwitch_update(Actor *this){
func_802D4A9C(this, 3);
if( this->velocity_x == 0.0f
&& mapSpecificFlags_get(3) == TRUE
&& func_802BB270()
){
this->velocity_x = 1.0f;
func_802D68F0(10);
item_set(ITEM_6_HOURGLASS, 1);
}//L8038EDC8
if( this->velocity_x == 1.0f
&& mapSpecificFlags_get(3) == FALSE
){
this->velocity_x = 0.0f;
}
}
void chStarSwitch_update(Actor *this){
if( this->velocity_x == 0.0f
&& mapSpecificFlags_get(5) == TRUE
&& func_802BB270()
){
this->velocity_x = 1.0f;
}//L8038EDC8
if( this->velocity_x == 1.0f
&& mapSpecificFlags_get(5) == FALSE
){
this->velocity_x = 0.0f;
}
func_802D4A9C(this, 5);
}
void chHoneycombSwitch_update(Actor *this){
if(!mapSpecificFlags_get(0xd) && honeycombscore_get(HONEYCOMB_B_GV_CACTUS)){
mapSpecificFlags_set(0xd, TRUE);
}
func_802D4A9C(this, 0xd);
}
void func_8038EF14(Actor *this){
func_802D4AC0(this, 0x8000a3, 0xa4);
}
void chKazooieTarget_update(Actor *this){
this->marker->propPtr->unk8_3 = TRUE;
if( this->velocity_x == 0.0f
&& mapSpecificFlags_get(6) == TRUE
&& func_802BB270()
){
this->velocity_x = 1.0f;
func_802D68F0(0x15);
item_set(ITEM_6_HOURGLASS, 1);
}//L8038EDC8
if( this->velocity_x == 1.0f
&& mapSpecificFlags_get(6) == FALSE
){
this->velocity_x = 0.0f;
}
}
void func_8038F004(void){
func_8025A6EC(SFX_2D_KABOING, 0x7fff);
}
void func_8038F028(UNK_TYPE(s32) arg0, ActorMarker *arg1, s32 arg2, s32 arg3){
f32 sp24[3];
s16 *tmp_v1;
if(mapSpecificFlags_get(arg2) == FALSE){
mapSpecificFlags_set(arg2, 1);
sp24[0] = (f32)arg1->propPtr->x;
sp24[1] = (f32)arg1->propPtr->y;
sp24[2] = (f32)arg1->propPtr->z;
func_802C3F04((GenMethod_4)func_802C4140, 0x4e, reinterpret_cast(s32, sp24[0]), reinterpret_cast(s32, sp24[1]), reinterpret_cast(s32, sp24[2]));
func_8025A6EC(COMUSIC_2B_DING_B, 22000);
if(mapSpecificFlags_get(arg3)){
timedFunc_set_0(2.0f, func_8038F004);
}
}
func_80353580(arg1);
}
void func_8038F10C(UNK_TYPE(s32) arg0, ActorMarker *arg1){
func_8038F028(arg0, arg1, 0, 1); //JINXY egg flags?
}
void func_8038F130(UNK_TYPE(s32) arg0, ActorMarker *arg1){
func_8038F028(arg0, arg1, 1, 0); //JINXY egg flags?
}
void func_8038F154(void)
{
spawnableActorList_add(&D_80390BF0, actor_new, 0X180);
spawnableActorList_add(&D_80390C5C, actor_new, 0X58A);
spawnableActorList_add(&D_80390C80, actor_new, 0X9A8);
spawnableActorList_add(&D_80390D30, actor_new, 0X880);
spawnableActorList_add(&D_80390D60, actor_new, 0X80);
spawnableActorList_add(&D_80390CB0, actor_new, 0XDA8);
spawnableActorList_add(&D_80390D00, actor_new, 0X9A8);
spawnableActorList_add(&D_80390D90, actor_new, 0XD80);
spawnableActorList_add(&D_80390DD0, actor_new, 0X4004);
spawnableActorList_add(&D_80390E30, actor_new, 0X448);
spawnableActorList_add(&D_80390E54, actor_new, 0X48);
spawnableActorList_add(&D_80390ED0, actor_new, 0X180);
spawnableActorList_add(&D_80390F00, actor_new, 0X80);
spawnableActorList_add(&D_80390FD0, actor_new, 0X4048);
spawnableActorList_add(&D_80391010, actor_new, 0X4048);
spawnableActorList_add(&D_80391098, actor_new, 0X10069);
spawnableActorList_add(&D_80391158, actor_new, 0X48);
spawnableActorList_add(&D_803911C0, actor_new, 8);
spawnableActorList_add(&D_803911F4, actor_new, 0X80988);
spawnableActorList_add(&D_80391218, actor_new, 0X80988);
spawnableActorList_add(&D_8039123C, actor_new, 0X80988);
spawnableActorList_add(&D_80391260, actor_new, 0X80);
spawnableActorList_add(&D_80391318, actor_new, 0X78A);
spawnableActorList_add(&D_80391358, actor_new, 0X518);
spawnableActorList_add(&D_803912B8, actor_new, 0X500);
spawnableActorList_add(&D_80391390, actor_new, 0X500);
spawnableActorList_add(&D_803913B4, actor_new, 0X500);
spawnableActorList_add(&D_80390F40, actor_new, 0);
spawnableActorList_add(&D_80391494, actor_new, 0X408);
spawnableActorList_add(&D_803915C0, actor_new, 0);
spawnableActorList_add(&D_80391620, actor_new, 0X400);
spawnableActorList_add(&D_803914B8, actor_new, 0X400);
spawnableActorList_add(&D_803914DC, actor_new, 0X400);
spawnableActorList_add(&D_80391500, actor_new, 0X400);
spawnableActorList_add(&D_80391524, actor_new, 0X400);
spawnableActorList_add(&D_8039156C, actor_new, 0X400);
spawnableActorList_add(&D_80391428, actor_new, 8);
spawnableActorList_add(&D_8039144C, actor_new, 8);
spawnableActorList_add(&D_80391470, actor_new, 8);
spawnableActorList_add(&D_80391548, actor_new, 0X400);
spawnableActorList_add(&D_80391590, actor_new, 0X400);
}
s32 func_8038F4C0(Actor *arg0, s32 arg1){
if( getGameMode() != GAME_MODE_7_ATTRACT_DEMO
&& (0xDBF4E829 + *(s32*)PHYS_TO_K1(0x284))
){
return arg1;
}
else{
return arg0->state;
}
}

206
src/GV/code_9130.c Normal file
View File

@@ -0,0 +1,206 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
extern void func_80324CD8(f32);
typedef struct {
u8 pad0[4];
s16 unk4;
//u8 pad6[2];
f32 unk8;
} ActorLocal_GVMazeCtrl;
void __chmazectrl_setState(Actor *this, s32 next_state);
void chmazectrl_update(Actor *this);
/* .data */
ActorInfo D_803915C0 = { MARKER_1CD_GV_MAZE_CTRL, ACTOR_319_GV_MAZE_CTRL, 0x0,
0, NULL,
chmazectrl_update, 0x0, func_80325340,
0, 0, 0.0f, 0
};
f32 D_803915E4[3] = {460.0f, 1400.0f, 0.0f};
f32 D_803915F0[3] = {0.0f, 0.0f, 0.0f};
f32 D_803915FC[3] = {0.0f, 0.0f, 0.0f};
f32 D_80391608[3] = {460.0f, 1400.0f, 0.0f};
/* .code */
void func_8038F520(f32 arg0){
Struct6Ds *tmp_v0 = func_8034C528(0x19A);
if(tmp_v0 != NULL){
func_8034DDF0(tmp_v0, D_803915E4, D_803915F0, arg0, 1);
}
}
void func_8038F56C(f32 arg0){
Struct6Ds *tmp_v0 = func_8034C528(0x19A);
if(tmp_v0 != NULL){
func_8034DDF0(tmp_v0, D_803915FC, D_80391608, arg0, 1);
}
}
void __chmazectrl_markerSetState(ActorMarker *this_marker, s32 arg1){
Actor *this = marker_getActor(this_marker);
__chmazectrl_setState(this, arg1);
}
void __chmazectrl_8038F5E4(Actor *this){
if(this->state == 2){
comusic_8025AB44(COMUSIC_26_GV_SANDYBUTT_DANGER, 0, 30000);
item_set(ITEM_6_HOURGLASS, FALSE);
}
}
void __chmazectrl_setState(Actor *this, s32 next_state){
f32 plyr_pos[3];
Struct6Ds *tmp_v0;
ActorLocal_GVMazeCtrl *local;
f32 sp28[3];
local = (ActorLocal_GVMazeCtrl *)&this->local;
player_getPosition(plyr_pos);
local->unk8 = 0.0f;
if(next_state == 2){
func_8025A58C(0, 4000);
func_8025A6EC(COMUSIC_26_GV_SANDYBUTT_DANGER, 30000);
item_set(ITEM_0_HOURGLASS_TIMER, 0xdd3);
item_set(ITEM_6_HOURGLASS, TRUE);
func_8038F520(1.0f);
FUNC_8030E624(SFX_3F6_UNKNOWN, 0.8f, 25000);
FUNC_8030E624(SFX_3F6_UNKNOWN, 0.7f, 25000);
FUNC_8030E624(SFX_3F6_UNKNOWN, 0.5f, 25000);
if(1500.0f < plyr_pos[0]){
func_80324E38(0.0f, 3);
timed_setCameraToNode(0.0f, 8);
timed_playSfx(1.0f, SFX_7F_HEAVYDOOR_SLAM, 1.0f, 32000);
func_80324CD8(1.2f);
func_80324E88(1.2f);
func_80324E38(1.2f, 0);
}
else{//L8038F754
timed_playSfx(1.0f, SFX_7F_HEAVYDOOR_SLAM, 1.0f, 32000);
}
if(!levelSpecificFlags_get(0x16)){
func_80311480(ASSET_A82_TEXT_SANDYBUTT_START_MAZE, 4, NULL, NULL, NULL, NULL);
levelSpecificFlags_set(0x16, TRUE);
}
}//L8038F794
if(this->state == 2){
func_8025A58C(-1, 400);
comusic_8025AB44(COMUSIC_26_GV_SANDYBUTT_DANGER, 0, 0x190);
func_8025AABC(COMUSIC_26_GV_SANDYBUTT_DANGER);
item_set(ITEM_6_HOURGLASS, FALSE);
}
if(next_state == 3){
func_80324E38(0.0f, 3);
timedFunc_set_2(0.0f, (TFQM2)func_8025A6EC, COMUSIC_3E_SANDYBUTT_FAILURE, 0x7FFF);
timedFunc_set_2(1.0f, (TFQM2)__chmazectrl_markerSetState, reinterpret_cast(s32, this->marker), 6);
timedFunc_set_2(2.0f, (TFQM2)__chmazectrl_markerSetState, reinterpret_cast(s32, this->marker), 4);
}//L8038F850
if(next_state == 4){
FUNC_8030E624(SFX_3F6_UNKNOWN, 1.0f, 30000);
FUNC_8030E624(SFX_3F6_UNKNOWN, 0.8f, 29000);
FUNC_8030E624(SFX_3F6_UNKNOWN, 0.7f, 28000);
FUNC_8030E624(SFX_3F6_UNKNOWN, 0.5f, 31000);
func_8030E6D4(SFX_52_BANJO_YAH_OH);
tmp_v0 = func_8034C528(400);
if(tmp_v0){
func_8034DE60(tmp_v0, 0.0f, -1700.0f, 1.0f, 1);
}
}//L8038F8C4
if(this->state == 4){
FUNC_8030E624(SFX_7F_HEAVYDOOR_SLAM, 0.6f, 32750);
FUNC_8030E624(SFX_7F_HEAVYDOOR_SLAM, 0.8f, 32725);
func_8030E6D4(SFX_7F_HEAVYDOOR_SLAM);
func_8028F66C(0x26);
}
if(next_state == 6){
player_getPosition(sp28);
sp28[1] = 2000.0f;
func_8028F94C(4, sp28);
}
if(next_state == 5){
func_8038F56C(0.0f);
if(++local->unk4 == 1)
func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 0x7fff);
if(!levelSpecificFlags_get(0x17)){
func_80311480(ASSET_A83_TEXT_SANDYBUTT_DONE, 4, NULL, NULL, NULL, NULL);
levelSpecificFlags_set(0x17, TRUE);
}
}
this->state = next_state;
}
void chmazectrl_update(Actor *this){
f32 sp3C[3];
Struct6Ds *sp38;
f32 sp34;
Struct6Ds *sp30;
ActorLocal_GVMazeCtrl *local = (ActorLocal_GVMazeCtrl *)&this->local;
sp34 = time_getDelta();
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
this->marker->unk30 = __chmazectrl_8038F5E4;
if(this->state == 2){
comusic_8025AB44(COMUSIC_26_GV_SANDYBUTT_DANGER, 30000, 30000);
item_set(ITEM_6_HOURGLASS, TRUE);
}
else{
func_8038F56C(0.0f);
local->unk4 = 0;
this->state = 0;
__chmazectrl_setState(this, 1);
local->unk8 = 1.0f;
}//L8038FA8C
if(jiggyscore_isCollected(JIGGY_41_GV_MAZE))
levelSpecificFlags_set(0x17, TRUE);
}//L8038FAA4
player_getPosition(sp3C);
if(this->state == 1){
sp38 = func_8034C528(0x191);
if(sp38 != NULL && func_8034DC80(sp38, sp3C)){
__chmazectrl_setState(this, 2);
}
if( !levelSpecificFlags_get(0x15)
&& func_8025773C(&local->unk8, sp34)
&& func_80311480(ASSET_A81_TEXT_SANDYBUTT_ENTER, 0, NULL, NULL, NULL, NULL)
){
levelSpecificFlags_set(0x15, TRUE);
}
}//L8038FB34
if(this->state == 2){
if( sp3C[0] <= -1750.0f && 80.0f <= sp3C[2] && sp3C[2] <= 350.0f){
__chmazectrl_setState(this, 5);
}
else{
if(item_empty(ITEM_6_HOURGLASS)){
__chmazectrl_setState(this, 3);
}
}
}//L8038FBBC
if(this->state == 5){
if(-1700.0f < sp3C[0]){
__chmazectrl_setState(this, 2);
}
}
if(this->state == 4){
sp30 = func_8034C528(0x190);
if(sp30 != NULL && func_8034DC78(sp30)){
__chmazectrl_setState(this, 0);
}
}
}

80
src/GV/code_9860.c Normal file
View File

@@ -0,0 +1,80 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
typedef struct{
f32 unk0;
s32 unk4;
}ActorLocal_GV_9860;
void func_8038FD8C(Actor *this);
Actor *func_8038FCF4(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
/* .data */
ActorInfo D_80391620 = { MARKER_1D4_SANDYBUTT_PYRAMID, ACTOR_31D_SANDYBUTT_PYRAMID, ASSET_56B_MODEL_SANDYBUTT_PYRAMID,
0, NULL,
func_8038FD8C, NULL, func_8038FCF4,
0, 0, 0.0f, 0
};
/* .code */
void func_8038FC50(Actor *this, s32 next_state){
s32 sp1C;
if(next_state == 2){
sp1C = func_802F9AA8(SFX_3EC_CCW_DOOR_OPENING);
func_802F9DB8(sp1C, 0.7f, 0.9f, 0.03f);
func_802F9F80(sp1C, 0.3f, 2.4f, 0.3f);
func_802FA060(sp1C, 32000, 32000, 0.0f);
}
this->state = next_state;
}
Actor *func_8038FCF4(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
Actor *this = marker_getActor(this_marker);
ActorLocal_GV_9860 *local = (ActorLocal_GV_9860 *)&this->local;
if(local->unk4 == 0){
return func_80325340(this_marker, gfx, mtx, vtx);
}
else{
return func_80325888(this_marker, gfx, mtx, vtx);
}
}
void func_8038FD50(ActorMarker *this_marker, s32 arg1){
Actor *this = marker_getActor(this_marker);
ActorLocal_GV_9860 *local = (ActorLocal_GV_9860 *)&this->local;
local->unk0 = 0.0f;
local->unk4 = arg1;
func_8038FC50(this, 2);
}
void func_8038FD8C(Actor *this){
ActorLocal_GV_9860 *local = (ActorLocal_GV_9860 *)&this->local;
f32 tmp_f2;
f32 tmp_f0;
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
this->marker->propPtr->unk8_3 = TRUE;
local->unk4 = func_8031FF44(BKPROG_F8_KING_SANDYBUTT_PYRAMID_STATE, 2);
this->position_x = 67.0f;
this->position_y = (local->unk4/3.0)*1050.0 + 1375.0;
this->position_z = 400.0f;
func_8038FC50(this, 1);
}//L8038FE48
if(this->state == 2){
local->unk0 += time_getDelta()/3.0f;
if(1.0f < local->unk0)
local->unk0 = 1.0f;
tmp_f0 = ((local->unk4 - 1)/3.0)*1050.0 + 1375.0;
tmp_f2 = (local->unk4/3.0)*1050.0 + 1375.0;
this->position_y = local->unk0*(tmp_f2 - tmp_f0) + tmp_f0;
if(1.0f == local->unk0)
func_8038FC50(this, 1);
}//L8038FF48
}

20
src/GV/code_9B70.c Normal file
View File

@@ -0,0 +1,20 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
void func_8038FF60(void){}
void func_8038FF68(void){
if(map_get() != MAP_12_GV_GOBIS_VALLEY) return;
if(jiggyscore_isCollected(JIGGY_42_GV_WATER_PYRAMID)){
func_8034DE60(func_8034C528(0x190), 0.0f, 270.0f, 0.0f, 1);
}
else{
func_8034E71C(func_8034C5AC(0x130), -1500, 0.0f);
}
}
void func_8038FFF4(void){}

54
src/GV/code_9C10.c Normal file
View File

@@ -0,0 +1,54 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
/* .bss */
extern u8 D_80391AD0;
/* .code */
void func_80390000(s32 arg0){
Struct73s *tmp_v0;
Struct6Ds *tmp_v0_2;
D_80391AD0 = arg0;
if(D_80391AD0 == 1){
set_camera_to_node(0x14);
func_80324E38(0.0f, 3);
timed_setCameraToNode(4.0f, 0x15);
func_80324E38(8.0f, 0);
tmp_v0 = func_8034C5AC(0x130);
if(tmp_v0){
func_8034E71C(tmp_v0, -1000, 0.0f);
func_8034E71C(tmp_v0, 0, 10.0f);
}
tmp_v0_2 = func_8034C528(0x190);
if(tmp_v0_2){
func_8034DE60(tmp_v0_2, 0.0f, 270.0f, 0.0f, 1);
}
}//L803900AC
if(D_80391AD0 == 2){
levelSpecificFlags_set(6, FALSE);
func_803228D8();
func_802E4078(MAP_15_GV_WATER_PYRAMID, 1, 0);
}
}
void func_803900F8(void){}
void func_80390100(void){
D_80391AD0 = 0;
if(levelSpecificFlags_get(6)){
func_80390000(1);
}
}
void func_80390138(void){
if(D_80391AD0 && func_80334904() == 2){
if(D_80391AD0 == 1 && timedFuncQueue_is_empty()){
func_80390000(2);
}
}
}

239
src/GV/code_9DB0.c Normal file
View File

@@ -0,0 +1,239 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
extern void func_8034E120(void *, f32, f32, f32, s32);
typedef struct {
s16 unk0;
s16 unk2;
Struct6Ds *unk4;
}Struct_GV_9DB0_1;
/* .data */
Struct_GV_9DB0_1 D_80391650[] = {
{0x190, 1, 0 },
{0x191, 5, 0 },
{0x192, 3, 0 },
{0x193, 4, 0 },
{0x194, 3, 0 },
{0x195, 7, 0 },
{0x196, 0, 0 },
{0x197, 4, 0 },
{0x198, 0, 0 },
{0x199, 2, 0 },
{0x19A, 6, 0 },
{0x19B, 1, 0 },
{0x19C, 6, 0 },
{0x19D, 5, 0 },
{0x19E, 2, 0 },
{0x19F, 7, 0 },
{0x000, 0, 0 },
};
f32 D_803916D8[3] = {0.0f, 100.0f, 0.0f};
/*.bss */
extern struct {
Struct_GV_9DB0_1 *tile1_0;
Struct_GV_9DB0_1 *tile2_4;
u8 matchCnt_8;//match_count
u8 state_9;
//u8 padA[0x2];
f32 unkC;
ActorMarker *unk10;
}D_80391AE0;
/* .code */
Struct_GV_9DB0_1 * func_803901A0(s32 arg0){
int i;
for(i = 0; D_80391650[i].unk0 != 0; i++){
if(arg0 == D_80391650[i].unk0)
return D_80391650 + i;
}
return NULL;
}
void func_803901F0(void *arg0){
FUNC_8030E624(SFX_3F6_UNKNOWN, 1.0f, 30000);
}
void func_80390218(void *arg0){
FUNC_8030E624(SFX_7F_HEAVYDOOR_SLAM, 0.8f, 32725);
func_8030E6D4(SFX_7F_HEAVYDOOR_SLAM);
}
void func_80390248(void){
jiggySpawn(JIGGY_40_GV_MATCHING_GAME, D_803916D8);
}
//matchingGame_setState
void func_80390270(s32 next_state){
if(next_state == 2){
item_set(ITEM_6_HOURGLASS, 1);
if(func_803203FC(2))
item_set(ITEM_0_HOURGLASS_TIMER, 4499);
else
item_set(ITEM_0_HOURGLASS_TIMER, 5999);
}
if(D_80391AE0.state_9 == 2){
item_set(ITEM_6_HOURGLASS, 0);
}
if(next_state == 3){
if(func_803203FC(2)){
func_803204E4(3, 0);
func_803204E4(5, 0);
}
else{
func_8028F66C(0xf);
}
}
if(next_state == 4){
if(func_803203FC(2)){
func_803204E4(3, 0);
func_803204E4(5, 1);
}
else{
func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 0x7fff);
if(D_80391AE0.unk10){
func_8035D490(D_80391AE0.unk10);
}
func_80324E38(0.5f, 3);
timed_setCameraToNode(1.5f, 2);
timedFunc_set_0(1.7f, func_80390248);
func_80324E88(4.0f);
func_80324E38(4.0f, 0);
}
}//L803903D8
D_80391AE0.state_9 = next_state;
}
//matchingGame_reset
void func_803903EC(void){
func_80390270(0);
}
//matchingGame_init
void func_8039040C(void){
Actor *actor;
D_80391AE0.state_9 = 0;
if(map_get() == MAP_13_GV_MEMORY_GAME){
if( !jiggyscore_isSpawned(JIGGY_40_GV_MATCHING_GAME) //jiggy is collected
|| func_803203FC(2) //in FF minigame
){
D_80391AE0.matchCnt_8 = 0;
D_80391AE0.tile1_0 = NULL;
D_80391AE0.tile2_4 = NULL;
D_80391AE0.state_9 = 1;
D_80391AE0.unkC = 0.0f;
actor = func_80326EEC(0x34f);
if(actor){
D_80391AE0.unk10 = actor->marker;
}
else{
D_80391AE0.unk10 = NULL;
}
}
}
}
void func_803904A8(void){
f32 sp5C;
f32 sp50[3];
s32 sp4C;
Struct6Ds *sp48;
Struct_GV_9DB0_1 * sp44;
f32 sp38[3];
f32 pad34;
sp5C = time_getDelta();
if(!D_80391AE0.state_9)
return;
if(D_80391AE0.unk10 && !D_80391AE0.unk10->unk5C){
D_80391AE0.unk10 = NULL;
}
if(D_80391AE0.tile1_0 == NULL || D_80391AE0.tile2_4 == NULL){
if( player_getActiveHitbox(0) == HITBOX_1_BEAK_BUSTER && func_8028F20C()){
player_getPosition(sp50);
sp4C = func_8033F3E8(func_80309744(0), sp50, 0x190, 0x1a0);
if(sp4C){
sp48 = func_8034C528(sp4C);
if(D_80391AE0.state_9 == 1){
func_80390270(2);
}
if(func_8034DC78(sp48) != 1){
sp44 = func_803901A0(sp4C);
func_8034E254(sp48, func_803901F0);
func_8034E25C(sp48, func_80390218);
func_8034E120(sp48, 0.0f, 180.0f, 0.7f, 1);
D_80391AE0.tile2_4 = D_80391AE0.tile1_0;
D_80391AE0.tile1_0 = sp44;
sp44->unk4 = sp48;
if(D_80391AE0.unk10){
func_8035D4F0(D_80391AE0.unk10, sp4C);
}
}
}
}
}//L80390608
if(D_80391AE0.tile1_0 && D_80391AE0.tile2_4){
s32 sp48;
if( func_8034DC78(D_80391AE0.tile1_0->unk4) == 1 && func_8034DC78(D_80391AE0.tile2_4->unk4) == 1){
if(0.0f < D_80391AE0.unkC){
if(0.6 < D_80391AE0.unkC && D_80391AE0.unkC - sp5C <= 0.6){
func_8025A6EC(COMUSIC_2C_BUZZER, 0x7fff);
}//L803906AC
D_80391AE0.unkC -= sp5C;
if(D_80391AE0.unkC <= 0.0f){
func_8034E254(D_80391AE0.tile1_0->unk4, 0);
func_8034E25C(D_80391AE0.tile1_0->unk4, 0);
func_8034E120(D_80391AE0.tile1_0->unk4, 180.0f, 0.0f, 0.5f, 2);
func_8034E120(D_80391AE0.tile2_4->unk4, 180.0f, 0.0f, 0.5f, 2);
player_getPosition(sp38);
sp48 = func_8033F3E8(func_80309744(0), sp38, 0x190, 0x1a0);
if(sp48 == D_80391AE0.tile1_0->unk0 || sp48 == D_80391AE0.tile2_4->unk0){
func_8028F66C(0x14);
}
D_80391AE0.tile1_0 = D_80391AE0.tile2_4 = NULL;
}
}//L80390788
else{
if(D_80391AE0.tile2_4->unk2 == D_80391AE0.tile1_0->unk2){
D_80391AE0.matchCnt_8++;
if(D_80391AE0.matchCnt_8 == 8){
func_80390270(4); //end game state
}
else{
func_8025A6EC(COMUSIC_2B_DING_B, 0x7fff);
}
D_80391AE0.tile1_0 = D_80391AE0.tile2_4 = NULL;
}//L803907E4
else{
D_80391AE0.unkC = 1.0f;
}
}//L803907EC
}//L803907F0
}//L803907F0
if( D_80391AE0.state_9 == 1
&& func_803203FC(2)
&& func_803203FC(3)
){
func_80390270(2);
}
if(D_80391AE0.state_9 == 2){
if(D_80391AE0.tile1_0 == NULL || D_80391AE0.tile2_4 == NULL){
if(item_empty(ITEM_6_HOURGLASS)){
func_80390270(3);
}
}
}
}

105
src/GV/code_A490.c Normal file
View File

@@ -0,0 +1,105 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
/* .bss */
struct {
u8 unk0;
f32 unk4;
}D_80391B00;
/* .code */
void func_80390880(void){
void *tmp_v0;
tmp_v0 = func_8034C5AC(300);
if(tmp_v0){
func_8034E7B8(tmp_v0, -1460, 20.0f, 2, 20.0f);
}
}
void func_803908C4(s32 arg0){
void *tmp_v0;
D_80391B00.unk0 = arg0;
if(D_80391B00.unk0 == 2){
func_80324E38(0.0f, 3);
timed_setCameraToNode(0.0f, 0);
timedFunc_set_0(3.0f, func_80390880);
timed_setCameraToNode(3.0f, 1);
func_80324E38(6.0f, 0);
tmp_v0 = func_8034C528(400);
if(tmp_v0){
func_8030E760(SFX_3F6_UNKNOWN, 0.7f, 28000);
func_8030E760(SFX_3F6_UNKNOWN, 0.9f, 29000);
func_8030E760(SFX_3F6_UNKNOWN, 1.0f, 30000);
func_8034DE60(tmp_v0, 0.0f, 400.0f, 2.5f, 1);
}
}
if(D_80391B00.unk0 == 3){
levelSpecificFlags_set(6, TRUE);
func_803228D8();
func_803204E4(0xe, 1);
func_802E4078(MAP_12_GV_GOBIS_VALLEY, 0, 0);
}
}
void func_803909EC(void){}
void func_803909F4(void){
void *tmp_v0;
void *tmp_v0_2;
D_80391B00.unk0 = 0;
if(map_get() != MAP_15_GV_WATER_PYRAMID) return;
if(jiggyscore_isCollected(JIGGY_42_GV_WATER_PYRAMID)){
tmp_v0 = func_8034C528(400);
if(tmp_v0)
func_8034DE60(tmp_v0, 0.0f, 400.0f, 0.0f, 2);
tmp_v0_2 = func_8034C5AC(300);
if(tmp_v0_2)
func_8034E71C(tmp_v0_2, -1460, 0.0f);
}
else{
D_80391B00.unk4 = 0.0f;
func_803908C4(1);
}
}
void func_80390A94(void){
f32 time_delta;
void *tmp_v0;
time_delta = time_getDelta();
if(!D_80391B00.unk0) return;
if(D_80391B00.unk0 == 1){
if(0.0f < D_80391B00.unk4){
D_80391B00.unk4 -= time_delta;
if(D_80391B00.unk4 <= 0.0f){
func_803908C4(2);
}
}
else{
if(jiggyscore_isCollected(JIGGY_42_GV_WATER_PYRAMID)){
D_80391B00.unk4 = 0.01f;
}
}
}//L80390B34
if(D_80391B00.unk0 == 2){
tmp_v0 = func_8034C528(0x190);
if(tmp_v0 && func_8034DC78(tmp_v0) == 1){
func_8030E760(SFX_7F_HEAVYDOOR_SLAM, 0.8f, 0x7fd0);
func_8030E760(SFX_7F_HEAVYDOOR_SLAM, 0.9f, 0x7fc6);
func_8030E760(SFX_7F_HEAVYDOOR_SLAM, 1.0f, 0x7fc6);
func_8034E264(tmp_v0, 2);
}
if(timedFuncQueue_is_empty())
func_803908C4(3);
}
}

232
src/GV/code_D60.c Normal file
View File

@@ -0,0 +1,232 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
extern func_802EBA98(s32, f32[3], s32, f32, s32, f32[3], f32, f32[3]);
typedef struct {
u8 unk0[2];
//u8 pad2[2];
f32 unk4;
f32 unk8;
f32 unkC;
f32 unk10;
f32 unk14;
}ActorLocal_GV_D60;
void func_80387408(Actor *this);
Actor *chgobi1_draw(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
/* .data */
ActorInfo D_80390C80 = { MARKER_BC_GOBI_1, ACTOR_12E_GOBI_1, ASSET_3E0_MODEL_GOBI,
0, NULL,
NULL, func_80387408, chgobi1_draw,
0, 0x533, 0.0f, 0
};
/* .bss */
struct {
u8 unk0;
u8 unk1;
}D_80391A40;
/* .code */
void func_80387150(Actor *this, s32 next_state){
ActorLocal_GV_D60 *local = (ActorLocal_GV_D60 *)&this->local;
this->state = next_state;
D_80391A40.unk0 = FALSE;
D_80391A40.unk1 = FALSE;
if(this->state == 1){
func_80335924(this->unk148, 0xd9, 0.5f, 4.0f);
local->unk4 = randf2(2.0f, 10.0f);
}
if(this->state == 2){
func_80335924(this->unk148, 0xda, 1.0f, 5.0f);
local->unkC = 0.9f;
D_80391A40.unk0 = TRUE;
}
if(this->state == 3){
func_8028F918(2);
func_80335924(this->unk148, 0xf7, 1.0f, 5.33f);
local->unk14 = 0.01f;
D_80391A40.unk1 = TRUE;
}
if(this->state == 4){
func_80335924(this->unk148, 0xf8, 0.7f, 0.71f);
}
if(this->state == 6){
FUNC_8030E8B4(SFX_84_GOBI_CRYING, 0.9f, 20000, this->position, 1500, 2500);
func_80335924(this->unk148, 0x241, 0.2f, 0.5f);
}
}
Actor *chgobi1_draw(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
Actor *this = marker_getActor(this_marker);
if(this->state == 0 || this->state == 5){
return this;
}
else{
return func_80325888(this_marker, gfx, mtx, vtx);
}
}
s32 func_80387354(void){
return D_80391A40.unk0;
}
s32 func_80387360(void){
return D_80391A40.unk1;
}
void func_8038736C(Actor *this){
ActorLocal_GV_D60 *local = (ActorLocal_GV_D60 *)&this->local;
func_80387150(this, 0);
func_8030DA44(local->unk0[0]);
func_8030DA44(local->unk0[1]);
}
void func_803873B0(ActorMarker *this_marker, ActorMarker *other_marker){
Actor *this = marker_getActor(this_marker);
if( player_getActiveHitbox(NULL) == HITBOX_A_FAST_FALLING
|| player_getActiveHitbox(NULL) == HITBOX_1_BEAK_BUSTER
){
this->unk1C[0] = 1.0f;
}
}
void func_80387408(Actor *this){
ActorMarker *marker = this->marker;
ActorLocal_GV_D60 *local = (ActorLocal_GV_D60 *)&this->local;
s32 sp6C = 0;
f32 tick; //sp68;
int i;
s32 tmp_s1;
f32 sp54[3];
f32 sp48[3];
tick = time_getDelta();
if(!this->unk16C_4){
this->unk16C_4 = TRUE;
marker_setCollisionScripts(this->marker, func_803873B0, NULL, NULL);
marker->unk30 = func_8038736C;
marker->propPtr->unk8_3 = TRUE;
marker->collidable = TRUE;
D_80391A40.unk0 = 0;
D_80391A40.unk1 = 0;
local->unk0[0] = func_8030D90C();
local->unk0[1] = func_8030D90C();
local->unk8 = 0.0f;
local->unkC = 0.0f;
local->unk10 = 0.0f;
local->unk14 = 0.0f;
this->unk1C[0] = 0.0f;
this->unk1C[1] = 0.0f;
func_80387150(this, 1);
if(jiggyscore_isSpawned(JIGGY_44_GV_GOBI_1) && ! func_803203FC(1)){
marker_despawn(this->marker);
}
return;
}//L80387514
if(func_8025773C(&local->unk8, tick))
sp6C = 5;
if(func_8025773C(&local->unkC, tick))
FUNC_8030E8B4(SFX_84_GOBI_CRYING, 0.9f, 32000, this->position, 1500, 2500);
if(func_8025773C(&local->unk10, tick)){
for(i = 0; i < 2; i++){
sfxsource_setSfxId(local->unk0[i], SFX_3F9_UNKNOWN);
func_8030DD14(local->unk0[i], 3);
sfxsource_setSampleRate(local->unk0[i], 32000);
func_8030E2C4(local->unk0[i]);
}
}
if(func_8025773C(&local->unk14, tick)){
local->unk10 = 0.75f;
local->unk8 = 7.5f;
timed_setCameraToNode(0.5f, 0xa);
timed_playSfx(1.0f, SFX_84_GOBI_CRYING, 1.1f, 30000);
timed_playSfx(2.0f, SFX_84_GOBI_CRYING, 1.3f, 30000);
timed_playSfx(2.5f, SFX_74_WALKING_NOISE_5, 0.5f, 30000);
func_80324DBC(3.0f, ASSET_A74_TEXT_GOBI_HELPED, 0x2a, this->position, NULL, NULL, NULL);
timed_playSfx(5.0f, SFX_2E_BIGBUTT_RUNNING, 1.0f, 20000);
timed_playSfx(5.6f, SFX_2E_BIGBUTT_RUNNING, 1.0f, 20000);
timed_playSfx(6.5f, SFX_2E_BIGBUTT_RUNNING, 1.0f, 20000);
func_80324E88(7.6f);
}
if(this->state == 1 || this->state == 2){
if(func_80388D78())
sp6C = 3;
}
if(this->state == 2){
if(func_80335794(this->unk148) > 0)
sp6C = 1;
}
if(this->state == 1 || this->state == 2){
if( !this->unk138_24
&& func_80329530(this, 250)
&& !func_80329530(this, 80)
&& func_8028F2A0()
&& func_80311480(0xa73, 0, NULL, NULL, NULL, NULL)
){
this->unk138_24 = 1;
}
}//L803877A4
if(this->state == 1){
if(this->unk1C[0] != 0.0f && this->unk1C[1] == 0.0f ){
sp6C = 6;
}//L803877F0
else{
if(func_8025773C(&local->unk4, tick))
sp6C = 2;
}
}//L80387808
if(this->state == 3){
if(func_80335794(this->unk148) > 0)
sp6C = 4;
}//L80387830
if(this->state == 4){
func_80326224(this);
tmp_s1 = func_8033A12C(func_80330B1C(this->marker));
if(tmp_s1){
player_getPosition(sp54);
sp54[1] += 50.0f;
if(func_802EBA98(tmp_s1, this->position, 0, 1.0f, 0, sp54, 40.0f, sp48)){
func_8028F428(2, this->marker);
}
}
}
if(this->state == 5){
if(timedFuncQueue_is_empty()){
func_8028F918(0);
marker_despawn(this->marker);
}
}
if(this->state == 6){
if(func_80335794(this->unk148) > 0)
sp6C = 1;
}
this->unk1C[1] = this->unk1C[0];
this->unk1C[0] = 0.0f;
if(sp6C)
func_80387150(this, sp6C);
}