Analysis model: gpt-5.5 xhigh Revision model: GPT-6 Astra (user-reported) Last edited: 2026-09-19

Television by Orange - Technical Dissection

Television is Orange's Assembly 1995 PC demo. Pouet lists it as an August 1995 MS-DOS production ranked seventh in the PC demo competition, with code by Hoplite, graphics by Der Piipo, music by Dune, and some additional graphics credited to Zeb.

Its full-screen image treatments include warped credit cards, texture tunnels, striped portraits and painted artwork. This review follows the recovered code behind the portrait/radial treatment, credits, texture tunnels and angular triangle-history passage, and corrects several media labels.

Sources

Pouet metadata:

type:           demo
platform:       MS-Dos/gus
release date:   august 1995
release party:  Assembly 1995
compo:          pc demo
ranked:         7th

Examined Files

Archive hash:

8b0a24114b690df7b7bcf00a51e97f8ad660b0a730ab3668cd8a9c46e98323de  tv.zip

Extracted files:

d3c32d2764a8c9f955c0100b444d7bd38a1cc2345a6d1fb082fdeaba95ebee6f  ALTERRAI.MOD
3b3279d1f20a64db9afb2a9bd73c6fac14be18ccfd50f59e99ed9ea8cebd1724  DEMO.EXE
ee61e8da54c9346d8e7c57366d5da5b3751fe2b2edb075bb1ba9370e6d93dda6  FILE_ID.DIZ
042c4976f71ce2d02b86e8b53b1a5c09fa9165875c7bee2bcc691ec1da02e334  INFOFILE
858d605b2d6eae58a6c2e1a9fd0b58c9e7c38a4be7ead60aedb0c2186d8055ab  081495 sidecar EXE

FILE_ID.DIZ gives the concise package identity:

Orange demo from asm95
    television
 386, gus/sb/nosound

The INFOFILE names Hoplite, Dune, and Der Piipo as contacts, but it also contains old postal addresses. Those private contact details are intentionally omitted here. The zip central directory also contains a 9,746-byte dated sidecar EXE with a non-ASCII first character in the filename; locally it was recovered under a safe scratch name for hashing only.

ALTERRAI.MOD is an 8-channel FastTracker module titled alterraid. Its sample names include dune/oran ge, radio1, radio2, juno.res2, juno.res3, 909 kick 6, and cm64 drum/synth names, matching the Dune music credit and the GUS/SB/nosound setup scope in the archive text.

What Changed In This Review

The packed-code boundary in the earlier article was a tooling limitation. UNP 4.12 recovers the full load image, and the original compressed header, checksums, relocation records and unchanged overlay corroborate that recovery. All thirteen main stages now have code-based explanations: the opening logo, Television title, early portrait/radial treatment, credits, gold and warm tunnels, intervening portraits, cellular tunnel, angular triangle history, later feedback portrait and finale. The picture-stage review also confirms an original decoder overrun in live memory.

The media review also found incorrect examples. The former “red radial” GIF showed the treated portrait; the former “liquid field” GIF showed the angular brown tunnel. The green-tunnel example had drifted into its brown successor. The corrected examples below use a fresh run. Their labels follow the visible scene, not the old filenames or approximate timeline.

Runtime Capture

The original packed release executable was run again on 2026-09-19 in DOSBox-X, with a dynamic core at 50,000 cycles, 16 MB RAM, S3 VGA and GUS base 240h. Host audio used the dummy driver. The guest sound hardware remained available for the demo's timing; all published GIFs are silent.

Native ZMBV capture splits when the video mode changes. Concatenating the six demo_000 through demo_005 video-stream durations gives 189.596 seconds. That clock starts with the first native capture frame, including a short DOS screen; it is not the earlier article's roughly 211-second process/startup clock. The executable returned to DOS by itself. New GIFs present the display at 400×300, generally sampled at 35 fps. The scale-atlas portrait uses 30 fps from its approximately 59.713 fps stream; the title is a selected native-frame still.

The older retained GIFs came from the previous direct, silent X11 capture at 10 fps. They are visually checked here but are not assigned the new capture's precise timestamps. The fresh run provides these representative observations, not exact scene-boundary measurements:

Native capture time Visible material
00:02.742 Opening monochrome Orange texture distortion
00:11.859 Television title picture
00:21.836 and 00:31.836 Striped/treated portrait
00:41.836 Red radial pattern
00:51.836 and 01:01.836 Wavy Hoplite and “barti! ZEB” credit cards
01:11.836 and 01:21.836 Gold tunnel, then warmer tunnel material
01:34.832 and 01:44.832 Cap-wearing portrait, then the swept-hair portrait
01:49.569 Green cellular tunnel
01:59.569 Brown concentric tunnel
02:19.569 Angular brown tunnel
02:29.569 Warm liquid-looking tunnel
02:39.569 and 02:49.569 Later striped portrait treatment
02:59.569 Final Zeb illustration

Unpacking And Address Map

The 776,285-byte original executable consists of a 60,926-byte MZ file portion and a 715,359-byte overlay. The former includes the 32-byte header: the actual DOS load image is 60,894 bytes. Its entry is CS:IP = 0eb0:000c, raw file 0xeb2c, with SS:SP = 4479:04de relative to the DOS load segment.

The entry stub copies itself and compressed input upward, using backward copies to avoid overlap. The old article confused backward copy order with downward relocation. Its other address error was the relocation table: CS:028c in the relocated stub corresponds to original raw file 0xedac, not raw 0x028c.

The RNC method-1 header at raw 0x20 declares 60,131 packed bytes and 280,441 unpacked bytes. UNP identifies PRO-PACK V2.08 and produces:

MZ header:             112 bytes
restored load image:   280441 bytes
relocations:           20
restored entry:        load-segment:03d9
restored stack:        load-segment+4478:1c00
overlay:               715359 bytes, unchanged
whole output file:     995912 bytes

Both RNC CRCs and all twenty relocation records agree with the original. The 8,640-byte depklite fragment used previously is no longer the extraction boundary. The restored entry first establishes the execution environment; it is not an effect routine.

The protected-mode entry is 0x259, which jumps to the main dispatcher at 0xafe. Unless explicitly called a raw offset, addresses below are relative to this 32-bit body. Convert them to offsets in the UNP file with:

UNP file offset = 0xf30 + protected-body offset
0xf30 = 0x70-byte MZ header + 0xec0-byte startup region

The main dispatcher calls thirteen stages in this order:

8785 → 2fd02 → 24480 → 19cea → 32f36 → 1d3ae → 2ff59
     → 2a588 → 27a05 → c46d → 2db62 → 431e7 → 300df

This establishes program order. It does not, by itself, identify every visible subdivision inside those stages.

The Overlay Is A Resource Archive

The loader at 0x6b0a uses a table of seventeen signed offsets at 0x6ac6. Offsets are relative to the end of the executable, so moving the unchanged overlay behind a larger unpacked load image preserves the resource layout. There are sixteen resources; they occupy the entire overlay without gaps, stored in reverse ID order. For resource i:

start  = executable_length + offset[i + 1]
length = offset[i] - offset[i + 1]

The important associations for this pass are:

Resource ID Bytes Recovered use
0 11,144 PCX Orange picture
3 4,826 PCX “hoplite” credit
12 4,328 PCX “dune” credit
13 5,080 PCX “der piipo” credit
11 4,884 PCX “barti! ZEB” credit
4 64,000 32,000 packed texture-coordinate words, consumed by the gold tunnel and other stages
10 65,536 Gold tunnel's 256×256 byte texture
7 22,519 PCX swept-hair portrait
9 17,885 PCX Television title
14 24,149 PCX cap-wearing portrait

The credits are identified from the extracted pictures and the actual calls that load them, not from development filenames. The preserved tnldata, tnldata2 and piccy.raw strings are useful context, but are unnecessary to prove the two renderers below.

Opening Orange Logo: Radial Displacement With Index Persistence

Opening Orange texture distortion from the earlier direct run

The retained opening clip shows the Orange lettering, distinct from the following Television title picture. Stage 0x8785 warps a fixed picture through a radial displacement field, then blends the new palette index with the index already stored at that destination. This is different from the later portrait/radial renderer's three separate RGB histories.

Source, Radial Field And Delayed Displacement

Entry loads resource 0. Decoder 0x873f skips its 128-byte PCX header, expands the run-length stream to 64,000 indices, skips the palette marker and shifts the 768 palette components right by two for the VGA DAC. The 320×200 decoded picture remains unchanged during the effect. Other allocated regions hold a 64,000-byte radial field, a 25,600-byte persistent work image and a 64 KiB-aligned blend table. The work image is explicitly cleared.

Field builder 0x85fd computes:

field[y*320 + x] = byte(((x-160)*(x-160) + (2*y-200)*(2*y-200)) >> 4)

