Author Topic: Megadrive SRM Saving issue..getting closer to solving..  (Read 3880 times)

Offline gliitch

  • Baby Retrode
  • *
  • Posts: 13
  • Karma: +0/-0
    • View Profile
Re: Megadrive SRM Saving issue..getting closer to solving..
« Reply #15 on: 29/Oct/2016 02:11:46 PM »
I have just tried testing saving to an  EU cart from an US rom, with Phantasy Star IV. It works, & reads back as if you were playing from a cartridge from your own region. I think its because it's copied straight to the cart itself, without any checks, so provided you have a matching SRM name ie: PhantasyStarTheEnd7FC0 which then matches the bin file on the cart itself, i dont see any reason as to why it wouldn't work.


  I also got a downloaded save to work, turns out i don't think i left it long enough in the retrode to copy properly  :-[ But its awesome that we finally have saving SRM working :D also, you can use games with game genie codes & it will still save your progress, you'll just have to reinput the codes in the emulator.
« Last Edit: 29/Oct/2016 02:15:32 PM by gliitch »

Offline Nori

  • Junior Retrode
  • **
  • Posts: 39
  • Karma: +0/-0
    • View Profile
Re: Megadrive SRM Saving issue..getting closer to solving..
« Reply #16 on: 30/Oct/2016 08:18:05 PM »
Oh my gosh. I can't wait to try this out. This sounds like the holy grail of updates for Genesis/Megadrive fans such as myself!

What file sizes were you working with gliitch? Real Genesis srams appear to be 32 but emulators I use give me 64 kb srams. So does the new update allow the Retrode to correctly rewrite the file size into a 32kb sram?

For what it's worth I've encountered that Phantasy Star IV (US copy) problem back when I first bought the Retrode. I thought it was my battery that was dying, I had backed up my games prior to replacing all the batteries. What happened was save 1 and 3 were wiped. Fortunately all three were close to each other so not much was lost with just the second save. I've never had any other oddity like that with the retrode on the SNES or any other Genesis game.
« Last Edit: 30/Oct/2016 08:22:16 PM by Nori »

Offline gliitch

  • Baby Retrode
  • *
  • Posts: 13
  • Karma: +0/-0
    • View Profile
Re: Megadrive SRM Saving issue..getting closer to solving..
« Reply #17 on: 03/Nov/2016 02:16:16 PM »
The new update indeed allows for the carts to be read properly, there are still some issues (3rd save slot gets wiped) 1 & 2 are fine, Wannado is on the right track, i can't really speak for genesis owners such as yourself, but for me Phantasy Star 3 / 4 & Shining Force save as they should. The save issue isn't just specific to Phantasy Star 4 but also Shining Force also.

I don't see why Genesis carts would be any differrent. I thought it maybe an issue with the size of the game but Wannado, who is far more knowlegeable about these things would know. He will probably ask you to send him some Genesis save files.

SNES were working from the start i think, at least thats what most people said, it was always just the megadrive that posed a problem. Let me know how it goes for you, as I've only got those 3 games that have SRAM saving, it would be interesting to know if Sonic 3 works, that is if you have it? :)

Offline Wannado

  • Junior Retrode
  • **
  • Posts: 96
  • Karma: +13/-0
    • View Profile
Re: Megadrive SRM Saving issue..getting closer to solving..
« Reply #18 on: 06/Nov/2016 03:30:53 PM »
What file sizes were you working with gliitch? Real Genesis srams appear to be 32 but emulators I use give me 64 kb srams. So does the new update allow the Retrode to correctly rewrite the file size into a 32kb sram?

The cartridge has a 16 bit data bus, but some (many?) games are using only half of it for SRAM.

Most(?) emulators don't seem to care and just pretend that the whole data bus is used. So for each real SRAM byte, they store an unused byte (hex value FF) next to it. This makes the emulator's save file twice as large as the cartridge's SRAM.

In such a case, you must set "[segaSram16bit] 1" in RETRODE.CFG. For more details, see reply #14.

Offline Wannado

  • Junior Retrode
  • **
  • Posts: 96
  • Karma: +13/-0
    • View Profile
Re: Megadrive SRM Saving issue..getting closer to solving..
« Reply #19 on: 13/Nov/2016 11:57:44 PM »
I just noticed that v0.20 beta still has a bug in the size computation for MegaDrive/Genesis savegame files (*.srm).

