Skip to content

Commit

Permalink
MSU1: speed up bulk PCM file scanning by some games
Browse files Browse the repository at this point in the history
Some games, notably ALTTP Randomizer, perform a full scan of all PCM tracks on startup. After adding MSU1 SRAM checks, this led to a full SRAM check per track scanned (because it was considered a safe opportunity to always do an SRAM check on track change), resulting in 7+ seconds of one-time startup time for the game which was considered unacceptable.
SRAM check is now relaxed to at most once per second on track change; startup time is reduced to about 600ms.
  • Loading branch information
mrehkopf committed Jun 21, 2023
1 parent f849441 commit 85d1dde
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/msu1.c
Expand Up @@ -96,7 +96,7 @@ void prepare_audio_track(uint16_t msu_track, uint32_t audio_offset) {
f_close(&msuaudio);
msu_audio_usage = MSU_IDLE;
if(is_msu_free_to_save()) {
msu_savecheck(1);
msu_savecheck(0);
}
snprintf(suffix, sizeof(suffix), "-%d.pcm", msu_track);
strcpy((char*)file_buf, (char*)file_lfn);
Expand Down

0 comments on commit 85d1dde

Please sign in to comment.