• Welcome to Smashboards, the world's largest Super Smash Brothers community! Over 250,000 Smash Bros. fans from around the world have come to discuss these great games in over 19 million posts!

    You are currently viewing our boards as a visitor. Click here to sign up right now and start on your path in the Smash community!

Keyboard to N64 Adapter

cmu6eh

Banned via Warnings
Joined
Apr 29, 2012
Messages
356
Location
Parterre
2012-03-08 UPDATE: http://youtu.be/MLJPZqsHKDU
Working:
NRage input plugin:​
Keyboard works 100%.​
N64 controller with Raphnet adapter: buttons work fine, XY values are garbage.​
Lag is less than 3 frames. I think its between 0 and 2, but I'd need an expert to tell me.​

Not working:
Like every other input plugin :p
Missing some controller state responses. (Doesn't noticeably affect gameplay so far)​
My smash keyboard skills.​
TODO:
Communicate button states via ethernet.​
Fix missed controller state issue.​
Test other input such as Xbox controllers.​
Add support for other input plugins.​
Once this is all working to my satisfaction I'll give you guys source code and instructions on how to set this up.
 

cmu6eh

Banned via Warnings
Joined
Apr 29, 2012
Messages
356
Location
Parterre
2nd post reserved

Other goals:

Make my program a TCP client, and make the Arduino itself a TCP server, so we can get anyone with an internet connection to be able to play on a console from anywhere (The video of the game would have to be streamed to them somehow)
 

KoRoBeNiKi

Smash Hero
Writing Team
Joined
Apr 26, 2007
Messages
5,959
Location
Brooklyn, NY
Slippi.gg
KORO#668
Why would people mind if there is input delay?
Keyboard play is fake smash anyway. Might as well represent it :denzel:
 

LLDL

Smash Hero
Joined
Apr 27, 2007
Messages
7,128
I just bought some Arduino micro-controllers (overnight shipping) and I am going to make an interface for a physical N64 as soon as I can. My goal is to write a program on my laptop that pretends to be an emulator, and sends controller input signals to the N64 through the Arduino. I want to do this before the tournament at yestercades.

TDLR: You will be able to use your favorite emulator input plugin as input to a real console. This means you can play Smash on a console with a keyboard, xbox controller, ps controller, etc.

I don't know how much lag the Arduino will introduce.
That would be sick if you could do it before the tournament. Tell me how it goes man.
 

cmu6eh

Banned via Warnings
Joined
Apr 29, 2012
Messages
356
Location
Parterre
Arduino! let me know if you run into any coding issues or need general help. Can I ask what model you are using?
I got a Arduino Leonardo with Headers and a Arduino Uno - R3. My co-worker does a lot of micro-controller stuff so he should be able to help me out with the soldering and ****.

Right now I am pouring through the PJ64 v 1.6 source, I couldn't find any specs on how the input dll's are supposed to interact with the emulator, so i'm just going to debug the **** out of it till I figure it all out.
 

KnitePhox

Smash Lord
Joined
Oct 17, 2005
Messages
1,838
Location
Chicago, IL
nice man, hopefully it turns out well for you

i was going to make a keyboard controller, which is different (easier) but if you do this with adequate success i won't be interested anymore

coooooooool
 

The Star King

Smash Hero
Joined
Nov 6, 2007
Messages
9,681
SK for Apex 2014 confirmed
I probably wouldn't use it in console tournament anyways, just on principle. Though I might use it in like friendlies or MMs if people want/request that challenge (if the delay isn't too bad).
 

madrush21

Smash Journeyman
Joined
Apr 29, 2010
Messages
315
Location
Colorado Springs
I got a Arduino Leonardo with Headers and a Arduino Uno - R3. My co-worker does a lot of micro-controller stuff so he should be able to help me out with the soldering and ****.

Right now I am pouring through the PJ64 v 1.6 source, I couldn't find any specs on how the input dll's are supposed to interact with the emulator, so i'm just going to debug the **** out of it till I figure it all out.
Alright sweet R3's are coooool, I've worked alot with them and the mega. <3 microcontrollers
 

