2600 LAN
I originally wrote a detailed blog entry about this, but lost it due to accidentally closing the browser window, so this one will be brief unless I feel like recreating all that effort again.
Anyway, this is a proof-of-concept demo of a multiplayer game on two 2600s connected via the right joystick port. It's Adventure, where one console controls our hero and the other controls an enemy (dragons or the bat, and these are swapped every few seconds.) The cable may be constructed by anyone with readily available parts. You just need a straight-through serial cable with pin 7 of the male end of the cable lopped off with needle-nose pliers, and on that male end you need a female-to-female gender changer. I already had the cable (it is exceedingly common) but I used a gender changer from Radio Shack, though not particularly cheap, it was small and the attachment screws could be removed easily so it will actually fit in the console.
Here are links to Radio Shack parts:
Male-to-Female straight-through 9-pin serial cable
The game works by establishing a master console when reset is pressed. The master searches for a slave console in a tight loop. If no other console is found, the game doesn't start, so there's no point in trying this in an emulator or single console. The consoles exchange joystick information and a few collision registers, but that alone isn't enough, as it would have required significant modifications to the game to support just that. So for now, the RAM contents are uploaded to the slave, one byte per frame. Therefore it takes about 2 seconds of weirdness for the game to begin. There is also some weirdness during gameplay on the slave console (the one controlling the enemies) but it actually isn't bad, and it corrects itself soon enough. It sort of reminds me of how some online games behave with a high-latency connection.
It is not necessary to start the game on the slave console - that will happen automatically. It is a good idea to make sure the difficulty switches match or you will get more weirdness than necessary.
At first I made considerable effort to ensure that two consoles would have essentially zero chance of trying to output at the same time. But then I made some mistakes and I found the consoles were actually creating output contention for considerable periods of time (several minutes) and no damage occurred. I'm not sure if it was due to the resistance of the serial cable or that the outputs are open drain, but regardless, this leads me to believe that preventing output contention might not be as critical as I thought.
The source code has not been posted, as this was a quick hack for NWCGE 2008 and I barely got it working the night before the show. I know the code is awful and the timing delays are less than ideal, but it works (kind of.)
I also wonder if lopping off pin 7 is really necessary after I found a circuit with two 7805s in parallel with their outputs directly connected. This may cause some current to feed back to another console, but I wonder how damaging it could be. I have not tried this, however.
If you make a cable and try this out, let me know how it worked for you.
5 Comments
Recommended Comments