Analysis model: gpt-5.5 xhigh

# Yersinia Pestis by tArzAn tuotanto - Technical Dissection

## Scope

This is a binary-level analysis of **Yersinia Pestis**, the July 1995 MS-DOS
demo by tArzAn tuotanto. It placed 11th in the Juhla 1995 2½ PC demo
competition. The production credits tArzAn for code and graphics, narSiSSi for
graphics, tOOga for music, and MIDAS for music replay.

Public references:

- Demozoo production: https://demozoo.org/productions/28278/
- Pouet production: https://www.pouet.net/prod.php?which=814
- Scene.org archive page: https://files.scene.org/view/parties/1995/juhla95-2/demo/pestis.zip
- Direct archive used here: https://files.scene.org/get/parties/1995/juhla95-2/demo/pestis.zip
- Official Juhla 1995 2½ results: https://demozoo.org/parties/623/results_file/65/

The important finding is not the list of pictures. The restored program is a
large real-mode Turbo Pascal MZ executable with a music-position dispatcher,
several related fixed-point 3D engines, a particle/X-wing section, a planar
VGA checkerboard effect, a temporal motion-blur loop, a generated landscape
normal field, and a real four-neighbour antialias pass. The code contains no
reachable x87 instructions in the mapped demo path: projection, rotation,
depth ordering, shading, blur, and filtering are all integer work.

This is not a source reconstruction. Function names are descriptive labels
assigned from disassembly, resource use, and direct runtime concordance.

## Examined Archive

The archive used for this pass is the party-path `pestis.zip`:

```text
deb47a4e433e35adacdce0ee3313f5845638eb00d67eae5e69128b4240e6ae15  pestis.zip
```

Original files:

| File | Bytes | SHA-256 |
| --- | ---: | --- |
| `PESTIS.EXE` | 651,869 | `c0f1760780c2f98515d0af870a2c02b55b9348adf1c8e442149b594378f8bdd4` |
| `MSETUP.EXE` | 25,215 | `d17961122001411d68cde11cc83d332f7fdf73e4cde4b5517c93c01b7b803d94` |
| `PESTIS.NFO` | 1,908 | `5146802893b5eeb8f955d37ef9ea22777f70a36c145b21dcf7a1f23b40eec287` |
| `FILE_ID.DIZ` | 310 | `cbc4395f7439aba1846d64c042ea4cc93c5959fa551990cbe25dd55f02d95224` |

`MIDAS.CFG` is not in that archive. The copy used during the runtime pass was
created locally by the supplied setup program. Keeping that distinction
matters because otherwise a generated machine configuration looks like part
of the historical release.

`PESTIS.NFO` calls the production an official release, requires VGA and a
386 or better, and marks GUS and Sound Blaster support. Its deliberately
self-deprecating one-line technical summary translates roughly as “the
routines are pretty lousy.” The restored code is more interesting than that
description suggests.

## Two Packed Executables Before The Real Program

The original `PESTIS.EXE` is not the renderer. It is a small packed MZ front
followed by an XLink/XLC virtual filesystem.

The original MZ header describes only 2,392 bytes of executable image inside a
651,869-byte file:

```text
file size:                  651,869 bytes
declared MZ image:            2,392 bytes
MZ header:                       32 bytes
relocations:                       1
entry:                     fff0:0100
```

UNP restores that outer executable to a conventional 2,724-byte MZ image while
leaving the attached data intact:

```text
restored outer size:         652,201 bytes
restored MZ image:             2,724 bytes
restored header:                  64 bytes
restored relocations:              8
restored SHA-256:
f0472af55cee2da7b106bfa3c4f0b21b67fbb514ccd46ee4a4ec56839c94717d
```

At absolute file offset `0x0aa4` is the XLC header:

```text
58 4c 02 82 00 00 00 00 11 00 ...
X  L                       17 entries
```

The 544-byte directory is byte-obfuscated. For directory byte position `i`,
the decoded byte is:

```text
decoded[i] = stored[i] - (i & 255)
```

Data begins at absolute offset `0x0cd4`. The embedded `TAATDEMO.EXE` begins at
`0x0d61` and is itself packed:

```text
packed TAATDEMO.EXE:          90,345 bytes
SHA-256:
1e1989ae432f0ee29a8abc146b5cd86755d55670306f1253481e2729ef6e75dc
```

