🏠 Atari Jaguar Developer Reference ▸ CD-ROM Subsystem ▸ CD-ROM Programming Procedures & Guidelines

CD-ROM Programming Procedures & Guidelines

Practical recipes for booting from CD, reading data reliably, minimizing delays, swapping discs, and the rules your title must follow for production approval.

Source: Jaguar CD-ROM developer manual (scanned), © Atari Corp. 1995, §2 and §6 (pp. 5–14, 27–31, printed). This is a “living document” in the original — details may change, but not in ways that require game-code changes.

Boot sequence

  1. The CD Boot ROM authenticates the disc, then loads the TOC to $2C00.
  2. It reads the boot track (first track of Session #1), takes the load address and code length from the two Motorola longwords after the header, and loads up to 64 KB of your startup code to that address.
  3. It transfers 68000 control to the start of your startup code.
  4. Your code parses the TOC at $2C00, finds the first track of Session #1, and computes all other track/time codes as offsets from it.

See boot track format.

Do: rely on the TOC at $2C00 (already loaded for you). Don’t: call CD_getoc in shipping code, and don’t reference absolute track numbers — mastering renumbers them.

Reading data reliably

Typical flow (GPU path):

  1. CD_setup — once, before anything else.
  2. CD_mode — set speed (double) and mode (data).
  3. One of CD_init / CD_initf / CD_initm — once, to load the GPU ISR.
  4. CD_read — as many times as needed; it returns immediately.
  5. Poll CD_ptr for the write position; check err_flag.
  6. CD_uread to stop a transfer early or free resources.

Inexact reads. With CD_init/CD_initf, request a time code 6 frames before the data you need and search the first 31 frames (72,912 bytes) for your partition marker. With CD_initm, the BIOS finds the marker (passed in D1) and auto-locates the data — no manual search.

The latency rule. At double speed the CD interrupt fires every ~90 µs, leaving a usable budget of ≈54 µs (less with heavy Object Processor use). No processor with priority over the GPU may hold the bus longer than that.

DSP read path (alternative). Install a DSP I²S handler, call CD_jeri, set SMODE = $14 (restore the Boot ROM default $15 when done). No CD_init needed, but DSP transfers can have infrequent unreported errors — checksum data that must be perfect.

Error handling (mandatory)

Minimizing startup delay

Startup runs disc authentication, which scans your code for partition markers that split data into manageable blocks.

Minimizing loading delay

Accessing additional discs

For multi-disc titles, or to let the user swap in a Red Book audio disc, CD_switch (BIOS rev 4.0+) accepts a new disc and re-reads the TOC without a reset.

Procedure:

  1. CD_stop with “wait for completion” set.
  2. Display a graphic asking the user to insert the disc.
  3. Call CD_switch (stay in “wait for completion”).
  4. The BIOS waits for the lid to open then close; if a disc was inserted it reads the new TOC to $2C00 and returns. (If no disc was inserted, it keeps waiting.)
  5. Assume nothing about CD state afterward — reissue CD_mode etc.
  6. Parse the new TOC at $2C00 and branch on what it is.

Disc-switch decision flow (from the manual’s flowchart):

CD_switch disc-swap flowchart: CD_stop (wait), show an insert-disc graphic, call CD_switch, the BIOS waits for the lid to open then close, loops until a disc is inserted, reads the TOC to $2C00, then your code parses the TOC and branches on whether it is the wrong multi-session disc, the requested multi-session disc, or a single-session disc.

Do’s and don’ts (summary)

Do

Don’t

See also


Prev: Disc & Data Format  ·  🏠 Home  ·  Next: CD-ROM Hardware

Jump to: Architecture · Memory Map · Registers · Instructions · Glossary · CD-ROM