Home-Computer Light Guns · Volume 3
Commodore — PET, VIC-20, C64 and C128, Amiga
Pin 6 of the game port and the VIC and VIC-II light-pen registers; why a C64 gun from one maker so often fails with another maker's games; the Defender 64 and the Light Fantastic pack; and the Amiga's beam trigger

Commodore documented its light-pen input more plainly than anyone. Both the VIC-20 and the Commodore 64 programmer’s reference guides print the game-port pinout with the pen on pin 6, name the registers that latch the beam position, and explain in a paragraph how the pen works. The guns that used that input are another matter: no two makers agreed on where to put the trigger, and the result is a shelf of C64 guns that each work only with their own games.
3.1 The PET: no pen input found
The Commodore PET is in the brief for this dive, and nothing primary was found for it. No light pen or gun for the PET was located in a manual, a magazine article or a museum record, and none of the PET documents read for this dive shows a pen input on any connector. Collectors’ firmware notes describe the later 12-inch PETs as using a 6545 CRT controller, a relative of the 6845 that has a light-pen pin (Volume 5), but whether that pin was brought out on any PET is unconfirmed. A PET pen, if one existed, would have had to work the way Robert Peck’s 1981 software-scan pen did, by blanking regions and polling an input bit (Volume 1).
3.2 VIC-20: the VIC chip’s two registers
The VIC-20 Programmer’s Reference Guide has a page headed “Using a Light Pen on the VIC”:1
When the scan passes the area where the pen is, a signal is sent to the VIC chip. When this signal is received, the VIC chip, which keeps track of where the scan line is at any particular moment, will record the exact location of the scan in two registers, 36870 (9006 HEX) for the X direction and 36871 (9007) in the Y direction. You can read and use this information in your programs.
The light pen trigger is connected to pin 6 of the game port. The light pen trigger input can also be reached from pin 7 of the user port. Note that you can’t use a joystick and a light pen at the same time, because the same line that is used as the light pen trigger input is used as the joystick fire button input (you would get false readings).
The guide’s “Game I/O” table gives the port: 1 JOY0, 2 JOY1, 3 JOY2, 4 JOY3, 5 POTY, 6 LIGHT PEN, 7 +5 V (maximum 100 mA), 8 GND, 9 POTX. The register chart describes the two values as “the latched number of the dot under the light pen, from the left of the screen” and “counted from the top of the screen”.
Two details matter for a gun. The latch re-arms on reading: “When the light pen trigger input is brought low, the VIC freezes the two registers. … After reading the two registers, the trigger line will be cleared, so that scan information can be placed again in the two registers.” And the pen line is the fire button, so a gun on a VIC-20 cannot use pin 6 for its trigger.
3.3 C64 and C128: LPX and LPY, control port 1 only
The Commodore 64 Programmer’s Reference Guide is equally direct. In its input/output chapter: “A light pen can be plugged into Port A (only) for special graphic control”.2 Its connector appendix lists control port 1 as 1 JOYA0, 2 JOYA1, 3 JOYA2, 4 JOYA3, 5 POT AY, 6 BUTTON A/LP, 7 +5 V (maximum 50 mA), 8 GND, 9 POT AX. Control port 2 has no pen line.
The guide reprints the VIC-II datasheet, whose light-pen paragraph is the most complete statement of any latch in this dive:
The light pen input latches the current screen position into a pair of registers (LPX,LPY) on a low-going edge. The X position register 19 ($13) will contain the 8 MSB of the X position at the time of transition. Since the X position is defined by a 512-state counter (9 bits) resolution to 2 horizontal dots is provided. Similarly, the Y position is latched to its register 20 ($14) but here 8 bits provide single raster resolution within the visible display. The light pen latch may be triggered only once per frame, and subsequent triggers within the same frame will have no effect. Therefore, you must take several samples before turning the pen to the screen (3 or more samples, average), depending upon the characteristics of your light pen.
So on a C64, LPX is at $D013 (53267) and LPY at $D014 (53268); horizontal resolution is two pixels, vertical one raster line; the latch fires on the first falling edge of each frame and ignores the rest. “Once per frame” is the important difference from the Atari, whose ANTIC re-latches on every edge. A C64 gun reports the first point of the screen it sees each frame, which is the top of its field of view, not the middle; a game must offset for it or average.
The C128 kept the VIC-II and the same port. The VICE emulator’s source notes that on the C128 it triggers the pen input of both the VIC-II and the 80-column VDC chip, which has its own light-pen register;3 no Commodore document on the VDC’s pen input was read for this dive.
3.4 Same pin 6, different triggers: why C64 guns do not mix
Every C64 gun drives pin 6 with its sensor, or almost every one. The trigger has nowhere standard to go: pin 6 is taken, and the guide reserves no other line for it. Makers chose differently. The VICE emulator, which has to wire each gun correctly to run its games, documents the choices in its source code; these are its authors’ findings, not the gun makers’ documents:3
Table 1 — Same pin 6, different triggers: why C64 guns do not mix
| Device | Sensor | Trigger or button | Power |
|---|---|---|---|
| Light pen, “button Up (e.g. Atari CX75)“ | Pin 6 | Pin 1 (up) | 7, 8 |
| Light pen, button left; Datel pen | Pin 6 | Pin 3 (left) | 7, 8 |
| Stack Light Rifle | Pin 6 | Pin 3 (left) | 7, 8 |
| Magnum Light Phaser; Cheetah Defender | Pin 6 | Pin 9 (POT X) | 7, 8 |
| Inkwell light pen | Pin 6 | Pin 3 (left) and pin 9 (POT X) | 7, 8 |
| Gun Stick | Pin 2 (down) | Pin 6 | 7, 8 |
The Gun Stick row is the odd one, and VICE’s authors call it out: “This gun is somewhat weird, in that it uses pin 2 (down) for the light sensor, and pin 6 (lp-trigger) for the trigger button. also the signal on pin 2 is stretched a bit by the logic in the gun.” It is not using the VIC-II latch at all. Its sensor is a plain input bit that the game polls, and its pulse is stretched so that a polling loop cannot miss it: the software school, on a machine that had the hardware for the other one. That is how the same Spanish gun could be sold for the Spectrum, the MSX and the Amstrad, none of which shares the C64’s latch (Volume 4).
The table also explains the reviews. A game written for the Magnum reads its trigger from the POT X line; a Stack rifle’s trigger is on joystick left, so its trigger does nothing in a Magnum game. The XG-1 puts its trigger on pin 1, so on a C64 it reads as joystick up held until the trigger is pulled, which the C64-Wiki records as “the fire key isn’t compatible, because pin 1 active-low is used by the control port”.4 Only the sensor is common to all of them.

