Analysis model: gpt-5.5 xhigh
Hex Appeal by Cascada Demo Section - Technical Dissection
Scope
This is a reverse-engineering and direct-runtime pass over Hex Appeal by Cascada Demo Section. It is a 1993 MS-DOS VGA demo, released outside the Assembly 1993 competition after the group missed the deadline. Public metadata is available from Demozoo, Pouet, and the scene.org/Hornet file entry.
This is not a source-level reconstruction. The archive was unpacked, the main executable was carved into its embedded MZ programs, and selected DOS, VGA, XMS, and inner-loop code was disassembled. A complete silent run of that exact archive now supplies the visual sequence. Where a part role is derived from strings or the release document instead of fully traced code, I mark it as inferred.
Archive
The archive used here was appeal.zip from the Hornet mirror path:
https://archive.scene.org/pub/mirrors/hornet/demos/1993/a/appeal.zip
Archive and extracted-file hashes:
| File | Size | SHA-256 |
|---|---|---|
appeal.zip |
346,742 | cd9b6f995d75bd3cdb4eb7bda64d8b9f128b0ef0468d4158effe0b0976e6e9f6 |
appeal.doc |
13,191 | ca3909a5f018b97781c3c0ba769b7edc8d75005f8d6ee4796748b4996f66c859 |
appeal.exe |
1,188,635 | 3b8a46e730ab0cdbad61f6f2016daae26a384dc42a56c7d8f30c5cc39e197087 |
file_id.diz |
127 | 6155acf9e85899265ae3f8a7538f17ba93336cca2263eedb5a88b0fdeac43a02 |
uman.com |
1,455 | 5ee15f6f65cdcd39644d6fe5353c7b585fd9f5441baadd779c6f0be78ac03dda |
file_id.diz only identifies the release as a new Cascada Demo Section
production. The release document gives the official release date as
2 September 1993, says the demo was intended for Assembly 1993, and explains
that it was released after the deadline miss instead of being held back.
The documented requirements are a 386-compatible machine, VGA, and preferably a Gravis Ultrasound, Sound Blaster, or SoundPlayer-style D/A output. The document also explicitly warns that a fast 486 is the sensible target. That matches what the code does: this is a real-mode DOS program that uses 386 instructions, protected-mode transitions, XMS, direct VGA programming, and carefully unrolled pixel loops.
Complete Direct Silent Run
The animations below come directly from a complete DOSBox-X run of the
authenticated appeal.exe, not from a video upload or a recreated effect. The
emulated target was a 486-class machine with 16 MB RAM, XMS enabled, EMS
disabled, and 50,000 fixed cycles. The demo's own setup program was used to
select its native Silent option. The host also used a dummy audio driver, so
no sound was played.
The recorded demo path begins after setup and reaches its natural return to DOS without skipped parts or manual part advancement. It lasts about 5 minutes 44 seconds, from the opening text to the end of the long slimy panner. The capture was continuous; these GIFs are short windows from that run.

The opening starts with blurred, deforming magenta text and then resolves to the metallic title. The separate Cascada logo assembles over the first particle-field material:


The central sequence changes visual systems rather than merely changing the same object's phase. It moves through a full-screen illustrated picture and then into texture-mapped 3D:




The final child executable is visually unmistakable: marble tiles bend beneath extruded orange-and-silver text for an extended end message.

