Analysis model: gpt-5.5 xhigh, sol high
Last edited: 2026-08-25

# Witan 2 by Witan - Technical Dissection

`Witan 2` is a February 1991 MS-DOS demo by Witan. The Hornet 1991 demo
index lists `witan2.zip` as `Witan 2 by Witan`, and the main executable is
timestamped 1991-02-03. The program credits Wytze B. Westra (WBW) for graphics
and programming.

Release year: 1991

This is a compact early VGA/Sound Blaster piece:

- one LZEXE 0.91-compressed real-mode MZ executable;
- one external Creative `CT-VOICE.DRV` driver;
- one external `TOV.VOC` Creative Voice sample;
- mode `13h` chunky VGA;
- a BIOS MCGA/VGA probe via `INT 10h AX=1A00h`;
- a direct `A000h` background/logo renderer;
- five 16x16 sprites moved by byte tables and runtime phase controls;
- an embedded 8x8 font writer whose unreachable wrap test turns the intended
  first-row typewriter into a slowly descending, overlapping VRAM text stream;
- a small palette-band cycler using ports `3C8h/3C9h`;
- vertical-retrace polling on `3DAh`.

The bundled text and end/contact material contain old private contact details.
Those lines are deliberately not reproduced here.

![Direct Witan 2 opening loop](images/witan-2-runtime-opening.gif)

The primary evidence is now a continuous direct `00:00..00:08` excerpt from
the untouched release. It shows the actual ownership split: a fixed logo,
three moving palette-light bands, five opaque 16x16 letter sprites, and the
near-top text stream beginning after its 256-frame delay. The excerpt stops
before private contact material.

![Reconstructed Witan 2 still](images/witan-2-reconstructed-still.png)

The still above is a decoded/reconstructed image from the unpacked binary's own
palette, background, logo, sprite, and font tables. It is not claimed as a raw
DOSBox screenshot and is secondary to the direct GIF.

Front-page media note: the card now uses the direct GIF. The reconstruction
remains asset/layout evidence, not timing evidence.

## Sources

- Hornet 1991 demo index:
  https://ftp.scene.org/mirrors/hornet/demos/1991/00_index.txt
- Scene.org archive:
  https://ftp.scene.org/mirrors/hornet/demos/1991/witan2.zip
- Scene.org file page:
  https://files.scene.org/view/mirrors/hornet/demos/1991/witan2.zip
- Creative Technology, *Sound Blaster Series Hardware Programming Guide*,
  Creative Voice file-format appendix:
  https://cecas.clemson.edu/~ahoover/ece468/labs/SoundBlasterProgrammingGuide.pdf

## Archive

The examined archive is `witan2.zip` from the Hornet mirror:

```text
witan2.zip      66743 bytes
```

Archive contents:

```text
ct-voice.drv     2377  1989-11-27 10:26
demosite.com     1104  1992-10-21 18:43
tov.voc         60607  1990-12-07 19:31
witan2.doc        185  1992-09-14 21:29
witan_2.exe      7851  1991-02-03 23:49
```

Important hashes:

```text
f38483af80e5df74d041dd3387859b42240a97da47cd9994e92680b20e64b2b0  ct-voice.drv
ae4377ea5ad7ace3149992f111f8384a81a71b1d658cd2fe453291ab14b26d6f  demosite.com
d8726d61292cffcb3f18df7afcc6997392df593567c90d39e622fb72aad81ac8  tov.voc
99e3f78802abac338750e8c7ac4a300d0dc391a0303e8d5dd87c62b7f6727ce1  witan2.doc
cbf871a47462aa26cb78fd08af2536a5b9cb9dd64ad1d54a3b238c39c55ee21e  witan_2.exe packed
fff8e2c43ab2c9fb9588d0a7951df124469f4e7cb5ac259114d30ba3fb0b3c5c  witan_2.exe after LZEXE repair
c891e899daef88ab6b18ad767a6f5af1eb5098a4cc51441d1f48610873f021f5  headerless load image
```

`demosite.com` is a later archive-site advertisement and not part of the demo
proper. `witan2.doc` is only a driver note: if the bundled `CT-VOICE.DRV` does
not work, copy a compatible Creative driver into the directory.

## Executable Shape

The shipped `witan_2.exe` is LZEXE 0.91 compressed:

```text
witan_2.exe  7851 bytes  MZ, LZEXE v0.91 compressed
```

After LZEXE repair:

```text
file size      19189 bytes
header size      512 bytes
load image     18677 bytes
relocations        0
entry          FFF0:0100
stack          FFF0:FFFE
```

