MiSTer-devel / MegaDrive_MiSTer

Sega Megadrive for MiSTer
44 stars 14 forks source link

EEPROM Saves Unsupported #6

Closed Dinierto closed 9 months ago

Dinierto commented 10 months ago

Much like the previous Genesis/Megadrive core, EEPROM saving is unsupported. I'm not sure how much room is left for added features, but this would be a good one to make the core more "complete"

bootsector commented 10 months ago

Following this! This awesome core really deserves this! ❤️

Sheeg commented 9 months ago

Issue on Genesis core, for more info on affected games and temporary workarounds. Would love for this to get implemented finally!

https://github.com/MiSTer-devel/Genesis_MiSTer/issues/171

Damedade commented 9 months ago

Unsupported games

Barkley: Shut Up and Jam! 2 (EEPROM) Blockbuster World Videogame Championship II (NBA Jam T.E. portion) (EEPROM) Brian Lara/Shane Warne Cricket (Europe/Australia exclusive title) (EEPROM) College Slam (EEPROM) Evander "Real Deal" Holyfield Boxing (EEPROM) Frank Thomas Big Hurt Baseball (EEPROM) Greatest Heavyweights of the Ring (EEPROM) Mega Man: The Wily Wars (Europe uses EEPROM, Japanese release uses SRAM) Micro Machines '96 (Europe exclusive title) (EEPROM) Micro Machines 2 (Europe exclusive title) (EEPROM) Micro Machines Military (Europe exclusive title) (EEPROM) NBA Jam (EEPROM) NBA Jam Tournament Edition (EEPROM) NFL Quarterback Club (EEPROM) NFL Quarterback Club '96 (EEPROM) NHLPA Hockey '93 (EEPROM) Rings of Power (EEPROM) Sports Talk Baseball (EEPROM) Unnecessary Roughness '95 (EEPROM) Wonder Boy in Monster World (EEPROM)

bootsector commented 9 months ago

EEPROM support has just been added to the core! Please test with the latest release by the time it’s available.

Damedade commented 9 months ago

EEPROM support has just been added to the core! Please test with the latest release by the time it’s available.

Will do.

Damedade commented 9 months ago

I tested Rings of Power and the save only survives soft reset if you reload the core the save is gone.

Using MegaDrive_20230904.rbf

RoP_Save_Error

Enabled Autosave: ON in the BRAM option and that seemed to save it when opening the OSD. Not the most intuitive way but it is better than not working, I would hate to be the guy that forgets to effectively "double save" saving in game then saving out game. Maybe Autosave should be defaulted to ON unless there is a technical reason for it to be defaulted to OFF.

MP2E commented 9 months ago

Just tried rings of power and it works for me, try this rbf:

https://github.com/MiSTer-devel/MegaDrive_MiSTer/files/12513901/MegaDrive_20230904.zip

also make sure to go to core menu and save backup ram before switching games/cores or turning off the system

Damedade commented 9 months ago

Just tried rings of power and it works for me, try this rbf:

https://github.com/MiSTer-devel/MegaDrive_MiSTer/files/12513901/MegaDrive_20230904.zip

also make sure to go to core menu and save backup ram before switching games/cores or turning off the system

Yep, I just tried that. I could see a lot of people getting caught out by this who are not familiar with the Mega Drive. Maybe the menu could be clearer on this as I don't think of BRAM (battery back up RAM as the same as EEPROM (electrically erasable programmable ROM)

Dinierto commented 9 months ago

Just tried rings of power and it works for me, try this rbf: https://github.com/MiSTer-devel/MegaDrive_MiSTer/files/12513901/MegaDrive_20230904.zip also make sure to go to core menu and save backup ram before switching games/cores or turning off the system

Yep, I just tried that. I could see a lot of people getting caught out by this who are not familiar with the Mega Drive. Maybe the menu could be clearer on this as I don't think of BRAM (battery back up RAM as the same as EEPROM (electrically erasable programmable ROM)

Yes, I agree, in fact I didn't know any of this until just now and I owned a Genesis :)

KremlingKuthroat19 commented 9 months ago

Just tried rings of power and it works for me, try this rbf:

https://github.com/MiSTer-devel/MegaDrive_MiSTer/files/12513901/MegaDrive_20230904.zip

also make sure to go to core menu and save backup ram before switching games/cores or turning off the system

Can confirm with this build that it works! Tested this with College Slam. Created a few characters on Georgetown, saved by pulling up the OSD, loaded another core and then loaded College Slam and my created characters are saved there.

wwark commented 9 months ago

