foone Profile picture
7 Apr, 64 tweets, 10 min read
stupid idea: the c64 has two analog inputs, in the forms of the X/Y paddle ports. each one can read 256 analog values, so by hooking up a DAC to them you could communicate with the c64, 16 bits at a time
so apparently the SID (yes, it's hooked up to the sound chip. don't ask) updates the value every 512 cycles, so on a 1mhz c64 you can only get new values a bit under 2000 times a second.
So you'd maybe be able to manage ~2000 cps, or a bit over 9600 baud?
anyway the real reason this is a "stupid idea" is that the c64 has an expansion slot, a user port, a serial port, and a cassette port, all of which are easier to interface with (and probably faster)
BTW the way the C64 has 2 analog inputs on the controller inputs that are routed through the sound chip and updated every 512 cycles DOES mean that it has a joystick system significantly less braindead than the one PCs were using well into the early 2000s.
c64 joysticks were digital, the paddle/mouse inputs were analog.
But to figure out their analog value, you just had to read a register in the analog-digital converter in the SID
compare this to the PC, which has analog joysticks that are converted using... well it doesn't really have an analog-digital converter. that'd be too expensive.
instead, it has a TIMER.
it uses a variant of the classic 555 timer chip, which can have it's timing adjusted by an external resistor. It's hooked up to the joystick so that you're adjusting the resistance as you move the joystick on each axis
so to read a PC joystick, it's simple!
you write to the PC joystick register, which resets it
you then start timing how long it takes to turn back on
the longer it takes, the more right/down the joystick is.
fun fact: this was invented at a time when PCs did not have high resolution timers. You had to count cycles, and this on a computer that could have any number of different speeds
so this meant that EVERY SINGLE GAME had to have a calibration function included in it to manually calibrate the joystick because the game had no idea how many cycles it took your joystick to count up to top-left versus bottom-right.
since it depended on your system speed, and on your joystick's electrical properties.
the best part is that this was invented in a time when computers were slow and 16bit.
so when you were building your timing loop you could have it nicely sized for a variety of joysticks available at the time you wrote it...
and then run the same code on a much faster computer a couple years later and now it overflows the variable and your joystick doesn't work!
because your system is too fast
this is why there were gameport cards which specifically had "speed" as their big selling point. They'd automatically adjust their timing so that older games would still work on newer systems
and some games implemented joystick functionality in a way where the speed of the PC was used as a divisor, which meant that instead of just breaking as your system got faster, your joystick just got less precise
which is like low-level gaslighting everyone. imagine loading up a flight sim on your new system and it seems to run fine but you're having trouble controlling it.
anyway this was one of the major benefits of windows 95.
not only did the OS handle the joystick reading, so you just asked the position, but it stored the calibration PER JOYSTICK
in DOS if you wanted to play game A and then game B, you'd have to calibrate it for each game.
Windows 95 let the OS store the calibration, so you only had to calibrate it once when you set it up, and every game would get the benefit.
and my favorite thing about how the gameport is analog is that there are digital controllers for it, like the gravis PC gamepad. how do they work?
and the answer is that they just pretend to be analog.
DOS games are still going to make you calibrate them.
But internally they're digital, but they convert the digital inputs to an analog value to send to the PC
The other fun trick is how the gravis pc gamepad has four buttons.
The PC gameport standard supports only two buttons
EXCEPT the PC gameport standard supports two buttons PER JOYSTICK and it support two joysticks at once, using a Y-cable
so all the "4 button" joysticks are actually wired as if they're two joysticks. You've got the X and Y wired to Joystick one, then buttons wired to A and B of joystick 1 and A and B of joystick 2
and if that's not complicated enough, some fancypancy joystick makers wanted HAT SWITCHES.
The hat switch is a little mini-joystick on the joystick, used to control which way you're looking, usually.
so Thrustmaster solved this by just using the second joystick X/Y for this. Hat switches are usually digital, but they just used the gamepad solution where you fake an analog input using a digital input.
CH Products on the other hand had a different solution... BUTTONS
they instead chorded the buttons so that when you press the hat switch left, it holds down buttons A & B, and right holds down A, B, & D, and so on.
so basically every time you use the hat switch to look around, it thinks you're pressing a series of buttons at once. I think they preferred this solution because it's really cheap to implement with some diodes?
but it has the side effect that you now can't use multiple button presses for normal stuff (or it'll be interpreted as hat switch directions) and the hat switch overrides buttons
joysticks were terrible guys the USB gameport is so much better.
which one? fuck you.
it's actually horrible.
There's joyGetPos, there's DirectInput, and there's XInput
so really if you want to us a joystick on the PC there's 4 different APIs you can use depending on what kind of joystick it is and what year it is
1. the "fuck you, time it yourself" manual API of the original
2. the win95 joystick interface
3. DirectInput (legacy deprecated but still works)
4. XInput: new but basically limited to the Xbox 360 controller? also you can't use more than 4 at once
but don't worry: the c64 joystick port isn't completely different from the PC gameport in terms of weird corner cutting: they wired it into the keyboard matrix
instead of having a separate interface to talk to the joystick through some IO chip that interprets the digital inputs... they wired it into the keyboard!
so, for example, there's no way to tell the difference between the second joystick being held LEFT and the user holding down SPACE and C on the keyboard.
this is, btw, where my name came from.
I was playing some C64 game and the high score menu came up and I just put in "FOO" as in the metasyntactic variable, like foo,bar,baz,qux
I then tried to press the key on the joystick to continue on, but it turned out the game wasn't asking for initials, it stored entire names, and my joystick-wiggling-pressing typed in some letters
so "FOO" became "FOONE".
I thought it was a cool name and kept it in mind. I started using it on IRC and later, when I changed my name, it became my legal name.
as opposed to my illegal name, which is Stabby McCrimeFace
anyway it's good that now we can use bluetooth joysticks
oh wait no, because for some reason android hardcode some bluetooth IDs as being joysticks, because a bunch of bluetooth joysticks used a specific chip that could also be used for keyboards
which is fine, unless you have one of those bluetooth keyboards, which now won't work at all because android says they have to be joysticks now
spoiler alert: I have one of those keyboards
BTW, in the win95 era Gravis released the Gravis GamePad Pro.
This was a TEN BUTTON gamepad, and you could connect up to FOUR of them at once.
still plugged into the same limited gameport.
How'd that work? Ehh... incompatibility and blasphemy.
So they had a switch on the back that let you set the mode to 1 player, 2 player, or GRiP.
1 player let you use 4 of the buttons in DOS games
2 player only let you use 2, but you could hook up a second one to the back of the port
so what it does is that it uses button A as a clock, toggling it on and off 20-25 THOUSAND TIMES A SECOND, while the B button is toggled alongside it to send 24-bit data frames
the windows 95 driver then interprets this into a virtual joystick with all 10 buttons + D-pad
the neat trick it does is that for the second GRiP pad, it uses buttons C and D, and the pad doesn't need to know it's the second or third pad.
because it's got that passthrough for a second joystick, but it's not actually a direct passthru. It swaps the position of AB and CD.
so a GRiP driver can listen for two gamepads with a full 10 buttons and D-pad with only one port, because the second one will be swapped from AB to CD
the weird thing is that the GRiP driver/protocol supported FOUR gamepads. I'm not entirely sure how that worked
but they did make a MultiPort device, so it may have been limited to that. Maybe it layered gamepads #3 and #4 by using a different set of start bits, or B+C or D+A, or maybe by using different axises.
although the weirdest joystick interface for the PC was this one.
Yeah, that's a graphics card. See those connectors going up to a daughtercard?
Those connectors (shown here on a different card) are these.
Do they look familiar?
if not, you probably never owned a Sega Saturn.
So yeah, Nvidia got their start in PC graphics by releasing a weird 2D/3D accelerator with included audio and Sega Saturn controller support.
This made it easy to port Sega Saturn games to the PC, and some were, but it didn't work very similar to other PC 3D accelerators, especially when DirectX was released a few months later and used a completely incompatible rendering method (triangles, instead of quads)
so it ended up being a dead end, and Nvidia cancled their planned followup NV2, and instead started working on the "NV3", which became the much more successful Riva 128 chip.
Anyway, that's enough talking about weird gameports.
and weird graphics cards.
All I can say is: at least it's not the Kiddie Keyboard.
That weirdo connects to your PC through the PRINTER PORT

