Joystick Draw, from Atari to Arcade

—

in , , , , —
Estimated Reading Time: 3 minutes

My first encounter with programming was on the Atari 800 XL. My dad had typed in a program called Joystick Draw and saved it on cassette. I remember examining the program he had typed in. There was a drawing program I could use with a joystick, and there was the code that made it work. Years later, I used the same name for a drawing program of my own, this time for the AtGames Legends Ultimate Mini.

Drawing With Six Buttons

On the cabinet, you move the cursor with the stick and hold A to paint. B opens the color selector, where the same stick moves between swatches and A confirms the choice. C works as an eraser, X and Y adjust the brush size, and Z fills the area under the cursor. The desktop build also accepts a mouse and keyboard, which makes it possible to try the drawing tools without the cabinet.

The Start button has two jobs. A tap saves the drawing as a timestamped BMP, and holding the button for about a second clears the canvas when you release it. If you clear a drawing by accident, Rewind brings it back. The app keeps snapshots of the eight most recent changes in memory, including the canvas before a clear. On OneSauce, the saved BMP goes into a folder beside the executable and contains just the artwork.

From Stick Movement to Pixels

There are two parts to getting a continuous brush stroke. First, SDL has to tell the app which way the stick is pointing. Depending on how the controls show up, that direction can come from a D-pad event, a joystick hat, or an axis. The OneSauce launcher forces SDL’s raw joystick mode so the game can use the Mini’s button mapping across releases with different controller profiles.

Then the program has to fill the space between cursor positions. If the brush only stamped a circle at each new position, a fast stroke could leave gaps. Joystick Draw steps along the line between the old and new positions and stamps the brush along the way. The fill tool works in horizontal runs of matching pixels and looks at the rows above and below for places to continue.

SDL2 scales the interface from a fixed 1280×720 layout. The drawing itself lives on a 1024×672 surface, which gives the brush, fill, undo, and BMP export the same pixel coordinates regardless of display size.

Getting It Onto the Cabinet

The desktop build uses CMake and SDL2. The OneSauce package takes an extra step because the cabinet needs a 32-bit ARM executable. The build script downloads and checks the cross-compiler and SDL2 packages, verifies the binary’s target format, and puts it in a ZIP with the RetroFE launcher files and menu artwork. Extracting the ZIP at the root of the OneSauce drive puts Joystick Draw in the Ports collection.

Conclusion

Drawing with a joystick, whether on an Atari over forty years ago or a modern arcade, does not produce the best drawings. But that’s half the point, creating for the sake of creating. My kids had fun playing with it knowing, just as I did back in the 80s.

Project Code

The source repository is awaiting publication.