Analysis model: gpt-5.5 xhigh
CyboMan - The Inner Loop
Production
CyboMan is Gazebo's 80K PC intro from The Party 1993. It won the PC intro competition with 1280 points.
Release year: 1993.
Credits in the bundled documentation name Jmagic for code, Trav for graphics, Jugi for the soundtrack, and Cascada's replay code for the Gravis UltraSound music path. The executable expects real-mode DOS, 386 instructions, about 500K of free conventional memory, and a Gravis UltraSound at port 220h. Old contact and postal details are intentionally omitted here.
Sources and Method
The base archive used for this pass was cyboman.zip from the The Party 1993
80K intro directory on scene.org. The archive contains CYBOMAN.EXE,
CYBOMAN.DOC, FILE_ID.DIZ, and DESCRIPT.ION.
Useful hashes:
47ddf2b8456a22ba7b30e8b1d039f0a215e3b2e040add36225bf810f52482d4b CYBOMAN.EXE
c81a8b0250be647f4cc73258e630e4bd1ed1bf760185d535fb9cad983a667ef0 CYBOMAN.EXE.000020.bin
The important unpacking clue is at file offset 20h. The MZ image starts with
an RNC method-1 stream:
52 4e 43 01
unpacked size 0005a424h = 369700 bytes
packed size 0001219ch = 74140 bytes
After expanding the stream, the intro becomes a large real-mode image with many
far entry points. Most of the visual code is not reached by linear fall-through;
the main hub far-calls segment:offset pairs whose linear positions are roughly
segment * 16 + offset inside the expanded image.
Top-Level Shape
The main hub lives at expanded offset 0F922h. It is the DOS-facing part of the
intro: file cleanup, memory resize, keyboard vector install, music setup, visual
sequence, wait gates, and exit path.
Its visual call sequence is:
4FFF:23AA GUS setup helper
4FFF:2387 replay state helper
4FFF:2506 temporary music-file load helper
4FFF:2287 timer / replay tick install
4A82:0000 planar logo and panned page
0000:0002 particle text page, AX = 3
5288:12BC dot / wipe prelude
4BFB:0000 projected vector surface
0000:0002 particle text page, AX = 0
53BB:0000 mixed vector and frame stream
4E52:0000 tweaked Mode-X vector / music-title part
0000:0002 particle text page, AX = 1
58E1:0000 final texture mapper
0000:0002 particle text page, AX = 2
The sequencing is tied to a replay/timer word at 4FFF:0F44. The hub waits for
specific tick values between parts, including 0730h, 0E00h, 1100h,
1800h, and later an Escape key wait.
The DOS Hub
The entry at 0F922h begins with the usual tiny real-mode setup:
push cs
pop ds
Then it removes a leftover temporary file named cyboman.$$$ with
int 21h, AH=41h. It resizes its DOS memory block with int 21h, AH=4Ah,
using BX=5CC7h, so the expanded code and data have room while still leaving
DOS a sane allocation boundary.
The keyboard hook uses the interrupt-vector table directly. It reads the old
INT 09h vector from 0000:0024 and 0000:0026, saves it at CS:0A0E and
CS:0A10, then installs a handler at CS:0BF3. At exit, those saved words are
written back.
The hub also writes the music payload out to disk:
AH = 3Ch ; create cyboman.$$$
AH = 40h ; write AB10h bytes from segment 2031h
AH = 3Eh ; close
call 4FFF:2506 ; pass it to the replay loader
AH = 41h ; delete cyboman.$$$
That temporary-file dance is typical of intros which embedded a module or replay asset in the packed image but wanted to feed it to an existing DOS-era loader path.
Before the visuals start, the hub writes:
mov al,0FEh
out 21h,al
That masks the PIC down to IRQ0 only. In practice, the intro wants the timer
tick for music and timing, while reducing other IRQ noise during the tightly
timed VGA parts. Near the end it writes 00h back to port 21h, restores the
keyboard vector, shuts down the replay path, sets text mode 3, and exits through
int 21h, AX=4C00h.
Replay and Timer Layer
The helper at 4FFF:2287 is the key timing install. It clears state tables,
installs an INT 08h handler at CS:1826, and programs the PIT:
out 43h,36h
out 40h,0A9h
out 40h,04h
The PIT reload value is 04A9h, much faster than the default BIOS tick. That
gives the replay and visual gates a higher-rate clock. The old INT 08h vector is
saved at CS:166E and CS:1670.
The same helper touches the Gravis UltraSound base port stored at CS:0F2E.
The documentation says this is expected to be 220h, and the code accesses the
GUS register/data area around base+102h through base+105h.
Teardown at 4FFF:2315 does the inverse:
out 43h,36h
out 40h,00h
out 40h,00h
That restores the BIOS-compatible PIT divisor. It then restores INT 08h and
clears GUS voice-register state. Another setup helper at 4FFF:23AA builds a
0321h-entry timing table near CS:0F4C and writes GUS registers including
4Ch, 41h, 45h, 49h, and 0Eh.
I have not fully reconstructed the Cascada/GUSPLAY data format here, but enough of the code is clear to see its role: it owns the fast timer, drives the GUS, and exposes the global tick word which the visual hub waits on.
Particle Text Pages
The text-page entry is at 0000:0002 in the expanded image. It begins by
mapping the AX argument to one of four text blocks:
cmp ax,0
je use_0364
cmp ax,1
je use_0684
cmp ax,2
je use_09A5
cmp ax,3
je use_0043
The chosen pointer is stored in CS:0000, then execution jumps to the renderer
at EE6Bh.
The renderer sets mode 13h, assigns an offscreen/background buffer segment, and loads a small DAC range:
mov ax,0013h
int 10h
mov word [cs:24F6],2AE2h ; background buffer
mov word [cs:24F8],0A000h ; visible VGA
It clears 64000 bytes in the offscreen buffer with rep stosw, then runs a loop
whose shape is:
repeat while active_particle_count != 0:
call text_spawn_step sixteen times
call particle_update
wait for VGA status at 3DAh
The glyph path at ECCDh treats the text as 8x8 cells. For a non-space
character:
glyph_offset = ((character - 20h) << 6) + 0CF6h
CS:ECC0 and CS:ECC2 are the row/column inside the 8x8 glyph. CS:ECC4 and
CS:ECC6 are the target text cell position. Each nonzero glyph byte spawns a
particle at EB17h.
The particle pool has 0B00h slots, 2816 particles total. Slot arrays are
stored in parallel:
2517h current visible pixel address
3B17h step/count data
5117h signed motion term
6717h x or address term pair
A917h accumulated error pair
D517h color byte
The spawner first checks the active count at CS:2515. It scans for a free
slot marked FFFFh, then calculates a moving start position from sine tables
around EF10h and F110h. The phase words at CS:ECC9 and CS:ECCB make the
source orbit while the target remains the final glyph pixel. The result is text
forming from moving points rather than being drawn directly.
The updater at EBD0h is the real inner loop. For each live slot it:
1. reads the old pixel address
2. restores that pixel from the offscreen buffer to A000
3. advances a fixed-point address/error path
4. writes the particle color at the new visible address
5. on arrival, burns the color into the offscreen buffer and frees the slot
The movement math is compact. It uses an integer error accumulator and this kind of pattern:
add error,step_error
sbb bx,bx ; bx becomes 0000h or FFFFh
; choose one of two address increments from the sign
add address,increment
That is a Bresenham-style walker, adapted for pixel-address motion. The path is unrolled enough that a live particle can move through several microsteps per frame without an expensive multiply or divide in the visible update body.
Planar Logo and Panned Page
The far call 4A82:0000 is only a veneer:
push cs
pop ds
jmp 4BE7Dh
The real part at 4BE7Dh uses BIOS mode 0Dh, a 320x200 16-color planar mode.
It then tightens the screen layout with CRTC writes:
mov dx,3D4h
mov ax,1913h
out dx,ax ; offset register 13h = 19h
mov ax,0009h
out dx,ax ; max scanline register 09h = 0
It sets an identity attribute palette through 3C0h, enables all VGA planes
with sequencer map mask 0F02h, and copies a 44-line, 10-word-wide graphic to
A000:22CE. The destination skip between lines is 1Eh, matching a compact
planar layout rather than a chunky linear 320-byte stride.
The panning loop is where the VGA trick lives. A helper at 4BCA6h calculates a
start address from two sine-table reads and a phase at CS:146D. Then it
writes the CRTC start address:
mov dx,3D4h
mov al,0Ch
out dx,al
inc dx
out dx,high_start
dec dx
mov al,0Dh
out dx,al
inc dx
out dx,low_start
It waits on port 3DAh around those writes, so the start-address change lands
during a safe display window. The fine horizontal position uses the low three
bits of the calculated address through an attribute port write. The coarse byte
start is saved at CS:1471.
The redraw side at 4BD11h toggles the backing page and selects planes with
map masks like 0C02h, 0802h, and 0402h. The most telling inner operation
builds a shifted planar strip:
lodsw
ror ax,cl
; combine shifted bits from adjacent source words
stosw
The low bits of the pan become the rotate count. This lets the intro scroll a
1-bit/planar image smoothly without converting it to chunky pixels. The helper
at 4BDC4h uses 386 addressing (lea di,[ebx+ebx*4]) and five-byte row copies
to lay out two plane images at A000h and A800h.
Dot / Wipe Prelude
The call 5288:12BC reaches expanded offset 53B3Ch. It also uses mode 0Dh.
Setup at 53A60h loads an identity attribute palette, writes DAC bytes from
0D20h, and initializes row/bound tables near 0D52h, 0B90h, and 0A00h.
The main state is small:
0EF3h / 0EEFh / 0EF1h moving coordinates and bounds
0EF7h / 0EF9h sine phases
0EFDh fade byte
0EFBh loop counter, ends at 00BFh
53AF0h is the per-frame step. It adds 5 to one phase, calls a sine helper at
537C1h, shifts the result, and updates one coordinate. It adds 23h to the
other phase and repeats the sine path for the other coordinate. Then it calls
the masked planar drawing helpers at 539D5h and 5397Dh.
There is also a palette fade routine at 53ABDh. Once its fade byte reaches the
terminal state, it self-patches a nearby byte to C3h, turning a later call
into an immediate return. That is a very DOS-intro way to remove a branch from a
hot visual path after the fade is no longer needed.
Projected Vector Surface
4BFB:0000 jumps to 4E3B8h. This is the first large projected-line part. It
is built around three rotation phases and a camera/depth word:
020Dh += 6
020Fh += 5
0211h += 3
0217h eases down toward 251Ch, later 1BBCh
0213h ramps toward 00A0h
The frame worker at 4C9B4h masks each phase to 10 bits, then iterates over a
point table. For every source point it:
1. loads x/y/z triples from the table at 0278h+
2. calls 4C8C9h for sine-table rotation
3. projects x with (rot_x * 296) / (rot_z - camera_z) + center_x
4. projects y with (rot_y * scale) / depth + center_y
5. stores screen x and y in parallel output arrays
The draw list is unrolled: the code pushes endpoint coordinates for many edges
or faces, then calls 4C565h.
4C565h is the core span routine. It receives three projected vertices, checks
the signed area:
(x3 - x1) * (y2 - y1) - (x2 - x1) * (y3 - y1)
The sign chooses whether to draw or skip that face. If the face is accepted, the
routine sets the VGA sequencer map mask from CS:0584 and the graphics read
map through port 3CEh. It clips y against CS:0595 and CS:0597.
The edge setup uses integer division once per edge. Quotients and remainders are saved in small work variables:
05B1h / 05B3h / 05AFh whole x step
05ABh / 05ADh / 05A9h remainder / error term
After setup, the scanline walk is add-only:
left_x += left_whole_step
left_err += left_remainder
if left_err overflows: left_x++
right_x += right_whole_step
right_err += right_remainder
if right_err overflows: right_x++
Each scanline's y, left x, and right x are pushed to the stack. The span drawer later pops them and calculates:
byte_offset = y * 40 + (x >> 3)
Then it uses edge-mask tables at 0585h and 058Dh. If both ends land in the
same byte, the masks are ANDed. Otherwise, it writes the first masked byte,
fills full middle words with rep stosw, optionally writes a byte with
rep stosb, and writes the final masked byte. Because this is planar VGA, the
map mask chooses the bitplane, and the edge masks decide which pixels inside
the first and last bytes are lit.
This part is not a chunky triangle drawer. It is a planar solid-span filler, made to work with VGA latches and bit masks.
Mixed Vector and Frame Stream Part
The far entry 53BB:0000 jumps to 58CEBh. It starts in mode 0Dh, sets the
identity attribute palette, and calls a fade-in routine at 55F72h.
It uses another projection worker, 545D6h, with a sibling span routine at
54160h. This path has stricter clipping: x is clamped to the 0..319 range and
y to the upper half of the display. The edge and span math mirrors the earlier
4C565h routine but uses its own mask tables at 0588h and 0590h.
The distinctive second layer is a frame stream copy:
mov si,[cs:5137]
mov es,A000h + page_offset
mov di,0410h
mov cx,03C0h
rep movsw
On selected timer ticks, SI steps backward by 0780h bytes and wraps from
below 5137h to 2437h. So this part combines a real-time projected object
with a pre-rendered or prepacked planar frame strip.
The fade routines are small but neat. 55F72h scales a 48-byte DAC table from
black, using a phase byte at 23C1h. When saturated, it patches the call path
so the fade-in is no longer run. 55FA5h blends from one palette table to
another:
new = (old * (255 - t) + target * t) >> 8
That gives a palette crossfade while the same frame-stream code keeps running.
Tweaked Mode-X / Music-Title Part
4E52:0000 jumps to 4FE4Ah. The caller passes AX=1031h, and the callee
stores that in CS:13A6. It first asks BIOS for mode 13h, then immediately
reprograms VGA:
sequencer memory mode = 06h
CRTC underline = 00h
CRTC mode control = E3h
misc output 3C2h = E3h
CRTC 06h = 0Dh
CRTC 07h = 3Eh
CRTC 10h = EAh
CRTC 11h = ACh
CRTC 12h = DFh
CRTC 15h = E7h
CRTC 16h = 06h
That is a tweaked unchained VGA mode rather than plain linear 13h. The code
clears A000h, primes DAC entry 0, and writes almost 64K bytes at the segment
held in 13A6h, ORing each byte with D0h.
It also creates a repeated 256-entry code/data pattern at 02BFh. Each entry
has seven words:
C803 1366 12DD 8AFA 2637 3588 FE03
The repeated pattern is then consumed by the part's frame worker. The outer timing is:
raise 13E3h over 78h frames
hold until music tick 1500h
collapse by lowering 13E3h every other frame
fade DAC entry 0 upward, then downward
Embedded nearby are short instrument/title strings such as OCTA, Ga-ze-bo,
Base, Snare, and St-02:softshake. In context, this looks like a visual
part that exposes or plays with music/sample metadata while the VGA mode is
already in its unchained layout.
Final Texture Mapper
The far entry 58E1:0000 jumps to 5A2B9h. This is the most classic inner loop
in the intro.
Startup first rearranges a texture inside segment 3A82h:
copy 255 rows of 64 words
source starts at 0000h
destination starts at FF80h
source += 0080h per row
destination -= 0180h per row
Then it sets mode 13h and applies the same kind of unchained VGA register setup
used by the previous part. It loads a full 768-byte DAC table from CS:1007h.
Each frame toggles the display page by changing the CRTC start high byte and by
flipping CS:1318 with 8000h. It then updates a scalar at CS:0005, bouncing
between 008Fh and 7918h, and derives two signed texture-step terms from
sine tables:
130Eh = highword((sin(phase) >> 4) * scale)
130Ch = highword((sin(phase+0200h) >> 4) * scale)
The renderer at 5A130h turns those into two row/column step pairs:
1312h / 1310h = products of 130Eh/130Ch with negative constants
Then it maps the texture. DS points at 3A82h; ES points at the active A000h
page; the sequencer map mask is changed through index 2.
The hot pixel body uses the high bytes of two accumulators as texture coordinates:
; conceptual form
bl = ch
bh = dh
al = [ds:bx]
cx += du
dx += dv
The actual code is unrolled. It fetches eight samples per small group, packs pairs of pixels into AX, and writes words to ES:
sample, add u/v
sample, add u/v, write word
sample, add u/v
sample, add u/v, write word
...
The reason it is fast is that there is no multiply in the pixel body. The expensive products happen once per frame or once per row. Inside the body, texture addressing is just high-byte selection from two 16-bit accumulators, two adds per sample, one byte load, and packed word stores. That is the standard high-end DOS texture-mapper trick, adapted to the intro's unchained VGA page layout.
After a row, it advances the planar destination bank and adjusts the texture
origin by the row step terms. The row counter near CS:131C is initialized to
77h, so the effect draws a tall central mapped field rather than a full
200-line screen.
Why It Feels Fancy
CyboMan is not just a chain of unrelated effects. The code reuses a few strong ideas in different VGA modes:
- timer-owned staging, where the visual hub waits on a fast music tick instead of loose delay loops;
- planar drawing that respects VGA's bitplane shape instead of pretending the screen is chunky;
- integer edge walkers and mask tables for filled vector surfaces;
- self-patched fade exits once a fade has finished;
- a final texture mapper whose pixel body is add-only and heavily unrolled.
The intro also shows a practical 1993 80K design habit: pack a much larger working image with RNC, write an embedded music asset to a temporary file only long enough for the replay loader, then run the visuals as a far-call sequence inside one expanded real-mode image.
Caveats
The replay format itself is not fully named here. The timer, GUS register use, temporary loader path, and visible tick interface are clear; the exact module data structure would need a separate pass through the Cascada replay code.
The dot/wipe prelude is also described at the level of its state, sine motion,
palette fade, and planar helper calls. A full bit-level reconstruction of
539D5h and 5397Dh is left for a later pass if needed.