• • •

Missing some Tweet in this thread? You can try to force a refresh

Keep Current with foone

foone Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!


Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @Foone

8 Apr
Fun fact: this would be a disaster, yes, but not as bad as it would be on telescopes like the Hubble.
Because the JWST doesn't have one mirror, it has a METAMIRROR made of 18 smaller mirrors
It's 18 hexagonal mirrors. Image
So if you did drop a hammer on the JWST, they'd only have to replace that single mirror, not the whole thing.
Read 35 tweets
8 Apr
Remember, when packing up for a move, you gotta prioritize. Get the most important stuff first.

Specifically, that's Manos on VHS, Intel 486 poster, TransBot for the SMS, and 1" Tungsten cube. ImageImageImageImage
Thankfully I still have my carrying case. Image
All sealed up and ready to go. Image
Read 4 tweets
7 Apr
Me: OK, I can park this huge truck behind this gas station for a minute. It's going to be slightly tricky to back out with the lack of rear view mirror, but I have plenty of room and I can go slowly...
Shiny New Tesla: *parks directly next to me*
I just sat here and waited for them to leave. I don't want to pay astronomical insurance premiums for the rest of my life just because I ran over a Tesla with a uhaul that one time
And when I say "Shiny New", I mean it. I'm less than a mile from the Tesla factory, that thing probably still has the protective film covering the dash.
The odometer probably still says zero
Read 7 tweets
7 Apr
It's on ebay, if you want it…
Read 5 tweets
7 Apr
I updated SorryPunk! It now has a fallback for characters that aren't in the font, so if you want to use characters that aren't included, it'll use your browser's font fallback and you'll get something instead of nothing.
the generator is based on the one used by but using the font as used on, and it includes all the characters provided by it. This is basically just the western languages characters + Cyrillic
so I can't just add in missing characters, they don't exist in the right font. So instead I'm switching to rendering missing characters in "Verdana" (not really) using the browser's text rendering.
Read 9 tweets
7 Apr
I mean, no? but technically this is progress
weirdly no matter what size I tell it to you, it always renders at the same TINY TINY size
well that's technically better
Read 7 tweets

Did Thread Reader help you today?

Support us! We are indie developers!

This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!