Analysis model: gpt-5.5 xhigh, sol high

Last edited: 2026-08-26

Torso by Soc. Brigade and The Cat - Technical Dissection

Release year: 1991

Identity, result, and evidence boundary

Torso is a July 1991 MS-DOS VGA demo by Soc. Brigade and The Cat. Demozoo records it as first in the PC demo competition at the Twin Sectors Inc. Party 1991; the surviving result file places it immediately above Twin Sectors Inc.'s Scroll Land. The executable identifies itself as a source-lost test version and carries Copyright (C) The Cat 1991 in its opening bytes.

Primary references and artifacts:

2ef486623437dbccbca9ce04b6586dfd3b00d434c1b3e2a1406abc75ec430ffd  torso.zip
9722916b3397c27c635445e8833ecc699f265a8cbc5a08d8afedb697dc48d5c4  P.COM
89c2f4a9e25467d73239b68bd7f26b0eef95569379bcc76ffa42e9811e7f8124  BART.NIF
b2904c9e2ccf4d09f007aadc2bd0a366e350d57a387ea97d4217cc39c3a5942c  CD.NIF
3915b8ecd5c60a76ffc8e99f29bb60d45ab94b5ae06bc979c12360222aecc97b  INTRO.NIF

The soundtrack was neither auditioned nor published. The bounded DOSBox-X 2024.03.01 diagnostic used dummy host audio and redirected routine emulator warnings to an ignored log. A 30-second maximum-cycle file trace confirms that the guest opens and fully reads INTRO.NIF, %PMPMYHS.MOD, CD.NIF, and %SONYI.MOD. It did not reach BART.NIF before the host timeout, so the third stage is established from reachable code and data rather than claimed as a locally captured run.

Public screenshots and code concordance

Public Demozoo screenshot of Torso's player stage

The image above is an unmodified public Demozoo screenshot, not a local runtime capture. It shows the second-stage PHILIPS deck, scattered coloured points, and a magenta triangular patch. The deck is present in the exact CD.NIF decodes and the points have a concrete owner in the later 32-star loop. The triangle is visible in the public still but is not cleanly reproduced by the archive's NIF frames under their stored palette, so this pass does not assign that patch to a renderer merely from resemblance.

Exact binary decode of CD.NIF frame 4

This 320x200 still is exact binary evidence, not an emulator capture. Frame 4 shows the same deck entering from the right and establishes the panel's NIF ownership independently of the unexplained public-still triangle.

Public Demozoo screenshot of Torso's sparse authored object

The large magenta form can resemble a live polygon object. It matches frame 42 of the exact INTRO.NIF decode: the silhouette, inner notch, two side marks, and small red mark at the bottom all coincide. The code does not contain a vertex transform, projection, edge walker, or polygon filler for it. 09BCh reconstructs authored byte runs directly in mode-13h video memory. The distinction matters: this is compressed indexed-pixel animation, not a 3D renderer.

Exact binary decode of INTRO.NIF frame 42

Unlike the public still, this image is reconstructed directly from the archive with INTRO.NIF's embedded 768-byte palette. Its one-to-one match closes the visual-to-code attribution without relying on a scene label.

Public Demozoo screenshot of Torso's Bart credits stage

The final public screenshot matches the third code stage. BART.NIF supplies the large static Bart image and palette; the executable draws decoded credits on the right and repeatedly redraws the small 40x24 one-bit figure visible near the lower-right corner.

A nearly full-size flat COM program

P.COM is a 65,113-byte flat binary, loaded at offset 0100h and ending at FF58h. Its first instruction jumps to 0137h; there is no executable packer or relocation layer to remove. All offsets below are runtime offsets in that single CS=DS image, so file offset is simply runtime offset minus 0100h.

The release separates display material from the executable:

File Bytes Role established by code
INTRO.NIF 311,440 first-stage palette and compressed picture streams
CD.NIF 122,593 second-stage player-panel animation and palette
BART.NIF 5,448 final Bart base image and palette
%PMPMYHS.MOD 65,206 first-stage module, 53 orders / 35 patterns
%SONYI.MOD 29,126 player-stage module, 15 orders / 12 patterns
%KOTBIZT.MOD 22,438 credits-stage module, 21 orders / 13 patterns

The NIF loader at 0684h places data seven bytes beyond the COM image, at CS+0FF6h:0000h. It reads FFF0h-byte chunks and advances DS by 0FFFh paragraphs between full chunks. At exact EOF it appends a FFFFh word for the decoder. There is no stack leak: the loop returns to the instruction after its single segment push, and normal return leaves DS=CS+0FF6h.

The first 768 file bytes are a VGA DAC palette. Byte 0300h is the initial full-screen colour; bytes from 0301h onward are the frame stream consumed by 09BCh. After each decoder return, DS is restored to CS. The next MOD load then reuses the same CS+0FF6h workspace for pattern and sample data, and the next NIF safely replaces that workspace only after the preceding scene ends.

068B  mov  ax,FF68h
068E  shr  ax,4
0691  mov  dx,ds
0693  add  ax,dx               ; CS + 0FF6h
0695  push ax                  ; one saved base segment
0696  mov  ds,ax
0698  xor  dx,dx
069A  mov  cx,FFF0h
069D  mov  ah,3Fh
069F  int  21h                 ; contiguous chunk
06A1  cmp  ax,cx
06A3  jne  06ACh
06A5  mov  ax,ds
06A7  add  ax,0FFFh
06AA  jmp  0696h               ; after PUSH: no stack growth
06AC  mov  si,ax
06AE  mov  word [si],FFFFh     ; append decoder sentinel
06B6  pop  ds                  ; base segment for 09B0h/09BCh
File Read chunks Appended sentinel, linear from CS:0000
INTRO.NIF four FFF0h + C0D0h 5BFF0h
CD.NIF one FFF0h + DEF1h 2DE41h
BART.NIF one 1548h short read 114A8h

Startup and three-stage control flow

Startup saves the four IVT words for IRQ0 and IRQ1, installs handlers at 0A69h and 10A1h, programs PIT channel 0 with divisor 75, enables PIT channel 2 through port 61h, and enters BIOS mode 13h:

013F  xor  ax,ax
0141  mov  es,ax
0143  mov  ax,[es:0020h]       ; save IRQ0 offset/segment
015F  mov  ax,0A69h
0162  mov  [es:0020h],ax
016B  mov  ax,10A1h
016E  mov  [es:0024h],ax       ; install IRQ1
0177  mov  ax,0034h
017A  out  43h,al
017C  mov  al,4Bh
017E  out  40h,al
0182  out  40h,al              ; divisor 004Bh = 75
018E  mov  ax,0013h
0191  int  10h

The high-level choreography is explicit:

load_nif("INTRO.NIF");
load_module("%PMPMYHS.MOD");
run_8315_iteration_callback_script();
fade_audio_and_palette();

initialize_32_stars();
load_nif("CD.NIF");
load_module("%SONYI.MOD");
while (!module_finished) {
    wait_display_enable_gate();
    update_60_meter_palette_entries();
    move_32_stars_with_selective_restore();
}
fade_audio_and_palette();

load_nif("BART.NIF");
load_module("%KOTBIZT.MOD");
draw_credits_twice_per_line();
animate_40x24_sprite_2000_times();
fade_audio_and_palette();
restore_machine_and_exit();

IRQ1 does more than set a polite flag. The handler acknowledges the keyboard and rewrites the interrupted return IP to 01D5h, forcing the first-stage fade and transition path. Module completion uses F846h; the first-stage callback script also sets that byte through its final callback.

That shortcut has a test-build race: if IRQ1 rewrites the return IP while the NIF or MOD loader has an external data segment active, execution can resume at 01D5h without restoring DS=CS. The normal no-key path is segment-correct; the asynchronous skip is not guaranteed to be.

The first-stage callback scheduler

The steady loop at 01B7h calls the display gate and palette/meter compositor, then decrements the current four-byte scheduler record. A zero countdown calls the record's function pointer and advances the table pointer by four bytes:

01B7  call 0A51h               ; horizontal display-enable gate
01BA  call 0752h               ; palette history + meter raster
01BD  mov  bx,[F494h]
01C1  dec  word [bx]
01C3  jnz  01CEh
01C5  inc  bx
01C6  inc  bx
01C7  call [bx]
01C9  add  word [F494h],4
01CE  cmp  byte [F846h],0
01D3  jz   01B7h

The 15 records total exactly 8,315 main-loop iterations:

Delay Callback Mechanism
78 0301h clear 9,280 bytes at VGA D5C0h
538 06B8h decode one 100x60 authored image
364 0A27h decode full-width strip at 1D21h
120 0301h clear lower work area
670 0A27h repeat strip decoder
120 0301h clear lower work area
60 0310h decode strip at 177Ch
50 0301h clear lower work area
930 0271h decode one embedded screen, fade, lattice, and lower strip
640 0257h five gated 100x60 image updates
1,200 06B8h one image update
2,455 032Bh duplicate the lower page into two rows
90 06B8h one image update
500 06B8h one image update
500 0251h set completion flag

This table is the stage director. The visual routines do not infer time from the music position; the PIT IRQ advances music independently while this loop counts successful foreground iterations.

Three exact byte-run decoders

The compact routine at 0A2Ah begins with a destination word. A command with bit 7 set repeats its following byte -command + 1 times; a positive command copies that many literal bytes. It stops when the destination reaches FA00h:

di = read_u16(&stream);
while (di < 0xFA00) {
    int8_t count = read_i8(&stream);
    if (count < 0)
        repeat_byte(&vga[di], read_u8(&stream), -count + 1);
    else
        copy_bytes(&vga[di], &stream, count);
}

Independent replay closes the three embedded streams exactly:

Stream End VGA writes Repeat runs Literal runs
177Ch 1D21h 9,280 345 173
1D21h 28A6h 8,320 830 419
28A6h 3718h 14,080 1,716 88

The last stream is invoked after the compound 0271h scene. These are bounded screen-strip reconstructions, not generic file decompression calls.

NIF is a cumulative full-screen frame codec

09BCh begins by filling all 64,000 mode-13h pixels with one palette index. Each frame reads one initial 16-bit destination, then a continuous sequence of PackBits-like commands. A zero command skips next_byte + 1 pixels, a negative command repeats one byte, and a positive command copies literals. Crossing FA00h ends the current frame; only the next frame reads another initial destination. FFFFh after a frame is the end sentinel.

fill_words(vga, read_u8(&stream), 32000);    // 64,000 bytes
for (;;) {
    di = read_u16(&stream);                  // once per frame
    while (di < 0xFA00) {
        int8_t op = read_i8(&stream);
        if (op == 0)
            di += read_u8(&stream) + 1;
        else if (op < 0) {
            unsigned n = -op + 1;
            repeat_byte(&vga[di], read_u8(&stream), n);
            di += n;
        } else {
            copy_bytes(&vga[di], &stream, op);
            di += op;
        }
    }
    if (peek_u16(stream) == 0xFFFF) return_with_ds_equal_cs();
    wait_n_display_gates(frame_delay);
    frame_delay = 4;
}

This detail is not cosmetic. Treating every command as if it began with another 16-bit destination produces a plausible but false 435-frame parse. Correct replay consumes every post-palette NIF byte and reaches exact file EOF:

File Frames First destination Bytes after palette Pixel writes after fill Display-gate calls
INTRO.NIF 60 315Fh 310,672 317,458 744
CD.NIF 38 AA0Dh 121,825 224,654 344
BART.NIF 1 0028h 4,680 13,648 0

The loader-appended sentinel follows each final frame exactly. Source rollover at 09F5h preserves the linear position with SI &= 00FFh and DS += 0FF0h; the final decoder positions are respectively CS+4FB6h:C490h, CS+1FE6h:DFE1h, and CS+0FF6h:1548h.

Pacing comes from word 0A25h. It begins at 512, so INTRO.NIF waits 512 display gates after its first non-final frame and four after each of the next 58 boundaries: 744 calls total. Before CD.NIF, startup changes the first wait to 200; its remaining 36 non-final boundaries add four each, for 344 calls. The one-frame BART.NIF reaches the sentinel without a boundary wait.

INTRO.NIF frame 42 is the public screenshot's giant magenta form. Its pixels are incrementally authored by the codec; they are not projected geometry. No reachable visual code performs the transform, divide, edge walk, or span fill expected of a live 1991 polygon renderer.

The call at 0271h is separate: it enters 09BCh on embedded stream 7265h. That stream has one frame, starts at destination zero, ends at F30Ch, and writes 45,769 pixels through 989 skips, 4,770 repeat commands, and 3,114 literal commands. 0271h then performs a 2,304-component DAC blackout, a 64-step 16-entry grayscale ramp, a 256-gate pause, an eight-pass by 25-row lattice (120,000 VGA byte writes), one 100x60 object decode, and the 14,080-byte lower strip at 28A6h. It is a compound authored scene, not one animation loop.

The 100x60 stream player and doubled lower page

06B8h always draws a 100x60 rectangle at x=110. Each row expands to exactly 100 pixels; after the row it adds 220 to DI, making the 320-byte screen pitch. The stream pointer comes through a table whose instruction operand is advanced by two after every call, so the routine is self-modifying at its pointer-table load site.

stream = *(uint16_t *)(next_pointer_operand);
next_pointer_operand += 2;
di = 110;
for (unsigned row = 0; row != 60; ++row) {
    unsigned x = 0;
    while (x != 100) {
        uint8_t op = *stream++;
        if (op & 0x80) {
            unsigned n = 256 - op;
            uint8_t pixel = *stream++;
            repeat_byte(vga + di, pixel, n);
            di += n; x += n;
        } else {
            copy_bytes(vga + di, &stream, op);
            di += op; x += op;
        }
    }
    di += 220;
}

Every successful call therefore performs exactly 6,000 VGA byte writes. The 11-call path consumes pointers F30Eh, 3718h, 3718h, 3B98h, 4026h, 44BEh, 4957h, 4DFCh, 5726h, 52A8h, and 630Eh: 14,027 compressed input bytes, 4,449 commands, and 66,000 VGA byte writes. The pointer table has a twelfth entry, 67DDh, but the recovered path never consumes it. The repeated 3718h pointer deliberately holds that authored object for an extra call.

The later callback at 032Bh copies VGA source rows from C300h through F9FFh. Each 320-byte source row is written once at the current destination and once 320 bytes below it, then destination advances by 640 bytes. The loop processes 44 source rows, yielding 88 destination rows and 28,160 word-store bytes:

0333  mov  si,C300h
0336  mov  di,8C00h
0339  mov  cx,00A0h            ; 160 words / source row
033C  lodsw
033D  mov  [di+0140h],ax       ; duplicate to next row
0341  stosw
0342  loop 033Ch
0344  add  di,0140h            ; skip over duplicate row
0348  cmp  si,FA00h
034C  jb   0339h

Palette history, four-channel meters, and raster traffic

The first-stage compositor at 0752h shifts 738 bytes of RGB history left by 18 bytes, leaving room for six new palette entries. One encoded script byte is XORed with 7Bh, multiplied by eight, and used to select six bytes from the font at 6F66h. Each font bit inserts one RGB triplet or a zero triplet into the 18-byte tail. Every eighth call advances the script; encoded byte 5Bh decodes as space and regenerates the RGB source at 013Fh.

The routine then uploads 756 bytes from F4DEh to DAC indices 4..255. On seven calls out of eight it adds three to each of the 18 source bytes; on the eighth it subtracts 15h. This makes the history conveyor and its colour ramp entirely palette-side.

08AAh derives four 15-entry meter groups from the IRQ mixer's latest signed sample bytes at F84Ah..F84Dh. For each channel, the high byte of sample * decaying_peak, shifted right two, selects 0..15 active entries. The routine writes exactly 60 RGB records, 180 bytes, then decreases each source level by four with a zero clamp.

The raster loop at 0839h performs 15 outer iterations. Four groups per iteration each make six word stores: three sequential STOSW stores and three mirrored stores through [ES:DI+D3h]. That is 24 words or 48 VGA bytes per iteration, exactly 720 VGA bytes per compositor call. It consumes four source words per iteration, 120 source bytes total.

The CD-player stage: DAC meters and selective stars

