Atari 2600 digital photo frame
This #MakerMonday, we learn how to display photos as blocky 8-bit masterpieces on a classic console with the help of Raspberry Pi Pico. You can find more projects like this in the latest issue of Raspberry Pi Official Magazine.
The Atari 2600 is an iconic console dating back to 1977. But it’s also a machine that is notoriously difficult to program due to its simple, limited hardware. There’s no character ROM, no frame buffer, and only 76 CPU cycles per scan line. What’s more, the console has just 128 bytes of RAM. And yet, for Nick Bild, this is merely a challenge.

“I enjoy pushing this kind of hardware to do things it was never intended to do — things that may not even seem possible to most people,” he says. So while, on the face of it, a digital photo frame program doesn’t sound like a big deal, it’s actually mightily impressive.
Pixel placement
Nick’s program allows photos that have been converted into 8-bit pixel art to be displayed as a slideshow. However, since Atari 2600 cartridges can only contain 4kB of data (or 64kB if they’re bank-switched), he needed to get creative.
To that end, he’s built what he calls a Picotari cartridge, with an edge connector that can slot into the console’s cart port. It supports a Raspberry Pi Pico microcontroller board, which provides two key benefits: it adds extra memory for storing many images and enables the running of his customised Atari 2600 ROM emulator so that the hardware can make use of them.

The Digital Photo Frame program is then able to display each of those photos, in turn, as a 64×84 pixel image. In doing so, the program is fooling the Atari into thinking only one byte is being used for each picture — it’s addressing a specified byte each time another eight pixels are needed to draw a player sprite. Nick uses a trick that employs sprite copies and vertical delays to fit six 8-bit sprites on a single line (giving 48 pixels in total) before drawing another two sprites (an extra 16 pixels) straight after.
“The Atari asks for the data at a given address, and the Pico returns the data that is stored at that address, just like a physical ROM chip in an old cartridge would do,” he explains. “But when a special address is requested, the Picotari sequentially returns data from a special storage area outside of what the Atari can normally access. In this way, image data can be supplied byte by byte, right as it is needed, to draw the images.”
Bit manipulation
For it to work, the images need to be prepared in advance. This is done on a PC using a JavaScript library, Pixel It, with touch-ups from the GNU Image Manipulation Program.

“Aside from lacking in storage space, the Atari is severely constrained in terms of processing power, so the images need to be fed to it in a simple data structure that can drive the display with as few instructions as possible,” Nick says. “I experimented with a few tools to give the images the right 8-bit look at a low resolution, then wrote some scripts to prepare the data structures that were to be loaded onto the Pico.”
The result is a unique app that truly pushes the hardware to produce instantly recognisable pixel-based photos, and Nick has been so inspired that he’s now thinking about creating something like a Game Boy Camera for the system. Not that this will be any easier: “The severe hardware constraints of the Atari make for difficulties every step of the way,” he says.
The post Atari 2600 digital photo frame appeared first on Raspberry Pi.
from News - Raspberry Pi https://ift.tt/1qEOMPi
Comments
Post a Comment