How I added a USB port to the Nintendo 64 (Because I didn't want to buy the mouse)
HTML-код
- Опубликовано: 22 июл 2023
- I created a device that lets the N64 work as a USB host. So far it only supports a boot mouse but more functionality could be added in the future with only software changes.
Source code for the project is here
github.com/lambertjamesd/n64-usb Наука
Your work inspired me to pursue electrical engineering! Great to see what hobbyists can do with a little bit of knowledge and the right tools!
His work inspires me. Period. 😅
Me too! Then a few semesters in I realized it wasn't for me and switched to comp sci instead lol.
@@bowi1332no period lol
@@bowi1332 Me too full stop.
You might want to investigate an Adruino Teensy. I've used one to make an adapter for an old metal DDR pad I own. The Teensy is specifically intended to be a HID (human interface device) which makes it able to emulate keyboards, mice, game controllers, midi, etc. pretty easily with the right libraries.
That definitely sounds like something I may check out. Can it operate as the USB host? If not it wouldn't be useful for this project but I would love to find a good chip that has a built in USB host.
@@james.lambert yes, it can host; it has 4 pins on the top that a host adapter cable can be attached to. I recommend getting a teensy with the headers already attached. It saves a tonne of time being able to plug it straight into a breadboard.
@@james.lambert The Pico can do USB host. Overall it'll be cheaper than any Arduino offering.
@@DoctorDalekPi Pico can also do timing sensitive stuff with interfaces.
@@james.lambertThe later Teensy models can even have two or three (with gpio routing) usb ports. One host and two client ports are possible - using this to create a hardware alternative to software audio routing.
Saving money on peripherals? Sounds good to me!
Somebody call the Nintendo lawyers! Miyamoto won’t be happy about this!
@@jackatk 🤓☝️
@@Trollzz_YT
Correct
@@jackatkit’s really funny that anyone can immediately refute this by saying “Nintendo isn’t selling peripherals anymore, the money wouldn’t go to them” but people who really know what’s going on know that Nintendo hates their fans and would still get mad for no reason.
Lol, just the oscilloscope he purchase is around $275, a good $100 more expensive than just buying the mouse. He didn't save money.
This is really cool! You mentioned it's not sensitive enough, maybe you could add a little potentiometer for a dial sticking out that lets you adjust the sensitivity.
Oh nice, this is an awesome project!
As a tip for anyone else interested in this sort of electronic signal analysis - If you're not dealing with analogue signals at all, then you can get by without needing to spend a lot of money on a fancy oscilloscope. You can get a basic logic analyser for ~£12.50 which will let you capture a signal and analyse the logic. I originally got mine when I was debugging an Arduino based N64 controller adapter, and it worked a treat to be able to see what both the console and the controller were doing.
This is huge, mouse & keyboard support for the n64 would be a dream come true.
hope you continue working on this project.
Screw keyboard, just add the mouse support.
I love your easy to understand explanations as to what is happening rather than glossing over it. Even as someone who just likes to mess around with electronics I find your videos to be a joy to watch.
Wow, good stuff!
A couple of thoughts:
(1) The mouse sensitivity can hopefully be addressed by adding a line or two of code to multiply mouse inputs by n.n. 1.0 would then be raw input, and something like 1.5 would give more movement and something like 0.5 would give less movement.
(2) The audio in your video is really quiet compared to a lot of other RUclips content I watch. I think you'd benefit from running your audio through a dynamic range compressor and increasing the gain before uploading. For reference, I watched this video by downloading it to my PC and then running the audio through FFMPEG with the filter "loudnorm, compand=0|0:1|1:-90/-900|-70/-70|-30/-9|0/-3:6:0:0:0, loudnorm". In plain English, that's, "boost the volume to a reference level, run some aggressive dynamic range compression, and then pull the output up/down to that reference level again to be sure". This let me comfortably hear everything at my normal Windows volume of 20 whereas I would otherwise need to turn you waaay up to 40.
I used to run all my desktop audio through a dynamic range compressor, but it made music sound really bad. I've switched to automatic gain control with a limiter.
I'd ignore the suggestion for the audio stuff; he likely got a different microphone compared to his last vlog a couple months ago. Just test the input before recording using an audio visualizer and use an equalizer to keep the quiet intended input balanced with the higher.
I've been learning circuit design and arduino stuff lately and your explanation of the double pull-down really helped me understand the concept.
The beginning of this video was so quiet I thought my audio setup was broken, and the rest of the video is still rather quiet. Anyway, nice work!
the beginning of the video is quiet because of a copyrighted song I had to remove after uploading.
Normally I use audio at like 30% volume, but I had to use more like 90% to hear anything in the video
I love these videos =3 please make more, they're REALLY really interesting, it's like seeing bits and pieces of my childhood being explained how they did certain things.
I'm always inspired by your passion in your projects my friend this is all brilliant :)
every last video of yours is a certified banger, software homebrew, hardware mods, what CAN'T you do? keep it up!
I'm loving how your style of editing is developing! Thanks for sharing a great project and video.
Another banger as per usual! And very informal/easy to follow. Would love to see keyboard support as well, or at least support for a usb numpad so you could use the arrow keys for movement as that's all that really matters. Or native support in Portal 64 to use the second controller port just to use the dpad for movement instead. Can't wait to see more!
This is awesome! And thanks for sharing your R&D with everyone who might be interested in getting this setup for themselves!
Think i heard a child half way through the the video, if so even more kudos for working on these projects!
I have a two year old and struggle to find the time/motivation to work on my projects. If you have a young child and still managing to build these awesome things thats very impressive.
Buying an oscilloscope is a great move, digital doubly so, but i'm gonna echo the person that suggested getting a logic analyzer. They start around $20 and are complementary to an oscilloscope. Salaea Logic is a great free analyzer tool, and it even has a plugin for N64 controller logic analysis!
I just love the stuff you do period. You're amazing. Am a developer myself, but if I was to do such project, it would just end up in a hardware mess and stall right there.
I think my closest project I get to "something that's easy to fix and really bothers me" is a script that allows you to double-click a rom and open it in the appropriate RetroArch core, but that's also a really simple one.
Keep it up!
Your videos are awesome. I hope you keep making them long after you're done with Portal 64!
Ah! Your tip about disabling the timer interrupt was exactly what solved my issue! I just finished a synthesizer module that reads a N64 controller and sends out an analog voltage. Only thing was the data was a bit glitchy. It makes perfect sense now though that the microcontroller was in an interrupt while a falling or rising signal came that it missed. Fixed everything by disabling global interrupts during the data sampling! Thanks again and great project!
Amazing work! I never thought something like this was possible, that's bonkers.
just gotta say, I loved your inline asm noop for a short delay, did the same thing when I was writing addressable-RGB firmware in Rust. The dramatic music was amazing
Urgh even N64 isnt safe from the KBM hackers on console. /s
I am a big fan of the N64 so your channel is very fun to watch!
You're the first person I've ever heard to say "ar-du-i-no," most people I know say "ar-dwi-no." Though, I'm not saying you're wrong. This is a brilliant project and I love using Arduinos and other similar devices to emulate hardware for consoles and the like.
Maybe I should start calling it ardu-eye-no
another amazing video btw, your channel is such a gem. great work! sc with a mouse and keyboard would be super fun to see
Cool project. Always great to see people working with old gaming consoles like this.
On a technical/video production note: I would suggest using something to capture your PC screen rather than just jamming your camera into the screen. You could still crop/zoom to show relevant areas, and it would be much more readable.
"I changed nothing(or nothing that should matter) but it works now." Debugging in a nutshell.
Your channel is super inspirational.
Nice work, awesome! :} I was in Japan last month and wanted to get some nice N64 mouses for Portal64, but I did not find even one, despite visiting like 20 retro shops... So I guess there is a reason why it is so expensive nowadays... :( But now I can build it by myself, thanks!
I love that this is not destructive at all to the N64. gives you all the mouse, and a pristine, stock N64, truly lovely :-)
Including debugging and explanation is great! I'll try to remember the interrupt issue, it might be usefull.
That is a criminally small mousepad.
This project will be brilliant for retro enthusiasts!
laughed out loud on 9:55
New Sub! Dryden, MI
Excellent Job! Uh, I didn't have/play n64... Couldn't Afford it, & the Thumbstick Looked Weird. The Wii Implementation made it all Clear. Now I want to make some fashion to Attach 4 controllers to a USB for Emulators... I've never done PIC Style or any programming, but this looks sweet
STAGE CLEAR! 🌟 that's all I remember from the Toys 'R Us Demo lol
I'm glad to see you printed it in orange, as is legally required for Prusa printers
oh this is neat! I've only just gotten into arduino/stm32 tinkering recently and bitbanging "low complexity" peripherals (meaning moreso the N64 gamepad communication protocol than the USB) is intensely gratifying :)
What a fascinating project! I would absolutely pay for a Keyboard/Mouse adapter for the N64. 100%. Also, anyone ever tell you you look a LOT like a young Mark Hamill? 😁
enjoyed the video, would love if you had some bonus content for subscribers for how you built the circuit board
The epic music for the little bits of coding killed me.
those parts where you cut to you coding with overly dramatic music were really funny lmao
Love the way you engineer things, my dude - your projects are inspiring af!
This makes me wonder if it'd be possible to use a USB Mic with this and write a voice to text ROM, like a more accurate VRU, so homebrew devs could make games with it that actually use it in cool ways - because we all prefer to forget Hey You Pikachu
thats really cool james!
cheers for the github, i'm going to build this and the psx version aswell sometime .
Wow I’m glad you didn’t want mine haha because this is ten times better!! Offer still stands but I love seeing this😀 keep up the great work. Now that I’m moved in and can start unpacking I can’t wait to try this out! Do you think you want to tackle the keyboard next? 😂
Your videos are very inspiring to me
That code debugging with epic music was too funny 😂
Love the dramatic code edits 😂
For any one that wants to try this, a more simple solution is using a ps/2 mouse since it can be read by any arduino without any extra hardware and there are already made libraries for them that simplify the process.
Also laptops touchpads are almost always a ps/2 device, it's even posible to read the amount of pressure applied to them!
Glad to see a fellow ThinkPad + Linux user
Your channel is really underrated.
Keep living the dream James.
Awesome project. Had you considered using the RP2040 as the micro instead of the Arduino? The RP2040 is capable of doing USB Host with its PIO, which is supported by TinyUSB so it supports HID mouse input. The RP2040 is also ridiculously cheap and even supports MicroPython.
And supports arduino ide instalation so if he is familiar with that he can use if
Your audio volume was low, so I turned up my earbuds. When an ad played, I leaped off the floor about a foot (may be slight exaggeration) while I was cooking dinner.
theoretically,considering you've got all the primary interfacing issues put of the way, it shouldn't be too hard to program this to control any arbitrary usb device to work with the N64 with just a relatively little amount of reprogrammimg (p much kust buttons and inputs, since you've got all the hard stuff covered!!)
nice job!!
Holy moly, this reminds me of the old Mac plus keyboard that I didn't want to buy the adapter for, so I built my own. Only to find out afterward that somebody had already done it lol
a protocol analyzer (or a logic analyzer) can be extremely useful for debugging lines that carry binary data. you can configure the protocol analyzer with how long each bit should be and it will do the work for you and instead of showing the trace, it can show you the bits. some of the really fancy protocol analyzers can take it even further and have common protocols built in like RS-232 or RS-422 and will show you data relevant to that protocol (or if there is some protocol error). they aren't too expensive these days either because you can get computer controlled ones that connect to your PC over USB
So, this gives me an idea of how to make something I've been thinking about: An Arduino that emulates an N64 controller or multiple controllers which then can be controlled via local network or remotely. Essentially what that would do is give the ability to do networked multiplayer using the original hardware. Programming a server and client then compensating for the lag would probably be the hard part though.
Even if it's more expensive at first, this sort of thing is definitely good in the long run since there are a finite amount of n64 mice but an approximately infinite amount of generic usb mice.
This is brilliant!
you know, I see one potential application for a gadget like that. since the hot and ground wires are common to all 4 controllers anyway, and only the shared signal wires are unique, it would be possible to have that device emulate more than one controller at once, particularly with a faster chip doing the emulation.
Which would be fun to pair with a virtual joystick applicaiton, stream a not-too-timing-critical multiplayer game and let your friends control player 2-4 on *actual hardware*.
Wish my coding felt like that lol. Fun video, thanks dude 🙂
This is so nice to see. The mouse was already expensive, but at least comes with each copy of the game. Meanwhile the N64 keyboard is like $1,000-$1,500!!!
If I have the possibility one day to have my own company, I want you to be my project's director and do this all day !
14:20 is such a mood lol
Well that is just amazing.
Oh my god that is great. We need one for dreamcast. The dreamcast only recognises the official mouse and maybe old ps/2 mouses with special adapters that are expensive
Great work ❤
Just about time to get Irix running on the N64, so we can get that 3d file browser.
I like this I wonder if you could use the extra mouse buttons like the scroll functions or the other buttons that some have?
Nice work
Laser trackball from Logitech and pair, (with ltunify in linux,) a keyboard to the same receiver dongle. Once paired they stay paired. They can also handle up to 6 devices on one receiver. Saves space, power, and wrists. No noticeable lag or issues with keys responding. I've got 3 paired sets
It would be really cool if you add 2 buttons to the case for increasing or decreasing the mouse sensibility (I gess that it would be as simple as multiplying the input values for the X and Y coordinates by a variable that stores the sensibility managed by these 2 buttons).
randnet is back babyyyyyy
A built in multiplier for sensitivity would be nice. You could add a simple button to the arduino to change the "DPI" of the mouse.
Simple idea to some. But you went beyond. TRUE GAMER! LOVE !
This is so extremely cool! Imagine getting to play all those FPS games with a modern keyboard and mouse on real hardware😵
Maybe Blueretro could implement support for KB&M at some point. Though something with a USB input port would probably have a better chance at working with my KVM switch
I hope you continue work on this! Not sure how much those parts cost, but maybe some cheaper alternatives exist?🤔
Anywas, I’m just overly excited and day-dreaming😂
Great work on both the project and on the video!👏🏻
while it sounds cool to play those games with a keyboard and mouse, those games would NEED to be changed to accommodate the new control scheme. I've played emulated perfect dark on a keyboard and mouse and it wasn't pretty.
@@darbling You might wanna check out some tutorials. Because 1964 GE/PD edition works perfect (at least with GE, can’t see why PD should be any different).
As long as you can edit sensitivity in-game or adjust settings on the adapter, I believe it should be doable even or real hardware.
@@AdrianDX in the case of PD, the controls are really wack in general and the way it feels is rough when played on kb/m. I'm just gonna say try it haha. I can't remember off the top of my head what the problems were.
You know what, I'll try it again and I'll get back to you.
@@darbling I’ll give it a go as well! Got me curious here😂 I hear the PC port based off the decomp for PD is really good with KB/M though.
I have no idea what the PC port project name is though😅
Wow this is so cool, imagine playing Goldeneye/Doom64/Quake with a mouse !
This is really cool and similar to something I once made. I used an arduino micro to interpret bytes to send mouse and keyboard data for a kvm device thing. I think the likely reason the program didn't work when you tried running it post debugging (Timestamp: 14:06) is because it wasn't connected to the serial monitor in the arduino IDE.
If you tell it to connect to the serial monitor and it can't, it throws a pissy fit, so as long as you disable the serial debugger lines for that, it should work without needing to connect to the Serial Monitor. (I could very well be wrong, but idk just a thought)
Overall though, really cool video
Could be. It started working later even without being connected to the monitor.
@@james.lambertodd, I just wanted to state this because it was an issue I had on my project which caused a ton of latency lol
This is sick
Maybe a sensitivity slider of some sort would help with stuff like Mario Paint 64 since you can't change how sensitive it is on the game's end. Also kinda wish I saw you try it with Goldeneye or Perfect Dark. Still awesome project either way.
Holy heck. Now THATS epic.
Hmm, you could also have used an esp32s3. It has usb host and tanakamasayuki made a library for it.
You could even add bluetooth to it if you really wanted to!
Been there. Did a similar thing some years back, with an Arduino, PS/2 mouse, and SNES. It kinda worked in general, but it was a bit glitchy, and it was very difficult to figure out just by the gueswork, without having a scope. Eventually got a scope, but never returned to this project.
... well, this should excite Uncle Derek over at Stop Skeletons From Fighting...
Have you tried multiplying the mouse's input values by 1.2 or 1.3 to see if it is more sensitive? If that works, you could potentially include a pot on one of the analog pins on the Arduino and use that to change sensitivity.
Would not work. That would just cause more jitter.
I made an adapter for Dual Shock to N64 using an UNO. There were libraries, but I do remember having to hack around them a bit. It was pretty cool to play GoldenEye with, but the aim was a bit jittery. I no longer have an N64 to mess with it.
This is super cool
Hey, would it be possible to do the same for the dreamcast keyboard/mouse? It would really be quite impressive if you could combine them into one.
You are a boss. Im sorry for late sub. Thats my bad. The algorithm kept you away. .
Is it possible to get the USB64 debugging ROM please? If it's been uploaded elsewhere I haven't found it and it looks really useful!
To get a full controller working on the mouse try the UtechSmart Venus Pro, its around $30 USD and has a num pad on the side so all you would have to do is program whatever numpad like on a keyboard to the button of your choice. Again as someone that has the mouse the computer see 0-9 as if you had an external Numpad attached to the PC
It would be cool if it supported controller passthrough. That way you can use the mouse for joystick inputs, and the gamepad for normal N64 inputs while still being the "same" controller to the console
Maybe have a mouse sensitivity variable on the arduino. If I understand it correctly, you could just multiply the input Vector by that value to correct for the mouse having a low DPI...
Really interesting
How much was the final theoretical cost of the arduino, cord end that plugs into the N64, and the 3D print materials? Since you open sourced it, I'm curious how much it would cost to build.
And on a related note... Is the N64 pigtail connector sourced from a controller or a new part? lol...Speaking of not harming old hardware!
A business laptop, and a workstation model at that! I considered a workstation laptop, but got tired of looking for the right one and got a T series.
Lol. I did the same thing but for the Sega master system. They have a spinner controller in Japan and I thought it was too expensive to bother purchasing and I saw that someone had created a board that will mow you to me on spinner controller. So I designed a 3-D housing that was almost identical to the Sega master system controllers, the cost of testing, the prince and the sizing before having a printed far outweigh the cost of just buying the stupid controller in the first place. But I’ve got a video in my channel that showcases the final prototype.
The sensitivity might be negotiable with the mouse. I have fiddled with PS/2 mouse and I remember that even that protocol had commands to set DPI, though I never tried it myself. Perhaps the mouse HID protocol over USB has the same thing?
that would be awesome to see StarCraft with mouse and keyboard on N64