sanni / cartreader

A shield for the Arduino Mega that can back up video game cartridges.
GNU General Public License v3.0
2.23k stars 226 forks source link

Mario RPG SA-1 HiRom issue #781

Closed Slyazku closed 1 year ago

Slyazku commented 1 year ago

Well I have this bad identification of Super Mario RPG, it should be Lowrom. Dump works but CRC fails and I can't read rom file in an emulator. I use HWrev 5 and tried 2 diferent boards of SNES Cic and 2 different clock generators, one working perfectly on HW rev3 IMG_20230427_232342

sanni commented 1 year ago

The OSCR dumps SA1 as if it was HiROM.

That being said, SA1 code is still far from perfect. One thing you can try is to lower the clocks. A real SNES seems to run at only 5.3MHz for EXT and 2.6MHz for CPU clock when reading SA1:

sa1clocks

Change line 484

 if (i2c_found) {
    //Set clocks to standard or else SA-1 sram writing will fail
    clockgen.set_freq(2147727200ULL, SI5351_CLK0);
    clockgen.set_freq(357954500ULL, SI5351_CLK1);
    clockgen.set_freq(307200000ULL, SI5351_CLK2);
  }

to:

  if (i2c_found) {
    //Set clocks to standard or else SA-1 sram writing will fail
    clockgen.set_freq(536931800ULL, SI5351_CLK0);
    clockgen.set_freq(268465900ULL, SI5351_CLK1);
    clockgen.set_freq(307200000ULL, SI5351_CLK2);
  } 

Maybe it helps.

Also make sure you got Rev3 of the Six Slot Adapter or apply the fix for Rev1/Rev2.

Slyazku commented 1 year ago

Sorry for the late answer. Just wanted to let know the fix works perfectly, I can dump the Rom despite the CRC32 Error - Error Database Missing. Thanks !

sanni commented 1 year ago

Which fix you mean the hardware fix for Rev1/Rev2 or do you mean changing the code like shown above?

sanni commented 1 year ago

Duplicate of #734