Decompress a full-screen picture and six frames of video from strings
Some checks failed
akbasic CI Build / cmake_build (push) Failing after 3m23s
akbasic CI Build / sanitizers (push) Failing after 4m33s
akbasic CI Build / coverage (push) Failing after 3m45s
akbasic CI Build / akgl_build (push) Failing after 24s
akbasic CI Build / mutation_test (push) Failing after 3m30s

The megademo gains a scene: an 800x600 vaporwave sunset carried inside
the listing, then six looping delta frames of full motion video -- the
floor grid rolling forward and the sun's slices crawling, about 220
bytes a frame. DATA cannot carry an image (512 items, ~350 owned by the
stroke font), so the picture rides in RLE-encoded string literals
decoded with INSTR: 2 KB of base frame, 1.3 KB of video. Row records
jump the decoder between changed rows, an unreachable colour is the
skip, black draws so a delta can erase, and the rays are struck live
over every frame rather than encoded. The 63-byte bird gliding over it
is the one image DATA does have room for, via SPRSAV's type-in form.

examples/megademo/vaporwave.py composes the image in palette space,
dithers by row so the gradients band instead of shattering the RLE,
proves base-plus-deltas reproduces every frame against a simulation of
the decoder, and owns the generated block between the PICTURE markers.
TODO.md section 4 records the DATA ceiling and the wanted verb.

Co-Authored-By: Claude Code (Fable 5) <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EwxGB6TdoVvZ11KQQME9cL
This commit is contained in:
2026-08-02 16:26:56 -04:00
parent 6536658c92
commit 0d79a3f52c
4 changed files with 578 additions and 12 deletions

11
TODO.md
View File

@@ -778,6 +778,17 @@ and that is the argument for the verb. Ordered by how much BASIC each one would
the note rather than read from shared state at release. The demo works around it the way
1985 did on one channel: an interleaved kickbassarpeggio line (the `TUNE` label), which
is authentic and should not be mandatory.
- **`DATA` is too small a pipe for assets, and `SPRSAV`'s type-in form is 24 by 21.** The
pool is 512 items and the demo's stroke font already holds ~350, so a full-screen picture
can never arrive by `DATA` — and the one sprite form that reads from the program is fixed
at the VIC-II's 24x21 monochrome. The demo's scene 5 shows both the ceiling and the way
around it: a 160x120 sixteen-colour image rides in **string literals** instead — RLE, two
characters a run, ~4 KB in eighteen `IM$()` assignments, decoded with `INSTR` and painted
in 5x5 blocks (`examples/megademo/vaporwave.py` generates the block) — while the 63-byte
bird beside it is all `DATA` can actually carry. Strings are the workaround, not the
answer: every program that wants a picture must also carry a decoder. What is wanted is
either a bigger `DATA` pool (it is one constant) or, better, a `SPRSAV`/`BLOAD` form that
accepts packed image data from program text at a stated width and height.
- **The only vsync is spinning on `TI#`, and the spin is worse than it looks.** Chapter 13
documents the polling; the demo's first cut had the loop — read `TI#`, branch to yourself
until it moves — and it did not just waste CPU, it **starved the `PLAY` queue dry**. The