spacewar with custom controllers

578 views
Skip to first unread message

Obsolescence

unread,
Aug 20, 2015, 8:44:37 PM8/20/15
to PiDP-8

Got to show something new at VCF Midwest on August 29-30, so here is the PiDP-8 running spacewar, the world's first ever video game:




See halfway on the page here for spacewar history.


Note the homebrew controllers - clunky looks intended (see the originals here). The poor photography is not intentional though. It's just very late at night... preparation for a VCF always happens at ungodly hours.


The screen is a $20 HMDI TFT put in a matching case. Makes for a rack-mounted look. I still want to add some instrument features (A/D, D/A converters etc) so it becomes a proper lab peripheral, just like DEC offered back in the day.


Intellectual credits go to Kyle Owen, who ported spacewar to SimH and also made a nice X/Y (oscilloscope) display emulator using Processing. The phosphorous effect deserves a video, really! I ported it to C on the Pi, as Processing has 'issues' with the little machine. The Pi program runs on a stock PiDP, but the keyboard handling makes it not nice to play just yet (5 days to go to VCF MW). Kyle's Processing display emulator through a telnet link works beautifully though!


Hope to see you at VCF Midwest next week! My suitcase will need space on the way back home from VCF MW. So if you're there and want to adopt one of the demo machines, please let me know :)

Dylan McNamee

unread,
Aug 21, 2015, 8:15:11 PM8/21/15
to PiDP-8
Oscar,

That is very cool - have fun at VCF MW! I suspect that things like the VCF is where a complete DECUS library may show up one day. Fingers are crossed.

cheers,
dylan (and the PiDP-8 crew)

Norbert Landsteiner

unread,
Sep 1, 2015, 3:14:27 PM9/1/15
to PiDP-8
Also see here for an in depth description of the original PDP-1 Spacewar! controllers ("control boxes"):

Chris Smith

unread,
Oct 10, 2015, 8:28:10 AM10/10/15
to PiDP-8
Oscar - in the interests of compatibility, could you lay down some rough rules about some of the external options?

One of them would be regarding connecting external spacewar controllers. I was looking through the notes on the expansion connector. I assume that the "Spare IO" could be an additional row? That would mean the possibility of row2/6 switches and "row4"/12 switches making a total of 18 possible external switches. Given the wide availability of classic Atari/C64 style joysticks, I would think that assigning 10 of those switches to two joysticks in a predictable manner would allow for things like a daughter board that would implement the few needed pieces in a standard manner. Of course, those who want to build original style custom controllers still can, but this would still provide a interfacing standard. ( If you are feeling especially documentative, you could even assign the 5 switches plus ground to particular pins on a 6P6C modular connector for case mounting. )

I was wondering about paper tape interfacing, but after looking through some some articles on how the ASR-33 operated, it looks like paper tape simply appears to the PDP as a serial device. With simh 4.0 implementing USB serial connections, that seems like a better route for those considering paper tape options.

Thoughts?

... Chris

Obsolescence

unread,
Oct 10, 2015, 6:16:01 PM10/10/15
to PiDP-8
Chris,


On Saturday, October 10, 2015 at 2:28:10 PM UTC+2, Chris Smith wrote:
Oscar - in the interests of compatibility, could you lay down some rough rules about some of the external options?

Err... the expansion connector contains all the 12 column lines and the 2 row pins (switch groups) that have a few column that are not used on the front panel. There's also the one single unused IO pin from the GPIO that can be freely used. Plus the ledrows. With the ledrows, you have to keep in mind they are coming straight out of the driver IC, meaning they carry more than 3.3V. That's fine if you put a led on it, the voltage drop of which will make it safe for use with the Pi. 

One of them would be regarding connecting external spacewar controllers.

The spacewar controllers I concocted are soldered straight on the solder pins of the switches (SR1-4 for player 1, SR9-12 for player 2). That's how it was done for the original, and it saves extra programming effort - this is how the spacewar code expects it to be. So, although it could be using the expansion connector, it actually does not.

 
I was looking through the notes on the expansion connector. I assume that the "Spare IO" could be an additional row? That would mean the possibility of row2/6 switches and "row4"/12 switches making a total of 18 possible external switches.

