# Cartridges ## The slot ([AHRM] 8.1) - The 800 has a left and a right slot, wired slightly differently; every other model (400, XL/XE, XEGS) has the left slot only. - Three windows: left cartridge $A000-$BFFF (RD5), right cartridge $8000-$9FFF (RD4), and cartridge control **CCTL $D500-$D5FF**. The left slot can use all three, the right slot the right window and CCTL (a 16K left cartridge drives both RD4 and RD5). All can be read and written; the cartridge sees R/W. - RD4/RD5 tell the computer to deselect RAM; RD5 is also TRIG3 on the XL/XE ([memory-map.md](memory-map.md)). A bank-switched cartridge can drop RD5 to disappear. - **Bank switches on reads**: CCTL registers that switch on any access fire on false reads (indexed modes' dummy reads, ANTIC DMA from $D5xx) as well; the board must present every bus cycle, dummy and DMA included, to the cartridge, as a5200-python already does for $4000-$BFFF. - **Power-on state**: cartridges without reset circuitry power up in any bank; the cartridge port carries no reset line ([AHRM] 8.1). MAME's XEGS device resets to bank 0 with a "TODO: random" note ([MAME-BSD] `rom.cpp`). Proposed: a machine-row field, default bank 0, and a seeded "random" option for testing (U6). ## Types, and what the local set holds MAME 0.285's CC0 software lists name a slot type per cartridge (`a800.xml`, 474 entries; `xegs.xml`, 44). The local No-Intro set ([census.md](census.md)) holds 30 raw cartridge dumps: | Type (MAME slot) | Local dumps | Banking (facts from [MAME-BSD], BSD-3-Clause) | | --- | --- | --- | | `a800_8k` | 12 | none: 8K at $A000 (RD5) | | `a800_16k` | 7 | none: 16K at $8000-$BFFF (RD4 and RD5) | | `xegs` (32K, 64K, 128K) | 10 | $8000-$9FFF a switchable 8K bank chosen by any write to $D5xx (value masked to the bank count); $A000-$BFFF fixed to the last bank (`xegs_rom_device`, `rom.cpp`) | | not in MAME's lists | 1 (Basketball, 8K) | by size: 8K | MAME's lists give 26 more slot types across the 474 + 44 entries: OSS (`a800_oss8k`, `oss034m`, `oss043m`, `ossm091`), Williams, Diamond, Express, SpartaDOS X (`a800_sparta`, `_128kb`), Atrax, Phoenix, Blizzard, Turbosoft, BBSB (Bounty Bob), right-slot 8K, Corina, Atarimax MaxFlash, SIC!, Ultracart, Telelink II, ADAWLIAH and others (counted from the two lists' `slot` features). Each has a BSD-3 device in `reference/src/mame/src/devices/bus/a800/` (42 files, all `license: BSD-3-Clause` at mame0285): **facts may be used, and code too with the BSD notice kept beside it** (sources.md row "MAME `src/devices/bus/a800/`", proposed). [AHRM] chapter 8 documents several modern ones (Atarimax, MyIDE-II, SIC!, SIDE 1-3, Corina, R-Time 8, Veronica). Nothing from Atari800's or Altirra's cartridge tables (GPL) is used. ## Identification Raw dumps carry no type. As on the 5200 (a5200-python decision 4), the table is seeded from MAME's CC0 lists by SHA-1, with hand rows for what they lack, each row naming its source; size decides the plain cases (8K, 16K); an unknown larger dump is refused unless the player names the type. Atari800's `.car` container (a "CART" header with a type number) is read when given; the type numbers' meaning would have to come from a non-GPL description (U9). ## Proposed order Milestone 4 builds `a800_8k`, `a800_16k`, right-slot 8K and `xegs` first (they cover the local set); OSS, Williams, SpartaDOS X, Atrax, Diamond, Express and Turbosoft next (the common 1980s schemes); flash and modern cartridges last, behind the same socket, each with a test built from the BSD device's documented behaviour and a census title where one exists.