3.5 The C64 guns
The C64-Wiki lists the guns sold for the machine; the list below keeps those that a second source confirms and says where it does not.4
- Stack Light Rifle (Stack Computer Services). Sold for the ZX Spectrum, C64 and VIC-20; a 1984 review describes a chromed pistol with a stock, scope and barrel extension on a 12-foot cable (Volume 1 shows the opened pistol). Its three bundled games, High Noon, Shooting Gallery and Grouse Shoot, appear in the C64 list.5
- Magnum Light Phaser. Best known in its Sinclair and Amstrad versions (Volume 4); a C64 version existed, and MobyGames records Gunslinger (1990) as one of five Software Creations games bundled with it.6 VICE gives it the POT X trigger.
- Cheetah Defender 64. Cheetah’s gun in its C64 version, dark grey with red grips, sold in Commodore’s own Light Fantastic pack. The Centre for Computing History catalogues the gun as part of that pack and lists its compatible games.7
- Trojan Light Phazer. Listed for the C64; Trojan’s Phazer is documented for the Amstrad Plus range (Volume 4), and the C64 version was not confirmed independently.
- Gun Stick (MHT Ingenieros, Spain). The C64-Wiki notes that it “supports two light guns”. Its wiring is the polled one in the table above.
- Atari XG-1. Usable for its sensor only, as described above.
The Light Fantastic pack was Commodore UK’s bundle of a C64C with the Cheetah gun. The Centre for Computing History’s example contains “a Cheetah Light Gun, Datassette unit (model C2N), Blaze out software pack, the Toolbox range of cassettes, and a C64c” and dates it March 1989; the C64-Wiki dates it to the Christmas 1989 market and adds 3D glasses.78 The year 1989 is common to both.

3.6 C64 light-gun games
The C64-Wiki’s list of light-gun titles, cross-checked against the Light Fantastic catalogue entry, the Stack bundle and the VICE source:473
Table 2 — C64 light-gun games
| Title | Gun it came with or was written for | Second source |
|---|---|---|
| High Noon, Shooting Gallery, Grouse Shoot | Stack Light Rifle | WoS / Sinclair User 1984 (Spectrum bundle) |
| Gunslinger | Magnum Light Phaser (C64) | MobyGames |
| Blaze Out (compilation) | Light Fantastic pack, Defender 64 | Centre for Computing History; VICE calibrates against it |
| Army Days, Baby Blues, Cosmic Storm, Gangster, Ghost Town, Goosebusters, Time Traveller | Defender 64 compatible | Centre for Computing History list |
| Operation Wolf, Operation Thunderbolt | Defender 64 compatible | Centre for Computing History list |
| Mike Gunner, Target Plus | Gun Stick | Also Gun Stick titles on the Spectrum (ZXDB) |
| Big Game Safari, Crow Shoot, Escape From Alcatraz, Rats & Cats, Space Gun, Thunder 4th | Not recorded | C64-Wiki only |
VICE’s source mentions “3-D Action Pack” as a second calibration target for the Magnum and Defender type. No manual for any of these games was read, so the pairings are the collectors’.
3.7 Light pens on the C64
Pens were more common than guns on the C64. The VICE source models three kinds: a pen with its button on joystick up (the Atari CX75 convention), one with its button on joystick left, and a Datel pen with the button on left and its own calibration offset; plus the Inkwell pen, whose two buttons use left and POT X.3 A C64 pen with its software disk is shown below. All read LPX and LPY the same way; only the button wiring and the delay differ.