Indeed - row 2 (if I remember numbering correctly) has only the 6 IF/DF  switches hooked up to columns 1-6. So columns 7-12 with row2 gives you 6 optional switches. Same is true for row3 (the right-hand control switches). Any switches hooked up to those row & column pins will be read out by the gpio.c code as it is. And the extra unused IO pin could give you 12 more switches. If you bother to scan one more row in the code.

Given the wide availability of classic Atari/C64 style joysticks, I would think that assigning 10 of those switches to two joysticks in a predictable manner would allow for things like a daughter board that would implement the few needed pieces in a standard manner.

True. It's simpler to solder the controllers (or joysticks) straight on the front panel switches though. That eliminates the need for a diode. What I did was to solder a DB-9 connector with wires to the back of the switches. There's no reason why you could not use normal Atari/Commodore style joysticks.

I'll add details to the web site on this next week, that may be useful.

I was wondering about paper tape interfacing, but after looking through some some articles on how the ASR-33 operated, it looks like paper tape simply appears to the PDP as a serial device. With simh 4.0 implementing USB serial connections, that seems like a better route for those considering paper tape options.

You're right! I was planning to hook up a simple paper tape reader to the expansion port. But why bother - you might as well do it on a serial port properly.

Kind regards,

Oscar.
 

slob

unread,
Oct 10, 2015, 6:50:51 PM10/10/15
to PiDP-8
 I've purchased several paper tape mechanisms on eBay and either "gutted" them and made my own controllers or made special-purpose interfaces for them. For example, the one on my PDP8/e SBC6120 clone is a simple parallel to RS-232 serial interface. I've made others with MOSFET stepper motor drivers operated by a single PIC or Ubicom processor. It's a PITA to buzz out the electronics but it can be done. In a few cases, I replaced lightbulbs (for shining through the punch holes) with LED's. I liked Oscar's original idea of using a pull-through unit with surface mount phototransistors. One annoyance is that MOST (but not all) surface mount phototransistors are 3mm, and you really need 2mm.

 I have two working punches, one of which is OK at punching Mylar. I also (incredibly) have a good supply of unpunched roll and fanfold genuine DEC paper tape. I've punched FOCAL on a few for demonstrations.

 

Chris Smith

unread,
Oct 10, 2015, 9:21:10 PM10/10/15
to PiDP-8
On Saturday, October 10, 2015 at 6:16:01 PM UTC-4, Obsolescence wrote:
Err... the expansion connector contains all the 12 column lines and the 2 row pins (switch groups) that have a few column that are not used on the front panel. There's also the one single unused IO pin from the GPIO that can be freely used. Plus the ledrows. With the ledrows, you have to keep in mind they are coming straight out of the driver IC, meaning they carry more than 3.3V. That's fine if you put a led on it, the voltage drop of which will make it safe for use with the Pi. 

Rrr?? Ok, according the the expansion IO diagram snippet on the website, you have +5,+3.3,ground, led7, led8, col1-col12, row2, SPARE_IO, and an unconnected pin. It doesn't say there is a row3 on there. I don't trust myself to try tracing the board, and the board images on the site are not high res enough to do it that way.

Perhaps the expansion IO diagram is out of date? Is that unused pin now used?
 
One of them would be regarding connecting external spacewar controllers.

The spacewar controllers I concocted are soldered straight on the solder pins of the switches (SR1-4 for player 1, SR9-12 for player 2). That's how it was done for the original, and it saves extra programming effort - this is how the spacewar code expects it to be. So, although it could be using the expansion connector, it actually does not.

You planned well! Because a standard atari joystick has a common line across all the switches, what you just described is only possible if all the sense switches on one joystick are on a common switch row. If you had decided to put different parts of the sense switch row on different rows, what you described might not have worked.

It's simpler to solder the controllers (or joysticks) straight on the front panel switches though. That eliminates the need for a diode. What I did was to solder a DB-9 connector with wires to the back of the switches. There's no reason why you could not use normal Atari/Commodore style joysticks.

I'll add details to the web site on this next week, that may be useful.

It would be a nice touch! Thanks. Now, the original spacewar only needs SR1-4 and SR9-12. Did you also (for completeness sake) add SR5 and SR8 to the connector (as the "down" control)? That would open up the incredible market for PDP8 joystick games!

Chris Smith

unread,
Oct 17, 2015, 11:17:58 AM10/17/15
to PiDP-8
Ok, I did some reading on how the controllers for Spacewar worked, and it means that connecting joysticks is not quite as straightforward as one would expect.

Because Spacewar offers "hyperspace" on "both left and right", a straight joystick connection is not enough. There needs to be a way to trigger hyperspace from the joystick as well. Although I could not find a definitive circuit, the implication is clear that the controllers are straight-forward for "left", "right", and "pull for thrust", and "torpedo". However, "push for hyperspace" means that controller switch must close *both* the left and right at the same time. This control layout was used on the custom MIT controllers for the original Spacewar!

The second question is surrounding the connectivity. I wanted the possibility of just plugging in a classic DB9 AtariC64 stick and having it "just work". But I figured if you are doing most of that external connection work already, it should be possible to run all the sense switches remotely. It turns out that it is not really possible to do both of these things.

Hence, the following small chart. (Sorry for the graphic, but tables are really hard to get right in plain text.)



This delivers the following capabilities:

1) A standard AtariC64 stick can be plugged in and will give a good interpretation of the classic controllers. Notice that the "up" direction of the joystick closes two switches, which are the same as "left" and "right".

2) Clear connections are available for the construction of historically accurate controllers.

3) Pinouts are structured so that the ports are the same for both sticks.

4) Although DB9 sockets can be used, 8P8C ("RJ45") are low cost and widely available, so that is an option as well.

5) With the 8P8C connector, the "hyperspace" pin is special with that dual connection, but all 6 switches get their own individual line as well. Thus, it is possible to use both 8P8C ports together to control all 12 sense switches.

6) The layout of the chart gives a clear way to build 8P8C jacks on your PiDP-8, and also to easily construct "8P8C-DB9" adapter cables.

7) Note that the "line to which switches get connected" is referred to as "COMMON" and NOT "ground". The switch read process in the PiDP-8 makes that line an active line, not a ground. This is compatible with classic joysticks, but that line should never be connected to a real ground.

8) It provides a standard "alternate AtariC64" connection that enables full use of the stick, but is incompatible with Spacewar! This is "DB9-alt" in the chart. If this wiring is used, the full set of sense switches are available on the DB9 port.

9) It should be completely unambiguous. Two people should be able to wire up DB9 sockets, or 8P8C sockets and 8P8C-DB9 adapters, and use them interchangeably with no problems.

The only thing it cannot deliver is a way to have both Spacewar! AND read a classic AtariC64 stick for all four directions plus fire. Because Spacewar! requires "up" to equal "left+right", that is unavoidable. If you want to have that flexibility, then I would suggest using the 8P8C socket, and then building both an "8P8C-DB9-SPACEWAR" adapter, and separately construct an "8P8C-DB9-ALTERNATE" adapter. Then simply swapping adapters between a standard stick and the PiDP-8 port will give you both options. If you are feeling especially fancy, build an adapter box, and put a switch on that to select between the two connection patterns. If you want to carry the fewest items around with you, build the DB9 connectors into your PiDP-8 case, and put a back panel switch on the PiDP-8 case to select the joytick pattern.

