Skip to content

First examples: SAGA PIP (ApolloPiP) and the SAGA hardware pointer (ApolloPointer) - #20

Merged
WDrijver merged 10 commits into
mainfrom
content-example-sagapip
Nov 4, 2026
Merged

WDrijver merged 10 commits into
mainfrom
content-example-sagapip

Conversation

@WDrijver

@WDrijver WDrijver commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

The first two files in examples/, both from ApolloCrossDev examples at commit ad7f0b4. Contains #19's commits until #19 is merged; then only the examples and the CI change remain.

examples/saga-pip-overlay-and-chroma-key.md (ApolloPiP, formerly SAGAPiP)

  • Code (kb:compile):
    • ShowPiP1Overlay: an 8-bit PIP in front of the screen, palette index $FF transparent;
    • ShowPiP1Behind: a 16-bit PIP behind the screen, visible through purple;
    • HidePiP1.
    • Since ApolloLib a9a994f, ApolloShowPiP1 loads the 8-bit palette itself.
  • The full example: what ApolloPiP adds, and what ApolloCrossDev ApolloLib in toolchain/apollolib/, with its known bugs #19 fixed in it:
    • the PIP palette;
    • positional initializers that put target into palette[2];
    • the hard-coded Workbench mode $0A04;
    • if (!&pipwindow);
    • BMB_ bits used as BMF_ flags;
    • the exit paths and leaks.

examples/saga-pointer-sprite.md (ApolloPointer)

  • Code (kb:compile):
    • SetPointerFromBMP returns the result code of ApolloLoadPointer (ApolloLib b9891d9+);
    • MovePointer.
  • The full example: what ApolloCrossDev maggie.library function reference, checked against the source #21 fixed in ApolloLoadPointer:
    • no result and no bLoaded;
    • 24-bit BMPs not converted;
    • the BMP not freed;
    • alpha read correctly only with endian set;
    • "colour 1 is semi-transparent", which is no longer true.

ApolloLib and SAGA register files

  • Name: the ApolloPiP rename everywhere, including the SAGA register converter's source line; the converter files are regenerated.
  • Pointer fixes: the ApolloLoadPointer fixes are recorded in toolchain/apollolib/picture.md and apollolib-known-bugs.md.
  • Commits cited: ad7f0b4, b9891d9, a9a994f.

CI change

  • tools/compile-snippets.sh: adds -I$APOLLOLIB when APOLLOLIB is set.
  • compile-examples job: fetches ApolloCrossDev Projects/ApolloLib (sparse, about 480 KB) at the toolchain's commit, also on a cache hit.
  • Tested locally: all three snippets (two examples, the vasm one) compile against ApolloLib ad7f0b4 with -Wall.

Knowledge base files relied on

🤖 Generated with Claude Code

WDrijver and others added 4 commits November 4, 2026 17:11
Describe ApolloLib (ApolloCrossDev Projects/ApolloLib, commit ce1fcbf,
after the merge of the two versions in ApolloCrossDev #16 and #17): how a
project uses it, sound on Arne, pictures, PIP and the pointer, input,
memory and blit routines, system and timing, and the serial debug output.
toolchain/pitfalls/apollolib-known-bugs.md lists what reading the code
found, among them the 320-pixel fall-through in ApolloShowPicture, the
VBlank server of ApolloTimer that is never removed, and the takeover
helpers without restore.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…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>
examples/saga-pip-overlay-and-chroma-key.md takes the PIP part of
ApolloCrossDev's SAGAPiP example (commit 5ad4035) as three compiling
functions on ApolloLib, and lists the problems of the full example: no PIP
palette, a window check that can't fail, BMB_ bits used as BMF_ flags, a
hard-coded Workbench mode, and leaks on the error paths.

CI: compile-snippets.sh adds -I$APOLLOLIB when set; the compile-examples
job fetches ApolloCrossDev Projects/ApolloLib (sparse, same commit as the
toolchain) so snippets can include ApolloCrossDev_Lib.h.

ApolloLib files: ApolloShowPiP1/2 don't load an 8-bit PIP's palette (a
regression from the older ApolloLib).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@WDrijver
WDrijver requested a review from TuKo1982 as a code owner November 4, 2026 14:43
WDrijver and others added 3 commits November 4, 2026 17:46
Correct the history: ApolloLoadPicture wrote the palette into the colour
port chosen by picture->target until ApolloCrossDev commit 789cbcc
(2026-06-16), which made palette an array for the pointer. SAGAPiP
(2026-06-03) still relies on the old behaviour.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ApolloCrossDev #19 made ApolloShowPiP1/2 load the 8-bit palette and fixed
the SAGAPiP example. The example page now calls ApolloShowPiP1 without its
own palette loop, and its "full example" section lists what #19 changed.
The PIP palette moves from the remaining limits to the fixed bugs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
examples/saga-pointer-sprite.md takes ApolloCrossDev's ApolloPointer
example: SetPointerFromBMP and MovePointer on ApolloLib, compiling. It
records the points of ApolloLoadPointer that the code works around: no
return value and bLoaded never set, 24-bit BMPs accepted but not
converted, the loaded BMP not freed, alpha read correctly only with
endian set.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@WDrijver WDrijver changed the title First example: SAGA PIP in overlay and chroma-key mode First examples: SAGA PIP (ApolloPiP) and the SAGA hardware pointer (ApolloPointer) Nov 4, 2026
@WDrijver
WDrijver changed the base branch from content-apollolib to main November 4, 2026 15:40
WDrijver and others added 3 commits November 4, 2026 18:41
ApolloCrossDev #20 renamed SAGAPiP to ApolloPiP, #21 fixed
ApolloLoadPointer (result code, 24-bit, BMP freed). Cite commit ad7f0b4,
rename the example everywhere (also in the SAGA register converter, and
regenerate), simplify the pointer example to use the result code, and add
the ApolloLoadPointer fixes to the ApolloLib files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@WDrijver
WDrijver merged commit 80f5c71 into main Nov 4, 2026
2 checks passed
@WDrijver
WDrijver deleted the content-example-sagapip branch November 4, 2026 17:29
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