Here x runs from 0 to 319 and y from 0 to 199. This is a squared-radius field truncated to eight bits; it does not calculate a square root or a geometric angle. Repeated byte values select the same displacement vector. The renderer uses field rows 60–139, corresponding to an 80-row strip from the source picture. A foreground sine calculation looks like it might select a varying strip, but the actual row selector is overwritten with the constant 60 before rendering.

Builder 0x86d6 creates 256 signed dword displacements at 0x8f7d. With sixteen-bit phases p and q, a step of 256 and the original 256-entry sine table S, whose range is −127 to 127:

for j in 0..255:
    dx = (S[p >> 8] * amplitude) >> 8
    dy = (S[q >> 8] * amplitude) >> 8
    displacement[j] = dx + 320*dy
    p = word(p + 256)
    q = word(q + 256)

Both scaled shifts are arithmetic. The frame loop renders before building this table, so each newly generated table belongs to the next foreground iteration. Its initial contents are zero. Treating the captured phase globals as parameters for the image already drawn would lose that ordering, as well as any intervening timer updates.

The amplitude control falls from 64 to 6. Across that complete reachable range and all sine phases, the source indices are bounded by 8,928 and 54,750. Thus these reads stay within the decoded 64,000-byte picture without clipping or wrapping. Horizontal displacements use linear addresses, rather than a separately wrapped X coordinate.

Four Pixels Per Iteration, Fifteen-Sixteenths History

Initializer 0x8f47 builds all 65,536 blend entries from two coefficient tables, 16*new and 240*old. Taking the second byte of their sum produces:

blend[(old << 8) | new] = floor((new + 15*old) / 16)

Kernel 0x8636 then performs:

for i in 0..25599:
    source_index = 19200 + i + displacement[field[19200 + i]]
    new = picture[source_index]
    work[i] = blend[(work[i] << 8) | new]

The original loop handles four pixels per iteration, 6,400 iterations in all. It fetches pixels two and three first into DL/DH, rotates EDX by sixteen bits, then fetches zero and one before storing the completed dword. For each lookup, AL receives the source index and AH the old work index; the upper half of EAX retains the aligned blend-table address. There is no multiply or division in this pixel loop.

The image history remains at the same destination positions. Only the fixed source picture is displaced; old pixels are not warped into new positions. Furthermore, this is interpolation in the palette's index ordering, not an RGB average. Changing the palette changes the displayed colours without changing the history bytes. Integer truncation also prevents an initially black history from rising toward a fixed input of fifteen or less, whereas a zero source continues reducing every positive old value.

Music Controls And Palette Transitions

The callback advances the two displacement phases by −625 and −725 modulo 65,536. It selects phase one during module order zero, phase two during order one before row 32, and phase three from order one/row 32. A separate control starts at 508 and falls by four toward 128 during phase two. The foreground uses amplitude = (128 + wave[control >> 3]) >> 1; the stored wave values produce the 64-to-6 range. The final distortion therefore remains nonzero.

During order zero, rows 0–32, routine 0x8ea2 uploads the source palette scaled by row/32. On entering phase two, foreground 0x8afc resets weights to 0/256 and blends from a separate stored palette toward the PCX palette. Callbacks transfer one weight unit toward the PCX palette. On entering phase three, it clears the second palette to black, resets weights to 256/0 and callbacks transfer two units toward black. Routine 0x8ef9 computes each component as (pcx*weightA + second*weightB) >> 8.

These are fixed-endpoint palette blends, unlike the warm tunnels' recursive palette updates. Foreground phase-entry resets and callback weight changes are separate operations; a music-row label alone does not specify their precise interleaving. Five saved states cover the strong warp, its reduced amplitude and the concluding fade. One snapshot already has order one/row zero while its callback-selected phase remains one, illustrating that limit.

Display, Timing And Checks

The stage requests BIOS mode 13h and sets CRTC 09h to 02h. Copy 0x8989 transfers the entire 25,600-byte work image as 6,400 dwords to VGA byte offset 0x2080, or row 26. Under that mode's chain-4 layout, three scanlines per logical row give 78 upper border lines, 240 image lines and 82 lower border lines in the 400-line scanout. There is no alternating image page. The foreground waits for retrace to enter and leave before copying.

Its timer setup measures a retrace interval using the PIT, subtracts 192 counts and installs a retrace-adjusted callback; callback counts should not be casually equated with rendered frames. A fallback branch, enabled by byte 0x604a, advances a synthetic tracker row once per six callbacks; that flag is zero in these GUS-run snapshots. Space enables a border-colour timing marker around the retrace wait, after drawing and table generation and before copying. Escape exits; the normal exit specifically tests order one and row at least 48. It then restores the timer hook and saved allocator cursor.

Original-instruction checks reproduce the PCX and palette, complete radial and blend tables, 24 full image updates, 400 controller cases, palette fades and phase-entry resets, plus the exact transfer bounds. Five paused original-run states retain the exact decoded source, field and blend table; their actual saved displacement tables keep every source read in bounds. Original instructions and an independent formula agree on each next 25,600-byte update from the saved history. That is a next-update prediction, not a reconstruction of the preceding history or an observed VGA-output match. Saved palette buffers likewise do not establish the DAC or beam state.

Portrait And Radial Pattern: RGB History On Coloured Scanlines

Early striped portrait from the older direct run

The old filename calls this a red radial clip, but it shows the portrait appearance. The later radial appearance is:

Red radial appearance from the fresh original-executable run

The radial excerpt is fresh demo_003 + 22.000–26.000, concatenated 00:41.836–00:45.836. Both appearances belong to stage 0x24480. Changing the warp turns the same source imagery into different shapes, while a persistent RGB image smooths their motion. The display then places the three colour components on successive scanlines. Those stripes are part of the renderer.

Source Expansion And The History Loop

Resource 5 contains 19,200 packed coordinate words, one for each pixel of a 160×120 working image. Resource 6 contains a 256×256 indexed source texture. Initializer 0x2443f expands each source index through the palette at 0x233a0, producing three separate 65,536-byte arrays of red, green and blue intensities. Each component lies between zero and 63.

The persistent working image occupies another three arrays of 19,200 bytes, initially cleared. Sampler 0x24165 processes one coordinate word and all three components per iteration:

v = coordinate[i]
sample = word(v + A[v >> 8] + B[v & 255])

for channel in (red, green, blue):
    new = source[channel*65536 + sample]
    old = history[channel*19200 + i]
    history[channel*19200 + i] = (new + 7*old) // 8

The two correction indices come from the original coordinate. Addition wraps the whole sixteen-bit word, including any low-byte carry into the high byte. The aligned source address keeps the component-bank selection outside those low sixteen bits.

The blend is implemented with a 65,536-byte lookup table at the aligned pointer in 0x24120. Its high address byte is the new intensity and its low byte the old intensity. Initializer 0x2412c combines coefficient tables 8*i and 56*i, then takes the appropriate byte after shifting; this gives exactly floor((new + 7*old)/8). Thus the pixel loop needs no multiplication for the persistence blend.

Each of 19,200 iterations reads three source components, three old history components and three blend-table bytes, then overwrites the same three history locations. The image retains seven-eighths of its old value at the same destination pixel. The warp samples the expanded source texture; it does not geometrically move pixels from the previous displayed image.

Integer rounding matters here. With a fixed brighter input, the history stops rising once it is fewer than eight intensity units below that input: floor((new-old)/8) has become zero. For example, a constant source intensity of seven cannot raise an initially black history pixel. A zeroed source, however, continues reducing any positive history value until it reaches zero. This is a quantized persistence filter, not an exact floating-point fade.

Distortion And Authored Motion

Builder 0x242ed creates two 256-word correction tables at 0x1df98 and 0x1e198. Eight phases, eight phase steps and four gains drive pairs of lookups in the wave table at 0x1e398. Preserving the x86 arithmetic widths, one scaled wave-pair operation is:

f(p, q, gain) = s32(u32((u32((S[p] + S[q]) << 3) >> 8) * gain)) >> 7

A[j] = word((f(pair_0) << 8) + f(pair_1) + movement)
B[j] = word(f(pair_2) + (f(pair_3) << 8))
movement = byte(-((word(scroll) >> 6) & 255))

Each phase advances by its own step modulo 4,096 for every table entry. The shift after the initial left shift is logical; the final signed shift is arithmetic. The scroll term is negated in AL with AH cleared, so it contributes an unsigned byte, rather than a sign-extended negative coordinate. Replacing either operation with an ideal signed formula changes the generated offsets.

Frame controller 0x24827 uses 48-byte records: four gains followed by eight phase steps. It selects them using the current module order minus the order recorded on entry, interpolating current and previous records with weights whose sum is 64. An order change resets the weights to 0/64; callbacks then move one unit at a time toward 64/0. The multiply/add wraps to 32 bits and uses a logical right shift by six.

The callback also advances the four phase pairs by −7/−9, −18/−17, +7/+5 and +6/+7, each modulo 4,096. After two elapsed orders, the foreground adds three to a sixteen-bit velocity and then adds that velocity to the sixteen-bit scroll value. The increasing scroll and changing gains produce further transformations of the same source material.

Erasing The Source, Then Letting The History Decay

At elapsed order three, from row 32, the frame controller enables erasure. The callback accumulates a pending width while the erase cursor is below 258. The foreground drains that width before drawing, so the wipe speed follows callback timing rather than a guaranteed single column per rendered frame. Its actual store addresses are:

for row in 0..255:
    for k in 0..pending_width-1:
        for channel in 0..2:
            source[channel*65536 + (row+1)*256 + old_cursor+k] = 0

The first affected row is one. The last crosses a logical 64 KB component boundary, touching the beginning of the next component bank; the enclosing allocation also has extra space. This is the executed footprint, including its spill, rather than a clipped 256-column image wipe. As those black source locations are sampled, the persistent history decays through the same blend lookup. The separate indexed resource remains intact.

Two saved states establish that lifecycle in the original executable. At order 4, row 3, erasure is disabled and the cursor is zero. At order 6, row 39, erasure is enabled and the cursor has reached 58. All 196,608 expanded source bytes agree with the source expansion plus that exact erasure footprint in both states. The stage exits when the module order equals seven, then restores its saved allocation cursor and timer handling.

Packing RGB Into VGA Planes

Packer 0x241e2 makes two passes over the saved history. The first starts at even source columns with sequencer write mask 03h, writing the same bytes to planes 0 and 1. The second starts at odd columns with mask 0ch, writing to planes 2 and 3. This duplicates each working-image pixel horizontally.

Each pass gathers source samples at offsets 0, 2, 4 and 6 into one dword. It writes red indices on one line, green indices plus 64 on the next, and blue indices plus 128 on the third. Twenty dword writes fill each component line; 120 working-image rows become 360 displayed component lines. Across both passes that is 14,400 dword stores. Self-modified comparison immediates mark the eighty-byte line end and the 28,800-byte per-plane drawing extent.

The setup unchains VGA with sequencer register 4 set to 06h. CRTC registers 14h/17h are 00h/e3h, the offset register is 40, and the maximum-scanline field is zero. The two pages use planar offsets zero and 32,000. Each plane's active range is page+1600 through page+30399: twenty top rows, 360 component rows and twenty bottom rows in the 320×400 display layout. These page units differ from the later chained tunnel stages.

The three sixty-four-entry DAC ramps are more than pure red, green and blue. Below intensity 32, the selected primary is 2*i and the other components are zero. From 32 upward, the primary is 63 and the other two become 2*(i-32), taking bright samples toward white. Valid generated indices stay within 0–191. The DAC upload contains 256 entries, but the final sixty-four are outside this renderer's normal output range.

After packing, the foreground selects the page in the CRTC, waits for retrace to enter and leave, and swaps page variables. This order does not by itself prove a tear-free page change. The red/green/blue line structure also means that display scaling and vertical filtering materially affect how the image looks; simply combining the three history arrays into one RGB image would show the working image, not this actual scanline presentation.

Verification Boundary

Original-instruction checks cover all source expansion and blend-table bytes, twenty warp/history states, five erase footprints, both VGA pages and the controller's arithmetic. The two saved guest states independently match the resources, source lifecycle, blend table, interpolated controls and both correction tables. Running the original packer on their real histories agrees with the independent scanline formula for all 115,200 drawn indices in each state. A predicted next history update also agrees for all 57,600 component bytes; that is a forward calculation from the snapshot, not an observed next frame.

A further silent run supplied five paused states across module orders four, five and six. Packing each real history reproduces all 115,200 active scanline indices found in a separate emulator buffer with the expected interleaved VGA-plane layout. All five images are distinct, and the page variables cover both page assignments. This ties the working RGB history to live output storage rather than only to a synthetic VGA write model.

The comparison covers the 360 drawn lines. It does not separately save the hardware register block, beam position or DAC registers, and does not claim an exact RGB screenshot match. The source/controller checks and original packer checks remain independently reproducible from the saved guest memory.

Wavy Credits: A Plasma Field Used As Displacement

Wavy credit cards from the fresh original-executable run

Fresh native capture demo_003 + 30.000–36.000, or concatenated 00:49.836–00:55.836. The scene starts at 0x19cea; its picture decoder is 0x19ca4, displacement-table builder 0x19c1e, and frame renderer 0x19a89.

This is a picture-warping effect. It first constructs a plasma-like byte field, then uses each field value to select an offset into a credit picture. It does not feed the previous displayed frame back into the next one.

The four PCX pictures decode to consecutive 320×200 byte images in the order Hoplite, Dune, Der Piipo, “barti! ZEB”. The decoder skips the 128-byte header, expands 11xxxxxx run markers until 64,000 pixels have been emitted, skips the palette marker, and shifts each palette component right by two for the VGA DAC. The last decoded palette is the one uploaded before rendering.

At startup, 5,120 dwords at 0xe558 are converted using (value + 1024) >> 5. The frame renderer uses this adjusted wave table to build 320 horizontal bytes and 200 vertical bytes. Each axis has two sample phases and two phases controlling their changing increments:

for each position on an axis:
    axis[position] = byte(W[a] + W[b])
    b = (b + (W[c] >> 1)) & 4095
    a = (a + (W[d] >> 1)) & 4095
    c = (c + step) & 4095
    d = (d + step) & 4095

field[y*320 + x] = byte(horizontal[x] + vertical[y])

The spatial step starts at four. The retrace-driven controller advances the horizontal/vertical sample phases by +21, −15, +24, −13, and their modulation phases by −15, +17, +19, −18; every phase wraps at 4,096. This changes the shape of the field rather than merely scrolling a fixed displacement bitmap.

A second pair of tables supplies signed horizontal and vertical displacements. 0x19c1e writes 257 dwords, although the byte field can select only the first 256. Its phases start at 128 and zero and advance by sixteen per entry:

displacement[i] = (table_13560[(128 + 16*i) & 4095] >> 6)
                + 320 * (table_14564[(16*i) & 4095] >> 6)

Those are arithmetic shifts. The renderer then processes 160 rows, with 160 pairs of pixels per row. It starts at byte offset 6,400: row 20. Thus the active picture area is 320×160, leaving twenty rows above and below untouched by this loop:

for pos in 6400 .. 57599:
    VGA[pos] = picture_base[pos + displacement[field[pos]]]

Each iteration fetches two independently displaced pixels and emits one word. There is no per-pixel multiplication, division or trigonometric calculation. Most of the work is byte lookup, dword-offset lookup and source fetch.

The credit changes also operate on addresses. On the authored order/row cues, the controller advances picture_base by 1,600 bytes—five picture rows—per update. Consecutive decoded pictures therefore roll through the same warped window. The cues are order 7 from row 32, order 8 through row 32, and order 8 from row 32 onward. The comparisons allow one step past an exactly equal picture pointer; they are not precise clamps to each image boundary. The stage exits when the order reaches 9. These order numbers are the player's zero-based byte at 0x35d5, with row at 0x35d3.

There is a small allocation detail worth preserving: the field is filled with 64,000 bytes even though its individual allocation request is 51,200 bytes. The following allocation reserves a 64,000-byte prefix before the first credit picture, so the extra field bytes fall into that prefix rather than into the picture. Treating each allocation size as an independent renderer bound would misread this layout.

The original decoder matches all four independently decoded pictures and palettes. A separate instruction-emulation check matches the two axes, all 64,000 field bytes and all 51,200 displayed pixels in 32 phase configurations; it also verifies that the source pictures and screen borders are unchanged. This checks the kernel, not cycle-exact synchronization to a captured frame.

Gold Tunnel: Two Texture Samples In One Palette Index

Gold tunnel from the earlier direct original-executable run

The fresh run also shows this gold passage at 01:11.836. It follows the credits in the dispatcher: stage 0x32f36, inner loop 0x32e50.

Resource 4 supplies 32,000 little-endian coordinate words. Resource 10 is copied into two separately aligned 64 KB texture banks. One copy retains the high nibble of each pixel; the other moves that same high nibble into the low nibble. The original texture's low four bits are discarded in both copies.

Before drawing, the routine makes a 256-entry row-distortion table from two 512-phase wave lookups. Its two phases advance by two and three per controller update. Within the table, both advance by two per entry:

row_shift[i] = word(((S[(p + 2*i) & 511]
                   + S[(q + 2*i) & 511]) >> 2) << 8)

For each packed coordinate, the low byte selects this row shift. Two animated 16-bit offsets then produce separate texture addresses:

uv = coordinate[pixel]
bent = word(uv + row_shift[uv & 255])
a = word(bent + offset_A)
b = word(bent + offset_B)
colour = (texture[a] & 0xf0) | (texture[b] >> 4)

The wrapping is a 16-bit address addition, including carries from the low byte into the high byte. It is not two independently clamped coordinates. The implementation keeps the aligned texture-bank address in the upper half of EAX or EDX and replaces only AX or DX. This makes wrapping around a 256×256 texture almost free. Two output pixels are assembled into BX and stored together, repeated 16,000 times.

The palette turns the combined nibbles into two coloured contributions. 0x32d4d constructs six 256-colour palettes from pairs of sixteen-colour ramps. For every high-nibble/low-nibble pair, each RGB component is approximately:

min(63, (ramp_A[high] + ramp_B[low]) * 100 >> 7)

The original instruction adds the ramp components in a byte before scaling. The stored ramps and all six generated palettes were checked against that exact operation. Colour blending therefore costs no RGB arithmetic in the pixel loop: two texture reads and an OR select a precombined palette colour.

The controller reads twenty-byte records at 0x30962: four motion values and a palette selector. On a music-order change it resets weights to 256 and zero, then transfers one unit per controller update toward the next record. The motion interpolation keeps the original 32-bit multiply/add wrap, logical right shift by eight, then arithmetic right shift by one. These values feed four wrapping accumulators; arithmetic shifts and the low sixteen bits of 256*v + u produce the two texture offsets. This animates two samples over the same coordinate map. It does not regenerate a perspective projection each frame.

Palette evolution has a different detail: 0x33179 blends the current palette toward the selected stored palette on every foreground pass, with those weights. It does not repeatedly interpolate from a saved original palette. The resulting convergence depends on the foreground updates as well as the controller weights. The upload happens before the next palette update, so the new RGB values reach the DAC on the following pass.

The stage starts from BIOS mode 13h and writes CRTC register 9 as 03h. Its 32,000 output bytes represent 320×100 logical pixels with repeated raster rows. Page-start values are zero and 8,000 in CRTC units; multiplying by four selects byte offsets zero and 32,000 in VGA memory. The renderer fills a page, selects its CRTC start, waits through retrace and swaps the page variables. Two display pages are not evidence of feedback: this kernel reads immutable texture banks, not either displayed page. The stage ends at music order 11.

Forty original-instruction checks using the actual coordinate and texture resources match all 32,000 output pixels, the 256 row shifts, and both page boundaries. All 4,608 bytes of the six generated palettes also match. A further 600 controller updates across orders 9 and 10 match the wrapping accumulators, offsets, phases and weights, with 900 recursively checked palette updates at a deliberately varied foreground cadence. This is a controller check, not a measurement of the original run's frame scheduling. The coordinate table's offline construction is still unrecovered; its consumer and the resulting texture-sampling mechanism are established.

Cellular Tunnel: Two Distortions, One Fixed Texture

Green cellular tunnel from the fresh original-executable run

Fresh demo_005 + 2.000–6.000, concatenated 01:49.569–01:53.569. This is stage 0x27a05, with sampler 0x27901. The later brown cellular view belongs to the same stage:

Brown cellular state of the same tunnel from the older direct run

The older filename says “green feedback”, although this particular excerpt is brown. The important correction is the mechanism: both appearances come from two samples of an unchanged source texture. There is no framebuffer feedback in this recovered path.

Resource 4 supplies the same 32,000 packed coordinate words used by the gold tunnel. Resource 8 supplies a different 256×256 byte texture. Setup allocates a 64 KB-aligned bank and reduces every source byte to its high nibble with pixel >>= 4. It retains this one 0–15-valued texture throughout the stage. Unlike the gold kernel, it does not prebuild separate high- and low-nibble copies.

Two Coordinate Corrections

The gold tunnel used one distortion indexed by the coordinate's low byte. Here 0x27901 constructs two 256-word correction tables: one indexed by the original low byte, the other by the original high byte. A separate wave controls the first correction's strength:

amplitude = (S[amplitude_phase] + 256) >> 1

for j in 0..255:
    A[j] = word((((S[((phase_A >> 2) + 16*j) & 511] >> 3)
                  * amplitude) >> 8) << 8)
    B[j] = word((S[((phase_B >> 2) + 16*j) & 511] >> 3) << 8)

S is the signed 512-entry table at 0x255d3, ranging from −256 to +256. The sample-value shifts are arithmetic; the phase shifts are logical. The amplitude therefore ranges from zero to 256. At zero the A correction vanishes while B remains active. The sixteen-entry phase step makes each correction table repeat after thirty-two entries, helping explain the repeated cellular structure.

Both corrections are multiples of 256. They change the high byte of the packed coordinate; neither represents a separately clipped Cartesian axis. Crucially, both lookup indices are taken from the original coordinate, before either correction has been added:

v = coordinate[pixel]
t = word(v + A[v & 255] + B[v >> 8])
a = word(t + offset_A)
b = word(t + offset_B)
output[pixel] = (texture[a] << 4) + texture[b]

The final offsets wrap the whole sixteen-bit word, so low-byte carries can change the high byte. MOV AX and MOV DX preserve the aligned bank address in the upper halves of their registers. The loop emits one byte per iteration, 32,000 times. It reads 64,000 coordinate bytes and 64,000 texture bytes per frame, with no reads from VGA memory. The source texture is not refreshed from either destination page.

Motion And Colour Controls

Callback 0x27c3d advances the two distortion phases by four and two, and the amplitude phase by one modulo 512. The first correction consequently breathes in strength as the two corrections move through their wave tables.

The twenty-byte control records at 0x24ffe contain four motion values and a palette selector. An order change resets weights to 256/0, then transfers one unit toward the next record per callback. Motion interpolation preserves the original wrapping 32-bit multiply/add and logical right shift by eight. It has no additional divide-by-two step, unlike the gold stage. Four wrapping accumulators supply the packed offsets through arithmetic shifts by three and a final word(256*v + u) construction.

Six palettes at 0x26610 combine pairs of sixteen-colour ramps. Their component formula is byte(ramp_A[high] + ramp_B[low]) >> 1, rather than the gold tunnel's gain and clamp. The packed high/low texture samples select the two ramp contributions. The shape can retain its cellular pattern while changing from green/gray to brown through palette and motion controls.

Foreground routine 0x27bec recursively blends the current palette toward the selected bank, with an additional brightness multiplier:

sum = u32(current_component * weight_A + target_component * weight_B)
current_component = (u32(sum * brightness) >> 16) & 255

Brightness starts at 256. During order 18, each callback decrements it while nonzero; the stage exits at order 19 or later. That branch is specific to order 18, so a guaranteed completely black exit cannot be inferred without the actual clock history. The palette upload precedes rendering, while the recursive update happens after the retrace wait; the next pass uploads those new components. Palette history is real, but it is not image-buffer feedback.

Pages And Live Checks

BIOS mode 13h plus CRTC register 9 set to 03h gives the same 320×100 stored pixels and repeated raster rows as the gold stage. Page variables at 0x24fe8/0x24fec contain zero and 8,000; the sampler multiplies them by four, selecting contiguous 32,000-byte output pages. The foreground renders, selects the CRTC start, waits through retrace, updates the palette and swaps page variables. Its CRTC writes precede the wait; this sequence alone does not establish an atomic, tear-free display change.

Independent instruction checks cover the entire texture normalization, six palette banks, 48 sampler states and 260 controller/palette cases. The sampler checks also verify that the source arrays remain unchanged and that all stores stay within the selected page.

A separate run of the untouched packed executable supplied two paused guest states. At module order 15, row 32, and order 16, row 22, the live coordinate and texture buffers match resources 4 and 8 exactly, including the one-time nibble conversion. The live phases regenerate both stored correction tables exactly. Using the live offsets then reproduces all 32,000 output bytes at both snapshots, matching a buffer outside guest RAM in DOSBox's chained-VGA layout: four used bytes per sixteen-byte group. The reconstructed states show the green and brown cellular appearances above.

This is stronger than a test with invented phase values: it ties the recovered source, tables and sampler to live output storage. The check does not separately recover the hardware register block or beam position. Its RGB reconstructions use the current software palette, which may differ from the most recently uploaded DAC values; no exact captured RGB-frame or scanout-timing match is claimed.

Angular Tunnel: Projected Triangles And Four Mask Histories

Angular brown tunnel from the original direct run

This older GIF's filename says “liquid field”. It actually shows stage 0xc46d: projected triangles XOR-filled into a one-bit work mask, then combined with older masks through VGA planes. Its sharp facets come from geometry and overlap parity. The neighbouring cellular tunnel's texture sampler is a different renderer.

Thirty-Two Triangles Moving Toward The Viewer

The geometry at 0xa694 contains 96 six-byte records: signed sixteen-bit x, y, z values, grouped into thirty-two triangles. The index table at 0xa8e6 simply names consecutive triples. On every second foreground loop, 0xc55a obtains a new triangle's X/Y coordinates from signed-byte wave tables, sets its three depths to 256, shifts the history forward by eighteen bytes, and appends the new triangle. Older triangles retain their earlier orientation while moving outward through perspective.

Projection at 0xc5d2 processes all 96 vertices. It reads each depth, then reduces the stored depth by four for the next loop. After combining its stored coordinate bias with the rasterizer's viewport subtraction, the projection is:

d = old_z + 25
x_screen = (trunc(x * 64 / d) * 178 >> 7) + 160
y_screen =  trunc(y * 64 / d) + 100
stored_z = word(old_z - 4)

The divisions are signed and truncate toward zero; the horizontal scaling uses an arithmetic shift. The intermediate projected coordinates are stored as words. The thirty-two retained depths form a moving sequence with an interval of eight after the insertion history fills. A live state contains post-decrement depths 4, 12, …, 252; adding four recovers the exact depths used to produce its saved projected vertices.

The insertion orientation follows a separate phase at 0x94f8. Each foreground loop adds the arithmetic-shifted sum of three signed wave samples and wraps modulo 360. A callback advances the three sample phases by two, three and five modulo 720; the foreground halves those phase indices before reading the table. This gives changing angular motion to newly inserted triangles. Two other counters passed through registers near the drawing loop are overwritten by the rasterizer; they do not establish another rotation of every stored triangle.

Exact XOR Rasterization

For each triangle, 0xc09a sorts vertices by unsigned word Y with three compare/swaps, including swaps on equality. Its edge walkers use eight fractional bits:

step = trunc((x1 - x0) * 256 / (y1 - y0))
x[k] = word(u32(x0*256 + k*step) >> 8)

One array holds the long top-to-bottom edge. The other holds the two short edges. When both short segments are nonempty, the second segment overwrites the last entry of the first. The span loop then draws total_height - 1 rows. Keeping that original join and row count is necessary to reproduce the mask; a conventional triangle filler gives different pixels.

The rasterizer subtracts the stored viewport bias (320,800), rejects rows outside 0–199, and clips X to 0–319. A row whose endpoints are both negative is skipped, as is one whose endpoints are both at least 319. The latter includes two endpoints exactly at 319. Surviving spans toggle both endpoints and everything between them. Short spans rotate a one-bit mask; longer ones XOR partial endpoint bytes and whole bytes, words or dwords in between.

All thirty-two triangles accumulate into the same 8,000-byte, 320×200 mask. Overlapping filled areas toggle each other rather than accumulating opacity. Triangle order is fixed; there is no texture fetch, depth sort or back-face rejection in this path. The screen clipping handles triangles expanding past the viewport as their depth decreases.

The cleared-mask polarity changes too. After the initial counter reaches 64, the foreground toggles the next clear value between zero and all ones on its every-two-loop branch. The actual clear occurs before that toggle, so the new value belongs to a later mask. The first allocated contents are not assumed to be zero. The exact zero-total-height branch can reuse an older edge height; the tested normal triangles do not justify treating arbitrary degenerate inputs as safely discarded.

Three Pages, Four Planes, Twelve Copies

Transfer 0xc70e copies ten dwords per mask row to one selected VGA plane. The source advances forty bytes; the destination advances eighty. Its sequencer mask rotates through 11h,22h,44h,88h; only the low four bits matter, selecting planes 0, 1, 2 and 3 in turn. Independently, the page starts cycle through byte offsets 0, 16,000 and 32,000.

The stage requests BIOS mode 0dh, whose saved ROM defaults select byte-addressed CRTC starts. It writes CRTC offset 14h and maximum scanline zero. The resulting row pitch is forty bytes per plane with a 320×400 scanout. Thus each forty-byte mask row lands on an even display row, with the odd rows left at index zero under the mode-set clear. Index zero is itself palette-controlled and need not be black. These are neither duplicated rows nor a 640-pixel logical framebuffer.

Numbering completed copies from zero:

updated_plane = copy_number % 4
page_start    = (copy_number % 3) * 16000

for row in 0..199:
    plane[updated_plane][page_start + 80*row : +40] = mask[row*40 : +40]

A page is revisited every three copies, changing a different plane each time. After startup, the page just written contains masks aged 0, 3, 6 and 9 foreground copies. If the newest mask is in plane p, those ages occupy planes p, p+1, p+2, p+3 modulo four. The four bits form a sixteen-colour palette index. Each particular page/plane pair is replaced once per twelve copies. This retained mask history supplies additional coloured facets even though each new work image has only one bit per pixel.

The opening copy is cropped: height two and offset 8,000 select mask rows 100–101 and display rows 200 and 202. Each callback performs five bounded offset -= 80; height += 2 steps. After twenty callbacks, all 200 mask rows are copied. The source begins at offset/2, preserving the relationship display_row = 2*mask_row as the opening expands.

Here the foreground waits for retrace to enter and leave before copying, then writes the CRTC start and advances the page variable. DOSBox separately latches that start for scanout. The age calculation describes stored page contents after completed copies; it is not a claim that every foreground copy is already the page being scanned at that instant.

Palette And End Conditions

The four retained masks are coloured through sixteen DAC entries. Each foreground loop computes and uploads forty-eight component bytes using a weight that transfers from 128/0 toward 0/128 in steps of four per callback. After uploading, it computes the next base palette from two stored palettes, using another pair of weights that change by plus/minus two per callback and a right shift by twelve. The upload therefore uses the preceding base palette calculation. Both operations preserve the original wrapping multiply/add, logical shift and byte truncation; they are not a single clamped interpolation.

The frame loop clears the complete work mask after copying. It exits when the module order reaches 21 or Escape is pressed, then restores the saved allocation cursor and timer hook. This puts the authored angular passage in the order-19/20 interval between the cellular and following warm stage.

Verification

Independent original-instruction checks cover 200 complete XOR masks, 17,280 projected vertices, 600 controller updates, both palette calculations, transfer stores and crop states. A four-plane storage model follows thirty-six copies and checks the full 320×400 index image and the 0/3/6/9 age pattern. The address interpretation is corroborated by the original register writes, the saved BIOS mode table and the local DOSBox implementation.

The original executable supplies a further check. One paused state reproduces all 96 saved projected vertices and all 8,000 work-mask bytes. In a second run, five distinct snapshots supply geometry for the original rasterizer and an independent scalar filler. After briefly resuming the emulator to allow a transfer, all 8,000 bytes match a saved VGA plane in each case. Both zero and all-ones starting masks occur. The other half of each saved row-pair is zero in all four planes, corroborating the untouched odd-row layout.

The combined saved planes have the angular appearance shown in the GIF. Their oldest three masks have not been independently reconstructed from prior geometry, and the paused guest state precedes the display-memory read by 45 milliseconds of host time. The comparison establishes mask generation and transfer, not an exact captured RGB frame, uploaded DAC state or beam phase.

Two Warm Tunnels: Shared Assets, Different Loops

Earlier warm tunnel with a bordered display

Earlier warm passage: fresh demo_003 + 60.000–64.000, concatenated 01:19.836–01:23.836. This continuous four-second, 35 fps clip shows the bordered output of stage 0x1d3ae, following the gold tunnel.

Later warm flowing tunnel

Later warm passage: fresh demo_005 + 38.000–44.000, concatenated 02:25.569–02:31.569. Stage 0x2db62 follows the angular triangle history. Its flowing appearance comes from coordinate distortion, two samples of a fixed texture and palette changes. Neither warm sampler reads its preceding image; the recursive operation is in the palette update.

Both stages load resource 4, the 32,000-word coordinate map, and resource 2, a 256×256 indexed texture. Reusing those assets does not make their rendering paths identical. The earlier stage combines two sines in one correction table and draws into RAM. The later stage uses two separately indexed correction tables and draws directly into alternating VGA pages.

Earlier Tunnel: Two Texture Banks And A Word Store

Setup 0x1d3ae allocates two texture regions aligned to 64 KiB. It copies resource 2 into both, then prepares low[i] = raw[i] >> 4 and high[i] = raw[i] & 0xf0. Thus both samples use the original high nibble; the texture's original low nibble is discarded. One bank holds that value in bits 0–3, the other in bits 4–7.

Kernel 0x1d2d9 generates 256 correction words at four-byte intervals. S is the original 512-entry signed sine table, with values from −256 to 256; word means truncation to sixteen bits and the first shift is arithmetic:

for j in 0..255:
    D[j] = word(((S[(P + 10*j) & 511]
                 + S[(Q + 10*j) & 511]) >> 3) << 8)

for each of 32000 coordinate words v:
    t = word(v + D[v & 255])
    pixel = high[word(t + offsetA)] | low[word(t + offsetB)]

The correction changes the coordinate's high byte modulo 256. The table index uses the original low byte, before adding either sample offset. The actual loop processes two coordinates per iteration: BL and BH collect two indices, then one word store writes both. Its 16,000 iterations overwrite the entire 32,000-byte output buffer. Keeping the texture pointers' upper sixteen bits in registers allows AX/DX arithmetic to wrap inside each aligned bank without a separate modulo instruction.

The gold tunnel also corrects the coordinate high byte. Here the sine index advances by ten per table entry and the sum is shifted by three; gold uses a stride of two and a shift of two. The earlier warm renderer also uses a RAM buffer and transfer instead of gold's direct paged VGA stores.

The apparent alignment operation after allocating the output is misleading: 0x1a1f0 already holds the raw allocation result, and the following palette builder ignores the adjusted register. The observed output pointer is the unaligned 0x1866ed; both sampler and copier use it. Similarly, a foreground calculation appears to supply a moving map origin in EAX, but the kernel overwrites that register and restarts from the coordinate pointer. That calculation does not crop or pan resource 4 in this path.

Earlier Controls And Bordered Display

Callback 0x1d673 advances phases by seven and eight, masking each to 511. Twenty-byte records contain four motion values and a palette-bank number. On a music-order change the motion weights reset to 256/0, then advance by −4/+4 on that same callback and subsequent calls: sixty-four updates complete the transition. These are callback counts, not measured displayed frames.

Each motion value blends the current and next order's records. The code wraps the products and sum to 32 bits, shifts logically right by eight, then halves the result. The second instruction is an arithmetic shift, but the preceding logical shift has already cleared the sign bit. Treating this as unrestricted signed interpolation would change its overflow behaviour. Four wrapping accumulators receive record fields in order 1, 0, 3, 2; each pair produces a sample offset:

offset = word((s32(accumulator0) >> 3)*256
              + (s32(accumulator1) >> 3))

Palette builder 0x1d1fd combines pairs of sixteen-colour ramps into six 256-colour banks. Each component is the byte-wrapped sum of the two ramp components, shifted right by one. Foreground routine 0x1d629 updates the current palette toward the bank selected by the current order:

current[i] = byte((current[i]*weightA + selected_bank[i]*weightB) >> 8)

This repeatedly blends the palette's previous result, rather than taking a fixed pair of endpoint palettes. Its bank selection also differs from the motion blend, which reads both current and next order records.

The stage inherits gold's chain-4 mode, resets the CRTC start to zero and writes CRTC register 09h with 02h. After rendering, it waits for retrace to enter and leave, uploads the existing 768 palette bytes, then copies 8,000 dwords from RAM into the VGA aperture at byte offset 0x1400 (5,120). Only afterward does it calculate the next palette. There is no page swap.

At 320 bytes per logical row, that destination begins at row sixteen and covers one hundred rows. Three scanlines per logical row produce a 300-line image beginning forty-eight scanlines down the 400-line display, leaving fifty-two lines below. The native capture visibly has the corresponding borders. The copy bounds and register writes establish this layout; they do not establish atomic palette/beam timing. The stage exits at music order 13 or Escape and restores its timer hook and allocation cursor.

Later Tunnel: Two Corrections And Delayed Phase State

The later kernel 0x2da61 constructs two tightly packed 256-word tables:

A[j] = word((S[(phaseA + 2*j) & 511] >> 1) << 8)
B[j] = word((S[(phaseB + 2*j) & 511] >> 1) << 8)

t = word(v + A[v & 255] + B[v >> 8])
pixel = byte((texture[word(t + offsetA)] << 4)
             + texture[word(t + offsetB)])

Both lookup indices come from the original coordinate word. Both corrections change its high byte. There is one immutable prepared texture, sampled twice, with a byte shift and byte addition joining the samples. The loop writes all 32,000 pixels directly into the selected VGA page.

The phase state has a one-call pipeline. The kernel first builds its tables from the saved phases, then latches the current offsets and replaces the phase globals with unsigned(counterA >> 2) and unsigned(counterB >> 2). Those new phases belong to the next table build. The timer callback advances the wrapping counters by four and three without masking them to 511; the table lookup itself applies that mask.

In the checked live state, the saved tables correspond to phases 40/30, while the already-updated phase globals contain 41/30. Rebuilding the tables from those globals would therefore misdiagnose a valid capture as wrong. The table identities were checked against all 512 source phases; this identifies their contents without claiming a unique timing history.

A Full-Register Shift Changes One Texture Byte

The texture-preparation loop at 0x2dbe2 loads AL but executes SHR EAX,4, not SHR AL,4. The original read routine returns the resource length, 65,536, in EAX. Consequently the exact conversion is:

eax = 65536
for each raw texture byte v:
    eax = ((eax & 0xffffff00) | v) >> 4
    prepared_byte = eax & 255

Residual upper bits survive the first iterations. At zero-based texture index 2 the result is 22 instead of 6; all other prepared bytes match raw >> 4. Executing the original loader with successful DOS reads, then its untouched conversion loop, reproduces this. The complete saved 65,536-byte texture confirms that it also occurs in the original demo run.

This matters to an exact reconstruction: the sampler shifts its first sample as a byte and adds the second as a byte. One cannot universally replace that addition with disjoint-nibble OR. The extra sixteen vanishes when the anomalous byte supplies the high sample but can affect the low sample. Neither sample addresses index 2 in the checked order-21/row-5 state, so replacing 22 with 6 changes no predicted pixels there. No visible glitch or intentional purpose is inferred from this instruction alone.

Later Controls, Pages And Verification

The later controller 0x2dd9f changes weights by one per callback rather than four, taking 256 updates from 256/0 to 0/256. Its four motion fields use the same wrapping blend and accumulator arrangement, but omit the earlier stage's additional halving. Its six palette banks use different ramp pairs; 0x2dd55 again recursively blends the current palette toward the current order's selected bank.

Entry explicitly sets BIOS mode 13h and CRTC 09h to 03h: each of the one hundred image rows occupies four scanlines. Page variables contain decimal 0 and 8,000. The kernel draws at CPU VGA offset 4*page, yielding the two 32,000-byte regions. The CRTC receives page itself, not that multiplied CPU address. Foreground uploads the existing palette before drawing, writes the CRTC start after drawing, waits for retrace, swaps page variables, then updates the palette. A saved page variable therefore does not by itself identify the page currently scanned. Exit is at order 23 or Escape.

Original-instruction checks cover both texture preparations, all twelve palette banks, 32 complete early-kernel cases with two incoming EAX values, 40 complete later-kernel cases, 260 controller/palette cases per stage, the RAM transfer and both later page destinations/register values.

An original-run early state at order 11/row 44 supplies a stronger output check: exact source assets, correction table and palette state reproduce all 32,000 saved RAM output bytes, using both original instructions and an independent sampler. For the later state at order 21/row 5, stage ownership through order, allocated resources and their contents, original code, prepared texture, palette banks and saved tables are verified. Original instructions and a scalar sampler agree on a 32,000-byte prediction from those inputs; it has not been matched against external VGA storage. Neither comparison claims an observed DAC bank, beam phase or complete timed replay.

Later Portrait: Expanding RGB Feedback Behind A Fixed Face

Later striped portrait treatment from the older direct run

The later striped face is stage 0x431e7, following the second warm tunnel. Its moving colour layer is genuine spatial feedback: a four-neighbour filter samples a reduced region of the previous image, enlarging it into the next work image. Noise injected near the centre supplies new detail. The portrait itself is added only during display packing, so its features remain fixed while the feedback develops around it.

Embedded Picture And Initialization Order

This stage makes no resource-loader call. The 160×120 indexed face is embedded in the restored body at 0x3d370, followed by 768 palette bytes at 0x41e70. Expansion 0x4319e makes three 19,200-byte component planes. Each component is palette[index*3 + channel] >> 2; the embedded palette already has values 0–63, so the expanded picture contributes only 0–15 per component.

Separate allocations hold three 256×256 feedback planes and three 160×120 work planes. The feedback source is aligned to 64 KiB, enabling the sampler to substitute address bytes. In both checked live states the source begins at 0x1b0000, fixed portrait at 0x1e66ed and work at 0x1f47f0.

The clear sequence deserves attention. After clearing all 57,600 work bytes, setup clears 319,744 bytes from the feedback-source address. That is more than the three 64 KiB planes and extends across the following portrait allocation into part of the work allocation. The portrait is expanded after this clear, so reading the stores without following initialization order would incorrectly suggest that the finished portrait is erased. Original allocator execution and the complete zero-store footprint are checked against these addresses.

Setup also builds a 65,536-byte (new + 7*old)/8 lookup table. It is unused by the normal frame loop. The sampler loads its pointer into EDX, but then replaces DL and DH with source bytes and never reads the table. Instruction-level memory tracing confirms that distinction. Its presence alone would give a misleading explanation of the persistence mechanism.

Sampling A Smaller Region To Expand The Feedback

The geometry uses four phases and a 4,096-entry sine table S, ranging from −1023 to 1023. With the authored step fixed at 200:

origin_x = 0x8100 + ((S[p0] + S[p1]) >> 4) - 80*200
origin_y = 0x8100 + ((S[p2] + S[p3]) >> 4) - 60*200

for y in 0..119:
    for x in 0..159:
        sx = ((origin_x + x*200) >> 8) & 255
        sy = ((origin_y + y*200) >> 8) & 255
        a = sy*256 + sx
        for channel in 0..2:
            work[channel,y,x] = byte(source[channel,a-1]
                                     + source[channel,a+1]
                                     + source[channel,a-256]
                                     + source[channel,a+256]) >> 2

The original 0x42f80 filter averages the left, right, upper and lower neighbours, excluding the centre. It is not bilinear interpolation. Its byte additions wrap before the shift for arbitrary inputs; the actual source invariant is 0–63, making the sum at most 252 and avoiding that wrap.

Each output step advances only 200/256 of a source pixel. Because the previous work image was copied into the source at one-to-one pixel spacing, this expands its sampled detail by a factor of 256/200, or 1.28, with small sine-controlled translations. The next source is this filtered image with fresh noise added. Repeating the filter smooths and spreads that detail.

For all phases under these fixed constants, sample centres remain within X 66–191 and Y 81–175. Including neighbours gives X 65–192 and Y 80–176, safely inside the feedback rectangle and its plane. The code uses linear neighbour addresses; it does not independently wrap or clamp each neighbour. Those bounds explain why the authored path does not need edge handling.

Noise Is Added After The Display Copy

The foreground filters first, waits for retrace to enter and leave, packs the visible image, writes the CRTC start and swaps page variables. Only then does it inject noise into the work layer and copy that layer back to the feedback source. Consequently newly injected noise belongs to the next feedback iteration, not the image just packed.

There are 140 noise iterations. Each computes:

delta = ((S[q0] + S[q1]) >> 8)
        + 160*((S[q2] + S[q3]) >> 8)

At component-relative offset 0x2671 + delta, it updates a four-byte-wide, four-row-high block with row stride 160. Offset 0x2671 is row 61, column 81; the same block location is used in all three component planes. Each dword is XORed with the evolving seed and ANDed with 0x3f3f3f3f, maintaining six-bit components.

For each channel, the seed is used for row zero, multiplied for row one, rotated through carry for row two, rotated left for row three, then multiplied again before continuing into the next channel:

Channel First multiplier Rotate through carry Rotate left Final multiplier
Red 0x9d 8 2 0x5cf
Green 0x627 2 4 0x5cf
Blue 0x11245d 1 5 0x2444c

The products wrap to 32 bits. RCR is a 33-bit rotation including carry, not an ordinary 32-bit rotate. Each occurrence follows an AND that clears carry, so the inserted initial carry is zero. Preserving that detail is necessary to reproduce the generated bytes and final seed.

Each noise iteration advances its four phases by 1, 2, 3 and 4, modulo 4,096. The timer callback separately advances the same phases by 1, 2, 5 and 3. Foreground iteration count alone therefore cannot recover their history. After all 140 iterations, three rectangle copies transfer every work byte into source offset 0x4430: row 68, column 48, 160 pixels wide and 120 high, with a 256-byte source-plane pitch. Bytes outside those rectangles are preserved; they are zero in the checked live states.

Fixed Portrait Addition And RGB Scanlines

Packer 0x43042 adds the fixed portrait to the filtered work as it writes to VGA. The portrait is neither inserted into the feedback planes nor resampled by the four-neighbour filter. Two passes use plane masks 03h and 0ch for even and odd input columns, duplicating each pixel horizontally. Red, green and blue component rows are interleaved vertically.

For the drawn 320×360 region, with coordinates relative to that region:

channel = y % 3
i = channel*19200 + (y//3)*160 + x//2
index(x,y) = work[i] + portrait[i] + 64*channel

The actual packer assembles dwords, adds work and picture with dword ADD, then adds 0x40404040 for green or 0x80808080 for blue. Given work at most 63 and portrait at most 15, there is no carry between byte lanes. But there is also no clamp to 63 before adding the colour-band offset. A component sum can reach 78, entering the next palette band; blue can reach index 206. It is therefore inaccurate to describe every possible pixel as a pure red, green or blue ramp sample.

One saved state contains eighteen component sums of at least 64, with a maximum of 77. This confirms such values in working data. Since noise follows packing, it does not prove those particular values reached the display. The static 768-byte upload palette is verified separately from DAC state.

Setup selects an unchained 320-wide, 400-line VGA mode. Each packer pass starts at page + 1600, with eighty bytes per plane per row. The resulting 360 drawn rows occupy display rows 20–379, leaving twenty-line margins. Pages begin at decimal 0 and 32,000. The CRTC receives the page after packing, then the variables swap; register values alone do not establish which image was being scanned at an arbitrary snapshot instant.

Controls, Cleanup And Evidence Limits

Callback 0x434ed advances the four sampling phases by 251, 283, 262 and 294, each masked to 4,095, in addition to its noise-phase updates. The foreground exits at music order 27 or Escape after finishing its iteration. It restores the timer and requests BIOS text mode 3. Unlike the warm stages, this entry does not save and restore the allocator cursor; no freeing of these allocations on its return is established.

Controlled original-instruction checks cover initialization, the unused LUT, twelve full 57,600-byte filters, eight complete noise batches, three feedback copies, both 115,200-index packer pages and one hundred controller states. The tests retain the original packer's self-modified loop endpoints.

Two live snapshots, at order 23/row 13 and order 24/row 22, confirm the allocations, all immutable portrait components, lookup table, upload palette and source bounds. Original instructions and an independent filter agree on all 57,600 predicted bytes from each saved source. However, that prediction does not reproduce the saved work buffer: 680 and 28,392 bytes differ, respectively. The buffers are modified in several phases of an iteration, and no saved instruction position establishes the capture boundary. Those differences remain explicit; no fitted noise history or assumed frame phase is used to turn them into a match. A complete feedback-history replay and observed VGA/RGB-frame match remain open.

Title And Cap Portrait: A Shared Decoder With A Real Overrun

Television title picture from the native capture

The Television title follows the opening Orange logo. This is native frame 115 of demo_002, at concatenated capture time 00:11.855. Four selected full-palette native frames match the original source and palette exactly, as described below.

Title entry 0x2fd02 uses resource 9, a 320×256 PCX. The later cap portrait at 0x2ff59 uses resource 14, a 320×240 PCX. Both call loader 0x2f2c3, then decoder/copier 0x2fbeb. Their display effects are principally palette changes over an image copied once into VGA planes.

The Counter Doubles Instead Of Counting A Run

The shared decoder contains 03 d2 at 0x2fc2c: ADD EDX,EDX, not ADD EDX,ECX. Its literal path adds one to the count, but the run path does:

run_length = token & 63
count = u32(count + count)
value = next input byte
write run_length copies of value

It then tests equality against the nominal decoded size. Run output itself is correct, so the intended picture prefix is produced. The counter, however, no longer measures that output and does not stop at the PCX image boundary. Expansion continues into palette bytes and beyond the resource; subsequent behaviour depends on the surrounding heap.

This is confirmed in original-run RAM, not just a suspicious disassembly. A title state at order one/row 48 contains the intact 17,885-byte resource, the correct 81,920 decoded pixels, and another 4,587 matching expansion bytes immediately beyond the output allocation. Those extra bytes can all be derived from input still inside the intact packed resource. At the legitimate image boundary the reconstructed faulty counter is zero; it never reaches 81,920 while consuming that known resource.

A bounded execution of the original instructions on the captured memory, with declared decoder-entry registers, reproduces all 86,507 bytes. It stops before reading any unknown input beyond the packed resource. This proves a live out-of-allocation write, but not the complete invocation's final overrun length or exact stopped instruction. Longer controlled-heap reproductions are not substituted for an observed live length.

The copier subsequently uses the legitimate dimensions. Four sequencer masks, 1, 2, 4 and 8, read linear source offsets 0, 1, 2 and 3 with a stride of four, producing eighty bytes per plane per 320-pixel row. All intended title and cap pixels match independent decodes in instruction-level checks. A RET at 0x2fcc0 makes the adjacent palette-reading code unreachable from this call. The entries instead use embedded palettes: the title palette matches resource 9's DAC-scaled palette; the cap palette matches all of its used indices, 0–103.

Title Palette Gates And Shared Defaults

The title relies on initially loaded shared defaults for resource ID, packed size, height and decoded size. It does not reset those fields on entry. The cap and finale change them, so invoking the title later with their stale values would not reproduce original startup.

After BIOS mode 13h, the title unchains VGA, clears its planes and writes a custom vertical register set. Its vertical-display-end value is 0x1fe, inclusive 511 scanlines, while the copier supplies 256 source rows. The mode's row-repeat and pitch context matter. Native frames 115, 116, 230 and 231 are identical and match all 981,120 RGB bytes of the following independent construction:

index = picture[(y//2)*320 + x//2]
RGB_component = (DAC_component[index] << 2) | (DAC_component[index] >> 4)

Here x is 0–639 and y is 0–510. This verifies the full-colour source image and 511-row presentation in those selected frames, including the foreground lettering. It does not measure the beam phase or establish the entire fade trajectory.

The first music gate requires both order >= 1 and row >= 60. Eight fade-up iterations scale each palette component by coefficients 0, 32, …, 224, divided by 256, followed by an explicit full-palette upload. The next gate requires both order >= 2 and row >= 32, then 256 fade-down iterations use coefficients 256, 255, …, 1. With DAC components at most 63, that final coefficient produces black exactly. These predicates are conjunctions, not lexicographic comparisons of an order/row pair.

Each fade computes its palette before waiting for retrace, calls foreground helper 0x302d9, then uploads. No separate timer callback is installed by this entry. Escape in the helper sets the shared exit flag; it does not replace the title's order/row gates with immediate exits. A changing value at 0x2e289 has no consumer in this picture-copy path and is not evidence that the still image moves. The saved allocator cursor is restored on return.

Cap Portrait: White To Picture

Cap-wearing portrait from the older direct run

Entry 0x2ff59 changes the shared defaults to resource 14, packed size 24,149, height 240 and output size 76,800. Its mode helper selects 480 scanlines with two scans per picture row and eighty bytes per VGA plane per memory row. The initial palette has every component set to 63.

After decoding and copying, sixty-four palette steps use:

component[k] = (63*(256-4*k) + target_component*(4*k)) >> 8
              for k = 0..63

The last weights are 4/252, yet integer truncation already yields every six-bit target component exactly. Each iteration waits for retrace and uploads the palette. There is no additional music-order holding loop or own timer installation. It restores its allocator cursor but leaves the shared image defaults changed.

A later snapshot illustrates why pointers alone cannot identify the visible scene: its old cap-output pointer lies inside the next effect's newly built atlas. The next picture can be preparing in RAM while the cap remains in VGA. That snapshot is not treated as a live cap-buffer match.

Following Portrait: Per-Pixel Selection From A Scale Atlas

Wave-selected portrait scales from the native run

The following swept-hair portrait is stage 0x2a588. This four-second clip uses demo_004 + 10.000–14.000, concatenated 01:42.832–01:46.832, at 30 fps from that stream's approximately 59.713 fps capture. It selects among precomputed versions of the picture at each pixel; it does not sample the previous displayed image.

Its separate decoder 0x2a38e correctly adds run lengths, expands resource 7 to exactly 64,000 pixels and reads the trailing palette. Setup builds sixty-four 160×100 images in a 1,024,000-byte atlas. For frame f:

step = 512 - 5*f
source = 32160 + (((x-80)*step) >> 8)
               + 320*(((y-50)*step) >> 8)
atlas[f,y,x] = picture[source] | ((4*f) & 0xf0)

The shifts are signed, and all source addresses stay within the 320×200 picture. The step falls from 512 to 197, changing the sampled area and hence the apparent scale. Original picture indices are only 0–9, leaving their high nibble free for the brightness tag. Four consecutive scale frames share one tag. Sixteen palette banks scale the first sixteen source colours by bank/16, from zero through 15/16; the last bank is not full brightness.

The full atlas, every decoded pixel and all generated palette bytes are checked against original instructions. A saved original-run state also matches all 1,024,000 atlas bytes. It is at order 13/row 39, before this stage's mode-change gate, so atlas preparation does not prove the image was already on screen.

Wave Tables Choose Scale Independently At Each Pixel

Setup transforms 640 dwords at 0x29880 in place with unsigned ((old + 256) mod 2^32) >> 3. Repeating setup on those modified values is not equivalent to a fresh entry. A separate 256-dword table maps an index to 16000*(index >> 2), selecting one of the sixty-four atlas frames.

Kernel 0x2a3cd builds one hundred row bytes and 160 column bytes:

row[y] = byte(T[(p0 + 2*y) & 511] + T[(p1 + y) & 511])
col[x] = byte(T[(p2 + 2*x) & 511] + T[(p3 + x) & 511])
f = byte(row[y] + col[x]) >> 2
pixel[y,x] = atlas[f,y,x]

The row/column sum wraps to a byte before frame selection. Each pixel keeps its own (x,y) location inside the selected atlas image. The visible warping therefore comes from spatially varying scale selection, with linked brightness tags, rather than a single zoom applied to the whole frame.

Two rendering passes use plane masks 03h and 0ch, duplicating each input pixel horizontally. Together they issue 4,000 dword stores. Eight controlled phase/page cases reproduce all 16,000 sampled indices and the duplicated plane writes. At eighty bytes per plane per memory row, destination page + 800 begins ten memory rows down. Four scans per sampled row give 320×400 active scanlines inside a 480-line mode, with forty-line margins. Pages use original per-plane offsets zero and decimal 32,000.

The kernel draws, writes the CRTC start, waits for retrace, uploads the palette and then swaps page variables. The start-register write is distinct from the moment the hardware latches a displayed page. Preparation waits for order 14 before changing the mode; Escape can bypass that wait.

Callback 0x2a8ad moves phases by −5, +3, −4 and +5 modulo 512, and transfers fade weights by four until 0/256. One hundred and thirty original callback suffixes and their complete palette mixes match independent arithmetic. The frame loop exits at order 15 or Escape, restores its timer path and pops the allocator cursor. Neither the atlas match nor these controlled checks establishes an atomic live VGA/beam comparison.

Finale: Raw Picture And Foreground-Controlled Fade

Final Zeb illustration from the older direct run

The final illustration is stage 0x300df. It sets height 400 and size 128,000, but loads resource 15 directly as indexed pixels: the faulty PCX decoder is not involved. Four plane-copy calls distribute all 320×400 indices with source offsets 0–3 and stride four. All 128,000 copied indices match the original resource in the independent plane-routing check.

Its mode setup unchains VGA while retaining the 400-line vertical timing, uses one scan per picture row and eighty bytes per plane per row. The palette is embedded at 0x2f8e3. The stage starts black with weight zero. Each foreground iteration computes/uploads its weighted palette around a retrace wait, then calls 0x302d9 to update the weight for the next iteration:

Music order Weight update
27 Increase by four, stopping at 256
28 Hold
29 Decrease by four, stopping at zero

The exit test requires order 29 with zero weight, or Escape. The terminal 4-to-0 decrement follows a weight-four upload, already exact black for components at most 63. All sixty-five weight palettes and 455 declared order/weight controller cases match original arithmetic. These updates happen in the foreground, not an independently installed timer callback, so sixty-four increments are not automatically sixty-four music ticks. The saved allocator cursor is restored on exit.

The complete native run visibly reaches this picture and returns to DOS. The available late-portrait snapshot precedes final entry and contains no loaded resource-15 image, so it is explicitly excluded from live final-buffer or palette-upload claims. The final-copy proof is an original-instruction and resource comparison, not an external VGA or exact RGB-frame match.

Remaining Work

All thirteen calls in the main stage dispatcher now have recovered setup, source data, drawing or copy loops, controls and presentation paths. This does not establish a complete timed replay. The original decoder overrun is confirmed beyond the title allocation, but its full live extent and later heap consequences remain unmeasured. Four selected full-palette title frames match the independently reconstructed RGB image; the whole fade trajectory and exact beam timing have not been reproduced.

The checks execute recovered 32-bit instructions and compare them with independent formulations. The visual runs use the untouched packed executable. Cellular outputs, early RGB scanline arrays and angular VGA masks have live byte matches; the earlier warm sampler matches saved RAM output. The later warm sampler and opening have predictions from saved inputs. The later feedback portrait's filter predictions differ from its saved work, leaving capture phase and prior history unresolved. The scale portrait's entire atlas matches live RAM, but that preparation can precede its display. Final-image copying is checked against the original resource and instructions, without a live final-buffer comparison. Exact captured RGB-frame, DAC and scanout-timing matches remain open where explicitly stated above.