Arduino Forum

Community => Exhibition / Gallery => Topic started by: MichlK on Apr 07, 2013, 03:51 pm

Title: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: MichlK on Apr 07, 2013, 03:51 pm
Hi Arduino community,

would you like to read the ROM-contents of your Super Nintendo / Super Famicom game cartridges?

Using an Arduino and some 74HC595 shift-out registers, you can build a game cartridge-reader. Schematics and source code are included (please login to get access to the attachments). It even reads the Japanese game cartridge "Star Ocean" (one of the few game cartridges that utilise the "S-DD1" chip for graphics compression).

Have fun & best regards,
Michael
PS: This is my first Arduino-based project and I am an amateur in electrical engineering - it may contain severe errors and blow up your entire equipment, but at least it worked fine for me without doing any damage to my equipment... :)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on May 06, 2014, 04:14 pm
I followed your instructions and build the dumper myself. It's working great.  :)
Did you ever implement sram reading?
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: MichlK on May 06, 2014, 08:11 pm
Nice!  :)

Sorry, I did never dump actual SRAM-data from my carts.

However, using the same sources as I did, you should be able to implement it quite easily:
1. Cartridge addressing scheme, i.e. which lines you have to set low / high to tell the cartridge that you want to read SRAM:
http://www.emulatronia.com/doctec/consolas/snes/sneskart.html#cartridgeaddressing
2. Code in Python for the Raspberry Pi by waterbury that includes SRAM-reading (just do a text-search for SRAM on this page):
https://github.com/waterbury/SNES-Pi/blob/master/MCP23017_CartReader/cart_reader.py
3. Reading SRAM-size and decoding Romtype (lorom / hirom) from the cart-header is already implemented in my code...

HTH  :) & best regards
Michael
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on May 08, 2014, 12:53 pm
With the help of the SdFat library and by changing "Serial.write(dumpByte(currBank, currByte));" to "myFile.write(dumpByte(currBank, currByte));" it was very easy to dump the rom to an SD card instead of sending it over serial to a PC.
It takes 12.5 minutes for a 1MB LoROM/SlowROM game compared to 18 minutes over serial.
And 100 minutes for a 8MB ExHiROM/FastROM.

You just got to love the arduino :)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: MichlK on May 08, 2014, 09:10 pm
Ah, nice speed boost!

Sorry, I am curious  ;) : Is it an Arduino Pro Mini and did you use the analog pins for SPI-communication to the sd card reader?

Best regards
Michael
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on May 08, 2014, 09:27 pm
Yes it's one of those $4 Arduino Pro Mini's from ebay with the Atmega328.
I'm using pins 10 to 13 for the SD card and the analog pins for the shift register.
Had to remove the debug features though because the Arduino IDE complained about low memory now that the SdFat lib is also in use.

Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: alkex on May 14, 2014, 11:52 am
Hi Guys!

@MichlK: Thanks for posting this project, I have been fantasizing over a snes hardware sampler for ages!

I ordered the parts to make your reader and have already been studiying how the audio is stored. Hope to parse the rom and dump the samples onto an sd to play back afterwards via midi.

This is going to be fun and exciting! I'll definitely keep you posted

Thanks again,
Alex
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on May 30, 2014, 06:42 pm
I played a little bit more with your code as a base  :smiley-mr-green:

(http://i.imgur.com/nOeDbZI.jpg)

(http://i.imgur.com/TQ0dNpd.jpg)


Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: MichlK on Jul 06, 2014, 10:28 pm

I played a little bit more with your code as a base  :smiley-mr-green:


Wow - amazing what you have done there! 8) Thanks for sharing!!!

Best regards
Michael
PS: From Chrono Trigger to EarthBound - the dumper is in very good company... ;)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: tylau0 on Sep 01, 2014, 02:30 am
I also follow the instruction and have my dumper done successfully. Thanks for the sharing!

I am extending my code to support carts with SPC7110, with partial success -- I can read most of the ROM data correctly, but have to be done by parts.

SPC7110 is a special chip that appears in a few SNES carts in 1995-1997. Carts with this chip features a 8Mb program ROM and a variable-size data ROM. In Far East of Eden Zero (Tengai Makyo Zero), the size of the data ROM is 32Mb.

A few things that we need to know in order to read the data from the ROMs.


For some unknown reason, my reader fails to write the registers most of the time. I need to take the following alternative approach.


1)    Upload and run the unlock0 script which just makes sure we have correct initial register values. Once you start running the script, open the Serial Monitor. If the program says 0x4844-0x4841 are not of values 0, 2, 1, 0, close the serial monitor, disconnect, reconnect the Arduino USB/power and open the serial monitor again.
2)    Without disconnecting the Arduino power, upload and run the read0 script. This time, use a terminal console to obtain the data stream from Arduino. This gives you the program ROM and the 1st 8Mb of the data ROM data. Note you may need to manually edit the two hex starting at 00100000 to 01.
3)    Upload and run the unlock1 script which just unlocks the cart, without changing the register at 0x4833. Once you start running the script, open the Serial Monitor. If the program says 0x4844 is not of value 7, close the serial monitor, disconnect, reconnect the Arduino USB/power and open the serial monitor again. Only when the program says the value is 7, we are sure the unlock sequence has been successfully written and the data ROM unlock.
4)    Without disconnecting the Arduino power, upload and run the read1 script. This time, use a terminal console to obtain the data stream from Arduino. This gives you the 2nd and 3rd 8Mb of the data ROM data. Note that you may need to manually edit the two hex at the beginning to 20.
5)    Upload and run the unlock2 script which unlocks the cart and changes the register at 0x4833 to 3. Once you start running the script, open the Serial Monitor. If the program says 0x4844 is not of value 7, close the serial monitor, disconnect, reconnect the Arduino USB/power and open the serial monitor again. Only when the program says the value is 7, we are sure that the data ROM has been unlocked. The program should also say the value of the 0x4833 register is 3.
6)    Without disconnecting the Arduino power, upload and run the read2 script. This time, use a terminal console to obtain the data stream from Arduino. This gives you the program ROM and the last 8Mb of the data ROM data. Note that you may need to manually edit the two hex at the beginning to BF.
7)    Use some program to join the file obtained in the above steps. Now you should have got the complete ROM.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: MichlK on Sep 28, 2014, 09:53 am


I am extending my code to support carts with SPC7110, with partial success -- I can read most of the ROM data correctly, but have to be done by parts.
...
For some unknown reason, my reader fails to write the registers most of the time. I need to take the following alternative approach.
...


Very cool - SPC7110 support - thanks for sharing!  :)

I do not own a cart with the SPC7110 (let alone the legendary Far East of Eden Zero ;)) but as far as I can think of, there may be two reasons for the problem with writing the registers:
1. I often had the problem that the connection between the socket for the cart and the jumper wires was not good enough, so I put a folded sheet of paper between the two rows of the jumper wires to improve connectivity...
2. I do not know, which timing is expected when sending the unlock codes (needs to be clocked???). Maybe a small delay between sending each byte could help? Switching between 0x00 and 0x80 would not necessarily mean that a specific timing is necessary, but as the sequence includes two consecutive 0x80, I wonder if there is a specific timing and/or if you e.g. can read the registers in between the sequence and the value changes shortly after you write to it, so you know that you can send the next byte...

Just my 2 cents...

Best regards
Michael
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: starkes on Oct 19, 2014, 08:11 am
Hey guys

Made one of these, works pretty good. Can't seem to dump some common games like mario kart, mario world, pilotwings, and a few others but works pretty good for the rest of them. I haven't really looked into it yet, if anybody knows whats up with that let me know.

Anyways. I managed to get it to go quite a bit faster.

I cut the code down a bit, took out the delays (the snes would read from the cart way faster than the arduino, seems to work) and I used the fastDigitalWrite and fastDigitalRead functions I found here (https://code.google.com/p/digitalwritefast/downloads/list) which are closer to bare port manipulation than the stock digitalRead and digitalWrite. A bunch of things are changed from variables to defines so that the pins have fixed values at compile time. To make the fastDigital functions work right.

So far it looks like it takes 177s (2m 57s) to dump a 1mb cart, where before it was taking 1113s (18m 33s). About 6x faster.

I made a little python program for it too that makes it a little easier to work with and shows progress as it dumps. It doesn't start dumping automatically now, it waits for "R" to be sent to it. So the python program can tell it to dump or do other things, like "I" to just give you cart info or read/write SRAM (which is what I plan to do next, has anyone done this with theirs yet?). You can swap cartridges without unplugging because it'll always be idle without the computer telling it to do something.

If anyone wants the code let me know. It's a bit of a mess.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Nov 09, 2014, 03:16 pm
Here is my current version of MichlK's code, it's a shield for an Arduino Mega.
The rom gets saved to an SD card. You can also read/write save files to the SRAM, display information about the cartridge on the LCD or calculate the checksum of your rom dump.

(http://i.imgur.com/Zyaleba.jpg)(http://i.imgur.com/CoeApzO.jpg)
(http://i.imgur.com/jqUQspy.jpg)(http://i.imgur.com/waLH8GV.jpg)

You control it using the push button on the left. One click moves the selection down, a double click moves it up and a long press executes the current menu option.

I used this Prototype PCB from ebay item # 201205316404 (you need to cut a trace on the top of the pcb leading from the switch to the reset pin)
That SD module from ebay item # 290901349431
And a white 0.96" IIC I2C 128X64 OLED LCD from ebay item # 291216700457

I also incorporated the DigitalIOPerformance lib now and dumping an 1MByte (8Mbit) LoRom game takes 62 seconds while dumping a 4Mbyte (32Mbit) HiRom game takes 4 minutes and 10 seconds.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Mar 10, 2015, 08:48 am
Success!

I finally finished building a duplicate of sanni's cart reader.  The hardest part was finding the cart connector (aside from waiting on parts from China). 

If anyone needs a SNES cart connector, I located a Centronic 46P connector.  I contacted a distributor and found out that they sell on eBay.  The seller is wonderco_buy and they added the part listing "Industrial Card Edge Slot Socket Connector 23x2P 46P 2.54mm 0.1" 3A".  Shipping to the US from Taiwan is fast (less than a week).

I want to thank MichlK and sanni for all of their help with this project!
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Mar 15, 2015, 11:29 pm
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.

Code: [Select]
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):

Code: [Select]
    // 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.

Code: [Select]
  // 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
    }
  }
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Mar 15, 2015, 11:38 pm
I forgot one last addition to sanni's code in dumpROM().  The original code is missing the dumpedBytes++ at the end of the Star Ocean section:

Code: [Select]
       // Dump the bytes to SD one by one
        for (long currByte = 0; currByte < 65536; currByte++) {
          do {
            currDumpedByte = dumpByte(currBank, currByte, false);
            if (verifySORead)
              currDumpedByteVerify = dumpByte(currBank, currByte, false);
            else
              currDumpedByteVerify = currDumpedByte;
          }
          while (currDumpedByte != currDumpedByteVerify);
          myFile.write(currDumpedByte);
          dumpedBytes++;
        }


Fixed a bug in getCartInfo() where a checksum byte with upper nibble of 0 has the zero dropped.  This resulted in erroneous checksum error messages.

Code: [Select]
  // Get Checksum as string
  sprintf(checksumStr, "%02X%02X", dumpByte(0, 65503, false), dumpByte(0, 65502, false));
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Apr 25, 2015, 07:56 am
Added code to dumpROM() for CX4 carts.  Actually only really needed for Mega Man/Rockman X2.

Code: [Select]
  if ((romChips != 67)&&(romChips != 69)&&(romChips != 243)) {
...

  else if(romChips == 243){
  // CX4 - Mega Man X2/Mega Man X3/Rockman X2/Rockman X3: romChips = 243
    display.println("Dumping LoROM");
    display.print("Banks: ");
    display.println(numBanks);
    display.display();

    // Check initial content of mapping register...
    // Mega Man/Rockman X2 should return 1, Mega Man/Rockman X3 should return 0
    byte initialCX4Map = dumpByte(0, 32594, false); //0x7F52
     
    // Mega Man/Rockman X2 needs to be set to 0 before dumping
    setByte(0, 32594, 0);  //0x7F52

      // Read up to 96 banks starting at bank 0×00.
    for (int currBank = 0; currBank < numBanks; currBank++) {

      // give status updates via LCD or LED
      display.print(".");
      display.display();

      // blink led
      if (currBank % 2 != 0)
        rgbLed(off_color);
      else
        rgbLed(busy_color);

      // Dump the bytes to SD one by one
      for (long currByte = 32768; currByte < 65536; currByte++) {
        myFile.write(dumpByte(currBank, currByte, false));
        dumpedBytes++;
      }
    }
    // Return mapping register to initial setting...
    setByte(0, 32594, initialCX4Map);  //0x7F52
  }


credits to byuu (and waterbury) for the CX4 info
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on May 06, 2015, 08:13 am
Success!  I managed to enable reliable SPC7110 dumping (FEOEZ).  The dumping code runs all-inclusive (no switching back and forth) and works 100% of the time.   It requires a hardware addition and some changes to the code.

For the hardware addition, you need to add a 21.477272MHz clock signal to Pin 1.  I used the Adafruit Clock Generator module with the Si5351 chip (https://learn.adafruit.com/adafruit-si5351-clock-generator-breakout/overview) to generate the clock signal.  I wired the module up to the I2C with output to Pin 1 of the cart.  Adafruit has a library for the module but I used the Si5351Arduino library (https://github.com/etherkit/Si5351Arduino).

For the code, one big change and a bunch of small changes need to be made.  The big change is that you cannot use setByte() to set the SPC7110 registers - the timing is off.  The slower byte setting routine needs to be added.  sanni's setSRAMByte() code works to set the registers.  The small changes that need to be added are the SPC7110 register settings to fully unlock and dump the cart.  Most of the register changes are outlined in tylau0's code but there are a couple other settings that (may) need to be changed.

I'll clean up my code and post it sometime.

credits to caitsith2 for the SPC7110 unlocking details
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: MichlK on May 07, 2015, 09:07 am
Success!  I managed to enable reliable SPC7110 dumping (FEOEZ).  The dumping code runs all-inclusive (no switching back and forth) and works 100% of the time.   It requires a hardware addition and some changes to the code.
Never thought that this would be possible with an Arduino... :o Congratz & thanks for sharing!

Best regards
Michael
PS: Back in September last year, I ordered such a clock generator module myself - pretty handy stuff... :)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on May 08, 2015, 03:34 am
Thanks to you, Michael, for getting this started.  Time to add the clock generator to your reader setup!

In the process of trying to add SRAM read/write for FEOEZ, I came across a post by byuu that states that the SPC7110 unlock sequence is unnecessary.  I removed the unlock sequence from my code and the FEOEZ cart still dumps!  The key element is the Clock to Pin 1.  Without the clock, the register changes don't work.

I'll post the code once I figure out why my FEOEZ SRAM dumps are weird.  Anyone got a FEOEZ .srm file they care to share?  If not, I'll have to sit down and actually play this game for awhile.

EDIT:  Nevermind on the savefile.  I figured out why my SRAM dumps were bad - dying battery!  Pulled the old battery and put in a new battery + holder.  FEOEZ SRAM dumping works (well it actually always did just couldn't tell).  Going to add SRAM writes and then look at adding the RTC stuff.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on May 09, 2015, 11:20 am
Here's a logo for the LCD that I use during bootup:

Code: [Select]
//Nintendo Logo 104x16
static const unsigned char PROGMEM nintylogo [] = {
0xF0, 0x3C, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xC0, 0x00, 0x3C, 0xF0, 0x3C, 0xF0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xC0, 0x00, 0x42, 0xFC, 0x3C, 0xF0, 0x00, 0x0F, 0x00,
0x00, 0x00, 0x00, 0x03, 0xC0, 0x00, 0xB9, 0xFC, 0x3C, 0xF0, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x00,
0x03, 0xC0, 0x00, 0xA5, 0xFC, 0x3C, 0x00, 0x00, 0x3F, 0xC0, 0x00, 0x00, 0x00, 0x03, 0xC0, 0x00,
0xB9, 0xFC, 0x3C, 0x00, 0x00, 0x3F, 0xC0, 0x00, 0x00, 0x00, 0x03, 0xC0, 0x00, 0xA5, 0xF3, 0x3C,
0xF3, 0xCF, 0x0F, 0x0F, 0xF0, 0xF3, 0xC0, 0xFF, 0xC3, 0xFC, 0x42, 0xF3, 0x3C, 0xF3, 0xCF, 0x0F,
0x0F, 0xF0, 0xF3, 0xC0, 0xFF, 0xC3, 0xFC, 0x3C, 0xF3, 0x3C, 0xF3, 0xF3, 0xCF, 0x3C, 0x3C, 0xFC,
0xF3, 0xC3, 0xCF, 0x0F, 0x00, 0xF3, 0x3C, 0xF3, 0xF3, 0xCF, 0x3C, 0x3C, 0xFC, 0xF3, 0xC3, 0xCF,
0x0F, 0x00, 0xF0, 0xFC, 0xF3, 0xC3, 0xCF, 0x3F, 0xFC, 0xF0, 0xF3, 0xC3, 0xCF, 0x0F, 0x00, 0xF0,
0xFC, 0xF3, 0xC3, 0xCF, 0x3F, 0xFC, 0xF0, 0xF3, 0xC3, 0xCF, 0x0F, 0x00, 0xF0, 0xFC, 0xF3, 0xC3,
0xCF, 0x3C, 0x00, 0xF0, 0xF3, 0xC3, 0xCF, 0x0F, 0x00, 0xF0, 0xFC, 0xF3, 0xC3, 0xCF, 0x3C, 0x00,
0xF0, 0xF3, 0xC3, 0xCF, 0x0F, 0x00, 0xF0, 0x3C, 0xF3, 0xC3, 0xCF, 0x0F, 0xFC, 0xF0, 0xF0, 0xFF,
0xC3, 0xFC, 0x00, 0xF0, 0x3C, 0xF3, 0xC3, 0xCF, 0x0F, 0xFC, 0xF0, 0xF0, 0xFF, 0xC3, 0xFC, 0x00
};

void setup() {
...
  display.clearDisplay();
  display.drawBitmap(12, 24, nintylogo, 104, 16, 1);
  display.display();
  delay(1000);
...
}
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on May 09, 2015, 11:30 pm
Here's the Adafruit Clock Generator code:

Code: [Select]
//**********************************************************************************

// Adafruit Clock Generator
#include <si5351.h>

Si5351 clockgen;

//**********************************************************************************

void setup() {
...
  // Adafruit Clock Generator
  clockgen.init(SI5351_CRYSTAL_LOAD_8PF, 0);
  clockgen.set_pll(SI5351_PLL_FIXED, SI5351_PLLA);
  // Setup Clock Generator to 21.477272MHz
  clockgen.set_freq(2147727200ULL, SI5351_PLL_FIXED, SI5351_CLK0);
  clockgen.output_enable(SI5351_CLK0, 1);
  clockgen.output_enable(SI5351_CLK1, 0);
  clockgen.output_enable(SI5351_CLK2, 0);
...
}


Wire the Clock Generator to the I2C (along with power and ground) then connect CLK0 to Pin 1 on the cart.  If you're using only the center 46 pins then you'll need to add a connection to Pin 1.  I couldn't source a matching 8 pin (2x4) connector to add next to my 46 pin connector so I cut up a spare connector and added it to my sanni clone.

Edit:  If you're not using a version of sanni's code with the LCD, then you need to also add the I2C code (Wire.h):

Code: [Select]

// Adafruit Clock Generator
#include <Wire.h>
#include <si5351.h>

Si5351 clockgen;
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on May 11, 2015, 06:08 pm
Nice work yet again, this is getting better and better :)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on May 13, 2015, 01:13 pm
Here's the code changes to dump SPC7110 carts. 

I added SPC7110Check() to check the status of SPC7110 registers 0x4831-0x4834 which are the bank control registers.  setDataOut() and setDataIn() were added to wrap around the calls to setSRAMByte() when setting the SPC7110 registers. 

Code: [Select]

void SPC7110Check(){
    // Check content of mapping registers...
    // Initial values of 0x4831-0x4834 should be set to {0, 1, 2, 0}
    byte SPC7110Reg1 = dumpByte(0, 18481, false); //0x4831
    byte SPC7110Reg2 = dumpByte(0, 18482, false); //0x4832
    byte SPC7110Reg3 = dumpByte(0, 18483, false); //0x4833
    byte SPC7110Reg4 = dumpByte(0, 18484, false); //0x4834
    display.println("Register Settings:");
    display.print("0x4831: ");
    display.print(SPC7110Reg1);
    display.print(",");
    display.print(SPC7110Reg2);
    display.print(",");
    display.print(SPC7110Reg3);
    display.print(",");
    display.println(SPC7110Reg4);
    display.display();
}

void setDataOut(){
  pinMode(d0Pin, OUTPUT);
  pinMode(d1Pin, OUTPUT);
  pinMode(d2Pin, OUTPUT);
  pinMode(d3Pin, OUTPUT);
  pinMode(d4Pin, OUTPUT);
  pinMode(d5Pin, OUTPUT);
  pinMode(d6Pin, OUTPUT);
  pinMode(d7Pin, OUTPUT);
}

void setDataIn(){
  pinMode(d0Pin, INPUT);
  pinMode(d1Pin, INPUT);
  pinMode(d2Pin, INPUT);
  pinMode(d3Pin, INPUT);
  pinMode(d4Pin, INPUT);
  pinMode(d5Pin, INPUT);
  pinMode(d6Pin, INPUT);
  pinMode(d7Pin, INPUT);
 
  // Activate pull-up resistors for input-pins
  writeByteD(255);
  delay(400);
}


I changed romSizeExp in getCartInfo() since we use it to identify the different SPC7110 carts. 

Code: [Select]

void getCartInfo() {
...
  // Check RomSize
  romSizeExp = dumpByte(0, 65495, false); // 0xFFD7
  byte romSizeCalc = romSizeExp - 7;
  romSize = 1;
  while (romSizeCalc--)
    romSize *= 2;
  numBanks = (long(romSize) * 1024 * 1024 / 8) / (32768 + (long(romType) * 32768));
...
}


The dumpROM() routine adds new code to handle carts with romChips 245 and 249.  We'll have to ignore the other non-SPC7110 romChips 245 cart (Hayazashi Nidan Morita Shougi 2) for right now.

Code: [Select]

void dumpROM() {
...
  else if((romChips == 245)||(romChips == 249)){
    // SPC7110
    // Momotarou Dentetsu Happy/Super Power League 4: romChips = 245
    // Far East of Eden Zero: romChips = 249

    // Super Power League 4: 0x0B 
    // Momotarou Dentetsu Happy: 0x0C   
    // Tengai Far East of Eden Zero: 0x0D
    if (romSizeExp == 0x0B){
      romSize = 16;
      numBanks = 32;
    }
    else if(romSizeExp == 0x0C){
      romSize = 24;
      numBanks = 48;
    }
    else if(romSizeExp == 0x0D){
      romSize = 40;
      numBanks = 80;  //HiROM banks
    }
 
    display.println("Dumping HiROM");
    display.print("Banks: ");
    display.println(numBanks);
    display.display();

    display.clearDisplay();
    display.setCursor(0, 0);
    display.display();
    SPC7110Check();

// 0xC00000-0xDFFFFF
    display.println("Dumping 0xC0-DF");
    display.display();
    for(int currBank=192; currBank < 224; currBank++) {
      display.print(".");
      display.display();

      // blink led
      if (currBank % 2 != 0)
        rgbLed(off_color);
      else
        rgbLed(busy_color);
  for(long currByte=0; currByte < 65536; currByte++) {
      myFile.write(dumpByte(currBank, currByte, false));
      dumpedBytes++;
  }
    }

    if(numBanks > 32){
      display.clearDisplay();
      display.setCursor(0, 0);
      display.println("Unlocking SPC7110");
      display.display();
     
      setDataOut();
      // Set 0x4834 to 0xFF
      setSRAMByte(0, 18484, 255, false);
      setDataIn();
      SPC7110Check();

// 0xE00000-0xEFFFFF
      display.println("Dumping 0xE0-EF");
      display.display();
      for(int currBank=224; currBank < 240; currBank++) {
        display.print(".");
        display.display();
     
        // blink led
        if (currBank % 2 != 0)
          rgbLed(off_color);
        else
          rgbLed(busy_color);
    for(long currByte=0; currByte < 65536; currByte++) {
        myFile.write(dumpByte(currBank, currByte, false));
        dumpedBytes++;
    }
      }
         
      if(numBanks > 48){
// 0xF00000-0xFFFFFF
        display.println("");
        display.println("Dumping 0xF0-FF");
        display.display();
        for(int currBank=240; currBank < 256; currBank++) {
          display.print(".");
          display.display();
       
          // blink led
          if (currBank % 2 != 0)
            rgbLed(off_color);
          else
            rgbLed(busy_color);
      for(long currByte=0; currByte < 65536; currByte++) {
          myFile.write(dumpByte(currBank, currByte, false));
          dumpedBytes++;
      }
        }

        display.clearDisplay();
        display.setCursor(0, 0);
        display.display();
        display.println("Remapping Final Bank");
        display.display();
       
        setDataOut();
        // Set 0x4833 to 3
        setSRAMByte(0, 18483, 3, false);
        setDataIn();
        SPC7110Check();

// 0xF00000-0xFFFFFF
        display.println("Dumping 0xF0-FF");
        display.display();
        for(int currBank=240; currBank < 256; currBank++) {
          display.print(".");
          display.display();
       
          // blink led
          if (currBank % 2 != 0)
            rgbLed(off_color);
          else
            rgbLed(busy_color);
          for(long currByte=0; currByte < 65536; currByte++) {
          myFile.write(dumpByte(currBank, currByte, false));
          dumpedBytes++;
          }
        }
      }     
      // Return mapping registers to initial settings...
      setDataOut();
      setSRAMByte(0, 18483, 2, false); //0x4833: 0x2
      setSRAMByte(0, 18484, 0, false); //0x4834: 0x0
      setDataIn();
     }
  }
...
}


The code is tested with FEOEZ but I hope to test with the other SPC7110 carts (MDH and SPL4) soon.

The dumping process should show changes to the registers as they're set.  For FEOEZ, the 0x4831-0x4834 registers should go from {0,1,2,0} to {0,1,2,7} to {0,1,3,7} during the dumping process.  If the registers never change from {0,1,2,0}, then the clock signal is most likely not getting to Pin 1.

I'll post the Read/Write SRAM code next.  The RTC read code is working (I think).  I have to read the RTC documents to see how to interpret the data.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on May 13, 2015, 01:34 pm
Adafruit Clock Generator added to the sanni board.

(http://i.imgur.com/Xw6okmF.jpg?1)
(http://i.imgur.com/FAOKwWf.jpg?1)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on May 14, 2015, 10:07 am
Here's the SPC7110 Read/Write SRAM.  First, I made a change to romType in getCartInfo() to classify SDD1 and SPC7110 carts as HiROM.  I found it easier to handle the changes to read/write SRAM that way.  I should also get around to modify dumpROM() to reflect the romType change but since the existing code works, I'll wait to clean it up later.

Code: [Select]

void getCartInfo() {
...
  // Check if LoROM or HiROM
  romType = dumpByte(0, 65493, false); // 0xFFD5
  if ((romType == 0x32)||(romType == 0x3A)) // SDD1/SPC7110
    romType = 1;  //HiROM
  else
    romType = romType & 1; // 0xFFD5
...
}


Code was added to readSRAM() to enable the SRAM using register 0x4830.  The modifications to readSRAM() are in the Dump HiRom SRAM section:

Code: [Select]

void readSRAM (char* fileName, char* folder) {
...
  // Dump HiRom SRAM
  else if (romType == 1) {
    // SPC7110 SRAM
    if ((romChips == 245)||(romChips == 249)) {
      // Configure SPC7110 SRAM Register
      setDataOut();
      // Set 0x4830 to 0x80
      setSRAMByte(0, 18480, 128, false);
      setDataIn();

      dumpByte(48, 24576, false); // Preconfigure to fix the corrupt 1st byte
      // Sram size
      long lastByte = (long(sramSize) * 128) + 24576;
      display.println("HiROM SRAM");
      display.print("SRAM Size: ");
      display.println(lastByte);
    display.display();
      for (long currByte = 24576; currByte < lastByte; currByte++) { //startAddr = 0x6000
        myFile.write(dumpByte(48, currByte, false)); //startBank = 0x30
      }
      setDataOut();
      // Reset 0x4830 to 0x0
      setSRAMByte(0, 18480, 0, false);
      setDataIn();
    }
    else {
      dumpByte(48, 24576, true); // Preconfigure to fix the corrupt 1st byte
      // Sram size
      long lastByte = (long(sramSize) * 128) + 24576;
      display.println("HiROM SRAM");
      display.print("SRAM Size: ");
      display.println(lastByte);
    display.display();
      for (long currByte = 24576; currByte < lastByte; currByte++) { //startAddr = 0x6000
        myFile.write(dumpByte(48, currByte, true)); //startBank = 0x30; CS high
      }
    }
  }


I made similar changes to writeSRAM() also in the HiRom section:

Code: [Select]

void writeSRAM () {
...

// HiRom
      else if (sramSize != 0 && romType == 1) {
        // SPC7110 SRAM
        if ((romChips == 245)||(romChips == 249)) {
          // Configure SPC7110 SRAM Register
          // Set 0x4830 to 0x80
          setSRAMByte(0, 18480, 128, false);
         
          long lastByte = (long(sramSize) * 128) + 24576;
         
          display.print(sramSize / 8);
          display.println("Kb HiROM");
          display.println("Writing SRAM...");
          display.display();
         
          // Write to sram bank
          for (long currByte = 24576; currByte < lastByte; currByte++) { //startAddr = 0x6000
            setSRAMByte(48, currByte, myFile.read(), false); //startBank = 0x30
            // blink led
            if (currByte % 100 != 0)
              rgbLed(busy_color);
            else
              rgbLed(off_color);
            // Print Progess to LCD
            progress = currByte * 100 / lastByte;
            if ((progress - lastprogress) > 9) {
              display.print(".");
              display.display();
              lastprogress = progress;
            }
          }
          // Reset SPC7110 SRAM Register
          setDataOut();
          // Reset 0x4830 to 0x0
          setSRAMByte(0, 18480, 0, false);
          setDataIn();
        }
        else {
          long lastByte = (long(sramSize) * 128) + 24576;

          display.print(sramSize / 8);
          display.println("Kb HiROM");
          display.println("Writing SRAM...");
          display.display();
         
          // Write to sram bank
          for (long currByte = 24576; currByte < lastByte; currByte++) { //startAddr = 0x6000
            setSRAMByte(48, currByte, myFile.read(), true); //startBank = 0x30; CS high
            // blink led
              if (currByte % 100 != 0)
                rgbLed(busy_color);
              else
                rgbLed(off_color);
            // Print Progess to LCD
            progress = currByte * 100 / lastByte;
            if ((progress - lastprogress) > 9) {
              display.print(".");
              display.display();
              lastprogress = progress;
            }
          }
        }
      }
...
}


Coming up next:  the FEOEZ RTC reading code.  I've only done the read RTC code so far.  I'm not sure if the write RTC code is really necessary.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on May 14, 2015, 08:28 pm
Here's the FEOEZ RTC Read code.  I currently have the call to the RTC code at the end of printinfoGLCD().  The normal cart info is displayed then it checks to see if the cart is FEOEZ.  If the cart is FEOEZ, then it waits for a button press to clear the screen and read the RTC.

Code: [Select]

void printinfoGLCD() {
...
  if(romChips == 249) {
    wait();
    readRTC();
  }
}


I added two routines - showRTC() and readRTC().  readRTC() sets the SPC7110 registers to read the RTC and outputs the data to a file - rtc.ram.  showRTC() opens the rtc.ram file, interprets the data, and displays the date, time, and weekday on screen.

Code: [Select]

void showRTC() {
int   rtc_data[16];
int seconds;
int minutes;
int hours;
int day;
int month;
int year;

int   w;
char *weekday[7] =
        {
           "Sunday",
           "Monday",
           "Tuesday",
           "Wednesday",
           "Thursday",
           "Friday",
           "Saturday"
        };
  //open file on sd card
    if (!myFile.open("rtc.ram", O_RDWR | O_CREAT)) {
    rgbLed(error_color);
    display.println("SD ERROR");
    display.display();
    while (1);
  }

  for(int r = 0; r < 16; r++)
    rtc_data[r] = myFile.read();

  seconds = ((rtc_data[1] & 7)*10) + rtc_data[0];
minutes = ((rtc_data[3] & 7)*10) + rtc_data[2];
hours = ((rtc_data[5] & 3)*10) + rtc_data[4];
year =  rtc_data[11]*10 + rtc_data[10];
year += ( 1900 );
month = ((rtc_data[9] & 1)*10) + rtc_data[8];
day = ((rtc_data[7] & 3)*10) + rtc_data[6];

  display.print("DATE:  ");
  display.print(month);
  display.print("/");
  display.print(day);
  display.print("/");
  display.println(year);
  display.print("TIME:  ");
  display.print(hours);
  display.print(":");
  display.print(minutes);
  display.print(":");
  display.print(seconds);

  if((rtc_data[15] & 4) == 0) { //Check 12/24: 1 = 24H, 0 = 12H
  if((rtc_data[5] & 4) == 4) //If 12H, check PM/AM: 1 = PM, 0 = AM
    display.println(" PM");
  else display.println(" AM");
}
else display.println("");
w = (rtc_data[12] & 7);
  display.print("DAY:   ");
  display.println(weekday[w]);
  display.display();

  // Close the file:
  myFile.close();
}

void readRTC() {
  // Read FEOEZ RTC-4513 Chip

  //open file on sd card
    if (!myFile.open("rtc.ram", O_RDWR | O_CREAT)) {
    rgbLed(error_color);
    display.println("SD ERROR");
    display.display();
    while (1);
  }
  display.clearDisplay();
  display.setCursor(0, 0);

  // Signal beginning of dumping process
  display.println("Reading RTC Chip...");
  display.display();
 
setDataOut();
  // Enable RTC Chip:  0x4840: 0x1
  setSRAMByte(0, 18496, 1, false); //0x4840
  // Set RTC Chip to Read Mode:  0x4841: 0xC
  setSRAMByte(0, 18497, 0xC, false); //0x4841
  // Set RTC to Data Byte 0
  setSRAMByte(0, 18497, 0, false); //0x4841
setDataIn();

  for(int r = 0; r < 16; r++) {   
    // Check RTC Status:  0x4842
    dumpByte(0, 18498, false); //0x4842
    myFile.write(dumpByte(0, 18497, false)); //0x4841
  }
  // Disable RTC Chip:  0x4840: 0x0
  setDataOut();
  setByte(0, 18496, 0);
  setDataIn();

  // Close the file:
  myFile.close();

  showRTC();

  // Signal end of process
  rgbLed(success_color);
  display.println("Saved as rtc.ram");
  display.display();
}
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on May 16, 2015, 09:37 pm
Ran into an interesting problem while reading a new cart with my sanni clone.  I normally connect the reader thru a USB hub and have not had any problems reading/writing carts. 

I recently picked up a copy of F1 ROC II (Exhaust Heat) which is a Seta DSP (ST-010 chip) cart.  When I first connected the new cart to the reader, the reader could not detect the cart.  I modified the code to force dump all of the banks and they were all FFs.  I moved the reader to a different PC to run more extensive tests and found it dumped 100% with the original code.  The only difference was the direct USB connection vs the USB hub.  I moved the reader back to the original PC and bypassed the USB hub and it worked.

I should be getting the other Seta DSP/RISC carts (ST-011/ST-018) so I'll test those out.  If anyone has a cart that doesn't detect properly (or dumps all FFs), make sure your reader is connected directly to USB (no hub).
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on May 19, 2015, 08:24 am
Found a small checksum error bug in the compare_checksum(). Similar to the earlier checksum error bug in getCartInfo().  Need to make sure we compare 4 characters.  The original sprintf code used "%X" which drops leading 0s resulting in an error.

Code: [Select]

void compare_checksum() {
...
  char calcsumStr[5];
  sprintf(calcsumStr, "%04X", calc_checksum(fileName, folder));
...
}


I discovered the bug dumping Super Power League 4 because it has checksum 0x01AA.  I can now confirm that my SPC7110 code changes work with all 3 carts - FEOEZ, MDH, and SPL4. 

The checksum verification code need to be tweaked for MDH - the checksum should be checksum*2.  EDIT:  Here's the calc_checksum code addition:

Code: [Select]

unsigned int calc_checksum (char* fileName, char* folder) {
...
    else if (calcFilesize == 24 || calcFilesize == 28) {
      // Momotarou Dentestu Happy Fix 3MB (24Mbit)
      if ((calcFilesize == 24) && (romSizeExp = 0x0C)) {
       for (unsigned long i = 0; i < myFile.fileSize(); i++) {
          calcChecksum += myFile.read();
       }
       calcChecksum = 2 * calcChecksum;
      }
      else {
        for (unsigned long i = 0; i < (calcFilesize / 16); i++ ) {
          // Add all the bits in the 16Mbit chunks
          for (unsigned long j = 0; j < 2097152; j++) {
            calcChecksum += myFile.read();
          }
          // Add all the chunks together
          calcChecksum +=  calcChecksumChunk;
          calcChecksumChunk = 0;
        }
        // Add the 8Mbit rest
        for (unsigned long j = 0; j < 1048576; j++) {
          calcChecksumChunk += myFile.read();
        }
        calcChecksum +=  2 * calcChecksumChunk;
      }
    }
...
}
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on May 22, 2015, 09:59 am
There is a modification to the SPC7110 dumpROM() code that I posted earlier.  The change is needed to handle Hayazashi Nidan Morita Shougi 2 which is the only Seta ST018 cart.  Since the cart uses romChips = 245 (0xF5), we need to separate it from two of the SPC7110 games - Momotarou Dentestu Happy (MDH) and Super Power League 4 (SPL4).  Since MDH and SPL4 are HiROMs and Hayazashi 2 is LoROM, I added a romType check to the SPC7110 section of dumpROM().

Code: [Select]

void dumpROM () {
...
  else if((romChips == 245)||(romChips == 249)){
    if (romType == 0) {
      // ST018
      // Hayazashi Nidan Morita Shougi 2: romChips = 245
      <add LoROM dumping routines>
    ...
    }
    else if (romType == 1) {
      // SPC7110
      // Momotarou Dentetsu Happy/Super Power League 4: romChips = 245
      // Far East of Eden Zero: romChips = 249
      <see SPC7110 code posted above>  
     ...
    }
  }
}


I've confirmed all of the SDD1, SuperFX, SPC7110 and Seta DSP (ST010/ST011/ST018) carts dump properly.  I also tested one of the CX4 carts - Rockman/Mega Man X2.  The other CX4 cart - Rockman/Mega Man X3 should work but it is untested.  

There is currently a lot of duplication of routines in dumpROM() that needs to be cleaned up.  I'll work on streamlining the code and post the complete code after I wrap up my testing of enhanced carts.

Next up, I'll be testing the ExHiROM cart Tales of Phantasia once it arrives.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on May 24, 2015, 08:14 am
Got around to redumping Star Ocean.  With the Adafruit Clock Generator connected, Star Ocean cart no longer needs the verifySORead code.  The SDD1 carts now dump correctly every time.

EDIT:  Ran tests without the clock and Star Ocean still dumped okay.  Maybe it isn't the Clock Generator?  I did a couple runs and both dumps were good without the verifySORead.  On the other hand, the clock is definitely needed for FEOEZ.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on May 24, 2015, 11:52 am
Made a huge time savings in calc_checksum().  Added a 512 byte buffer for the myFile.read() and it now completes the task in seconds versus minutes.  I'll post the code after I clean it up.

EDIT:  Applied the same 512 byte buffer to myFile.write() in dumpROM() and it cut my dump times by more than half!  Got a 2MB (16Mbit) LoROM dumping AND checking the checksum in 1 minute - it used to take around ~3:50. 

In case anyone cares, the 512 byte buffer was chosen as it is the minimum block size used by the SD card.  Reading and writing anything less than 512 bytes to the SD card slows things down.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on May 24, 2015, 08:39 pm
I've confirmed all of the SDD1, SuperFX, SPC7110 and Seta DSP (ST010/ST011/ST018) carts dump properly.  I also tested one of the CX4 carts - Rockman/Mega Man X2.  The other CX4 cart - Rockman/Mega Man X3 should work but it is untested.  
This is so amazing  :)
It perfectly shows the power of open source  8)


Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on May 25, 2015, 11:20 am
Okay, here's the SD buffer code to speed up reads and writes.  I'll post the complete dump code after I test the ExHiROM carts and a couple other enhanced chip carts.

First off we add the SDBuffer[512] in the define section.

Next, my current calc_checksum() code.  Some of it is untested as I don't have all of the different sizes (missing 1.5MB, 2.5MB & "Normal" 3MB).  I referred to ROMs from the GoodSets where needed.

Code: [Select]

//Define Cart Reader Variables
...
byte SDBuffer[512];
...

//*************************CALCULATE CHECKSUM**************************************
unsigned int calc_checksum (char* fileName, char* folder) {
  unsigned int calcChecksum = 0;
  unsigned int calcChecksumChunk = 0;
  int calcFilesize = 0;
  unsigned int c = 0;
  unsigned long i = 0;
  unsigned long j = 0;

  if (strcmp(folder, "root") != 0)
    sd.chdir(folder);

  // If file exists
  if (myFile.open(fileName, O_READ)) {
    calcFilesize = myFile.fileSize() * 8 / 1024 / 1024;
    if (calcFilesize == 12 || calcFilesize == 20) {
      // Divide filesize by 8 to get number of 8Mbit chunks
      for (i = 0; i < (calcFilesize / 8); i++ ) {
        // Add all the bits in the 8Mbit chunks
        for (j = 0; j < (1048576 / 512); j++) {
          myFile.read(SDBuffer, 512);
          for (c = 0; c < 512; c++) {
            calcChecksumChunk += SDBuffer[c];
          }
        }
        calcChecksum = calcChecksumChunk;
      }
      calcChecksumChunk = 0;
      // Add the 4Mbit rest
      for (j = 0; j < (524288 / 512); j++) {
        myFile.read(SDBuffer, 512);
        for (c = 0; c < 512; c++) {
          calcChecksumChunk += SDBuffer[c];
        }
      }
      calcChecksum +=  2 * calcChecksumChunk;
    }
    else if (calcFilesize == 24 || calcFilesize == 28) {
      // Momotarou Dentestu Happy Fix 3MB (24Mbit)
      if ((calcFilesize == 24) && (romSizeExp = 0x0C)) {
        for (i = 0; i < (myFile.fileSize() / 512); i++) {
          myFile.read(SDBuffer, 512);
          for (c = 0; c < 512; c++) {
            calcChecksumChunk += SDBuffer[c];
          }
        }
        calcChecksum = 2 * calcChecksumChunk;
      }
      else {
        for (i = 0; i < (calcFilesize / 16); i++ ) {
          // Add all the bits in the 16Mbit chunks
          for (j = 0; j < (2097152 / 512); j++) {
            myFile.read(SDBuffer, 512);
            for (c = 0; c < 512; c++) {
              calcChecksumChunk += SDBuffer[c];
            }
          }
          calcChecksum = calcChecksumChunk;
        }
        calcChecksumChunk = 0;
        // Add the 8Mbit rest
        for (j = 0; j < (1048576 / 512); j++) {
          myFile.read(SDBuffer, 512);
          for (c = 0; c < 512; c++) {
            calcChecksumChunk += SDBuffer[c];
          }
        }
        calcChecksum +=  2 * calcChecksumChunk;
      }
    }
    else if (calcFilesize == 48) {
 // Star Ocean/Tales of Phantasia Fix 6MB (48Mbit)
 // Add the 4MB (32Mbit) start
      for (j = 0; j < (4194304 / 512); j++) {
        myFile.read(SDBuffer, 512);
        for (c = 0; c < 512; c++) {
          calcChecksumChunk += SDBuffer[c];
        }
        calcChecksum = calcChecksumChunk;
      }
      calcChecksumChunk = 0;
      // Add the 2MB (16Mbit) end
      for (j = 0; j < (2097152 / 512); j++) {
        myFile.read(SDBuffer, 512);
        for (c = 0; c < 512; c++) {
          calcChecksumChunk += SDBuffer[c];
        }
      }
      calcChecksum +=  2 * calcChecksumChunk;
    }
    else {
    //calcFilesize == 2, 4, 8, 16, 32, 40, etc
      for (i = 0; i < (myFile.fileSize() / 512); i++) {
        myFile.read(SDBuffer, 512);
        for (c = 0; c < 512; c++) {
          calcChecksumChunk += SDBuffer[c];
        }
        calcChecksum = calcChecksumChunk;
      }
    }
    myFile.close();
    sd.chdir();
    return (calcChecksum);
  }
  // Else show error
  else {
    display.println("ERROR");
    display.println("DUMP ROM 1ST");
    display.display();
    return 0;
  }
}


The checksum calculation greatly benefits from the 512 byte buffer.  We read the file on the SD card in 512 byte chunks to perform our calculation.  Calculations used to take minutes but now it takes only seconds to complete.

Now for the dumping code.  In an effort to streamline the dumpROM() code, I created a dumpLoROM() and dumpHiROM().  These routines dump 512 bytes into the SDBuffer then writes the buffer to the file on the SD card.

Code: [Select]

long dumpLoROM() {
  display.println("Dumping LoROM");
  display.print("Banks: ");
  display.println(numBanks);
  display.display();
  long dumpedBytes = 0;
  // Read up to 96 banks starting at bank 0x00.
  for (int currBank = 0; currBank < numBanks; currBank++) {
    // give status updates via LCD
    display.print(".");
    display.display();

    // Dump the bytes to SD
    for (long currByte = 0x8000; currByte < 0x10000; currByte += 512) {
      for (unsigned long c = 0; c < 512; c++) {
        SDBuffer[c] = dumpByte(currBank, currByte + c, false);
        dumpedBytes++;
      }
      myFile.write(SDBuffer, 512);
    }
  }
  return(dumpedBytes);
}

long dumpHiROM(int currBank, int endBank, long dumpedBytes) {
  for(currBank; currBank < endBank; currBank++) {
    // give status updates via LCD
    display.print(".");
    display.display();
   
    // Dump the bytes to SD
   for(long currByte=0; currByte < 0x10000; currByte += 512) {
      for (unsigned long c = 0; c < 512; c++) {
        SDBuffer[c] = dumpByte(currBank, currByte + c, false);
        dumpedBytes++;
      }
      myFile.write(SDBuffer, 512);
   }
  }
  return(dumpedBytes);
}


So substitute dumpLoROM() and dumpHiROM() into dumpROM() where needed.  Here's the calls as I have them right now.

Code: [Select]

void dumpROM() {
...
  long dumpedBytes = 0;
  ...
  if ((romChips != 67)&&(romChips != 69)&&(romChips != 245)&&(romChips != 249)) {
    if (romType == 0) {
     ...
       dumpedBytes = dumpLoROM();
    ...
    }
    else if (romType == 1) {
      ...
        dumpedBytes = dumpHiROM(0xC0, numBanks + 0xC0, dumpedBytes);
    ...
    }
  }
  else if((romChips == 67)||(romChips ==69)) {
    // SDD1
    // Street Fighter Alpha/Zero 2 (J, U, E): romChips = 67
    // Star Ocean (J): romChips = 69
    ...
      dumpedBytes = dumpHiROM(0xF0, 0x100, dumpedBytes);
  ...
  }
  else if((romChips == 245)||(romChips == 249)){
    if (romType == 0) {
      // ST018
      // Hayazashi Nidan Morita Shougi 2: romChips = 245
      dumpedBytes = dumpLoROM();
    }
    else if (romType == 1) {
      // SPC7110
      // Momotarou Dentetsu Happy/Super Power League 4: romChips = 245
      // Far East of Eden Zero: romChips = 249
    ...
      dumpedBytes = dumpHiROM(0xC0, 0xE0, dumpedBytes);
    ...
      dumpedBytes = dumpHiROM(0xE0, 0xF0, dumpedBytes);
    ...         
      dumpedBytes = dumpHiROM(0xF0, 0x100, dumpedBytes);
    ...
      dumpedBytes = dumpHiROM(0xF0, 0x100, dumpedBytes);
    ...
    }
  }
}
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on May 29, 2015, 10:58 am
Got a code change for the CX4 (Rockman/Mega Man X2 & X3) carts.  I had previously only tested the code on X2 but I was finally able to test on X3.

Rockman/Mega Man X2 & X3 both start with the mapping register 0x7F52 set to 1.  X2 needs to be set to 0 in order to fully dump the ROM.  X3 needs to be set to 1 to dump the entire ROM.

I added code to differentiate between X2 and X3 and also switched the register setting code to use the slower setSRAMByte() to make sure the changes worked. 

Code changes:

Code: [Select]

void dumpROM() {
...
    if (romType == 0) {
      byte initialCX4Map = 0;
      byte mmxType = 0;
      // CX4 (Mega Man X2/Mega Man X3/Rockman X2/Rockman X3) romChips = 243 (0xF3)
      if(romChips == 243){
        // Check initial content of mapping register...
        // Mega Man/Rockman X2 & X3 should both return 1
        initialCX4Map = dumpByte(0, 0x7F52, false); //0x7F52
       
        display.print("CX4 Register: ");
        display.println(initialCX4Map);
        display.display();

        // Check ROM Name to determine whether X2 or X3       
        mmxType = dumpByte(0, 0xFFC9, false) & 0xF; // 0xFFC9
     
        // Mega Man/Rockman X2 needs to be set to 0
        if((mmxType == 2)&&(initialCX4Map != 0)){
          setDataOut();
          // Set 0x7F52 to 0
          setSRAMByte(0, 0x7F52, 0, false);
          setDataIn();
        }
        // Mega Man/Rockman X3 needs to be set to 1
        if((mmxType == 3)&&(initialCX4Map == 0)){
          setDataOut();
          // Set 0x7F52 to 1
          setSRAMByte(0, 0x7F52, 1, false);
          setDataIn();
        }
      }
      dumpedBytes = dumpLoROM();
      if(romChips == 243){
        // Return mapping register to initial setting...
        setDataOut();
        setSRAMByte(0, 0x7F52, initialCX4Map, false);
        setDataIn();
      }
    }
...
}
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: Gargamel13 on May 30, 2015, 04:51 pm
Is the latest version of this source made available public?  I don't want to make a mistake pasting pieces of code from the forums together... :smiley-confuse:
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on May 30, 2015, 09:30 pm
My code is in constant flux so I haven't posted the complete code.  I've been testing the special enhanced chip games.  So far, I've dumped all of the CX4, OBC1, SDD1, S-RTC, ST010, ST011, ST018, and SuperFX carts.  ExHiROM carts also work but it requires byte verification code like verifySORead.

I'm finishing up testing on the ExHiROM and S-RTC (Daikaijuu Monogatari 2) code.  I'll post my complete code after I test a couple other carts that should be arriving soon.  I also have to fix a bug that prevents writing to the SD card (any cart that uses an extended ASCII character in the ROM name will not be able to write to the SD).

If you're building the reader, then the original codes that have been posted will get you up and running.  There are only a small number of enhanced chip games.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Jun 06, 2015, 09:25 pm
Some progress notes...

S-RTC, DSP1, DSP2, and DSP3 all dump, read/write SRAM.  I only tested one DSP1 cart (Super Mario Kart) but it works.  Waiting for a DSP4 cart to get here. 

The S-RTC cart has been kicking my @ss trying to get the RTC data.  There isn't much documentation on the S-RTC chip so communicating with it is like flying blind.  I've got the chip changing modes but the read command isn't working for me right now.  Too bad the chip isn't fully documented like the EPSON RTC used in FEOEZ which has the full datasheet available.

I also added code to dump the Nintendo Power (SF Memory Cassette) cart and I'm trying to see if the SRAM is accessible without any special commands.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Jun 07, 2015, 02:01 pm
Breakthrough!

I managed to dump the SA-1 cart.  I actually dumped PGA Tour 96 yesterday before my previous post.  I was going to include the news in that post but since I only had only managed it once (I finished the hardware addition that same day), I deleted the details before posting.  I managed to dump the same cart again today and verified the contents of the ROM which appears to be a previously undumped version of the game.  My ROM and SRAM dump both work in higan although I haven't played thru a game yet.

Dumping the SA-1 cart requires attaching a CIC chip in lock configuration.  I built two different versions of the CIC lock - one using a SuperCIC 16F630 and one with a snesCIC 12F629.  I've dumped the PGA Tour 96 using both versions.  The cart connector CIC pins (24, 25, 55, 56) need to be connected to the CIC lock chip.  Pin 56 is connected to the CIC chip and a 3.072MHz clock signal (I'm using one of the other clock outputs from the Adafruit Clock Generator).

The CIC-SA1 connection is a bit hit-or-miss right now.  Most of the time it doesn't connect but it will eventually work.  I think I have to tweak the reset timings to get it working more consistently.  What was amazing is that I managed to dump Super Mario RPG on the first attempt using the SuperCIC.  It was nice to finally get a copy of my savegame off the cart.  Kirby Super Star dumped on the first attempt with the snesCIC.  Kirby's Dream Land 3 dumped ok but is giving inconsistent SRAM dumps so I suspect the battery might be dying.

Another good thing about the CIC addition is that it works fine with the other non-SA1 carts.  There is one cart that does need to have the CIC module removed and it is the Nintendo Power (SF Memory Cassette).  With the CIC module connected, the Nintendo Power cart won't be recognized by the reader.  I'm assuming the CIC module and the MX15001TFC processor chip don't get along.  I'll have to do more testing to see if there is a workaround.

EDIT:  The changes to the setup() code with the CIC Lock Reset outlined below have fixed the issue with the one problematic Nintendo Power cart.

I'll post more details after further testing.

Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: tylau0 on Jun 07, 2015, 10:23 pm
Excellent! Thanks for sharing the big news.

I am now looking forward to receiving my electronic parts so I can try it out here.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: MichlK on Jun 08, 2015, 04:07 pm
I managed to dump the SA-1 cart.
Wow - congratulations once again! :o There are not many solutions out there that support all the enhancement chips... :)

The CIC-SA1 connection is a bit hit-or-miss right now.  Most of the time it doesn't connect but it will eventually work.  I think I have to tweak the reset timings to get it working more consistently.
I guess, you have already seen this, but there was some discussion in the nesdev.com forums about this - just search for "ripping sa1 nesdev" in Google...

Best regards
Michael
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Jun 10, 2015, 07:57 am
Some notes on the CIC stuff.

The most compatible version of the lock seems to be the snesCIC.  I've been getting the best results using the snescic-lock-resync version.  Get the ASM & HEX here:  https://github.com/mrehkopf/sd2snes/blob/develop/cic/

Code: [Select]

;   snesCIC LOCK 12F629
;   pin configuration: (cartridge slot pin) [original 18-pin SMD lock CIC pin]
;
;                       ,---_---.
;      +5V (27,58) [18] |1     8| GND (5,36) [9]
;      CIC clk (56) [7] |2     7| CIC data i/o 0 (55) [1]
;   host reset out [10] |3     6| CIC data i/o 1 (24) [2]
; CIC lock reset in [8] |4     5| CIC slave reset out (25) [11]
;                       `-------'



You wire up the snesCIC to the Cart Pins 24, 25, 55, 56.  Connect CIC Pin 2 and Cart Pin 56 both to the clock generator outputting 3.072MHz.  I also connected Host Reset (CIC Pin 3) and CIC Lock Reset (CIC Pin 4) to available pins on the Mega 2560.

The snesCIC has specific timing built into the code for the CIC LOCK-KEY to work.  We need to set up our code to make sure the LOCK-KEY works right.  Since the snesCIC has the correct timing, we need to trigger the code at the right time using the CIC Lock Reset.  When CIC Lock Reset is HIGH then it is in reset, when LOW it is running the CIC code. 

In our Arduino setup(), we immediately set CIC Lock Reset HIGH otherwise the LOCK-KEY communication may fail.  Pulling CIC Lock Reset HIGH gives us time to get everything else that is connected to the Arduino up and running before trying the CIC handshake.  We let most everything initialize in setup() then we set CIC Lock Reset LOW to start the CIC code and hopefully get a valid connection to the cart.

After making the changes to setup(), the SA-1 carts get recognized most of the time now.  For when the cart is not recognized, I added a soft_Reset() "jmp 0" to reset the reader and start over.  I've dumped all of my SA-1 carts except for one problem cart, PGA European Tour.  I don't know what is different about the cart but it only spits out 0x17s right now.

EDIT:  I managed to get the problematic PGA European Tour to dump. I put the cart in the SNES and let it run for a little bit then moved it over to the reader and dumped it.  I'm still not sure what makes this cart fail.  I'll have to look at the SA-1 registers to see what is there.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Jun 13, 2015, 09:29 pm
Success!

I finally fixed the S-RTC communication and have the S-RTC outputting the time correctly.  So both the RTC and S-RTC now output properly.  If anyone thinks it would be worthwhile to add writing the time to the RTC chips, then let me know.  I'm not inclined to add it as the time can always be set in the respective cart.

I've made progress on a different cart.  I managed to get the games off the Nintendo Power (SF Memory Cassette) cart in multi-game configuration.  It requires some fiddling with the MX15001TFC registers 0x2400 and 0x2401.

In single game configuration (with or without the Menu), the reader should be able to see the game data in banks 00-7F in LoROM (0x8000-0xFFFF).  After dumping the Menu, the game data will be at 0x80000 in the dump.  If you set the registers to switch to the game, then the data changes and the cart actually becomes the individual game and the normal cart dumping process will work.

I have a multi-game (3-in-1) cart and the games are not visible to the reader.  Only the Menu is visible and it repeats 8x (in banks 00-7F).  I searched all of the banks and there is no game data to be found.  The MX15001TFC hides the actual game data.  Accessing the game data requires setting registers 2400 and 2401, the data changes for each game so it requires multiple steps to dump all of the games.

Right now I can dump individual game data with the settings hardcoded but it will take some time to code it so that the reader can dynamically dump the games.  I have to wrap my head around coding all of this because of the number of steps involved. We need to access the Menu, read the game entries, set the correct registers, dump the individual game data, then reset the cart to repeat the process to dump the next game. 

I have to experiment more with switching between games.  Registers 2400 and 2401 remain active even when acting as a single game so I'm hoping it is possible to switch between the games with a reset instead going back to the Menu.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Jun 21, 2015, 03:06 am
Ok.  So I appear to have sorted out the last inconsistency issue with the SA-1 carts.  The key is getting the clock signals exactly right in order to have the cart recognized and dump properly.  One of my SA-1 carts, PGA European Tour, almost never got recognized due to a slightly incorrect clock frequency.  I completely forgot that I had an old PIC 16F84 frequency counter so I never bothered to check the clock signals until yesterday.

Using the Si5351 Arduino library (https://github.com/etherkit/Si5351Arduino),  there is a calibration needed to get the clock output as close as possible to the target 21.477272 MHz and 3.072 MHz.  If you read the documentation on the library, then you will find the calibration section in the Readme.  You need to run the si5351calibration sketch in the Arduino IDE to find the setting for your individual setup.

After testing my clock generator with a frequency counter, I found that my clocks were at 21.46998 MHz and 3.07096 MHz.  So the clock generator definitely needed calibration.  I ran the si5351calibration sketch in the IDE and found the correction needed for my reader.  The set_correction value needs to be set early in the setup.  Here's how my clock generator section in setup() looks right now:

Code: [Select]

void setup() {
...
  // Adafruit Clock Generator
  clockgen.set_correction(-29000); // Find this value by using the si5351calibration in the Arduino IDE
  clockgen.init(SI5351_CRYSTAL_LOAD_8PF, 0);
  clockgen.set_pll(SI5351_PLL_FIXED, SI5351_PLLA);
  clockgen.set_pll(SI5351_PLL_FIXED, SI5351_PLLB);
  // Set Clock Generator CLK0 to 21.477272MHz
  clockgen.set_freq(2147727200ULL, SI5351_PLL_FIXED, SI5351_CLK0);
  // Set Clock Generator CLK2 to 3.072MHz
  clockgen.set_freq(307200000ULL, SI5351_PLL_FIXED, SI5351_CLK2);
  clockgen.output_enable(SI5351_CLK0, 1);
  clockgen.output_enable(SI5351_CLK1, 0);
  clockgen.output_enable(SI5351_CLK2, 1);
...
}



The clocks are now almost spot on at 21.47727 MHz and 3.07199 MHz.  With the current clock settings, the SA-1 carts are recognized every time even the problem PGA European Tour cart.  I'll be picking up a new frequency counter to replace my old PIC16F84 unit so maybe I can get the clocks exactly right.

For anyone planning on adding SA-1 support to their reader, the snescic-lock-resync is definitely the best version to use.  Don't bother with the SuperCIC as it doesn't recognize the SA-1 carts as reliably as the snesCIC resync version.

Using my reader, I dumped a new version of an SA-1 cart, PGA Tour 96 (U).  The cart that I dumped is Revision 1.1 with ROM chip "SNS-A3GE-1".  The previous known version is Revision 1.0 with chip "SNS-A3GE-0" (I dumped a copy of that one too).  I submitted the new dump to No-Intro and GoodTools so it will eventually be available for anyone that cares about this type of stuff.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Jul 12, 2015, 04:32 am
Nice work, sanni!

I'll have to post a complete version of my reader code.  The reader code should support all of the enhanced chip carts.  I was hoping to include full support for the Nintendo Power (SF Memory Cassette) carts but the NP carts are finicky (even more than the SA-1 carts).  If I can't manage to get the NP cart working 100%, then I'll post a version with everything but the NP code. 

The biggest problem I'm having with the NP carts is I cannot consistently get the cart to switch to a single game.  Switching to a single game is important as that is the only way to see and dump the SRAM.  Once the cart becomes a game, then the processor will map the savegame to the normal SRAM location.  I've written all of the code even added a menu for the multi-game but the timing on getting the cart to switch is hit-or-miss.  I've dumped all of my NP carts but it takes multiple tries to get each game done.

I also have to do more testing as I recently got a NP cart with a combination of LoROM and HiROM games and I want to confirm the mapping for the HiROM game.  It appears that the HiROM game is mapped like a LoROM game including the SRAM.  I'll have to do more testing to be sure.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Aug 07, 2015, 01:10 am
I tried to figure out the pinout of a Nintendo Power cart, maybe you find it useful. There might be still some errors left in the schematics though.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: Gargamel13 on Aug 07, 2015, 08:05 pm
Nice work, sanni!

I'll have to post a complete version of my reader code.  The reader code should support all of the enhanced chip carts.  I was hoping to include full support for the Nintendo Power (SF Memory Cassette) carts but the NP carts are finicky (even more than the SA-1 carts).  If I can't manage to get the NP cart working 100%, then I'll post a version with everything but the NP code. 

The biggest problem I'm having with the NP carts is I cannot consistently get the cart to switch to a single game.  Switching to a single game is important as that is the only way to see and dump the SRAM.  Once the cart becomes a game, then the processor will map the savegame to the normal SRAM location.  I've written all of the code even added a menu for the multi-game but the timing on getting the cart to switch is hit-or-miss.  I've dumped all of my NP carts but it takes multiple tries to get each game done.

I also have to do more testing as I recently got a NP cart with a combination of LoROM and HiROM games and I want to confirm the mapping for the HiROM game.  It appears that the HiROM game is mapped like a LoROM game including the SRAM.  I'll have to do more testing to be sure.
Will it include the saving and writing of SRAM (your completed work)?  Thanks for your efforts!
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Aug 11, 2015, 09:49 pm
Dumping the SRAM on the NP cart is definitely possible.  I've dumped all the savegames off of my NP carts.

For a single game NP cart, then the SRAM should be visible.

For a multi-game NP cart, you need to enter the command sequence to set the cart to a game then the corresponding savegame becomes accessible in the SRAM.

I haven't tried to write the SRAM yet.  I'll have to give it a try sometime.

I'm waiting on a bunch of NP carts to arrive from Japan to do more testing on.

Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: AngryHelder on Aug 12, 2015, 04:17 am
Anyway you could release the code you have up to now and maybe give us an update when you got the NP carts all figured out? I'd love to build me one of these with your code and maybe even make a custom PCB for this project.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Aug 15, 2015, 09:16 pm
Here's the code with support for the Enhanced chip carts for sanni's cart reader:
http://www.mediafire.com/download/e76feeya77rb3q7/Cart_ROM_READER_SNES_ENHANCED.zip

I've included the SDFat library with long filename support and the Si5351 library for the Adafruit Clock Generator.  If this is your first build, then you'll also need the other libraries that sanni included (LCD, RGB, DigitalIO).

A few notes on the hardware modifications:

The Adafruit Clock Generator is needed for SPC7110 and SA-1 carts.  The clock generator uses CLK0 to generate the 21.477272MHz master clock signal that is connected to Pin 1 of the cart connector.  CLK2 outputs the 3.072MHz CIC clock signal which is wired to the CIC clk in on the snesCIC/SuperCIC chip.

The snesCIC/SuperCIC has the CIC host reset and CIC lock reset connected to Arduino pins 6 & 7, respectively (although I haven't implemented any code for the CIC host reset in this version).  The remaining CIC connections are wired to the appropriate pins on the cart connector.

As of right now, the snesCIC/SuperCIC is only really necessary for SA-1 carts.  There's a possibility that the Nintendo Power (SF Memory Cassette) carts need the CIC but my best results with my current NP code is without the CIC (and clock).

One last item, some of these enhanced chip carts are extremely sensitive to how the power is supplied.  If a cart is not being recognized, then check your power supply and/or try a different connection.

I forgot to specify that we use the snesCIC/SuperCIC LOCK code.
snesCIC resync lock:  https://github.com/mrehkopf/sd2snes/blob/develop/cic/snescic-lock-resync.asm
snesCIC resync lock (HEX):  https://github.com/mrehkopf/sd2snes/blob/develop/cic/snescic-lock-resync.hex
SuperCIC lock:  https://github.com/mrehkopf/sd2snes/blob/develop/cic/supercic/supercic-lock.asm

Please post any improvements made to the code.

Good luck!
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Aug 15, 2015, 11:16 pm
Pictures of the snesCIC/SuperCIC.  Sorry for the dust!

(http://i.imgur.com/dfgYj0T.jpg)(http://i.imgur.com/MBZSzPL.jpg)(http://i.imgur.com/Arg9pqM.jpg)(http://i.imgur.com/2Cu69tc.jpg)(http://i.imgur.com/cSar9J6.jpg)(http://i.imgur.com/HmhdJgc.jpg)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Aug 16, 2015, 01:26 am
I've made a pcb for it, since I didn't want to rewire my old build for adding the full lenght slot. It should arrive in 2 weeks time. Well worth the saved time compared to wiring everything per hand.

(https://dl.dropboxusercontent.com/u/20912715/snes/snes_shield_pcb.jpg)

If you have a closer look you will notice that I changed all the pins around. This is so that the address and data lines are grouped together on one port which will in theory give an insane speed boost since you can just do:

Code: [Select]

PORTC = myData;


instead of:

Code: [Select]

void writeData(byte myData) {

  if ( (myData & 1) == 1 ) digitalWrite(d0Pin, 1); else digitalWrite(d0Pin, 0);
  if ( (myData & 2) == 2 ) digitalWrite(d1Pin, 1); else digitalWrite(d1Pin, 0);
  if ( (myData & 4) == 4 ) digitalWrite(d2Pin, 1); else digitalWrite(d2Pin, 0);
  if ( (myData & 8) == 8 ) digitalWrite(d3Pin, 1); else digitalWrite(d3Pin, 0);
  if ( (myData & 16) == 16 ) digitalWrite(d4Pin, 1); else digitalWrite(d4Pin, 0);
  if ( (myData & 32) == 32 ) digitalWrite(d5Pin, 1); else digitalWrite(d5Pin, 0);
  if ( (myData & 64) == 64 ) digitalWrite(d6Pin, 1); else digitalWrite(d6Pin, 0);
  if ( (myData & 128) == 128 ) digitalWrite(d7Pin, 1); else digitalWrite(d7Pin, 0);
}
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Aug 16, 2015, 02:48 am
Hi sanni,

Nice PCB.  I might need one!  I recently pulled a cart connector from a broken Retron 3 and it has the proper pin spacing.

One thing on the clock generator location, the USB connector on the Arduino is close to the pins for the clock generator on my current adapter.  I put a layer of kapton tape over the USB connector to prevent a short (just in case).  I also have some plastic spacers sandwiched in between the adapter and Arduino but it might be really close if you fully seat the adapter onto the Arduino.

Thanks!
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Aug 16, 2015, 03:08 am
I'll send you one, no problem.  :)

I tried to stay away from the USB socket but it still might conflict with the 6pin ISP header depending on the used Arduino board, but nothing a little tape or desoldering iron couldn't fix.

(https://dl.dropboxusercontent.com/u/20912715/snes/snes_shield_pcb_eagle.jpg)

The manufacturer already emailed me an image of the order, I like the color.

(https://dl.dropboxusercontent.com/u/20912715/snes/snes_shield_pcb_back.jpg)

As you can see I used the remaining board space for a little break-out board, just plug it into the cart slot and you got access to all the important pins to mess around with, e.g. when you want to use the arduino to program a 29F032 flashrom.

I just hope I didn't mess up and the board actually works  :smiley-roll-sweat:
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: AngryHelder on Aug 18, 2015, 03:45 am
I'll take one of those bad boys if you're selling them, if you don't mind could you post your schematic? I also notice 2 SNESCIC in the images above, I can see one is the Pic16F30 but what is the smaller one used? Also which of the CIC codes is the one to use fr the project?

Sanni maybe you could add a Voltage Regulator or something else required so the Cart is powered correctly as it seems to be an issue for some games or rather the USB ports lack of power.

Are you guys using the MEGA 2560 R3 Board or something else? I'm about to buy all the parts needed but this is the only thing I'm unsure of. Thanks.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Aug 18, 2015, 04:43 am
sanni's adapter interfaces with the Arduino MEGA 2560 R3.

As for the CIC, snesCIC Lock uses PIC12F629 and SuperCIC Lock uses PIC16F630.  You can use either one.  I've had better success with the snesCIC using the resync code that was linked to.  I've tested both on my adapter as I built the boards to be interchangeable.  sanni's new PCB is setup for the 12F629.

Good luck!



Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Aug 18, 2015, 04:35 pm
The Arduino Mega does have a 5V 1A power supply onboard that takes a 9-12V barrel plug type power supply. If you have both USB and the 9V-12V external power supply plugged in the Arduino will automaticly use the external supply for power instead the USB.

There are 3 different versions of the Arduino Mega 2560 that have different chips for USB communication:
- the old official design with a FTDI chip
- the new official design with an ATMEGA16U2
- and an unofficial chinese redesign with a CH340

The unofficial chinese redesign is the cheapest but since you can also get a clone following the official design for about ~$10 (like ebay #360790082588) I would just buy that instead. Especially since all shields and cases are designed with the official design in mind.

As soon as I have received the pcbs and can confirm that I didn't mess up, I'll post the Eagle files.

Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: AngryHelder on Aug 18, 2015, 08:24 pm
Awesome! Thanks guys for the responses and looking forward to the eagle files as well. One last question on parts: What socket are you guys using or recommend (besides stripping it from an SNES or Retron)? I have found the ones mentioned by another user in this thread:

62pin= http://www.ebay.com/itm/131137330390
46pin= http://www.ebay.com/itm/131416146382

and from his comments they seem to work. Wondering what are your recommendations and what is the pitch of the SNES pins? I might try alibaba to see if there is some distributor with the official specs (once I know them).
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Aug 18, 2015, 08:42 pm
Official ones are 2.5mm pin pitch. I have one from a Retrode and a short one from a HoneyBee Super Game Converter. Both also have the correct 2.5mm.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Aug 18, 2015, 10:36 pm
Any of the commonly available connectors with 0.1" (2.54mm) spacing will be off.  For the center 46 pins, it doesn't matter too much.  Once you get to the ends of the full length connector, the spacing will be noticeably off. 

The Wonderco (Centronic) 46 pin connector listed on eBay will work but the spacing will be off.  My adapter uses the 46 pin connector and I cut an extra connector to add the end section.  I tried to shift the end section more into alignment when attaching it to the adapter.

The SNES Game Genie has a proper spaced 46 pin connector.  The Retron 3 has a proper spaced full length connector.  The later SNES consoles have thru-hole cart connectors - they're the ones with the black plastic mounting tabs on the end.

Good luck!
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Aug 21, 2015, 10:12 pm
There seem to be two types of cart connectors, the official with 6.8mm vertical spacing and 3rd party clones that have 5mm.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Aug 22, 2015, 02:05 pm
Just checked the Retron 3 connector and it is the narrow 5mm spacing too.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Aug 22, 2015, 10:56 pm
I redesigned the cart slot so that both the 5mm china version and the wider official should fit. I used the FreeRouting Autorouter for Eagle:
Github (https://github.com/nikropht/FreeRouting)
Forum (http://www.freerouting.net/fen/viewtopic.php?f=4&t=221)

Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: AngryHelder on Aug 25, 2015, 04:28 am
I used the FreeRouting Autorouter for Eagle:
Github (https://github.com/nikropht/FreeRouting)
Forum (http://www.freerouting.net/fen/viewtopic.php?f=4&t=221)
Any info on how to open FreeRoute? I can't find any site that will open the java program and I tried to run the file freeroute.jnlp offline I get a java program error. This looks like a really cool program I'd like to try on some of my projects, if it's going to be a problem posting such info about it (copyright?) please send me a PM.

Thank you for all the files.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Sep 02, 2015, 04:00 am
Found an error in my romType code in getCartInfo().  If the romType is 0x32 (or 0x3A), then the code currently sets it to HiROM.  This works for SDD1 (and SPC7110) carts.

While dumping Nintendo Power carts, I ran across "Super Momotarou Dentetsu 2" which is romType 0x32 but LoROM.  This was the NP game that I was dumping wrong because I had flagged it based on romType as HiROM.

EDIT:  Here's the modified code:
Code: [Select]

void getCartInfo () {
  ...
  // Check if LoROM or HiROM
  romType = dumpByte(0, 0xFFD5 + offsetEx, false);

  // Check RomSpeed
  romSpeed = (dumpByte(0, 0xFFD5 + offsetEx, false) >> 4);

  // Check RomChips
  romChips = dumpByte(0, 0xFFD6 + offsetEx, false);

  // Identify LoROM or HiROM or ExHiROM
  if (romType == 0x35) // ExHiROM
    romType = 2;
  else if (romType == 0x32) {
    if ((romChips == 0x43) || (romChips == 0x45)) // SDD1
      romType = 1;  //HiROM
    else
      romType = 0;
  }
  else if (romType == 0x3A) // SPC7110
    romType = 1;  //HiROM
  else
    romType = romType & 1; // 0xFFD5
  ...
}


I moved the section that modifies the romType to after the romChips check.  We'll use the romChips 0x43 or 0x45 to flag the SDD1 carts as HiROM.

Good Luck!
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: zzattack on Sep 03, 2015, 01:45 pm
Very awesome stuff in here! I'd like to build one myself now. Could you share the eagle file (or gerbers) for your board sanni? (Assuming that the electrical test really passed of course :))
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Sep 03, 2015, 06:10 pm
There were some problems with my design so I took the files down. Mainly clearance issues that could lead to short circuits. I will refine the design and upload it again.

In other news, I added a MX29L3211 flashrom programmer to my previous post. Now you can program all interesting(in terms of SNES) flashroms with the Arduino. :)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: zzattack on Sep 03, 2015, 07:22 pm
Ah, sorry to hear.. Yeah, autorouter strikes again. Good luck on the next generation.  Eagle has some useful drc options, which help run some checks that prevent you from having clearance issues. Oshpark and sseedstudio (and probably many more) provide them, iirc.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Sep 04, 2015, 11:55 pm
Thanks, I'll try that.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: AngryHelder on Sep 06, 2015, 04:04 pm
I've used quite a few manufacturers and have a collection of DRU files from them and most Chinese fabricators teds to use 8mil for spacing where as OSHPark uses 6mil.

Here is my collection for anyone to use and they are accompanied by the fabricators name.

https://www.mediafire.com/?remkbqbjgpb08yb
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Sep 11, 2015, 10:11 am
Someone asked about reading and writing SRAM for the Nintendo Power carts. 

As I mentioned previously, reading the savegame out of SRAM is possible once a cart is switched out of the menu into game mode.  I've dumped all of the savegames off of my NP carts.

I finally ran some tests writing savegames to SRAM.  Using an NP cart with Super Mario World, I was able to write a new 96* savegame to the SRAM.  After testing the 96* savegame, I then wrote back the original savegame.  Everything works without a problem.

Once the NP cart switches from menu to the selected game, then the cart essentially becomes that game.  The read/write code for ROM and SRAM should work.

I'm still trying to improve the reliability of the menu to game mode switching.  I'll be doing more testing until I figure it out.

Good Luck!
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: zzattack on Sep 11, 2015, 10:38 am
That's so awesome skaman! I'm waiting for my parts now, am really excited to build this
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Sep 16, 2015, 01:51 pm
I made some short videos  :smiley-mr-green:

Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: zzattack on Sep 16, 2015, 11:00 pm
Cool!! Did you already receive the revised board or did you patch up the first batch? I should have the boards from the 2nd revision back from oshpark in about a week now. Can't wait :D
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Sep 16, 2015, 11:26 pm
I'm still using the 1st revision, works fine after you carefully bend the pins of the cart slot so it fits the spacing. :)

Remember that the pinout has changed between the perfboard-and-wire version and the pcb shield version, I uploaded skamans enhanced code with those pinout changes already made for the pcb in post #68.

The reason for changing the pinout was that now everything is grouped into the same ports, so that you could use direct port manipulation quite easily instead of digitalwrite to gain a speed boost if needed.

Please post pictures once your build is completed, that purple pcb will surely looks nice  8)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Sep 18, 2015, 08:49 am
Thanks to nocash (Martin Korth) the Nintendo Power code is finally working smoothly.  I was having difficulty getting the reader to switch reliably from the Menu mode to Game mode.  With a few pointers (and much patience) from Martin, I was able to identify the cause of the problem.

Switching the NP cart from Menu mode to Game mode requires a specific sequence to be sent (read more in nocash's Fullsnes document here:  http://problemkaputt.de/fullsnes.txt).  The final command is the game selection (Slot # + 0x80) sent to 0x2400.  When the game selection is sent, then the cart immediately becomes the game selected. 

The problem with the switching code was the 21.477272MHz Master Clock running the NP cart too fast for the Arduino.  In order to ensure that the NP commands work properly on the reader, the Master Clock needs to be slowed down before the NP sequence is sent.  After the sequence is sent to the cart, then the Master Clock is restored back to 21.477272MHz.  My initial test of 2.68MHz (21.477272/8) for the slowdown works and the cart now switches back and forth between game and menu without a problem. 

For optimal results, the Nintendo Power cart requires the clock generator and the snesCIC/SuperCIC.

I'll clean up my code and post it sometime soon.

Good Luck!
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: zzattack on Sep 28, 2015, 02:55 pm
I got the oshpark boards in the mail today :)
Hopefully I have all the parts now so I can build the adapter tonight. When it's working I want to add another way of navigating the menu using something like this:
(http://i.ebayimg.com/00/s/MTA5MFgxMDkw/z/U~EAAOSwPcVVyh0H/$_12.JPG?set_id=880000500F)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Sep 28, 2015, 03:19 pm
According to this topic there are some nice cart slots available somewhere in china
(http://i.imgur.com/f9XNKSy.jpg)

http://forums.nesdev.com/viewtopic.php?f=9&t=12192&p=138433#p138433

I wonder how good they fit?
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: zzattack on Sep 28, 2015, 03:24 pm
http://world.taobao.com/item/521246288114.htm?fromSite=main&spm=a312a.7700824.w4004-10497653512.8.LeJ1No

let's see if they ship to Europe :)

it mentions 2.54mm though :(
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Sep 29, 2015, 12:02 am
Darn, 2.54 is a no go :/
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: zzattack on Oct 01, 2015, 03:22 am
I put the thing together and it seems to work pretty well! I've tried some SFX, CX4 and GSU carts and they all work. SA-1 doesn't work though, but I'm guessing my frequency generator may be off still or my improvised extra pins may not work as well as I had hoped.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Oct 04, 2015, 09:21 am
One thing you could test that might improve the SA-1 detection is to slow the Master Clock:

Code: [Select]

void setup() {
  ...
  // Set Clock Generator CLK0 to 21.477272MHz
  //TESTING 10.738636MHz for SA-1 Carts (21.47727MHz/2)
  clockgen.set_freq(1073863600ULL, SI5351_PLL_FIXED, SI5351_CLK0);
  //  clockgen.set_freq(2147727200ULL, SI5351_PLL_FIXED, SI5351_CLK0);
  ...
}

The slower Master Clock appears to work with all of the carts that I have on hand including the SPC7110 carts.  I've also written code to set the clock correction without an external frequency counter but it needs more testing.

Make sure you have a solid, stable power supply to the reader.  The SA-1 cart is one of the enhanced carts that won't work off a flaky power supply.

Good Luck!
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: zzattack on Oct 04, 2015, 02:25 pm
Thanks for the tips. If it remains quirky, I have some 21.4772 and 3.072 crystals so I'll swap out the clockgen for those.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Oct 12, 2015, 02:53 am
According to sanni, the cheap Chinese Arduino clones have suspect power regulation that could affect SA-1 cart detection.  He had problems with a CH340 based Arduino clone that required changing the onboard voltage regulator in order to get SA-1 detection working.  By contrast, a different Arduino (official design) that he had always worked with the SA-1 carts.

My original reader uses a CH340 based Arduino which might explain some of the power issues that I've encountered.  I recently picked up an Arduino that follows the official design with the ATmega 16U2.  I'll have to do more testing with the new Arduino to see if it eliminates the need for some of my Master Clock code adjustments.

Good Luck!
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Oct 12, 2015, 10:21 am
It must be a noise problem, most likely my other Arduino has better caps or an overall better design.
Replacing the voltage regulator probably helped because some regulators can cope with noise better than others and so does powering the Arduino with a 9V battery. Soldering a wire directly from the voltage regulator's output tab to the cartslot also seems to help if powered from a battery.
I haven't fully understood it yet and also don't have the equipment to do better testing.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: zzattack on Oct 18, 2015, 03:27 pm
I've made a pulse counter (useful experience) and found that I needed quite some calibration (-581000), now the frequency seems to be spot on. Slowing the master clock doesn't help me get SA-1 carts recognized either, so I think I'll replace the voltage regulator and add necessary caps on the arduino now.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Oct 25, 2015, 08:34 pm
Still need to get something myself that can count clock pulses.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: flagoss on Oct 30, 2015, 09:07 pm
That would be great to control the menu instead of using only one button.

http://www.ebay.ca/itm/Infrared-Wireless-Remote-Control-Kits-for-Arduino-AVR-PIC-/191674550175?hash=item2ca0b1879f:g:pRoAAMXQDnpTa4qW
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: zzattack on Oct 31, 2015, 07:14 pm
I finally got a SA-1 cart recognized. The cartridge in question had its maskrom replaced by a 27C322. None of my SA-1 carts with original MX maskrom ever worked though. I've already exchanged my chinese voltage regulator for a trusty 7805 but I still suspect the power circuit to be suboptimal.
How did you improve the power circuit no your chinese boards sanni?
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Nov 02, 2015, 12:02 pm
I did replace the output capacitor to see if anything changes, but nothing happend. Replacing the voltage regulator(AMS1117 1A) at least gave varying results from worse(78M05 0.5A) to better(AX1117 1A) but still far away from fixing the issue 100%.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Nov 08, 2015, 05:23 pm
I dumped my SA-1 cart(PAL PGA Tour '96 1L3B-01 PCB) but my Super Mario RPG SA-1 cart(NTSC 1L5B-20 PCB) simply does not want to boot.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: zzattack on Nov 14, 2015, 06:50 pm
sanni, do you use 'slow' functions for writeByteA1/writeByteA2/writeByteB or are you using optimized writes to the port registers? could poor SA-1 detection be due to too many rapid changes on the addressing ports?
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Jan 23, 2016, 05:13 pm
I'm using the faster variant, maybe too fast.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: p4r4d0x86 on Feb 15, 2016, 10:02 pm
Hi all,

What a great project!
Thanks a lot to all the contributors, specially MichlK, sanni, skaman.

I will try to build my own "clone" so:
SNES Cart Slots: http://www.aliexpress.com/store/product/Replacement-62Pins-Slot-for-SNES-Clone-Console/1902006_32605683635.html
Any chance to find a reseller for only one or two connectors?

Kind regards,
Nico
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: zzattack on Feb 15, 2016, 10:04 pm
I recently purchased 10, so if you're from Europe I could send them
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: p4r4d0x86 on Feb 17, 2016, 01:49 am
I recently purchased 10, so if you're from Europe I could send them
Cool, I will send you a PM.

Nico
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Feb 17, 2016, 02:05 am
The project continues to move forward.  We are now able to completely rewrite the Nintendo Power (SF Memory) carts.  It took many months and combined input from several people including nocash, sanni, and BennVenn.

A little background, the flash chips used in the Nintendo Power carts (both SF Memory and GB Memory) include a page buffer/mapping register that is checked when reading games in the normal flash area.  The games written to the cart will not work properly without the correct mapping.  The flash chips use non-standard, undocumented commands to access the mapping data.

I'm working on an update to my "enhanced" code with full write support for the NP carts.  It is the last SNES cart type that I set out to support.

On a different but related note, to gain insight into the SF Memory cart, I built a GB cart interface to sit in between the GB and GB Memory cart.  Using the cart interface to log data, we were able to unlock the GB Memory cart and we can now completely rewrite it as well.  I decided to build a standalone GB cart reader around the cart interface similar to the SNES cart reader.  I plan to eventually release the code when all of the mappers are supported - I need to finish the MMM01 and TAMA5 mappers.

Good Luck!
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Mar 11, 2016, 07:36 pm
I ported my Nintendo Cart Reader sketch from using the standard Arduino digitalread/write functions to using direct port manipulation. Everything is now faster than before, especially writing the 29F032 flashrom did benefit since now it's twice as fast as before.

I also added a little content viewer for the N64 Controller Pak so that before you dump it you see what games are actually on it:
(https://dl.dropboxusercontent.com/u/20912715/snes/Snes_Cart_Reader_Mega_Shield/cpak_read.jpg)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: nivalis on Mar 12, 2016, 07:48 am
I've been following this project closely on this and the other forums, and I have a question that you may be able to answer!
The NP cart pcb seems to have two 16mbit MX 29F1601MC roms, but the PCB itself has the traces for a third rom chip, which is also silkscreen marked with "16M Flash"

Would it be possible to populate that third slot with an additional 16M flash rom, bumping the total from 32 to 48mbit?
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Mar 12, 2016, 11:57 am
What is missing right now is how to address it. Since the Hirom mapping can only be 4MB total, we would need either an Ex-Hirom mapping or some way of temporarily remapping the 3rd chip into the address space of the 2nd.

There are also several pins on the MX15001 chip that can be pulled either low or high with resistors so maybe they configure how much memory is installed? I wonder what happens when you switch those resistors around.

Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Mar 13, 2016, 01:07 am
There was a supplier on Aliexpress that was selling loose 29F1601 chips.  I bought a few and confirmed they were the real deal.  The chips were not new and appeared to be pulled off boards.  I did a lot of testing of the NP flash code using a single 29F1601 in sanni's original flashrom writer board. 

I primarily picked up the chips to figure out the hidden register/page buffer commands but I also wanted to eventually add a 3rd flash chip to the carts.  It should be a fun project to attempt.  I don't know when I'll get around to doing it.  I still have to optimize the flash writing in the Enhanced code and I'm a bit sidetracked finishing the savegame code for the last GB mappers.

Good Luck!
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Mar 19, 2016, 06:51 pm
Some impressions:

(https://dl.dropboxusercontent.com/u/20912715/snes/Snes_Cart_Reader_Mega_Shield/front_v4%20(Medium).jpg)

(https://dl.dropboxusercontent.com/u/20912715/snes/Snes_Cart_Reader_Mega_Shield/back_v4%20(Medium).jpg)

(https://dl.dropboxusercontent.com/u/20912715/snes/Snes_Cart_Reader_Mega_Shield/build_front_v4.jpg)

(https://dl.dropboxusercontent.com/u/20912715/snes/Snes_Cart_Reader_Mega_Shield/build_back_v4.jpg)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: dtp35 on Mar 21, 2016, 01:54 pm
Hello All,

I'm in the process as making one for myself. I love the idea of downloading and uploading save games from SNES carts!

I found the OLED screen on ebay. But i can't find a SD card with the pins facing down. Only pins facing up. Do you have a ebay number with one? OR did you remove the pins and make them face down?

In the pictures there is a small pcb on the back. What is it? and what does it do? I presume i only need the LCD and SD card.

Thanks for your help and this great project!! Hopfully my PCB works first go.

D.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: zzattack on Mar 21, 2016, 02:07 pm
Yep, I desoldered the SD card header and put it back on the other side. I think on the OLED two pins were also swapped. No biggie.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Mar 21, 2016, 05:08 pm
On the currenct version of the shield you can select the Oled screens polarity with two solder jumpers
(https://dl.dropboxusercontent.com/u/20912715/snes/Snes_Cart_Reader_Mega_Shield/oled_config.jpg)

Here are the parts I recommend:
Arduino Mega 2560: aliexpress.com/item/Mega-2560-CH340G-ATmega2560-16AU-Compatible-for-Arduino-Mega-2560/32517341214.html
Oled screen: ebay.com/itm/351493706885
SD module: ebay.com/itm/291551876341

You need to desolder the pins from the sd module and resolder them to the other side. Just apply so much solder that all pins are covered at the same time together in one big blob and then heat the blob until the pins fall out.

The small pcb on the back is a clock generator, you need that only for SA-1 games afaik. Personally I had no luck with the newer SA-1 pcbs anyway so I wouldn't buy it unless you want to tinker with the SA-1 games. For NP carts the Arduino can generate the clock signal by itself so the clock generator is not needed there also.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: joseuro on Mar 22, 2016, 12:47 am
 Hello, greetings to all, and thank you very much to all the people who have made this project. Really, thank you.

I am not a professional electronics, I am only an amateur, with a few small electronic knowledge.

Long ago I follow this project and it is something that I've been waiting for a long time.

Before this, I had looked, the advances made by "The Man Behind the Curtain" I am interested in extracting the saves of the N64 cartridges.  

I have a game cartridge of The Legend of Zelda Majora's Mask, with my save data stored in it, which I spent it many hours and that a long time ago that I want to remove the Save Data from the cartridge.

I've been doing the mounting of this project, from the schematic, with my limited resources, I have managed to read all the rom of all the cartridges that I've placed in it, SuperMario, Zelda OOT, Zelda MM, F-1 World Grand Prix, etc. But, I can not read the Save Data of these cartridges. Rather, I have done wrong or something I do not have connected correctly, I have to review again the entire Assembly, to see what I've done wrong.  

Now, I'm waiting for the pieces (connectors and pcb's) that I bought in China.

But meanwhile I will continue researching with my Assembly made with a recycled connector from a broken clone console.

By the way Sanni, please, can you tell me will be able to this project, read this flashram?: MN63F81MPN, this is what I've been waiting for many years.
 
Again many thanks to all those involved in this project, a greeting to all.

I'm sorry for my bad English, I come from Spain.

Joseuro
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Mar 22, 2016, 07:43 am
I'm not sure about the MN63F81MPN flashram, I haven't found a cartridge with that chip inside yet myself. Even my Majoras Mask has the standard MX type.

So far I found out:
Animal Crossing
MN63F81MPN
April 2001

Command & Conquer
29L1100KC-15B0
May 1999

Jet Force Gemini
NTSC:29L1100KC-15B0 PAL: 29L1101KC-15B0
October 1999

Ken Griffey Jr's Slugfest
29L1100KC-15B0
May 1999

Zelda Majora's Mask
29L1100KC-15B0 or MN63F81MPN
April 2000

Megaman 64
MN63F81MPN
November 2000

NBA Courtside 2
29L1100KC-15B0
October 1999

Paper Mario
MN63F81MPN or 29L1100KC-15B0
August 2000

Pokémon Puzzle League
29L1100KC-15B0
September 2000

Pokémon Snap
29L1100KC-15B0
March 1999

Pokémon Stadium
29L1100KC-15B0
February 2000

Pokémon Stadium 2
29L1100KC-15B0 or MN63F81MPN
December 2000

Starcraft 64
29L1100KC-15B0
June 2000

Tigger's Honey Hunt
29L1100KC-15B0 or MN63F81MPN
November 2000

WWF: No Mercy
MN63F81MPN or 29L1100KC-15B0
November 2000

So I still need to buy one of the MN63F81MPN games to check it out. Auto detection of flashram type won't work but you should be able to manually choose both of the MX types and dump the save, then send the dumps to me so I can make adjustments to the code.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: joseuro on Mar 22, 2016, 10:12 am
 Ok, thank you very much for your response.

 Still, I have not managed to make a reading of a save data from any of my cartridges.

 I suspect it may be a problem with the power to the Assembly, but I'm not sure.

 I am not sure where I should connect the clock line, I have connected line of clock at two potential sites in PH3 /CS and CPU_CLK in PH1, none of the two sites work for me, I have to look at the signal with oscilloscope and checked power from the circuit.

 Of course, there is no problem, as I get to do a Dump, I will send it to you.

 If you wish, you do not buy anything, I can send you a cartridge that I have, with the MN63F81MPN chip.

 I need a little time, to check and find where I have the error.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Mar 22, 2016, 12:04 pm
I made some detailed instructions here: https://github.com/sanni/cartreader/wiki/PCB-build-guide (https://github.com/sanni/cartreader/wiki/PCB-build-guide)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: joseuro on Mar 24, 2016, 06:11 pm
Hello to all:)

 Thank you very much sanni, by this instruction manual so large and so detailed. This must have been an impressive and very laborious work for you.

 I'm using very well my holidays week :)

 Three days I've been working on my electronic Assembly and I still don't know why it does not read the save data of any of the cartridges that I have placed in it, only reads the Rom.

 I apologize for my stupidity and my ignorance, but I can't find the fault in my assembly.

 I've revised it dozens of times, without finding any error, I have checked the wiring, I have changed the power supply several times and then I decided to use a battery, to avoid electrical noise. I have changed the memory card by different each other several times, everything has been useless, I can not get it work and read the save data.

 Then I tried to change the version of arduino, without positive result, I'm back up libraries several times, same result, I have uploaded the program arduino card several times, also without result. I'm very frustrated, I don't know what more can I do.

 Then I thought, this can be a problem of clock signal or something similar and I have decided to check the clock signal with my oscilloscope in pin 57(PH1) CPU_CLK, this has left me amazed, here is a reading with too much noise and a triangular wave, ranging between 28 Mhz and 32 Mhz. should be here in this pin a perfectly square wave signal is not true? with 1.6 Mhz. I apologize for my ignorance.

 Please sanni can you tell me, What signal must be present at this pin 57(PH1) CPU_CLK, thank you.
 
 I must take my Chinese clone of the arduino mega 2560 and delicately let it fall into the dustbin. Ha, ha, ha :)

 Believe me, I very much regret the inconvenience that I am causing, due to my ignorance and I apologise humbly, thank you to all.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: joseuro on Mar 24, 2016, 06:29 pm
Another photo of the reading of the oscilloscope, because in the previous message I could not upload it, I've exceeded upload limit per message.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Mar 24, 2016, 07:46 pm
I'm not generating a constant clock signal on that pin, it just pulses the clock shortly when it's reading/writing. Also the clock signal is just needed for eeprom save games. So even without it all other save types should still work.
What game(s) are you trying exactly?
What exactly is happening when you try to read save games?
It could be that your wires are just too long, since I never tested the code with anything else than my pcb.

Does the n64.txt get read from the SD card correctly so that it shows the right save type for the game in the oled screen?
Do you run your Arduino with 5V or 3.3V?
Do you have the S_Dat pin(n64 cartslot pinout (https://web.archive.org/web/20080620090548/http://www.crazynation.org/N64/n64_cart_info.htm)) connected to pin 7 of the Arduino and with a 1K resistor to VCC? It's needed for eeprom saves.

Sometimes it's good to play the game shortly in a real console before dumping with the cart reader.

I think it's best to wait for the pcb's to arrive, so many thing that could be wrong and at the same time maybe nothing is wrong and you just found a bug in my code ;)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: joseuro on Mar 24, 2016, 10:30 pm
Thank you very much for your answer so quickly to my question.

 OK, I thought there was a constant clock signal, thank you for clarifying my doubt.

 I've read successfully the rom of these cartridges:

 - Super Mario 64
 - Zelda OOT
 - Zelda MM
 - F-1 World Grand Prix
 - Paper Mario

 Before reading the savedata of these cartridges, the program does not recognize what cartridge is it, and of course, the n64.txt is placed at the root of the sd card, along with the rest of files, snes.txt , cpak.txt, etc.

 Then when I try to read the savedata of either of them, it gives me this error: "Savetype error press button" I think that this is better see some pictures.
 With Super Mario cartridge inserted in it.

 
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: joseuro on Mar 24, 2016, 10:39 pm
I'm powering the arduino pcb with 5v:

 - Oled Screen directly to 5v. No problem, manufacturer say 3v to 5v
 - The SD card directly to 5v, this is not a problem, because this card has installed an AMS1117-3v3
 - Cartridge has connected the power directly to the Arduino board to 3v3 and gnd pin respectively.
 - If of course S_Dat is connected to pin 7 and with 1k resistor to 3v3
 - The rest of the electronic circuit is connected as shown in the schematic, so I revised everything several times :)

 Yes, I've also tried playing around with the N64 cartridge, before reading, this is one thing that I also thought.

 I think you're right, is better for me to wait for arriving pcb's, what happens is, what I've been so long time waiting for this electronic circuit, what I'm already desperate.

 On the other hand I do not think what there is a bug in the program, chances are that I have done something wrong, maybe you're right and the wires are very long.

 I'll try to calm my enthusiasm and I wait for the pcb's, thank you very much for all and forgive my impatience :)

 Greetings to all the members of this community.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: joseuro on Mar 24, 2016, 10:45 pm
more pictures
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: joseuro on Mar 24, 2016, 11:04 pm
I am sorry, but the system will not let me upload the photos along with the text, although probably the problem is I don't know how to do it.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Mar 24, 2016, 11:17 pm
It's not reading your cartridges right. The roms you dumped should not work. Try a game you don't like that much and power it with 5V instead of 3.3V and see if you get a valid info screen then. Maybe the 3.3V from the Arduino is not good enough.

See that is how it should look like, it should give you at least the rom name without errors:
http://www.youtube.com/watch?v=myOywW-6JlM

Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: joseuro on Mar 25, 2016, 12:50 am
 Hi, again,

 I already thought of that, also I thought what it could be a power supply problem, so I use an external power supply, connected to the 5v from usb using wires and powering the cartridge directly with it. But it didn't work either, look at the picture. But I'll try again.

 But I hadn't thought to check the roms written on the sd card, I thought that it was a correct reading, good idea, thanks, in this case I should install an emulator on my PC or I can use the Everdrive to check the roms. I will prove it.

 Relative to the powering the cartridge directly with 5v Ummhh, good idea but I had not thought about that, what happens is that I love very much my cartridges and I wouldn't like to see anyone die with 5v, but I think it :)

 Thank you, until tomorrow, I'm going to bed, I'm very tired.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: MichlK on Mar 25, 2016, 07:16 am
Hi!

According to https://www.retrode.com/plug-in-adapters/ the N64 cartridges should be 3.3V. I do not own an N64, but is it possible to remove the cover of a cartridge and stick only the PCB in the console? If so, you could measure the "original-voltage" there... Just to avoid the magic blue smoke thing you know... ;)

I did not have a look at the current sourcecode / the N64 parts, but maybe some output via serial or using e.g. an Atmel ICE (looking at the variables) could also help to debug the steps of cartridge detection?! If you need help there, feel free to PM me.

Truely impressive, what all you guys did here - it is hardly comparable to the tiny project I published three years ago...  :)

Best regards,
Michael
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Mar 25, 2016, 10:23 am
so I use an external power supply, connected to the 5v from usb using wires and powering the cartridge directly with it.
Ok then it's not a power supply problem either. The N64 carts need a good 3.3V supply, for example I tried with a power supply that only gave me 3.2V and I got errors too. But that external supply you're using looks good enough for the job.

If the info screen isn't correct it can't read the cart at all and it won't dump right, neither rom nor save.

Maybe it really is just that the wires are too long. It is known in the N64 portable scene that long wires on the cartridge port make the N64 malfunctioning. But this will fix itself after you receive my pcb set :)

Truely impressive, what all you guys did here - it is hardly comparable to the tiny project I published three years ago
Thanks, open source is a really powerful thing :D
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: joseuro on Mar 25, 2016, 02:54 pm
Hello to all :)

 Hi MichIK, nice to meet you, thank you very much for your offer to help with this assembly. All possible help is welcome.

 Today I woke up early and I've been working on my assembly, without positive results.

 Thank you Sanni, I also believe what this is a problem of very long wires. I wait for arriving pcb's.

 Unfortunately for me, today I can not continue with this project, I have to meet family commitments. If it is possible for me, I retrieve the project this weekend.

 Anyway, I've discovered something, which I not had noticed before, and it is: My Paper Mario and my Zelda MM cartridges have not implemented pin 21 S_Dat, something logical because the system of saved is not EEprom, these cartridges use flashRam to savedata, so my question is how would the program reads these cartridges? Please look at the pictures.

 Thank you all, I have to go to meet my family commitments, when I can, I retrieve the project.

 A greeting to all

 Jose
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Mar 25, 2016, 07:02 pm
The flashram uses the same pins as the maskrom(=game rom). The Nintendo Cart Reader reads the flashram by sending special commands that the flashram recognizes.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Mar 31, 2016, 02:08 pm
In 2013 I made a little N64 controller tester I did adapt it for the card reader shield some time ago but it seems I never posted it here.

https://github.com/sanni/cartreader/tree/master/extras/controllertest (https://github.com/sanni/cartreader/tree/master/extras/controllertest)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: dtp30 on Apr 04, 2016, 08:17 am
Hello all,

I have started work on mine. I'm only interested in the SNES side of things. Also this is a test board to make sure i did them right :-) I found one via in the wrong spot. Once it works fine.. will make another with the propper SNES slot.

I have left off the 3V3 reg and cap. Still waiting on the OLED screens to arrive.

Whats the format on the SD card?? FAT16? FAT32? Size limit? 2GB??

D.

(http://s24.postimg.org/dei9gdlkl/WORK_SO_FAR.jpg)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Apr 04, 2016, 08:34 am
I'm using 4GB and Fat32 but 32GB cards work too.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Apr 04, 2016, 08:43 pm
@joseuro - The N64 reader can dump the MN63F81MPN flashram.  I have a Pokemon Stadium 2 with the MN63F81 and it dumps using the current 29L1101 save code.  The Autodetect does not work as the current reader code does not have the flash id information for the MN chip.

What we found is that there are two groups of flashram chips used in the N64 carts.  They're grouped as OLD_FLASH and NEW_FLASH.  The OLD_FLASH group is MX_PROTO_A, MX_A and MX_C (29L1100).  The MX_PROTO_A and MX_A are in the code base but whether they actually exist in retail carts is unknown (they are Macronix Device ID 00 and 01).  The NEW_FLASH group is MX_B_AND_D (29L1101) and MATSUSHITA (MEI) flash (MN63F81).  

The cart flashram list that sanni posted earlier is not a definitive list and it is likely that the mid to late 2000 carts could contain any of the flashram chips - 29L1100 (OLD_FLASH), 29L1101 (NEW_FLASH), or MN63F81 (NEW_FLASH).  The best way to check is to open up the cart and read the id printed on the chip.  Alternatively, you could use the current Autodetect routine which should sort you out if you have a 29L1100 or 29L1101.  If you use the Autodetect and get a "Flashram unknown" with the following bytes - 11, 11, 80, 1, 0, 32, 0, F1 then you have the MN63F81 and you should dump it using the 29L1101 mode.

I believe sanni will be updating the reader code with the MEI (MN63F81) flash id so we'll then be able to Autodetect all of the known flashram chips. 

Keep in mind that if you're planning to use the save file in an emulator that you might need to saveswap (use saturnu's Saveswap from KRIKzz's forum).

Good Luck!
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: joseuro on Apr 04, 2016, 11:46 pm
 Hello :)

 Thank you very much for the information, skaman. This is really very interesting.

 I am still waiting for the connectors that comes from China, I still have not received them.

 So I can not do saves readings still. I think what as I have the electronic circuit armed and running, I want to make several dumps of my cartridges and send them to Sanni. So, investigate them.

 As I can not do anything until I have the connectors, I'm using my little free time in other projects,

 when I can I publish my results. I have attached a file with my installation of the 2013 Sanni controller test.

 Again thank you for everything, a greeting to all :)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Apr 05, 2016, 09:11 am
Very nice :)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: dtp30 on Apr 05, 2016, 01:29 pm
With the "cart info" menu on the OLED. What info is displayed for SNES carts? Is it like Hi rom / low rom, sram size? etc. Does it read that from the cart? or do i need the snes game database file?

I wish my OLEDs screens would arrive!!! I can't wait!

Is there an option for larger text font if you use a 128 x 128 OLED screen??

D.

Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: zzattack on Apr 05, 2016, 02:42 pm
If you're that curious you should use the serial output, it has pretty much the same functionality.
The reader indeed extracts info from the rom header, so it gives info like hi/lorom, sram size, expansion chips etc.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Apr 06, 2016, 02:21 pm
Here you can buy N64 cart slots for cheap: https://www.reichelt.de/Slotstecker-Steckkartenverbinder/STECKER-50-254/3/index.html?ACTION=3&GROUPID=5218&ARTICLE=19472&OFFSET=1000&
The don't have the Nintendo own 2.5mm spacing but instead the industry standard of 2.54mm but the two outer pins on the N64 cartridge are either additional GND or unconnected so it doesn't matter if the last pin doesn't line up and the slots still work perfectly.

Direct comparison between 2.5mm slots by SuperUfo from Aliexpress and 2.54mm slots by reichelt.de, close enough.

(https://dl.dropboxusercontent.com/u/20912715/N64/n64slots.jpg)

And as a further alternative here are the slots skaman found on ebay, they also work great: http://www.ebay.com/itm/5pc-Industrial-Card-Edge-Slot-Socket-Connector-25x2P-50P-2-54mm-0-1-3A-RoHS-/140888533934
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: joseuro on Apr 06, 2016, 11:55 pm
 Thank you sanni for the links to buy the connectors, but I've been so many days waiting for them, I'll wait a few days more.
 I think that connectors should already be next to arrive by mail that as almost a month ago I bought them on Aliexpress.
 Anyway, if I make a new order, I would also have to wait and this would also be an extra expenditure of money.
 I'm investing my little free time in other projects, I have to make to my family a few electronic assemblies with pic microcontrollers.
 But I also had time to assemble this circuit (look at the attached pictures) surely you know it very well, it works perfectly. It is wonderful.
 By the way I would like to that with this circuit could be used an oled screen instead of using the monitor series of arduino, this is possible?
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: dtp30 on Apr 07, 2016, 12:55 pm
As anyone who has read my posts will know. This is a really exciting project!! I'm hugely into SNES gear. I make my own games / Do english translations. I have only done 1 translation.... BUT i have started a second. I was trying to think of some way how i could say "THANK YOU" for the time and effort spent by the people who have helped this project.

Because of this project, i found about writing to Nintendo Power Flash Carts. I didn't know anyone was working on that. I then found out about "Genjuu Ryodan". Its a NP Flash cart ONLY game. Its turn based stratgey (which i love). So i have started doing a english translation for it. Its only early days. But its almost playable. Thats what i have been working on.

D.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Apr 07, 2016, 01:56 pm
By the way I would like to that with this circuit could be used an oled screen instead of using the monitor series of arduino, this is possible?
Not with the Arudino Uno since it has not enough space for my filebrowser code but with the Arduino Mega it works.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Apr 07, 2016, 08:16 pm
As anyone who has read my posts will know. This is a really exciting project!! I'm hugely into SNES gear. I make my own games / Do english translations. I have only done 1 translation.... BUT i have started a second. I was trying to think of some way how i could say "THANK YOU" for the time and effort spent by the people who have helped this project.

Because of this project, i found about writing to Nintendo Power Flash Carts. I didn't know anyone was working on that. I then found out about "Genjuu Ryodan". Its a NP Flash cart ONLY game. Its turn based stratgey (which i love). So i have started doing a english translation for it. Its only early days. But its almost playable. Thats what i have been working on.

D.
In a way, we've opened Pandora's box when we figured out how to rewrite the NP carts.  Giving people the ability to rewrite the carts could result in the loss of some irreplaceable data.  I've dumped close to 50 different games and found 3 previously unknown NP-exclusive revisions.  These revisions were never released in retail cart form and are the last revision for each game.  Extrapolating out over the full 179 NP game list, that would mean that there might be another 8 or 9 previously unknown game revisions out there. 

For anyone that is planning on rewriting their NP cart, please consider backing up the original data (ROM + MAP).  Even if the game is a known dump (GoodTools/NoIntro/etc), the data on each NP cart is unique.  For single game carts (no menu), then the unique data is in the mapping.  For multi-game carts with menu, then the unique data is in the menu and mapping.  Even blank carts have unique data in the mapping.

I wanted to set up some type of repository to collect the original data but I didn't have the resources to do it.  I'm now working with someone that wants to archive the complete original data and plans to make it available on the web.  If anyone is willing to share their original NP dumps (Full ROM + MAP), then please PM me a link.

Good Luck with the translation!
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: dtp30 on Apr 07, 2016, 10:09 pm
In a way, we've opened Pandora's box when we figured out how to rewrite the NP carts.  Giving people the ability to rewrite the carts could result in the loss of some irreplaceable data.  I've dumped close to 50 different games and found 3 previously unknown NP-exclusive revisions.  These revisions were never released in retail cart form and are the last revision for each game.  Extrapolating out over the full 179 NP game list, that would mean that there might be another 8 or 9 previously unknown game revisions out there. 

For anyone that is planning on rewriting their NP cart, please consider backing up the original data (ROM + MAP).  Even if the game is a known dump (GoodTools/NoIntro/etc), the data on each NP cart is unique.  For single game carts (no menu), then the unique data is in the mapping.  For multi-game carts with menu, then the unique data is in the menu and mapping.  Even blank carts have unique data in the mapping.

I wanted to set up some type of repository to collect the original data but I didn't have the resources to do it.  I'm now working with someone that wants to archive the complete original data and plans to make it available on the web.  If anyone is willing to share their original NP dumps (Full ROM + MAP), then please PM me a link.

Good Luck with the translation!
Thats a realy good idea. Once my reader is finished.. i can start dumping my NP flash carts. I have quite a few.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Apr 08, 2016, 09:20 am
Great, can't wait to get some more feedback :)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: joseuro on Apr 11, 2016, 06:03 pm
Total success!!! Now I can dump all my n64 Carts

Thank you Sanni
Thank you skaman
Thank you MichIK
Thank you themanbehindthecurtain
And thanks to all the people who worked on this project :)

I still have not received the connectors purchased in China. I'm tired of waiting for them. But last Friday I received by mail the pcbs of version v5B of sanni, which I had bought more than one month ago in China.

To my despair, for not having received the connectors. I decided to try one of the pcbs received last Friday. So I decided to check one pcb at any price.

So I removed the connector of my  Plus III and I use the connector on the pcb adapter for N64.

Then I dismantled my Snes game adapter for NTSC and JAP games, I took one of the two connectors and I use it on the main Board: the Nintendo Cart Reader pcb. This connector does not included all pins but takes the pins needed to work with the N64 carts.

I've used a few metres of desoldering wire, but the result has been positive :)

Then, I assembled all the circuit and I place all the essential electronic components to make it work in N64 cart reader mode.

Now everything works perfectly with sanni pcbs, it is clear what the problem what I had and by which the circuit did not work properly was the length of the wires.

I've done my first dumps of the cartridges with chip MN63F81MPN, thanks to the skaman information, using the 29L1101 mode.

The rom and the flashram savedata are fully functional, they work perfectly on my Everdrive 64 and I don't have to do the saveswap. The ED64 recognizes the savedata in the SAVE folder at the first time and the rom of course.   

By the way skaman, I could not get the tool: "saturnu's Saveswap from Krikzz forum" all links are broken and I could not find it on Google, so I can not test these files in an emulator, I'll keep looking, thank you very much for your help.

By the way I've discovered something curious in the operation of the circuit:

 I can do the reading of the savedata on the cart in "29L1101" mode, without any problem this works fantastically well and the save data is fully functional.  But when I try to upload the savedata to the cart again in this mode: "29L1101", the program gets frozen in that moment and on the Oled Screen says: Erasing Flashram and the circuit is blocked, it does not pass that point. Then I have to turn off the power to the circuit and to restart it again.
But if I upload the savedata in autodetection mode to the cart, then the circuit upload it perfectly and without any problems. What might be the problem? I will continue investigating this matter.

Sanni thank you very much for making reality something what I had been waiting for, for many years. I'll send you a PM with the files that I have obtained, to update the sketch with the flashram MN63F81MPN. By the way I have a Paper Mario cart with 29L1100KC chip, you have to update the list.

Thanks to all :)

Again I apologize for my bad English, I'm trying to learn
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Apr 11, 2016, 06:25 pm
Looking great :)

I have ordered Animal Crossing from Japan in hope that it will have the MN63 chip. I already written a test version of the MN63 support but since I can't test it I don't know if it works or not.

You'll find saturnus ED64 Saveswap tool inside the ed64_archive_v3.zip here (http://krikzz.com/forum/index.php?topic=2298.msg23606#msg23606)

And remember you should not plug the USB cable directly into the Arduino when the N64 Adapter PCB is also plugged into the Arduino. So to upload a new version of the Cart Reader code you must first remove the N64 Adapter PCB. Because otherwise the N64 cartridge will get 5V instead of 3.3V. Although it probably won't do any damage.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: joseuro on Apr 11, 2016, 10:06 pm
 Okay, as soon as I can and I have time, I'll try the update v9 Test 1.

 The file "saturnus ED64 Saveswap tool " I have already downloaded it, is rare, this past weekend the links don't worked for me. Now yes, thanks.

 Thank you for reminding me the theme of the power of the arduino, I know that if I connect the arduino to the usb wire, then I have 5 volts on the main pcb and if the N64 adapter is plugged in, I can destroy the cartridge ;)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: dtp30 on Apr 12, 2016, 03:14 am
Hello All,

I can't get the code to compile. I selected the correct board and comport.


compilation terminated.

exit status 1
Error compiling for board Arduino/Genuino Mega or Mega 2560.

Any ideas??

D.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Apr 12, 2016, 05:40 am
Do you have all of the libraries installed?

You might want to enable verbose output in the Arduino IDE. 

File->Preferences->Show verbose output during: compilation and upload.  Check the boxes.

Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: dtp30 on Apr 12, 2016, 07:33 am
Opps.. had them in the wrong Libary DIR.

OK it compiles.... BUT only the first time... If you press compile again. It fails...

Thats very odd. BUT the board seams to work :-) I have the OLED saying somthing.. VERY EXCITING!!

I can't wait to dump some NP carts and see what games / revisions we have. If you need some where to store them. I do have a web page. Its only basic.. But i think i have heaps of HDD space...

D.

Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: dtp30 on Apr 12, 2016, 10:59 am
OK.. Mine is working OK. Just got out a NP Cart. To protect the data on it. Do i need to do a full dump + all the other items dumped aswell?? I presume keep all cart files in one directory? So you know which ones come from which cart.

On the menu layout. Can "EXIT" be added as a menu option to take you back to the main menu?? That would be handy...

Thanks again for all the hard work. This really should be fun to play with :-)

D.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Apr 12, 2016, 10:59 am
Quote
If you press compile again. It fails.
Be sure to use Arduino 1.6.7 as 1.6.8 is broken.

Where exactly do you want "Exit"? The V9 test version has a "Reset" option to reset the cart reader so it will go back to the very first menu again.

You will have to backup both the flash("Read All" in V8, "Read flash" in V9) and the mapping(Read Mapping).
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: dtp30 on Apr 13, 2016, 12:37 am
Be sure to use Arduino 1.6.7 as 1.6.8 is broken.

Where exactly do you want "Exit"? The V9 test version has a "Reset" option to reset the cart reader so it will go back to the very first menu again.

You will have to backup both the flash("Read All" in V8, "Read flash" in V9) and the mapping(Read Mapping).
Have EXIT at the bottom of each of the main menus. Like when you go into "NP Cart" in the menu that comes up under "write mapping" have EXIT there. Is that were RESET is on V9?

I downloaded the latest version of Arduino. So thats what the compile issues is. Now i know why.

D.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: dtp30 on Apr 13, 2016, 11:05 am
Some Feedback...

Starting to dump NP Flash carts. Getting a few "switch to hirom : failed".

It would be really helpfull to have another button for OK/ENTER. Is there enough I/O lines to add one?

Thanks,

D.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Apr 13, 2016, 11:45 am
Are you using the V9_test_2? You shouldn't use V8_fast with NP carts. Either V8_slow or V9_test_2. All three versions have different timing for switching the NP cart to hirom, V9_test_2 should be best.

The single button interface should work pretty good. If not then it's most likely the button you're using that is either broken or of bad quality or not long enough, I'm now using 6x6x6mm ones.
To press enter you just hold the button down as long as you like, you don't have to let go, just hold it down until something happens. But you can also tweak the behaviour of the button in the code if you want to adjust the timings.

But there is plenty I/O left to add another button if you wanted to.  At one point I had a SNES controller and TV-Output added just for fun:

(http://circuit-board.de/forum/index.php/Attachment/19827-1menu-JPG/?thumbnail=1)

(http://circuit-board.de/forum/index.php/Attachment/19826-0-JPG/?thumbnail=1)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: dtp30 on Apr 13, 2016, 11:28 pm
I was using V8_SLOW. I have now upgraded to V9_2 TEST.

The button on my board is brand new.

D.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Apr 15, 2016, 04:55 pm
V9 update:
I split the code into different files for better readability
(https://dl.dropboxusercontent.com/u/20912715/snes/Snes_Cart_Reader_Mega_Shield/tabs.jpg)

Furthermore there is now a variable npDelay that can change the timing of the switch to hirom sequence. In V8 this variable was 1, in V9 Test it was 2 and now I have increased it to 4, slowing down the command even further in hope of a better successrate.

I also added reading/writing the controller pak through a N64 controller. The controller is connected to the S_DAT pin on the N64 adapter pcb.

(https://dl.dropboxusercontent.com/u/20912715/N64/cpak/gc_n64_pinouts.png)

(https://dl.dropboxusercontent.com/u/20912715/N64/n64contr1.jpg)

It also includes a small controller test.
(https://dl.dropboxusercontent.com/u/20912715/N64/n64contr2.jpg)

My Animal Crossing cart came, so far I can read and delete the MN63 flashram chip but can't write to it yet.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: joseuro on Apr 17, 2016, 10:07 pm


 Hello to all :)

 Success, I have used the savedata file of the ZeldaMM, obtained with the snes cart reader shield in the emulator of the N64 (PJ64) and it works perfectly.

(https://drive.google.com/open?id=0B6atF-ZUAph5b19MdkwzblROZHM)

 Before opening it with the PJ64, I have done swap to the file, with the saveswap program of saturnus and then I've renamed it. Now it works perfectly.

 Thank you skaman and sanni for detailed information. Now I will concentrate on my snes carts.

 Thanks to all :)

 
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Apr 18, 2016, 01:54 pm
Just seen this, looks amazing  :)

http://64drive.retroactive.be/ultrasave.php (http://64drive.retroactive.be/ultrasave.php)

A little case like that for our Arduino cartreader would be cool.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: joseuro on Apr 18, 2016, 10:22 pm
 Hi,

 Looks very interesting and very nice UltraSave for the 64Drive :)

 Today I have tried to read the savedata of a cart with the MN63 chip, in the v9 test4 version. In the autodetect mode.

 I don't know if the program detects automatically the chip MN63 because, simply appears in the oled display "Reading Flashram", but in the oled screen does not appear what chip is it.

 But I think: it detects perfectly because then I have tried the readings obtained from the cart, the Rom and the Savedata and both work properly in the ED64.

 By the way sanni, The V9 update version is the V9 final version?
 

 (http://i66.tinypic.com/110yx6f.jpg)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Apr 18, 2016, 11:37 pm
Updated to V9C
- fixed writing to MN63 flashram.
- fixed timing error with N64 eeprom writes resulting in the first 8 bytes not being written correctly sometimes
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: dtp30 on Apr 20, 2016, 01:10 pm
A couple of things i have noticed.

"Daikaijuu Monogatari 2" isn't detected correctly. It doesn't say it has the RTC chip. It also has the rom size as 64MBit which is wrong.

"Starfox" is dected with 0 sram. It has 256k.

Are all "special chips" detected? (Except for SA1?)

D.

Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Apr 20, 2016, 07:01 pm
My Nintendo Cart Reader V9C sketch can't do any special chips.

In other news, today the N64 controller extensions came, thanks to skaman for the idea :)
(https://dl.dropboxusercontent.com/u/20912715/N64/cpak/controllerplug.jpg)

Right now I'm really happy with how my V9C code performs, most of the stuff works quite reliably.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: joseuro on Apr 24, 2016, 06:55 pm
Hi :)

 Several days ago, I've been making various reading tests of my carts with the sketch of sanni: V9C version, to check its operation. I've dumped both saves and roms of these carts:

 -Supermario 64  - 4k eeprom
 -Yoshi story    - 16k eeprom
 -Zelda OOT      - sram
 -Pokemon Snap   - flashRam 29l1100
 -Zelda MM       - flashRam Mn63F81
 -Paper Mario    - flashram 29L1100
 -Fifa 98        - controller pak save
 -Fifa 99        - controller pak save
 -NBA Pro 98     - controller pak save
 -Xena Warrior P.- controller pak save
 -World Driver C.- controller pak save
 -Turok2 Seeds of- controller pak save

 I don't have any cart with the 29l1101 chip, so I have not been able to test this chip, but I've bought a Jet Force Gemini Pal cart and I am waiting the arrival by mail.

 The files obtained, I have tried in my ED64, all files works perfectly, both the Roms and the Saves works well on the ED64.

 But I have found these problems:

 -Paper Mario Rom file does not work on PJ64 emulator, but it works well on ED64. But the save works in the ED64 and in the PJ64. I have observed what the retrieved file Rom from "Cart Reader" weighs 40MB and a Rom of the same cart, downloaded from internet, weighs 65 MB, this has made me hesitate, however the rom file that I've got of the "Cart Reader" works well on ED64.



 (http://i68.tinypic.com/axfxq1.jpg)



 -Save file of the Pokémon Snap cart, does not work on my PJ64 emulator, but it works perfectly in my ED64.

 -Rom file of the Fifa 99 works bad on the emulator PJ64 (pixelization and strange characters) this may be due to a bad dump made by me.

 -The Rom file of the cart: World Driver Championship, does not work on the emulator PJ64, Another bad dump made by me?

 I have come to this conclusion: Snes Cart Reader V9C version works perfectly, with the exception of the Paper Mario Rom which size is not the same, all files work perfectly on ED64, both the save files and the Roms files. I have appreciated very much the reset option and the autodetect of the saves chips. This is great :)

 I believe what the problems of reading of files that I have had with PJ64 emulator, are the product of a bad configuration of the emulator or some incompatibility with my operating system. Because absolutely all the obtained files work well on ED64. Including Paper Mario with 40MB size.

 But, I have found a problem. Of all my cartridges with the save on the controller pak, the "Cart Reader" only recognizes the size of the rom of one of them: the Turok 2 cartridge, all other cartridges should be put the size of the rom manually with the push button. but, however the program recognizes all the names of all the carts introduced in it.

 My conclusion: I really like how the program works, I think that is almost 100 percent, if we skipped the size of roms that need to enter them manually, everything else is perfect. At least in terms of N64 carts :)


 (http://i68.tinypic.com/2pql46q.jpg)         



 (http://i64.tinypic.com/i69lzm.jpg)



 (http://i65.tinypic.com/2wrg1u8.jpg)




 Regards :)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: dtp30 on Apr 25, 2016, 08:01 am
I'm running 9_2 beta. All i need is SNES carts stuff aswell as NP Flash Carts. What and where is the latest version?

I have some issues with checksums in the SNES menu.

GAME           info screen      dump rom
                   checksum        checksum
Lady Stalker  D58               D508   JAPAN
Simcity JR     E73                0E73   JAPAN
SIM CITY       26C               260C    PAL

Thanks,

D.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Apr 25, 2016, 09:05 am
Thanks alot joseuro  :)

Update to V9E
- Improved N64 game database, this should fix the size recognition of Paper Mario and the other games. Be sure to both upload the new sketch and copy the new n64.txt to the SD card overwriting the old.
- Fixed display of SNES checksum
- Fixed display of Flashrom ID
- added more led colors

World Rally Championship and Fifa99 might be bad dumps, it could be that I need to add more delays into the code, maybe some games have slower maskroms.

@dtp30
My newest code is the V9D in this post but concerning Snes retail games it can only dump standard hi- and lorom games, so no exrom and no special chips. That's because I don't have any special chips so I can't test them.

You can find a describtion of skamans enhanced code in this post (http://forum.arduino.cc/index.php?topic=158974.msg2358317#msg2358317) but it has a different pinout than the pcb I made because it's based on the old hardware version of the cart reader.
I have made the necessary changes to this code to run on my pcb and uploaded it here (https://dl.dropboxusercontent.com/u/20912715/snes/Snes_Cart_Reader_Mega_Shield/Cart_ROM_READER_SNES_ENHANCED_SERIAL.zip), be sure to adjust the output option to either serial or oled.
But you can also ask skaman if he has an updated version for you.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: dtp30 on Apr 25, 2016, 09:10 am
None of the games are Special chip. Just normal HI rom / Low rom games. If you want you can download the games rom. I will check it with the new code and see what happnes.

D.

PS I check SimCity on my PC. Its a low rom, 4mbit,256k sram check sum from SNES DAT file is 260C. So there is somthing wrong somewhere.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: kogami on Apr 25, 2016, 08:43 pm
Hello,

It's really good what you do !
It would be possible to add the BS-X support for Super Famicom ?

http://superfamicom.org/blog/2010/04/internals-of-a-bs-x-cartridge/

(http://www.snescentral.com/0/8/0/0800/cart.jpg)

(http://img11.hostingpics.net/pics/182195CartoucheBSx1.jpg) (http://www.hostingpics.net/viewer.php?id=182195CartoucheBSx1.jpg)

(http://img11.hostingpics.net/pics/810208CartoucheBSXA.jpg) (http://www.hostingpics.net/viewer.php?id=810208CartoucheBSXA.jpg)

(http://img11.hostingpics.net/pics/721792CartoucheBSXB.jpg) (http://www.hostingpics.net/viewer.php?id=721792CartoucheBSXB.jpg)

(http://img11.hostingpics.net/pics/236456CartoucheBSXC.jpg) (http://www.hostingpics.net/viewer.php?id=236456CartoucheBSXC.jpg)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Apr 25, 2016, 10:50 pm
@kogami,  that would be an interesting addition.  The BS-X memory packs generally use a Sharp flash chip with similar instructions to the SF Memory carts.  I have a couple of the BS-X carts that I could test.  Maybe I could look into it if I ever find some free time.  The other cart type that still needs support is the Sufami Turbo carts.  I have a bunch of the Sufami Turbo carts but I never got around to examining them.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: joseuro on Apr 26, 2016, 10:51 am
 @sanni, Thanks alot joseuro  :)

Don't worry about it sanni, you're welcome :)

I will continue doing tests this week with the new version of the Sketch, to the extent that my job allows me to do it.

As soon as I have results, I will post it.

Thank you, regards to all ;)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Apr 26, 2016, 04:18 pm
I dumped the BS-X BIOS using the normal dumping routines.  Now to figure out the interface to the flash chip in the BS memory pack. 

I also managed to dump the Sufami Turbo BIOS and carts.  In order to dump the BIOS and carts, the ROM size needs to be forced otherwise it will be an empty file.  The Sufami Turbo adapter is a bit finicky sometimes booting up.  The dumped file will always report a bad checksum because the Sufami Turbo BIOS has checksum "0000" in the header.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Apr 28, 2016, 08:07 pm
Those BS-X memory carts are kinda expensive or else I would buy one to tinker around.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on May 01, 2016, 12:31 am
Ok.  I read up on the BS cart and wrote code for my reader.

The BS cart BIOS can be dumped as normal as it has a proper header.

The BS cart SRAM needs to have the SRAM routines modified as the SRAM is mapped across banks 0x10-0x17 at addresses 0x5000-0x5FFF.

The Memory Pak data is mirrored at banks 0x40/0x50/0xC0/0xD0/0xE0/0xF0.  Dump the data using a dumpHiROM type routine.

I only have one Memory Pak right now and I was able to successfully dump the game (Super Formation Soccer) off of it.  The dumped game matches the data from a retail cart with the exception of the header (0x7FB0-0x7FDF).

I recently found a new NP dump of Lord Monarch Rev 1.1 which matched the previously known BS Lord Monarch 1.1.  The only difference between my NP dump and the BS dump was the header at 0xFFC0. 

If you dump a Memory Pak, then the game will not have a proper header but that will be the only difference from a normal cart dump UNLESS the game is a previously unknown revision.

Good Luck!
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on May 02, 2016, 10:12 am
I made a little program in Processing that splits a 4MB NP dump into single rom files. You'll need the Java Runtimes (http://www.java.com/en/download/manual.jsp) installed to use it.

https://github.com/sanni/cartreader/tree/master/extras/npsplit (https://github.com/sanni/cartreader/tree/master/extras/npsplit)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on May 03, 2016, 01:18 am
Update to V9G:
Download: https://github.com/sanni/cartreader (https://github.com/sanni/cartreader)

Changes:
Flashrom
- fixed printing of flash content

N64
- fixed save type for JPN version of Kirby 64 in n64.txt (JPN version has SRAM, PAL and US have 4k eeprom)

SNES
- added rom version to info screen (thx to skaman for the code)

Nintendo Power
- changed npdelay back to 2, if you get multiple "switched to hirom"-fails change it to either 1 or 4
- added printing of the current mapping (both even and odd bytes)
- added list of the currently flashed games' 4 byte code and the rom version/size (couldn't do name because some games have japanese letters, basicly uses the same code as the np splitter program in the above post)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: joseuro on May 03, 2016, 11:34 pm
 Hi,

This week I have received the cart "Jet Force Gemini Pal" by mail, with the 29l1101 chip. I have made it the dump and everything has been perfect. The files that I've got work properly, both in the ED64 and in the PJ64, could not be otherwise, everything perfect ;)



(http://i67.tinypic.com/aotfk1.jpg)






(http://i65.tinypic.com/5mh942.jpg)






Sanni, I have to apologize you, because in my previous post, I made a mistake, I'm wrong by putting the name of the cart that gave me problems. The cart is this: "World Driver Championship" and I wrote: "World Rally Championship". I lament much this mistake and confusion that I have created. I've already corrected the name in my previous post. I'm sorry very much.

This week I've dumped successfully these carts:

-Command and Conquer (USA) Version - flashram 29l100
-F1 World Grand Prix - 4k eeprom
-Knockout Kings 2000 - C.Pak
-Mickey Speedway - 4k eeprom
-Monaco Grand Prix - 4k eeprom
-Perfect Dark - 16k eeprom
-V Rally 99 edition - 4k eeprom
-Waialae Country Club - 4k eeprom
-Wave Race 64 (JAP) vesion - 4k eeprom
-Multi Racing Championship - 4k eeprom
-International Superstar Soccer 98 - C.pak
-Pokemon Stadium - flashram 29l1100
-Pokemon Snap - flashram 29l1100
-Lylat Wars - 4k eeprom
-Cruis'n World - 16k eeprom
-Ridge Racer 64 - 16k eeprom
-1080 Snowboarding - Sram

All the obtained files work perfectly in the ED64.

These are all the carts that I have at the moment, I need to test some of them in the PJ64 emulator. But if them working well in the ED64, them should also working perfectly in the emulator.

I still have problems with "Fifa 99" cart and with the "World Driver Championship" cart, in the emulator, but I still think that it is a problem of my computer Setup. I've uninstalled version 1.7 that I had installed and I have installed the latest version of the emulator PJ64, the problems now are minor, but they persists. I refuse to believe that it is a problem of dumps, I've dumped  several times the carts and the problem persists. But if this is a problem of carts dumps, these files would not work either in the ED64, however, the obtained files work perfectly in the ED64. Definitely I think I have a bad configuration of the emulator in my computer.

That these two games, don't work well in the emulator, this is one thing that for me don't worried to much. I think that I'm not going to continue with this topic. I don't like very much the emulators. I prefer playing games in the original system and feel the emotions in the original machine.

Now I've downloaded the latest version of the Sketch V9G, when I have time I will begin testing this new version.

Although the previous version V9E was already very well, thank you sanni by the new led colours, now is amazing and very nice, thank you for updating the listing with the size of the N64 roms, the program now recognizes all my carts and their sizes, this is wonderful.

Sanni, you're simply the best ;)

Kind Regards
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on May 04, 2016, 08:08 am
Thanks for your kind words and all your testing, that really helps and motivates me.
Version 9E and 9G are basicly the same when it comes to the N64, so you don't need to retest :)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on May 05, 2016, 03:18 am
Those BS-X memory carts are kinda expensive or else I would buy one to tinker around.
Hmm...  I didn't realize that they had gotten so pricey.  I was hoping to pick up a blank Memory Pak to test code on.  Now I'm not so sure that I want to test the write code on my lone Memory Pak.  I thought I had another Memory Pak but I can't find it.

On second thought, maybe it wouldn't be good to implement the write code.  According to MatthewCallis, Memory Paks that don't show anything when you enter your house may not be blank.  Some downloaded data had a limited life and when it expired, the data was no longer accessible on the Satellaview BUT the data still exists in the Flash.

If anyone dumps their BS Memory Pak, please preserve the data.  That also goes for NP carts and any new revisions of retail carts.  If you find something that is previously undiscovered, then please consider sharing it.  If you're not sure how to share it, then message me and I'll get the data to the people that are dedicated to preserving it.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: dtp30 on May 05, 2016, 06:00 am
BIG THANKS!! To all the new SNES and NP Cart stuff. Makes it heaps more handy :-)

D.

Thanks for your kind words and all your testing, that really helps and motivates me.
Version 9E and 9G are basicly the same when it comes to the N64, so you don't need to retest :)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on May 06, 2016, 05:39 pm
True those were some really useful additions  :)

Today I implemented a CRC32 checksum for the dumped N64 roms and it now will also show the revision number.

Funny side note: The US and PAL Kirby 64 carts have 4K Eeprom. There are 4 different JPN revisions and at least one of those has Sram for saving so for now I have set all JPN revs to Sram in my n64.txt database.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on May 06, 2016, 06:25 pm
I added a CRC32 implementation into my Enhanced SNES sketch too.  It makes it quick to check a new dump against known versions.

With all of the speed improvements in the dumping code, running a CRC32 check on a SNES size ROM doesn't really take too long.

Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: dtp30 on May 08, 2016, 10:52 am
Tested the new NP fuctions. Having the games list was realy handy! Even if its only a SHVC number!!!
Only thing i noticed is with a "blank" NP Flash Cart. The menu bombs out. I thought it would just say SHVC-MENU.... I personaly would leave it.. as i doubt there are many "blank" carts out there....

I think the Print mapping doesn't have enough room on the LCD. I have been able to find a 256X64 OLED screen. i presume its just filling the screen? Were as Menus all have CR's at the end??

D.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on May 09, 2016, 03:44 am
Well you gonna like the V12 release too I bet, now the SHVC number has a little dot in front of it ;)
Finally added Sram reading for Nintendo Power games, switching to the different games might still be a little buggy since I don't check yet if the switch was successful.

Also I read how to use progmem and put all the menus in the flash instead of sram, so that now I'm again down to 60% sram even after adding all the new stuff.

From now on you need the Adafruit Si5351 Clock Generator for the Nintendo Power cart. It's just more reliable compared to manually clocking the MX15001 chip like I did before.
But if you don't have one you can still use the NP cart by simply plugging in a wire in CLK0 and hoping that this antenna catches enough noise to toggle the clk pin a few times...which actually works surprisingly well.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: dtp30 on May 09, 2016, 12:55 pm
Well i better go buy some clock gen boards. :-)

How many frequencies do you need? Could you replace the board with fixed crystals instead? I presume its being used because it is software controllable??

D.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on May 09, 2016, 09:34 pm
Concerning Nintendo Power carts I have tried so far:
- 500 and 666kHz clock signal generated by Arduino -> works but not 100% reliable
- 2Mhz crystal from N64 controller pcb -> doesn't work, very unreliable,
- 10Mhz Adafruit clock generator -> works reliably
- 21Mhz Adafruit clock generator -> I feel like it works a little worse than 10Mhz

Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: dtp30 on May 10, 2016, 08:12 am
Not sure if its a code thing.. or the jumper pins on the PCB are being like small antenna's.

I built a external clock circuit. But no matter were i put the clk jumpers OR completely remove them. The NP Flash carts i have still works !!

I presume with your next version of code the extrernal clock will have to be connected in order for NP Flash carts to work?
D.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Jun 17, 2016, 11:18 am
Yes the external clock has to be connected from now on to dump NP carts.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: Pickle136 on Jun 19, 2016, 03:28 pm
anyone have a spare 62 pin snes cart connector? PM if you do.

I found something that should work.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: erendorn on Jun 24, 2016, 10:57 pm
Hello
I'd like to try to build a rom reader to backup my n64 saves. From what I've read in this thread, it seems doable to extract these saves. Are there some instructions available for the build?
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Jun 24, 2016, 11:10 pm
Yes extracting N64 saves works perfectly.

You can either:
- wait a month until I build new cart readers and buy one from me
- have the pcb fabricated yourself using the gerber files from here: https://github.com/sanni/cartreader/tree/master/pcb
- manually wire everything using this pinout: https://github.com/sanni/cartreader/blob/master/pinout.xls
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: erendorn on Jun 27, 2016, 08:19 am
Yes extracting N64 saves works perfectly.

You can either:
- wait a month until I build new cart readers and buy one from me
- have the pcb fabricated yourself using the gerber files from here: https://github.com/sanni/cartreader/tree/master/pcb
- manually wire everything using this pinout: https://github.com/sanni/cartreader/blob/master/pinout.xls
Thanks! I'm quite tempted by buying you one. (I can wait, as I suppose my carts aren't going anywhere)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Jun 27, 2016, 08:55 am
I did a small hardware revision too, really just rearranged how everything plugs together, but it looks quite nice.
Hopefully I didn't do anything wrong and all will work, so now I have to wait until it arrives from China.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: SputnikBR on Jul 08, 2016, 05:06 am
Hello. first thank you all for sharing this information!
Anyone know if there is a tutorial for beginners "newbies". because until then I think not being able to reproduce this content ...
I would make one that works only for SNES save sram cartridges.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Jul 08, 2016, 07:40 am
Did you already have a look at the Wiki (https://github.com/sanni/cartreader/wiki/PCB-Build-guide)?  :)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: SputnikBR on Jul 08, 2016, 04:37 pm
Your content is professional level  :o
I want to make something simpler, like the version of MichlK or your own first version of MichlK with shield.

Sanni its first version made in the shield, does not use the 74HC595?
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Jul 08, 2016, 05:30 pm
You can buy an Arduino Mega 2560 and this Arduino Mega Prototype Shield (http://www.ebay.com/itm/201205316404) and take a Snes Cartridge Slot from an Action Replay cheat cartridge and just wire it accordingly to the pinout.xls (https://github.com/sanni/cartreader/raw/master/pinout.xls).
Just connect the pins in the column named Arduino with the pins in the column named SNES.

Example:
Connect Arduino Pin A0 to SNES cartridge slot pin A0

Or another example:
Connect Arduino D30 to SNES cartridge slot pin D7

So just like the excel sheet tells you. Just ignore every other column except Arduino and SNES.
Also you don't have to wire SNES cart slot pins 1,2,3,4,32,33,34,35,28,29,30,31,59,60,61,62,24,25,55,56.

Snes Cartridge Slot pinout:
Code: [Select]

                  +--------+
     21.477MHz Clock |  1  32 | /WRAM
              EXPAND |  2  33 | REFRESH
                 PA6 |  3  34 | PA7
               /PARD |  4  35 | /PAWR
                     |--------|
                 GND |  5  36 | GND
F                A11 |  6  37 | A12
r                A10 |  7  38 | A13
o                 A9 |  8  39 | A14
n                 A8 |  9  40 | A15
t                 A7 | 10  41 | A16
                  A6 | 11  42 | A17
o                 A5 | 12  43 | A18
f                 A4 | 13  44 | A19
                  A3 | 14  45 | A20
c                 A2 | 15  46 | A21
a                 A1 | 16  47 | A22
r                 A0 | 17  48 | A23
t               /IRQ | 18  49 | /CART
                  D0 | 19  50 | D4
                  D1 | 20  51 | D5
                  D2 | 21  52 | D6
                  D3 | 22  53 | D7
                 /RD | 23  54 | /WR
   CIC out data (p1) | 24  55 | CIC out data (p2)
    CIC in data (p7) | 25  56 | CIC in clock (p6)
              /RESET | 26  57 | CPU_CLOCK
                 Vcc | 27  58 | Vcc
                     |--------|
                 PA0 | 28  59 | PA1
                 PA2 | 29  60 | PA3
                 PA4 | 30  61 | PA5
    Left Audio Input | 31  62 | Right Audio Input
                     +--------+


Then use this code (http://forums.nesdev.com/viewtopic.php?f=12&t=14096&start=15#p170366) made by Tamanegi_taro on your Arduino. That way you don't need an SD card.

(http://pds.exblog.jp/pds/1/201605/06/19/a0340819_19241936.jpg)

But it's a lot easier to solder on a printed circuit board compared to wiring everything by hand.
None of my versions use the 74HC595 because the Arduino Mega has enough pins.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: SputnikBR on Jul 08, 2016, 09:09 pm
Thank you very much!
I believe I am now able to do it. I'll buy the card connector snes and once you get will begin!
a question:
I have a ATmega1280 arduino think I can have compatibility problems?
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Jul 08, 2016, 09:29 pm
The code should also work with an Atmega1280 but I never tested it. :)


In other news:
I've been playing around with a new pcb design that integrates the N64 adapter into the main pcb.

(https://dl.dropboxusercontent.com/u/20912715/snes/Snes_Cart_Reader_Mega_Shield/acryl1.jpg)

Makes everything look a little bit nicer. Featurewise it's the same as before and also uses the same parts.

(https://dl.dropboxusercontent.com/u/20912715/snes/Snes_Cart_Reader_Mega_Shield/acryl2.jpg)

It does need a bottom plate though since the N64 part of the pcb overhangs the Arduino quite a bit.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: Pickle136 on Jul 09, 2016, 01:55 am
I have 9 extra pcb boards for the original layout. If anyone needs one I am selling them for $2 + shipping apiece.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: SputnikBR on Jul 10, 2016, 07:47 am
Sanni,

it is necessary resistor 470 ohm to connect arduino pinout directly on Snes Cartridge Slot pinout?
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Jul 10, 2016, 01:51 pm
The 470 Ohm resistors are for safety in case you solder something wrong.

So if you use a PCB, you don't need it.
If you solder many wires instead and you are sure that you won't connect them wrong then you also don't need it. But if you connect them wrong e.g. short two address pins together because a little strand from one wire touches the other wire then the Arduino can take damage.

So if you have the resistors then I would install them. But if you don't have that many resistors then just check everything again before you turn it on so you can be sure there are no short circuits.

My tip: Buy one of the spare PCB's in the post above yours, it makes everything so much easier.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: SputnikBR on Jul 10, 2016, 02:46 pm
I will do this test, if it works I will buy the pcb.
thanks again!
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: SputnikBR on Jul 12, 2016, 03:10 am
Sanni,

I did exactly as you instructed and is working. At the moment it is possible to read the ROM and save the SRAM.
It's not pretty but it works, used as a bus connector of an old N64 adaptation cartridge.
Now I want to upgrade, I write to SRAM in cartridges.
I read "http://forums.nesdev.com/viewtopic.php?f=12&t=14096" the Tamanegi_taro replaced some components of its original design by others.
Can you guide me what components and the simplest way to start recording the SRAM directly in the cartridge?

His latest version of the PCB this very cool! you think to produce and sell them?

(https://drive.google.com/file/d/0B29D8iJRA0WSWEVVdW5UTlR2MDA/view?usp=sharing)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Jul 12, 2016, 06:11 am
If you're able to read the SRAM, then you should be able to write to the SRAM (except for SA-1 carts).
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: SputnikBR on Jul 12, 2016, 06:35 am
Thanks for answering skaman. I can not write the ram, Serial GUI always hangs. I thought it was some hardware missing ...
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Jul 12, 2016, 10:51 am
If you add an SD card to your current build you can use my latest code together with the Arduino Serial Monitor, doesn't look as nice though ;)

(http://house4u.com.ua/photos/solar-controller/arduino-SD-sch.jpg)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: SputnikBR on Jul 12, 2016, 07:13 pm
My Arduino Serial Monitor does not show anything. I am using your code and added an SD shield connecting wires as your guidance.

Do you have any idea?
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Jul 12, 2016, 07:24 pm
Did you edit the source code to disable the oled and enable the serial monitor like this:

Quote
/******************************************
   Choose Output
******************************************/
#define enable_OLED 0
#define enable_Serial 1
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: SputnikBR on Jul 12, 2016, 07:54 pm
I had not done it. :)
Now I made this modification and monitor serial works. however I have some error of shield SD, I'm using a different model of your although I have the wires connected properly. I will again analyze the shield wires SD
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: SputnikBR on Jul 13, 2016, 08:08 pm
I bought another SD module, and now everything is working!
I can finally keep my old snes save security.
In the future perhaps I will update to support N64, for now I'm happy only supporting snes.

 :D  :D  :D
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: Pickle136 on Jul 14, 2016, 01:29 pm
is snescic-lock-resync.hex the correct file to flash to the PIC12629?
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Jul 14, 2016, 03:51 pm
Yes the snescic-lock-resync.hex on my github page under extras is the exact file I'm always flashing to the PIC12629.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Jul 26, 2016, 09:54 am
Some more images of the current version:

N64:
(https://dl.dropboxusercontent.com/u/20912715/snes/Snes_Cart_Reader_Mega_Shield/v7/n64_info.jpg)
(https://dl.dropboxusercontent.com/u/20912715/snes/Snes_Cart_Reader_Mega_Shield/v7/n64_menu.jpg)
(https://dl.dropboxusercontent.com/u/20912715/snes/Snes_Cart_Reader_Mega_Shield/v7/n64_read_rom.jpg)
(https://dl.dropboxusercontent.com/u/20912715/snes/Snes_Cart_Reader_Mega_Shield/v7/n64_read_eep.jpg)
(https://dl.dropboxusercontent.com/u/20912715/snes/Snes_Cart_Reader_Mega_Shield/v7/n64_write_eep.jpg)
(https://dl.dropboxusercontent.com/u/20912715/snes/Snes_Cart_Reader_Mega_Shield/v7/n64_write_flash.jpg)

SNES:
(https://dl.dropboxusercontent.com/u/20912715/snes/Snes_Cart_Reader_Mega_Shield/v7/snes_cart.jpg)
(https://dl.dropboxusercontent.com/u/20912715/snes/Snes_Cart_Reader_Mega_Shield/v7/snes_info.jpg)
(https://dl.dropboxusercontent.com/u/20912715/snes/Snes_Cart_Reader_Mega_Shield/v7/snes_menu.jpg)
(https://dl.dropboxusercontent.com/u/20912715/snes/Snes_Cart_Reader_Mega_Shield/v7/snes_readrom.jpg)
(https://dl.dropboxusercontent.com/u/20912715/snes/Snes_Cart_Reader_Mega_Shield/v7/snes_sram_read.jpg)
(https://dl.dropboxusercontent.com/u/20912715/snes/Snes_Cart_Reader_Mega_Shield/v7/snes_sram_write.jpg)

29F033:
(https://dl.dropboxusercontent.com/u/20912715/snes/Snes_Cart_Reader_Mega_Shield/v7/29f033.jpg)
(https://dl.dropboxusercontent.com/u/20912715/snes/Snes_Cart_Reader_Mega_Shield/v7/29f033_id.jpg)
(https://dl.dropboxusercontent.com/u/20912715/snes/Snes_Cart_Reader_Mega_Shield/v7/29f033_write.jpg)

29L3211:
(https://dl.dropboxusercontent.com/u/20912715/snes/Snes_Cart_Reader_Mega_Shield/v7/29L3211.jpg)
(https://dl.dropboxusercontent.com/u/20912715/snes/Snes_Cart_Reader_Mega_Shield/v7/29L3211_id.jpg)
(https://dl.dropboxusercontent.com/u/20912715/snes/Snes_Cart_Reader_Mega_Shield/v7/29L3211_menu.jpg)
(https://dl.dropboxusercontent.com/u/20912715/snes/Snes_Cart_Reader_Mega_Shield/v7/29L3211_write.jpg)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: Pickle136 on Jul 28, 2016, 01:47 am
I put my snesCIC PIC on today and I cant get my starocean to dump correctly.

(http://i.imgur.com/wjlmrSs.png)

Version is 1.0 and Checksum is 13B8. I dont know why it doesnt say SA1 or 48 mbit instead of 64 mbit.

(http://i.imgur.com/iFOJWUR.png)

Filesize on SD is always 0

(http://i.imgur.com/fHw3H0e.jpg)

Tried different USB sources one which is self powered.
Cleaned the cart
Normal carts still work, with the same setup

Is there anything special needed to set in the arduino code?
Anything else I should check?
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Jul 28, 2016, 04:38 am
Star Ocean is not an SA-1 cart.  Star Ocean uses the SDD1 chip.

I don't think sanni has migrated all of the Enhanced cart code into his new codebase.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Jul 28, 2016, 08:14 am
That's true, I haven't included all the special carts yet, Star Ocean is on my buy list however together with Megaman X2. So sooner or later I'll be able to add support.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Jul 28, 2016, 09:15 pm
Nice job on the new hardware!

If I ever finish the updated Enhanced code, then I'll look further into merging the enhancements into the new code base.  I tested moving some of the Enhanced code to the new code base but the port manipulation broke the timing.  The carts that need specific register settings might not work due to the faster direct port manipulation breaking the timing.

Enhanced code has read/write support for the Satellaview carts including the Memory Paks.  I also added support for Sufami Turbo carts awhile back.  The modified code includes an "Express" mode that will dump the complete contents of whatever cart (and memory pak) is plugged in once the "Dump Cart" option is selected.  Express mode works great for NP carts as it will dump everything (flash, flash map, menu, individual games, and individual save files) without any intervention.  Express mode runs continuously until good dumps (checksum matches) are found and will reboot the reader if needed and continue dumping.  Express mode makes dumping 100+ NP carts a much simpler operation.

There's one item left to do for the Enhanced code and it is the SA-1 SRAM writes.  I can now modify the SRAM contents but I'm having difficulty getting the SA-1 to write a complete new save file.  More testing to do.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: Pickle136 on Jul 29, 2016, 02:59 am
My mistake getting the SA-1 mixed up with the SDD1.
But im giving it a try to add the support myself. Ive can handle the detection and setting the correct details, but theres still something wrong with my dump code.

I tried to mimic the code in the Michik zip (Can i just compile the Michik ino code and run that?)

I suppose the issues reside with the memory areas or maybe it has timing probs?

Code: [Select]
  // Dump SDD1 High-type ROM
  else if ((romType == HI) && (romChips == 69)) {
    println_Msg(F("Dumping SDD1 HiRom..."));
    display_Update();

    controlIn_SNES();
    byte initialSOMap = readBank_SNES(0, 18439);
   
    for (int currMemmap=0; currMemmap < (numBanks / 16); currMemmap++) {

      dataOut();
      controlOut_SNES();
     
      writeBank_SNES(0, 18439, currMemmap);

      dataIn();
      controlIn_SNES();
     
      for (int currBank = 240; currBank < 256; currBank++) {
        for (long currByte = 0; currByte < 65536; currByte += 512) {
          for (unsigned long c = 0; c < 512; c++) {
            sdBuffer[c] = readBank_SNES(currBank, currByte + c);
          }
          myFile.write(sdBuffer, 512);
        }
      }
    }
   
    dataOut();
    controlOut_SNES();
   
    writeBank_SNES(0, 18439, initialSOMap);
   
    dataIn();
    controlIn_SNES();
  }


Edit: I got it to work! Sanni are you up for patch through github?
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Jul 29, 2016, 08:35 am
Sure, I think if there is a pull request I can click yes and the code will be updated.

Great work. :)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: SputnikBR on Jul 29, 2016, 10:08 pm
sup!
To Read and writes SFC Nintendo Power Cartridges, is necessary Adafruit Clock Generator?
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Jul 31, 2016, 12:20 pm
I've added an alternative NP module (https://raw.githubusercontent.com/sanni/cartreader/master/extras/modules/NP/NP.ino) that allows you to read/write NP carts without the clock generator. It's not as reliable but it should work most of the time.
Just overwrite the default NP.ino with this and reupload to the Arduino.

The CLK0 jumper needs to be in the down position for it to work.

(https://dl.dropboxusercontent.com/u/20912715/snes/Snes_Cart_Reader_Mega_Shield/wiki/npnoclkjump.jpg)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: Guchion on Aug 03, 2016, 11:52 am
This is a really cool project, is there somewhere I can buy a kit?
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: joneco on Aug 03, 2016, 03:04 pm
Hi, how can i buy the cartridges socket? is it easy to buy, is it a standard one?
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Aug 03, 2016, 03:08 pm
You can either use the cart slot out of a dead console or buy one from China, I got some links in my wiki (https://github.com/sanni/cartreader/wiki/PCB-Needed-Parts).
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: joneco on Aug 03, 2016, 03:14 pm
You can either use the cart slot out of a dead console or buy one from China, I got some links in my wiki (https://github.com/sanni/cartreader/wiki/PCB-Needed-Parts).

Nice, i think i will buy a dead console =).
have you tried to play it direct from the cartridge in any pc emulator?
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Aug 04, 2016, 06:04 pm
have you tried to play it direct from the cartridge in any pc emulator?
No, this cart reader was designed as a standalone tool to read/write from cartridges to an sd card. What you want is a Retrode.

Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: erendorn on Aug 08, 2016, 08:43 pm
Some more images of the current version:

N64:


SNES:


29F033:


29L3211:

Wow, this looks stunning. How much work and pieces are needed to get to such a result?

Edit: maybe it's best I'll read the wiki before asking questions :)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: SputnikBR on Aug 10, 2016, 04:31 pm
Sanni,
I received my SF cartridge and tested with your extra module NP.ino recorded and tested various roms and everything worked perfectly!
If possible, answer me some questions:
1-It is possible to implement the functions "NP game menu items" original starting NP.ino for extra NP.ino module?
2-It is possible to recreate the original menu SF Cartridge?
3-How to add more than one rom using mapping or other method?
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Aug 10, 2016, 05:30 pm
1. The clock generated by the Arduino is not reliable enough to successfully change the mapping multiple times in a row. You need the Adafruit Clock Generator for that or improvee my clock code.
As an alternative I have written a desktop program that splits the 4MB raw NP dump into the different games, maybe try that (https://github.com/sanni/cartreader/tree/master/extras/npsplit).

2. Yes, but it's complicated. You find all the info here (http://problemkaputt.de/fullsnes.htm#snescartnintendopowerflashcard) if you want to dive deeper. I have not done it myself yet, so I can't really help you.

3. By adding a menu, see 2.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Aug 12, 2016, 04:57 am
Success!  I've got SA-1 SRAM writes working.  It took weeks of testing code to find out how to interact with the SA-1.  Thankfully, I've finally got the code to make the SA-1 write new files to the SRAM properly.

Thanks to Vitor Vilela, AWJ, and nocash for their insight into the SA-1!

Here's the SA-1 SRAM write code added into writeSRAM() from the old code base:
Code: [Select]
      // SA-1
      if ((sramSize != 0) && ((romChips == 0x34)||(romChips == 0x35))) {
        lastByte = (long(sramSize) * 0x80);
        display.print(sramSize / 8);
        display.println(F("Kb SRAM"));
        display.println(F("Writing BW-RAM..."));
        display.display();

        clockgen.set_freq(357954500ULL, SI5351_PLL_FIXED, SI5351_CLK1);
        clockgen.output_enable(SI5351_CLK1, 1);
        dataOut();
        controlOut();

        // Direct writes to BW-RAM (SRAM) in banks 0x40-0x43 don't work
        // Break BW-RAM (SRAM) into 0x2000 blocks
        // Use $2225 to map BW-RAM block to 0x6000-0x7FFF
        // Writes must be to entire address range 0x0000-0x7FFF
        byte lastBlock = 0;
        lastBlock = lastByte / 0x2000;
        digitalWrite(csPin, HIGH);
       
        for (byte currBlock = 0; currBlock < lastBlock; currBlock++) {
          writeBank(0, 0x2225, currBlock); // Set 0x2225 (SA-1 BMAP) to map SRAM Block to 0x6000-0x7FFF
          writeBank(0, 0x2227, 0x80);      // Set 0x2227 to 0x80  SA-1 SWBE BW-RAM Write Enable
          for (long currByte = 0x0000; currByte < 0x8000; currByte += 512) {
            if (currByte < 0x6000) {
              for (unsigned long c = 0; c < 512; c++) {
                writeBank(0, currByte + c, currBlock + lastBlock);  // Shift to bypass protected 1st 0x100 bytes
              }
            }
            else {
              myFile.read(SDBuffer, 512);
              for (unsigned long c = 0; c < 512; c++) {
                writeBank(0, currByte + c, SDBuffer[c]);
              }
            }
          }
        }
        writeBank(0, 0x2227, 0x00); // Set 0x2227 to 0x00  SA-1 SWBE BW-RAM Write Disable
        digitalWrite(csPin, LOW);
        clockgen.output_enable(SI5351_CLK1, 0);       
      }

After the write completes and verifies, I soft_Reset() to clear the CLK1 clockgen settings since they might interfere with other cart operations.

There is also a bug in the old readSRAM() code.  Replace "if (!myFile.open(fileName, O_RDWR | O_CREAT)) {" with "if (!myFile.open(fileName, O_RDWR | O_CREAT | O_TRUNC)) {".  Otherwise the SRAM verify will fail when writing a smaller SRAM file after writing a larger SRAM file since the TEMP file remains at the larger size.  I found this out when writing a 64K file after a 256K file.

Looking back at the old posts in this thread, it has been exactly 1 year and 2 months since I dumped the first SA-1 cart.  Writing the SRAM was the last item on the SA-1 to-do list.  In fact, SA-1 SRAM writes is the last item on my entire Enhanced cart to-do list.  All of the Enhanced chip carts are now supported including fully unlocking the Nintendo Power carts (what a process that was!).  I can finally say that I'm done adding support for all of the Enhanced carts.

I'll work on cleaning up the modified Enhanced code for a final release.

Thanks to everyone who helped along the way especially MichlK, sanni, nocash, byuu, ikari_01, BennVenn, caitsith2, Tamanegi_taro, AWJ, Vitor Vilela, and the whole SNESDEV community!


Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: phreak97 on Aug 15, 2016, 06:00 am
Sanni,
I received my SF cartridge and tested with your extra module NP.ino recorded and tested various roms and everything worked perfectly!
If possible, answer me some questions:
1-It is possible to implement the functions "NP game menu items" original starting NP.ino for extra NP.ino module?
2-It is possible to recreate the original menu SF Cartridge?
3-How to add more than one rom using mapping or other method?
Did you figure out the menus? I'm trying to work it out too.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Aug 15, 2016, 12:05 pm
All of the NP menu and mapping info can be found in nocash's latest FullSNES document that sanni linked to. 

The menu format was documented years ago but no one knew about the mapping until sanni, nocash and I started working on it.  If anyone wants to see how the mapping was figured out, the information is in a long thread on snesdev:  http://forums.nesdev.com/viewtopic.php?f=12&t=11453

I've created a custom cart with a US SMW + SMAS combo.  The menu engine is still in Japanese but I made the game titles in English.  I think the hardest part was creating the new game title bitmaps.  I wrote a small program to convert a bitmap to the format used by the menu.  Figuring out the rest of the menu and mapping data is relatively easy if you take the time to read the Nintendo Power section of the FullSNES doc.

Good Luck!
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: Syco54645 on Aug 20, 2016, 04:55 am
This is amazing. About to pull the trigger and order boards but before I do is there a hardware revision coming? It looked like there may be. Either way keep up the great work. This looks like a fun little project to build.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Aug 20, 2016, 03:47 pm
Have you seen this post by Pickle136 already:

I have 9 extra pcb boards for the original layout. If anyone needs one I am selling them for $2 + shipping apiece.
It's the earlier variant of the pcb, the one with the smaller SNES cart reader shield and the additional N64 adapter compared to my new version that has both SNES + N64 combined on a larger cart reader shield.

But the only difference between the two hardware designs is that the second design looks nicer. Functionally they are the same.

I'll also make some more kits of the second hardware version soonish if you want to wait.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Aug 20, 2016, 05:28 pm
(http://www.mediafire.com/convkey/30f6/z6dix3sxsti2o224g.jpg) (http://www.mediafire.com/view/z6dix3sxsti2o22/smw_smas.png)

Someone asked about the game entry text.  This is what my English SMW+SMAS Menu ROM looks like in the game selection screen.  The text is in a 192x12 Monochrome 1bpp BMP that is converted to the format that the Menu uses.  In case anyone cares, the font that I used is Lucida Console size 9.

Game entries begin at 0x62000 in the Menu ROM.  Additional game entries are at +0x2000 (0x64000, 0x66000, and so on).  Offset to the start of the BMP data is 0x3F.  So the converted BMP data for the first game begins at 0x6203F (+0x2000 for each successive game).

If anyone wants to test the English SMW+SMAS on their NP cart, then you can download it here:  http://www.mediafire.com/download/lp9mvlw7r15ypvb/smw_smas.zip
Edit:  http://www.mediafire.com/download/2222b5e4h07d4es/smw+smas-REVISED.zip (http://www.mediafire.com/download/2222b5e4h07d4es/smw+smas-REVISED.zip)
BASSIX caught an error in the ROM size setting for SMAS game entry (I used 0xC when it should be 0x10).  Anyone that has downloaded the original ROM please download the revised ROM.

The SMW+SMAS mapping file still has my original cart "serial number" in it.  You might want to save your original mapping file somewhere since it has the unique number assigned to your cart.  The odd bytes in the first 0x10 bytes of the mapping file are unique to each cart and basically consists of a type of production date and time stamp.

Please take any discussion of the NP carts to the SNESDEV thread here:  http://forums.nesdev.com/viewtopic.php?f=12&t=11453 (http://forums.nesdev.com/viewtopic.php?f=12&t=11453)

Good Luck!

Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: Syco54645 on Aug 21, 2016, 12:55 am
Have you seen this post by Pickle136 already:

It's the earlier variant of the pcb, the one with the smaller SNES cart reader shield and the additional N64 adapter compared to my new version that has both SNES + N64 combined on a larger cart reader shield.

But the only difference between the two hardware designs is that the second design looks nicer. Functionally they are the same.

I'll also make some more kits of the second hardware version soonish if you want to wait.
Any idea when the kits will become available? I do not really care what hardware revision I have as long as they are the same functionality wise but revision 2 has less stuff for me to lose...
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Aug 21, 2016, 11:54 pm
Maybe 2-3 months.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: mrkaylor on Aug 22, 2016, 04:06 pm
Have you seen this post by Pickle136 already:

It's the earlier variant of the pcb, the one with the smaller SNES cart reader shield and the additional N64 adapter compared to my new version that has both SNES + N64 combined on a larger cart reader shield.

But the only difference between the two hardware designs is that the second design looks nicer. Functionally they are the same.

I'll also make some more kits of the second hardware version soonish if you want to wait.
I got one of Pickle136's boards.  The transaction went great so rest easy if you order one from him.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Aug 22, 2016, 05:33 pm
Some Sketchup render of the next version:

(https://dl.dropboxusercontent.com/u/20912715/snes/Snes_Cart_Reader_Mega_Shield/cartreader_hw3.jpg)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Aug 31, 2016, 08:08 am
If anyone wants to Beta test what is likely to be the FINAL Enhanced sketch, then send me a PM.

I've made the Enhanced sketch compatible with either the Original handwired layout or the PCB layout.  There's a #define that determines at compilation whether to configure the Arduino pins for the PCB layout or else the sketch defaults to the Original handwired layout.

Take Care!



Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: RedScorpion on Aug 31, 2016, 01:26 pm
Check your PNs.

Thanks

red
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Sep 12, 2016, 08:22 pm
I started adding Game Boy Advance support.

(http://i.imgur.com/N81BLLG.jpg) (https://www.youtube.com/watch?v=kuMtNNYSVHM)

Right now it reads the rom fine on 5V but still has read errors on the intended 3.3V. I'm guessing I have some slight timing issue somewhere.

As always the source code is on my github.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: Syco54645 on Sep 20, 2016, 04:10 pm
I started adding Game Boy Advance support.

(http://i.imgur.com/N81BLLG.jpg) (https://www.youtube.com/watch?v=kuMtNNYSVHM)

Right now it reads the rom fine on 5V but still has read errors on the intended 3.3V. I'm guessing I have some slight timing issue somewhere.

As always the source code is on my github.
That is great. This will soon be an almost all in one device that most any console hacker is going to want.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Sep 22, 2016, 03:07 pm
Let's hope so  :)

I added reading/writing GBA Sram/Fram saves and also one of the many flashrom savetypes.
Still problems with dumping GBA roms on 3.3V without errors though.

Next I need to buy a Nintendo DS so I can capture the eeprom read/writes commands and timing while running GBA Backup Tool V0.21. Then I can imitate the behaviour with the Arduino.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: Syco54645 on Sep 22, 2016, 06:29 pm
That all looks quite nice and neat. Cannot wait till you get the new kits in, extremely interested. Just being able to try out rom hacks on a real cart and reflash the cart without desoldering the chip will be extremely nice. The rest of the features push it over the top though.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Sep 22, 2016, 09:09 pm
Right now I have everything here except the 64 protective resistors(between 130 and 180 Ohm, 0805 size, red in picture) and the SD module.

Build plan:
(https://dl.dropboxusercontent.com/u/20912715/snes/Snes_Cart_Reader_Mega_Shield/v8/smdparts.jpg)

So if you're ok with buying those parts separately then I can sell you an almost complete kit.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: dtp30 on Sep 25, 2016, 03:07 pm
Hello all,

There are some issues with the SRAM Test in the SNES menu.

A cart without any SRAM WILL pass! Also one of the write 00, write 11, can also fail.. but it still gets a pass aswell.

Would realy love this to be working :-)

D.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Sep 25, 2016, 03:16 pm
Hello all,

There are some issues with the SRAM Test in the SNES menu.

A cart without any flash WILL pass! Also one of the write 00, write 11, can also fail.. but it still gets a pass aswell.

Would realy love this to be working :-)

D.
Are you using the latest version?
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: dtp30 on Sep 25, 2016, 03:31 pm
Yes, V19. ,

I should have said that...
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Sep 25, 2016, 04:37 pm
There are 4 tests
1st test: Check if cart is supposed to have sram, if not, display error(this sanity check was added in V19A I think), if yes backup sram
2nd test: Overwrite entire sram with 0x00, check if each byte is 0x00, if not display error
3rd test: Overwrite entire sram with 0xFF, check if each byte is 0xFF, if not display error
4th test: Write back the sram backup from test 1 and check for write errors if no write errors display "Verified OK" message

A good sram needs to pass all tests.
It can absolutely be that a broken sram fails one of the two 0xFF/0x00 tests but still manages to write back the old save perfectly fine. That's why there are multiple test. All of them have to pass.

So I guess I should change the "Verified OK" message to "Restored OK".  ;)

I don't actually have a broken sram cart to test the test but in theory it should work.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: Syco54645 on Sep 26, 2016, 04:26 pm
Right now I have everything here except the 64 protective resistors(between 130 and 180 Ohm, 0805 size, red in picture) and the SD module.

Build plan:
(https://dl.dropboxusercontent.com/u/20912715/snes/Snes_Cart_Reader_Mega_Shield/v8/smdparts.jpg)

So if you're ok with buying those parts separately then I can sell you an almost complete kit.
Honestly with my 70+ hours a week at work right now I will probably not find the time to source the missing parts, even though it appears to just be 2 types of resistors and the sd card reader, let alone assemble it. My intention is to build one and then contribute to the project but scope creep and deadline slip have got me into this current predicament. However there is a light at the end of the tunnel which appears to be happening Friday. So I will report back then what I want to do.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Oct 02, 2016, 07:04 pm
If you can wait I did order all the parts so when they arrive I'll build all my remaining PCBs into full units including Arduino, Oled and everything.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: Syco54645 on Oct 07, 2016, 04:41 am
If you can wait I did order all the parts so when they arrive I'll build all my remaining PCBs into full units including Arduino, Oled and everything.
Any idea on price? Work has let up recently so a kit actually wouldn't be that bad at this point.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Oct 15, 2016, 10:08 pm
Quick update on the software side of things:
I just finished adding 4K Eeprom, 64K Eeprom, Sram/Fram, SST39VF512 512K flashrom + MX29L010 1M flashrom save support for GBA cartridges. Both reading from an original game cartridge and writing a save back to the cartridge.

Now I have to hunt down variations of the flashrom chips and add support for them too.

Missing flashrom chips:
- Atmel AT29LV512 (512Kb)
- Macronix MX29L512 (512Kb)
- Panasonic MN63F805MNP (512Kb)
- Sanyo LE26FV10N1TS (1Mb)

Here is a list of all flashrom games that could contain one of those chips in case anyone is interested in helping: http://pastebin.com/mGxp1dAv

It's the little chip on the right
(https://abload.de/img/open_gameboy_advance_ympkn.jpg)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: b--- on Oct 16, 2016, 07:07 pm
Quick update on the software side of things:
I just finished adding 4K Eeprom, 64K Eeprom, Sram/Fram, SST39VF512 512K flashrom + MX29L010 1M flashrom save support for GBA cartridges. Both reading from an original game cartridge and writing a save back to the cartridge.

Now I have to hunt down variations of the flashrom chips and add support for them too.

Missing flashrom chips:
- Atmel AT29LV512 (512Kb)
- Macronix MX29L512 (512Kb)
- Panasonic MN63F805MNP (512Kb)
- Sanyo LE26FV10N1TS (1Mb)

Here is a list of all flashrom games that could contain one of those chips in case anyone is interested in helping: http://pastebin.com/mGxp1dAv

It's the little chip on the right
(https://abload.de/img/open_gameboy_advance_ympkn.jpg)
Damn, I checked two copies of Pokémon Emerald, two copies of Sapphire, a copy of Fire Red, /'d a copy of Pokémon Mystery Dungeon: Red Rescue Team, and they ALL have a Macronix brand 1MB flash, model MX29L010…

I have another set of GBA Pokémon games on my desk at work I'll look through tomorrow.

Since these games all use 1MB flashrom should I look for a Sanyo brand chip? I'm pretty sure that at least one or two of them has a differently packaged flash chip, though I don't recall anything else about it.

EDIT: I realized I photographed the innards of the games on my work desk when changing the batteries. I have a copy of Ruby with the Sanyo chip you mentioned. How can I use it to help? I don't mind if the savedata on the chip gets corrupted, so long as it still works.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: Syco54645 on Oct 20, 2016, 07:27 pm
Any eta on the kits sanni?
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Oct 20, 2016, 07:42 pm
I'm currently selling two complete units here (http://assemblergames.com/l/threads/for-sale-nintendo-cartridge-reader-and-flashrom-programmer.62063/)

Once they're gone I'll put together some diy kits, hopefully before the end of the year just in time for the holidays probably early 2017.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: Syco54645 on Oct 22, 2016, 04:39 am
I'm currently selling two complete units here (http://assemblergames.com/l/threads/for-sale-nintendo-cartridge-reader-and-flashrom-programmer.62063/)

Once they're gone I'll put together some diy-kits, hopefully before the end of the year just in time for the holidays.
Damn, I was too late. Oh well.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: tylau0 on Nov 12, 2016, 09:29 am
Hi Skaman, I am also interested in reading the memory paks of the Satellaview carts. May you share what we need to set and what address to read?

Thanks.

Nice job on the new hardware!

If I ever finish the updated Enhanced code, then I'll look further into merging the enhancements into the new code base.  I tested moving some of the Enhanced code to the new code base but the port manipulation broke the timing.  The carts that need specific register settings might not work due to the faster direct port manipulation breaking the timing.

Enhanced code has read/write support for the Satellaview carts including the Memory Paks.  I also added support for Sufami Turbo carts awhile back.  The modified code includes an "Express" mode that will dump the complete contents of whatever cart (and memory pak) is plugged in once the "Dump Cart" option is selected.  Express mode works great for NP carts as it will dump everything (flash, flash map, menu, individual games, and individual save files) without any intervention.  Express mode runs continuously until good dumps (checksum matches) are found and will reboot the reader if needed and continue dumping.  Express mode makes dumping 100+ NP carts a much simpler operation.

There's one item left to do for the Enhanced code and it is the SA-1 SRAM writes.  I can now modify the SRAM contents but I'm having difficulty getting the SA-1 to write a complete new save file.  More testing to do.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Nov 13, 2016, 08:21 pm
@tylau0, check your PMs.

BETA testers need to provide feedback before I publicly release the final Enhanced code.  Still waiting...  I can only assume that there haven't been any problems.  Positive feedback would be appreciated!

I did make a recent change to the Enhanced code in the detection of the CX4 (Rockman/Mega Man X2/X3) carts to enable dumping of the Rockman X3 prototype. 

In case anyone cares, the Rockman X3 prototype uses a Capcom LBM20-94907-00 PCB with 4 EPROM chips.  The ROM is coded as ARXJ which is Rockman X2 instead of the Rockman X3 code AR3J.  The prototype Rockman X3 is dumped similar to the retail Rockman X2 with the mapping register 0x7F52 = 0.  My original code used the game title to distinguish between the carts but this did not work for the Prototype since the game title "X3" would set the register 0x7F52 = 1 which is the retail Rockman X3 setting.  I changed the code to adjust the mapping based on the game code at 0x7FB4 (0xFFB4).
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Dec 05, 2016, 03:31 pm
Just received the new revision:

(https://dl.dropboxusercontent.com/u/20912715/snes/Snes_Cart_Reader_Mega_Shield/wiki/v82_top.jpg)

(https://dl.dropboxusercontent.com/u/20912715/snes/Snes_Cart_Reader_Mega_Shield/wiki/v82_back.jpg)

- removed the ~60 protection resistors as it was just too much to solder
- replaced all jumpers with switches
- new N64 slot that has the correct spacing but is not overly tight like the other ones
- the sd spacer now is a total of 8mm thick so you can use a standard 2x8 female pinheader to mount the sd module in a removable fashion and also to press the sd module against the backplate so that it doesn't move anymore
- proper cutout in the sd spacer for the LED and solder pads located directly in front of it

(https://dl.dropboxusercontent.com/u/20912715/snes/Snes_Cart_Reader_Mega_Shield/wiki/v82_switches.jpg)

Overall the needed build time was probably cut in half or something like that.
I uploaded the building instructions here. (https://github.com/sanni/cartreader/blob/master/pcb/building_instructions.pdf)

(https://dl.dropboxusercontent.com/u/20912715/snes/Snes_Cart_Reader_Mega_Shield/wiki/v82_components.jpg)

Now I just have to wait for the adapter pcbs to arrive and then I can test everything and see if it still works  ;)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Dec 05, 2016, 08:04 pm
Looking good! :)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: Syco54645 on Dec 08, 2016, 11:39 pm
This is looking super sweet. Truly cannot wait for these to be ready.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Dec 12, 2016, 06:02 pm
Updated the needed parts list. (https://github.com/sanni/cartreader/wiki/PCB-Needed-Parts)
And made some Build Instructions (https://dl.dropboxusercontent.com/u/20912715/snes/Snes_Cart_Reader_Mega_Shield/v8/smdparts.jpg).

Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: joego on Dec 12, 2016, 06:23 pm
I'll take one set off your hands! Just let me know how we can make the arrangements.

I've been following your project for a while now and was looking forward to the next gen 2 final product, but I'm up for rolling up my sleeves and making this version work.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: AngryHelder on Dec 23, 2016, 09:12 pm
Hey sanni just wondering if you will upload the gerber files to the github since we can't order any pcbs with the links unless we have the gerber files zipped up and I don't see them on the github. Thanks for the hard work on these.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Dec 24, 2016, 11:09 pm
I just uploaded all the pcb files, merry christmas everyone ;)

Yesterday I received the new adapter pcbs, this time I have decided to go with a white solder mask.

(https://dl.dropboxusercontent.com/u/20912715/snes/Snes_Cart_Reader_Mega_Shield/v9/adapter_pcb%20(8).jpg)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: rosaage on Dec 26, 2016, 08:46 pm
This looks amazing, I'll probably order parts and stuff sometime after my current project is finished.
How long does it take to read and write the sram on a snes cartridge?
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Jan 18, 2017, 04:46 pm
Tried out a 3d printed backplate:

(https://dl.dropboxusercontent.com/u/20912715/pics/kit%20(2).jpg)

Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: mog123 on Jan 20, 2017, 11:26 am
I will take one for sure!
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Jan 29, 2017, 11:24 pm
A wild feature appeared!

(http://i.imgur.com/8Z90eF2.jpg) (https://www.youtube.com/watch?v=1BviR53_6NQ)

Only works with custom build flashcarts that use a MBC5 donor board and a 29F033 flashrom like shown here (http://www.reinerziegler.de/download/MBC5_Cart.pdf).
Currently you can only write games up to 2Mbyte but not bigger. *fixed*

(http://i.imgur.com/1uspMrE.jpg)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Jan 30, 2017, 09:13 pm
Nice work, sanni!

I recently ran across the 0x2A8000 write error, too.  I'm using N64freak's custom GB MBC5 cart with a 29F033 and programming it with my Arduino based GB cart reader.

The problem occurs because of the bank switch to 0xAA (0xAA * 0x4000 = 0x2A8000).  I'm assuming that the code you're using writes the bank to address 0x2000 (or similar) then follows with the flash sequence to program the byte.  Since 0xAA is also a flash command, the flash chip misinterprets the bank switch as the flash command and misses the command sequence to write the first byte in the bank.

The original programming sequence probably looks like this:
PutByte(0x2000, 0xAA)
PutByte(0x555, 0xAA)
PutByte(0x2AA, 0x55)
PutByte(0x555, 0xA0)

The solution was to modify the bank switch code slightly to make sure there is a write after the bank switch to 0x2000.

The new programming sequence looks like this:
PutByte(0x2000, 0xAA)
PutByte(0x4000, 0x0)
PutByte(0x555, 0xAA)
PutByte(0x2AA, 0x55)
PutByte(0x555, 0xA0)

Code: [Select]
void CUSTOM_SetBank(int bank) {
 if (bank > 0xFF) {
   PutByte(0x3000, 0x1);
   PutByte(0x2000, bank & 0xFF);
   PutByte(0x4000, 0x0);
 }
 else {
   PutByte(0x3000, 0x0);
   PutByte(0x2000, bank);
   PutByte(0x4000, 0x0);
 }
}


The fix should allow you to write the full 4MB.

Take Care!
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Jan 30, 2017, 10:53 pm
Yep that fixed it. Thank you very much.  :)

Never would have guessed that in a million years. Already build a second flasher following the design by Reiner Ziegler to confirm my custom build flashcart is working fine. Read through the 29F033 datasheet and the MBC5 reference again, couldn't find anything that made 0x2A8000 so special. That would have been a tough nut to crack  :o
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: erendorn on Feb 04, 2017, 10:33 pm
Yay, received the cart reader two days ago, and it works flawlessly :)
Read rom and saved file of one of my carts, had to byteswap the save file but now it loads fine!

Will backup some more tomorrow.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: erendorn on Feb 05, 2017, 10:22 am
Yay, received the cart reader two days ago, and it works flawlessly :)
Read rom and saved file of one of my carts, had to byteswap the save file but now it loads fine!

Will backup some more tomorrow.
All done except "Turok Rage Wars", is this something I can solve?
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Feb 07, 2017, 10:18 pm
Just added Turok - Rage Wars (Europe) (En,Fr,It) to the database (n64.txt file on sd card).


Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: Syco54645 on Feb 10, 2017, 06:11 am
Got my reader today. Built it up and it seems to work fine. Only issue I am having is the sram for snes games is not working in emulators. I know that n64 needed byte swapped but does that need done for snes as well?

Actually I do not think it is even reading the sram correctly, sure it is writing it but in my tests I used ff6j to read a 24 hour save and wrote it to another ff6j cart and when testing the game out the save was at the begging of the game. Is there something special that I need to do in order to get sram reading/writing working in this case?
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Feb 10, 2017, 09:57 am
Got my reader today. Built it up and it seems to work fine. Only issue I am having is the sram for snes games is not working in emulators. I know that n64 needed byte swapped but does that need done for snes as well?

Actually I do not think it is even reading the sram correctly, sure it is writing it but in my tests I used ff6j to read a 24 hour save and wrote it to another ff6j cart and when testing the game out the save was at the begging of the game. Is there something special that I need to do in order to get sram reading/writing working in this case?
There is no need for any byte swapping for SNES saves. At least to my knowledge.

Can you download this ff6j save (http://www.zophar.net/savestates/snes/final-fantasy-6-j-.html) and write it to your spare FF6J cart and test it in a Snes console?
It works for me.
If it also works for you then try to read the save back and compare it with an hex editor to the downloaded save to see if it was read back ok.
Finally with your spare FF6 cart try out the Snes sram test and see if it passes.

If it does not then the easiest explanation would be that there are slower Snes sram chips out there than the ones I tested and that I made reading the save too fast for some carts and need to add more delays.
Or there is a hardware error that prevents the cart select pin (http://i.imgur.com/6AYwYVkh.png) from going high like a short to GND.


Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: Syco54645 on Feb 10, 2017, 07:59 pm
Well it seems to have wrote just fine to the spare ff6j that I have, however upon reading the file back off I get a different md5sum. However it is the same in a hex editor. I then got excited and tested the file in an emulator and it works fine, as a last test i read my save from the ff6j that I am playing on and loading it up into an emulator and it works fine.
The only difference is I am now powering it from the arduino rather than the port on the cart reader but I had read that is not ideal. Was tired last night so did not think to try that out. Could that be the reason for the issues I was having?

Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Feb 10, 2017, 08:37 pm
Is the voltage jumper switched to 5V? Because you need 5V for Snes.
It's not bad to power it from the usb port on the Arduino, it's just for N64 you need 3.3V and that you can only get if you use the port on the back of the cartreader and switch the voltage to 3.3V
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: Syco54645 on Feb 11, 2017, 02:43 am
Is the voltage jumper switched to 5V? Because you need 5V for Snes.
It's not bad to power it from the usb port on the Arduino, it's just for N64 you need 3.3V and that you can only get if you use the port on the back of the cartreader and switch the voltage to 3.3V
Oh this I did not know. I read the entire wiki but did not see mention of that.

In looking at the code I did not see where you defined the pins for the actual cart reading, granted I only looked at it briefly, was going to try my hand at adding some stuff. Is there a way to reconfigure the pins for reading carts on the fly or is must that stay static?
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Feb 11, 2017, 10:02 am
I'm directly addressing to the pins via the DDR, PIN and PORT registers. You can find an overview on how the pins are connected here: https://github.com/sanni/cartreader/blob/master/pinout.xls

Every module is using its own pin configuration defined in its setup_XX() function.
Example:

Code: [Select]

void setup_N64_Controller() {
  // Output a low signal
  PORTH &= ~(1 << 4);
  // Set Controller Data Pin(PH4) to Input
  DDRH &= ~(1 << 4);
}


Would be the same as this in a more traditional Arduino sketch

Code: [Select]

int dataPin = 7;

void setup(){
  // Output a low signal
 digitalWrite(dataPin, LOW);
  // Set controller data pin to input
 pinMode(dataPin, INPUT);
}
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: suloku on Feb 19, 2017, 02:46 pm
This is an awesome project and I'd like to thank you for making it open source.

I'd really like to build myself one, but as an unexperienced user that only knows how to solder and has never used an arduino, I feel like the current desing is completely out of my possibilities.

I'm mostly interested in n64 cart dumping (basically savegames), so my question is, can the project theoretically be reduced to as simple as the arduino + the slot for the n64 carts and dump the file via usb cable to a computer?

I know that most likely some components would still need to go in between the arduino and the cart connector.

Also, would omiting rom dumping and only focusing onto save read/write reduce soldering/components?


Best regards
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Feb 19, 2017, 03:06 pm
The N64 cartridge port is directly wired to the Arduino Mega, there are no components inbetween. You can check the pinout.xls on my github to see what connects to where. Just connect everything with wires.
The only other thing you need is a SD card. You could directly wire a micro sd adapter to the Arduino and use it as an sd slot.
(https://abload.de/img/img_2815n7u3g.jpg)

Then you change the code like this:

Quote
// If you don't have an OLED screen change 
// enable_OLED to 0 and enable_Serial to 1   
#define enable_OLED 0   
#define enable_Serial 1
And it will output to the Arduino Serial Monitor

(https://abload.de/img/untitledbiup8.jpg)

Ofc you can also rewrite my project so it sends the data over the serial monitor too instead of saving it to the sd card.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: suloku on Feb 19, 2017, 05:12 pm
Thank you for your quick response. If it is directly wired then I really can build one myself. The sd adapter is cheap enough, so I might just go for it, but seems it may be easy to send the read file over the monitor instead of writing to sd card.

The most expensive component seems to be the edge connector (unless I could find a broken n64 maybe...), but since this is not intended for a n64 replacement, would another edge connector just do the work?
I've seen 56 way connectors for 1/3 of the n64 one (and even lower prices) and I wonder if that would work just fine if I just cut a bigger one, just like people do for zx spectrum as you may see here: https://www.tindie.com/products/TRC/zx-spectrum-edge-connector/)

edit: just noticed the link in the wiki is for a 10 unit pack, but I can't find anywhere selling single units.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Feb 19, 2017, 05:42 pm
Yes it's super easy to send the save over to the serial monitor.
Just remove all the sd error code like this one for example
Code: [Select]

  //open file on sd card
  if (!myFile.open(fileName, O_RDWR | O_CREAT)) {
    print_Error(F("Can't open file on SD"), true);
  }


and replace all the "myFile.write" with "Serial.write".

Then you can just copy the save out of the serial monitor windows into a file using a hex editor.
I want to write a simple Windows GUI for the cart reader at some point too.

This connector also works if you make absolutly sure that you insert the cartridge centered. This is because the N64 slot has a 2mm pin spacing while all the other non-Nintendo slots have 2.54mm.
http://www.ebay.com/itm/5pc-Industrial-Card-Edge-Slot-Socket-Connector-25x2P-50P-2-54mm-0-1-3A-RoHS-/140888533934
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: CrossRoads on Feb 19, 2017, 05:43 pm
You can always search at a real parts distributor like Digikey.com or Mouser.com to find the right connector.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: geriatrix on Feb 21, 2017, 09:57 pm
Awesome work with this stuff sanni (and all others that contributed)!

I have a question with regards to the possibility of writing different chips to the SNES. You have support for the 29F032 and others, is it possible to add support for a 29GL064 (8Mbyte)? (datasheet here: http://www.cypress.com/file/202426/download)

That would enable people to write games larger than 4Mbyte for Exhirom, or even to write multicarts using that chip. If coding for the 29GL064 was supported, that could enable use of the 29GL032 (4Mbyte), or maybe even the 29GL256P (32Mbyte)?
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Feb 22, 2017, 08:41 pm
That's a 3V part.  Not a good idea to use it in a SNES.

There's only so much address space available before you need to add some type of microcontroller.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: geriatrix on Feb 23, 2017, 05:00 am
That's a 3V part.  Not a good idea to use it in a SNES.

There's only so much address space available before you need to add some type of microcontroller.
Someone could just use level shifters or resistor buffers to handle the voltage differences.

And I saw that there are N64 pirate carts that use the 29GL256 chips sold on Aliexpress right now. Would be pretty awesome to be able to dump and rewrite those.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Feb 23, 2017, 07:23 am
sanni is looking into the N64 repro.  I'll help after I get my repro cart if he hasn't figured it out by then.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Mar 02, 2017, 12:43 am
Just uploaded the code for re-writing the N64 repros. It's still a little rough and slow. But I'm sure we will get it faster without much hassle. Especially after all that we have been through so far *looks at SF Memory cart* :)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Mar 02, 2017, 04:16 am
Looking forward to it!

Should give me a decent break from the 6MB (48Mbit) upgrade for the SF Memory Cassette that has been kicking my butt the last couple weeks. :(

Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Mar 04, 2017, 03:41 pm
Just received the newest version, no actual hardware changes just some different design choices to bring it into the year 2017  8)

(https://www.dropbox.com/s/axvckz33nqbkyut/v10_front.jpg?dl=1)

(https://www.dropbox.com/s/cv1kpb97vebo1e1/v10_back.jpg?dl=1)



Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Mar 05, 2017, 06:13 am
Those are beautiful!
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Mar 29, 2017, 04:50 pm
Over the past few days I've updated the github repo (https://github.com/sanni/cartreader) and the wiki guides (https://github.com/sanni/cartreader/wiki) to represent the latest version.

Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Apr 01, 2017, 03:22 am
Nice work as always, sanni!

I've been working on a prototype SA-1 adapter that replaces the Adafruit Clock Generator.  It might be possible to fit the circuit on the new shield version.  Right now, I've built it as an adapter that sits between the SA-1 cart and SNES slot.  The adapter works properly reading and writing SA-1 carts and also switches between games on the multi-game SF Memory Cassettes.  I still have more testing to do to make sure functionality with other enhanced chip carts doesn't change when switching to the circuit.

I'm also trying to get the adapter working with my Retrode.  Using the adapter, the Retrode reads the cart header properly and shows the game in the USB folder but the firmware is not set up to properly read out the complete cart contents (there's valid data but it is incomplete).  Unfortunately, support for the Retrode is nonexistent at this time so there is no way to fix the SA-1 carts.  Maybe if I gain access to the Retrode source code then I can add some of the SNES improvements that we've made with the Arduino reader.

Thank God for open source projects!

Take Care!
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: DiamondMinerITA on Apr 14, 2017, 03:53 pm
hi, is there a way to make everything more compact and make it of little adaptors like the retrode?
I know that this is hard but it wold make everything smaller
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Apr 14, 2017, 10:27 pm
If you build one of the single SNES slot versions (handwired version or the early PCB), then it will be smaller than the Retrode.  There is a separate N64 adapter board that you plug in to the SNES slot.

Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Apr 15, 2017, 01:38 pm
The Retrode is 16x8x4cm=512cm³ and my current cart reader design is 10x10x4cm=400cm³.
Therefore I'd argue it already is smaller by volume. :smiley-small:  :D
Ofc the Retrode can do a lot more things like you can plug SNES controllers in it, so it needs to be bigger :smiley-cool:

Now if the question is "What is the cheapest way possible to build this Cart Reader?", then the answer to that would be the following item list:
- Arduino Mega2560 (http://www.ebay.it/itm/152505189714) 8€
- Prototype PCB (http://www.ebay.it/itm/201205316404) 5€
- SNES slot from a broken Action Replay or import adapter (http://www.ebay.it/itm/292060882817) 6€
- SD module (http://www.ebay.it/itm/141976857662) 1€
You don't need the OLED screen because you can just use the Arduino Serial Monitor to display all the information.

That's about 20€ in total.
Then just hand wire everything according to this pinout (https://github.com/sanni/cartreader/blob/master/pinout.xls?raw=true).
For the N64 or Gameboy adapter you can just use the pcbs of some cheap SNES game and wire the appropriate cartridge slot to it, again using the pinout from the Excel file.

Just be aware that hand wiring everything can lead to wiring errors really easy.

I don't have any pictures of my earlier hand wired prototypes anymore but here is a fun picture I once made that shows different stages of the cart reader:
(https://www.dropbox.com/s/gleggpxfr5nmv2k/greahtah.jpg?dl=1)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Apr 15, 2017, 08:10 pm
I own a Retrode.  For me, the main problem with the Retrode is that the source code is closed and the original developer is no longer working on it.  All of the problems with the Retrode code are not likely to be fixed.  There's one person that sort of works on the code but he isn't that interested in making changes.

I've made an SA-1 adapter board that works with our Arduino based reader and should also work with the Retrode.  I have actually successfully dumped an SA-1 cart using the Retrode.  Unfortunately, not all SA-1 carts can be dumped using my adapter since the underlying Retrode code is flawed.  I've spoken with the original and current devs about the problems but there's no interest in fixing the code. 

Maybe they see the Arduino reader as a rival product and therefore are not willing to share the source code.  I guess that they must think that I'm looking to adapt Retrode code to the Arduino reader when I'm actually trying to bring all of the SNES enhancements that I've developed for the Arduino reader to the Retrode.  The Retrode SNES code appears rather basic and incomplete so there's no reason for me to use any of it.

The only hope is that the Retrode devs open up the source code but that remains unlikely as the project has been basically abandoned for a number of years.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: tomt64 on Apr 17, 2017, 10:14 pm
Surprisingly (to me, anyway), Wikipedia has the most current information on what happened to the Retrode.

"The Retrode got licensed to OpenPandora GmbH in Germany and is available again since March 2015.[10] The Retrode from 2015 is the second hardware revision."

https://en.wikipedia.org/wiki/Retrode

Basically, it's a commercial product with legal licenses and such, so I doubt they will release source code beyond their firmware update downloads.

I purchased a Retrode 2 and plugins in mid 2016 from DragonBox.de, which is basically the store for OpenPandora.  It also seems to have a more current firmware then is on the retrode website.  However, it still does not allow for getting N64 saves, and the controller ports are not built in to the adapters produced by OpenPandora. This overall failure of a device to meet a requirement I wanted is why I am here and got a kit from sanni.  That has arrived today however the Arduino itself and the OLED are still on their way.

I have done other experiments trying to get save data from cartridges.  On the N64 end, I used the Gameshark 3.2 over parallel port method of extracting RAM data from a running game, as well as extracting the data by using the Gameshark's memory card manager and a Dexdrive. Both of these were marginally successful but only reliably worked for games that have SRAM (the battery).  It's also a painful method, requiring a working N64, old PC equipment that has a non-USB based parallel port sitting pretty much right next to it, a TV with RCA inputs or device that can upconvert to output to a monitor or modern TV, a Dexdrive, and of course an N64 cartridge which still has save data on it (a challenge considering the physical battery issue).  Found out a couple of other useful tidbits of info along the way, but nothing that basically gives me a reliable method of extracting saves of all types from an N64 cart.

Regarding two other cartridge types that this kit supports (SNES and GB/GBC/GBA) I successfully got most of this from the Retrode (except for GBA of course since that is also not supported by the Retrode, grrr).  I also successfully got save data off the SNES and GB/GBC/GBA cartridges using a RetroN 5.  These saves are compressed so are not immediately usable by emulators.  For that I used some code provided to a particular forum on the subject from a team member of Hyperkin itself, which deals with the compression formatting they use.  I have been able to transfer saves back and forth with a couple of extra steps of compression/decompression as a result.

All of my experiments led me to the conclusion that, prior to this device, no device existed that would perform the N64 functions on native cartridge save data.  Other devices arguably allow for SNES and GB functions, but this one is much more friendly to the process.  So I'm quite excited to use it and, if possible, contribute in some way other than buying a kit :)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: Pickle136 on Apr 17, 2017, 10:24 pm
skaman is your SPC7110 code back on post 23 still up to date?
Id like to dump FEOEZ and it looks like this hasnt been added to Sanni's code base yet.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Apr 17, 2017, 11:33 pm
DragonBox isn't doing anything with the firmware.  They're producing the hardware (currently planning another run of the units).  They're interested in my SA-1 adapter but with the current status of the firmware, the adapter is not viable with the Retrode.

Matthias controls access to the source code repository although he isn't actively working on it.  Basically only Wannado is working on the Retrode firmware right now.

@Pickle136, the current SPC7110 code is similar to what was posted early in this thread.  I made changes to use the SDBuffer and switched some of the dump routines used.  The code to switch the ROM mapping using the SPC7110 registers is essentially the same (although I switched to using HEX values).  I'll send you a copy of the latest Enhanced code.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: tomt64 on Apr 17, 2017, 11:41 pm
The firmware version on my Retrode 2 is higher than the highest version number found here: www.retrode.org/documentation/firmware/

if memory serves, the version number on my Retrode is 0.20 or something close to it.  The highest on that page is "0.19-beta"

I don't know who is responsible for that and would make no assertions as such, but that's what I found when I looked into my Retrode's firmware.  I have not found any other firmware download locations but that doesn't mean they don't exist.  And without a download I don't actually know what's different about the firmware I received. What I DO know is that it still does not support save data from GBA and N64 carts.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Apr 18, 2017, 01:55 am
Most recent Retrode firmware is v0.21-beta.  The recent firmware versions are basically bugfixes or attempts at bugfixes.  Unfortunately, there won't be any possibility for support of the items that you listed until the source is opened up.  Needless to say that I'm frustrated by the Retrode. 

I think this project is accomplishing all that the Retrode should have done.

Kudos to MichlK and sanni for their work on this project!
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: Pickle136 on Apr 20, 2017, 11:16 pm
I was successful last night porting Skaman's SPC1170 code to Sanni's code.

One thing ive been having issues with my push button. It works in the main menu, but for some reason I go right past the cart info screen and sometimes start the read rom.
I suppose it might be a stuck signal, but i hear it click and it doesnt do anything on the main menu...
I added a delay in the cart info screen just so I could see it for debugging in this session.
Any thoughts?
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Apr 20, 2017, 11:30 pm
I was successful last night porting Skaman's SPC1170 code to Sanni's code.

One thing ive been having issues with my push button. It works in the main menu, but for some reason I go right past the cart info screen and sometimes start the read rom.
I suppose it might be a stuck signal, but i hear it click and it doesnt do anything on the main menu...
I added a delay in the cart info screen just so I could see it for debugging in this session.
Any thoughts?
How many buttons does your PCB have? If it's one of the older ones with just one button you need to disable the second button in the code.

Change:
"#define enable_Button2"
to:
"//#define enable_Button2"

As an alternative you could also pull Arduino Pin D39 permanently high with a 10k resistor or maybe even with the internal pullups.

Because the code right now is setup to first check if button 2 is pressed and if yes execute what ever option is selected.

int checkButton() {
#ifdef enable_Button2
  if (checkButton2() != 0)
    return 3;
  else
    return (checkButton1());
#else
  return (checkButton1());
#endif
}
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: Pickle136 on Apr 21, 2017, 12:30 am
thanks that was it
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: SputnikBR on Apr 25, 2017, 03:14 am
Hello sanni  :)
Your kit is super cool! Do you intend to make a second kit that contains the adapters for GB and GBA and Flash?
Another thing, does your code have support for the Nintendo Power GB Memory Cartridge?
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Apr 27, 2017, 12:58 pm
I do have some GB/A adapter pcbs and slots coming my way, no flash adapters though.
My code does not support the GB Memory carts because I find them way too expensive. Instead my code can write homemade flash carts like this one:

(http://i.imgur.com/CiJrd6s.jpg)

There is a lot of technical info on the GB Memory carts in this thread at nesdev: http://forums.nesdev.com/viewtopic.php?f=12&t=11453&start=90 in case your interested.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: SputnikBR on Apr 27, 2017, 04:02 pm
Indeed the GB memory carts are very expensive. However it would be a lot of fun to replicate everything the Japanese machine did with SF and GB memory using arduino! ;D  ;D  ;D
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: geriatrix on May 02, 2017, 12:13 am
Has anyone had any luck with writing the N64 repros? I see that sanni made an update about a month ago that added some N64 writing functions, but it's quite slow.

Does anyone have that working faster? Or can someone point me to the place in the code that controls that so I can start poking around the code and trying things out? :)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on May 02, 2017, 02:12 pm
There were two types of N64 repros being sold at aliexpress. The "old" ones with the Spansion S29GL256N and the newer ones with the Intel 4400L0ZDQ0.

So far the cart reader only supports the Spansion S29GL256N (Datasheet) (https://www.dropbox.com/s/7c92tf0oxlnw2i7/SPANSION_S29GL256N.pdf?dl=1).

Now the S29GL256N can be written in two ways:
- 2 bytes(=1 words) at a time
- 32 bytes(=16 words) at a time using the write buffer

Only the first method is currently implemented which results in pretty slow programming.

The S29GL256N is hardwired in word mode (pin 53 #BYTE connected to VCC).

That means that the command definitions for 16bit mode on page 73 of the datasheet should be used. But for some reason they don't work and instead you have to use the 8bit mode commands from page 76. Very confusing, most likely something to do with the MaxII chip inside the repro.

The Write Buffer Programming method is described on page 60. There is also a diagram on page 63.

Furthermore there is the source code download for Spansion's Low Level Driver for NOR Flash (http://www.cypress.com/software-and-drivers-cypress-flash-memory) where the most interesting part is the "lld_WriteBufferProgramOp" function found in the lld_S29GLxxxN.c file that gives a C code example on how to use the write buffer.

Code: [Select]

/******************************************************************************
*
* lld_WriteBufferProgramOp - Performs a Write Buffer Programming Operation.
*
* Function programs a write-buffer overlay of addresses to data
* passed via <data_buf>.
* Function issues all required commands and polls for completion.
*
* There are 4 main sections to the function:
*  Set-up and write command sequence
*  Determine number of locations to program and load buffer
*  Start operation with "Program Buffer to Flash" command
*  Poll for completion
*
* REQUIREMENTS:
*  Data in the buffer MUST be properly aligned with the Flash bus width.
*  No parameter checking is performed.
*  The <word_count> variable must be properly initialized. 
*  Valid <byte_cnt> values:
*   min = 1 byte (only valid when used with a single x8 Flash)
*   max = write buffer size in bytes * number of devices in parallel
      (e.g. 32-byte buffer per device, 2 x16 devices = 64 bytes)
*
* RETURNS: DEVSTATUS
*/
DEVSTATUS lld_WriteBufferProgramOp
(
FLASHDATA *   base_addr,  /* device base address in system     */
ADDRESS   offset,     /* address offset from base address  */
WORDCOUNT word_count, /* number of words to program        */
FLASHDATA *data_buf   /* buffer containing data to program */
)
{
  DEVSTATUS status;
  FLASHDATA write_data = 0;
  FLASHDATA read_data = 0;
  ADDRESS   last_loaded_addr;
  ADDRESS   current_offset;
  ADDRESS   end_offset;
  FLASHDATA wcount;

  /* Initialize variables */
  current_offset   = offset;
  end_offset       = offset + word_count - 1;
  last_loaded_addr = offset;

  /* don't try with a count of zero */
  if (!word_count)
  {
    return(DEV_NOT_BUSY);
  }

  /* Issue Load Write Buffer Command Sequence */
  lld_WriteToBufferCmd(base_addr, offset);

  /* Write # of locations to program */
  wcount = (FLASHDATA)word_count - 1;
  wcount *= LLD_DEV_MULTIPLIER;

  FLASH_WR(base_addr, offset, wcount);

  /* Load Data into Buffer */
  while(current_offset <= end_offset)
  {
    /* Store last loaded address & data value (for polling) */
    last_loaded_addr = current_offset;
    write_data = *data_buf;

    /* Write Data */
    FLASH_WR(base_addr, current_offset++, *data_buf++);   
  }

  /* Issue Program Buffer to Flash command */
  lld_ProgramBufferToFlashCmd(base_addr, last_loaded_addr);
 
  status = lld_Poll(base_addr, last_loaded_addr, &write_data,
                    &read_data, LLD_P_POLL_WRT_BUF_PGM);
  return(status);
}
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on May 03, 2017, 12:03 pm
Aaaand done. :smiley-draw:

Uploaded the changes to github. Flashing a 32MB file takes ~12 minutes.
- it now only erases the sectors needed according to the rom size instead of the whole flashrom
- blankcheck is skipped since up until now erasing has never failed even once so why test it everytime
- the code now uses the 16 word write buffer to flash the rom

Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: geriatrix on May 05, 2017, 05:49 am
Aaaand done. :smiley-draw:

Uploaded the changes to github. Flashing a 32MB file takes ~12 minutes.
- it now only erases the sectors needed according to the rom size instead of the whole flashrom
- blankcheck is skipped since up until now erasing has never failed even once so why test it everytime
- the code now uses the 16 word write buffer to flash the rom


Wow that was fast! Congrats on the efficiency bump!

I've tested it out on mine here and it indeed works really fast now. I figure if verification was cut out then programming time itself would only be about 9 minutes on a 32MB game. Pretty nifty!
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on May 23, 2017, 08:48 am
The newer N64 repro with the Intel chip can now be re-flashed too:

(https://www.dropbox.com/s/vps1l1fxkwb84co/youtubeflashn64.jpg?dl=1) (https://www.youtube.com/watch?v=hl2sTF5I9qI)

I cut out the wait times, in reality it took 5 minutes to flash the rom with the 8MB file. 64MB takes around 38 minutes.
In theory it should be possible to make it faster since there are two physical chips inside the Intel flashrom that could be addressed in parallel. This would half the erase time.
The write time also would be a little bit faster, not much though since there we are limited by the speed of SD card interface.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: tamanegi_taro on May 23, 2017, 03:32 pm
Hi sanni,

Aren't you going to develop famicom and nes adapter for snes connector?
It would be awesome if your Nintendo dumper supports dumping all Nintendo cartridge based console games.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on May 23, 2017, 04:16 pm
There is the Kazzo (https://osdn.net/projects/unagi/wiki/kazzo_intro_en) cart dumper that also uses an Atmega chip and is open source so that could be used as a base for adding NES support to the Arduino Cart Reader. Might be worth a look but I fear it could be very complicated.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: tamanegi_taro on May 23, 2017, 05:22 pm
Thanks sanni!

I'm working on building kazzo right now on universal boards.
Got all necessary parts and all I've left to do is lot of soldering...

By the way, I just ordered Nintendo dumper PCB and Adapter board to Elecrow.

I ordered adapter using old adapter.zip file instead of latest small GB adapter only version.
Is it better if I order another one using latest Gerber file?






Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on May 23, 2017, 05:31 pm
The only difference between the two GBA adapter versions is that the new version has holes for mounting the 3d printed case with screws and it also has a longer cart edge connector. Electronically they are the same and both versions work fine. So no need to order the new version.

(https://www.dropbox.com/s/fec7hkwryoqoz51/gbaadapt%20%282%29.jpg?dl=1)

(https://www.dropbox.com/s/h0xaxvs46f4r390/gbaadapt%20%281%29.jpg?dl=1)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: tamanegi_taro on May 23, 2017, 05:52 pm
OK! I don't have 3D printer so it doesn't mind then.
I need to go find nice case for dumper at dollar shop though.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on May 28, 2017, 04:27 pm
Here are some updated pictures of everything the cart reader can right now:

(https://www.dropbox.com/s/7j62u8yvrpdjitd/n64cart.jpg?dl=1)
Read N64 roms out of their cartridge. Read and write save games from and to the cartridge.

(https://www.dropbox.com/s/4iycbk3ktz38dkn/controller.jpg?dl=1)
Test the buttons and give the exact values of the thumbstick of a N64 controller.

(https://www.dropbox.com/s/z21kyw3623kq9pg/mempak.jpg?dl=1)
Read and write Controller Paks.

(https://www.dropbox.com/s/a72nph58mwdfspo/n64repro.jpg?dl=1)
Re-write those $22 chinese N64 reproduction cartridges.

(https://www.dropbox.com/s/xuwx40a4hc9w686/snes.jpg?dl=1)
Read SNES roms out of their cartridge. Read and write save games from and to the cartridge.

(https://www.dropbox.com/s/1b5cgb6j964ubfr/flashrom.jpg?dl=1)
Write flashroms for making custom SNES reproduction carts.

(https://www.dropbox.com/s/n5qiznhkne0yf2w/sfmemory.jpg?dl=1)
Read and write Nintendo Power SF Memory cartridges.

(https://www.dropbox.com/s/vvyojrtoj8v49p8/gb.jpg?dl=1)
Read Game Boy (Color) roms out of their cartridge. Read and write save games from and to the cartridge.

(https://www.dropbox.com/s/hn3am77htzbgzqk/gbflash.jpg?dl=1)
Write custom made Game Boy flashcartridges.

(https://www.dropbox.com/s/gdojlefe2pxcktj/gba.jpg?dl=1)
Read Game Boy Advance roms out of their cartridge. Read and write save games from and to the cartridge.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: tamanegi_taro on May 30, 2017, 04:32 pm
Looks so nice!
I can't wait until I make my own cart reader.

By the way, did skaman say anything about adding satellaview 8M memory pack read/write feature?
I also got some GB memory cartridge but couldn't dump Flash using insidegadget's GBcartread. I will try some commands once I get cart reader working.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on May 30, 2017, 04:52 pm
I got dumping GB memory carts working but it's not very reliable yet. See latest version of the code on my github.
I'll work on it again once I find the time, was distracted by the N64 repro  :smiley-lol:
The code itself is in the NP.ino file at the end.

You can also look at bennvenn's code from here: https://bennvenn.myshopify.com/pages/downloads -> v3.18c -> JoeyJoebags3_18.py

Code: [Select]

def main_JPN_test():
    main_JPN_F2()
    main_JPN_F4()

    dev.write(0x01,[0x0A,0x00, 0x02  ,0x01,0x20,0x01 ,0x01,0x3F,0xA5] )
    USBbuffer = dev.read(0x81,64)
    dev.write(0x01,[0x0A,0x00, 0x02  ,0x01,0x20,0x02 ,0x01,0x3F,0xA5] )
    USBbuffer = dev.read(0x81,64)

    main_JPN_F5(0xA0) # or is it F5
   
   
    main_JPN_F5(0x60)


    main_JPN_F5(0xE0)
   
    dev.write(0x01,[0x0A,0x00, 0x02  ,0x01,0x20,0x02 ,0x01,0x3F,0xA5] )
    USBbuffer = dev.read(0x81,64)

    dev.write(0x01,[0x0A,0x00, 0x02  ,0x01,0x20,0x02 ,0x01,0x3F,0xA5] )
    USBbuffer = dev.read(0x81,64)

    for k in range (16):
        dev.write(0x01,[0x0A,0x00, 0x10  ,0x55,0x55,0x55 ,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55] )
        USBbuffer = dev.read(0x81,64)
   
   
def main_JPN_Unlock_ROM():
    main_JPN_F2()
    main_JPN_F4()
    main_JPN_F1(0x5555,0xAA)
    main_JPN_F1(0x2AAA,0x55)
    main_JPN_F1(0x5555,0x60)
    main_JPN_F1(0x5555,0xAA)
    main_JPN_F1(0x2AAA,0x55)
    main_JPN_F1(0x0000,0x40)   
   
def main_JPN_Burn_ROM():
    #Enable Flash Writing/Access
    main_JPN_F2()
    main_JPN_F4()
    main_JPN_EraseFlash()       
    #Flash Cart
    main_LoadROM()
    addold=0
    for address in range (0,ROMsize,32):

        AddHi=(address>>16)&0xFF
        AddMe=(address>>8)&0xFF
        AddLo=address&0xFF
        Data32Bytes=ROMbuffer[address:address+32]
        AddHi=AddHi.to_bytes(1,'little')
        AddMe=AddMe.to_bytes(1,'little')
        AddLo=AddLo.to_bytes(1,'little')

        FlashWriteCommand=b'\x22'+AddHi+AddMe+AddLo
        Data32Bytes=ROMbuffer[address:address+32]
        USBoutputPacket = FlashWriteCommand+Data32Bytes
        dev.write(0x01,USBoutputPacket)
        USBbuffer = dev.read(0x81,64)
        trying=0
        while (main_JPN_Read(0)&0x80)!=128:
            trying=trying+1
            if trying==100:
                print ("Failed writing to sector",address)
                break
        if addold != address >> 13:
            print (address,"bytes of",ROMsize)
        addold=address >> 13
       
           
    app.lowerLeftLabel.set(str(ROMsize)+' Bytes Written' )
    messagebox.showinfo('Operation Complete','Writing Complete.')

    main_JPN_F1(0x0000,0xF0)
    #Disable Flash Access
    main_JPN_F3()

def main_JPN_EraseFlash():
    #Erase Flash Cart - 64kbyte blocks, 0x00000, 0x10000, 0x20000 etc.... MBC 16kbytes/bank - 4 banks/block.
    main_JPN_F1(0x5555,0xAA)
    main_JPN_F1(0x2AAA,0x55)
    main_JPN_F1(0x5555,0x80)
    main_JPN_F1(0x5555,0xAA)
    main_JPN_F1(0x2AAA,0x55)
    main_JPN_F1(0x5555,0x10)
    while main_JPN_Read(0)!=128:
        pass
   
def main_JPN_F1(Address,Data):
    AddHi=Address>>8
    AddLo=Address&0xFF
    dev.write(0x01,[0x0A,0x00, 0x05  ,0x01,0x20,0x0F ,0x01,0x25,AddHi ,0x01,0x26,AddLo ,0x01,0x27,Data ,0x01,0x3F,0xA5] )
    USBbuffer = dev.read(0x81,64)
def main_JPN_F2():
    dev.write(0x01,[0x0A,0x00, 0x04  ,0x01,0x20,0x09 ,0x01,0x21,0xAA ,0x01,0x22,0x55 ,0x01,0x3F,0xA5] )
    USBbuffer = dev.read(0x81,64)
def main_JPN_F3():
    dev.write(0x01,[0x0A,0x00, 0x02  ,0x01,0x20,0x08 ,0x01,0x3F,0xA5] )
    USBbuffer = dev.read(0x81,64)
def main_JPN_F4():
    dev.write(0x01,[0x0A,0x00, 0x09  ,0x01,0x20,0x0A ,0x01,0x25,0x62 ,0x01,0x26,0x04 ,0x01,0x27,0x00 ,0x01,0x3F,0xA5 ,0x01,0x20,0x01 ,0x01,0x3F,0xA5, 0x01,0x20,0x02 ,0x01,0x3F,0xA5] )
    USBbuffer = dev.read(0x81,64)
def main_JPN_F5(inst):
    dev.write(0x01,[0x0A,0x00, 0x03  ,0x01,0x20,0x10 ,0x01,0x3F,0xA5 ,0x01,0x21,0x01 ] )
    USBbuffer = dev.read(0x81,64)
    main_JPN_F1(0x5555,0xAA)
    main_JPN_F1(0x2AAA,0x55)
    main_JPN_F1(0x5555,inst)
def main_JPN_F6(data):
    dev.write(0x01,[0x0A,0x00, 0x02  ,0x01,0x20,(0xC0&data) ,0x01,0x3F,0xA5] )
    USBbuffer = dev.read(0x81,64)
def main_JPN_F7(inst):
    main_JPN_F1(0x4555,0xAA)
    main_JPN_F1(0x42AA,0x55)
    main_JPN_F1(0x4555,inst)

def main_JPN_Read(Address):
    AddHi=Address>>8
    AddLo=Address&0xFF
    dev.write(0x01,[0x10,0x00,0x00,AddHi,AddLo])
    ROMbuffer= dev.read(0x81,64)
    return (ROMbuffer[0])

def JPN_Read(Address):
    AddHi=Address>>8
    AddLo=Address&0xFF
    dev.write(0x01,[0x10,0x00,0x00,AddHi,AddLo])
    ROMbuffer= dev.read(0x81,64)
    return (ROMbuffer)

Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: tamanegi_taro on May 30, 2017, 05:12 pm
Thank you sanni!
I'll try those.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: tamanegi_taro on Jun 04, 2017, 05:44 pm
I got all my parts except for clock gen module. I made my original clock gen module and it seems working great.

Successfully dumped all my N64 games and SA1 Snes games.
I also dumped a GB Nintendo power cartridge but I'm not sure if the dump is successful because it is in bin format.
I'll take a look at structure this week to extract a game from it.

One thing I noticed was that Derby Stallion 96(One with satellaview memory pack slot on top of the cart) only dumps first 2MB and other 2MB are all 0xFF.
Maybe special command is needed to dump all 4MB of this cart.

Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Jun 05, 2017, 04:01 am
Special LoROM (like Derby Stallion 96) needs to read Banks 0x00-0x3F for the 1st/2nd MB and then Bank 0x80-9F for the 3rd MB.

Good Luck!
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Jun 05, 2017, 06:37 pm
Successfully dumped all my N64 games and SA1 Snes games.
Nice 8)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: tamanegi_taro on Jun 10, 2017, 06:22 am
Thank you!
Dumped my Derby Stallion 96 by adding following code in line 845 of SNES.ino V25C.

*******************************************************
  // Check if LoROM or HiROM...
  //Dump Derby Stallion '96 (Japan) Actual Size is 24Mb
  if ((romType == LO) && (numBanks == 128) && (strcmp("CC86", checksumStr) == 0)) {
    // Read Banks 0x00-0x3F for the 1st/2nd MB
    for (int currBank = 0; currBank < 64; currBank++) {
      // Dump the bytes to SD 512B at a time
      for (long currByte = 32768; currByte < 65536; currByte += 512) {
        for (int c = 0; c < 512; c++) {
          sdBuffer[c] = readBank_SNES(currBank, currByte + c);
        }
        myFile.write(sdBuffer, 512);
      }
    }
    //Read Bank 0x80-9F for the 3rd MB
    for (int currBank = 128; currBank < 160; currBank++) {
      // Dump the bytes to SD 512B at a time
      for (long currByte = 32768; currByte < 65536; currByte += 512) {
        for (int c = 0; c < 512; c++) {
          sdBuffer[c] = readBank_SNES(currBank, currByte + c);
        }
        myFile.write(sdBuffer, 512);
      }
    }

  }
  //Dump Low-type ROM
  else if (romType == LO) {
**************************************

ROM information of this pack is

Name: DERBYSTALLION96
Type: LoROM FastROM
Rom Size: 32MBit
Banks: 128
SRAM Size: 256Kbit
ROM Version: 1.0
Checksum: CC86

So I used bank size and checksum to recognize its derby stallion.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Jun 10, 2017, 03:46 pm
Thanks  8)
Added it to the github repo.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: bluehawk301 on Jun 17, 2017, 12:05 am
Hey sanni!

I just read a lot of this thread and your GitHub. Amazing work! I've aspired to do something like this forever and I just had no idea where to start. Just a few questions before I try to replicate what you've done. How hard is this for an Arduino/soldering beginner? Also, I saw that it is capable of serial control from the computer. Would it be possible to send the dump over serial back to the computer, or is the SD card the only way to get the ROMs? How hard would a modification to the code like that be? Thanks in advance if you reply!

bluehawk
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Jun 17, 2017, 08:36 am
Soldering is quite easy, I would recommend ordering the pcb from China though.
While I have hand wired two cart readers without a pcb in the beginning and it's not that difficult either it gets really messy and you are more likely to do a mistake. So the pcb is a must in my opinion.

If you do not have a soldering iron already and want a cheap but actually decent one get this one (https://hobbyking.com/en_us/soldering-station-with-adjustable-heat-range-us-warehouse.html?___store=en_us) and buy some high quality copper tips from here (https://www.adafruit.com/product/1286)

The "hardest" part of the Arduino stuff is actually to select the right board in the Arduino menu, it sounds ridiculous but that's where most people fail that received one of my pre-built cart readers. Either that or forgetting to install the drivers for the Serial Chip.
So yeah the Arduino part is really easy. Just install the Arduino IDE, download my code, double click on the main file, select the Arduino type in the IDE and hit upload.

You could send the rom over the serial with minor code changes but it would take forever until the rom finishes transferring to the PC.

You can however already control the Arduino over the serial, so you wont need buttons or an lcd, if you change:

Code: [Select]

#define enable_OLED 1
#define enable_Serial 0


to:

Code: [Select]

#define enable_OLED 0
#define enable_Serial 1


It will still store the rom to the SD card however.

If you really don't want to use an SD card you have to remove all the SD card checks like this:
Code: [Select]

// Init SD card
  if (!sd.begin(chipSelectPin, sdSpeed)) {
    display_Clear();
    print_Error(F("SD Error"), true);
  }


And also those:

Code: [Select]

if (!myFile.open(fileName, O_RDWR | O_CREAT)) {
    print_Error(F("Can't open file on SD"), true);
  }


And replace all the:

Code: [Select]

 myFile.write(myBlock[j]);


With:

Code: [Select]

Serial.write(myBlock[j]);


If you do order the printed circuit board from China installing an SD card is very easy so I would recommend that.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: tamanegi_taro on Jun 20, 2017, 05:25 pm
Hi bluehawk,

I would recommend SD card if you want to dump N64 and GBA. Arduino needs to run in 3.3V mode to support those carts. If you use serial mode and plug USB cable directly to arduino, arduino always run in 5V mode.

Another thing I would recommend is the micro SD module instead of SD card module. Micro SD module has level shifter on the board while SD card module doesn't. You just need to connect 6 pins of microSD card module to SD card module pads using wire.

https://m.ja.aliexpress.com/s/item/32583289463.html
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Jul 08, 2017, 02:53 pm
Trying out some new color combination :D

(https://www.dropbox.com/s/2yr19snyqhqvn0g/blacknyellow.jpg?dl=1)









(https://abload.de/img/lego-batman-movie-thuq0sbg.jpg) I like it!!!
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: tamanegi_taro on Jul 13, 2017, 05:23 pm
I like it too.
Mine is black PCB too.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: Nishant_Sood on Jul 14, 2017, 09:14 am
Hi GUys,

Very nice project, I have read through the post for half an hour but couldn't understand what to do with cloned cartridges (whether in SD card or sram)?
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Jul 24, 2017, 05:23 pm
White and yellow :D

(https://www.dropbox.com/s/o26c0yey8onuha2/v11_front_diagonal.jpg?dl=1)

(https://www.dropbox.com/s/goc70t6cg9v7sfa/v11_switches.jpg?dl=1)

(https://www.dropbox.com/s/0be9rp9ss37vq2c/v11_rear.jpg?dl=1)

(https://www.dropbox.com/s/xuhxxnm3av5zftn/v11_front_close.jpg?dl=1)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: hernan43 on Jul 24, 2017, 06:13 pm
I have one of these cartreaders and all I can say is that this thing is elite. While I have used it to dump a dozen or so ROMs, understated is the ability to test the N64 controllers.

I love this thing!
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: drkow on Jul 25, 2017, 07:57 pm
Hi Sanni, thanks for the awesome contributions!

Could you post some high res pics of your assembled board? Specifically, I'm wondering how you mounted the 22uF cap.

I've soldered mine with the positive going to +5v, however when I plug the board in, the cap overheats and makes smoke.

edit: good catch! I confused the pinout of the regulator.


P.S.
I've had no issues flashing the NP carts without the clock gen and most SMD components, just powering everything via the arduino.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Jul 25, 2017, 08:08 pm
The positive pin is marked with a - on the SMD capacitors. So you have to solder it the other way.

(https://i.stack.imgur.com/seNT9.jpg)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: hernan43 on Aug 30, 2017, 06:49 pm
I noticed in the Github repo that this reader can dump Genesis/MD carts. Is there an adapter needed for this?
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Aug 30, 2017, 07:26 pm
Yes an adapter is needed which I have designed but not tested so far.

(https://www.dropbox.com/s/li0kb0v3m98bqd2/md_adapter_pcb.png?dl=1)

Download Gerber files (https://www.dropbox.com/s/etql1iei4tflz30/md_adapter.zip?dl=1)

Schematics:
(https://www.dropbox.com/s/zpaufy9c6o71mli/md_adapter.png?dl=1)

You'll also need some MD slots like those (http://www.ebay.com/itm/5pc-Industrial-Card-Edge-Slot-Socket-Connector-32x2P-64P-2-54mm-0-1-3A-RoHS-/131137330390?).
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: hernan43 on Aug 30, 2017, 08:10 pm
Excellent! Thanks so much! I placed my order.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: Pickle136 on Sep 19, 2017, 04:31 pm
i pushed some code based on Skaman's code to Sanni's code to enable reading Tengai Makyou Zero (SPC7110).
It also has some reorganizing of the code, that in that my opinion cleans it up a bit.

https://github.com/sanni/cartreader/pull/9
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: hernan43 on Sep 20, 2017, 12:58 am
I ended up making one of the Mega Drive/Genesis cartridge adapters. I won't post a pic here because my soldering is atrocious.

I did about a dozen or so games and they all dumped fine with the exception of two. But I think the bad dumps for those two are due to the filth factor of their connectors. When I get some time later I will clean them and re-dump them.

I was pretty excited to be able to dump my Genesis games! Thanks again Sanni for the hard work!
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: EmkeyN on Sep 30, 2017, 01:23 pm
Hi sanni. Thank you for your hard work.

Finally built mine italiano work gratis!
Now I have ordered mega drive adapter pcb from elecrow.

Can I ask to you if I have to solder n64 cable on pcb or I have to connect it on Arduino?
Another question:
ON pcb is a placement for 47 uF capacitor (near tantalum capacitor), it's optional or I have to add to the pcb?

Thanks in advance.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Sep 30, 2017, 02:40 pm
The 47uF is on the input side of the AMS1117 3.3V voltage regulator. It's not really needed but it helps a little.

The N64 cable connects to the bottom of the pcb:
(https://i.imgur.com/CHaX7Xx.jpg)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: EmkeyN on Oct 01, 2017, 12:37 pm
Thank you sanni!
Which voltage you suggest for 47uF capacitor?
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Oct 01, 2017, 03:17 pm
The capacitor can be 47uF, 100uf, 200uF or anything else you got since it is only there to filter the 5V input voltage coming from the USB plug. And the voltage rating needs to be at least 6V so I would go with 10V or 25V.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: c3gamer on Oct 05, 2017, 11:46 pm
Hi sanni and everybody.
I'm studying about eprom and eeprom. I saw your project and wanted to know if it's possible to write in eeprom using arduino mega. I saw your project how you can write how to read. As I'm starting in the programming part, I wanted something that related only to writing in eeprom (29L3211).
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Oct 06, 2017, 09:40 am
Yes that will work. Just wire up a PSOP44 socket like this (https://www.aliexpress.com/item/Free-Shipping-SOP44-to-DIP44-PSOP44-DIP44-SOP44-SOIC44-SA638-B006-IC-IC-socket-Programmer-adapter/32536088590.html?) to an Arduino Mega according to the pinout.xls found on my github (https://github.com/sanni/cartreader/blob/master/pinout.xls). Connect the pins from the Arduino column to the 16bit flash column.
You'll also need an SD module to provide the file you want to flash.

Since the 29L3211 is a 3.3V part you need to convert your Arduino to 3.3V either by following one of the tutorials for converting the serial port to 3.3V found online (https://learn.adafruit.com/arduino-tips-tricks-and-techniques/3-3v-conversion) or by using a 3.3V voltage regulator like an AMS1117 and connecting its output to the 5V line of the Arduino Mega. In the latter case you can't connect the USB cable anymore or you'll short the Arduino out and therefore you also need to install the OLED display and the buttons to control the program independent from a PC.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: Newbie2 on Oct 07, 2017, 09:38 pm
Will the changes to allow reading Tengai Makyou Zero also allow for writing saves back to the cart?
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Oct 08, 2017, 01:09 pm
New design prototype: [see post #356]
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: hernan43 on Oct 08, 2017, 07:09 pm
Would the N64 controller port go away or would it now live in the external control unit?
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Oct 08, 2017, 07:16 pm
It would stay the same as before, meaning a N64 controller extension cut in half and then soldered to the cart reader pcb. Just haven't modeled that in Sketchup  :smiley-mr-green:
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skyhawk71 on Oct 12, 2017, 02:48 pm
Is there anyone here accepting commissions to make these? I have no prior experience with soldering, and don't want to accidentally mess something up. I'm looking to get a unit like this since my Retrode 2 can't dump Nintendo Power or Xband cartridges.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: hernan43 on Oct 12, 2017, 03:15 pm
I'm planning on *attempting* to make a couple of them. My soldering skills are mostly ok. I'm fairly confident I can pull this one off.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Oct 12, 2017, 04:19 pm
Is there anyone here accepting commissions to make these?
Have you seen the work that skaman has done with the Retrode? I think the Retrode can dump Nintendo Power now: http://forum.retrode.org/index.php/topic,361.0.html

Anyway if the prototype pcbs I ordered work out I'll have a few spares.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skyhawk71 on Oct 12, 2017, 06:56 pm
Have you seen the work that skaman has done with the Retrode? I think the Retrode can dump Nintendo Power now: http://forum.retrode.org/index.php/topic,361.0.html

Anyway if the prototype pcbs I ordered work out I'll have a few spares.
I did see Skaman express interest in helping out with the Retrode code, but I didn't know that something was already done.

EDIT: Downloaded. Thank you for the link, Sanni!
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Oct 13, 2017, 10:02 am
No problem, to be honest since skaman poured his heart and soul into the Retrode I started looking for a used one on ebay too, "used" because I want an early version with the long SNES slot. :)
Before the Retrode wasn't even worth considering, at least for myself, since it could only do the easy stuff, basically the low hanging fruit without delving into the slightly harder stuff like N64 save support.

I really hope that the maker one day will release the source code for it so more people can help making it better. Especially since you don't have to "open-source" something when you release the source code. Just don't put it under an open-source licence and nobody can legally fabricate and sell your device. It would clearly benefit the product and probably even increase sales.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skyhawk71 on Oct 13, 2017, 11:12 am
I bought my Retrode 2 brand new from DragonBox. One of the original purposes I had for it was dumping Japanese ROM's so that they can be translated into English and played on an emulator. I didn't realize the Retrode's issues till I tried slotting in Xband and Nintendo Power carts. It couldn't read the actual ROM data on them.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: theodor613 on Oct 17, 2017, 02:07 pm
Just wanted to say that I have assembled 2 of these to program Dreamcast bios and they work great and fast! Currently have enough parts to make another 5 or 6 boards minus the Arduino clock, N64 cord, GBA adapter and Mega Drive adapters.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Oct 17, 2017, 10:07 pm
Here are my current design protoypes.

Low-cost single system versions of the cart reader
They share an optional external control unit with oled/buttons but also can be controller via the Serial Monitor from your PC or mobile phone.

N64:

(https://www.dropbox.com/s/by2imxsh0q08wgx/n64reader.png?dl=1)

(https://www.dropbox.com/s/a61cixxilght35t/n64reader2.png?dl=1)

Mega Drive/Genesis:

(https://www.dropbox.com/s/rkbkjhuviwuui7i/mdreader_v21.png?dl=1)

(https://www.dropbox.com/s/t5rdbf1riflwk8k/mdreader_v2.png?dl=1)

GB/A:
(https://www.dropbox.com/s/ljeg1087pgk170k/gbareader.png?dl=1)

SNES:
(https://www.dropbox.com/s/4kus4kgxb5a0ob5/snesreader.png?dl=1)

(http://​www.dropbox.com/s/wx102vphyvheitl/snesreader2.png?dl=1)​
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: theodor613 on Oct 18, 2017, 02:17 pm
That looks great Sanni! I would be interested in the flash programmer only. One without the snes adaptor and port. That would be great for me.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: wilykat on Oct 19, 2017, 12:38 pm
Have you looked at Atari Lynx?  All commercial games don't have bankswitching circuit or save system but a few of the address lines are used in an odd manner.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Oct 25, 2017, 11:52 am
I don't own any systems other than the ones I have already implemented.

In other news, I have done some further work on the new All-in-one board:

(https://www.dropbox.com/s/jhe196hu7b8mm8q/3d_model1.png?dl=1)

(https://www.dropbox.com/s/m8aczgoljhsl456/3d_model2.png?dl=1)

(https://www.dropbox.com/s/8lyop4jlxwp13v4/3d_model3.png?dl=1)

(https://www.dropbox.com/s/f09c8jltcwe39r5/3d_model4.png?dl=1)

(https://www.dropbox.com/s/2shcrtx9pv2kcsa/3d_model5.png?dl=1)

In this version the USB port at the back will also vanish and instead a little pcb will be used to convert the Arduino to 3.3V if needed following the tutorial by Adafruit (https://learn.adafruit.com/arduino-tips-tricks-and-techniques/3-3v-conversion​).

(http://www.dropbox.com/s/rgzzzo1akiljeal/3d_model6.jpg?dl=1)​
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: theodor613 on Oct 25, 2017, 02:21 pm
Looks like you raised the mega by adding some support legs. Wouldn't this put the SNES/Nintendo pin legs closer to the Arduino possibly making a short?
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: star1 on Oct 27, 2017, 02:53 pm
Hi everyone!
I got a mega, and soldered together a shield with a zif socket, and a diy sd adapter. So far so good.
However, I am unable to flash my 29F033.

"Flash ID: 4078
Flashrom Writer 8bit
 
 
Flash ID: 408B
Unknown flashrom"

This is what the serial monitor shows.

Also, is there any way to dump the contents of a flash rom?

Thanks in advance!

Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Oct 27, 2017, 06:40 pm
Either it's a wiring error or there are 29F033 with an ID of 0x4078, but since google did not show any results for 0x4078 I guess it's the first possibility.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: star1 on Oct 27, 2017, 07:00 pm
I suppose that is a possibility... I followed the pin out of the excel sheet, but let us go over it, and I can narrow it down from there.

A0-15 are easy enough
A16-A21 is pin 35-40
D0-D7 is pin 53-60
OE is connected to TX216
CE goes to PWM 9
WE foes to PWM 7
Pin 34 of the socket goes to 5v

Does this seem correct?

Edit: it IS correct, but I had managed to goof up the very last solder operation. WE was connected to pin 35 instead of 36.

Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: Pickle136 on Oct 30, 2017, 02:15 pm
Will the changes to allow reading Tengai Makyou Zero also allow for writing saves back to the cart?
I only pushed the changes to read the rom, nothing to do with the SRAM.

I also just pushed a change for a fix on dumping NP carts where the banks is greater than 96. (Specifically fire emblem 5). Thanks again to Skaman for pointing this out.

One final note I still have some extra original pcb layouts for sale. PM for details.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: hernan43 on Nov 05, 2017, 05:26 pm
I got a chance to assemble one of these this weekend. It is a super fun project. I had never soldered SMD components before.

This wasn't too bad as there are only a handful of them. It was great to see the super mushroom logo when I fired it up the first time.

Thanks to everyone who made this project possible!

(http://forum.arduino.cc/index.php?action=dlattach;topic=158974.0;attach=232339)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: EmkeyN on Nov 06, 2017, 05:11 pm
Hi Sanni,
Finally I have built mine with mega drive adapter.
I have a problem dumping mega drive cartridge.
The cart is correctly identified but when I try to read rom the cartridge reader stuck on reading message.
I haven't checked yet if the rom has been dumped on sd.
Can you help me?
Thanks for your good work.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Nov 06, 2017, 05:43 pm
What is the game called?

I only tested the Mega Drive code with Sonic 1, Sonic 3, Mega Games 2 and Striker. So there might be games that behave differently and need code changes to work.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: EmkeyN on Nov 06, 2017, 08:33 pm
I tested the following cartridge with same results:
Wrestle War
Jungle strike
Sonic
European club soccer

I have some other cartridge that i'll test soon.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Nov 06, 2017, 10:19 pm
Can you make a picture of the Sonic pcb so I can compare it to the version I have?

Just as a reference, this is how fast Sonic should dump:

(https://i.imgur.com/7dXcaQe.jpg) (https://www.youtube.com/watch?v=TDpdc0QAsig)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: EmkeyN on Nov 07, 2017, 08:48 pm
Here are the photo of my sonic pcb.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Nov 07, 2017, 09:16 pm
Ok, this is the exact same Sonic pcb that I have, so your problem lies somewhere else.
Do you use a microSD or a full size SD card?
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: theodor613 on Nov 07, 2017, 09:50 pm
Could you also upload pictures of the adapter as well? Maybe there's some soldering issue.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: EmkeyN on Nov 09, 2017, 06:55 am
Solved. The problem was sd.

Thank you!
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: redphone on Nov 23, 2017, 08:09 am
I was wondering if we could use, or find, any cheaper alternatives for the slots. The AliExpress sellers seem a tad more expensive than these, if they are compatible:

https://www.ebay.com/itm/131137330390
https://www.ebay.com/itm/5pc-Industrial-Card-Edge-Slot-Socket-Connector-25x2P-50P-2-54mm-0-1-3A-240-50-/140888533934?hash=item20cd9c6bae

Can anyone confirm if these work? compared to
https://www.aliexpress.com/item/50Pins-Slot-for-N64-Game-Cartridge/32719168154.html

Same for GB/GBA slots... but those seem harder to find.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Nov 23, 2017, 09:05 am
I was wondering if we could use, or find, any cheaper alternatives for the slots. The AliExpress sellers seem a tad more expensive than these, if they are compatible:

https://www.ebay.com/itm/131137330390
https://www.ebay.com/itm/5pc-Industrial-Card-Edge-Slot-Socket-Connector-25x2P-50P-2-54mm-0-1-3A-240-50-/140888533934?hash=item20cd9c6bae

Can anyone confirm if these work? compared to
https://www.aliexpress.com/item/50Pins-Slot-for-N64-Game-Cartridge/32719168154.html

Same for GB/GBA slots... but those seem harder to find.
The 50 pin slots you posted have 2.54mm pin spacing, the N64 has 2.5mm.

Here are some single slots from aliexpress for $1.80:
GBA: https://www.aliexpress.com/item/For-Nintendo-DS-NDSL-GBA-Game-Cartridge-Card-Reader-Slot-Repair-Part/32679592016.html?
N64: https://www.aliexpress.com/item/High-quality-50-Pin-Connector-Game-Cartridge-Slot-for-Nintendo-64-for-N64-Console/32829907088.html?

They look fine but I have not ordered them. If you do please post whether or not they are good quality and fit.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: tamanegi_taro on Nov 25, 2017, 01:55 am
I guess someone need to confirm by buying those cheaper one.
My cart reader has 2.54mm pitch socket for N64 but still works. It is same socket sanni mentioned. Pins on the edge of the slot will misaligned by 1.00mm (25 * 0.04mm = 1.00mm) but hopefully this misalignment won't short adjacent pins together.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Nov 25, 2017, 12:38 pm
My newest iteration combines the SNES, Megadrive, N64 and GBA/GBC slots into one unit ... but don't plug them in all at the same time  :smiley-lol:

(https://dl.dropboxusercontent.com/s/e6og8bt9d1pvl3n/cartv15.jpg?dl=1)

There is now only one USB port, the one from the Arduino Mega. The barrel plug serves no purpose anymore.

(https://dl.dropboxusercontent.com/s/fehmbuogwh397j3/cartv15_2.jpg?dl=1)

To achieve 3.3V for N64 and GBA a little pcb, pictured in the top right corner, gets soldered to the Arduino Mega that can convert it to 3.3V following the Adafruit tutorial (https://learn.adafruit.com/arduino-tips-tricks-and-techniques/3-3v-conversion).

(https://dl.dropboxusercontent.com/s/pn8rh78t4tethp8/cartv15_5.jpg?dl=1)

The flashrom adapter also got revised and the 16bit slot at the back got converted to a 16bit in 8bit mode slot, so only 8 data pins are connected and thus the pcb could be made smaller.

(https://dl.dropboxusercontent.com/s/0p2j22vxfzcwvll/cartv15_3.jpg?dl=1)

There are two switches that change the pinout from a MX29L3211 to a MX29LV160, basicly just switching WE to the other side and connecting the Reset line, so now you can easily flash Dreamcast region free bios chips too.

(https://dl.dropboxusercontent.com/s/rurj6sxhc3g05jx/cartv15_4.jpg?dl=1)


And here is the N64 only Cart Reader variant:

(https://dl.dropboxusercontent.com/s/cr3im07belixdmr/n64reader_1.jpg?dl=1)

(https://dl.dropboxusercontent.com/s/kwzmh2kvrn33fcp/n64reader_2.jpg?dl=1)

(https://dl.dropboxusercontent.com/s/4ulb26qspy0qj4q/n64reader_3.jpg?dl=1)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: tamanegi_taro on Nov 26, 2017, 03:55 am
Looks so nice sanni!
That should be very difficult to get all wireings fit in the small PCB board.


I'm trying to develop pcengine hucard(turbografx-16 turbochip) adapter but I don't know which socket I should buy.

Hucard
https://en.m.wikipedia.org/wiki/HuCard

I found hucard dumper with card edge socket but I can't find which socket this is.
http://likecatlovecat.up.n.seesaa.net/likecatlovecat/image/pce01.jpg?d=a1

Anyone have any idea?

Retrode2 support dumping hucard using hucard-snes adapter.
So I'm planning to develop adapter board using this pin assignments.
http://www.retrode.org/plug-in-adapters/
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: hernan43 on Nov 27, 2017, 02:34 am
I looked into the HuCard adapter for my retrode as well. I couldn't find a place that had them. I saw that Rene from db Electronics got one from http://www.famulator.com. I didn't see them for sale so maybe he got one on the side.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Nov 28, 2017, 07:11 am
Game Doctor HK had a few HuCard card slot boards pulled from PCE units.

I bought a couple for a prototype TG16/PCE plugin for the Retrode.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Nov 28, 2017, 09:34 am
If you have an old pc mainboard with a PCI slot lying around you could test if the Hucard fits into that and if yes you could buy a 40pin slot with 1.27mm spacing and just cut slots into the ends to make the card fit.
https://www.ebay.co.uk/p/5-Pcs-1-27mm-Pitch-40-Pin-PCI-Card-Edge-Slot-Connector-Socket-Beige/1438256747
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: hernan43 on Nov 28, 2017, 03:33 pm
I have read that suggestion in other places as well. That might be the way to go. I might buy some and try it out to see.

Thanks!
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: EmkeyN on Dec 03, 2017, 05:55 pm
I was wondering if we could use, or find, any cheaper alternatives for the slots. The AliExpress sellers seem a tad more expensive than these, if they are compatible:

https://www.ebay.com/itm/131137330390
https://www.ebay.com/itm/5pc-Industrial-Card-Edge-Slot-Socket-Connector-25x2P-50P-2-54mm-0-1-3A-240-50-/140888533934?hash=item20cd9c6bae

Can anyone confirm if these work? compared to
https://www.aliexpress.com/item/50Pins-Slot-for-N64-Game-Cartridge/32719168154.html

Same for GB/GBA slots... but those seem harder to find.
I built my second reader using slot from an old pc pcb.(just for fun, I was bored and I have a lot of spare parts)
I had to cut the pc slot in four parts and test connections with a multimeter to use with n64 cartridge.
It could look not very elegant but it works well.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: hernan43 on Dec 03, 2017, 06:11 pm
How close is the all-in-one reader getting to being complete enough for the Github repo? It looks pretty good. I was pretty excited to see pictures of the actual hardware.

Very cool!
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: tamanegi_taro on Dec 04, 2017, 01:46 am
http://docs-europe.electrocomponents.com/webdocs/06a6/0900766b806a61d0.pdf

Thanks! I can see that all PCI slots are 1.27mm pitch.
I think PCI 120pin sockets are better.
I'll try 120pin socket. I hope card will fit.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: tamanegi_taro on Dec 12, 2017, 12:50 pm
Oh no. Card didn't fit in PCI slot.
Thickness of PC engine hucard is about 2.3mm and PCI is only like 1mm thick.
I need to find way to cut slot into half without cutting my finger.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: Cyber_Akuma on Dec 13, 2017, 01:25 am
Are there by any chance any more detailed guides on assembling Sanni's cart reader for one who wants to build one and has no skills in reading schematics or being able to assemble any circuitry from just a parts list? The "PCB Build Guide" still assumes many steps are obvious for those who know how to do it. (It also seems to be based on one of the first revisions of the board and not the newer designs).
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: hernan43 on Dec 13, 2017, 01:48 am
I thought the build guide was fairly complete. Is there a particular step you are having trouble with?
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: theodor613 on Dec 13, 2017, 02:31 pm
Are there by any chance any more detailed guides on assembling Sanni's cart reader for one who wants to build one and has no skills in reading schematics or being able to assemble any circuitry from just a parts list? The "PCB Build Guide" still assumes many steps are obvious for those who know how to do it. (It also seems to be based on one of the first revisions of the board and not the newer designs).
The build guide is complete for the current release that he has available. As far as I can see, he hasn't uploaded the standalone version or the all in one yet. You just need to know how to solder. Parts are labeled on the PCB so just match the part with the PCB label and solder away.

I have at least 2 fully assembled and tested for programming the MX29F1610MC-10. They programmed just fine and the chips work. I also have another 6 or 7 all sodered just not yet assembled.

If you are located in the United States, I can help you out here, if you want to purchase one instead.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: Cyber_Akuma on Dec 13, 2017, 03:01 pm
I thought the build guide was fairly complete. Is there a particular step you are having trouble with?
Well, mainly, the steps basically go "Here's all the parts to solder in this step, solder them in"

I have no idea where or how, since it basically just shows all the sets of parts to just solder in at once, and not specifically how to do each one.

I have at least 2 fully assembled and tested for programming the MX29F1610MC-10. They programmed just fine and the chips work. I also have another 6 or 7 all sodered just not yet assembled.

If you are located in the United States, I can help you out here, if you want to purchase one instead.
That would help. Really, it's the sourcing the parts (especially since many of the parts lists are broken links so I would need to know a viable replacement), ordering the PCBs, and soldering that's an issue.... granted, that's about 95% of the work. If all you need to do to assemble them is basically plug their pin headers and any cabling into each other, then that dosen't sound difficult to do at all.

Which revision are these by the way? I was hoping to see if I would be able to build the newer version of the multi-cart one shown in post 377.

By the way, this is likely a stupid question now, but I just noticed, it dosen't support the NES right? Although SNES, Genesis, and N64 are my main concern anyway. I am hoping to be able to use this to backup my saved data before the batteries expire.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: hernan43 on Dec 13, 2017, 03:46 pm
Well, mainly, the steps basically go "Here's all the parts to solder in this step, solder them in"

I have no idea where or how, since it basically just shows all the sets of parts to just solder in at once, and not specifically how to do each one.
Yeah I understand what you mean. In terms of placing the parts I think they are more or less "color coded" so you just have to match them up to what is in the picture. The one exception is the tantalum capacitor which does have to be soldered in a specific orientation.

I watch a lot of the GameTechUS videos on Youtube. He has a lot of videos demonstrating how he solders on surface mount stuff. I found this one to be particularly helpful when building this project:

https://www.youtube.com/watch?v=Fbciki5v0Rs

I realize this doesn't help a ton with this project but for NES carts/saves I use the Kazzo Dumper-Programmer:

http://www.infiniteneslives.com/kazzo.php

It is super cheap and works pretty well.

--Ray
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: theodor613 on Dec 13, 2017, 05:34 pm
Which revision are these by the way? I was hoping to see if I would be able to build the newer version of the multi-cart one shown in post 377.

I have the latest board that is on the front page of the GitHub.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: Cyber_Akuma on Dec 14, 2017, 11:44 am
I have the latest board that is on the front page of the GitHub.
What types of games does that one support? SNES is obvious, but is that a Genesis or a N64 port? And does it still have a GB/GBA port? The front page of the GitHub mentions SNES/N64/Genesis(MegaDrive)/GB/GBA support, but I can only see two cartridge slots, not 3. One of those is obviously SNES, but I can't tell if the other is Genesis or N64.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: theodor613 on Dec 14, 2017, 02:44 pm
It is an N64 slot. The Genesis port is not included on the board I had made. He was still working on the prototype PCB when I had the boards made. The only functions that I know for sure that works are the sd, oled, all the buttons and the programming of the MX chips through the snes adapter PCB. As this was the only intended function that was I desired.

I believe the adapter PCB he has, you can add the Genesis port to the specific adapter and then it'll plug into the snes port for programming or reading. Maybe Hernan43 can confirm??? This goes the same for the GB/GBA port as well.

Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: hernan43 on Dec 14, 2017, 02:50 pm
That sounds correct. The Megadrive/Genesis functionality is achieved through a cart adapter, same goes for the GB/GBA.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: Cyber_Akuma on Dec 14, 2017, 07:05 pm
The only functions that I know for sure that works are the sd, oled, all the buttons and the programming of the MX chips through the snes adapter PCB. As this was the only intended function that was I desired.
Wait, so you don't know if the cart dumping or save backup/restore functions work? Since that's the main reason I wanted to build this.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: theodor613 on Dec 14, 2017, 07:57 pm
Plain and simple, I don't have any cart to dump. I mainly built this to write Dreamcast bios into the MX chips. Which works great! There are other users on here that built the same PCB that have success with what they are looking to do with it.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: hernan43 on Dec 14, 2017, 07:58 pm
I think they are just saying they haven't tried it yet. All of the dumping and ROM saving work on the ones I have.

I have not tried dumping genesis saves as I don't think any of my genesis games have save ram.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Dec 15, 2017, 09:21 am
I've fixed most of the dead links in the wiki and added some more information.  ;)

The current pcb design uploaded on Github has been tested by many many people and works quite well. For GB/GBA and Megadrive you need to also order the adapter pcbs.
Here is an overview of the Cart Reader (Github version): https://github.com/sanni/cartreader/wiki/Cart-Reader-Github-Version (https://github.com/sanni/cartreader/wiki/Cart-Reader-Github-Version)

If you don't think your solder skills are up to the task just ask someone in this thread to build it for you. :)

The new All-in-One pcb design is still in development and won't be uploaded to Github for quite some time. The major difference compared to the version available on Github is that the GB/GBA and Megadrive slots are now part of the main pcb, so mainly cosmetic changes. Both versions can do the same things and run the exact same Arduino Code.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: Cyber_Akuma on Dec 15, 2017, 05:55 pm
Plain and simple, I don't have any cart to dump. I mainly built this to write Dreamcast bios into the MX chips. Which works great! There are other users on here that built the same PCB that have success with what they are looking to do with it.
Ah, I see. Fair enough.

Is the offer to help me get one still on the table?

I've fixed most of the dead links in the wiki and added some more information.  ;)
Thanks Sanni. I think it might be best for now to see who on these forums can help me get an assembled (or at least soldered) one and then i will try to see if I can build the newer all-in-one version myself someday once the design has been completed. I should learn to solder someday anyway, might as well start with that.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: theodor613 on Dec 15, 2017, 05:59 pm
yes
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: Cyber_Akuma on Dec 15, 2017, 09:48 pm
Ok, so how would we go about doing that?
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: theodor613 on Dec 15, 2017, 09:54 pm
I'll pm you.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: Cyber_Akuma on Dec 18, 2017, 08:10 pm
By the way, A bit of a random question. Has anyone attempted to work on trying to get Sega CD Backup RAM Carts can to be read from/written to with this? They were basically a SRAM memory card that plugs into the Genesis cart slot for the SegaCD.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Dec 19, 2017, 02:06 pm
By the way, A bit of a random question. Has anyone attempted to work on trying to get Sega CD Backup RAM Carts can to be read from/written to with this? They were basically a SRAM memory card that plugs into the Genesis cart slot for the SegaCD.
As a general rule, everything that is not explicitly mentioned to work on the github page (https://github.com/sanni/cartreader) is not supported.

However since I did post the source code you can always add features yourself. In fact this is the main purpose of my cart reader project.

Now for the Sega ram cartridge you would first check the datasheet (https://www.digchip.com/datasheets/parts/datasheet/453/CXK581000M-10L.php) of the Sony cxk581000m sram ic found on its pcb (http://retrostuff.org/wp-content/uploads/2016/05/backup_ram_12.jpg). Then you use a multimeter to figure out to where all the pins connect to. Next you have to work out what all the additional 74 logic chips do, most likely they control WE/CE/OE or some address pins.
Then you look at how the sram of standard cartridges is read out in the current code and change it according to the schematic you have figured out earlier.

And hopefully when you have working code you'll post it here so everyone can use it.  :)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: Cyber_Akuma on Dec 19, 2017, 02:40 pm
I know it isn't on the GitHub page, I was just asking if anyone here had ever looked into it even if they didn't get far.

I have looked up the pinout of it before in an attempt to try to replace the SRAM chip with a FRAM one, including schematics on how to assemble one from scratch, I can try to use that to determine how to read it with the cart-reader.

Although, what do you mean by additional 74 logic chips? The PCB for the carts has 6 ICs on it, 1 of which is the SRAM itself.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: stinkpickle on Dec 21, 2017, 01:08 am
Successfully built my cart reader and am super happy with it! (Other than messing up the solder pads for the cart reader pcb's micro usb. no n64 for me for now!)

That being said, I am having an issue reading Starfox (snes). The issue is that there is an error that occurs when checking the checksum since it comes back differently than the initial read. Can anyone give me a hand on this issue?
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: drkow on Dec 26, 2017, 04:13 am
Can we flash the INL SNES repros with this hardware?
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Dec 27, 2017, 04:34 pm
That being said, I am having an issue reading Starfox (snes). The issue is that there is an error that occurs when checking the checksum since it comes back differently than the initial read. Can anyone give me a hand on this issue?
Try it with the switches set like this:

(https://dl.dropboxusercontent.com/s/5np6jvcv7x6ilvl/flash_jumper.jpg?dl=1)

Can we flash the INL SNES repros with this hardware?
In theory yes if someone would write the needed code changes for it. The INL SNES repros seem to use the 3.3V Spansion S29GL flashroms which my cart reader can flash. They seem to use a 74lvc16245 as a level shifter so they should be safe to use with a real SNES too unlike the typical chinese SNES repro.
I could not find a schematic for the INL repros so someone would need to figure that out first to see how the CE/OE/WE lines of the flashrom are routed.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: stinkpickle on Dec 31, 2017, 07:02 am
No luck.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Jan 05, 2018, 11:28 am
Have you checked if the dump itself is ok for example by comparing it to a known good dump in a hex editor?
I only have the japanese Starfox and it does dump and calculate the checksum correctly.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: drkow on Jan 05, 2018, 06:22 pm
In theory yes if someone would write the needed code changes for it. The INL SNES repros seem to use the 3.3V Spansion S29GL flashroms which my cart reader can flash. They seem to use a 74lvc16245 as a level shifter so they should be safe to use with a real SNES too unlike the typical chinese SNES repro.
I could not find a schematic for the INL repros so someone would need to figure that out first to see how the CE/OE/WE lines of the flashrom are routed.
Do you know if anyone has tried to reflash the chinese SNES repros? Was thinking of ordering some and giving it a try.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Jan 06, 2018, 07:28 pm
As far as I know those use the same flashrom chips as the gba and n64 repros so you just have to copy and paste some of the already available code together to reflash them.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Jan 10, 2018, 10:44 am
Here are some fresh pictures of my most recent build:

(https://dl.dropboxusercontent.com/s/13g1392eo3ooq8w/v15_top.jpg?dl=1)

(https://dl.dropboxusercontent.com/s/akuzs9wctm58pl6/v15_front_left.jpg?dl=1)

(https://dl.dropboxusercontent.com/s/sb36yxcb8tutuaq/v15_front_right.jpg?dl=1)

(https://dl.dropboxusercontent.com/s/8acdkk2gwo7pgxm/v15_back.jpg?dl=1)

(https://dl.dropboxusercontent.com/s/q2u4rnnvhmrrwvc/v15_left.jpg?dl=1)

I'm going to make two more just to be sure the current design is not only reliable but also works consistently across different builds.

Here is one more picture from "under the hood":

(https://dl.dropboxusercontent.com/s/loe6apru7um155r/underthehood.jpg?dl=1)

As for the Arduino sketch lately I have been concentrating on fixing bugs so no new features since my last status update.
I have however worked on the wiki: https://github.com/sanni/cartreader/wiki/Cart-Reader-AIO (https://github.com/sanni/cartreader/wiki/Cart-Reader-AIO)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: theodor613 on Jan 11, 2018, 02:11 pm
I see the newly updated flash adapter schematic. Does this change the PCB as well? If so, would the old adapter still work with the new and old reader?
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Jan 11, 2018, 02:29 pm
The old adapter has an 8bit(=byte mode) socket at the front for flashroms like 29F032 and a 16bit(=word mode) socket at the back for 29L3211  and 29F1610. For the back slot you would use the 16bit flashrom programmer menu.

The new flash adapter has the same 8bit socket for flashroms like 29F032 but the 16bit slot at the back got replaced with a "16bit flashrom wired as 8bit" slot. Therefore the schematic/pcb has changed.
So with the new adapter you now use the 8bit flash menu for the slot at the back too.
Additionally it now has two switches to add support for the 29LV160, which has its WE pin on the opposite side.

The old flash adapter will still work with newer cart reader revisions, simply select the 16bit menu option for the slot at the back.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: theodor613 on Jan 11, 2018, 02:51 pm
I need to be able to program both 29LV160 and 29F1610. I got extra boards so maybe a trace cut and adding some switches, I could emulate the newer flasher adapter? at least just to get the 29LV160 programming or does this need to be done in 8bit as well?

Also will the new adapter work with the old cart reader?
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Jan 11, 2018, 07:23 pm
Well you could make it work.
First you would need to rewire the WE pin to the opposite site. Just have a look at the 29LV160's pinout in its datasheet and then you would have to add a 16bit flashwrite function for the 29LV640 series of flashroms to the code since currently there is only the 8bit flashwrite function in there.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: theodor613 on Jan 11, 2018, 07:55 pm
I'll just wait for the new flash adapter to arrive. Also waiting for the standalone to be released when ready.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: hernan43 on Jan 18, 2018, 06:08 pm
Sanni,

On this page:

https://github.com/sanni/cartreader/wiki/Programming-a-29F032-flashrom

Is the flash adapter using a 40 pin universal socket? I don't think I saw it on the parts list, so I _tried_ counting the pins in the pic. Just curious to know which part you used for that. Thanks!

--Ray
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Jan 19, 2018, 10:27 am
It's this one: https://www.ebay.com/itm/351492841197
The last two pin rows have to be bent away before soldering because the flash adapter pcb only has 36 pins.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: hernan43 on Jan 25, 2018, 05:41 pm
Excellent! Thanks so much.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: grizzlyjere on Feb 06, 2018, 03:00 am
Hi All, I was going to build one of these but thought I'd see if anyone already has parts to sell a completed one.  Anyone selling kits or pre-built ones?  Thanks!
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: theodor613 on Feb 06, 2018, 03:46 pm
Hi All, I was going to build one of these but thought I'd see if anyone already has parts to sell a completed one.  Anyone selling kits or pre-built ones?  Thanks!
If Sanni doesn't have any extras left, I have one available. It isn't the all in one but it is the most current one available that's on his GitHub page. PM me for details if Sanni doesn't have any extras.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: Cyber_Akuma on Feb 10, 2018, 06:54 am
Being someone who has had little experience with Ardunios before, I am a little unsure how to flash the newer firmware on the AIO units, the instructions don't completely match up with the new AIO design:

https://github.com/sanni/cartreader/wiki/How-to-flash-the-Arduino-Code-to-your-Cart-Reader

In the instructions, the units seem to (or at least those instructions make me assume) have a separate micro-USB and USB-B port, as well as a separate 5v/3v switch and on/off switch.

The AIO units just have a single Micro-USB port, and a 5v/off/3v switch instead of the on/off switch being separate from the 5v/3v switch.

I assumed that the Micro-USB port now fills both roles, but I was not sure what to do with the voltage/off switch. When set to Off, my PC does not recognize that anything has been plugged in at all, and on 5V the unit itself is running when plugged in, and I am not sure if it would be safe to flash it while it is running normally like that.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Feb 10, 2018, 09:13 am
Yes the single USB Port can now be used for everything and the voltage switch should be switched to 5V. The Arduino will be on but that is ok.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: Cyber_Akuma on Feb 10, 2018, 02:10 pm
Thank You!
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: Einhandr on Feb 19, 2018, 04:22 pm
So I found this thread through a google search looking for a device that would allow me to backup game saves and also re-write SF memory/NP carts for super Famicom. This looks so impressive!  I'll admit, I know nothing about arduino or hobby electronic component kits and the like but I made an account just to say how impressive this kit is. Is there anyone that's making these for others? I'd pay a decent sum for someone to build one out for me as I'm pretty sure I don't process the skills to make one on my own.

Edit:  Looks like I'm getting some assistance in a few weeks, thanks everyone!
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: hanson933 on Feb 22, 2018, 06:07 am
Hey Sanni,
I was going to take a crack at making a 64 only cart reader for flashing repro carts etc.
I can't see any gerber files or anything for getting just the 64 cart reader PCB printed.
Do you have them anywhere? Or am I just blind?
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: theodor613 on Feb 22, 2018, 02:11 pm
He hasn't released them yet.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: werewolfslayr925 on Mar 03, 2018, 07:42 am
Newbie here. I'm very pleased with the idea for this device. Special thanks to everyone who's developed code and such for dumping special SNES/SFC carts.

So far I (and a friend) have built the ROM dumper. However, I have run into several problems.

1. At first I could not dump SNES games. I tried common stuff like Pop'n'Twinbee and MegaMan X, but neither of them dumped at first. I haven't gotten Twinbee to work, but I did make what the reader identifies as a clean dump of MegaMan X. This was only done after heavy cleaning of the cartridge. No surprise about the cleaning (the Kazzo NES dumper has similar issues), but I wasn't sure what was wrong with it up to that point. Is there a(n easy) way to troubleshoot this to make sure that it isn't just my cartridges being dirty?

2. I can't seem to get it to dump N64 cartridges. I've tried Mischief Makers and Majora's Mask, but neither of them reads properly and it just gives me jumbled/weird characters for the title and ID of the game. These are a bit harder to test as I'm not as familiar with N64 emulators as I am with those of older consoles. Am I missing something or are the carts just that dirty?

3. I consistently have trouble dumping Game Boy carts. I have tried three different cartridges (The Final Fantasy Legend, The Final Fantasy Legend II, and Super Mario Land 2), each cleaned at least five times. I consistently get the same results though. For example, FFL1 's cart info is as follows:

Code: [Select]

NAME: Q
ROM type: ROM+RAM
ROM Size: Not found
Banks: 2
Sram Size: Not found
Checksum:DB5D


And when I try to dump the game it gives me an erroneous checksum of D707. It's done that for the last umpteen times. I've dumped enough carts to know that I'm doing something wrong and that it isn't the cartridge. I have very low-level soldering skills, so I'm thinking that maybe it's the soldering job I did on the cartridge slot (see attached)? However, all the pins are connected and solitary. Is there a way to troubleshoot this as well?

4. How do I get the "Nintendo Power" option as seen in this video (https://www.youtube.com/watch?v=KztLeOWPq6s) to which sanni linked in the wiki? Does anyone have any advice for dumping a cart like this?

Thanks in advance!
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: tamanegi_taro on Mar 03, 2018, 07:56 am
I've had no problem with dumping N64, SNES, GB games so far with latest cart dumper on github.

Before you do anything, clean the carts. Did game boot successfully on real consoles? If not, keep cleaning. I had one of those old Nintendo game which I had to use fine sand paper to remove rust on contact to get it recognized.

Than, use your tester to make sure that no adjacent pins are connected. If important pins are connected, you can't dump games.

sanni's cart reader support dumping NP carts too so you should have no problem dumping those carts once you get the problem fixed.(You might need clockgen module and snescic).
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Mar 03, 2018, 10:39 am
The parts of the code that work 100% consistently every time, where I literally never had an error ever, are:
- writing 29F033 flashroms with the 8bit flash adapter for testing the SNES slot
- writing N64 Chinese repros with 2x S29GL256N flashroms for testing the N64 slot
- writing 29F033 custom diy MBC5 flash carts (Reiner Ziegler type) for testing the Gameboy slot
- reading the N64 controller's buttons and stick values for testing the N64 controller plug

These are also the very first things I test when building a cart reader.

Known problems:
- most N64 slots sold on Aliexpress actually have a 2.54mm spacing instead of 2.5mm. So you need to make sure that you insert the N64 cartridge perfectly centered or it will not make good contact.
- there are two sd modules linked in the parts list, one for standard sized and one for micro sd cards. The micro sd cards read/write a lot slower for some reason. And the full-size sd module is missing a voltage level converter and thus only high quality full-size sd cards seem to work without problems, others will encounter read/write errors. I have designed a full-size sd module with voltage level converter and will upload it once I have tested it.
- sometimes the pcb manufacturer gets a little sloppy and the solder mask is not aligned perfectly and it is possible that the GND plane is exposed and makes contact through solder with a function pin, so you always need to check each and every pin for a short to GND
- the Arduino comes with a 2.7V brown out detection by default, with some Arduinos it is necessary to lower it to 1.8V by changing the fuses for correctly dumping N64 carts

Parts of the code that experience some troubles currently:
- dumping N64 carts sometimes does not work correctly ever since I optimized the code towards writing N64 repros. I'll need to have a look at that again sometime.
- dumping GBA carts can be unreliable as sometimes a byte or two will get dumped incorrectly, I think it was mostly with eeprom save carts if I remember correctly. Flashing repro carts once again works perfectly though.

The whole code was written without having a logic analyzer which explains why the timings can be a little bit wonky.

The Nintendo Power options now can be found under the SNES and Gameboy menus respectively.

Now in your specific case it sounds more like you have made a soldering mistake somewhere since basically nothing works for you. Get a multimeter and check each and every connection against the schematics: https://github.com/sanni/cartreader/blob/master/pcb/cartreader_schematics.png
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: werewolfslayr925 on Mar 03, 2018, 04:49 pm
I've had no problem with dumping N64, SNES, GB games so far with latest cart dumper on github.
This is what's been done on my end as well.

Quote
Before you do anything, clean the carts. Did game boot successfully on real consoles? If not, keep cleaning. I had one of those old Nintendo game which I had to use fine sand paper to remove rust on contact to get it recognized.
I have managed to boot up the games I want to dump on a GBA SP, yes. They work fine on the GBA SP hardware.

Quote
Than, use your tester to make sure that no adjacent pins are connected. If important pins are connected, you can't dump games.
Now in your specific case it sounds more like you have made a soldering mistake somewhere since basically nothing works for you. Get a multimeter and check each and every connection against the schematics: https://github.com/sanni/cartreader/blob/master/pcb/cartreader_schematics.png

sometimes the pcb manufacturer gets a little sloppy and the solder mask is not aligned perfectly and it is possible that the GND plane is exposed and makes contact through solder with a function pin, so you always need to check each and every pin for a short to GND
This looks more complicated to me than it probably is, but how am I supposed to test the pins on the GB cart adapter? I don't see the GB cart adapter incuded in the the schematic. I'm brand new to electrical engineering, so, if you can, please "explain it to me like I'm five". Where do I put the points of the tester? Do I need to test each and every pin? What am I looking for exactly when I put the points of the tester wherever I'm to put them?

sanni's cart reader support dumping NP carts too so you should have no problem dumping those carts once you get the problem fixed.(You might need clockgen module and snescic).
I have the clock generator plugged in. I don't see the option to do the NP cartridges on the OLED, though. In the video posted by sanni, there's an option for "Nintendo Power" on the OLED. I don't get that on my OLED screen. Am I missing something in the software flashed to the Arduino or does the Nintendo Power option have a different name?

most N64 slots sold on Aliexpress actually have a 2.54mm spacing instead of 2.5mm. So you need to make sure that you insert the N64 cartridge perfectly centered or it will not make good contact.
All of my cartridge slots are taken from old consoles I have had lying around. A friend of mine and I desoldered when we needed to (SNES slot) and he soldered on the SNES and N64 slots. I soldered the GBA SP slot (again, see picture). For the record, his soldering skills (and tools) are much more efficient than mine, so if there's anything that wasn't soldered correctly, it was the GBA SP slot.

there are two sd modules linked in the parts list, one for standard sized and one for micro sd cards. The micro sd cards read/write a lot slower for some reason. And the full-size sd module is missing a voltage level converter and thus only high quality full-size sd cards seem to work without problems, others will encounter read/write errors. I have designed a full-size sd module with voltage level converter and will upload it once I have tested it.
Again, I've managed to get a clean dump of MegaMan X, so I don't think it's the SD card or anything associated directly with it.

dumping N64 carts sometimes does not work correctly ever since I optimized the code towards writing N64 repros. I'll need to have a look at that again sometime.
Is there and older version of the code that is better for dumping N64 carts? I'm really not interested in writing anything to cartridges. I'm just interested in preserving my personal game collection and or putting them on my PSP to play wherever.

dumping GBA carts can be unreliable as sometimes a byte or two will get dumped incorrectly, I think it was mostly with eeprom save carts if I remember correctly. Flashing repro carts once again works perfectly though.
Not a problem. I use a DS lite and an R4 for dumping GBA games :P

Edit: Oh! A couple of other things.

First, just to be sure, the hex code that needs to be put on the PIC12F629 is this code here (https://github.com/sanni/cartreader/blob/master/extras/snesCIC/snescic-lock-resync.hex), correct? (I should hope so, since there doesn't seem to be any other pure hex code on that page).

Second, what are the requirements and/or procedures as of right now for dumping the following?

- MegaMan X2
- Tengai Makyou ZERO (Far East of Eden ZERO) (SPC7110)
- Star Ocean
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: Newbie2 on Mar 03, 2018, 09:08 pm
Second, what are the requirements and/or procedures as of right now for dumping the following?

- Tengai Makyou ZERO (Far East of Eden ZERO) (SPC7110)
I believe you need extra functionality for the SPC7110, and that the adafruit clock generator attachment should provide it. In terms of software, in the past Sanni's main build did not have code for the SPC7110, but that may have changed.  If it does not, my understanding is that Sanni may have a separate version with that support, so you may need to contact him to see if he can provide it.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Mar 04, 2018, 01:44 am
Pickle merged the SPC7110 code by skaman (https://github.com/sanni/cartreader/pull/9) into the current version of the cart reader code. And yes it does require the Adafruit clock generator. I myself have not tested SPC7110 carts however since I don't own any.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: Newbie2 on Mar 04, 2018, 04:59 am
Sanni, do you know whether the cart reader supports flashing BennVenn's MBC3 RTC Game cart with 2mbytes Flash ROM? (https://bennvenn.myshopify.com/collections/frontpage/products/genuine-mbc3-rtc-game-cart-with-2mbytes-flash-rom-fitted) BennVenn said that the flash chip is a 29w640 flash IC, and that most flashers should support it. He also said that WE is tied to AudioIN (not sure what that means...)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Mar 04, 2018, 10:29 am
Adding support for writing flashroms on a MBC3 board should be easy to implement as only the first one or two banks differ between the current MBC5 based implementation and MBC3. But if you make a MBC3 flashcart you should use a 29F016 flashchip instead since the 29w640 is 3V only and the Gameboy is 5V so it will damage your handheld according to db-electronics: https://db-electronics.ca/2017/07/05/the-dangers-of-3-3v-flash-in-retro-consoles/
Pokemon Gold/Silver is $3 from Japan(I think at least the early japanese versions have the needed 32 pin chip pcb and not the 44pin one), 29F016 chip is $2 from China and the adapter pcb you can order from oshpark $2.40 for 3 pcbs. A tutorial can be found here: https://www.jrodrigo.net/wiki/how-to-diy-a-gameboy-flash-cartridge-with-a-rom-adapter-board/

Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: Newbie2 on Mar 04, 2018, 03:12 pm
Adding support for writing flashroms on a MBC3 board should be easy to implement as only the first one or two banks differ between the current MBC5 based implementation and MBC3. But if you make a MBC3 flashcart you should use a 29F016 flashchip instead since the 29w640 is 3V only and the Gameboy is 5V so it will damage your handheld according to db-electronics: https://db-electronics.ca/2017/07/05/the-dangers-of-3-3v-flash-in-retro-consoles/
I should have been more clear, I already purchased one of bennvenn's carts, rather than looking to make my own.

That said, I think you answered my question anyways, which is that right now it is not supported, but potentially I could add support to the cart reader software for it.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Mar 04, 2018, 03:47 pm
Which is that right now it is not supported, but potentially I could add support to the cart reader software for it.
I did order some Pokemon Gold/Silver carts and will at least implement flashing a MBC3 flashcart with 29F016 in the near future.

I don't see the GB cart adapter incuded in the the schematic.
The schematics are all available on github: https://github.com/sanni/cartreader/tree/master/pcb

Where do I put the points of the tester? Do I need to test each and every pin?
Yes each and every pin since you don't know where the error lies if there is one. You can also post detailed pictures of the pcb here maybe we can spot some errors right away like cold solder joints or bridges.
The easiest thing to start checking would be setting your multimeter up for continuity testing and then connect one probe to GND and touch every pin on the SNES/N64 cart slot with the other probe. There should only be continuity on the GND pins.
Then do a visual inspection using a magnifying glass of the GB adapter, make sure that no two pins are bridged, since the pins are so small it can be hard to spot.

Is there and older version of the code that is better for dumping N64 carts?
Every single revision starting from V16 is available on github: https://github.com/sanni/cartreader/commits/master?after=9c2fcae43dda179f9f0347c006357314c74be298+244
I'm currently still working on the next hardware revision and until that is finished I do not want to change anything in the code so I'll look into the N64 issues after that. But in the meantime you can just try V16, V20, V22A and V22B.


First, just to be sure, the hex code that needs to be put on the PIC12F629 is this code
Yes, just go to https://github.com/sanni/cartreader and click on the green download button to download everything including the hex file.

Second, what are the requirements and/or procedures as of right now for dumping the following?
Tengai Makyou ZERO (Far East of Eden ZERO) (SPC7110)
Star Ocean (S-DD1)
They should dump with the config switches setup the same as for SA-1: https://github.com/sanni/cartreader/wiki/Dumping-SA1-cartridges

MegaMan X2 (CX4)
Afaik CX4 is currently not supported unless you flash skaman's alternative SNES only "cart rom reader enhanced" Arduino sketch on your Arduino Cartridge Reader. It think there is more info about it somewhere in the beginning of this thread.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Mar 05, 2018, 12:36 pm
I just made a 4k image with all the hardware revisions since pcb version 6, this should help identifying which version someone has. The version uploaded to github is V11.

(https://dl.dropboxusercontent.com/s/dmrasmi896ie5k8/id_cartreader.jpg?dl=1)

Still waiting for the V16 pcb to arrive though...
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: tamanegi_taro on Mar 08, 2018, 09:47 am
The micro sd cards read/write a lot slower for some reason.
Hi sanni,

I had no problem so far with microsd card module. Difference is that I did not remove 3.3V voltage converter on microsd module. Instead, attached 5V constant as power supply.

Slow read/write might be caused by noise on 3.3V line. Because if you remove 3.3V from the microsd module and share 3.3V generated on PCB with carts, noise might be added on 3.3V line. Besides, long 3.3V wireing also add noise on 3.3V. So I think supplying 5V constant to microsd module and let module generate its own 3.3V might help solving the problem.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Mar 08, 2018, 11:04 am
Maybe it's just my particular microSD card(32GB Class10) that is bad but I only get 150KB/Sec write speed in the "bench" sketch of the SDfat library examples while with the older full-size SD card(4GB Class4) I get 200KB/Sec write speed.

Quote
Type is FAT32
Card size: 31.49 GB (GB = 1E9 bytes)

Manufacturer ID: 0X27
OEM ID: PH
Product: SD32G
Version: 3.0
Serial number: 0XA8D98C01
Manufacturing date: 9/2013

File size 5 MB
Buffer size 512 bytes
Starting write test, please wait.

write speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
150.92,145532,2440,3383
Quote
Type is FAT32
Card size: 3.97 GB (GB = 1E9 bytes)

Manufacturer ID: 0X3
OEM ID: SD
Product: SD04G
Version: 8.0
Serial number: 0XF8D5A270
Manufacturing date: 7/2009

File size 5 MB
Buffer size 512 bytes
Starting write test, please wait.

write speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
199.14,507136,1872,2552
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: tamanegi_taro on Mar 08, 2018, 01:48 pm
OK. So it might be compatibility problem of microsd card.

Surprised that you kept upgrading cart reader. If you are considering about upgrading your cart reader again, please let me share my wish list. It's just my humble opinion though.

Would you please add screw holes on all 4 corner of board? Currently, holes are only on 2 corner of board. Other side of board only have holes on Arduino. I want to tightly attach PCB board on nice case using screws on all 4 corner of board.

Current schematic of SD connector is
GND 3V3 VCC PB0 PB2 PB 1 PB3 GND
Would you please add 5V constant(Not 5V/3.3V switchable) to SD connected?
GND 3V3 VCC PB0 PB2 PB 1 PB3 GND 5V
This will add compatibility to microsd module without removing 3.3V generator on microsd module.

Current schematics of adafruit clock gen connector is
VIN GND SDA SCL CLK2 CLK1 CLK0
Would you please add 3.3V constant(Not 5V/3.3V switchable)?
For example,
VIN GND SDA SCL CLK2 CLK1 CLK0 3.3V
This will add compatibility of simple I2C one way level converter and AE-Si5351A-B clock generator. You can also use these two modules sold in Japan too.
http://akizukidenshi.com/catalog/g/gM-05452/
http://akizukidenshi.com/catalog/g/gK-10679/
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: werewolfslayr925 on Mar 09, 2018, 07:35 am
Afaik CX4 is currently not supported unless you flash skaman's alternative SNES only "cart rom reader enhanced" Arduino sketch on your Arduino Cartridge Reader. It think there is more info about it somewhere in the beginning of this thread.
If I'm not mistaken, are you referring to this:

Code: [Select]

else if(romChips == 243){
  // CX4 - Mega Man X2/Mega Man X3/Rockman X2/Rockman X3: romChips = 243
    display.println("Dumping LoROM");
    display.print("Banks: ");
    display.println(numBanks);
    display.display();

    // Check initial content of mapping register...
    // Mega Man/Rockman X2 should return 1, Mega Man/Rockman X3 should return 0
    byte initialCX4Map = dumpByte(0, 32594, false); //0x7F52
     
    // Mega Man/Rockman X2 needs to be set to 0 before dumping
    setByte(0, 32594, 0);  //0x7F52

      // Read up to 96 banks starting at bank 0×00.
    for (int currBank = 0; currBank < numBanks; currBank++) {

      // give status updates via LCD or LED
      display.print(".");
      display.display();

      // blink led
      if (currBank % 2 != 0)
        rgbLed(off_color);
      else
        rgbLed(busy_color);

      // Dump the bytes to SD one by one
      for (long currByte = 32768; currByte < 65536; currByte++) {
        myFile.write(dumpByte(currBank, currByte, false));
        dumpedBytes++;
      }
    }
    // Return mapping register to initial setting...
    setByte(0, 32594, initialCX4Map);  //0x7F52
  }


If so, then is there a way to incorporate it into the Arduino code you already have on the GitHub for the dumper? I tried just copying and pasting it, but there were some errors. Apparently the rest of the code didn't like terms like "dumpByte".

If there isn't a way to incorporate it, then what's the full code that I can flash onto the Arduino for MegaMan X2? (Also, will I be able to reflash the normal code for the dumper back onto the Arduino afterwards? Is that a silly question?)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: tamanegi_taro on Mar 09, 2018, 05:08 pm
Messed up with couple wireings but successfully dumped 2 out of 4 hucard games I have.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: hernan43 on Mar 09, 2018, 05:49 pm
Wow that is pretty exciting. What connector did you use to read the hucards? I've tried in the past to find a connector that is compatible but have never had much luck.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Mar 09, 2018, 08:18 pm
gamedoctorhk.com sells original HuCard connectors (still attached to the daughterboard).  A bit pricey but cheaper than buying donor consoles.

If anyone wants to wire up there own PCE/TG16 adapter, there's a pinout for the Retrode using the SNES slot.  There is an error with the published pinout as the uppermost address pins (A18 and A19) are swapped.

@tamanegi_taro, I've got all of my HuCards dumping on the Retrode except for Street Fighter 2.  I still need to implement the SF2 mapper code.  Aside from SF2, the only tricky thing was the 384Kb cards which have the first 256Kb mirrored at 0x40000.  I shifted the read for those to start at 0x40000.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: hernan43 on Mar 09, 2018, 08:28 pm
How do you interface them with the SNES port? Did you make your own board from the Retrode pinout diagram?
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Mar 09, 2018, 10:35 pm
Yes, I made a PCE/TG16 plugin PCB for the Retrode.  The PCB is still under development as I've had to make a few changes.  As I mentioned previously, the original pinout swapped A18 and A19.  The pinout also tied /WR to 5V but we need control of /WR to write the ports to get SF2 mapping properly.  The final PCB will be released once the SF2 mapper support is complete.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: werewolfslayr925 on Mar 09, 2018, 11:18 pm
[Tengai Makyou ZERO] should dump with the config switches setup the same as for SA-1: https://github.com/sanni/cartreader/wiki/Dumping-SA1-cartridges
Okay, great! I managed to dump the game. However, it consistently gives me a bad checksum and, when comparing the ROM file with a clean dump of the ROM, there are two huge chunks of 00s where game data should be from 00100000 to 002FFFFF and from 00400000 to 004FFFFF. I've tried cycling the cart using the "Cycle Cart" option in the SNES Cart Reader menu, but it doesn't seem to make a difference as subsequent dumps are identical to the first dump. What am I doing wrong?
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: tamanegi_taro on Mar 10, 2018, 01:12 am
Wow that is pretty exciting. What connector did you use to read the hucards? I've tried in the past to find a connector that is compatible but have never had much luck.
I used PCI socket 120 pin connector and cut it into 38pin.

Hi skaman,

Would you provide pin assignment between SNES socket and hucard?
I noticed that WR is pulled up in retrode version and 18th and 19th bit are swapped(I think there were reason for this swap). Also, High speed pin and cart detect pins are not connected. So, I assigned those pins to cic data0/1 but just noticed that cic data0/1 are not connected to arduino. So I need to change pin assignment.

Do you know header structure of hucard? I have no idea about how to find rom size/title from data in hucard. So I had to select dump size manually.

To dump street fighter II', read 0x0 to 0x07ffff. Than, I think you need to write something(any value) on 0x1ff0. Than read banked rom 0x080000 to 0x0fffff. Than, write something on 0x1ff1 and read 0x080000 to 0x0fffff again. Keep going until 0x1ff3.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: hernan43 on Mar 10, 2018, 03:25 am
Skaman/tamanegi_taro thanks for your hard work on this. I've been looking into it for a while and am excited to see so much progress being made on it!
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: tamanegi_taro on Mar 10, 2018, 02:59 pm
Hi hernan43,

Welcome!

Hi werewolfslayr925,

You need special method to dump Tengai makyo Zero. Otherwise, you always get corrupted data like that.
I also had problem with dumping Tengai makyo Zero too. Sadly, I don't have the game nor dump anymore and I dumped it using my original old cart reader,  sanni's low level drivers, and port of skaman's Tengaimakyo Zero code. Let me share my code anyway. Hope it helps!

Quote
if(((romChips == 249) || (romChips == 245))&&(romType == 1))
    {
      //Just for Tengai makyo zero. need to fix for other games
      //For Data Size is more than 2MB
      if(DataSize < 2097152)
      {
        DataSizeEx2 = 0;
        DataSizeEx = 0;
      }
      else if(DataSize < 4194304)
      {
        DataSizeEx2 = 0;
        DataSizeEx = DataSize - 2097152;
        DataSize = 2097152;
      }
      else
      {
        DataSizeEx2 = DataSize - 4194304;
        DataSizeEx = 2097152;
        DataSize = 2097152;       
      }

      BankStartEx = 0xE0;
      BankStartEx2 = 0xF0;
     
      for(long BankCurr = BankStart; (BankCurr <= BankEnd) && (DataSize > 0); BankCurr++)
      {
        for(long AddressCurr = AddressLow; (AddressCurr < AddressHigh) && (DataSize > 0); AddressCurr++, DataSize--)
        {
          Serial.write(readBank_SNES(BankCurr, AddressCurr));
        }
      }

      dataOut();
      controlOut_SNES();

      writeBank_SNES(0, 0x4834, 0xFF);

      dataIn();
      controlIn_SNES();

      for(long BankCurr = BankStartEx; (BankCurr <= BankEnd) && (DataSizeEx > 0); BankCurr++)
      {
        for(long AddressCurr = AddressLow; (AddressCurr < AddressHigh) && (DataSizeEx > 0); AddressCurr++, DataSizeEx--)
        {
          Serial.write(readBank_SNES(BankCurr, AddressCurr));
        }
      } 

      dataOut();
      controlOut_SNES();

      writeBank_SNES(0, 0x4833, 0x3);

      dataIn();
      controlIn_SNES();

      for(long BankCurr = BankStartEx2; (BankCurr <= BankEnd) && (DataSizeEx2 > 0); BankCurr++)
      {
        for(long AddressCurr = AddressLow; (AddressCurr < AddressHigh) && (DataSizeEx2 > 0); AddressCurr++, DataSizeEx2--)
        {
          Serial.write(readBank_SNES(BankCurr, AddressCurr));
        }
      } 
      dataOut();
      controlOut_SNES();

      writeBank_SNES(0, 0x4833, 0x2);
      writeBank_SNES(0, 0x4834, 0x0);
     
    }
    else
    {
      //For normal roms
      for(long BankCurr = BankStart; (BankCurr <= BankEnd) && (DataSize > 0); BankCurr++)
      {
        for(long AddressCurr = AddressLow; (AddressCurr < AddressHigh) && (DataSize > 0); AddressCurr++, DataSize--)
        {
          Serial.write(readBank_SNES(BankCurr, AddressCurr));
        }
      } 
    }

Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: werewolfslayr925 on Mar 10, 2018, 03:13 pm
Hi werewolfslayr925,

You need special method to dump Tengai makyo Zero. Otherwise, you always get corrupted data like that.
I also had problem with dumping Tengai makyo Zero too. Sadly, I don't have the game nor dump anymore and I dumped it using my original old cart reader,  sanni's low level drivers, and port of skaman's Tengaimakyo Zero code. Let me share my code anyway. Hope it helps!

Oh, wow! Thank you so much, tamanegi_taro! I plan to try this out a.s.a.p.! Unfortunately, I'm quite new to Arduino (and am a terrible programmer...). Shall I be able to just plug this code into the section that mentions TMZero in the normal code provided by sanni, or do I need to fiddle with anything else in the normal code so that there aren't any errors?
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Mar 10, 2018, 10:55 pm
@tamanegi_taro,

There's no header for PCE/TG16.  I changed how the Retrode detects the HuCards.  Once the code detects PCE or TG16, then it checks the size by looking for mirrored sections at 128Kb, 256Kb, 384Kb, 512Kb, 768Kb.  The 384Kb size is slightly different as the first 256Kb is mirrored at the start so I simply shift the read to start at 0x40000.  For SF2, if the size is 1MB (default after size check), I then search a small section for "NEC HE" and switch the size if found.

I know how the SF2 mapper works but I haven't been able to get it fully working.  I had the first bank (using $1FF0) displaying but I couldn't get the other banks working.  I physically shifted the plugin around and somehow that broke the bank switching.  It might have been some misaligned pins that allowed the mapper to work at the time so I'm rechecking the hardware.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: tamanegi_taro on Mar 11, 2018, 12:10 pm
Oh, wow! Thank you so much, tamanegi_taro! I plan to try this out a.s.a.p.! Unfortunately, I'm quite new to Arduino (and am a terrible programmer...). Shall I be able to just plug this code into the section that mentions TMZero in the normal code provided by sanni, or do I need to fiddle with anything else in the normal code so that there aren't any errors?
Sadly, you can't simply copy-paste the code.
As you can see in my code, there are several register writes before reading banked ROMs.
You need to put those in your code.

Hi skaman.
Thanks it works perfectly.

Code: [Select]

//Confirm the size of ROM - 128Kb, 256Kb, 384Kb, 512Kb, or 768Kb
uint32_t find_rom_size_PCE()
{
  uint32_t currByte;
  uint32_t rom_size;
  uint8_t check_loop;
  uint16_t checksize[3] = {128, 256, 512};

  //Set pins to read PC Engine cart
  pin_read_write_PCE();

  //Read first 64bytes
  for (currByte = 0; currByte < 64; currByte ++) {
      sdBuffer[currByte] = read_byte_PCE(currByte);
  }

  //Initialize rom_size as 768KB
  rom_size = 768;

  //loop to confirm if romsize is 128KB, 256KB or 512KB by finding where the mirror rom start from
  for(check_loop = 0; (check_loop < 3) && (rom_size == 768); check_loop++)
  {
    //Read first 64 bytes from each mirror candidates and compare it against previously read data
    for(currByte = 0; currByte < 64; currByte++)
    {
      if(sdBuffer[currByte] == read_byte_PCE(checksize[check_loop] * 1024UL + currByte))
      {
       
        //If every data matched, it is mirror. Set ROM size and end the loop
        if(currByte == 63)
        {
          rom_size = checksize[check_loop];
        }
      }
      else
      {
        break;
      }
    }
  }
 
  //Another confirmation for 384KB because 384KB hucard has data in 0x0--0x40000 and 0x80000--0xA0000(0x40000 is mirror of 0x00000)
  if(rom_size == 256)
  {
    for(currByte = 0; currByte < 64; currByte++)
    {
      //Check 0x80000 and if it did not match with 0x00000, cart is 384KB
      if(sdBuffer[currByte] != read_byte_PCE(currByte + 512UL * 1024UL))
      {
        rom_size = 384;
        break;
      }
    }
  }

  return rom_size;
}



Now, I need to modify hardware and send design to elecrow again.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Mar 11, 2018, 09:14 pm
If you ever dump Cyber Dodge or Hisou Kihei, I'd love to find out your results.  I'm having a discussion on No-Intro on the dumps for these two HuCards.

Part of my HuCard detection is to scan the 6502 code for the entry point and initial MPR register settings.  All of the ROMs in the No-Intro set work except for the current versions of Cyber Dodge and Hisou Kihei.  The original dumps for these two cards are detected properly, however, a few years ago, the decision was made to deinterleave these two ROMs and the "fixed" ROMs are now listed in the database.  After deinterleaving the ROMs, the 6502 code is scrambled and not recognizable.

Because the current ROMs fail the check, I decided to redump both HuCards.  My dumps match the original database entries.  I'd love to have someone independently corroborate my findings.

More discussion on this topic here:  http://forums.no-intro.org/viewtopic.php?f=7&t=3040
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: Oatburner on Mar 11, 2018, 10:46 pm
Hi Skaman,

We spoke over PM a while ago about my SNES cartridge reader I made, and some issues regarding SA-1 BW-RAM writes.

After messing around with it some, I've finally gotten it to work in a way that agrees with what the SNES development book 2 says.

What I've found is that you need to use the BW-RAM mapping and write protection registers from the SNES CPU's point of view, not the SA-1's, so that instead of using 0x2225 to map the BW-RAM block and 0x2227 to disable write protection, you use 0x2224 and 0x2226 respectively. The writes are coming from the Arduino, which is effectively the SNES CPU here, so I think this makes sense.

You mentioned that BW-RAM writes would only work if you first wrote dummy data from 0x0000-0x5FFF before writing the actual data to 0x6000-0x7FFF. After making that change, I can write to 0x6000-0x7FFF and have it work perfectly without first writing dummy data. I suspect that by writing the dummy data from 0x0000-0x5FFF, the SA-1 registers starting at 0x2200 get overwritten in a way that happens to allow it to work right, but I'm not sure.

I also found that the write protection register only protects the area specified in register 0x2228. So, if SNES CPU write protection is on, and the protected area register 0x2228 is set to 0x0 (2KBits), only the first 2KBits will be protected. If you turn off SNES CPU write protection, the entire BW-RAM can be written to. I've attached a picture showing this on a logic analyzer. Only reason I mention it is because the nocash FullSNES page indicates that it isn't certain whether or not the protected area can be set to zero if write protection is disabled.

So, not sure if you're still working on the SNES reader at all, but I thought I would share what I found so that anyone who runs into the same issue as me can figure it out.  :D
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Mar 12, 2018, 12:19 am
@Oatburner,

Nice job!  I'm glad you figured it out.  I only got the code to the point where it was working and didn't look deeper into it.

I'll modify my Enhanced sketch to implement your findings.  It will be nice to work on the SNES reader stuff after what feels like ages on other projects.

Thanks for the help!

EDIT:  OOPS!  Did you look at the code in the Enhanced sketch?  I think the fix was already done...  I didn't use $2226 but bypassed the protected area by shifting up to the next mirrored block.  I'll add the $2226 register change. Sorry, my memory is so foggy sometimes.  LOL

EDIT2:  Nevermind.  You were referring to the SA-1 Write code in sanni's sketch.  That was the original version that simply worked in spite of the inaccuracies.  The corrected version from the Enhanced sketch was never merged into sanni's code.  :/
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: tamanegi_taro on Mar 12, 2018, 04:45 am
If you ever dump Cyber Dodge or Hisou Kihei, I'd love to find out your results.  I'm having a discussion on No-Intro on the dumps for these two HuCards.

Part of my HuCard detection is to scan the 6502 code for the entry point and initial MPR register settings.  All of the ROMs in the No-Intro set work except for the current versions of Cyber Dodge and Hisou Kihei.  The original dumps for these two cards are detected properly, however, a few years ago, the decision was made to deinterleave these two ROMs and the "fixed" ROMs are now listed in the database.  After deinterleaving the ROMs, the 6502 code is scrambled and not recognizable.

Because the current ROMs fail the check, I decided to redump both HuCards.  My dumps match the original database entries.  I'd love to have someone independently corroborate my findings.

More discussion on this topic here:  http://forums.no-intro.org/viewtopic.php?f=7&t=3040
OK. Just bought those two games from amazon japan. Also bought SF2' too. Pretty interesting to investigate special hucard structures. I'll try and let you know the result once those games arrived.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Mar 12, 2018, 04:56 am
The other interesting HuCard is Populous.  When I dump it, it overdumps with what I assume is the RAM data.  The RAM data is garbage since the card doesn't have a save battery.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Mar 12, 2018, 08:29 am
Ok.  I merged the SA-1 BW-RAM changes from the Enhanced sketch with Oatburner's $2226 register change and managed to get it working.  The code still isn't perfect as the initial SRAM byte needs to be rewritten at the end of the write.  It works and is more accurate than the original version that was in sanni's sketch.

Here's the fixed SA-1 BW-RAM Write Code for sanni's current V30I sketch:
Code: [Select]

void writeSRAM (boolean browseFile) {
...
    // SA1
    else if (romType == SA) {
      long lastByte = (long(sramSize) * 128);
      // Enable CPU Clock
      clockgen.set_freq(357954500ULL, SI5351_CLK1);
      clockgen.output_enable(SI5351_CLK1, 1);

      // Direct writes to BW-RAM (SRAM) in banks 0x40-0x43 don't work
      // Break BW-RAM (SRAM) into 0x2000 blocks
      byte lastBlock = 0;
      lastBlock = lastByte / 0x2000;

      // Writing SRAM on SA1 needs CS(PH3) to be high
//      PORTH |=  (1 << 3);

      // Setup BW-RAM
      // Set 0x2224 (SNES BMAPS) to map SRAM Block 0 to 0x6000-0x7FFF
      writeBank_SNES(0, 0x2224, 0);
      // Set 0x2226 (SNES SBWE) to 0x80 Write Enable
      writeBank_SNES(0, 0x2226, 0x80);
      // Set 0x2228 (SNES BWPA) to 0x00 BW-RAM Write-Protected Area
      writeBank_SNES(0, 0x2228, 0);
      delay(1000);

      // Use $2224 (SNES) to map BW-RAM block to 0x6000-0x7FFF
      // Use $2226 (SNES) to write enable the BW-RAM
      byte firstByte = 0;
      for (byte currBlock = 0; currBlock < lastBlock; currBlock++) {
        // Set 0x2224 (SNES BMAPS) to map SRAM Block to 0x6000-0x7FFF
        writeBank_SNES(0, 0x2224, currBlock);
        // Set 0x2226 (SNES SBWE) to 0x80 Write Enable
        writeBank_SNES(0, 0x2226, 0x80);
        for (long currByte = 0x6000; currByte < 0x8000; currByte += 512) {
          myFile.read(sdBuffer, 512);
          if ((currBlock == 0) && (currByte == 0x6000)) {
            firstByte = sdBuffer[0];
          }
          for (int c = 0; c < 512; c++) {
              writeBank_SNES(0, currByte + c, sdBuffer[c]);
          }
        }
      }
      // Rewrite First Byte
      writeBank_SNES(0, 0x2224, 0);
      writeBank_SNES(0, 0x2226, 0x80);
      writeBank_SNES(0, 0x6000, firstByte);
      // Disable CPU clock
      clockgen.output_enable(SI5351_CLK1, 0);
...
  }
...
}


Here's the fixed SA-1 BW-RAM Erase Code:
Code: [Select]

boolean eraseSRAM (byte b) {
...
  // SA1
  else if (romType == SA) {
    long lastByte = (long(sramSize) * 128);
    // Enable CPU Clock
    clockgen.set_freq(357954500ULL, SI5351_CLK1);
    clockgen.output_enable(SI5351_CLK1, 1);

    // Direct writes to BW-RAM (SRAM) in banks 0x40-0x43 don't work
    // Break BW-RAM (SRAM) into 0x2000 blocks
    // Use $2224 to map BW-RAM block to 0x6000-0x7FFF
    byte lastBlock = 0;
    lastBlock = lastByte / 0x2000;

    // Writing SRAM on SA1 needs CS(PH3) to be high
//    PORTH |=  (1 << 3);

    // Setup BW-RAM
    // Set 0x2224 (SNES BMAPS) to map SRAM Block 0 to 0x6000-0x7FFF
    writeBank_SNES(0, 0x2224, 0);
    // Set 0x2226 (SNES SBWE) to 0x80 Write Enable
    writeBank_SNES(0, 0x2226, 0x80);
    // Set 0x2228 (SNES BWPA) to 0x00 BW-RAM Write-Protected Area
    writeBank_SNES(0, 0x2228, 0);
    delay(1000);

    // Use $2224 (SNES) to map BW-RAM block to 0x6000-0x7FFF
    // Use $2226 (SNES) to write enable the BW-RAM
    for (byte currBlock = 0; currBlock < lastBlock; currBlock++) {
      // Set 0x2224 (SNES BMAPS) to map SRAM Block to 0x6000-0x7FFF
      writeBank_SNES(0, 0x2224, currBlock);
      // Set 0x2226 (SNES SBWE) to 0x80 Write Enable
      writeBank_SNES(0, 0x2226, 0x80);
      for (long currByte = 0x6000; currByte < 0x8000; currByte += 512) {
        for (int c = 0; c < 512; c++) {
            writeBank_SNES(0, currByte + c, b);
        }
      }
    }
    // Rewrite First Byte
    writeBank_SNES(0, 0x2224, 0);
    writeBank_SNES(0, 0x2226, 0x80);
    writeBank_SNES(0, 0x6000, b);
    // Disable CPU clock
    clockgen.output_enable(SI5351_CLK1, 0);
  }
...
}

Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: tamanegi_taro on Mar 13, 2018, 01:35 pm
Street Fighter 2' HuCARD just arrived!
Had no problem dumping the cart.

I tried to post the whole code but forum gave me error by exceeding 9000 characters...

Code: [Select]

  //If rom size is more than or equal to 512KB, detect Street fighter II'
  if(rom_size >= 512)
  {
    //Look for "NEC HE "
    if(read_byte_PCE(0x7FFF9) == 'N' && read_byte_PCE(0x7FFFA) == 'E'  && read_byte_PCE(0x7FFFB) == 'C'
    && read_byte_PCE(0x7FFFC) == ' ' && read_byte_PCE(0x7FFFD) == 'H' && read_byte_PCE(0x7FFFE) == 'E')
    {
      rom_size = 2560;
    }
  }

************************************
  else if(rom_size == 2560)
  {
    //Dump Street fighter II' Champion Edition
    read_bank_PCE(0, 0x80000, &processed_size, rom_size * 1024UL);

    //Display first bank
    write_byte_PCE(0x1FF0, 0xFF);
    read_bank_PCE(0x80000, 0x100000, &processed_size, rom_size * 1024UL);

    //Display second bank
    write_byte_PCE(0x1FF1, 0xFF);
    read_bank_PCE(0x80000, 0x100000, &processed_size, rom_size * 1024UL);

    //Display third bank
    write_byte_PCE(0x1FF2, 0xFF);
    read_bank_PCE(0x80000, 0x100000, &processed_size, rom_size * 1024UL);

    //Display forth bank
    write_byte_PCE(0x1FF3, 0xFF);
    read_bank_PCE(0x80000, 0x100000, &processed_size, rom_size * 1024UL);
  }
*******************************************

uint8_t write_byte_PCE(uint32_t address, uint8_t data)
{
  uint8_t ret;
  uint8_t address_byte;

  //Set address
  PORTF = address & 0xFF;
  PORTK = (address >> 8) & 0xFF;
  PORTL = (address >> 16) & 0xFF;

  // Arduino running at 16Mhz -> one nop = 62.5ns -> 1000ns total
  __asm__("nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t");

  //Swap bit order for PC Engine HuCARD
  if(pce_internal_mode == HUCARD)
  {
    data = ((data & 0x01) << 7) | ((data & 0x02) << 5) | ((data & 0x04) << 3) | ((data & 0x08) << 1) | ((data & 0x10) >> 1) | ((data & 0x20) >> 3) | ((data & 0x40) >> 5) | ((data & 0x80) >> 7);
  }

  //write byte
  PORTC = data;

  // Set Data Pins (D0-D7) to Output
  DDRC = 0xFF;

  // Switch CS(PH3) and WR(PH5) to LOW
  PORTH &= ~((1 << 3) | (1 << 5));

  // Arduino running at 16Mhz -> one nop = 62.5ns -> 1000ns total
  __asm__("nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t");
 
  //Set CE and WR as high
  PORTH |= (1 << 3) | (1 << 5);

  // Set Data Pins (D0-D7) to Input
  DDRC = 0x00;

  // Enable Internal Pullups
  PORTC = 0xFF;
 
  //return read data
  return ret;
 
}




Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Mar 13, 2018, 06:46 pm
Nice work!

I'm still working on the Retrode version.  It should be simple but it never is with so much going on on the Retrode. :/

Take Care!
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Mar 14, 2018, 01:29 pm
Just finished building and testing my newest V16 cart reader pcb and can confirm that the new SA1 sram write code works perfectly.  :D

(https://dl.dropboxusercontent.com/s/q89c6hokc6ji4nm/v16_top.jpg?dl=1)

(https://dl.dropboxusercontent.com/s/g1r7h61kq7ddl18/v16_left.jpg?dl=1)

(https://dl.dropboxusercontent.com/s/g7agxh1pxe9zy6l/v16_front_left.jpg?dl=1)

(https://dl.dropboxusercontent.com/s/atobff4zlx4nfg2/v16_front.jpg?dl=1)

(https://dl.dropboxusercontent.com/s/mmamt33kge4yhqp/v16_right.jpg?dl=1)

(https://dl.dropboxusercontent.com/s/ugllfvhd1wt49al/v16_bottom.jpg?dl=1)


I've also designed a new SD module pcb that uses the same schematics and components as the microSD module but has a full-size sd slot.

(https://dl.dropboxusercontent.com/s/gcgfh3n80lqx4u3/v16_sd.jpg?dl=1)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: tamanegi_taro on Mar 14, 2018, 01:41 pm
So nice sanni!
It looks like famicom color(Red and white).
I like your new SD card adapter too.

elecrow started 3D printing service.
Do you think your 3D printer file has compatibility with elecrow?

Did you connect 5V constant to new SD card adapter's 3.3V LDO?
I think supplying 3.3V to 3.3V LDO do not work because it can only generate 2.1V.
3.3V - 1.2V = 2.1V
SD cards need least 2.7V to work.


Hi skaman,

Uploaded pinout excel file and Cart_Reader PC Engine dumper source code.

http://fast-uploader.com/file/7076586403288/ (http://fast-uploader.com/file/7076586403288/)
http://fast-uploader.com/file/7076586434468/ (http://fast-uploader.com/file/7076586434468/)

Be careful. PCE adapter Pinout listed in excel is hardware REV2.
PCE source code is for hardware REV1.
I will update hardware and source code by end of March(Or April) to ask sanni to upload these on github.

These are pin differences between REV1 and REV2
As you can see, I messed up and connected some pins to CIC instead of Arduino for REV1.

REV1:
A23-SNES No connect
A22-SNES No connect
A21-SNES No connect
Reset In-SNES Audio In-PCE
CIC1-SNES HSM -PCE
CIC0-SNES Card Detect-PCE


REV2
A23-SNES Card Detect-PCE
A22-SNES Audio In-PCE
A21-SNES HSM -PCE
Reset In-SNES No connect
CIC1-SNES No connect
CIC0-SNES No connect

And I also know that there is no pin compatibility with Retrode one because I thought it is better to connect HSM and WR to Arduino IO pins. I also left 18th and 19th address pins connected to same address instead of swapping them.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Mar 14, 2018, 07:04 pm
@tamanegi_taro,

I made some changes to my Retrode code and got SF2 dumping properly with my existing plugin.  It was a timing issue with my original code.  As for the plugin, the extra pins (CARD, AUDIO, HSM, IRQ) remain unconnected as in the original pinout.

Thanks for sharing the files!
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: Einhandr on Mar 14, 2018, 07:37 pm
Just finished building and testing my newest V16 cart reader pcb and can confirm that the new SA1 sram write code works perfectly.  :D

(https://dl.dropboxusercontent.com/s/q89c6hokc6ji4nm/v16_top.jpg?dl=1)

(https://dl.dropboxusercontent.com/s/g1r7h61kq7ddl18/v16_left.jpg?dl=1)

(https://dl.dropboxusercontent.com/s/g7agxh1pxe9zy6l/v16_front_left.jpg?dl=1)

(https://dl.dropboxusercontent.com/s/atobff4zlx4nfg2/v16_front.jpg?dl=1)

(https://dl.dropboxusercontent.com/s/mmamt33kge4yhqp/v16_right.jpg?dl=1)

(https://dl.dropboxusercontent.com/s/ugllfvhd1wt49al/v16_bottom.jpg?dl=1)


I've also designed a new SD module pcb that uses the same schematics and components as the microSD module but has a full-size sd slot.

(https://dl.dropboxusercontent.com/s/gcgfh3n80lqx4u3/v16_sd.jpg?dl=1)
It's so beautiful!!!
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: tamanegi_taro on Mar 15, 2018, 12:06 pm
Hi skaman,

Games arrived.

Cyber dodge - detected as 512KB
B5326B16 CRC matched with database.

Kisoukishi Kaizard - detected as 384KB
1CAB1EE6 CRC matched with database.

By the way, about populus, I think it was just bad dump.
I never heard about hucard with RAM implemented in it.

Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Mar 15, 2018, 12:45 pm
Thanks for the confirmation on those HuCards!

Populous and Tennokoe Bank are the only ROMRAM HuCards.  Populous doesn't have a battery so nothing is saved.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: tamanegi_taro on Mar 15, 2018, 01:26 pm
Welcome skaman.
 Yes Populus has ram on it.
I'm not sure but maybe super system card, arcade card pro, and SF2' might have Ram in them too because card size is thicker.

I found these in mamedev source

Normally address spacebanks 00-F6 are assigned to regular HuCard ROM space. There
are a couple of special situations:
Street Fighter II:
  - address space banks 40-7F switchable by writing to 1FF0-1FF3
    1FF0 - select rom banks 40-7F
    1FF1 - select rom banks 80-BF
    1FF2 - select rom banks C0-FF
    1FF3 - select rom banks 100-13F
Populous:
  - address space banks 40-43 contains 32KB RAM
CDRom units:
  - address space banks 80-87 contains 64KB RAM
Super System Card:
  - address space banks 68-7F contains 192KB RAM
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: Cyber_Akuma on Mar 15, 2018, 03:08 pm
Just finished building and testing my newest V16 cart reader pcb and can confirm that the new SA1 sram write code works perfectly.  :D
Nice! Is there a hardware changelog BTW of what the differences between revisions are? Main difference I see is that the 3/5v selector has been put on a dedicated switch instead of being part of the power switch, but I don't know if anything else is different.

Does the new SA1 Sram writing code work on all models that support SNES cartridges?
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Mar 15, 2018, 06:15 pm
The difference is that with V15 there was a little pcb on the Arduino Mega that did the 5V/3V supply switching and with V16 all that was integrated back into the cart reader shield pcb, which is more cost effective. The 5V/3V switch and the On/OFF switch are separate again because it's cheaper that way since you only need to order one kind of switch for the whole cart reader.

Functionally all the different cart reader versions are the same. So the new SA1 Sram writing code will work with all versions as long as you have installed the Adafruit Clock Generator.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: tamanegi_taro on Mar 16, 2018, 01:41 am
The difference is that with V15 there was a little pcb on the Arduino Mega that did the 5V/3V supply switching and with V16 all that was integrated back into the cart reader shield pcb, which is more cost effective. The 5V/3V switch and the On/OFF switch are separate again because it's cheaper that way since you only need to order one kind of switch for the whole cart reader.

Functionally all the different cart reader versions are the same. So the new SA1 Sram writing code will work with all versions as long as you have installed the Adafruit Clock Generator.
Hi sanni,

Sorry to bother you. Please let me explain my opinion in detail.

I think you already know well about this though. Did you supply VCC(3.3V/5V switchable) to SD card module's 3.3V LDO? If so, I think you need to change VCC to 5V constant. 3.3V LDO dropout voltage is like 1.2V. So if you supply 3.3V to 3.3V LDO to get 3.3V, you don't get 3.3V. You get 3.3V - 1.2V = 2.1V. According to SD card specification, SD card need 2.7V to operate correctly as minimum voltage. 2.1V obviously will not be enough voltage. So I think you need to change VCC pad of SD card connector to 5V constant pad.

On the other hand, few days ago, I was asking you about adding 3.3V and 5V pads to the clockgen connector and SD card connector, respectively. No need to add those extra pads if you are going to change VCC pad of SD card connector to 5V constant pad. This is because I can get both 3.3V and 5V for clockgen from SD card connector if needed.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Mar 16, 2018, 09:53 am
I don't use the LDO on the sd card modules. I supply constant 3.3V to where the output of the LDO would be. The 5V/3V switchable VCC pin is currently not used for anything, I can change it to 5V constant next revision if that will be useful.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: tamanegi_taro on Mar 16, 2018, 11:10 am
Hi sanni,

Yes please!
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: werewolfslayr925 on Mar 17, 2018, 09:52 pm
Okay, so, if I understand tamanegi_taro correctly, there's an error in the coding for SPC7110 carts in that it isn't reading one of the banks properly. The only thing that I could find that seemed odd, was that it wants to read 0xF00000-0xFFFFFF twice:

Code: [Select]
// Dump SPC7110 High-type ROM
  else if ((romType == HI) && ((romChips == 245) || (romChips == 249))) {
    println_Msg(F("Dumping SPC7110 HiRom"));
    display_Update();

    // 0xC00000-0xDFFFFF
    print_Msg(F(" Part 1"));
    display_Update();
    readHiRomBanks( 192, 224, &myFile );

    if (numBanks > 32) {
      dataOut();
      controlOut_SNES();
      // Set 0x4834 to 0xFF
      writeBank_SNES( 0, 0x4834, 0xFF );

      dataIn();
      controlIn_SNES();

      // 0xE00000-0xEFFFFF
      print_Msg(F(" 2"));
      display_Update();
      readHiRomBanks( 224, 240, &myFile );

//first here
      if (numBanks > 48) {
        // 0xF00000-0xFFFFFF
        print_Msg(F(" 3"));
        display_Update();
        readHiRomBanks( 240, 256, &myFile );

        dataOut();
        controlOut_SNES();

        // Set 0x4833 to 3
        writeBank_SNES( 0, 0x4833, 3 );

        dataIn();
        controlIn_SNES();

//then here
        // 0xF00000-0xFFFFFF
        println_Msg(F(" 4"));
        display_Update();
        readHiRomBanks( 240, 256, &myFile );
      }

      // Return mapping registers to initial settings...
      dataOut();
      controlOut_SNES();

      writeBank_SNES( 0, 0x4833, 2 );
      writeBank_SNES( 0, 0x4834, 0 );

      dataIn();
      controlIn_SNES();
    }
  }

  // Close the file:
  myFile.close();
}


Is it supposed to do that? Could that be what's causing the problem? Should I erase one of the  0xF00000-0xFFFFFF readings or replace it with something else?
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: tamanegi_taro on Mar 17, 2018, 10:47 pm
Maybe code is for other game? Not sure why it's reading it twice.
Did you see "Dumping SPC7110 HiRom" and 1, 2, 3, and 4 on screen when you dump the cart?
Try removing first F00000 read.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Mar 18, 2018, 05:16 am
SPC7110 uses registers 0x4831-0x4834 to map the ROM.

Reading 0xF0-0xFF twice is correct with the current register settings.

The second read of 0xF0-0xFF is preceded by writing to register 0x4833 which maps in the final bank.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: werewolfslayr925 on Mar 18, 2018, 09:15 pm
SPC7110 uses registers 0x4831-0x4834 to map the ROM.

Reading 0xF0-0xFF twice is correct with the current register settings.

The second read of 0xF0-0xFF is preceded by writing to register 0x4833 which maps in the final bank.
Thanks for the input, skaman. When comparing the dump I get from the ROM dumper with a clean dump, here's what I get:

1. In the hex code for my dump of Tengai Makyou ZERO, everything from 00100000 to 002FFFFF is blank (i.e. all 00s).

2. In the hex code for my dump of Tengai Makyou ZERO, everything from 00400000 to 004FFFFF is blank (i.e. all 00s).

3. When comparing my dump to a clean dump, the information from 00300000 through 003FFFFF in my dump seems to be identical to the information from 00100000 through 001FFFFF in the clean dump.

4. When comparing my dump to a clean dump, both files are the same size.

The dumper itself seems to go through the whole thing just fine:

1. It properly identifies the cartridge, both in name and in specs

2. it does go through all four steps of the dumping process (i.e. "1", "2", "3", and "4" all show up when it is supposedly dumping the cart).

Apparently, the dumper isn't reading certain things that it should be, though, and it is placing certain things that it is reading into the wrong places in my dump of the game. What exactly is incorrect in the code? What do I need to change in the code to make it dump properly and how do I go about doing that?


Edit: For quick and easy reference, here's my code for SPC7110 carts:

Code: [Select]
  // Dump SPC7110 High-type ROM
  else if ((romType == HI) && ((romChips == 245) || (romChips == 249))) {
    println_Msg(F("Dumping SPC7110 HiRom"));
    display_Update();

    // 0xC00000-0xDFFFFF
    print_Msg(F(" Part 1"));
    display_Update();
    readHiRomBanks( 192, 224, &myFile );

    if (numBanks > 32) {
      dataOut();
      controlOut_SNES();
      // Set 0x4834 to 0xFF
      writeBank_SNES( 0, 0x4834, 0xFF );

      dataIn();
      controlIn_SNES();

      // 0xE00000-0xEFFFFF
      print_Msg(F(" 2"));
      display_Update();
      readHiRomBanks( 224, 240, &myFile );

      if (numBanks > 48) {
        // 0xF00000-0xFFFFFF
        print_Msg(F(" 3"));
        display_Update();
        readHiRomBanks( 240, 256, &myFile );

        dataOut();
        controlOut_SNES();

        // Set 0x4833 to 3
        writeBank_SNES( 0, 0x4833, 3 );

        dataIn();
        controlIn_SNES();

        // 0xF00000-0xFFFFFF
        println_Msg(F(" 4"));
        display_Update();
        readHiRomBanks( 240, 256, &myFile );
      }

      // Return mapping registers to initial settings...
      dataOut();
      controlOut_SNES();

      writeBank_SNES( 0, 0x4833, 2 );
      writeBank_SNES( 0, 0x4834, 0 );

      dataIn();
      controlIn_SNES();
    }
  }

  // Close the file:
  myFile.close();
}
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Mar 18, 2018, 10:28 pm
What reader are you using?  If you built the reader yourself, double-check all of your address lines.  It looks like the address lines are mixed up.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: werewolfslayr925 on Mar 18, 2018, 11:34 pm
What reader are you using?  If you built the reader yourself, double-check all of your address lines.  It looks like the address lines are mixed up.
I built this (https://github.com/sanni/cartreader) ROM dumper and used this code (https://github.com/sanni/cartreader/archive/master.zip) found on this page (https://github.com/sanni/cartreader/wiki/How-to-flash-the-Arduino-Code-to-your-Cart-Reader) of the cart reader wiki (https://github.com/sanni/cartreader/wiki).

What do you mean by "the address lines are mixed up" and how do I make them not "mixed up"?
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Mar 18, 2018, 11:52 pm
Whatever wiring diagram that you used should have Address lines labeled A0-A15 and BA0-7 (or maybe A0-A23) on the SNES side.

These are the address lines and tell the cart where to read the data from. 

Double-check that each line is connected to the correct pin on the Arduino according to the wiring diagram.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: werewolfslayr925 on Mar 19, 2018, 12:31 am
Whatever wiring diagram that you used should have Address lines labeled A0-A15 and BA0-7 (or maybe A0-A23) on the SNES side.

These are the address lines and tell the cart where to read the data from. 

Double-check that each line is connected to the correct pin on the Arduino according to the wiring diagram.
I didn't use a wiring diagram to build the dumper. A friend of mine and I built this without wiring diagrams. Are you suggesting that we put the cart slot in wrong? Because I've been able to dump all other types of carts that I own--including S-DD1 and SA1 chips--just fine. (Admittedly, most of my SA1 chip games are old and stubborn and haven't been dumped successfully, but I have been able to dump one for certain).

For the record, though, I just checked the pins and all the A's match up where necessary along with the pins for nearly everything else. The stuff that should go to the clock generator goes to the clock generator. The only thing the destination of which I couldn't figure out was something labelled TX1.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Mar 19, 2018, 01:46 am
Try adding the SPC7110 initialization code:

Code: [Select]

  // Dump SPC7110 High-type ROM
  else if ((romType == HI) && ((romChips == 245) || (romChips == 249))) {
    println_Msg(F("Dumping SPC7110 HiRom"));
    display_Update();

    dataOut();
    controlOut_SNES();
    writeBank_SNES( 0, 0x4831, 0 );
    writeBank_SNES( 0, 0x4832, 1 );
    writeBank_SNES( 0, 0x4833, 2 );
    writeBank_SNES( 0, 0x4834, 0 );
    dataIn();
    controlIn_SNES();

    // 0xC00000-0xDFFFFF
    print_Msg(F(" Part 1"));
    display_Update();
    readHiRomBanks( 192, 224, &myFile );
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: werewolfslayr925 on Mar 19, 2018, 03:17 am
Try adding the SPC7110 initialization code:

Code: [Select]

  // Dump SPC7110 High-type ROM
  else if ((romType == HI) && ((romChips == 245) || (romChips == 249))) {
    println_Msg(F("Dumping SPC7110 HiRom"));
    display_Update();

    dataOut();
    controlOut_SNES();
    writeBank_SNES( 0, 0x4831, 0 );
    writeBank_SNES( 0, 0x4832, 1 );
    writeBank_SNES( 0, 0x4833, 2 );
    writeBank_SNES( 0, 0x4834, 0 );
    dataIn();
    controlIn_SNES();

    // 0xC00000-0xDFFFFF
    print_Msg(F(" Part 1"));
    display_Update();
    readHiRomBanks( 192, 224, &myFile );

Thanks for the quick reply. Tried entering this into the code. No dice. I got a copy identical to the ones I've been getting. Any other ideas?
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Mar 19, 2018, 07:53 am
I tested the SPC7110 code in sanni's sketch and it works perfectly with Tengai Makyou Zero.

You have a hardware issue or possibly a cart issue.

The swapped sections of your dump would tend to indicate that the address lines are mixed up.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Mar 19, 2018, 12:41 pm
Just received Momotaro Dentetsu Happy and copy&pasted the necessary code for the correct size detection and checksum calculation from skaman's enhanced sketch into my current version and that dumps perfectly too.

@werewolfslayr925 Two weeks ago you posted that you can't dump N64 nor Gameboy games, did you find the issue there? Because if there is an error somewhere on the pcb that affects everything else too.
Also if you shorted something out there is a chance that the Arduino itself took damage and one of the ports is dead now.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: werewolfslayr925 on Mar 19, 2018, 01:00 pm
sanni:

Ah, yes! I did manage to dump all my Game Boy games just fine. I successfully dumped one N64 game. Sorry for not reporting back about that. It turns out that I accidentally had two pairs of pins soldered together on the GB converter for the GB games. I forget what was wrong with the N64 games besides their being old and stubborn. It may have been that I had the switches in the wrong position or that I was trying to dump them with power going to the dumper through the Arduino instead of through the microUSB port. Something silly like that.

skaman:

Like I mentioned, I've been able to dump everything else just fine (except for some of the more stubborn SA1 carts; I've read somewhere, however, that those may merely take a few tries, and I know that mine are especially difficult to get working even on original hardware). How could it be a hardware issue on the dumper itself if other special chip games (Star Ocean, Kirby Super Star) dump successfully? TMZERO boots up just fine on regular hardware, too. What cart issue are you suggesting? What should I look for specifically on the dumper to see if things are mixed up? Also, are the switches on the dumper supposed to go a particular, unique way when dumping TMZERO? Could it be that the switches aren't in the right position?
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Mar 19, 2018, 06:50 pm
The existing sketch with SPC7110 code is fine.  The problem is clearly on your end either reader hardware or cart.  There's no way I can tell exactly what is wrong from here.  Like I said before, recheck all address lines.

DO NOT ASSUME THAT YOUR HARDWARE IS CORRECT.  ASSUME THAT EVERYTHING IS CONNECTED WRONG UNTIL YOU VERIFY EACH PIN CONNECTION.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: werewolfslayr925 on Mar 19, 2018, 07:43 pm
sanni, if I'm not mistaken, this (https://github.com/sanni/cartreader/blob/master/pcb/cartreader_schematics.png) is the diagram against which skaman is saying I should compare my dumper, correct? That's the schematic for the dumper for which you give the instructions on GitHub, right?

The existing sketch with SPC7110 code is fine.  The problem is clearly on your end either reader hardware or cart.  There's no way I can tell exactly what is wrong from here.  Like I said before, recheck all address lines.

DO NOT ASSUME THAT YOUR HARDWARE IS CORRECT.  ASSUME THAT EVERYTHING IS CONNECTED WRONG UNTIL YOU VERIFY EACH PIN CONNECTION.
Thanks for the help. You don't have to shout, though :3 I already checked to make sure everything was connected like you said. I just remembered that sanni posted a link to the schematics in response to my first inquiry. Assuming that the ones he gave me are for the build he has on his GitHub, I'll check them again, using the schematic as a guide, and report back any abnormalities if they exist.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Mar 19, 2018, 08:02 pm
Sorry, not shouting.  Meant to say it with emphasis.  Recheck all the pins while you're at it.  Even if you were able to read other special chip carts, the addressing to read them is different from reading  the SPC7110 carts.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: tamanegi_taro on Mar 20, 2018, 05:25 pm
I should have implemented TMZero dump code to sanni's cart reader. I'm pretty sure that the code I posted while ago will dump TMZERO cart properly by UART though.
By the way, how big is size of your dump werewolfslayr925?
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: Einhandr on Mar 21, 2018, 12:55 am
I was curious. If you backup a game or battery save from a reproduction of a patched game (English translation of a JP rom) would work? Or would you get errors because the data wouldn't match?

Edit: Got my answer. I was able to read the save from a retail JP Star Ocean and write the save back to a English patched repro cart that I made with no issue. Amazing!
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Mar 26, 2018, 10:23 pm
I've been on a bit of a Street Fighter 2 run.  Got PCE Street Fighter II', Virtual Boy Hyper Fighting, and MD/Gen Super Street Fighter 2 all dumping properly.  SF2 and its console variants really pushed the hardware limits.

I'll submit the Super Street Fighter 2 code changes to sanni.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: tamanegi_taro on Mar 27, 2018, 05:01 pm
Nice! Are you able to dump virtual boy though? I cannot find any compatible sockets.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Mar 27, 2018, 09:16 pm
Yes, I made a VB Plugin PCB for the Retrode.  The connector requires hand assembling header pins into the proper configuration.  Pictures of a prototype in this thread:  http://forum.retrode.org/index.php/topic,392.msg2875.html

I modified one of the prototype plugins to work with the Arduino reader.  The plugin configured for the Arduino reader supports SRAM and Hyper Fighting.  The Retrode is limited to SRAM or Hyper Fighting (ROM only) due to a lack of available control pins.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: tamanegi_taro on Mar 28, 2018, 11:44 am
Hi skaman,

Can you share me Pinout of your PC Engine adapter?
I need to slightly modify hardware of my PCI socket version again.
So I want to rewire it to add compatibility with yours.

By the way, I think adding logic IC to your VB adapter will solve control pins problem.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Mar 29, 2018, 08:50 pm
Modified PCE/TG16 pinout (based on pinout posted on Retrode website):

Code: [Select]
SNES  - TG16                                SNES  - TG16
===============================             ===============================
PIN5  - PIN18                               PIN36 - PIN18
PIN6  - PIN27                               PIN37 - PIN6
PIN7  - PIN25                               PIN38 - PIN30
PIN8  - PIN28                               PIN39 - PIN31
PIN9  - PIN29                               PIN40 - PIN5
PIN10 - PIN7                                PIN41 - PIN4
PIN11 - PIN8                                PIN42 - PIN32
PIN12 - PIN9                                PIN43 - PIN33
PIN13 - PIN10                               PIN44 - PIN3
PIN14 - PIN11                               PIN45 - PIN24
PIN15 - PIN12                               PIN46 - No Connect
PIN16 - PIN13                               PIN47 - No Connect
PIN17 - PIN14                               PIN48 - No Connect
PIN18 - No Connect                          PIN49 - PIN26
PIN19 - PIN23                               PIN50 - PIN19
PIN20 - PIN22                               PIN51 - PIN17
PIN21 - PIN21                               PIN52 - PIN16
PIN22 - PIN20                               PIN53 - PIN15
PIN23 - No Connect                          PIN54 - PIN34
PIN24 - No Connect                          PIN55 - No Connect
PIN25 - No Connect                          PIN56 - No Connect
PIN26 - No Connect                          PIN57 - No Connect
PIN27 - PIN38 Vcc.                          PIN58 - PIN38 Vcc


Changes to original pinout: swap A18 and A19 (SNES Pins 43 and 44) and connect /WR (SNES Pin 54).
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: tamanegi_taro on Mar 31, 2018, 01:38 pm
Thanks.
Only difference I found was CE and OE pins.

I also bought one VB cart to play with but surprised about how thin the connector holes are.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Mar 31, 2018, 11:29 pm
The original plugin made for the Retrode by JonY used pins extracted from PCMCIA connectors.

I use pins from a specific 1.27mm header.  The pins that I use are 0.4mm square.

Pins from a standard 1.27mm header will work but they will be slightly oversize and a really tight fit.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: tamanegi_taro on Apr 01, 2018, 04:30 am
Thanks.
I'll try to make another VB adapter for sanni's by re-aligning pins in link below once I get PC engine adapter finished.

http://akizukidenshi.com/download/2199-pinheader.pdf
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: werewolfslayr925 on Apr 07, 2018, 08:20 am
I should have implemented TMZero dump code to sanni's cart reader. I'm pretty sure that the code I posted while ago will dump TMZERO cart properly by UART though.
By the way, how big is size of your dump werewolfslayr925?
The size of the dump is appr. 5 MB (5,242,880 bytes)

I'm going through each pin on the board for the SNES cart slot as skaman suggested. So far, all of the A pins match where the board says they should go.

I really don't know how to make heads or tails of the schematic. It doesn't seem to match the names on the board--then again, I really don't know how to read it. So, I'm drafting my own schematic/taking notes based on what I've got. I'll post both my schematic draft, my notes, and pictures of my dumper when I'm done.

Thanks everyone for being willing to help. I'm sorry for being such trouble.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Apr 07, 2018, 03:57 pm
Just download Open Office, Libre Office or Microsoft Excel and open the pinout.xls (https://github.com/sanni/cartreader/blob/master/pinout.xls) from my github.

An Arduino Mega pinout might help you too:
(https://i.pinimg.com/originals/2b/59/1b/2b591b96965d376003e36466cf9496de.jpg)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Apr 13, 2018, 02:44 pm
Just ordered the next and hopefully final version:

(https://dl.dropboxusercontent.com/s/ilktpjbnvpvop4k/v17.jpg?dl=1)

Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: SputnikBR on Apr 13, 2018, 10:24 pm
I have problems in writing on memory MBM29F033C (Flash ID 0404). I checked the "blank check" and "erase" functions and working normally. But writing any ROM only be displayed on LCD: "Flashing file /ROM/romtest.bin" and that's it ...
After i reboot the arduino and dump the ROM recorded, does not work on emulators.

I use the PCB 1J3M-20 with adapter to the Sanni CartReader(V23), and a 29F033C DIP36-TSOP40 Adapter (III). The jumpers according to the instructions contained in the Wiki, /OE PCB-57 and /WE PCB-18.

Anyone have any idea what the problem might be?
Thank you
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Apr 14, 2018, 12:23 am
Remove solder jumper R3 on DIP36-TSOP40 Adapter (III) so that WE is not connected to VCC anymore.
Desolder pin from OE on DIP36-TSOP40 Adapter (III) so that OE is not connected to MAD-1 chip anymore.
Keep the 2 wires you soldered attached.
Then try again.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: SputnikBR on Apr 14, 2018, 05:10 am
I had already done that. and it did not work.  :'(
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Apr 14, 2018, 12:49 pm
Dump the rom again and open both the dump and the source file with a hex editor like https://mh-nexus.de/en/hxd/ and use the ctrl+k compare function to see where the errors begin.

Maybe the first few bytes got written correctly and then you see the address where it starts to get bad. Then you can check which address pin is needed to write for that address and maybe that pin is not connected right.
Or if nothing was written at all then it's a different problem.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: star1 on Apr 14, 2018, 02:20 pm
So, my card reader has been working fine, but trying to flash a snes rom today, I end up getting
"cant open file"
"veryfiying"
"can't open card on SD"

I'm using a different SD card than previously, but the card reader finds the roms, it just can't read them, any ideas?
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Apr 14, 2018, 02:28 pm
Check that the filename is not more than 8 characters long, only letters or numbers, no spaces and make sure that it's in a directory close to the root that also has a short name so that the overall file path is not too long.

If the error still persists change in Cart_Reader.ino:

Code: [Select]

// Change to half speed if you get an sd error or it hangs when writing
#define sdSpeed SPI_FULL_SPEED
//#define sdSpeed SPI_HALF_SPEED


to:

Code: [Select]

// Change to half speed if you get an sd error or it hangs when writing
//#define sdSpeed SPI_FULL_SPEED
#define sdSpeed SPI_HALF_SPEED


Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: star1 on Apr 14, 2018, 02:59 pm
Thanks, I tried a simpler filename just before you posted your reply, because I figured special characters might mess things up. Did the trick, thanks for the help :)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: SputnikBR on Apr 14, 2018, 04:04 pm
Dump the rom again and open both the dump and the source file with a hex editor like https://mh-nexus.de/en/hxd/ and use the ctrl+k compare function to see where the errors begin.

Maybe the first few bytes got written correctly and then you see the address where it starts to get bad. Then you can check which address pin is needed to write for that address and maybe that pin is not connected right.
Or if nothing was written at all then it's a different problem.

only the beginning is written, more specifically the first line. all the rest is FF
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Apr 14, 2018, 04:33 pm
If the first line(=16 bytes) is written correctly then the data pins are ok and the error starts at address line A4. Try resoldering A4 on the 29F032 chip. Make sure that the trace going from A4 to the cart edge connector is not damaged and clean the golden finger for A4.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: SputnikBR on Apr 14, 2018, 08:19 pm
If the first line(=16 bytes) is written correctly then the data pins are ok and the error starts at address line A4. Try resoldering A4 on the 29F032 chip. Make sure that the trace going from A4 to the cart edge connector is not damaged and clean the golden finger for A4.
Were written 16bytes but 8bytes were repeated. The address A3 was disconnected from the adapter. Many thanks Sanni for the solution :D
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Apr 14, 2018, 08:27 pm
No problem  :)

In other news:
In preparation for receiving the hopefully final PCB version in about 3 weeks I have started on updating the documentation on my github to better reflect the current state of the project:
https://github.com/sanni/cartreader (https://github.com/sanni/cartreader)
https://github.com/sanni/cartreader/wiki/How-to-build-the-PCB (https://github.com/sanni/cartreader/wiki/How-to-build-the-PCB)

Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: Ailuros on Apr 14, 2018, 08:45 pm
Hi. I've been planning on building this for some time. But I already downloaded the repo back in November (the download is Cart_Reader_V27D.zip) and ordered the main PCB based on what I downloaded then. Do I have to re-order the PCBs again now, or can I go ahead and make what I have work? I just want to dump my N64 saves, as I already have ways of getting all my SNES and GBA saves. Could I build the variant listed here, and if so, how?
https://github.com/sanni/cartreader/wiki/Cart-Reader-64
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Apr 14, 2018, 08:57 pm
The new PCB version will integrate Mega Drive and Gameboy into the main pcb. If you don't care about those you can just go ahead and build the old version. All new code will work perfectly fine with it.

Here are the wiki pages for the old version:
https://github.com/sanni/cartreader/wiki/Cart-Reader-SNES-and-N64 (https://github.com/sanni/cartreader/wiki/Cart-Reader-SNES-and-N64)
https://github.com/sanni/cartreader/wiki/Needed-Parts/26d82ed870367b93ec197ab153b63f9f27a8f25f (https://github.com/sanni/cartreader/wiki/Needed-Parts/26d82ed870367b93ec197ab153b63f9f27a8f25f)
https://github.com/sanni/cartreader/wiki/PCB-Build-guide (https://github.com/sanni/cartreader/wiki/PCB-Build-guide)
https://github.com/sanni/cartreader/wiki/Setup-and-user-guide (https://github.com/sanni/cartreader/wiki/Setup-and-user-guide)

And the old PCB and 3d print files can still be found here: https://github.com/sanni/cartreader/tree/09d122369fb5bbec1bffa3a6568dc0b8f87921db/pcb (https://github.com/sanni/cartreader/tree/09d122369fb5bbec1bffa3a6568dc0b8f87921db/pcb)

It will still be some time before I'll upload the new design files since I haven't even received the pcbs yet to test them. I just took down the old pcb files so that nobody orders them shortly before I upload the new versions.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: Ailuros on Apr 15, 2018, 09:34 pm
Cool. I thought that might be the reason I couldn't find them. Thank you for the prompt reply. I just have one more question. If all I care about is N64 stuff, I just need to build the old version with just the main PCB, right? Do I even need the smaller secondary one for the build to work with N64 cartridges?
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Apr 15, 2018, 10:25 pm
Just the main pcb.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: werewolfslayr925 on Apr 16, 2018, 03:54 am
As requested, I took pictures of the ROM dumper (https://drive.google.com/open?id=1A8nTawOZdBX2T4XatIcXRTiBAfk_7RbP).

A few explanations:

1. I know the buttons are put on in a weird way. I actually prefer them like that.
2. The clock generator is not soldered to the male pins. Instead, it is connected to the PCB by slipping the male pins into the appropriate holes in the clock generator and putting the male pins into the holes of the female pins. Could this be what's causing the problem? I get a charge when I test the connections between the SNES pins and the clock generator, but it's often half of what the charge is when I test the connection between the SNES pins and the Arduino pins.

Also, I just saw your post with the schematics, sanni. I'll take a look at them and see if I can figure them out.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: tamanegi_taro on Apr 17, 2018, 03:24 pm
Hi skaman,

Would you try my PC Engine / TG16 dumper code on sanni's cart reader?
It should be fully compatible with PCE - SNES adapter you have.

http://fast-uploader.com/file/7079526678715/

4 files included:
Cart_Reader.ino
PCE.ino
PCE_CRC_LIST.txt
pinout_pce.xls

Copy ino files in Sanni's V32A code. You need to replace Cart_Reader.ino.
Placing PCE_CRC_LIST.txt on root of SD card will enable verify and automatic game name identifier.

pinout_pce.xls is pinout.xls with PC Engine/TG16 pinout

Hope this works!
(Please try with your cheapest HuCARD first though...)

I need some physical adjustments with hardware(Socket were too tight), so I will release hardware later on...
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: tamanegi_taro on Apr 18, 2018, 05:55 am
You forgot to place 47uF capacitor.

As requested, I took pictures of the ROM dumper (https://drive.google.com/open?id=1A8nTawOZdBX2T4XatIcXRTiBAfk_7RbP).

A few explanations:

1. I know the buttons are put on in a weird way. I actually prefer them like that.
2. The clock generator is not soldered to the male pins. Instead, it is connected to the PCB by slipping the male pins into the appropriate holes in the clock generator and putting the male pins into the holes of the female pins. Could this be what's causing the problem? I get a charge when I test the connections between the SNES pins and the clock generator, but it's often half of what the charge is when I test the connection between the SNES pins and the Arduino pins.

Also, I just saw your post with the schematics, sanni. I'll take a look at them and see if I can figure them out.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Apr 18, 2018, 08:37 am
Hi tamanegi_taro,

I tested your PCE sketch with my PCE/TG16 Plugin.  Both PCE and TG16 HuCards dump properly with the sketch.  I tested a few PCE HuCards and a couple TG16 HuCards.  I also tested the SF2' HuCard.

One item to note is that after dumping SF2', the reader displayed the "TG TurboChip menu" instead of the "PCE HuCard menu".  I tested the card twice and both times it returned to the TG menu.

BTW, your PCE_CRC_LIST is missing a HuCard that I recently dumped (and should be added to No-Intro):
Super Momotarou Dentetsu (Alternate)
CRC32: 69D52E7A
MD5: EF3F7D0333B5EE8F09068C6A1BED71AF
SHA1: E4C6129E98CF37FCE6CFC5352D112B1EC728D166

Nice job!
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Apr 18, 2018, 08:53 am
@werewolfslayr925:

The lack of proper connections to the Clock Generator could produce the problem you're having with the SPC7110 carts.  The clock signals are needed for the register commands used to map the different sections of the ROM.

I suggest you solder the pins to the Clock Generator.

Good Luck!
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: star1 on Apr 18, 2018, 04:02 pm
Forgive my ignorance, but as long as I adapt the pinout (and provide 12v where needed), can I use this to program a 27c322? I can see the options in the "Flash.ino", but there is no other mention of it that I can find.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Apr 18, 2018, 04:27 pm
I started adding support for 27C322 eproms but both the code and the new 16bit eprom adapter are still very rough and need work.

(https://dl.dropboxusercontent.com/s/8phxeb5xn62iqq0/IMG_20180405_111546603.jpg?dl=1)

(https://dl.dropboxusercontent.com/s/7ysk017cd966pgk/IMG_20180405_111605974.jpg?dl=1)

I'm using a 2N2222 transistor to switch on and off a 12V step-up converter to provide the correct VPP voltage when needed.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: tamanegi_taro on Apr 18, 2018, 04:37 pm
Hi sanni,

Nice work!

Would you please add my latest PC engine/TG16 dumper code into your arduino cart reader?
You can download latest files from here:

http://fast-uploader.com/file/7079617498094/

4 files included:
Cart_Reader.ino
PCE.ino
PCE_CRC_LIST.txt
pinout_pce.xls

Copy ino files in Sanni's V32A code. You need to replace Cart_Reader.ino.
Placing PCE_CRC_LIST.txt on root of SD card will enable verify and automatic game name identifier.

pinout_pce.xls is pinout.xls with PC Engine/TG16 pinout




Hi skaman,

Thank you!
Successfully fixed the bug with ST II'.
Would you try this new one?
Also added Momotaro densetsu alternate version into crc list file.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Apr 18, 2018, 05:03 pm
Added, many thanks  :)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: star1 on Apr 18, 2018, 05:19 pm
That is good to know. So how does the pin out compare? And is enabling writing just a matter of providing 12V to Vpp (and A9?) Thanks again!
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Apr 18, 2018, 05:45 pm
I have not bothered with Pin A9 because it's only really needed for eprom identification and I already know it's a 27c322. I'm also currently not applying the 6.5V programming voltage to VCC, just 5V. And the timings are not according to the datasheet.

Here is the pinout based on the SNES slot:
(https://dl.dropboxusercontent.com/s/ybewobwy24b8hpi/27c322.png?dl=1)
CE is E, DQ# is Q#, VPP is GVPP, GND is VSS, STEPUP is one of those cheap 12V step-up regulators from ebay, 2N2222 is a NPN transistor

(http://sega4ever.power-heberg.com/tutodedev/Cartmodding%20Megadrive/images/27c322%20pinout.png)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: star1 on Apr 18, 2018, 06:11 pm
Thanks a lot! I don't use a snes cart slot, I just have a zif socket on a shield for flash rom programming. Might just try to make another zif socket adapter that fits on top of the existing one.  Will need to order parts, so expect more questions in a while ;P

Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Apr 20, 2018, 08:24 am
@tamanegi_taro:

I tested the PCE_Dumper_101 and SF2' now returns to the PCE HuCard menu.  I redumped a few other HuCards and they worked correctly.

Great job!
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: hernan43 on Apr 20, 2018, 04:38 pm
I tested it as well and it worked great. It appeared to name the HuCard dumps and everything.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: werewolfslayr925 on Apr 20, 2018, 10:50 pm
@werewolfslayr925:

The lack of proper connections to the Clock Generator could produce the problem you're having with the SPC7110 carts.  The clock signals are needed for the register commands used to map the different sections of the ROM.

I suggest you solder the pins to the Clock Generator.

Good Luck!
Soldered the pins to the Clock Generator! IT WORKS!! That was what was giving me problems, then! Thanks everyone! I got TM Zero dumped. I'm gonna go try the SA-1 carts now. I think I asked this before, but has anyone managed to incorporate the appropriate code in for properly dumping MegaMan X2?

Update: Tried the two remaining SA-1 carts I have yet to dump--Super Mario RPG and Kirby's Dream Land 3. No dice. Maybe the carts are just too old and stubborn?
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Apr 21, 2018, 03:12 pm
Do you use an USB Port from your PC to power the Cart Reader for SA1? If yes try using a 5V/1A USB charger like those from mobile phones.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: KnightofTime on Apr 21, 2018, 07:57 pm
Hi guys, I'm new here (although I know a little about skaman.  He and I have had conversations on the Retrode forum; it's thanks to him I came here).  I've been seriously thinking of purchasing an Arduino cart reader, specifically with a SNES slot and N64 slot (but also including the clock generator so that it would work with SA-1 SNES cartridges since I have a Super Mario RPG cartridge here) as I already have other ways to read and write data from/to my Sega Genesis, Game Boy, Game Boy Color, and Game Boy Advance cartridges that have the ability to save to them (including a Retrode2, GBx plugin, Nintendo DS Lite, and a DSTwo flashcard), so slots for the other systems won't be necessary.  Before I make a decision about making a purchase, I have a bunch of questions I'd like to ask, please.

First and foremost, being as I'm not comfortable with soldering the parts if I directly order all the parts I need (my hands tend to sometimes shake uncontrollably when I do something that requires precision, so I just don't think soldering something myself would work that well), when I feel the time is right, is it totally fine for me to ask for someone else with soldering experience to order the parts I need and build the cart reader to my specifications, and pay that person either via Paypal or EMT to have them ship it to me directly when it's ready?  I might want to negotiate the price a little in hopes it can be reasonable for me (I'm Canadian BTW).   

Second,  will my laptop's USB ports be powerful enough to dump Super Mario RPG or any other SA-1 SNES game, and read/write data from/to the cartridge?  My laptop is an Alienware M14XR2, which is basically a gaming lapptop.

Third, can the cart reader be designed to also work with NES and/or Sega 32X cartridges?

Lastly, can a cart reader be customized so that it requires being plugged into a wall socket?

Thanks in advance.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Apr 21, 2018, 08:41 pm
From my experience a PC's USB port does not provide enough power to reliably dump SA1 games with my cart reader. I always use one of those:

(https://images-na.ssl-images-amazon.com/images/I/51FY6qmN3QL._SY355_.jpg)

Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: werewolfslayr925 on Apr 23, 2018, 03:54 am
From my experience a PC's USB port does not provide enough power to reliably dump SA1 games with my cart reader. I always use one of those:

(https://images-na.ssl-images-amazon.com/images/I/51FY6qmN3QL._SY355_.jpg)


This worked! Unfortunately, it only worked with Super Mario RPG. I think my copy of Kirby's Dream Land 3 is shot: I can't even get it to work on my SNES, even after thorough cleaning. Maybe I'll just have to get another copy...
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Apr 23, 2018, 10:14 am
Try replacing the battery, I had SNES games not start because of corrupted SRAM before.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: KnightofTime on Apr 23, 2018, 11:23 pm
sanni, I'm curious to ask if you're planning to order some PCBs sooner or later (or have lately)?  If you haven't ordered any lately, will you please let me know via PM when you get them?  skaman let me know about the need of PCBs for each batch of cart readers.

Also, can you give me a price estimate in USD or CAD of how much one of these cart readers will cost if it's fully assembled (presuming the only consoles it was designed to work with are SNES (including SA-1 games) and Nintendo 64), please?  If there is a time when you can reserve one of these cart readers, I'd really appreciate it.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Apr 24, 2018, 08:50 am
I don't have any leftover Cart Readers right now. Maybe someone else in this thread can help you out.  8)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: theodor613 on Apr 30, 2018, 02:11 pm
I still have about 2 of the older revision left. They just need an sd card with the latest from Sanni GitHub.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on May 13, 2018, 03:31 am
If anyone wants a PCE/TG16 Plugin PCB, send me a PM.

The plugin was developed for the Retrode but it is compatible with the Arduino reader.

Pictures here (http://forum.retrode.org/index.php/topic,367.msg2862.html#msg2862) and here (http://forum.retrode.org/index.php/topic,367.msg2873.html#msg2873).

You'll need to supply your own HuCard slot.  You can buy one from gamedoctorhk.com (http://gamedoctorhk.com/index.php?main_page=product_info&cPath=72_21_123&products_id=2159).
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: Discordian on May 16, 2018, 08:35 pm
Is there a relatively easy way to read/write the eeprom from an n64 cart? I just want to be able to backup and restore my saves :3. I'm okay buying a connector (or making a simple one). In pinout.xls, I only see 3 pins needed, do I just need to hookup those 3 pins (one with a 1k pullup resistor, I'm assuming on 3.3v?), or what else is required?
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on May 16, 2018, 09:10 pm
You buy the following items:
https://www.aliexpress.com/item/Mega-2560-CH340G-ATmega2560-16AU-Compatible-for-Arduino-Mega-2560/32517341214.html (https://www.aliexpress.com/item/Mega-2560-CH340G-ATmega2560-16AU-Compatible-for-Arduino-Mega-2560/32517341214.html)
https://www.ebay.com/itm/Micro-SD-Storage-Board-Mciro-SD-TF-Card-Memory-Shield-Module-SPI-For-Arduino-/261720518170 (https://www.ebay.com/itm/Micro-SD-Storage-Board-Mciro-SD-TF-Card-Memory-Shield-Module-SPI-For-Arduino-/261720518170)
https://www.aliexpress.com/item/High-quality-50-Pin-Connector-Game-Cartridge-Slot-for-Nintendo-64-for-N64-Console/32829907088.html (https://www.aliexpress.com/item/High-quality-50-Pin-Connector-Game-Cartridge-Slot-for-Nintendo-64-for-N64-Console/32829907088.html)

And then wire them up according to the pinout.xls. It's relatively easy and once finished it will work just like my Cart Reader 64: https://github.com/sanni/cartreader/wiki/Cart-Reader-64 (https://github.com/sanni/cartreader/wiki/Cart-Reader-64)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: Discordian on May 16, 2018, 09:36 pm
Okay so I already have the Mega and a bunch of pro minis, so I'll just go ahead and order those other parts! It looks very easy with the way you wrote it, I just wasn't sure if I was looking at it wrong because it almost looks too easy to me lol (If I knew what pins were what I suppose, which leads to my final questions).

My only questions left I suppose are it says for EEP to "DATA (1K Pullup)" to D7, "CLK" to D16 and "Reset" to D17, but I'm not sure where to find DATA, CLK, and Reset. The data sheet I found is here (http://n64.icequake.net/mirror/www.crazynation.org/N64/), but it doesn't list those pins. I also just noticed for ROM that, WR, RD, Reset under ROM also aren't on this sheet, should I be looking at a different one?

Sorry if I've missed something obvious! Cheers ^-^.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on May 16, 2018, 09:42 pm
DATA is "S_DAT", CLK is "1.6Mhz", Reset is "/COLD_RESET", WR is "/write" and RD is "/read".
You can also have a look at my schematics here (https://github.com/sanni/cartreader/blob/master/extras/pcb/cartreader_schematics.png) in addition to the pinouts.xls and the N64 cart slot pinout you linked.

It will be even easier once I get the pcb done. ;)

(https://dl.dropboxusercontent.com/s/pzxxy9f98qad4uy/n64reader_v2.jpg?dl=1)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: KnightofTime on May 20, 2018, 09:20 pm
Okay guys, I managed to find a guy in my home province who I am confident will be able to make me an Arduino cart reader if he purchases the required parts for the cart reader to have just SNES and Nintendo 64 support (this guy is Chinese; he runs this small store which specializes in products involving the use of the Raspberry Pi, and he has expertise in electrical engineering so I'm sure he can help me).

Now, I better ask a few questions so I can get back to this guy with the information he'll want to know.

First of all, what parts will he need to order to make the cart reader (including the clock generator for giving it compatibility with SA-1 SNES games)?

Second, can I have a guide to give him for this specific setup, please?

And third, if he is successful in building one of these cart readers someday, should I let him borrow my Super Mario RPG cartridge and one of my Nintendo 64 cartridges so that he can test it?

Thanks in advance.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: theodor613 on May 21, 2018, 04:08 am
Go here for the parts list:
https://github.com/sanni/cartreader/wiki/Needed-Parts (https://github.com/sanni/cartreader/wiki/Needed-Parts)

And here on how to build it:
https://github.com/sanni/cartreader/wiki/PCB-Build-guide (https://github.com/sanni/cartreader/wiki/PCB-Build-guide)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: Ailuros on May 21, 2018, 05:31 pm
Is there any reason to use the micro SD slot in the part list over the regular one? I saw an issue in the GitHub about it, but don't really understand it. Something about the logic level? I'm using the parts from the old version linked a few pages back. That issue appears to be closed now, so I'm quite confused as to which SD slot to use, and I'm almost ready to start building.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: hernan43 on May 21, 2018, 05:38 pm
I think for the MicroSD you had to remove the 3.3v voltage regulator(and bridge some of the pins) since it will already be receiving 3.3v. If I recall that was the issue.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on May 21, 2018, 07:45 pm
The best sd module is the custom design uploaded here (https://github.com/sanni/cartreader/tree/master/extras/pcb), which uses the same schematics as the microSD module but offers a full-size sd slot.
(https://dl.dropboxusercontent.com/s/jcse9iaxm3bbuu6/sd_adapter.png?dl=1)

It uses the parts of the microSD module (https://www.ebay.com/itm/Micro-SD-Storage-Board-Mciro-SD-TF-Card-Memory-Shield-Module-SPI-For-Arduino-/261720518170) and this sd slot (MMC/SD long variant) (https://www.ebay.com/itm/TF-MMC-SD-SIM-Deck-Socket-Micro-Card-Memory-Card-Holder-Plastic-Copper-ES/162636035873).

The old sd module (https://www.ebay.com/itm/291551876341) works too but there were concerns about the missing voltage level converter chip, so I designed the custom pcb.
You can also use the microSD module (https://www.ebay.com/itm/Micro-SD-Storage-Board-Mciro-SD-TF-Card-Memory-Shield-Module-SPI-For-Arduino-/261720518170), however on almost all cart reader pcb revisions but the currently unreleased design you need to desolder the AMS1117 and bridge its input/output pads on the module's pcb.

I'm still waiting for some Arduinos I initially ordered in February and reordered in April, so that's why the project is a little bit behind schedule right now.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: KnightofTime on May 21, 2018, 08:36 pm
Alright, thanks theodor613.

Now, I have a couple more questions, one, under "Electronic components" the downloadable excel file appears to be broken (I recall seeing something about this), what do I do here, presuming that a working version of that file can be uploaded to lcsc.com via the given URL?

Second, what's the difference between the various PCBs?  Seeing that the Cart Reader PCB is the only one that isn't optional, I'm basically curious to ask what the Flashadapter PCB and PSOP44 to DIP44 adapter each do?

Third, what's the difference between the N64 slot and N64 plug?

Finally, if the guy I mentioned purchases only the SNES slot and N64 slot in addition to the other important parts, would steps 3, 4, and 7 in the build guide change accordingly (so that step 3 would not mention the GBA slot, step 4 would not mention the Genesis/Mega Drive slot, and step 7 would be basically omitted)?
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on May 21, 2018, 08:59 pm
The excel file for the parts should download just fine. After you download it you can upload it to lcsc and order the parts, currently two parts are out of stock but they're pretty common parts so I guess if you order them anyway they'll just send it once they get them back in stock.

The flash adapter pcb let's you program 29F032 and similar flashroms. The PSOP44 to DIP44 adapter is needed for 29L3211 flash roms. If you don't know what those are then you don't need it. It has nothing to do with backing up games.

The N64 slot is where you put the N64 cartridge in. The N64 controller plug is where you put the N64 controller in so you can read Controller Paks or test the controllers analog stick and buttons.

Yes you can just leave out whatever slot you don't need. You can even leave out the buttons and the oled screen if you're okay with using your PC for input/output over the Arduino serial monitor.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: KnightofTime on May 21, 2018, 09:18 pm
You can even leave out the buttons and the oled screen if you're okay with using your PC for input/output over the Arduino serial monitor.
Uh, would leaving out the buttons and the led screen (presuming that's what you meant) not be optional (or for that matter, a good idea) if the clock generator is included as part of the cart reader setup?
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: moldov on May 22, 2018, 12:03 am
Sanni, thanks a lot for Your perfect job. I already ordered the parts for CartReader and waiting impatiently. I know that I'm not the first one who's asking this question: "When PCB will be available for order as a PCB or layout?" Could You estimate or give us a hope:))) I know that You are testing it now...but any promise would be great.

Thanks again.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on May 22, 2018, 06:21 am
I wish I was already in the final testing phase but I am still waiting on the Arduinos to arrive. :(
They should come any day now.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: moldov on May 22, 2018, 07:29 am
I wish to send You my Mega Arduino but it will take more time:( So will be waiting on Your updates.
Also the question is - will it be possible to order PCB from You because that will support You also, I guess.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on May 22, 2018, 10:16 am
I ordered more than one.  :D
Basically I know that the design works since I already build one reader but now I need to test if it works every time so I'm gonna build four more readers and test them over a longer period.
So the release is still longer than days away, hopefully just weeks, worst case scenario months but not years.  :smiley-small:
After four years in development it is time for a V1.0 release and all that is missing for that right now is a video about the build/soldering process and the finished and tested pcb.  8)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: moldov on May 22, 2018, 11:35 pm
This is huge amount of work and You gathering all the little masterpieces in one now. For sure we will be waiting until You do all the final machining and polishing before the final release.

Months it's OK. I recently left emulator way of life and went to white side of force:) - real hardware. Ordered NESRGB, OSSC, RGB cables and SF RAM cart and GB cart, so that's why I need Your masterpiece.


So if You need any help from my side just let me know.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: theodor613 on May 27, 2018, 08:04 pm
Sanni, how goes it with the 27c322?
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on May 27, 2018, 10:01 pm
I can write them just fine but there is one setting called "margin mode" that ensures that they are written properly for like long term and I haven't integrated that yet since it needs 12V on pin 9. I have however designed a new flash adapter pcb with that in mind but I have not ordered it. It's on low priority right now.

The Arduino Megas I ordered came yesterday too, so as soon as I have the time I'll build some cart readers and test for reliability, hopefully I can also make a video about the build process and upload it to youtube.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: theodor613 on May 28, 2018, 12:15 am
Sounds great so far. Thanks for the update.

One more thing, For some MX29L3211, I have to read, erase then blank check before I can actually write. I got 10pcs here and only 1 would erase, blank check and be empty before I can write. The other 9, I have to read them first. Otherwise, they would fail the blank check.

Edit: Added the 47uf capacitor and the issue is now fixed! I have now added 47uf capacitors on all my boards.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Jun 06, 2018, 11:47 am
Just finished testing, both hardware and software worked as expected.  :)

(https://dl.dropboxusercontent.com/s/4kix53kbziizlv7/v17_test.jpg?dl=1)

Now I only need to make a short video about the soldering process, maybe some videos about the Cart Reader in action, make a digikey shopping cart for the parts as an alternative to the Chinese parts vendor.

Should only be a few days/weeks until this is done now.

(https://dl.dropboxusercontent.com/s/f3qvs9gzzpfiwbf/v17b_front.jpg?dl=1)

(https://dl.dropboxusercontent.com/s/ycn5bu2jnrxqvm0/v17b_back.jpg?dl=1)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: theodor613 on Jun 06, 2018, 01:55 pm
That's awesome!
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Jun 09, 2018, 02:43 pm
And here is the video for the pcb build guide.  :smiley-draw:

(https://dl.dropboxusercontent.com/s/1ivtzp2swtemqn6/buildytprev.jpg?dl=1) (https://www.youtube.com/watch?v=EgYQeU0MP-U)




Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: DieKatzchen on Jun 10, 2018, 05:10 pm
Would it be possible to get these as a kit? I can source most of the parts myself, but that PCB is relatively large, I'm going to have to pay, like, $30 for a set of boards (since I can't just buy one).
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: theodor613 on Jun 12, 2018, 12:44 am
On the tsop to dip adapter board for the 29f033. I bridged all the pads to program the 29f033, but when installing do i remove all bridges, some or leave it as is?
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Jun 12, 2018, 11:31 am
If you just put it into a standard SHVC-1J3M-20 pcb or similar you leave all bridges on my design of the adapter pcb closed.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: theodor613 on Jun 12, 2018, 02:02 pm
Thanks, Sanni! The game is working beautifully.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Jun 12, 2018, 08:36 pm
I made a video about the process of putting together a translated SNES cartridge, I did not go into any details though to keep it nice and short:

(https://dl.dropboxusercontent.com/s/yd4qngljt7v2xku/transyouprev.jpg?dl=1) (https://www.youtube.com/watch?v=by7XxvAUwv0)






Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: theodor613 on Jun 12, 2018, 08:56 pm
Could you do a video on how to reprogram the 29f032 after it has been installed in a cartridge? I think that would be a nice addition.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Jun 12, 2018, 10:38 pm
Sure thing  :)
(https://dl.dropboxusercontent.com/s/3ibrpgwllnezj42/updtrepro.jpg?dl=1) (https://www.youtube.com/watch?v=r2SxECLrL4w)

Now to make it even nicer you could install a switch into the cartridge case that switches between connecting the wires for flashing and closing the solder bridges for playing.



Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: theodor613 on Jun 13, 2018, 12:21 am
Thanks!!
Also, this is a hirom board correct? Just want to point that out in case someone views the video. But, yes, i was thinking of adding a switch to erase and program without having to constantly resolder.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Jun 13, 2018, 12:52 pm
Updated my N64 Controller Pak video:
(https://dl.dropboxusercontent.com/s/6musdxfkjrlcdf3/contryoutubeprev.jpg?dl=1) (https://www.youtube.com/watch?v=TQl_If-YToE)

And also made one regarding GB and GBA flashcarts:
(https://dl.dropboxusercontent.com/s/cwfw4m8yq9y5qrb/gbflashprev.jpg?dl=1) (https://www.youtube.com/watch?v=HKKcEFmpgRM)

Reading and writing save games:
(https://dl.dropboxusercontent.com/s/h2e08skmn9pbi2y/savegameyouprev.jpg?dl=1) (https://www.youtube.com/watch?v=r0J9Dplejjg)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Jun 21, 2018, 01:33 pm
Just finished uploading the last files to my github and now everything should be ready to go.
If there are still questions just ask here in this thread.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: theodor613 on Jun 21, 2018, 05:08 pm
Other than finishing the 27c322 adapter, what else do you have planned for the cart reader?
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: jonasrosland on Jun 21, 2018, 09:08 pm
I just want to say THANK YOU for getting those last files uploaded/updated today, I've been following this project for a while and I'm really excited to get started with this shortly.

Great job on the tutorial videos as well, especially on how to solder everything to make sure I don't mess it up :)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: moldov on Jun 21, 2018, 10:42 pm
Sanni,

I would like to appreciate all of Your work You've done for the whole community. I ordered 10 boards of Cartreader and SDcart adapter and I would like to contribute to community some how. For sure I don't need all the 10 boards,so I want to share 8 with You guys.

So if You don't mind to save a bit on PCB manufacturing I can send one to You (once I receive them) with just cost of shipping which shouldn't be more then 6USD from Russian Federation.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Jun 22, 2018, 05:12 am
By request, I ported my CX4 (Rockman/Mega Man X2/X3) code to sanni's codebase.

The code is strictly for retail carts.  There are several X2/X3 prototypes that require different code to dump properly.

sanni has updated the Github repo with the CX4 code.

Enjoy!
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: DieKatzchen on Jun 27, 2018, 12:26 am
@Moldov I'll take one. Was going to offer the same, but you beat me to it.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: moldov on Jun 27, 2018, 12:32 am
@DieKatzchen - manufaturing suppose to send them in 1 day. I'm also waiting impatiently:)
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: DieKatzchen on Jul 05, 2018, 05:46 am
@moldov - Did you get them in any interesting color? Or just standard green?
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: moldov on Jul 05, 2018, 10:52 pm
Actually not, because another colors were twice more expencive
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: DieKatzchen on Jul 06, 2018, 02:31 pm
I like Elecrow for that. They charge about 2 or three bucks more for the boards, but about the same amount less for shipping, and some colors are free upgrades.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Jul 18, 2018, 06:00 pm
Added a new guide: https://github.com/sanni/cartreader/wiki/Adding-a-battery (https://github.com/sanni/cartreader/wiki/Adding-a-battery)

(https://dl.dropboxusercontent.com/s/xokh32nvpo5juv8/battery%20%281%29.jpg?dl=1)  

(https://dl.dropboxusercontent.com/s/z2o324mwpfb2lit/battery%20%282%29.jpg?dl=1)  
   
(https://dl.dropboxusercontent.com/s/oqnub2z4hdbahcm/battery%20%283%29.jpg?dl=1)  
    
(https://dl.dropboxusercontent.com/s/8ow40e4kj4j0js0/battery%20%284%29.jpg?dl=1)  
  
(https://dl.dropboxusercontent.com/s/d0we5xaj5qsac21/battery%20%285%29.jpg?dl=1)      
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Jul 18, 2018, 08:26 pm
Nice addition, sanni!  That was quick.

I guess I'll have to post pictures of my pocket SNES reader.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: sanni on Jul 19, 2018, 12:43 am
As soon as you told me about your pocket SNES reader with an integrated battery it dawned on me, that's exactly what was missing the whole time. :)
It just elevates the whole project, absolutely loving it. <3
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Jul 19, 2018, 03:22 am
I should have taken your advice and picked up the 3D printer.

The PCB fab house is having difficulty making the acrylic pieces for my case.

 :(
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: hernan43 on Jul 19, 2018, 03:34 am
How many are you looking for? I have a 3D printer.
Title: Re: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges
Post by: skaman on Jul 19, 2018, 04:12 am
Thanks hernan43!

I'll be in contact if I need help getting a case printed.  I'll wait to see what happens with my acrylic order.  My final PCBs were finished a week ago but the acrylic part of the order is unfinished so nothing has shipped.

I only want a couple cases.  The pocket/portable SNES Reader project is only for my personal use as the cost of the off-the-shelf components makes it quite expensive.