diff --git a/include/enums.h b/include/enums.h index 9437ff50..28c8bdaf 100644 --- a/include/enums.h +++ b/include/enums.h @@ -4640,7 +4640,7 @@ enum common_particle_e{ enum bsgroup_e { BSGROUP_3_WONDERWING = 0x3, - + BSGROUP_4_LOOK = 0x4, BSGROUP_5_CLIMB = 0x5, BSGROUP_6_TURBO_TALON_TRAINERS, BSGROUP_7_CROC_ATTACK, @@ -4673,8 +4673,15 @@ enum misc_flag_e{ //0x13 in difficult terrain (mud) MISC_FLAG_14_LOSE_BOGGY_RACE = 0x14, //0x15 touching loadzone? - + MISC_FLAG_17_FPV = 0x17, MISC_FLAG_1B_TRANSFORMING = 0x1B }; +enum nc_first_person_state{ + FIRSTPERSON_STATE_1_ENTER = 1, + FIRSTPERSON_STATE_2_IDLE, + FIRSTPERSON_STATE_3_EXIT, + FIRSTPERSON_STATE_4_DONE +}; + #endif diff --git a/include/functions.h b/include/functions.h index 145deaec..11ac0cf0 100644 --- a/include/functions.h +++ b/include/functions.h @@ -397,7 +397,7 @@ void func_8030E2C4(u8); void func_8030E394(u8 indx); void func_8030E484(enum sfx_e uid); void func_8030E4E4(enum sfx_e uid); -void func_8030E510(enum sfx_e uid, s32 arg1); +void sfxsource_play(enum sfx_e uid, s32 sample_rate); void func_8030E540(enum sfx_e uid); void func_8030E560(enum sfx_e uid, s32 arg1); void func_8030E58C(enum sfx_e uid, f32 arg1); diff --git a/src/BGS/ch/pinkegg.c b/src/BGS/ch/pinkegg.c index a455aabb..8f1193d9 100644 --- a/src/BGS/ch/pinkegg.c +++ b/src/BGS/ch/pinkegg.c @@ -84,7 +84,7 @@ void chpinkegg_collision(ActorMarker *this, ActorMarker *other_marker){ thisActor = marker_getActor(this); this->propPtr->unk8_3 = 0; - func_8030E510(SFX_AA_BGS_EGG_BREAKING_1, 28000); + sfxsource_play(SFX_AA_BGS_EGG_BREAKING_1, 28000); subaddie_set_state(thisActor, 3); actor_playAnimationOnce(thisActor); this->collidable = 0; diff --git a/src/CC/code_13C0.c b/src/CC/code_13C0.c index de5b4afe..fb291f0c 100644 --- a/src/CC/code_13C0.c +++ b/src/CC/code_13C0.c @@ -150,7 +150,7 @@ void func_80387CC0(void){ return; viewport_get_rotation_vec3f(sp1C); - tmp_v0 = func_8023DB4C(0x7F); + tmp_v0 = globalTimer_getTimeMasked(0x7F); if(tmp_v0 >= 0x40){ tmp_v0 = 0x7F - tmp_v0; } diff --git a/src/CCW/code_3050.c b/src/CCW/code_3050.c index 12698181..ea928bba 100644 --- a/src/CCW/code_3050.c +++ b/src/CCW/code_3050.c @@ -13,7 +13,7 @@ void func_80389440(Actor *this, s32 next_state) { void *temp_v0; if (next_state == 2) { - func_8030E510(SFX_AA_BGS_EGG_BREAKING_1, 28000); + sfxsource_play(SFX_AA_BGS_EGG_BREAKING_1, 28000); this->marker->propPtr->unk8_3 = FALSE; fileProgressFlag_set(FILEPROG_E6_SPRING_EYRIE_HATCHED, TRUE); skeletalAnim_set(this->unk148, 0x187, 0.0f, 2.0f); diff --git a/src/FP/ch/boggy2.c b/src/FP/ch/boggy2.c index fe3737db..b73d2008 100644 --- a/src/FP/ch/boggy2.c +++ b/src/FP/ch/boggy2.c @@ -70,7 +70,7 @@ Actor *func_80388740(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ || this->state == 6 || this->state == 8 ){ - if(this->unk4C != 0.0f && (func_8023DB5C() & 1)){ + if(this->unk4C != 0.0f && (globalTimer_getTime() & 1)){ if(-2.0 < this->roll){ func_8034A174(func_80329934(), 6, sp2C); particleEmitter_setPosition(local->unk0, sp2C); diff --git a/src/FP/ch/twinklybox.c b/src/FP/ch/twinklybox.c index 774f7a89..f47efbca 100644 --- a/src/FP/ch/twinklybox.c +++ b/src/FP/ch/twinklybox.c @@ -319,7 +319,7 @@ void func_8038D6C8(Actor *this){ if(!func_80329530(this, 800)) break; - if(!(func_8023DB5C() & 1)) + if(!(globalTimer_getTime() & 1)) subaddie_set_state_with_direction(this, 2, 0.001f, 1); else subaddie_set_state_with_direction(this, 2, 0.999f, 0); diff --git a/src/FP/ch/xmastreeeggtoll.c b/src/FP/ch/xmastreeeggtoll.c index 702a02c2..1ce1a850 100644 --- a/src/FP/ch/xmastreeeggtoll.c +++ b/src/FP/ch/xmastreeeggtoll.c @@ -74,11 +74,11 @@ void func_80390EB0(Actor *this){ if(func_8024DB50(this->position, 150.0f) || func_80329530(this, 1200)) { - if( !(func_8023DB5C() & 3) && randf() < 0.2){ + if( !(globalTimer_getTime() & 3) && randf() < 0.2){ func_80390C70(this->position); } - if( !(func_8023DB5C() & 3) && randf() < 0.7){ + if( !(globalTimer_getTime() & 3) && randf() < 0.7){ func_80390D58(this->position); } } diff --git a/src/FP/code_ABD0.c b/src/FP/code_ABD0.c index c33e79d8..fd5c16ef 100644 --- a/src/FP/code_ABD0.c +++ b/src/FP/code_ABD0.c @@ -87,7 +87,7 @@ void func_80391040(Actor *this){ if( !this->marker->unk14_21 ) return; if( !func_80390FC0() ) return; - if( func_8023DB5C() & 7 ) return; + if( globalTimer_getTime() & 7 ) return; if(randf() < 0.5){ a1 = 8; diff --git a/src/GV/ch/ancientone.c b/src/GV/ch/ancientone.c index 3554ed04..d564ac2f 100644 --- a/src/GV/ch/ancientone.c +++ b/src/GV/ch/ancientone.c @@ -176,7 +176,7 @@ void chAncientOne_update(Actor *this){ } } else{//L80386C64 - sp38 = func_8023DB5C() & 0xF; + sp38 = globalTimer_getTime() & 0xF; sp34 = LOCAL_CH_ANCIENT_ONE(this)->unk1C + 40.0f; this->position_y += 18.0; this->position_x += (sp38 & 1) ? 0x17 : -0x17; diff --git a/src/GV/ch/histup.c b/src/GV/ch/histup.c index 9b1efd8b..d5c81e1c 100644 --- a/src/GV/ch/histup.c +++ b/src/GV/ch/histup.c @@ -216,7 +216,7 @@ void func_8038DBDC(Actor *this){ } else{ if(actor_animationIsAt(this, 0.42f)) - func_8030E510(SFX_7C_CHEBOOF, 32000); + sfxsource_play(SFX_7C_CHEBOOF, 32000); tmp = this->unk44_31; if(tmp && func_8030E3FC(tmp)){ if(1.0 < this->unk1C[1]){ diff --git a/src/GV/code_5570.c b/src/GV/code_5570.c index 2aecc5d6..9b271158 100644 --- a/src/GV/code_5570.c +++ b/src/GV/code_5570.c @@ -293,7 +293,7 @@ void GV_func_8038BEA0(Actor *this){ else{ func_8030E2C4(this->unk44_31); this->position_y -= 7.0; - if(func_8023DB5C() & 1){ + if(globalTimer_getTime() & 1){ sp38[0] = this->position_x; sp38[1] = this->position_y; sp38[2] = this->position_z; diff --git a/src/MM/ch/chimpystump.c b/src/MM/ch/chimpystump.c index 201d4846..d0f9c536 100644 --- a/src/MM/ch/chimpystump.c +++ b/src/MM/ch/chimpystump.c @@ -27,8 +27,8 @@ void _chchimpystump_80386CA0(Actor *this){ func_802BB3DC(1, 3.0f, 1.0f); func_80244BB0(0, 0x6A, 0x7FF8, 0.2f); }//L80386D0C - this->position_x = ((func_8023DB5C() & 1) * 2) ^ (s32)this->position_x; - this->position_z = ((func_8023DB5C() & 2) * 2) ^ (s32)this->position_z; + this->position_x = ((globalTimer_getTime() & 1) * 2) ^ (s32)this->position_x; + this->position_z = ((globalTimer_getTime() & 2) * 2) ^ (s32)this->position_z; } } @@ -57,7 +57,7 @@ void chchimpystump_update(Actor *this){ func_802BB41C(1); func_80244C78(0); } - if((func_8023DB5C() & 3) == 2) + if((globalTimer_getTime() & 3) == 2) func_80353064(this->position, 40.0f); break; case 3: diff --git a/src/MM/ch/conga.c b/src/MM/ch/conga.c index edc783c3..04eac78e 100644 --- a/src/MM/ch/conga.c +++ b/src/MM/ch/conga.c @@ -83,7 +83,7 @@ void func_80386FB0(Actor *this){ } void func_80386FE8(void){ - if( (func_8023DB5C() & 0xF) == 0xB + if( (globalTimer_getTime() & 0xF) == 0xB && 0.85 < randf () && !func_803114B0() ){ diff --git a/src/RBB/ch/dolphin.c b/src/RBB/ch/dolphin.c index a308f533..9f0c806a 100644 --- a/src/RBB/ch/dolphin.c +++ b/src/RBB/ch/dolphin.c @@ -34,8 +34,8 @@ void func_8038B900(Actor *this){ this->marker->propPtr->unk8_3 = 1; if(this->marker->unk14_21){ sp54 = skeletalAnim_getProgress(this->unk148); - if( ( func_8023DB5C() & (1 << 4) ) - && ( func_8023DB5C() & (1 << 2) ) + if( ( globalTimer_getTime() & (1 << 4) ) + && ( globalTimer_getTime() & (1 << 2) ) && ( randf() < 0.90 ) ){ if( ( this->state == 3 diff --git a/src/core1/code_0.c b/src/core1/code_0.c index e73c1d2b..98d718b9 100644 --- a/src/core1/code_0.c +++ b/src/core1/code_0.c @@ -14,7 +14,7 @@ void func_8023DFF0(s32); s32 D_80275610 = 0; s32 D_80275614 = 0; -u32 D_80275618 = 0; +u32 gGlobalTimer = 0; u32 D_8027561C[] = { 0x9, 0x4, 0xA, 0x3, 0xB, 0x2, 0xC, 0x5, 0x0, 0x1, 0x6, 0xD, -1 @@ -70,16 +70,16 @@ void func_8023DA9C(s32 arg0){ func_80255CD8(); } -u32 func_8023DB4C(u32 arg0){ - return D_80275618 & arg0; +u32 globalTimer_getTimeMasked(u32 mask){ + return gGlobalTimer & mask; } -s32 func_8023DB5C(void){ - return D_80275618; +s32 globalTimer_getTime(void){ + return gGlobalTimer; } -void func_8023DB68(void){ - D_80275618 = 0; +void globalTimer_reset(void){ + gGlobalTimer = 0; } s32 func_8023DB74(void){ @@ -122,16 +122,16 @@ void core1_init(void){ ml_init(); gctransition_reset(); D_8027A130 = 0; - D_80275618 = 0; + gGlobalTimer = 0; func_8023DA9C(3); } -void func_8023DCDC(void){ - D_80275618++; +void globalTimer_incTimer(void){ + gGlobalTimer++; } -void func_8023DCF4(void){ - D_80275618--; +void globalTimer_decTimer(void){ + gGlobalTimer--; } void mainLoop(void){ @@ -141,12 +141,12 @@ void mainLoop(void){ u16 rgba; s32 offset; - if((func_8023DB5C() & 0x7f) == 0x11) + if((globalTimer_getTime() & 0x7f) == 0x11) sns_write_payload_over_heap(); func_8023DA74(); if(D_8027A130 != 3 || getGameMode() != GAME_MODE_4_PAUSED) - func_8023DCDC(); + globalTimer_incTimer(); if(!D_8027BEEC) pfsManager_update(); @@ -183,7 +183,7 @@ void mainLoop(void){ //render weird CRC failure image for(y= 0x1e; y < framebuffer_height - 0x1e; y++){//L8023DEB4 for(x = 0x14; x < 0xeb; x++){ - tmp = ((8 * func_8023DB5C()) + ((x*x) + (y*y))); + tmp = ((8 * globalTimer_getTime()) + ((x*x) + (y*y))); r = _SHIFTL(x>>3, 11, 5); g = _SHIFTL(y>>3, 6, 5); diff --git a/src/core1/code_10A00.c b/src/core1/code_10A00.c index 01692e67..fbefb2ab 100644 --- a/src/core1/code_10A00.c +++ b/src/core1/code_10A00.c @@ -133,7 +133,7 @@ s32 func_8024E67C(s32 controller_index){ } s32 func_8024E698(s32 controller_index){ - if(func_8023DB5C() < 2){ + if(globalTimer_getTime() < 2){ return 0; } diff --git a/src/core1/code_11AC0.c b/src/core1/code_11AC0.c index 280d51b0..ce2db4e8 100644 --- a/src/core1/code_11AC0.c +++ b/src/core1/code_11AC0.c @@ -322,7 +322,7 @@ void func_8024F890(u8 arg0, enum comusic_e arg1){ alCSPSetSeq(&D_80281720[arg0].cseqp, &D_80281720[arg0].cseq); alCSPPlay(&D_80281720[arg0].cseqp); alCSPSetVol(&D_80281720[arg0].cseqp, D_80281720[arg0].unk0); - if(player_is_present() && func_8028EE84() == BSWATERGROUP_2_UNDERWATER){ + if(player_is_present() && player_getWaterState() == BSWATERGROUP_2_UNDERWATER){ func_8025F3F0(&D_80281720[arg0].cseqp, 0.0f, 1.0f); } else{ @@ -433,7 +433,7 @@ void func_8024FE44(u8 arg0, f32 arg1, f32 arg2){ D_80281720[arg0].unk17C = arg1; D_80281720[arg0].unk180 = arg2; if(func_80250074(arg0) == 0){ - if(func_8028EE84() == BSWATERGROUP_2_UNDERWATER){ + if(player_getWaterState() == BSWATERGROUP_2_UNDERWATER){ func_8025F3F0(&D_80281720[arg0].cseqp, 0.0f, 1.0f); }else{ func_8025F3F0(&D_80281720[arg0].cseqp, arg1, arg2); diff --git a/src/core1/code_1D5D0.c b/src/core1/code_1D5D0.c index 0335e3e6..a228ac93 100644 --- a/src/core1/code_1D5D0.c +++ b/src/core1/code_1D5D0.c @@ -211,7 +211,7 @@ void sns_write_payload_over_heap(void) s32 val2; u32 i; - if (func_8023DB5C() <= 0x3B || snsToRestoreItems) + if (globalTimer_getTime() <= 0x3B || snsToRestoreItems) return; sns_generate_payload(snsBasePayloadPtr2); diff --git a/src/core1/code_9D30.c b/src/core1/code_9D30.c index 3031ca4d..607f178c 100644 --- a/src/core1/code_9D30.c +++ b/src/core1/code_9D30.c @@ -197,12 +197,12 @@ void func_80247C20(void) { s32 i; if (D_80275BE4 == 0) { - D_80275BE4 = func_8023DB5C(); + D_80275BE4 = globalTimer_getTime(); return; } - if (func_8023DB5C() != D_80275BE4) { + if (globalTimer_getTime() != D_80275BE4) { D_80275BE0 = FALSE; - D_80275BE4 = func_8023DB5C(); + D_80275BE4 = globalTimer_getTime(); } if (D_80275BE0) { diff --git a/src/core1/code_CE60.c b/src/core1/code_CE60.c index 10991d14..d4ae6f9e 100644 --- a/src/core1/code_CE60.c +++ b/src/core1/code_CE60.c @@ -170,7 +170,7 @@ void func_8024AED8(void){ } void func_8024AF00(s32 arg0, s32 arg1){ - if(func_8028EE84() == BSWATERGROUP_2_UNDERWATER){ + if(player_getWaterState() == BSWATERGROUP_2_UNDERWATER){ func_8024A880(arg0); } else{ @@ -208,7 +208,7 @@ void func_8024AF48(void){ case MAP_7_TTC_TREASURE_TROVE_COVE: // L8024B094 func_8024A9EC(0); - if(func_8028EE84() == BSWATERGROUP_2_UNDERWATER){ + if(player_getWaterState() == BSWATERGROUP_2_UNDERWATER){ func_8024A880(0x600); } else if(func_8024A8DC(-0x12C, 0x58c, 0x866) @@ -228,7 +228,7 @@ void func_8024AF48(void){ case MAP_B_CC_CLANKERS_CAVERN: // L8024B158 func_8024A9EC(0); - if(func_8028EE84() == BSWATERGROUP_2_UNDERWATER){ + if(player_getWaterState() == BSWATERGROUP_2_UNDERWATER){ if(!(D_802806F8[1] < 0x28b)){ func_8024A8AC(0x8180, 5.0f); } @@ -242,7 +242,7 @@ void func_8024AF48(void){ break; case MAP_12_GV_GOBIS_VALLEY:// L8024B1BC - if(func_8028EE84() == BSWATERGROUP_2_UNDERWATER){ + if(player_getWaterState() == BSWATERGROUP_2_UNDERWATER){ func_8024A880(0x8020); } else if(func_8024A8DC(-0xf96, 0x1626, 0xe74)){ @@ -262,7 +262,7 @@ void func_8024AF48(void){ break; case MAP_1_SM_SPIRAL_MOUNTAIN: // L8024B23C - if(func_8028EE84() == BSWATERGROUP_2_UNDERWATER){ + if(player_getWaterState() == BSWATERGROUP_2_UNDERWATER){ func_8024A880(0x9000); } else{ @@ -360,7 +360,7 @@ void func_8024AF48(void){ break; case MAP_45_CCW_AUTUMN:// L8024B4D4 - if(func_8028EE84() == BSWATERGROUP_2_UNDERWATER){ + if(player_getWaterState() == BSWATERGROUP_2_UNDERWATER){ func_8024A880(0x600); } else{ @@ -382,7 +382,7 @@ void func_8024AF48(void){ break; case MAP_27_FP_FREEZEEZY_PEAK:// L8024B538 - if(func_8028EE84() == BSWATERGROUP_2_UNDERWATER){ + if(player_getWaterState() == BSWATERGROUP_2_UNDERWATER){ func_8024A880(0x400); } else if( mapSpecificFlags_get(0) && !jiggyscore_isCollected(JIGGY_2F_FP_XMAS_TREE)){ @@ -453,7 +453,7 @@ void func_8024AF48(void){ break; case MAP_6B_GL_180_NOTE_DOOR:// L8024B704 - if(func_8028EE84() == BSWATERGROUP_2_UNDERWATER){ + if(player_getWaterState() == BSWATERGROUP_2_UNDERWATER){ func_8024A880(0x8800); } else if(func_8024A8DC(0x10eb, 0x4f5, 0x730)) { @@ -476,7 +476,7 @@ void func_8024AF48(void){ break; case MAP_70_GL_CC_LOBBY:// L8024B7B4 - if(func_8028EE84() == BSWATERGROUP_2_UNDERWATER){ + if(player_getWaterState() == BSWATERGROUP_2_UNDERWATER){ func_8024A880(0x8100); } else if(func_8024A8DC(-0x19d6, -0x1d3, 0x71e)){ @@ -520,7 +520,7 @@ void func_8024AF48(void){ break; case MAP_71_GL_STATUE_ROOM:// L8024B8C0 - if(func_8028EE84() == BSWATERGROUP_2_UNDERWATER){ + if(player_getWaterState() == BSWATERGROUP_2_UNDERWATER){ func_8024A880(0x200); } else if(func_8024A8DC(-0xf0e, -0x15a, 0x302)){ @@ -570,7 +570,7 @@ void func_8024AF48(void){ break; case MAP_78_GL_RBB_AND_MMM_PUZZLE:// L8024BA98 - if(func_8028EE84() == BSWATERGROUP_2_UNDERWATER){ + if(player_getWaterState() == BSWATERGROUP_2_UNDERWATER){ func_8024A880(0x8200); } else if(0x15a <= D_802806F8[1] && func_8024A8DC(-0x89a, 0x21a, 0x368)){ diff --git a/src/core2/ba/falldamage.c b/src/core2/ba/falldamage.c index 2c1c4307..f76a937c 100644 --- a/src/core2/ba/falldamage.c +++ b/src/core2/ba/falldamage.c @@ -124,7 +124,7 @@ void bafalldamage_init(void){ void bafalldamage_update(void){ s32 player_position; player_position = func_8028ECAC(); - if(func_8028B2E8() || (func_8028EE84() != BSWATERGROUP_0_NONE) || player_position == BSGROUP_A_FLYING){ + if(player_isStable() || (player_getWaterState() != BSWATERGROUP_0_NONE) || player_position == BSGROUP_A_FLYING){ bafalldamage_start(); bafalldamage_set_state(1); } diff --git a/src/core2/ba/marker.c b/src/core2/ba/marker.c index 911100db..ca3e0209 100644 --- a/src/core2/ba/marker.c +++ b/src/core2/ba/marker.c @@ -529,7 +529,7 @@ void __baMarker_resolveCollision(Prop *other_prop){ player_getPosition(spA0); jiggy_id = chjiggy_getJiggyId(actor); if( jiggy_id != JIGGY_2F_FP_XMAS_TREE - || (func_8028B2E8() && !(3600.0f < ml_distanceSquared_vec3f(actor->position, spA0))) + || (player_isStable() && !(3600.0f < ml_distanceSquared_vec3f(actor->position, spA0))) ){ jiggyscore_setCollected(jiggy_id, TRUE); item_adjustByDiffWithoutHud(ITEM_26_JIGGY_TOTAL, 1); @@ -686,7 +686,7 @@ void __baMarker_resolveCollision(Prop *other_prop){ break; case MARKER_6B_GLOOPBUBBLE: //L8028CD20 - if(func_8028EE84() == BSWATERGROUP_2_UNDERWATER){ + if(player_getWaterState() == BSWATERGROUP_2_UNDERWATER){ item_adjustByDiffWithHud(ITEM_17_AIR, fxairscore_count_to_time(2)); } break; diff --git a/src/core2/ba/model.c b/src/core2/ba/model.c index 1427f43e..8037a355 100644 --- a/src/core2/ba/model.c +++ b/src/core2/ba/model.c @@ -269,7 +269,7 @@ void baModel_setVisible(s32 arg0){ } void baModel_802921D4(f32 arg0[3]){ - if(func_8028EE84() == BSWATERGROUP_0_NONE){ + if(player_getWaterState() == BSWATERGROUP_0_NONE){ D_8037C150.unk0 = 1; D_8037C150.unk4[0] = arg0[0]; D_8037C150.unk4[1] = arg0[1]; diff --git a/src/core2/bs/ant.c b/src/core2/bs/ant.c index b4b4f01d..67be96dd 100644 --- a/src/core2/bs/ant.c +++ b/src/core2/bs/ant.c @@ -96,7 +96,7 @@ void bsant_idle_update(void){ if(func_8028B094()) new_state = BS_38_ANT_FALL; - if(func_80294F78()) + if(should_look_first_person_camera()) new_state = badrone_look(); if(func_8029B300() > 0) @@ -203,7 +203,7 @@ void bsant_jump_update(void){ break; case 2://L8029EAF4 func_80299628(0); - if(func_8028B2E8()){ + if(player_isStable()){ func_8029C5E8(); bsant_substate = 3; } @@ -213,7 +213,7 @@ void bsant_jump_update(void){ sp2C = BS_35_ANT_IDLE; break; }//L8029EB38 - if(func_8028B2E8()){ + if(player_isStable()){ baphysics_set_target_horizontal_velocity(0.0f); if(func_8029B300() > 0) sp2C = BS_ANT_WALK; @@ -265,7 +265,7 @@ void bsant_fall_update(void){ case 1: break; } - if(func_8028B2E8()){ + if(player_isStable()){ if(miscflag_isTrue(0x19)) sp2C = badrone_transform(); else @@ -329,7 +329,7 @@ static void __bsant_recoil_update(void){ break; } - if(func_8028B2E8()) + if(player_isStable()) sp1C = BS_35_ANT_IDLE; bs_setState(sp1C); @@ -411,7 +411,7 @@ void bsant_die_update(void){ func_80299628(0); switch(bsant_substate){ case 0://L8029F270 - if(func_8028B2E8()){ + if(player_isStable()){ baanim_setEnd(1.0f); FUNC_8030E624(SFX_1F_HITTING_AN_ENEMY_3, 0.8f, 18000); FUNC_8030E624(SFX_39_BANJO_AYE_2, 1.8f, 18000); diff --git a/src/core2/bs/bBarge.c b/src/core2/bs/bBarge.c index 589617a7..12a62de5 100644 --- a/src/core2/bs/bBarge.c +++ b/src/core2/bs/bBarge.c @@ -154,7 +154,7 @@ void bsbarge_update(void){ func_8029F4F0(); break; case 4: - if(!func_8028B2E8()) + if(!player_isStable()) sp24 = BS_2F_FALL; if(animctrl_isAt(plyrMvmnt, 0.7f)){ D_8037D2A0 = 0.0f; diff --git a/src/core2/bs/bFlap.c b/src/core2/bs/bFlap.c index 2146616c..a05f2229 100644 --- a/src/core2/bs/bFlap.c +++ b/src/core2/bs/bFlap.c @@ -169,7 +169,7 @@ void bsbflap_update(void){ } break; case 4: - if(func_8028B424()) + if(player_isFallTumbling()) sp1c = BS_3D_FALL_TUMBLING; break; }//L802A2C94 @@ -180,7 +180,7 @@ void bsbflap_update(void){ if(should_beak_bust()) sp1c = BS_F_BBUSTER; - if(func_8028B2E8()){ + if(player_isStable()){ func_8029C5E8(); sp1c = BS_2_WALK_SLOW; } diff --git a/src/core2/bs/bFlip.c b/src/core2/bs/bFlip.c index 186c1bcc..ea13f0a3 100644 --- a/src/core2/bs/bFlip.c +++ b/src/core2/bs/bFlip.c @@ -112,7 +112,7 @@ void bsbflip_update(void){ } break; case 2://L802A3184 - if(func_8028B424()) + if(player_isFallTumbling()) sp24 = BS_3D_FALL_TUMBLING; if(button_released(BUTTON_A)){ animctrl_reset(aCtrl); @@ -124,7 +124,7 @@ void bsbflip_update(void){ baphysics_reset_terminal_velocity(); D_8037D310 = 3; }//L802A320C - if(func_8028B2E8()){ + if(player_isStable()){ _bsbflip_802A2DC0(); sp24 = func_8029C9C0(sp24); D_8037D310 = 4; @@ -134,9 +134,9 @@ void bsbflip_update(void){ } break; case 3://L802A3258 - if(func_8028B424()) + if(player_isFallTumbling()) sp24 = BS_3D_FALL_TUMBLING; - if(func_8028B2E8()){ + if(player_isStable()){ func_8029E070(0); _bsbflip_802A2DC0(); sp24 = func_8029C9C0(sp24); diff --git a/src/core2/bs/bFly.c b/src/core2/bs/bFly.c index c9bcd43c..bcc1d876 100644 --- a/src/core2/bs/bFly.c +++ b/src/core2/bs/bFly.c @@ -25,7 +25,7 @@ u8 D_8037D347; /* .code */ int func_802A3350(void){ - if(!func_8028B2E8()) + if(!player_isStable()) return 0; if(func_80294684() & 8){ return 0; @@ -217,7 +217,7 @@ void bsbfly_update(void){ if(button_pressed(BUTTON_A)) D_8037D347 = 1; - if(D_8037D347 && func_8023DB5C()%3 == 0){ + if(D_8037D347 && globalTimer_getTime()%3 == 0){ D_8037D347 = 0; func_80346C10(&sp2C, 0, BS_1_IDLE, ITEM_F_RED_FEATHER, 1); } @@ -389,7 +389,7 @@ void func_802A411C(void) { case 1: func_802A36D0(); D_8037D324 += time_getDelta(); - sp40 = func_8028B2E8(); + sp40 = player_isStable(); if (player_inWater()) { next_state = BS_4C_LANDING_IN_WATER; } @@ -495,7 +495,7 @@ void func_802A4548(void){ if(should_beak_bust()) next_state = BS_F_BBUSTER; - if(func_8028B2E8()){ + if(player_isStable()){ func_8029C5E8(); next_state = BS_20_LANDING; } @@ -665,7 +665,7 @@ void func_802A4C34(s32 arg0) { if (animctrl_isStopped(baanim_getAnimCtrlPtr())) { next_state = BS_24_FLY; } - if (func_8028B2E8()) { + if (player_isStable()) { next_state = BS_2_WALK_SLOW; } bs_setState(next_state); @@ -738,7 +738,7 @@ void func_802A4EC8(void) { next_state = 0; sp18 = baanim_getAnimCtrlPtr(); - if (func_8028B2E8()) { + if (player_isStable()) { next_state = BS_20_LANDING; } if (animctrl_isStopped(sp18) && (func_8028B094() || func_80294530())) { diff --git a/src/core2/bs/bLongLeg.c b/src/core2/bs/bLongLeg.c index 1019024c..3aba219e 100644 --- a/src/core2/bs/bLongLeg.c +++ b/src/core2/bs/bLongLeg.c @@ -167,7 +167,7 @@ void bsblongleg_stand_update(void){ enum bs_e next_state = 0; func_802A531C(); func_80299594(1, 0.5f); - if(func_80294F78()) + if(should_look_first_person_camera()) next_state = badrone_look(); if(button_pressed(BUTTON_B)) @@ -179,7 +179,7 @@ void bsblongleg_stand_update(void){ if(player_shouldSlideTrot()) next_state = BS_LONGLEG_SLIDE; - if(button_pressed(BUTTON_A) && func_8028B2E8()) + if(button_pressed(BUTTON_A) && player_isStable()) next_state = BS_LONGLEG_JUMP; if(stateTimer_isDone(STATE_TIMER_2_LONGLEG)) @@ -230,7 +230,7 @@ void bsblongleg_walk_update(void){ if(player_shouldSlideTrot()) next_state = BS_LONGLEG_SLIDE; - if(button_pressed(BUTTON_A) && func_8028B2E8()) + if(button_pressed(BUTTON_A) && player_isStable()) next_state = BS_LONGLEG_JUMP; if(stateTimer_isDone(STATE_TIMER_2_LONGLEG)) @@ -371,7 +371,7 @@ void bsblongleg_jump_update(void){ case 2://L802A6020 animctrl_setAnimTimer(aCtrl, ml_map_f(sp30, D_8037D354, 1.0f, D_8037D350, 0.6703f)); func_80299594(1, 0.5f); - if(func_8028B2E8()){ + if(player_isStable()){ func_8029C5E8(); animctrl_setSubRange(aCtrl, 0.0f, 1.0f); animctrl_setDuration(aCtrl, 1.3f); diff --git a/src/core2/bs/bPeck.c b/src/core2/bs/bPeck.c index ffa13b5b..8301639e 100644 --- a/src/core2/bs/bPeck.c +++ b/src/core2/bs/bPeck.c @@ -118,7 +118,7 @@ void bsbpeck_update(void){ break; }//L802A68D8 - if(func_8028B2E8()){ + if(player_isStable()){ func_8029C5E8(); sp24 = BS_1_IDLE; } diff --git a/src/core2/bs/bShock.c b/src/core2/bs/bShock.c index eadd0bc9..8733a283 100644 --- a/src/core2/bs/bShock.c +++ b/src/core2/bs/bShock.c @@ -48,9 +48,10 @@ void bsbshock_charge_update(void){ AnimCtrl *aCtrl = baanim_getAnimCtrlPtr(); f32 sp1C[3]; - if(func_8028B2E8()){ - if(func_8023DB5C() % 2) + if(player_isStable()) { + if(globalTimer_getTime() % 2) { func_8029C348(); + } } else {//L802A6B94 @@ -64,7 +65,7 @@ void bsbshock_charge_update(void){ switch(D_8037D381){ case 0: - if(func_8028B424()) + if(player_isFallTumbling()) sp2C = BS_3D_FALL_TUMBLING; if(func_8028B254(0x82)){ @@ -90,7 +91,7 @@ void bsbshock_charge_update(void){ if(animctrl_getAnimTimer(aCtrl) < 0.3637 && button_released(8)){ D_8037D380 = 0; }//L802A6CF4 - if(func_8028B2E8()) + if(player_isStable()) baphysics_set_target_horizontal_velocity(0.0f); } else{//L802A6D18 @@ -172,8 +173,8 @@ void bsbshock_update(void){ sp2C = BS_2F_FALL; } - if(!func_8028B2E8()){ - if(func_8028B424()) + if(!player_isStable()){ + if(player_isFallTumbling()) sp2C = BS_3D_FALL_TUMBLING; if(should_feathery_flap()) diff --git a/src/core2/bs/bSwim.c b/src/core2/bs/bSwim.c index 42235ea2..804d4d19 100644 --- a/src/core2/bs/bSwim.c +++ b/src/core2/bs/bSwim.c @@ -127,7 +127,7 @@ void func_802A7674() { func_802A71D8(); func_802A7304(); - if (func_80294F78()) { + if (should_look_first_person_camera()) { state_id = badrone_look(); } if (button_held(BUTTON_A)) { @@ -428,7 +428,7 @@ void func_802A8098(void) { } switch (D_8037D396) { case 0: - if (func_8023DB4C(1) == 0) { + if (globalTimer_getTimeMasked(1) == 0) { _player_getPosition(plyr_pos); plyr_pos[1] += 60.0f; p_ctrl = func_8029B950(plyr_pos, 25.0f); @@ -558,7 +558,7 @@ void func_802A85EC(void) { D_8037D398 += ml_max_f(mlAbsF(D_8037D398) * 0.1, 50.0f); baphysics_set_vertical_velocity(D_8037D398); } - if (func_8028B2E8()) { + if (player_isStable()) { next_state = BS_2D_SWIM_IDLE; } if (!player_inWater()) { diff --git a/src/core2/bs/bTrot.c b/src/core2/bs/bTrot.c index e1a95d78..90045450 100644 --- a/src/core2/bs/bTrot.c +++ b/src/core2/bs/bTrot.c @@ -190,7 +190,7 @@ enum bs_e func_802A8D84(enum bs_e arg0){ if( func_8029B300(arg0) > 0) arg0 = BS_16_BTROT_WALK; - if(func_80294F78()) + if(should_look_first_person_camera()) arg0 = badrone_look(); if(func_8028B094()) @@ -405,7 +405,7 @@ void bsbtrot_jump_update(void){ break; case 2://L802A95C4 func_80299628(1); - if(func_8028B2E8()){ + if(player_isStable()){ func_8029C5E8(); animctrl_setSubRange(aCtrl, 0.0f, 0.8798f); animctrl_setDuration(aCtrl, 0.9f); @@ -457,13 +457,13 @@ void bsbtrot_jump_update(void){ if(should_peck()) sp2C = BS_11_BPECK; - if(func_8028B424()) + if(player_isFallTumbling()) sp2C = BS_3D_FALL_TUMBLING; if(player_inWater()) sp2C = BS_4C_LANDING_IN_WATER; - if(func_8028B2E8()){ + if(player_isStable()){ if(button_pressed(BUTTON_A)) sp2C = func_802A8D34(sp2C); @@ -540,7 +540,7 @@ void bsbtrot_slide_update(void){ if(player_inWater()) sp3C = BS_2D_SWIM_IDLE; - if(D_8037D3A0 == 0.0f && button_pressed(BUTTON_A) && func_8028B2E8()) + if(D_8037D3A0 == 0.0f && button_pressed(BUTTON_A) && player_isStable()) sp3C = func_802A8D34(sp3C); @@ -605,7 +605,7 @@ void bsbtrot_fall_update(void){ break; case 1://L802A9DDC func_80299628(1); - if(func_8028B2E8()){ + if(player_isStable()){ func_8029C5E8(); animctrl_setSubRange(aCtrl, 0.0f, 0.8798f); animctrl_setDuration(aCtrl, 0.9f); @@ -660,10 +660,10 @@ void bsbtrot_fall_update(void){ if(player_inWater()) sp2C = BS_4C_LANDING_IN_WATER; - if(func_8028B424()) + if(player_isFallTumbling()) sp2C = BS_3D_FALL_TUMBLING; - if(func_8028B2E8()){ + if(player_isStable()){ if(button_pressed(BUTTON_A)) sp2C = func_802A8D34(sp2C); @@ -736,10 +736,10 @@ void bsbtrot_ow_update(void){ if(baanim_isAt(0.3f)) func_80292EA4(); - if(func_8028B424()) + if(player_isFallTumbling()) sp1C = BS_3D_FALL_TUMBLING; - if(func_8028B2E8() && baanim_isStopped()) + if(player_isStable() && baanim_isStopped()) sp1C = BS_15_BTROT_IDLE; if(animctrl_isStopped(baanim_getAnimCtrlPtr()) && player_inWater()) diff --git a/src/core2/bs/bWhirl.c b/src/core2/bs/bWhirl.c index a3563d32..55780af8 100644 --- a/src/core2/bs/bWhirl.c +++ b/src/core2/bs/bWhirl.c @@ -56,7 +56,7 @@ enum bs_e func_802AA510(enum bs_e arg0){ if(button_released(BUTTON_Z)) arg0 = BS_1E_WONDERWING_EXIT; - if(button_pressed(BUTTON_A) && func_8028B2E8()) + if(button_pressed(BUTTON_A) && player_isStable()) arg0 = BS_1D_WONDERWING_JUMP; if(player_inWater()) @@ -151,7 +151,7 @@ void bsbwhirl_walk_update(void){ if(button_released(BUTTON_Z)) sp1C = BS_1E_WONDERWING_EXIT; - if(button_pressed(BUTTON_A) && func_8028B2E8()) + if(button_pressed(BUTTON_A) && player_isStable()) sp1C = BS_1D_WONDERWING_JUMP; if(player_inWater()) @@ -217,7 +217,7 @@ void bsbwhirl_jump_update(void){ if(player_inWater()) sp2C = BS_2D_SWIM_IDLE; - if(func_8028B2E8()){ + if(player_isStable()){ D_8037D3B4 = 2; func_8029C5E8(); } diff --git a/src/core2/bs/bbuster.c b/src/core2/bs/bbuster.c index b30876b5..c67bf185 100644 --- a/src/core2/bs/bbuster.c +++ b/src/core2/bs/bbuster.c @@ -135,7 +135,7 @@ void bsbbuster_update(void){ if(D_8037D2B7 == 2){ D_8037D2B7 = 0; } - if(func_8028B2E8() || D_8037D2B9 || !(D_8037D2BC < 4)){ + if(player_isStable() || D_8037D2B9 || !(D_8037D2BC < 4)){ func_802BB3DC( 0, 45.0f, 0.71f); func_8029AE74(0); func_8029FB30(); @@ -183,7 +183,7 @@ void bsbbuster_update(void){ animctrl_setDuration(aCtrl, 15.0f); animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE); } - if(func_8028B2E8()){ + if(player_isStable()){ animctrl_setSubRange(aCtrl, 0.0f, 1.0f); animctrl_setDuration(aCtrl, 1.9f); animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE); diff --git a/src/core2/bs/beeFly.c b/src/core2/bs/beeFly.c index 6a44ba47..920c8d47 100644 --- a/src/core2/bs/beeFly.c +++ b/src/core2/bs/beeFly.c @@ -253,7 +253,7 @@ void bsbeefly_update(void){ sp38 += (f64)sp38; } baphysics_set_target_horizontal_velocity(sp38); - if(func_8028B2E8() && !player_inWater()) + if(player_isStable() && !player_inWater()) sp4C = BS_85_BEE_IDLE; func_8028FFF0(); bs_setState(sp4C); diff --git a/src/core2/bs/beeMain.c b/src/core2/bs/beeMain.c index c0ab228b..f034d14a 100644 --- a/src/core2/bs/beeMain.c +++ b/src/core2/bs/beeMain.c @@ -73,7 +73,7 @@ void func_802A10D4(void){ if(func_8028B094()) s0 = 0x88; - if(func_80294F78()) + if(should_look_first_person_camera()) s0 = badrone_look(); if(func_8029B300() > 0) @@ -188,7 +188,7 @@ void func_802A1438(void){ break; case 2: func_80299628(0); - if(func_8028B2E8()){ + if(player_isStable()){ func_802A0F90(); baanim_setEndAndDuration(1.0f, 0.7f); D_8037D2D4 = 3; @@ -202,7 +202,7 @@ void func_802A1438(void){ } break; } - if(func_8028B2E8()){ + if(player_isStable()){ if(func_8029B300() > 0) sp2c = BS_BEE_WALK; if(button_pressed(BUTTON_A)){ @@ -259,7 +259,7 @@ void func_802A170C(void){ break; case 1: func_80299628(0); - if(func_8028B2E8()){ + if(player_isStable()){ func_802A0F90(); baphysics_set_target_horizontal_velocity(0.0f); baanim_setEndAndDuration(1.0f, 0.7f); @@ -274,7 +274,7 @@ void func_802A170C(void){ } break; } - if(func_8028B2E8()){ + if(player_isStable()){ if(miscflag_isTrue(0x19)){ sp2c = badrone_transform(); }else{ @@ -352,7 +352,7 @@ void func_802A1A50(void){ case 1: break; } - if(func_8028B2E8()) + if(player_isStable()) sp1C = BS_85_BEE_IDLE; if(0.65 < baanim_getTimer() && player_inWater()){ sp1C = 0x8C; @@ -436,7 +436,7 @@ void func_802A1DD8(void){ func_80299628(0); switch(D_8037D2D4){ case 0: - if(!func_8028B2E8()) + if(!player_isStable()) break; baanim_setEnd(0.7453f); FUNC_8030E624(SFX_1F_HITTING_AN_ENEMY_3, 0.8f, 18000); @@ -445,7 +445,7 @@ void func_802A1DD8(void){ D_8037D2D4 = 1; break; case 1: - if(!func_8028B2E8()) + if(!player_isStable()) break; baanim_setEnd(1.0f); FUNC_8030E624(SFX_1F_HITTING_AN_ENEMY_3, 0.8f, 18000); diff --git a/src/core2/bs/claw.c b/src/core2/bs/claw.c index a87b216b..18174341 100644 --- a/src/core2/bs/claw.c +++ b/src/core2/bs/claw.c @@ -54,14 +54,14 @@ void bsclaw_update(void){ if(animctrl_isStopped(aCtrl)) sp2C = BS_1_IDLE; - if(!func_8028B2E8()) + if(!player_isStable()) sp2C = BS_2F_FALL; if(player_inWater()) sp2C = BS_4C_LANDING_IN_WATER; if(button_pressed(BUTTON_A)) - sp2C = func_8029C780(); + sp2C = bs_getTypeOfJump(); bs_setState(sp2C); } diff --git a/src/core2/bs/croc.c b/src/core2/bs/croc.c index 68905985..70a951b5 100644 --- a/src/core2/bs/croc.c +++ b/src/core2/bs/croc.c @@ -121,7 +121,7 @@ void bscroc_idle_update(void){ if(func_8028B094()) next_state = BS_61_CROC_FALL; - if(func_80294F78()) + if(should_look_first_person_camera()) next_state = badrone_look(); if(func_8029B300() > 0) @@ -235,7 +235,7 @@ void bscroc_jump_update(void){ break; case 2: func_80299628(0); - if(func_8028B2E8()){ + if(player_isStable()){ func_8029AE48(); baanim_setEndAndDuration(1.0f, 1.0f); D_8037D3EC = 3; @@ -250,7 +250,7 @@ void bscroc_jump_update(void){ break; }//L802AC66C - if(func_8028B2E8()){ + if(player_isStable()){ if(func_8029B300() > 0) sp2C = BS_CROC_WALK; @@ -300,7 +300,7 @@ void bscroc_fall_update(void){ } break; case 1: - if(func_8028B2E8()){ + if(player_isStable()){ func_8029AE48(); baphysics_set_target_horizontal_velocity(0.0f); baanim_setEndAndDuration(1.0f, 1.0f); @@ -310,7 +310,7 @@ void bscroc_fall_update(void){ break; }//L802AC850 - if(func_8028B2E8()){ + if(player_isStable()){ if(func_8029B300() > 0 || (D_8037D3EC == 2 && animctrl_isStopped(aCtrl))){ if(miscflag_isTrue(0x19)){ next_state = badrone_transform(); @@ -376,7 +376,7 @@ static void __bscroc_recoil_update(void){ case 1: break; } - if(func_8028B2E8()) + if(player_isStable()) next_state = BS_5E_CROC_IDLE; bs_setState(next_state); @@ -458,7 +458,7 @@ void bscroc_die_update(void){ func_80299628(0); switch(D_8037D3EC){ case 0: - if(func_8028B2E8()){ + if(player_isStable()){ baanim_setEnd(0.7453f); FUNC_8030E624(SFX_1F_HITTING_AN_ENEMY_3, 0.8f, 18000); FUNC_8030E624(SFX_39_BANJO_AYE_2, 1.8f, 18000); @@ -467,7 +467,7 @@ void bscroc_die_update(void){ } break; case 1: - if(func_8028B2E8()){ + if(player_isStable()){ baanim_setEnd(1.0f); FUNC_8030E624(SFX_1F_HITTING_AN_ENEMY_3, 0.8f, 18000); FUNC_8030E624(SFX_39_BANJO_AYE_2, 1.8f, 18000); @@ -505,7 +505,7 @@ int bscroc_hitboxActive(void){ static void func_802ACF58(void){ f32 sp2C; f32 sp20[3]; - sp2C = func_8028B2E8() ? 500.0f : 400.0f; + sp2C = player_isStable() ? 500.0f : 400.0f; func_802589E4(sp20, yaw_get(), sp2C); sp20[1] = 200.0f; baphysics_set_velocity(sp20); @@ -549,7 +549,7 @@ void bscroc_bite_update(void){ next_state = BS_CROC_WALK; } - if(func_8028B2E8() && button_pressed(BUTTON_A)) + if(player_isStable() && button_pressed(BUTTON_A)) next_state = BS_CROC_JUMP; bs_setState(next_state); diff --git a/src/core2/bs/crouch.c b/src/core2/bs/crouch.c index 34de3d58..c3bc89e3 100644 --- a/src/core2/bs/crouch.c +++ b/src/core2/bs/crouch.c @@ -183,7 +183,7 @@ enum bs_e func_802ADCD4(enum bs_e arg0){ arg0 = BS_CLAW; if(button_pressed(BUTTON_A)) - arg0 = func_8029C780(); + arg0 = bs_getTypeOfJump(); }else{ if(should_wonderwing()) diff --git a/src/core2/bs/die.c b/src/core2/bs/die.c index dca890d5..8b11a0e9 100644 --- a/src/core2/bs/die.c +++ b/src/core2/bs/die.c @@ -10,7 +10,7 @@ s32 D_8037D414; /* .code */ int _bsdie_802ADE00(void){ - return func_8028B2E8(); + return player_isStable(); } void _bsdie_802ADE20(void){ diff --git a/src/core2/bs/dronegoto.c b/src/core2/bs/dronegoto.c index faca4847..7ed9b4dd 100644 --- a/src/core2/bs/dronegoto.c +++ b/src/core2/bs/dronegoto.c @@ -40,7 +40,7 @@ void func_802AEC08(void){ void func_802AEC28(void){ baphysics_reset_horizontal_velocity(); - if(func_8028B2E8() || player_inWater()) + if(player_isStable() || player_inWater()) __bsDroneGoTo_set_substate(2); } @@ -91,7 +91,7 @@ void func_802AEDC8(void){ void bsDroneGoTo_init(void){ bsdronetogo_substate = 0; func_8031F9F4(1); - if( !func_8028B2E8() && func_8029BDE8()){ + if( !player_isStable() && func_8029BDE8()){ __bsDroneGoTo_set_substate(1); }else{ __bsDroneGoTo_set_substate(2); diff --git a/src/core2/bs/dronelook.c b/src/core2/bs/dronelook.c index 13017231..7bf26c5d 100644 --- a/src/core2/bs/dronelook.c +++ b/src/core2/bs/dronelook.c @@ -30,7 +30,7 @@ void bsDroneLook_init(void) { eye_rotation[1] += 180.0f; eye_rotation[2] = 0.0f; ncFirstPersonCamera_setZoomedOutRotation(eye_rotation); - miscflag_set(0x17); + miscflag_set(MISC_FLAG_17_FPV); } void bsDroneLook_update(void) { @@ -42,7 +42,7 @@ void bsDroneLook_update(void) { next_state = 0; dt = time_getDelta(); - if (ncFirstPersonCamera_getState() == 2) { + if (ncFirstPersonCamera_getState() == FIRSTPERSON_STATE_2_IDLE) { //camera is in "idle" state ncFirstPersonCamera_getZoomedInRotation(eye_rotation); eye_rotation[0] -= func_8029B2DC() * 90.0f * dt; @@ -59,7 +59,7 @@ void bsDroneLook_update(void) { } // 1st person cancelled via entering water if (player_inWater()) { - if (player_getTransformation() == TRANSFORM_1_BANJO && func_8028EE84() == BSWATERGROUP_0_NONE) { + if (player_getTransformation() == TRANSFORM_1_BANJO && player_getWaterState() == BSWATERGROUP_0_NONE) { exit_first_person += TRUE; } } else if (func_8028B254(25) == 0) { @@ -79,5 +79,5 @@ void bsDroneLook_end(void) { func_80299D2C(SFX_12E_CAMERA_ZOOM_MEDIUM, 1.2f, 12000); } ncDynamicCamera_exitFirstPerson(); - miscflag_clear(0x17); + miscflag_clear(MISC_FLAG_17_FPV); } diff --git a/src/core2/bs/jump.c b/src/core2/bs/jump.c index 771aba76..b40919ea 100644 --- a/src/core2/bs/jump.c +++ b/src/core2/bs/jump.c @@ -134,7 +134,7 @@ void bsjump_update(void){ break; }//L802B1548 - if(func_8028B424()) + if(player_isFallTumbling()) sp34 = BS_3D_FALL_TUMBLING; if(button_released(BUTTON_A)) @@ -149,7 +149,7 @@ void bsjump_update(void){ if(should_beak_bust()) sp34 = BS_F_BBUSTER; - if(func_8028B2E8()){ + if(player_isStable()){ func_8029C5E8(); sp34 = BS_20_LANDING; } @@ -214,7 +214,7 @@ void bsjump_fall_update(void){ break; }//L802B1824 if(miscflag_isFalse(0xf)){ - if(func_8028B424()) + if(player_isFallTumbling()) sp2C = BS_3D_FALL_TUMBLING; if(should_feathery_flap() && miscflag_isFalse(MISC_FLAG_5_HAS_PECKED)) @@ -237,7 +237,7 @@ void bsjump_fall_update(void){ }//L802B18E8 - if(func_8028B2E8()){ + if(player_isStable()){ func_8029C5E8(); sp2C = BS_20_LANDING; } @@ -311,7 +311,7 @@ void func_802B1A54(void) { case 2: break; } - if (func_8028B2E8()) { + if (player_isStable()) { func_8029C5E8(); next_state = BS_20_LANDING; } @@ -371,7 +371,7 @@ void func_802B1CF8(void) { case 1: break; } - if (func_8028B2E8() != 0) { + if (player_isStable() != 0) { next_state = 1; } bs_setState(next_state); @@ -424,7 +424,7 @@ void bsjump_tumble_update(void){ if(player_inWater()) sp1C = BS_4C_LANDING_IN_WATER; - if(func_8028B2E8()) + if(player_isStable()) sp1C = BS_SPLAT; bs_setState(sp1C); diff --git a/src/core2/bs/ow.c b/src/core2/bs/ow.c index ae4b1034..b6665e59 100644 --- a/src/core2/bs/ow.c +++ b/src/core2/bs/ow.c @@ -50,10 +50,10 @@ void bsow_update(void) { if (baanim_isAt(0.3f) != 0) { func_80292EA4(); } - if (func_8028B424() != 0) { + if (player_isFallTumbling() != 0) { sp1C = BS_3D_FALL_TUMBLING; } - if (func_8028B2E8() != 0) { + if (player_isStable() != 0) { sp1C = BS_2_WALK_SLOW; } if ((player_inWater() != 0) && (baphysics_get_vertical_velocity() <= 0.0f)) { diff --git a/src/core2/bs/pumpkin.c b/src/core2/bs/pumpkin.c index df5712d0..401da3af 100644 --- a/src/core2/bs/pumpkin.c +++ b/src/core2/bs/pumpkin.c @@ -92,7 +92,7 @@ void bspumpkin_idle_update(void) { if (func_8028B094()) { next_state = BS_4B_PUMPKIN_FALL; } - if (func_80294F78()) { + if (should_look_first_person_camera()) { next_state = badrone_look(); } if (func_8029B300() > 0) { @@ -208,7 +208,7 @@ void bspumpkin_jump_update(void) { } break; case 2: - if (func_8028B2E8()) { + if (player_isStable()) { func_8029AE48(); animctrl_setSubRange(anim_ctrl, 0.0f, 1.0f); animctrl_setDuration(anim_ctrl, 1.2f); @@ -224,7 +224,7 @@ void bspumpkin_jump_update(void) { } break; } - if (func_8028B2E8()) { + if (player_isStable()) { if (func_8029B300() > 0) { next_state = BS_49_PUMPKIN_WALK; } @@ -277,7 +277,7 @@ void bspumpkin_fall_update(void) { } break; case 1: - if (func_8028B2E8()) { + if (player_isStable()) { func_8029AE48(); baphysics_set_target_horizontal_velocity(0.0f); animctrl_setSubRange(anim_ctrl, 0.0f, 1.0f); @@ -289,7 +289,7 @@ void bspumpkin_fall_update(void) { case 2: break; } - if (func_8028B2E8() && ((func_8029B300() > 0) || (D_8037D4E0 == 2 && animctrl_isStopped(anim_ctrl)))) { + if (player_isStable() && ((func_8029B300() > 0) || (D_8037D4E0 == 2 && animctrl_isStopped(anim_ctrl)))) { if (miscflag_isTrue(0x19)) { next_state = badrone_transform(); } else { @@ -475,7 +475,7 @@ void bspumpkin_die_update(void){ break; case 1://L802B32AC - if(func_8028B2E8()) { + if(player_isStable()) { func_8029AE48(); FUNC_8030E624(SFX_1F_HITTING_AN_ENEMY_3, 0.8f, 18000); FUNC_8030E624(SFX_39_BANJO_AYE_2, 1.8f, 18000); @@ -502,7 +502,7 @@ void bspumpkin_die_update(void){ case 4://L802B3384 D_8037D4F4 = ml_max_f(0.0f, D_8037D4F4 - 10.0f); - if (func_8028B2E8()) { + if (player_isStable()) { func_8029AE48(); FUNC_8030E624(SFX_1F_HITTING_AN_ENEMY_3, 0.8f, 18000); FUNC_8030E624(SFX_39_BANJO_AYE_2, 1.8f, 18000); diff --git a/src/core2/bs/rebound.c b/src/core2/bs/rebound.c index 0b0264ab..1aeebd94 100644 --- a/src/core2/bs/rebound.c +++ b/src/core2/bs/rebound.c @@ -118,10 +118,10 @@ void func_802B3954(void) { baMarker_collisionOn(); } func_802B37DC(); - if (func_8028B2E8()) { + if (player_isStable()) { next_state = BS_20_LANDING; } - if (func_8028B424() && D_8037D500 == 0) { + if (player_isFallTumbling() && D_8037D500 == 0) { next_state = BS_3D_FALL_TUMBLING; } if (animctrl_isStopped(anim_ctrl) && func_8028B094() && (D_8037D500 == 0)) { diff --git a/src/core2/bs/slide.c b/src/core2/bs/slide.c index e96f53be..96acd938 100644 --- a/src/core2/bs/slide.c +++ b/src/core2/bs/slide.c @@ -111,7 +111,7 @@ void bsslide_update(void){ sp3C = BS_4C_LANDING_IN_WATER; if(D_8037D528 == 0.0f && button_pressed(BUTTON_A)) - sp3C = func_8029C780(); + sp3C = bs_getTypeOfJump(); bs_setState(sp3C); } diff --git a/src/core2/bs/splat.c b/src/core2/bs/splat.c index a87c28e6..f8ab93c0 100644 --- a/src/core2/bs/splat.c +++ b/src/core2/bs/splat.c @@ -76,7 +76,7 @@ void bssplat_update(void){ break; }//L802B4808 - if(func_8028B2E8() == 0 && player_inWater()) + if(player_isStable() == 0 && player_inWater()) sp1C = BS_2D_SWIM_IDLE; bs_setState(sp1C); diff --git a/src/core2/bs/stand.c b/src/core2/bs/stand.c index 0165ef3c..6864a177 100644 --- a/src/core2/bs/stand.c +++ b/src/core2/bs/stand.c @@ -71,9 +71,9 @@ s32 func_802B488C(s32 arg0){ retVal = BS_CLAW; if(button_pressed(BUTTON_A)) - retVal = func_8029C780(); + retVal = bs_getTypeOfJump(); - if(func_80294F78()) + if(should_look_first_person_camera()) retVal = badrone_look(); if(player_isSliding()) diff --git a/src/core2/bs/swim.c b/src/core2/bs/swim.c index 2eac473b..8c3ab647 100644 --- a/src/core2/bs/swim.c +++ b/src/core2/bs/swim.c @@ -152,10 +152,10 @@ void func_802B5950(void) { next_state = 0; anim_ctrl = baanim_getAnimCtrlPtr(); - if ((func_8023DB4C(7) == 0) && ((f64) randf() < 0.5)) { + if ((globalTimer_getTimeMasked(7) == 0) && ((f64) randf() < 0.5)) { func_8029C304(1); } - if ((func_8023DB4C(7) == 0) && ((f64) randf() < 0.5)) { + if ((globalTimer_getTimeMasked(7) == 0) && ((f64) randf() < 0.5)) { func_802B5480(); } if (animctrl_isAt(anim_ctrl, 0.01f) != 0) { @@ -170,7 +170,7 @@ void func_802B5950(void) { if (!player_inWater()) { next_state = BS_1_IDLE; } - if (func_80294F78()) { + if (should_look_first_person_camera()) { next_state = badrone_look(); } if (should_dive()) { diff --git a/src/core2/bs/turn.c b/src/core2/bs/turn.c index 2e16695b..7ced62c4 100644 --- a/src/core2/bs/turn.c +++ b/src/core2/bs/turn.c @@ -60,7 +60,7 @@ void bsturn_update(void){ sp2C = BS_CLAW; if(button_pressed(BUTTON_A)) - sp2C = func_8029C780(); + sp2C = bs_getTypeOfJump(); bs_setState(sp2C); } diff --git a/src/core2/bs/twirl.c b/src/core2/bs/twirl.c index b7faed24..84adc5fb 100644 --- a/src/core2/bs/twirl.c +++ b/src/core2/bs/twirl.c @@ -66,9 +66,9 @@ void bstwirl_update(void){ }//L802B6C4C if(button_pressed(BUTTON_A)) - sp1C = func_8029C780(); + sp1C = bs_getTypeOfJump(); - if(0.6 < animctrl_getAnimTimer(aCtrl) && !func_8028B2E8()) + if(0.6 < animctrl_getAnimTimer(aCtrl) && !player_isStable()) sp1C = BS_2F_FALL; if(player_inWater()) diff --git a/src/core2/bs/walk.c b/src/core2/bs/walk.c index e60fb26c..c9afc348 100644 --- a/src/core2/bs/walk.c +++ b/src/core2/bs/walk.c @@ -162,7 +162,7 @@ void bswalk_creep_update(void){ if(func_8028B128()) next_state = BS_WALK_MUD; - if(func_80294F78()) + if(should_look_first_person_camera()) next_state = badrone_look(); if(func_8028B094()) @@ -174,7 +174,7 @@ void bswalk_creep_update(void){ next_state = func_802B6F20(next_state); if(button_pressed(BUTTON_A)) - next_state = func_8029C780(); + next_state = bs_getTypeOfJump(); if(player_isSliding()) next_state = BS_SLIDE; @@ -235,7 +235,7 @@ void bswalk_slow_upate(void){ if(func_8028B128()) next_state = BS_WALK_MUD; - if(func_80294F78()) + if(should_look_first_person_camera()) next_state = badrone_look(); if(func_8028B094()) @@ -247,7 +247,7 @@ void bswalk_slow_upate(void){ next_state = func_802B6F20(next_state); if(button_pressed(BUTTON_A)) - next_state = func_8029C780(); + next_state = bs_getTypeOfJump(); if(player_isSliding()) next_state = BS_SLIDE; @@ -311,7 +311,7 @@ void bswalk_update(void){ next_state = BS_SKID; } - if(func_80294F78()) + if(should_look_first_person_camera()) next_state = badrone_look(); if(func_8028B094()) @@ -323,7 +323,7 @@ void bswalk_update(void){ next_state = func_802B6F20(next_state); if(button_pressed(BUTTON_A)) - next_state = func_8029C780(); + next_state = bs_getTypeOfJump(); if(player_isSliding()) next_state = BS_SLIDE; @@ -386,7 +386,7 @@ void bswalk_fast_update(void){ if(baphysics_is_slower_than(18.0f)) next_state = BS_1_IDLE; - if(func_80294F78()) + if(should_look_first_person_camera()) next_state = badrone_look(); break; @@ -395,7 +395,7 @@ void bswalk_fast_update(void){ if(baphysics_is_slower_than(bsWalkSlowWalkWalkVelocityThreshold)) next_state = BS_2_WALK_SLOW; - if(func_80294F78()) + if(should_look_first_person_camera()) next_state = badrone_look(); break; @@ -403,7 +403,7 @@ void bswalk_fast_update(void){ if(baphysics_is_slower_than(bsWalkWalkFastWalkVelocityThreshold) && func_802B6EF4()) next_state = BS_WALK; - if(func_80294F78()) + if(should_look_first_person_camera()) next_state = badrone_look(); break; }//L802B7AA4 @@ -423,7 +423,7 @@ void bswalk_fast_update(void){ next_state = func_802B6F20(next_state); if(button_pressed(BUTTON_A)) - next_state = func_8029C780(); + next_state = bs_getTypeOfJump(); if(player_isSliding()) next_state = BS_SLIDE; @@ -460,7 +460,7 @@ void bswalk_mud_update(void){ if(!func_8029B300()) next_state = BS_1_IDLE; - if(func_80294F78()) + if(should_look_first_person_camera()) next_state = badrone_look(); if(func_8028B094()) @@ -472,7 +472,7 @@ void bswalk_mud_update(void){ next_state = func_802B6F20(next_state); if(button_pressed(BUTTON_A)) - next_state = func_8029C780(); + next_state = bs_getTypeOfJump(); if(player_isSliding()) next_state = BS_SLIDE; diff --git a/src/core2/bs/walrus.c b/src/core2/bs/walrus.c index b63e5319..103b22c1 100644 --- a/src/core2/bs/walrus.c +++ b/src/core2/bs/walrus.c @@ -162,7 +162,7 @@ void bswalrus_idle_update(void){ if(func_8028B094()) next_state = BS_6A_WALRUS_FALL; - if(func_80294F78()) + if(should_look_first_person_camera()) next_state = badrone_look(); if(func_8029B300() > 0) @@ -270,7 +270,7 @@ void bswalrus_jump_update(void){ break; case 2://L802B87B4 func_80299628(0); - if(func_8028B2E8()){ + if(player_isStable()){ func_8029AE48(); animctrl_setSubRange(aCtrl, 0.0f, 1.0f); animctrl_setDuration(aCtrl, 1.0f); @@ -287,7 +287,7 @@ void bswalrus_jump_update(void){ break; }//L802B8838 - if(func_8028B2E8()){ + if(player_isStable()){ if(func_8029B300() > 0) next_state = BS_WALRUS_WALK; @@ -335,7 +335,7 @@ void bswalrus_fall_update(void){ } break; case 1://L802B89E0 - if(func_8028B2E8()){ + if(player_isStable()){ func_8029AE48(); baphysics_set_target_horizontal_velocity(0.0f); animctrl_setSubRange(aCtrl, 0.0f, 1.0f); @@ -348,7 +348,7 @@ void bswalrus_fall_update(void){ break; }//L802B8A38 - if(func_8028B2E8()){ + if(player_isStable()){ if( func_8029B300() > 0 || (D_8037D5C8 == 2 && animctrl_isStopped(aCtrl)) ){ @@ -399,7 +399,7 @@ static void __bswalrus_recoil_update(void){ if(baanim_isAt(0.5f)) func_80292EA4(); - if(func_8028B2E8()) + if(player_isStable()) next_state = BS_67_WALRUS_IDLE; bs_setState(next_state); @@ -483,7 +483,7 @@ void bswalrus_die_update(void){ func_80299628(0); switch(D_8037D5C8){ case 0://L802B8F54 - if(func_8028B2E8()){ + if(player_isStable()){ baanim_setEnd(1.0f); FUNC_8030E624(SFX_1F_HITTING_AN_ENEMY_3, 0.8f, 18000); FUNC_8030E624(SFX_39_BANJO_AYE_2, 1.8f, 18000); @@ -568,7 +568,7 @@ void bswalrus_sled_update(void){ f32 sp20[3]; if(50.0f < baphysics_get_horizontal_velocity()){ - if(func_8023DB4C(1)){ + if(globalTimer_getTimeMasked(1)){ baModel_80292554(&sp20); }else{ baModel_80292578(&sp20); @@ -578,7 +578,7 @@ void bswalrus_sled_update(void){ func_80299628(0); func_802B7F28(); - if(func_80294F78()) + if(should_look_first_person_camera()) next_state = badrone_look(); if(button_pressed(BUTTON_A)) @@ -648,7 +648,7 @@ void bswalrus_sled_jump_update(void){ break; }//L802B9530 - if(func_8028B2E8()){ + if(player_isStable()){ if(button_pressed(BUTTON_A)) next_state = BS_7E_WALRUS_SLED; @@ -693,7 +693,7 @@ void func_802B963C(void){ } break; case 1://L802B96C0 - if(func_8028B2E8()){ + if(player_isStable()){ func_8029AE48(); baphysics_set_target_horizontal_velocity(0.0f); D_8037D5C8 = 2; @@ -703,7 +703,7 @@ void func_802B963C(void){ break; }//L802B96F0 - if(func_8028B2E8()){ + if(player_isStable()){ if( func_8029B300() > 0 || (D_8037D5C8 == 2 && animctrl_isStopped(aCtrl)) ){ diff --git a/src/core2/bs/washy.c b/src/core2/bs/washy.c index 38b25b93..3b2cb332 100644 --- a/src/core2/bs/washy.c +++ b/src/core2/bs/washy.c @@ -58,15 +58,15 @@ void func_802B9B14(void){ switch(D_8037D5D0){ case 0: // L802B9B48 - if(func_8028B2E8()) + if(player_isStable()) func_802B9980(1); break; case 1: // L802B9B68 - if(func_8028B2E8()) + if(player_isStable()) func_802B9980(2); break; case 2: // L802B9B88 - if(func_8028B2E8()) + if(player_isStable()) func_802B9980(3); break; case 3: // L802B9BA8 diff --git a/src/core2/ch/badShad.c b/src/core2/ch/badShad.c index 950e3db0..fe9417d8 100644 --- a/src/core2/ch/badShad.c +++ b/src/core2/ch/badShad.c @@ -27,7 +27,7 @@ void chBadShad_update(Actor *this){ this->initialized = 1; this->marker->collidable = 0; } - if(!this->despawn_flag && this->unk1C_x < (f32)(func_8023DB5C() - 1) ){ + if(!this->despawn_flag && this->unk1C_x < (f32)(globalTimer_getTime() - 1) ){ //unlink if(this->unk104){ marker_getActor(this->unk104)->unk104 = 0; @@ -116,7 +116,7 @@ void func_802D71A0(s32 this, s32 arg1){ if(sp3C){ marker_getActor(marker)->unk104 = sp3C->marker; sp3C->unk104 = marker; - sp3C->unk1C[0] = func_8023DB5C(); + sp3C->unk1C[0] = globalTimer_getTime(); sp3C->unk1C[1] = sp40; sp3C->unk28 = sp28; } @@ -145,7 +145,7 @@ void func_802D729C(Actor *actor, f32 arg1){ if(sp1C->despawn_flag == TRUE) return; - if(!((func_8023DB5C() ^ actor->marker->actrArrayIdx) & 0x7)){ + if(!((globalTimer_getTime() ^ actor->marker->actrArrayIdx) & 0x7)){ sp1C->unk28 = func_802D7038(actor); sp1C->position_x = D_8037DE10[0]; sp1C->position_y = D_8037DE10[1] + 6.0f; @@ -158,6 +158,6 @@ void func_802D729C(Actor *actor, f32 arg1){ sp1C->position_x = actor->position_x; sp1C->position_z = actor->position_z; } - sp1C->unk1C[0] = func_8023DB5C(); + sp1C->unk1C[0] = globalTimer_getTime(); sp1C->unk1C[1] = arg1; } diff --git a/src/core2/ch/bigbutt.c b/src/core2/ch/bigbutt.c index 9c19bed4..2b85cc2b 100644 --- a/src/core2/ch/bigbutt.c +++ b/src/core2/ch/bigbutt.c @@ -74,7 +74,7 @@ void func_802C5FF8(Actor *this){ if( !this->unk138_28 && actor_animationIsAt(this, 0.4f) && randf() < 0.14 - && func_8028EE84() != BSWATERGROUP_2_UNDERWATER + && player_getWaterState() != BSWATERGROUP_2_UNDERWATER ){ func_8030E878(SFX_2B_BULL_MOO_1, randf2(0.9f, 1.1f), 32000, this->position, 0.0f, 2000.0f); } @@ -136,7 +136,7 @@ void func_802C6240(Actor *this){ || actor_animationIsAt(this, 0.4f) || actor_animationIsAt(this, 0.536f) ){ - if(func_8028EE84() != BSWATERGROUP_2_UNDERWATER){ + if(player_getWaterState() != BSWATERGROUP_2_UNDERWATER){ func_8030E878(SFX_C8_CRUNCH,randf2(0.93f, 1.07f),10000, this->position, 0.0f, 1800.0f); } } @@ -161,13 +161,13 @@ void func_802C6240(Actor *this){ if(!func_80329030(this, 0) && func_80329480(this)){ func_80328CEC(this, (s32)this->yaw, 90, 150); }//L802C64EC - if(!(func_8023DB5C() & 0xf)) + if(!(globalTimer_getTime() & 0xf)) func_80328CEC(this, (s32)this->yaw_ideal, 10, 20); - if(!(func_8023DB5C() & 0x7)) + if(!(globalTimer_getTime() & 0x7)) subaddie_maybe_set_state_position_direction(this, 1, 0.16f, 1, 0.02f); - if( !(func_8023DB5C() & 0xf) + if( !(globalTimer_getTime() & 0xf) && func_80329078(this, (s32)this->yaw_ideal, 150) && subaddie_maybe_set_state(this, 3, 0.13f) ){ @@ -191,7 +191,7 @@ void func_802C6240(Actor *this){ subaddie_set_state(this, 2); func_802C5E80(this); } - if(!(func_8023DB5C() & 0xf) && subaddie_maybe_set_state(this, 2, 0.08f)) + if(!(globalTimer_getTime() & 0xf) && subaddie_maybe_set_state(this, 2, 0.08f)) func_802C5E80(this); func_802C5EB8(this); break; @@ -203,7 +203,7 @@ void func_802C6240(Actor *this){ subaddie_set_state(this, 8); } func_802C5F44(this); - if(actor_animationIsAt(this, 0.35f) && func_8028EE84() != BSWATERGROUP_2_UNDERWATER){ + if(actor_animationIsAt(this, 0.35f) && player_getWaterState() != BSWATERGROUP_2_UNDERWATER){ func_8030E58C(SFX_3C_BULL_GROWN, randf()/10.0f + 1.0); this->unk10_12--; } @@ -356,7 +356,7 @@ Actor *func_802C6E84(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ } break; case 4://L802C6F50 - if((func_8023DB5C() & 1) == 1){ + if((globalTimer_getTime() & 1) == 1){ if(func_80259808(actor->yaw)){ func_802C6E3C(0xb, sp34); func_802C6E3C(0xa, sp34); @@ -369,7 +369,7 @@ Actor *func_802C6E84(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ break; case 1://L802C6FB4 if(actor_animationIsAt(actor, 0.85f) - && (func_8023DB5C()& 0xe) == 8 + && (globalTimer_getTime()& 0xe) == 8 && randf() < 0.6 ){ func_8034A174(func_80329934(),5, sp40); diff --git a/src/core2/ch/crab.c b/src/core2/ch/crab.c index 1dc83447..755ec886 100644 --- a/src/core2/ch/crab.c +++ b/src/core2/ch/crab.c @@ -232,7 +232,7 @@ void chCrab_update(Actor *this) { static s32 D_803670B0 = 0; static s32 D_803670B4 = 0; - sp34 = func_8023DB5C(); + sp34 = globalTimer_getTime(); sp30 = time_getDelta(); is_mutant_snippet = this->modelCacheIndex == ACTOR_F5_MUTIE_SNIPPET; if (!this->unk16C_4) { @@ -343,7 +343,7 @@ void chCrab_update(Actor *this) { break; case 4: //L802CC024 - if ((func_8023DB5C() & 0xF) == 9) { + if ((globalTimer_getTime() & 0xF) == 9) { this->yaw_ideal = (f32) func_80329784(this); } func_80328FB0(this, 7.0f); diff --git a/src/core2/ch/firefx.c b/src/core2/ch/firefx.c index 6747fc5d..fd3cfbcb 100644 --- a/src/core2/ch/firefx.c +++ b/src/core2/ch/firefx.c @@ -76,10 +76,10 @@ void chfirefx_update(Actor *this){ }//L80359934 if(subaddie_playerIsWithinSphere(this, 2000)){ if( func_8024DB50(this->position, 50.0f) && this->unk38_31 ){ - if(!(func_8023DB5C() & 3) && randf() < 0.1){ + if(!(globalTimer_getTime() & 3) && randf() < 0.1){ __chfirefx_spawnSmoke(this->position, this->scale); } //L803599AC - if(!(func_8023DB5C() & 3) && randf() < 0.3){ + if(!(globalTimer_getTime() & 3) && randf() < 0.3){ __chfirefx_spawnSpark(this->position, this->scale); } }//L803599F4 diff --git a/src/core2/ch/gameSelect.c b/src/core2/ch/gameSelect.c index aacf2606..b306dfbd 100644 --- a/src/core2/ch/gameSelect.c +++ b/src/core2/ch/gameSelect.c @@ -341,10 +341,10 @@ void func_802C4C14(Actor *this){ switch(sp84){ case 0://L802C4D8C if(actor_animationIsAt(this, 0.1f)) - func_8030E510(SFX_5D_BANJO_RAAOWW, 8000); + sfxsource_play(SFX_5D_BANJO_RAAOWW, 8000); if(actor_animationIsAt(this, 0.7f)) - func_8030E510(SFX_5E_BANJO_PHEWWW, 8000); + sfxsource_play(SFX_5E_BANJO_PHEWWW, 8000); break; case 1://L802C4DD0 if(randf() < 0.1){ @@ -364,7 +364,7 @@ void func_802C4C14(Actor *this){ switch(this->state){ case 1://L802C4F10 if(sp84 == 1){ - func_8030E510(SFX_136_GAMEBOY_STARTUP, 15000); + sfxsource_play(SFX_136_GAMEBOY_STARTUP, 15000); timedFunc_set_3(0.25f, (GenFunction_3)comusic_8025AB44, COMUSIC_73_GAMEBOY, -1, 2000); func_8025A58C(0, 2000); } @@ -441,20 +441,20 @@ void func_802C4C14(Actor *this){ if(randf() < 0.1){ switch(sp84){ case 0://L802C52B8 - func_8030E510(SFX_31_BANJO_OHHWAAOOO, 28000); + sfxsource_play(SFX_31_BANJO_OHHWAAOOO, 28000); func_8030E540(SFX_135_CARTOONY_SPRING); - timedFunc_set_2(0.4f, (GenFunction_2)func_8030E510, SFX_13A_GLASS_BREAKING_7, 0x7fff); - timedFunc_set_2(0.9f, (GenFunction_2)func_8030E510, SFX_150_PORCELAIN_CRASH, 0x7fff); - timedFunc_set_2(1.0f, (GenFunction_2)func_8030E510, SFX_151_CAT_MEOW, 0x7fff); + timedFunc_set_2(0.4f, (GenFunction_2)sfxsource_play, SFX_13A_GLASS_BREAKING_7, 0x7fff); + timedFunc_set_2(0.9f, (GenFunction_2)sfxsource_play, SFX_150_PORCELAIN_CRASH, 0x7fff); + timedFunc_set_2(1.0f, (GenFunction_2)sfxsource_play, SFX_151_CAT_MEOW, 0x7fff); break; case 1://L802C5320 - timedFunc_set_2(0.4f, (GenFunction_2)func_8030E510, SFX_31_BANJO_OHHWAAOOO, 28000); - timedFunc_set_2(0.2f, (GenFunction_2)func_8030E510, SFX_E_SHOCKSPRING_BOING, 28000); + timedFunc_set_2(0.4f, (GenFunction_2)sfxsource_play, SFX_31_BANJO_OHHWAAOOO, 28000); + timedFunc_set_2(0.2f, (GenFunction_2)sfxsource_play, SFX_E_SHOCKSPRING_BOING, 28000); func_8030E540(SFX_2D_KABOING); break; case 2://L802C5364 - timedFunc_set_2(0.15f, (GenFunction_2)func_8030E510, SFX_32_BANJO_EGHEE, 28000); - func_8030E510(SFX_3F6_UNKNOWN, 28000); + timedFunc_set_2(0.15f, (GenFunction_2)sfxsource_play, SFX_32_BANJO_EGHEE, 28000); + sfxsource_play(SFX_3F6_UNKNOWN, 28000); func_8030E540(SFX_8F_SNOWBALL_FLYING); break; }//L802C5394 @@ -466,7 +466,7 @@ void func_802C4C14(Actor *this){ subaddie_set_state(this, 3); } }else{//L802C53D0 - func_8030E510(SFX_4F_BANJO_WAHOO, 28000); + sfxsource_play(SFX_4F_BANJO_WAHOO, 28000); subaddie_set_state(this, 3); }//L802C53E8 if(sp84 == 0) diff --git a/src/core2/ch/ghost.c b/src/core2/ch/ghost.c index 73d19ef0..11a273d5 100644 --- a/src/core2/ch/ghost.c +++ b/src/core2/ch/ghost.c @@ -200,7 +200,7 @@ void func_8035B8A8(Actor *this){ void func_8035B900(Actor *this){ ActorLocal_Core2_D4050 *local = (ActorLocal_Core2_D4050 *)&this->local; - s32 sp30 = func_8023DB5C(); + s32 sp30 = globalTimer_getTime(); f32 sp2C = time_getDelta(); if(!this->unk16C_4){ this->unk16C_4 = TRUE; @@ -346,7 +346,7 @@ void func_8035BD48(Actor *this){ func_80343DEC(this); } - if((func_8023DB5C() &0x3F) == 7 && randf() < 0.7){ + if((globalTimer_getTime() &0x3F) == 7 && randf() < 0.7){ func_8030E878(0x3f4, randf2(1.0f, 1.2f), 32000, this->position, this->scale*400.0f, this->scale*1800.0f); } } diff --git a/src/core2/ch/icecube.c b/src/core2/ch/icecube.c index f0869693..e5ab25db 100644 --- a/src/core2/ch/icecube.c +++ b/src/core2/ch/icecube.c @@ -83,7 +83,7 @@ int func_80359F40(Actor *this, f32 arg1[3]){ f32 sp20; sp24 = func_80257204(this->position[0], this->position[2], arg1[0], arg1[2]); - if((func_8023DB5C() & 0xF) == 4){ + if((globalTimer_getTime() & 0xF) == 4){ this->velocity[2] = (f32)randi2(-45, 45); } sp20 = this->yaw; @@ -177,7 +177,7 @@ void func_8035A694(Actor *this){ sp3C = this->yaw; sp38 = this->unk28*1.5 + 1.0; - tmp_v0 = func_8023DB5C(); + tmp_v0 = globalTimer_getTime(); this->yaw += sp38; if(360.0f < this->yaw) this->yaw -= 360.0f; diff --git a/src/core2/ch/snowball.c b/src/core2/ch/snowball.c index 1134ead5..1882b977 100644 --- a/src/core2/ch/snowball.c +++ b/src/core2/ch/snowball.c @@ -113,7 +113,7 @@ void chSnowball_update(Actor *this) { this->initialized = TRUE; player_getPosition(sp7C); sp7C[1] += 1.0f; - phi_a1 = (func_8023DB5C() & 1) ? 0x15 : 0x2B; + phi_a1 = (globalTimer_getTime() & 1) ? 0x15 : 0x2B; for(i = 0; i < 3; i++){ sp58[i] = sp7C[i] + (sp7C[i] - this->unk1C[i]) * phi_a1; } diff --git a/src/core2/ch/snowman.c b/src/core2/ch/snowman.c index 4fab6ce3..d42a1532 100644 --- a/src/core2/ch/snowman.c +++ b/src/core2/ch/snowman.c @@ -98,7 +98,7 @@ void __chSnowman_spawnHat(ActorMarker *marker){ other->velocity[0] = 34.0f; - sp28 = (func_8023DB5C() & 1)? 0x3C : 0x78; + sp28 = (globalTimer_getTime() & 1)? 0x3C : 0x78; ml_vec3f_yaw_rotate_copy(other->velocity, other->velocity, other->yaw - sp28); other->velocity[1] = 30.0f; } @@ -260,7 +260,7 @@ void chSnowman_update(Actor *this){ || fileProgressFlag_get(0x13) ){//L802E2318 if(0.0 < local->unk4){ - if( (func_8023DB5C() & 1) + if( (globalTimer_getTime() & 1) || func_8028ECAC() == BSGROUP_A_FLYING ){//L802E236C local->unk4 -= dt; @@ -269,7 +269,7 @@ void chSnowman_update(Actor *this){ else{//L802E2380 if( __chSnowman_isPlayerInAttackRange(this, 500, 2750) && __chSnowman_isYawNearYawTarget(this, 3) - && func_8028EE84() != BSWATERGROUP_2_UNDERWATER + && player_getWaterState() != BSWATERGROUP_2_UNDERWATER && !__chSnowman_CCW_playerInProtectedZone() ){ subaddie_set_state_with_direction(this, CHSNOWMAN_STATE_2_ATTACK, 0.01f, 1); @@ -285,7 +285,7 @@ void chSnowman_update(Actor *this){ else if( 0.98 < animctrl_getAnimTimer(this->animctrl) || !__chSnowman_isPlayerInAttackRange(this, 500, 2750) - || func_8028EE84() == BSWATERGROUP_2_UNDERWATER + || player_getWaterState() == BSWATERGROUP_2_UNDERWATER || __chSnowman_CCW_playerInProtectedZone() ){ __chSnowman_enterIdle(this); diff --git a/src/core2/ch/termite.c b/src/core2/ch/termite.c index 90910ccd..3476e1e4 100644 --- a/src/core2/ch/termite.c +++ b/src/core2/ch/termite.c @@ -150,7 +150,7 @@ void chTermite_update(Actor *this) { static s32 D_80372F48 = 0; static s32 D_80372F4C = 0; - sp34 = func_8023DB5C(); + sp34 = globalTimer_getTime(); if (!this->unk16C_4) { marker_setCollisionScripts(this->marker, NULL, __chTermite_ow, __chTermite_die); this->unk124_0 = this->unk138_31 = FALSE; diff --git a/src/core2/code_12F30.c b/src/core2/code_12F30.c index 60f7ab7c..bef271aa 100644 --- a/src/core2/code_12F30.c +++ b/src/core2/code_12F30.c @@ -120,7 +120,7 @@ void func_80299EC0(f32 arg0[3]) { if (D_8037C6F0.unk0 == 1) { sp78 = 50; - } else if (func_8028EE84() == BSWATERGROUP_0_NONE) { + } else if (player_getWaterState() == BSWATERGROUP_0_NONE) { sp78 = 200; } else { sp78 = 250; diff --git a/src/core2/code_14420.c b/src/core2/code_14420.c index 0cda47bf..84dfff67 100644 --- a/src/core2/code_14420.c +++ b/src/core2/code_14420.c @@ -455,7 +455,7 @@ enum bs_14420_e func_8029BAF0(void){ return BS14420_D_WONDERWING; } if (player_inWater()) { - switch(func_8028EE84()){ + switch(player_getWaterState()){ case BSWATERGROUP_2_UNDERWATER: return BS14420_5_UNDERWATER; case BSWATERGROUP_1_SURFACE: @@ -721,9 +721,9 @@ void func_8029C674(void) { f32 sp1C[3]; D_8037D1E8 = FALSE; - if (func_80298850() == 4) { + if (func_80298850() == BSGROUP_4_LOOK) { D_8037D1E8 = TRUE; - miscflag_set(0x17); + miscflag_set(MISC_FLAG_17_FPV); ncDynamicCamera_enterFirstPerson(); func_8028E9C4(5, sp1C); ncFirstPersonCamera_setZoomedOutPosition(sp1C); @@ -748,12 +748,12 @@ void func_8029C6D0(void) { void func_8029C748(void) { if (D_8037D1E8) { - miscflag_clear(0x17); + miscflag_clear(MISC_FLAG_17_FPV); ncDynamicCamera_exitFirstPerson(); } } -enum bs_e func_8029C780(void){ +enum bs_e bs_getTypeOfJump(void){ if(button_held(BUTTON_Z) && can_flap_flip()) return BS_12_BFLIP; @@ -831,7 +831,7 @@ s32 func_8029C9C0(s32 arg0){ return arg0; if(button_pressed(BUTTON_A)) - arg0 = func_8029C780(); + arg0 = bs_getTypeOfJump(); if(button_pressed(BUTTON_B) && can_claw()) arg0 = BS_CLAW; @@ -839,7 +839,7 @@ s32 func_8029C9C0(s32 arg0){ if(button_held(BUTTON_Z) && should_beak_barge()) arg0 = BS_BBARGE; - if(func_80294F78()) + if(should_look_first_person_camera()) arg0 = badrone_look(); if(player_isSliding()) diff --git a/src/core2/code_16010.c b/src/core2/code_16010.c index f176b628..b3efcfe1 100644 --- a/src/core2/code_16010.c +++ b/src/core2/code_16010.c @@ -186,7 +186,7 @@ bool func_8029D66C(void){ case MAP_6E_GL_GV_LOBBY: case MAP_72_GL_BGS_LOBBY: case MAP_8E_GL_FURNACE_FUN://L8029D6FC - return func_80294610(0xE000) && func_8028B2E8(); + return func_80294610(0xE000) && player_isStable(); case MAP_31_RBB_RUSTY_BUCKET_BAY: player_getPosition(sp2C); @@ -228,7 +228,7 @@ bool func_8029D7B4(void){ && func_8028ECAC() != BSGROUP_9_LONG_LEG && miscflag_isFalse(MISC_FLAG_E_TOUCHING_WADING_BOOTS) && sp1C != BS_25_LONGLEG_ENTER - && func_8028EE84() != BSWATERGROUP_2_UNDERWATER + && player_getWaterState() != BSWATERGROUP_2_UNDERWATER && func_8028EC04() < 1U && func_80297C6C() != 3 && bs_getState() != BS_3D_FALL_TUMBLING @@ -254,7 +254,7 @@ void func_8029D968(void){ } temp_v0 = func_8029463C(); if(temp_v0 != NULL){ - sp18 = (temp_v0->flags & 0x4000) && func_8028B2E8(); + sp18 = (temp_v0->flags & 0x4000) && player_isStable(); } if (sp1C || sp18) { rumbleManager_80250D94(1.0f, 0.5f, 0.4f); diff --git a/src/core2/code_39D0.c b/src/core2/code_39D0.c index c21032a6..e5972d32 100644 --- a/src/core2/code_39D0.c +++ b/src/core2/code_39D0.c @@ -107,15 +107,15 @@ s32 can_wonderwing(void){ return ability_hasLearned(ABILITY_12_WONDERWING); } -int func_8028ACD8(void){ +int can_view_first_person(void){ if( map_get() == MAP_27_FP_FREEZEEZY_PEAK && mapSpecificFlags_get(0xd)){ return 0; } - if(ncFirstPersonCamera_getState() == 3) + if(ncFirstPersonCamera_getState() == FIRSTPERSON_STATE_3_EXIT) return 0; - if(!func_8028B2E8() && !player_inWater()) + if(!player_isStable() && !player_inWater()) return 0; return 1; } @@ -205,10 +205,10 @@ int player_shouldSlideTrot(void){ } bool func_8028B254(s32 arg0) { - return (func_8028B2E8() || (baphysics_get_vertical_velocity() < 0.0f && (player_getYPosition() - func_80294438()) < (f32) arg0)); + return (player_isStable() || (baphysics_get_vertical_velocity() < 0.0f && (player_getYPosition() - func_80294438()) < (f32) arg0)); } -int func_8028B2E8(void){ +int player_isStable(void){ return D_8037BF60 && baphysics_get_vertical_velocity() < 0.0f; } @@ -232,10 +232,10 @@ bool func_8028B3B4(void) { return FALSE; } -bool func_8028B424(void){ +bool player_isFallTumbling(void){ s32 sp1C; - if (func_8028B2E8()) { + if (player_isStable()) { return FALSE; } if (!bafalldamage_get_damage(&sp1C)) { @@ -280,7 +280,7 @@ void func_8028B534(void){ D_8037BF62 = 1; } else{ - if(func_8028B2E8() || sp1C == BSGROUP_A_FLYING || sp1C == BSGROUP_5_CLIMB){ + if(player_isStable() || sp1C == BSGROUP_A_FLYING || sp1C == BSGROUP_5_CLIMB){ D_8037BF62 = 0; } } diff --git a/src/core2/code_43800.c b/src/core2/code_43800.c index 1c341227..8b611a13 100644 --- a/src/core2/code_43800.c +++ b/src/core2/code_43800.c @@ -30,7 +30,7 @@ Actor *func_802CA7BC(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ f32 sp40; f32 sp34[3]; - sp60 = (func_8028EE84() == BSWATERGROUP_2_UNDERWATER) ? 8.0f : 4.0f; + sp60 = (player_getWaterState() == BSWATERGROUP_2_UNDERWATER) ? 8.0f : 4.0f; this = marker_getActor(marker); if( !func_8028F070() || !func_8028F150() diff --git a/src/core2/code_45310.c b/src/core2/code_45310.c index 6da38fbd..0c30823e 100644 --- a/src/core2/code_45310.c +++ b/src/core2/code_45310.c @@ -446,7 +446,7 @@ void func_802CCC5C(Actor *this) { && !func_8028F25C() && (sp58 > 800.0f) && (this->marker->unk14_21) - && (func_8028EE84() != BSWATERGROUP_2_UNDERWATER) + && (player_getWaterState() != BSWATERGROUP_2_UNDERWATER) && func_802CC57C(this, sp8C) ) { sp8C[0] = 0.0f; @@ -463,7 +463,7 @@ void func_802CCC5C(Actor *this) { spBC = 1; } if (this->state == 3) { - if (func_8028F25C() || (func_8028EE84() == BSWATERGROUP_2_UNDERWATER)) { + if (func_8028F25C() || (player_getWaterState() == BSWATERGROUP_2_UNDERWATER)) { func_802CC640(this, 4); } else { if (local->unk3A == 0) { diff --git a/src/core2/code_47BD0.c b/src/core2/code_47BD0.c index ea58338c..9501230e 100644 --- a/src/core2/code_47BD0.c +++ b/src/core2/code_47BD0.c @@ -247,7 +247,7 @@ void chBeeSwarm_802CF434(Actor *this) { void chBeeSwarm_802CF518(Actor *this) { if( func_803292E0(this) && func_80329530(this, 900) - && func_8028EE84() == BSWATERGROUP_0_NONE + && player_getWaterState() == BSWATERGROUP_0_NONE && player_getTransformation() != TRANSFORM_6_BEE ) { subaddie_set_state(this, 3); @@ -258,7 +258,7 @@ void chBeeSwarm_802CF57C(Actor *this) { ActorLocal_core2_47BD0 *local; local = (ActorLocal_core2_47BD0 *) &this->local; - if (!func_803292E0(this) || !func_80329530(this, 900) || func_8028EE84() != BSWATERGROUP_0_NONE) { + if (!func_803292E0(this) || !func_80329530(this, 900) || player_getWaterState() != BSWATERGROUP_0_NONE) { subaddie_set_state(this, 5); func_802CEF54(this, local->unkC, 100.0f); } diff --git a/src/core2/code_4C020.c b/src/core2/code_4C020.c index 84580db7..6b6662ce 100644 --- a/src/core2/code_4C020.c +++ b/src/core2/code_4C020.c @@ -171,7 +171,7 @@ void func_802D31AC(ActorMarker *arg0, ActorMarker * arg1) { case MARKER_109_BREAKABLE_BRICK_WALL: func_8030E6D4(SFX_114_BRICKWALL_BREAKING); - func_8030E510(SFX_11_WOOD_BREAKING_1, 28000); + sfxsource_play(SFX_11_WOOD_BREAKING_1, 28000); subaddie_set_state_looped(sp2C, 9); fileProgressFlag_set((sp2C->unkF4_8 == 1) ? FILEPROG_C8_LAIR_BRICKWALL_TO_WADINGBOOTS_BROKEN : FILEPROG_C9_LAIR_BRICKWALL_TO_SHOCKJUMP_PAD_BROKEN, TRUE); break; @@ -329,7 +329,7 @@ void func_802D31AC(ActorMarker *arg0, ActorMarker * arg1) { case 0x164: case 0x165: if (sp2C->unk1C[1] == sp2C->position[1]) { - func_8030E510(SFX_9B_BOULDER_BREAKING_1, 25000); + sfxsource_play(SFX_9B_BOULDER_BREAKING_1, 25000); sp2C->unk1C[0] = 1.0f; } break; @@ -539,7 +539,7 @@ void func_802D4388(Actor *this){ Actor *func_802D4588(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx) { s32 phi_a1; - phi_a1 = (marker_getActor(marker)->unk38_0) ? ((func_8023DB5C() & 4) != 0) ? 1 : 2 : 2; + phi_a1 = (marker_getActor(marker)->unk38_0) ? ((globalTimer_getTime() & 4) != 0) ? 1 : 2 : 2; func_8033A45C(1, phi_a1); return actor_draw(marker, gfx, mtx, vtx); } diff --git a/src/core2/code_53C10.c b/src/core2/code_53C10.c index 78c3aeef..bc9a8c40 100644 --- a/src/core2/code_53C10.c +++ b/src/core2/code_53C10.c @@ -131,14 +131,14 @@ bool func_802DAFBC(Actor *this) { if (temp_v0 & 4) { func_8032C9E0(sp38); sp34 = func_80257248(sp38, this->position); - if (((func_8023DB5C() - local->unk38) == 0x1E) && ((sp34 - this->yaw_ideal < 15.0f) && (sp34 - this->yaw_ideal > -15.0f))) { + if (((globalTimer_getTime() - local->unk38) == 0x1E) && ((sp34 - this->yaw_ideal < 15.0f) && (sp34 - this->yaw_ideal > -15.0f))) { func_802DAF2C(this->position, this->yaw, this->unk28); } else { func_80328CEC(this, (s32) sp34, 0, 0xF); } this->unk38_31 = 0x1E; this->unk38_0 = TRUE; - local->unk38 = func_8023DB5C(); + local->unk38 = globalTimer_getTime(); } else if (temp_v0 & 8) { func_802DAE10(this); this->unk38_31 = 0x5A; @@ -284,13 +284,13 @@ void func_802DB5A0(Actor *this) { func_80328FB0(this, 2.0f); func_802DB3B0(this); if (this->unk38_31 == 0) { - if (!(func_8023DB5C() & 0xF)) { + if (!(globalTimer_getTime() & 0xF)) { func_80328CEC(this, this->yaw_ideal, 0xA, 0x14); } - if (!(func_8023DB5C() & 7)) { + if (!(globalTimer_getTime() & 7)) { subaddie_maybe_set_state(this, 1, 0.02f); } - if( !(func_8023DB5C() & 0xF) + if( !(globalTimer_getTime() & 0xF) && func_80329078(this, (s32) this->yaw_ideal, 0x96) ) { if (subaddie_maybe_set_state(this, 3, 0.13f) != 0) { @@ -316,7 +316,7 @@ void func_802DB5A0(Actor *this) { case 3://L802DB930 func_80328FB0(this, 3.0f); func_802DB3B0(this); - if (!(func_8023DB5C() & 0xF) && (subaddie_maybe_set_state(this, 2, 0.08f))) { + if (!(globalTimer_getTime() & 0xF) && (subaddie_maybe_set_state(this, 2, 0.08f))) { func_802DAE10(this); } func_802DB220(this); @@ -351,7 +351,7 @@ void func_802DB5A0(Actor *this) { case 7://L802DBB4C if (this->unk38_31 == 0) { - if ((func_8023DB5C() & 0xF) == 9) { + if ((globalTimer_getTime() & 0xF) == 9) { this->yaw_ideal = (f32) func_80329784(this); } } diff --git a/src/core2/code_55180.c b/src/core2/code_55180.c index af286667..eeaac631 100644 --- a/src/core2/code_55180.c +++ b/src/core2/code_55180.c @@ -59,7 +59,7 @@ void func_802DC208(Actor *this) { } if( func_8024DB50(this->position, 50.0f) && func_802DC188() - && !(func_8023DB5C() & 0x1F) + && !(globalTimer_getTime() & 0x1F) && randf() < 0.1 ){ switch((s32)this->yaw){ diff --git a/src/core2/code_6B30.c b/src/core2/code_6B30.c index 9a7c6e2e..3dd52395 100644 --- a/src/core2/code_6B30.c +++ b/src/core2/code_6B30.c @@ -29,7 +29,7 @@ void func_8028DB04(void){ D_8037BFA0 = 2; } -enum hitbox_e func_8028DB14(ActorMarker *arg0){ +enum hitbox_e hitbox_getHitboxForActor(ActorMarker *arg0){ s32 retVal; if(D_8037BFA0) return HITBOX_3_BEAK_BOMB; @@ -77,10 +77,10 @@ enum hitbox_e func_8028DB14(ActorMarker *arg0){ break; case BS_5_JUMP://8028DCD8 case BS_3D_FALL_TUMBLING: - if(baphysics_get_vertical_velocity() < 0.0f && !func_8028B2E8()) + if(baphysics_get_vertical_velocity() < 0.0f && !player_isStable()) return HITBOX_A_FAST_FALLING; case BS_2F_FALL://8028DD10 - if(baphysics_get_vertical_velocity() < -1400.0f && !func_8028B2E8()) + if(baphysics_get_vertical_velocity() < -1400.0f && !player_isStable()) return HITBOX_A_FAST_FALLING; default://8028DD4C return HITBOX_0_NONE; diff --git a/src/core2/code_7060.c b/src/core2/code_7060.c index d3391a3f..66361b57 100644 --- a/src/core2/code_7060.c +++ b/src/core2/code_7060.c @@ -254,7 +254,7 @@ void func_8028E71C(void) { enum hitbox_e player_getActiveHitbox(ActorMarker *marker){ - return func_8028DB14(marker); + return hitbox_getHitboxForActor(marker); } AnimCtrl *player_getAnimCtrlPtr(void){ @@ -444,8 +444,8 @@ enum bsgroup_e func_8028ECAC(void) { if (miscflag_isTrue(MISC_FLAG_1B_TRANSFORMING)) { return BSGROUP_D_TRANSFORMING; } - if (miscflag_isTrue(0x17)) { - return 4; + if (miscflag_isTrue(MISC_FLAG_17_FPV)) { + return BSGROUP_4_LOOK; } if (bsbfly_inSet(state_id)) { return BSGROUP_A_FLYING; @@ -508,7 +508,7 @@ enum bsgroup_e func_8028ECAC(void) { } -enum bswatergroup_e func_8028EE84(void) { +enum bswatergroup_e player_getWaterState(void) { enum bswatergroup_e state_id; state_id = bs_getState(); @@ -609,7 +609,7 @@ bool func_8028F150(void){ } bool func_8028F170(void){ - return miscflag_isTrue(0x17); + return miscflag_isTrue(MISC_FLAG_17_FPV); } int ability_isUnlocked(enum ability_e uid){ @@ -629,7 +629,7 @@ bool func_8028F1E0(void){ } bool func_8028F20C(void){ - return func_8028B2E8(); + return player_isStable(); } bool func_8028F22C(void){ diff --git a/src/core2/code_72060.c b/src/core2/code_72060.c index 895b4055..3c9c537a 100644 --- a/src/core2/code_72060.c +++ b/src/core2/code_72060.c @@ -124,7 +124,7 @@ void func_802F919C(void) { return; } temp_f20 = time_getDelta(); - sp60 = (func_8023DB5C() & 1) * 2; + sp60 = (globalTimer_getTime() & 1) * 2; player_getPosition(D_80381040); D_80369280->unkC[0] = D_80381040[0] - D_80369280->unk0[0]; diff --git a/src/core2/code_73640.c b/src/core2/code_73640.c index e9b3de50..3007fc3b 100644 --- a/src/core2/code_73640.c +++ b/src/core2/code_73640.c @@ -144,7 +144,7 @@ void itemPrint_update(void) { } else { itemPrintValues[i] += (sign * _73640_MIN(time_getDelta() * _73640_MAX(diff, 8.0f), 1.0)); } - if ((D_80381168[i] != 0) && ((func_8023DB5C() & 7) == 0)) { + if ((D_80381168[i] != 0) && ((globalTimer_getTime() & 7) == 0)) { func_8025A6EC(D_80381168[i], 32000); } if (D_80381378[i] != 0) { diff --git a/src/core2/code_7AF80.c b/src/core2/code_7AF80.c index a7f3e16d..e7f32862 100644 --- a/src/core2/code_7AF80.c +++ b/src/core2/code_7AF80.c @@ -2287,7 +2287,7 @@ void func_803086B4(void) { cube = D_80381FA0.cube_list; } }; - if (func_8023DB5C() & 1) { + if (globalTimer_getTime() & 1) { if (D_8036ABA0 != NULL) { D_8036ABA0 = (s16*) defrag(D_8036ABA0); } diff --git a/src/core2/code_83340.c b/src/core2/code_83340.c index c74095ee..ef90919e 100644 --- a/src/core2/code_83340.c +++ b/src/core2/code_83340.c @@ -64,7 +64,7 @@ BKModelBin *func_8030A428(s32 arg0){ if(D_80382390[arg0].unk0 == NULL){ D_80382390[arg0].unk0 = assetcache_get(0x2d1 + arg0); } - D_80382390[arg0].unk4 = func_8023DB5C(); + D_80382390[arg0].unk4 = globalTimer_getTime(); return D_80382390[arg0].unk0; } @@ -78,7 +78,7 @@ BKSpriteDisplayData *func_8030A4D4(s32 arg0) if (((struct_7AF80_1 *)((s32)D_80382394 + arg0*sizeof(struct_7AF80_1)))->unk0 == 0){ ((struct_7AF80_1 *)((s32)D_80382394 + arg0*sizeof(struct_7AF80_1)))->unk0 = func_8033B6C4(arg0 + 0x572, &((struct_7AF80_1 *)((s32)D_80382394 + arg0*sizeof(struct_7AF80_1)))->unk4); } - D_80382394[arg0].unk8 = func_8023DB5C(); + D_80382394[arg0].unk8 = globalTimer_getTime(); return D_80382394[arg0].unk4; } @@ -154,7 +154,7 @@ void func_8030A850(s32 arg0) { struct_7AF80_0 *sp3C; struct_7AF80_1 *temp_a0_2; - temp_s3 = func_8023DB5C() - func_80255B08(arg0); + temp_s3 = globalTimer_getTime() - func_80255B08(arg0); for(var_s0 = 0; (D_80382390 != NULL) && (var_s0 < ((arg0 == 1) ? 0x28 : 0x2A1)); var_s0++, D_8036B804 = (D_8036B804 >= 0x2A1)? 0: D_8036B804 + 1){ sp3C = (struct_7AF80_0*)((u32)D_80382390 + sizeof(struct_7AF80_0)*D_8036B804); if ((sp3C->unk0 != 0) && ((sp3C->unk4 < temp_s3) || (arg0 == 3))){ diff --git a/src/core2/code_85800.c b/src/core2/code_85800.c index f88a66fb..be2d8dd1 100644 --- a/src/core2/code_85800.c +++ b/src/core2/code_85800.c @@ -28,7 +28,7 @@ typedef struct { f32 unk20; f32 unk24; s16 sfx_uid; - s16 unk2A;//sample_rate + s16 sample_rate;//sample_rate u8 unk2C; u8 pad2D[3]; void (*unk30)(u8 indx); @@ -41,7 +41,7 @@ typedef struct { u8 unk43_7:3; u8 unk43_4:3; u8 unk43_1:2; -}struct45s; +}SfxSource; u8 func_8030D90C(void); void sfxsource_setSfxId(u8 indx, enum sfx_e uid); @@ -56,7 +56,7 @@ void func_8030EDAC(f32, f32); /* .bss */ struct46s D_80382470[10]; -struct45s D_803824C0[35]; +SfxSource sfxsources[35]; f32 D_80382E0C; f32 D_80382E10; @@ -68,46 +68,46 @@ void __sfx_getPlayerPositionIfPresent(f32 arg0[3]){ ml_vec3f_clear(arg0); } -void func_8030C7D0(struct45s *arg0, s32 arg1){ +void func_8030C7D0(SfxSource *arg0, s32 arg1){ arg0->unk43_7 = arg1; } -s32 func_8030C7E8(struct45s *arg0){ +s32 func_8030C7E8(SfxSource *arg0){ return arg0->unk43_7; } -void func_8030C7F8(struct45s *arg0, s32 arg1){ +void func_8030C7F8(SfxSource *arg0, s32 arg1){ arg0->unk43_4 = arg1; } -int func_8030C814(struct45s *arg0, s32 arg1){ +int func_8030C814(SfxSource *arg0, s32 arg1){ return arg0->unk43_4 == arg1; } -void sfxsource_setFlag(struct45s *arg0, s32 arg1){ +void sfxsource_setFlag(SfxSource *arg0, s32 arg1){ arg0->unk41 |= arg1; } -void sfxsource_clearFlag(struct45s *arg0, s32 arg1){ +void sfxsource_clearFlag(SfxSource *arg0, s32 arg1){ arg0->unk41 &= ~arg1; } -s32 sfxsource_isFlagSet(struct45s *arg0, s32 arg1){ +s32 sfxsource_isFlagSet(SfxSource *arg0, s32 arg1){ return arg0->unk41 & arg1; } -int sfxsource_isFlagCleared(struct45s *arg0, s32 arg1){ +int sfxsource_isFlagCleared(SfxSource *arg0, s32 arg1){ return (arg0->unk41 & arg1) == 0; } void sfxsource_initAll(void){ int i; for(i = 0; i < 35; i++) - D_803824C0[i].busy = FALSE; + sfxsources[i].busy = FALSE; } -struct45s *sfxsource_at(u8 indx){ - return D_803824C0 + indx; +SfxSource *sfxsource_at(u8 indx){ + return sfxsources + indx; } struct46s *func_8030C8DC(s32 indx){ @@ -121,8 +121,8 @@ Struct81s *func_8030C8F4(s32 indx){ u8 sfxsource_getNewIndex(void){ int i; for(i = 1; i < 35; i++){ - if(!D_803824C0[i].busy){ - D_803824C0[i].busy = TRUE; + if(!sfxsources[i].busy){ + sfxsources[i].busy = TRUE; return i; } } @@ -154,15 +154,15 @@ s32 func_8030CA60(void){ } void sfxsource_free(u8 indx){ - struct45s *ptr = sfxsource_at(indx); + SfxSource *ptr = sfxsource_at(indx); if(ptr->unk40){ func_8030C9F4(ptr->unk40); ptr->unk40 = 0; } - D_803824C0[indx].busy = FALSE; + sfxsources[indx].busy = FALSE; } -void func_8030CBD0(struct45s *arg0){ +void func_8030CBD0(SfxSource *arg0){ s32 sp24 = func_8030CA60(); struct46s *temp_a1; if(sp24){ @@ -182,7 +182,7 @@ void func_8030CBD0(struct45s *arg0){ }//L8030CC7C } -void func_8030CC90(struct45s *arg0){ +void func_8030CC90(SfxSource *arg0){ if(func_8030C814(arg0, 1)){ sfxsource_clearFlag(arg0, SFX_SRC_FLAG_5_UNKOWN); func_8030C7F8(arg0, 2); @@ -192,7 +192,7 @@ void func_8030CC90(struct45s *arg0){ } } -s32 func_8030CCF0(struct45s *arg0, s32 arg1){ +s32 func_8030CCF0(SfxSource *arg0, s32 arg1){ f32 plyr_pos[3]; f32 diff[3]; f32 dist_sqr; @@ -211,7 +211,7 @@ s32 func_8030CCF0(struct45s *arg0, s32 arg1){ return retVal; } -s32 func_8030CDE4(struct45s *arg0){ +s32 func_8030CDE4(SfxSource *arg0){ f32 sp44[3]; f32 sp38[3]; f32 sp2C[3]; @@ -264,14 +264,14 @@ void func_8030D004(s32 arg0, s32 arg1){ } } -s32 func_8030D038(struct45s *arg0, s32 arg1){ +s32 func_8030D038(SfxSource *arg0, s32 arg1){ if(sfxsource_isFlagSet(arg0,SFX_SRC_FLAG_6_UNKOWN)){ if(sfxsource_isFlagSet(arg0, SFX_SRC_FLAG_7_UNKOWN)){ - if(player_is_present() && func_8028EE84() == BSWATERGROUP_2_UNDERWATER) + if(player_is_present() && player_getWaterState() == BSWATERGROUP_2_UNDERWATER) arg1 *= arg0->unk3C; } else{//L8030D0B4 - if(player_is_present() && func_8028EE84() != BSWATERGROUP_2_UNDERWATER) + if(player_is_present() && player_getWaterState() != BSWATERGROUP_2_UNDERWATER) arg1 *= arg0->unk38; } } @@ -280,7 +280,7 @@ s32 func_8030D038(struct45s *arg0, s32 arg1){ s32 func_8030D10C(u8 indx){ s32 sp24; - struct45s * ptr; + SfxSource * ptr; s32 tmp_v0; f32 tmp_f2; @@ -299,14 +299,14 @@ s32 func_8030D10C(u8 indx){ //L8030D228 if(sfxsource_isFlagSet(ptr, SFX_SRC_FLAG_1_UNKOWN)){ - tmp_v0 = func_8030CCF0(ptr, ptr->unk2A); + tmp_v0 = func_8030CCF0(ptr, ptr->sample_rate); if(tmp_v0 < 100) sp24 = 1; func_8030D004(ptr->unk40, func_8030D038(ptr, tmp_v0)); func_8030CF9C(ptr->unk40, func_8030CDE4(ptr)); }else{//L8030D288 if(sfxsource_isFlagSet(ptr, SFX_SRC_FLAG_3_UNKOWN)){ - tmp_v0 = func_8030D038(ptr, ptr->unk2A); + tmp_v0 = func_8030D038(ptr, ptr->sample_rate); if(tmp_v0 < 100) sp24 = 1; func_8030D004(ptr->unk40, tmp_v0); @@ -326,7 +326,7 @@ void func_8030D310(u8 indx){ f32 pad0; s32 sp30; f32 pad1; - struct45s * ptr; + SfxSource * ptr; f32 sp24; ptr = sfxsource_at(indx); @@ -396,7 +396,7 @@ void func_8030D310(u8 indx){ } bool func_8030D5CC(u8 indx){ - struct45s * sp1C = sfxsource_at(indx); + SfxSource * sp1C = sfxsource_at(indx); if(!func_8030C814(sp1C, 3)) return 0; @@ -411,7 +411,7 @@ bool func_8030D5CC(u8 indx){ void func_8030D644(void){ int i; for(i = 1; i < 35; i++){ - if(D_803824C0[i].busy){ + if(sfxsources[i].busy){ func_8030D310(i); if(func_8030D5CC(i)) sfxsource_free(i); @@ -442,14 +442,14 @@ void func_8030D778(void){ int i; int temp_s1; for(i = 1; i < 35; i++){ - if(D_803824C0[i].busy) + if(sfxsources[i].busy) func_8030DA44(i); } do{ temp_s1 = 0; func_8030D644(); for(i = 1; i < 35; i++){ - if(D_803824C0[i].busy) + if(sfxsources[i].busy) temp_s1++; } }while(temp_s1); @@ -478,7 +478,7 @@ void func_8030D8DC(void){ u8 func_8030D90C(void){ u8 s1 = sfxsource_getNewIndex(); - struct45s *s0; + SfxSource *s0; if(s1 == 0) return 0; @@ -486,7 +486,7 @@ u8 func_8030D90C(void){ s0 = sfxsource_at(s1); s0->unk30 = NULL; s0->sfx_uid = -1; - s0->unk2A = 22000; + s0->sample_rate = 22000; s0->unk2C = 0; s0->unk40 = 0; s0->unk43_1 = 0; @@ -511,7 +511,7 @@ u8 func_8030D90C(void){ } void func_8030DA44(u8 indx){ - struct45s * sp1C = sfxsource_at(indx); + SfxSource * sp1C = sfxsource_at(indx); func_8030E394(indx); func_8030C7F8(sp1C, 3); } @@ -522,10 +522,10 @@ void sfxsource_setSfxId(u8 indx, enum sfx_e uid){ } void sfxsource_setSampleRate(u8 indx, s32 sample_rate){ - struct45s *temp_v0; + SfxSource *temp_v0; if(indx){ temp_v0 = sfxsource_at(indx); - temp_v0->unk2A = sample_rate; + temp_v0->sample_rate = sample_rate; sfxsource_setFlag(temp_v0, SFX_SRC_FLAG_3_UNKOWN); } } @@ -550,7 +550,7 @@ void func_8030DB04(u8 indx, s32 arg1, f32 arg2[3], f32 min_dist, f32 max_dist){ } void func_8030DBB4(u8 indx, f32 arg1){ - struct45s *temp_v0; + SfxSource *temp_v0; if(indx){ temp_v0 = sfxsource_at(indx); temp_v0->unk34 = arg1; @@ -581,7 +581,7 @@ void func_8030DBFC(u8 indx, f32 arg1, f32 arg2, f32 arg3){ } void func_8030DCCC(u8 indx, s32 arg1){ - struct45s *temp_v0; + SfxSource *temp_v0; if(indx){ temp_v0 = sfxsource_at(indx); temp_v0->unk2C = arg1; @@ -590,7 +590,7 @@ void func_8030DCCC(u8 indx, s32 arg1){ } void func_8030DD14(u8 indx, int arg1){ - struct45s *temp_v0; + SfxSource *temp_v0; if(indx){ temp_v0 = sfxsource_at(indx); func_8030C7D0(temp_v0, arg1); @@ -598,7 +598,7 @@ void func_8030DD14(u8 indx, int arg1){ } void func_8030DD54(u8 indx, void (*arg1)(u8)){ - struct45s *temp_v0; + SfxSource *temp_v0; if(indx){ temp_v0 = sfxsource_at(indx); temp_v0->unk30 = arg1; @@ -606,7 +606,7 @@ void func_8030DD54(u8 indx, void (*arg1)(u8)){ } void func_8030DD90(u8 indx, s32 arg1){ - struct45s *temp_v0; + SfxSource *temp_v0; if(indx){ temp_v0 = sfxsource_at(indx); switch(arg1){ @@ -627,7 +627,7 @@ void func_8030DD90(u8 indx, s32 arg1){ } void func_8030DE44(u8 indx, s32 arg1, f32 arg2){ - struct45s *ptr; + SfxSource *ptr; if(indx){ ptr = sfxsource_at(indx); switch(arg1){ @@ -644,7 +644,7 @@ void func_8030DE44(u8 indx, s32 arg1, f32 arg2){ } void sfxsource_set_fade_distances(u8 indx, f32 min, f32 max){ - struct45s *ptr; + SfxSource *ptr; if(indx){ ptr = sfxsource_at(indx); ptr->fade_inner_radius_sqr = min*min; @@ -654,7 +654,7 @@ void sfxsource_set_fade_distances(u8 indx, f32 min, f32 max){ } void func_8030DF18(u8 indx, f32 arg1){ - struct45s *ptr; + SfxSource *ptr; if(indx){ ptr = sfxsource_at(indx); ptr->unk14 = (s16)arg1; @@ -663,7 +663,7 @@ void func_8030DF18(u8 indx, f32 arg1){ } void sfxsource_set_position(u8 indx, f32 position[3]){ - struct45s *ptr; + SfxSource *ptr; if(indx){ ptr = sfxsource_at(indx); ml_vec3f_copy(ptr->position, position); @@ -672,7 +672,7 @@ void sfxsource_set_position(u8 indx, f32 position[3]){ } void func_8030DFB4(u8 indx, s32 arg1){ - struct45s *ptr; + SfxSource *ptr; if(indx){ ptr = sfxsource_at(indx); ptr->unk16 = arg1; @@ -680,7 +680,7 @@ void func_8030DFB4(u8 indx, s32 arg1){ } void func_8030DFF0(u8 indx, s32 arg1){ - struct45s *ptr; + SfxSource *ptr; if(indx){ ptr = sfxsource_at(indx); if(arg1){ @@ -693,7 +693,7 @@ void func_8030DFF0(u8 indx, s32 arg1){ } void func_8030E04C(u8 indx, f32 arg1, f32 arg2, f32 arg3){ - struct45s *ptr; + SfxSource *ptr; if(indx){ ptr = sfxsource_at(indx); ptr->unk43_1 = 1; @@ -704,7 +704,7 @@ void func_8030E04C(u8 indx, f32 arg1, f32 arg2, f32 arg3){ } void func_8030E0B4(u8 indx, f32 arg1, f32 arg2){ - struct45s *ptr; + SfxSource *ptr; if(indx){ ptr = sfxsource_at(indx); ptr->unk38 = arg1; @@ -713,7 +713,7 @@ void func_8030E0B4(u8 indx, f32 arg1, f32 arg2){ } void func_8030E0FC(u8 indx, f32 arg1, f32 arg2, f32 arg3){ - struct45s *ptr; + SfxSource *ptr; if(indx){ ptr = sfxsource_at(indx); @@ -726,7 +726,7 @@ void func_8030E0FC(u8 indx, f32 arg1, f32 arg2, f32 arg3){ } enum sfx_e sfxsource_getSfxId(u8 indx){ - struct45s *ptr; + SfxSource *ptr; if(!indx) return 0; @@ -737,18 +737,18 @@ enum sfx_e sfxsource_getSfxId(u8 indx){ } s32 func_8030E1C4(u8 indx){ - struct45s *ptr; + SfxSource *ptr; if(indx == 0) return 0; else{ ptr = sfxsource_at(indx); - return ptr->unk2A; + return ptr->sample_rate; } } f32 func_8030E200(u8 indx){ - struct45s *ptr; + SfxSource *ptr; if(!indx) return 1.0f; @@ -759,7 +759,7 @@ f32 func_8030E200(u8 indx){ } s32 func_8030E244(u8 indx){ - struct45s *ptr; + SfxSource *ptr; if(!indx) return 0; @@ -769,19 +769,19 @@ s32 func_8030E244(u8 indx){ } } -bool func_8030E280(struct45s *arg0){ +bool func_8030E280(SfxSource *arg0){ int temp_v1; if(sfxsource_isFlagSet(arg0, SFX_SRC_FLAG_1_UNKOWN)){ - temp_v1 = func_8030CCF0(arg0, arg0->unk2A); + temp_v1 = func_8030CCF0(arg0, arg0->sample_rate); } else{ - temp_v1 = arg0->unk2A; + temp_v1 = arg0->sample_rate; } return (temp_v1 > 100); } void func_8030E2C4(u8 indx){ - struct45s *ptr; + SfxSource *ptr; if(!indx) return; @@ -810,7 +810,7 @@ void func_8030E2C4(u8 indx){ } void func_8030E394(u8 indx){ - struct45s *ptr; + SfxSource *ptr; if(indx){ ptr = sfxsource_at(indx); @@ -824,7 +824,7 @@ void func_8030E394(u8 indx){ int func_8030E3FC(u8 indx){ - struct45s *ptr; + SfxSource *ptr; if(!indx) return 0; @@ -849,12 +849,12 @@ void func_8030E4E4(enum sfx_e uid){ func_8030D6C4(uid, 1.0f, 22000, 0, 0); } -void func_8030E510(enum sfx_e uid, s32 arg1){ - func_8030D6C4(uid, 1.0f, arg1, 0, 2); +void sfxsource_play(enum sfx_e uid, s32 sample_rate){ + func_8030D6C4(uid, 1.0f, sample_rate, 0, 2); } void func_8030E540(enum sfx_e uid){ - func_8030E510(uid, 0x7ff8); + sfxsource_play(uid, 0x7ff8); } void func_8030E560(enum sfx_e uid, s32 arg1){ @@ -898,55 +898,56 @@ void func_8030E760(enum sfx_e uid, f32 arg1, s32 arg2){ func_8030D6C4(uid, arg1, arg2, 0, 0); } -void func_8030E78C(enum sfx_e uid, f32 arg1, u32 arg2, f32 position[3], f32 arg4, f32 arg5, s32 arg6){ - u8 s0; +void sfx_play(enum sfx_e uid, f32 arg1, u32 sampleRate, f32 position[3], f32 minFadeDistance, f32 maxFadeDistance, s32 arg6){ + u8 sfxsource; f32 plyr_pos[3]; __sfx_getPlayerPositionIfPresent(plyr_pos); - if( !(arg5 <= ml_distance_vec3f(plyr_pos, position)) + if( !(maxFadeDistance <= ml_distance_vec3f(plyr_pos, position)) && levelSpecificFlags_validateCRC2() && func_80320240() ){ - s0 = func_8030D90C(); - if(s0){ - func_8030DD90(s0, arg6); - sfxsource_setSfxId(s0, uid); - sfxsource_setSampleRate(s0, arg2); - func_8030DBB4(s0, arg1); - sfxsource_set_fade_distances(s0, arg4, arg5); - sfxsource_set_position(s0, position); - func_8030DD14(s0, 1); - func_8030E2C4(s0); + sfxsource = func_8030D90C(); + if(sfxsource){ + func_8030DD90(sfxsource, arg6); // priority ? + sfxsource_setSfxId(sfxsource, uid); + sfxsource_setSampleRate(sfxsource, sampleRate); + func_8030DBB4(sfxsource, arg1); // volume ? + sfxsource_set_fade_distances(sfxsource, minFadeDistance, maxFadeDistance); + sfxsource_set_position(sfxsource, position); + func_8030DD14(sfxsource, 1); + func_8030E2C4(sfxsource); } } } -void func_8030E878(enum sfx_e id, f32 arg1, u32 arg2, f32 arg3[3], f32 arg4, f32 arg5){ - func_8030E78C(id, arg1, arg2, arg3, arg4, arg5, 2); +void func_8030E878(enum sfx_e id, f32 arg1, u32 sampleRate, f32 position[3], f32 minFadeDistance, f32 maxFadeDistance){ + sfx_play(id, arg1, sampleRate, position, minFadeDistance, maxFadeDistance, 2); } -void func_8030E8B4(u32 arg0, f32 arg1[3], u32 arg2){ - func_8030E78C( +// fadeDistance is a 32-bit value where the lower 16 bits represent minFadeDistance and the upper 16 bits represent maxFadeDistance. +void func_8030E8B4(u32 arg0, f32 position[3], u32 fadeDistance){ + sfx_play( (arg0 & 0x7ff), (f32)((arg0 >> 0x15) & 0x7ff)/1023.0, ((arg0 >> 0x6) & 0x7fe0), - arg1, (f32)(arg2 & 0xffff), (f32)((arg2 >> 0x10) & 0xffff), + position, (f32)(fadeDistance & 0xffff), (f32)((fadeDistance >> 0x10) & 0xffff), 2 ); } -void func_8030E988(enum sfx_e uid, f32 arg1, u32 arg2, f32 arg3[3], f32 arg4, f32 arg5){ - func_8030E78C(uid, arg1, arg2, arg3, arg4, arg5, 1); +void func_8030E988(enum sfx_e uid, f32 arg1, u32 sampleRate, f32 position[3], f32 minFadeDistance, f32 maxFadeDistance){ + sfx_play(uid, arg1, sampleRate, position, minFadeDistance, maxFadeDistance, 1); } -void func_8030E9C4(enum sfx_e uid, f32 arg1, u32 arg2, f32 arg3[3], f32 arg4, f32 arg5){ - func_8030E78C(uid, arg1, arg2, arg3, arg4, arg5, 0); +void func_8030E9C4(enum sfx_e uid, f32 arg1, u32 sampleRate, f32 position[3], f32 minFadeDistance, f32 maxFadeDistance){ + sfx_play(uid, arg1, sampleRate, position, minFadeDistance, maxFadeDistance, 0); } -void func_8030E9FC(enum sfx_e uid, f32 arg1, f32 arg2, u32 arg3, f32 arg4[3], f32 arg5, f32 arg6){ - func_8030E78C(uid, sfx_randf2(arg1, arg2), arg3, arg4, arg5, arg6, 2); +void func_8030E9FC(enum sfx_e uid, f32 arg1, f32 arg2, u32 sampleRate, f32 position[3], f32 minFadeDistance, f32 maxFadeDistance){ + sfx_play(uid, sfx_randf2(arg1, arg2), sampleRate, position, minFadeDistance, maxFadeDistance, 2); } -void func_8030EA54(enum sfx_e uid, f32 arg1, f32 arg2, u32 arg3, f32 arg4[3], f32 arg5, f32 arg6){ - func_8030E78C(uid, sfx_randf2(arg1, arg2), arg3, arg4, arg5, arg6, 1); +void func_8030EA54(enum sfx_e uid, f32 arg1, f32 arg2, u32 sampleRate, f32 position[3], f32 minFadeDistance, f32 maxFadeDistance){ + sfx_play(uid, sfx_randf2(arg1, arg2), sampleRate, position, minFadeDistance, maxFadeDistance, 1); } void func_8030EAAC(enum sfx_e uid, f32 arg1, s32 arg2, s32 arg3){ diff --git a/src/core2/code_9290.c b/src/core2/code_9290.c index 06f2d841..23fbf96c 100644 --- a/src/core2/code_9290.c +++ b/src/core2/code_9290.c @@ -35,7 +35,7 @@ void func_80290298(void) { is_pumpkin = player_getTransformation() == TRANSFORM_3_PUMPKIN; sp30 = (func_8028B528() && !is_pumpkin) ? 6 : 1; sp24 = func_8028B528() && !is_pumpkin; - if (D_8037C02C || func_8028B2E8() || sp24 || func_8028ECAC() == BSGROUP_5_CLIMB || bs_getState() == BS_B_UNKOWN) { + if (D_8037C02C || player_isStable() || sp24 || func_8028ECAC() == BSGROUP_5_CLIMB || bs_getState() == BS_B_UNKOWN) { _player_getPosition(D_8037C020); } diff --git a/src/core2/code_9450.c b/src/core2/code_9450.c index 4ab13895..756399d7 100644 --- a/src/core2/code_9450.c +++ b/src/core2/code_9450.c @@ -89,7 +89,7 @@ void func_802906D8(void){ int underwater_or_walrus_in_water; func_80290444(); - underwater_or_walrus_in_water = (func_8028EE84() == BSWATERGROUP_2_UNDERWATER); + underwater_or_walrus_in_water = (player_getWaterState() == BSWATERGROUP_2_UNDERWATER); if(!underwater_or_walrus_in_water){ underwater_or_walrus_in_water = (player_getTransformation() == TRANSFORM_4_WALRUS && player_inWater()); } diff --git a/src/core2/code_94A20.c b/src/core2/code_94A20.c index e90b021a..4c63d445 100644 --- a/src/core2/code_94A20.c +++ b/src/core2/code_94A20.c @@ -254,7 +254,7 @@ void func_8031C29C(struct0 *arg0) { ml_vec3f_copy(sp30, arg0->unk1C); sp48 = ((arg0->unk1C[1] - arg0->posX) > 120.0) ? 1 : 0; - sp40 = func_8023DB4C(1); + sp40 = globalTimer_getTimeMasked(1); if ((sp48 == 0) || (sp40 != 0)) { arg0->unk59 = arg0->unk5B; temp_v0 = func_8031BBA0(&sp30, 60.0f, -390.0f, arg0->unk54 | 0x1E0000, &sp4C); diff --git a/src/core2/code_9BD0.c b/src/core2/code_9BD0.c index 6c93ac41..b9473951 100644 --- a/src/core2/code_9BD0.c +++ b/src/core2/code_9BD0.c @@ -103,7 +103,7 @@ int func_80290D48(void){ } int func_80290E8C(void){ - if(func_8028EE84() != BSWATERGROUP_2_UNDERWATER) + if(player_getWaterState() != BSWATERGROUP_2_UNDERWATER) return FALSE; ncDynamicCamera_setState(3); diff --git a/src/core2/code_A5BC0.c b/src/core2/code_A5BC0.c index fdf2daee..26e8ba06 100644 --- a/src/core2/code_A5BC0.c +++ b/src/core2/code_A5BC0.c @@ -186,7 +186,7 @@ void func_8032CD60(Prop *prop) { sp30 = (sp44 == 3) ? sp38 : (sp38 - sp34)*2; sp2C = (s32)((((u32)(((u16*)prop)[5]) << 0x15) >> 0x1B) * sp30) / 32; - var_v1 = (((func_8023DB5C(sp34, sp30, prop, sp40) % (sp30 * sp48)) / sp48) + sp2C) % sp30; + var_v1 = (((globalTimer_getTime(sp34, sp30, prop, sp40) % (sp30 * sp48)) / sp48) + sp2C) % sp30; var_t5 = 0; switch (sp40) { /* irregular */ default: @@ -1398,7 +1398,7 @@ void func_803306C8(s32 arg0) { s32 var_s0_2; s32 var_s1; - temp_fp = func_8023DB5C() - func_80255B08(arg0); + temp_fp = globalTimer_getTime() - func_80255B08(arg0); func_80254BD0(&sp54, 1); if(sp54 > 256000) return; @@ -1514,7 +1514,7 @@ BKModelBin *func_80330B1C(ActorMarker *this){ if(!this->unk18 && this->propPtr->unk8_1 && modelInfo->modelPtr && func_8033A12C(modelInfo->modelPtr)){ this->unk18 = func_80330B10(); } - modelInfo->unk10 = func_8023DB5C(); + modelInfo->unk10 = globalTimer_getTime(); return modelInfo->modelPtr; } @@ -1577,7 +1577,7 @@ BKSpriteDisplayData *func_80330E54(ActorMarker *marker, BKSprite **sprite_ptr) { if (model_cache_ptr->unk4 == 0) { model_cache_ptr->unk4 = func_8033B6C4(marker->modelId, &model_cache_ptr->unk8); } - model_cache_ptr->unk10 = func_8023DB5C(); + model_cache_ptr->unk10 = globalTimer_getTime(); if (sprite_ptr != NULL) { *sprite_ptr = model_cache_ptr->unk4; } diff --git a/src/core2/code_AD110.c b/src/core2/code_AD110.c index d07fbe2b..78b689b1 100644 --- a/src/core2/code_AD110.c +++ b/src/core2/code_AD110.c @@ -554,7 +554,7 @@ void func_80334448(NodeProp *arg0, ActorMarker *arg1) { switch(func_80330F7C(arg0)) { case 3: //L80334480 - sp24 = func_8023DB5C(); + sp24 = globalTimer_getTime(); if ((func_80330FC4(arg0) + 1) != sp24) { D_8036F980[func_80330F8C(arg0)](arg0, arg1); } diff --git a/src/core2/code_AD5B0.c b/src/core2/code_AD5B0.c index 02b78a2a..f6a990c4 100644 --- a/src/core2/code_AD5B0.c +++ b/src/core2/code_AD5B0.c @@ -312,7 +312,7 @@ s32 func_80334ECC(void) { func_80351C48(); func_80330FF4(); func_8028E71C(); - phi_v0 = func_8023DB5C(); + phi_v0 = globalTimer_getTime(); if (D_80370250) { phi_v1 = 0xF; } else { diff --git a/src/core2/code_BEF20.c b/src/core2/code_BEF20.c index 5ad17a04..332efe92 100644 --- a/src/core2/code_BEF20.c +++ b/src/core2/code_BEF20.c @@ -282,8 +282,8 @@ void func_803465E4(void){ if(!func_8028EC04() && func_8028F070()){ if(level_get() != LEVEL_2_TREASURE_TROVE_COVE || !levelSpecificFlags_get(5)){ - is_underwater = (func_8028EE84() == BSWATERGROUP_2_UNDERWATER); - is_on_water_surface = (func_8028EE84() == BSWATERGROUP_1_SURFACE); + is_underwater = (player_getWaterState() == BSWATERGROUP_2_UNDERWATER); + is_on_water_surface = (player_getWaterState() == BSWATERGROUP_1_SURFACE); is_in_polluted_or_winter_water = ((level_get() == LEVEL_9_RUSTY_BUCKET_BAY) || (map_get() == MAP_46_CCW_WINTER)); if( is_in_polluted_or_winter_water && (is_underwater || is_on_water_surface)){ //L803467EC D_80385FEC = 2.0f; @@ -326,7 +326,7 @@ void func_803465E4(void){ } }//L80346B6C - if((func_8023DB5C() & 7) == 6){ + if((globalTimer_getTime() & 7) == 6){ if(!func_80320708() || !func_80320248()){ D_80385F30[randi2(0, 0x2C)] = 1; D_80385FF0[randi2(0, 0xE)] = 1; diff --git a/src/core2/code_C2F30.c b/src/core2/code_C2F30.c index 0e2f8e20..369c03e0 100644 --- a/src/core2/code_C2F30.c +++ b/src/core2/code_C2F30.c @@ -80,7 +80,7 @@ void func_80349FB0(DemoInput *input_ptr, u32 size, int arg2){ func_803204E4(0xc4, 1); func_8024F224(); rand_reset(); - func_8023DB68(); + globalTimer_reset(); }//*/ /* returns offset of current input */ diff --git a/src/core2/code_CD6E0.c b/src/core2/code_CD6E0.c index ddded45e..e73f4481 100644 --- a/src/core2/code_CD6E0.c +++ b/src/core2/code_CD6E0.c @@ -329,7 +329,7 @@ void func_80355134(void) { sp3C = func_8033E864(); sp38 = func_8033E888(); sp34 = func_8033E8AC(); - if ((func_8023DB5C() & 1) == 0) { + if ((globalTimer_getTime() & 1) == 0) { temp_s0->unk20--; } if (temp_s0->unk20 < 0) { @@ -400,7 +400,7 @@ void func_803553E8(void) { sp3C = func_8033E864(); sp38 = func_8033E888(); sp34 = func_8033E8AC(); - if ((func_8023DB5C() & 1) == 0) { + if ((globalTimer_getTime() & 1) == 0) { temp_s0->unk20--; } if (temp_s0->unk20 < 0) { diff --git a/src/core2/code_D6600.c b/src/core2/code_D6600.c index cafb0c8f..92ea4c55 100644 --- a/src/core2/code_D6600.c +++ b/src/core2/code_D6600.c @@ -142,7 +142,7 @@ void func_8035DA1C(Actor *this) { if (randf() < 0.01) { LOCAL_D6600(this)->unk0 = 5; } - if (LOCAL_D6600(this)->unk0 != 0 && !(func_8023DB5C() & 0xF)) { + if (LOCAL_D6600(this)->unk0 != 0 && !(globalTimer_getTime() & 0xF)) { LOCAL_D6600(this)->unk0--; func_8035D95C(this->marker); } diff --git a/src/core2/code_D89E0.c b/src/core2/code_D89E0.c index 829f4546..5b864c4a 100644 --- a/src/core2/code_D89E0.c +++ b/src/core2/code_D89E0.c @@ -435,7 +435,7 @@ void func_80360828(Actor *this){ this->unk38_31 = 0x3C; } else{ - if(!(func_8023DB5C() & 0xf)){ + if(!(globalTimer_getTime() & 0xf)){ if(randf() < 0.35){ FUNC_8030E8B4(SFX_419_UNKNOWN, 1.0f, 28000, this->position, 1250, 2500); } diff --git a/src/core2/code_D9B0.c b/src/core2/code_D9B0.c index 7c8db6a8..903d40f2 100644 --- a/src/core2/code_D9B0.c +++ b/src/core2/code_D9B0.c @@ -103,7 +103,7 @@ void func_80294B00(int arg0){ void func_80294B0C(void){ f32 sp1C = player_getYPosition(); int sp18 = func_8028ECAC(); - if( func_8028B2E8() + if( player_isStable() || player_inWater() || (sp18 == BSGROUP_A_FLYING && player_getActiveHitbox(0) != HITBOX_3_BEAK_BOMB) || sp18 == BSGROUP_5_CLIMB @@ -180,11 +180,11 @@ void func_80294E54(int arg0){ } void func_80294E60(void){ - if(func_8028B2E8()){ + if(player_isStable()){ _player_getPosition(D_8037C2D8); } - if(func_8028B2E8() || bsclimb_inSet(bs_getState())){ + if(player_isStable() || bsclimb_inSet(bs_getState())){ miscflag_clear(MISC_FLAG_5_HAS_PECKED); miscflag_clear(MISC_FLAG_12_HAS_FLAPPED); } diff --git a/src/core2/code_DF70.c b/src/core2/code_DF70.c index a49e7094..49bc84e0 100644 --- a/src/core2/code_DF70.c +++ b/src/core2/code_DF70.c @@ -13,8 +13,8 @@ int should_beak_bust(void){ return button_pressed(BUTTON_Z) && can_beak_bust(); } -int func_80294F78(void){ - return button_pressed(BUTTON_C_UP) && func_8028ACD8(); +int should_look_first_person_camera(void){ + return button_pressed(BUTTON_C_UP) && can_view_first_person(); } int should_rotate_camera_left(void){ diff --git a/src/core2/code_EF50.c b/src/core2/code_EF50.c index 62337482..e5280ebf 100644 --- a/src/core2/code_EF50.c +++ b/src/core2/code_EF50.c @@ -40,7 +40,7 @@ enum bs_e func_80295EE0(enum bs_e arg0){ sp2C = 0; sp28 = 0; current_state = bs_getState(); - if(player_getTransformation() != TRANSFORM_1_BANJO || func_8028EE84() != BSWATERGROUP_0_NONE){ + if(player_getTransformation() != TRANSFORM_1_BANJO || player_getWaterState() != BSWATERGROUP_0_NONE){ sp2C = 1; } if(bsjig_inJiggyJig(current_state)){ @@ -191,7 +191,7 @@ enum bs_e func_802962BC(u32 arg0){ if(bsbtrot_inSet(bs_getState())) return BS_BTROT_OW; - if(func_8028EE84() == BSWATERGROUP_2_UNDERWATER) + if(player_getWaterState() == BSWATERGROUP_2_UNDERWATER) return BS_7F_DIVE_OW; if(func_8028ECAC() == BSGROUP_A_FLYING) @@ -300,7 +300,7 @@ void func_80296608(void){ break; case BS_INTR_A: //L8029666C sp2C = 2; - if(func_8028B2E8()){ + if(player_isStable()){ next_state = badrone_transform(); } else{ @@ -443,7 +443,7 @@ void func_80296608(void){ !func_80298850() && !sp1C && !miscflag_isTrue(0xf) - && !func_8028B2E8() + && !player_isStable() ){ next_state = BS_4F_CLIMB_IDLE; sp2C = 2; @@ -474,7 +474,7 @@ void func_80296608(void){ next_state = BS_24_FLY; } else{ - switch(func_8028EE84()){ + switch(player_getWaterState()){ case BSWATERGROUP_1_SURFACE: next_state = BS_2D_SWIM_IDLE; break; @@ -482,7 +482,7 @@ void func_80296608(void){ next_state = BS_2B_DIVE_IDLE; break; case BSWATERGROUP_0_NONE://L80296B0C - if(func_8028B2E8()) + if(player_isStable()) next_state = bs_getIdleState(); else next_state = func_8029BA80(); diff --git a/src/core2/fx/honeycarrierscore.c b/src/core2/fx/honeycarrierscore.c index 0f4786ef..ff7faad6 100644 --- a/src/core2/fx/honeycarrierscore.c +++ b/src/core2/fx/honeycarrierscore.c @@ -224,7 +224,7 @@ void fxhoneycarrierscore_update(s32 arg0, struct8s *arg1){ if(D_8036A014 == NULL){ D_8036A014 = assetcache_get(0x7DD); } - D_803815C4 = func_8023DB5C(); + D_803815C4 = globalTimer_getTime(); D_803815E4 = 0; D_803815E0 = 0.9999f; item_adjustByDiffWithHud(ITEM_13_EMPTY_HONEYCOMB, -6); diff --git a/src/core2/gc/zoombox.c b/src/core2/gc/zoombox.c index 1c96903e..3ff3c464 100644 --- a/src/core2/gc/zoombox.c +++ b/src/core2/gc/zoombox.c @@ -929,7 +929,7 @@ void func_80316764(GcZoombox *this, s32 arg1) { } } else if (arg1) { - if (!this->unk1A4_12 || (sp2C[0] == 0) || !(func_8023DB5C() & 1)){ + if (!this->unk1A4_12 || (sp2C[0] == 0) || !(globalTimer_getTime() & 1)){ if (this->unk110[0] == -1.0f) { func_80315C90(this, 1); } diff --git a/src/core2/nc/dynamicCam12.c b/src/core2/nc/dynamicCam12.c index 38a4db66..227ca436 100644 --- a/src/core2/nc/dynamicCam12.c +++ b/src/core2/nc/dynamicCam12.c @@ -130,7 +130,7 @@ s32 func_802C11C8(f32 arg0[3]) { sp2C = func_802C0EC0(); func_802C0FF4(sp4C); - if (func_8028EE84() == BSWATERGROUP_2_UNDERWATER) { + if (player_getWaterState() == BSWATERGROUP_2_UNDERWATER) { func_802BD82C(20.0f, 200.0f); } else { func_802BD82C(80.0f, 200.0f); @@ -226,7 +226,7 @@ void func_802C16CC(s32 arg0) { s32 sp34; s16 *sp30; - if ((func_8028ECAC() != 4) && !__is_flying_in_FP()){ + if ((func_8028ECAC() != BSGROUP_4_LOOK) && !__is_flying_in_FP()){ sp38 = func_80334524(arg0); if(sp38 != D_8037DBE0.unk28 && D_8037DBE0.unk28 != -1){ player_getPosition(sp54); diff --git a/src/core2/nc/dynamicCamera.c b/src/core2/nc/dynamicCamera.c index 914f75da..fc393ce2 100644 --- a/src/core2/nc/dynamicCamera.c +++ b/src/core2/nc/dynamicCamera.c @@ -531,7 +531,7 @@ void func_802BD3CC(f32 arg0[3]) { player_getPosition(arg0); sp2C = func_8028E82C(); - if ((func_8028F2FC() != 0) && (func_8028EE84() != BSWATERGROUP_2_UNDERWATER) && (player_getTransformation() == TRANSFORM_1_BANJO)) { + if ((func_8028F2FC() != 0) && (player_getWaterState() != BSWATERGROUP_2_UNDERWATER) && (player_getTransformation() == TRANSFORM_1_BANJO)) { temp_f0 = func_8028EF88(); temp_f2 = temp_f0 - 500.0f; sp2C = ml_map_f(arg0[1], temp_f0 - 80.0f, temp_f2, temp_f0, temp_f2); @@ -991,11 +991,11 @@ void func_802BE894(f32 position[3], f32 rotation[3]){ void ncDynamicCamera_enterFirstPerson(void){ dynamicCameraInFirstPerson = TRUE; - ncFirstPersonCamera_setState(1); + ncFirstPersonCamera_setState(FIRSTPERSON_STATE_1_ENTER); ncFirstPersonCamera_setZoomedOutPosition(cameraPosition); ncFirstPersonCamera_setZoomedOutRotation(cameraRotation); } void ncDynamicCamera_exitFirstPerson(void){ - ncFirstPersonCamera_setState(3); + ncFirstPersonCamera_setState(FIRSTPERSON_STATE_3_EXIT); } diff --git a/src/core2/nc/firstpersoncamera.c b/src/core2/nc/firstpersoncamera.c index fc98870c..5af38183 100644 --- a/src/core2/nc/firstpersoncamera.c +++ b/src/core2/nc/firstpersoncamera.c @@ -6,14 +6,6 @@ extern void func_802BD780(f32[3], f32[3], f32, f32, f32, f32); extern f32 func_80257CF8(f32, f32, f32, f32, f32); - -enum nc_first_person_state{ - FIRSTPERSON_STATE_1_ENTER = 1, - FIRSTPERSON_STATE_2_IDLE, - FIRSTPERSON_STATE_3_EXIT, - FIRSTPERSON_STATE_4_DONE, -}; - void ncFirstPersonCamera_setState(enum nc_first_person_state state); /* .bss */ @@ -42,7 +34,7 @@ void __ncFirstPersonCamera_getPositionAndRotation_entering(f32 arg0[3], f32 arg1 D_8037DC60.rotation[i] = mlNormalizeAngle(D_8037DC60.zoomed_out_rotation[i] + func_80257CF8(D_8037DC60.transistion_timer, 0.5f, 0.0f, 0.0f, mlDiffDegF(D_8037DC60.zoomed_in_rotation[i], D_8037DC60.zoomed_out_rotation[i]))); } if (D_8037DC60.transistion_timer == 0.0f) { - ncFirstPersonCamera_setState(2); + ncFirstPersonCamera_setState(FIRSTPERSON_STATE_2_IDLE); } if (__ncFirstPersonCamera_fullyZoomedIn() && func_8028F150()) { func_8028FCC8(0); @@ -61,7 +53,7 @@ void __ncFirstPersonCamera_getPositionAndRotation_exiting(f32 arg0[3], f32 arg1[ D_8037DC60.rotation[i] = mlNormalizeAngle(D_8037DC60.zoomed_in_rotation[i] + func_80257CF8(D_8037DC60.transistion_timer, 1.0f, 0.5f, 0.0f, mlDiffDegF(arg1[i], D_8037DC60.zoomed_in_rotation[i]))); } if (D_8037DC60.transistion_timer == 0.0f) { - ncFirstPersonCamera_setState(4); + ncFirstPersonCamera_setState(FIRSTPERSON_STATE_4_DONE); } if (!__ncFirstPersonCamera_fullyZoomedIn() && !func_8028F150()) { func_8028FCC8(1); diff --git a/src/core2/snackerctl.c b/src/core2/snackerctl.c index d49abd44..f63d1b6d 100644 --- a/src/core2/snackerctl.c +++ b/src/core2/snackerctl.c @@ -83,7 +83,7 @@ static SnackerCtlState _snackerctl_update_bottles_bonus(void){ if(!func_8028F25C() && func_80321960() == 3) func_803219F4(1); - if(miscflag_isTrue(0x17) && !func_8028F25C()){ + if(miscflag_isTrue(MISC_FLAG_17_FPV) && !func_8028F25C()){ if(__snackerctl_player_within_distance(183.0f, -100.0f, 75.0f)){ if(chBottlesBonus_getPuzzleIndex() == 6){ if(!D_8037DCCC){ diff --git a/src/fight/chbossjinjobase.c b/src/fight/chbossjinjobase.c index 6f32d6ed..77fdc646 100644 --- a/src/fight/chbossjinjobase.c +++ b/src/fight/chbossjinjobase.c @@ -91,7 +91,7 @@ void func_8038D568(Actor *this){ ActorLocal_fight_6E90 *local = (ActorLocal_fight_6E90 *)&this->local; f32 sp48 = time_getDelta(); - u32 sp44 = func_8023DB5C() & 0xF; + u32 sp44 = globalTimer_getTime() & 0xF; Actor *other; //sp40 f32 sp3C; f32 sp30[3]; diff --git a/src/fight/chfinalboss.c b/src/fight/chfinalboss.c index 36768734..2fc3432b 100644 --- a/src/fight/chfinalboss.c +++ b/src/fight/chfinalboss.c @@ -342,7 +342,7 @@ void func_803869BC(Actor *this) { u32 temp_t3; if (this->marker->unk14_21) { - sp3C = func_8023DB5C(); + sp3C = globalTimer_getTime(); temp_t3 = (u32) this->state; if ((temp_t3 == 6) || (temp_t3 == 7)) { sp30[0] = D_803916CC[0]; @@ -852,7 +852,7 @@ void chfinalboss_phase1_setState(Actor *this, s32 next_state) { f32 temp_f12; local = (ActorLocal_fight_180 *)&this->local; - sp40 = func_8023DB5C(); + sp40 = globalTimer_getTime(); sp3C = animctrl_getAnimTimer(this->animctrl); local->phase = 1; subaddie_set_state_with_direction(this, next_state, 0.0001f, 1); @@ -936,7 +936,7 @@ void func_8038856C(Actor *actor, f32 *arg1) { } void func_803885DC(Actor *this) { - s32 sp24 = func_8023DB5C(); + s32 sp24 = globalTimer_getTime(); if (func_8030E3FC(this->unk44_31) == 0) { func_8030E2C4(this->unk44_31); @@ -1148,7 +1148,7 @@ void chfinalboss_phase2_setState(Actor *this, s32 arg1){ s32 sp28; local = (ActorLocal_fight_180 *)&this->local; - sp28 = func_8023DB5C(); + sp28 = globalTimer_getTime(); local->phase = 2; subaddie_set_state_with_direction(this, arg1, 0.0001f, 1); actor_loopAnimation(this); diff --git a/src/fight/chjinjonatorbase.c b/src/fight/chjinjonatorbase.c index acfe971e..9580765f 100644 --- a/src/fight/chjinjonatorbase.c +++ b/src/fight/chjinjonatorbase.c @@ -108,7 +108,7 @@ void func_8038E2CC(ActorMarker *arg0) { void chjinjonatorbase_update(Actor *this){ ActorLocal_fight_7BE0 *local = (ActorLocal_fight_7BE0 *)&this->local; f32 sp58 = time_getDelta(); - s32 temp_s1 = func_8023DB5C() & 0xf; + s32 temp_s1 = globalTimer_getTime() & 0xf; s32 temp_s0; int i; Actor *other; diff --git a/src/fight/chspellfireball.c b/src/fight/chspellfireball.c index 232e6f9d..50cb2d05 100644 --- a/src/fight/chspellfireball.c +++ b/src/fight/chspellfireball.c @@ -323,7 +323,7 @@ void func_8038F620(Actor *this){ D_80391CEC, D_80391D34, D_80391CF4, D_80391D1C, D_80391D2C ); - func_8023DB5C(); + globalTimer_getTime(); break; }//L8038F918 D_803928F8[0] = this->position[0]; diff --git a/src/fight/code_9850.c b/src/fight/code_9850.c index 85183c63..a3894f18 100644 --- a/src/fight/code_9850.c +++ b/src/fight/code_9850.c @@ -101,7 +101,7 @@ void func_8038FE94(Actor *this){ this->scale = (f64)this->scale + this->scale; }//L8038FF18 this->roll += 20.0f; - if(func_8023DB5C()%4 == 1){ + if(globalTimer_getTime()%4 == 1){ if(randf() < 0.5){ func_8038EBE0(this->position, 4, ASSET_718_SPRITE_SPARKLE_WHITE_2, &D_80391F3C, &D_80391F54, &D_80391F6C, diff --git a/src/lair/ch/cauldron.c b/src/lair/ch/cauldron.c index 14806538..906ca267 100644 --- a/src/lair/ch/cauldron.c +++ b/src/lair/ch/cauldron.c @@ -276,7 +276,7 @@ void chWarpCauldron_update(Actor *this) { func_802BAFE4(D_80393620[this->unkF4_8 - 1].unk3); func_802D09B8(this, 2); phi_a0 = (fileProgressFlag_get(chWarpCauldron_getPairedFileProgressFlagIndex(this)) != 0) ? SFX_107_CAULDRON_ACTIVATION_1 : SFX_108_CAULDRON_ACTIVATION_2; - func_8030E510(phi_a0, 32000); + sfxsource_play(phi_a0, 32000); if (!fileProgressFlag_get(FILEPROG_F5_COMPLETED_A_WARP_CAULDRON_SET) && !fileProgressFlag_get(chWarpCauldron_getPairedFileProgressFlagIndex(this))) { func_80311480(0xF79, 4, NULL, NULL, NULL, NULL); } @@ -444,7 +444,7 @@ Actor *chWarpCauldron_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx) sp3C[0] = randi2(150, sp3C[1]); sp3C[2] = 0; sp3C[3] = randi2(40, 80); - if (func_8023DB5C() & 1) { + if (globalTimer_getTime() & 1) { func_802EE354(this, 0x3E9, 5, randi2(-10, 90), randf2(0.3f, 0.7f), 0.28f, 0.45f, sp3C, 5, 0); } } diff --git a/src/lair/code_0.c b/src/lair/code_0.c index 3be62021..32ee0a05 100644 --- a/src/lair/code_0.c +++ b/src/lair/code_0.c @@ -405,7 +405,7 @@ void func_803867A8(Actor *this) { this->position[0] = this->unk1C[0] + sp5C[0]; this->position[2] = this->unk1C[2] + sp5C[2]; if (this->marker->unk14_21) { - sp44 = this->unk158[func_8023DB5C() & 1]; + sp44 = this->unk158[globalTimer_getTime() & 1]; if (sp44 != NULL) { particleEmitter_setAlpha(sp44, this->alpha_124_19); phi_f0 = this->unk60 - 10.0f;