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

[GBA] DOOM - Not Properly Saving #925

Closed
voidflower-xcii opened this issue Jan 2, 2023 · 5 comments · Fixed by #933
Closed

[GBA] DOOM - Not Properly Saving #925

voidflower-xcii opened this issue Jan 2, 2023 · 5 comments · Fixed by #933

Comments

@voidflower-xcii
Copy link

voidflower-xcii commented Jan 2, 2023

When the game asks you if you'd like to save your data to the selected slot, nothing gets saved despite the game telling you otherwise.

The game creates an EEPROM for the save file.

Doom (USA, Europe).gba
MD5 A4078F38DBB47AB22A9C74B725F3E481
SHA-256 F5F4F0AAC6C1884EF0B771DACB21A5D3F2152A066157F46ABB39769C7F95DEAB

Edit: Accidentally didn't label this a game bug.

@invertego
Copy link
Contributor

invertego commented Jan 4, 2023

Edit: I now see that the slot remains empty even after saving properly, so there is indeed an emulation bug here.

This is just a case of a game with bad UI. You need to press right or left before pressing A, then again to confirm.

https://doomwiki.org/wiki/Doom_for_Game_Boy_Advance#Saving

@voidflower-xcii
Copy link
Author

So, I decided to rename the .eeprom file the game creates to a .flash file. I launched the game, tried to save, and it seemingly worked in letting the game save data to a slot.

What exactly is the difference between .eeprom and .flash?

@LukeUsher
Copy link
Member

So, I decided to rename the .eeprom file the game creates to a .flash file. I launched the game, tried to save, and it seemingly worked in letting the game save data to a slot.

What exactly is the difference between .eeprom and .flash?

Some games used flash ROM, some games used EEPROM, they are different hardware solutions that can be used to add save data to games, different games use different save types.

@invertego
Copy link
Contributor

invertego commented Jan 6, 2023

Okay, so it appears the ares auto-save feature is interfering with eeprom size detection. If an auto-save occurs before the real eeprom size (64 bytes) is detected, then a size of 16 KiB gets baked in when it's flushed to disk.

At the moment this can be worked around by deleting the broken eeprom file and disabling the auto-save option.

So, I decided to rename the .eeprom file the game creates to a .flash file. I launched the game, tried to save, and it seemingly worked in letting the game save data to a slot.

This is a red herring. The flash file will be ignored by ares because it (correctly) detects the game uses an eeprom for saves. What likely happened is:

  1. Renaming the broken eeprom file prevented it from being found by ares.
  2. (Speculation) You selected "load game" on the main menu before there was time for an auto-save to be made (30 seconds after load). Opening the load game screen will trigger the eeprom size detection and thereby avoid triggering the bug, whereas going straight into a new game guarantees that an auto-save will occur before you reach the first opportunity to trigger a save in-game.

Edit: On further inspection, it looks like saving works even with an incorrectly sized eeprom file, but only until you reload the game. This is because the wrong eeprom size only throws a wrench in things when the file is loaded.

@invertego
Copy link
Contributor

I think there's an additional bug here. Detected save size should be 512 bytes, not 64...

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

Successfully merging a pull request may close this issue.

3 participants