Finally, for searchable references, here is an attempt at the chart in plain text. It will only work in monospaced fonts.

 Spacewar!....SwitchSet1....SwitchSet2....AtariC64....DB9-port....DB9-alt....RJ-port
 LEFT...........S1............S9............Left........DB9-3.......DB9-3.....Pin2..
 RIGHT..........S2............S10...........Right.......DB9-4.......DB9-4.....Pin3..
 THRUST.........S3............S11...........Down........DB9-2.......DB9-2.....Pin4..
 TORPEDO........S4............S12...........Fire........DB9-6.......DB9-6.....Pin5..
 HYPER..........S1,S2.........S9,S10........Up..........DB9-1.......-----.....Pin8..
 ------.........S5............S7............---.........-----.......DB9-1.....Pin6..
 ------.........S6............S8............---.........-----.......DB9-5.....Pin7..
 COMMON.........--............--............GND.........DB9-8.......DB9-8.....Pin1..

... Chris
Auto Generated Inline Image 1

Chris Smith

unread,
Oct 21, 2015, 10:59:28 PM10/21/15
to PiDP-8
Oscar, something was niggling at me about this. I figured out what was bugging me.

If a port is wired to trigger hyperspace with a single pole switch, then it would have to bridge the S1 and S2 lines *before* going to the switch.

This is a problem with my port wiring - if I wire S1 and S2 to RJ-port Pin8, then not only will that switch trigger hyperspace, but *any* switch on the combined line, such as either the joystick left and right switches, but also including the original front panel S1 and S2 would *also* trigger both S1 and S2.

I can only see two ways to fix this. One is that a separate hyperspace switch must be dual pole. The other is that two diodes must be used as part of the special hyperspace control so that left and right inputs do not cross trigger through the wiring added for the hyperspace switch. There is one more way, though - do not implement the hyperspace function.

You said you had used controllers but didn't go into much more detail than that. It seems likely that you would have encountered this problem. How did you handle it?


On Saturday, October 17, 2015 at 11:17:58 AM UTC-4, Chris Smith wrote:
Hence, the following small chart. (Sorry for the graphic, but tables are really hard to get right in plain text.)




... Chris

Obsolescence

unread,
Oct 22, 2015, 2:42:14 AM10/22/15
to PiDP-8
Chris,

Re the hyperspace button in spacewar --


On Thursday, October 22, 2015 at 4:59:28 AM UTC+2, Chris Smith wrote:

You said you had used controllers but didn't go into much more detail than that. It seems likely that you would have encountered this problem. How did you handle it?

I kept it very simple: four pushbuttons in a box, and a cable with 4 signal wires for the signals and 1 common wire.

In the PiDP, I soldered the 4 signal wires straight on the front panel switches (SR1-4 for player 1, SR9-12 for player 2; solder on the top pin). The common wire goes to the middle pin of any SR switch. In terms of the schematic, the signal wires go to columns 1-4 or 9-12; the common wire to row1.

So having to press two buttons at the same time to activate hyperspace caused no problems. However - If you want to tap the 'column' signals (SR1-4, 9-12) off the expansion port, then you'll need diodes. But all I did was connect 4 pushbuttons in parallel with the front panel switches.


For the connector, I used a single DB-9 to hook up both controllers:
Pin 1 is 'common' (not really GND, but the row1 pin).
Pins 2-5 are SR 1-4
Pins 6-9 are SR 9-12

Kind regards,

Oscar.

Chris Smith

unread,
Oct 22, 2015, 12:24:49 PM10/22/15
to PiDP-8
My mistaken inference, then. I had thought you were using original style control boxes, which had a push-pull stick ("big toggle switch") for thrust and hyperspace.

You actually had a completely different option - just duplicate the sense switches and use "press both". (Duh, I say at myself.)

I may also have read at somepoint that you used a DB9 connector, and made a further incorrect assumption that it was wired for "classic AtariC64" stick input. Also wrong on my part.

I'm still looking to have a nice clean back panel, and I think there is some benefit to nailing down the wiring pattern.

I'm curious to know if any significant number of people actually want classic interfaces; I may be biased by the fact that there is a classic game shop about two minutes walk from work, where I can get a wide selection of old controllers, so I can avoid building those entirely. But your button only interface is a nice match for the overall feel of the PiDP-8!

Oscar Vermeulen

unread,
Oct 22, 2015, 5:02:05 PM10/22/15
to Chris Smith, PiDP-8
Chris,

