Eagle's 7800 Tools — Interactive Reference

7800 SOFTWARE GUIDE

Based on the original Atari/GCC documentation • 8BitDev.org Wiki
SALLY 6502 MARIA GPU TIA AUDIO 6532 RIOT
🔍
01 SYSTEM OVERVIEW

The Atari 7800 combines the 2600 hardware with the MARIA custom graphics chip. In 7800 mode, the system provides 4K RAM, MARIA-driven video, TIA audio, and 6532 I/O at 1.79 MHz via the Sally (6502) processor.

SALLY (6502)

6502 variant with HALT line for DMA. Runs at 1.79 MHz, slows to 1.19 MHz on TIA/RIOT access. Also used in the Atari 5200.

MARIA GPU

Custom graphics chip — heart of the 7800. Handles all video via Display List driven DMA. Supports 160 and 320 pixel modes with 8 color palettes.

TIA

Partially accessible in 7800 mode ($0000-$001F). Used for sound generation (2 channels) and fire button / paddle input reading.

6532 RIOT

I/O only in 7800 mode — no reliable RAM/timers. Reads joystick directions, console switches (pause, select, reset, difficulty).

6116 RAM — 4K BYTES

Two 6116 2Kx8 chips occupy $1800–$27FF. Shadow mappings extend into zero page ($0040–$00FF) and stack page ($0140–$01FF) for fast access. Display Lists must reside in RAM.

CARTRIDGE SLOT

Extended connector with all 16 address lines, R/W line for cart RAM, phase-2 clock for co-processors, audio/video mix-in lines, and HALT line to distinguish MARIA vs SALLY accesses.

02 MARIA GRAPHICS

MARIA uses a scanline-based approach similar to coin-op hardware. Each raster is composed by writing graphic fragments into Line RAM, specifying horizontal position, palette, and data address. Two Line RAM buffers alternate: one displays while the other is constructed via DMA.

LINE RAM & OBJECT MODEL

No players/missiles/playfield concept. Instead, objects are placed by horizontal position into a bitmap-style Line RAM. Objects overlap with last-specified-on-top priority. Each pixel references one of 8 palettes with 3 colors + transparent.

The only limit to objects per scanline is the DMA time available — all loading must complete within one scanline period.
PALETTES

Eight palettes, 3 colors each. Color zero of any palette = transparent. The BACKGRND register sets the background color.

COLOR REGISTER FORMAT
7C3
Color/Chroma bit 3 (MSB)
6C2
Color/Chroma bit 2
5C1
Color/Chroma bit 1
4C0
Color/Chroma bit 0 (LSB)
3L3
Luminosity bit 3 (MSB)
2L2
Luminosity bit 2
1L1
Luminosity bit 1
0L0
Luminosity bit 0 (LSB)

4 bits color + 4 bits luminosity = 256 available hues. Palette registers: P0C1–P7C3 (write-only).

03 GRAPHICS MODES

Mode selection combines Write Mode (set per-header via 5-byte DL entry) and Read Mode (set via CTRL register). Click a mode to explore:

MODE SELECTION TABLE
MODEWRITE MODE (DL)READ MODE (CTRL)RESOLUTIONCOLORS/PX
160A000160×H2 bits → 3+trans
160B100160×H4 bits → 12+trans
320A011320×H1 bit → 1+trans
320B110320×H2 bits → Pal 0|4
320C111320×H1+palette bits
320D010320×HPal bits → color
04 DISPLAY LISTS

Standard 4-byte Display List entry for direct mode sprites/objects:

BYTE 0: Graphics Address Low
7P2
6P1
5P0
4W4
3W3
2W2
1W1
0W0

BYTE 1: Palette (bits 7-5) | Width in 2's complement (bits 4-0). If byte 1 = 0 → end of DL.

BYTE 2: Graphics Address High
BYTE 3: Horizontal Position (0-159 visible)
Width is 2's complement: for a 2-byte wide object, width field = 256 − 2 = 254 = $FE = 11110.

Extended 5-byte header enables indirect (character) mode and write-mode switching:

BYTE 0: Char Map Address Low
7WM
Write Mode: 0=160x2/320x1, 1=160x4/320x2
61
Always 1 (marks 5-byte header)
5IND
Indirect Mode: 0=direct, 1=indirect/character
40
30
20
10
00

BYTE 1: Write Mode (bit 7), bit 6 must be 1, Indirect flag (bit 5), bits 4-0 = 0

BYTE 2: Char Map Address High
7P2
6P1
5P0
4W4
3W3
2W2
1W1
0W0
BYTE 4: Horizontal Position
Width=0 is valid in 5-byte headers (interpreted as 32). End-of-DL is triggered by byte 1 = 0, which can't happen here since bit 6 = 1.

The Display List List (DLL) is a series of 3-byte entries pointing to Display Lists and defining zones:

7DLI
DL Interrupt flag (NMI after last line of PREVIOUS zone)
6H16
16-line Holey DMA enable
5H8
8-line Holey DMA enable
40
3O3
Offset bit 3 (zone height MSB)
2O2
Offset bit 2
1O1
Offset bit 1
0O0
Offset bit 0 (zone height LSB)

BYTE 0: DLI | Holey DMA flags | Offset (zone height − 1)

BYTE 1: Display List Address High
BYTE 2: Display List Address Low
Offset is added to the graphics data high address on each scanline — this allows one DL to serve multiple rasters. Each raster of graphics must be separated by $100 bytes (one page).
ZONE MECHANICS

A zone is a group of rasters defined by one DLL entry. Zone height = OFFSET + 1 (up to 16 lines). Larger zones = less RAM for DLLs and Display Lists, but objects need zero-padding for smooth vertical scrolling.

For a 16-high zone, an 8px (2 byte) wide object at the bottom line needs 15 lines of zeros above it. Holey DMA solves this by interpreting certain addresses as zeros without needing actual zero data.

HOLEY DMA

H16: Odd 4K blocks above $8000 treated as zeros (for 16-line zones).

H8: Odd 2K blocks above $8000 treated as zeros (for 8-line zones).

These "hole" areas can contain code, tables, or other graphics used in non-holey zones. Only 3 DMA cycles penalty per holey read.

05 DMA CYCLE CALCULATOR

Calculate DMA cycle usage for a scanline. Total available: 454 MARIA cycles per line (7.16 MHz). DMA begins 7 CPU cycles (28 MARIA cycles) into each scanline.

5
0
20
0
0
196
MARIA CYCLES USED
43% of 454 available • 0 CPU cycles free
CYCLE BREAKDOWN
06 TIA SOUND

TIA provides 2 independent audio channels. Each has tone control (AUDC), frequency divider (AUDF), and volume (AUDV). Accessible at $0000–$001F. Any TIA access slows CPU to 1.19 MHz.

