ROM-Reader for Super Nintendo / Super Famicom Game Cartridges

If anyone wants to dump SDD-1 carts (Star Ocean or Street Fighter Alpha/Zero 2), then you must enable verifySORead. Set verifySORead=1 in the code. Otherwise, the dump will have random corrupt bytes. The dump will take longer but it will produce a proper dump.

To dump Street Fighter Alpha/Zero 2, changes need to be made to the dump code. It requires the same dumping setup as Star Ocean. Street Fighter Alpha/Zero 2 is romChips=67.

if ((romChips != 67)&&(romChips != 69))
...
	if(romChips==69)
	{
	    romSize = 48;
 	    numBanks = 96;  //HiROM banks
 	}
 	// Street Fighter Alpha/Zero 2
 	else if(romChips==67)
	{
	    romSize = 32;
 	    numBanks = 64;  //HiROM banks
 	}

I also found that sanni's calc_checksum needed an addition to handle Star Ocean (and Tales of Phantasia):

    // Star Ocean/Tales of Phantasia Fix 6MB (48Mbit)
    else if (calcFilesize == 48) {
      // Add the 4MB (32Mbit) start
      for (unsigned long j = 0; j < 4194304; j++) {
        calcChecksum += myFile.read();
      }
      // Add the 2MB (16Mbit) end
      for (unsigned long j = 0; j < 2097152; j++) {
        calcChecksumChunk += myFile.read();
      }
      calcChecksum +=  2 * calcChecksumChunk;
    }

One last change was to sanni's code that write/verify SRAM. There needs to be a delay in the dumpByte() code or the VERIFY.SRM will always be wrong. The problem is that any delay added to dumpByte() ripples through all routines that call it which greatly slows everything down.

My solution was a small modification to the readSRAM() code to fix the problem. The SRAM dumps and verifies quickly and now it does it properly.

  // Dump LoRom
  if (romType == 0) {
    dumpByte(112, 0, false); // Preconfigure to fix the corrupt 1st byte
    // Sram size
    long lastByte = (long(sramSize) * 128);
    for (long currByte = 0; currByte < lastByte; currByte++) { //startAddr = 0x0000
      myFile.write(dumpByte(112, currByte, false)); //startBank = 0x70; CS low
    }
  }

  // Dump HiRom
  else  if (romType == 1) {
     dumpByte(48, 24576, true); // Preconfigure to fix the corrupt 1st byte
    // Sram size
    long lastByte = (long(sramSize) * 128) + 24576;
    for (long currByte = 24576; currByte < lastByte; currByte++) { //startAddr = 0x6000
      myFile.write(dumpByte(48, currByte, true)); //startBank = 0x30; CS high
    }
  }