Tools for the 3rd generation of raphnet GC/N64 to USB adapters



About this project

The third generation of my Gamecube/N64 to USB adapters has upgradable firmware and offers advanced functionalities such as a configurable polling frequency and N64 mempak access.

Since this is outside the scope of what a typical USB game controller does, operating systems do not support those new functions. Development of additional utilities was therefore necessary.

Those tools (both graphical and command-line based) are explained and distributed on this page.

Features:

goto top Up


Downloads

RSS feed for this table
File(s)DateDescription
gcn64ctl-install-1.6.0.exe (7.1 MB)
gcn64tools-1.6.0.tar.gz (345.6 KB)
April 6, 2017 (Thursday) Add support for the N64 Transfer Pak:
  • Read ROM from ROM-Only, MBC1, MBC3 and MBC5 cartridges.
  • Read/Write save RAM for MBC1, MBC3 and MBC5 cartridges.
gcn64ctl-install-1.5.0.exe (7 MB)
gcn64tools-1.5.0.tar.gz (333.3 KB)
February 4, 2017 (Saturday) GC to N64 adapter management support:
  • Displays the firmware version
  • Displays some configuration parameters (currently read-only)
  • Firmware update functionality
gcn64ctl-install-1.4.1.exe (7 MB)
gcn64tools-1.4.1.tar.gz (331 KB)
January 29, 2017 (Sunday)
  • Improved firmware update reliability:
    • Update would fail if there were spaces in the path to the firmware .hex file
    • Do a forced chip erase before flashing to make sure it really is blank (flashing fails on non-blank chips)
  • Firmware update now logs to a file (raphnetupdate.log in the user's home directory). (In case of failure, I'll want to look at this file)
gcn64ctl-install-1.4.exe (7 MB)
gcn64tools-1.4.tar.gz (328 KB)
January 16, 2017 (Monday)
  • Support for adapters with firmware 3.4.x
  • Simple N64 Bio sensor support (command-line only)
gcn64ctl-install-1.3.exe (7 MB)
gcn64tools-1.3.tar.gz (324.5 KB)
November 27, 2016 (Sunday)
  • Support for adapters with firmware 3.3.x
  • Add multi-channel support (for command-line tools only at the moment)
gcn64ctl-install-1.2.exe (7.2 MB)
gcn64tools-1.2.tar.gz (322.8 KB)
October 2, 2016 (Sunday) Firmware update improvements and fixes:
  • Add a 'recover adapter' function to recover 'bricked' adapters
  • Fix a bug when updating (Displayed 'Update failed' but it was not really the case and the user just had to disconnect and reconnect the adapter to complete the update)
gcn64ctl-install-1.1.exe (7.2 MB)
gcn64tools-1.1.tar.gz (324.3 KB)
May 25, 2016 (Wednesday) Added firmware version 3.2 support
gcn64ctl-install-1.0.exe (7.2 MB)
gcn64tools-1.0.tar.gz (323.9 KB)
February 16, 2016 (Tuesday) First version
This project is also available on GitHub!
To request features, report issues or contribute, you may send me an email or use the GitHub repository:
https://github.com/raphnet/gcn64tools
Looking for a firmware update .hex file? Firmwares are distributed directly from the Gamecube/N64 to USB adapters page.

goto top Up


Graphical user interface

The management tool can perform a vibration/rumble test, can update an adapter's firmware and perform read/write operations on N64 mempaks. The built-in mempak editor supports common .N64 and .MPK mempak image file formats. Downloading cheats from gamefaqs and using them on the real N64 system is therefore possible! The editor also supports importing and exporting individual saves (notes) in separate files.
Main screen

Main screen

Mempak editor

Mempak editor



The adapter update function asks you to select the firmware .hex file and does a few checks to prevent mistakes (ex: Installing an incompatible firmware). Once the file is selected, clicking "Start update" is all there is to do. If everything goes well (please, do not disconnect anything!) after a few moments the Update successful window should confirm the update.

Before

Before

During

During

After

After



IMPORTANT: Always use the latest version of the adapter management tool to update adapters.

goto top Up


Command-line tools

The command-line tools are very useful if you appreciate simplicity and efficiency. They are available in the tools/ subdirectory of the source code, and will also be available in compiled form (.exe) when I start releasing builds for Windows.

gcn64ctl

Here are a few examples of use for gcn64ctl. Use the --help option for more information.
# Listing adapters
$ ./gcn64ctl -l
Simply listing the devices...
Found device 'GC/N64 to USB v3.0', serial '000001'
1 device(s) found
# Displaying the adapter version
$ ./gcn64ctl -s 000001 --get_version
Firmware version: 3.1.0
# Displaying the configured polling interval
$ ./gcn64ctl -s 000001 --get_poll_rate
Poll interval: 5 ms

# And to configure it:
$ ./gcn64ctl -s 000001 --set_poll_rate 10
Setting poll interval to 10 ms
# Reading a N64 mempak
$ ./gcn64ctl -s 000001 --n64_mempak_dump --outfile backup.n64
Output file: backup.n64
Reading mempak...
Reading address 0x7fe0 / 0x8000
Wrote file 'backup.n64' in N64 format

