Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
nuxa17 opened this issue Nov 2, 2024 · 5 comments
Open

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

nuxa17 opened this issue Nov 2, 2024 · 5 comments
Labels

Comments

@nuxa17
Copy link

nuxa17 commented Nov 2, 2024

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

  • 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 Add Ace3DS+ (and clones) flashcart loader #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.
@nuxa17 nuxa17 added the bug label Nov 2, 2024
@nuxa17
Copy link
Author

nuxa17 commented Nov 2, 2024

More tests:

  • Removing _wfwd/savelist.bin creates a 512kb save file.
  • Copying __rpg/savesize.bin to _wfwd creates a 8kb save file.
  • Replacing _wfwd/savelist.bin with __rpg/savesize.bin and 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.

@nuxa17 nuxa17 changed the title Wrong save file size created Wrong save file size created (Ace3DS+ Flashcart Loader) Nov 2, 2024
@nuxa17
Copy link
Author

nuxa17 commented Nov 2, 2024

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.

@nuxa17
Copy link
Author

nuxa17 commented Nov 3, 2024

The issue persists in v27.11.1

@RocketRobz
Copy link
Member

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
Copy link
Author

nuxa17 commented Nov 9, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants