Analysis model: gpt-5.5 xhigh

# Plasma Intro by The Raven / The Brain - Technical Dissection

`Plasma Intro` is a 1992 MS-DOS intro credited in the Hornet archive as
`Plasma by Raven, Brain`. Pouet's Raven group listing names it as `Plasma
Intro` with The Brain, released in December 1992. The preserved Hornet archive
is `plasma.zip`, 9,428 bytes, containing one packed COM file:
`plasma.com`, 9,973 bytes, dated 3 December 1992.

Release year: 1992.

The program contains an end text/contact screen with old personal/postal/BBS
contact material. This writeup deliberately omits those details and publishes
only effect-only plasma frames plus a generated code-path map.

## Sources Checked

- Hornet 1992 index on scene.org:
  `https://files.scene.org/get/mirrors/hornet/demos/1992/00_index.txt`
- scene.org archive:
  `https://files.scene.org/get/mirrors/hornet/demos/1992/plasma.zip`
- Hornet search result for Raven:
  `https://hornet.org/cgi-bin/scene-search.cgi?search=Raven`
- Pouet Raven group page:
  `https://www.pouet.net/groups.php?which=1447`

Archive evidence:

```text
Archive: plasma.zip
  Length      Date    Time    Name
     9973  1992-12-03 00:51   plasma.com
```

Local evidence hashes:

```text
98cd90b2a566e510b0bfa39f4836027538d53c12963f01a7b5a1022cb28c490c  plasma.zip
94da9d7beb1e11d6d9863ab271a9bfcb40b234b98925845e6d2abaff7b1ec7ae  plasma.com
a8ecbfb60324738ba736a45c7efc72934fcca68f54a34ca2591ff284910299c4  Unicorn-emulated unpacked segment
29867cff631df4c5ce7a7b71173ea1ec7157ac852d2379f7fa9899da09b10838  plasma-raven-runtime-00-00-500.png
d4b168571338d66691101afcf02190f8ec40c92e87a80eae538dacf5d56fd21d  plasma-raven-runtime-00-01-000.png
2b4cbd1c0dd3246d1cb1044a9c6a16db13d73e2dac08980a64384bc9642c1682  plasma-raven-runtime-00-02-500.png
8a72e9ddab9e02f03956775f167b9567aa12880dc6f6a2310ad9cccaa202d92e  plasma-raven-runtime-00-03-500.png
d937375156ea56f3fdb47bbd04d7053d5ec48984cd25cc200feff5f60f534637  plasma-raven-runtime-00-04-500.png
b9a17d1732f2e158526590311e150c4306874dc3f63a95cb4ad95f090d734228  plasma-raven-runtime-00-05-500.png
b68661ddaa7843ad319b0a3b6473cde488127356ba066642602d388fe3ce343b  plasma-raven-runtime-contact.png
5eded8524e17d4ab062cb8600166e40b1e65eb807bde76948addceb637f86069  plasma-raven-pipeline-map.png
```

## Runtime Frames

![Plasma Intro effect-frame contact sheet](images/plasma-raven-runtime-contact.png)

These frames are from a DOSBox-X runtime capture, reduced to `320x200`. The
published samples are effect-only; the old contact text screen is not included.

The sparse GIF below is assembled from the same six effect-only frames. It is
an overview of the table/CRTC phase changes rather than a high-speed clip:
there is no separate source video for this pass, and the point is to connect
the visible colour-field recurrence to the phase-pointer code below.

![Plasma Intro sparse runtime sequence GIF](images/plasma-raven-runtime-sequence.gif)

The plasma is not a point/sine demo with visible primitives. It is a full-frame
moving colour field built from evolving lookup tables, then copied through a
tweaked VGA memory layout. The visible result has large slowly drifting red,
green, and blue islands with smaller noisy transitions. The repeated shape
between `00:00.500`, `00:03.500`, and `00:04.500` matches the code: several
1-D phase pointers advance through finite waveform tables and wrap, so parts of
the field reappear with shifted colour dominance.

The capture also makes the startup boundary clear. The first frame is still
black, which matches the unpack-and-setup work that happens before the palette
and plasma tables fully take over. After that, the effect is not a sequence of
different scenes; it is the same plasma field with changing dominance. The
`frame-1.5` and later samples skew heavily green, while the early `frame-01`
and `frame-04` samples show more red/blue dominance. That is the visible sign
of the table-driven phase mixing described below.

![Plasma Intro recovered runtime map](images/plasma-raven-pipeline-map.png)

## Runtime-To-Code Concordance

The published frames and GIF show one continuous effect, not a scene sequence.
That matches the recovered code path: after the COM wrapper expands the hidden
body, the intro enters one loop that rebuilds small wave tables, copies a short
table-derived band to VGA memory, advances the virtual display start, services
OPL state, and repeats until the keyboard wrapper sets the exit flag.

The black `00:00.500` frame is consistent with the startup boundary. Before the
first visible plasma frame, the program has to relocate and run the unpacker,
enter mode `13h`, alter sequencer/CRTC state, initialize the OPL path, calibrate
the PIT against retrace, prebuild the plasma tables, and install interrupt
wrappers:

```text
0100 packed COM trampoline copies relocated unpacker under the stack
017c relocated unpacker moves compressed tail and expands to CS:0100h
0284 terminal far return enters the unpacked body
0102 VGA setup
0105 OPL init
0108 PIT/retrace calibration
010b prebuild plasma tables
0118 save/install interrupt vectors
0132 enter main effect loop
```

The red/green/blue dominance changes in the later frames are the visible output
of four moving table states, not separate bitmap frames. `0354h` and `0374h`
bounce packed speed/phase words at different periods. `0394h` shifts a 51-byte
field and mixes it with a moving waveform sample stream. `03EDh` does the same
for a 112-byte field with different constants, so the two generated bands live
in different value ranges. Those finite, wrapping waveform pointers explain why
large colour regions recur between the sampled frames with shifted dominance.

The full-frame-looking plasma is then made cheap by the unrolled 2-D table
builder at `0444h` and the compact blitter at `06BFh`. The builder expands the
1-D fields into a table at `7800h`; the blitter reads selector bytes from
`773Bh`, turns each into a `78xxh` source page, and copies only `33h * 28h`
words per pass:

```text
51 selector rows * 40 words = 2040 words = 4080 bytes
```

So the visible field is not recalculated pixel-by-pixel in A000h. The motion
comes from table evolution, short `rep movsw` copies, and VGA display-start
movement.

The CRTC/scroll component is the other half of the GIF's movement. Helper
`02C8h` writes sampled bytes into A000h twice per iteration, once at `DI` and
once at `DI+50h`, then jumps by `009Fh` after `stosb`. That creates an
interleaved vertical update pattern. The helper finishes by writing CRTC start
address registers `0Ch` and `0Dh`, and the main loop calls it `[4C96h]` times
per rebuilt table. That is why a small copied band can read as a larger moving
field in the DOSBox-X frames.

The timing also matches the code. `091Eh` measures retrace/PIT deltas sixteen
times, derives a divisor, and self-patches the word at `0133h`. The main loop
then waits for vertical retrace at `03DAh`, writes the patched divisor to PIT
channel 0, adjusts CRTC registers, blits the table, ticks OPL state, evolves
the fields, and performs the repeated display-start helper.

Evidence mapping:

```text
00:00.500 black      unpack/setup boundary before visible palette/table output
00:01.000 plasma     first stable table/blitter/CRTC state after setup
00:02.500 green bias shifted 1-D waveform fields and selector table
00:03.500 recurrence wrapped finite waveform pointers with new dominance
00:04.500 recurrence same engine, changed phase/palette dominance
00:05.500 late phase same loop before omitted contact-screen path
```

The omitted contact screen is outside the published runtime sequence. The code
does have an exit path through the keyboard/timer wrappers and cleanup, but the
article's media intentionally stops at effect-only plasma frames.

## Packer And Unpack Boundary

The on-disk COM is packed. The first bytes are not the real intro loop:

```asm
0100  b88c89        mov ax,898ch
0103  ba3625        mov dx,2536h
0106  3bc4          cmp ax,sp
0108  7367          jae 0171h       ; not enough room
010a  8bc4          mov ax,sp
010c  2d4403        sub ax,0344h
010f  25f0ff        and ax,fff0h
0112  8bf8          mov di,ax
0114  b9a200        mov cx,00a2h
0117  be7c01        mov si,017ch
011a  fc            cld
011b  f3a5          rep movsw       ; copy unpacker under stack
011d  8bd8          mov bx,ax
011f  b104          mov cl,04h
0121  d3eb          shr bx,cl
0123  8cd9          mov cx,ds
0125  03d9          add bx,cx
0127  53            push bx
0128  33db          xor bx,bx
012a  53            push bx
012b  cb            retf            ; run relocated unpacker at offset 0000
```

The wrapper uses the current COM stack as scratch. With a normal high COM stack
it aligns `SP - 0344h`, copies `0a2h` words from `017ch` to that scratch area,
turns the scratch paragraph into a new CS, and far-returns into it.

The relocated unpacker then moves the compressed tail upward before expanding
over `CS:0100h`:

```asm
017c  fd            std
017d  8bf8          mov di,ax       ; aligned scratch offset
017f  4f            dec di
0180  4f            dec di
0181  bebe02        mov si,02beh
0184  03f2          add si,dx       ; source = end of compressed tail
0186  8bca          mov cx,dx
0188  d1e9          shr cx,1
018a  f3a5          rep movsw       ; copy tail upward, backwards
018c  fc            cld
018d  87f7          xchg si,di
018f  46            inc si
0190  46            inc si
0191  bf0001        mov di,0100h    ; unpack destination
```

The decompressor is a bit-buffer LZ variant. It loads 16-bit bit words with
`lodsw`, shifts the current word through `BP`, uses `rcl bx,1` to build copy
length/distance classes, and emits either literals (`movsb`) or backreferences
(`rep movsb`). Its terminal path zeroes the general registers and far-returns
to the newly unpacked program:

```asm
0284  33c0          xor ax,ax
0286  06            push es
0287  bb0001        mov bx,0100h
028a  53            push bx
028b  8bd8          mov bx,ax
028d  8bc8          mov cx,ax
028f  8bd0          mov dx,ax
0291  8be8          mov bp,ax
0293  8bf0          mov si,ax
0295  8bf8          mov di,ax
0297  cb            retf
```

I verified the unpack boundary by Unicorn-emulating the wrapper until it
returned to the original segment at `0100h`. The wrapper executed 151,778
instructions before that far return. The recovered segment hash is listed in
the evidence block above.

## Real Entry And Frame Loop

The unpacked program starts at `0100h`:

```asm
0100  eb00          jmp 0102h
0102  e8ef05        call 06f4h      ; VGA setup
0105  e86909        call 0a71h      ; OPL/AdLib init
0108  e81308        call 091eh      ; PIT/retrace calibration
010b  e8d305        call 06e1h      ; prebuild plasma tables
010e  b034          mov al,34h
0110  e643          out 43h,al      ; PIT channel 0, mode 2/3 style programming
0112  32c0          xor al,al
0114  e640          out 40h,al
0116  e640          out 40h,al
0118  e88507        call 08a0h      ; save/install vectors
011b  ba8a09        mov dx,098ah
011e  b80825        mov ax,2508h
0121  cd21          int 21h         ; install final INT 08h wrapper
```

The main loop begins at `0132h`:

```asm
0132  bb2a0f        mov bx,0f2ah    ; PIT divisor, later self-patched
0135  bada03        mov dx,03dah
0138  ec            in al,dx
0139  a808          test al,08h
013b  74fb          je 0138h        ; wait vertical retrace

013d  b034          mov al,34h
013f  e643          out 43h,al
0141  8ac3          mov al,bl
0143  e640          out 40h,al
0145  8ac7          mov al,bh
0147  e640          out 40h,al      ; write calibrated timer divisor

0149  bad403        mov dx,03d4h
014c  b80901        mov ax,0109h
014f  ef            out dx,ax
0150  b81350        mov ax,5013h
0153  ef            out dx,ax       ; CRTC row/offset settings

0154  e86805        call 06bfh      ; blit generated table to VGA
0157  e8a708        call 0a01h      ; OPL/music tick
015a  e8f701        call 0354h      ; phase-speed bounce A
015d  e81402        call 0374h      ; phase-speed bounce B
0160  e83102        call 0394h      ; build 51-byte field
0163  e88702        call 03edh      ; build 112-byte field
0166  e8db02        call 0444h      ; combine fields into 2-D table

0169  8b2e964c      mov bp,[4c96h]  ; per-frame delay / repeat count
016d  e83401        call 02a4h      ; scroll/copy/update display start
0170  4d            dec bp
0171  75fa          jne 016dh

0173  803e824c01    cmp byte [4c82h],01h ; exit flag
0178  75b8          jne 0132h
```

This is a real effect scheduler, not a single `for y / for x` pixel loop. Each
visible frame is assembled from several moving tables, and the actual A000h
copy is short.

## VGA Setup

The setup routine at `06f4h` starts in BIOS mode 13h, then pushes the VGA away
from plain chained mode:

```asm
06f4  b81300        mov ax,0013h
06f7  cd10          int 10h
06f9  b800a0        mov ax,0a000h
06fc  8ec0          mov es,ax
...
0750  bac403        mov dx,03c4h
0753  b80406        mov ax,0604h
0756  ef            out dx,ax       ; Sequencer memory mode

0757  bad403        mov dx,03d4h
075a  b81400        mov ax,0014h
075d  ef            out dx,ax       ; CRTC underline/location byte mode tweak

0761  b81018        mov ax,1810h
0764  50            push ax
0765  b00c          mov al,0ch
0767  ef            out dx,ax       ; CRTC start address high
0768  58            pop ax
0769  8ae0          mov ah,al
076b  b00d          mov al,0dh
076d  ef            out dx,ax       ; CRTC start address low

076e  b817e3        mov ax,e317h
0771  ef            out dx,ax       ; CRTC mode control

0772  bac403        mov dx,03c4h
0775  b8020f        mov ax,0f02h
0778  ef            out dx,ax       ; map mask: enable all planes

0779  33c0          xor ax,ax
077b  b90080        mov cx,8000h
077e  33ff          xor di,di
0780  f3ab          rep stosw       ; clear A000h
```

The program begins with mode 13h because that gives a known VGA state, then
changes sequencer/CRTC state and uses CRTC start-address writes during the
effect. The copy loops later write short spans into A000h while the display
origin is moved through the virtual page.

Palette setup begins at `0790h` by writing DAC index/data through `03c8h` and
`03c9h`. The runtime frames show a small dominant range of saturated red, green,
and blue. The code uses a generated ramp rather than shipping a large static
palette file.

## Field-Evolution Loops

Two small routines bounce phase speeds. `0354h` updates `[4c85h]` every
`017bh` ticks; `0374h` does the same for `[4c8eh]` every `02cfh` ticks:

```asm
0354  ff0e834c      dec word [4c83h]
0358  7519          jne 0373h
035a  c706834c7b01  mov word [4c83h],017bh
0360  a1854c        mov ax,[4c85h]
0363  02e0          add ah,al
0365  80fc06        cmp ah,06h
0368  7206          jb 0370h
036a  f6d8          neg al
036c  02e0          add ah,al
036e  02e0          add ah,al
0370  a3854c        mov [4c85h],ax
0373  c3            ret
```

The trick is packing speed and phase in one word:

```text
AL = signed speed
AH = phase accumulator
AH += AL
if AH reaches the limit:
    AL = -AL
    AH += AL twice
```

That reflects the phase at the boundary without a general branchy oscillator.
The second copy at `0374h` is identical except for its timer, limit, and state
addresses.

## One-Dimensional Wave Buffers

Routine `0394h` maintains a 51-byte field:

```asm
0394  bf9876        mov di,7698h
0397  be9976        mov si,7699h
039a  b93200        mov cx,0032h
039d  f3a4          rep movsb       ; shift old 51-byte field left by one

039f  8b36914c      mov si,[4c91h]
03a3  ac            lodsb
03a4  d0f8          sar al,1
03a6  aa            stosb           ; append new table sample
03a7  03368f4c      add si,[4c8fh]
03ab  81fe2e75      cmp si,752eh
03af  7204          jb 03b5h
03b1  81ee5e01      sub si,015eh    ; wrap finite waveform table
03b5  8936914c      mov [4c91h],si
```

Then it combines that shifted buffer with another moving sample stream:

```asm
03b9  bb9876        mov bx,7698h
03bc  bf3b77        mov di,773bh
03bf  8b36934c      mov si,[4c93h]
03c3  b93300        mov cx,0033h
03c6  8b168f4c      mov dx,[4c8fh]

03ca  ac            lodsb
03cb  d0f8          sar al,1
03cd  0207          add al,[bx]
03cf  c0f803        sar al,03h
03d2  0410          add al,10h
03d4  aa            stosb
03d5  43            inc bx
03d6  83c603        add si,0003h
03d9  e2ef          loop 03cah
```

In C-like terms:

```c
memmove(field_a, field_a + 1, 0x32);
field_a[0x32] = wave[p_a] >> 1;
p_a = wrap(p_a + step_a, 0x752e, 0x015e);

for (i = 0; i < 0x33; i++) {
    out_a[i] = (((wave[p_b] >> 1) + field_a[i]) >> 3) + 0x10;
    p_b += 3;
}
p_b = wrap(p_b + 4, 0x752e, 0x015e);
```

Routine `03edh` is the larger sibling. It shifts a `6fh`-byte field, appends a
new sample, then writes `70h` output values:

```asm
03ed  bfcb76        mov di,76cbh
03f0  becc76        mov si,76cch
03f3  b96f00        mov cx,006fh
03f6  f3a4          rep movsb
...
0418  8b368a4c      mov si,[4c8ah]
041c  b97000        mov cx,0070h
041f  8b16864c      mov dx,[4c86h]

0423  ac            lodsb
0424  d0f8          sar al,1
0426  0207          add al,[bx]
0428  c0f802        sar al,02h
042b  04ad          add al,0adh
042d  aa            stosb
042e  43            inc bx
042f  83c602        add si,0002h
0432  e2ef          loop 0423h
```

The constants differ (`>>3 + 10h` versus `>>2 + ADh`) so the two fields occupy
different value bands. Later routines use those byte values as table indices,
not as final RGB pixels.

## Two-Dimensional Table Builder

Routine `0444h` expands the two 1-D fields into a 2-D lookup table at `7800h`.
It reads two words from `776eh`, then writes those words across many `0100h`
strides:

```asm
0444  b91c00        mov cx,001ch
0447  be6e77        mov si,776eh
044a  bf0078        mov di,7800h
044d  bb0101        mov bx,0101h

0450  ad            lodsw
0451  8bd0          mov dx,ax
0453  ad            lodsw
0454  8915          mov [di],dx
0456  894502        mov [di+02h],ax
0459  03c3          add ax,bx
045b  03d3          add dx,bx
045d  89950001      mov [di+0100h],dx
0461  89850201      mov [di+0102h],ax
...
06b5  83c704        add di,0004h
06b8  49            dec cx
06b9  7403          je 06beh
06bb  e992fd        jmp 0450h
06be  c3            ret
```

This is deliberately unrolled. For each of `1ch` source positions, it writes
pairs at `di + n*0100h`, incrementing both words by `0101h` after each stride.
That produces a table where stepping by `0100h` moves along one plasma
dimension and stepping by bytes/words moves along the other. The renderer can
then copy rows cheaply instead of computing a formula per visible pixel.

## VGA Blit Loop

Routine `06bfh` is the hot visual copy:

```asm
06bf  b800a0        mov ax,0a000h
06c2  8ec0          mov es,ax
06c4  b80078        mov ax,7800h
06c7  be3b77        mov si,773bh
06ca  b333          mov bl,33h
06cc  33ff          xor di,di

06ce  ac            lodsb           ; AL = table-page selector
06cf  96            xchg ax,si      ; SI = 78xxh selector, AL keeps old SI low
06d0  b92800        mov cx,0028h
06d3  f3a5          rep movsw       ; copy 80 bytes to A000h
06d5  96            xchg ax,si      ; restore selector-stream pointer
06d6  fec4          inc ah          ; next 0100h table page
06d8  fecb          dec bl
06da  75f2          jne 06ceh
06dc  8cc8          mov ax,cs
06de  8ec0          mov es,ax
06e0  c3            ret
```

This is why the intro is fast enough even though the effect looks dense. The
CPU does not calculate every pixel in the visible frame. It builds table rows
once, then each blit iteration:

1. Reads one selector byte from `773bh`.
2. Turns it into an `SI = 78xxh` table address.
3. Copies `28h` words, exactly 80 bytes.
4. Advances the table page by incrementing `AH`.
5. Repeats `33h` times.

So the visible copy cost is roughly:

```text
33h * 28h words = 51 * 40 words = 2040 words = 4080 bytes
```

The rest of the apparent full-screen motion comes from CRTC start-address
updates, table evolution, and VGA memory layout.

## Display-Start And Scroll Helper

The helper at `02c8h` uses VGA graphics-controller state and A000h-to-A000h
copying to move/update a small display band:

```asm
02c8  bace03        mov dx,03ceh
02cb  b80541        mov ax,4105h
02ce  ef            out dx,ax
02cf  8b3e9b4c      mov di,[4c9bh]
02d3  8b369d4c      mov si,[4c9dh]
02d7  b800a0        mov ax,0a000h
02da  8ed8          mov ds,ax
02dc  8ec0          mov es,ax
02de  b92000        mov cx,0020h

02e1  ac            lodsb
02e2  884550        mov [di+50h],al
02e5  aa            stosb
02e6  81c79f00      add di,009fh
02ea  e2f5          loop 02e1h
```

Each iteration writes the sampled byte twice: once at `DI` and once 80 bytes
ahead at `DI+50h`. The `stosb` advances by one, then `add di,009fh` makes the
next write land 160 bytes later. That is a vertical/interleaved update pattern,
not a row-linear framebuffer loop.

After the 32 writes, it wraps the internal virtual-start offset and programs
the CRTC start address:

```asm
033d  bad403        mov dx,03d4h
0340  8bc7          mov ax,di
0342  50            push ax
0343  b00c          mov al,0ch
0345  ef            out dx,ax
0346  58            pop ax
0347  8ae0          mov ah,al
0349  b00d          mov al,0dh
034b  ef            out dx,ax
034c  bace03        mov dx,03ceh
034f  b80540        mov ax,4005h
0352  ef            out dx,ax
0353  c3            ret
```

This helper is called `[4c96h]` times per outer frame, so the script can change
how much display-start movement happens between two table rebuilds.

## Timing Calibration

The routine at `091eh` calibrates a timer divisor from vertical-retrace timing.
It calls `095ah` sixteen times, accumulates the measured PIT deltas in
`SI:BX`, shifts the 32-bit sum right four times, then self-patches the main-loop
PIT divisor stored at `0133h`:

```asm
091e  b91000        mov cx,0010h
0921  33db          xor bx,bx
0923  33f6          xor si,si
0925  e83200        call 095ah
0928  03d8          add bx,ax
092a  83d600        adc si,0000h
092d  e2f6          loop 0925h
092f  d1ee          shr si,1
0931  d1db          rcr bx,1
...                 ; four total right shifts
093f  b8f5c0        mov ax,c0f5h
0942  f7e3          mul bx
0944  c1ea07        shr dx,07h
0947  81d2870e      adc dx,0e87h
094b  89163301      mov [0133h],dx
```

The measurement helper toggles PIT programming around two retrace edges:

```asm
095a  bada03        mov dx,03dah
095d  b036          mov al,36h
095f  e643          out 43h,al
0961  ec            in al,dx
0962  a808          test al,08h
0964  75fb          jne 0961h
0966  ec            in al,dx
0967  a808          test al,08h
0969  74fb          je 0966h
096b  e640          out 40h,al
096d  e640          out 40h,al
...
097b  e643          out 43h,al
097d  e440          in al,40h
097f  8ae0          mov ah,al
0981  e440          in al,40h
0983  86c4          xchg al,ah
0985  f7d8          neg ax
0987  d1e8          shr ax,1
0989  c3            ret
```

That self-patched divisor is then used by the main loop at `013dh..0147h`.

## Interrupts And Exit

The vector installer at `08a0h` saves INT `03h`, `08h`, and `09h`, then
installs wrappers:

```asm
08a0  push es
08a1  cli
08a2  mov ax,3503h   ; save INT 03h
...
08af  mov dx,0909h
08b2  mov ax,2503h   ; install INT 03h wrapper
...
08c4  mov dx,0902h
08c7  mov ax,2508h   ; temporary INT 08h wrapper
...
08d9  mov dx,09e2h
08dc  mov ax,2509h   ; keyboard wrapper
```

The main code later replaces INT `08h` with `098ah`. That handler acknowledges
the PIC and rewrites the low interrupt-vector-table word for INT 08h to bounce
between `098ah` and `09ach`, creating a small two-stage timer cadence.

The keyboard wrapper at `09e2h` reads port `60h`. On a make code, it sets
`[4c82h] = 1`, pulses port `61h` bit 7, and returns with EOI. The main loop
checks `[4c82h]` at `0173h`; when set, cleanup restores vectors, returns to
text mode, prints the text screen, and exits through DOS.

## OPL Path

The intro includes an AdLib/OPL path even though the visual capture used here
is the important artifact. `0a71h` probes/initializes the chip at `0388h` and
`0389h`, then writes a block of register/value pairs. `0a01h` is the per-frame
music/event tick.

The low-level OPL write routine is `0b65h`:

```asm
0b65  86e0          xchg ah,al
0b67  ee            out dx,al       ; register
0b68  ec            in al,dx        ; delay reads
...                 ; six reads
0b6e  86c4          xchg al,ah
0b70  42            inc dx
0b71  ee            out dx,al       ; data
0b72  4a            dec dx
0b73  ec            in al,dx
...                 ; many reads for OPL timing
0b96  c3            ret
```

The repeated `in al,dx` reads are timing delays. Early OPL chips require a
short wait after selecting a register and a longer wait after writing data; the
routine burns those cycles with harmless status-port reads.

## What The Intro Is Really Doing

`Plasma Intro` is compact, but the recovered code is more structured than a
toy plasma:

- the COM packer hides the real code and expands it at runtime;
- mode 13h is only the starting point, then VGA sequencer/CRTC registers are
  changed;
- PIT/retrace calibration self-patches the frame timer;
- two 1-D wave buffers advance at different rates and wrap inside a finite
  waveform table;
- an unrolled builder expands those 1-D buffers into a 2-D table;
- the blitter copies only 4,080 bytes per frame from that table;
- CRTC start-address changes and virtual-page writes provide the rest of the
  apparent screen movement;
- AdLib writes are integrated into the frame loop through a compact event
  walker.

The key design choice is precomputation. The expensive-looking plasma is not
calculated per pixel in the visible loop. The intro spends its work updating
small tables, then lets VGA addressing and `rep movsw` do the bulk movement.

## Boundaries

This article covers the preserved `plasma.com`, the emulated unpacked segment,
and DOSBox-X effect frames. It does not publish the program's old contact
screen, and it does not claim hardware-accurate colour timing beyond the
runtime frames and register-level code paths shown above.