The unusual `FFF0:0100` entry and `FFF0:FFFE` stack make the repaired file act
like a `.COM` program behind an MZ header. DOS loads the image after the
512-byte header; execution starts at load-image offset `0000h`. All offsets
below are load-image offsets, not physical file offsets.

Useful image map:

```text
0000-0092  main entry, keyboard dispatch, exit path
0093-00e2  five-sprite position update
00e3-0134  draw five sprites
0135-0170  erase old five-sprite rectangles
0171-019a  16x16 sprite copy to A000h
019b-01c6  16x16 black rectangle erase
01c7-01d4  BIOS DAC upload for first 128 colors
01d5-0284  delayed text tick, one-character draw, and dead wrap branch
0285-0385  text-writer row-color tables / data
0386-038f  five sprite source pointers
0390-03a3  five x/y position words, overwritten every frame
03a4-03a9  sprite path spacing, phase, and speed bytes
03aa-04a9  x path table
04aa-05a9  y path table
05aa-0729  128-entry DAC block for INT 10h AX=1012h
0c3e-0e3d  8x8 font
0f46-1410  text pointer plus 1,224-byte text/NUL, private parts omitted
1411-1471  palette-band cycler
1472-14d1  background/logo initializer
171a-...   logo/field byte map
201e...    sprite bitmap data
45b8-47b0  CT-VOICE/VOC setup, play wrapper, and shutdown helper
47bc-47cd  MCGA/VGA probe
47d8-47f1  retrace wait helpers
```

## Direct Silent Runtime

The authenticated packed `witan_2.exe` was run in DOSBox-X 2024.03.01 with
`machine=svga_s3`, normal core, fixed `cycles=8000`, and 16 MiB RAM. Sound
Blaster, GUS, MIDI, PC speaker, and DOSBox mixer output were disabled; SDL used
a dummy host backend. The bundled driver/sample files remained present so the
original bundled-file/no-card guarded path ran unchanged. As detailed below,
other missing-file branches are not equally safe. No audio was monitored or
auditioned.

`dx-capture /v /-a /-m WITAN_2.EXE` produced a 0.556-second text/setup segment
and 28.108 seconds of 640x400 mode-13h graphics. The 1,970-frame graphics
segment was normalized sequentially to a video-only FFV1 stream with no audio.
The host bounded the still-active interactive loop; no natural exit is claimed.

```text
00:00.000  First graphics frame: fixed Witan logo, black high-index field,
           moving lit palette bands, and five moving letter tiles.
00:00..04  Initial text delay counts down while sprites and palette move.
00:04..08  Published excerpt shows the delayed 8x8 writer beginning near the
           top edge; its linear destination has only started creeping down.
00:08..28  Same one-screen loop continues; later text is not public media.
00:28.108  Last normalized frame before the host bound.
```

The public GIF is an uncropped 640x400, 80-frame, 10 fps `00:00..00:08`
derivative. It contains no audio and was screened for historical private text.

## Runtime-To-Code Concordance

The direct GIF is timed runtime evidence; the reconstruction is decoded table
evidence. They are kept separate because the reconstruction cannot prove
motion, pacing, or the crucial mostly-black DAC state.

Visible artifact:

```text
images/witan-2-runtime-opening.gif
evidence type: direct continuous DOSBox-X runtime, 00:00..00:08

images/witan-2-reconstructed-still.png
evidence type: decoded/reconstructed secondary still
```

The startup-to-screen path is:

```text
LZEXE 0.91 MZ wrapper
  -> repaired FFF0:0100 load-image entry
  -> MCGA/VGA probe through INT 10h AX=1A00h
  -> fragile CT-VOICE.DRV and TOV.VOC setup/failure flags
  -> BIOS mode 13h
  -> load DAC entries 0..127 from 05AAh
  -> draw 85-row high-index field and 230x53 logo/field map
  -> loop: erase five sprites, update table positions, redraw sprites,
           stamp the accumulating text stream, wait retrace, rotate bands
```

The still's visible layers correspond to these code paths:

- Rows 0..84 receive color indices `80h..D4h`, one index per row, but setup
  first blacks DAC entries `80h..FDh`. The GIF therefore shows only the three
  seven-entry windows lit by `1411h`, not a permanently visible gradient.
- The central logo/field comes from `14ACh`, which copies a 230x53 byte map
  from `171Ah` to `A000h` with zero treated as transparent.
