Go Down

Topic: ROM-Reader for Super Nintendo / Super Famicom Game Cartridges (Read 309252 times) previous topic - next topic

xjunox

Could you upgrade or add another chip to expand the memory on a sf nintendo power cart? I opened the cartridge and saw it had another spot for a chip.

https://ibb.co/TWT2tcp

sanni

You can add one but you can't use it.  :)
Access to the 3rd chip is most likely disabled in the MX15001 chip.

androxilogin


sanni

Can't say, never had one of these. A very similar flashram chip is already supported so it might be that you only need to add a new entry in idFlashrom_N64() with the correct ID and size for this chip.

KnightofTime

Hi guys,

I wasn't sure if I was going to make a post here after I received the cart reader I got from moldov, though unfortunately I just wasn't able to get it to work for me with any of the games I tested it with (I tested it with both SNES SA-1 games and Nintendo 64 games, and had no success with either).  I also have a slight feeling it may have contributed to me losing everything on the C drive of my laptop (I sure hope I am wrong though; despite losing everything on that C drive, I got another one installed on my laptop, and I also have Windows 10 now).

I might go for another cart reader in the future, though if I do, I'm gonna go for a SNES-only cart reader with the SA-1 functions, since I now have a Nintendo 64 plugin for my Retrode2.

So what I'd like to know is, one, can a cart reader be built with a protective shell that surrounds it but still allows a user to backup/restore save data?  Two, roughly how much would it cost for me (in US or Canadian dollars) to buy a SNES-only cart reader from someone else here that includes a protective shell (if applicable), the SA-1 stuff,  and a regular-sized SD card slot?  It would be great to acquire one that was thoroughly tested first, as I have no idea if moldov tested the cart reader he reserved for me before he sent it (I was surprised that moldov chose to make the cart reader he sent me only work with micro SD cards, and not regular-sized SD cards).

Thanks in advance.

sanni

The Cart Reader is just an Arduino Mega 2560 and I have never heard of any Arduino damaging people's hard drives.
Now the SD module is just that a module, you can either fit a microSD or full-size SD module to the Cart Reader since it has headers for both types. You can order a full-size module from China, they're like $1.
What's wrong with the current protective shell in your opinion?


Since this is a development thread I can obviously not give you any kind of customer support for something you bought from someone else. Best to contact your seller via a personal message.
Also, why don't you just get the SA-1 adapter for your Retrode, wouldn't that make the most sense in your situation?

KnightofTime

What's wrong with the current protective shell in your opinion?
Nothing, it's just that the cart reader I received from moldov was lacking in one (I could feel some of the inner workings, plus I could never get a regular sized SD card working with what I presumed was a slot for the cart reader to read it).

Also, why don't you just get the SA-1 adapter for your Retrode, wouldn't that make the most sense in your situation?
Unfortunately no.  skaman told me that the SA-1 adapter only reads SA-1 saves (it cannot write new ones to the cartridges), and such, buying one would be like having an inferior version of the Retro Freak I received last week (it can read saves on SA-1 games, but I found it can't write new saves to those games).  While I'm thinking about the Retro Freak, could it technically write new saves to SA-1 games if a USB clock generator (if it exists) was inserted into one of the USB slots?

Anyway, I'm planning to send back the cart reader back to moldov (and get a refund for it; I had to pay only $60 in Canadian dollars when I told him about an unrelated project I was helping a great deal with, where he was touched enough to cut the asking price of the cart reader he made for me in half)...it's not what I wanted to do, but it's still something I have to do (I already let him know via e-mail that I'm sending the cart reader back to him, and he has promised to give me the refund I asked for once I give him a tracking number.  But since I have it in a parcel ready to send back to him, I can't open it up.  I can post pictures of the cart reader that he sent me however, if you wish to look at them).  

One more thing, if someone here is open to building a SNES-only cart reader for me and sending it my way after receiving payment for it, would it be better for me to wait for the next major update to the cart reader (that is, when the SA-1 stuff is set up to always be ready instead of having the CLK0 and CLK1 switches) before I decide to purchase another one?  I don't mind the switches, though if the future model without the switches works even better than the current model, then I'm totally fine with waiting.

xybots

#1012
Dec 19, 2019, 01:44 pm Last Edit: Dec 19, 2019, 01:49 pm by xybots Reason: showing picture
Hi All

First i wish to thanks Sanni for a great project and my Cart Reader is working great, but i was wondering if anyone has code i could have please for the following GBA Repro Cart chip, M29W128GH 16MB flash chip, i've tried adding code but it still come up flash card id not found the cart reader resets.

Im not very good at coding and normally ask for help as this is a new area for me thanks for everyone help


sanni

With these Chinese repros you always have to do a few assumptions and then continue with trial and error, which is why you need the actual cart in front of you to implement support or else it would take too long.

So given that M29W128GH sounds quite similar to the already supported MX29GL128E we should first compare the M29W128GH's datasheet to the MX29GL128E functions in the Cart Reader code.

The first step would be to get the correct flashrom ID with the idFlashrom_GBA function.

Quote
else {
    // Send swapped MX29GL128E/MSP55LV128 ID command to flashrom
    writeWord_GAB(0xAAA, 0xAA);
    writeWord_GAB(0x555, 0x55);
    writeWord_GAB(0xAAA, 0x90);
    __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");

    // Read flashrom ID
    sprintf(flashid, "%02X%02X", ((readWord_GAB(0x2) >> 8) & 0xFF), (readWord_GAB(0x2) & 0xFF));

    // MX29GL128E or MSP55LV128
    if (strcmp(flashid, "227E") == 0) {
      // MX is 0xC2 and MSP is 0x4 or 0x1
      romType = (readWord_GAB(0x0) & 0xFF);
      cartSize = 0x1000000;
      resetMX29GL128E_GBA();
    }
    else {
      println_Msg(flashid);
      print_Error(F("Unknown Flashid"), true);
    }
  }
In the M29W128GH datasheet the relevant information starts on page 23. The flashrom commands seem to be the same, which is good. And according to datasheet page 27 we are expecting 0x227E as flashid same as with the MX29GL128E but 0x20 as the manufacturer ID instead of 0xC2. So the variable romType will be different, which is our first clue why it might give you an error which according to this line should be "Unknown manufacturer".

But since your error is "flash card id not found" and not "Unknown manufacturer" you probably have to look further into the idFlashrom_GBA() function until you get the correct flash ID.
One thing you could try is changing

Quote
writeWord_GAB(0xAAA, 0xAA);
    writeWord_GAB(0x555, 0x55);
    writeWord_GAB(0xAAA, 0x90);
to

Quote
writeWord_GBA(0xAAA, 0xAA);
    writeWord_GBA(0x555, 0x55);
    writeWord_GBA(0xAAA, 0x90);
And see if you now get the correct flash ID of "227E". Most GBA repros have D0 and D1 swapped to prevent accidentally erasing their flashrom but some might not have the pins swapped.




xybots

Hi Sanni

thanks for your help so far Ive edited the existing code and when I send it to the mega my pc won't detect the mega ? I have unplugged it from the cart reader shield do I have to desolder it to upload the code ?

When I 1st updated the code it was not soldered to the shield

thanks for everyones help

Brian

sanni

The shield needs to be plugged into the Arduino and connected via the two soldered wires and the power switch of the shield switch needs to be in the ON position.

xybots

Hi Sanni

I've updated the shield to v4.3, and when I plug in the GBA repo and go to flash cart I now get this up

ID:227E Size 16mb
32
Unknown Manufacturer

Press a button







sanni

Then the next step would be to add the manufacturer ID to the code, so change the
void flashRepro_GBA()
function from:

Quote
if (strcmp(flashid, "227E") == 0) {
      // MX is 0xC2 and MSP55LV128 is 0x4 and MSP55LV128N 0x1
      if (romType == 0xC2) {
        println_Msg(F("Macronix MX29GL128E"));
      }
      else if ((romType == 0x1) || (romType == 0x4)) {
        println_Msg(F("Fujitsu MSP55LV128N"));
      }
      else if ((romType == 0x89)) {
        println_Msg(F("Intel PC28F256M29"));
      }
      else {
        println_Msg(romType);
        print_Error(F("Unknown manufacturer"), true);
      }
    }
to:

Quote
if (strcmp(flashid, "227E") == 0) {
      // MX is 0xC2 and MSP55LV128 is 0x4 and MSP55LV128N 0x1
      if (romType == 0xC2) {
        println_Msg(F("Macronix MX29GL128E"));
      }
      else if ((romType == 0x1) || (romType == 0x4)) {
        println_Msg(F("Fujitsu MSP55LV128N"));
      }
      else if ((romType == 0x89)) {
        println_Msg(F("Intel PC28F256M29"));
      }
     else if ((romType == 0x20)) {
        println_Msg(F("ST M29W128GH"));
      }

      else {
        println_Msg(romType);
        print_Error(F("Unknown manufacturer"), true);
      }
    }
And further down from:
Quote
else if (strcmp(flashid, "227E") == 0) {
        //if (sectorCheckMX29GL128E_GBA()) {
        //print_Error(F("Sector Protected"), true);
        //}
        //else {
        println_Msg(F("Erasing..."));
        display_Update();
        if ((romType == 0xC2) || (romType == 0x89)) {
          //MX29GL128E
          //PC28F256M29 (0x89)
          sectorEraseMX29GL128E_GBA();
        }
        else if ((romType == 0x1) || (romType == 0x4)) {
          //MSP55LV128(N)
          sectorEraseMSP55LV128_GBA();
        }
        //}
      }
      /* Skip blankcheck to save time
        print_Msg(F("Blankcheck..."));
        display_Update();
        if (blankcheckFlashrom_GBA()) {
        println_Msg(F("OK"));
      */

      //Write flashrom
      print_Msg(F("Writing "));
      println_Msg(filePath);
      display_Update();
      if ((strcmp(flashid, "8802") == 0) || (strcmp(flashid, "8816") == 0)) {
        writeIntel4000_GBA();
      }
      else if (strcmp(flashid, "227E") == 0) {
        if ((romType == 0xC2) || (romType == 0x89)) {
          //MX29GL128E (0xC2)
          //PC28F256M29 (0x89)
          writeMX29GL128E_GBA();
        }
        else if ((romType == 0x1) || (romType == 0x4)) {
          //MSP55LV128(N)
          writeMSP55LV128_GBA();
        }
      }

      // Close the file:
      myFile.close();
to:
Quote
else if (strcmp(flashid, "227E") == 0) {
        //if (sectorCheckMX29GL128E_GBA()) {
        //print_Error(F("Sector Protected"), true);
        //}
        //else {
        println_Msg(F("Erasing..."));
        display_Update();
        if ((romType == 0xC2) || (romType == 0x89) || (romType == 0x20)) {
          //MX29GL128E
          //PC28F256M29 (0x89)
          sectorEraseMX29GL128E_GBA();
        }
        else if ((romType == 0x1) || (romType == 0x4)) {
          //MSP55LV128(N)
          sectorEraseMSP55LV128_GBA();
        }
        //}
      }
      ///* Skip blankcheck to save time
        print_Msg(F("Blankcheck..."));
        display_Update();
        if (blankcheckFlashrom_GBA()) {
        println_Msg(F("OK"));
      //*/

      //Write flashrom
      print_Msg(F("Writing "));
      println_Msg(filePath);
      display_Update();
      if ((strcmp(flashid, "8802") == 0) || (strcmp(flashid, "8816") == 0)) {
        writeIntel4000_GBA();
      }
      else if (strcmp(flashid, "227E") == 0) {
        if ((romType == 0xC2) || (romType == 0x89) || (romType == 0x20)) {
          //MX29GL128E (0xC2)
          //PC28F256M29 (0x89)
          writeMX29GL128E_GBA();
        }
        else if ((romType == 0x1) || (romType == 0x4)) {
          //MSP55LV128(N)
          writeMSP55LV128_GBA();
        }
      }

      // Close the file:
      myFile.close();
This is still under the assumption that the ST flashrom behaves like a MX29GL128E. So basically you want to keep an eye out if it erases correctly, it should say "Blankcheck...OK" and then ofc if it writes anything

xybots

Then the next step would be to add the manufacturer ID to the code, so change the
void flashRepro_GBA()
function from:

to:

And further down from:
to:
This is still under the assumption that the ST flashrom behaves like a MX29GL128E. So basically you want to keep an eye out if it erases correctly, it should say "Blankcheck...OK" and then ofc if it writes anything
Sanni that worked a treat i entered the code as you said, and it worked thank you so much as always. :)

sanni

Once you tested it a few times for stability and confirmed the cart working in a GBA please send me the gba.ino so I can upload it to github. :)

Go Up