cmu6eh

Banned via Warnings
Joined
Apr 29, 2012
Messages
356
Location
Parterre
Who is Rafael?

OK so I took the c code out of pj64 that communicates with the input dll's and I threw it into a managed c++ class, so that half of the coding is done.

At first I was going to use this guy's approach, which is hooking up a wire to each button on the controller itself: http://www.youtube.com/watch?annota...&feature=iv&src_vid=-V78AAs1yDw&v=OsnbYaCGwHk

But just now with some quick googling I found this: http://www.instructables.com/id/Use-an-Arduino-with-an-N64-controller/
I think it may be better to just do the same thing in reverse, ie, cut the wire on the controller and hook the 3 wires into my arduino and make the arduino do the logic the N64 controller would do to send out the correct signal on the wires. I am leaving right now to drive an hour to play smash all day, so if someone wants to look into this for me before I get back tonight it would be greatly appreciated. He has the code on the second page to convert signals from the controller, so you should be able to just use that in reverse.
 

madrush21

Smash Journeyman
Joined
Apr 29, 2010
Messages
315
Location
Colorado Springs
So my idea would be to write a get keyboard command function and then the arduino would output the corresponding signal that a normal 64 controller would output.
Raph has some examples of output on this page if you scroll down a little bit http://www.raphnet.net/electronique/gc_n64_usb/index_en.php

I know there is getkeyboard command functions already written but those take the input from a keyboard that is plugged into a computer with an arduino plugged into a separate port on the same computer but I think it wouldn't be that hard to wire a keyboard to an Uno.
The guy on instructables is using processing which requires a computer for the adapter to work.

Right now I'm working on an arduino based thermal camera but I'm going to make this a side project.

I'm gonna get into the lab on monday and do some sampling on an oscilloscope and see if I can replicate the output with an arduino as an intermediate step.
 

cmu6eh

Banned via Warnings
Joined
Apr 29, 2012
Messages
356
Location
Parterre
Ignore getkeyboard commands. I'll do something like this: http://blog.oscarliang.net/control-arduino-through-serial-connection-usb-vb-visual-basic-program/ i.e., controlling the arduino through usb with my own code on my laptop. That way people can use whatever input they want since I already have a program that reads the controller states of pj64 input plugins. I need the Arduino code (http://arduino.cc/en/main/software) for each "button" that would make it send the same signals out on the wires that a n64 controler does.

I am going to start that tonight, but i cant test it since I dont have an osclioscope and i dont get my arduino till monday.
 

cmu6eh

Banned via Warnings
Joined
Apr 29, 2012
Messages
356
Location
Parterre
http://code.google.com/p/micro-64-controller/wiki/Protocol


So the N64 sends requests
1.) 0x00
Arduino responds 0x05 0x00 0x02
2.) 0x01
Arduino responds with 0x???? which is the controller state.
3.) Whatever, other stuff is for reading and writing from mem packs and rumble packs


All I need is the logic for converting the electrical signals to bytes and vice-versa.
 

madrush21

Smash Journeyman
Joined
Apr 29, 2010
Messages
315
Location
Colorado Springs
Ok, I have oscilloscopes available. On Monday I can get into a lab and see exactly what controller outputs. Anything specific you would like me to test?
 

cmu6eh

Banned via Warnings
Joined
Apr 29, 2012
Messages
356
Location
Parterre
Looks like this might be finished sooner that I expected. I might have time to add some Macros for the ergonomically positioned hori pad D-pad.

Hori pad -> Laptop [via raphnet] -> Emulator plugin -> My wrapper program + macros -> Arduino -> N64
Crossing fingers for less than 16ms delay for the whole process.

The real question is what macros do i use?
D-Down = ( Z+down -> up+A) for fast fall up airs and platform drop up airs
D-Up = Auto Shine cancel,
D-Left = ness DJC
D-right = yoshi DJC
 

clubbadubba

Smash Master
Joined
Apr 27, 2011
Messages
4,086
All the macros. The more macros added, the easier this will be to ban in a tourney :)
 

LLDL

Smash Hero
Joined
Apr 27, 2007
Messages
7,128
yeah controller configuration presets are fine but I ban macros lol.
 

kys

Smash Ace
Joined
Aug 17, 2009
Messages
660
Location
World Traveler
This is an abomination.

I hate this new layout to the point it makes me not want to come here/post here, but this was too much. You might as well piss in holy water while you're adding the finishing touches.
 

Nintendude

Smash Hero
Joined
Feb 23, 2006
Messages
5,024
Location
San Francisco
macros opens up a big can of worms. If you can program the uair stuff that's normally not really possible on keyboard you can program perfect shines, Mario tornados, etc.
 

King Omega

Smash Journeyman
Joined
Apr 15, 2009
Messages
388
I think macros are fine for "single" things. For example, a short hop macro is okay, or a macro that lets you uair with a stick range reduction so you don't jump. But anything where you're mapping multiple inputs to a single button is iffy and I wouldn't allow it in my tournament.

DI is whole other can of worms.
 

clubbadubba

Smash Master
Joined
Apr 27, 2011
Messages
4,086
Yea please make a macro for short hop. Would make things so much easier (to ban)
 

King Omega

Smash Journeyman
Joined
Apr 15, 2009
Messages
388
Pfft, that's not bannable. If you're theoretically going to allow modifier-less keyboards in, despite the ridiculous DI, then no one will consider a short hop macro the straw that breaks the camel's back.

Shine, DJC, **** like that, that's bannable.
 

clubbadubba

Smash Master
Joined
Apr 27, 2011
Messages
4,086
short hop will get banned in a second. The reason keyboard DI is so ridiculously is because mashing a button is faster than mashing/sliding a stick. A short hop macro would actually be giving keyboard players more buttons than controller players, easily banned. Not to mention you can already short hop on keyboard...
 

King Omega

Smash Journeyman
Joined
Apr 15, 2009
Messages
388
Keyboard DI is as good or better than the best human QC DI, and all you have to do is hammer a single button instead of ****ing the control stick. It's not just faster, it's simplified as hell.

I don't really get the "more buttons" thing so long as the button is analogous to a single input on a controller, but then again, I don't run tourneys.
 

clubbadubba

Smash Master
Joined
Apr 27, 2011
Messages
4,086
But you don't have to **** the stick. You could just mash the stick, which some really good players do to great effect. You could also do slide DI on keyboard, but it would be less comfortable. Keyboard and controller both have smash and slide DI, but controllers tend to slide, and keyboards tend to mash. It really is just faster on keyboard, not simplified.

Don't get me wrong, I think kb's should be banned just because of DI alone. But adding ANY sort of macro that acts as a shortcut or simplification outside of the usual mechanics of the controller is a clear step further and should be a no brainer to ban. Take short hops, for example. Even good players will occasionally do a full hop instead of a short hop, but if you have a button just for short hopping, now keyboard players will never miss a short hop. Unfair advantage right there.

^^Chain-ace my man lol
 

KoRoBeNiKi

Smash Hero
Writing Team
Joined
Apr 26, 2007
Messages
5,959
Location
Brooklyn, NY
Slippi.gg
KORO#668
I will ban a short hop macro in a second
i would also, remove any and all macros. Just design a kb with the same buttons as a regular controller and that is all.

Also, what balln said outside outside of kb DI being broken. It isn't that broken. Not to mention that we can't walk or use the proper recoveries for Pikachu or Faux.
 

King Omega

Smash Journeyman
Joined
Apr 15, 2009
Messages
388
I'm pretty sure slide/QC is outright the best way to SDI, because it's just impossible to mash the stick fast enough to get all the inputs that slide gives you. Other than that, yeah, I see what you're seeing.
 
Top Bottom