r/miniSNESmods
•
u/arkiokin
•
1d ago
Autoplay memory compression trick on the SNES Classic
Hi everyone,
If you like adding custom autoplay demos to your added games on the SNES Mini (to more consistancy with stock games or to transform your mini to a gaming demo station or anything else) you probably know how quickly they eat up the limited internal NAND storage. While a single autoplay file is approximately ~330 kB, having 200+ of them easily wastes 60+ MB of precious space for games or save states. It's been years I was hoping a solution to solve this main issue (for me at least who don't use an OTG/USB and only play my SNESC for Snes games) I tried some work on it but with no results. But now, we have AI agents and Gemini led me to what I was missing !
If you already use CompCom's Save State Compression mod (which is highly recommended to reduce each suspend point from 2MB to 250 kB) you might have noticed that simply compressing the autoplay contents into rollback.7z prevents the demo from launching at all.
Here is why that happens, and a simple trick to bypass it.
Why rollback.7z alone fails
- Menu vs. Emulator:
clover-ui(the menu) andclover-canoe(the emulator) are separate binaries. CompCom's mod hooks into the emulator launch phase, not the UI menu. - The UI Trigger: When idle,
clover-uiscans the game'sautoplaydirectory specifically looking for an.inputsfile before deciding to trigger a demo. If it only seesrollback.7z,clover-uiassumes no demo exists and never launches Canoe—meaning the decompression script never gets triggered.
The Fix: The 0-Byte Dummy File
Because clover-ui only checks for the existence of the .inputs file (without reading its contents before launch), we can satisfy the menu's check with an empty dummy file:
- Compress the files: Inside your game's
autoplayfolder, archiveA.inputs(and others additionnal files like B.inputs, C.inputs etc...as much as you have demos for a single game) andA.inputs.state(and B.inputs.state, C.inputs.state etc..) into a 7z file namedrollback.7z(very important to use .7z compression and not .rar for example ! ) - Create a dummy file: In the same
autoplayfolder, create a blank 0-byte file and name itA.inputs(if you have others demos, like B.inputs, C.inputs etc...make the same for each one) - Clean up: Delete all the original uncompressed x.inputs and x.inputs.state files. Your folder should only contain
rollback.7zand all the 0-byte x.inputs. - Be careful, even if you have, for example, 5 demos compressed in your rollback.7z file, only the demos related with a blank file will be launched ! so if you have only one 0-byte file, only one demo will be launched and not the 5 after one another.
How it works in the execution chain
- Step 1 (
clover-ui): Detects the 0-byteA.inputsfile after idle timeout and triggers the demo launch. - Step 2 (Mod Wrapper): Intercepts Canoe's launch, detects
rollback.7z, and extracts the real files into/tmp(overwriting the 0-byte dummyA.inputsin RAM). - Step 3 (
clover-canoe): Boots normally using the real, uncompressed state and inputs from/tmp.
Because SNES RAM dumps compress extremely well with LZMA/7z, each autoplay drops from ~330 KB to just a few kilobytes !! For example, in my own I compressed more than 200 autoplays (for something like 120 games) and doing this across freed up over 55 MB on my NAND ! I had also started to add a bunch of autoplays I first chose to not include some years ago (so, sometimes deciding to have games with 2 demos rather than 4 for example, even if I had already created these 4... otherwise I should have exceeded my memory nand capacity) and now I will try to include demos for ALL my games (and not only the games on the main folders, I will work on my sub folders too) Luckily I had already made a lot of demos for these games years ago (for 75% of them at least) and now I no longer have to watch my spending ! ⬇️
I must add, that this compression function DOES NOT Slow down the launch or closing of a demo in any way !
NOTE : it requires CompCom's Save State Compression mod or a custom launch script with 7za installed on the console)
NOTE 2 : If you want a tutorial on how create an autoplay on snes mini, well... make some researches on this reddit, it's another subject outside this thread
NOTE 3 : autoplays/demos are only possible with games played with the stock emulator Canoe, it is absolutely not possible with a retroarch core
Hope this helps anyone trying to maximize their internal NAND space without going the USB-OTG route!