CARTDUMP: A One-Sector Cartridge Dumper from the 1980s Resurfaces
In May 2021 the AtariAge programmer glurk was going through his 40-year-old floppies and found CARTDUMP, a program that fits in a single sector. He had used it around 1984 to back up cartridges on his Atari 800. He hand-disassembled it, posted the commented listing, and the thread became a short history of home-made cartridge dumping, plus some advice for people dumping carts now.
How it worked
CARTDUMP is about 73 bytes of 6502 code loaded at $0600 (page 6). It sets up the disk device control block for drive 1, command $57 (write with verify), with the buffer at $8000, the start of the right-hand "B" cartridge slot on the 800, and sector 1 as the first sector. It then loops, writing 128-byte sectors through the OS routine DSKINV ($E453) and adding 128 to the buffer address each time, until it has written $80 (128) sectors, 16K in all. Then it halts in an endless loop.
The procedure was simple:
- Defeat the 800's cartridge-door interlock and boot DOS with the door open.
- Binary-load CARTDUMP and start it with DOS's run-at-address option (
M, address0600). - Swap in a blank disk and plug the cartridge into slot B while the machine is on.
CARTDUMP then writes the raw cartridge contents to the disk, starting at sector 1.
There was an extra surprise. A loop that reads PORTA was supposed to wait for the joystick to be moved before writing, but in practice the dump started as soon as the cart went in. glurk guessed that PORTA glitched when a cartridge was inserted, but another member replied that it doesn't. A suggested change, waiting for the fire button (TRIG0) instead, worked when glurk tried it.
Why it's more than a curiosity
Other members pointed out that undumped cartridges still turn up every year, such as a newly found Roklan prototype being discussed at the time. People who own them often ask what to dump them with. Several practical points came out of the thread:
- Hot-plugging is risky. glurk himself doesn't recommend it. ClausB showed a cartridge extender he had built with a switch to disable the ROM, so the cart can stay seated while the machine boots.
- XL/XE machines are different. The OS watches the cartridge state during vertical blank (
TRIG3shows whether a cart is present) and will lock up or reboot if it changes. A dumper has to set theCRITICflag to skip stage-2 VBI processing first. - Better tools exist. Jindroush's Cartridge Dumper (2001) has disk and SpartaDOS X piggyback versions, but its disk output format was never documented. The AtariMax USB Cartridge Programmer, with its PC software, can dump almost any cartridge.
- CARTDUMP handles neither bank-switched carts nor anything above 16K.
Where to find it
The full commented disassembly is in glurk's first post in the "CARTDUMP" thread in AtariAge's 8-bit programming forum. It is worth reading as a compact example of calling DSKINV directly to write raw sectors. For a real dump of a rare cartridge, though, use a cartridge programmer or a switched extender rather than hot-plugging.
Credits
- AtariAge — CARTDUMP — AtariAge forum members
- AtariAge — CARTDUMP (extender, XL/XE notes, Jindroush dumper) — AtariAge forum members
