Analysis model: gpt-5.5 xhigh
Revision model: GPT-6 Astra (user-reported)
Last edited: 2026-09-20 04:05:56 UTC

# Super Television by Orange - Technical Dissection

## Scope

This is a binary/resource/video pass over **Super Television** by Orange,
released for the Assembly 1996 PC demo competition, where it placed fourth.
The revised pass uses the original Assembly 1996 Scene.org archive, a complete
local DOSBox-X capture, original-code replay and separately labelled older
public-video references:

- [Pouet production page](https://www.pouet.net/prod.php?which=298)
- [Original Scene.org archive](https://files.scene.org/get/parties/1996/assembly96/demo/stv.zip)
- [Assembly 1996 party archive](https://archive.scene.org/pub/parties/1996/assembly96/)
- [Older public video used for GIF references](https://www.youtube.com/watch?v=2t3gjGrqMwo)

The included text calls it a "supertelevision all family demo" and says it
requires a 386, VGA, and GUS, Sound Blaster, or no sound. It also warns that
sound IRQs higher than 8 may cause trouble. The archive credits are sparse, but
the text says Haplo and Zeb helped Der Piipo while he was managing graphics.

The important technical shape is a PMODE/W protected-mode executable, a large
`data.dat` resource file that begins with uncompressed ColoRIX image resources,
and an external Scream Tracker 3 module. The runtime path is a late-DOS Orange
show: painted 256-colour stills and texture resources feed a sequence of VGA
effects, palette work, image compositing, and audio setup code.

## Examined Files

Archive hash:

```text
a4c5ca831d6a40ce41676c576cbcac8b804a41b94e55133c39098756a07b5358  stv.zip
```

Extracted files:

```text
8a06b71b6dbddf507ce2662f39e91660844cbd6268dada7c99783218f4c5082b  data.dat
ce265541863e3e0c53336b97dcfcb1f7b42337532670ba539f0a48d436dcbc81  demo.exe
fc8341293368bc5e7e3756b607d7ea253428b0e51903708d093692e9076bee26  file_id.diz
bd12e0ce1c5747f72c85369b36764c3850ea1c5ec0df27ea7690731efde5740a  info
5aa4df5dedde4e2bf5ee4c8ca34b1f4d4ff5cad5f575c783dc4d722317b73b00  makako.s3m
```

The executable is a 370,675-byte MZ wrapper around a PMODE/W LE image:

```text
PMODE/W v1.20 DOS extender - Copyright 1995, Daredevil and Tran.
LE header offset:          0x2620
LE pages:                      81
page size:                 0x1000
objects:                       2
object 1 base/size:       0x10000 / 0x31b36
object 2 base/size:       0x50000 / 0x2e650
initial EIP object/off:   object 1 / 0x2ece4
initial ESP object/off:   object 2 / 0x2e650
```

The data object contains the expected runtime file and sound strings:

```text
makako.s3m
ULTRASND
; BLASTER
Card: %lu, rate: %lu, port: %lu, dma: %lu, irq: %lu
data.dat
anim2.dat
tnldata.dat
akka.raw
kowtow.raw
kuva.raw
kuva2.raw
effy.raw
zz.raw
zz2.scx
kuva.scx
pic.scx
```

Those names matter because they show two layers of history. The shipped archive
only contains `data.dat` and `makako.s3m`, while the executable still carries
development-side names for raw images, SCX images, and old local paths such as
`c:\orange\lassi\m\konerikk.s3m` and
`c:\utils\tasm\supertv\makako.s3m`. The release package is therefore a packed
resource build, not a loose development tree.

## Visual Evidence

The earlier recorder failure is superseded by a complete local run on
2026-09-20. DOSBox-X 2024.03.01 (commit `02f36ba`), normal 486 core, fixed
60,000 cycles, 32 MiB RAM, S3 VGA, surface output, no scaler and no aspect
correction recorded the original program under Xvfb. Guest GUS configuration
was 240h, IRQ 5, DMA 3; host audio used SDL dummy output.

The program returned naturally to DOS and the emulator exited with status 0,
without the external timeout. The graphics AVI contains 17,550 ZMBV frames at
`2190197/31250` frames/second, 640×400, spanning 250.405557 seconds. Article
native timestamps start at frame 0 of that graphics stream; the preceding
720×400 text streams are excluded. Forty active memory saves agree with the
original S3M order-to-pattern table. Host elapsed time, music order and video
stream time are separate clocks.

The opening, bowl, STV-logo, stored-animation, fiery-feedback, texture-gradient
picture-card and television-text sections below use this direct capture. The following older
GIFs remain explicitly **public-video** references, not proof of a particular
original-code frame. Their source is the linked 960×720 public video, scaled
for page weight without cropping or padding.

![Super Television public-video contact sheet](images/super-television-public-video-contact.jpg)

An early identity section establishes the washed photo/texture grammar and the
name/logo overlay style:

![Super Television public-video identity/logo motion](images/super-television-public-identity.gif)

The middle of the demo has a circular lens/orb section where full-frame texture
sources are bent into a moving bowl or sphere:

![Super Television public-video orb/lens motion](images/super-television-public-orb.gif)

Later it switches to a soft spiral field:

![Super Television public-video spiral motion](images/super-television-public-spiral.gif)

The closing stretch moves from a molten orange/brown field to a fixed
background with a scrolling bitmap overlay:

![Super Television public-video molten credit field](images/super-television-public-molten.gif)

The decoded resources are still useful because they show the raw material the
runtime is selecting from. These images are direct archive resource decodes,
not timed runtime frames.

`data.dat` starts with twelve uncompressed ColoRIX `RIX3` resources. The format
is simple here: a 10-byte header, a 768-byte VGA palette, and indexed pixels.
The first resource is a 320x600 stack; most later resources are 320x200, with
three 256x256 texture/logo resources.

![Super Television decoded RIX contact sheet](images/super-television-rix-contact.png)

The first decoded resource is a tall green title/text stack:

![Super Television decoded green title stack](images/super-television-title-stack.png)

The next resources include painted or sampled image material that the demo can
use as full-screen cards or compositing sources:

![Super Television decoded portrait still](images/super-television-portrait.png)

![Super Television decoded statue and colour-band still](images/super-television-statue.png)

The tunnel/ball still and STV logo resources are the clearest compact examples
of the texture/logo side of the asset file:

![Super Television decoded tunnel and ball still](images/super-television-tunnel-ball.png)

![Super Television decoded STV logo still](images/super-television-stv-logo.png)

## Resource Layout

The first `data.dat` pass finds these RIX resources:

```text
0x000000  RIX3  320x600
0x02f10a  RIX3  320x200
0x03ee14  RIX3  320x200
0x04eb1e  RIX3  320x200
0x0a354e  RIX3  320x200
0x0b3258  RIX3  320x200
0x0c2f62  RIX3  320x200
0x0d2c6c  RIX3  320x200
0x0f0a76  RIX3  256x256
0x131974  RIX3  320x200
0x19ceb9  RIX3  256x256
0x1e61c3  RIX3  256x256
```

There are large non-RIX spans between those images:

```text
0x05e828..0x0a354d  281,894 bytes
0x0e2976..0x0f0a75   57,600 bytes
0x100d80..0x131973  199,668 bytes
0x14167e..0x19ceb8  374,843 bytes
0x1ad1c3..0x1e61c2  233,472 bytes
0x1f64cd..0x284027  580,443 bytes
```

The original resource directory resolves these apparent gaps into 28 indexed
slices, in reverse physical file order. All 2,637,864 file bytes belong to
exactly one slice. Helper `0x38e9a` uses a table of 29 signed DWORDs at
`0x500d8`; its first entry is zero and its last is `−2637864`.

```c
// EAX=index, EDX=destination; PUSHAL/POPAL preserve both inputs.
start  = 0x284028 + T[index+1];
length = T[index] - T[index+1];
memcpy(destination, wholeData + start, length);
```

All 28 original copies agree with the file slices and leave destination
canaries intact. The helper itself checks neither index nor destination
capacity. Whole-file loader `0x38ec4` requests `0x284028` bytes but does not
validate the returned read count in its short wrapper.

| Index | File offset | Bytes |
|---:|---:|---:|
| 0 | `0x274628` | 64000 |
| 1 | `0x264c28` | 64000 |
| 2 | `0x224c28` | 262144 |
| 3 | `0x20dbcd` | 94299 |
| 4 | `0x1fe1cd` | 64000 |
| 5 | `0x1f64cd` | 32000 |
| 6 | `0x1e61c3` | 66314 |
| 7 | `0x1d61c3` | 65536 |
| 8 | `0x1c61c3` | 65536 |
| 9 | `0x1ad1c3` | 102400 |
| 10 | `0x19ceb9` | 66314 |
| 11 | `0x18ceb9` | 65536 |
| 12 | `0x17d4b9` | 64000 |
| 13 | `0x15107e` | 181307 |
| 14 | `0x14167e` | 64000 |
| 15 | `0x131974` | 64778 |
| 16 | `0x100d80` | 199668 |
| 17 | `0x0f0a76` | 66314 |
| 18 | `0x0e2976` | 57600 |
| 19 | `0x0d2c6c` | 64778 |
| 20 | `0x0c2f62` | 64778 |
| 21 | `0x0b3258` | 64778 |
| 22 | `0x0a354e` | 64778 |
| 23 | `0x05e828` | 281894 |
| 24 | `0x04eb1e` | 64778 |
| 25 | `0x03ee14` | 64778 |
| 26 | `0x02f10a` | 64778 |
| 27 | `0x000000` | 192778 |

## Opening: tiny animation, persistent grain, and keyed credit frames

The moving background is a stored **300-frame, 40×25 intensity sequence**.
The code mixes it with a persistent 1,000-byte grain field, expands adjacent
corners into staggered VGA plane writes, and overlays either a scaled picture
or a 320×100 credit record. The apparent surface motion is already present in
the tiny source frames; the grain evolution, expansion, compositing and palette
changes happen at runtime.

![Super Television native opening credit motion](images/super-television-runtime-opening-credits.gif)

Direct capture, graphics-stream frames 2800–2940, every second frame:
39.9507–41.9483 seconds. The GIF preserves the selected full 640×400 RGB frames;
its centisecond timing totals 2.03 seconds. The diagonal/staggered pixel pattern
belongs to the recovered expansion, not a GIF scaling filter.

### Setup and decoded ownership

Entry `0x39c30` allocates the following state. Allocation handles are saved
separately for the eight releases at the end of the scene. Alignment advances
to the *next* boundary, including when the returned address is already aligned.

```c
// Canonical pointer slots; counts are bytes.
grain          = alloc(1000);       // [50160], not explicitly initialized here
compressedTiny = alloc(300000);     // [501c0], resource 16 copied here
tinyFrames     = alloc(300000);     // [501d6]
creditAllocationBase   = alloc(0x101d05);
creditFrames   = (creditAllocationBase + 4) & ~3;       // [501e4]
compressedText = alloc(300000);     // [5018c], resource 3 copied here
unusedWork     = alloc(128000);     // [5023c], no frame-path consumer found
picture0AllocationBase = alloc(0x1fa00);
picture1AllocationBase = alloc(0x1fa00);
picture0 = (picture0AllocationBase + 65536) & ~65535;  // [51c60]
picture1 = (picture1AllocationBase + 65536) & ~65535;  // [51c64]
copyResource(0, picture0);         // 64000 indexed pixels each
copyResource(1, picture1);
```

The headerless decoder at `0x3a7c9` consumes all 199,668 bytes of resource 16
and produces exactly 300,000 bytes. The other decoder, `0x3a785`, has a less
obvious boundary:

```c
// Both use this scalar PCX-style byte/run grammar.
b = *src++;
if ((b & 0xc0) == 0xc0) {
    count = b & 63;
    value = *src++;
} else {
    count = 1;
    value = b;
}
repeat(count) *dst++ = value;      // no per-run output clamp

// Original credit decoder: its iteration count is 31, not 30.
for (record = 0; record < 31; ++record) {
    src += 128;                   // skips a header; does not validate it
    decode_until_output_count_is_32000();
    src += 769;                   // skips palette marker + 768 bytes
}
copyResource(4, creditFrames + 31*32000);  // ending 320×200 raw picture
```

Resource 3 contains **30** complete PCX records, each declaring 320×100 pixels,
and ends exactly after byte 94,298. The extra iteration skips to staging offset
94,427 and reads 32,000 zero bytes in the four checked saves; its final cursor
is 127,196. Those reads remain inside the 300,000-byte allocation but lie beyond
the copied resource. Replacing that unused tail with byte 7 makes the original
decoder produce 32,000 sevens instead. This is an incidental extra decoded
slot, not an authored black frame or a guaranteed zero-filled allocation.

```c
// The actual row tables avoid that extra slot.
if (order == 4 && row == 63) source = creditFrames;
if (order == 5) source = creditFrames + 32000 * table_576e9[row]; // 0..10
if (order == 6) source = creditFrames + 32000 * table_577e9[row]; // 10..20
if (order == 7) source = creditFrames + 32000 * table_578e9[row]; // 20..29
if (signed_order >= 8) source = creditFrames + 31*32000;
```

All 192 table selections use slots 0–29; none selects slot 30. The deliberately
blank authored records remain part of those 30. No visible glitch from the
extra decode has been demonstrated.

### Grain recurrence and the 936-cell expansion

`0x3a803` updates the grain only while its weight is nonzero. The controller
crossfades from weights 2048/0 to 0/2048, one unit per enabled controller call.
The source animation advances independently of the foreground loop.

```c
// All seed arithmetic is unsigned 32-bit.
if (grainWeight != 0) {
    for (i = 0; i < 1000; ++i) {
        grain[i] = ((seed & 63) + 3*grain[i]) >> 2;
        seed = rol32(seed + 157, 11) ^ 157;
    }
}

// Controller slice 3a456: cold phase=0 advances on calls 3,5,7,...
if (phase == 2) {
    phase = 0;
    cursor += 1000;
    if (cursor >= 300000) cursor -= 300000;
}
++phase;

frame = tinyFrames + cursor;
for (cy = 0; cy < 24; ++cy) {
    for (cx = 0; cx < 39; ++cx) {
        i = cy*40 + cx;
        for (j in {i, i+1, i+40, i+41}) {
            t = sar32(frame[j]*frameWeight + grain[j]*grainWeight, 11);
            corner = low8(min_signed(t, 63)); // upper clamp only
        }
        pack_cell(TL, TR, BL, BR, page + 321 + cy*640 + cx*2);
    }
}
```

The packer at `0x3a99a` retains 16-bit intermediate values. The `32768` bias
moves normal output into the upper palette half. These are exact plane-store
rules, rather than a floating-point approximation of bilinear interpolation:

```c
for (r = 0; r < 4; ++r) {
    L[r] = low16(32768 + 256*TL + 64*r*(BL-TL));
    R[r] = low16(32768 + 256*TR + 64*r*(BR-TR));
}
for (mask in {0x05, 0x0a}) {       // sequencer 3c4/3c5, index 2
    select_planes(mask);
    for (r = 0; r < 4; ++r) {
        delta = s16(R[r] - L[r]);
        if (mask == 0x05) {
            h = delta >> 1;
            a = high8(L[r]);
            b = high8(low16(L[r] + h));
        } else {
            q = delta >> 2;
            a = high8(low16(L[r] + q));
            b = high8(low16(L[r] + 3*q));
        }
        word = a | (b << 8);
        p = cellDest + r*160 + (mask == 0x0a ? 240 : 0);
        vga16[p] = word;
        vga16[p + 81] = word;      // offset duplicate, not the next scanline
    }
}
select_planes(0x0f);
clear_bytes(page + 0, 640);
clear_bytes(page + 15680, 320);
for (y = 0; y < 200; ++y) store32(page + y*80 + 78, 0);
```

Each cell emits 16 masked WORD stores. The final clear crosses into the first
two bytes after the nominal 16,000-byte plane image. That is a write-footprint
finding; it is not evidence of a visible seam. Page history must remain an
explicit input when predicting the sparse writes.

### Overlay sampling and old-pixel ownership

Dispatcher `0x3927a` draws the underlay before considering the foreground.
The controller enables the overlay at order 1; order 4 suppresses it until row
63. Orders 5–7 use `0x39be6` under four sequencer masks:

```c
for (plane = 0; plane < 4; ++plane) {
    select_planes(1 << plane);
    src = source + plane;
    dst = A0000 + page + 4000;      // plane row 50
    for (i = 0; i < 8000; ++i, src += 4, ++dst)
        if (*src != 0) *dst = *src;
}
// 320×100 at logical rows 50..149; zero preserves the newly drawn underlay.
```

Earlier picture motion uses separate clamped X and Y tables at `0x39336`.
There is no recovered perspective division in this sampler. Coordinates use
signed 16.16 accumulators, and the extra 128 affects initialization only:

```c
sx = s32(scale_505c8 + sineExtra_501a4);
sy = s32(sx + aspect_501f0);
xAcc = s32(-160*s32(sx+128) + 160*65536 + tx + 65536);
yAcc = s32(-100*s32(sy+128) + 100*65536 + ty + 65536);
for (x = 0; x < 320; ++x) {
    X[x] = clamp(s32(xAcc) >> 16, 0, 319);
    xAcc = s32(xAcc + sx);
}
for (y = 0; y < 200; ++y) {
    Y[y] = source + 320*clamp(s32(yAcc) >> 16, 0, 199);
    yAcc = s32(yAcc + sy);
}
// 394ee: 80 unrolled samples per row, four plane phases, 200 rows.
for (plane = 0; plane < 4; ++plane)
    for (y = 0; y < 200; ++y)
        for (k = 0; k < 80; ++k) {
            v = *(Y[y] + X[plane + 4*k]);
            if (v) VGA[plane][page + 80*y + k] = v;
        }
```

The horizontal displacement integrates three quantities during order 3, rather
than following a constant-speed pan. When its signed accumulator reaches
`0x1400000`, the foreground clears both currently selected image buffers.
Those pointer slots are subsequently reassigned to credit/ending resources;
they cannot be treated as permanent immutable picture pointers.

```c
// Order 3, signed row >= 31; all three additions wrap32:
v1 += 16;
v2 += v1;
xPosition += v2;
// Foreground while order <= 4:
tx = s32(s32((sine[phase_502b8] * amplitude_50240) << 5) + xPosition);
if (signed(xPosition) >= 0x1400000) {
    xPosition = 0;
    memset(currentSource0, 0, 64000);
    memset(currentSource1, 0, 64000);
}
```

### Palette, controller and presentation

The upper 128 entries blend six directed pairs of four stored palettes.
Weights move by −4/+4. A zero weight survives until the *next* call resets the
weights and advances the selector: 65 enabled calls per pair, not 64.

```c
pairs = {{51954,51654}, {51654,51354}, {51354,51054},
         {51054,51354}, {51354,51654}, {51654,51954}};
if (weightA != 0) { weightA -= 4; weightB += 4; }
else { weightA = 256; weightB = 0; selector = (selector+1) % 6; }
for (i = 0; i < 384; ++i)
    mixed[i] = bits8to15(paletteA[i]*weightA + paletteB[i]*weightB);

// Foreground 39e06..39eff: keep the original staged shifts.
lowSource = order >= 8 ? 508d4 : 50bd4;
if ((order == 4 && row == 63) || (order >= 5 && order <= 7))
    lowSource = 505d4;
lowGain = u32(pulseGain * fade_501e8) >> 8;
t = sar32((sine[phase_50170]+1024) * amplitude_5016c, 8);
g = sar32(pulseGain * (2048-t), 11);
g = u32(g * fade_501e8) >> 8;
highGain = u32(g * fade_501ec) >> 10;
for (i = 0; i < 384; ++i) {
    DAC[i]     = low8(min_signed(sar32(lowSource[i]*lowGain, 8), 63));
    DAC[384+i] = low8(min_signed(sar32(mixed[i]*highGain, 8), 63));
}
if (order >= 5 && order <= 7) {
    factor = (sine[phase_50194] >> 4) + 256;
    for (i = 0; i < 384; ++i) {
        al = low8(u32(DAC[i]*factor) >> 8);
        DAC[i] = s8(al) < 63 ? al : 63; // original signed byte comparison
    }
}
```

A held row 63 on orders 0, 4, 5 or 6 can repeatedly reset `pulseGain` to 1024;
otherwise it decreases by 16 while above 256. That is a level-sensitive
controller condition, not a demonstrated one-shot beat event. The foreground
and IRQ controller share these fields without a captured atomic frame record.

```c
wait_until((in8(0x3da) & 8) != 0);
wait_until((in8(0x3da) & 8) == 0);
write_CRTC_start(pageA);          // registers 0d then 0c
(pageA, pageB, pageC) = (pageC, pageA, pageB);
out8(0x3c8, 0);
outs8(0x3c9, DAC, 768);

if (in8(0x60) == 1 || (fade_501ec == 0 && scale_505c8 == 0xff80)) {
    // 39c17: opaque 16000-byte copy per plane, including zero pixels.
    copy_full_raw_resource4_to_page0();
    write_CRTC_start(0);
    release_all_eight_saved_handles();
    return;                      // later dispatcher owns IRQ/mode changes
}
```

Cold scale setup subtracts a velocity increasing by 8 from 65408 until the
scale becomes negative: 129 iterations reach −640 with velocity 1032. Order 1
raises it toward 32768; order 2 uses a sine-controlled interpolation toward
65536; orders 3–4 reduce it again. Orders 5–7 select the fixed credit layout.
When `fade_501ec` equals 1024, the ending controller restores the saved
negative scale. It integrates the decreasing velocity back toward `0xff80`
and fades the upper field. The foreground initially sets scale 1 once; the
restore must not be assumed for arbitrary interrupted entry state. Exit requires both
the scale and fade conditions, rather than merely reaching order 8.

### Exact native-image correspondence

The original underlay, original four-plane credit copier and both original
palette loops reproduce these entire 640×400 captured RGB images:

| Native frame | Stream time | 40×25 source frame | Compatible credit record |
|---:|---:|---:|---:|
| 2800 | 39.9507 s | 196 | 2 |
| 3150 | 44.9446 s | 71 | 8 |
| 3500 | 49.9384 s | 246 | 17 |
| 3850 | 54.9322 s | 121 | 25 |

![Super Television native credit frame at 44.9446 seconds](images/super-television-runtime-credit-3150.png)

Every RGB byte matches, including the borders and pixels under transparent
foreground samples. The four compared frames have exact 2×2 pixel duplication. The
replay uses modeled sequencer writes to four planes with declared initial
history; it does not mistake a guest-RAM `A0000` dump for DOSBox's video backing
store. Source/control candidates were identified from the captured images.
Identical credit records and symmetric palette phases can produce the same
pixels, so this does not uniquely recover an IRQ history or instruction pointer.

Separate original/reference checks cover all resource copies, poisoned decoder
outputs, grain recurrence, ordered masked stores, clamped sampling, row-table
selection, controller slices and page rotation. Those checks support the
mechanisms above; the four full RGB matches supply the additional link to
what actually reached the captured display.


## Protected-Mode Shape

The LE object map is conventional for PMODE/W:

```text
object 1: base 0x10000, size 0x31b36, flags 0x2045, 50 pages
object 2: base 0x50000, size 0x2e650, flags 0x2043, 31 pages
```

Object 1 contains the executable code and some tables. Object 2 holds data,
strings, stack, and file/runtime state. The freshly relocated image applies 3,586 internal 32-bit fixups. All match
the pre-initialization guest save at actual code base `0x14000` and data base
`0x45c00`. Thus canonical code addresses move by `+0x4000`, while canonical
data addresses move by `−0xa400`. Heap pointers are already guest addresses.
The module filename is at canonical `0x50008`, `data.dat` at `0x5014c`.
The previous article mixed unrelocated operands and shifted code coordinates.
`0x3ece4` is Watcom startup, not a palette routine.

The dispatcher at `0x10458` loads the whole data file and configures sound.
Its normal branch saves interrupt vector 8, programs the PIT with divisor
`0x4295`, and installs a wrapper that establishes runtime data access, calls
a visual controller, acknowledges the PIC and returns with IRETD.

```text
scene entry    installed wrapper    visual controller
39c30          1006c                3a11e
3b25f          10094                3b5ef
3b8b4          100bc                3bb9b
3c7b0          100e4                3cb0d
3d37b          1010c                3d659
3d7c1          10134                3dcdf
3c186          no new installation at this callsite
3c409          no new installation at this callsite
3c76a          100e4                3cb0d
3e386          no new installation at this callsite
3e82f          1015c                3ebb9
3bf60          10184                3c072
3c079          no new installation at this callsite
```

No new installation at a callsite does not prove that its callee never changes
the vector. The first wrapper's controller is recovered above; actual IRQ
instruction histories are not available from the flat memory saves. Shared
cleanup selects text mode, requests saved-vector restoration, resets the PIT
to divisor 65536 and releases sound and whole-file resources. It does not
recover an arbitrary previous PIT divisor. The observed run reached its normal DOS return.

## Later Families: Corrected Code Anchors

These are fresh instruction-backed corrections to the older later-family
notes. The opening, bowl, STV-logo and stored-animation families now have
original-code/native RGB joins. The fiery STV family additionally has two
exact compositions from successive original output states, with measured
display-region boundaries. The texture-gradient family has complete native
reconstructions of normal frames and its keyed ending. Both picture cards
have original copy/palette matches across all 24 positive pulse gains. The
television-text section reconstructs its random/CPU history and distinguishes
completed images from measured scanline compositions. Other public-video
labels remain provisional.
The old scheduler excerpt also confused IRQ wrapper calls with foreground
scene dispatch.
`0x3efb0` establishes data access, the following call runs a controller, and
`0x3ecd4` performs the wrapper's PIC output; that is not a frame teardown loop.

### Bowl field: `0x3b25f`, stored coordinates and alternating pixels

The bowl/orb shown in the earlier public-video GIF belongs to **this second
planar family**, not the following `0x3b8b4` lookup compositor. Four complete
native RGB reconstructions now identify it directly. Its shape comes from a
stored coordinate map inside the zero-valued opening of a static picture;
two sets of sine-derived offsets deform the texture coordinates. Each pass
updates one checkerboard parity while the three-page rotation retains the
other parity from the preceding visit, three presentation passes earlier.
The tested native images separately match control states three IRQ-controller
updates apart; the page count alone does not establish IRQ timing.

![Super Television native bowl field](images/super-television-runtime-bowl-checkerboard.gif)

Native graphics-stream frames 4650–4790, every second frame, approximately
66.347–68.344 seconds. The 2.03-second GIF preserves all 71 selected full
640×400 RGB images. It samples the capture at half its frame rate; the original
code's complementary passes and page history are recovered separately below.

#### Three inputs and their setup

Entry `0x3b25f` inherits the preceding scene's planar mode and pitch; it does
not set BIOS mode 13 or reprogram that layout here. It requests three DPMI
blocks through `0x3adc0`. The allocator
passes size in BX:CX and returns an address in BX:CX and a separate handle in
SI:DI. The freeing wrapper `0x3ade2` reconstructs both handle halves correctly.

```c
mapAllocation = dpmi_alloc(0x19005); // 102405 bytes
map = (mapAllocation.address | 3) + 1;       // [5f034]
pictureAllocation = dpmi_alloc(0xfa05);      // 64005 bytes
picture = (pictureAllocation.address | 3) + 1; // [5effb]
textureAllocation = dpmi_alloc(0x20000);
texture = (textureAllocation.address | 65535) + 1; // [58854]
copyResource(8, texture);           // 65536 bytes, values0..127
copyResource(4, picture);           // 64000 bytes, 320×200 picture/mask
copyResource(9, map);               // 102400 bytes, 256×200 packed WORDs

// Original 3b4b5: 16384 DWORDs, not an unconditional bytewise transform.
for (i = 0; i < 16384; ++i)
    texture32[i] = u32(texture32[i] + 0x80808080);
// This resource's proven0..127 range prevents carries between bytes:
// the resulting texture indices are128..255.
```

The pointers advance to the next alignment boundary, even if already aligned.
Two active saves match all three original resources, including the converted
texture. The live sine table also matches its embedded source. The frame path
reads the map as stored; the nearby `0x3b141` coordinate generator is not called
by the recovered entry/frame path and is not evidence that this map is rebuilt
at runtime.

`0x3b230` initializes all three VGA pages from the picture:

```c
for (page in {0, 16000, 32000})
    for (plane = 0; plane < 4; ++plane) {
        select_planes(1 << plane);
        src = picture + plane;
        dst = A0000 + page;
        for (i = 0; i < 16000; ++i) {
            *dst++ = *src;
            src += 4;
        }
    }
```

This is 320×200 across four planes, not a 160×100 image. Initial picture bytes
also provide the mask and retained pixels for subsequent drawing.

#### Two 256-WORD distortion tables

`0x3adf2` rebuilds tables `0x588b5` and `0x58ab5` before each drawing pass.
The embedded sine has signed integer samples. Four phase accumulators are
wrapped to 4095 after each column, then shifted right three for lookup:

```c
make_table(T, phaseX, phaseY, stepX, stepY) {
    for (i = 0; i < 256; ++i) {
        dx = (sine[phaseX >> 3] + 256) >> 4;
        dy = (sine[phaseY >> 3] + 256) >> 4;
        T[i] = low16(dx + (dy << 8));
        phaseX = u32(phaseX + stepX) & 4095;
        phaseY = u32(phaseY + stepY) & 4095;
    }
}
make_table(A, p5887d, p58881, step58844, step58848);
make_table(B, p5888d, p58891, step5884c, step58850);
```

The same routine calculates scalar fields `0x58865/0x58869`; the inner
sampler below does not read them. Its texture address is formed from the
original map word, one global offset and one word from each table:

```asm
; 3af53 inner loop; EAX initially holds the64KiB-aligned texture base.
; ESI=map sample, EBP=picture mask sample, EDI=VGA destination.
cmp byte [ebp], 0
jne skip_pixel
mov ax, [esi]
mov dl, ah                       ; original map high byte
mov bl, al                       ; original map low byte
add ax, [57af0]
add ax, [588b5 + edx*2]
add ax, [58ab5 + ebx*2]
mov al, [eax]
mov [edi], al
skip_pixel:
add esi, 8
add ebp, 4
inc edi
```

EDX and EBX are cleared before the loop, so their byte assignments safely
select 0–255 table entries. The table indices come from the **original** map
word, before adding the global offset. All three additions wrap AX as a whole:

```c
uv = map[y*256 + x];
u = uv & 255;
v = uv >> 8;
address16 = low16(uv + globalOffset + A[v] + B[u]);
colour = texture[address16];
```

This is not independent modulo-256 X/Y addition. In the checked saved-control
cases, thousands of enabled sampler positions carry from the low byte into
the high byte. Splitting the arithmetic into two separately wrapped coordinates loses
that behaviour. A nonzero picture byte skips both coordinate/texture reads
and the VGA write.

#### Complementary passes and the three-page history

Each `0x3af53` invocation performs 100 rows × 64 samples. A row consumes 512
map bytes, 256 mask bytes and 64 plane bytes, then skips another 512, 384 and
96 respectively. Thus it visits every other logical row, every fourth column
in that plane, and only the first 256 logical columns of the 320-pixel image.
The rightmost 64 columns retain the initialized picture.

```c
// Wrapper3afa9, phaseA; wrapper3b078, phaseB.
for (plane in {3,2,1,0}) {
    firstRow = (1 - plane + phase) & 1;  // phaseA=0, phaseB=1
    select_planes(1 << plane);
    for (y = firstRow; y < 200; y += 2)
        for (x = plane; x < 256; x += 4)
            if (picture[y*320+x] == 0)
                VGA[plane][page + y*80 + x/4] = sample_map(x,y);
}
// PhaseA writes(x+y)odd; phaseB writes(x+y)even.
```

Each phase tests 25,600 mask samples. With the shipped mask, phase A issues
20,499 byte writes and phase B 20,495. Neither clears the complementary
pixels. The main loop alternates the phases while rotating three page starts:

```c
while (true) {
    for (phase in {A,B}) {
        update_and_upload_palette();       // 3b1d3, before drawing
        field57e1c = field57e14 = 0;
        rebuild_distortion_tables();
        draw_one_checkerboard_phase(phase, pageA);
        wait_retrace_set_then_clear();
        write_CRTC_start(pageA);
        (pageA,pageB,pageC) = (pageC,pageA,pageB);
    }
    if (gainLow == 0 || songOrder == 11 || signed(field57e0c) > 0x1e00)
        break;
    if (in8(0x60) == 1) break;
}
```

Starting from `(0,16000,32000)`, the writes/presentations are
`A@0, B@32000, A@16000, B@0, A@32000, B@16000`. A returning page therefore
receives the *opposite* parity after three presentations. This is the source
of the old/new pixel mixture; a renderer that refreshes both parities from one
control state does not reproduce the observed images.

#### Controller and palette cadence

The full callback at `0x3b5ef` is installed through wrapper `0x10094`.
It selects these four table increments:

| Song order | A X step | A Y step | B X step | B Y step |
|---:|---:|---:|---:|---:|
| 8 | 0 | 128 | 32 | 0 |
| 9 | 32 | 64 | 48 | 0 |
| 10 | 0 | 64 | 0 | 16 |

The underlying phases continue moving regardless of those selected steps:

```c
p5887d = (p5887d - 32) & 4095;
p58881 = (p58881 - 56) & 4095;
p5888d = (p5888d - 40) & 4095;
p58891 = (p58891 - 64) & 4095;
q0 = (q0 + 3) & 2047;
q1 = (q1 + 5) & 2047;
q2 = (q2 + 7) & 2047;
globalOffset = low16((sine[q0>>2] + sine[q1>>2] + sine[q2>>2]) >> 3);
if (byte5885c != 40) ++byte5885c;    // equality test, not saturation
```

Palette setup copies 384 bytes from `0x58cc1+0x300` into the upper half and
384 from `0x58cc1+0x600` into the lower half. The per-pass upload uses separate
picture and field gains:

```c
for (i = 0; i < 384; ++i)
    DAC[i] = low8(u32(basePalette[i] * gainLow) >> 8);
for (i = 384; i < 768; ++i)
    DAC[i] = low8(u32(basePalette[i] * gainHigh * fieldGate) >> 16);
upload_768_DAC_bytes();            // no software63 clamp in this helper
```

Cold `gainHigh=0`, `gainLow=256`, `fieldGate=256`. Controller conditions are
level-sensitive rather than one-shot row events:

```c
if (order == 10 && signed_row >= 47) {
    if (signed(gainHigh) > 0) { gainHigh -= 6; gainLow -= 6; }
    if (signed(gainHigh) <= 0) gainHigh = gainLow = 0;
} else if (gainHigh != 256) gainHigh += 2;

if (order != 8 && signed_row <= 8 && fieldGate != 256) fieldGate += 16;
if (signed_row >= 56 && fieldGate != 0) fieldGate -= 8;
```

The equality guards matter for arbitrary starting states; they are not general
clamps. During normal playback the field can turn black while the surrounding
picture remains visible, then brighten under the next order's distortion
steps. At the final fade both gains reach zero. Exit releases all three saved
handles in reverse allocation order without clearing the display or restoring
a mode in this entry; the following family takes over. Declared DPMI-service
tests verify the requests and exact handle halves, not an OS release result.
The pre-loop Escape comparison jumps to its own fall-through target and does
not abort; the meaningful keyboard exit is after the two drawing passes.

#### Native correspondence and tested boundary

The complete original table builder, both original plane wrappers and original
palette setup/scaling reproduce every RGB byte in these captures:

| Native frame | Stream time | Even-parity control delta | Odd-parity control delta |
|---:|---:|---:|---:|
| 4650 | 66.3468 s | 110 | 113 |
| 4800 | 68.4870 s | 260 | 263 |
| 5100 | 72.7674 s | 560 | 563 |
| 5250 | 74.9076 s | 709 | 712 |

The deltas are candidate controller updates relative to one saved phase tuple,
not wall-clock measurements. Each pair is three updates apart. The replay uses
the original static picture as declared initial page contents; it does not
claim access to DOSBox's captured VGA backing store or an atomic IRQ snapshot.
Four full matches include every masked-out picture pixel, the untouched right
edge and the DAC expansion. Separate original/reference checks cover 1,024
built table words, 12 complete phase/page cases and 1,440 complete controller
updates, including boundary and signed-row cases.

### STV logo contraction: `0x3b8b4`

This is the **distorted STV logo**, not the preceding bowl. Resource 6 contains
the yellow logo on a textured backdrop. For each output pixel, two samples
from one field control both a contraction toward the source-window centre
and a shade lookup. The field samples move on independently modulated paths;
the logo itself remains a stored picture.

![Super Television native STV logo contraction and entry](images/super-television-runtime-logo-contraction.gif)

Native graphics-stream frames 5400–5610, every second frame, approximately
77.048–80.044 seconds. This 3.02-second GIF preserves all 106 selected full
640×400 RGB images. It shows the moving entry position followed by the
nonuniform contraction; it is not a synthetic animation of the decoded asset.

#### Setup: aligned lookup windows and a separately allocated work area

Entry `0x3b8b4` requests five blocks. The fifth request happens only after
setup and the wait for song order 11. Addresses and release handles are kept
separately; the handle wrapper restores SI:DI correctly for DPMI release.

```c
tableAllocation = dpmi_alloc(0x20000);
T = (tableAllocation.address | 65535) + 1;       // [5f0a3]
pictureAllocation = dpmi_alloc(0x20614);
container = ((pictureAllocation.address + 778) | 65535) + 1;
lookupAllocation = dpmi_alloc(0x20000);
shade = (lookupAllocation.address | 65535) + 1;  // [5f058]
fieldAllocation = dpmi_alloc(0x40000);
field = fieldAllocation.address;               // [5f04c]
copyResource(6, container);                     // 66314-byte RIX3 container
copyResource(7, shade);                         // 65536-byte lookup
copyResource(2, field);                         // 262144 bytes
memcpy(sourcePalette, container + 10, 768);
savedPicturePointer = container + 778;          // [5f09f]
for (i = 0; i < 262144; ++i) field[i] >>= 1;     // source values now0..127

BIOS_set_mode(0x13);
upload_source_palette();
for (;;) {
    if (in8(0x60) == 1) goto cleanup;
    if (signed(songOrder) >= 11) break;
}
workAllocation = dpmi_alloc(128000);
work = workAllocation.address;                  // [5f529]
producerDisplacement = 51200;                   // [5f545]
```

The work allocation is not cleared by this setup. The installed controller can
run during allocation, loading and the order wait; no scene-ready flag stops
it. Entry resets the producer displacement after allocating the work area,
not all controller phases. An early Escape still goes through the common
five-handle release list, even when the fifth allocation has not occurred;
this is not an allocation-failure rollback path.

The centred table at `0x3b8d0` has 256 rows and 256 columns:

```c
for (row = 0; row < 256; ++row)
    for (column = 0; column < 256; ++column)
        T[row*256 + column] = low8(
            (((row-128) * (256-column)) >> 8) + 128);
// Signed product/SAR8 followed by byte ADD128;65536 original bytes checked.
```

At sum zero, this preserves the window coordinate exactly. Increasing
the sum contracts it toward 128. Because the sum changes per output pixel,
this is a spatially varying source-coordinate contraction rather than one
uniform image scale.

#### Phase preparation and the two field offsets

The original preparation at `0x3ba10` uses two actual signed DWORD tables:
`S(p) = [0x51c87+4*p]` and `C(p) = [0x52c8b+4*p]`. Keep these exact table
bases rather than substituting ideal sine/cosine functions. The products and
address additions preserve 32-bit instruction widths:

```c
frame_prepare_3ba10:
a = s32(S(amplitudePhaseA) + 1224);
b = s32(S(amplitudePhaseB) + 1224);
p = phase;
q = (p + 2048) & 4095;
xA = (s32(S(p)*a) >> 14) + 128;
yA = (s32(C(p)*a) >> 14) + 128;
xB = (s32(S(q)*b) >> 14) + 128;
yB = (s32(C(q)*b) >> 14) + 128;
offsetA = u32((yA << 9) + xA);      // [5f050]
offsetB = u32((yB << 9) + xB);      // [5f054]
```

There is no X/Y clamp. However, the actual tables bound S and C to −1023..1023,
amplitudes to 201..2247, and coordinates to −13..268. Including the sampler's
`0x3800` prefix, 512-byte row stride and full 200×256 footprint gives a
conservative field-relative read range **7667..253963**, inside the
262,144-byte allocation for every wrapped phase combination. A negative
stored offset is therefore not by itself an out-of-range field read.

Preparation also writes a 128-byte table:

```c
for (i = 0; i < 128; ++i)
    unused[i] = bits8to15(u32(i * multiplier));  // [5f4a9]
```

Within this recovered family its sole memory operand is the write. Replaying
preparation and the complete original sampler with multipliers 0, 256 and
`0xdeadbeef` produces three different auxiliary tables but identical 51,200
output bytes; the sampler makes no reads from that table. The growing
multiplier is not an active zoom or fade control here.

#### The 51,200-pixel sampler

`0x3b826` performs 200 rows × 256 columns. Both field pointers have the same
base, separate prepared offsets, and an additional `0x3800` margin:

```c
fa = u32(field + offsetA + 0x3800);
fb = u32(field + offsetB + 0x3800);
for (y = 0; y < 200; ++y)
    for (x = 0; x < 256; ++x) {
        sum = low8(mem[fa + y*512 + x] + mem[fb + y*512 + x]);
        py = mem[(T & 0xffff0000) | ((y+28)<<8) | sum];
        px = mem[(T & 0xffff0000) | (x<<8) | sum];
        address = (savedPicturePointer & 0xffff0000) | (py<<8) | px;
        pictureIndex = mem[address];
        lookupAddress = (shade & 0xffff0000) | ((sum>>2)<<8) | pictureIndex;
        work[producerDisplacement + y*256 + x] = mem[lookupAddress];
    }
```

The original byte-register operations are essential to this interpretation:

```asm
; 3b874 onward: EAX=T window, EDX=picture pointer, EBX=shade window.
mov al, [esi]
add al, [ebp]                     ; sum remains inAL through the table reads
mov ah, [row_counter]             ;28..227
mov dh, [eax]                     ; source Y
mov ah, ch                       ; output X0..255
mov dl, [eax]                     ; source X
mov bl, [edx]                     ; sampled picture index -> low lookup byte
mov bh, al
shr bh, 2                        ; intensity -> high lookup byte
mov al, [ebx]
mov [edi], al
```

DH/DL replace the picture pointer's entire low 16 bits. They do **not** add a
coordinate to its post-header pixel pointer. In both active saves the stored
pointer is `0x45030a`, but the effective address window starts at `0x450000`.
The sampled pixel's offset is therefore `((py<<8)|px) − 778` relative to the
image pixels. Dropping that distinction changes the reconstruction.

The half-valued field bounds the sum to 0..254. Exhausting all those sums and
all output rows/columns bounds picture reads to container offsets
7168..58367, entirely within the pixel portion. Thus the address convention
includes the header at its origin but does not actually read header bytes
under these verified source ranges. The shade address uses only the first
16,384 bytes of the 65,536-byte lookup: its low byte is the picture index,
its high byte is `sum>>2`, not the other way round.

Source pointers advance 256 pixels then skip another 256 bytes per row. Output
is tightly packed at 256 bytes per row. At return the sampler stores the
advanced first-source pointer in `0x5f05c`.

#### Moving producer, fixed screen consumer

The sampler's output begins at a moving displacement, but the transfer at
`0x3bae9` always copies from the **base** of the work allocation:

```c
src = work;                       // deliberately no producerDisplacement
for (y = 0; y < 200; ++y) {
    memcpy(A0000 + y*320 + 48, src, 256);
    src += 256;
}
```

Columns 48..303 are overwritten; the left 48 and right 16 are retained, not
symmetrically centred. Original transfer tests preserve supplied nonzero
margin bytes. The native image reconstruction uses observed black borders
following mode 13, not guest-RAM `A0000` as a captured backing-store claim.

The full IRQ controller at `0x3bb9b` runs these updates:

```c
if (order == 12 && signed_row >= 48 && gain != 0) gain -= 8;
if (producerDisplacement != 0) producerDisplacement -= 1280;
if (multiplier != 256) multiplier += 24;
phase = (phase + 24) & 4095;              // [5f06e]
amplitudePhaseA = (amplitudePhaseA + 32) & 4095; // [5f044]
amplitudePhaseB = (amplitudePhaseB + 26) & 4095; // [5f048]
```

The decrement is five 256-byte rows per call. From the declared start of
51,200 bytes, 40 controller calls bring the producer to the base. At its
initial position the entire new 51,200-byte output lies beyond the visible
consumer window; as it moves upward, more of that output enters the window.
Bytes before it retain prior work/allocation contents. They are not cleared
by this mechanism. Native entry evidence below establishes the observed zero
prefix for this run rather than assuming a generally zero-filled heap.

Starting multiplier 0 skips 256 when incremented by 24, so the equality guard
is not a saturation limit. Its unconsumed preparation table prevents that
behaviour from becoming a visible zoom error. Likewise the fade's decrement
and equality condition preserve 32-bit wrap for arbitrary starting values;
from the normal gain 256, 32 eligible calls reach zero.

#### Palette, exit and complete native correspondence

After the screen copy, `0x3bb09` scales all 768 source components and keeps
AH. There is no software clamp to 63 in this loop:

```c
for (i = 0; i < 768; ++i)
    preparedPalette[i] = bits8to15(u32(sourcePalette[i] * gain));
wait_retrace_set_then_clear();
upload_768_DAC_bytes();
if (songOrder == 13 || in8(0x60) == 1) goto cleanup;
// Equality order gate, not order>=13.
goto frame_prepare_3ba10;           // normal next frame, no cleanup
cleanup:
release(workHandle);
release(fieldHandle);
release(shadeHandle);
release(pictureHandle);
release(tableHandle);
```

The original code restores neither mode nor IRQ in this entry. Five allocation
and five release requests have been executed with declared DPMI responses;
these establish requested sizes and handle handling, not OS outcomes.

![Super Television direct native STV-logo reference](images/super-television-runtime-logo-5560.png)

Direct native reference, frame 5560 at 79.331 seconds. The quantified original-code
comparisons below use frames 5432–5433 and 5850–5851.

The original preparation, sampler, screen transfer and palette loop now
reproduce two distinct images, each present in two consecutive native frames:

| Native frames | Saved state | Producer displacement in replay | Exact visible work bytes |
|---|---:|---:|---:|
| 5432–5433 | 13, entry | 16640 | 51200 |
| 5850–5851 | 14, steady | 0 | 51200 |

Both saved offset pairs match preparation from phase values **one controller
update earlier** than the dumped phase fields. In the entry save, the dumped
displacement is already 15,360, while the visible output fits 16,640. Its first
16,640 bytes are zero in both this save and the preceding pre-entry save;
the replay combines that observed prefix with 34,560 newly generated visible
bytes. The full original sampler is run, but its off-screen tail is not
claimed to match all saved RAM. Using the dumped displacement instead moves
the output five rows and fails the comparison.

In the steady save, displacement zero lets the entire poisoned 51,200-byte
output be rebuilt and compared directly. Both cases then pass through the
original screen copy and palette instructions, matching every 640×400 native
RGB byte. This is a candidate prior control state corroborated by pixels, not
an independently captured instruction pointer or complete IRQ history.
Separate original/reference checks cover all 65,536 centred-table bytes,
input/source bounds, preparation, sampler, preserved-margin copies, palette
arithmetic, allocation/release requests and 903 full controller updates.

### Two stored animations: `0x3c7b0` and its later re-entry

The spreading field and the later spiral use the same player: each source is
**300 authored 40×25 intensity frames**, decoded once and enlarged through
staggered VGA plane stores. The visible motion comes from advancing through
those frames; the executable does not generate it by feeding the preceding
rendered image back into a simulation. Palette interpolation and music-driven
brightness pulses supply another layer of motion.

![Direct native first stored-animation playback](images/super-television-runtime-animation.gif)

*Native frames 6300–6440, sampled every two frames; 89.889–91.887 seconds.
This is the first invocation, using resource 13. The GIF preserves the full
640×400 RGB capture and rounds its sampled cadence to GIF centiseconds.*

![Direct native later stored spiral animation](images/super-television-runtime-spiral.gif)

*Native frames 11200–11340; 159.803–161.801 seconds, the same sampling and
colour-preservation rules. This invocation uses resource 23. Both clips have
71 source samples and a 2.03-second GIF duration.*

#### Decode once; retain more state than the entry resets

The first entry is canonical `0x3c7b0`; the later entry `0x3c76a` changes seven
fields and falls through into it. Both install controller `0x3cb0d` through
wrapper `0x100e4`. The foreground calls `0x3c68c`, which calls the actual
expander `0x3cf63` and returns. Nearby scaling helpers `0x3c692` and `0x3c715`
are not part of this active call chain.

Each invocation sets up the planar mode, 320-pixel pitch and repeated scan
lines through the original mode helpers, then selects all four planes and
clears 65,536 aperture bytes. One 664,778-byte allocation contains:

| Offset from allocation | Use | Capacity |
|---:|---|---:|
| 0 | Compressed source staging | 300000 |
| 300000 | Decoded animation, pointer `0x5f894` | 300000 |
| 600000 | Resource 22 image container, pointer `0x61a94` | 64778 |

Resource 13 occupies 181,307 compressed bytes; resource 23 occupies 281,894.
Original decoder `0x3cf29` treats a byte with its top two bits set as a repeat
count in the low six bits, followed by the repeated value; other bytes are
literal. Both streams consume their exact original lengths and expand to
300,000 bytes, with ranges 0–63 and 0–57 respectively. Termination compares
the output count with 300,000 for equality, without clamping a final run;
the shipped assets satisfy that constraint. Resource 22 is loaded on both
invocations, even though only the later ending uses it.

The prefix changes these fields:

| Field | Cold configuration | Later configuration |
|---|---:|---:|
| Resource ID `0x61a3d` | 13 | 23 |
| Start-order WORD `0x61a43` | 11 | 23 |
| Stop-order WORD `0x61a41` | 15 | 26 |
| Cursor divisor `0x61a45` | 3 | 2 |
| Global fade `0x61a83` | 256 | 256 |
| Fade latch `0x61a7f` | 0 | 0 |
| Byte cursor `0x5f890` | 0 | 0 |

Crucially, it **does not clear `0x61a87`**, which normal first exit sets to 1.
That flag bypasses the cursor divisor, changes pulse triggering, and enables
the later image-card ending. Thus the later animation advances on every
controller call despite the assigned divisor of two. The palette cycle,
page pointers, row tracker and cursor counter also survive re-entry.

The readiness loop waits for song order at least the selected start value.
Success resets the independent gain to zero, pulse to 256 and cursor to zero.
Escape from that wait instead enters the palette/frame block without those
resets. Interrupt control is already enabled during allocation, decode and
waiting; these stores do not establish an entirely cold first-frame state.

#### Inner loop: quantize vertically, then interpolate horizontally

A frame occupies 1000 bytes. The expander visits 24×39 cells, reading the
four corners at offsets `i`, `i+1`, `i+40`, `i+41`, with a source row stride
of 40. These accesses stay within the selected 40×25 frame. Each cell starts
at `page + 321 + 640*cellY + 2*cellX` in **plane-address units**.

This differs subtly from the opening's packer. Here the vertical interpolation
is reduced to eight **bytes** before horizontal interpolation; the opening
retains 16-bit intermediates. For corners TL, TR, BL and BR:

```c
for (r = 0; r < 4; ++r) {
    L[r] = low8((32768 + 256*TL + 64*r*(BL-TL)) >> 8);
    R[r] = low8((32768 + 256*TR + 64*r*(BR-TR)) >> 8);
}
// Original stores at 3d050/3d052 produce eight bytes at 61a4d.
```

Those bytes are zero-extended for the horizontal calculations. Let
`hi(v) = (v >> 8) & 255`:

```c
// For each of the four intermediate rows:
d = (R-L)*128;
a = hi(L*256);       b = hi(L*256+d);       // plane mask 05h

d = (R-L)*64;
a = hi(L*256+d);     b = hi(L*256+3*d);     // plane mask 0ah
word = a | (b << 8);
```

Each mask writes four WORDs at 160-byte row steps and duplicates each WORD
81 plane bytes later. Mask `0ah` starts 240 bytes after mask `05h`. This
staggered layout, rather than a conventional contiguous software stretch,
produces the enlarged field. The 32768 bias places the normal source ranges
in palette indices 128–191 or 128–185. There is no grain addition or corner
clamp in this player.

After the cells, mask `0fh` clears page offsets 0–639 and 15680–15999,
plus a DWORD at `row*80+78` for each of 200 rows. The final DWORD reaches two
bytes beyond the nominal 16,000-byte plane page. That is the measured write
footprint, not evidence of a visible seam. Native reconstruction uses zero
initial plane contents, consistent with the explicit entry clear, and then
applies every original masked write; it does not interpret a flat guest
`A0000` memory save as four captured VGA planes.

#### Cursor, pulse and palette timing

The cursor is a byte offset, incremented by one 1000-byte frame and wrapped
at 300,000. Controller calls and foreground presentations are distinct clocks:

```c
if (retainedFlag == 1 || counter == divisor) {
    if (retainedFlag != 1) counter = 0;
    cursor = u32(cursor + 1000);
    if (cursor >= 300000) cursor -= 300000;
}
counter = u32(counter + 1);
```

For a declared cold counter of zero and divisor three, advances occur on
calls 4, 7, 10, and so on. With the retained flag set, every callback advances
and the counter no longer resets. The two later active saves contain counters
60 and 474 with divisor two, corroborating that bypass.

The fade latch sets at `order == stopOrder-1` and signed row at least 56;
thereafter a nonzero global fade decreases by four each callback. An
independent gain normally rises by eight toward 256, but falls by eight at
**hardcoded order 15, row at least 47**. The later prefix does not retarget
that condition to order 26.

Pulse handling also changes with the retained flag:

- First invocation: skip the pulse block at the start order. Otherwise rows
  3, 9, 19, 25, 29, 35, 41, 51, 57 and 61 reset it to 448 on every held call.
- Later invocation: only a change from the retained row byte can trigger;
  the row set is 3, 5, 7, 9, 12, 19, 23, 25, 28, 35, 37, 39, 41, 44,
  51, 55, 57 and 60.

After an executed pulse block, any pulse unequal to 256 decreases by eight,
so a newly triggered 448 becomes 440 on that callback. Four phase fields
also advance by 25, −27, 26 and −24 modulo 4096, but this frame expander does
not consume them. They do not establish live geometric distortion here.

Two palette weights change by −4/+4, starting at 256/0. Once the first is
already zero, the next call resets the weights and selects the next pair.
That gives 65 callbacks per ordinary pair, including the reset. The six
selected source pairs traverse these 128-colour tables:

```text
60cd2 → 609d2 → 606d2 → 603d2 → 606d2 → 609d2 → 60cd2
```

Foreground `0x3c895` blends their 384 components, retaining bits 8–15 of
`low32(A*weightA + B*weightB)`. The lower 128 colours come from retained
`0x5ff52`; the upper 128 come from this mixture. Both halves use:

```c
gain = u32(u32(independentGain * pulse) * globalFade) >> 16;
v = sar32(low32(component * gain), 8);
if (signed(v) > 63) v = 63;
DACbyte = low8(v);
```

There is no extra pulse factor from the nearby `MOV EDX,[pulse]`: the next
instructions overwrite it. After drawing, foreground waits for retrace,
sends the current page start, rotates the three page variables as
`(A,B,C)=(C,A,B)`, then uploads all 768 prepared DAC bytes. Palette preparation
therefore precedes drawing, while its upload follows it.

#### The later card preserves an older animation page

![Direct native masked ending card over retained spiral pixels](images/super-television-runtime-card-12024.png)

*Native frame 12024, 171.560 seconds. Resource 22 supplies the foreground;
its zero pixels preserve the prior animation. This exact composite stays
unchanged through frame 12263, about 3.4 seconds of captured display.*

The exit test gives the card priority when the retained flag is one,
`order == stopOrder-1`, and signed row is at least 61. Otherwise zero fade,
the exact stop order or Escape takes normal exit. Normal exit resets display
start to zero, releases the allocation and sets the retained flag to one.

Card path `0x3ca02` uploads **only the first 16 colours** of resource 22,
then makes four plane passes over its 64,000 pixels. Nonzero source bytes
write; zero bytes skip. Its 26,685 foreground stores use indices 1–15,
leaving the animation's upper-half colours intact. It selects the current
page and waits for `order == stopOrder` with signed row at least 32, or
Escape, before releasing the allocation. This path does not reset display
start to zero. Because the preceding frame loop has already rotated its
page variables, the card can land on an older animation page.

That distinction is visible in the native join. Save 28 has cursor frame
279, but the retained background matches source frame **255**. Searching
all 300 source frames finds exactly that match. Replaying the complete
original expander for frame 255 and the complete original masked card copy,
including its 48 DAC bytes, reproduces every native RGB byte. This composite
uses the saved animation palette with the original 16-colour replacement;
it does not claim recovery of that palette's full preparation history.
The background is frozen while interrupt-driven cursor state keeps advancing.

#### Native correspondence and evidence limits

The four active saves have exact relocated code, compressed source, decoded
animation and card-resource ownership. Complete original palette preparation
and plane expansion reproduce ten native capture frames across both uses:

| Save | Resource | Source animation frame | Native frame(s) |
|---:|---:|---:|---|
| 15 | 13 | 14 | 6337 |
| 16 | 13 | 151 | 6747–6748 |
| 16 | 13 | 152 | 6749–6751 |
| 26 | 23 | 51 | 11217 |
| 26 | 23 | 52 | 11218 |
| 27 | 23 | 165 | 11631 |
| 27 | 23 | 166 | 11632 |

Palette-cycle and pulse candidates from the current or preceding callback
reproduce the corresponding prepared palette bytes before rendering. These
are pixel-corroborated candidate control states, not atomic IRQ snapshots.
The ending adds the separate full composite match described above; it uses
a retained palette rather than claiming the same preparation proof.

Independent arithmetic checks cover the two entire decoders, four complete
render calls and their quantized intermediates, four palette preparations,
576 full controller calls, both setup paths, normal release and 72 ending
branch cases. BIOS, allocation and port readbacks in those setup tests are
declared service boundaries. The native RGB matches strengthen the visual
join without proving every intervening interrupt, beam position or page
history. How the original 40×25 source animations were authored remains
outside the recovered playback code.

### Fiery STV: `0x3d37b`, remapped feedback with a fixed seed

Here the STV letters dissolve into a fiery, distorted field over the painted
tunnel-and-ball background. Unlike the preceding stored animations, this
renderer **writes its filtered output back into the field it samples next**.
A fixed intensity image of the STV artwork continually feeds detail back into
that evolving field. The background picture itself stays still.

![Direct native fiery STV feedback motion](images/super-television-runtime-feedback.gif)

*Native frames 7200–7410, 102.730–105.727 seconds, sampled every two frames.
The 3.02-second GIF preserves all RGB values of its 106 selected 640×400
capture frames. The capture can contain parts of successive screen writes;
the code-to-image correspondence below states that boundary explicitly.*

The foreground at `0x3d4b4` prepares the remapping controls, builds two address
tables, samples the old field into a separate work buffer, then filters and
writes both the new field and the screen. Palette preparation follows those
writes. This ordering is important: **all old-field reads finish before any
feedback writeback begins**, despite the source and final destination sharing
one allocation.

#### Two authored inputs, four allocations

Resource 14 is a raw 64,000-byte, 320×200 intensity image, with values 0–63:

![Original resource 14 STV intensity seed shown in grayscale](images/super-television-feedback-seed.png)

*Diagnostic grayscale display of the original six-bit intensity bytes, not
a captured demo frame or the runtime fire palette.*

Resource 15 is the 64,778-byte RIX container for the static tunnel-and-ball
picture shown in the resource overview. Its pixels range from 0 to 15. Setup
copies its palette and shifts each of 16,000 pixel DWORDs left four bits.
For this asset, the four-bit pixel bound prevents cross-byte carry and makes
the packed shift equivalent to placing each pixel in an index's high nibble.
It is not a generally valid byte-shift interpretation for arbitrary inputs.

Four allocations establish the buffers:

| Request | Layout and role |
|---:|---|
| 192778 bytes | Resource 15 container; picture pointer `0x61a9c` advances 778 bytes to its pixels. The frame path does not consume the reserved extension. |
| 257536 bytes | Start at the next 64 KiB boundary, clear 192000 bytes, and put resource 14 in the middle 64000. Feedback pointer `0x6241f` addresses that middle region. |
| 257536 bytes | The same alignment and clear, with pointer `0x62423` to its middle. This frame loop does not use it as a second feedback buffer. |
| 128000 bytes | Sampled work at `0x61aa8`, then the fixed seed at `0x61aac`, each 64000 bytes and initially copied from resource 14. |

The first feedback buffer therefore has 64,000 cleared bytes on either side
of the nominal image. The other padded allocation remains entirely zero in
both active saves. There is no feedback-pointer swap in the recovered loop;
its unused second allocation should not be turned into an assumed ping-pong
algorithm merely because it resembles one.

Entry sets BIOS mode 13h, uploads the existing palette, and enters the frame
loop without another song-order readiness wait. Controller `0x3d659` has
already been installed through wrapper `0x1010c` and can run during setup.
The allocation and BIOS tests use declared service results; the native
capture provides the separate evidence that the original demo actually ran.

#### Remapping: signed scale and two perturbed address tables

Let `S(p)` be the original signed DWORD table at `0x51c87 + 4*p`, indexed
modulo 4096. Its values range from −1023 to 1023. Before building the tables:

```c
step = u32(S(phase_61ac0) + 1124) >> 2;
stepX0 = step + 35;       stepX1 = step + 25;
stepY0 = step + 15;       stepY1 = step - 5;
scale = u32(65536 - u32((S(phase_61e17) + 1024) << 6));
```

In this original table domain, the last expression is exactly
`-64*S(phase_61e17)`, a signed 16.16 sampling step from −65472 to 65472.
It can pass through zero and reverse both sampling directions. The observed
zooming and reversal come from coordinate sampling, without a perspective
division.

The 320-entry X table is at `0x62768`; the 200-entry Y table is at `0x62448`.
Both translations are set from the **same** field:

```c
translation = ((control_61ab0 & 4095) - 2048) << 4;
xAccumulator = s32(-158*scale + 160*65536 + translation);
yAccumulator = s32( -98*scale + 100*65536 + translation);
```

The origins are −158 and −98, rather than −160 and −100. The controller does
not animate `0x61ab0`; its checked value is zero, giving a −32768 translation
in each accumulator. It would be incorrect to invent two independent moving
translation controls from the two destination fields.

For X, the two starting phases subtract `160*stepX0` and `160*stepX1` from
`phase_61ac0` and `phase_61ac4`. For Y, subtract `100*stepY0` and `100*stepY1`
from `phase_61ac8` and `phase_61acc`. Each is masked by 4095. Every table
entry then follows this arithmetic:

```c
base = s32(accumulator) >> 16;
if (base < 0 || base >= extent) base = 0;  // extent 320 or 200
value = base * (isY ? 320 : 1);
value += 320 * (s32(S(p) * amplitude) >> 18);
value +=       (s32(S(q) * amplitude) >> 18);
table[i] = u32(value);
accumulator = s32(accumulator + scale);
p = (p + step0) & 4095;
q = (q + step1) & 4095;
```

An out-of-range coarse coordinate resets to **zero**, rather than the nearest
edge. The two signed perturbations are added afterwards, without another
clamp. Both tables therefore contain two-dimensional byte offsets; calling
them independently clamped X and Y coordinates would miss part of the warp.

Sampler `0x3d2e4` reads at
`u32(feedbackBase + Y[y] + X[x])` for all 200×320 positions, packing pairs
into WORDs in the separate work buffer. It uses nearest indexed samples;
there is no bilinear filtering at this stage.

The padding has a concrete purpose. Controller amplitude is
`(S(phase_61aa4)+1500)>>1`, giving 238–1261. Each shifted sine perturbation
therefore lies between −5 and 4. Including both tables, the conservative
source-offset bound is **−3210 to 66567**, within the allocated domain
−64000 to 127999. These accesses must not be silently wrapped to 64,000 bytes
or clamped to the visible image. The two checked next-step tuples happen to
read offsets 8–63997 and 24137–38903, so neither by itself exercises the
padding; the bound covers the wider original control domain.

#### Packed filter: three parts remapped field, one part fixed artwork

After all sampling, `0x3d328..0x3d379` walks 16,000 DWORDs in ascending order:

```c
v = u32(3*sampledDWORD + seedDWORD);
v = (v >> 2) & 0x3f3f3f3f;
feedbackDWORD = v;
VGA_DWORD = ((v >> 2) & 0x0f0f0f0f) | pictureDWORD;
```

The seed stays fixed while the remapped field changes. In the demonstrated
six-bit domain, each `3*sample + seed` is at most 252, so the packed addition
has no inter-byte carry. The feedback operation is consequently exactly
`floor((3*sample + seed)/4)` per pixel. Its output remains in 0–63, preserving
the same bound for the next iteration from the original initialization.

The remaining shift reduces that feedback intensity to four bits. A screen
index then contains:

```text
bits 7..4 : static picture pixel, 0..15
bits 3..0 : filtered feedback intensity >> 2, 0..15
```

Thus the moving fire does not overwrite the background's pixel identities;
the palette maps each background/intensity combination to its final colour.
The original writer stores each new feedback DWORD and then its composed VGA
DWORD before advancing. It writes the full 64,000-byte linear screen directly,
without the three planar pages used by the preceding animation player.

#### Palette and music control

Palette builder `0x3d51f` combines 16 picture colours from `0x6211f` with
16 intensity colours from `0x61e1f`, creating all 256 index combinations.
For one picture component `a`, intensity component `b` and gain `G` at
`0x62c98`:

```c
w = sar32(low32(b * G), 8);
v = u32(6*a + 9*w) >> 3;
v = min_unsigned(v, 63);
DACbyte = low8(sar32(low32(v * G), 8));
```

This is a weighted **sum**, unlike the component-product palette in the
later field family. The intensity contribution is gain-scaled before the
mixture, and the combined result is gain-scaled again after the 63 clamp.
At the checked gain of 256, the original builder exactly reproduces both
saved 768-byte palettes.

The complete controller changes gain and six phases:

```c
if (order == 15 && G != 256) G = u32(G + 8);
if (order == 16 && signed_row >= 48 && G != 0) G = u32(G - 8);
phase_61e17 = (phase_61e17 +  2) & 4095;
phase_61ac0 = (phase_61ac0 +  9) & 4095;
phase_61ac4 = (phase_61ac4 - 38) & 4095;
phase_61ac8 = (phase_61ac8 - 26) & 4095;
phase_61acc = (phase_61acc + 25) & 4095;
phase_61aa4 = (phase_61aa4 +  3) & 4095;
amplitude = (S(phase_61aa4) + 1500) >> 1;
```

The gain tests are equality guards, not general saturation clamps. Foreground
ordering is preparation, tables, sample, filter/screen writes, palette build,
retrace wait, palette upload, then exit checks. Order exactly 17 or Escape
releases all four allocations, in the order work, unused padded buffer,
feedback buffer and picture. The dispatcher handles the next scene; this
entry does not restore text mode itself.

#### Why a complete memory image did not match the captured frame

![Native fiery STV frame 7236](images/super-television-runtime-feedback-7236.png)

*Frame 7236, 103.244 seconds. Its exact reproduction uses successive original
output states, with the display-region boundaries stated below.*

The active saves at song orders 15 and 16 have exact relocated code, original
seed/picture ownership and cleared padding. Whole original/reference tests
agree on their address tables, all 64,000 samples, the complete feedback
writeback and the complete screen output. But a scan of all 17,550 capture
frames found **no exact match for ten complete-image candidates** built from
those saves. The saved work, current feedback and prepared controls must not
be treated as one atomic displayed frame.

For save 18, filtering the saved work reproduces every saved feedback byte.
Sampling that feedback again is a subsequent iteration; its different work
image is not evidence of a broken sampler. In save 17, the saved feedback
differs from that completed filtering at 725 bytes, so that save does not
even establish a fully completed filter pass.

A more specific match uses successive original output states. First finish
the original filter from the saved work. Then run the original preparation,
tables, sampler and next filter, with zero or one declared controller update
between them. Both complete output states, and the required intermediate
copy state, match independent fixed-width arithmetic. The original palette
builder also reproduces the unchanged palette.

| Native frame | Save | Declared updates | Exact RGB composition |
|---:|---:|---:|---|
| 7236 | 17 | 0 | Display rows 0–274 from the first completed output; row 275 from an intermediate next-copy state; rows 276–399 from the next completed output. |
| 7642 | 18 | 1 | Rows 0–274 from the first completed output; rows 275–399 from the next completed output. |

For frame 7236, the intermediate state occurs after 10,995 original DWORD
writes, or 43,980 logical bytes. On display row 275, columns 0–279 come from
the next iteration and columns 280–639 from the preceding one. The complete
64,000-byte intermediate screen and feedback buffers match the original
ascending writer's new-prefix/old-suffix state.

These compositions reproduce **every one of the 768,000 native RGB bytes**
in each frame without copying pixels from the video into the predictions or
fitting palette entries. However, the row and column boundaries were
**measured from the native differences**, not predicted from CPU cycles and
VGA scanout. The tested zero/one controller counts are compatible candidates,
not recovered interrupt timings. This establishes exact image composition
from original states, not a complete account of when the display sampled
each state. In particular, the two repeated display scanlines for one logical
memory row need not show the same iteration.

The independent checks also cover 400 complete controller calls, both
preparations and palettes, full initialization, all four release requests,
and the padded source bound. Full preceding feedback history, actual VGA
backing memory and CPU-to-beam chronology remain outside these tests. The
native clip preserves what the capture recorded, including that limitation.

### Texture-gradient lighting: `0x3d7c1`

This effect turns a colourful texture into a rippling, lit field. It derives
a height map from that texture's palette brightness, blurs it four times,
and stores its horizontal and vertical differences. Those differences then
displace samples from a radial highlight image. A shipped lookup table
combines the texture index and highlight index into the final colour.

The result is bump-style lighting implemented through integer address
arithmetic and indexed lookups. There is no per-pixel normal normalization,
light-vector dot product or evolving feedback buffer in this frame loop.

![Direct native texture-gradient lighting](images/super-television-runtime-gradient.gif)

*Native frames 8500–8710, 121.279–124.275 seconds, sampled every two frames.
The three-second GIF preserves the RGB values of all 106 selected full
640×400 capture frames.*

The two inputs are resource 10, a 256×256 coloured texture, and resource 17,
a 256×256 radial highlight. A fixed 160×100 WORD coordinate map, resource 5,
sets their underlying screen mapping. Resource 11 supplies the 65,536-byte
colour-combination lookup. The moving coordinate offset comes from the
controller's interpolated velocity records; the texture-gradient table is
built once during setup.

#### Setup: luminance, four packed blurs, then two wrapped differences

The dispatcher installs controller `0x3dcdf` through wrapper `0x10134` before
calling entry `0x3d7c1`, which uses BIOS mode 13h. Nine allocation requests establish:

| Requested bytes | Role |
|---:|---|
| 256005 | Four-byte-aligned resource 5 map; only 32000 source bytes are loaded. |
| 16000 | Sampled work buffer, `0x62ca0`. |
| 131070 | Resource 11 lookup, aligned to the next 64 KiB boundary. |
| 132626 | Resource 10 container, with its pixels at the next 64 KiB boundary and header/palette 778 bytes before them. |
| 131072 | 65536-WORD derivative table, `0x62fee`. |
| 131072 each, twice | Two luminance/blur planes, each aligned to the next 64 KiB boundary. |
| 132626 | Resource 17 container, aligned like resource 10. |
| 64778 | Resource 21 ending-card container. |

The alignment is strict: an already aligned address advances to the next
boundary. Original tests provide declared successful allocation returns;
they do not assume that every possible allocator/alignment outcome is safe.

For each resource 10 pixel, setup adds its three original palette components
and looks up the integer mean in a 192-byte table at `0x62cb8`:

```c
luminance[i] = floor((palette[index].r + palette[index].g
                     + palette[index].b) / 3);
```

All components are six-bit values, so the sum is at most 189 and neither
wraps its byte accumulator nor exceeds the table. The shipped texture's
luminance ranges from 0 to 56. The radial image's own palette is loaded with
its container but is not used to build this working palette or height map.

Four passes then alternate the two 65,536-byte planes. Each pass processes
16,384 DWORDs:

```c
for (i = 0; i < 65536; i += 4) {
    sum = u32(read32(src + ((i-1)   & 65535))
            + read32(src + ((i+1)   & 65535))
            + read32(src + ((i-256) & 65535))
            + read32(src + ((i+256) & 65535)));
    write32(dst+i, (sum >> 2) & 0x3f3f3f3f);
}
swap(src, dst);
```

Only the **starting offset** of each read wraps. A DWORD starting at 65535
still reads three bytes beyond the nominal plane; this is not four separately
wrapped byte reads or independent X/Y edge wrapping. Four swaps restore the
original pointer ordering.

The captured tails are `08 09 04` for the first plane and zero for the second.
Supplying them reproduces both entire final/penultimate planes and the entire
derivative table. Setup does not write those tail bytes, and their prior
history is not established. Replacing them with zeros changes one final
blurred byte and four derivative bytes. Propagating that counterfactual
through all four checked frame tuples changes **no sampled output or RGB
pixels**, even where a changed derivative is read. This is a setup-fidelity
detail, not a demonstrated visible defect.

Finally, each blurred position produces a packed derivative WORD:

```c
lo = low8(4 * (L[(i-1)   & 65535] - L[(i+1)   & 65535]));
hi = low8(4 * (L[(i-256) & 65535] - L[(i+256) & 65535]));
derivative[i] = lo | (hi << 8);
```

The signed differences wrap to bytes. Later addition treats them as one WORD,
so a low-byte carry can affect the high byte; replacing that with independent
wrapped coordinates would change the addresses.

#### The 16000-sample inner loop

Sampler `0x3d752` reads every WORD from the fixed resource 5 map. Let `w` be
that map word and `shift` the controller WORD at `0x62fe2`:

```c
t = u16(w + shift);
textureIndex = firstPicture[t];
delta = derivative[t];
t2 = u16(w + delta);                // starts from w, not t
highlightIndex = secondPicture[t2];
work[i] = colourLookup[(highlightIndex << 8) | textureIndex];
```

The displacement is evaluated at the shifted texture position, but is added
to the **unshifted map coordinate** for the highlight. That distinction keeps
the moving texture and the highlight's base coordinate roles separate.
The final palette index comes from the shipped lookup, whose generation
algorithm is not recovered from this playback code.

The instructions replace the low 16 bits of aligned picture/lookup pointers,
retaining their upper address bits. Both picture reads remain in their
65,536-byte windows; derivative reads use the separately allocated
131,072-byte WORD table. Original-register checks verify all four addresses
per sample, not just final colour equality where lookup aliases might conceal
an addressing mistake. None of the inputs is modified by the sampler.

Several nearby controls are misleading if read without following their
consumers. A height-derived offset is computed and then overwritten by the
work pointer. Two animated phases produce another packed coordinate that
this sampler does not consume. The map always starts at its base; there is
no map-frame advance or demonstrated vertical bounce from those fields.

#### Sparse screen expansion and retained bytes

The work buffer contains 160×100 samples, but the screen copy uses source
columns 1–158. For each row and used column:

```c
v = work[160*y + x + 1];       // y=0..99, x=0..157
a = 640*y + 2 + 2*x;
screen[a]     = v;
screen[a+3]   = v;
screen[a+318] = v;
screen[a+321] = v;
```

These offsets form a staggered expansion, not an ordinary contiguous 2×2
block. They write 63,200 distinct bytes. Four bytes per logical screen row
retain their history: columns 0, 1, 3, 318 on even rows, and 1, 316, 318, 319
on odd rows. Tests start with nonzero declared history and verify all 64,000
resulting bytes. The native matches use zero for those 800 untouched bytes,
without treating a flat guest `A0000` dump as captured VGA backing memory.

#### Controller: interpolate velocities, then accumulate a packed shift

Rows 2, 5, 33, 36, 39 and 63 set the brightness pulse to 384; the same call
subtracts four unless the pulse equals 256. Held trigger rows therefore keep
producing 380. There is no row-edge latch. A separate gain starts at four
and increments by one per callback unless it equals 256. These are equality
stops, not general saturation clamps.

When the order changes, two interpolation weights reset to 256/0 and move
to 255/1 on that same call. They continue toward 0/256. The controller reads
only the first two DWORDs of adjacent 20-byte records at `0x62daa`, and for
each accumulated coordinate performs:

```c
increment = u32(endpoint0*weight0 + endpoint1*weight1) >> 8;
accumulator = u32(accumulator + increment);
```

The shift is **logical**, even though some endpoint encodings are negative.
The original 32-bit multiplication/addition wrap must be retained. In orders
17–20, the velocity pairs are `(−10,10)`, `(10,10)`, `(10,10)`, `(−20,8)`;
record 21 supplies `(0,0)`. The resulting two accumulators are arithmetic-
shifted right four and combined as `u16(256*x+y)` to form the actual sampler
shift. The other three DWORDs in each record do not participate here.

The controller also updates a bounce velocity/height and phases advancing
by +21/−11 modulo 4096. Their derived frame offsets are discarded in this
path, so they do not establish visible bouncing or extra geometric motion.

The working palette comes from resource 10, except its final 16 colours are
replaced with the ending card's palette. Normal palette construction is:

```c
factor = u32(gain * pulse);
v = sar32(low32(sourceComponent * factor), 16);
DACbyte = low8(min_signed(v, 63));
```

Foreground samples first, prepares the palette, waits for retrace, uploads
that palette, then performs the sparse screen copy. This differs from the
preceding feedback family's screen-write-before-palette-upload order.

#### Ending card and fade

![Direct native keyed ending over the texture-gradient field](images/super-television-runtime-gradient-card-9894.png)

*Native frame 9894, 141.169 seconds. Original sampling, keyed expansion and
ending-palette construction reproduce this complete image; the fade weight
for this frame is 414.*

Resource 21's original 0–15 picture indices are increased by 240 during setup.
The ending copy visits the same 63,200 destinations as normal expansion. At
each destination separately, it uses the transformed picture byte unless
that byte is 240, in which case it uses the sampled field. It leaves the same
800 screen bytes untouched.

After a normal copy, order exactly 21 takes priority over the Escape check.
The code waits until the signed row byte is at least two, without checking
Escape or rechecking order inside that wait. It then overlays the card on
the last sampled work and begins a palette fade, without sampling new frames.

The fade starts at weight 512, doubles the source brightness with a 63 clamp,
and decreases the weight by two per pass. In the controlled no-Escape test,
it uploads 256 palettes for weights 512, 510, …, 2. Weight zero is computed
but exits before upload; the weight-two palette is already entirely black
for the actual source colours. Native frames 9892–9897 match six consecutive
weights 418, 416, 414, 412, 410 and 408. That establishes this observed portion
of the fade, not a measured duration for all 256 uploads.

Cleanup releases all nine handles in reverse allocation order. It does not
restore the video mode or timer wrapper. The following picture-card routines
can run while this controller continues changing retained fields, so a later
save containing these pointers does not by itself prove active rendering.

#### Native correspondence and remaining limits

Complete original sampler, palette and normal display replay match eight
native frames:

| Save | Sampler shift | Native frame(s) |
|---:|---|---|
| 19 | Prior candidate 8296; current 8040 | 8125; 8126 |
| 20 | Prior candidate 50026; current 50282 | 8538; 8539 |
| 21 | Prior candidate 49767; current 50024 | 8944–8945; 8946 |
| 22 | Current 26199 | 9411 |

The prior shifts come from reversing nearby same-order accumulated updates.
For save 21, one and two earlier updates quantize to the same WORD. These
candidates reproduce the entire saved work with original instructions, but
do not recover a unique interrupt history. The ending adds six full native
RGB matches from save 23's unchanged sampled work and the original fade
builder. All comparisons cover the complete 640×400 image.

Independent checks cover complete resource/code ownership, luminance and
both blurred planes, all derivative bytes, intermediate sample addresses,
normal/keyed screen writes, 1635 controller calls plus four captured next
updates, all nine allocation/release requests, 24 exit cases and the full
controlled fade. The setup reproductions explicitly supply the captured
three-byte tails. Exact beam timing, successful allocation for arbitrary
returns and the offline construction of the shipped coordinate/colour tables
remain outside this evidence.

### Picture cards: `0x3c186` and `0x3c409`

The portrait and skull-and-leaf cards are static pictures whose palettes
pulse with the music. Each entry copies its bitmap **once**. Its foreground
loop then observes music-row changes, triggers brightness, and reduces that
brightness by 16 after each palette build. It neither redraws the image nor
uses the preceding shader's interrupt-controlled gain.

![Native portrait card with foreground palette pulses](images/super-television-runtime-portrait-pulse.gif)

*Resource 24, native frames 10295–10435, 146.890–148.888 seconds.*

![Native skull-and-leaf card with foreground palette pulses](images/super-television-runtime-skull-pulse.gif)

*Resource 25, native frames 10738–10878, 153.211–155.209 seconds. Both clips
preserve 71 full 640×400 native RGB samples, taken every two capture frames,
with a 2.03-second GIF duration.*

#### One copy under a black palette

Each entry requests 64,778 bytes, loads its complete RIX resource, copies
768 palette bytes from container offset 10 to `0x5ff52`, then clears and
uploads the working palette at `0x5f942`. With that black palette installed,
it copies 16,000 DWORDs from container offset 778 to the linear screen.
Neither entry calls the BIOS or changes the CRTC/plane configuration; it
inherits the preceding texture-gradient family's display mode.

| Entry | Resource | Signed start-order threshold | Exact exit order |
|---|---:|---:|---:|
| `0x3c186` | 24 | 22 | 23 |
| `0x3c409` | 25 | 23 | 24 |

Allocation precedes the start wait. The wait tests Escape before the order
comparison, so Escape releases the allocation even when the start threshold
is already satisfied. The order comparison is signed 16-bit: raw `ffffh`
is −1, not a sufficiently late order. No additional row gate starts the
picture itself.

The first entry retains gain DWORD `0x61a8b` and row-tracker BYTE `0x61a8f`.
The second explicitly clears both **before** allocation and waiting. An
observed zero in the preceding save is not a reason to describe both entries
as performing the same reset.

#### Row-edge trigger, then pre-decrement palette construction

Foreground compares the current row with its own tracker. Only a changed
row updates the tracker and tests the card's trigger list:

| Resource | Trigger rows |
|---:|---|
| 24 | 3, 5, 7, 9, 12, 15, 18, 21, 24, 27, 29, 30, 31, 35, 37, 39, 41, 44, 47, 51, 55, 57, 60 |
| 25 | 3, 5, 7, 9, 12, 19, 23, 25, 28, 35, 37, 39, 41, 44, 51, 55, 57, 60 |

A trigger sets gain to 384. The complete component loop then uses that gain
before decrementing it:

```c
if (row != tracker) {
    tracker = row;
    if (row_is_in_this_card_list(row)) gain = 384;
}
for (i = 0; i < 768; ++i) {
    v = sar32(low32(sourcePalette[i] * gain), 8);
    outputPalette[i] = low8(min_signed(v, 63));
}
if (gain != 0) gain = u32(gain - 16);
wait_retrace_on_then_off();
upload_palette(outputPalette);
```

The initial 384 gives a 1.5× brightness multiplier with an upper clamp.
A complete un-retriggered pulse has 24 positive builds at gains 384, 368,
… , 16, followed by black builds. Holding the same trigger row does not
reset the pulse: it continues to decay. Conversely, a newly observed trigger
row restarts it before the previous pulse necessarily reaches zero.

The gain decrement tests equality with zero; it is not a general saturating
subtraction. The original tests include an off-grid gain of one, which
underflows on decrement, without claiming that the authored sequence reaches
that state.

These updates occur once per **foreground palette iteration**, paced by the
retrace waits. They are not once-per-interrupt updates. The actual trigger
comparisons reread the live music row, so the stable-row pseudocode above
expresses a controlled iteration rather than proving atomic observation of
every music-row transition. Rows skipped between foreground observations
need not trigger a pulse.

#### The retained shader interrupt is a separate clock

The dispatcher installs wrapper `0x10134` before the texture-gradient entry
and calls both cards without replacing it. That wrapper keeps calling
controller `0x3dcdf`, which advances its own interpolation, phases, bounce
and gain/pulse fields. It does **not** write card gain `0x61a8b`, tracker
`0x61a8f`, or palettes `0x5f942`/`0x5ff52`.

This matters because the shader pulse tests held rows directly, whereas the
card pulse tests row changes. Reusing the shader's controller description
would give the wrong trigger and decay cadence. A write audit of original
controller calls from both card saves preserves all card controls, palettes
and complete resource bytes. The card setup similarly preserves declared
shader gain/pulse values. Only after the second card does the dispatcher
install wrapper `0x100e4` for the later stored-animation invocation.

After each palette upload, the card exits when its order equals the exact
exit value in the table, otherwise checking Escape and looping. An order
beyond that equality is not automatically an exit. Cleanup releases the one
saved handle, without a forced final black palette, image clear, video-mode
restore or interrupt-vector change. The dispatcher determines subsequent
flow; the card's Escape path alone does not describe the whole demo's exit.

#### Captured state and complete native correspondence

Saves 24 and 25 match every original resource byte and all 1286 relocated
code bytes covering the two routines. Save 24 has music row 6, tracker 5
and stored gain 272, but its saved palette matches **gain 288**. That is
consistent with palette construction preceding the decrement. Running a
fresh iteration from the stored gain instead changes 408 palette bytes.
The mismatch must not be repaired by treating the saved gain and palette
as simultaneous inputs to a new build.

Save 25 has row/tracker 2 and gain zero, before its row-3 trigger. Its black
palette does not by itself establish visible picture identity. Native
matching therefore excludes zero gain and tests all 24 positive authored
gain values for each original picture:

| Resource | Distinct positive-gain states checked | Exact native frames in selected scan |
|---:|---:|---:|
| 24 | 24 | 407, within frames 10295–10712 |
| 25 | 24 | 231, within frames 10738–11020 |

For every state, the replay executes the original full bitmap copy and
original row/palette/decrement instructions. All 638 matched native frames
agree on every RGB byte. The controlled sequence uses a newly observed row
3 followed by a held row to exercise all 24 decay states; it does not claim
that the actual music held row 3 for 24 foreground iterations. The selected
scan covers frames 10150–11020 and does not claim a full-run palette timeline.

Independent checks additionally cover 2560 original controlled pulse
iterations, both complete setup/release paths, 48 entry/exit gate cases and
16 retained-controller calls. Allocation results and retrace/input readiness
in those tests are declared service boundaries. The original player publishes
a row BYTE at `0x38704`, order WORD at `0x38705` and pattern WORD at `0x38707`;
all 40 active saves agree with the shipped module's order table. The old
`0x17`/`0x18` labels here are song orders 23/24, not frame counts.

### Television text: `0x3e386`, neighbour copying and VGA history

The repeated television lettering starts sharply defined, then its colours
spread into a noisy field. Two different histories produce that change.
CPU buffers copy randomly selected neighbouring **three-byte pixels**, while
the VGA planes retain and filter the displayed intensities. The CPU movement
is copying, not averaging; the smoothing happens in the old-screen lookup.

![Native stationary television lettering](images/super-television-runtime-television-12500.png)

*Native frame 12500, 178.352 seconds. The original stationary renderer has
settled to its integer fixed point. The same complete image occurs in 423
consecutive capture frames, 12285–12707.*

![Native television lettering spreading through neighbour copies](images/super-television-runtime-television-diffusion.gif)

*Native frames 13100–13310, 186.912–189.909 seconds. The GIF preserves 106
full 640×400 RGB samples, taken every two capture frames, in 3.02 seconds.
The scanline bands belong to the original display layout.*

#### A small RGB source becomes three palette-indexed scanline bands

Resource 18 is 57,600 bytes: a 160×120 image of repeated, alternately inverted
television lettering, stored as three consecutive component bytes per pixel.
Setup preserves an untouched copy, then shifts each working byte right two,
reducing it to 0–63. It requests two allocations:

| Bytes | Layout |
|---:|---|
| 179200 | Two 57600-byte working bodies, 89600 bytes apart, each with 16000 cleared bytes before and after it. |
| 121600 | Random-choice storage at the allocation base; the pristine 57600-byte resource copy begins 57600 bytes later. |

The first body receives the shifted source; the second starts zero. The
body pointers at `0x68082`/`0x68086` swap after each pass. All four padding
regions remain zero in the five active saves. The repeatedly assigned
pristine-copy pointer `0x6808a` is not consumed by this frame kernel.

Mode setup calls the BIOS, disables chain four and sets an 80-byte plane-row
pitch. Its maximum-scan-line request is **one memory row per scanline**,
not the two-line repetition used earlier. Under the checked BIOS register
inputs, it produces a 320×400 memory display. The first 360 rows are active;
the bottom 40 remain clear. Native correspondence confirms horizontal doubling
to 640 pixels without vertically doubling those memory rows.

Each source pixel supplies three consecutive display rows. The first row
uses palette indices 0–63, the second 64–127, and the third 128–191. These
are three embedded colour ramps; their high levels include other components,
so they are not assumed to be perfectly pure red, green and blue throughout.
The display is palette-indexed throughout, rather than a 24-bit framebuffer.

Setup initializes every plane with repeating row indices 0, 64 and 128,
which represent zero intensity in their respective bands. Both page globals
`0x63661` and `0x63665` are zero in all five active saves. Swapping those
variables does not establish two distinct VGA pages in this run.

#### Random choices and the delayed switch to neighbour movement

The foreground generates 4800 DWORDs, or 19,200 choice bytes, per pass.
Starting from three 32-bit states A, B and C, each iteration stores A and
then performs:

```c
A = u32(A + B);
B = u32(B + C);
C = rol32(C, 2);
B = rol32(B, 1);
A = A ^ C;
C = C ^ A;                 // uses the newly changed A
```

After all 4800 iterations, the final three values are added to their
respective starting seed globals at `0x67872`, `0x67876`, `0x6787a`.
The stored seeds therefore identify the completed random-block generation;
they are not necessarily the seeds that produced the currently saved bytes.
A save during the next fill can contain part of each choice block.

A choice byte selects a signed DWORD displacement from a 256-entry table.
Initially every entry is zero. Only **after an order-28 frame** does the
foreground suffix install the alternate table:

| Byte displacement | Entries | Three-byte-pixel interpretation |
|---:|---:|---|
| 0 | 1 | Same pixel |
| +480 | 64 | Next 160-pixel row |
| −480 | 64 | Previous row |
| +3 | 64 | Next pixel |
| −3 | 63 | Previous pixel |

The current pass has already rendered when the table changes. These are
linear addresses: a ±3 move at a row edge can reach the neighbouring row's
edge. Reads outside the complete image reach the checked zero padding;
there is no independent horizontal clamp or image wrap.

#### The two-pass inner loop and its old-screen lookup

For each pass `p=0,1`, the kernel at `0x3e1ce` visits 120 groups of three
rows and 80 pixel positions. It reads plane 0 for the first pass and plane 3
for the second. The write masks are `33h` and `cch`, whose low four bits
select planes 0/1 and 2/3 respectively:

```c
i = 160*y + 2*x + p;                    // y=0..119, x=0..79
delta = displacement[randomChoice[i]];
for (component = 0; component < 3; ++component) {
    fresh = source[3*i + delta + component];
    nextCPU[3*i + component] = fresh;
    off = (3*y + component)*80 + x;
    old = low8(readPlane[srcPage + off] - 64*component);
    value = low8(lookup[(old << 8) | fresh] + 64*component);
    writeSelectedPlanes(dstPage + off, value);
}
```

Each pass issues 28,800 VGA byte stores; together they fill all 57,600 CPU
bytes and issue 57,600 VGA stores. The paired masks duplicate each source
pixel across two adjacent memory pixels. The two passes interleave those
pairs across the 320-pixel row. The three source components go into three
successive scanlines.

The 16,384-byte lookup at `0x63672` is built from two integer arrays:

```c
newPart[n] = (n < 64) ? floor(n/8) : 63;
oldPart[o] = floor(7*o/8);               // o=0..63
lookup[256*o + n] = newPart[n] + oldPart[o];
```

Working source bytes remain at most 63, so the normal intensity recurrence is

```c
nextLevel = floor(fresh/8) + floor(7*oldLevel/8);
```

Those two truncations are separate. Replacing them with
`floor((fresh + 7*oldLevel)/8)` changes the result. The unused high source
columns of the lookup are not ordinary division-by-eight entries either.
Starting from the original zero-level initialization, every resulting level
stays at most 49, keeping the old-value lookup inside its valid range.

The stationary phase has a particularly visible consequence. For constant
`j = floor(fresh/8)`, the zero-start recurrence settles at zero for j=0,
otherwise `8*j-7`. The only fixed levels reached by the original image are
**0, 1, 9, 17, 25, 33, 41 and 49**. Nineteen updates reach the fixed image;
the twentieth leaves it unchanged. This explains the stationary quantization
without attributing it to GIF conversion or an assumed 64-level convergence.

#### Reconstructing the random and CPU history

The three pre-entry seeds in save 28 equal the original executable values.
Executing the original generator continuously from them reproduces every
byte of 1874 random blocks—35,980,800 bytes—and reaches all six examined
post-entry seed tuples:

| Save | Completed random-block generation |
|---:|---:|
| 29 | 270 |
| 30 | 475 |
| 31 | 894 |
| 32 | 1377 |
| 33 | 1437 |
| 34, exit boundary | 1874 |

Here “generation” counts foreground random blocks, not tracker rows or
interrupts. Save 31 is partway through the following fill: its saved choice
bytes are not all from the completed generation indicated by its seeds.

Save 29 still has the zero displacement table; save 30 has neighbour copying
active. Testing every possible first moving generation between those two
saves finds exactly **generation 443** reproduces both complete 57,600-byte
CPU bodies in save 30. Continuing that one sequence also reproduces both
bodies in saves 29–33. Save 31 has already swapped the source/destination
roles; the other moving saves are before that swap. No image-derived source
pixels or hand-repaired buffer history are inserted.

This supplies a continuous reference history for the VGA recurrence from
its original initialized planes. Complete original kernels and palette
builders are then checked at six reconstructed states, including the first
pass and moving generations 475, 877, 894, 1377 and 1437. All CPU outputs and
all visible plane bytes agree. The original PRNG is checked over the entire
1874-block sequence, not merely fitted to one output image.

#### Completed frames versus scanline observations

![Native moving television-text frame 13143](images/super-television-runtime-television-13143.png)

*Native frame 13143, 187.526 seconds, exactly matches completed generation
877, including original old-plane reads, neighbour copying and palette work.*

The first generated image also exactly matches native frame 12266. The
stationary result matches the 423 identical frames noted above. However,
a scan of frames 12260–14600 finds only one complete moving-state match at
full gain. Most moving capture frames must not be presented as snapshots
of the renderer after its second pass has finished.

Three further captures have exact, more narrowly scoped reproductions:

| Native frame | Generation | Original display-state reconstruction |
|---:|---:|---|
| 13160 | 894 | Whole scanlines sampled at nondecreasing prefixes of the original 57600-store sequence. |
| 13643 | 1377 | The same constraint, with its own measured sampling positions. |
| 13703 | 1437 | The same constraint, with its own measured sampling positions. |

For each scanline, **one common original state** supplies both pixel parities;
they are not fitted independently. The original writer is replayed and its
modeled planes read after the selected store counts. Every RGB byte then
matches the native capture. For example, frame 13160 needs partial first-pass
rows 11–12 and partial second-pass rows 272–274; the surrounding lines agree
with earlier or later complete values.

The store counts are measured from the image constraints and are not always
unique. This establishes that the original ordered writes admit the observed
scanline compositions. It does **not** predict CPU cycles, beam position or
exact capture sampling times. The modeled planes are reconstructed history,
not bytes misidentified as hardware VGA backing in a flat guest-memory save.

#### Foreground controls, inherited IRQ and exit

The loop regenerates random choices, renders, programs the page start,
builds a scaled palette, waits for retrace and uploads it, swaps both sets
of pointers, then runs its control suffix. Palette components use 32-bit
multiply, signed shift eight and byte storage, without an upper-63 clamp.
All five active saves have gain 256.

At order 30, signed rows 48–63 set gain to `256 - 16*(row-48)` after the
current upload. That affects a later build and gives gains 256 down to 16,
not zero. Order exactly 31 exits after rendering, upload and swaps; otherwise
Escape is checked. Cleanup releases the two handles in reverse allocation
order without restoring video mode or the timer wrapper.

The prior wrapper `0x100e4` still calls controller `0x3cb0d`, but original
write audits show it preserves this entry's controls. Random generation,
the displacement switch and fade are foreground-owned. A separate preceding
entry at `0x3e37c` sets a retained alternate-mode flag; in that mode the table
can activate independently of order 28 and a foreground counter exits at
350. The normal dispatcher calls `0x3e386` directly, and the checked run has
that flag clear. Neither flag nor counter is reset by this entry.

The independent checks also cover full setup and initial plane contents,
padded source ownership, five original two-pass kernels against nonzero
plane histories, 300 suffix cases and 20 inherited-controller calls. BIOS
readbacks and allocation results in setup tests remain declared inputs.
The recovered normal sequence and native joins do not establish every
possible allocator outcome, alternate-mode run or CPU-to-display schedule.

### Late molten field: `0x3e82f`, displaced picture and palette product

The molten orange/brown surface combines two stored 16-colour pictures. Four
moving windows of resource 19 produce a small intensity field. Differences
within that field displace samples of resource 20; the field and picture
indices then select a product palette. **The generated field is rebuilt from
the source picture, without writing its output back into that source.** Each
screen pass updates only one checkerboard half, so display history still
matters even though the field generator has no feedback.

![Native molten field, with alternating sparse pixel updates](images/super-television-runtime-molten.gif)

*Direct native frames 14580..14790, every second frame, at
208.029..211.026 seconds. The 106 samples retain their exact captured colours
in a 3.02-second GIF; no interpolated frames or simulated effect are used.*

#### Setup, picture conversion and padding

Entry `0x3e82f` calls BIOS mode 13h and makes four allocations:

| Requested bytes | Consumer |
|---|---|
| 16008 | A 16000-byte field, advanced to the strict next four-byte boundary |
| 130336 | Resource 19, with its pixel base aligned to 64 KiB |
| 194336 | Resource 20 and padding; the first 192000 bytes are cleared |
| 64000 | Signed displacement records; 57600 bytes are actively written |

Each original picture container is 64778 bytes: ten header bytes, 768 palette
bytes and 64000 indices. Both original index ranges are 0..15. Resource 19
stays unchanged. Resource 20's palette is copied separately, its header and
palette area is cleared, and every picture byte is shifted left four. Its
pixels consequently occupy only the high nibble. The two palettes live at
`0x6dc8d` and `0x6d98d`; the generated 256-colour palette is at `0x6df9d`.
Setup uploads the existing generated-palette buffer before building a new one.

The complete source containers, converted picture, copied palettes and
surrounding cleared storage agree with four live saves at orders 31..34.
The apparent `MOV AX,0309h; MOV DX,03d4h` preparation at `0x3e8c1` never
reaches an `OUT`: the allocation code overwrites EAX first. The setup does
not establish an extra CRTC row-repeat mode through those instructions.

#### Four windows and the packed average

Eight phase DWORDs at `0x6d94c..0x6d968` select four X/Y positions from the
4096-entry signed table at `0x688ec`. With its actual range −1023..1023:

```c
for (i = 0; i < 4; ++i) {
    x[i] = sar32(low32(S[phaseX[i]] * 80), 10) + 80;
    y[i] = sar32(low32(S[phaseY[i]] * 50), 10) + 50;
    offset[i] = x[i] + 320 * y[i];
}
```

The resulting X range is 0..159 and Y range 0..99. Each window reads
100 rows of 160 bytes from the original 320-byte source stride. Even the
largest possible address, source byte 63678, stays inside the picture.
The kernel at `0x3e67a` writes 4000 DWORDs to a contiguous 160×100 field:

```c
for (y = 0; y < 100; ++y)
    for (x = 0; x < 160; x += 4) {
        sum = u32(load32(source + offset[0] + 320*y + x)
                + load32(source + offset[1] + 320*y + x)
                + load32(source + offset[2] + 320*y + x)
                + load32(source + offset[3] + 320*y + x));
        store32(field + 160*y + x, (sum >> 2) & 0x3f3f3f3f);
    }
```

Here the shipped range proves that a byte sum cannot exceed 60, so there
are no carries between bytes. In this authored domain the packed expression
is exactly four independent `floor(sum/4)` averages, with output still 0..15.
That equivalence would not follow for arbitrary eight-bit source pixels.

#### Gradient, colour offset and the two sparse writers

At `0x3e6f6`, the middle 90 rows of the field produce 14400 signed DWORD
displacements. Subtraction wraps to a byte before sign extension:

```c
for (i = 800; i < 15200; ++i) {
    dy = s8(u8(field[i+640] - field[i-640]));
    dx = s8(u8(field[i+4]   - field[i-4]));
    gradient[i-800] = -320*dy - dx;
}
```

The vertical neighbours are four field rows away. Horizontal ±4 accesses
are linear byte neighbours, including across row boundaries; there is no
per-row clamp. All reads lie in field positions 160..15839. The original
0..15 domain bounds the combined displacement to −4815..4815.

Writers `0x3e76b` and `0x3e7cb` each visit 90×160 positions and issue two
byte stores per position:

```c
for (y = 0; y < 90; ++y)
    for (x = 0; x < 160; ++x) {
        j = 160*y + x;
        a = picture + 3200 + 640*y + 2*x + phase + gradient[j];
        d = displayBase + 640*y + 2*x + phase;
        k = phase == 0 ? 321 : 319;
        screen[d]   = field[j] | *a;
        screen[d+k] = (screen[d] & 15) | *(a+k);
    }
```

`displayBase` is 3200 in all four active saves. The two phases together
cover the 320×180 rectangle at rows 10..189. Each individual phase makes
28800 writes, preserving the opposite checkerboard half and the outside
rows. Neither kernel reads old VGA pixels to calculate its result.

The colour comes from **`field[j]`**, whereas the corresponding displacement
was calculated around **`field[j+800]`**. Aligning those two centres would
change the effect. The second store also samples the picture at its own
±row/column displacement; it is not simply a duplicate output pixel.

Across all allowed field differences the picture-relative address bound is
−1615..65614. Those extremes fit inside the observed cleared padding in the
four active allocations. The four current-input reconstructions actually read
only 1011..62571, entirely inside the picture. This verifies these inputs and
allocations without asserting that every allocator alignment is equivalent.

The phase flag is changed **before** entering its writer: a value other than
1 becomes 1 and selects phase 0; 1 becomes 0 and selects phase 1. A saved
flag alone therefore does not identify a completed screen update.

#### Palette product and interrupt fade

At `0x3ea97`, the 16-colour resource 20 palette A and resource 19 palette B
form a Cartesian product. High and low index nibbles select their entries:

```c
for (h = 0; h < 16; ++h)
    for (l = 0; l < 16; ++l)
        for (c = 0; c < 3; ++c) {
            t = u32(A[h][c] * B[l][c] * multiplier_6e2a9) >> 12;
            v = sar32(u32(t * gain_6e29d), 8);
            DAC[3*(16*h+l)+c] = low8(min_signed(v, 63));
        }
```

The first shift is logical, the second arithmetic; products wrap at 32 bits
and there is only an upper clamp. Multiplier `0x6e2a9` is 256 in the four
saves and this controller does not change it. The display writer completes
before palette construction, retrace waits and the DAC upload.

Controller `0x3ebb9`, installed through wrapper `0x1015c`, advances **all
eight phases by four modulo 4096**. Their initial offsets differ, but this
controller does not give them different speeds. It also performs:

```c
if (gain != 256) gain = u32(gain + 1);
if (order == 34 && signed_row >= 34 && signed(gain) >= 2)
    gain = u32(gain - 2);
```

Thus the first gated call at 256 gives 254, subsequent ordinary gated calls
decay by a net one, and a continued low-gain sequence alternates 0/1. It is
not a simple subtraction of two down to a clamped zero. Seven initial gains,
four orders and five row values were checked through five original calls
each: 700 controller updates. Entry masks phases but preserves the other
controls; the installed interrupt can run during setup.

#### What the saved buffers and native frames establish

Prepared offsets stored at `0x6d96c..0x6d978` reproduce all four saved fields
exactly through the original builder. Gradients rebuilt from those fields
match three saves completely. The earliest save differs in 17903 gradient
bytes, starting at byte 6484. Current phase globals are not universally the
inputs that produced the saved work buffers: one save needs the preceding
phase tuple; another has two compatible nearby tuples. These are not treated
as atomic foreground/interrupt snapshots.

An initial search of 2301 native frames found no complete-image match among
nearby two-phase candidates. Comparing the two checkerboard halves then
localized the difference: one half matches throughout, while the other shows
older output above a narrow transition and newer output below it.

![Native molten field with original sparse-writer correspondence](images/super-television-runtime-molten-14650.png)

*Direct native frame 14650, at 209.028 seconds. Its complete RGB image matches
whole-scanline observations of the original writer; the observation positions
are fitted to the capture, not predicted from CPU cycles.*

Original-code replay now reproduces **all 768000 RGB bytes** of native frames
14404 and 14650. It runs preparation, the full field and gradient builders,
two prior complementary writes, the next 28800-store phase and the palette
builder. The prior screen is reconstructed from those original writes with
zero outside history; no captured pixels are fed back as rendering inputs.

For each of the 400 physical output lines, a nondecreasing store-prefix
position selects one whole line from that execution. Frame 14404 requires
mixed old/new phase-0 pixels on physical rows 179..180; frame 14650 requires
them on rows 178..180. The opposite half matches the newer field throughout.
Two different nearby saved-phase descriptions reproduce the same 14404 state,
so this is not a unique reconstruction of the interrupt chronology.

These are exact original-writer **line compositions**, not whole completed
framebuffer matches or a cycle-accurate display simulation. Identical colours
also leave some observation positions ambiguous. The tests verify the entire
final framebuffer independently, as well as the line-composed native RGB.

#### Exit and the wrong release argument

After uploading the palette, order exactly 35 or Escape leaves the loop;
there is no `order >= 35` test. Cleanup releases four recorded slots in
reverse order. Original setup has a concrete mistake at `0x3e892`: it stores
the resource 20 header address from EAX into `0x6e2b5`, where the allocation
handle from EBX is needed. Cleanup later supplies that address to DPMI 0502h.

A complete setup/cleanup replay with distinct declared addresses and handles
proves the arguments are `[fourthHandle, pictureHeader, secondHandle,
firstHandle]`. The live slot likewise equals the picture base minus 778.
The release wrapper itself splits its argument into SI:DI correctly. This
proves the wrong release request; it does not establish whether the actual
DPMI host leaked, rejected it or behaved differently. Graphics mode and the
installed interrupt wrapper are not restored by this family return.

### Closing scroller: `0x3bf60`, stored overlay and a fixed background

The molten-field renderer is followed by a fixed version of its second
picture with pale characters scrolling over it. This routine does not build
letters from character codes or a font. Resource 27 supplies one authored
**320×600 indexed bitmap**; a moving 200-row window supplies the overlay.
Resource 20 supplies the 320×200 background and the palette used for both.

![Native closing bitmap overlay scrolling over its fixed background](images/super-television-runtime-closing-scroll.gif)

*Direct native frames 16580..16790, every second frame, at
236.565..239.562 seconds. The 106 colour-exact samples occupy 3.02 seconds.*

#### Source ownership, clearing and the copy loop

Entry `0x3bf60` selects BIOS mode 13h, allocates 64778 bytes for the
background container and 448778 bytes for the overlay storage. Each resource
has a ten-byte header followed by 768 palette bytes. Resource 20 contributes
64000 picture bytes; resource 27 contributes 192000. Both use indices 0..15.
The overlay's own palette is loaded with its container but never selected by
this compositor.

Before loading the overlay, the routine clears **448000 bytes** of its
allocation. The loaded 192778-byte container then replaces the beginning,
leaving 255222 explicitly cleared bytes after it. The allocation's final
778 bytes are not cleared by this loop. The setup test fills allocations
with nonzero values first, so that distinction is verified rather than
inferred from an already zero heap.

After loading the resources and uploading resource 20's palette, setup resets
counter `0x61a98` to zero. Its installed controller at `0x3c072` consists of
an increment of that DWORD and a return. It neither clamps the counter nor
checks music rows.

The foreground waits for vertical retrace to become active and then inactive.
At `0x3bfff`, it snapshots the counter, calculates a source pointer and runs
a scalar 64000-iteration loop:

```c
row = sar32(counter_61a98, 1);
overlay = overlayAllocation + 778 + u32(row * 320);
background = backgroundAllocation + 778;

for (i = 0; i < 64000; ++i) {
    pixel = overlay[i];
    if (pixel == 0) pixel = background[i];
    VGA[i] = pixel;
}
```

The actual inner loop at `0x3c031..0x3c044` reads an overlay byte, branches
on zero, optionally reads a background byte, stores one byte, advances all
three pointers and decrements ECX. Every destination pixel is overwritten;
there is no retained-screen input, blending or filtering. A nonzero overlay
byte replaces the background index directly. The background remains fixed
because its pointer always starts at the beginning of resource 20.

Two controller increments select one source row, **not necessarily two
presented frames**. The source pointer is calculated once before the copy;
an interrupt later in that copy does not change its register-held position.

The 200-row window lies entirely within authored pixels through source row
400. At row 401 it starts consuming the cleared tail; at row 600 its whole
window is cleared and the output is only the background. Counter 2395 is the
largest nonnegative value whose entire window fits the explicitly initialized
region. The code does not enforce this bound. The active captured counters
are 66 and 558, far below it; hypothetical later reads must not silently
assume the final uncleared bytes are zero.

After the copy, Escape exits first. Otherwise the loop ends only when the
music order WORD equals 37. The two allocation handles are released in reverse
order. Both full setup/release paths and 24 complete copies at captured and
boundary counters were independently checked; eight original controller calls
also verify DWORD wraparound. These tests supply successful allocation results
without asserting actual DPMI release success.

#### Native correspondence and counter ambiguity

![Native closing overlay at source row 279](images/super-television-runtime-closing-16679.png)

*Direct native frame 16679, at 237.978 seconds. The complete original
compositor with the saved counter 558 reproduces every RGB byte.*

The two active saves retain the exact original background, overlay, copied
palette and initialized tail. Counter 558 selects source row 279, whose
original copy matches native frame 16679 exactly. Row 279 is the only matching
row among the tested 0..600, although counter 559 selects the same row.

Counter 66 selects row 33 and also matches the capture, but that image is
background-only. Rows 0..73 and 533..600 give the same visible image. It cannot
uniquely establish a scrolling position.

A full 17550-frame scan found **420 distinct scroller RGB images across 775
native frames**, between frames 16121 and 17109. All 561 matching source-row
candidates were replayed through the original 64000-byte compositor and
compared with an independent scalar model. Candidate hashes locate matches;
the matching RGB images are also directly byte-compared. Some captures in
that interval do not match a complete-copy candidate; these checks do not
explain their timing or imply an exact interrupt trajectory.

### Final portrait: `0x3c079`, early palette change and foreground fade

Resource 26 is the final 320×200 portrait. Entry `0x3c079` loads its
64778-byte container and uploads its original palette **before** waiting for
the picture-change gate. It does not select another graphics mode or copy
the portrait pixels at that point. Until the copy, the previous framebuffer
remains under the new palette in the checked capture: **183 identical native
frames, 17111..17293**, reproduce the scroller at source row 494 with resource
26's palette. They occupy 244.142..246.739 seconds, immediately before the
portrait appears. Original replay runs the scrolling copy and the entire
final setup/palette upload, verifies that all 64000 screen indices survive
setup unchanged, and matches the complete native RGB image.

This explains the nearly dark pause: it is the old composite interpreted
through the new palette, before the portrait copy. Row 494 is the only match
among rows 0..600, but counters 988/989 select that same row. The native match
does not identify a unique exit counter or instruction at the moment of the
save. A background-only hand-off prediction failed; the retained overlay
pixels matter even at this late position.

![Native full-gain final portrait](images/super-television-runtime-closing-17294.png)

*Direct native frame 17294, at 246.753 seconds. The original one-time bitmap
copy and full-gain palette reproduce the complete captured image.*

#### Wait gate and one-time picture copy

The wait checks Escape first. Escape advances into the picture-copy/fade path;
it does not skip directly to cleanup. The ordinary music condition requires
both order **exactly 37** and a **signed row byte at least 24**:

```c
while (!escape) {
    if (order == 37 && signed_row >= 24) break;
}
copy16000DWORDs(picturePixels, VGA);       // 64000 bytes, once
paletteGain_61a8b = 256;
```

Forty controlled first-exit/final-wait cases verify the equality, signed-row
and keyboard branches. Orders 36, 38 and `ffffh` do not satisfy the final
music gate; byte row 128 is negative for that comparison. These branch tests
do not by themselves prove that every possible player/input history exits.

The save at order 37, row 8 contains the loaded resource 26. That establishes
source ownership, not that the portrait has already been copied. A later save
at order `ffffh` retains the same resource and code after the ending; it is
historical memory rather than proof that the renderer remains active.

#### Palette loop, stored gain and the last upload

The full picture is copied using 16000 DWORD moves. Subsequent iterations
change the palette only. At `0x3c11f`, each of the 768 source components is
multiplied by the current gain, shifted arithmetically by eight, upper-clamped
to 63 and stored in the working palette at `0x5f942`:

```c
for (;;) {
    for (i = 0; i < 768; ++i) {
        value = sar32(u32(sourcePalette[i] * gain), 8);
        workingPalette[i] = low8(min_signed(value, 63));
    }
    if (gain == 0) break;
    --gain;
    waitRetraceOnThenOff();
    upload768Components(workingPalette);
    if (escape) break;
}
```

The stored gain is decremented **after building** a palette and **before
uploading** it. A memory value of 255 can therefore coexist with an upload
built at 256. Under ready-retrace/no-Escape inputs, the original loop uploads
256 palettes at weights 256 down to 1. It computes the weight-zero palette
in RAM but exits before uploading it. Since the source components are 0..63,
the last uploaded weight 1 is already black.

With Escape held through the wait and fade, the original still copies the
portrait and uploads its full-gain palette once before leaving. Both this
one-upload path and the full 256-upload path were executed, with every emitted
DAC component and all 64000 copied pixels checked against the reference.

![Native final portrait fading through palette changes](images/super-television-runtime-closing-fade.gif)

*Direct native frames 17294..17548, every second frame, at
246.753..250.377 seconds. All 128 samples preserve their captured RGB values;
the GIF's centisecond timing totals 3.65 seconds.*

Every native frame **17294..17549**, 256 frames, matches an original final-card
palette candidate. That does not mean each frame uniquely identifies a
different upload: weights 252..255 produce the same RGB image, and weights
1..4 are all black. Unrelated earlier black frames are excluded from the
closing-coverage count. Across all weights there are 243 distinct RGB images.
The proof covers original picture/palette output, not a unique per-frame gain
or CPU-to-display schedule.

#### The interrupt that keeps running

Dispatcher wrapper `0x10184` installs the scroller controller before
`0x3bf60`, and the dispatcher calls `0x3c079` without replacing it. Counter
`0x61a98` therefore continues to increment during the final wait and fade,
but the final routine does not consult it. Its fade is paced by foreground
retrace waits. Sixteen original controller calls leave the tested final
palette and gain/tracker region unchanged while advancing that old counter.

The later captured counter values must not be reassigned to a still-active
scroller: its allocations have already been released and the final picture
has reused the background slot. After the final routine releases its handle
and returns, the dispatcher selects text mode 3 and proceeds through common
cleanup. There is no endless final-picture hold in this path; the complete
native run independently reached the DOS prompt.

## Sound, Visual Timer And Dispatcher

The demo has separate visual and audio interrupt paths. **PIT IRQ0 runs the
visual controllers** listed in the dispatcher table; the selected sound
backend advances the tracker through its own handler. Foreground routines
then read the published music order/row and often wait for VGA retrace.
Those are distinct clocks, not interchangeable ways to count a frame.

### Device selection in the checked run

Entry `0x1022c` looks for `ULTRASND` first and only tries `BLASTER` if it is
absent. The ordinary environment-selected branches do not run the separate
hardware autodetection routine. Their configured values are:

| Parsed environment | Card ID | Rate field | Backend initializer |
|---|---:|---:|---|
| `ULTRASND` | 1 | 25000 | `0x35e1d`, GUS |
| `BLASTER`, T below 6 | 2 | 22222 | `0x350f5`, software mixer |
| `BLASTER`, T at least 6 | 5 | 45454 | `0x350f5`, software mixer |

The rate field is a configuration value, not a measured interrupt frequency.
Both successful branches load the module and call the player setup. Card ID,
rate, port, DMA and IRQ occupy `0x6e610`, `0x6e608`, `0x6e60c`, `0x6e61c`
and `0x6e618`; backend entry `0x38737` also stores the hardware values in
code-resident fields around `0x354e7`.

Four post-initialization saves agree in both sets of fields: **card 1,
rate 25000, port 240h, DMA 3, IRQ 5**. Thus this capture supplies GUS-path
evidence. Merely finding Sound Blaster code in the executable does not show
that the run executed it.

The parsers consume narrow field formats. For example, the BLASTER IRQ is
read from one character after `I`; the controlled input `I10` becomes IRQ 1.
Five original parser tests verify these branches, including ULTRASND
precedence when both variables are present. They hook module/player startup,
so they do not claim successful hardware initialization for every input.

### Playback handlers and the detection probes

The older text described four short `base+0eh` handlers as generic playback
handlers. Their actual purpose is **IRQ detection**. Entries `0x37dd5`,
`0x37df0`, `0x37e09` and `0x37e22` store IRQ numbers 9, 5, 7 and 10 in
`0x354ec`, read the acknowledgement port, issue PIC end-of-interrupt writes
and return. They do not advance the tracker. Their references belong to the
Sound Blaster detection path.

GUS initialization instead selects handler **`0x37c7e`**. The original code
reads `base+6`, acknowledges/rearms card registers through `base+103h`,
`base+105h`, `base+8` and `base+9`, and subtracts 100 from a retained period
counter. Its branches call `0x3792d` or `0x37b29`; the latter reaches the
common tracker at `0x31b80`. This is not one tracker tick on every handler
entry. Setup helper `0x37bec` emits the corresponding card-register sequence;
its presence does not by itself establish an exact hardware timer frequency.

The software-mixing backend uses handler **`0x35072`**, with a card-specific
service and buffer work at `0x34fc3`. That buffer routine divides work around
tracker periods and can call the same tracker before processing remaining
samples. It likewise does not justify equating a music row to one hardware
interrupt. These playback paths are established by instruction inspection and
backend selection; the checks do not emulate complete DMA or audio playback.

The tracker publishes its row BYTE and order/pattern WORDs into
`0x38704/0x38705/0x38707`. Those shared fields connect the audio path to the
visual controllers and foreground gates recovered above.

### Vector guards: skipped installation is not high-IRQ support

The unsigned branches after `cmp bl,8` skip vector operations when the IRQ
is greater than eight. They should not be labelled a functioning
“high-IRQ path.” Some probe bodies and PIC-unmask operations for IRQ 9/10
exist even though their installer skips installing the vector. Original
guard tests for IRQs 5, 7, 8, 9 and 10 verify that 9/10 issue no vector-install
interrupt. The accepted boundary 8 is not thereby proved usable: the nearby
mapping table has only the eight ordinary entries `08h..0fh`.

The release note's warning about sound IRQs above eight therefore has a
concrete code-level limitation behind it. These bounded checks do not predict
all resulting behaviour on arbitrary machines.

DOS `INT 21h/AH=25h` requests vector installation in the active extender
environment; it does not itself allocate a real/protected-mode callback
wrapper. The separately decoded DPMI functions `0204h/0205h` request protected
vector get/set. The helper branches depend on the extender-type byte, which
is 1 in the captured run. The original vector-service tests log requests
rather than asserting that a real OS installed them.

### Visual PIT, inherited wrappers and cleanup

The normal dispatcher saves vector 8, calls `0x10010` with divisor `4295h`
and installs the first visual wrapper. The PIT helper writes `36h` to port
43h and the divisor's low/high bytes to port 40h. It also stores the integer
quotient `1234deh / divisor`: 70 for normal setup. This records a programmed
rate, not a measurement of delivered interrupts or display synchronization.

Each wrapper saves general and segment registers, clears the direction flag,
loads runtime data access, calls its visual controller, sends `20h` to PIC
port 20h and restores registers before IRETD. All eight wrapper bodies were
checked to the return instruction with balanced registers/stack. Seven
controller calls are explicit hooks in that wrapper test; the closing
controller actually executes and increments its counter. Its complete body
was already tested separately.

The normal dispatcher makes thirteen scene calls and nine vector
installations. A nonzero common return check can leave after a scene; that
check is not itself an Escape-specific comparison. Individual effects have
their own keyboard tests. Controlled normal, early-return and fallback paths
verify the dispatcher order without replacing scene-specific evidence.

If neither environment variable is present, the retained fallback flag sends
the dispatcher to `0x3e37c`. That entry enables the alternate television-text
mode and falls into `0x3e386`, bypassing the normal vector installation and
full scene sequence. This is evidence of a fallback effect, **not proof of a
silent full-demo playback path**. No new fallback capture is claimed.

Common cleanup requests the saved vector-8 selector/offset, then programs
PIT divisor **65536**: writes `36h,00h,00h` to the control/data ports. It does
not recover an arbitrary previous PIT divisor or mode. The retained integer
rate changes from 70 in active saves to 18 in the ending save, consistent
with those calls. Sound/module teardown and DATA teardown follow text-mode
selection and timer cleanup. The complete run reached DOS, but that does not
prove every individual allocation release succeeded.

The sound audit additionally checks 2588 relocated instruction bytes in four
saved states. Its port hooks, declared vector-service returns and bounded
backend branches remain distinct from actual interrupt delivery, OS vector
installation, DMA transfers or a cycle-accurate player simulation.

## Remaining Boundaries

The opening, bowl, STV-logo, both stored-animation invocations and the
texture-gradient family now have exact original-code/native RGB correspondence. The ending-card
composite additionally matches with its retained animation palette stated
explicitly. The fifth, fiery-feedback family has two exact native RGB
compositions from original output states; its measured row/column boundaries
do not establish CPU-to-beam timing. Both picture cards reproduce 638 selected
native frames from 48 original copy/palette states, without claiming a full
foreground/music-row chronology. The television-text pass recovers continuous
random/CPU history, completed native states and three measured scanline
compositions, without predicting beam timing. The late molten field now has
full field/gradient, sparse-write, controller and palette recovery, plus two
exact native whole-line compositions with the same timing distinction. Its
wrong cleanup argument is proved, but actual DPMI failure is not. The closing
compositor reproduces 775 native frames, its palette-before-picture hand-off
reproduces 183 more, and the final picture/fade matches all 256 ending frames.
Row and palette aliases prevent unique counter/gain attribution. Older
public-video associations remain separately labelled. Flat memory saves do not establish atomic foreground
or IRQ state, and no guest `A0000` dump has been passed off as captured VGA
history. OS allocation/release success and actual interrupt-delivery timing
are separate from the bounded original-kernel tests.
