Analysis model: gpt-5.5 xhigh, sol high
Last edited: 2026-08-26
Anti-svd by The Untouchables - Technical Dissection
Anti-svd is a 1991 MS-DOS VGA demo by The Untouchables. The Hornet 1991
index lists it as tudemo.zip 144334 *** Anti-svd by The Untouchables.
Release year: 1991
This is an early, packed, data-file-driven VGA demo. The restored executable is
not just a linear mode-13h picture viewer: it switches between chained and
unchained VGA access, uses external tu.dat resource blocks, contains two
bitstream image decoders, does retrace-paced DAC fades, stages masked image
blocks through scratch segments, scrolls large screen windows with CRTC start
addresses, and finishes in a tight four-plane strip loop at 57FFCh.

This is a direct, continuous, silent DOSBox-X excerpt from graphics-stream
00:44.000..00:59.000. It covers the forest scene, the moving foreground
figures, the sliding stone UT panel, and the late forest/panel state; these are
real consecutive frames, not a slideshow assembled from stills.

At graphics-stream 00:06.000, the clean opening has faded up to the stone
UT logo and PC World Ruler Presents. The 320x200 mode-13h frame is retained
as DOSBox-X's direct 640x400 nearest-neighbour capture.

This older image remains useful as a static-analysis map, but it is not a literal runtime screenshot and is no longer the front-page preview. It summarizes the recovered loader and inner-loop topology from the unpacked MZ code.
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/tudemo.zip
- Scene.org file page: https://files.scene.org/view/mirrors/hornet/demos/1991/tudemo.zip
Archive
The examined archive is tudemo.zip from the Hornet mirror:
tudemo.zip 144334 bytes
ZIP contents:
demosite.com 1104 bytes 1992-10-21 18:43
tu.dat 196435 bytes 1991-06-30 03:02
tu.exe 25723 bytes 1991-06-30 03:19
Hashes:
2bed2d64b303691a9c7e160567b522135db97df5f6af44d8ba8d7c327c9664de tudemo.zip
ae4377ea5ad7ace3149992f111f8384a81a71b1d658cd2fe453291ab14b26d6f demosite.com
94015ffafcd1ea2167dccb7f2a9be2d5e291852cd9f6e2ef03a0bda06345d020 tu.dat
5e1e424cf2df1bdb3f0dda0a853bfee7c988093c8b087bba7199deba0d6ffe9a tu.exe
21213584a29d7b319a8b26a2249c4b5a612fb963c6aee5b875931dfb94809df3 tu-unpacked.exe
demosite.com is a TheDraw-style demo-site advertisement screen. It is not
part of the demo runtime.
Runtime Capture And Concordance
A fresh no-sound run now supplies the missing playback evidence:
DOSBox-X version 2024.03.01 Commit 02f36ba
machine / CPU svga_s3, normal core, fixed 12,000 cycles
guest command TU.EXE /speed:7 /sound:4
capture command dx-capture /v /-a /-m
host audio dummy; published media are silent
main graphics stream 640x400 ZMBV, 70.0863 fps, 84.167657 seconds
timing zero first frame of tu_001.avi after the 28.536 ms mode switch
effect input X11 Space key events at host-run +62 s and +80 s
The command-line switches select the fastest advertised machine profile and
the demo's no-sound path, so the text setup prompts do not appear. The visual
route is deliberately keyed: the first injected Space leaves the forest/strip
loop, and the second releases the final page. This agrees with the IRQ-9
mailbox and unconditional main-loop back edge recovered below. Host-run times
are reported for the input events because they are not video packet timestamps;
their visible boundaries fall at roughly graphics-stream 00:60 and 00:78.
Observed graphics-stream states:
00:00.000 black start of the mode-13h stream
00:04.000 stone UT logo begins to emerge
00:06.000 UT / PC World Ruler Presents opening
00:12.000 first hostile anti-SVD picture begins its fade
00:18.000 first hostile picture fully visible
00:24.000 wanted-poster picture begins
00:30.000 poster and bottom text fully visible
00:38.000 picture/text fade reaches black
00:42.000 forest background established
00:46.000 first foreground figure moves in from the right
00:50.000 stone UT panel joins the moving figures
00:54.000 flying figure above the panel
00:58.000 late forest/panel state and transition
~00:60.000 first Space boundary; forest phrase/transition begins
00:62.000 forest phase fades down
00:64.000 stone UT transition begins
00:68.000 final credit page starts to emerge
00:70.000 final credit page fully visible
~00:78.000 second Space boundary; final fade/cleanup begins
00:84.168 stream ends and DOSBox-X returns to the shell
The two hostile middle pictures include period homophobic taunting, and the final page includes old board telephone numbers. Those frames were inspected for concordance but are not published as page assets. The clean opening and forest excerpt above preserve direct runtime evidence without reproducing that text.
The run confirms the broad static sequence: full-picture decodes and palette fades own the opening and middle cards; the later forest phase uses the carved mask/image blocks, delta window restoration and planar strip machinery; and a final resource fade follows it. The static seek and carving tables sharpen that concordance: the 72x61 pairs are the red-headed runners, the 83x59 pairs are the flying figures, and separate full frames own the forest, stone window, strip source, opening, cards, and credits.
At /speed:7, CS:0C48 = 5D37h-0500h = 5837h and the pacing threshold is
CS:0C46 = floor(5837h/60) = 0178h (376). With no sound interrupt, the
70.0863 Hz retrace gate dominates. A picture fade-in consumes 320 gates, its
fixed hold 240, and fade-down 325 including the initial DAC read. The recovered
loop counts therefore align with the capture as follows:
00.0..12.6 EC0E PC World Ruler: 320 fade + 240 hold + 325 fade
12.6..25.3 EC16 Sucker Sander: the same three stages
25.3..37.9 EC1A wanted poster: the same three stages
37.9..42.5 EC02 forest fade-in
42.5..47.0 16 red-headed-runner composites, 20 gates each
47.0..48.7 120-position stone-window reveal
48.7..57.9 32 flying-figure composites, 20 gates each
57.9..58.7 28 software reverse + 32 CRTC reverse steps
~58.7..60 EC12 strip scene, held until the first Space
~60..64.7 strip-scene fade-down
~64.7..69.3 EC0A credits fade-in
~69.3..78 fixed hold followed by the final key wait
~78..84.2 final fade, hardware cleanup, and DOS return
The ranges are code-to-capture concordance, not sampled instruction-pointer timestamps; the two keyed boundaries are deliberately shown as approximate.
Packing And MZ Layout
The distributed tu.exe is a 25723-byte MZ executable with an EXEPACK-family
stub. The packed file contains the familiar failure text:
Packed file is corrupt
UNP restored an expanded MZ image of 363056 bytes:
original file size 25723 bytes
original header 512 bytes
original load image 25211 bytes
original entry 060A:0012
original stack 58AD:0080
unpacked file size 363056 bytes
unpacked header 320 bytes
unpacked load image 362736 bytes
unpacked relocations 71
unpacked entry 5758:0EBE
unpacked stack 5658:1000
entry file offset 5857Eh
The expanded code still contains relocation records. Instructions such as
mov ax,5040h, call 417D:013Ch, and call 0000:73A3h are relocation
targets; DOS adds the program load segment at runtime. In this note, code
labels such as 57FFCh are raw file offsets in the restored executable.
The restored image contains more initialized data than a segment-first reading
suggests. In particular, 417D:013Ch changes DS to its own code segment
before dereferencing SI, so EBFEh..EC22h names a static table in segment
417Dh, not missing data above segment 5040h. The table is present at raw
file offsets 5050Eh..50535h and gives exact tu.dat seeks below.
Setup Flow
The entry point starts at 5857Eh. It parses the PSP command tail for:
/speed:n
/sound:p
If either switch is missing, the demo asks interactively:
1= 6 Mhz AT
2= 8 Mhz AT
3=10 Mhz AT
4=12 Mhz AT
5=16 Mhz 386
6=20 Mhz 386
7=25 Mhz 386
1=Sound Blaster
2=Covox on LPT1
3=Covox on LPT2
4=Nosound
The speed selection indexes a table at CS:0C4A; the selected word minus
0500h is stored at CS:0C48. Later the program divides that value by 60 and
stores the per-frame pacing threshold at CS:0C46.
The sound choice is stored at CS:0C58:
0 Sound Blaster path
1 Covox on LPT1
2 Covox on LPT2
3 no sound
The keyboard handler is installed by a far call to 5758:0045, raw file
offset 57705h. The handler at 576D2h reads scancodes from port 60h,
sets a byte at CS:0004, acknowledges the keyboard controller through port
61h, sends EOI to PIC port 20h, and returns with iret:
space scancode 39h -> CS:0004 = 1
escape scancode 01h -> CS:0004 = 2
key 1 scancode 02h -> CS:0004 = 3
The main loop only tests for value 1, so Space is the normal "continue/exit
this loop" key in the recovered path.
After setup the code switches to INT 10h, AX=0013h, clears the DAC to black,
puts VGA into a planar/unchained variant, clears A000, flips back to the other
VGA mode variant, and begins loading resources.
VGA Mode Helpers
The two VGA setup helpers are a good sign that this is not plain mode 13h code.
57F74h modifies Sequencer, Graphics Controller, and CRTC bits:
Sequencer 04h: clear bit 3, set bit 2
GC mode 05h: clear bit 4
GC misc 06h: clear bit 1
CRTC 14h: clear bit 6
CRTC 17h: set bit 6
57FAAh applies the complementary settings:
Sequencer 04h: set bit 3, clear bit 2
GC mode 05h: set bit 4
GC misc 06h: set bit 1
CRTC 14h: set bit 6
CRTC 17h: clear bit 6
The clear routines then rely on the Sequencer map mask:
; 57F59h - clear A000 through all planes
mov dx,03C4h
mov al,02h
out dx,al
inc dx
mov al,0Fh
out dx,al
mov ax,0A000h
mov es,ax
xor di,di
xor ax,ax
mov cx,8000h
rep stosw
57F3Eh is the same idea for segment A400h with 6000h words.
tu.dat Resource Loader
There are two close loader entry points in segment 417Dh.
417D:00E5, raw file offset 419F5h, opens a filename supplied by DS:SI,
reads EA60h bytes into CS:019Ch, closes the file, then decodes the block.
417D:013C, raw file offset 41A4Ch, opens hardcoded tu.DAT, changes DS
to the loader's segment, seeks to the 32-bit offset at loader DS:SI, reads up
to EA60h bytes into CS:019Ch, closes the file, then decodes the block.
The seek/read path is:
mov dx,0135h ; "tu.DAT" in the loader segment
mov ah,3Dh
int 21h ; open
mov dx,[si] ; low word of resource offset
mov cx,[si+2] ; high word
mov ax,4200h
int 21h ; seek absolute
mov cx,EA60h
mov dx,019Ch
mov ah,3Fh
int 21h ; read packed block
After the read, byte CS:00E2 selects the decoder:
0 -> 417D:0040 linear byte output
1 -> 417D:008F planar pixel output
The wrapper at 57F1Ch calls 417D:013C with ES=A000, then copies a
768-byte palette from the caller's data area into CS:00B6:
push di
mov ax,0A000h
mov es,ax
call 417D:013Ch
mov ax,5040h
mov ds,ax
pop di
mov si,di
mov di,00B6h
mov cx,0180h
rep movsw ; 0300h palette bytes
This explains the repeated call pattern near startup:
SI=EC0E DI=0300 load resource, palette at 5040:0300
SI=EC16 DI=0600 load resource, palette at 5040:0600
SI=EC1A DI=0900 load resource, palette at 5040:0900
SI=EBFE DI=0000 load resource, then carve blocks
SI=EC02 DI=0000 load resource, fade it in
The static seek table resolves the resource ownership exactly:
| Pointer | tu.dat offset |
Decoded role |
|---|---|---|
EBFEh |
0 | four red-headed runner mask/image pairs |
EC02h |
5,714 | forest background |
EC06h |
27,360 | stone UT window |
EC0Ah |
40,086 | credits |
EC0Eh |
65,728 | PC World Ruler opening |
EC12h |
83,537 | tiled source for the final strip renderer |
EC16h |
107,259 | Sucker Sander card |
EC1Ah |
122,205 | wanted-poster card |
EC1Eh |
146,709 | two flying-figure mask/image pairs |
EC22h |
150,829 | bulk mod.ball / Scream data |
The nine graphics streams are contiguous. Their compressed lengths, obtained
by subtracting adjacent seeks, are 5,714, 21,646, 12,726, 25,642,
17,809, 23,722, 14,946, 24,504, and 4,120 bytes. Each one expands
to exactly FA00h bytes before its later carving or display path takes over.
Bitstream Decoder
The linear decoder starts at raw file offset 41950h, corresponding to
417D:0040. It emits exactly FA00h bytes, a full 320x200 indexed image.
The bit cursor is stored in CL. The compressed stream starts at CS:019Eh,
so the first two bytes of the read block are not emitted as pixels. Each symbol
uses a decision bit extracted by loading two source bytes into AX and rotating
through carry:
mov si,019Eh
mov di,0000h
xor cx,cx
loop:
cmp di,FA00h
jae done
cmp cl,8
jne have_bit_pos
xor cl,cl
inc si
have_bit_pos:
lodsb
mov ah,al
lodsb
rcl ax,cl
push cx
mov cl,9
rcl ax,cl
pop cx
jae literal
If carry is clear, the low byte is a literal:
literal:
inc cl
stosb
dec si
jmp loop
If carry is set, the decoder takes AL as the repeated value, extracts a
second bitfield for the count, adds one, and writes a run:
run:
mov dh,al ; repeated value
dec si
lodsb
mov ah,al
lodsb
rcl ax,cl
push cx
mov cl,0Ah
rcl ax,cl
mov cl,al ; count byte
mov al,dh
xor ch,ch
inc cx ; run length = count + 1
rep stosb
pop cx
dec si
inc cl
jmp loop
417D:008F, raw file offset 4199Fh, uses the same token grammar, but replaces
each stosb with a planar pixel plotter at 4192Bh.
The planar plotter computes the VGA map mask from the low two bits of the linear pixel index:
; 4192Bh
push cx
push di
push dx
push ax
mov dx,03C4h
mov al,02h
out dx,al
inc dx
mov cx,di
and cl,03h
mov al,01h
shl al,cl
out dx,al
pop ax
pop dx
shr di,1
shr di,1
add di,cs:[0000h]
stosb
pop di
inc di
pop cx
ret
So the decoder walks a logical chunky pixel index while physically writing one
byte into one of four VGA planes. That alternative exists in the binary, but
417D:00E2 is statically zero and the recovered mainline contains no write that
enables it. The release resources above therefore take the linear decoder at
41950h; the planar plotter is a dormant alternative, not their active path.
Palette Machinery
The fade routines use real DAC reads/writes rather than just copying prepared tables.
57E90h clears the complete 256-color DAC:
mov dx,03C8h
xor al,al
out dx,al
inc dx
mov cx,0300h
out_loop:
out dx,al
loop out_loop
57D7Ch fades the current palette down. It first reads the DAC through
03C7h/03C9h into CS:00B6, then performs 64 outer fade steps. For every step
it writes the palette in four chunks of C0h bytes, decrementing nonzero
components and clamping values above 3Fh:
outer fade steps 40h
chunks per step 4
bytes per chunk C0h
total DAC bytes/step 300h
sync 03DAh wait between chunks/steps
57DFEh is the inverse-ish fade-in helper. It builds a temporary palette at
CS:03B9 from the saved palette at CS:00B6, using the current outer value as
a threshold, then outputs the full 300h bytes in four retrace-paced chunks.
The result is expensive but visually smooth for 1991: the code does not merely swap one palette into place; it repeatedly writes the DAC during vertical timing windows.
Block Carving And Masked Compositing
After loading the resource at offset zero, 5817Ch carves eight 72x61 blocks
from A000 into segment 174Dh. Its static source table at CS:0AACh is:
AC80 3480 ACCB 34CB AD16 3516 AD62 3562
The loop structure is simple and fixed:
for block in 0..7:
SI = source_offset_table[block]
for row in 0..60:
copy 72 bytes from A000:SI to 174D:DI
SI += 320
That is exactly 8*72*61 = 35,136 source reads and 35,136 scratch writes.
The paired compositor at 581BAh treats the selected block pair in 174Dh as
two images: an AND mask followed by OR data. CX selects the block pair:
block pair stride 1128h bytes
mask size 72 * 61 = 1128h
image size 72 * 61 = 1128h
destination segment 26EDh
row stride 320 bytes
The first pass applies the mask:
lodsb
and es:[di],al
inc di
The second pass ORs in the image bytes:
lodsb
or es:[di],al
inc di
One composition makes two 4,392-byte passes: 8,784 source reads, 8,784
read-modify reads of segment 26EDh, and 8,784 writes back to that RAM
surface. It does not touch VGA directly; 58401h later copies the composed
surface to A000. The animation makes four outer passes, selecting poses
3,2,1,0 on each pass. Across its 16 poses, DI starts at 58B6h, falls by
0Ch per pose and another 30h per four-pose pass, while the fixed delay
costs 16*20 = 320 retrace gates.
The second block family uses 5820Ch and 5824Ch. Its static source table at
CS:0AA4 is 5DC1 ADC1 5E1C AE1C; carving four 83x59 blocks costs 19,588
source reads and the same number of scratch writes. It composites them with
the same mask-then-image idea:
block pair stride 1321h bytes
mask size 83 * 59 = 1321h
image size 83 * 59 = 1321h
destination stride B6h bytes in the visible window
Each pose makes 9,794 source reads, 9,794 destination RMW reads, and 9,794
writes. The routine executes 32 poses—16 alternating mask/image pairs—on a
symmetric path from DI=5579h down through 0029h and back to 5579h.
Including each 36,400-byte scratch reset and 36,400-byte VGA-window blit, the
complete 32-pose phase performs 2,956,416 CPU memory reads, 2,643,008 CPU
memory writes, and 640 retrace gates.
This is a classic early VGA trick: precompute or decode rectangular sprites as mask/data pairs, then update the background by ANDing away pixels and ORing in the new shape.
Sliding Window Copies
The routines at 584C9h and 58544h implement a large vertical-window reveal.
58544h copies a 72-row, 91-word-wide window from segment 174Dh into A000.
The destination is:
DI = BX * 320 + 005Ah
Each row copies 5Bh words, then advances both source and destination by
8Ah bytes:
mov ax,bx
mov cx,0140h
mul cx
mov di,ax
add di,005Ah
mov cx,0048h
row:
push cx
mov cx,005Bh
rep movsw
pop cx
add si,008Ah
add di,008Ah
loop row
584C9h restores only the changed rows from segment 588Fh back to A000. It
compares the new BX against CS:0DDE, chooses forward or backward movement,
and copies only the delta. That makes the slide cheaper than redrawing the
whole 320x200 page every tick.
The authored trajectory calls the full-window copier 180 times: forward
BX=0..119 (120 calls), reverse 118..91 (28), and CRTC-assisted reverse
90..59 (32). Each call transfers 72*91*2 = 13,104 source bytes and 13,104
VGA bytes, for 2,358,720 bytes in each direction across the phase. The delta
restorer covers 179 rows total, or 32,578 source reads and VGA writes.
During the last 32 steps, CRTC start addresses fall from FFB0h to F600h by
50h. This part is still chained mode 13h, where start addresses are CRTC
doubleword units, so one 50h decrement moves the display by one 320-byte row.
Dormant Point/History Helper
5835Ah is a compact 64-point update fed by low-memory bytes at 0000:729E.
It waits until 0000:72DE >= 3Fh, then walks 64 entries:
old y = CS:0C5A[i]
clear A000[i + old_y * 320]
new y = low_memory_stream[i] >> 3
CS:0C5A[i] = new_y
plot A000[i + new_y * 320] = FFh
The address multiplication is done as y*64 + y*256, i.e. y*320:
mov al,cs:[bx]
xor ah,ah
mov cl,06h
shl ax,cl ; y * 64
add di,ax
shl ax,1
shl ax,1 ; y * 256
add di,ax ; total y * 320
After updating all 64 columns it resets 0000:72DE to zero. No near or far
call to 5835Ah appears in the recovered mainline, so this must not be used to
explain a captured object. It is retained here as dormant/helper machinery,
with no proven ownership of a visible phase in this release.
Main CRTC Strip Loop At 57FFCh