- The five 16x16 moving sprites come from source pointers at `0386h` and the
  draw/erase pair at `0171h` and `019Bh`; positions are generated from the
  `03AAh` x table, `04AAh` y table, and phase/spacing bytes at `03A4h..03A9h`.
- The text is a cell writer, not a smooth pixel scroll: `01D5h` stamps one 8x8
  glyph from the font at `0C3Eh` whenever the delay byte expires. Its compiled
  start offset and equality-only wrap bug explain the slowly thickening red
  strip at the top of the retained runtime sheet.
- The apparent light motion in the high-color bands is palette animation:
  `1411h` blanks and uploads three seven-color windows through VGA DAC ports
  `3C8h/3C9h`.
- The audio path loads Creative `CT-VOICE.DRV` and points command 6 directly at
  `TOV.VOC`'s 8 kHz 4-bit ADPCM data block. It explains the Sound Blaster side
  but was disabled and host-inaudible in the retained run.

Evidence boundary: the direct run is host-bounded and does not prove the Space
exit. Later text/contact material is deliberately outside public media.

## Main Loop

The whole control loop is short enough to quote as structure:

```asm
0000  call 47bc          ; MCGA/VGA probe, CF on failure
0003  jae  000b
0005  mov  dx,48f2       ; "YOU MUST HAVE A MCGA/VGA CARD !!!"
0008  jmp  008a          ; print and exit
000b  call 45b8          ; CT-VOICE and VOC setup
000e  mov  ax,0013h
0011  int  10h           ; 320x200x256
0013  call 01c7          ; load 128 DAC entries from 05aa
0016  call 1472          ; initialize background/logo

0019  call 0135          ; erase five old 16x16 sprite rectangles
001c  call 0093          ; update five x/y positions from path tables
001f  call 00e3          ; redraw five sprites
0022  call 01d5          ; text tick and possible 8x8 cell draw
0025  call 47d8          ; wait for vertical retrace
0028  call 1411          ; palette-band update
002b  mov  ah,01h
002d  int  16h           ; key waiting?
002f  je   0019
0031  mov  ah,00h
0033  int  16h           ; read key
...
007f  call 47a2          ; command 9 if driver file was loaded
0082  mov  ax,0003h
0085  int  10h           ; text mode
0087  mov  dx,4937       ; exit text
008a  mov  ah,09h
008c  int  21h
008e  mov  ax,4c00h
0091  int  21h
```

There is no timer ISR for animation. Frame pacing is the VGA retrace wait at
`47d8`, plus whatever time the software drawing takes. The wait stops as soon
as `03DAh` bit 3 becomes one, so the following three-band DAC update begins
during retrace rather than waiting for a complete clear-to-set edge.

### One Complete Steady-State Iteration

The normal frame is a direct single-buffer transaction; there is no hidden
back page or final copy. In exact call order:

1. `0135h` reads the five old `(x,y)` word pairs at `0390h..03A3h`. Each call
   to `019Bh` computes `(y * 320 + x) mod 65536` and writes a black 16x16
   rectangle straight to `A000h`: 256 bytes per sprite, 1,280 framebuffer
   bytes for the pass. This destroys any one-time background/logo pixels under
   the old rectangles rather than recovering them.
2. `0093h` samples the 256-byte X and Y tables five times each, writes ten new
   coordinate words, and advances the two byte phases modulo 256. Spacing and
   speed are also bytes, so key changes alter table traversal without changing
   the blitter.
3. `00E3h` reads those ten words and the five source pointers, then `0171h`
   copies five literal 16x16 sources to `A000h` in pointer order: another
   1,280 framebuffer bytes. Overlap ownership therefore belongs to the
   highest-numbered sprite drawn at that pixel.
4. `01D5h` always decrements the text delay. Most frames stop there. On an
   expiry it writes one 8x8 cell, exactly 64 framebuffer bytes. Only the first
   expiry clears rows 0..7 (2,560 bytes): the nominal post-wrap clear is
   unreachable from the compiled destination offset.
5. `47D8h` polls input-status bit 3 until retrace is active. It does not wait
   for the preceding retrace to end first, and it does not publish a completed
   page: all pixel writes above were already made directly to displayed VRAM.
6. `1411h` blanks three remembered seven-entry DAC windows, selects three new
   starts from the phase table, uploads 63 RGB bytes, stores the three starts,
   and advances the global phase. This is 168 VGA-port writes per iteration.
7. BIOS `INT 16h` polls after the visual work. With no key, control returns to
   the erase pass; ASCII keys `1`..`5` mutate motion bytes and Space enters
   command-9/video/DOS shutdown. Every other key is consumed and ignored.