On 22 October 2015 at 18:24, Chris Smith <cjs...@gmail.com> wrote:
My mistaken inference, then. I had thought you were using original style control boxes, which had a push-pull stick ("big toggle switch") for thrust and hyperspace.

Actually, AFAIK, those were the 'later ones' - the first boxes had buttons. OR so I inferred from the masswerk.at spacewar pages and the CHM exhibit.


You actually had a completely different option - just duplicate the sense switches and use "press both". (Duh, I say at myself.)

Well - the expansion port would make sense. Were it not for the fact that you then need to add diodes to the switches, much as they are needed for the front panel switches themselves (to avoid the keyboard 'ghosting' problem).
 
I'm still looking to have a nice clean back panel, and I think there is some benefit to nailing down the wiring pattern.

Certainly. Also because most people may prefer to stick in an existing joystick.

Wiring from the switches can be done quite cleanly: 2 times 4 wires on the solder lugs of the switches (top pins) and 1 on a middle pin of any SR switch. I led that out on a (misleading) DB-9 connector on the PiDP back.

I'm curious to know if any significant number of people actually want classic interfaces; I may be biased by the fact that there is a classic game shop about two minutes walk from work, where I can get a wide selection of old controllers, so I can avoid building those entirely. But your button only interface is a nice match for the overall feel of the PiDP-8!

A two-fire-button joystick would be easy to rig up by rewiring it inside (make the two fire buttons separate).

Anyway - my first intention was to make wooden controller boxes as per the CHM example. But as I rather dislike woodworking, I grabbed two plastic cases instead...

Kind regards,

Oscar.

Dylan McNamee

unread,
Feb 17, 2016, 10:24:51 PM2/17/16
to PiDP-8
On Thursday, October 22, 2015 at 2:02:05 PM UTC-7, Obsolescence wrote:
Chris,

Has anyone reproduced the SpaceWar demo? I tried a while back, but couldn't get the display going. Ideally, I'd like to be able to connect to the SpaceWar server over a remote connection. My goal is to have a "history of video games" exhibit for a local grade school in about a month, and this would be a great addition.

I also don't mind a bit of woodworking, but that's further down my list of concerns. :) 

thanks,
dylan

Obsolescence

unread,
Feb 19, 2016, 4:58:30 PM2/19/16
to PiDP-8
Dylan,


On Thursday, February 18, 2016 at 4:24:51 AM UTC+1, Dylan McNamee wrote:

Has anyone reproduced the SpaceWar demo? I tried a while back, but couldn't get the display going.

You mean the VC08 emulator that runs on the Pi and outputs to HDMI? Which is my concoction. Shall I send you the latest version? It's from quite a while back, and although not exactly great, I should put it on the site really.

Or the Processing-based VC08 emulator running on your PC, connecting to the PiDP? For that one, all you should have to do is enter the IP address of the PiDP and that's it. Try booting spacewar first, then run the Processing program. Although the sequence should not matter really.

 
Ideally, I'd like to be able to connect to the SpaceWar server over a remote connection. My goal is to have a "history of video games" exhibit for a local grade school in about a month, and this would be a great addition.

With the Processing program, it should go flawlessly. Can you describe what is the problem?
 

I also don't mind a bit of woodworking, but that's further down my list of concerns. :) 

You referring to the 'faux rackmounted monitor' - the monitor in a case just like the PiDP? I liked it for a brief while but in the end found it too, well, faux. The idea was to also put an AD/DA interface in the panel space next to it. But that went onto the Infinite Stack Of Possible Projects, for the moment. Still, it's trivial to do. I think.


Kind regards,

Oscar.
 

thanks,
dylan

Dylan McNamee

unread,
Feb 19, 2016, 5:04:41 PM2/19/16
to PiDP-8
I can now report (now that my power issues are resolved) that I got Spacewar going! The PipaOS networking support is very nice. The framerate is pretty low, but looking on the YouTubes for videos of the real thing, I see that it's quite accurate. Neat!

This will be a great demo!

cheers,
dylan
Reply all
Reply to author
Forward
0 new messages