Analysis model: gpt-5.5 xhigh

Dole / Darkzone by Rune - Technical Dissection

Scope

The Party 1994 result file lists the third-place PC fast intro as Darkzone by Rune:

PC FAST INTRO
     1     305      3  Weener                    P-Nut/Darkzone
     2     278      1  Banana Split              Hitech
     3     236      2  Darkzone                  Rune

The archive linked from Demozoo is dole.zip, the executable is DOLE.EXE, and the tiny FILE_ID.DIZ calls the production DOLE. I am therefore treating the competition entry as Dole / Darkzone: Darkzone is the result-list name, while Dole is the shipped archive name.

Release year: 1994.

Public references:

The analysis below is based on archive inspection, LE/PMODE-W parsing, static 386 disassembly, and direct inspection of the shipped image and music assets.

Examined Files

Archive:

057ccdd3738c736f6e875861914215b24fd4c8f12d9289c30a7d5323a60e7c11  dole.zip

Extracted files:

9aa53ffd62159ec96923ec9eb84d349838b1daaa7bc56e382a7b331b113a02be  DOLE.EXE
706ae4ac487261984efa33462c2a7ce5ab56e96d7b7781a8c48a55833c2b246d  DOLE.DAT
b16b08fb774d16dc90aa395520d4bda4344d92cf421c5e09e0a6666a8f481aec  DOLE.PAL
056bd8248bff8e05335e75fb6cc6bfc4c67904c7e6db62df384bcfc0f0faf4d9  DOLE1.BMP
f136bacede9b5a0e8bafa5f5e56d574283783c4854444b6da39b60c1cdafbc7b  DOLE2.BMP
82c0462cb19906b20d65060a9217a2205a248a82ff9643cface325a9667ddfb1  DOLE3.BMP
96b8a2aa1c83a6b823b8ce728a2ef634939b2d3b4d33329a49cf1e33f0bed996  DOLE4.BMP
f46e7ca207e7545ad48e930150bec777002e2468bc3969a274b397735284dee0  DOLE5.BMP
ef6e4de7737b0a7479c488c004ff2b9a7e9f681e80ccbe18e8b9e1f46e86812c  DOLE.CFG
1692b87093cba12809fc59a8bd9d0a9a45fdd4b38efdf7e5c3899d3ee7aa17ae  FILE_ID.DIZ
0fd9764f56d835e0f3dd6209737bce241881902e6aa3ead91f2d02ad9d34b1c0  scene.org.txt

File roles:

DOLE.EXE   114257 bytes   PMODE/W protected-mode executable
DOLE.DAT   143340 bytes   4-channel ProTracker module, title "trumpetare tekkno"
DOLE.PAL      768 bytes   256 VGA DAC entries
DOLE1.BMP   64008 bytes   raw 320x200 image
DOLE2.BMP    5901 bytes   two-frame sprite format
DOLE3.BMP   30088 bytes   raw 320x94 image
DOLE4.BMP    6528 bytes   raw 163x40 image
DOLE5.BMP     484 bytes   raw 28x17 image
DOLE.CFG       24 bytes   sound setup state

Despite the .BMP suffix, these are not Windows BMP files. They are custom 8-bit raw chunks.

Executable Shape

DOLE.EXE is an MZ wrapper around a Linear Executable image:

MZ e_cblp       0120h
MZ e_cp         0010h
MZ e_cparhdr    0004h
MZ e_minalloc   049eh
MZ e_maxalloc   ffffh
MZ e_ss:e_sp    029fh:0100h
MZ e_cs:e_ip    0000h:0058h
MZ e_lfanew     1f20h

The real payload starts at 1F20h with an LE signature. The real-mode stub is PMODE/W:

PMODE/W v1.02 DOS extender - Copyright 1994, Daredevil and TranZ

The protected-mode code was built with WATCOM C/C++32. The entry point lands on a short jump over the WATCOM runtime string and then enters the C startup code.

LE Layout

The parsed LE header gives this layout:

LE offset              1f20h
page size              1000h
module pages           22
entry object           1
entry EIP              ad3ch
stack object           2
stack ESP              3170h
data pages file start  6200h
object count           2

Object table:

object 1  base 10000h  size 13e3dh  flags 2045h  pages 20
object 2  base 30000h  size 03170h  flags 2043h  pages 2

Object 1 is the code object. Object 2 is the data object; string offsets are relative to that data selector. The filenames appear at these object-2 offsets:

00f3h  DOLE.CFG
01b5h  DOLE.DAT
01c7h  dole.pal
01d0h  dole1.bmp
01dah  dole2.bmp
01e4h  dole2.bmp
01feh  dole3.bmp
0208h  dole4.bmp
0212h  dole5.bmp

That is why the disassembly uses immediates like edx=01d0h; those are data selector offsets, not flat linear addresses.

Library Payloads

The executable includes three recognizable support blocks:

The DSIK strings show the supported device families:

Sound Blaster
Sound Blaster Pro
Sound Blaster 16/16ASP
Windows Sound System
Gravis UltraSound

The intro uses DOLE.CFG as a small binary sound setup record. It uses DOLE.DAT as the song file; file(1) identifies it as a 4-channel ProTracker module.

Main Timeline

The demo body starts near code address 10552h. In high-level order:

  1. Register DSIK sound drivers and read DOLE.CFG if present.
  2. Open/load DOLE.DAT and initialize the selected sound device.
  3. Switch into a tweaked 320-wide planar VGA mode.
  4. Allocate a small screen-state object.
  5. Load and upload DOLE.PAL.
  6. Load DOLE1.BMP as a raw 320x200 image.
  7. Load DOLE2.BMP twice as two animated sprite objects.
  8. Draw the base image and animate two bouncing sprites for about 0226h timer units.
  9. Load and display DOLE3.BMP several times with short waits.
  10. Load DOLE4.BMP and DOLE5.BMP, then alternate them on screen.
  11. Shut down sound, return to text mode, and exit.

The program is much more asset-driven than Weener or Banana Split. Its "fast intro" part is not a size stunt; it is a protected-mode C demo using a compact custom image format and a ready-made sound layer.

Wait And Exit Loop

The small wait routine at 104DBh is used throughout the timeline:

104db: ; EAX = target tick count
wait_until_target:
    cmp eax-1, [1f2a]
    jbe first_done
    call sound_or_timer_tick
    call key_or_exit_test
    if AL != 0: call shutdown_and_exit
    jmp wait_until_target

first_done:
    [1f2a] = 0
wait_until_nonzero:
    cmp [1f2a], 0
    jne done
    call sound_or_timer_tick
    call key_or_exit_test
    if AL != 0: call shutdown_and_exit
    jmp wait_until_nonzero
done:
    [1f2a] = 0
    ret

The counter at data offset 1F2Ah is the pacing source. The routine polls the sound/timer path and keeps the keyboard exit path live during long visual waits. This is why the main code can use calls like wait(1), wait(46h), or wait(0D2h) between graphics operations.

VGA Setup

Routine 11912h starts from BIOS mode 13h and then changes the VGA registers into a planar 320-wide layout:

11912: mov eax,13h
       int 10h

       mov dx,03c8h
       xor al,al
       out dx,al
       inc dx
       mov ecx,100h
clear_dac:
       out dx,al
       out dx,al
       out dx,al
       loop clear_dac

       mov dx,03c4h
       mov eax,0604h
       out dx,ax          ; sequencer memory mode

       mov dx,03d4h
       mov eax,0e317h
       out dx,ax
       mov eax,0014h
       out dx,ax

       in  al,03dah       ; reset attribute flip-flop
       mov dx,03c0h
       mov al,10h
       out dx,al
       mov al,61h
       out dx,al

It then clears 64 KiB at A0000h:

mov edi,0a0000h
xor eax,eax
mov ecx,4000h
rep stosd

The important saved state values are:

screen max x      013fh  ; 319
screen max y      00c7h  ; 199
linear width      0140h  ; 320 pixels
visible height    00c8h  ; 200 rows
planar row stride 0050h  ; 80 bytes per plane row
VRAM base         a0000h
VRAM end          b0000h
VRAM span         10000h

The blitter routines use the 80-byte planar row stride and pick VGA planes explicitly. The source image is linear 8-bit data; the destination is planar VGA memory.

Raw Image Format

Four of the image files use the simplest possible format:

offset 0  uint32 little-endian width
offset 4  uint32 little-endian height
offset 8  width * height bytes of 8-bit pixels

Decoded dimensions:

DOLE1.BMP  320 x 200
DOLE3.BMP  320 x 94
DOLE4.BMP  163 x 40
DOLE5.BMP  28 x 17

The raw-image loader at 1358Ch opens the file, reads the two dimensions, allocates width * height + 8 bytes, stores the dimensions at the front of the allocated block, and reads the rest of the file after the 8-byte header.

The .BMP extension is only a scene-local convention here. The executable also contains strings for IFF/PBM chunk names, but these particular assets are not IFF files.

Animated Image Format

DOLE2.BMP is handled by the animated-image loader at 13C58h, not by the raw loader. Its first two bytes are frame-grid counts:

byte 0  count in x direction = 02h
byte 1  count in y direction = 01h

The file then stores raw image chunks, each with its own 8-byte width/height header:

frame 0 at file offset 0002h: 53 x 56
frame 1 at file offset 0ba2h: 53 x 55

The loader allocates a pointer table with count_x * count_y entries, reads each frame chunk into memory, and constructs a normal raw-image object for each frame. The first frame's dimensions are also used to set the sprite's half-width and half-height fields:

sprite.center_x = sprite.width  / 2
sprite.center_y = sprite.height / 2

Each animated sprite stores:

00h  pointer table for frames
0ch  sprite width
10h  sprite height
14h  half width
18h  half height
1ch  current x minus half width
20h  current y minus half height
24h  count x
25h  count y
26h  frame count
27h  current frame x
28h  current frame y
29h  active restore slot

The dual restore slot at 29h is a small dirty-rectangle scheme: restore the old rectangle from one slot, draw the new sprite, then toggle the slot.

Full-Screen Draw Path

The draw call used for raw images is 139ABh, which forwards to the clipped planar blitter at 13AA7h:

139ab:
    esi = image.block
    ebx = y
    eax = x
    call 13AA7h

The image block begins with:

00h  uint32 width
04h  uint32 height
08h  pixel bytes

13AA7h performs clipping against the current screen bounds:

width  = [esi+0]
height = [esi+4]
pixels = esi + 8

if x > max_x: return
if x < 0:
    width -= -x
    pixels += -x
    x = 0

if y > max_y: return
if y < 0:
    height -= -y
    pixels += (-y) * original_width
    y = 0

right = x + width - 1
if right > max_x:
    width -= right - max_x

bottom = y + height - 1
if bottom > max_y:
    height -= bottom - max_y

After clipping, the destination is converted to planar address and plane index:

edi = vram_base + y * planar_stride + (x >> 2)
plane = (x & 3) + phase
if plane >= 4:
    plane -= 4
    edi += 1

The plane is selected through the sequencer map mask:

mov dx,03c4h
mov eax,1102h
rol ah,cl
out dx,ax

The low byte 02h is the sequencer map-mask index. The high byte is the bit mask selecting which VGA plane accepts writes.

Transparent Planar Blitter

The hottest visual loop is inside 13BEDh. It draws the source image into planar VGA one plane at a time, skipping zero pixels:

plane_pass:
    save source and dest
    source += source_plane_offset
    rows = clipped_height
row:
    cols = planar_width_bytes
pixel:
    xor al,al
    add al,[esi]       ; sets ZF and loads source pixel
    jz  skip
    mov [edi],al
    xor al,al
skip:
    inc edi
    add esi,4          ; next source pixel for this VGA plane
    dec cols
    jne pixel

    restore row bases
    source += source_row_skip
    dest   += dest_row_skip
    dec rows
    jne row

    restore plane bases
    source += 1
    rotate plane mask
    adjust dest if the plane wrapped
    repeat until four planes are done or the clipped width is exhausted

This loop explains the image format. Source images are simple chunky 8-bit pixels, but the VGA target is planar. For a given plane, the source pointer walks every fourth chunky pixel. Nonzero source bytes are written; zero source bytes leave the old screen byte intact. That gives all sprites and overlay images transparent backgrounds without masks.

The code uses add al,[esi] instead of mov al,[esi] / test al,al. Since AL is zero before the add and reset after each possible store, the add both loads the byte and sets the zero flag. It saves an instruction in the innermost loop.

Rectangle Capture

The other half of the sprite system is 13A4Ch, which captures a rectangle from VGA memory into a linear backup buffer. It selects a VGA read plane, then deinterleaves each plane into a linear buffer:

for plane in visible planes:
    select read plane through port 03CEh
    save source and destination
    rows = rectangle_height
    while rows:
        cols = planar_width_bytes
        while cols:
            al = [vram]
            [backup] = al
            vram += 1
            backup += 4
            cols -= 1
        source += row_skip
        dest   += backup_row_skip
        rows -= 1
    next plane

The backup layout matches the source image layout used by the draw routine: one chunky-looking byte stream, but deinterleaved by plane in memory. That lets the same blitter machinery restore old sprite rectangles and draw new sprites.

Rectangle Restore

Routine 14ACDh restores a captured rectangle. It switches VGA write behavior, then copies each row from the backup buffer back into VRAM:

row:
    if source + row_width crosses vram_end:
        copy to end of VRAM window
        wrap source to vram_base
        copy the remaining bytes
    else:
        rep movsb

    source += row_skip
    if source >= vram_end:
        source -= vram_span
    dest += row_skip
    rows -= 1
    jne row

The wrap handling exists because the screen code treats a VRAM window as a cyclic memory range. The moving sprites can be restored even if a saved segment crosses the end of that range.

Sprite Frame Update

Routine 14229h is the frame draw/update path for the first animated sprite type:

restore old rectangle from active restore slot

frame_index = frame_y * count_x + frame_x
frame_ptr = frame_table[frame_index]
draw frame at current x/y

active_restore_slot ^= 1

The second sprite type has a parallel implementation around 14A26h. The layout differs slightly, but the idea is the same: restore old rectangle, pick a frame pointer, draw at the new position, then toggle the restore slot.

Bouncing Sprite Loop

The main animation loop starts after the base image and the two DOLE2.BMP sprite instances have been loaded. It seeds two positions and two velocity sets:

sprite A starts at x=50, y=50
sprite B starts at x=60, y=50
initial fractional step = 0.1
later fractional step   = 0.5
loop limit              = 0226h frames
speed-up point          = 01f4h frames

Each frame:

  1. Wait one tick with 104DBh.
  2. Restore and draw sprite A.
  3. Reposition sprite A from xA,yA.
  4. Restore and draw sprite B.
  5. Reposition sprite B from xB,yB.
  6. Render the updated frame page.
  7. Reverse direction when either sprite hits the bounds.
  8. Update xA, yA, xB, and yB with x87 math.

The boundary checks use these approximate ranges:

x lower bound  1eh
x upper bound  121h
y lower bound  1eh
y upper bound  0a9h

The position update code is FPU-heavy for such a small effect:

fild dword [dir_x]
fmul qword [fractional_step_x]
fild dword [x]
fadd previous_temp
frndint via WATCOM helper
fistp dword [x]

The WATCOM helper at 1AD1Ch temporarily changes the FPU rounding mode, runs frndint, and restores the original FPU setting. The result is integer sprite positions driven by fractional speed values.

Once the frame count passes 01F4h, the code changes the fractional step from about 0.1 to 0.5, making the movement accelerate for the final part of the sprite section.

Later Image Sections

After the sprite loop ends, the main code waits and loads DOLE3.BMP:

wait 46h
load dole3.bmp
draw at x=0, y=26h
wait 1
draw again
wait 1
draw again
wait 1
wait d2h

Then it loads the two small images:

load dole4.bmp
load dole5.bmp

They are drawn at fixed positions:

DOLE4.BMP at x=8dh, y=88h
DOLE5.BMP at x=11h, y=1bh

The code alternates the two draws with one-tick waits and page/render calls, which gives the final display a staged arrival instead of a single static blit.

Sound Path

The sound setup is externalized through DSIK. The visible program logic is:

open/read DOLE.CFG if available
select sound device / port / IRQ / DMA / rate
open DOLE.DAT
initialize sound system
start module playback
call sound/timer tick during waits
shutdown sound at exit

The module title is:

trumpetare tekkno

The module credit string says:

by vicious

The main loop does not decode ProTracker data itself. DSIK handles the playback device and module update path; the demo code only keeps the tick path alive during waits and exits.

What The Code Is Really Doing

The production's core is not a large effect engine. It is a protected-mode asset runner with a good planar VGA blitter:

The inner loop to notice is the transparent chunky-to-planar blitter. It is small, branchy, and very PC-specific: select a VGA plane, walk every fourth source pixel, skip zero bytes, write visible pixels, advance to the next plane, and repeat. The rest of the demo is built around feeding that loop with raw assets and keeping the music tick alive while the images arrive on screen.