Tools for handling mempak images

These tools make it possible to convert mempak image files (.MPK to/from .N64), display and manipulate the content (add/remove/export/import notes), etc. Note that these tools operate on files and never access a physical mempak. To read/write a real mempak, use gcn64ctl or the graphical tool.

Note: Everything shown below is also possible using the mempak editor built in the graphical adapter management tool.
# Displaying the content
$ ./mempak_ls test2.n64
File size: 36928 bytes
.N64 file detected
Mempak image loaded. Image type 3 (N64)
Mempak content is valid
Block usage: 97 / 123
Note 0: PERFECT DARK. (28 blocks) 
Note 1: QUEST64.0 (2 blocks) 
Note 2: TUROK LVL 8. (16 blocks) 
Note 3: RAMPAGE WT. (7 blocks) 
Note 4: TUROK LVL 8. (16 blocks) 
Note 5: PERFECT DARK. (28 blocks) 
Note 6: Free
...
Note 15: Free
# Erasing a note (Note ID as listed by mempak_ls)
./mempak_rm test2.n64 5
File size: 36928 bytes
.N64 file detected
Loaded pakfile in N64 format.
Deleting note 5 (28 blocks)
# Converting a file
./mempak_convert test2.n64 test2a.mpk -f mpk
File size: 36928 bytes
.N64 file detected
Loaded file 'test2.n64' (N64 format)
Wrote file 'test2a.mpk' in MPK format
# Creating a new image (formatting)
$ ./mempak_format new.n64
Wrote empty (formatted) memory card file 'new.n64' in 'N64' format
# Extracting a note
$ ./mempak_extract_note test2.n64 3 rampage.note
File size: 36928 bytes
.N64 file detected
Exported note 3 to file 'rampage.note'
# Importing a note
$ ./mempak_insert_note new.n64 rampage.note
File size: 36928 bytes
.N64 file detected
Loaded pakfile in N64 format.
Current free blocks: 123
Note size: 7 blocks
Note name: RAMPAGE WT.
Note imported and written to slot 0

goto top Up


Updating an adapter under Windows

Windows users, please read this:
  1. When you will attempt to update an adapter for the very first time, Windows will detect a new device and will want to install a driver. This is an expected behaviour. However, installation will take so much time that the update will timeout and fail. Do not panic, disconnect the adapter, reconnect it, restart you computer and try again.
  2. With the current version of the tool, there is unfortunately a black window that keeps flashing during the update. Do not worry, this is a known issue. I will try to correct it in the future, but meanwhile at least updates work.
  3. If update fails and your adapter becomes unusable, please follow these steps to recover your adapter.
Note: Before you complain for the issues described above, please consider that my lack of interest for GUI programming combined with a strong aversion against Windows software development means that the very existence of this tool is almost a miracle.

Ready

Ready

Black window

Black window


goto top Up


Linux notes

If the tool does not detect your adapter despite it being properly connected, the most likely cause is that your user does not have the required permissions to access it.

Running the tool as root would work, but it is a very bad practise. Not recommended. Configuring udev to give your user the appropriate permissions is much cleaner. On my system, my user is a member of the plugdev group, and I use the following files to give the plugdev group direct access to the adapter in normal mode (99-raphnet.rules) and in update mode (99-atmel-dfu.rules).

/etc/udev/rules.d/99-raphnet.rules
SUBSYSTEM=="hidraw", ATTRS{idVendor}=="289b", ATTRS{idProduct}=="0017", MODE="0664", GROUP="plugdev"
SUBSYSTEM=="hidraw", ATTRS{idVendor}=="289b", ATTRS{idProduct}=="001d", MODE="0664", GROUP="plugdev"
/etc/udev/rules.d/99-atmel-dfu.rules
ATTR{idVendor}=="03eb", ATTR{idProduct}=="2ff0", MODE="0664", GROUP="plugdev" # ATmega32U2 DFU
ATTR{idVendor}=="03eb", ATTR{idProduct}=="2ffb", MODE="0664", GROUP="plugdev" # AT90USB128 DFU
Note: Of course, the above may need modifications for your specific distro or to fit to your needs.

goto top Up


Failed update recovery

I know the update function offered by the graphical user interface has a lot of room for improvement, especially under Windows where for many users, updating fails, leaving the adapter in an unusable state.

There are two variations of the issue:
  1. The adapter comes back to life once disconnected and reconnected. If it does not show the new adapter version in the management tool, the update may be re-attempted and then usually works.
  2. The adapter does not come back to life, even if disconnected a few times. When connected, it appears as a device named "ATmega32U2 DFU" and is not detected as a joystick. The adapter management tool does not "see" it either.
In this section, I will explain how to deal with the second issue described above.

Step 1: Disconnect the adapter

Disconnect the adapter and only reconnect it when told so at step 3 below.


Step 2: (re)Install the adapter management tool

