This is a virtual DEC PDP-1 emulated in HTML5/JavaScript running the earliest known version of "Spacewar!", the earliest known digital video game.
Spacewar! was conceived in 1961 by Martin Graetz, Stephen Russell, and Wayne Wiitanen. It was first realized on the PDP-1 in 1962 by Stephen Russell, Peter Samson, Dan Edwards, and Martin Graetz, together with Alan Kotok, Steve Piner, and Robert A Saunders. – Spacewar! is in the public domain, but this credit paragraph must accompany all distributed versions of the program.
Emulation by Norbert Landsteiner, www.masswerk.at, 2012–2022,
based on emulation code by Barry Silverman, Brian Silverman, and Vadim Gerasimov.
This is a special project page, please visit the www.masswerk.at/spacewar for the normal game and additional information.
The Spacewar! 2B Preservation Project
This pages provides a carefully revised version of Spacewar! 2B that represents the program as shown at the MIT Science Open House in May 1962 and as described by J.M. Graetz in "The Origin of Spacewar" (Creative Computing, August issue 1981) and in his DECUS conference paper "Spacewar! Real-Time Capability of the PDP-1" (DECUS Proceedings 1962, p. 37-39). The program has been upgraded to run on a PDP-1 with the automatic hardware multiply/divide option installed and the hyperspace trigger has been revised to work on the deployment of the signals rather than on their release as in the original hyperspace patch.
This page provides both the original program and the newly revised version in order to prove their functional equivalence. The steps to create the revised version are documented in detail at the page "Inside Spacewar!, Part 11".
For this purpose the following programs are provided in emulation (see the Version menu at the top left):
- Spacewar! 2B (2 Apr 1962)
This is the original program loaded from a digital image of the paper tape "spaceWar_SA-5.bin" [1] (identical in code to the tape "spacewar2B_2apr62.bin" [2]) with all known patches applied by loading them from separate tape images. These patches are the original hyperspace patch by Martin Graetz, "hyperspace85.bin" (Hyperspace VIci, 2 May 1962) [5], and the auto-restart patch "spaceWarRstrt.bin" [7] (identical in code to the tape "spacewAutoRestartPatch.bin" [8]).
- Spacewar! 2B-m (8 Mar 2016)
This is the revised version consisting of inlined code of:
- Spacewar! 2b, 2 Apr 1962 [1],[2]
The code is based on the source code of an earlier version from 25 March 1962 [3], which differs only in the polarity of the sense switch settings. The source code regained from the dissasembly of [1] and [2] and the according adjustments made to [3] is available locally [4].
- Hyperspace 85 / Hyperspace VIci, 2 May 1962 [5] based on the original source code [6].
- The auto-restart patch [7],[8] based on source code regained by disassembly [9].
- A reconstruction of the apparently lost scorer/matchplay patch based on source code of Spacewar! 3.1.
- A modification to the auto-restart patch, fixing an edge-case, where two motionless objects are exploding in an infinite loop.
- A modification to the hyperspace patch to revert the signal-order of the trigger to deploy on the signals going to high. (Thus providing compatibility with the control boxes as used by the CHM.)
- An upgrade to the automatic multiply/divide option, including a compensation for the gain in runtime speed.
The resulting source code of the revised version (including detailed annotations) and a binary file of the object code are available locally [10], [11]. — Please mind that this is newly revised code and not an authentic program.
Notes on Spacewar! 2B
Spacewar! 2B differs from later version of Spacewar! in the following aspects:
- Single game operation (restart required for a new game without the sperate auto-restart patch).
- No table of "interesting and often changed constants", parameters are rather inlined and values for torpedo speed, life, and reload time differ, contibuting to the single major difference in gameplay.
- Exhaust flames of spaceships are drawn as a short, continuous line (half the size of later versions).
- Single shots only, no salvoes.
- The Expensive Planetarium modulates brightnesses by refresh rates only (as opposed to using the intensity of the "
dpy
" instruction) and features variable speeds. Moreover, the start position is right at the margin of the starfield rather than in the lateral center (as observed in later versions of Spacewar!).
- Explosions are drawn in a well perceptible box (the so-called "crock explosions", compare "The Origin of Spacewar" and source code comments). Moreover, there is no flag indicating a non-collidible state.
- Thus, an alledgly winning ship may still collide with the debris of an exploding opponent, resulting in a tie.
- The object table reserves the same number of properties for all collidible objects, while later versions reserve some for the two spaceships only (thus, put in modern terms, subclassing the spaceships).
- There is a property for the spaceships' fuel supply (same as used in later versions), but the supply is never allocated, nor consumed. Thus, the ships are of infinite fuel supply.
- Finally, a subtle difference in the implementation of the random number generator.
Options to the game are operated by the following sense switch settings ("up" = on, "down" = off/default):
SSW 1 UP INERTIAL ROTATION
DOWN BERGENHOLM ROTATION
SSW 2 UP LIGHT GRAVITY
DOWN HEAVY GRAVITY
SSW 3,4
00 MOVING STARS, NORMAL
01 MOVING STARS, FAST
10 STATIONARY STARS
11 NO STARS
SSW 5 UP HEAVY START TRAP
DOWN HEAVY STAR TO ANTIPOINT
SSW 6 UP NO HEAVY STAR
DOWN HEAVY STAR ON
(Compare CHM Catalog Number 102631130.)
Resources
[1] http://textfiles.com/bitsavers/bits/DEC/pdp1/papertapeImages/20031202/InsidePDP1_80s_box3/spaceWar_SA-5.bin
[2] http://textfiles.com/bitsavers/bits/DEC/pdp1/papertapeImages/20050823/spacewar2B_2apr62.bin
[3] http://www.masswerk.at/spacewar/sources/spacewar_2b_25mar62.txt
[4] http://www.masswerk.at/spacewar/sources/spacewar_2b_2apr62.txt
[5] http://textfiles.com/bitsavers/bits/DEC/pdp1/papertapeImages/20031202/InsidePDP1_80s_box3/hyperspace85.bin
[6] http://www.masswerk.at/spacewar/sources/hyperspace85.txt
[7] http://textfiles.com/bitsavers/bits/DEC/pdp1/papertapeImages/20030408/spaceWarRstrt.bin
[8] http://textfiles.com/bitsavers/bits/DEC/pdp1/papertapeImages/20031202/InsidePDP1_80s_box3/spacewAutoRestartPatch.bin
[9] http://www.masswerk.at/spacewar/sources/spacewAutoRestartPatch.txt
Downloads:
[10] http://www.masswerk.at/spacewar/sources/spacewar_2b_m_2016.txt
[11] http://www.masswerk.at/spacewar/sources/spacewar_2b_m_2016.rim
Related Links