Life on Mars shows this screen. 20230904_233439-Life on Mars (World) (Aftermarket) (Unl) We need to use SRAM patch for playing it.

sorgelig commented 9 months ago

It looks like very new homebrew. May be developer of game or someone who has this game will add support.

sorgelig commented 9 months ago

upd. There are 2 versions of this game - both looks like working. Saves aren't supported for this game. I have no info what mapper it uses and what type of backup memory.

Sheeg commented 9 months ago

Can confirm that saving is now working in Wonder Boy in Monster World, awesome stuff, thanks so much!

birdybro commented 9 months ago

Yep, I just tried that. I could see a lot of people getting caught out by this who are not familiar with the Mega Drive. Maybe the menu could be clearer on this as I don't think of BRAM (battery back up RAM as the same as EEPROM (electrically erasable programmable ROM)

This is the same in every console core that had some kind of saving across MiSTer. NES/SNES/Gameboy/etc... - You can enable autosave, but you still have to open the OSD to reflect the game save in sd card storage.

Damedade commented 9 months ago

Probably not super helpful but Life on Mars uses FRAM I believe, Although looking at this PCB it seems multipurpose and the points seem unpopulated which are for enabling it I assume?

LifeOnMarsBeveledPCB

sorgelig commented 9 months ago

Probably not super helpful but Life on Mars uses FRAM I believe, Although looking at this PCB it seems multipurpose and the points seem unpopulated which are for enabling it I assume?

I see only flash memory used as ROM. There is no other chips on board. So it's a question if game supports backup or not. May be it writes directly to flash?

sorgelig commented 9 months ago

As far as i see from disassembling, Life On Mars SRAM fix version has been patched to use SSF2 mapper which should work correct with saves in MD core.

bootsector commented 9 months ago

@sorgelig could you please post md5 of the SRAM patched version? Thanks!

sorgelig commented 9 months ago

ad28c5041627f7fcd2604d9a32466d8a3000765ce1cc05065fc74dccdaf8e90f *Life On Mars.md

I've tested. Saves work fine.

bootsector commented 9 months ago

Confirmed that the SRAM patched version of Life on Mars works on MiSTer!

Damedade commented 9 months ago

I can confirm the patched ROM works too. Hopefully going forward the original ROM can be properly supported rather than relying on a hack/fix. This will just keep cropping up as these kind of hacks and fixes are not included in sets.

sorgelig commented 9 months ago

Supporting flash saving just for a single game is just unneeded complexity for core. And it's very custom, so there won't be games using exactly the same flash and address of saving.

I hope devs will start to sell their ROMs adopted for existing mappers like SSF2.

Nigoli commented 9 months ago

Mega Man: The Wily Wars (Europe uses EEPROM, Japanese release uses SRAM)

Japanese also uses EEPROM. The No-Intro dump of it is a mislabeled SRAM patched version of the game.

https://circuit-board.de/forum/index.php/Thread/14676-Br%C3%A4uchte-Hilfe-bez%C3%BCglich-Echtheit-Rockman-Mega-World-MD/

https://www.emu-land.net/forum/index.php/topic,70879.msg1073125.html?PHPSESSID=bd08gf4ubrt4aj0gk0senus2f5#msg1073125

https://github.com/SmokeMonsterPacks/Mega-Sg-Jailbreak/issues/27

sorgelig commented 9 months ago

Japanese also uses EEPROM. The No-Intro dump of it is a mislabeled SRAM patched version of the game.

both versions are listed in core as EEPROM games and already should work with saves.

Nigoli commented 9 months ago

both versions are listed in core as EEPROM games and already should work with saves.

All of 3 regions that were EEPROM enabled didn't work for me on the latest unstable 230910. The Japanese one that's "Alt 1" from No-Intro should be EEPROM enabled. (520d081a450b5e9f127369e6ec1be43e) I had Autosave and loaded the menu each time before reset and reloading the core.

The (U) one was also the one from the Genesis Mini.

I also tried Greatest Heavyweights (U) as a test and that worked fine compared to these.

sorgelig commented 9 months ago

it's unclear when Megaman saves and how to see if saves work. I need instructions how to check.

bootsector commented 9 months ago

Can anyone confim if it works in GenplusGx?

https://github.com/ekeeke/Genesis-Plus-GX/blob/c3f02f9c9059e7f4898dd73feac57ef610e22db0/core/cart_hw/eeprom_i2c.c#L129

sorgelig commented 9 months ago

Can anyone confim if it works in GenplusGx?