Make sure you have the very latest version of the adapter management tool installed. Even if you do, re-install it, and make sure to check the "Install driver for updating adapter firmware" option during installation. This installs the driver to handle the adapter when it is in update mode.

Windows Security will warn that a device driver by Atmel Norway is about to be installed. Make sure to click Install (beware: The button saying Don't Install has focus by default). Atmel is the manufacturer of the micro-controller the adapter is based on.

Option to install the driver (please check!)

Option to install the driver (please check!)

Security message: Click 'Install'

Security message: Click 'Install'

Driver installation completed

Driver installation completed




Step 3: Connect the adapter and wait

It is now the time to re-connect the adapter. At this point, if your system begins installing something, please let it finish. The appearance and exact text may vary depending on your Windows version. Here is an example:
Example installation feedback

Example installation feedback



You can check that the driver was installed correctly by looking at the Device Manager. The adapter should now appear under the "Atmel USB Devices" section, under the name "ATmega32U2". If on the other hand it appears in the "Other devices" section, it means the driver was not installed (did you check the installation option and did you allow the driver to get installed?) or installation is still in progress (as shown for instance by a popup+system tray icon).

Here are screenshots demonstrating how the device should and should not appear in the Device Manager:
<b>OK!</b> (Atmel USB Devices)

OK! (Atmel USB Devices)

<u>NOT</u> ok (Other Devices)

NOT ok (Other Devices)




Step 4: Attempt to recover the adapter

In the management tool, use the Recover adapter function from the Tools menu, select the adapter firmware .hex file, and click Start update.


Step 5: Did it work?

Use the File->Rescan adapters function, and the adapter should be present. If not, please try the manual command-line recovery described in the next section.

goto top Up


Manual recovery

If the instructions above did not solve the problem, try using the steps in this section.

Step 1: Driver check

As described in the previous section at step 3, the driver must be installed and working. Confirm that the device is properly listed in the "Atmel USB Devices" category in the Device manager as shown below. Refer to the above section for more details.

Driver OK

Driver OK

Driver <b>NOT OK</b>

Driver NOT OK




Step 2: Opening a terminal

A shortcut for opening a terminal in the adapter management tool's installation directory was created at installation. Use it to open a terminal:

Command-line tools shortcut

Command-line tools shortcut



This will open a terminal window in the correct working directory.

Terminal ready

Terminal ready



From this point, please take screenshots of the terminal window after running each command, even if you think there were no errors. If there is still a problem after performing the steps that follows, I will really need those screenshots to understand what went wrong.

Step 3: Erasing the adapter

Run the following commands, in this order, taking a screenshot after each command.
dfu-programmer atmega32u2 erase
dfu-programmer atmega32u2 erase --force

Step 4: Uploading the firmware

Copy the firmware file (in this example: gcn64usb-3.4.0.hex) to the adapter manager's installation directory (Typically, "Program Files (x86)\gcn64ctl"). If you place the file elsewhere (eg: On your desktop) you will have to write the full path on the command-line. Then run the following command:
dfu-programmer atmega32u2 flash gcn64usb-3.4.0.hex
Here is an example of successful programming:

Flashed ok

Flashed ok



Step 5: Disconnect the adapter

Once the flash command completes, disconnect the adapter and reconnect it. Start the adapter management tool to confirm the adapter is working. If it still does not work, please contact me (and include the screenshots).

goto top Up


Transfer Pak

The Transfer Pak can read and write to the cartridge save RAM, so you can back up your saves, or transfer them to emulators. The ROM may also be read and then played in an emulator...

Cartridge types

There are many different Gameboy cartridge types, and only a few are supported. Si far, the following types are implemented:

Transfering saves to an emulator

Save RAM data read using this tool is stored using the .sav file format which appears to be the standard. Start the game at least once in the emulator to create a blank save file. Then find out where your emulator stores its .sav files and overwrite the one matching the game when prompted to save the the data that was read to a file.

Here is an example using VisualBoyAdvance under Windows 10. The .sav file has is created in the same directory as the ROM (the .gb file) and has the same name:


Writing emulator saves to a cartridge

Writing an emulator save game to a physical cartridge is the opposite process of what was described above. Find where your emulator stored your latest save and select it for writing to the cartridge. Data will be written to RAM first and then read back for verification.

Careful!: Before writing anything to a cartridge containing precious save data, make a backup copy and test it in an emulator (who knows if it has been corrupted by a read error?). Whatever happens, regardless of if you made a backup or not, I am not responsible if for some reason your saves get erased.

goto top Up


Disclaimer

I cannot be held responsible for any damages that could occur to you or your equipment while following the procedures present on this page. Also, I GIVE ABSOLUTELY NO WARRANTY on the correctness and usability of the informations on this page. Please note, however, that the procedures above have worked in my case without any damages or problems.

Now you cannot say that I did not warn you :)

goto top Up


Trademarks used in this site are the property of their respectives owners.
Copyright © 2002-2017, Raphaël Assénat
Website coded withWebsite coded with vimLast update: April 7, 2017 (Friday)