30% milestone

This commit is contained in:
Niko 2023-04-28 16:10:24 -04:00
parent 1ca7300fd1
commit df77a00696
4 changed files with 88 additions and 88 deletions

View File

@ -471,7 +471,7 @@ void DECOMP_MM_ParseCheatCodes()
DecalFont_DrawLine(info, 5, 197, FONT_SMALL, ORANGE);
DecalFont_DrawLine(__DATE__, 5, 206, FONT_SMALL, ORANGE);
DecalFont_DrawLine(__TIME__, 170, 206, FONT_SMALL, ORANGE);
DecalFont_DrawLine("29%", 285, 206, FONT_SMALL, ORANGE);
DecalFont_DrawLine("30%", 285, 206, FONT_SMALL, ORANGE);
#endif
#if 0

View File

@ -1,14 +1,14 @@
#include <common.h>
typedef void (*whateverThisIs)(struct Thread* thread, struct Driver* driver);
typedef void (*VehicleFuncPtr)(struct Thread* thread, struct Driver* driver);
void DECOMP_MainFrame_GameLogic(struct GameTracker* gGT2, struct GamepadSystem* gGamepads2)
void DECOMP_MainFrame_GameLogic(struct GameTracker* gGT, struct GamepadSystem* gGamepads)
{
char bVar1;
short sVar2;
u_int uVar3;
int iVar4;
whateverThisIs pcVar5;
VehicleFuncPtr pcVar5;
u_int uVar5;
u_int uVar6;
int* piVar7;
@ -22,15 +22,13 @@ void DECOMP_MainFrame_GameLogic(struct GameTracker* gGT2, struct GamepadSystem*
struct Thread* psVar12;
int iVar13;
int iVar14;
struct GameTracker* gGT3;
struct GamepadSystem* gGamepads3;
bVar1 = true;
if ((gGT2->gameMode1 & (PAUSE_1 | PAUSE_2 | PAUSE_3 | PAUSE_4)) == 0)
if ((gGT->gameMode1 & (PAUSE_1 | PAUSE_2 | PAUSE_3 | PAUSE_4)) == 0)
{
bVar1 = false;
tileView = sdata->gGT->tileView;
for(psVar12 = sdata->gGT->threadBuckets[0].thread; psVar12 != 0; psVar12 = psVar12->siblingThread)
tileView = gGT->tileView;
for(psVar12 = gGT->threadBuckets[0].thread; psVar12 != 0; psVar12 = psVar12->siblingThread)
{
pvVar12 = (struct Driver*)psVar12->object;
if (pvVar12->clockSend)
@ -45,7 +43,7 @@ void DECOMP_MainFrame_GameLogic(struct GameTracker* gGT2, struct GamepadSystem*
uVar3 = (u_int)pvVar12->clockSend;
if (uVar3 == 0)
{
if ((sdata->gGT->clockEffectEnabled & 1) == 0) goto LAB_80034e74;
if ((gGT->clockEffectEnabled & 1) == 0) goto LAB_80034e74;
uVar3 = 10000;
}
}
@ -67,49 +65,47 @@ void DECOMP_MainFrame_GameLogic(struct GameTracker* gGT2, struct GamepadSystem*
LAB_80034e74:
tileView = tileView + 1;
}
gGT2->timer = gGT2->timer + 1;
gGT3 = sdata->gGT;
gGT2->framesInThisLEV = gGT2->framesInThisLEV + 1;
gGT3->unk1cc4[4] = 0;
iVar4 = RCNT_GetTime_Elapsed(gGT2->anotherTimer, &gGT2->anotherTimer);
gGT->timer = gGT->timer + 1;
gGT->framesInThisLEV = gGT->framesInThisLEV + 1;
gGT->unk1cc4[4] = 0;
iVar4 = RCNT_GetTime_Elapsed(gGT->anotherTimer, &gGT->anotherTimer);
iVar4 = (iVar4 << 5) / 100;
gGT2->elapsedTimeMS = iVar4;
gGT->elapsedTimeMS = iVar4;
if (iVar4 < 0)
{
gGT2->elapsedTimeMS = 0x20;
gGT->elapsedTimeMS = 0x20;
}
if (0x40 < gGT2->elapsedTimeMS)
if (0x40 < gGT->elapsedTimeMS)
{
gGT2->elapsedTimeMS = 0x40;
gGT->elapsedTimeMS = 0x40;
}
if ((sdata->gGT->gameMode1_prevFrame & (PAUSE_1 | PAUSE_2 | PAUSE_3 | PAUSE_4)) != 0)
if ((gGT->gameMode1_prevFrame & (PAUSE_1 | PAUSE_2 | PAUSE_3 | PAUSE_4)) != 0)
{
gGT2->elapsedTimeMS = 0x20;
gGT->elapsedTimeMS = 0x20;
}
gGT2->BoxSceneTimer += gGT2->elapsedTimeMS;
gGT3 = sdata->gGT;
if (gGT2->trafficLightsTimer < 1)
gGT->BoxSceneTimer += gGT->elapsedTimeMS;
if (gGT->trafficLightsTimer < 1)
{
if ((sdata->gGT->gameMode1 & PAUSE_THREADS) == 0)
if ((gGT->gameMode1 & PAUSE_THREADS) == 0)
{
if (gGT2->frozenTimeRemaining < 1)
if (gGT->frozenTimeRemaining < 1)
{
if ((sdata->gGT->gameMode1 & END_OF_RACE) == 0)
if ((gGT->gameMode1 & END_OF_RACE) == 0)
{
gGT2->elapsedEventTime += gGT2->elapsedTimeMS;
gGT->elapsedEventTime += gGT->elapsedTimeMS;
}
}
else
{
iVar4 = gGT2->frozenTimeRemaining - gGT2->elapsedTimeMS;
gGT2->frozenTimeRemaining = iVar4;
iVar4 = gGT->frozenTimeRemaining - gGT->elapsedTimeMS;
gGT->frozenTimeRemaining = iVar4;
if (iVar4 < 0)
{
gGT2->frozenTimeRemaining = 0;
gGT->frozenTimeRemaining = 0;
}
else
{
uVar3 = gGT3->timer;
uVar3 = gGT->timer;
if (uVar3 == (uVar3 / 6) * 6)
{
if (uVar3 == (uVar3 / 0xc) * 0xc)
@ -127,13 +123,13 @@ LAB_80034e74:
}
else
{
gGT2->elapsedEventTime = 0;
gGT->elapsedEventTime = 0;
}
CTR_CycleTex_AllModels(-1, (struct Model*)sdata->PLYROBJECTLIST, gGT2->timer);
CTR_CycleTex_AllModels(gGT2->level1->numModels, (struct Model*)gGT2->level1->ptrModelsPtrArray, gGT2->timer);
CTR_CycleTex_AllModels(-1, (struct Model*)sdata->PLYROBJECTLIST, gGT->timer);
CTR_CycleTex_AllModels(gGT->level1->numModels, (struct Model*)gGT->level1->ptrModelsPtrArray, gGT->timer);
psVar8 = 0;
psVar9 = 0;
for(psVar12 = sdata->gGT->threadBuckets[0].thread; psVar12 != 0; psVar12 = psVar12->siblingThread)
for(psVar12 = gGT->threadBuckets[0].thread; psVar12 != 0; psVar12 = psVar12->siblingThread)
{
pvVar9 = (struct Driver*)psVar12->object;
psVar10 = psVar9;
@ -166,22 +162,30 @@ LAB_80035098:
}
iVar14 = 0;
iVar4 = 0;
iVar13 = 0x1b2c;
gGT3 = gGT2;
do
{
piVar7 = (int*)((u_int)gGT2->db[0].drawEnv.ofs + iVar13 - 0x20);
if ((((sdata->gGT->gameMode1 & PAUSE_THREADS) == 0) || ((piVar7[3] & 1U) != 0)) && (*piVar7 != 0))
if (
(
// if threads are not paused
((gGT->gameMode1 & PAUSE_THREADS) == 0) ||
// if bucket can not be paused
((gGT->threadBuckets[PLAYER].boolCantPause & 1U) != 0)
) &&
// if threads exist
(gGT->threadBuckets[PLAYER].thread != 0)
)
{
if (iVar4 == 0)
{
for(psVar12 = sdata->gGT->threadBuckets[PLAYER].thread; psVar12 != 0; psVar12 = psVar12->siblingThread)
for(psVar12 = gGT->threadBuckets[PLAYER].thread; psVar12 != 0; psVar12 = psVar12->siblingThread)
{
Weapon_Shoot_OnCirclePress((struct Driver*)psVar12->object);
}
for(iVar11 = 0; iVar11 < 13; iVar11++)
{
for(psVar12 = sdata->gGT->threadBuckets[PLAYER].thread; psVar12 != 0; psVar12 = psVar12->childThread)
for(psVar12 = gGT->threadBuckets[PLAYER].thread; psVar12 != 0; psVar12 = psVar12->childThread)
{
if
(
@ -198,21 +202,21 @@ LAB_80035098:
}
}
}
ThreadBucketTickAll(gGT3->threadBuckets[0].thread);
ThreadBucketTickAll(gGT->threadBuckets[iVar4].thread);
}
gGT3 = (struct GameTracker*)&gGT3->frontBuffer;
iVar14 = iVar14 + 0x14;
iVar4 = iVar4 + 1;
iVar13 = iVar13 + 0x14;
} while (iVar4 < 17);
BOTS_UpdateGlobals();
GhostBuffer_RecordStats(0);
sdata->gGT->unk1cc4[4] = (u_int)(sdata->gGT->unk1cc4[4] * 10000) / 0x147e;
gGT->unk1cc4[4] = (u_int)(gGT->unk1cc4[4] * 10000) / 0x147e;
Particle_UpdateAllParticles();
}
else
{
psVar12 = gGT2->threadBuckets[AKUAKU].thread;
psVar12 = gGT->threadBuckets[AKUAKU].thread;
if (psVar12 != 0)
{
ThreadBucketTickAll(psVar12);
@ -221,29 +225,29 @@ LAB_80035098:
uVar5 = LOAD_IsOpen_RacingOrBattle();
if (uVar5 != 0)
{
if ((sdata->gGT->gameMode1 & (PAUSE_1 | PAUSE_2 | PAUSE_3 | PAUSE_4)) == 0)
if ((gGT->gameMode1 & (PAUSE_1 | PAUSE_2 | PAUSE_3 | PAUSE_4)) == 0)
{
RB_Bubbles_RoosTubes();
}
if (sdata->gGT->threadBuckets[BURST].thread != 0)
if (gGT->threadBuckets[BURST].thread != 0)
{
RB_Burst_DrawAll(sdata->gGT);
RB_Burst_DrawAll(gGT);
}
}
THREAD_CheckAllForDead();
if ((sdata->gGT->gameMode1 & (PAUSE_1 | PAUSE_2 | PAUSE_3 | PAUSE_4)) == 0)
if ((gGT->gameMode1 & (PAUSE_1 | PAUSE_2 | PAUSE_3 | PAUSE_4)) == 0)
{
Audio_Update1();
}
gGamepads3 = sdata->gGamepads;
gGT2->gameMode1_prevFrame = gGT2->gameMode1;
uVar5 = GAMEPAD_GetNumConnected(gGamepads3);
uVar3 = sdata->gGT->gameMode1;
gGT->gameMode1_prevFrame = gGT->gameMode1;
uVar5 = GAMEPAD_GetNumConnected(gGamepads);
uVar3 = gGT->gameMode1;
if ((uVar3 & END_OF_RACE) == 0)
{
if ((bVar1) || ((gGT2->gameMode1 & (PAUSE_1 | PAUSE_2 | PAUSE_3 | PAUSE_4)) != 0))
if ((bVar1) || ((gGT->gameMode1 & (PAUSE_1 | PAUSE_2 | PAUSE_3 | PAUSE_4)) != 0))
{
if (sdata->gGT->cooldownfromPauseUntilUnpause == '\0')
if (gGT->cooldownfromPauseUntilUnpause == '\0')
{
if
(
@ -255,21 +259,21 @@ LAB_80035098:
)
{
MenuBox_ClearInput();
sdata->gGT->gameMode1 = sdata->gGT->gameMode1 & (0xffffffff ^ PAUSE_1);
gGT->gameMode1 = gGT->gameMode1 & (0xffffffff ^ PAUSE_1);
MainFrame_TogglePauseAudio(0);
OtherFX_Play(1, 1);
MainFreeze_SafeAdvDestroy();
ElimBG_Deactivate(sdata->gGT);
ElimBG_Deactivate(gGT);
MenuBox_Hide(sdata->ptrActiveMenuBox);
sdata->gGT->cooldownFromUnpauseUntilPause = 5;
gGT->cooldownFromUnpauseUntilPause = 5;
}
}
else
{
sdata->gGT->cooldownfromPauseUntilUnpause--;
gGT->cooldownfromPauseUntilUnpause--;
}
}
else if (sdata->gGT->cooldownFromUnpauseUntilPause == 0)
else if (gGT->cooldownFromUnpauseUntilPause == 0)
{
if
(
@ -279,15 +283,14 @@ LAB_80035098:
sdata->AkuAkuHintState == 0 &&
(
(
uVar6 = TitleFlag_IsFullyOnScreen(), uVar6 == 0 &&
(iVar4 = 0, gGT2->numPlyrCurrGame != 0)
uVar6 = TitleFlag_IsFullyOnScreen(), uVar6 == 0
)
)
)
)
)
{
do
for(iVar4 = 0; iVar4 < gGT->numPlyrCurrGame; iVar4++)
{
if
(
@ -296,43 +299,42 @@ LAB_80035098:
(uVar5 != 0) &&
(
(
uVar3 = MainFrame_HaveAllPads((u_short)(u_char)sdata->gGT->numPlyrNextGame),
(uVar3 & 0xffff) == 0 && ((gGT2->gameMode1 & (PAUSE_1 | PAUSE_2 | PAUSE_3 | PAUSE_4)) == 0)
uVar3 = MainFrame_HaveAllPads((u_short)(u_char)gGT->numPlyrNextGame),
(uVar3 & 0xffff) == 0 && ((gGT->gameMode1 & (PAUSE_1 | PAUSE_2 | PAUSE_3 | PAUSE_4)) == 0)
)
)
) ||
((gGamepads2->gamepad[0].buttonsTapped & 0x1000U) != 0)
((gGamepads->gamepad[iVar4].buttonsTapped & 0x1000U) != 0)
) &&
(sdata->gGT->overlayIndex_Threads != -1)
(gGT->overlayIndex_Threads != -1)
)
{
sdata->gGT->unknownFlags_1d44 = sdata->gGT->gameMode1 & 0x3e0020U | PAUSE_1;
gGT->unknownFlags_1d44 = gGT->gameMode1 & 0x3e0020U | PAUSE_1;
MainFreeze_IfPressStart();
sdata->gGT->cooldownfromPauseUntilUnpause = 5;
gGT->cooldownfromPauseUntilUnpause = 5;
}
iVar4 = iVar4 + 1;
gGamepads2 = (struct GamepadSystem*)(gGamepads2->gamepad + 1);
} while (iVar4 < (int)(u_int)(u_char)gGT2->numPlyrCurrGame);
}
}
}
else
{
sdata->gGT->cooldownFromUnpauseUntilPause--;
gGT->cooldownFromUnpauseUntilPause--;
}
}
else if (sdata->gGT->timerEndOfRaceVS == 0)
else if (gGT->timerEndOfRaceVS == 0)
{
uVar3 = sdata->gGT->unknownFlags_1d44;
uVar3 = gGT->unknownFlags_1d44;
if ((uVar3 & AKU_SONG) == 0)
{
if ((uVar3 & CRYSTAL_CHALLENGE) == 0)
{
if (sdata->gGT->unk_timerCooldown_similarTo_1d36 == 0)
if (gGT->unk_timerCooldown_similarTo_1d36 == 0)
{
return;
}
}
else if (sdata->gGT->unk_timerCooldown_similarTo_1d36 == 0)
else if (gGT->unk_timerCooldown_similarTo_1d36 == 0)
{
if ((uVar3 & PAUSE_2) == 0)
{
@ -348,31 +350,31 @@ LAB_80035098:
*(u_short*)&sdata->unk_saveGame_related = 0;
LoadSave_ToggleMode(0x41);
MenuBox_Show(&data.menuBox_warning2);
sdata->gGT->unknownFlags_1d44 |= AKU_SONG;
gGT->unknownFlags_1d44 |= AKU_SONG;
return;
}
sdata->gGT->newHighScoreIndex = -1;
sdata->gGT->unknownFlags_1d44 &= 0xf3ffffff;
gGT->newHighScoreIndex = -1;
gGT->unknownFlags_1d44 &= 0xf3ffffff;
return;
}
sdata->gGT->unk_timerCooldown_similarTo_1d36--;
gGT->unk_timerCooldown_similarTo_1d36--;
}
}
else if ((uVar3 & ARCADE_MODE) == 0)
{
if (sdata->gGT->timerEndOfRaceVS < 0x96)
if (gGT->timerEndOfRaceVS < 0x96)
{
UI_VsQuipDrawAll();
UI_VsWaitForPressX();
}
if (0x1e < sdata->gGT->timerEndOfRaceVS)
if (0x1e < gGT->timerEndOfRaceVS)
{
sdata->gGT->timerEndOfRaceVS--;
gGT->timerEndOfRaceVS--;
}
}
else
{
sdata->gGT->timerEndOfRaceVS = 0;
gGT->timerEndOfRaceVS = 0;
}
return;
}

View File

@ -1,3 +0,0 @@
.set noreorder
j DECOMP_MainFrame_GameLogic
nop

View File

@ -266,6 +266,7 @@ common, exe, MainDB_PrimMem, 0x0, General/MAIN/MainDB_PrimMem.c
common, exe, MainDB_OTMem, 0x0, General/MAIN/MainDB_OTMem.c
common, exe, MainDrawCb_DrawSync, 0x0, General/MAIN/MainDrawCb_DrawSync.c
common, exe, MainDrawCb_Vsync, 0x0, General/MAIN/MainDrawCb_Vsync.c
common, exe, MainFrame_GameLogic, 0x0, General/MAIN/MainFrame_GameLogic.c
common, exe, MainFrame_RenderFrame, 0x0, General/MAIN/MainFrame_RenderFrame.c
common, exe, MainFrame_RequestMaskHint, 0x0, General/MAIN/MainFrame_RequestMaskHint.c
common, exe, MainFrame_ResetDB, 0x0, General/MAIN/MainFrame_ResetDB.c