Programming the Atari 1020 Color Printer/Plotter
The Atari 1020 Color Printer is not really a printer at all. It is a small four-pen plotter that draws with tiny ballpoint pens (black, blue, green and red) on a roll of narrow paper. Text is drawn stroke by stroke, so it can be any of 64 sizes and face in four directions, and graphics are smooth lines rather than dots. Its mechanism, made by ALPS, also turns up in the Commodore 1520, the Radio Shack CGP-115 and several pocket-computer printers. On the Atari it connects straight to the serial bus as a P: device, and in the mid-1980s it was sold off so cheaply that it became a popular way to get colour hardcopy.
What you'll learn: text mode and its widths, switching to graphics mode, every graphics command, how to send several commands at once, and a worked example.
What you need: a 1020 (or Altirra, which emulates it and shows the plotted output on screen) and Atari BASIC. We had no plotter on hand, so the examples here were checked carefully against the owner's guide and the Antic programs listed under Further reading, but not run.
1. Opening the plotter and text mode
The 1020 is opened like any printer:
10 OPEN #2,8,0,"P:"
20 ? #2;"HELLO FROM THE 1020"
After the OPEN it is in text mode, at 40 characters per line. Anything you PRINT is drawn as text in the current pen colour. Three escape sequences change the width:
| Width | Characters sent | From BASIC |
|---|---|---|
| 20 columns | ESC, CTRL-P | ? #2;CHR$(27);CHR$(16) |
| 40 columns (default) | ESC, CTRL-N | ? #2;CHR$(27);CHR$(14) |
| 80 columns | ESC, CTRL-S | ? #2;CHR$(27);CHR$(19) |
The owner's guide writes these as "ESC ESC CTRL P" because of how you type them inside quotes: the first ESC tells the screen editor to put the next key into the string literally, so ESC ESC puts one ESC character in. The listings on the Antic disk confirm that only one ESC is actually stored. Building the string with CHR$ avoids the question entirely. ESC with CTRL-W and CTRL-X switch the international character set on and off.
2. Graphics mode
ESC followed by CTRL-G switches to graphics mode:
30 ? #2;CHR$(27);CHR$(7)
In graphics mode, each PRINT is a command: one letter followed by numbers. A returns to text mode. The full set:
| Command | Meaning |
|---|---|
H |
Home: return the pen to its starting position |
Cn |
Pen colour: 0 black, 1 blue, 2 green, 3 red |
Ln |
Line type: 0 solid, 1–15 dashed with increasing dash length |
Dx,y |
Draw a line to x,y (pen down) |
Mx,y |
Move to x,y with the pen up |
I |
Initialise: make the current pen position the new 0,0 |
Jx,y |
Relative draw: draw by x,y from the current position |
Rx,y |
Relative move |
Xa,d,n |
Draw an axis with n scale marks d units apart. a = 0 for a Y axis, anything else for an X axis |
Qn |
Direction of text drawn with P: 0–3 (four directions at 90° steps) |
Sn |
Character scale, 0–63 |
Ptext |
Draw text in graphics mode at the pen position |
A |
Back to text mode |
Coordinates: x runs from 0 to 480 across the paper, and y from −999 to 999. The paper moves to give the vertical axis, and negative y is further down the roll. The listings in Antic move to M220,-200 to work below the first plot.
3. Chaining commands
Several commands can go in one PRINT, separated by asterisks:
? #2;"H*C1"
? #2;"D240,240*M0,0*D50,280"
The owner's guide warns that other separators don't work. With colons, the plotter executes the first command and ignores the rest. A single D or M can take a series of points separated by semicolons, which draws a connected path: "D100,0;100,100;0,100;0,0".
When you build commands from numbers in BASIC, print the parts with semicolons so no spaces creep in. Atari BASIC doesn't add spaces around numbers, so ? #2;"D";X;",";Y sends exactly D x , y. Kris Cruz's demonstration programs in Antic (February 1986) send unrounded values from SIN and COS this way.
4. A worked example
This draws a pair of axes, plots a sine wave in red and labels it in blue:
10 REM 1020: AXES, SINE WAVE, LABEL
20 OPEN #2,8,0,"P:":DEG
30 ? #2;CHR$(27);CHR$(7):REM GRAPHICS MODE
40 ? #2;"C0*X1,20,18":REM BLACK X AXIS: 18 MARKS 20 APART
50 ? #2;"M0,-100*X0,20,10":REM Y AXIS, 10 MARKS
60 ? #2;"C3*M0,0"
70 FOR X=0 TO 360 STEP 5:? #2;"D";X;",";50*SIN(X):NEXT X
80 ? #2;"C1*M20,-130*S2*Q0*PSINE WAVE"
90 ? #2;"H":? #2;"A":CLOSE #2
How it works:
- Line 40 draws the X axis from the home position, with 18 marks 20 units apart: 360 units, one per degree.
- Line 50 moves down 100 units and draws a Y axis with 10 marks, the same pattern Cruz uses (
X0,10,20after a move). - Line 70 is the plot: DEG makes SIN work in degrees, and each D draws to the next point. Amplitude 50 keeps the curve between −50 and 50.
- Line 80 changes to the blue pen, moves below the graph, sets a small scale, chooses the normal text direction and draws the label with P.
- Line 90 parks the pen, returns to text mode and closes the channel.
If the axis comes out in a different place from what you expect, remember that X draws from the current pen position. Move first.
5. Scaled text and banners
The S command affects text in both modes. The owner's guide's troubleshooting section explains a classic mistake: if you send "S45" while still in text mode, the plotter simply writes the characters "S45". Enter graphics mode, send the scale, then A to return to text mode, and everything you print afterwards is large. Combining S with Q (direction) and P lets you draw giant lettering down the paper, which is how 1020 banner programs worked.
6. Care and feeding
- Each time it is switched on, the 1020 draws a test pattern of four small squares, one per pen. It is a quick way to see which pen is running dry.
- The CHANGE PEN button moves the carriage to the pen-changing position. Holding it for more than three seconds instead re-runs the test pattern. COLOR rotates the pen barrel, and PAPER feeds paper and returns the carriage home.
- To load paper, feed the trimmed end into the slot and turn the roller until the paper comes out under the two brass pinch rollers. Otherwise it won't feed.
- Pens were sold in packs of four, either mixed colours or all black, along with replacement paper rolls. Old pens dry out, so expect to hunt for compatible ones today.
- The 1020 uses a 9 V AC adapter of the same type as the 400/800 family's other peripherals.
7. Software
Schools used the 1020 with Atari Logo to give students colour printouts of their turtle graphics. Utilities such as Screen Plot dumped GRAPHICS 8 and drawing-program pictures to it, and Print 'n Draw produced banners and pie charts. The 1020 itself came with a disk of sample programs.
Troubleshooting
- Commands are printed as text: you're still in text mode. Send ESC CTRL-G first.
- Only the first of several commands runs: separate commands with
*, not colons. - Strange characters instead of a mode change: you sent ESC twice. In a CHR$ sequence you need only one.
- Faint or skipping lines: a dry pen. Check the power-on test pattern.
- Paper doesn't advance: it isn't under the pinch rollers.
Further reading
- Atari, Inc., The Atari 1020 Color Printer Owner's Guide (1982, C061368).
- Kris Cruz, "Mastering the Atari 1020 Plotter", Antic, February 1986, with four demonstration listings.
- Eric Clausen, "Plotters for Your Atari", Antic, September 1985: Screen Plot, B/Graph and other plotters.
- On this site: Printing from Atari BASIC, Atari Logo Basics.
Credits
- Picture: Real Atari 1020 output: scaled and coloured text drawn with the four ballpoint pens. — Multicherry, Wikimedia Commons (CC0)
- The Atari 1020 Color Printer Owner's Guide (1982) — archive.org OCR text — Internet Archive, 1982
- Kris Cruz, "Mastering the Atari 1020 Plotter", Antic, February 1986 (command table, coordinates, demo listings) — AtariMagazines.com (Kevin Savetz), 1986
- Antic disk listings PLOTTER1-4.BAS (Kris Cruz) — single ESC before CTRL-G in stored strings — AtariMagazines.com (Kevin Savetz)
- Eric Clausen, "Plotters for Your Atari", Antic, September 1985 — Eric Clausen; AtariMagazines.com (Kevin Savetz), 1985
- comp.sys.atari.8bit FAQ — 4.2 Atari 1020 (operations, ALPS mechanism, pens, power, sample disk files) — Michael Current (comp.sys.atari.8bit FAQ)
- Altirra changelog — Devices: Added 820, 825, 1020, 1025, and 1029 printers — Screenshot from Avery Lee's Altirra page, virtualdub.org
