How Game Controllers Work
Well, this video should have been done a week ago. It's been almost done for a while but crazy things kept happening to keep me from finishing the last 10% or so of the video. Everything from taking my mom to the DMV to get her license renewed and ended up sitting there 5 and a half hours one day, a family member having a baby, my wife having laser eye surgery, and top it off that Planet X3 is in the final stages of beta-testing. So I've spent a huge amount of time fixing bugs that were reported and getting all of the manufacturing lined up this last week or so. More news on that soon.... For the moment, I hope you find this interesting! I need to finish the subtitles and thumbnail, so it will be later this evening or tomorrow before it goes live.
Comments (21)
Nice
Glad to be a new supporter, keep up the great job David! I completely understand about the balancing between family and work; at least you are working from home now, and you are now the boss. I am fairly new to the hobby of retro computing, and retro consoles; I have found your videos informative and encouraging. Germany, way cool! I spent 9 years in Europe, 7 while on active duty and 2 in college. What a blast that all was! Have fun! Anyway, blessings to you and your family. Happy Holidays,
N64 and old PS2 controllers are nice too. Ever want something easy to read in a microcontroller with sensitive analog controls, they are great without using a bunch of pins. You should try out the Genesis controllers. They are "technically" backward compatible with the atari controllers. They do this by having a "select input that drives high when you want to read the other buttons. The 6 button controller works similar to the NES. Because of this you can plug the genes 3 button controller into anything that takes that 9 pin slot and it works:)
I learned something new today. :-)
Oh memories... I can still remember time when I soldered an adapter for my Amiga to use analogue joystick for PC with it...
David, I appreciate your code download, but (if it's easy) could you offer an ASCII text version of the code so I can read the code on my PC/Mac?
I know how shift registers work but I love your explanations :) You mention at 9:12 the Basic program you wrote is a little slow to respond. I remember that programs can be made faster if you use integer variables and arrays, e.g. B%(7) instead of B(7), instead of the default that is float-point. Have you tried that? Might fix your issue. Cheers!
That is actually a myth. In Commodore BASIC, all numbers are treated as floating point, even if you specify them as an integer. There are ways I could optimize the code, however. For example, there are places I use a hard-coded number and I could replace that with a variable. So, instead of POKE 12345, 20, I could replace that with POKE A,B and it would run faster. Of course, I would need to define A and B ahead of time. There are some other things I could do as well, but I didn't want the code to become difficult to understand.
The length he goes to..
Man, it's funny this video came out now. A few weekends ago I just built my own NES controller on a breadboard using a 4021 compatible shift register. No lag!!!
I’m always so impressed by the ingenuity of electrical engineers from the 70s and 80s.
Does anyone know if the Sega Master System controller has the same problem as the Sega Genesis version?
Quick one about the Megadrive/Genesis pad, it should be “Start” not “Select” as shown on the diagram. And the protocol starts getting fun with the 6-button controller :)
Actually no, the 'select' line is is used to multiplex the extra buttons. When select is high, pin 9 is button B, when select is low pin 9 is button A. Pin 6 is C / Start respectively. So when the system reads the button states it reads them all with the select line high, then sets select low and re-reads for A and Start (or maybe that's backwards, I didn't check). I have no idea why David thinks this pin can damage the system since the system just ties it to high, meaning the mux is only ever in one state. I played 2600s with a Genesis controller a bunch of times and never fried a system. A quick check suggests reading the B and C buttons of a Genesis controller is common in 2600 homebrew, and one guy even went so far as to swap pins 7 and 9 and add a resister to use the paddle line to control the mux and read all four buttons. Addendum: From some comments on youtube, I gather that the way the C64 connects the joystick ports with the keyboard means that a Genesis controller actually can fry a C64. However everyone seems to be in agreement that this is not a problem suffered by any Atari system.
Wow did not know that about the mega drive controller. I wonder how many poor folks unwittingly fried Thier machines :( interestingly the BBC micro used a similar 15 pin connector like the PCs but as I understand they are not compatible.
A, A, B, B, DOWN, UP, RIGHT, LEFT :D
i wonder how many games crash when you send multiple directions at once on the d-pad. or maybe it activates a cheat-menu?
L+R and U+D gets a lot of use in tool-assisted speedruns, with a variety of results. Sometimes it results in going off the edge of the screen, moving faster than normal, or just moonwalking.
As always, very educational! Thanks for sharing the source code, I was wondering about that when you were showing your C64 demo. Great experimental stuff here.
I am actually working on getting the source code uploaded at the moment.. so if you are looking for it, it will be a little while still.
You're back, yes!!!
