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/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/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 809965f9..fb4e023a 100644 --- a/src/core1/code_0.c +++ b/src/core1/code_0.c @@ -11,7 +11,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 @@ -68,16 +68,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){ @@ -117,16 +117,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){ @@ -136,12 +136,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(); @@ -178,7 +178,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 858af440..bf7d7209 100644 --- a/src/core1/code_10A00.c +++ b/src/core1/code_10A00.c @@ -126,7 +126,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_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 cb9187a9..d5543a88 100644 --- a/src/core1/code_9D30.c +++ b/src/core1/code_9D30.c @@ -195,12 +195,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/core2/bs/bFly.c b/src/core2/bs/bFly.c index c9bcd43c..fcfa7f88 100644 --- a/src/core2/bs/bFly.c +++ b/src/core2/bs/bFly.c @@ -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); } diff --git a/src/core2/bs/bShock.c b/src/core2/bs/bShock.c index eadd0bc9..d7788146 100644 --- a/src/core2/bs/bShock.c +++ b/src/core2/bs/bShock.c @@ -49,7 +49,7 @@ void bsbshock_charge_update(void){ f32 sp1C[3]; if(func_8028B2E8()){ - if(func_8023DB5C() % 2) + if(globalTimer_getTime() % 2) func_8029C348(); } else diff --git a/src/core2/bs/bSwim.c b/src/core2/bs/bSwim.c index 42235ea2..672b30f6 100644 --- a/src/core2/bs/bSwim.c +++ b/src/core2/bs/bSwim.c @@ -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); diff --git a/src/core2/bs/swim.c b/src/core2/bs/swim.c index 2eac473b..a2a3b314 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) { diff --git a/src/core2/bs/walrus.c b/src/core2/bs/walrus.c index b63e5319..30beb9d9 100644 --- a/src/core2/bs/walrus.c +++ b/src/core2/bs/walrus.c @@ -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); 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..94209497 100644 --- a/src/core2/ch/bigbutt.c +++ b/src/core2/ch/bigbutt.c @@ -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; @@ -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/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..c85257d0 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; 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_4C020.c b/src/core2/code_4C020.c index 84580db7..9694f7af 100644 --- a/src/core2/code_4C020.c +++ b/src/core2/code_4C020.c @@ -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_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_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_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..e91cfcc9 100644 --- a/src/core2/code_BEF20.c +++ b/src/core2/code_BEF20.c @@ -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/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/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..ba941d37 100644 --- a/src/lair/ch/cauldron.c +++ b/src/lair/ch/cauldron.c @@ -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;