Reflashing the N64 Repro - dkidd928/cartreader GitHub Wiki
First you need to setup the Cart Reader Shield's configuration switches like so:
Double-check that the voltage switch is set correctly to 3.3V for the N64. You should also use a 5V/1A phone charger instead of one of your PC's USB ports since reflashing the repro can take some time and the Arduino has some quirk where it can reset when you plug or unplug anything into a USB port of your PC.
For the repro to be re-flashable with the Cartridge Reader you need one of the repros with the Altera Max II CPLD and the Spansion S29GL256N (32MB/64MB), Fujitsu MSP55LV512 (64MB), Fujitsu MSP55LV100S (64MB) or Intel 4400L0ZDQ0 (32MB/64MB) flashroms.
Be aware that the games come in different hardware configurations like:
- Resident Evil 2: 64MB flash, two sram chips and the standard 6102 ultraCIC.
- Conker's BFD: 64MB flash, one sram chips configured as eeprom and a 6105 ultraCIC.
- Zelda Master Quest: 32MB flash, two sram chips and a 6105 ultraCIC.
- and probably many others
While the Intel 4400L0ZDQ0 flashroms are always 64MB the CPLD chip does not let you access the second half if the game is smaller than 64MB. If possible buy the biggest game available like Resident Evil(sram save) or Conker(16KB eeprom save) so you don't get stuck with a small flashrom.
Now your Rom needs to be in Z64 file format. You can use Tool64.exe to make sure that this is the case. Also make sure that it has a short and simple filename.
The repro cart needs to have the same CIC and save type as the rom you are about to flash. It does not circumvent region locking unless you patched the rom.
Furthermore the ultraCIC inside the repro needs to correspond to the region of your console.
If you buy a repro with a game that saves to Sram like Zelda Master Quest you can save all games that use Sram. 4K and 16K Eeprom or Flashrom won't save on an Sram pcb.
So you could just buy multiple repros with different CIC chips and save types so you can mix and match depending on the rom you want to flash.
Here is a list of all the games and their save and cic type.
Changing the repro to PAL:
This has only been tested with the Intel 4400L0ZDQ0 pcb but should work with all variants.
On the repro pcb there is a solder jumper marked with J1. If you bridge the middle(PIN3) and the lower(GND) pad together then the ultraCIC will be switched to PAL. But make absolutely sure that PIN3 is not connected to VCC(red in the picture) by default, if that's the case you need to sever its connection to VCC before you connect it to GND. Check with a multimeter after everything is done and make sure that VCC and GND are not shorted.
Patching the rom:
In case you don't have the needed cic/save combination for your current rom there are also patches/cracks available for certain games that change their CIC to 6102 and sometimes even change the save type. In the goodN64 set those fixed roms are marked with [f1].
You can also use a program like MotetIII or paladin to replace the cic data between 0x40 and 0xFFF inside the rom so that it corresponds with the CIC installed in your repro, fix the rom entry point and calculate a new checksum.
But this only seems to work with a few titles. You can use the cen64 emulator to check if a patched rom will boot or not prior to flashing.
Reflashing the ultraCIC:
You can also re-flash the Attiny25 to a different CIC type using an Arduino Uno running this sketch by Adafruit.
Don't forget to connect Pin 9 of the Arduino Uno to Pin 2 of the ultraCIC to provide a clock signal.
You don't need to solder the ISP wires to the repro, just sticking them in and applying pressure is enough for a successful flash. Make sure that pin 5 MOSI is not connected to GND on your N64 repro like it was on the very first version as this will prevent the Attiny from being reflashed.
First read out the Attiny25's current code in binary form. Since you most likely already have the Arduino IDE installed we will use the included avrdude for that.
Just create a *.bat file with this content, you have to change COM6 to whatever COM port your Arduino got assigned:
"C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avrdude.exe" -C "C:\Program Files (x86)\Arduino\hardware\tools\avr\etc\avrdude.conf" -c arduino -P COM6 -b 19200 -p t25 -U flash:r:ultracic_read.bin:r
pause
Next compare it to the file read out from the repro I bought to make sure your Attiny programmer is working.
To change the CIC type just edit the value at Offset 0x38 with an hexeditor:
0x60 = 6102
0x61 = 6103
0x62 = 6106
0x63 = 6101
0x64 = 6105
0x68 = 7101
0x69 = 7103
0x6A = 7106
0x6B = 7102
0x6C = 7105
As an alternative you can also compile the switchable ultraCIC II from its source code
Next create a second *.bat file with this content to perform the flashing, once again you have to adjust COM6 to whatever COM port your Arduino got assigned and also change the filename according to your hex file:
"C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avrdude.exe" -C "C:\Program Files (x86)\Arduino\hardware\tools\avr\etc\avrdude.conf" -c arduino -P COM6 -b 19200 -p t25 -U flash:w:ultracic.bin
pause
Adding an eeprom chip:
You can also salvage an eeprom chip out of a real N64 game and solder it into your sram repro like that:
Bytes at the end of the repro rom:
The repros have some bytes added to the end of the rom:
55 AA 55 AA 55 AA 55 AA 01 08 FF FF FF FF 58 FF // Super Smash Bros(SRAM save 16MB rom)
55 AA 55 AA 55 AA 55 AA 01 20 00 00 00 00 2F 00 // Resident Evil 2 (SRAM save 64MB rom)
55 AA 55 AA 55 AA 55 AA EE 08 00 00 00 00 D4 00 // Bomberman 2nd Attack (EEPROM save 16MB rom)
55 AA 55 AA 55 AA 55 AA EE 10 FF FF FF FF A4 FF // Mario Party 3 (EEPROM save 32MB rom)
55 AA 55 AA 55 AA 55 AA EE 20 FF FF FF FF BA FF // Conker BFD (EEPROM save 64MB rom)
Best guess:
01 = SRAM save
EE = EEPROM save
08 = 16MB rom
10 = 32MB rom
20 = 64MB rom
The second last byte is the checksum of the rom (just a simple addition of all bytes in the whole rom besides the checksum byte where you just add 0xFF)
Speculated:
04 = 8MB rom
02 = 4MB rom
01 = 2MB rom