SOUND REGISTERS
ADDRREGBITSFUNCTION
$15AUDC04Audio Control Ch.0 — tone/noise type
$16AUDC14Audio Control Ch.1 — tone/noise type
$17AUDF05Audio Frequency Ch.0 — divides 30KHz
$18AUDF15Audio Frequency Ch.1 — divides 30KHz
$19AUDV04Audio Volume Ch.0 — 0=off, 15=max
$1AAUDV14Audio Volume Ch.1 — 0=off, 15=max
AUDC TONE TABLE
VALUESOUND TYPE
$0Silence (divided by 1)
$14-bit polynomial
$2÷15 → 4-bit poly
$35-bit poly → 4-bit poly
$4/$5÷2 pure tone
$6÷31 pure tone
$75-bit poly ÷2
$89-bit polynomial
$95-bit polynomial
$A÷31 pure tone
$BLast 4 bits high
$C/$D÷6 pure tone
$E÷93 pure tone
$F5-bit poly ÷6
07 I/O & 6532
SWCHB — CONSOLE SWITCHES ($282)
7P1 Diff
0=Basic, 1=Advanced
6P0 Diff
0=Basic, 1=Advanced
5
4
3PAUSE
0=pressed, 1=released
2
1SELECT
0=pressed, 1=released
0RESET
0=pressed, 1=released
SWCHA — JOYSTICK DIRECTIONS ($280)
7P0→
P0 Right (0=active)
6P0←
P0 Left (0=active)
5P0↓
P0 Down (0=active)
4P0↑
P0 Up (0=active)
3P1→
P1 Right (0=active)
2P1←
P1 Left (0=active)
1P1↓
P1 Down (0=active)
0P1↑
P1 Up (0=active)
2-BUTTON JOYSTICK SETUP
; Enable 2-button mode LDA #$14 STA CTLSWB ; set bits 2,4 of Port B for output LDA #0 STA SWCHB ; output 0 on bits 2,4 ; Then read buttons: ; INPT0 ($08) = P0 right btn (bit 7=1 pushed) ; INPT1 ($09) = P0 left btn (bit 7=1 pushed) ; INPT2 ($0A) = P1 right btn (bit 7=1 pushed) ; INPT3 ($0B) = P1 left btn (bit 7=1 pushed)
2-button mode with a 1-button joystick may harm the console. Detect via INPT4/5 and disable for that port if needed.
08 REGISTER REFERENCE
ADDRNAMER/WDESCRIPTION
$20BACKGRNDWBackground color
$21-$23P0C1-P0C3WPalette 0 colors 1-3
$24WSYNCWWait for horizontal sync
$25-$27P1C1-P1C3WPalette 1 colors 1-3
$28MSTATRBit 7: VBLANK status (1=VBLANK on)
$29-$2BP2C1-P2C3WPalette 2 colors 1-3
$2CDPPHWDisplay List List pointer high
$2D-$2FP3C1-P3C3WPalette 3 colors 1-3
$30DPPLWDisplay List List pointer low
$31-$33P4C1-P4C3WPalette 4 colors 1-3
$34CHARBASEWCharacter base high address (indirect mode)
$35-$37P5C1-P5C3WPalette 5 colors 1-3
$38OFFSETWInternal — set by DLL entries
$39-$3BP6C1-P6C3WPalette 6 colors 1-3
$3CCTRLWMARIA control register
$3D-$3FP7C1-P7C3WPalette 7 colors 1-3
CTRL REGISTER ($3C)
7CK
Color Kill: 0=normal, 1=no color burst (B&W)
6DMA1
DMA Control high bit
5DMA0
DMA Control low bit. 0/1=TEST, 2=normal, 3=off
4CW
Char Width: 0=1-byte, 1=2-byte chars
3BC
Border: 0=black border, 1=BACKGRND color
2KM
Kangaroo Mode: 0=normal, 1=no transparency
1RM1
Read Mode high bit
0RM0
Read Mode low bit. 00=160A/B, 10=320B/D, 11=320A/C
DMA Control 0 or 1 = TEST MODE — may damage console! Always use 2 (normal) or 3 (off). Turn DMA on during VBLANK only.
ADDRNAMER/WDESCRIPTION
$01INPTCTRLWMode control (7800/2600 switching)
$08INPT0RPaddle 0 / P0 right button (2-btn mode)
$09INPT1RPaddle 1 / P0 left button (2-btn mode)
$0AINPT2RPaddle 2 / P1 right button (2-btn mode)
$0BINPT3RPaddle 3 / P1 left button (2-btn mode)
$0CINPT4RP0 fire button (bit 7=0 pressed)
$0DINPT5RP1 fire button (bit 7=0 pressed)
$15AUDC0WAudio control channel 0
$16AUDC1WAudio control channel 1
$17AUDF0WAudio frequency channel 0
$18AUDF1WAudio frequency channel 1
$19AUDV0WAudio volume channel 0
$1AAUDV1WAudio volume channel 1
ADDRNAMER/WDESCRIPTION
$280SWCHAR/WPort A — joystick directions / controller I/O
$281CTLSWAR/WPort A DDR (0=input, 1=output)
$282SWCHBR/WPort B — console switches
$283CTLSWBR/WPort B DDR
$284INTIMRInterval timer read (unreliable w/DMA)
$294TIM1TWSet 1-clock interval (838 ns)
$295TIM8TWSet 8-clock interval (6.7 µs)
$296TIM64TWSet 64-clock interval (63.6 µs)
$297T1024TWSet 1024-clock interval (858.2 µs)
RIOT timers and RAM are unreliable with DMA active. Double-write and verify for reliability. See RIOT Limitations on 8BitDev.org.
09 MEMORY MAP

Click any region to see details. Shadow regions provide fast zero-page and stack access to the 6116 RAM.

10 FRAME TIMING
NTSC

263 rasters per frame (~60 Hz)

Visible screen: rasters 16–258

Safe area: rasters 41–233 (192 scanlines)

Scanline: 227 pixels = 454 MARIA cycles = 113.5 CPU cycles

PAL

313 rasters per frame (~50 Hz)

Visible screen: rasters 16–308

Safe area: rasters 41–281 (240 scanlines)

Scanline: 227 pixels = 454 MARIA cycles = 113.5 CPU cycles

SCANLINE BREAKDOWN

HBLANK: 67 pixels (134 MARIA cycles, 33.5 CPU cycles)

Visible: 160 pixels (320 MARIA cycles, 80 CPU cycles)

DMA starts 7 CPU cycles (28 MARIA cycles) into each scanline. MARIA @ 7.16 MHz, Sally @ 1.79 MHz (÷4 ratio).

DMA startup uncertainty: up to ~3 extra cycles at normal speed, ~5 if CPU is in slow (TIA/RIOT) access. One 7.16 MHz cycle between DMA shutdown and DLI generation.