TWiLightMenu
TWiLightMenu copied to clipboard
Wrong save file size created (Ace3DS+ Flashcart Loader)
A save file of an incorrect size is being created for Pic Pic, making it impossible to save.
Flashcard or Exploits? Ace3DS+ clone (X in 1 games), Ace3DS+ R4iLS 1.62 Base Console: Nintendo 3DS XL, 11.17.0-50E
TWiLight Menu++ Version: v27.11.0 TWiLight Menu++ Theme: Tested with Nintendo 3DS and DSi themes
Expected behavior
Pic Pic has a save file of size 64kb. When using the original kernel without TWiLight Menu++, the created save file has a size of 512kb (probably a default size, see Notes). Both of them work correctly. When using TWiLight Menu++ with Autoboot and Flashcart Loader, the save file should be created with the same size.
Actual behavior
When using TWiLight Menu++ with Autoboot and Flashcart Loader, the created save file has a size of 8kb.
Steps to reproduce
- On an empty SD card, move the files from the kernel zip file (link in notes).
- Install TWiLight Menu++ with the Autoboot and Flashcart Loader files for Ace3DS+.
- Move the game to the roms/nds folder.
- Run the game. The file is created before loading, so it can be closed when the first credits appear.
- The save file created will have 8kb.
Tests
- Different SD card, completely empty. Following the same steps produces the same output.
- Tested with original kernel (AOS v2.13), saves fine.
- Originally tested with TWiLight Menu++ v27.5.0.
Notes
- MelonDS uses a list with the specific save size per game, and creates a file of 64kb.
- This is not the first time I have problems with save files. I think the problem resides in the Flashcart Loader, since it uses a different kernel (see #1783). If there is a better place to submit this bug, please let me know.
- For testing: the game saves for the first time when a new user is created.
- Kernel taken from the flashcart archive.
More tests:
- Removing
_wfwd/savelist.bincreates a 512kb save file. - Copying
__rpg/savesize.binto_wfwdcreates a 8kb save file. - Replacing
_wfwd/savelist.binwith__rpg/savesize.binand renaming it creates a 512kb save file.
The format of savesize.bin and savelist.bin is different, but I wanted to try it out just in case. On the other hand, when using the original kernel, you can change the save size manually. Changes per game are stored in __rpg/gamedata.bin which uses the same format as savelist.bin.
Edit: The save config stored in __rpg/gamedata.bin matches the one stored in __wfwd/savelist.bin, confirming that the problem is not the file itself.
Tested with two more games of the same save size according to __wfwd/savelist.bin:
- Meteos. MelonDS: 8kb.
- Top Spin 3. MelonDS: 64kb.
These games generate a 8kb save file using the Flashcart Loader.
After formatting the SD to a cluster size of 32kb, the generated save file for Pic Pic has a size of 512 bytes. The original kernel still creates a file of 512kb, and nds-bootstrap generates the save files with correct sizes.
The issue persists in v27.11.1
What could be done is for TWLMenu++ to create the save file instead of the flashcard kernel, but then afaik, YSMenu saves it's per-game settings at the end of the .sav file, so it probably won't work properly for flashcards which use YSMenu as the flashcard kernel.
Judging by the variation of sizes depending of the card's format, I'm worried that there could be more issues with this particular loader. A temporary solution could be to detect if this particular loader is in use, and generate the saves if that's the case.
Either way, I will be performing more tests to see if there are any more problems, specifically with reading and writing.