ROM-Reader for Super Nintendo / Super Famicom Game Cartridges

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)

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!