Analysis model: gpt-5.5 xhigh
Eclipse by Electromotive Force - Technical Dissection
Scope
This is a reverse-engineering pass over Eclipse by Electromotive Force, an MS-DOS 100K intro released at Assembly 1993. Demozoo lists it as released on 31 July 1993 and as the 1st-place entry in the Assembly 1993 PC 100K Intro competition. Pouet also lists it as a July 1993 MS-DOS 100K intro by EMF, ranked 1st at Assembly 1993 in the PC 100K compo.
Public references:
- Demozoo production: https://demozoo.org/productions/6704/
- Pouet production: https://www.pouet.net/prod.php?which=2589
- Demozoo Assembly 1993 party/results page: https://demozoo.org/parties/101/
- Scene.org archive entry: https://files.scene.org/view/parties/1993/assembly93/100k/emf_ecl.zip
- Direct archive URL used here: https://archive.scene.org/pub/parties/1993/assembly93/100k/emf_ecl.zip
The important caveat for this file: the offsets below are flat offsets in the
unpacked executable image after removing the 512-byte MZ header, not source
offsets and not always direct runtime CS:IP offsets. The MZ still uses a
segmented layout. Some near-call targets that look natural in a raw flat
disassembly land on data when interpreted as file offsets. I therefore describe
the loops and routines that are anchored by actual decoded code and VGA/DOS/IRQ
hardware access, and I call out places where a helper target is segment-aliased
or unresolved.
Examined Archive
Downloaded archive:
ba527454f7d1428935e4919cad394783067667bd8fcfb3bb5a0590ad467cc739 emf_ecl.zip
Files:
| File | Size | SHA-256 | Notes |
|---|---|---|---|
EMF_ECL.EXE |
76,387 | 6a56445bddf0c00b70d73003c411ed158d0604d4eb9a2f072fbb3cba0fa91f54 |
Main intro, MZ executable, PKLITE-packed |
FILE_ID.DIZ |
297 | 5966357616a92c74ff3b4b1555c2d40135a4a5d7ef72b58861bf266fd643610b |
Release description |
README.TXT |
709 | ca596c1595f2b4db17ea627975140e59bec0b0cf2cfa23d852126f23a690616b |
Requirements and contact text |
The README describes this as EMF's Assembly 1993 100K intro competition entry, requires at least a 386SX, recommends a Sound Blaster, and suggests the 10 kHz mixing option on slow machines. The DIZ says the same thing in release-board form: 386 required, SB recommended.
The packed executable contains the PKLITE marker:
!PKLITE Copr. 1990-92 PKWARE Inc. All Rights Reserved
Useful packed strings include the 386 requirement, a virtual-8086/memory-manager
error, Sound Blaster prompts, Eclipse, and names such as Dominic, Wowi, Beep,
and M.K.
Unpacking and Image Layout
PKLITE -x EMF_ECL.EXE followed by UNP EMF_ECL.EXE under DOSBox-X produced a
clean unpacked executable:
d100f1210910ae13f0b082f7dff187dab0393e2587276cc3c261fa93a0fd1ede unpacked EMF_ECL.EXE
MZ header facts for the unpacked executable:
| Field | Value |
|---|---|
| File size | 206,335 bytes |
| Computed MZ image size | 206,335 bytes |
| Header size | 0x200 bytes |
| Relocations | 0 |
| Entry | 3221:0012 |
| Entry file offset | 0x32422 |
| Stack | 8ec3:0080 |
| Min alloc | 0x5c8b paragraphs |
| Max alloc | 0xffff paragraphs |
| Overlay number | 0 |
For analysis I stripped the 512-byte header:
tail -c +513 EMF_ECL.EXE > eclipse_image.bin
That image is 205,823 bytes. The MZ entry becomes flat image offset 0x32222,
which is still a depacker/runtime tail. The first useful setup island found in
the unpacked image is around 0xf432. The visual code islands with the clearest
hardware anchors are around 0x111c0, 0x12300, and 0x13939/0x13a3a.
Startup and Configuration at 0xf432
The visible setup block begins with the tail of a CPU test and then does three things: rejects unsuitable environments, asks for sound configuration, and installs the interrupt/timing framework.
The environment checks:
f439: jae f44c ; previous probe accepted the CPU
f43b: ds = 01a7
dx = 001c
ah = 09
int 21h ; print "386SX and better" style error
ax = 4c01
int 21h ; exit
f44c: smsw ax
test al,01h
je f464
ds = 01a7
dx = 0059
ah = 09
int 21h ; virtual-8086 / memory-manager error
ax = 4c01
int 21h
The smsw test is the important one. EMF is not just asking DOS what machine it
is on. It reads the machine status word and refuses to run if protected/virtual
mode is already active. That matches the text warning about QEMM, EMM386,
386MAX, Windows, DesqView, and similar environments.
The Sound Blaster prompt logic is compact and direct:
f464: print sound prompt with int 21h/09h
f470: read char with int 21h/08h
if N or n: skip SB setup
if Y, y, or Enter:
word [000c] = 0003
ask for IRQ
IRQ validation accepts only IRQ 2, 3, 5, or 7. The default is 7:
f499: bx = 0007 ; default IRQ
if Enter: store it
al -= '0'
reject al < 2
reject al > 7
reject al == 4
reject al == 6
bl = al
f4b6: [0010] = bx
Mixing frequency selection is three hard-coded timer/divisor choices:
default/Enter/'3': bx = 55f0h ; nominal 22 kHz path
'1': bx = 2710h ; 10 kHz path
'2': bx = 3e80h ; 16 kHz path
f4e3: [0004] = bx
After that, the startup copies the configuration bytes into another segment via
a helper at 0xfe63, sets up common segments, installs interrupt handlers, and
calls the audio initializer:
ds = 01a7
es = 2491
copy config starting at ds:000c
ds = 01a7
gs = 0100
es = a000
call f5c0 ; install IVT hooks
call feb6 ; audio/init path, not fully reconstructed here
gs:0322 = 3e80h ; timer reload baseline
The dispatcher then calls a sequence of visual parts and checks the keyboard
state byte GS:0324 after most of them. In the flat disassembly these calls
look like targets such as 0x1cd3, 0x1fb3, 0x2743, through 0x6683, but I
am not treating those as reliable flat file offsets. The reliable point is the
control pattern: each stage returns to the dispatcher, and pressing the watched
key jumps to the shared shutdown path at 0xf599.
Shutdown calls the music/system cleanup, restores vectors, resets the timer, returns to text mode 3, and exits through DOS:
f599: call ff29
call f603 ; restore IRQ vectors
call f5af ; reset PIT channel 0
call f6e8 ; date/time related cleanup
ax = 0003
int 10h
ax = 4c00
int 21h
Interrupt, Timer, and Keyboard Core
Vector Installation
The vector installer at 0xf5c0 saves the old IRQ0 and IRQ1 vectors from the
IVT, then writes new handlers:
f5c0: cli
es = 0000
eax = es:[0020] ; old int 08h vector
ebx = es:[0024] ; old int 09h vector
[0014] = eax
[0018] = ebx
es:[0000] = 4266:cs
es:[0020] = 42ed:cs
es:[0024] = 4391:cs
sti
The exact target code for the written offsets is part of the segment-mapped
runtime layout, but the visible local handlers at 0xf620 and 0xf6c4 show
the timer and keyboard policy used by the intro.
0xf603 restores the saved IRQ0/IRQ1 vectors:
es = 0000
eax = [0014]
ebx = [0018]
es:[0020] = eax
es:[0024] = ebx
Timer IRQ at 0xf620
The timer handler is the heart of the choreography. It uses GS=0100 as a
small global state page:
GS field |
Use |
|---|---|
0320 |
frame/tick counter, incremented by retrace wait helper |
0322 |
PIT channel 0 reload value |
0324 |
last keyboard make code |
0326 |
timer-processing enabled flag |
0327 |
CRTC page cycling enabled flag |
0328 |
requested/render page start |
032a |
displayed/page-cycling start used by the IRQ |
032c |
persistent per-tick callback |
032e |
one-shot callback after PIT programming |
0330 |
one-shot callback before page update |
The handler immediately sends EOI to the PIC, then only does the heavy path if
GS:0326 == 1:
push all
gs = 0100
out 20h,20h
if gs:0326 != 1:
restore and iret
if gs:0330 != 0:
call [gs:0330]
gs:0330 = 0
if gs:0327 == 1:
bx = gs:032a + 5000h
if bx > a000h: bx = 0
if bx != gs:0328:
gs:032a = bx
out 3d4h, 0c/bh
out 3d4h, 0d/bl
wait for vertical retrace
program PIT channel 0 mode 2/3 style with divisor gs:0322
sti
if gs:032e != 0:
call [gs:032e]
gs:032e = 0
if gs:032c != 0:
call [gs:032c]
call feef ; music mixer/player tick path
restore and iret
This is a very 1993 PC-intro structure: visual parts do not own all timing
themselves. They schedule small callbacks in GS:032c/032e/0330, reset
GS:0320, and spin until the timer/retrace side has advanced far enough.
Keyboard IRQ at 0xf6c4
The keyboard handler is minimal and bypasses the BIOS key queue:
push ax
push gs
gs = 0100
in al,60h
if (al & 80h) == 0:
gs:0324 = al ; keep last make code
in al,61h
or al,80h
out 61h,al
and al,7fh
out 61h,al ; keyboard acknowledge pulse
out 20h,20h ; PIC EOI
pop gs
pop ax
iret
The dispatcher compares GS:0324 with 1, the Esc make code, after each major
part.
Shared VGA Helpers
The visible VGA helper island from 0xf7b9 onward is conventional but
important because it explains the later inner loops.
Retrace waits:
f7b9: inc word gs:0320
dx = 03dah
.set: in al,dx
test al,08h
jz .set
ret
f7c7: dx = 03dah
.clr: in al,dx
test al,08h
jnz .clr
ret
Palette clear at 0xf7d0:
out 3c8h, 0
repeat 0300h times:
out 3c9h, 0
Planar screen clear at 0xf7ef:
es = a000h
out 3c4h, 0f02h ; sequencer map mask = all four planes
di = 0
cx = 3e80h
eax = 0
rep stosd
0x3e80 dwords is 64,000 bytes. With all planes enabled, this writes the whole
tweaked VGA backing store as a planar broadcast.
Mode setup at 0xf86a starts with BIOS mode 13h, then pushes the card into a
tweaked planar mode:
call f7b2 ; disable timer visual path
ax = 0013h
int 10h
call f7ab ; re-enable timer visual path
call f7d0 ; black DAC
out 3c4h, 0604h ; sequencer memory mode
attr 10h = 61h
unlock CRTC reg 11h with 0e11h
rep outsw 5 words from cs:457a to 3d4h
Other mode helpers flip common VGA registers:
0xf8af: Mode-X-like setup with sequencer memory mode0e04h, map mask0f02h, CRTC14=40h,17=a3h,09=80h.0xf8ca: alternate planar timing with sequencer0604h, CRTC14=00h,17=e3h,09=80h.0xf8e1: sequencer clock/memory setup plus graphics-controller write mode and an attribute-controller mode byte of01h.0xf932: graphics-controller setup using register 5 value40hand an attribute-controller mode byte of41h.
Small RLE Decoder at 0x11425
The image/reveal part uses a compact RLE format:
11425: cld
cx = 0
.loop:
al = *si++
if (al & 80h) == 0:
*di++ = al
if si < bx: goto .loop
ret
al &= 7fh
cl = *si
rep stosb ; write CL copies of AL
si++
if si < bx: goto .loop
ret
So the high bit marks a run. The low seven bits are the repeated value, and the
next source byte is the count. Literal bytes are copied as-is. The end pointer
is passed in BX, so each resource stream is a half-open range SI..BX.
This matters because the visual parts are small partly because they avoid storing full planar images. They unpack chunky/interleaved source data into a temporary segment and then scatter it into VGA planes.
Planar Image and Reveal Engine at 0x111c0
The clearest early visual island begins at 0x111c0. It sets:
ds = 425dh
es = a000h
fs = 01c4h
Several setup calls at the start are not safely mapped as flat offsets, so the first fully resolved operation is the resource decode:
es = fs
di = 0000h
si = 02d8h
bx = 0a5eh
call 11425 ; RLE decode into fs:0000
es = a000h
Chunky-to-Planar Scatter
The first decoded block is converted into VGA planes with this loop:
out 3c4h, ax ; ax starts as 0102h, so map mask = 1
for plane in 0..3:
si = plane
di = 0
cx = 1f40h
repeat cx:
es:[di++] = fs:[si]
si += 3
ah = rol(ah,1) ; next plane mask
0x1f40 is 8000 bytes. Four passes copy 32,000 source samples into the four
planes. The si += 3 stride says the decoded resource is not already VGA-planar
in memory. It is packed in an interleaved form that the loop fans into the VGA
planes by selecting one byte stream per plane.
The routine repeats the same kind of plane split inside the temp segment using
FS:7d00 as source and FS:0000 as destination:
for plane in 0..3:
si = 7d00h + plane
di = 0000h
cx = 07d0h
repeat cx:
fs:[di++] = fs:[si]
si += 3
That second loop prepares a smaller 4-plane block of 0x7d0 bytes per plane,
most likely a strip or mask used by the reveal.
Timed Scroll/Reveal
The part initializes a screen start around 0x1f40:
[0002] = 5c80h
[0000] = 1f40h
out 3d4h, 0c/bh
out 3d4h, 0d/bl
Then it schedules a one-shot timer callback and waits for one tick:
gs:032e = 6c50h
gs:0320 = 0
while gs:0320 < 1: spin
The main scroll/reveal loop runs 0x32 frames. Each frame schedules a pre-page
callback through GS:0330, waits one tick, then copies four planar strips:
for frame in 0..49:
gs:0330 = 6c67h
wait until gs:0320 >= 1
ax = 0102h
si = 0
for plane in 0..3:
out 3c4h, ax
di = [0002]
cx = 01f4h
rep movsd fs:[si] -> es:[di]
ah = rol(ah,1)
si = 9c40h
out 3c4h, 0f02h
for row in 0..73:
eax = fs:[si]
cx = 0014h
rep stosd ; 20 dwords of the same value
si += 0140h
[0000] -= 00a0h
[0002] -= 0140h
This is a planar scroller with a repeated-fill band. The rep movsd copy places
one plane at a time, while the later all-plane rep stosd lays down a wide
constant strip from per-row values at FS:9c40. The CRTC start moves upward by
0xa0 each frame, while the destination moves by 0x140, the 320-byte screen
row width.
Second Resource and 16-Pass Brightness Lift
After a delay of 0x8c ticks, another RLE resource is decoded:
es = fs
di = 0000h
si = 0a5eh
bx = 1b7ah
call 11425
es = a000h
Then comes a 16-pass reveal:
ax = 1102h ; starting map mask pattern
si = 0
bx = 0
bp = 0010h
for pass in 0..15:
wait until gs:0320 >= 3
out 3c4h, ax
di = bx
cx = 0fa0h
repeat cx:
dl = fs:[si]
dl += 40h
fs:[si] = dl
es:[di] = dl
si += 10h
di += 4
ah = rol(ah,1)
bx += carry_from_plane_rotation
si = previous_si + 1
The important detail is the paired address stride: source moves by 0x10, VGA
destination by 4. Combined with rotating plane masks, this brightens/reveals one
interleaved column/plane stream at a time. Adding 0x40 to each byte is a crude
but effective palette-index lift.
Copy to Alternate VGA Segment
The engine then copies from A000 to A500 after toggling graphics-controller
write mode:
out 3ceh, reg 5 with bit 0 set
out 3c4h, 0f02h
ds = a000h
es = a500h
si = di = 0
cx = 3e80h
rep movsb
restore graphics-controller reg 5
A500 is not a normal separate VGA framebuffer in mode 13h terms; in tweaked
planar addressing this is another 64K segment window into display memory. This
copy is part of the double-buffer/page arrangement used in the later reveal.
Page-Flipped Strip Ramp
The last resolved loop in this part runs 0xbe frames:
[0004] = 0
[0006] = 0
[0000] = 5000h
for frame in 0..189:
wait until gs:0320 >= 1
call 11486 ; write CRTC start from [0000]
es = a000h + ([0000] >> 4)
[0000] ^= 5000h ; alternate two pages
si = [0004]
repeat 0320h dwords:
fs:[si] += 10101010h
si += 4
ax = 0102h
bx = [0004]
for plane in 0..3:
out 3c4h, ax
si = bx
di = [0006]
cx = 0320h
repeat cx:
es:[di++] = fs:[si]
si += 3
ah <<= 1
bx++
di = [0006] - 0050h
out 3c4h, 0f02h
eax = 0
cx = 0014h
rep stosd
[0004] += 0140h
[0006] += 0050h
wait until gs:0320 >= 2
This is the strongest example of the intro's style: it combines palette-index math, planar scattering, and CRTC page flips instead of drawing a plain chunky 320x200 framebuffer.
Palette Helpers
Several palette upload helpers are small enough to identify exactly.
0x1146f uploads a 240-color palette from DS=425d, SI=0008:
out 3c8h, 0
cx = 02d0h
rep outsb ds:[si] -> 3c9h
0x122bb, 0x122d2, and 0x122e9 use DS=4959 and upload three different
0xc0-byte palette tables from offsets 0258h, 0318h, and 0198h.
0x13900 writes 0xb4 bytes starting at DAC index 0x60.
0x1390e is more unusual. It increments a small state byte until it reaches
0x1e, then writes 0x60 DAC entries by repeatedly backing SI up three bytes:
if byte [0307] < 1eh:
byte [0307]++
out 3c8h, 60h
cx = 0060h
si = 0305h
repeat cx:
outsb r
outsb g
outsb b
si -= 3
That effectively floods a DAC band with one RGB triplet, changing slowly as the state advances.
Runtime Capture At 01:08.000
A DOSBox-X follow-up run on 19 June 2026 executed EMF_ECL.EXE from the
emf_ecl.zip archive listed above
(ba527454f7d1428935e4919cad394783067667bd8fcfb3bb5a0590ad467cc739).
The run used DOSBox-X 2026.01.02, cycles=20000, SDL dummy video/audio,
capture format=mpegts-h264, and an automated n keypress at startup to skip
Sound Blaster setup. The executable hash was
6a56445bddf0c00b70d73003c411ed158d0604d4eb9a2f072fbb3cba0fa91f54.

