Analysis model: gpt-5.5 xhigh
The Cult Intro by ISCH Crew - Technical Dissection
The Cult Intro is a 1994 MS-DOS 64K intro by ISCH Crew. Demozoo lists the
release date as 30 October 1994 and places it first in the Wired 1994 PC Intro
competition. The original Wired 1994 results file lists the entry as Cult by
ISCH Crew with 203 points, ahead of Once by DSL and Weird by $PA.
Release year: 1994
Released: 30 October 1994.
Sources
- Scene.org Wired 1994 intro directory: https://files.scene.org/browse/parties/1994/wired94/in64/
- Scene.org
cult.ziprelease archive: https://archive.scene.org/pub/parties/1994/wired94/in64/cult.zip - Scene.org Wired 1994 results: https://archive.scene.org/pub/parties/1994/wired94/results.txt
- Demozoo production: https://demozoo.org/productions/27289/
- Demozoo Wired 1994 party page: https://demozoo.org/parties/529/
- Pouet production: https://www.pouet.net/prod.php?which=8742
- LZEXE background by Fabrice Bellard: https://bellard.org/lzexe/
unlzexereference implementation used as a packer-family cross-check: https://github.com/mywave82/unlzexe
Old personal contact details from the original files are deliberately omitted.
Credits And Party Context
The bundled text credits:
- Coding: DamN.
- Graphics: GHoRY and BaRT.
- Additional graphics: M!CKeY.
- Music: ALeXeL.
The same text says the official chip MOD had to be reduced at the party from roughly 20 KB to roughly 12 KB. It also says the intro was written over about three months, and that the final party machine changed from the expected DX33 to a DX2/66 near the deadline, forcing last-minute timing fixes, especially for the stars.
That machine note matters technically: several loops below use software waits, vertical-blank waits, and caller-supplied delay counts rather than a complete timer-based scene scheduler.
Archive Identity
The Scene.org archive contains:
CULT.TXT 5653 bytes
CULT.SDM 12964 bytes
CULT.CDM 21818 bytes
CULT.EDM 22424 bytes
FILE_ID.DIZ 448 bytes
CULT.EXE 7927 bytes
Hashes used for this pass:
49f61b84e929bc146c44325141f9f9d960aced11474a54bee1ee787eb3b226c0 cult.zip
0cb6271b97e68642acdf96492661c72718ccc06b8cddb86d12008130dbc52568 CULT.EXE
970f7a4ecc1bbac7e689602f550b3f8cc650404c06c2185568f5cefc79a613fb CULT.EDM
fc77dbda9bbc0877f3e3517b5e2034f1f8c660fa1a4c6acfbfe3c7f1cc44bdbc CULT.CDM
fa994a9cea7000f2a9a9cec5f6abd89299ffa70c9c7bea2932785adb372bb55f CULT.SDM
7a887aae2882464c31610ccb6f76c94843b261f1a601a01d474e6b127259a315 CULT.TXT
ca3993e36e4d88af2de54549e4cc599c80649fc662c9c0bdad3641d791687fad FILE_ID.DIZ
CULT.SDM is a 4-channel ProTracker module titled CULT Intro Wired'94.
CULT.CDM is a DamN graphics container. CULT.EDM is not just arbitrary data:
it is another packed MZ image with the same depacker family as CULT.EXE.
Two Packed MZ Images
Both CULT.EXE and CULT.EDM use tiny MZ headers with the old
FFF0:0100 entry trick. Under DOS, the executable load image begins at
PSP:0100; a relative CS of FFF0h cancels the normal +10h EXE load bias,
so execution starts at the first byte of the loaded image. Static tools that
convert CS:IP directly to a large file offset will miss this.
Raw header summary:
CULT.EXE
file size: 7927 bytes
MZ load bytes: 7895 bytes
header bytes: 32 bytes
relocations: 1
initial CS:IP: fff0:0100
initial SS:SP: 01f5:0200
min/max alloc: 823/1948 paragraphs
CULT.EDM
file size: 22424 bytes
MZ load bytes: 22392 bytes
header bytes: 32 bytes
relocations: 1
initial CS:IP: fff0:0100
initial SS:SP: 057f:0200
min/max alloc: 3550/65535 paragraphs
The public unlzexe reference rejected both files because the usual marker and
header layout are modified. The depacker bytes, however, are very close to the
LZEXE 0.90/0.91 family. I unpacked them by emulating the DOS load state and
stopping at the second retf: the first far return enters the copied depacker,
the second would enter the original program.
Recovered entry points from that emulation:
CULT.EXE unpacked load image: entry 0060:021c
CULT.EDM unpacked load image: entry 0060:0bc4
The important result is that CULT.EXE is mostly a launcher/sound prompt and
file loader, while CULT.EDM is the real intro body.
Depacker Bootstrap
CULT.EXE begins at loaded offset 0100h with a small memory check and a copy
of the depacker to a safer segment:
0100: b8 10 05 mov ax,0510h
0103: ba ee 01 mov dx,01eeh
0109: cmp ax,[0002] ; PSP top-of-memory word
010d: jae not_enough
010f: sub ax,0020h
0112: cli
0113: mov ss,ax
0115: sti
0116: sub ax,0019h
0119: mov es,ax
011b: push ax
011c: mov cx,00c3h
011f: xor di,di
0121: push di
0122: mov si,0144h
0125: cld
0126: rep movsw
0128: retf
The copied code starts at the source offset 0144h. CULT.EDM uses the same
shape, but with larger size constants:
0100: b8 2b 13 mov ax,132bh
0103: ba 78 05 mov dx,0578h
...
011c: mov cx,0122h
0122: mov si,0144h
0126: rep movsw
0128: retf
This explains why the stub is so small in the file. The first stage only needs to move a decompressor and then run it from a place where it can overwrite the original load image.
Depacker Inner Loop
The decompressor keeps its bit buffer in BP and its remaining bit count in
DL. Refills are 16-bit little-endian loads:
ad lodsw
95 xchg bp,ax
b2 10 mov dl,10h
A bit is consumed by shifting BP right and decrementing DL. The zero-count
case jumps back to a refill block. The literal path is a single byte copy from
compressed stream to output:
d1 ed shr bp,1
4a dec dx
74 refill
73 literal
...
literal:
a4 movsb
Match copies use a small code table to choose length classes, then derive a backward span. The hot copy path is:
56 push si
8b f7 mov si,di
2b f3 sub si,bx ; SI = DI - match_distance
fa cli
f3 26 a4 rep movsb es:[di],es:[si]
fb sti
5e pop si
This is a normal LZ sliding-window copy, but the segment override makes both
read and write come from the output segment. Interrupts are briefly masked
during the overlapping copy. That avoids an interrupt handler observing
temporary SI/DI state while the depacker is copying inside its own output
buffer.
The end marker is AL=FFh. After that the stream contains relocation and final
entry metadata. The tail loop reads relocation spans, adds the load base, and
patches words in the reconstructed load image:
pop bx
mov bp,bx
add bx,0010h ; executable load segment = PSP + 10h
xor ax,ax
next_block:
lodsb
xchg cx,ax
jcxz done_block
lodsw
add ax,bx
mov es,ax
patch_words:
lodsw
xchg di,ax
add word ptr es:[di],bx
loop patch_words
jmp next_block
The final words in the stream rebuild SS:SP and push the original CS:IP
before clearing general registers and executing retf.
CULT.EXE Launcher
After unpacking, CULT.EXE is a Borland-style real-mode program. Its entry at
load offset 021c has enter frames, Pascal strings, far calls into runtime
segments, and a short interactive GUS prompt.
Useful strings include:
Hello, Do YOU have a sound card Called Gravis Ultra Sound [GUS]
Press a key to continue
cult.sdm
cult.edm
demo.exe
M.K.FLT46CHN8CHNOCTA
Runtime error
Portions Copyright (c) 1983,92 Borland
The loader is not where the demo effects live. Its job is to ask about GUS,
touch the module file, handle the packed CULT.EDM stage, and then leave the
intro body to do the visual work.
CULT.CDM Graphics Container
CULT.CDM is a concatenation of ten DamN records. Each record has a DamN
magic, a header length of 7Ah, an embedded original path string, and a
compressed payload immediately after the header. The code in CULT.EDM
contains the matching names:
gfx1.dmn
gfx1.dmp
gfx2.dmn
gfx2.dmp
gfx3.dmn
gfx3.dmp
gfx4.dmn
gfx4.dmp
gfx5.dmn
gfx5.dmp
Record table from CULT.CDM:
offset name record bytes payload bytes
0000 GFX1.DMN 4351 4229
10ff GFX1.DMP 730 608
13d9 GFX2.DMN 6359 6237
2cb0 GFX2.DMP 350 228
2e0e GFX3.DMN 1429 1307
33a3 GFX3.DMP 352 230
3503 GFX4.DMN 5712 5590
4b53 GFX4.DMP 356 234
4cb7 GFX5.DMN 1996 1874
5483 GFX5.DMP 183 61
CULT.EDM contains an error string naming the decompressor object as
MDCD1213.OBJ, so the record bodies are handled by DamN's own compress /
decompress code rather than by PCX, GIF, or another standard picture format.
Main Body Structure
The unpacked CULT.EDM entry at load offset 0bc4 is a Pascal-like scene
script. It calls a block of graphics routines in segment 0155h, which maps to
flat load-image offsets around 0f50h and above when the base segment is
0060h.
The first visible setup is:
0bc4: call 0b7a:0000 ; Borland/runtime init
0bc9: call 0b7a:0548
0bce: call 0155:5a2f
0bd3: enter 0100h,0
0bd7: call 0155:04d7 ; maps to flat 1427h, mode 13h
...
0c3e: push a000h
0c40: push 0000h
0c43: call 0155:04b9
Several story strings are embedded near the start of the body:
greetz
hue ? 66mhz ?!?
put your turbo off!
wired
first there was nothing,
then, there was ...
a landscape.
Back From a Party :
a little dizzy
mathematics,
Fractals,
Headache!
A sea of
Stars
Those strings correspond well to the code sections: text/logo sections, landscape/fractal drawing, and a starfield.
Basic VGA Routines
The small graphics library has both chunky mode 13h helpers and Mode X helpers.
Mode Set
At flat offset 1421h:
1421: b8 03 00 mov ax,0003h
1424: cd 10 int 10h
1426: cb retf
1427: b8 13 00 mov ax,0013h
142a: cd 10 int 10h
142c: cb retf
At 518fh it switches through BIOS modes and then tweaks VGA registers for an
unchained planar layout:
518f: mov ax,0012h
5192: int 10h
5194: mov ax,0013h
5197: int 10h
5199: mov dx,03c4h
519c: mov ax,0604h
519f: out dx,ax ; sequencer memory mode
51a0: mov dx,03d4h
51a3: mov ax,0014h
51a6: out dx,ax ; CRTC underline register
51a7: mov ax,0e317h
51aa: out dx,ax ; CRTC mode control
51ab: retf
The mode set is not just int 10h and done. It prepares the layout used by the
planar pixel writer and CRTC page-start routine.
Clear And Copy
Full 320x200 clears use 64,000 bytes, written as 32,000 words:
1409: mov cx,7d00h
1410: mov es,[bp+08]
1413: xor di,di
1415: mov al,[bp+06]
1418: mov ah,al
141a: rep stosw
141c: retf 0004h
Full-screen buffer copies use the same word count:
1569: mov es,[bp+06]
1572: mov ds,[bp+08]
1577: xor si,si
1579: xor di,di
157b: mov cx,7d00h
157e: rep movsw
1582: retf 0004h
That makes the off-screen segments named at 06c2h, 06c4h, and 06c6h
important. The intro allocates three nearly 64 KB buffers and clears all three:
142d: push fa00h
1433: call allocator
1438: mov [06b2],ax
143b: mov [06b4],dx
143f: les di,[06b2]
1443: mov [06c2],es
...
1478: push [06c2]
147c: push 0000h
147e: call 1409h
Palette Writes And Reads
Single-entry palette write at 14cdh:
14d0: mov al,[bp+0c] ; DAC index
14d3: mov dx,03c8h
14d6: out dx,al
14d7: mov al,[bp+0a] ; red
14da: mov dx,03c9h
14dd: out dx,al
14de: mov al,[bp+08] ; green
14e1: mov dx,03c9h
14e4: out dx,al
14e5: mov al,[bp+06] ; blue
14e8: mov dx,03c9h
14eb: out dx,al
Palette read at 14f0h selects the DAC read index at 03c7h, then reads three
components from 03c9h into caller pointers.
Vertical Blank Wait
Two copies of the same wait exist at 151ch and 51ach:
151c: mov dx,03dah
151f: in al,dx
1520: and al,08h
1522: jne 151fh ; wait until not in retrace
1524: in al,dx
1525: and al,08h
1527: je 1524h ; wait until retrace starts
1529: retf
This gives a frame boundary, not a speed-independent timer. That matches the party note about machine speed requiring last-minute sync work.
Mode X Pixel And Page Start
The planar pixel writer at 0f93h chooses one VGA plane from x & 3, computes
y * 80 + x / 4, adds a page offset, and writes one byte:
0f96: mov ax,0a000h
0f99: mov es,ax
0f9b: mov bx,[bp+0a] ; x
0f9e: mov dx,03c4h
0fa1: mov ax,0102h ; map mask index/value
0fa4: mov cl,bl
0fa6: and cl,03h
0fa9: shl ah,cl
0fab: out dx,ax
0fac: mov ax,[bp+08] ; y
0faf: shl ax,4
0fb2: mov di,ax
0fb4: shl ax,2
0fb7: add di,ax ; y * 80
0fb9: shr bx,2
0fbc: add di,bx ; x / 4
0fbe: add di,[0b3c] ; page offset
0fc2: mov al,[bp+06]
0fc5: mov es:[di],al
CRTC page start at 5178h writes registers 0Ch and 0Dh:
517b: mov bx,[bp+06]
517e: mov dx,03d4h
5181: mov ah,bh
5183: mov al,0ch
5185: out dx,ax
5186: mov ah,bl
5188: inc al
518a: out dx,ax
So the intro has both direct chunky buffers and VGA page/display-start tricks.
Text And Glyph Renderer
The text code builds its own glyph cache rather than calling BIOS font services.
At 496bh, it allocates 38h slots of DDh bytes and stores the resulting
segments in a table at 07aah:
496f: xor ax,ax
4971: mov [0b38],ax
4976: mov [bp-2],ax
4983: push 00ddh
4986: call allocator
498b: mov di,[bp-2]
498e: shl di,2
4991: mov [di+06ca],ax
4995: mov [di+06cc],dx
499f: les di,[di+06ca]
49a3: mov ax,es
49aa: mov [di+07aa],ax
49ae: cmp [bp-2],0037h
49b2: jne 4980h
It then scans a source picture buffer and converts source pixel values 0, 1,
and 2 into glyph bytes 00h, 3Ah, and 32h. The inner scan is small but
very explicit:
4a1f: mov ax,[06c2] ; source buffer segment
4a23: imul ax,[bp-6],0140h ; y * 320
4a28: add ax,[bp-4] ; + x
4a2d: mov es,ax_segment
4a2e: mov al,es:[di]
4a31: cmp al,00h
4a33: jne nonzero
...
4a43: mov es:[di],00h
...
4a5b: mov es:[di],3ah
...
4a73: mov es:[di],32h
The character renderer at 4ba1h first maps ASCII to a glyph number. Plain
letters use character - 40h; punctuation and digits have explicit cases.
That is why the string set is restricted and stylized.
The pixel loop is a 12-column by roughly 16-row glyph copy. One path writes
directly to A000h with y * 320 + x, and another path calls the planar
single-pixel helper:
4d1d: glyph = table[glyph_index]
4d2b: cl = glyph[pixel_index]
4d2e: mov ax,0a000h
4d38: imul ax,y,0140h
4d41: add ax,x
4d49: mov es:[di],cl
String routines such as 4dc5h, 4e26h, 4e9ah, 4f17h, 4fa4h, and
5036h copy a Pascal string to stack scratch, render each character, advance
the x position by 0Ch, and optionally wait one or more vertical blanks between
steps. This is the writer machinery behind the "wired", "landscape", and
credits/greetz text.
Texture / Scaler Inner Loop
The most interesting compact loop is at 2c39h. It renders a scaled or mapped
chunky source into A000h. The loop uses 386 operand-size prefixes inside
16-bit real-mode code so that two 16.16-style accumulators fit in EDX and
ESI.
The setup computes a destination scanline pointer without multiplication:
2c98: mov ax,0a000h
2c9c: mov es,ax
2c9e: mov ax,[bp-0c] ; y
2ca1: xchg al,ah ; y * 256 for y < 256
2ca3: mov di,ax
2ca5: shr di,2 ; y * 64
2ca8: add di,ax ; y * 320
Then the hot part emits two pixels per loop:
2caa: mov cx,[0b32]
2cae: shr cx,1
2cb0: lds si,[bp+08] ; source pointer
2cb4: mov ax,[bp+0e]
2cb7: shl eax,10h
2cbb: mov ax,[bp+0c]
2cbe: mov esi,eax ; packed source step
2cc1: mov dx,[bp-12]
2cc4: shl edx,10h
2cc8: mov dx,[bp-14] ; packed source accumulator
loop:
2ccb: add edx,esi
2cce: mov ebx,edx
2cd1: shr ebx,10h
2cd5: mov bl,dh
2cd7: mov al,[bx]
2cd9: add edx,esi
2cdc: mov ebx,edx
2cdf: shr ebx,10h
2ce3: mov bl,dh
2ce5: mov ah,[bx]
2ce7: stosw
2ce8: dec cx
2ce9: jne loop
The unusual mov bl,dh combines the high byte of the other accumulator into
the low byte of the lookup offset. In effect, BX becomes a compact 2D source
lookup index. This is exactly the kind of trick used for small real-mode
texture mappers: keep the inner loop branch-light, fetch two texels, emit a
word, and let the caller adjust the starting accumulator per scanline.
The caller changes the starting accumulators depending on a mode parameter:
if mode == 1:
start_x += step_y
if mode == 1 or mode == 2:
start_y -= step_x
if mode == 3:
start_x += step_x
That lets the same loop perform different twists/slides without duplicating the inner mapper.
Line And Landscape Span Kernels
The "landscape/fractal/headache" area uses line and span routines rather than only bitmap copies.
The helper at 1d1eh draws a horizontal run from x0 to x1. It computes the
linear offset from y * 320 + x, compares against a source/background color,
and conditionally writes to the target:
1d28: mov cx,[bp+10]
1d2b: sub cx,[bp+12] ; count = x1 - x0
1d30: mov ax,[bp+0e]
1d34: mov dx,0140h
1d37: mul dx ; y * 320
1d39: add ax,[bp+12]
1d3d: mov bx,ax
...
1d44: inc bx
1d45: mov es,[06c2]
1d49: mov dl,es:[bx]
1d4c: cmp dl,[bp+0a]
1d53: mov es,[bp+08]
1d56: mov es:[bx],al
1d59: loop 1d44h
The routine at 1dc3h wraps this into a Bresenham-like span drawer. It chooses
the major axis by comparing absolute deltas, accumulates an error term, and
draws mirrored horizontal spans with either 1d1eh or the faster solid
13d5h line fill:
1e23: abs(dx)
1e39: cmp abs_x,abs_y
1e73: error = major / 2
...
1e93: if masked:
1eb8: call 1d1eh
1ed8: call 1d1eh
1edd: else:
1ef2: call 13d5h
1f0b: call 13d5h
1f0e: error += minor
1f1a: if error >= major:
1f28: x += x_major_step
1f31: y += y_major_step
1f3c: else:
1f3f: x += x_minor_step
1f48: y += y_minor_step
That is a practical landscape trick: draw many horizontal spans instead of individual pixels, and use source-buffer tests when the span must respect an existing picture.
Starfield
The starfield is a classic "move in z, project x/y, erase old pixel" loop. The
initialization at 51bah fills arrays for roughly 500 stars:
51bd: xor ax,ax
51bf: mov [22c0],ax ; star index
51c8: push 0140h
51cb: call random
51d6: mov [di+16fe],ax ; x in 0..319
51da: push 00c8h
51dd: call random
51e8: mov [di+1ae8],ax ; y in 0..199
51ec: push 02f8h
51ef: call random
51fa: mov [di+1ed2],ax ; z in 0..759
51fe: cmp [22c0],01f4h
5204: jne next
The draw/project helper at 521bh first erases the old pixel saved in
[0b40 + index*2], then performs a perspective divide:
5227: di = [22c0] * 2
522d: push [di+0b40]
5231: call erase_old_pixel
523a: shl [bp+08],8 ; y or x numerator
523e: shl [bp+0a],8
5242: ax = [bp+0a]
5246: idiv [bp+06] ; divide by z
524c: ax = [bp+08]
5250: idiv [bp+06]
5256: add [bp+0a],00a0h ; center x at 160
525f: add [bp+08],0064h ; center y at 100
It bounds-checks against 0..319 and 0..199, writes the star, and records the
linear offset so the next frame can clear it:
5282: mov ax,0a000h
5285: mov es,ax
5287: mov ax,0140h
528a: mul [bp+08] ; y * 320
528d: add ax,[bp+0a] ; + x
5290: mov di,ax
5292: inc byte ptr es:[di]
5298: mov es:[di],al ; brightness/color
529b: mov [22be],di
52a8: mov [di+0b40],ax ; old pixel offset
The update routine at 52c6h has several movement modes selected by a caller
byte ('1', '2', '3', and later cases). In the simplest mode it subtracts a
speed value from z, respawns if z falls below 2, and introduces side motion
for different halves of the star array. The duplicated index ranges in the code
are not accidental: they let half the stars mirror the other half for a denser
or more symmetric field without doubling all random calls.
How The Parts Fit Together
The intro is technically a hybrid:
CULT.EXEis a small packed launcher around GUS/module setup.CULT.EDMis a second packed MZ image containing the real intro.CULT.CDMcarries five compressed graphics pairs.CULT.SDMcarries the reduced ProTracker module.- The visual code is Borland/Pascal-shaped at the scene-script level, but the important pixels are handled by short real-mode VGA kernels.
The low-level design is not a single giant magic loop. It is a compact toolkit: clear/copy buffers, set/read palette entries, wait for vertical blank, draw glyphs, plot planar pixels, page-flip, map a texture-like source with a 386 inner loop, draw landscape spans, and run a starfield. The "fancy" feel comes from sequencing those pieces with party-coded text and quick palette changes rather than from a large protected-mode engine.
Caveats
The unpacked code was recovered by emulating the depacker path, not by finding a clean original linker output. Offsets in this writeup are therefore load-image offsets after unpacking. Some ranges in the binary mix code, data tables, and Borland floating-point support, so only ranges with clear behavior are treated as effect code.
The DamN MDCD1213.OBJ compressor/decompressor was identified from the unpacked
strings and the CULT.CDM record layout, but this pass does not fully reconstruct
that compression format.