Atari Lynx Cartridge Reader/Writer Board Software

To use the Atari Lynx Cart Programmer Pi-Hat, special software is required. Since the Pi-Hat is meant for use with a Raspberry Pi, its software is built to run in Linux. The software can be used to read all Atari Lynx cartridges and to write/erase compatible flashable cartridges.

Note: Flashable cartridges must be based on the SST39SF010A / SST39SF020A / SST39SF040 CMOS Multi-Purpose Flash chip. Some homebrew cartridge PCBs are too thick to fit the slot connector and will not work (original Alpine Games for example).

^

Building the Software

The programmer board software source code is available from https://bitbucket.org/atarilynx/lynx. The software is currently in rapid development in the programmer-enhancements branch. No binary distribution is yet available, but building it is easy...

git clone -b programmer-enhancements https://bitbucket.org/atarilynx/lynx.git
cd lynx/contrib/blankcart/programmer
make all

This should build the readcart, writecart and romutil commands. These are explained further below.

^

SPI

SPI must be enabled on your Raspberry Pi in order to use this software. Failing to enable SPI, you will get the following output whenever using any of the PiHat software...

Initialising SPI @ 10Mhz
Unable to open SPI device: No such file or directory

To enable SPI, edit your /boot/config.txt and ensure that the following line is not commented out:

dtparam=spi=on

For more information on SPI see this page - SPI - Raspberry Pi Documentation.

^

Reading Cartridges

To read a cartridge, use the readcart command. It's usage is...

Usage: readcart -a|-bN [-h] [-nohdr] [-swvcc] [-turbo] [-v|-vv] [-i|<romfile>]
-a Automatically determine block size
-bN Manually set block size to N, valid values: 512, 1024, 2048, 1024x2
-h Show this summary and exit
-i Show cart information and exit (implies -a)
-nohdr Do not write the LNX file header to romfile
-swvcc Enable SWVCC to allow reading certain cart types
-turbo Use turbo mode, may produce corrupt dumps
-v Set verbose mode
-vv Set verbose debug mode

Examples:

  • ./readcart -a mycart.lnx
  • ./readcart -b1024 -swvcc -turbo -v mycart.lnx
  • ./readcart -a -turbo -vv mycart.lnx
  • ./readcart -a -nohdr mycart.lyx
  • ./readcart -i
^

Writing a ROM to a Blank Cartridge

An LNX format ROM can be written to a special programmable cartridge. The writecart command is used for this purpose. This command will check that a compatible flash cart is inserted into the board before trying to write any data. It's usage is:

Usage: writecart [-nc] [-nohdr -bN] [-turbo] [-v|-vv] <romfile>
-bN Manually set block size to N, valid values: 512, 1024, 2048
-h Show this summary and exit
-nc Do not check if flash chip is compatible - use carefully!
-nohdr Treat input ROM as headerless, must provide -bN option
-swvcc Enable SWVCC to allow writing certain cart types
-turbo Use turbo mode, may produce corrupt carts
-v Set verbose mode
-vv Set verbose debug mode

Examples:

  • ./writecart mycart.lnx
  • ./writecart -turbo -vv -b1024 mycart.lnx
  • ./writecart -nohdr mycart.lyx
^

ROM Utility

There is a ROM utility included that can be used to display information about a ROM, convert LNX to LYX formats (and vice-versa), and to compare ROMs. It's usage is:

Usage: romutil -2lyx|-2lnx|-cmp|-i <romfile> [<romfile2>]
-2lyx Convert LNX ROM romfile to LYX ROM romfile2
-2lnx Convert LYX ROM romfile to LNX ROM romfile2 adding default header
-cmp Compare two ROMs, input can be LNX or LYX files
-h Show this summary and exit
-i Show LNX ROM header information

Examples:

  • ./romutil -i mycart.lnx
  • ./romutil -2lyx mycart.lnx mycart.lyx
  • ./romutil -2lnx mycart.lyx mycart.lnx
  • ./romutil -cmp mycart.lnx mycart.lyx
^
Changed

Did we get something wrong or you have something to contribute? Please tell us about it!

We're looking for content editors and maintainers, if you want to help us out, let us know!