The common no-text-expiry frame therefore performs 2,560 explicit framebuffer
byte writes plus 168 DAC-port writes. Since the displayed `A000h` page is
modified before the retrace poll, the wait primarily gates palette motion;
it is not tear-free whole-frame presentation.

## VGA Probe

The probe at `47bc` uses the BIOS Display Combination Code function:

```asm
47bc  mov ax,1a00h
47bf  int 10h
47c1  cmp al,1ah
47c3  je  47c7
47c5  stc
47c6  ret
47c7  cmp bl,07h
47ca  jb  47c5
47cc  clc
47cd  ret
```

The first test checks whether the BIOS supports the function. The second test
rejects adapters below the MCGA/VGA display-combination code range. If the
probe fails, the program prints the `$`-terminated text at `47f2` and never
touches mode `13h`.

## Background And Logo

The setup at `1472` does three things:

```asm
1472  call 1494          ; clear DAC entries 80h..FDh to black
1475  mov ax,0a000h
1478  mov es,ax
147a  xor di,di
147c  mov cx,0055h       ; 85 rows
147f  mov ax,8080h
1482  push cx
1483  mov cx,00a0h       ; 160 words = 320 pixels
1486  rep stosw          ; one full row
1488  pop cx
1489  add ax,0101h       ; next color index for next row
148c  loop 1482
148e  call 14ac          ; overlay logo/field bytes
```

Only the upper 85 scanlines receive these row indices. Since the code writes
words, each row is a solid 320-pixel band starting at index `80h` and
incrementing once per scanline. Routine `1494h` has just set DAC entries
`80h..FDh` to black, however. Geometry and visibility are separate: the rows
exist in VRAM continuously, while `1411h` reveals only selected seven-row
palette windows. That banded result is what the direct GIF shows.

The logo/field writer at `14ac` copies a 230x53 byte map:

```asm
14b2  mov si,171ah       ; source map
14b5  mov di,192dh       ; A000h offset, x=45 y=20
14b8  mov bx,0035h       ; 53 rows
14bb  mov cx,00e6h       ; 230 columns
14be  lodsb
14bf  cmp al,00h
14c1  jne 14c7
14c3  inc di             ; zero is transparent
14c7  stosb              ; nonzero writes direct color index
14c8  loop 14be
14ca  add di,005ah       ; 320 - 230 row stride
14cd  dec bx
14ce  jne 14bb
```

The row stride is explicit: `230 + 90 = 320`, so this is a rectangular byte
sprite with transparent zeros, not a packed RLE format.

## Palette Bands

The palette updater at `1411` rotates three seven-color windows in the high
half of the DAC:

```asm
1411  xor bx,bx
1413  mov di,15d3h       ; remembered old band starts
1416  mov si,15dbh       ; RGB triples to upload
1419  mov bl,[15d2h]     ; phase
141d  mov cx,0003h       ; three bands
1421  mov ah,[di]        ; old DAC start
1423  call 145c          ; blank seven entries
1426  mov ah,[bx+161ah]  ; new table value
142a  add ah,80h         ; high DAC start
142d  mov [di],ah
142f  call 1445          ; upload seven RGB triples
1432  mov ah,[15d9h]
1436  add bl,ah          ; next band phase
1438  inc di
143a  loop 1420
143c  mov ah,[15dah]
1440  add [15d2h],ah     ; global phase step
```

The inner upload at `1445` is pure VGA DAC port output:

```asm
1448  mov al,ah
144a  mov dx,03c8h
144d  out dx,al          ; select DAC index
144e  mov dx,03c9h
1451  lodsb / out dx,al  ; R
1453  lodsb / out dx,al  ; G
1455  lodsb / out dx,al  ; B
1457  inc ah
1459  loop 1448
```

The companion `145c` writes black triples to seven palette entries. The visible
effect is not moving pixels; it is moving light through palette indices already
present in the row field and logo screen.

Each frame processes three windows. Per window it blanks seven old entries and
uploads seven new RGB triples; both paths perform one DAC-index write and three
component writes per entry. That is `3 * 14 * 4 = 168` port writes after the
retrace-active gate.

The state hand-off is also explicit. `15D3h..15D5h` hold the three windows to
blank on the next frame, `15D2h` is the global phase, `15D9h=2Ah` separates the
three phase lookups, and `15DAh=28h` advances the global phase. `SI` is set only
once, so the three uploads consume consecutive 21-byte RGB ramps rather than
reusing one ramp. On the first call the remembered starts are still the
low-palette bytes `35h,33h,32h`; it blanks those windows once, then the first
phase lookups choose high starts `91h,92h,91h`. Overlapping DAC entries obey
call order, so the later ramp is the final owner until the next iteration.

## Sprite Motion

Five sprite source pointers live at `0386`:

```text
201e 2422 2826 2d2b 322f
```

Those point into five 16x16 byte sprites. Each sprite is copied literally, zeros
included. The black-rectangle erase pass runs before the new sprite draw pass,
so zeros inside the sprite source are real transparent-looking black pixels only
because the whole 16x16 block was just cleared.

The x and y paths use byte lookup tables:

```text
03aa-04a9  x table, values 78h..b4h; +20h is applied before use
04aa-05a9  y table, values 00h..3fh
```

The state bytes at `03a4..03a9` are:

```text
03a4  x spacing between the five sprites
03a5  x phase
03a6  x phase speed
03a7  y spacing between the five sprites
03a8  y phase
03a9  y phase speed
```

At process start those six bytes are `6Dh 70h 73h 76h 79h 7Dh`; they are not
zeroed state. Thus the untouched release begins with x-spacing 109, x-phase
112, x-step 115, y-spacing 118, y-phase 121, and y-step 125, all wrapping as
bytes. Key `5` replaces the spacing/step fields with `08h/02h` for X and
`08h/01h` for Y while leaving the current phases alone.

The update loop at `0093` computes all five positions. Normal generated
top-lefts are x=152..212 and y=0..63, so the 16x16 extents are x=152..227 and
y=0..78. Every block remains inside 320x200 and the unclipped kernels are safe
after initialization:

```asm
0093  xor di,di
0099  mov al,05h
009b  mov bl,[03a5h]       ; x phase
009f  mov cl,[bx+03aah]    ; x path sample
00a5  add cx,0020h         ; x bias
00a8  mov [di+0390h],cx    ; x word
00ac  add di,0004h         ; next x/y pair
00af  add bl,[03a4h]       ; per-sprite x spacing
00b3  dec al
00b5  jne 009f

00b7  mov bl,[03a8h]       ; y phase
00bf  mov al,05h
00c1  mov cl,[bx+04aah]    ; y path sample
00c5  mov [di+0392h],cx    ; y word
00c9  add di,0004h
00cc  add bl,[03a7h]       ; per-sprite y spacing
00d0  dec al
00d2  jne 00c1

00d4  mov al,[03a6h]
00d7  add [03a5h],al       ; advance x phase
00db  mov al,[03a9h]
00de  add [03a8h],al       ; advance y phase
```

The keyboard handlers change these parameters live:

```asm
key '1'  inc [03a6h]       ; x speed
key '2'  inc [03a9h]       ; y speed
key '3'  inc [03a4h]       ; x spacing
key '4'  inc [03a7h]       ; y spacing
key '5'  [03a4]=08h, [03a7]=08h, [03a6]=02h, [03a9]=01h
```

That matches the embedded help text: keys `1` through `5` alter sprite
movement, with `5` restoring the intended movement constants.

## Sprite Blitter

The draw and erase routines are twins. The draw dispatch at `00e3` loads each
sprite's x/y pair and source pointer, then calls `0171`:

```asm
00e6  mov cx,[0390h]       ; x
00ea  mov dx,[0392h]       ; y
00ee  mov si,[0386h]       ; sprite source
00f2  call 0171
...
```

The blitter:

```asm
0177  mov ax,0a000h
017a  mov es,ax
017c  mov ax,0140h
017f  mul dx              ; AX = y * 320
0181  add ax,cx           ; + x
0183  mov di,ax
0185  mov bx,0010h        ; 16 rows
0188  mov cx,0008h        ; 8 words = 16 bytes
018b  rep movsw           ; copy one row
018d  add di,0130h        ; 320 - 16
0191  dec bx
0192  jne 0188
```

The erase routine at `019b` repeats the same row math, then uses `rep stosw`
with `AX=0` for 16 rows. This is not saved-background restoration: every old
sprite rectangle becomes black, even over the row-index field or logo. Sprite
source zeroes are also copied as black; there is no transparency test. The five
sprites are drawn in fixed pointer order, so a later 16x16 source overwrites an
earlier one where they overlap. There is no page flip, clipping, sort, or depth
policy.

One bootstrap hazard precedes the safe generated coordinates. The first main
iteration calls the erase pass before `0093h` has written valid positions. Its
five raw `(x,y)` pairs are `(3734h,3C39h)`, `(413Eh,4744h)`, `(4C49h,524Fh)`,
`(5855h,5E5Bh)`, and `(6461h,6A67h)`. The 16-bit address calculation wraps
these to `A000:7E74`, `A000:563E`, `A000:2F09`, `A000:4A15`, and `A000:6521`.
The subsequent generated draws stabilize the visible loop, but this first
five-rectangle erase has arbitrary wrapped screen positions rather than valid
sprite coordinates.

## Text Writer, Linear Drift, And Dead Wrap

The routine conventionally called the scroller is gated by delay byte `0C2Dh`
and uses word `0C2Bh` as a *linear A000h destination*, not a separately reduced
X coordinate. Its compiled state is clear flag `[0C2Ah]=0`, destination
`003Ch` (60), and delay zero. Since the first operation decrements the delay,
zero wraps to 255. Calls 1..255 draw nothing; call 256 reaches zero and stamps
the first cell. This exactly accounts for the several-second sprite/palette-only
lead-in in the direct GIF.

Each later expiry occurs five frames apart:

```asm
01d5  dec [0c2dh]
01d9  cmp [0c2dh],00h
01de  jne 0265
01e3  cmp [0c2ah],00h
01e8  jne 01f1
01ea  call 0268          ; clear first eight rows once
01ed  inc [0c2ah]
01f1  mov [0c2dh],05h    ; next-character delay
01f7  mov si,[0f46h]     ; text pointer
01fb  lodsb
01fc  cmp al,00h
01fe  jne 020b
0200  mov [0f46h],0f48h  ; restart text
0206  call 4791          ; unguarded CT-VOICE command-6 retrigger
0209  jmp 01f7
```

The text at `0F48h` is 1,224 bytes before its NUL at `1410h`. Its private later
material is not reproduced. A NUL resets the pointer, attempts to replay the
voice sample, and fetches the first byte again in the *same* expiry; it never
terminates the visual loop. One full pass therefore takes 1,224 x 5 = 6,120
frames after the first glyph, about 87.43 seconds at the roughly 70 Hz cadence
of the retained mode-13h run. The public eight-second GIF cannot reach that
retrigger or the later private text.

Character lookup:

```asm
020b  sub al,20h
020d  xor ah,ah
020f  shl ax,1
0211  shl ax,1
0213  shl ax,1           ; char index * 8
0215  add ax,0c3eh       ; 8x8 font base
0218  mov si,ax
```

The pixel loop uses each font byte as a mask and chooses one of two
row-dependent chunky-VGA colors:

```asm
021f  mov di,[0c2bh]       ; current x offset
0225  mov bl,08h
0227  lodsb                ; one glyph row
0228  mov ah,al
022a  mov cx,0008h
022d  mov al,[bx+0c2dh]    ; background/shadow color
0231  shl ah,1
0233  jae 0239
0235  mov al,[bx+0c35h]    ; foreground color
0239  stosb
023a  loop 022d
023c  add di,0138h         ; next screen row, 320 - 8
0240  dec bl
0242  jne 0227
```

After one character, the code advances both text and destination:

```asm
0244  inc [0f46h]          ; next text byte
0248  add [0c2bh],0008h    ; next 8-pixel column
024d  cmp [0c2bh],0140h
0253  jne 0265
0255  mov [0c2bh],0000h    ; wrap to left
025b  mov [0c2dh],3ch      ; pause at wrap
0261  dec [0c2ah]          ; force band clear next time
```

The apparent wrap logic is dead in the shipped state. `003Ch mod 8 = 4`, adding
8 preserves that residue forever, and target `0140h` (320) is divisible by 8.
The equality can therefore never succeed. No other instruction writes
`0C2Bh`. The destination is not reduced modulo 320, the 60-frame pause never
runs, and clear flag `0C2Ah` is never decremented after its first set.

The hardware address still wraps naturally as a 16-bit `DI`, but before that
the visible placement for glyph number `n` is exact:

```text
base(n) = 60 + 8*n
y(n)    = floor(base(n) / 320)
x(n)    = base(n) mod 320
```

Glyphs 0..31 begin at x=60..308 on scanline 0. Glyph 32 begins at x=316 and
its eight-byte rows cross the 320-byte boundary. Glyph 33 starts at x=4 on
scanline 1. Every 40 further characters moves the base down one scanline, not
eight, so successive 8x8 cells overlap seven rows of older text. The result is
the slowly descending/thickening red text band visible in the longer retained
contact sheet—not a clean one-row wrap and not smooth pixel scrolling.