After loading CD.NIF, Torso copies its 768-byte palette to F15Eh, uploads it, and starts %SONYI.MOD. The foreground loop rebuilds the 60 RGB meter records with DX=0030h, writes all 180 bytes to DAC index 90h, then calls the star routine:

022B  call 0A51h
022E  mov  dx,0030h
0231  call 08AAh
0234  mov  al,90h
0236  mov  dx,03C8h
0239  out  dx,al
023A  inc  dx
023B  mov  cx,00B4h            ; 180 DAC bytes
023E  rep  outsb
0240  call 06F6h               ; 32 stars

The 32 four-byte star records hold speed, saved background colour, and x offset; a separate 32-word table supplies row bases. On a normal update the routine restores the old pixel, subtracts speed from x, reads and saves the new background pixel, and writes colour speed-1. That is one VGA read and two VGA writes per non-wrapping star. A wrapping star only restores its old pixel, chooses a new speed from 2..5, and resets x to 319. There is no full-screen clear: whatever final image state the NIF decoder leaves survives because each star repairs only the pixel it owned. This is the code path for the later moving points and is consistent with the public still's scattered pixels; the still alone does not prove its exact capture instant. The loop does not explain the magenta triangle.

Credits and the 40x24 moving sprite

The final stage loads BART.NIF, uploads its palette, and starts %KOTBIZT.MOD. Text beginning at 15FDh is decoded with XOR 7Bh. 0540h selects one 8x8 glyph at 6F65h, scans eight rows by eight bits, and writes only set bits. Each line is drawn twice at adjacent positions with incremented colours, accounting for the offset colour edges in the public screenshot. The complete sequence makes 22 line calls, decodes 119 printable glyphs, performs 7,616 font-bit iterations, reads 952 font bytes, and writes 1,668 set pixels. The large Bart image itself comes from the one-frame BART.NIF decode.

The moving figure loop is exact and intentionally expensive:

for (unsigned frame = 2000; frame != 0; --frame) {
    wait_display_enable_gate();
    wait_display_enable_gate();

    for (unsigned row = 0; row != 74; ++row) {
        clear_20_words(vga + 0x9710 + row * 320);  // 2,960 bytes
    }

    x = position_table[frame & 31];
    for (unsigned row = 0; row != 24; ++row) {
        for (unsigned byte = 0; byte != 5; ++byte) {
            uint8_t bits = sprite[row * 5 + byte];
            for (unsigned bit = 0; bit != 8; ++bit) {
                if (rotate_left(&bits)) vga_pixel = 15;
                ++vga_pixel;
            }
        }
        vga_pixel += 280;
    }
}

Each frame clears 2,960 bytes, evaluates 960 one-bit sprite pixels, and writes only set bits. The 32-entry position table at 16A1h supplies horizontal motion. This code owns the small moving lower-right figure; it does not redraw the large static Bart artwork on the left.

The display gate is not vertical retrace

0A51h is easy to mislabel. It polls VGA input-status port 03DAh until bit 0 (display enable) is low, then requires ten consecutive reads with bit 0 high. Any low read resets the ten-read count:

0A51  mov  dx,03DAh
0A54  in   al,dx
0A55  and  al,1
0A57  jnz  0A54h
0A59  cbw
0A5A  in   al,dx
0A5B  inc  ah
0A5D  cmp  ah,0Ah
0A60  jne  0A63h
0A62  ret
0A63  and  al,1
0A65  jnz  0A5Ah
0A67  jmp  0A59h

Bit 0 is horizontal display-enable status, not bit 3 vertical retrace. The routine therefore phase-locks to the start of a stable active-display interval; it is not a VBL wait. All scene durations expressed as counts of this call remain workload- and VGA-timing-dependent rather than fixed 70 Hz frame counts.

The IRQ0 PC-speaker MOD mixer

PIT divisor 75 produces approximately 15,909.09 IRQ0 calls per second. At every interrupt, 0A69h mixes four signed eight-bit samples. Each channel uses an 8.8 fixed-point step calculated as 57600 / period; the low byte accumulates fraction and carry, while the high byte advances the sample pointer. There is no interpolation:

sample = *(int8_t far *)(sample_segment:sample_offset);
mix += sample * (int8_t)volume;

