Skip to content

SAGA register intake: SAGA-specific registers - #18

Merged
WDrijver merged 12 commits into
mainfrom
intake-saga-registers
Nov 4, 2026
Merged

WDrijver merged 12 commits into
mainfrom
intake-saga-registers

Conversation

@WDrijver

@WDrijver WDrijver commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Document intake (CONTRIBUTING.md section 11) of the SAGA register documentation.

What this PR does

  • Original: sources/official/saga-registers/, the 93 HTML pages copied verbatim from ApolloClaude docs/hardware/sagadoc.
  • Converter: tools/intake/sagaregs.py, standard library only. CI runs it with --check, like the PRM converter.
  • Output: 12 generated files in core/saga-registers/. All are origin: official, status: draft, owner WDrijver, applies_to.core: "Core 12000+".
File Content
index.md Scope, access codes, files, register map, corrections, open questions
chunky-plane.md GFXMODE (21 resolutions, pixel formats), chunky pointer and modulo
colour-ports.md Planar, sprite, chunky and PIP colour ports
pip.md PIP 1 (original) and PIP 2 (ApolloLib), the two modes
pointer.md Pointer position, the 32x32 sprite (ApolloLib), 12-bit colours
display-control.md SAGA CONTROL, SCREEN SHIFT, SCREENMODE ADJUST
sprite-collision.md clxdat0–7
arne-channels.md 16 channels at $DFF400 + n × $10, CTRL/LEN/VOL/PER
arne-dma-and-interrupts.md DMACON2, INTENA2, INTREQ2
maggie-3d.md Official names of the 3D registers
input.md USB joypads, mouse wheel, DB9, POTGO fire buttons
system.md Board ID, core revision, chip ID, SPI

Scope (agreed 2026-11-04)

  • index.htm is the current table; saga.htm is not used. The Atari section is skipped.
  • Only SAGA-specific registers, option (b):
    • every row of the original is marked SAGA;
    • the converter takes the 183 rows where OCS, ECS and AGA are empty;
    • it adds 4 SAGA addresses that the original also marks as classic ($DFF1D0/$DFF1D2 pointer position, $DFF20A/$DFF20C DB9).
  • Classic registers: "the HRM applies; on SAGA, pointers are 32-bit and reach all RAM".

Corrections applied by the converter (the original should be fixed the same way)

  • Address typos:
    • $DFFAA0 → $DFF4A0;
    • $DFF4C4C → $DFF4CC;
    • $DFF21c → $DFF21C.
  • Description typos:
    • AUD3L is called "channel 1";
    • BPLHPTH/BPLHPTL say 15 bits; it should be 16;
    • "Vaniall".
  • Access: $DFF3EC is W, not R (WDrijver).
  • Page selection: the converter uses the right pages for the Arne rows instead of the wrong links. It leaves out the copied example on the screen adjust page, and notes the wrong title of the screen shift page.
  • Layout check: the converter checks all 80 Arne rows against $DFF400 + n × $10 and fails if one doesn't fit.

Added from other sources, tagged (SRC) or WDrijver

  • PIP 2: $DFF3B0–$DFF3C2, colour port $DFF37C. ApolloLib is leading, as agreed.
  • PIP register meanings: the format bit 8 transparency, colour key, DMA row length (0 = off), and overlay and chroma-key modes. Sources: ApolloLib and the SAGAPiP example.
  • Pointer:
    • read-back at $DFE1D0/$DFE1D2;
    • the 32x32 sprite: image at $DFD000, palette at $DFF3A8/$DFF3AA.
    • Sources: ApolloLib and the ApolloPointer example.
  • Arne:
    • volume $00–$FF per side, and the LEN unit for 16-bit stereo (ApolloLib);
    • channels 0–3 = Paula channels 0–3 (WDrijver).
  • Board IDs: $03/$04/$05/$07/$08, Salamander and Phoenix (WDrijver); legacy V2 IDs from the ApolloOS source.