Routine `0268h` does clear exactly the first eight scanlines with one
row-specific background color, but only on the first glyph. Thereafter each
new cell overwrites its own 64-byte rectangle and older text otherwise remains.
This accumulating overlap is the text path's old-frame policy.

## Sound Path

The intended audio route uses one 64 KB segment at `CS+1800h`: driver bytes at
offset 0 and the complete VOC file at offset `1000h`. The 2,377-byte driver
ends at `0948h`, leaving a 1,719-byte gap; the 60,607-byte VOC occupies
`1000h..FCBEh`. Nothing overlaps and the command-6 pointer can address the
VOC's data block directly at `101Ah`.

The setup entry at `45B8h` does:

1. open `CT-VOICE.DRV` and read up to `8000h` bytes at `CS+1800:0000`;
2. form far call pointer `(CS+1800):0000`;
3. call command 3 and require `AX=0` for successful initialization;
4. call command 5 with `ES=CS, DI=48BAh`, installing a completion/status word;
5. open `TOV.VOC` and read up to `ED00h` bytes at driver-segment offset
   `1000h`;
6. run a 1,000-iteration one-sided retrace wait and, if the sample flag is
   nonzero, call command 6 with `ES:DI=(CS+1800):101Ah`;
7. call that same command-6 wrapper at every 1,224-byte text NUL;
8. call command 9 on Space if the driver file-load flag is nonzero.

Driver load:

```asm
45e9  mov ah,3dh
45eb  mov al,00h
45ed  mov dx,4739h        ; "CT-VOICE.DRV"
45f0  int 21h
45f4  mov [48b1h],ax      ; handle
45f7  mov ax,cs
45f9  add ax,1800h
45fc  mov [48b6h],ax      ; driver/sample buffer segment
4600  mov ah,3fh
4602  mov bx,[48b1h]
4606  mov cx,8000h
4609  xor dx,dx
460b  mov ds,[48b6h]
460f  int 21h             ; read driver into buffer segment
4614  mov ah,3eh
4616  mov bx,[48b1h]
461a  int 21h
461e  mov [48b4h],0000h   ; far offset 0000, segment at 48b6
4624  mov [48b3h],01h     ; driver-present flag
```

The loader checks DOS carry after open, read, and close but never verifies the
returned byte count, driver signature, or version. A read failure after open
also skips close. Those weaknesses are normally hidden by the exact bundled
file.

Driver init:

```asm
468d  mov bx,0003h
4690  call far [48b4h]
4694  cmp ax,0000h
4697  jne init_failed
4699  mov bx,0005h
469c  mov di,48bah        ; completion/status word in caller segment
469f  call far [48b4h]
46a3  mov [48b8h],01h     ; SB initialized
```

Command 5 was previously mislabeled as an error-string call. It is the standard
CT-VOICE completion/marker pointer. The driver zeroes `CS:48BAh` and remembers
it, but Witan 2 never reads that word. Playback is therefore not synchronized
to graphics, palette state, or the text pass; command 6's return is ignored too.

VOC load:

```asm
4702  mov ah,3dh
4704  mov al,00h
4706  mov dx,4845h        ; "TOV.VOC"
4709  int 21h
4711  mov ah,3fh
4713  mov bx,[48b1h]
4717  mov cx,ed00h
471a  mov dx,1000h
471d  mov ds,[48b6h]
4721  int 21h
4730  mov [48b9h],01h     ; sample-present flag
```

The file pointer passed to playback is `101Ah`, not `1000h`, correctly skipping
the 26-byte VOC header. The one data block is exact:

```text
header       "Creative Voice File"
version      1.10
data offset  001Ah
block type   1
block length 60575 bytes, including time constant and codec
time const   83h: 1,000,000 / (256 - 131) = 8,000 Hz
codec        1: Creative 4-bit ADPCM
block bytes  60573 compressed bytes after the two setup bytes
decoded      121145 unsigned 8-bit samples = 15.143125 seconds
terminator   file offset ECBDh
trailer      one ignored byte, 7Dh, at ECBEh
```

For codec 1, the first compressed byte is the reference sample and each of the
remaining 60,572 bytes supplies two ADPCM nibbles: `1 + 2*60572 = 121145`
decoded samples. A silent decode confirmed that exact sample count; no sample
output was monitored or auditioned. The demo delegates nibble reconstruction,
DMA page handling, and DSP output to `CT-VOICE.DRV`; it has no home-grown PCM
mixer.