This runtime sequence also sharpens the executable map. Chunk 2 contains the opening/title material; chunks 3 and 4 cover the particle/line, morph, picture, and transition material; chunk 5 is the texture-mapped 3D section; and chunk 6 is the marble-backed slimy panner. The remaining uncertainty is inside the middle two chunks: their exact internal routine boundaries have not yet been traced instruction by instruction.
Credits From The Release
The release document credits Cascada for design and gives the following technical split:
| Area | Credit |
|---|---|
| Setup | Jeffe |
| Setup graphics | Mirage |
| Intro blur | Robban |
| Intro font | Delsion |
| Hex Appeal logo | O'Hara |
| Stardriver | Hellraiser |
| Cubes | Hellraiser |
| Cube logo | Delsion |
| IFS and morphs | Hellraiser |
| Eevi picture | Delsion |
| Texture code | Iceman |
| Texture pictures | O'Hara |
| Slimy panner | Iceman |
| Slimy font and marble | O'Hara |
| Soundtrack | Zodiak |
| Music system | Robban |
| Linking/debugging | Robban |
The old contact details in the document are intentionally omitted here.
Top-Level Executable Layout
appeal.exe presents as one DOS MZ executable, but its on-disk layout is more
interesting. The first MZ image is a loader/runtime. It is followed by six more
complete MZ executables and then a 6-channel FastTracker module.
The first MZ header says the outer program is only 0xf95c bytes long:
e_magic = MZ
e_cblp = 0x015c
e_cp = 0x007d
e_crlc = 54
e_cparhdr = 0x20 ; 512-byte header
entry = 0040:01ee
ss:sp = 0000:0400
The DOS executable size formula gives:
size = (e_cp - 1) * 512 + e_cblp; // 0xf95c bytes
The actual file is 1,188,635 bytes, so nearly all of the file is appended content. Carving by consecutive MZ headers gives this structure:
| Chunk | File offset | Size | Entry | Stack | Role |
|---|---|---|---|---|---|
| 0 | 0x00000 |
0x0f95c |
0040:01ee |
0000:0400 |
loader, XMS manager, part runner, shared tables |
| 1 | 0x0f95c |
0x03510 |
0000:16e5 |
1106:4000 |
setup/options executable, inferred from Borland runtime and mouse strings |
| 2 | 0x12e6c |
0x14a43 |
0c48:14c7 |
0000:0100 |
intro/logo/font data, inferred |
| 3 | 0x278af |
0x225f0 |
0000:0000 |
222f:0100 |
large visual part, likely IFS/morph/cube data, inferred |
| 4 | 0x49e9f |
0x1e58c |
1a43:0000 |
0000:0100 |
graphics-heavy part, includes RIX3 image signatures, inferred |
| 5 | 0x6842b |
0x3bd10 |
0403:0000 |
3bb1:0300 |
texture/cube/VGA-specific part, confirmed by strings and projection code |
| 6 | 0xa413b |
0x0e0b8 |
0000:0000 |
0dec:0100 |
ending slimy writer/panner, confirmed |
| tail | 0xb21f3 |
0x70128 |
n/a | n/a | 6-channel FastTracker module |
This is not a normal linker overlay. Each child is a valid DOS executable with its own header and relocation table. The loader scans them, moves them to XMS, then copies and relocates each part into conventional memory when it is time to run it.
The Loader
The loader in chunk 0 is the real organizer of the demo. It performs:
- DOS memory resizing and largest-block checks.
- V86/protected-mode rejection.
- XMS entry discovery and allocation.
- A20/protected-mode helper setup.
- Scanning of the chained MZ programs.
- Copying of child executables into locked XMS memory.
- Per-part conventional-memory loading, relocation, execution, and return.
- A small shared interrupt/service surface, including
int 21hexit capture andint 80hcalls used by the parts.
Environment And Memory Checks
The loader starts by saving the PIC masks from ports 0x21 and 0xa1, then
shrinks its own DOS allocation with int 21h, AH=4Ah. It checks whether the CPU
is already in protected/V86 mode via smsw; if so, it prints the v86-mode
error string and exits. That is why the document tells the user to remove
expanded-memory managers such as EMM386 or QEMM.
It then checks DOS conventional memory by requesting the largest possible block with:
mov ah, 48h
mov bx, ffffh
int 21h
For XMS it uses the standard multiplex entry:
mov ax, 4300h
int 2fh ; XMS installed?
mov ax, 4310h
int 2fh ; get XMS entry point in ES:BX
The XMS manager calls that matter are:
| XMS AH | Meaning | Loader use |
|---|---|---|
08h |
query free extended memory | requires at least 0x02bc KB, i.e. 700 KB |
09h |
allocate extended-memory block | stores the XMS handle |
0ch |
lock extended-memory block | stores a linear base address |
The important point is that the loader does not stream the whole demo from disk part by part. It front-loads the embedded executable images into XMS, then stages them into conventional memory as runnable child programs.
Chained-MZ Scanner
The scanner begins around chunk 0 offset 0x08c4. It reads seven DOS MZ
headers, one after another, and computes the byte length of each image directly
from the header page fields.
Relevant disassembly:
08c4 mov bp,0007h ; seven MZ images
08c7 mov bx,013ch ; output table
08ca mov dx,018ch ; temporary header buffer
08cd mov cx,001ch ; read 28-byte MZ fixed header
08d0 call read_exact
08d3 mov cx,0200h
08d6 mov ax,cs:[0190h] ; e_cp from header buffer
08da dec ax
08db mul cx
08df add dx,cs:[018eh] ; add e_cblp
08e4 adc cx,0000h
08e7 mov cs:[bx],dx ; store size low
08ea mov cs:[bx+2],cx ; store size high
08ee sub dx,001ch ; already consumed header bytes
08f1 sbb cx,0000h
08f4 mov al,01h
08f6 call seek_relative
08f9 add bx,0008h
08fc dec bp
08fd jne 08ca
The scanner deliberately stores 8-byte table entries even though each size fits within 20 bits here. Later passes overwrite or extend entries with the XMS linear address and the staged size delta. This table becomes the loader's manifest of runnable parts.
In C-like form:
for (int i = 0; i < 7; i++) {
read(fd, &mz, 28);
uint32_t size = (mz.e_cp - 1) * 512u + mz.e_cblp;
table[i].disk_size = size;
lseek(fd, size - 28, SEEK_CUR);
}
XMS Staging Loop
After the scan, the loader rewinds and allocates a 64 KB conventional-memory bounce buffer. It then skips table entry 0 and processes six child programs. For each child:
- Seek to the child image.
- Read up to 64 KB into the bounce buffer.
- Copy that block to the locked XMS linear destination.
- Repeat until the full child image is stored.
- Align the destination to the next paragraph boundary.
- Replace the table entry with the XMS location and staged size.
The copy uses operand-size/address-size-prefixed instructions, so it is 32-bit
copying while still hosted by a real-mode DOS program. The loader has helper
code that briefly enters protected mode, loads descriptors, copies to the XMS
linear address, and returns to real mode. The code around 0x0fab reads and
patches descriptor values; the code around 0x1041 performs the lgdt,
sets CR0 PE, loads segment registers, then clears PE again.
This is one of the more interesting engineering decisions in the demo. XMS provides storage, but locked XMS gives a linear physical address. Real mode cannot normally address arbitrary linear memory, so the loader uses a tiny protected-mode window as a copy engine instead of depending on slower XMS move calls for every transfer.
A20 Handling
The helper at roughly 0x1010 uses the keyboard controller ports 0x64 and
0x60. This is the classic A20 path. The loader needs A20 open because XMS
linear addresses above 1 MB are meaningless if address line 20 is still wrapped.
The practical sequence is:
wait for keyboard controller input buffer clear
send command through 0x64
write output-port value through 0x60
wait again
The exact implementation is terse, but its role is clear from the ports and from the nearby protected-mode/XMS access code.
Running A Child EXE
The loader does not simply jump to a child image as raw code. It reconstructs a normal DOS EXE load:
- Allocate a conventional block large enough for the selected child.
- Copy the child image from XMS into that block.
- Read the child's relocation table.
- Add the load segment to every relocation target.
- Build the child's stack from
e_ss:e_sp. - Build the child's entry point from
e_cs:e_ip. retfinto the child.
That means the individual parts can be compiled and linked as ordinary EXE programs while still behaving like a chained multi-part demo.
Capturing Part Exit
The clever detail is the int 21h hook around chunk 0 offset 0x0995. Child
programs exit by calling DOS function AH=4Ch. The hook intercepts that exit,
stores the return code, unwinds the interrupt frame, and jumps back to a
continuation address owned by the loader instead of allowing DOS to end the
whole process.
Conceptually:
void int21_hook(Frame *f) {
if (AH == 0x4c) {
loader.last_return_code = AL;
restore_loader_stack();
jump(loader.continuation);
}
chain_to_old_int21();
}
This explains why the parts can be separate MZ executables yet still behave as one continuous demo. Each part is allowed to "terminate"; the loader catches the termination and starts the next part.
int 80h
Several parts call int 80h with small service numbers. Chunk 6, for example,
installs a frame callback and uses services around 0x19, 0x1a, and 0x1b
for timing or shared runtime coordination. Chunk 5 calls int 80h before
switching display mode. I did not fully map the dispatch table, so I am not
claiming exact names for all services.
The safe interpretation is: int 80h is Hex Appeal's shared demo runtime
interface. It appears to cover timing, music/runtime callbacks, and part
coordination.
Music Tail
The final 459,048 bytes are a 6-channel FastTracker module. The file command identifies it as 6-channel FastTracker data, and the module signature at offset 1080 is:
6CHN
The module title is libertine, and the embedded sample names credit Zodiak
and identify it as the Hex Appeal demo tune. The tail is therefore not a random
data blob. It is the demo soundtrack appended directly after the child EXE
chain.
Chunk 0 also contains the text signatures:
M.K. FLT4 6CHN 8CHN OCTA
Those are module-format identifiers, not another embedded module. They are most likely part of Robban's module loader/player format detection.
Part Inventory
Chunk 0: Loader And Runtime
Confirmed by code:
- Parses seven MZ headers.
- Requires XMS.
- Uses A20/protected-mode helper code.
- Loads child executables into XMS.
- Reconstructs child EXE loads in conventional memory.
- Hooks
int 21hto trap child exits. - Exposes or participates in the shared
int 80hservice surface. - Contains palette/gradient tables and module signature strings.
Chunk 1: Setup
Confirmed strings include a Borland runtime signature, a mouse-driver warning,
and APPEAL.EXE. This is almost certainly the setup executable credited to
Jeffe, with setup graphics credited to Mirage.
This part looks Pascal/Borland-derived rather than hand-tuned assembler. That fits a configuration UI: choose sound device, sample rate, interpolation, and similar runtime options, then return to the loader.
Chunk 2: Intro/Logo, Inferred
This chunk contains visible text and graphic/font-looking data, including a
CASCADA string. The release credits list an intro blur, intro font, and Hex
Appeal logo. I did not fully trace the renderer, so this part is best described
as an intro/logo candidate rather than a confirmed implementation.
Chunk 3: Large Visual Part, Inferred
Chunk 3 is data-heavy and contains large patterned tables. It likely covers one or more of the Hellraiser visual sections, such as IFS, morphs, or cube effects, but the static evidence is not enough to assign a specific named effect with confidence.
Chunk 4: Graphics-Heavy Part, Inferred
Chunk 4 contains RIX3 signatures, suggesting bundled ColoRIX-style image
data. The release credits mention the Eevi picture and multiple graphic assets.
The role is graphics-heavy, but the exact scene mapping remains unresolved.
Chunk 5: Texture/Cube/VGA-Specific Part
This part is much firmer:
- It contains the visible text
HEX APPEAL BY CASCADA. - It contains the VGA chipset-support message.
- It switches to BIOS mode
13h, then immediately reprograms VGA CRTC registers. - It contains perspective projection code near
0xc734.
The chipset message lists AHEAD, ATI VGA, Chips & Tech, Everex, Oak, Genoa,
NCR, Paradise, Trident, and Tseng variants. That is a strong hint that the part
depends on VGA behavior beyond plain BIOS mode 13h. The code also writes VGA
CRTC indexes through ports 0x3d4/0x3d5, including the unlock of register
0x11.
Chunk 6: Ending Slimy Writer/Panner
This part is confirmed by strings and code. The end text explicitly calls the writer slimy and credits the scroll to Iceman. Its code includes:
- Conventional-memory allocation for a large work buffer.
- Palette upload and palette fade loops.
- Text preprocessing into a centered token stream.
- Two text drawing passes.
- Sine-table pointer generation.
- A self-patched/unrolled panning renderer that writes directly to segment
A000h.
This is the most completely understandable part of the binary in this pass, so the next sections go into its inner loops in detail.
Chunk 6 Startup
Chunk 6 starts as a normal MZ child with entry 0000:0000 after the 512-byte
header. It first resizes its own memory block and allocates another block:
mov ah,4ah
mov bx,0e29h
int 21h
mov ah,48h
mov bx,36b1h
int 21h
mov cs:[39a6h],ax
The allocation is 0x36b1 paragraphs, roughly 0x36b10 bytes. It then clears
a large part of that memory:
xor eax,eax
mov ecx,0000dac0h
rep stosd
0xdac0 DWORDs is 0x36b00 bytes. In other words, the part allocates a
dedicated work segment, clears it, and keeps its segment value in cs:39a6.
After that it:
- Calls the text preprocessor at
0x35b2. - Uploads palettes via DAC ports
0x3c8/0x3c9. - Builds a repeated background/text plane using 50-byte row spans.
- Registers or updates a frame callback through
int 80h. - Enters its frame/timing loop.
The key constants in this part are not random:
| Constant | Meaning in context |
|---|---|
0x190 |
400 decimal, used as logical row width/centering width |
0x0c8 |
200 decimal, used as row count |
0x032 |
50 bytes, repeated row strip width |
0x258 |
600 decimal, one glyph: 24 columns by 25 rows |
0x018 |
24 decimal, one glyph row width |
0x834 |
wrap span for a source/tile plane |
The renderer therefore works in a 400 by 200-ish logical space even though the final visible output is written through VGA memory. The part appears to use a tweaked VGA layout rather than only plain 320x200 mode 13h semantics.
Chunk 6 Palette Fade
The fade code around 0x04bc scales a source palette into a working palette.
The destination is then sent to the DAC.
The repeated instruction body is:
mov bx,cs:[3980h] ; fade factor
mov si,2040h ; source palette
mov di,1d40h ; faded palette
lodsb
mul bl
shr ax,06h
stosb
This body is unrolled many times. Conceptually it is:
uint8_t fade = state.fade; // expected range: 0..64
for (int i = 0; i < 768; i++) {
faded_palette[i] = (base_palette[i] * fade) >> 6;
}
outportb(0x3c8, 0);
outsb(0x3c9, faded_palette, 768);
The use of >> 6 is a clean fit for VGA DAC values, which are normally 6-bit
channels in the range 0..63. A fade factor of 64 reproduces the source palette;
0 gives black.
The loop is unrolled because this is per-frame work and the 386 loop
instruction plus branch overhead would be expensive relative to the tiny
operation. The code pays in bytes to avoid per-byte control flow.
Chunk 6 Text Preprocessor
The end scroller does not parse ASCII while drawing. It preprocesses the end text into a compact token stream at startup.
Relevant addresses:
| Address | Role |
|---|---|
0x1829 |
input text |
0x2344 |
output token stream |
0x3342 |
alphabet table |
0x3378 |
glyph-width table |
0x33ae |
current line/token pointer |
0x33b0 |
glyph count in current line |
Core disassembly:
35ba mov si,1829h
35bd mov di,2344h
35c0 lodsb
35c1 cmp al,0ffh
35c3 je 362a
35c5 cmp al,23h
35c7 jne 35d4
0xff ends the whole text. # is a control/literal token: the preprocessor
copies # and the following byte as a two-byte word.
For a normal printable character, it performs a linear search in the alphabet:
3615 mov bx,3341h
3618 inc bx
3619 cmp al,[bx]
361b jne 3618
361d sub bx,3342h
3621 mov ah,[bx+3378h] ; glyph width
3625 mov al,bl ; glyph index
3627 stosw
Each normal token is therefore:
struct GlyphToken {
uint8_t glyph_index;
uint8_t width;
};
A NUL byte ends a text line. At that point the preprocessor computes the line width and stores a centered-line header:
35d8 mov bx,[33aeh]
35dc add bx,0003h
35df mov cx,[33b0h]
35e3 xor ax,ax
35e6 add al,[bx] ; add width
35e8 adc ah,00h
35eb inc ax ; one-pixel gap
35ec add bx,0002h
35ef loop 35e6
35f1 mov cx,0190h ; 400-pixel line
35f4 sub cx,ax
35f6 shr cx,1
35f8 mov ch,[33b0h] ; high byte stores glyph count
3600 mov [bx],cx ; line header: x offset + count
In C-like form:
for each input line:
uint16_t width = 0;
for each glyph:
width += glyph.width + 1;
uint8_t x = (400 - width) / 2;
uint8_t count = glyph_count;
emit_line_header(x, count);
emit_glyph_tokens();
This is a good example of doing non-realtime work once. The frame renderer can later read a centered token stream without measuring text or finding glyphs.
Chunk 6 Background Tile/Scroll Update
The code around 0x3644..0x379b updates the textured background plane. The
pattern is a long run of 50-byte copies:
copy 0x19 words = 50 bytes
advance destination
advance source by 0x32
wrap at 0x834
repeat
There are two source bases separated by 0x834, and a phase flag at
cs:3442 chooses which side is active. The result is a horizontally narrow
strip source tiled over a larger logical plane. Since the later panner samples
through a sine-distorted pointer table, the visible effect is not just a flat
scroll; it is a warped texture/background feeding the final A000 write.
Chunk 6 Shadow/Depth Text Pass
The first text pass starts around 0x37a0. It reads a preprocessed line, adds
its x offset to the current destination pointer, then draws each glyph row.
Line setup:
37a0 mov edi,cs:[39a2h]
37a6 sub edi,4
37aa mov bx,cs:[3438h] ; current token-line pointer
37b2 mov cl,cs:[bx] ; x offset
37b5 add edi,ecx
37b8 mov dl,cs:[bx+1] ; glyph count
37bc add bx,2
For each glyph:
37c4 mov cx,cs:[bx]
37c7 cmp cl,23h ; skip # control tokens
37ca jne 37d1
37cc add bx,2
37cf jmp 37c4
37d1 and cx,00ffh
37d5 imul cx,cx,0258h ; glyph index * 600 bytes
37d9 mov si,cx
37db add si,cs:[343ah] ; current glyph row offset
37e0 mov ecx,18h ; 24 columns
Then comes an unrolled 24-pixel row. The repeated body is:
mov al,[esi]
and al,al
je skip
sub byte ptr es:[edi],20h
skip:
inc di
inc si
This pass does not write the glyph color. It subtracts 0x20 from the existing
destination pixel wherever the glyph mask is nonzero. Because the demo uses
palette-indexed VGA, subtracting a fixed palette offset is a cheap lighting or
depth trick. It changes the color class of background pixels under the text
without doing RGB math.
C-like equivalent:
uint8_t *dst = frame_base + line.x - 4;
for (int g = 0; g < line.count; g++) {
GlyphToken t = next_visible_token();
uint8_t *mask = glyphs + t.glyph_index * 600 + glyph_row;
for (int x = 0; x < 24; x++) {
if (mask[x] != 0) {
dst[x] -= 0x20;
}
}
dst += t.width + 1;
}
At the end of a glyph row, it advances by 24 bytes:
394a add word ptr cs:[343ah],0018h
3950 cmp word ptr cs:[343ah],0258h
When 0x258 is reached, the part has consumed 25 rows of 24 bytes. It advances
to the next preprocessed line or wraps back to the start.
Chunk 6 Foreground Text Pass
The next pass starts around 0x3992 and uses the same token structure, but it
writes glyph pixels instead of subtracting from the background.
The repeated body is similar but semantically different:
mov al,[esi]
and al,al
je skip
mov es:[edi],al
skip:
inc di
inc si
Equivalent:
for (int g = 0; g < line.count; g++) {
GlyphToken t = next_visible_token();
uint8_t *src = glyphs + t.glyph_index * 600 + glyph_row;
for (int x = 0; x < 24; x++) {
uint8_t p = src[x];
if (p != 0) {
dst[x] = p;
}
}
dst += t.width + 1;
}
The two passes together give the text a stronger presence:
- The shadow/depth pass modifies the underlying texture where the glyph will go.
- The foreground pass lays colored font pixels on top.
This is cheaper than compositing with per-pixel alpha. It also fits a palette demo: palette indices are intentionally organized so arithmetic offsets create useful shade bands.
Chunk 6 Sine-Based Panner
The panner starts around 0x3ba8. This is the visually distinctive part of the
ending: a warped, slimy texture/text surface is sampled through sine-derived
source pointers and written directly to VGA memory.
First it computes sine-scaled amplitudes:
3bb0 mov bx,[3994h]
3bb4 and bx,03feh
3bb8 mov ax,[bx+446ah] ; sine table
3bbc mov dx,cs:[3984h]
3bc1 imul dx
3bc3 mov [398ah],dx
3bc7 mov bx,[3996h]
3bcb and bx,03feh
3bcf mov ax,[bx+446ah]
3bd3 mov dx,cs:[3986h]
3bd8 imul dx
3bda mov [398ch],dx
Then it builds a pointer table at 0x3aa1. For each column pair, it samples
the sine table, multiplies by the current amplitude, converts the fixed-point
result into a row offset, multiplies by 0x190, and adds the base pointer:
3bf4 mov ecx,cs:[39a2h]
3bfa add ecx,00003ea8h
3c04 movsx eax,word ptr [bx+446ah]
3c11 movsx edx,word ptr cs:[398ch]
3c18 imul edx
3c1b mov ebp,eax
3c1e sar ebp,10h
3c22 imul ebp,ebp,0190h
3c29 add ebp,ecx
3c2e mov [di+3],ebp
The same body is repeated for the next sample, and di advances by 0x0f.
The result is a compact table of absolute source addresses used by the final
scanline renderer.
The visible renderer sets ES=A000h, DS to the allocated work segment, and
runs 200 rows:
3c6c push 0a000h
3c6f pop es
3c70 mov ax,cs:[39a6h]
3c74 mov ds,ax
3c84 mov cx,00c8h ; 200 rows
Per row it derives another sine offset:
3c88 and si,03feh
3c8c mov bx,cs:[si+446ah]
3c91 add si,0005h
3c94 mov ax,cs:[398ah]
3c98 imul bx
3c9a movsx ebx,dx
3c9e add ebx,ebp
Then comes the hot sampling loop. Static disassembly shows operands like:
mov al,[ebx+12345678h]
mov ah,[ebx+12345678h]
stosw
The repeated displacement 0x12345678 is not a real source address. It is a
placeholder in self-modified code. Earlier code builds or patches the pointer
table, and the unrolled sampler uses those patched displacements to sample
different warped source columns.
The effective inner loop is:
for (int y = 0; y < 200; y++) {
int row_wave = sine(phase_y) * amp_y;
uint8_t *dst = vga + y * visible_pitch;
for (int xpair = 0; xpair < visible_width / 2; xpair++) {
uint8_t a = *(uint8_t *)(patched_source_0[xpair] + row_wave);
uint8_t b = *(uint8_t *)(patched_source_1[xpair] + row_wave);
*(uint16_t *)dst = a | (b << 8);
dst += 2;
}
}
That is the classic trick: make the per-frame setup code more complex so the
per-pixel loop becomes almost branchless. The expensive sine, multiply, and
address construction happen outside the visible write loop or once per row. The
hot path is a stream of loads and stosw writes.
Chunk 5 VGA And Texture-Cube Evidence
Chunk 5 starts by interacting with the shared runtime, then switches to BIOS
mode 13h:
mov bx,001dh
int 80h
mov ax,0013h
int 10h
Immediately after mode setup, it reprograms VGA registers directly. The code
unlocks CRTC register 0x11, updates the miscellaneous output register through
0x3cc/0x3c2, and writes CRTC indexes such as 0x06, 0x07, 0x09, 0x10,
0x11, 0x15, and 0x16.
That supports the interpretation that the part uses a tweaked VGA timing or memory layout. The fallback/error text reinforces this: it says the demo only supports VGA cards based on a specific list of chipsets.
Screen-Region Clear
One low-level fill sequence around 0x49d7 repeatedly clears a clipped region:
mov di,12fch
mov cx,0064h
rep stosw
add di,0078h
0x64 words is 200 bytes; then the code skips 0x78 bytes. Repeating that
pattern clears a rectangular or banded area inside a larger pitch. It is not a
plain 64,000-byte mode-13h clear. This again points at a custom layout, viewport,
or split/tweaked VGA arrangement.
Perspective Projection Helper
The projection helper near 0xc734 is clear enough to name. It integrates
position deltas, then projects X and Y by dividing by Z-derived depths:
c734 mov ax,[072eh]
c737 add [071ch],ax ; x += dx
c73b mov ax,[0730h]
c73e add [0722h],ax ; y += dy
c742 mov ax,[0732h]
c745 add [0728h],ax ; z += dz
c749 mov bx,[0728h]
c74d mov dx,[0734h]
c751 shr dx,1
c753 add bx,dx
c755 mov ax,[071ch]
c758 imul dx
c75a idiv bx
c75c add ax,00a0h ; center x at 160
c75f mov [072ah],ax
c762 mov bx,[0728h]
c766 mov dx,[0734h]
c76a add bx,dx
c76c mov ax,[0722h]
c76f imul dx
c771 idiv bx
c773 add ax,00c8h ; center y at 200
c776 mov [072ch],ax
In C-like terms:
x += dx;
y += dy;
z += dz;
screen_x = (x * focal_half) / (z + focal_half) + 160;
screen_y = (y * focal) / (z + focal) + 200;
The different depth constants for X and Y are not a typo in this analysis; the
code uses focal / 2 in the first denominator path and full focal in the
second. That may be an aspect-ratio correction or simply how this part's
coordinate system was tuned.
This does not prove every texture-mapping span loop in chunk 5, but it does confirm that the part contains a real 3D projection path and not just flat image effects.
Why The Structure Matters
Hex Appeal is a good example of a 1993 DOS demo that sits between simple COM intros and later DOS extenders:
- It still runs as real-mode DOS child EXEs.
- It needs 386 instructions and XMS.
- It uses a custom loader rather than a general DOS extender.
- It briefly opens protected-mode access for linear memory copying.
- It treats VGA as hardware, not as a BIOS framebuffer.
- It compiles or links independent parts, then orchestrates them as one demo.
The result is practical. The team could develop separate parts as normal MZ executables, pack them behind a loader, cache them in XMS, and still use hand-tuned assembler where the frame budget demanded it.
Remaining Unknowns
The main unresolved areas are the internal renderer boundaries in chunks 2, 3, and 4. Their broad roles are now visible in the complete direct run and supported by strings, data shape, and the release credits, but I did not fully trace every renderer in this pass. A deeper follow-up would:
- Snapshot memory after each child load.
- Identify the
int 80hdispatch table and name its services. - Set part-level breakpoints to map the middle effects to exact code entry points.
- Trace chunk 5's texture filler beyond the projection helper.
- Trace chunks 2 through 4 far enough to separate the intro blur, IFS/morphs, multicube, and picture sections.
For the code that was traced, the strongest conclusions are the chained-MZ loader design, the XMS/protected-copy staging path, and the chunk 6 slimy panner/text renderer. Those are directly supported by disassembly rather than only by release-document labels.