Skip to content

Commit 72054ba

Browse files
author
Niko
committed
loading screen optimizations
1 parent 72cd0c9 commit 72054ba

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

decompile/General/LOAD/LOAD_41_OvrEndRace.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,14 @@ void DECOMP_LOAD_OvrEndRace(unsigned int param_1)
2222

2323
// save ID, and reload next overlay (sector read invalidation)
2424
gGT->overlayIndex_EndOfRace = param_1;
25+
26+
// Optimization, new Region1 overlays
27+
// cut off loading at 2 disc sectors (not 3),
28+
// so Region2 RAM is protected, dont reload
29+
// Region2 unless numPlayers changes (LOAD_OvrLOD)
30+
#if 0
2531
gGT->overlayIndex_LOD = 0xff;
32+
#endif
2633
}
2734
return;
2835
}

decompile/General/LOAD/LOAD_44_TenStages.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,10 @@ int DECOMP_LOAD_TenStages(struct GameTracker* gGT, int loadingStage, struct BigH
311311
}
312312
case 2:
313313
{
314+
int levelID = gGT->levelID;
315+
316+
if (levelID == MAIN_MENU_LEVEL) break;
317+
314318
#ifdef USE_HIGHMP
315319
DECOMP_LOAD_OvrLOD(1);
316320
#else

decompile/General/MAIN/MainMain.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -799,6 +799,12 @@ void StateZero()
799799
firstEntry[231].size = 28*0x800;
800800
//firstEntry[231].size = (u_int)RB_NewEndFile - (u_int)OVR_Region3;
801801
//printf("Size: %08x\n", firstEntry[231].size);
802+
803+
// Cut off Region1 overlays at 2 sectors (not 3),
804+
// This protects Region2 RAM so it is not overwritten
805+
// during Region1 disc streaming, saves loading time
806+
for(int i = 221; i <= 225; i++)
807+
firstEntry[i].size = 2*0x800;
802808
#endif
803809

804810
#ifndef FastBoot

0 commit comments

Comments
 (0)