Graphics-stream 00:54.000 is a direct frame from the later forest phase: a
flying foreground figure, static tree backdrop and sliding stone UT panel.
The code below explains the phase's incremental planar strip and circular CRTC
surface; the broader block/window routines own additional layers in this
composition.
The most distinctive inner loop is called once per main-loop tick from
589A0h. It draws into a planar A000 area and scrolls it with CRTC start
address changes.
The mode transition establishes the geometry before the loop. 57F74h
selects unchained byte addressing, the CRTC offset remains 28h (80 bytes per
plane row), and 58130h programs line compare 0040h. With mode-13h double
scanning, the moving split is approximately 32 logical rows high. Consequently
the start value 7D02h+ring below is a plane-byte address, not a chained
mode-13h doubleword address.
State variables in segment 5040h:
13E8h frame/tick counter
13EAh ring offset, wraps at 0A00h
13ECh phase within current strip source
13EEh derived strip selector byte
13EFh source-frame index
The first block updates the source-frame index. It uses 13EEh to index a
threshold table at 0F6Ch, divides the selected threshold by four, and compares
it against the current phase:
mov dx,[13ECh]
mov bl,[13EEh]
xor bh,bh
add bx,0F6Ch
mov al,[bx]
shr al,1
shr al,1
xor ah,ah
cmp dx,ax
jb no_advance
inc word [13EFh]
...
mov word [13ECh],0
When the frame index reaches CS:093A, it wraps to zero and clears two history
bytes at CS:0936 and CS:0937.
Next it clears the old strip in all planes:
mov dx,03C4h
mov al,02h
out dx,al
inc dx
mov al,0Fh
out dx,al
mov di,[13EAh]
add di,7D00h
mov cx,20h
xor al,al
clear_loop:
stosb
add di,4Fh
loop clear_loop
STOSB advances DI once before the ADD DI,4Fh, so consecutive store
addresses are actually 80 bytes apart. The loop clears one addressed byte in
each of 32 rows of the unchained surface, not 32 contiguous screen pixels.
Then it scrolls the display by changing CRTC start address registers:
start = [13EAh] + 7D00h + 2
out 03D4h,0Dh
out 03D5h,low(start)
out 03D4h,0Ch
out 03D5h,high(start)
The next selector byte is generated from the source stream at
[CS:0938 + 13EFh] and two one-byte history values:
al = stream[13EFh]
CS:0937 = al
al ^= CS:0936
rol al,4
al ^= 3Eh
al -= 20h
[13EEh] = al
That byte is used to choose a 1 KiB-aligned source block and a four-byte planar
group inside it in segment 174Dh. The original AH shifts discard the
selector's top two bits; this is not the much smaller selector*4 expression:
tile_base = (selector & 3Fh) * 0400h
SI = tile_base + phase * 4
The four-plane draw is then explicit. For plane CL = 0..3, it writes map mask
1 << CL, copies 32 source bytes with source stride 1Fh and destination
stride 4Fh, then repeats the same strip 0A00h bytes lower:
for plane in 0..3:
set sequencer map mask = 1 << plane
copy 32 bytes:
A000:DI = 174D:SI
SI += 1Fh
DI += 4Fh
copy duplicate 32 bytes at DI + 0A00h:
A000:DI = 174D:SI
SI += 1Fh
DI += 4Fh
if DI >= 9100h:
DI -= 1400h
SI = original_SI + 1
Finally:
inc word [13EAh]
if [13EAh] == 0A00h:
[13EAh] = 0
inc word [13ECh]
ret
So the effect is a hardware-assisted ring scroller/strip animator. CRTC start
address moves the viewport through a 0A00h-byte circular region while the CPU
refreshes only one new vertical strip per tick. The duplicate write at +0A00h
keeps the wrap area valid so the CRTC scroll can cross the ring boundary
without exposing stale data.
Exact per-tick strip workload
The clear selects map mask 0Fh, so its 32 CPU byte stores update 128 VGA
plane bytes. The draw then runs four plane selections; each selection copies
32 source bytes into the primary strip and the same 32 bytes into its duplicate.
That is 256 source reads and 256 CPU framebuffer writes, each targeting one
selected plane. The complete routine therefore costs:
Work inside 57FFCh |
Per tick | Full 2,560-tick ring period |
|---|---|---|
| Source bytes read | 256 | 655,360 |
| CPU VGA byte writes | 288 | 737,280 |
| VGA plane-byte updates | 384 | 983,040 |
Port OUTs |
14 | 35,840 |
Port INs |
0 | 0 |
The fourteen outputs are two Sequencer writes for the all-plane clear mask, four CRTC index/data writes for the new start address, and two Sequencer index/data writes for each of four draw planes. Pacing-port reads and the PIC write belong to the caller and are excluded from this renderer-only ledger.
The destination geometry explains both constants in the duplicate loop. One
copy writes 32 addresses at an 80-byte pitch; 0A00h = 32*80 starts the second
copy in the other half of the backing ring, and 1400h = 64*80 is subtracted
when that second walk reaches 9100h. The ring offset increments once per
call and wraps only at 0A00h, giving the exact 2,560-tick period used in the
table. At the measured 70.0863 Hz, one complete traversal would take 36.526
seconds; this keyed run leaves the strip phase after only about one to two
seconds, so the capture does not demonstrate a full traversal.
The source selector is also bounded: CS:0938 = 0FCCh points to exactly
CS:093A = 0419h (1,049) selector bytes. Each selected 1 KiB block is 32 rows
by 32 bytes. For each of those 32 rows, the four plane passes consume four
adjacent bytes selected by
phase*4, then advance to the same group in the next row. Those four bytes are
already the four bitplanes for one addressed VGA byte, an eight-pixel-wide by
32-row strip. The renderer therefore performs no live bit shifting or planar
deinterleave; it only selects a prepared strip, writes it once, and mirrors it
into the wrap half of the ring.
Main Loop And Timing
The main loop at 5898Ah sets:
DS = 5040h
ES = A000h
CX = 0A82h
PIC mask = FCh
FCh leaves timer and keyboard enabled while masking the other IRQs. It is
written once before the first iteration; the end of that frame and every later
frame writes 00h, unmasking all IRQs. The caller also loads CX=0A82h, but
that is not an automatic pass budget:
57FFCh uses CX for its 32-row and four-plane loops and returns with CX=4.
Every iteration:
inc word [13E8h]
call 57FFCh
Then it waits around VGA status port 03DAh and a timer counter at
0000:735E:
wait until not in vertical retrace
wait until 0000:735E > CS:0C46 or retrace starts
clear 0000:735E
unmask PIC
if CS:0004 != 1:
jump unconditionally to the next tick
There is no caller-side LOOP instruction: 589D5h is an unconditional jump
to 5899Bh. The main effect therefore does require Space, exactly as the IRQ 9
mailbox analysis indicates. The visual loop has no DOS keyboard polling inside
it; keyboard input is reduced to one byte by the interrupt handler.
On exit it fades down and BIOS mode 13h resets the VGA/CRTC state before the
credits. The final wait accepts any nonzero keyboard-mailbox value, unlike the
strip loop's Space-only test. Cleanup restores the original IRQ-9 vector at
5758:0066, but the handler never chains BIOS while installed, so those keys
do not enter the BIOS keyboard buffer. It writes FFFFh to PIT channel 0 and
does not restore a saved divisor or the original PIC mask. Finally it switches
to text mode 03h and exits through INT 21h, AX=4C00h.
Bulk Loader At 73A3h
The far call at 58915h goes through 0000:73A3, raw file offset 74E3h.
This is a larger tu.dat loader used after the earlier picture stages.
Input:
CX:DX absolute offset inside tu.dat
DS caller destination segment
The loader:
- Opens
tu.dat. - Seeks to the supplied offset.
- Reads a
30h-byte header to7369h. - Reads
3E0hbytes to5398h. - Reads
80hbytes to5798h. - Seeks to original offset +
0490h. - Reads the low 16 bits of
[738Ah] << 10into segment074Dh. - Enters a segmented streaming loop whose full-chunk request is
F000h, advancing DS by0F00hparagraphs after a full chunk. - Applies a small relocation/adjustment table at
53A6h, up to 31 entries.
For this release, [738Ah]=4007h; the 16-bit ten-place shift wraps to 1C00h,
so step 7 reads 7,168 bytes. The following stream receives one short
9196h = 37,270-byte read and terminates rather than processing repeated
F000h chunks. The generic chunk structure avoids crossing a segment boundary,
but describing repeated full chunks would be wrong for this actual tu.dat.
Sound Path
The startup code branches on CS:0C58.
For Sound Blaster it calls the sound setup path at 0000:7345 and then
0000:72FA. For Covox it reads the BIOS LPT base address from 0040:0008 or
0040:000A, stores it in DX, and calls 0000:7316. The no-sound setting
skips this setup and lets the visual loop run with only timer/keyboard pacing.
The visible setup text says no sound "will improve the speed but not the demo", which matches the code structure: audio installs interrupt-side work, while the visuals still run from the same retrace/timer loop.
The sound code is larger than the surrounding VGA helpers and includes sample
or pattern state tables around 5798h, 581Ah, and 68C7h. I have not treated
it as a full music-driver dissection here because the interesting demo-specific
part is the graphics/resource pipeline; the audio path is a reused driver-style
subsystem.
What The Demo Is Doing
At a high level, Anti-svd is built around a compact data pipeline:
packed MZ -> setup -> VGA mode helpers -> tu.dat resource blocks
-> bitstream picture decode -> palette fade
-> block carve/masked composite/slide
-> planar CRTC strip loop
The early resource stages are full-screen or large-window effects, decoded from
tu.dat and made presentable with palette fades. The middle stages carve and
composite rectangular elements through scratch segments. The final loop is more
engine-like: it maintains a scrollable unchained VGA ring and draws only the
new strip needed for the next frame.
The exact tu.dat seeks, decoded ownership, carving coordinates, pose counts,
window trajectory, and final strip workload are all present in the restored
image. The remaining boundary is narrower: without an instruction-pointer
trace, runtime timestamps can be aligned to the proved loop budgets and visible
state changes but not assigned to a specific instruction cycle. The article
therefore reports exact static counts and bounded capture concordance rather
than pretending the video itself sampled execution addresses.