The selected frame is capture timestamp 01:08.000 from emf_ecl_000.mts.
It is a good visual anchor for the projected-dot engine below: the tunnel shape
is built from many individually projected points rather than a textured
framebuffer.
The front-page card uses this frame directly. I did not make a GIF because only one public runtime frame is published for this pass.
Runtime-To-Code Concordance
The 01:08.000 frame is a bounded piece of evidence: it anchors the
projected-dot tunnel, not every part of Eclipse. It still connects strongly to
the surrounding setup because that point effect uses the same timer page,
palette, and direct VGA assumptions established earlier in the binary.
The startup path around 0xf432 explains why the capture reaches this state
only after the no-sound prompt. The run sends n, so the dispatcher skips the
Sound Blaster configuration, installs the timer and keyboard vectors through
0xf5c0, initializes GS=0100 state fields, and then executes each visual
part until the projected-dot island at 0x12300 is reached. The selected still
is therefore downstream of the same IRQ/timer framework described in the setup
section, not a standalone viewer for the effect.
The frame's tunnel body is the visible output of the table generator at
0x12300. That code creates three word tables at 5c27:5100,
5c27:5e80, and 5c27:6c00 from PIT port noise, then mirrors and negates the
tables to make a symmetric coordinate field. The radial look in the screenshot
comes from projecting those generated point arrays, not from a stored tunnel
bitmap.
The perspective shape in the still maps to 0x126ab. For each of 0x6c0
points, it biases depth by 8000h + 1234h, divides X and Y by that depth,
centers the result at (160,100), and stores either a mode-13h screen offset
or the off-screen sentinel fa00h. The dense center and thinning edges in the
frame are exactly what that integer perspective divide produces.
The dotted brightness and trail behavior map to 0x125ca. In normal mode it
erases an old point position and writes the new intensity; in trail mode it
clears several history positions and writes a short decreasing intensity tail.
The history tables are copied down with rep movsd after each draw. That is
why the picture reads as a tunnel made of individual samples rather than a
filled surface or texture.
The motion leading to the still is controlled by the script records and the
six small-angle rotators at 0x1273d through 0x12850. Record fields load
movement deltas into [0000], [0001], and [0002]; each frame calls the
positive or negative axis-pair rotator selected by those signed bytes, then
waits for GS:0320 to advance. The frozen frame therefore captures one phase
of an interrupt-paced deformation loop.
The surrounding VGA setup matters even though this particular still is from the
dot engine. Mode setup helpers such as 0xf86a/0xf8af, retrace waits at
0xf7b9/0xf7c7, and DAC uploads around 0x1146f/0x122bb establish the
palette and display state. The timer handler at 0xf620 waits for retrace,
programs the PIT reload from GS:0322, calls scheduled callbacks, and then
ticks the music path. That shared machinery is what makes the dot tunnel sit
inside Eclipse's larger sequence of planar reveals, callback wipes, and filled
vectors.
Random-Table / Projected-Dot Engine at 0x12300
The code island at 0x12300 starts with DS=5038, ES=A000, then creates a
large table segment at ES=5c27. The setup helper calls near the beginning are
segment-ambiguous, but the table generation and projection loops are resolved.
PIT-Seeded Table Generation
It fills three word tables at offsets 5100h, 5e80h, and 6c00h:
es = 5c27h
cx = 06c0h
di = 0
repeat cx:
ax = mixed PIT ports 40h, 41h, 42h, bx, dx
es:[5100h + di] = ax
ax = mixed PIT ports 40h, 41h, 42h, bx, dx
es:[5e80h + di] = ax
ax = mixed PIT ports 40h, 41h, 42h, bx, dx
es:[6c00h + di] = ax
di += 2
The mix step is not cryptographic. It reads the timer ports, XORs previous
state, swaps bytes, rotates, and accumulates in DX. It is good enough for
visual pseudo-random coordinates.
Then it mirrors and negates table sections:
for six blocks, bp += 0d80h:
si = 0
di = 035eh
repeat 00d8h words:
ax = es:[bp+si]
ax = -ax
es:[bp+di] = ax
si += 2
di -= 2
After that, two larger mirror passes copy/negate across offsets 1b00h and
0d80h. The result is a symmetric 3D-ish coordinate/noise field from a small
amount of random input.
Script Records
The engine then interprets compact records from DS:SI. Record type is read
from [si+4]:
| Type | Meaning in code |
|---|---|
| 0 | call 0x12509, an interpolation/setup sequence |
| 1 | set byte [0003] = 1 |
| 2 | set byte [0003] = 0 |
| 3 | write eight DAC entries at index 0x28 with a blue-ish 00,00,0f pattern |
| other | load movement deltas and run a per-frame projection/deformation loop |
The nontrivial record path loads three words and three signed axis-control bytes:
[bedc] = [si+06]
[bede] = [si+08]
[bee0] = [si+0a]
[0002] = lowbyte([si+0c])
[0000] = lowbyte([si+0e])
[0001] = lowbyte([si+10])
Each record frame then does:
gs:0320 = 0
call 125ca ; erase/redraw point intensities
call 126ab ; project 3D points to screen offsets
if signed [0000] > 0: call 1273d
if signed [0000] < 0: call 12774
if signed [0002] > 0: call 127ab
if signed [0002] < 0: call 127e2
if signed [0001] > 0: call 12819
if signed [0001] < 0: call 12850
wait until gs:0320 >= 1
The six routines at 0x1273d through 0x12850 are axis-pair rotators. They all
loop 0x6c0 points and update two coordinate arrays using shifts instead of
sin/cos tables. One representative routine:
for each point:
bx = z
di = z
bx >>= 5
bp = y
dx = y
ax = y >> 11
bp -= ax
bp -= bx
dx >>= 5
ax = z >> 11
di -= ax
di += dx
z = di
y = bp
That is a small-angle fixed-point rotation/damping step. The paired positive and negative variants change the signs of the cross terms.
Projection and Dot Plotting
0x126ab projects 0x6c0 points into 320x200 screen offsets:
for each point:
bx = z + 8000h + 1234h
bx >>= 7
bx++
ax = x + 1234h
ax = ax / bx + 00a0h
if ax <= 0 or ax >= 0140h:
stored_offset = fa00h
continue
di = ax
ax = y + 1234h
ax = ax / bx + 0064h
if ax <= 0 or ax >= 00c8h:
stored_offset = fa00h
continue
screen_offset = ax * 0140h + di
ds:[bp+si] = screen_offset
The sentinel fa00h marks off-screen points. The renderer at 0x125ca erases
old point positions and writes new intensity values. In normal mode it clears
one old position and writes one new position. When byte [0003] is set, it
clears several trailing positions and writes a seven-sample tail with decreasing
brightness:
if trail_mode == 0:
old = table[52dc + si]
es:[old] = 0
new = table[605c + si]
es:[new] = intensity
else:
clear old positions from several history tables
es:[new0] = intensity
es:[new1] = intensity - 1
...
es:[new6] = intensity - 6
The history tables are copied down with rep movsd after each draw, so the next
frame can erase or trail the previous positions efficiently. This is a classic
projected-dot/particle object: 1728 points, integer perspective divide, optional
motion trails, and one byte write per visible sample.
Bar/Wipe Callback at 0x139a4
The routine at 0x13939 sets up a small effect, writes CRTC register 13h, fills
the first 0x140 bytes with 0x0f0f, and schedules callbacks. The visible
callback at 0x139a4 draws ten soft horizontal strips:
ds = 6e05h
es = a000h
bx = 0
di = 0
for strip in 0..9:
dx = word [0030 + strip*2]
word [0030 + strip*2]++
if dx < 0:
write 16 words of 0f0fh
else if dx >= 00a0h:
write 16 words of 0000h
else:
dl &= 3fh
if dl < 20h:
write dl zero bytes
al = (1fh - dl) >> 1
write (20h - dl) bytes of al
else:
dl -= 20h
write (20h - dl) zero bytes
al = dl >> 1
write dl bytes of al
This is a timed strip wipe. Each strip has its own counter in [0030..0043],
and the inner body writes a small gradient ramp without a lookup table.
Filled-Vector Engine at 0x13a3a
The island at 0x13a3a is the most conventional 3D engine recovered here. It
sets DS=6e0a, ES=A000, calls segment-mapped setup helpers, initializes
object/angle state, schedules a callback, and enters a page-flipped render loop.
The frame loop:
while [02a0] != 1:
unblank attribute controller
gs:0320 = 0
call 13af1 ; draw one frame
wait until gs:0320 >= 1
cx = (gs:0320 >> 1) + 1
repeat cx:
call 13d9b ; command sequencer
call 13d3d ; camera/angle update
ax = gs:0328 + 5000h
if ax > a000h: ax = 0
gs:0328 = ax
wait while gs:0328 == gs:032a
The wait at the end coordinates with the timer IRQ's CRTC start update. The part draws into one page while the IRQ displays another.
Frame Renderer at 0x13af1
The frame renderer chooses a page from GS:0328, clears it, transforms and
projects object vertices, then draws polygons:
es = a000h + (gs:0328 >> 4)
out 3c4h, 0f02h ; all planes
out 3ceh, 0000h
out 3ceh, 0f01h
out 3ceh, ff08h
di = 0
cx = 07d0h
rep stosd ; clear page chunk
esi = 0168h - [0294]
edi = [0298]
ebp = [0296]
call 1ee63 ; segment-mapped transform/table helper
bx = [02b0] ; object descriptor
si = [bx+02aa] ; source vertices
bp = [bx+02ac] ; vertex count
di = 00a8h ; transformed vertex buffer
call 1f01e ; segment-mapped transform helper
bp = [bx+02ac]
si = 00a8h
di = 0030h
call 13b79 ; perspective projection
out 3ceh, 0305h ; GC write mode for filled polygons
di = [bx+02a6] ; polygon list
dx = [bx+02a8] ; polygon count
call 13bb9
out 3ceh, 0005h
The two transform helpers are not safely decoded as flat offsets, but the data
contract around them is clear: transformed vertices go to 0x00a8, projected
screen coordinates go to 0x0030, and polygon records reference those
projected vertices by index.
Perspective Projector at 0x13b79
The projector is fully readable:
for bp vertices:
eax = dword [si + 0] ; x
ecx = dword [si + 8] ; z
eax >>= 13
ecx >>= 16
cx += [0288] ; camera/depth bias
ax = (eax * 0096h) / cx
ax += [028a] ; screen center x
[di + 0] = ax
eax = dword [si + 4] ; y
eax >>= 13
ax = (eax * 0080h) / cx
ax += [028c] ; screen center y
[di + 2] = ax
si += 0010h
di += 0004h
Coordinates are 32-bit fixed-point values. X and Y use a 13-bit shift; Z uses a
16-bit shift. The constants 0x96 and 0x80 are projection scale factors.
Polygon Loop and Backface Test at 0x13bb9
Each polygon record appears to be 8 bytes. The loop walks records backwards from the last polygon:
si = di + (dx - 1) * 8
eax = word [si+4] ; vertex A index
ebx = word [si+2] ; vertex B index
ecx = word [si+6] ; vertex C index
The backface determinant is computed from the projected coordinate arrays at
0x30 and 0x32:
det =
(x[A] - x[B]) * (y[C] - y[B])
- (y[A] - y[B]) * (x[C] - x[B])
If the determinant is positive:
ah = byte [si] << 1
ah += 2
out 3ceh, ax ; set/reset color path
out 3c4h, 0602h ; plane mask variant
If the determinant is non-positive and the polygon color byte is nonzero:
ah = byte [si]
out 3ceh, ax
out 3c4h, 0102h
Then it loads the projected X/Y pairs for the three vertices and calls the span filler:
eax = projected vertex [si+2]
ebx = projected vertex [si+4]
ecx = projected vertex [si+6]
call 1f099
Again, 1f099 is segment-mapped in the executable and does not decode safely
as a flat image offset, but the caller establishes the usual filled-triangle
contract: selected VGA write mode, selected plane mask/color, and three
projected vertices in registers.
Camera and Script Sequencer
0x13d3d updates angles and camera/projector state:
[0294] = ([0294] + [029a]) mod 0168h
[0298] = ([0298] + [029c]) mod 0168h
[0296] = ([0296] + [029e]) mod 0168h
[028a] += [0290] ; screen center x / camera x
[028c] += [0292] ; screen center y / camera y
[0288] += [028e] ; depth bias
0x13d9b is a tiny command sequencer:
dec word [02a2]
if [02a2] == 0:
[02a2] = 1
bx = [02a4]
call bx
[02a4] = bx
The command functions around 0x13c74 set up camera centers, angle deltas,
movement deltas, delays, and the next command pointer. For example:
13c74: [028a] = 00a0h
[028c] = 012ch
[0288] = 0136h
bx = 9481h
13c8a: [029a] = 0002h
[029c] = 0001h
[029e] = 0001h
bx = 9497h
13d36: [02a0] = 0001h ; end part
This is a script chain rather than a hard-coded camera path in the render loop.
What Eclipse Is Doing Technically
The intro's core style is not "draw into a chunky framebuffer and copy it". Most resolved parts rely on direct VGA behavior:
- CRTC start-address changes for page flips and scrolls.
- Sequencer map masks to scatter one logical image into four VGA planes.
- Graphics-controller write modes for copy/fill behavior.
- Palette-index arithmetic instead of RGB arithmetic.
- Timer IRQ callbacks to hide small one-shot updates behind retrace.
- Integer projection and shift-based rotations to keep 3D effects 386-friendly.
The 0x111c0 part is the most tightly size-coded image/reveal routine: decode a
small RLE stream, fan it into planes, brighten selected interleaved samples,
copy through alternate VGA windows, and flip pages by CRTC start.
The 0x12300 part is a compact projected-dot engine: generate a symmetric point
field from PIT noise, project 1728 points using integer divides, keep old
screen offsets for erasing/trails, and deform coordinates with six tiny
small-angle rotation loops.
The 0x13a3a part is a filled-vector engine: transform fixed-point vertices,
project them, reject/backface polygons with a 2D determinant, then hand
projected triangles to a VGA-mode span filler.
Remaining Unresolved Areas
This pass intentionally leaves a few boundaries:
- The music mixer/player routines around
0xfeb6and0xfeefare identified by call site and IRQ role but not reconstructed. - Several early dispatcher targets are not reliable flat offsets in the stripped image. They likely depend on the executable's segment layout or runtime mapping, so I did not assign visual names to them.
- Shared transform and span-fill helpers called as
0x1ee63,0x1f01e, and0x1f099are described by their caller contracts, but their bodies did not decode cleanly at the same flat image offsets.
Even with those caveats, the recovered loops explain the main engineering character of Eclipse: a 75K-ish 386 intro built around tweaked VGA planes, interrupt-synchronized callbacks, small packed resources, and fixed-point projection rather than brute force framebuffer code.