fraction += step & 0xFF;
sample_offset += (step >> 8) + carry;

Each channel occupies 18 bytes: sample segment, end offset, repeat start, repeat length/end, volume, current offset, 8.8 step, fractional accumulator, volume-slide delta, and arpeggio state. Repeat length exactly two disables a channel at sample end. Any other loop replaces the end offset with the raw repeat length rather than repeat_start + repeat_length, but every supplied nonempty sample uses the one-shot repeat_start=0, repeat_length=2 case.

The high byte of the signed 16-bit sum indexes the 256-byte table at FE11h. The table maps silence to PIT channel-2 count 32, positive values toward 1, and negative values toward 64. One OUT 42h,AL per IRQ creates six-bit variable-width PC-speaker pulses. It is neither Sound Blaster nor AdLib output.

Tracker work is split across five consecutive sample IRQs. F837h counts down from 312; values 4..0 dispatch tick effects, then channels 4, 3, 2, and 1. Channel 1 resets the counter to 312:

15,909.09 / 312 = 50.9907 tracker ticks per second

The loader reads the standard 1,084-byte MOD header but parses only 30 sample headers. It scans the active order list for the highest pattern and reads pattern_count * 1024 - 4 bytes, a real four-byte short read. Sample 1 therefore begins with the omitted final pattern cell, every later sample boundary is displaced four bytes, and the final four sample bytes are absent. The supplied modules happen to put zeros in the omitted cell and initial sample bytes, reducing the first-boundary symptom but not removing the displacement.

Only effects 0, A, B, C, D, and F are recognized. Dxx ignores its row parameter, Fxx changes row speed but never the PIT rate, and intended 1xx/2xx pitch slides are ignored. The arpeggio path is also defective: channels 2..4 calculate a table address and then load through the old BX, so their semitone adjustment is discarded. These are properties of Torso's player, not claims about the source modules.

Axy also has an asymmetric quirk: a high-nibble upward slide applies NOT without the final add-one, increasing volume by x+1; the result is then clamped to 0..64. Order completion is based on a remaining-pattern-transition counter initialized to song_length + 1, not the restart byte. Uninterrupted execution through the three supplied modules is therefore:

Module Pattern loads Rows parsed Nominal player duration
%PMPMYHS.MOD 53 2,599 200.94 s
%SONYI.MOD 15 928 163.79 s
%KOTBIZT.MOD 21 1,302 76.60 s

Those durations derive from the fixed 50.9907 Hz tick and executed Fxx speeds. Keyboard interruption or the foreground stage's own completion path can end a section earlier.

Fade, cleanup, and machine state

04B9h starts with a ceiling of 64. Each level waits 1,234 IRQs via HLT, clamps the four live channel peaks, decrements every nonzero byte in the active 768-byte palette, and uploads the full palette. Levels 64 through 0 consume 80,210 timer interrupts, approximately 5.04 seconds at divisor 75, before the routine masks all PIC interrupts.

Final teardown disables the speaker, restores the saved IRQ0/IRQ1 vectors, programs channel 0 with divisor zero (the conventional 65,536-count BIOS rate), programs channel 2 with divisor 0533h, writes PIC mask B8h, returns to BIOS mode 3, and exits with INT 20h. Only the vectors are restored byte-for-byte; the original PIT divisors, PIC mask, and speaker configuration were never saved. The custom IRQ0 handler also does not chain the BIOS timer, so DOS clock ticks are lost while the demo runs.

What this pass establishes

Torso's central machinery is not a conventional vector-object demo. It is a flat, almost 64 KiB controller coordinating three external picture banks, three MOD files, a high-rate PC-speaker PWM mixer, a 15-record foreground scheduler, palette-history and audio-meter raster work, exact byte-run screen strips, 60- and 38-frame cumulative NIF sequences, selective-restore stars, and a small masked sprite over a static Bart credits page. The public screenshots now have defensible code owners: CD.NIF owns the deck and 06F6h the later selective-restore points; INTRO.NIF frame 42 owns the giant magenta form; BART.NIF plus 0540h/03E1h own the credits frame. The public player's point timing remains bounded, and its unmatched triangle is explicitly unassigned instead of being forced onto an unrelated loop.