Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - Wannado

Pages: [1]
Dear Retrode community,

in this post, I'd like to tell you about my recent activities and my plans regarding the Retrode firmware.

justin89's patch

You may have heard about the patch that justin89 submitted long time ago. I want to finally try and merge it into the firmware, step by step. To simplify that, I've split the patch up by the features it contains:
  • A way to force HiRom or LoRom addressing for SNES games.
  • A way to read/write the saves of the SNES games Brain Lord and Robotrek.
  • Support for reading/writing SRAM and Flash saves of GBA games. (Also FRAM saves, but with issues.)
  • Support for reading/writing SRAM saves of N64 games. (Also reading FRAM saves, but the results don't seem correct.)

The small features 1 and 2 will be included (in a modified form) in the next release I'll publish. Superseded by skaman's work. See also "Plans" below.

Config file optimization

At the moment, I'm optimizing the config file. This is motivated by justin89's patch (which includes new config options) and other things.

To save buffer space, I've removed most of the help comments from the config file. As a replacement, I want to add a separate help file with more detailled descriptions (compressed, read-only). However, the current draft is still rather large even in compressed form. Apart from that, I've reduced the size of the parsing and printing code significantly.

Still issues saving to Phantasy Star IV and Shining Force from Kega Fusion

After the release of v0.21-beta, gliitch had reported that saving in above Mega Drive games still doesn't fully work for him (using Kega Fusion). The issues are the same as with v0.20-beta. Despite gliitch's assistance, I haven't been able to find the cause of the problems yet. See also below.


These are the things I'll try and do in the near future when possible (see reply #7 below), approximately in that order:
  • Finish the config file optimization (hopefully this weekend).
  • Add diagnostic features to help analyze the Kega saving issues (maybe this weekend or the next).
  • Make a new release before the end of April.
  • Take a closer look at features 3 and 4 of justin89's patch and maybe merge them (hopefully in May). Make a new release afterwards.
  • Continue work on the NES plug-in (possibly starting in May):
    • Design improved PCB.
    • Attempt to integrate support into the standard firmware.
    • Maybe improve SRAM battery detection.

You probably didn't expect this to happen anymore, but ...

With some help from JonY, Muzer, and of course Matthias, and using lots of information from the Nesdev website and similar sources, I designed and built a prototype of a NES plug-in for the Retrode. I also implemented experimental firmware support for this prototype. (Right now, it only exists as a branch and is not included in the standard firmware.)

I have attached a text file describing the pin assignments and an archive containing the PCB layout and schematics.
WARNING: My prototype uses a NES 72-pin connector. The PCB must be exactly 1.2 mm thick to fit into that connector. (Warning added 2015-11-08)

Firmware Features

The experimental firmware has built-in support for NES cartridges with the following boards/mappers:
I have successfully tested it with all of my NES games.

Auto-detection of the above boards/mappers as well as the ROM/RAM sizes is working for all tested games.

Support of many other mappers is possible by implementing small "mapper drivers", which you can load at runtime by overwriting a particular file on the Retrode's file system (retained until the Retrode is disconnected/reset).

The ROM is presented in two ways:
- As an emulator-friendly ".nes" file (original iNES format, not NES 2.0). The information in the header is incomplete (and the battery flag isn't 100% reliable), but emulators should be able to deal with it. Some homebrew or pirate carts may be too large for this format.
- As separate files for PRG ROM and CHR ROM (which may also be RAM).

Detection of whether CHR is ROM or RAM is based on the frequency of the byte values (hex) F0, E0, C0, 03, 07, 0F. This is relevant for the ".nes" file, which only includes CHR ROM, not CHR RAM, for obvious reasons.

Savegame SRAM reading and writing is supported.


2016-12-11: As stated previously, everything that is possible with the plug-in prototype is implemented in the experimental firmware and works quite well, and NES plug-in development retains its slow and irregular pace. However, my hopes that I could complete it in 2016 have proven illusory. It looks like it will still take months.
If I'll manage to do anything NES plug-in related in the few days this year has remaining, I will most probably be working on the improved PCB design.

To-do List

These are the major remaining items on my to-do list:
- Design an improved PCB, aiming to simplify assembly and use of the plug-in.
- Try to integrate NES plug-in support into the standard firmware.
- Maybe build another prototype with some modifications.
- Maybe improve detection of SRAM battery, if possible.

Update 2015-01-08: PCB and schematics added; formatting.
Update 2015-04-16: MMC6 (StarTropics) now supported, including SRAM reading.
Update 2015-11-08: Warning added; to-do list updated; spelling; new features: iNES file support, CNROM tested, SEROM now auto-detected like other SxROM.
Update 2016-03-20: Status, to-do list.
Update 2016-07-03: SRAM writing is now supported, size detection and CHR RAM detection improved; battery flag issue; status, to-do list.
Update 2016-12-11: Status.


Starting with firmware version 0.18d beta 1, the Retrode supports reading from and writing to the N64 Controller Pak also known as Memory Pak or MemPak, a memory card that stores data in battery buffered SRAM.

Note that access to savegame data stored inside N64 game cartridges (SRAM/Flash/EEPROM) is still unsupported.

Hardware Requirements

To use this feature, you need:
- a Retrode 1 or 2
- a Plug-IN64 (with controller ports)
- an N64 Controller
- a MemPak, obviously.

If you're using a Retrode 1, you also need the 3.3V adapter that came with the old N64/GBx plugin (which had no shell and no controller ports).


1. Update the firmware, if necessary (version 0.18d beta 1 or later is required).
2. Disconnect the Retrode from the USB host (PC or whatever you're using), so that the Retrode is unpowered.
3. The N64 hardware is designed to work with 3.3 volts.
Retrode 1: Attach the 3.3V adapter to the Retrode's USB cable.
Retrode 2: Set the voltage switch (reachable through the SNES slot) to 3.3V.
4. Plug the Plug-IN64 into the SEGA slot of the Retrode.
5. If desired, plug an N64 game cartridge into the Plug-IN64.
6. Plug the MemPak into the N64 Controller.
7. Plug the N64 Controller with the MemPak into the left port of the Plug-IN64.
8. If desired, plug another N64 Controller (without MemPak) into the right port.
9. As the last step, connect the Retrode to the USB host (Retrode 1: using the cable with the 3.3V adapter on it).

Accessing MemPak Data

If everything is connected properly, the Retrode's filesystem will show a file named "Mempak1.mpk" with a size of 32 kiB. Programs can read and write the raw MemPak data through this file.
Of course, writing is allowed only if you set [sramReadonly] 0 in the configuration file "RETRODE.CFG".

I recommend that the first thing you do is to make a backup copy of "Mempak1.mpk" and put it somewhere safe. Then disconnect and reconnect (or just reset) the Retrode and make another copy of "Mempak1.mpk". If possible, compare both copies. If they do not match, retry this procedure.

This is necessary because there is a chance of read errors. I tuned the code's timing to eliminate read errors on my controllers and MemPaks, but I cannot tell if results will be as stable on yours.

Write errors are possible, too. If you find that a savegame doesn't work on the real N64, you may need to write it again. You might try to verify the written file by comparing copies as described above.

Use In Emulators

I strongly recommend that you never let an emulator read or write your MemPak directly, even if it could. (See the discussion of read/write errors above.)

I successfully loaded the MemPak file into Project 64 2.0 as well as an old version of Mupen64. Hints: Look for (input plugin) options called Controller Pak, Memory Pak or MemPak. Find the directory where the emulator stores savegames and look for files bearing the .mpk extension.

Note that Project 64 may grow the file (to 160 kiB, then 256 kiB).

I will update this section with more details when I have more time. Feel free to share your own findings in the meantime. :)

Pages: [1]