Its MZ header again has the characteristic packed entry `fff0:0100` and only
one relocation. A second UNP pass recovers the actual program:

```text
restored TAATDEMO.EXE:       169,008 bytes
MZ header:                     6,848 bytes
load image:                  162,160 bytes
relocations:                   1,702
entry:                     0000:98fb
stack:                     2a6b:4000
restored executable SHA-256:
a242e7d6f2c318fb728c96818ccac900825f70f53916bc171394e2388b402b88
load-image SHA-256:
34e3437e0fa9489533e1befcbb97334e896235e4cd5c7885af1af3b5916f3631
```

That 1,702-entry relocation table is a useful warning against analyzing the
90 KB inner carrier as if it were the demo. The renderer is the 162,160-byte
load image behind both packing layers.

## Embedded Resource Files

The XLC container holds the inner executable, the music, twelve normal PCX
files, one raw checkerboard stored under a `.PCX` name, and a label atlas.

| Resource | Bytes | Role proved by code or decoding |
| --- | ---: | --- |
| `TAATDEMO.EXE` | 90,345 | Packed inner program |
| `PESTIS.S3M` | 207,312 | Scream Tracker 3 score and master timeline |
| `PESTIS00.PCX` | 27,753 | tAAt logo/title image |
| `PESTIS01.PCX` | 5,740 | `Presents` title |
| `PESTIS02.PCX` | 23,620 | `Yersinia Pestis` title |
| `PESTIS03.PCX` | 12,254 | Owl image |
| `PESTIS04.PCX` | 23,563 | Credits page |
| `PESTIS05.PCX` | 16,422 | Greetings page |
| `PESTIS06.PCX` | 18,228 | Closing text/formula image |
| `PESTIS07.PCX` | 6,024 | `tArzAn tuotanto 1995` ending |
| `PESTIS08.PCX` | 61,807 | Green material texture/palette source |
| `PESTIS09.PCX` | 8,000 | Raw 320x200 one-bit checkerboard, not PCX |
| `PESTIS10.PCX` | 25,831 | `Flong Motionblur + Delay` bitmap |
| `PESTIS11.PCX` | 3,297 | Palette carrier; decoded pixel plane is index zero |
| `PESTIS12.PCX` | 62,069 | Purple checker/`IH` texture and palette |
| `PESTIS99.PCX` | 56,511 | 4x4 atlas of sixteen 80x50 effect labels |

The S3M hash is:

```text
a4ae57eb496a202f69a2c6ef429ade51fd917582dd896045a828c6fd969ff142  PESTIS.S3M
```

Calling `PESTIS11.PCX` a blank picture would miss its actual job. Its decoded
pixel plane is all palette index zero, but it carries the palette installed by
the motion-blur part. The code uses it as a palette resource, not as a visible
bitmap.

## The Label Atlas Is Executable Presentation Data

`PESTIS99.PCX` is a 320x200 image divided into sixteen 80x50 cells:

```text
row 0: Demo | Multiple Materials | Ugly Picture | Effect
row 1: Line Vector | Ugly Shading | Bitmap Stretcher | Ugly Space
row 2: X-Wing Attack | Fractal Landscape | Techno Light | Ugly + Antialias
row 3: Screen With Text | Another Screen With Text | tAAt logo | Blank Screen
```

The helper at load offset `0x0471` converts label number 1..16 into source
coordinates `(0,80,160,240)` by `(0,50,100,150)`. It then reveals the cell in
ten retrace-paced steps. At step `s`, it copies `5*s` rows of 80 bytes to x=240
and y=`199-5*s` in `A000h`.

The copy loop at `0x05d5..0x067b` is equivalent to:

```text
for scale = 1 .. 10:
    wait_frame()
    rows = 5*scale
    for row = 0 .. rows-1:
        src = atlas + tile_y*320 + tile_x + row*320
        dst = A000:((199-5*scale)*320 + 240 + row*320)
        far_copy(dst, src, 80)
```

So the recurring lower-right title is not sixteen separate animations. It is
one decoded atlas plus a small rising-window copier. That also explains why
the visual titles and the implementation boundaries do not always line up
one-to-one: several controller functions can sit under one named label.

## MIDAS Position Is The Master Clock

The restored entry eventually initializes MIDAS, loads `pestis.s3m`, installs
mode 13h, allocates a 64,016-byte screen buffer, and loads the label atlas.

Two tiny helpers query the player:

```asm
; 041b: current order position
les  di,[c7e6]
lcall es:[di+28h]
les  di,[c7ee]
mov  al,es:[di+08h]
ret

; 0446: current pattern row
les  di,[c7e6]
lcall es:[di+28h]
les  di,[c7ee]
mov  al,es:[di+0ch]
ret
```

Runtime behavior proves the fields at `+8` and `+0c` are order and row. The
S3M has 22 order bytes, 13 instruments, and 21 patterns. It starts at speed 8
and tempo 125, making a normal 64-row order last 10.24 seconds. Its effective
order list is:

```text
00 01 03 02 06 07 18 10 04 05 11 12 13 14 15 19 20 08 09 16 ff ff
```

Pattern 16 ends with `B03` at row 63, looping to order position 3. The visual
dispatcher is therefore following the S3M order list, not assuming that
pattern numbers are sequential.

Every long-running part receives an order/row target in globals at `c7e4` and
`c7e2`. Its frame loop continues until both comparisons have passed:

```asm
call 041bh            ; AL = current order
xor  ah,ah
mov  dx,ax
mov  ax,[c7e4]        ; target order
dec  ax
cmp  ax,dx
jae  render_next_frame

call 0446h            ; AL = current row
xor  ah,ah
mov  dx,ax
mov  ax,[c7e2]        ; target row
dec  ax
cmp  ax,dx
jae  render_next_frame
```

The use of `target-1` turns the unsigned comparisons into an inclusive wait.
The visuals advance from the player's current order and row rather than from
a guessed wall-clock delay.

## Top-Level Controller Map

The main dispatcher begins at load offset `0x98fb`. Capstone sometimes prints
near calls such as `call 106afh`; on a 16-bit near call the IP wraps, so the
real target is `06afh`. The same applies to `1041bh`, `10446h`, and `10471h`.

| Target order:row | Routine | Code role |
| ---: | ---: | --- |
| startup | `06af` | Three title PCXs and `Demo` label |
| `03:20` | `0a67` | 240-vertex / 480-face Multiple Materials object |
| `04:01` | `1616` | Owl PCX, palette, and `Ugly Picture` label |
| `04:55` | `16be` | Raw checkerboard in planar VGA mode |
| `05:14` | `1d2e` | 116-vertex / 236-face Line Vector object |
| `05:36` | `2673` | 325-vertex / 382-face wire object |
| `05:60` | `2f8b` | 1000-vertex / 2000-face dense wire torus |
| `06:10` | `369b` | Bitmap Stretcher using `PESTIS10.PCX` |
| `08:01` | `39e3` | Object renderer plus temporal blur/decay |
| `08:45` | `464a` | Second Line Vector section |
| `09:20` | `4fa2` | Generated grid/space transition |
| `10:01` | `585d` | 72-vertex / 144-face Ugly Shading object |
| `11:30` | `61e5` | 73-vertex / 142-face Ugly Space object |
| `12:25` | `6a3f` | X-Wing Attack particle field |
| `13:60` | `7065` | 256-vertex landscape with generated normals |
| `14:20` | `7aba` | Techno Light palette flashes |
| `15:20` | `7d4a` | 325-vertex object plus spatial antialias pass |
| `17:30` | `86c1` | 240-vertex logo object plus temporal averaging |
| hard-coded | `919a` | Credits, greetings, and closing text pages |
| final | `953f` | Bottom-band feedback and blank-screen label |

The controller itself is unusually readable after restoration:

```asm
mov word [c7e4],03h
mov word [c7e2],14h
call 0a67h

mov word [c7e4],04h
mov word [c7e2],01h
call 1616h

; ...same pair of stores before each effect...

mov word [c7e4],11h
mov word [c7e2],1eh
call 86c1h
call 919ah
call 953fh
```

This is a complete authored route. There is no hidden menu of unrelated
parts; the S3M position and this call chain define the show.

The direct capture below shows the third title PCX before the dispatcher enters
the generated effects:

![Yersinia Pestis runtime title rendered from PESTIS02.PCX](images/yersinia-pestis-runtime-title.png)

## Fixed-Point 3D Family

Several effects are variations of one integer pipeline rather than unrelated
routines. The strongest common signatures are:

- two 361-word sine/cosine tables (`0x2d2` bytes each);
- 16- or 20-byte vertex work records;
- six-byte face records containing three vertex indices;
- twelve signed multiplies to assemble a Q7 rotation matrix;
- `sar ...,7` after matrix products;
- perspective division after an eight-bit numerator shift;
- average face depth followed by a paired depth/index quicksort;
- reverse traversal of that index list for back-to-front drawing.

A reachable-control-flow scan across the mapped dispatcher and effect routines
found 11,322 instructions. It found zero x87 instructions, but 234 `imul`, 92
`idiv`, 72 `sar`, and 700 `shl` instructions. Those counts are not a claim
about the whole Pascal runtime; they describe the mapped demo path and its
local helpers.

The transform core has the recurring shape:

```asm
mov  ax,sine_or_cos
mov  bx,vertex_component
imul bx
mov  cx,ax
mov  ax,other_term
imul bx
add/sub cx,ax
sar  cx,7              ; Q7 result
```

Projection in the large object parts is similarly direct:

```asm
mov  ax,transformed_y
shl  ax,8
cwd
idiv word es:[di+0ah]  ; depth
add  ax,100
mov  es:[di+08h],ax

mov  ax,transformed_x
shl  ax,8
cwd
idiv word es:[di+0ah]
add  ax,160
mov  es:[di+06h],ax
```

Some parts use nearby centers such as `(130,80)` or `(110,100)`, but the data
flow is the same: rotate in Q7, translate depth, project with integer division,
sort faces, then draw.

## Multiple Materials: 240 Vertices, 480 Faces

Routine `0x0a67` loads `PESTIS08.PCX`, allocates two screen-sized buffers,
2,880 bytes for 480 six-byte face records, 7,680 bytes for 240 32-byte-ish
source/work slots, and two 722-byte trig tables.

The exact static counts are visible in the initialization loops:

```text
vertices: indices 0..239 = 240
faces:    indices 0..479 = 480
```

Each frame builds the Q7 rotation terms, transforms all 240 vertices, projects
around `(160,100)` with camera depth 300, averages the three depths of each
face, quicksorts 480 `(depth,face-index)` pairs, and walks the list from 480
down to 1.

The face renderer contains an explicit branch on `(face_index & 8)`. One path
passes projected coordinates directly; the other scales selected endpoint
parameters by ten before reaching the common polygon routine at `0x086f`.
This proves two rendering parameter paths grouped in the mesh data. Calling
the exact visual result “two materials” is supported by the demo's own label;
the lower-level branch is proved, while the artistic material interpretation
is not invented beyond that.

This continuous runtime GIF shows the 240-vertex object and the atlas label
rising at the lower right:

![Multiple Materials rotating object and generated label reveal](images/yersinia-pestis-runtime-materials.gif)

## The Planar Checkerboard Is Not A PCX Effect

Routine `0x16be` opens `PESTIS09.PCX` as an ordinary file and reads 200 rows
of 40 bytes into an 8,000-byte buffer. That is exactly 320 one-bit pixels per
row. The file has no PCX header.

The routine then switches to BIOS mode `0dh`, builds two moving 200-byte edge
arrays, and writes four VGA planes through Sequencer map masks `08h`, `02h`,
`01h`, and `04h`. Each output row selects a 40-byte checker source row using a
different weighted combination of its two moving edge values.

One representative plane path is:

```asm
mov ax,0202h
mov dx,03c4h
out dx,ax              ; select one VGA plane

; for each of 200 rows
al = edge_a[row]
dx = edge_b[row]
ax = (3*al + dx) >> 8
src = checker + ax*40
dst = A000 + row*40
copy 40 bytes
```

The other planes use different mixes, including `(a+b)/2` and
`(12*b+a)>>8`. The perspective/checker motion therefore comes from selecting
different source rows independently for four bitplanes, not from scaling a
320x200 chunky bitmap.

The direct frame shows the resulting independently warped checker planes:

![Planar checkerboard effect generated from the 8000-byte one-bit source](images/yersinia-pestis-runtime-planar-checker.png)

## Line Vector Escalation

The first Line Vector routine at `0x1d2e` allocates:

```text
1,416 bytes = 236 * 6-byte face/index records
2,320 bytes = 116 * 20-byte vertex work records
  400 bytes = 200 word row offsets
2 * 722 bytes for sine/cosine tables
```

It loads 116 static vertices and 236 index triples. Each frame applies the Q7
rotation and projects around `(130,80)`:

```text
screen_y = (transformed_y << 8) / depth + 80
screen_x = (transformed_x << 8) / depth + 130
```

The face depth is the average transformed z of its three vertices. The paired
depth/index arrays are sorted, traversed in descending order, and the three
projected points are sent to the local line/triangle routine at `0x1b1e`.

The following two controller functions are deliberate escalations of the same
architecture:

| Routine | Vertices | Faces |
| ---: | ---: | ---: |
| `1d2e` | 116 | 236 |
| `2673` | 325 | 382 |
| `2f8b` | 1,000 | 2,000 |

That code progression explains the runtime progression from a sparse object
to the very dense wire torus. It is not eight copies of one picture; it is
three meshes pushed through increasingly large work and sort arrays.

## Bitmap Stretcher

Routine `0x369b` loads `PESTIS10.PCX` into a screen-sized buffer. Its first
100-step loop calls the rectangle transfer routine with bounds derived from
`99-i`, `220+i`, and `100+i`, expanding a centered rectangle outward.

The second loop runs 80 times. For each `i` it performs four consecutive
operations for phase offsets `4*i+0` through `4*i+3` while retaining the full
320x200 source. The code-level conclusion is a four-phase strip/stretch pass;
the exact visible distortion is confirmed by the capture rather than guessed
from the helper's Pascal runtime entry alone.

## Temporal Motion Blur And Palette-Bank Decay

Routine `0x39e3` loads `PESTIS11.PCX` for its palette, builds another
240-vertex / 480-face object pipeline, and renders into a current-frame buffer.
After drawing, the inner loop at `0x43d4` blends every pixel with the previous
frame:

```asm
mov  cx,0fa00h          ; 64,000 bytes
blend:
xor  ax,ax
xor  bh,bh
mov  bl,[current+si]
add  ax,bx
mov  bl,[history+di]
add  ax,bx
shr  ax,1
mov  [history+di],al
inc  si
inc  di
dec  cx
jne  blend
```

In formula form:

```text
history[p] = (current[p] + history[p]) >> 1
```

The next loop is unrolled eight ways. It runs 8,000 iterations, therefore also
touching exactly 64,000 pixels. Each lane does:

```text
if history[p] >= 16:
    history[p] -= 16
```

The palette is arranged in banks, so subtracting 16 decays a pixel by one
intensity bank without a multiply or lookup. The visible trail is therefore
the product of two distinct mechanisms: half-and-half temporal feedback and
a one-bank per-frame decay.

The continuous runtime GIF shows the dense object while that history buffer is
being accumulated and decayed:

![Dense object rendered through temporal averaging and palette-bank decay](images/yersinia-pestis-runtime-temporal-blur.gif)

## X-Wing Attack Is A 100-Record Particle System

Routine `0x6a3f` allocates 1,000 bytes and initializes 100 ten-byte records:

```text
+0  signed x, randomized to -5000..4999
+2  signed y, randomized to -5000..4999
+4  depth, randomized to 1..63
+6  projected x
+8  projected y
```

Initial projection is:

```text
screen_x = x / depth + 159
screen_y = y / depth + 99
```

For every live record, the renderer computes `size = 10 - (depth >> 2)` and
draws two crossing diagonals around the projected point. Each frame advances
the record with three globals:

```text
depth += signed_byte[8b14]
x     += word[8b16]
y     += word[8b18]
```

If depth leaves 1..63, the record is randomized and reprojected. The second
half of the frame redraws the crosses using color `63-depth`, so nearer and
farther particles occupy different palette levels. This is the literal
implementation behind the `X-Wing Attack` label: 100 independently recycled
perspective points rendered as tiny X shapes.

## Fractal Landscape Builds Its Own Vertex Normals

Routine `0x7065` is the most structurally interesting 3D part. It allocates:

```text
 2,700 bytes = 450 * 6-byte faces
 8,192 bytes = 512 * 16-byte vertex/normal records
 2 * 722-byte sine/cosine tables
64,016-byte screen buffer
```

The static object supplies 256 position records and 450 triangles. The code
then uses records 257..512 as a second 256-element field. For each original
vertex it scans all 450 faces. Whenever a face contains that vertex index, it
loads the triangle's three positions and calls the vector helper at `0x17fa:002b`.
The three returned components are accumulated in 32-bit sums.

After the face scan, each sum is divided by the number of matching faces and
then divided by three before being stored in the corresponding second-half
record. In pseudocode:

```text
for vertex = 0 .. 255:
    sum = (0,0,0)
    count = 0
    for face = 0 .. 449:
        if vertex in face.indices:
            sum += triangle_vector(face)
            count++
    generated[vertex] = (sum / count) / 3
```

This is not just a projected height field. It precomputes a per-vertex vector
from all adjacent triangles, then transforms both the position half and the
generated normal half through the same Q7 rotation path. The triangle drawer
at `0x6e71` converts those transformed per-vertex values into three shade
parameters before calling the shaded polygon helper.

The word “Fractal” is the demo's label. The reconstructed mechanism proves a
256-vertex, 450-face landscape mesh with adjacency-derived normals and
per-vertex shading; it does not prove a particular mathematical fractal
generator in this restored runtime.

The captured landscape frame confirms the shaded mesh and the label produced
by the shared atlas helper:

![Fractal Landscape shaded mesh with lower-right atlas label](images/yersinia-pestis-runtime-landscape.png)

## Techno Light Is A Deliberately Tiny Part

Routine `0x7aba` has no geometry. It installs label 11, waits for retrace,
writes one random RGB triplet with each component in `48..63`, waits again,
then writes black. It repeats until the next order/row target.

That is a useful counterexample to judging complexity by screen activity. The
rapid light flashes are implemented by little more than three bounded random
calls and two palette writes per iteration.

## Ugly + Antialias Has A Real Spatial Filter

Routine `0x7d4a` is another full Q7 renderer, this time with 325 vertices and
382 faces. The label is not marketing pasted over an unrelated object: after
the sorted geometry pass, `0x841e..0x844d` performs a four-neighbour filter
while copying the useful interior from the offscreen buffer to VGA.

```asm
mov dx,00c6h            ; 198 rows
mov si,015ah
mov di,015ah
row:
mov cx,00c8h            ; 200 pixels
pixel:
xor ax,ax
xor bh,bh
mov bl,[si-0140h]       ; above
add ax,bx
mov bl,[si-1]           ; left
add ax,bx
mov bl,[si+1]           ; right
add ax,bx
mov bl,[si+0140h]       ; below
add ax,bx
shr ax,2
mov es:[di],al
inc si
inc di
dec cx
jne pixel
add si,0078h            ; 320 - 200
add di,0078h
dec dx
jne row
```

The pass averages above, left, right, and below for a 200x198 central region.
It intentionally omits the center sample. The remaining side regions are
copied separately afterward. So the visible softening is a genuine
framebuffer-space cross filter, not merely Gouraud shading or a blurred source
texture.

The continuous runtime GIF shows the filtered object rotating while the
`Ugly + Antialias` atlas cell remains visible:

![Ugly plus Antialias rotating object after the four-neighbour output pass](images/yersinia-pestis-runtime-antialias.gif)

## Logo Part: Packed Four-Pixel Temporal Average

Routine `0x86c1` loads `PESTIS12.PCX`, constructs 240 source vertices and 480
faces, generates another set of adjacency-derived records, and runs the same
Q7 transform/depth-sort family.

Its feedback path at `0x9090` works on four pixels at a time:

```asm
mov  cx,03e80h          ; 16,000 dwords = 64,000 pixels
loop:
mov  eax,es:[di]        ; history
add  eax,[di]           ; current
shr  eax,1
and  eax,7f7f7f7fh
mov  es:[di],eax
add  di,4
dec  cx
jne  loop
```

The mask clears the top bit of every byte after the packed shift. The loop is
a 386 optimization of the same temporal-average idea seen earlier, processing
an entire mode-13h frame in 16,000 iterations rather than 64,000 byte
iterations.

## Credits And Ending Wipes

Routine `0x919a` loads `PESTIS04`, `PESTIS05`, and `PESTIS06` in sequence. The
first two use the `Screen With Text` and `Another Screen With Text` atlas
labels. Each page enters from the left as a growing column band while random
rows are copied repeatedly, then the completed offscreen page is transferred
to VGA.

Unlike the normal effect routines, these transitions wait on hard-coded S3M
positions:

```text
order 18, row > 30  -> greetings
order 19, row > 10  -> closing text
order 19, row > 39  -> finish credits sequence
```

The final routine at `0x953f` loads `PESTIS07.PCX` and keeps only a 34-row band
from y=166 to y=199 in its feedback buffers. Its unrolled inner loop covers
10,880 bytes (`0x440 * 10`) per frame. Each lane computes:

```text
history[p] = (new[p] + 3*history[p]) >> 2
```

That weighting comes directly from one addition of the new byte, three
additions of the old byte, and `shr ax,2`. It is a slower temporal convergence
than the earlier half-and-half blur. After the final hold, label 16 (`Blank
Screen`) rises and the routine restores text mode and returns through the main
program cleanup.

The credits frame below shows the horizontal reveal in progress, including the
atlas-generated `Screen With Text` label:

![Yersinia Pestis credits page during the code-driven horizontal reveal](images/yersinia-pestis-runtime-credits.png)

## Direct Runtime Concordance

The exact party archive was run under DOSBox-X 2026.01.02. MIDAS setup 0.40a
selected GUS at port 240h and 16-bit mono output. Host playback remained muted;
the emulated music state was retained because the code uses it as the visual
clock. The program completed its authored route, returned normally to DOS, and
the external capture lasted about 214.76 seconds including boot and shell
time.

Representative capture states line up with the dispatcher as follows:

| Capture time | Visible state | Binary concordance |
| ---: | --- | --- |
| `00:05..00:18` | tAAt / presents / Yersinia Pestis titles | `06af`, three PCX loads and order/row waits |
| `00:21..00:38` | green rotating torus, Multiple Materials | `0a67`, 240 vertices, 480 faces, material-path branch |
| `00:40..00:44` | owl page | `1616`, `PESTIS03.PCX` and label 3 |
| `00:45..00:53` | moving checker | `16be`, 8,000-byte one-bit source and four VGA planes |
| `00:54..01:23` | progressively denser wire objects | `1d2e`, `2673`, `2f8b` mesh escalation |
| `01:26..01:54` | Line Vector / shading / space sequence | `464a`, `4fa2`, `585d`, `61e5` |
| `02:08..02:20` | shaded landscape | `7065`, 256 positions plus 256 generated normals |
| `02:25..02:58` | Techno Light, antialiased object, purple torus | `7aba`, `7d4a`, `86c1` |
| `03:04..03:20` | credits, greetings, closing page | `919a`, hard-coded order/row waits |
| `03:20..03:28` | final tArzAn image and blank-screen label | `953f`, weighted lower-band feedback |

The capture is evidence for appearance and authored order. Counts, offsets,
record sizes, arithmetic, sorting, and filtering above come from the restored
binary rather than from visual inference.

## What The Code Is Optimizing For

Yersinia Pestis is a useful snapshot of mid-1995 real-mode PC demo engineering:

- XLC keeps one apparent executable while preserving separately named assets.
- MIDAS order and row remove the need for a second visual timing script.
- Q7 trigonometry makes the repeated 3D paths entirely integer-based.
- Six-byte index triples and paired quicksort arrays keep face ordering simple.
- Mode 13h gives the chunky effects a linear 64,000-byte target.
- Mode 0dh and four map masks make the checker part cheap in one-bit source
  data even though its output moves independently per plane.
- Palette banks turn blur decay into `subtract 16` instead of a table lookup.
- Temporal filters use byte loops where necessary and a 386 dword loop where
  four packed pixels can be processed together.
- The antialias pass limits itself to a 200-pixel-wide interior, avoiding edge
  clipping logic and leaving the side regions to ordinary copies.
- Landscape normals are generated once from mesh adjacency rather than stored
  as another large static table.

The demo's visual labels are jokey and often self-critical. The restored code
is quite systematic: a compact presentation layer around a family of reusable
mesh, sort, palette, and framebuffer mechanisms.

## Limits Of This Pass

- The Pascal and graphics-library far-call symbols are not recovered, so
  library helpers are described only where their arguments and observed result
  make the role bounded.
- The exact static mesh identities are not named beyond what the demo labels
  and runtime show.
- The `(face_index & 8)` split in Multiple Materials is proved, but a fuller
  reconstruction of the polygon helper would be required to name every shade
  or material parameter precisely.
- `Fractal Landscape` is the production's own title. This pass proves mesh
  adjacency, generated per-vertex vectors, projection, depth sorting, and
  shaded drawing; it does not claim to have recovered a separate fractal
  height generator.
- The analysis maps the authored path and its local helpers, not every branch
  of the linked Turbo Pascal and MIDAS runtime.
