DS-Homebrew / TWiLightMenu

DSi Menu replacement for DS/DSi/3DS/2DS
https://wiki.ds-homebrew.com/twilightmenu/
GNU General Public License v3.0
3.31k stars 206 forks source link

Wrong save file size created (Ace3DS+ Flashcart Loader) #2486

Open nuxa17 opened 3 weeks ago

nuxa17 commented 3 weeks ago

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

  1. On an empty SD card, move the files from the kernel zip file (link in notes).
  2. Install TWiLight Menu++ with the Autoboot and Flashcart Loader files for Ace3DS+.
  3. Move the game to the roms/nds folder.
  4. Run the game. The file is created before loading, so it can be closed when the first credits appear.
  5. The save file created will have 8kb.

Tests

Notes

nuxa17 commented 3 weeks ago

More tests:

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.

nuxa17 commented 3 weeks ago

Tested with two more games of the same save size according to __wfwd/savelist.bin:

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.

nuxa17 commented 3 weeks ago

The issue persists in v27.11.1

RocketRobz commented 3 weeks ago

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.

nuxa17 commented 2 weeks ago

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.