Analysis model: gpt-5.5 xhigh
Once - The Intro by LaSerDance / Acme - Technical Dissection
Once - The Intro is a 1994 MS-DOS intro by LaSerDance / Acme. Demozoo lists
the release date as 30 October 1994 and places it second in the Wired 1994 PC
Intro competition. The official Wired 1994 results file lists the entry as
Once by DSL with 180 points, between Cult by ISCH Crew 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
once_lsd.ziprelease archive: https://archive.scene.org/pub/parties/1994/wired94/in64/once_lsd.zip - Scene.org Wired 1994 results: https://archive.scene.org/pub/parties/1994/wired94/results.txt
- Demozoo production: https://demozoo.org/productions/27290/
- Demozoo Wired 1994 party page: https://demozoo.org/parties/529/
- Pouet production: https://www.pouet.net/prod.php?which=11662
Old personal contact and BBS details from the original files are deliberately omitted.
Credits And Context
The bundled ONCE-LSD.NFO calls the intro ONCE .. THE SECOND ONE MAN PROJECT, a 64K intro for Wired 1994, coded in 100% assembler by LaSerDance /
AcmE. It says the intro was assembled in the week before the party, while the
author was also working on a demo version. It also says the first intro part had
been made roughly half a year earlier for Assembly 1994 but was not released
there.
The text is unusually direct about what the parts are meant to be:
- an opening with 3D Studio-rendered text and a
SuperCubereply to Cascada; - a circular plasma with palette motion;
- a "phong-shaded / smokey" cube;
- a final texture-mapped 3D maze inspired by Nostalgia's
Echoes from the Past; - AdLib/HSC music in this intro version.
Pouet's page adds the useful comparison that the intro is visually close to the
demo version, but uses an AdLib tune where the demo has a module soundtrack.
The recovered binary agrees: the main loader contains HSCOBJ 1.2 and
HSC-Player 1.1 strings, not a tracker-module player.
Archive Identity
The Scene.org archive has a party wrapper plus distribution extras:
ONCE-LSD.EXE 61855 bytes
ONCE-LSD.NFO 4498 bytes
FILE_ID.DIZ 479 bytes
IC_WHQ.NFO 1623 bytes
TETSUO.TXT 1461 bytes
RUN_IT.EXE 4700 bytes
PA.BBS 10920 bytes
KUKOO2.EXE 23974 bytes
Hashes used for this pass:
eafaefa6a03331559785c7ee001a412f2d1c31880ff70daddd6932d54e32e608 once_lsd.zip
0c8ba5808440a3348351386daf12eb25a1cda742e285f46b50e50a153a16c32d ONCE-LSD.EXE
ace284ab54aab98d4aa92e12cfe490e7cdc7d917d71c2fff8ed180993e544611 ONCE-LSD.NFO
4eb6a26f427e3699863426c7568b193efbd113788ea07c4d00e1da37dc67a0c1 FILE_ID.DIZ
ONCE-LSD.EXE is the only file needed to run the intro. The outer ZIP is
87,894 bytes, but the intro executable itself is 61,855 bytes. The executable is
not a single continuous program: it is a PKLITE loader followed by several
embedded PKLITE-compressed child programs.
Main MZ Wrapper
The main executable has a tiny DOS MZ image and a large tail:
file size: 61855 bytes
MZ image size: 6937 bytes
header bytes: 96 bytes
load bytes: 6841 bytes
relocations: 1
initial CS:IP: fff0:0100
initial SS:SP: 01b2:0200
overlay tail: 54918 bytes
The FFF0:0100 entry trick makes execution start at the first byte of the load
image after DOS has placed it at PSP+10h. Static EXE tools can misread this if
they convert CS:IP as an absolute file pointer.
The PKLITE marker occurs many times because the main file contains the loader plus packed child images:
MZ child offsets:
0x0000 main loader
0x1fe5 part1 intro / SuperCube
0x5575 part2 circular plasma
0x60b2 part3 image bridge
0x75b9 part4 shaded cube
0x83f9 part5 image bridge
0x9812 part6 maze / texture mapper
0xd787 part7 final image sequence
There is also a small COM-style tail at 0x1b19, used after the larger visual
parts. It contains a tiny text/audio end routine and another PKLITE signature.
Loader Strategy
After PKLITE decoding, the main loader is a raw 16-bit load image of about 52 KB. Its first job is to free and reacquire memory:
0000: mov ax,es
0002: mov cs:[04ed],ax
0006: mov bx,ss
0008: sub bx,ax
000a: mov ax,sp
000c: shr ax,4
000f: add bx,ax
0011: add bx,2
0014: mov ah,4a
0016: int 21h ; shrink current DOS block
0018: mov bx,0800h
001b: mov ah,48h
001d: int 21h ; allocate 32 KB staging buffer
Then it checks for the memory layout it wants:
0297: mov bx,5400h
029a: mov ah,48h
029c: int 21h ; conventional-memory availability probe
02aa: mov dx,0419h ; "EMMXXXX0"
02ad: mov ax,3d00h
02b0: int 21h ; open EMS device
02b4: mov ah,43h
02b6: mov bx,0090h
02b9: int 67h ; EMS query
02c0: mov ah,45h
02c2: int 67h ; allocate EMS pages
The user-facing error strings say it needs 390 KB of free conventional memory and 2304 KB of EMS. That is a lot for a 64K intro, but it makes sense once the parts are understood: the author stores large depacked code images, generated tables, images, and full Mode 13h work buffers outside the packed file.
Embedded Part Execution
The most important loader routine starts at 01ach. It opens its own
once-lsd.exe, seeks from end-of-file to a part offset, reads that packed block
into the 32 KB staging segment, writes it as \temp.tmp, then executes it with
DOS function 4Bh.
01af: mov dx,0
01b2: mov ds,dx
01b4: mov dx,cs:[04e1] ; "once-lsd.exe"
01be: mov ah,3dh
01c0: int 21h ; open self
01c6: mov cx,0
01c9: mov dx,0
01cc: mov al,2
01d3: mov ah,42h
01d5: int 21h ; seek EOF
01d7: sub ax,cs:[04e7] ; convert EOF-relative part pointer
01e8: mov ah,42h
01ea: int 21h ; seek part
01ec: mov cx,cs:[04e9] ; part length
01f1: mov dx,cs:[04df] ; staging segment
0200: mov ah,3fh
0202: int 21h ; read part
0212: mov dx,0422h ; "\temp.tmp"
0218: mov ah,3ch
021a: int 21h ; create temp
022f: mov bx,cs:[04e5]
0234: mov ah,40h
0236: int 21h ; write temp
028a: mov al,0
028c: mov ah,4bh
028e: int 21h ; exec temp
This is a very size-conscious design. The main file is a container, but it does not need its own executable loader format. DOS already knows how to run an MZ file, so the main program simply materializes each packed child as a temporary program and lets DOS load it.
The part table implied by the loader is:
part0 tail COM file 0x1b19 size 0x04cc
part1 intro file 0x1fe5 size 0x3590
part2 plasma file 0x5575 size 0x0b3d
part3 image bridge file 0x60b2 size 0x1507
part4 cube file 0x75b9 size 0x0e40
part5 image bridge file 0x83f9 size 0x1419
part6 maze file 0x9812 size 0x3f75
part7 final images file 0xd787 size 0x1a18
The loader also sets up the PIT and uses INT 8 to count frames:
0038: mov al,36h
003a: out 43h,al
003c: mov al,8fh
003e: out 40h,al
0040: mov al,42h
0042: out 40h,al
0049: 66 26 a1 20 00 mov eax,es:[0020h]
004e: 66 2e a3 f1 04 mov cs:[04f1h],eax
The 8Fh,42h divisor is repeated inside several child parts after vertical
blank waits. The effect code is paced by both vertical retrace and a timer tick
increment variable rather than a single central scene clock.
Shared Palette Fade
The loader and several child parts reuse the same DAC accumulator idea. First they read the 768 DAC bytes into 4-byte slots:
03b0: mov di,04f5h
03b3: mov cx,0300h
03b6: mov eax,0
03bc: rep stosd ; clear 768 accumulator slots
03c2: mov dx,03c7h
03c7: out dx,al ; DAC read index 0
03c8: add dx,2 ; now 03c9h
03cb: mov cx,0300h
03ce: in al,dx
03cf: mov es:[di+1],0
03d4: shl al,2
03d7: mov es:[di+2],al ; target delta in high byte scale
03db: add di,4
A fade step subtracts or adds the target delta and outputs the high byte:
03ff: mov ax,es:[di]
0402: add ax,es:[di+2]
0406: mov es:[di],ax
0409: mov al,ah
040b: out dx,al
040c: add di,4
040f: loop 03ffh
This is a fixed-point palette ramp. The low byte accumulates fractional fade error, so the ramp is smoother than a plain integer decrement of 6-bit DAC values.
Part 1: Opening Text And SuperCube
The first child expands to a large raw load image. It allocates 0x4000
paragraphs, splits them into four 64 KB banks, enters Mode 13h, then uses
A000h directly:
0036: mov bx,4000h
0039: mov ah,48h
003b: int 21h
0041: mov cs:[1e7a],ax
0045: add ax,1000h
0048: mov cs:[1e74],ax
004c: add ax,1000h
004f: mov cs:[1edb],ax
0053: add ax,1000h
0056: mov cs:[1edd],ax
005a: mov ax,0013h
005d: int 10h
005f: mov word cs:[1e42],0a000h
The opening text is packed as bitmap glyphs and a compressed text stream. The glyph blitter draws a 32-line-high character cell, 32 bytes per line, using 32-bit copies inside real-mode code:
0283: mov ax,08deh
0286: mov ds,ax
028b: mov bx,cs:[1e40] ; character code
0290: sub bx,41h
0293: shl bx,1
0295: mov si,[bx+di] ; glyph pointer table
0297: add si,100eh
029b: mov ax,cs:[1e42]
029f: mov es,ax
02a1: mov di,cs:[1e44] ; screen offset
02a6: mov dx,0020h ; 32 rows
02a9: mov cx,0008h
02ac: rep movsd ; 8 dwords = 32 bytes per row
02af: add si,0120h
02b3: add di,0120h ; next screen row, 320-byte stride minus copied width
02b7: dec dx
02b8: jne 02a9h
Spaces are not skipped by a branchy special case; the blank path clears the
same 32x32 cell with rep stosd, so text layout stays mechanically identical
for all characters:
02ca: xor eax,eax
02cd: mov cx,0008h
02d0: rep stosd
02d3: add di,0120h
02d7: dec dx
02d8: jne 02cdh
The part contains the string block:
LASERDANCE PRESENTS THE SECOND ONE MAN PROJECT FOR WIRED MCMXCIV
INTRO COMPO CALLED ONCE THE ELEPHANT MAN SUPERCUBE BEAT THIS CASCADA
After the title pages, the same part switches to a small polygon engine for the
SuperCube. It sorts triangle vertices by Y, computes 16.16 edge slopes using
386 div ecx, builds two edge tables, then fills spans. The span setup stores
left/right X and interpolated shade into two temporary tables. This is the same
basic shape later reused by the cube part, but here there is an extra compare
before writing a pixel:
d19: mov dl,es:[di]
d1c: sub dl,ah
d1e: jae skip
d20: mov es:[di],ah
d23: add ax,bx
d25: inc di
d26: loop d19h
So the opening cube writes only when the new shade is stronger than the old byte. That gives a cheap additive/highlight feel without a true Z-buffer.
Part 2: Circular Plasma
PART2 is the circular plasma part. UNP reconstructs it to a 4,618-byte MZ; the
load image allocates one 64 KB work segment, enters Mode 13h, clears the work
area with rep stosd, then seeds a plasma field:
0018: mov bx,1000h
001b: mov ah,48h
001d: int 21h ; 64 KB work segment
0023: mov cs:[0712],ax
0027: mov ax,0013h
002a: int 10h
0031: mov es,ax
0036: xor eax,eax
003c: mov cx,4000h
003f: rep stosd ; clear 64 KB
The small string !plasdw.bin appears just after the exit path. It is not used
as a DOS file here; the code treats that area as data. The part seeds four
corners and recursively subdivides a 256x256-like byte field. The random
generator is a tiny linear congruential step:
0465: mov ax,cs:[072a]
0469: mov dx,8405h
046c: mul dx
046e: inc ax
046f: add ax,di
0471: add ax,si
0473: mov cs:[072a],ax
The midpoint routine samples three neighbors, adds a scaled random term, clamps
to 1..255, and writes the new byte:
0497: call random
049e: sub bx,[bp+10h]
04a1: add bx,[bp+06h]
04a4: sub bx,[bp+0eh]
04a7: shl bx,2
04aa: imul bx ; random displacement
04bc: mov al,es:[bx] ; neighbor sample
04bf: add dx,ax
04cf: mov al,es:[bx] ; second neighbor sample
04d2: add ax,dx
04d4: shr ax,1
04d6: cmp ax,0001h
04db: mov ax,0001h ; clamp low
04de: cmp ax,00ffh
04e3: mov ax,00ffh ; clamp high
04f2: mov es:[bx],al
The recursive splitter stops when the rectangle is smaller than two pixels in both axes:
04fd: mov ax,[bp+06h]
0500: sub ax,[bp+0ah]
0503: cmp ax,0002h
0508: mov ax,[bp+04h]
050b: sub ax,[bp+08h]
050e: cmp ax,0002h
0513: jmp done
The display blitter samples an 80x100 source grid and doubles each source byte into two horizontal pixels:
02a0: mov ax,0a000h
02a3: mov es,ax
02a5: xor di,di
02a8: mov bh,cs:[0715] ; Y phase
02ad: mov dx,0064h ; 100 rows
02b0: mov bl,cs:[0714] ; X phase
02b5: mov cx,0050h ; 80 samples per row
02b8: mov al,[bx]
02ba: mov ah,al
02bc: inc bl
02be: ror eax,16
02c2: mov al,[bx]
02c4: mov ah,al
02c6: inc bl
02c8: ror eax,16
02cc: mov es:[di],eax ; four screen pixels from two samples
02d0: add di,4
02d3: loop 02b8h
02d5: inc bh
02d7: dec dx
02d8: jne 02b0h
The circular motion comes from two phase bytes generated through sine/cosine tables:
0067: mov bx,cs:[0728]
006c: mov ax,cs:[0724]
0070: imul word cs:[bx+0d0ah]
0075: shrd ax,dx,8
0079: mov cs:[0714],al
0082: mov ax,cs:[0724]
0086: imul word cs:[bx+0a3ah]
008b: shrd ax,dx,8
008f: mov cs:[0715],al
Palette rotation is done by shifting a 765-byte RGB palette block by three
bytes. The current first DWORD is saved, the rest moves down with rep movsd,
then the saved bytes are appended:
0446: mov si,0738h
0449: mov eax,[si]
044c: mov di,si
044e: add si,3
0451: mov cx,00beh
0454: rep movsd
0457: movsw
0458: stosd
045a: dec word cs:[0736]
045f: jne 0437h
This is why the part can feel intense on a fast machine: the image is a small sampled field, but the palette and sample phase move every frame.
Parts 3 And 5: Image Bridges
PART3 and PART5 are not effect engines. They are compact display programs
for pre-rendered or packed image material. Both enter video mode 11h, set DAC
entry 0 to white or black, then copy chunks from their load image to A000h
with 32-bit string moves:
0000: mov ax,0011h
0003: int 10h
0011: mov ax,000ch
0014: mov ds,ax
0019: mov ax,0a000h
001c: mov es,ax
001e: xor di,di
0021: mov cx,076ch
0024: rep movsd
Between chunks they wait for vertical blank and run a small one-entry palette ramp:
006c: pusha
006d: mov byte cs:[00b9],3eh
0076: mov dx,03c8h
0079: mov al,cs:[00ba]
007d: out dx,al
007e: inc dx
007f: mov al,cs:[00b9]
0083: out dx,al
0084: out dx,al
0085: out dx,al
0086: sub byte cs:[00b9],1
008c: cmp byte cs:[00b9],0ffh
0092: jne 0073h
The important point is structural: the intro alternates real-time parts with very small image-show programs. The large outer executable keeps those images packed until needed.
Part 4: Shaded / Smoky Cube
PART4 is the cube part mentioned in the NFO. It allocates two 64 KB work
segments, enters Mode 13h, clears the first buffer, installs a timer hook, and
runs a transform/raster/copy loop:
0016: mov bx,2000h
0019: mov ah,48h
001b: int 21h ; 128 KB
001f: mov cs:[1054],ax ; frame/work segment
0023: add ax,1000h
0026: mov cs:[104e],ax ; edge-table segment
002a: mov ax,0013h
002d: int 10h
002f: call setup
0032: call install_timer
0035: call clear_work
0038: call palette
003b: call capture_palette
003e: call main_cube
0041: call copy_to_a000
0044: call restore_timer
The vertex transform is fixed-point and table-driven. Sine and cosine tables
live near 45cfh and 489fh. The code rotates pairs of coordinates with
imul and shrd, using 14 fractional bits:
0a3c: mov ax,cs:[bx+489fh] ; cos
0a41: imul bp
0a43: shrd ax,dx,0eh
0a47: mov cs:[di+02h],ax
0a4f: mov ax,cs:[bx+45cfh] ; sin
0a54: imul bp
0a56: shrd ax,dx,0eh
0a5a: sub cs:[di+02h],ax
Projection uses a fixed distance of 0x1388 and a global scale word at
1029h:
0b38: mov ax,cs:[di]
0b3b: mov bx,0266h
0b3e: imul bx
0b40: shrd ax,dx,9
0b44: imul word cs:[1029h]
0b49: mov bx,1388h
0b4c: sub bx,cs:[di+04h]
0b50: idiv bx
0b52: mov cs:[di],ax
Triangle setup sorts vertices by Y, classifies the triangle shape, and computes 16.16 X slopes with 386 division:
03d1: mov ax,cs:[1037]
03d5: sub ax,cs:[102b]
03e4: shl eax,16
03e8: mov cx,cs:[1039]
03ed: sub cx,cs:[102d]
03f2: div ecx
03f5: inc eax
03f7: mov cs:[1044],eax
The edge-table writer stores X values as words while accumulating a 16.16
position in EDX:
0527: mov eax,edx
052a: shr eax,16
052e: stosw
052f: add di,2
0532: add edx,ebx
0535: loop 0527h
Then a second table stores shade or texture-gradient data for each scanline:
0723: mov ah,0
0725: mov dx,cs:[102f]
072a: shl dx,8
072d: mov bx,cs:[1058]
0732: mov al,dh
0734: stosw
0735: add dx,bx
073a: loop 0732h
The hot span filler reads a left/right edge pair and a shade step, then emits
four pixels per loop using EDX as a byte pack:
0860: mov di,[si] ; left X plus row base
0867: mov cx,[si+2]
086a: sub cx,[si] ; span length
086d: mov ax,ds:[bp+0] ; shade start
0871: shl ax,8
0874: mov bx,ds:[bp+2] ; shade step
0878: add ah,cs:[109c] ; global brightness
08a2: mov dl,ah
08a4: add ax,bx
08a6: mov dh,ah
08a8: add ax,bx
08aa: ror edx,16
08ae: mov dl,ah
08b0: add ax,bx
08b2: mov dh,ah
08b4: add ax,bx
08b6: ror edx,16
08ba: mov es:[di],edx
08be: add di,4
08c1: loop 08a2h
The "smoky" look is a separate blur/decay pass over the work buffer. It averages nearby horizontal bytes in pairs, subtracts a small decay amount, clamps at zero, and writes four output bytes at a time:
0dd3: mov bl,es:[bp+di-1]
0dd7: mov bh,es:[bp+di+1]
0ddb: shr bl,1
0ddd: shr bh,1
0ddf: add bl,bh
0de1: sub bl,dh
0de3: jae keep0
0de5: xor bl,bl
0de7: mov al,bl
...
0e2e: ror eax,16
0e32: mov es:[di],eax
0e36: add di,4
0e39: loop 0dd3h
This is not mathematically real Phong shading. It is a smart 1994 real-mode approximation: an interpolated shade polygon plus a decaying blur trail, with a palette chosen to make the result read as a shiny smoky object.
Part 6: Final Maze / Texture Mapper
PART6 is the largest child. The packed block is 16,245 bytes; UNP expands it
to a 186,028-byte MZ, with a 185,948-byte load image. It allocates about
190 KB, enters Mode 13h, sets up two 32 KB-ish buffers and several lookup
segments, then installs its own INT 8 tick routine.
Startup:
0016: mov bx,0be8h
0019: mov ah,48h
001b: int 21h
001f: mov cs:[1b60],ax
0023: add ax,0800h
0026: mov cs:[1b62],ax
002a: mov word cs:[1b43],0368h
0031: mov word cs:[1b45],1d68h
0038: mov word cs:[1b47],0fe8h
003f: mov word cs:[1b49],1b28h
0046: mov ax,0013h
0049: int 10h
004b: call install_timer
004e: call upload_palette
0051: call build_distance_table
0054: call main_maze
The first transform loop handles 70 coordinate records (0x46) and uses sine
tables at 2bb0h and 2e80h. Again the math is fixed-point with imul and
shrd:
01c1: mov si,3450h
01c4: mov di,1cach
01c7: mov cx,0046h
01ca: mov bx,cs:[1b36] ; angle
01cf: mov ax,cs:[si]
01d2: imul word cs:[bx+2e80h]
01d7: shrd ax,dx,7
01db: mov cs:[di],ax
01de: mov ax,cs:[si+2]
01e2: imul word cs:[bx+2bb0h]
01e7: shrd ax,dx,7
01eb: sub cs:[di],ax
The screen copy at 0260h reveals a 160x100-ish low-resolution buffer expanded
to 320x200. For each source byte it writes the same value to a vertical column
of many rows. It clears or stamps a 160-byte source strip and then doubles both
axes while copying to A000h:
03c5: mov ax,cs:[1b60]
03c9: mov ds,ax
03cb: mov ax,0a000h
03ce: mov es,ax
03d6: mov cx,1f40h
03d9: lodsd
03db: mov bl,ah
03dd: mov bh,bl
03df: ror ebx,16
03e3: mov bl,al
03e5: mov bh,bl
03e7: mov es:[di],ebx
03eb: ror eax,16
03ef: mov bl,ah
03f1: mov bh,bl
03f3: ror ebx,16
03f7: mov bl,al
03f9: mov bh,bl
03fb: mov es:[di+4],ebx
0400: add di,8
0403: loop 03d9h
The maze renderer at 0409h is the most interesting code in the intro. It uses
FS and GS as texture/lookup planes and keeps two packed values in 32-bit
register halves. At the top of each column group it tests signs and patches
three later instructions:
044f: mov bx,05afh
0452: mov word cs:[bx],032eh ; encode add form
045f: mov bx,1848h
0462: mov word cs:[bx],032eh
046d: mov bx,0518h
0470: mov word cs:[bx],9090h ; remove neg ax
...
0477: mov bx,05afh
047a: mov word cs:[bx],2b2eh ; encode subtract form
0487: mov bx,1848h
048a: mov word cs:[bx],2b2eh
0495: mov bx,0518h
0498: mov word cs:[bx],d8f7h ; encode neg ax
That is real self-modifying code. Instead of carrying a sign branch inside the inner loop, the part edits opcodes before drawing a wall slice.
The hot path renders 160 columns (0xA0) from a ray/grid state. It computes a
texture index from two fixed-point accumulators:
057b: mov bx,cx
057d: shr bx,0bh
0580: mov ax,dx
0582: and ax,0f800h
0585: shr ax,6
0588: or bx,ax ; texture offset
058a: mov al,[bx+si] ; texture sample
058c: add al,cs:[1b5d] ; light/ramp bias
0591: mov es:[di],al
Then it uses the upper half of ESI as a second texture base and the upper half
of EDI as a second screen pointer. The pair of ror ...,16 instructions is
not decorative; it swaps between the two packed lanes:
0594: ror esi,16
0598: mov al,gs:[bx+si]
059b: ror esi,16
059f: add al,cs:[1b5d]
05a4: ror edi,16
05a8: mov es:[di],al
05ab: ror edi,16
Each column step advances the fixed-point ray:
05af: add cx,cs:[1b51] ; may be patched to sub form
05b4: jb boundary_x
05b6: add dx,cs:[1b53] ; may be patched to sub form
05bb: jb boundary_y
05bd: inc bp ; mark/visibility pointer
05be: add edi,00010001h ; advance both packed screen pointers
05c5: dec word cs:[1b4f] ; 160 columns
05ca: jne 0574h
When a ray crosses a cell boundary, the renderer updates the packed grid pointer
and refreshes the texture base from FS:
05d3: mov bx,cs:[1b4b]
05d8: add bl,cs:[1b4d] ; X step, sign set by patch phase
05dd: mov cs:[1b4b],bx
05e2: mov al,fs:[bx]
05e5: mov cs:[1b6a],al
05f0: shl ax,0ah
05f3: mov si,ax
05f5: ror esi,16
05f9: mov al,fs:[bx-8000h]
05fe: shl ax,0ah
0601: mov si,ax
0603: ror esi,16
For near wall hits it jumps into a huge unrolled vertical writer. The code selects a jump target from the current slice height:
073f: mov ax,cs:[1b59]
0743: neg ax
0745: mov bx,ax
0747: shl ax,2
074a: add bx,ax
074c: add bx,0b4bh
0750: mov al,0b0h
0752: cmp byte cs:[1b6a],04h
0758: jl 075ch
075a: mov al,0e0h
075c: add al,cs:[1b5d]
0761: jmp bx
The target table is a long run of direct stores spaced by 0xA0 bytes, matching
the 160-byte low-resolution row stride:
0763: mov es:[di-7c60h],al
0768: mov es:[di-7bc0h],al
076d: mov es:[di-7b20h],al
0772: mov es:[di-7a80h],al
...
0b41: mov es:[di-00a0h],al
0b48: mov es:[di],al
For textured wall columns, the unrolled path changes from constant color to
repeated texture sampling. It obtains a vertical texture step from a table at
1f04h, packs the current shade in BL, uses CH as the fractional high byte,
and writes one screen row per unrolled block:
0bae: mov dx,cs:[bx] ; vertical texture step
0bb1: mov cx,0000h
0bb4: mov bl,al
0bbc: neg ax
0bbf: add ax,1844h
0bc2: jmp ax ; choose height-specific entry
0bc4: mov bh,ch
0bc6: mov al,[bx]
0bc8: add al,cs:[1b5d]
0bcd: mov es:[di-7c60h],al
0bd2: add cx,dx
0bd4: mov bh,ch
0bd6: mov al,[bx]
0bd8: add al,cs:[1b5d]
0bdd: mov es:[di-7bc0h],al
That is the classic inner loop of this production: no multiply or divide inside the wall draw, no per-pixel row multiplication, and almost no conditional logic inside the unrolled vertical run. The expensive setup happens before the jump; the draw path is a chain of indexed texture reads and fixed-offset stores.
Part 7 And Tail
PART7 and the tail part return to display duties. PART7 uses video mode
11h, copies three image blocks to A000h, and fades a single DAC entry:
0000: mov ax,0011h
0003: int 10h
0011: mov ax,096dh
0014: mov ds,ax
0019: mov ax,0a000h
001c: mov es,ax
0021: mov cx,2580h
0024: rep movsd
The fade waits for vertical blank and decrements a DAC gray level from 3Eh
down to zero:
0087: mov dx,03c8h
008a: mov al,cs:[00cb]
008e: out dx,al
008f: inc dx
0090: mov al,cs:[00ca]
0094: out dx,al
0095: out dx,al
0096: out dx,al
0097: sub byte cs:[00ca],1
009d: cmp byte cs:[00ca],0ffh
00a3: jne 0084h
The small COM tail contains final text/audio handling and another AdLib player reference. Structurally, it is the closing card rather than a new heavy effect.
What The Code Is Really Doing
Once is fancy less because it has one perfect engine and more because it uses
an aggressive part-chain architecture:
- The main 64K file is a self-reading PKLITE container.
- Each scene is its own compressed MZ/COM program.
- The main loader schedules music and fades, then runs the child programs as temporary files.
- Several child programs are pure image bridges, so pre-rendered 3D Studio text does not pollute the real-time effect code.
- Real-time parts lean hard on 386 instructions in 16-bit real mode:
rep movsd, 32-bit accumulators,shrd,ror reg,16,div ecx,FS, andGS. - The final maze part is carefully tuned around precomputed tables and self-modified sign code, with a giant unrolled wall-column writer.
The NFO's claim about the final maze using "self modifying code" is not hype.
The maze module literally edits opcode words at offsets like 0518h, 05afh,
0712h, 1848h, and 1851h before entering the hot wall routine. That is the
piece of code most worth preserving from this intro: it is a compact real-mode
texture mapper built out of precomputed tables, packed 32-bit register lanes,
and height-specific jump targets.