### Driver Gate And Packaged Command-6 Anomaly

This is the same 2,377-byte IRQ-7 driver examined with Mach 3. Its dispatcher
admits commands 0..3 before initialization but rejects commands 4..13 with
`AX=FFFFh` while ready byte `0065h` is zero. The direct Witan 2 capture used
`sbtype=none`, so the driver file loaded but command 3 could not initialize a
card. Later command-6 and command-9 calls therefore hit the guard instead of
touching nonexistent hardware, which is why the visual loop survives this
particular no-sound route.

The packaged driver also has the same static command-table anomaly: word
`0045h`, command 6's dispatch slot, contains `94BAh` rather than the play
routine address `07D6h`; initialization can replace it only from initially
zero word `006Ch`. The bundled `witan2.doc` explicitly advises replacing a
driver that does not work. Without a successful hardware trace or proven
patch step, playback through this exact packaged copy remains an intended
code/data path, not runtime proof.

### Dual-Use Tail Bytes And The Real Failure Matrix

State storage at `48B1h..48BBh` is not a zero-initialized BSS. It aliases bytes in
the program's trailing end text: handle, driver flag, far pointer, buffer
segment, initialized flag, sample flag, and completion word overwrite that
text in place. The article does not reproduce the private surrounding text,
but its nonzero initial bytes matter to control flow.

The code explicitly sets `[48B3h]` on every driver-load outcome and
`[48B8h]` on every attempted initialization. It sets `[48B9h]` only if the VOC
loader is reached. Consequently:

- exact files plus no card: driver flag 1, init flag 0, stale nonzero sample
  flag; startup attempts command 6, but the ready gate safely rejects it;
- missing driver: driver flag becomes 0, but sample flag and far pointer remain
  text bytes; startup sees the stale nonzero sample flag and calls an invalid
  far pointer, so the advertised warning-and-continue route can crash;
- successful driver init plus missing/bad VOC: the loader sets sample flag 0,
  so startup skips playback, but the text NUL later calls `4791h` without any
  flag check and can pass unloaded data to a live driver;
- successful normal route: command 6 starts the 15.143125-second ADPCM block;
  the status word is ignored, and the next authored retrigger is roughly 87
  seconds later at the text NUL.

Thus audio is *visually optional only on the specific guarded failure path*;
not every printed warning is a safe continuation.

## Key Dispatch And Exit Cleanup

The main loop uses BIOS `INT 16h`, unlike Mach 3's raw IRQ latch. It polls after
all drawing and DAC work, then reads one key. ASCII `1`..`4` increment x speed,
y speed, x spacing, or y spacing as wrapping bytes; `5` writes the four default
motion constants while preserving both current phases. Space alone exits.
Every other key is consumed and returns to the erase pass.

The normal Space path is short and ordered:

```asm
007f  call 47a2h
47a2  if [48b3] != 0: bx=9; far-call [48b4]  ; driver shutdown
0082  ax=0003h; int 10h                      ; 80x25 text mode
0087  dx=4937h; ah=09h; int 21h              ; final text
008e  ax=4c00h; int 21h                      ; DOS status 0
```

There is no separate command 8; command 9 owns driver stop/IRQ restoration.
The condition is merely “driver file loaded,” not “driver initialized,” but
the ready gate makes command 9 harmless after command-3 failure. The MCGA/VGA
probe runs before driver setup; on failure it jumps directly to the common
print/`4C00h` tail, with no graphics mode or driver state to restore. No custom
keyboard, timer, or music interrupt is installed by the main executable.

## Why It Matters

`Witan 2` is not a large multipart production, but it is exactly the kind of
early-PC missing piece that helps the chronology:

- it shows Witan before the much larger `Facts of Life`;
- it uses the Creative driver/VOC path common in 1990-1991 PC demos;
- it keeps the graphics loop small enough to understand instruction by
  instruction;
- it already has interactive movement controls and palette tricks;
- it exposes two instructive early-demo bugs: an equality wrap that the
  compiled text destination can never hit, and optional-audio flags carved
  from nonzero end-text bytes;
- it is an early example of a Dutch PC group presenting itself through a
  self-contained VGA/Sound Blaster demo shell.

The core technique is not a hidden engine. It is a direct loop: use tables for
motion, copy 16x16 byte sprites into mode `13h`, accumulate 8x8 text through a
linear-address bug, and make the screen feel alive by moving palette light
instead of redrawing the whole scene. The visuals are compact and fully live;
the packaged ADPCM route is carefully separated from what the silent runtime
actually proved.
