Direct N64 controller access plugins for mupen64plus and Project64
What is it for?
Everything shown works!
plugins use the direct controller access feature
offered by my N64 to USB adapters (versions 3 and up)
to let the emulated game communicate with the controllers directly.
So, what does this do for you? Many things! Here are the key advantages:
- No calibration required. As the game talks to the controller directly, it
reads exactly the same axis values it would in a non-emulated setup. In other words,
the controller works, responds and feels exactly as it would in real life.
- Low latency. When the game must read the controller, the request is forwarded
directly to the controller by the adapter. The later immediately returns the controller's
answer to the game.
- Potential support for any expansion accessory without any intervention nor device-specific
functionality required on the part of the emulator, of the plugin or of the adapter (except for
the direct access feature), which means:
And just like with a real N64 system, you simply need to insert the accessory you
wish to use and the game will take care of everything else. No emulator configuration required
to switch accessory...
- Rumble pack support (tested)
- Memory pack support (tested)
- Transfer pack support (confirmed)
- Bio sensor support (tested)
- Support for peripherals other than controllers.
- N64 mouse (tested)
- VRU (confirmed, requires special ports1_4 version of the plugin)
- N64 Keyboard (not confirmed)
I cannot test accessories I do not own yet. But the nice thing about this plugin is that
it probably already works. Please contact me if you get the chance to test.
Warning: This project is experimental and still in development. While it is already usable,
some of the features above, especially the ones that are unconfirmed, may be found not to work at all.
There can (and will) be bugs, and there are still many missing features such
as multi adapter support.
Your help and patience in testing as well as your constructive feedback are welcomed.
Here are a few screenshots taken with a memory card present in the N64 controller. The Mario Kart 64
built-in mempak manager (hold the START
before running the emulator) is usable despite
a few visual glitches. Then once in the game, we can see ghost data exists (saved in a previous
session. The emulator had been restarted since). Later (and on a different machine, in this screenshot
on a Linux system) the data written by MK64 can be accessed with
the adapter management tool
MK64 built-in manager
For now at least, it is better not
to run the adapter manager and a game (with this plugin) at the same time.
Controller, Transfer and Tremor paks
tested the Transfer Pak
and a Tremor Pak Plus
(Third party Rumble Pak
equivalent) and reports it works fine. The games he tested with the Transfer Pak are Pokemon Statium
and Pokemon Statium 2, using Project 64 version 126.96.36.199 under Windows 10. He mentions however that the emulator crashes with a blank screen when he goes to the Gameboy Tower...
Here are a few screenshots of the Pokemon games:
Pokemon Stadium 2
Pokemon Stadium 2
Pokemon Stadium 2
MaMaLuigi9001 also confirmed the VRU works, but the ports1_4 version of the plugin where adapter port 2 acts as N64 port 4 is required. This version will be included in release 1.0.0.
How it works
Here is a diagram outlining the main differences between the usual architecture (input-sdl) and this plugin.
The normal event chain
is more or less the following: (written with mupen64plus in mind, but also applies to project64)
- The adapter polls the controller and stores the answer containing button and axis status data in RAM.
- The host PC polls the adapter over USB and receives the most recently read data.
- This newly received data makes its way through a few software layers including the HID driver, the DirectX (DirectInput) or
joystick driver and the SDL library. (The data is in fact stored in a buffer somewhere)
- When the game being emulated requests a controller status update, an answer is built using the most recent
data returned by the SDL library.
- The emulator does not need to wait. Relatively fresh data is always available immediately (the SDL library returns it without delay)
so the emulator only needs to reformat the data to make it look like what a real controller would answer.
- This approach works with almost all controllers and adapters usable through SDL.
- The exact axis value are often lost (calibration, dead-zone, assumptions on the exact axis range from the part of the emulator
that are not met by the adapter-driver stack, etc) and restoring the original feel can require a lot of subjective tweaking.
- The emulator needs to know what kind of pack to emulate (i.e. mempak or rumble a pack?). This means the user must
configure this depending on the game. While rumble packs can work mostly as intended (through HID PID) mempack emulation
is almost always virtual (i.e. file-backed).
The "direct access" event chain
is more or less the following:
- The emulated game requests a controller status update.
- The plugin forwards the request as-is to the adapter through USB.
- The adapter in turn forwards it to the actual controller (or other peripheral).
- The controller (or peripheral) answers the request.
- The adapter receives the answer and retransmits it through USB.
- The input plugin receives it and serves it unmodified to the game.
- The game actually communicates with the controller. Accessoires such as memory packs and rumble packs (and potentially
others) are therefore supported natively.
- The answer from the controller does not undergo any transformation. The axis values received by the game are
exactly what they would be on a non-emulated setup. No unknowns and no tweaking!
- Since the request has to do a round-trip to the controller, the action of reading the
controller status takes a bit more time. When there are a lot of exchanges (especially when writing
and reading mempacks) this can cause a temporary slow down of the emulator.
- Only possible on adapters offering a way to communicate with the controllers directly. (For me of course that's a pro)
The .zip files for Project 64 (see the download section) contains several raphnetraw DLLs. Here's a summary
of what those are and what they are for:
|Name||Filename||Purpose and description|
||The standard version. Supports up to 4 players through any combination of 1 and 2 player adapters.
||Special version supporting only one controller, regardless of how many ports your adapter has. Meant
for use with dual-controller adapters where there can be, depending on the game, a small performance penalty
caused by polling the second (unused or absent) controller.|
If you mostly play alone, you should use this version. When playing with friends, you should use the above (Standard)
|Ports 1 and 3
||Special build where the first two adapter ports are mapped to ports 1 and 3 on the emulated N64 console.
Intended to be used with Densha de GO! where the game expects a special controller in port 3.
|Ports 1 and 4
||Special build where the first two adapter ports are mapped to ports 1 and 4 on the emulated N64 console.
Intended to use with the VRU which must be connected to port 4.
||There are some (currently) unexplained compatiblity issues for netplay with Project64k. It does not work
unless a very old adapter firmware (v3.3.2) is used. A feature was introduced in firmware version 3.4.0 to
boost performance, and raphnetraw v0.9.4 make use of it, but when this feature is used, it breaks netplay...|
As a temporary solution, this version disables the use of the offending feature and hopefully fixes netplay.
Question: Which file do I need? What is the difference between the .zip and .tar.gz files?
Answer: The .zip files contain ready to use plugin files (.DLL) for Windows. The .tar.gz files
contain the source code. If using Linux, this is what you need.
RSS feed for this table
June 28, 2021 (Monday)
- Fix controller swapping for some games.
- Show a message box when attempting to configure the plugin. (contributed by CEnnis91)
pj64raphnetraw-1.0.7.tar.gz (21.6 KB)
pj64raphnetraw-1.0.7.zip (490.2 KB)
July 16, 2019 (Tuesday)
|Maintenance for mupen64plus only: (for project64, see previous releases)
- Update to input plugin API 2.1.0
mupen64plus-input-raphnetraw-1.1.0.tar.gz (30.6 KB)
mupen64plus-input-raphnetraw-windows-1.1.0.zip (262.6 KB)
October 6, 2018 (Saturday)
- Support for adapters running firmware version 3.6.x
pj64raphnetraw-1.0.6.tar.gz (21.3 KB)
pj64raphnetraw-1.0.6.zip (483.1 KB)
mupen64plus-input-raphnetraw-1.0.2.tar.gz (30.3 KB)
mupen64plus-input-raphnetraw-windows-1.0.2.zip (262.2 KB)
May 16, 2018 (Wednesday)
- Add protection against invalid commands (Fixes errors when using more than one controller pak)
- Disabled logging (slight increase in performance)
pj64raphnetraw-1.0.5.zip (483 KB)
pj64raphnetraw-1.0.5.tar.gz (21.3 KB)
November 22, 2017 (Wednesday)
|pj64 plugin version 1.0.4 and mupen64plus plugin version 1.0.1:
- Add support for the upcoming 3.5.x adapter firmware (2-player adapters won't work properly otherwise)
pj64raphnetraw-1.0.4.tar.gz (21 KB)
pj64raphnetraw-1.0.4.zip (204.6 KB)
mupen64plus-input-raphnetraw-1.0.1.tar.gz (30.2 KB)
mupen64plus-input-raphnetraw-windows-1.0.1.zip (161.9 KB)
April 16, 2017 (Sunday)
- Fix ports 1 and 3 special version
- Another attempt to fix netplay (version 1.0.2 did not work)
pj64raphnetraw-1.0.3.tar.gz (20.9 KB)
pj64raphnetraw-1.0.3.zip (204.6 KB)
April 10, 2017 (Monday)
|New special builds:
- Add a single-port version (improves dual-port adapter performance in some situations by not attempting to poll non-connected controllers)
- Add a netplay version.
(Single player only. Hopefully this one will work with the newest firmware)Update: Unfortunately, it did not.
pj64raphnetraw-1.0.2.tar.gz (20.7 KB)
pj64raphnetraw-1.0.2.zip (203.9 KB)
February 4, 2017 (Saturday)
|Add another special build where two-port adapters act as N64 ports 1 and 3. (This is in the hope that the Densha de GO! controller will then work.)
pj64raphnetraw-1.0.1.tar.gz (20.3 KB)
pj64raphnetraw-1.0.1.zip (139.2 KB)
January 15, 2017 (Sunday)
|New features and internal changes:
- Now supports multiple adapters simultaneously.
- Includes a special build for PJ64 where two-port adapters act as N64 ports 1 and 4 (For VRU use)
mupen64plus-input-raphnetraw-1.0.0.tar.gz (30.1 KB)
mupen64plus-input-raphnetraw-windows-1.0.0.zip (161.8 KB)
pj64raphnetraw-1.0.0.tar.gz (20.3 KB)
pj64raphnetraw-1.0.0.zip (106.6 KB)
December 3, 2016 (Saturday)
- Improved structure and separation for easier maintenance of the code shared between the Project 64 and mupen64plus versions of this plugin.
- Support for the upcoming 3.4.x adapter firmware (will provide even lower latency/overhead)
mupen64plus-input-raphnetraw-0.9.4.tar.gz (29.8 KB)
mupen64plus-input-raphnetraw-windows-0.9.4.zip (161 KB)
pj64raphnetraw-0.9.4.tar.gz (19.6 KB)
pj64raphnetraw-0.9.4.zip (72.8 KB)
November 26, 2016 (Saturday)
|Optimisation and bug fix:
- Only handle channels supported by the adapter. This increases performance (reduces lag) by preventing meaningless attempts to communicate with controllers connected to non-existing ports on the adapter. It also fixes issues where games would see more controllers than actually present (on single-player adapters).
mupen64plus-input-raphnetraw-0.9.3.tar.gz (26.8 KB)
mupen64plus-input-raphnetraw-windows-0.9.3.zip (158.4 KB)
pj64raphnetraw-0.9.3.tar.gz (16.1 KB)
pj64raphnetraw-0.9.3.zip (71.6 KB)
November 24, 2016 (Thursday)
- Protect against invalid commands received from emulator. This fixes some games that failed to start. (The issue was present in PJ64 and mupen64plus)
mupen64plus-input-raphnetraw-0.9.2.tar.gz (26.3 KB)
mupen64plus-input-raphnetraw-windows-0.9.2.zip (155.7 KB)
pj64raphnetraw-0.9.2.tar.gz (15.9 KB)
pj64raphnetraw-0.9.2.zip (69.4 KB)
November 23, 2016 (Wednesday)
|Changes specific to the Project64 version:
Changes common to both plugins:
- Changed the plugin specification version (Now using v1.0 instead of v1.1) in order to be usable with old Project 64 releases (v1.4 - v1.6).
- Controller polling is now disabled only while a ROM is open. (In the previous version, after using the plugin, to use the adapter normally (eg: Through DirectInput) one had to disconnect and reconnect it.
mupen64plus-input-raphnetraw-0.9.1.tar.gz (25.8 KB)
mupen64plus-input-raphnetraw-windows-0.9.1.zip (155.6 KB)
pj64raphnetraw-0.9.1.tar.gz (15.2 KB)
pj64raphnetraw-0.9.1.zip (69.3 KB)
November 22, 2016 (Tuesday)
|First release for project64
pj64raphnetraw-0.9.tar.gz (13.8 KB)
pj64raphnetraw-0.9.zip (69.3 KB)
November 20, 2016 (Sunday)
|First release version (mupen64plus)
mupen64plus-input-raphnetraw-0.9.tar.gz (25.7 KB)
mupen64plus-input-raphnetraw-windows-0.9.zip (155.4 KB)
Usage (Project64 under Windows)
To install and use the PJ64 plugin, there are two files to place at specific locations.
Copy the following file to "your PJ64 installation directory"/Plugin/Input:
(for older PJ64 versions (such as v1.4), place the file directly in the Plugin directory as there are no subdirectories per plugin type).
You must also copy the following file to your PJ64 installation base directory (i.e. The directory where the .EXE is):
Then in the settings dialog, select "raphnetraw for Project64 version xx.xx" in the Input plugin list.
Installing the plugin (pj64raphnetraw.dll)
Installing the support file (libhidapi-0.dll)
Input plugin selection (PJ64 v2.3)
The current version of the plugin will create a log file named raphnetraw.log
Usage (1964 under Windows)
Only the "net" version (see Special versions
) of this plugin is compatible with 1964. This
is due to a performance hack that only works with Project64. (This hack was also found to break net play).
Installation for use with 1964 is as follows:
- Copy the raphnetraw_net.dll file to the plugin/ directory in the 1964 folder.
- Copy the libhidapi-0.dll file to the 1964 directory (not the plugin directory)
- Select the raphnetraw plugin from the list in the Change Plugins dialog.
raphnetraw_net.dll in plugin/
libhidapi-0.dll in the 1964 folder
Usage (mupen64plus under Windows)
The .zip version of the plugin available from the downloads section above contains the 32 and 64 bit
versions of the plugin files. The .zip contents will look like this:
If you use a 64-bit version of mupen64plus, copy the files from the dist_win64
the 32-bit version, copy the files from the dist_win32
Copy the appropriate plugin (.dll files) to the directory your mupen64plus installation uses for plugins (eg: Along
with the main executable and other plugin .DLL files). Then run the emulator like this:
$ mupen64plus --input mupen64plus-input-raphnetraw
(of course you will add other arguments such as the rom file...)
Usage (mupen64plus under Linux)
Copy the plugin (.so file) to the directory your mupen64plus installation uses for plugins. Then
run the emulator like this:
$ mupen64plus --input mupen64plus-input-raphnetraw
(of course you will add other arguments such as the rom file...)
Confirming that it works (mupen64plus)
If you are not sure if you were able to enable, have a look to the emulator output:
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 :)