ApolloLib version: the converter uses ApolloLib from ApolloCrossDev Projects/ApolloLib (commit 2dfaa5c). The copy in ApolloClaude docs/toolchain/_ApolloLib is older and describes a 16x16 planar pointer at $DFF800 instead; that is listed as an open question.

Answers added during review (2026-11-04)

  • $DFF3EC: write-only, SAGA Control 1 (OCS mode, PAL zoom, zoom mode, scanlines). Source: WDrijver.
  • $DFF3EE: read and write, SAGA Control 2 (zoom shift X and Y in pixels, positive integers). Source: WDrijver.
  • Pointer: from Core 12500 the 32x32x8-bit sprite replaces the 16x16 pointer. It has only 50 % semi-transparency, no real alpha. Source: WDrijver.
  • PIP formats:
    • supported: $01, $02, $03, YUV888 $06, YUV444 $0E; not $04/$05;
    • transparent colour: index $FF in 8-bit, purple (red and blue at maximum) in 15- and 16-bit;
    • ApolloLib wrongly marks YUV as unsupported.
    • Source: WDrijver.
  • Sprites: SAGA has the 8 classic sprites. Source: WDrijver.
  • Read-back:
    • write-only registers at $DFF0xx/$DFF1xx read back at $DFE0xx/$DFE1xx;
    • nothing from $DFF200 up has a read-back shadow.
    • Source: WDrijver.
  • Copper:
    • 32-bit MOVE with bit 15 of the first word set;
    • without FMODE bit 4 (SAGA), the Copper is gated to $DFF0xx/$DFF1xx;
    • with it, the Copper can write every SAGA register up to $DFF4FF, with 16- and 32-bit moves.
    • Source: Gunnar (G).
  • Best practice: prefer library calls (ApolloLib for Arne and Isabelle, maggie.library for Maggie) to direct register access. New file core/best-practices/prefer-library-calls-for-saga-chips.md. Source: WDrijver.

Still open

  1. "IRQ $48/$50": vector offset or vector number, and at which level (in index.md).
  2. Arne maximum rate: see the conflict below. Asked Gunnar for the clock of AUDxPER, the minimum period and the maximum rate.

Conflicts with existing knowledge base files (not resolved here)

  • core/saga-audio-arne/registers.md (TuKo1982, measured) says the high-quality rate caps at about 66 kHz. The original says 56 kHz, and period 65 gives 54.6 kHz.

Other changes

  • AGENTS.md task table and CONTRIBUTING.md: point to core/saga-registers/.
  • The chip folders (saga-video-isabelle, saga-audio-arne, saga-3d-maggie) link to the generated files.
  • core/saga-audio-arne/registers.md: the channel base addresses are now documented.
  • .github/CODEOWNERS: regenerated.

Structural choice to review

The generated files are in one new folder, core/saga-registers/, instead of the chip folders, because:

  • generated files can't share a folder with hand-written registers.md files;
  • input and system registers belong to no single chip.

Knowledge base files relied on

  • core/saga-audio-arne/registers.md
  • core/saga-3d-maggie/registers.md
  • os/libraries/maggie-library.md
  • hardware/index.md

🤖 Generated with Claude Code

Add the SAGA register documentation (HTML, 93 pages) verbatim to
sources/official/saga-registers/ and the converter tools/intake/sagaregs.py,
which generates 12 files in core/saga-registers/: the SAGA-specific rows of
index.htm (OCS, ECS and AGA empty, plus the SAGA addresses the original also
marks as classic), without the Atari section.

The converter applies a listed set of corrections (typos in addresses and
descriptions, $DFF3EC is writable) and adds, with source tags, what the
original lacks: PIP 2 and the 32x32 pointer sprite from ApolloLib, the Arne
volume range, channels 0-3 = Paula, and the board IDs. Open questions are
listed in core/saga-registers/index.md. Point AGENTS.md, CONTRIBUTING.md
and the chip folders to the new folder.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@WDrijver
WDrijver requested a review from TuKo1982 as a code owner November 4, 2026 11:04
WDrijver and others added 10 commits November 4, 2026 14:25
WDrijver, 2026-11-04: $DFF3EC is SAGA Control 1 (OCS mode, PAL zoom, zoom
mode, scanlines), write-only. $DFF3EE is SAGA Control 2 (zoom shift X and
Y in pixels, positive integers), read and write. Add both as corrections
and drop the SCREEN SHIFT open question.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
WDrijver, 2026-11-04: from Core 12500 the 32x32x8-bit hardware sprite
pointer replaces the old 16x16 pointer, and it has only 50 %
semi-transparency, no real alpha. Describe both generations with their
core ranges and drop the pointer open question.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
WDrijver, 2026-11-04: a PIP supports 8-bit indexed, R5G6B5, 1R5G5B5,
YUV888 and YUV444, not 24- or 32-bit. With format bit 8 set, the
transparent colour is fixed: index $FF in 8-bit, red and blue at maximum
(purple) in 15- and 16-bit. ApolloLib still marks YUV as unsupported; that
is an ApolloLib error. Drop the PIP format open question.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
WDrijver, 2026-11-04: SAGA supports the 8 classic sprites, as on the
classic Amiga. Only bits 0-7 of clxdat0-7 refer to real sprites. Drop the
sprites 8-15 open question.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
WDrijver, 2026-11-04: every write-only register at $DFF000-$DFF1FF reads
back at the same offset in $DFE000-$DFE1FF. State the rule in the index,
chunky-plane and pointer files, and narrow the open question to the
write-only registers from $DFF200 up.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
BigGun (Apollo chat, 2026-11-04, relayed by WDrijver): the SAGA Copper can
do 32-bit moves; the first word has its high bit set; SAGA mode needs the
SAGA bit in FMODE; without it the Copper writes only $DFF0xx and $DFF1xx.
Describe the three-word form in colour-ports.md and the FMODE note in the
index, and narrow the Copper open question.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
BigGun is Gunnar, the core developer (WDrijver, 2026-11-04). Tag the
Copper facts (G) and add core-developer to the basis of the files that use
them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Gunnar (G, 2026-11-04): the Copper is gated to $DFF0xx and $DFF1xx unless
the SAGA bit in FMODE is set; with it set, the Copper can write every SAGA
register up to $DFF4FF, with 16- and 32-bit moves. Drop the Copper open
question.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
WDrijver, 2026-11-04: for Arne, Isabelle and Maggie, the library calls are
preferred to direct register access; a best practice, not a forced rule.
ApolloLib for Arne and Isabelle until their official library is released;
maggie.library (github.com/RMortenB/MaggieLibrary, golden source) for
Maggie. Add core/best-practices/prefer-library-calls-for-saga-chips.md,
put the rule in the generated register files and the chip index files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
WDrijver, 2026-11-04: only $DFF0xx and $DFF1xx have read-back shadows at
$DFExxx. The write-only registers from $DFF200 up can't be read back.
State it in the index and drop the read-back open question.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Gunnar (BigGun), 2026-11-04: Arne's period coding is compatible with
Paula and runs at the same clock. State it in arne-channels.md (period 65
= 54.6 kHz with the PAL clock), and narrow the open question to the
minimum period and the "about 66 kHz" in core/saga-audio-arne/registers.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
WDrijver added a commit that referenced this pull request Nov 4, 2026
…Dev #18

ApolloCrossDev #18 fixed the bugs listed in apollolib-known-bugs.md and
added ApolloTimerStop, ApolloRelease, ApolloPermit and ApolloEnable.
Describe that version: the pitfall now lists what was fixed and the limits
that remain; sound, picture, input, memory and system files follow the
fixes, and the restore table names the new functions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@WDrijver
WDrijver merged commit c38bcbc into main Nov 4, 2026
2 checks passed
@WDrijver
WDrijver deleted the intake-saga-registers branch November 4, 2026 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant