Analysis model: gpt-5.5 xhigh
Cyboman 3 by Plant - Technical Dissection
Scope
This is a static dissection of Cyboman 3 - The Honeynut Loop by Plant,
released in 1995 and ranked second in the Juhla 1995 2.5 PC demo competition.
The focus is the code that makes it more than a joke sequel to Cyboman 2:
protected-mode startup, RIX image staging, timer-paced callbacks, palette
fades, framebuffer compositing, object records, projected face lists, and the
patched triangle span loops.
Sources:
- Demozoo: https://demozoo.org/productions/28269/
- Pouet: https://www.pouet.net/prod.php?which=2164
- Scene.org file page: https://files.scene.org/view/parties/1995/juhla95-2/demo/cyboman3.zip
- Scene.org party results: https://files.scene.org/view/parties/1995/juhla95-2/results.txt
- Scene.org party demo directory: https://files.scene.org/browse/parties/1995/juhla95-2/demo/
Demozoo gives the release date as 1 July 1995. Pouet lists June 1995. The zip contents have late June / early July timestamps, so I treat the release year as 1995 and the party release as Juhla 1995 2.5.
Archive Contents
The examined archive is the public Scene.org cyboman3.zip:
0d701840859b683b30ddb8425ba23b4bcd06b8ca0680c4599032993522d89706 cyboman3.zip
It contains:
CYBOMAN3.EXE 231862 bytes
CYBOMAN3.DAT 388048 bytes
REALCYBO.S3M 547496 bytes
FTJ_CYBO.TXT 1664 bytes
FILE_ID.DIZ 245 bytes
Extracted file hashes:
f2ea8a60d44e7796a8da5253b806ab94ac4443914783e9ac827f88d69ccf31a8 CYBOMAN3.EXE
cc94c1131da92835d0190acf6e15e862077d216d6b2713f9cef80366192fb985 CYBOMAN3.DAT
5c082757b61be489f181145c9d93a1b2c24db8b35d5f293fbc345fbbb48ab7c5 REALCYBO.S3M
7dd78cdb31d7d77351673e11c7e3d6373e944942047e67f20a506d5fd0d06c95 FTJ_CYBO.TXT
cd63951a0677e509ab6e147639075b63591b12fafbcae90efc433326e77e5e79 FILE_ID.DIZ
FILE_ID.DIZ names the party release and subtitle:
CYBOMAN 3
The Honeynut Loop
The text file credits:
Code: Mik
Graphics: Nik
Music: Purple Motion
Objects: Varlock
It also says the real Cyboman part has 5778 faces, or 34668 faces by the release-note joke count. Old private contact listings are omitted here.
MZ And Protected-Mode Startup
CYBOMAN3.EXE is a normal DOS MZ executable from the outside:
declared size: 231862 bytes
actual size: 231862 bytes
header paragraphs: 32
relocations: 25
CS:IP: 0000:03dc
SS:SP: 387c:1c00
entry file offset: 0x5dc
The entry at 0x5dc is a PMODE-style bootstrap. Its early work is not demo
content; it is CPU and DOS environment setup:
check 386+
probe DPMI through INT 2Fh AX=1687h
fall back to VCPI through INT 67h when needed
enable A20 through port 92h, then keyboard-port fallback
allocate or build descriptors
enter 32-bit protected mode with a far return/jump
The failure strings in the executable make the expected machine clear:
386 or better not detected!!!
System is already in V86 mode, and no VCPI or DPMI found!!!
DPMI host is not 32bit!!!
Couldn't enter 32bit protected mode!!!
The A20 path first tries port 92h. If that does not work, it uses the
keyboard command port 64h and data port 60h:
out 92h, al ; fast A20 gate path
out 64h, 0d1h ; write output-port command
out 60h, 0dfh ; enable A20 through keyboard unit path
The protected-mode handoff stores selector and base-adjust values in low
variables around 0xafe0..0xb0ff, then uses a far transfer into the 32-bit
image. From that point on, most interesting offsets below are file/runtime code
offsets in the protected-mode body.
Asset File Layout
CYBOMAN3.DAT is a sequence of RIX-style image chunks. The raw file has RIX3
markers at:
0
64778
129556
323270
The first, second, and fourth chunks are exact 320x200 8-bit images:
10-byte RIX header
768-byte VGA palette
64000-byte pixel page
That totals 64778 bytes. The third chunk is larger and starts with a
256x256-looking header, then includes more visual data. The loader treats the
RIX header as 10 bytes, then uses the next 0x300 bytes as palette data and
the following bytes as chunky 8-bit pixel pages or sprite pages.
REALCYBO.S3M parses as a Scream Tracker 3 module:
title: REAL cybomen v2.1
orders: 30
instruments: 22
patterns: 30
speed: 6
tempo: 125
global vol: 64
active channels: 8
The executable contains the strings MikPlay, realcybo.s3m, and
cyboman3.dat, tying the visible sequencer to a module-driven timing counter.
Global Setup At 0xf8f8
The routine at 0xf8f8 builds the working memory used by several later parts.
The two most important generated tables are a 256-byte signed noise table and a
64 by 256 signed multiply/remap table.
The first allocation is aligned to 256 bytes and stored at [0x6dd7]. The
generator uses three changing 32-bit state registers:
ebx = 461258fah
ecx = ed9876abh
edx = 23fe98a7h
bp = 0100h
next_byte:
ebx += edx
rol edx, cl
edx -= ecx
eax += ebx
eax ^= edx
al &= 3fh
al -= 20h
stosb
dec bp
jne next_byte
The result is not a full random stream. It is a 256-byte cyclic signed wobble
table in approximately [-32, 31], indexed later by only the low byte of BL.
The second allocation is 0x4000 bytes and is stored at [0x6dd3]. It is a
precomputed table of signed byte times 0..63:
for cl in 0..63:
for bl in 0..255:
eax = sign_extend(bl) * cl
eax >>= 6
store al
That turns a multiply and shift in the hot pixel path into a single indexed
byte load. The code uses AL as the signed noise/amplitude input and AH as a
0..63 factor, so EAX naturally becomes an offset into this 16K table.
The same setup routine also builds:
[0x6de7] linear A000h pointer adjusted by the protected-mode base
[0x6deb] main 64000-byte work page plus extra transition data
[0x6ddf] current image/page pointer after RIX header and palette
[0x6ddb] secondary image or transition page
[0x6e03] 64K work block
[0x6de3] sprite/animation block
[0x880d] additional visual block
The first visible still is copied directly to VGA:
esi = [0x6ddf] ; first chunky page
edi = [0x6de7] ; A000h linear pointer
ecx = 3e80h ; 64000 / 4
rep movsd
Timer And Frame Callback
The timer install path at 0xfeb7 is unusually careful about retrace timing.
It reads the old interrupt vector, measures vertical retrace through port
3dah, samples the PIT counter through 43h/40h, computes a reload value, and
installs its own ISR at 0x4d83.
The retrace measurement loop runs 32 times:
wait_retrace_set:
in al, dx ; dx = 3dah
test al, 08h
je wait_retrace_set
wait_display_window:
in al, dx
test al, 09h
jne wait_display_window
out 43h, 06h ; latch PIT channel 0
in al, 40h
in al, 40h
accumulate elapsed PIT counts
It then averages, subtracts a small bias, stores the result at [0x4ddb], and
programs PIT channel 0. The installed ISR does four jobs:
set [0x4de1] = 1 ; frame gate for mainline waits
wait for retrace bit 3 ; align visible work
reload PIT from [0x4ddb]
inc dword [0x4ddd] ; ISR tick
call dword [0x4d7f] ; current visual callback
The callback pointer [0x4d7f] is the main scene hook. The sequencer writes it
under cli/sti, for example:
cli
mov dword [0x4d7f], 0x556d
sti
The ISR also keeps a fractional accumulator at [0x4dd9]. When the accumulator
carries, it chains to the old timer vector at [0x4d7b]; otherwise it sends an
EOI to port 20h and irets. That preserves DOS time while still driving a
custom visual rate.
Mainline waits use two helpers:
0xf8ce: wait until word [0x901] reaches requested music tick
0xf8d8: wait until byte [0x4de1] is set by the ISR, then clear it
[0x901] is the module-tick clock used by the main show script.
Palette Fades
Palette uploads are all straight DAC writes:
mov dx, 03c8h
xor al, al
out dx, al ; start at DAC entry 0
inc dx ; 03c9h
mov ecx, 0300h
out_loop:
lodsb
out dx, al
loop out_loop
The fade-out loop at 0xf838 scales a 768-byte palette by a 6-bit factor:
bx = 64
fade_step:
wait frame flag
esi = [0x83d4] ; original palette
edi = 0x48ee ; working palette
ecx = 0x300
repeat ecx:
al = [esi++]
ax = al * bx
ax >>= 6
[edi++] = al
upload 0x300 bytes from 0x48ee to DAC
bl--
jne fade_step
The inverse fade around 0x1355b does the same operation around white instead
of black:
al = [source_palette++]
al = 3fh - al
ax = al * bx
ax >>= 6
al = 3fh - al
[working_palette++] = al
This gives the demo its white flash / inverted fade path without a second palette table.
The 64K Framebuffer Compositor At 0xfe35
The cleanest full-screen inner loop is 0xfe35. It is a 64000-byte compositor
that treats zero pixels as transparent and uses the two generated tables from
setup:
ebx = [0x6dd7] ; 256-byte signed wobble table
ebp = [0x6dd3] ; 64*256 multiply/remap table
edi = [0x6de7] ; A000h
esi = [0x6deb] ; work page
ecx = 0fa00h ; 64000 pixels
dh = 3fh
bl = [0x4cca] ; animated table phase
al = [0x4cc8]
al >>= 1
[0x4cc9] = al
pixel:
dl = [esi]
if dl != 0:
al = [ebx]
bl++
ah = [0x4cc9]
al = [ebp + eax]
al += dl
al &= dh
ah = -ah + dh
al = [ebp + eax]
[edi] = al
edi++
esi++
loop pixel
bl += 57h
[0x4cca] = bl
In higher-level form:
for each screen pixel:
base = work_page[p]
if base != 0:
wobble = signed_noise[(phase + p) & 255]
t0 = mul_table[(fade_half << 8) | wobble]
mixed = (base + t0) & 63
t1 = mul_table[((63 - fade_half) << 8) | mixed]
vga[p] = t1
phase += 0x57
This is not a generic fade. It is a two-stage indexed transform:
- A per-pixel cyclic wobble is scaled by the current fade value.
- The image pixel is added and masked to a 64-color range.
- The result is scaled again by the inverse fade value.
That is why the transition can feel alive even though it only scans one byte per
screen pixel and writes one byte to VGA. The costly signed multiply work was
moved into [0x6dd3], and the changing phase [0x4cca] makes the noise field
slide between frames.
Text And Grid Copy Loops
The text painter at 0x10020 uses fixed 16 by 20 glyphs. It walks a 9 by 19
layout, converts lowercase letters to glyph offsets, and copies a 16-pixel row
for 20 rows:
for row_block in 0..8:
for char_slot in 0..18:
al = [text++]
if al != ' ':
glyph = ((al - 'a') << 6)
glyph = glyph + glyph*4 + 0x0c80
ch = 20
repeat 20 rows:
cl = 16
repeat 16 columns:
[edi++] = [glyph++]
edi += 0x130
0x130 is 320 - 16, so each glyph row lands at the next screen line. The
outer math positions the text block in the normal 320-byte stride.
The transition routine at 0x107c5 takes an integer step in [0x56e9] and
uses it as a pixel-cell width. It divides 200 and 320 by that width:
cell = [0x56e9]
rows = 200 / cell
cols = 320 / cell
tail = 320 % cell
Then it walks through a sampled page and either copies bytes from a backing image or writes repeated solid bytes:
for each sampled row:
for each full cell:
al = [sample]
if al == 0:
copy cell bytes from backing page
else:
store al for cell bytes
handle tail bytes the same way
advance to next output row
The paired wrappers increment or decrement [0x56e9] between frames. So the
effect is a blocky reveal/collapse, not a scaler in the geometric sense.
Object Records And Scene State
The main animated object records are 0x58 bytes each. The setup at 0x12d67
allocates 0xa50 bytes, exactly 30 records:
eax = allocate(0x0a50)
edi = 0x5814
ecx = 30
repeat:
[edi] = eax
eax += 0x58
edi += 4
Each record is initialized by copying 0x16 dwords from a template at 0xd629:
for 30 records:
ecx = 0x16
esi = 0xd629
rep movsd
Then three pseudo-random values from [0x6dd7] seed per-object phase and
motion:
[record+08h] = ax ; phase
[record+54h] = ((ax & 7fh) - 40h) + 190h ; radius/depth-ish scale
[record+02h] = (ax & 7fh) - 40h ; horizontal or vertical bias
Per frame, the same routine updates:
[0x79c2] scene-local tick
[0x7d44] animation frame, modulo 10
[0x7d16] phase accumulator
[0x5742] rotation/state word
[0x14873] Cyboman-face related motion word
[0x1487d] active face count or draw count, decreasing by 4 late in the part
The variant at 0x12bf0 seeds 30 records more widely:
[record+02h] = (rand & 01ffh) - 0100h
[record+00h] = (rand & 01ffh) - 0100h
[record+04h] = (rand & 01ffh) - 001ch
[record+06h] = 0
[record+08h] = 0
[record+0ah] = 0
It also initializes camera/state words:
[0x5738] = fd00h
[0x573a] = 0000h
[0x573c] = fc20h
[0x573e] = 0000h
[0x5740] = 0000h
[0x5742] = 0000h
The update routine at 0x12d05 advances the frame and moves those state words
by tick ranges:
frame = (frame + 1) % 10
tick++
phase += 100
if tick <= 0x80:
[0x5738] += 6
[0x573c] += 4
elif tick <= 0x36f:
[0x5740] -= 0x55
else:
[0x5738] += 9
[0x573c] -= 4
Another path, 0x12e5a, handles 15 objects on a circular trajectory. It uses
the sine helper at 0x11f4e:
; 0x11f4e
index = ah
frac = al
a = sintable[index]
b = sintable[index + 1]
return a + ((b - a) * frac >> 8)
The object update calls it twice:
x = sin(phase_word - global_phase) * radius >> 15
y = sin(phase_word + 4000h) * radius >> 15
y += 0226h
Then it copies 18 bytes of frame data into the record:
add edi, 12h
movsd
movsd
movsd
movsd
movsw
add edi, 34h
So the record has animated geometry/control data at offset 0x12, while the
front fields hold position, phase, and scale.
3D Pipeline: Transform And Face List
The high-level 3D draw call at 0x129bb is:
call 0x114e0 ; build camera/object transform state
call 0x1151e ; transform objects and emit faces
append sentinel
compute face count
call 0x116f4 ; partition/order face list
call 0x11e44 ; draw faces
0x1151e walks a list of object pointers. For each object it calls:
0x11573 load object matrix/translation parameters
0x115e3 transform object vertices
0x1181a project vertices and emit visible faces
The transform inner helper at 0x11664 is a 3 by 3 fixed-point matrix multiply.
The immediate values shown as 0x12345678 in the static disassembly are patch
slots filled with actual matrix coefficients:
out_z = (x*m20 >> 15) + (y*m21 >> 15) + (z*m22 >> 15) + z_translate
[edi+04h] = out_z
out_x = (x*m00 >> 15) + (y*m01 >> 15) + (z*m02 >> 15) + x_translate
[edi+00h] = out_x
out_y = (x*m10 >> 15) + (y*m11 >> 15) + (z*m12 >> 15) + y_translate
[edi+02h] = out_y
edi += 6
The projection loop at 0x11869 divides by depth:
z = vertex.z
if z < 0:
skip
z += 0100h
screen_x = (vertex.x << 8) / z
screen_y = ((vertex.y << 8) * 5) / (z * 6)
Then it computes a per-face visibility test at 0x11936. For each triangle,
it loads three projected vertices, subtracts edge vectors, and forms a 2D cross
product:
a = v1 - v0
b = v2 - v0
cross = a.x*b.y - a.y*b.x
cross ^= facing_bit
if cross <= 0:
skip face
After the facing test, all three vertex depths must be nonnegative. The three depth words are summed, shifted, combined with the face id, and written to the draw list:
depth_sum = z0 + z1 + z2
if depth_sum >= max_seen:
max_seen = depth_sum
sort_key = (depth_sum << 15) | face_index
store sort_key
The routine at 0x116f4 is a bit-partition sorter over those 32-bit sort keys.
It starts with bit 0x00020000 and repeatedly partitions the list into two
ends of the same buffer:
mask = 0x00020000
while mask != 0 and mask <= [0x6864]:
for each key:
if key & mask:
write key at high end, moving backward
else:
write key at low end, moving forward
mask <<= 1
This is a radix-like partition pass, not a comparison sort. It is a good fit
for the packed sort keys because every pass is just test, mov, pointer
movement, and loop control.
Triangle Setup At 0x12011
The face draw loop at 0x11e44 consumes sort keys from the ordered list. Each
key picks an object bucket and a triangle. The code loads three projected
vertices into:
eax/ecx vertex A packed x/y
ebx/edi vertex B packed x/y
ebp/esi vertex C packed x/y
It also derives two style bits from the face byte:
dl = face_flags & 1
dh = face_flags & 2
dl <<= 7
dh <<= 6
[0x76ec] = dl
[0x76ef] = dh
[0x77be] = dl
[0x77c1] = dh
Those bytes become part of later texture/shade indexing.
0x12011 sorts vertices by Y, with tie handling that swaps X-side state too:
if yA >= yB: swap A/B
if yA >= yC: swap A/C
if yB >= yC: swap B/C
The clip tests use packed coordinates. The visible screen limits are:
x: 0..319
y: 0..199
The code rejects triangles wholly off the lower or upper side and stores several edge deltas:
[0x7869] = yB - yA
[0x786d] = yC - yB
[0x785b] = xB - xA
[0x785d] = xC - xB
[0x7859] = xC - xA
Then it computes 16.16 edge slopes with signed divides:
slope_AB = ((xB - xA) << 16) / (yB - yA)
slope_BC = ((xC - xB) << 16) / (yC - yB)
slope_AC = ((xC - xA) << 16) / (yC - yA)
It also computes paired attribute slopes for the texture or shade coordinates
kept around [0x7828], [0x782c], [0x7830], and [0x7833]. The many
special branches between 0x1229e and 0x127bb are not separate effects; they
are flat-top, flat-bottom, clipped-top, and clipped-bottom cases. Their job is
to enter the same span writer with valid left/right edge state and valid
attribute state.
The single-pixel triangle path at 0x120c5 is worth noting. If all three
vertices collapse to a single screen pixel, it averages the three attributes,
checks the one pixel is on screen, reads one shade byte through CS:[EAX], and
writes one byte:
avg_u = (u0 + u1 + u2) / 3
avg_v = (v0 + v1 + v2) / 3
offset = y*320 + x
al = cs:[avg_v*256 + avg_u]
[screen + offset] = al
That avoids division-by-zero slope cases while preserving tiny faces.
Patched Span Loops At 0x12826
0x12826 is the main triangle inner loop. There are two variants. The first is
used when [0x7894] == 0:
; line setup before loop
left = [0x7849] + 01400000h
right = [0x7851] + 01400000h
u_step = [0x7838]
v_step = [0x783c]
scanline:
[0x7828] += patched_delta
[0x782c] += patched_delta
[0x7830] += patched_delta
[0x7833] += patched_delta
di = word [0x782a] ; left x and screen offset low part
dx = dword [0x782e] ; texture/shade accumulator
bx = dword [0x7832]
ax = word [0x7835] - di ; span width
if ax > 0:
repeat ax pixels:
bl += 12h
dl += 12h
bh = dl
bh = fs:[bx]
es:[di] = bh
edi += ebp
edx += esi with carry
ebx += ecx with carry
dec [0x7837]
jg scanline
In simplified form:
for each scanline:
advance left edge, right edge, and attributes
width = right_x - left_x
for x in width:
u += du_dx
v += dv_dx
texel = fs[(v_high << 8) | u_high]
es[pixel_offset] = texel
pixel_offset += x_step
The byte additions +0x12 are small shade/texture phase offsets, giving the
span a biased lookup rather than a raw texture read. FS is the texture/shade
lookup segment; ES is the target page.
The second branch at 0x128dd handles clipped or alternate-orientation spans.
It sets up a line base at [0x77ce], clamps the right side to 319, handles
negative left x by advancing the texture accumulators before drawing, then runs
the same kind of byte loop:
if left_x < 0:
u -= left_x * du_dx
v -= left_x * dv_dx
left_x = 0
if right_x > 319:
right_x = 319
while left_x < right_x:
ah += 12h
dh += 12h
bh = dh
bl = ah
bh = fs:[bx]
es:[di + line_base] = bh
u += du_dx
v += dv_dx
di++
The visible trick is the self-patched arithmetic. The disassembly shows several
add dword [state], 12345678h instructions. Those immediates are patch slots:
81 05 28 78 00 00 78 56 34 12
81 05 2c 78 00 00 78 56 34 12
81 05 30 78 00 00 78 56 34 12
81 05 33 78 00 00 78 56 34 12
With the actual deltas written into those slots, the inner loop does not need to load slope variables each scanline. It just executes immediate adds against fixed state variables. That is the same optimization family as the classic Cyboman 2 filler, but this demo wraps it in a larger asset and scene system.
Page Copy And Overlay Loops
The routine at 0x11f77 is a full 64000-byte page exchange/present path:
edi = [0x6de7] ; A000h
ebp = [0x6deb] ; work page
esi = [0x6ddf] ; image page
ecx = 3e80h
repeat 16000 dwords:
eax = [esi]
xchg [ebp], eax
[edi] = eax
esi += 4
ebp += 4
edi += 4
This is a neat triple-duty loop:
- Read a dword from the current image page.
- Swap it with the work page dword.
- Present the old work-page dword to VGA.
So it both displays and prepares the next backing state in one pass.
0x12a67 clears the work page, renders a 3D list, then combines the result with
the original image page into a second 64000-byte buffer:
clear [0x6deb] with 16000 zero dwords
call 0x129bb
esi = [0x6deb]
edi = esi + 64000
ebp = [0x6ddf]
ecx = 64000
repeat:
al = [esi++]
if al == 0:
al = [ebp]
[edi++] = al
ebp++
That is a transparent compositing pass: rendered pixels win, zero lets the background image through.
The sprite overlay at 0x13004 is a clipped 140 by 130 transparent blitter:
frame = [0x8329] >> 2
esi = [0x6de3] + frame * 0x4718
edi = [0x6deb] + [0x8325]
width = min(0x8c, computed_reveal_width)
height = 0x82
for y in 0..129:
for x in 0..width-1:
al = [esi++]
if al != 0:
[edi] = al
edi++
esi += 0x8c - width
edi += 0x140 - width
This is used after a delay gate on [0x79c2], so the overlay enters after the
scene has already been moving for a while.
The Cyboman Face Mesh
The 0x148xx region is not code; it is dense face/index data. The byte pattern
around 0x14500 is a grid of word triplets:
08 00 19 00 18 00
09 00 0a 00 1a 00
09 00 1a 00 19 00
...
This is triangle index data: three 16-bit vertex ids per face, frequently two
triangles per quad. The setup helpers at 0x139e1 and 0x139f9 write face
state words into 8-byte records pointed to by [0x14881].
0x139e1 writes type 3 to every active record:
edi = [0x14881]
ecx = [0x1487d]
repeat ecx:
word [edi] = 3
edi += 8
0x139f9 writes an eight-record repeating pattern:
1, 1, 1, 2, 2, 2, 1, 2
That is most likely a per-face style selector. It is not the face geometry itself; the geometry is the word-triplet index block, while these helpers alter how active records are classified for drawing.
The late 0x12d67 path compares [0x1487d] to 0xc0, subtracts 4 until it
reaches 4, and adjusts camera words at the same time. That matches a shrinking
or reveal/recede sequence for the large Cyboman face object rather than a
static full-mesh draw for the whole part.
What The Visible Parts Do
From the release text and the binary paths, the demo is built from these systems:
- Still pictures and title material come from the RIX chunks in
CYBOMAN3.DAT. - The S3M file drives a music tick at
[0x901]; the main script waits on those ticks and swaps visual callbacks. - Palette fades are 768-byte DAC upload loops with per-channel 6-bit scaling.
- Full-screen transitions use
0xfe35, a 64000-byte wobble/remap compositor. - Text screens use the 16 by 20 glyph copier at
0x10020. - Blocky image reveals use the cell copier at
0x107c5. - Donut/letter/animated object scenes use 0x58-byte object records, frame tables
at
0x7d18, and sine interpolation through0x11f4e. - The "real Cyboman" face mesh uses the 3D path: matrix transform, perspective divide, back-face rejection, radix-style face ordering, and patched triangle spans.
- Sprite overlays use the transparent 140 by 130 blitter at
0x13004.
The code is therefore much more substantial than a pure parody shell. It is a full protected-mode 1995 PC demo with custom timing, image handling, palette work, software 3D, and several carefully tuned 64K/frame or per-span loops.
Caveats
This is not a source-level reconstruction. Several object fields are named by observed use rather than by original labels. The exact artistic mapping from every routine to every on-screen joke would require a frame-by-frame runtime trace, but the loops above are the important mechanical parts: the startup, the timer, the tables, the transition compositor, the object update records, the face list, and the triangle filler.