diff options
| author | petrie911 <69443847+petrie911@users.noreply.github.com> | 2024-04-24 23:14:49 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-25 01:14:49 -0300 |
| commit | 0c9be776da37e754a9b9422a945bf1bc5cfd7e75 (patch) | |
| tree | 645f323b60ddd6b8bd2c85adfe961003898b5190 /src/engine | |
| parent | a6b80a5825c4a9ae06223a3879c864589ff13cf1 (diff) | |
Cumulative docs update (#221)
* lights fix
* names
* remove header
* so many names
* format
* more docs
* makefile
Diffstat (limited to 'src/engine')
| -rw-r--r-- | src/engine/fox_360.c | 283 | ||||
| -rw-r--r-- | src/engine/fox_A48A0.c | 2 | ||||
| -rw-r--r-- | src/engine/fox_beam.c | 2 | ||||
| -rw-r--r-- | src/engine/fox_bg.c | 2 | ||||
| -rw-r--r-- | src/engine/fox_context.c | 14 | ||||
| -rw-r--r-- | src/engine/fox_demo.c | 12 | ||||
| -rw-r--r-- | src/engine/fox_edisplay.c | 4 | ||||
| -rw-r--r-- | src/engine/fox_enmy.c | 8 | ||||
| -rw-r--r-- | src/engine/fox_enmy2.c | 34 | ||||
| -rw-r--r-- | src/engine/fox_game.c | 4 | ||||
| -rw-r--r-- | src/engine/fox_hud.c | 26 | ||||
| -rw-r--r-- | src/engine/fox_play.c | 38 | ||||
| -rw-r--r-- | src/engine/fox_save.c | 8 | ||||
| -rw-r--r-- | src/engine/fox_versus.c | 2 |
14 files changed, 216 insertions, 223 deletions
diff --git a/src/engine/fox_360.c b/src/engine/fox_360.c index 566ab856..b74b9e33 100644 --- a/src/engine/fox_360.c +++ b/src/engine/fox_360.c @@ -62,7 +62,7 @@ s32 gAllRangeSupplyTimer; s32 sStarWolfKillTimer; s16 gStarWolfMsgTimer; s32 gAllRangeWingRepairTimer; -s32 gAllRangeWingRepairSent; +s32 gAllRangeSuppliesSent; f32 gSzMissileR; f32 gSzMissileG; f32 gSzMissileB; @@ -250,7 +250,7 @@ void AllRange_GreatFoxRepair(Player* player) { player->unk_014 = 0; player->unk_018 = 0; player->unk_01C = 0; - gActors[0].state = 2; + gActors[0].state = STATE360_2; } break; } @@ -402,10 +402,10 @@ void ActorAllRange_SpawnTeam(void) { } else { actor->aiIndex = D_360_800C9ADC[i]; } - actor->state = 2; + actor->state = STATE360_2; actor->unk_0F4.y = 180.0f; if (actor->aiIndex <= -1) { - actor->state = 3; + actor->state = STATE360_3; } actor->health = 50; if ((gLevelType == LEVELTYPE_PLANET) || (gCurrentLevel == LEVEL_BOLSE)) { @@ -442,7 +442,7 @@ void ActorAllRange_SpawnStarWolf(void) { actor->health = 100; actor->unk_0C9 = 1; actor->unk_0F4.y = 225.0f; - actor->state = 0; + actor->state = STATE360_0; actor->timer_0BC = 250; actor->unk_0F4.x = -20.0f; actor->iwork[11] = 1; @@ -474,8 +474,8 @@ void ActorAllRange_StarWolfDefeatMesg(u16* msg, RadioCharacterId character) { ActorAllRange_PlayMessage(msg, character); } -void func_360_8002F69C(Actor* actor) { - Actor* otherActor; +void func_360_8002F69C(Actor* this) { + Actor* actor; s32 i; if (sStarWolfKillTimer != 0) { @@ -492,7 +492,7 @@ void func_360_8002F69C(Actor* actor) { } if (gAllRangeEventTimer == D_360_800C9B4C) { ActorAllRange_SpawnStarWolf(); - actor->state = 3; + this->state = STATE360_3; gPlayer[0].state_1C8 = PLAYERSTATE_1C8_STANDBY; if ((gCurrentLevel == LEVEL_VENOM_2) || (gCurrentLevel == LEVEL_BOLSE)) { gPlayer[0].camRoll = 20.0f; @@ -510,56 +510,53 @@ void func_360_8002F69C(Actor* actor) { gPlayer[0].cam.at.y = gActors[4].obj.pos.y; gPlayer[0].cam.at.z = gActors[4].obj.pos.z; } - if (gAllRangeEventTimer > D_360_800C9B4C) { - if (gStarWolfMsgTimer == 0) { - gAllRangeFrameCount++; - for (i = 1, otherActor = &gActors[1]; i < 8; i++, otherActor++) { - if ((otherActor->obj.status == OBJ_ACTIVE) && (otherActor->state == 2) && (otherActor->health < 70) && - (otherActor->timer_0C6 != 0) && (otherActor->unk_0D4 == 1)) { - if ((gActors[otherActor->aiIndex].state == STATE360_3) && - (gActors[otherActor->aiIndex].aiType <= AI360_ANDREW)) { - gActors[otherActor->aiIndex].iwork[2] = AI360_FOX; - gActors[otherActor->aiIndex].state = 2; - gActors[otherActor->aiIndex].aiIndex = otherActor->aiType; - if (gTeamHelpActor == &gActors[otherActor->aiIndex]) { - gTeamHelpActor = NULL; - gTeamHelpTimer = 0; - } - if (gActors[otherActor->aiIndex].iwork[3] == 0) { - switch (gActors[otherActor->aiIndex].aiType) { - case AI360_FALCO: - ActorAllRange_PlayMessage(gMsg_ID_9160, RCID_FALCO); - break; - case AI360_SLIPPY: - ActorAllRange_PlayMessage(gMsg_ID_9170, RCID_SLIPPY); - break; - case AI360_PEPPY: - ActorAllRange_PlayMessage(gMsg_ID_9180, RCID_PEPPY); - break; - } - gActors[otherActor->aiIndex].iwork[3] = 200; - } + if ((gAllRangeEventTimer > D_360_800C9B4C) && (gStarWolfMsgTimer == 0)) { + gAllRangeFrameCount++; + for (i = 1, actor = &gActors[1]; i < 8; i++, actor++) { + if ((actor->obj.status == OBJ_ACTIVE) && (actor->state == STATE360_2) && (actor->health < 70) && + (actor->timer_0C6 != 0) && (actor->unk_0D4 == 1)) { + if ((gActors[actor->aiIndex].state == STATE360_3) && (gActors[actor->aiIndex].aiType <= AI360_ANDREW)) { + gActors[actor->aiIndex].iwork[2] = AI360_FOX; + gActors[actor->aiIndex].state = STATE360_2; + gActors[actor->aiIndex].aiIndex = actor->aiType; + if (gTeamHelpActor == &gActors[actor->aiIndex]) { + gTeamHelpActor = NULL; + gTeamHelpTimer = 0; } - if (otherActor->aiType == AI360_WOLF) { - if (gCurrentLevel != LEVEL_VENOM_2) { - otherActor->state = STATE360_3; - otherActor->unk_04E = 300; + if (gActors[actor->aiIndex].iwork[3] == 0) { + switch (gActors[actor->aiIndex].aiType) { + case AI360_FALCO: + ActorAllRange_PlayMessage(gMsg_ID_9160, RCID_FALCO); + break; + case AI360_SLIPPY: + ActorAllRange_PlayMessage(gMsg_ID_9170, RCID_SLIPPY); + break; + case AI360_PEPPY: + ActorAllRange_PlayMessage(gMsg_ID_9180, RCID_PEPPY); + break; } - } else { - otherActor->state = STATE360_3; - otherActor->aiIndex = -1; + gActors[actor->aiIndex].iwork[3] = 200; } } + if (actor->aiType == AI360_WOLF) { + if (gCurrentLevel != LEVEL_VENOM_2) { + actor->state = STATE360_3; + actor->unk_04E = 300; + } + } else { + actor->state = STATE360_3; + actor->aiIndex = -1; + } } - if (gTeamShields[TEAM_ID_FALCO] <= 0) { - gActors[AI360_LEON].aiIndex = AI360_FOX; - } - if (gTeamShields[TEAM_ID_SLIPPY] <= 0) { - gActors[AI360_ANDREW].aiIndex = AI360_FOX; - } - if (gTeamShields[TEAM_ID_PEPPY] <= 0) { - gActors[AI360_PIGMA].aiIndex = AI360_FOX; - } + } + if (gTeamShields[TEAM_ID_FALCO] <= 0) { + gActors[AI360_LEON].aiIndex = AI360_FOX; + } + if (gTeamShields[TEAM_ID_SLIPPY] <= 0) { + gActors[AI360_ANDREW].aiIndex = AI360_FOX; + } + if (gTeamShields[TEAM_ID_PEPPY] <= 0) { + gActors[AI360_PIGMA].aiIndex = AI360_FOX; } } } @@ -582,7 +579,7 @@ void func_360_8002FB4C(Actor* actor) { } if (!var_a0) { actor->aiIndex = i; - actor->state = 2; + actor->state = STATE360_2; actor->iwork[2] = AI360_FOX; break; } @@ -590,31 +587,29 @@ void func_360_8002FB4C(Actor* actor) { } } -void func_360_8002FC00(Actor* actor) { - Actor* otherActor; +void func_360_8002FC00(Actor* this) { + Actor* actor; s32 i; - for (i = 0, otherActor = &gActors[10]; i < 50; i++, otherActor++) { - if ((otherActor->obj.status == OBJ_DYING) && (otherActor->aiIndex >= AI360_FALCO) && - (otherActor->aiIndex <= AI360_PEPPY)) { + for (i = 0, actor = &gActors[10]; i < 50; i++, actor++) { + if ((actor->obj.status == OBJ_DYING) && (actor->aiIndex >= AI360_FALCO) && (actor->aiIndex <= AI360_PEPPY)) { Actor* actor2; s32 j; for (j = 0, actor2 = &gActors[10]; j < 51; j++, actor2++) { - if ((actor2->obj.status == OBJ_ACTIVE) && (actor2->state == 2) && - (actor2->aiIndex == otherActor->aiIndex)) { + if ((actor2->obj.status == OBJ_ACTIVE) && (actor2->state == STATE360_2) && + (actor2->aiIndex == actor->aiIndex)) { return; } } - if (gTeamShields[otherActor->aiIndex] > 0) { - func_360_8002FB4C(&gActors[otherActor->aiIndex]); - if ((otherActor->iwork[5] != 0) && (otherActor->unk_0D4 == 1) && - (gActors[otherActor->aiIndex].iwork[3] == 0)) { - if (gTeamHelpActor == &gActors[otherActor->aiIndex]) { + if (gTeamShields[actor->aiIndex] > 0) { + func_360_8002FB4C(&gActors[actor->aiIndex]); + if ((actor->iwork[5] != 0) && (actor->unk_0D4 == 1) && (gActors[actor->aiIndex].iwork[3] == 0)) { + if (gTeamHelpActor == &gActors[actor->aiIndex]) { gTeamHelpActor = NULL; gTeamHelpTimer = 0; } - switch (gActors[otherActor->aiIndex].aiType) { + switch (gActors[actor->aiIndex].aiType) { case AI360_FALCO: ActorAllRange_PlayMessage(gMsg_ID_9160, RCID_FALCO); break; @@ -625,15 +620,15 @@ void func_360_8002FC00(Actor* actor) { ActorAllRange_PlayMessage(gMsg_ID_9180, RCID_PEPPY); break; } - gActors[otherActor->aiIndex].iwork[3] = 200; - gActors[otherActor->aiIndex].timer_0C4 = 600; + gActors[actor->aiIndex].iwork[3] = 200; + gActors[actor->aiIndex].timer_0C4 = 600; } } } } } -bool func_360_8002FE74(void) { +bool AllRange_SupplyEvent(void) { switch (gCurrentLevel) { case LEVEL_FORTUNA: return gAllRangeEventTimer == D_360_800C9B4C + 2400; @@ -650,7 +645,7 @@ void ActorAllRange_SpawnSupplies(Actor* this) { s32 i; if ((gCallTimer != 0) && (gControllerPress[gMainController].button & R_CBUTTONS)) { - func_8001AF40(0); + Audio_SetUnkVoiceParam(0); gCallVoiceParam = 0; gCallTimer = 0; Radio_PlayMessage(gMsg_ID_20230, RCID_ROB64); @@ -682,13 +677,13 @@ void ActorAllRange_SpawnSupplies(Actor* this) { } } } - if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) && !gAllRangeWingRepairSent) { + if ((gPlayer[0].state_1C8 == PLAYERSTATE_1C8_ACTIVE) && !gAllRangeSuppliesSent) { if (gAllRangeWingRepairTimer != 0) { gAllRangeWingRepairTimer--; } - if ((gPlayer[0].shields < 64) || func_360_8002FE74() || (gAllRangeWingRepairTimer == 1)) { + if ((gPlayer[0].shields < 64) || AllRange_SupplyEvent() || (gAllRangeWingRepairTimer == 1)) { gCallTimer = 60; - gAllRangeWingRepairSent = true; + gAllRangeSuppliesSent = true; } } } @@ -719,27 +714,27 @@ void ActorAllRange_UpdateEvents(Actor* this) { ActorAllRange_SpawnSupplies(this); } -s32 func_360_800301F4(Actor* actor) { +s32 func_360_800301F4(Actor* this) { Boss* boss; f32 temp_ft4; f32 temp_ft5; s32 i; - f32 sp1C; - f32 sp18; + f32 sinY; + f32 cosY; if (gLevelMode == LEVELMODE_ON_RAILS) { return 0; } - sp1C = SIN_DEG(actor->obj.rot.y); - sp18 = COS_DEG(actor->obj.rot.y); - temp_ft4 = actor->fwork[9] * 10.0f + (sp1C * 650.0f); - temp_ft5 = actor->fwork[9] * 10.0f + (sp18 * 650.0f); + sinY = SIN_DEG(this->obj.rot.y); + cosY = COS_DEG(this->obj.rot.y); + temp_ft4 = this->fwork[9] * 10.0f + (sinY * 650.0f); + temp_ft5 = this->fwork[9] * 10.0f + (cosY * 650.0f); for (i = 0; i < 200; i++) { if ((gScenery360[i].obj.status == OBJ_ACTIVE) && - (fabsf(gScenery360[i].obj.pos.x - (actor->obj.pos.x + temp_ft4)) < 1000.0f) && - (fabsf(gScenery360[i].obj.pos.z - (actor->obj.pos.z + temp_ft5)) < 1000.0f)) { - if (fabsf(gScenery360[i].obj.pos.y - actor->obj.pos.y) < 1000.0f) { - if (gScenery360[i].obj.pos.y < actor->obj.pos.y) { + (fabsf(gScenery360[i].obj.pos.x - (this->obj.pos.x + temp_ft4)) < 1000.0f) && + (fabsf(gScenery360[i].obj.pos.z - (this->obj.pos.z + temp_ft5)) < 1000.0f)) { + if (fabsf(gScenery360[i].obj.pos.y - this->obj.pos.y) < 1000.0f) { + if (gScenery360[i].obj.pos.y < this->obj.pos.y) { return 1; } else { return -1; @@ -748,10 +743,10 @@ s32 func_360_800301F4(Actor* actor) { } } boss = &gBosses[0]; - if ((gCurrentLevel == LEVEL_SECTOR_Z) && (fabsf(boss->obj.pos.x - (actor->obj.pos.x + temp_ft4)) < 2000.0f) && - (fabsf(boss->obj.pos.z - (actor->obj.pos.z + temp_ft5)) < 2000.0f)) { - if (fabsf(boss->obj.pos.y - actor->obj.pos.y) < 1500.0f) { - if (boss->obj.pos.y < actor->obj.pos.y) { + if ((gCurrentLevel == LEVEL_SECTOR_Z) && (fabsf(boss->obj.pos.x - (this->obj.pos.x + temp_ft4)) < 2000.0f) && + (fabsf(boss->obj.pos.z - (this->obj.pos.z + temp_ft5)) < 2000.0f)) { + if (fabsf(boss->obj.pos.y - this->obj.pos.y) < 1500.0f) { + if (boss->obj.pos.y < this->obj.pos.y) { return 1; } else { return -1; @@ -761,7 +756,7 @@ s32 func_360_800301F4(Actor* actor) { return 0; } -s32 func_360_8003049C(Actor* actor) { +s32 func_360_8003049C(Actor* this) { Scenery360* scenery360; s32 i; f32 sp44; @@ -777,25 +772,24 @@ s32 func_360_8003049C(Actor* actor) { return 0; } if ((gLevelType == LEVELTYPE_SPACE) && (gCurrentLevel != LEVEL_BOLSE)) { - return func_360_800301F4(actor); + return func_360_800301F4(this); } - sp40 = SIN_DEG(actor->obj.rot.y); - sp3C = COS_DEG(actor->obj.rot.y); - temp_fa0 = actor->fwork[9] * 10.0f + (sp40 * 650.0f); - temp_ft4 = actor->fwork[9] * 10.0f + (sp3C * 650.0f); + sp40 = SIN_DEG(this->obj.rot.y); + sp3C = COS_DEG(this->obj.rot.y); + temp_fa0 = this->fwork[9] * 10.0f + (sp40 * 650.0f); + temp_ft4 = this->fwork[9] * 10.0f + (sp3C * 650.0f); if (gLevelMode == LEVELMODE_ALL_RANGE) { for (i = 0, scenery360 = gScenery360; i < 200; i++, scenery360++) { if ((scenery360->obj.status == OBJ_ACTIVE) && - (fabsf(scenery360->obj.pos.x - (actor->obj.pos.x + temp_fa0)) < 1200.0f) && - (fabsf(scenery360->obj.pos.z - (actor->obj.pos.z + temp_ft4)) < 1200.0f) && - (actor->obj.pos.y < 650.0f)) { + (fabsf(scenery360->obj.pos.x - (this->obj.pos.x + temp_fa0)) < 1200.0f) && + (fabsf(scenery360->obj.pos.z - (this->obj.pos.z + temp_ft4)) < 1200.0f) && (this->obj.pos.y < 650.0f)) { return 1; } } } sp44 = 1200.0f; var_ft5 = 650.0f; - if (actor->aiType < AI360_KATT) { + if (this->aiType < AI360_KATT) { var_ft5 = 720.0f; } @@ -808,9 +802,9 @@ s32 func_360_8003049C(Actor* actor) { sp44 = 1500.0f; var_ft5 = 700.0f; } - if ((fabsf(boss->obj.pos.x - (actor->obj.pos.x + temp_fa0)) < sp44) && - (fabsf(boss->obj.pos.z - (actor->obj.pos.z + temp_ft4)) < sp44) && - (fabsf(boss->obj.pos.y - actor->obj.pos.y) < var_ft5)) { + if ((fabsf(boss->obj.pos.x - (this->obj.pos.x + temp_fa0)) < sp44) && + (fabsf(boss->obj.pos.z - (this->obj.pos.z + temp_ft4)) < sp44) && + (fabsf(boss->obj.pos.y - this->obj.pos.y) < var_ft5)) { return 1; } return 0; @@ -857,7 +851,7 @@ void ActorAllRange_ApplyDamage(Actor* this) { ((this->aiType != AI360_MISSILE) || (this->unk_0D0 != 2))) { this->health -= this->damage; } - } else if ((this->aiType <= AI360_PEPPY) && (this->state != 6)) { + } else if ((this->aiType <= AI360_PEPPY) && (this->state != STATE360_6)) { if (this->aiType == AI360_FALCO) { gTeamDamage[this->aiType] = this->damage; } else { @@ -1226,42 +1220,42 @@ void ActorAllRange_Update(Actor* this) { ActorAllRange_UpdateEvents(this); return; } - if ((this->iwork[17] != 0) && (this->iwork[16] == 0) && (this->aiType >= AI360_WOLF)) { + if ((this->iwork[17] != 0) && (this->iwork[16] == STATE360_0) && (this->aiType >= AI360_WOLF)) { switch (RAND_INT(3.9f)) { case 0: case 1: if (gCurrentLevel == LEVEL_VENOM_2) { - this->iwork[16] = 10; + this->iwork[16] = STATE360_10; } break; case 2: - this->iwork[16] = 8; + this->iwork[16] = STATE360_8; break; case 3: - this->iwork[16] = 7; + this->iwork[16] = STATE360_7; break; } this->iwork[17] = 0; if (this->iwork[18] != 0) { this->iwork[18]--; - this->iwork[16] = 0; + this->iwork[16] = STATE360_0; } } - if ((this->lockOnTimers[0] != 0) && (gCurrentLevel != LEVEL_VENOM_2) && (this->aiType < AI360_10) && - (this->lockOnTimers[0] < 5) && ((gGameFrameCount % 32) == 0)) { - this->iwork[16] = 10; + if ((this->lockOnTimers[TEAM_ID_FOX] != 0) && (gCurrentLevel != LEVEL_VENOM_2) && (this->aiType < AI360_10) && + (this->lockOnTimers[TEAM_ID_FOX] < 5) && ((gGameFrameCount % 32) == 0)) { + this->iwork[16] = STATE360_10; } - if ((this->iwork[16] != 0) && (this->state < 7)) { + if ((this->iwork[16] != STATE360_0) && (this->state < STATE360_7)) { this->state = this->iwork[16]; switch (this->state) { - case 7: - case 8: + case STATE360_7: + case STATE360_8: if (this->unk_0F4.x > 180.0f) { this->unk_0F4.x -= 360.0f; } this->unk_046 = 0; break; - case 9: + case STATE360_9: this->timer_0BC = RAND_INT(20.0f) + 30; if (Rand_ZeroOne() < 0.5f) { this->fwork[19] = this->obj.rot.y + 50.0f; @@ -1275,7 +1269,7 @@ void ActorAllRange_Update(Actor* this) { this->fwork[19] += 360.0f; } break; - case 10: + case STATE360_10: this->timer_0BC = 35; if (Rand_ZeroOne() < 0.5f) { this->fwork[7] = 360.0f; @@ -1290,7 +1284,7 @@ void ActorAllRange_Update(Actor* this) { break; } } - this->iwork[16] = 0; + this->iwork[16] = STATE360_0; spCC = spC8 = spC4 = 0.0f; if (this->iwork[7] != 0) { this->iwork[7]--; @@ -1352,8 +1346,8 @@ void ActorAllRange_Update(Actor* this) { sp104 = 0; this->iwork[5] = 0; if ((this->aiType > AI360_FOX) && (this->aiType <= AI360_PEPPY) && (gTeamShields[this->aiType] <= 0) && - (this->state != 6)) { - this->state = 6; + (this->state != STATE360_6)) { + this->state = STATE360_6; if (this->timer_0C2 < 100) { gTeamShields[this->aiType] = 1; switch (this->aiType) { @@ -1412,20 +1406,20 @@ void ActorAllRange_Update(Actor* this) { case STATE360_0: if (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_START_360) { this->fwork[0] = this->fwork[1] = 40.0f; - if (gActors[0].state == 5) { + if (gActors[0].state == STATE360_5) { Math_SmoothStepToF(&this->unk_0F4.x, 30.0f, 0.1f, 0.5f, 0.0f); this->fwork[1] = 200.0f; } if (this->timer_0BC == 0) { if (this->aiType == AI360_WOLF) { - this->state = 3; + this->state = STATE360_3; if (gCurrentLevel == LEVEL_VENOM_2) { this->unk_04E = 200; } else { this->unk_04E = 200; } } else { - this->state = 2; + this->state = STATE360_2; if (this->aiType == AI360_KATT) { this->fwork[7] = 360.0f; this->fwork[8] = 0.0f; @@ -1441,9 +1435,9 @@ void ActorAllRange_Update(Actor* this) { Math_SmoothStepToF(&this->unk_0F4.x, 15.0f, 0.1f, 1.0f, 0.0f); } if (this->timer_0BC == 0) { - this->state = 3; + this->state = STATE360_3; if ((gCurrentLevel == LEVEL_BOLSE) && (this->aiIndex > -1)) { - this->state = 2; + this->state = STATE360_2; } } break; @@ -1464,7 +1458,7 @@ void ActorAllRange_Update(Actor* this) { spF0 = 0.2f; } if (this->aiIndex <= -1) { - this->state = 3; + this->state = STATE360_3; } else { if (gActors[this->aiIndex].aiType == AI360_MISSILE) { spF0 = 0.8f; @@ -1475,7 +1469,7 @@ void ActorAllRange_Update(Actor* this) { if (gCurrentLevel != LEVEL_VENOM_2) { if ((gPlayer[0].somersault && (this->iwork[4] > 10)) || ((gCurrentLevel == LEVEL_BOLSE) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_STANDBY))) { - this->state = 3; + this->state = STATE360_3; this->unk_04E = 300; this->timer_0BC = 160; if (this->aiType == AI360_WOLF) { @@ -1488,7 +1482,7 @@ void ActorAllRange_Update(Actor* this) { } } if ((this->aiType >= AI360_WOLF) && (this->aiType != AI360_KATT) && - ((gCurrentLevel != LEVEL_VENOM_2) || (this->aiType != AI360_WOLF))) { + !((gCurrentLevel == LEVEL_VENOM_2) && (this->aiType == AI360_WOLF))) { spCC = SIN_DEG((this->index * 45) + gGameFrameCount) * 100.0f; spC8 = COS_DEG((this->index * 45) + (gGameFrameCount * 2)) * 100.0f; spC4 = SIN_DEG((this->index * 45) + gGameFrameCount) * 100.0f; @@ -1499,7 +1493,7 @@ void ActorAllRange_Update(Actor* this) { this->fwork[6] = gPlayer[0].unk_138 + spC4; this->fwork[1] = gPlayer[0].unk_0D0 + 10.0f; } - if ((gActors[0].state == 6) && (this->aiType <= AI360_PEPPY)) { + if ((gActors[0].state == STATE360_6) && (this->aiType <= AI360_PEPPY)) { this->fwork[3] = 3.0f; this->fwork[1] = gPlayer[0].unk_0D0 - 5.0f; this->iwork[11] = 2; @@ -1545,7 +1539,7 @@ void ActorAllRange_Update(Actor* this) { this->fwork[6] = gBosses[0].obj.pos.z; this->fwork[1] = 40.0f; } - if ((this->aiIndex > -1) && (this->aiIndex != AI360_GREAT_FOX) && (gActors[0].state != 6)) { + if ((this->aiIndex > -1) && (this->aiIndex != AI360_GREAT_FOX) && (gActors[0].state != STATE360_6)) { if (spE8 < spF8) { if (spEC < spF8) { if (this->aiIndex != AI360_FOX) { @@ -1554,7 +1548,7 @@ void ActorAllRange_Update(Actor* this) { this->fwork[1] = gPlayer[0].unk_0D0 - 5.0f; if ((gCurrentLevel == LEVEL_VENOM_2) && (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_U_TURN) && (gPlayer[0].unk_4D8 > 100.0f)) { - this->iwork[16] = 8; + this->iwork[16] = STATE360_8; } } } @@ -1752,10 +1746,10 @@ void ActorAllRange_Update(Actor* this) { } else { this->iwork[4] = 0; } - if ((this->aiIndex >= AI360_FALCO) && - ((gActors[this->aiIndex].obj.status == OBJ_DYING) || (gActors[this->aiIndex].state == 6) || - (gActors[this->aiIndex].obj.status == OBJ_FREE))) { - this->state = 3; + if ((this->aiIndex >= AI360_FALCO) && ((gActors[this->aiIndex].obj.status == OBJ_DYING) || + (gActors[this->aiIndex].state == STATE360_6) || + (gActors[this->aiIndex].obj.status == OBJ_FREE))) { + this->state = STATE360_3; if (gCurrentLevel == LEVEL_BOLSE) { func_360_8002FB4C(this); } @@ -1783,7 +1777,7 @@ void ActorAllRange_Update(Actor* this) { this->fwork[3] = 1.0f; this->fwork[1] = 38.0f; } - if ((gCurrentLevel == LEVEL_SECTOR_Z) && (gActors[0].state == 10)) { + if ((gCurrentLevel == LEVEL_SECTOR_Z) && (gActors[0].state == STATE360_10)) { this->fwork[10] = 30.0f; } if ((gLevelType == LEVELTYPE_SPACE) && (gCurrentLevel != LEVEL_BOLSE)) { @@ -1823,7 +1817,7 @@ void ActorAllRange_Update(Actor* this) { } if ((this->aiIndex >= AI360_FALCO) && (gActors[this->aiIndex].obj.id == OBJ_ACTOR_ALLRANGE) && (gActors[this->aiIndex].timer_0C2 == 0) && (gActors[this->aiIndex].obj.status == OBJ_ACTIVE)) { - this->state = 2; + this->state = STATE360_2; this->iwork[2] = AI360_FOX; } if (this->aiIndex == AI360_FOX) { @@ -1831,7 +1825,7 @@ void ActorAllRange_Update(Actor* this) { this->unk_04E--; } if (this->unk_04E == 0) { - this->state = 2; + this->state = STATE360_2; this->iwork[2] = AI360_FOX; } } @@ -1841,7 +1835,7 @@ void ActorAllRange_Update(Actor* this) { Math_SmoothStepToF(&this->unk_0F4.x, 360.0f, 0.1f, 5.0f, 0.0001f); Math_SmoothStepToAngle(&this->obj.rot.z, 0.0f, 0.1f, 3.0f, 0.01f); if (this->unk_0F4.x > 350.0f) { - this->state = 3; + this->state = STATE360_3; } break; case STATE360_8: @@ -1871,7 +1865,7 @@ void ActorAllRange_Update(Actor* this) { break; case 1: if (this->timer_0BC == 0) { - this->state = 3; + this->state = STATE360_3; } break; } @@ -1885,13 +1879,13 @@ void ActorAllRange_Update(Actor* this) { } Math_SmoothStepToAngle(&this->obj.rot.z, spD0, 0.1f, 15.0f, 0.01f); if (this->timer_0BC == 0) { - this->state = 3; + this->state = STATE360_3; } break; case STATE360_10: sp104 = 1; if (this->timer_0BC == 0) { - this->state = 3; + this->state = STATE360_3; } if (this->timer_0BC > 20) { Math_SmoothStepToF(&this->fwork[23], 180.0f, 1.0f, 60.0f, 0.0f); @@ -1899,14 +1893,14 @@ void ActorAllRange_Update(Actor* this) { break; } if (sp104 != 0) { - s32 var_v0 = 3; + s32 var_v0 = 4 - 1; spE4 = this->fwork[4] - this->obj.pos.x; spE0 = this->fwork[5] - this->obj.pos.y; spDC = this->fwork[6] - this->obj.pos.z; if (gCurrentLevel == LEVEL_VENOM_2) { - var_v0 = 1; + var_v0 = 2 - 1; } if (!((this->index + gGameFrameCount) & var_v0)) { this->fwork[19] = Math_RadToDeg(Math_Atan2F(spE4, spDC)); @@ -1956,7 +1950,7 @@ void ActorAllRange_Update(Actor* this) { } if ((this->fwork[7] > 0.01f) && (this->fwork[7] < 359.9f)) { if ((((gGameFrameCount + 15) % 32) == 0) && (gCurrentLevel != LEVEL_VENOM_2)) { - this->lockOnTimers[0] = 0; + this->lockOnTimers[TEAM_ID_FOX] = 0; } } else { Math_SmoothStepToAngle(&this->obj.rot.z, spD0, 0.1f, 3.0f, 0.01f); @@ -1977,7 +1971,6 @@ void ActorAllRange_Update(Actor* this) { Matrix_RotateZ(gCalcMatrix, this->obj.rot.z * M_DTOR, MTXF_APPLY); spA8.x = 0.0f; spA8.y = 70.0f; - spA8.z = -70.0f; Matrix_MultVec3fNoTranslate(gCalcMatrix, &spA8, &sp9C); func_effect_80078E50(this->obj.pos.x + sp9C.x, this->obj.pos.y + sp9C.y, this->obj.pos.z + sp9C.z, diff --git a/src/engine/fox_A48A0.c b/src/engine/fox_A48A0.c index 01036834..677cf218 100644 --- a/src/engine/fox_A48A0.c +++ b/src/engine/fox_A48A0.c @@ -31,7 +31,7 @@ void func_800A3E00(void) { break; case 2: if ((gControllerPress[0].button & START_BUTTON) || (gControllerPress[1].button & START_BUTTON)) { - func_8001D638(0); + Audio_PlayPauseSfx(0); D_ctx_80177868 = 3; gDrawMode = DRAW_NONE; Play_Setup(); diff --git a/src/engine/fox_beam.c b/src/engine/fox_beam.c index 98ba98d2..fb588b6e 100644 --- a/src/engine/fox_beam.c +++ b/src/engine/fox_beam.c @@ -56,7 +56,7 @@ void func_beam_80035E78(PlayerShot* shot) { shot->unk_5C = 1; shot->unk_64 = 30; shot->unk_58 = 150; - func_8001CE28(shot->playerNum, shot->sfxSource); + Audio_PlayBombExplodeSfx(shot->playerNum, shot->sfxSource); gScreenFlashTimer = 4; if (shot->obj.pos.y < (gGroundHeight + 450.0f)) { gCameraShake = 15; diff --git a/src/engine/fox_bg.c b/src/engine/fox_bg.c index d185de70..b78a0593 100644 --- a/src/engine/fox_bg.c +++ b/src/engine/fox_bg.c @@ -611,7 +611,7 @@ void Background_DrawBackdrop(void) { break; case LEVEL_FORTUNA: sp128 = 1.5f; - if ((gCsFrameCount > 400) && (gNextPlanetPath == 0)) { + if ((gCsFrameCount > 400) && (gMissionStatus == MISSION_COMPLETE)) { sp128 = 0.75f; } Matrix_Translate(gGfxMatrix, sp138 - 120.0f, -(sp134 - 120.0f), -290.0f, MTXF_APPLY); diff --git a/src/engine/fox_context.c b/src/engine/fox_context.c index 7434822e..b56f03d7 100644 --- a/src/engine/fox_context.c +++ b/src/engine/fox_context.c @@ -22,7 +22,7 @@ s32 gTeamShields[6]; s32 gSavedTeamShields[6]; s32 gPrevPlanetSavedTeamShields[6]; s32 gTeamDamage[6]; -u8 gNextPlanetPath; // next planet path +u8 gMissionStatus; // next planet path f32 gGroundHeight; f32 D_ctx_80177950; f32 D_ctx_80177968; @@ -45,11 +45,11 @@ u8 gAqDrawMode; s32 D_ctx_80177AE0; s32 gMainController; s32 D_ctx_80177B40; -s32 gMissionNumber; // D_ctx_80177B48 // Arrow pointer? -s32 D_ctx_80177B50[7]; -s32 D_ctx_80177B70[7]; -PlanetId D_ctx_80177B90[7]; -s32 D_ctx_80177BB0[7]; +s32 gMissionNumber; +s32 gMissionTeamStatus[7]; +s32 gMissionHitCount[7]; +PlanetId gMissionPlanet[7]; +s32 gMissionMedal[7]; #ifdef AVOID_UB s32 gPlanetPathStatus[24]; #else @@ -93,7 +93,7 @@ s32 gRadioState; s32 D_ctx_801782A4; s32 D_Timer_801782AC; s32 D_Timer_801782B4; -u8 D_play_800D3180[30] = { +u8 gLeveLClearStatus[30] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; s32 D_ctx_801782C0; diff --git a/src/engine/fox_demo.c b/src/engine/fox_demo.c index e4035b99..b2a2da19 100644 --- a/src/engine/fox_demo.c +++ b/src/engine/fox_demo.c @@ -292,11 +292,11 @@ void Cutscene_WarpZoneComplete(Player* player) { player->timer_1F8 = 0; gFadeoutType = 4; if (gCurrentLevel == LEVEL_METEO) { - D_play_800D3180[LEVEL_METEO] = Play_CheckMedalStatus(200) + 1; + gLeveLClearStatus[LEVEL_METEO] = Play_CheckMedalStatus(200) + 1; } else { - D_play_800D3180[LEVEL_SECTOR_X] = Play_CheckMedalStatus(150) + 1; + gLeveLClearStatus[LEVEL_SECTOR_X] = Play_CheckMedalStatus(150) + 1; } - gNextPlanetPath = 2; + gMissionStatus = MISSION_WARP; } } } else { @@ -1290,7 +1290,7 @@ void Cutscene_CoComplete2(Player* player) { player->timer_1F8 = 0; gFadeoutType = 4; Audio_FadeOutAll(10); - D_play_800D3180[gCurrentLevel] = Play_CheckMedalStatus(150) + 1; + gLeveLClearStatus[gCurrentLevel] = Play_CheckMedalStatus(150) + 1; } break; } @@ -1422,7 +1422,7 @@ void Cutscene_LevelComplete(Player* player) { if (gCurrentLevel == LEVEL_TITANIA) { Titania_LevelComplete(player); - } else if (gNextPlanetPath != 0) { + } else if (gMissionStatus != MISSION_COMPLETE) { Macbeth_LevelComplete2(player); } else { Macbeth_LevelComplete1(player); @@ -1610,7 +1610,7 @@ void Cutscene_DropVsItem(Player* player, ObjectId itemId, Item* item) { void Cutscene_KillPlayer(Player* player) { s32 teamId; - func_8001CA24(player->num); + Audio_StopPlayerNoise(player->num); Audio_KillSfxBySourceAndId(player->sfxSource, 0x0900C010); func_play_800A5FA0(player->sfxSource, 0x0903F004, player->num); player->state_1C8 = PLAYERSTATE_1C8_NEXT; diff --git a/src/engine/fox_edisplay.c b/src/engine/fox_edisplay.c index c6218e05..2815176a 100644 --- a/src/engine/fox_edisplay.c +++ b/src/engine/fox_edisplay.c @@ -1026,11 +1026,11 @@ void Actor_DrawOnRails(Actor* this) { Matrix_MultVec3f(gGfxMatrix, &sp34, &gTeamArrowsViewPos[this->aiType]); } } - if ((this->lockOnTimers[0] != 0) && (gReflectY > 0)) { + if ((this->lockOnTimers[TEAM_ID_FOX] != 0) && (gReflectY > 0)) { sp34.y += this->info.unk_1C; Matrix_MultVec3f(gGfxMatrix, &sp34, &D_display_80161578[0]); if (D_display_80161578[0].z > -200.0f) { - this->lockOnTimers[0] = 0; + this->lockOnTimers[TEAM_ID_FOX] = 0; } } } diff --git a/src/engine/fox_enmy.c b/src/engine/fox_enmy.c index a277bb15..26bcc7eb 100644 --- a/src/engine/fox_enmy.c +++ b/src/engine/fox_enmy.c @@ -2286,8 +2286,8 @@ void ItemMeteoWarp_Update(ItemMeteoWarp* this) { gPlayer[0].state_1C8 = PLAYERSTATE_1C8_ENTER_WARP_ZONE; gPlayer[0].unk_1D0 = 0; AUDIO_PLAY_SFX(0x1900602A, gDefaultSfxSource, 0); - gNextPlanetPath = 2; - D_play_800D3180[gCurrentLevel] = 1; + gMissionStatus = MISSION_WARP; + gLeveLClearStatus[gCurrentLevel] = 1; } } } @@ -2642,9 +2642,9 @@ void Actor_Update(Actor* this) { gChargeTimers[i] = 0; } } - } else if (this->lockOnTimers[0] != 0) { + } else if (this->lockOnTimers[TEAM_ID_FOX] != 0) { if (!(gControllerHold[gMainController].button & A_BUTTON)) { - this->lockOnTimers[0]--; + this->lockOnTimers[TEAM_ID_FOX]--; } gChargeTimers[0] = 0; } diff --git a/src/engine/fox_enmy2.c b/src/engine/fox_enmy2.c index c303222f..9980eaa5 100644 --- a/src/engine/fox_enmy2.c +++ b/src/engine/fox_enmy2.c @@ -307,11 +307,11 @@ void Actor194_8006B46C(Actor194* this, f32 xTrans, f32 yTrans, f32 zTrans, f32 x if (arg7 != 1) { RCP_SetupDL_29(gFogRed, gFogGreen, gFogBlue, gFogAlpha, gFogNear, gFogFar); - if ((arg7 == 0) && (this->lockOnTimers[0] != 0)) { + if ((arg7 == 0) && (this->lockOnTimers[TEAM_ID_FOX] != 0)) { sp34.y += this->info.unk_1C; Matrix_MultVec3f(gGfxMatrix, &sp34, D_display_80161578); if (D_display_80161578->z > -500.0f) { - this->lockOnTimers[0] = 0; + this->lockOnTimers[TEAM_ID_FOX] = 0; } } } else { @@ -1265,7 +1265,7 @@ void ActorEvent_ProcessScript(ActorEvent* this) { break; case EV_OPC(EVOP_SET_REVERB): - Audio_SetBaseSfxReverb(actorScript[this->aiIndex + 1]); + Audio_SetEnvSfxReverb(actorScript[this->aiIndex + 1]); this->aiIndex += 2; ActorEvent_ProcessScript(this); break; @@ -2626,7 +2626,7 @@ void ActorEvent_ProcessTriggers(ActorEvent* this) { case EVC_PRESS_CRIGHT: if (gControllerPress[gMainController].button & R_CBUTTONS) { - func_8001AF40(0); + Audio_SetUnkVoiceParam(0); gCallVoiceParam = 0; gCallTimer = 0; ActorEvent_TriggerBranch(this); @@ -2640,79 +2640,79 @@ void ActorEvent_ProcessTriggers(ActorEvent* this) { break; case EVC_ME_CLEAR: - if (D_play_800D3180[LEVEL_METEO] != 0) { + if (gLeveLClearStatus[LEVEL_METEO] != 0) { ActorEvent_TriggerBranch(this); } break; case EVC_FO_CLEAR: - if (D_play_800D3180[LEVEL_FORTUNA] != 0) { + if (gLeveLClearStatus[LEVEL_FORTUNA] != 0) { ActorEvent_TriggerBranch(this); } break; case EVC_SX_CLEAR: - if (D_play_800D3180[LEVEL_SECTOR_X] != 0) { + if (gLeveLClearStatus[LEVEL_SECTOR_X] != 0) { ActorEvent_TriggerBranch(this); } break; case EVC_TI_CLEAR: - if (D_play_800D3180[LEVEL_TITANIA] != 0) { + if (gLeveLClearStatus[LEVEL_TITANIA] != 0) { ActorEvent_TriggerBranch(this); } break; case EVC_BO_CLEAR: - if (D_play_800D3180[LEVEL_BOLSE] != 0) { + if (gLeveLClearStatus[LEVEL_BOLSE] != 0) { ActorEvent_TriggerBranch(this); } break; case EVC_SY_CLEAR: - if (D_play_800D3180[LEVEL_SECTOR_Y] != 0) { + if (gLeveLClearStatus[LEVEL_SECTOR_Y] != 0) { ActorEvent_TriggerBranch(this); } break; case EVC_KA_CLEAR: - if (D_play_800D3180[LEVEL_KATINA] != 0) { + if (gLeveLClearStatus[LEVEL_KATINA] != 0) { ActorEvent_TriggerBranch(this); } break; case EVC_SO_CLEAR: - if (D_play_800D3180[LEVEL_SOLAR] != 0) { + if (gLeveLClearStatus[LEVEL_SOLAR] != 0) { ActorEvent_TriggerBranch(this); } break; case EVC_MA_CLEAR: - if (D_play_800D3180[LEVEL_MACBETH] != 0) { + if (gLeveLClearStatus[LEVEL_MACBETH] != 0) { ActorEvent_TriggerBranch(this); } break; case EVC_AQ_CLEAR: - if (D_play_800D3180[LEVEL_AQUAS] != 0) { + if (gLeveLClearStatus[LEVEL_AQUAS] != 0) { ActorEvent_TriggerBranch(this); } break; case EVC_ZO_CLEAR: - if (D_play_800D3180[LEVEL_ZONESS] != 0) { + if (gLeveLClearStatus[LEVEL_ZONESS] != 0) { ActorEvent_TriggerBranch(this); } break; case EVC_SZ_CLEAR: - if (D_play_800D3180[LEVEL_SECTOR_Z] != 0) { + if (gLeveLClearStatus[LEVEL_SECTOR_Z] != 0) { ActorEvent_TriggerBranch(this); } break; case EVC_A6_CLEAR: - if (D_play_800D3180[LEVEL_AREA_6] != 0) { + if (gLeveLClearStatus[LEVEL_AREA_6] != 0) { ActorEvent_TriggerBranch(this); } break; diff --git a/src/engine/fox_game.c b/src/engine/fox_game.c index 389eb086..20167e46 100644 --- a/src/engine/fox_game.c +++ b/src/engine/fox_game.c @@ -115,7 +115,7 @@ void Game_SetGameState(void) { gBlurAlpha = 255; gDrawMode = DRAW_NONE; Audio_ClearVoice(); - Audio_SetBaseSfxReverb(0); + Audio_SetEnvSfxReverb(0); } bool Game_ChangeScene(void) { @@ -413,7 +413,7 @@ void Game_Update(void) { D_ctx_801778A4 = 3; gBlurAlpha = 255; for (i = 0; i < 30; i++) { - D_play_800D3180[i] = 0; + gLeveLClearStatus[i] = 0; } gExpertMode = false; gOptionSoundMode = gSaveFile.save.data.soundMode; diff --git a/src/engine/fox_hud.c b/src/engine/fox_hud.c index 03affb02..96eb29fc 100644 --- a/src/engine/fox_hud.c +++ b/src/engine/fox_hud.c @@ -759,7 +759,7 @@ void func_hud_80086DCC(void) { gLevelClearScreenTimer--; } - boolTemp = gNextPlanetPath; + boolTemp = gMissionStatus; if ((gCurrentLevel == LEVEL_TITANIA) || (gCurrentLevel == LEVEL_BOLSE) || (gCurrentLevel == LEVEL_VENOM_1) || (gCurrentLevel == LEVEL_VENOM_2) || (gCurrentLevel == LEVEL_AREA_6) || (gCurrentLevel == LEVEL_AQUAS) || @@ -1258,14 +1258,14 @@ void func_hud_800884E4(void) { s32 mask; s32 i; - D_ctx_80177B70[gMissionNumber] = gHitCount; + gMissionHitCount[gMissionNumber] = gHitCount; mask = 0x00FF0000; for (i = 0; i < 3; i++) { if (gTeamShields[3 - i] <= 0) { - D_ctx_80177B50[gMissionNumber] ^= mask; + gMissionTeamStatus[gMissionNumber] ^= mask; } else { - D_ctx_80177B50[gMissionNumber] |= mask; + gMissionTeamStatus[gMissionNumber] |= mask; } mask >>= 8; } @@ -1289,8 +1289,8 @@ void func_hud_80088564(void) { gSaveFile.save.data.planet[planetId].normalClear = 1; } - if (D_play_800D3180[gCurrentLevel] == 2) { - D_ctx_80177BB0[gMissionNumber] = 1; + if (gLeveLClearStatus[gCurrentLevel] == 2) { + gMissionMedal[gMissionNumber] = 1; if (gExpertMode) { gSaveFile.save.data.planet[planetId].expertMedal = 1; @@ -1456,7 +1456,7 @@ void func_hud_80088970(void) { break; } - func_8001CA24(gPlayer[0].num); + Audio_StopPlayerNoise(gPlayer[0].num); Audio_ClearVoice(); gRadioState = 0; @@ -1496,7 +1496,7 @@ void func_hud_80088970(void) { if (gFillScreenAlpha == 0) { if (gLevelType == LEVELTYPE_PLANET) { if (D_80161838[1] == 0) { - func_8001D520(); + Audio_PlayDeathSequence(); } if (D_80161838[1] == 10) { gLifeCount[gPlayerNum]--; @@ -1509,7 +1509,7 @@ void func_hud_80088970(void) { } } else { if (D_80161838[1] == 0) { - func_8001D520(); + Audio_PlayDeathSequence(); } if (D_80161838[1] == 6) { gLifeCount[gPlayerNum]--; @@ -1564,7 +1564,7 @@ void func_hud_80088970(void) { gSavedHitCount = D_ctx_80177CA0 = 0; - func_8001CA24(0); + Audio_StopPlayerNoise(0); gPlayer[0].state_1C8 = PLAYERSTATE_1C8_NEXT; gScreenFlashTimer = 0; gPlayer[0].timer_1F8 = 0; @@ -1576,7 +1576,7 @@ void func_hud_80088970(void) { break; case 10: - func_8001D638(0); + Audio_PlayPauseSfx(0); gDrawMode = DRAW_PLAY; gPlayState = PLAY_UPDATE; break; @@ -2252,7 +2252,7 @@ void func_hud_8008B044(void) { AUDIO_PLAY_SFX(0x49002018, gDefaultSfxSource, 4); if (gCallVoiceParam != 0) { - func_8001AF40(1); + Audio_SetUnkVoiceParam(1); } D_80161794 = 0; D_80161798 = 1; @@ -5861,7 +5861,7 @@ void HUD_AquasComplete(Player* player) { gFillScreenAlphaStep = 16; if (gFillScreenAlpha == 255) { - D_play_800D3180[LEVEL_AQUAS] = Play_CheckMedalStatus(150) + 1; + gLeveLClearStatus[LEVEL_AQUAS] = Play_CheckMedalStatus(150) + 1; player->state_1C8 = PLAYERSTATE_1C8_NEXT; player->timer_1F8 = 0; Audio_FadeOutAll(10); diff --git a/src/engine/fox_play.c b/src/engine/fox_play.c index 8f424900..c81521e5 100644 --- a/src/engine/fox_play.c +++ b/src/engine/fox_play.c @@ -497,7 +497,7 @@ void func_play_800A594C(void) { } if (D_ctx_8017782C == 0) { if (gCurrentLevel == LEVEL_SOLAR) { - func_8001D1C8(255, 1); + Audio_SetHeatAlarmParams(255, 1); AUDIO_PLAY_SFX(0x4100C023, gDefaultSfxSource, 4); Audio_KillSfxBySourceAndId(gPlayer[0].sfxSource, 0x3140807E); } @@ -2393,7 +2393,7 @@ void func_play_800AB334(void) { break; case LEVEL_VENOM_ANDROSS: AUDIO_SET_SPEC(SFXCHAN_0, AUDIOSPEC_15); - Audio_SetBaseSfxReverb(0); + Audio_SetEnvSfxReverb(0); D_ctx_8017796C = -1; break; } @@ -2562,7 +2562,7 @@ void Play_Init(void) { Audio_KillSfxById(0x49000014); Memory_FreeAll(); D_ctx_80177C78 = D_ctx_80177C8C = gShowBossHealth = gStarWolfMsgTimer = gAllRangeWingRepairTimer = - gAllRangeWingRepairSent = 0; + gAllRangeSuppliesSent = 0; D_display_800CA220 = 0; gShowLevelClearStatusScreen = 0; if (gCurrentLevel != LEVEL_VERSUS) { @@ -2589,10 +2589,10 @@ void Play_Init(void) { func_play_800A594C(); gDropHitCountItem = D_ctx_8017796C = gStartAndrossFightTimer = gSoShieldsEmpty = gAllRangeEventTimer = gAllRangeFrameCount = gBossActive = gGameFrameCount = gCameraShake = D_ctx_801782FC = gBossFrameCount = - gCallTimer = gAllRangeSupplyTimer = gNextPlanetPath = 0; + gCallTimer = gAllRangeSupplyTimer = gMissionStatus = 0; if (gCurrentLevel == LEVEL_SECTOR_X) { - gNextPlanetPath = 1; + gMissionStatus = MISSION_ACCOMPLISHED; } D_ctx_80177CC0 = -25000.0f; D_ctx_80177950 = 1.0f; @@ -2893,8 +2893,8 @@ void func_play_800ACC7C(Player* player) { } gPlayerShots[ARRAY_COUNT(gPlayerShots) - 1].unk_48 = 30.0f; gPlayerShots[ARRAY_COUNT(gPlayerShots) - 1].unk_60 = 0; - func_8001CB80(player->num, 1); - func_8001CCDC(player->num, gPlayerShots[ARRAY_COUNT(gPlayerShots) - 1].sfxSource); + Audio_InitBombSfx(player->num, 1); + Audio_PlayBombFlightSfx(player->num, gPlayerShots[ARRAY_COUNT(gPlayerShots) - 1].sfxSource); } } @@ -3074,8 +3074,8 @@ bool func_play_800AD1F4(Player* player) { } gPlayerShots[ARRAY_COUNT(gPlayerShots) - 1].unk_48 = 30.0f; gPlayerShots[ARRAY_COUNT(gPlayerShots) - 1].unk_60 = 0; - func_8001CB80(player->num, 1); - func_8001CCDC(player->num, gPlayerShots[ARRAY_COUNT(gPlayerShots) - 1].sfxSource); + Audio_InitBombSfx(player->num, 1); + Audio_PlayBombFlightSfx(player->num, gPlayerShots[ARRAY_COUNT(gPlayerShots) - 1].sfxSource); return true; } } @@ -4283,7 +4283,7 @@ void func_play_800B0F50(Player* playerx) { player->unk_018 = 1.0f; } if ((D_ctx_8017782C != 0) && (D_ctx_80177CA0 == 0)) { - D_play_800D3180[gCurrentLevel] = 0; + gLeveLClearStatus[gCurrentLevel] = 0; for (j = 0; j < 10; j++) { D_ctx_80177A10[j] = 0; D_ctx_80177A48[j] = 0.0f; @@ -5107,7 +5107,7 @@ void func_play_800B41EC(Player* player) { if (gCurrentLevel == LEVEL_SOLAR) { Audio_KillSfxById(0x4100C023); } - func_8001CA24(player->num); + Audio_StopPlayerNoise(player->num); func_play_800A5FA0(player->sfxSource, 0x0900C010, player->num); player->shields = 0; player->unk_1D0 = 0; @@ -5521,7 +5521,7 @@ void Player_Update(Player* player) { gPlayerGlareAlphas[0] = 0; gShowAllRangeCountdown = gRadioState = 0; Audio_ClearVoice(); - Audio_SetBaseSfxReverb(0); + Audio_SetEnvSfxReverb(0); D_ctx_80161A94[0] = gGoldRingCount[0]; if (gCurrentLevel == LEVEL_VENOM_ANDROSS) { D_ctx_80177C94 = gGoldRingCount[0]; @@ -6205,8 +6205,8 @@ void Play_UpdateLevel(void) { gPlayer[0].unk_1D0 = 0; gSceneSetup = 1; AUDIO_PLAY_SFX(0x1900602A, gDefaultSfxSource, 0); - gNextPlanetPath = 2; - D_play_800D3180[gCurrentLevel] = 1; + gMissionStatus = MISSION_WARP; + gLeveLClearStatus[gCurrentLevel] = 1; } break; case LEVEL_CORNERIA: @@ -6268,7 +6268,7 @@ void Play_UpdateLevel(void) { } } shields = MIN(gPlayer[0].shields, 255); - func_8001D1C8(shields, heightParam); + Audio_SetHeatAlarmParams(shields, heightParam); if (((gGameFrameCount % 8) == 0) && (gPlayer[0].state_1C8 != PLAYERSTATE_1C8_LEVEL_COMPLETE)) { Solar_8019E8B8(RAND_FLOAT_CENTERED(6000.0f), -80.0f, gPlayer[0].unk_138 + (RAND_FLOAT(2000.0f) + -6000.0f), @@ -6448,11 +6448,11 @@ void Play_Main(void) { (gPlayer[0].state_1C8 == PLAYERSTATE_1C8_LEVEL_INTRO) && gSaveFile.save.data.planet[D_800D2F6C[gCurrentLevel]].normalClear) { Audio_ClearVoice(); - Audio_SetBaseSfxReverb(0); + Audio_SetEnvSfxReverb(0); Play_ClearObjectData(); for (i = 0; i < gCamCount; i++) { Audio_KillSfxBySource(gPlayer[i].sfxSource); - func_8001CA24(i); + Audio_StopPlayerNoise(i); } gPlayState = PLAY_INIT; gDrawMode = gVersusMode = 0; @@ -6465,7 +6465,7 @@ void Play_Main(void) { func_versus_800C1E9C(); } if ((gControllerPress[gMainController].button & START_BUTTON) && gPauseEnabled) { - func_8001D638(1); + Audio_PlayPauseSfx(1); gPlayState = PLAY_PAUSE; D_ctx_80177868 = 4; D_ctx_80178484 = 100000; @@ -6494,7 +6494,7 @@ void Play_Main(void) { } if ((D_ctx_80177868 == 4) && (gControllerPress[gMainController].button & START_BUTTON) && (gPauseEnabled != 0)) { - func_8001D638(0); + Audio_PlayPauseSfx(0); gPlayState = PLAY_UPDATE; gDrawMode = DRAW_PLAY; } diff --git a/src/engine/fox_save.c b/src/engine/fox_save.c index 086e2d12..c6a88897 100644 --- a/src/engine/fox_save.c +++ b/src/engine/fox_save.c @@ -44,8 +44,8 @@ s32 Save_Write(void) { gSaveFile.save.checksum = Save_Checksum(&gSaveFile.save); gSaveFile.backup = gSaveFile.save; gSaveIOBuffer = gSaveFile; - osSendMesg(&gSerialThreadMsgQueue, (OSMesg) SI_WRITE_SAVE, OS_MESG_PRI_NORMAL); - osRecvMesg(&gSaveMsgQueue, &sp1C, OS_MESG_BLOCK); + osSendMesg(&gSerialThreadMesgQueue, (OSMesg) SI_WRITE_SAVE, OS_MESG_NOBLOCK); + MQ_WAIT_FOR_MESG(&gSaveMesgQueue, &sp1C); if (sp1C != (OSMesg) SI_SAVE_SUCCESS) { return -1; } @@ -56,8 +56,8 @@ s32 Save_Read(void) { OSMesg sp24; s32 i; - osSendMesg(&gSerialThreadMsgQueue, (OSMesg) SI_READ_SAVE, OS_MESG_PRI_NORMAL); - osRecvMesg(&gSaveMsgQueue, &sp24, OS_MESG_BLOCK); + osSendMesg(&gSerialThreadMesgQueue, (OSMesg) SI_READ_SAVE, OS_MESG_NOBLOCK); + MQ_WAIT_FOR_MESG(&gSaveMesgQueue, &sp24); if ((s32) sp24 != SI_SAVE_SUCCESS) { return -1; } diff --git a/src/engine/fox_versus.c b/src/engine/fox_versus.c index 6340a806..1ed295c9 100644 --- a/src/engine/fox_versus.c +++ b/src/engine/fox_versus.c @@ -56,7 +56,7 @@ void func_versus_800BC760(void) { for (i = 0; i < gCamCount; i++) { Audio_KillSfxBySource(gPlayer[i].sfxSource); - func_8001CA24(i); + Audio_StopPlayerNoise(i); } gGameState = GSTATE_INIT; |