MD core uses eeprom code from Genesis Plus Gx, actually.

sorgelig commented 9 months ago

i want to download this save: https://www.thetechgame.com/Downloads/id=221204/mega-man-the-wily-wars-game-save.html

unfortunately site doesn't send me verification e-mail.

Nigoli commented 9 months ago

it's unclear when Megaman saves and how to see if saves work. I need instructions how to check.

You have to beat a Boss and then it asks you if you want to save to one of the 3 files.

https://mega.nz/file/PeRhlIiC#xV2QnqPOiVH08CzJaWotqaJOA_jUsMXjQFslpNXIIeU

I made these some years ago. Not sure if the file structure would be Mister compatible.

sorgelig commented 9 months ago

How to notice if save is loaded? Is there some info in game i can see?

bootsector commented 9 months ago

i want to download this save: https://www.thetechgame.com/Downloads/id=221204/mega-man-the-wily-wars-game-save.html

unfortunately site doesn't send me verification e-mail.

mega-man-the-wily-wars-europe-1-221204.zip

Nigoli commented 9 months ago

How to notice if save is loaded? Is there some info in game i can see?

Whichever boss you've beaten in each game should be darkened out if you've beaten them if the game was saved.

sorgelig commented 9 months ago

Ok. I see now in MiSTer save has some missing bytes. Will investigate it.

birdybro commented 9 months ago

Can anyone confim if it works in GenplusGx?

https://github.com/ekeeke/Genesis-Plus-GX/blob/c3f02f9c9059e7f4898dd73feac57ef610e22db0/core/cart_hw/eeprom_i2c.c#L129

Important to note, gpgx's official version is for the Wii only. The libretro version uses a totally different saving format for the purposes of rewinding in the core to work, which gpgx later added backward compatibility for with some detection in case people transferred saves to it.

sorgelig commented 9 months ago

There is something weird in Megaman EEPROM access. It does following in group of 4 bytes: it reads 3rd and 4rth bytes from EEPROM and then save all 4 bytes where 1st and 2nd can be updated but 3rd and 4th are always from eeprom..

I wonder if Genesis GX really supports saves for this game.

birdybro commented 9 months ago

@ekeeke - Maybe you know something different about the Megaman Wily Wars EEPROM saving vs Wonderboy in Monster World behavior? genesis-plus-gx seems to treat them both the same in terms of mapping. I don't have a modded Wii so I can't test your original core the way it's intended and I know that libretro cores often have modified saving behavior.

sorgelig commented 9 months ago

Megaman tests i2c bus against grounded SCL pin and goes to completely different routines. May be Megaman supports EEPROM and for example SRAM depending on cartridge PCB?

sorgelig commented 9 months ago

Looks like SPI memory as an option.

ekeeke commented 9 months ago

Maybe you know something different about the Megaman Wily Wars EEPROM saving vs Wonderboy in Monster World behavior? genesis-plus-gx seems to treat them both the same in terms of mapping.

Yes, they are supposed to use same mapper. I think I confirmed it back then when I first added i2c eeprom support in gpgx by checking the writes/reads done by the game on startup to upper cartridge area (0x200000-0x3fffff) and they were the same as those done with other games using Sega i2c mapper (and were correctly initiating read operations in my i2c eeprom code).

You can also see it from PCB, which although not the same P/N, looks identical to the one used in Wonderboy 5 (the only difference being the addressable ROM size, 1MB for one vs 2MB for the other)

Megaman PCB: https://datomatic.no-intro.org/attachments%20-%20sources/Sega%20-%20Mega%20Drive%20-%20Genesis/20180314_012329_0818_pcb_front.png

Wonderboy 5 PCB: https://datomatic.no-intro.org/attachments%20-%20sources/Sega%20-%20Mega%20Drive%20-%20Genesis/20210924_065221_1549_pcb_front.JPG

I don't think I verified myself if saves were working in this particular game as I am not good enough to get very far in it but I am pretty sure others did.

I don't have a modded Wii so I can't test your original core the way it's intended and I know that libretro cores often have modified saving behavior.

There is no reason it shouldn't work in Retroarch, sram (or eeprom in that case) saves work the same (and should be compatible with other emulators or other platforms), it is only savestates that are a bit different in official libretro core but those have zero impact on sram or eeprom emulation.

sorgelig commented 9 months ago

Ok. i fixed it. Wasn't good idea to clone SDA to all bits. It was triggering the other option (SPI?) for memory. I need to test other eeprom games and then will push it.

sorgelig commented 9 months ago

I think all official EEPROM equipped carts are supported now.