The computed size is one byte too small in many cases, so that the last byte of SRAM is not read or written. If the missing byte is relevant to the game, effects may range from subtle changes to wiping a save slot or the whole save data.

For example, this may be the reason why the third save slot of Phantasy Star IV and Shining Force was wiped in gliitch's tests (see replies #14 and #17 in this thread).

Offline Nori

  • Junior Retrode
  • **
  • Posts: 39
  • Karma: +0/-0
    • View Profile
Re: Megadrive SRM Saving issue..getting closer to solving..
« Reply #20 on: 14/Nov/2016 07:48:10 PM »
Great find. Unlike Glitch, in my tests of transferring an existing srm obtained through an emulator to the cart still doesn't work. Although with v0.20 I now get a message notifying me that the cartridge doesn't have the room for the srm (which is two times larger than regular srm's sitting at 64kb instead of 32kb).

Offline Wannado

  • Junior Retrode
  • **
  • Posts: 96
  • Karma: +13/-0
    • View Profile
Re: Megadrive SRM Saving issue..getting closer to solving..
« Reply #21 on: 11/Dec/2016 03:05:11 PM »
Once again sorry for the delay. I wasn't able to do much in the past few weeks.

Anyway, the emulator that Nori is using seems to always store the full contents of the address range from 0x200000 to 0x20FFFF1, regardless of what part of that range is really populated with SRAM (according to the ROM header). So srm files written by that emulator are always 64 kiB in size.

I'm adding support for this save format to the firmware (will be v0.21 beta). It will be selected by setting "[segaSram16bit] 2".

1 Note that I couldn't find out if there are any (commercial) games that put SRAM outside that address range, or if that would be possible at all. The ROM header would allow for it, and the address range assigned to the cartridge as a whole (including ROM and RAM) seems to be much larger.

Offline Nori

  • Junior Retrode
  • **
  • Posts: 39
  • Karma: +0/-0
    • View Profile
Re: Megadrive SRM Saving issue..getting closer to solving..
« Reply #22 on: 25/Dec/2016 09:39:26 AM »
Wannado you are amazing. Can't wait to try that out in the next version. :D

Offline Wannado

  • Junior Retrode
  • **
  • Posts: 96
  • Karma: +13/-0
    • View Profile
New firmware beta: v0.21-beta
« Reply #23 on: 26/Jan/2017 11:16:33 PM »
Here it is, f i n a l l y.

I only tested it on the Retrode 2 with a few games (GB, SNES) and an N64 Mempak.

As always, see the enclosed readme.txt for details.

Offline Nori

  • Junior Retrode
  • **
  • Posts: 39
  • Karma: +0/-0
    • View Profile
Re: New firmware beta: v0.21-beta
« Reply #24 on: 01/Feb/2017 08:38:04 AM »
Here it is, f i n a l l y.

I only tested it on the Retrode 2 with a few games (GB, SNES) and an N64 Mempak.

As always, see the enclosed readme.txt for details.

Fantastic! Can't wait to try it out!

Unfortunately when I try to download the file for the Retrode 2 I get this message:
"File could not be saved, because the source file could not be read."

If I force download it I have it visible on the desktop but it tells me the file is either damaged or corrupted. :(

EDIT: Nevermind, a few minutes later it worked! I'm going to try this out at my first break tomorrow (right about to pass out for the night). :)
« Last Edit: 01/Feb/2017 08:40:48 AM by Nori »

Offline Nori

  • Junior Retrode
  • **
  • Posts: 39
  • Karma: +0/-0
    • View Profile
Re: Megadrive SRM Saving issue..getting closer to solving..
« Reply #25 on: 01/Feb/2017 04:50:39 PM »
It WORKS!

Using SegaSram16bits set to "2" everything I've sent to it worked. You can even change it back to "1", restart the Retrode, and get the save converted to a regular sized file.

It's absolutely amazing. Now the Retrode does both the SNES and Megadrive/Genesis save transferring absolutely flawlessly. It's perfection.

Thank you so much Wannado for your hard work and perseverance at solving what appeared to be, or at least that we thought, was a nearly unsolvable issue. You're the greatest!

So with this issue now solved, what's your next priority with regards to the Retrode? :)
« Last Edit: 01/Feb/2017 04:52:36 PM by Nori »