3.8 Amiga: the beam trigger on pin 6
The Amiga kept the arrangement and documented it in its Hardware Reference Manual under “Reading a Light Pen”:9
A light pen can be connected to one of the controller ports. On the A1000, the light pen must be connected to port 1. Changing ports requires a minor internal modification. On the A500, A2000 and A3000 the default is port 2. An internal jumper can select port 1. Regardless of the port used, the light pen design is the same.
The manual describes the sequence. Capture is enabled “just as the system exits vertical blank”; the pen “converts this light pulse into an electrical pulse on the “Beam Trigger” line (pin 6)”; and “This trigger signal tells the internal circuitry to capture and save the current contents of the beam register, VPOSR.” Pin 6 is also the port’s fire button. The pen’s tip switch “is connected to one of the potentiometer inputs and must be read as same as the right or middle button on a mouse.”
Table 3 — Amiga: the beam trigger on pin 6
| Item | Value (Amiga HRM) |
|---|---|
| Enable | Write 1 to bit 3 of BPLCON0 ($DFF100) |
| Registers | VPOSR ($DFF004): bit 0 = V8. VHPOSR ($DFF006): bits 15–8 = V7–V0, bits 7–0 = H8–H1 |
| Resolution | Vertical: 1 line non-interlaced, 2 interlaced. Horizontal: 2 low-resolution pixels |
| Behaviour | Frozen on the trigger; if none, “the counters latch at the end of the display field”; released “at the end of internal vertical blanking (vertical position 20)“ |
| Did it fire? | ”There is no single bit in the system that indicates a light pen trigger.” Read VPOSR twice; if the values differ, no trigger; if equal, compare with $10500 (V = 261) |
The “read twice” test is worth noting for any modern design. With no status flag, the program has to infer whether the latch fired from whether the counter is still moving.
The Amiga had light-gun games, and the Trojan Phazer is reported in secondary sources to have been sold for it; no Amiga gun’s manual or wiring was read for this dive, so none is described here.
3.9 What could not be verified
- Any PET pen or gun, or a PET connector carrying a pen line.
- The C64 gun wirings come from the VICE emulator’s source, not from the makers. They are consistent with the guns’ reported incompatibilities, and VICE runs the games with them.
- Trojan Phazer for the C64 and the Amiga, and Terminator Laser (listed by the C64-Wiki): not confirmed by a second source.
- The Light Fantastic pack’s exact year and contents: the two sources differ (March 1989 with tape software; Christmas 1989 with 3D glasses).
- The C128’s VDC light-pen input: from the VICE source only.
Sources
Footnotes
-
Commodore, VIC-20 Programmer’s Reference Guide, 1st edition, 6th printing, 1983, p. 250 “Using a Light Pen on the VIC”, p. 215 register chart, and appendix “Game I/O”, https://archive.org/details/VIC-20ProgrammersReferenceGuide1stEdition6thPrinti, read 2026-10-19. ↩
-
Commodore, Commodore 64 Programmer’s Reference Guide, 1983, p. 342 “The Game Ports”, appendix I (control port 1 pinout) and appendix N (6566/6567 VIC-II, “Light Pen”), https://archive.org/details/Commodore_64_Programmers_Reference_Guide_1983_Commodore, read 2026-10-19. ↩
-
VICE emulator source,
vice/src/joyport/lightpen.c(Hannu Nuotio, Marco van den Heuvel; GPL-2), connection tables in the header comment and the pen-type table, https://github.com/VICE-Team/svn-mirror/blob/main/vice/src/joyport/lightpen.c, read 2026-10-19. ↩ ↩2 ↩3 ↩4 -
C64-Wiki, “Light gun”, https://c64-wiki.com/wiki/Light_gun, read 2026-10-19. ↩ ↩2 ↩3
-
World of Spectrum, Hardware Feature 8, “Stack Light Rifle”, quoting Sinclair User, May 1984, https://worldofspectrum.org/hardware/feat8.html, read 2026-10-19. ↩
-
MobyGames, “Gunslinger” (Commodore 64, 1990), https://www.mobygames.com/game/65492/gunslinger, read 2026-10-19 (search excerpt). ↩
-
Centre for Computing History, “Defender 64 Light Gun”, catalogue CH52968, https://www.computinghistory.org.uk/det/52968/Defender%2064%20Light%20Gun, and “Commodore 64 C Light Fantastic Pack”, CH55772, https://www.computinghistory.org.uk/det/55772/Commodore-64-C-Light-Fantastic-Pack/, both read 2026-10-19. ↩ ↩2 ↩3
-
C64-Wiki, “Commodore C64 Light Fantastic (Collection)”, https://www.c64-wiki.com/wiki/Commodore_C64_Light_Fantastic_(Collection), read 2026-10-19 (search excerpt). ↩
-
Commodore-Amiga, Amiga Hardware Reference Manual, 3rd edition, Addison-Wesley, 1991, “Reading a Light Pen”, pp. 237–238, https://archive.org/details/amiga-hardware-reference-manual-3rd-edition, read 2026-10-19. ↩
Comments (0)