dustinsoftware has released software that lets you connect any input device to your N64 using just an Arduino and a computer, here is a quote from the source:
How This Works
The program uploaded to the Arduino simulates a controller by responding to the N64’s queries. The C# program interprits your gamepad’s state and turns it into 4 bytes (2 for button state, 2 for analog stick state), which it sends over the serial port when the Arduino asks for it. Those 4 bytes are then sent to the N64 when it queries the Arduino for controller state.