mrehkopf / sd2snes

SD card based multi-purpose cartridge for the SNES
http://sd2snes.de
GNU General Public License v2.0
579 stars 114 forks source link

Fixes related to MSU1 autosave #224

Closed mrehkopf closed 1 year ago

mrehkopf commented 1 year ago

MSU1: speed up bulk PCM file scanning by some games

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.

Add config toggles for Autosave & MSU1 Autosave

Since MSU1 auto saving may lead to undesired delays on track changes for quirky hacks, add a config option to turn it off. In the process, a global autosave disable option is also introduced. MSU1 autosave is automatically disabled when global autosave is disabled.

Avoid static buzzing noise on MSU1 track change

Some games do not pause playback before changing the audio track. Normally this is not a problem since the track change handling stops playback implicitly; however after adding MSU1 SRAM checks the playback stop had moved after the SRAM check so there was an opportunity for the FPGA continuing playback without refilling the audio buffer. Playback is now stopped before performing the SRAM check on track change.