Analysis model: gpt-5.5 xhigh

Gear Demo by Careless + Sonic Inc. + The Brain Slayer - Technical Dissection

Subject: Gear Demo / Gear by Careless, Sonic Inc., and The Brain Slayer.

Demozoo lists Gear Demo as an MS-DOS intro/advert for Metro Holografix by Careless, Sonic Inc., and The Brain Slayer, released March 1992, with Ocze credited for code and graphics conversion. Pouet lists Gear as a March 1992 MS-DOS demo by The Brain Slayer, Careless, and Sonic Inc.; a period comment summarizes the visible payload as mouse-painted graphics, a scrolling star field, pre-rendered gear animation, VGA, and Sound Blaster.

Release year: 1992

This one is structurally more interesting than the single-screen runtime first suggests. TBS_GEAR.EXE is not a normal large linked MZ program. DOS loads only a small MZ image; the real body is appended after it and marked with LOADG and MAING. The entrypoint first copies the loader over the DOS header, then a bitstream LZ depacker reconstructs the runnable program and applies relocations before far-jumping into it. The captured runtime then behaves like a compact scrolltro: loader card, logo cards, production card, vertical reveal, and one main VGA loop with a dragon frame, star field, rotating gear aperture, and bottom scroller.

The archive includes an old distribution note and a separate HOME.COM ANSI screen. They were used only for file/context identification; old phone/email contact details are deliberately not reproduced here.

Sources

Visual References

Public Demozoo screenshot of the main screen:

Gear Demo public Demozoo main screenshot

Public Demozoo screenshot of the production card:

Gear Demo public Demozoo production screenshot

Runtime Capture

DOSBox-X 2026.01.02 was run with SDL dummy video/audio, machine=svga_s3, core=normal, cycles=30000, nosound=true, sbtype=none, xms=true, ems=false, and the public archive. Timing zero is the start of dx-capture /v TBS_GEAR.EXE.

The capture stream is about 88.32 seconds. The wrapper killed DOSBox-X at the timeout, so ffmpeg warned about random-access decode damage near some seek points. The selected frames below are stable enough to show the phase timing. Sound was disabled for this pass, so the visual timing is a DOSBox-X no-sound timing reference rather than an audio-synced hardware capture.

Gear Demo DOSBox-X runtime contact sheet

Read left to right, the capture is one compact loader-to-main-loop sequence: black LOADING..., two full-screen credit cards, a vertical purple reveal, and then the framed dragon/gear/scroller screen. That is the runtime evidence for the transition table later in the article; the exact unpacked MAING loop addresses remain outside this pass.

At 00:02.000, the loader is still on the black LOADING... screen:

Gear Demo runtime frame at 00:02.000 showing LOADING

At 00:10.000, the Psygnosis-style credit card is visible:

Gear Demo runtime frame at 00:10.000 showing Psygnosis presents

At 00:15.000, the Sonic/Careless production card is visible:

Gear Demo runtime frame at 00:15.000 showing Sonic and Careless production card

At 00:20.000, a purple vertical-column reveal is introducing the main page:

Gear Demo runtime frame at 00:20.000 showing the vertical reveal

At 00:30.000, the main loop is steady: dragon frame, logo, star field, rotating gear, and bottom text scroller:

Gear Demo runtime frame at 00:30.000 showing the main loop

Archive Contents

Examined archive:

tbs_gear.zip  SHA-256 b46d93dcab97395dfcbd42d11eb3e41f7e123ad3bad79e9bcd08913c87e42e3b

Extracted files:

File Size SHA-256 Role
home.com 7,583 226e795d8bd6d97477296bdc61c66754a75fc8f07d7af92a8a7d9049bfaeb27e ANSI/text-mode helper screen
readme.txt 461 0f4bb744186d427bec9f1549a8f97007fc988b954b7d4e91466be8ca2a0c97a7 distribution note, not quoted here
tbs_gear.exe 365,854 573ec355d73c2072946d36b901c1b9bbbd24056455be8bfc94b0d971b583d91c packed main intro

MZ Shape

The executable begins with a real MZ header, but it is hand-shaped:

file size:         365,854 bytes
MZ image size:      13,227 bytes
appended payload:  352,627 bytes
header size:            32 bytes
relocations:             0
initial CS:IP:     0321:000e
entry file offset: 0x323e

The field that a normal MZ parser would call overlay_no is not meaningful here, because bytes 0x1a..0x1f spell SONIC!. The loader is using the header area as compact code/signature storage, not as a conventional linker-produced structure.

DOS loads only the 13,227-byte MZ image. The remaining 352,627 bytes begin at file offset 0x33ab, immediately after the MZ image, and start with:

0x33ab  LOADG
0x3928  MAING

These are payload block markers, not separate DOS files. The appended data has high entropy through most of the file, which is consistent with packed graphics and code rather than raw 320x200 screens. That matters for static analysis: byte matches such as A000h, 03c8h, 03c9h, or 03dah inside the appended body are not reliable code evidence until the body is unpacked.

Entrypoint Copy Stub

The actual MZ entry at file offset 0x323e starts with a small self-copy. Its job is to get rid of the 32-byte MZ header gap and continue in the loader body:

323e  push es
323f  push cs
3240  pop  ds
3241  mov  cx,[000a]       ; 0x2a9e bytes from the header/minalloc word
3245  mov  si,cx
3247  dec  si
3248  mov  di,si
324a  mov  bx,ds
324c  add  bx,[0008]       ; header paragraphs: 2
3250  mov  es,bx
3252  std
3253  rep  movsb           ; copy image upward by 2 paragraphs
3255  push bx
3256  mov  ax,002b
3259  push ax
325a  retf                 ; continue at copied segment:002b

The source and destination ranges overlap, so the STD plus backward REP MOVSB is necessary. Forward copying would overwrite bytes that have not yet been moved. After this, execution continues in the copied loader body.

Depacker Inner Loop

The loader eventually reaches the LZ-family bitstream depacker at 0x325b. This is the most trustworthy code-level part of the analysis because it is plain 8086 code in the MZ image rather than compressed payload.

The setup first moves source and destination windows in paragraph-sized chunks so the packed stream and output image are positioned correctly:

325b  mov  bp,cs:[000c]
3262  mov  ax,bp
3264  cmp  ax,1000
3267  jbe  326c
3269  mov  ax,1000         ; cap one move chunk to 0x1000 paragraphs
326c  sub  bp,ax
326e  sub  dx,ax
3270  sub  bx,ax
3272  mov  ds,dx
3274  mov  es,bx
3276  mov  cl,03
3278  shl  ax,cl           ; paragraph count to word count
327a  mov  cx,ax
327c  shl  ax,1
327e  dec  ax
327f  dec  ax
3280  mov  si,ax
3282  mov  di,ax
3284  rep  movsw
3286  or   bp,bp
3288  jne  3262

The token stream then uses BP as a 16-bit bit bucket and DL as the remaining bit count. Every token starts by shifting one bit out of BP; when the bucket is empty, the next input word is loaded with LODSW.

328f  xor  si,si
3291  xor  di,di
3293  mov  dx,0010
3296  lodsw
3297  mov  bp,ax

3299  shr  bp,1
329b  dec  dx
329c  jne  32a3
329e  lodsw
329f  mov  bp,ax
32a1  mov  dl,10
32a3  jae  32a8            ; CF=0 means compressed token
32a5  movsb                ; CF=1 means literal byte
32a6  jmp  3299

So the first branch is simple:

The short back-reference form is selected when the next bit is also 0. It uses two more bits as the length code and a one-byte negative distance:

32a8  xor  cx,cx
      get one bit
32b4  jb   32d8            ; next bit 1: long form
      get bit into CX
      get bit into CX
32ce  inc  cx
32cf  inc  cx              ; length = two-bit value + 2, so 2..5
32d0  lodsb
32d1  mov  bh,ff
32d3  mov  bl,al           ; distance = signed -1..-256
32d5  jmp  32eb

The long back-reference form reads a word. The high byte is split between a larger negative distance and a 3-bit length nibble:

32d8  lodsw
32d9  mov  bx,ax
32db  mov  cl,03
32dd  shr  bh,cl
32df  or   bh,e0           ; distance in the negative 8 KiB window
32e2  and  ah,07           ; length code
32e5  je   32f3
32e7  mov  cl,ah
32e9  inc  cx
32ea  inc  cx              ; length = code + 2

When the 3-bit length code is zero, an extension byte follows:

32f3  lodsb
32f4  or   al,al
32f6  je   332c            ; 0: end of compressed stream
32f8  cmp  al,01
32fa  je   3301            ; 1: segment-normalization control
32fc  mov  cl,al
32fe  inc  cx
32ff  jmp  32eb            ; length = extension + 2

Both match forms share the same overlapping copy loop:

32eb  mov  al,es:[bx+di]
32ee  stosb
32ef  loop 32eb
32f1  jmp  3299

Because source is ES:[DI + negative_distance] and destination is ES:DI, the loop naturally supports overlapping LZ copies. If the match length is longer than the distance, bytes just written become source bytes for the rest of the same match, which is the normal trick behind compact repeated fills.

The special extension byte 1 rebases DS:SI and ES:DI so decompression can cross 64 KiB segment boundaries:

3301  mov  bx,di
3303  and  di,000f
3306  add  di,2000
330a  mov  cl,04
330c  shr  bx,cl
330e  mov  ax,es
3310  add  ax,bx
3312  sub  ax,0200
3315  mov  es,ax

3317  mov  bx,si
3319  and  si,000f
331c  shr  bx,cl
331e  mov  ax,ds
3320  add  ax,bx
3322  mov  ds,ax
3324  jmp  3299

That DI = (DI & 0x0f) + 0x2000 detail is important: the depacker intentionally keeps a 0x2000-byte output headroom after the segment slide. It is not merely normalizing to offset zero.

Relocation Repair and Final Jump

End-of-stream jumps to 0x332c, where the loader applies relocation deltas to the unpacked program. The relocation stream starts at CS:0158, and BX holds the load segment plus 0x10:

332c  push cs
332d  pop  ds
332e  mov  si,0158
3331  pop  bx
3332  add  bx,0010
3335  mov  dx,bx
3337  xor  di,di

The relocation table is variable-length:

3339  lodsb
333a  or   al,al
333c  je   3354
333e  mov  ah,00
3340  add  di,ax
3342  mov  ax,di
3344  and  di,000f
3347  mov  cl,04
3349  shr  ax,cl
334b  add  dx,ax
334d  mov  es,dx
334f  add  es:[di],bx      ; relocate one word
3352  jmp  3339

If the byte delta is zero, a word command follows:

3354  lodsw
3355  or   ax,ax
3357  jne  3361
3359  add  dx,0fff         ; advance relocation base window
335d  mov  es,dx
335f  jmp  3339

3361  cmp  ax,0001
3364  jne  3340            ; non-1 word is a larger delta

Command word 1 terminates relocation and transfers control to the restored program:

3366  mov  ax,bx
3368  mov  di,[0004]       ; restored SP
336c  mov  si,[0006]       ; restored SS base
3370  add  si,ax
3372  add  [0002],ax       ; patch restored far entry segment
3376  sub  ax,0010
3379  mov  ds,ax
337b  mov  es,ax
337d  xor  bx,bx
337f  cli
3380  mov  ss,si
3382  mov  sp,di
3384  sti
3385  jmp  far cs:[bx]

That is the final boundary between the loader and the real demo. The unpacked main body was not recovered into a stable file during this pass, so code-offset claims below this point are intentionally avoided.

Visible Runtime Structure

Observed sequence in the DOSBox-X capture:

Capture time Visible state Technical role
00:02.000 black screen, dim LOADING... loader/depacker/user wait phase
00:10.000 Psygnosis-style logo with presents full-screen logo card
00:15.000 a Sonic / Careless production full-screen production card
00:20.000 purple vertical wipe transition into main scene
00:25.000 main scene still partially in transition frame/scroller loop starting
00:30.000 onward main screen steady star/gear/scroller loop

The main scene is a layered 320x200 VGA composition:

  1. Static foreground: purple dragon frame and The Brain Slayer logo.
  2. Background star field: small white stars inside the black central field.
  3. Gear aperture: grey pre-rendered gear frames clipped inside the central circular/oval window.
  4. Bottom scroller: orange/yellow text scrolling horizontally through the lower window, with the foreground ornament winning the draw order.
  5. Thin bottom status line and small corner credits.

The public comment calling the gear animation pre-rendered matches the visible evidence. The gear has shaded, photographic-looking material and no visible edge recomputation; the plausible 1992 implementation is a frame sequence copied or masked into the aperture, not a live 3D gear renderer.

Reconstructed Main Inner Loop

The exact post-unpack code for the main loop was not recovered, so this section is a reconstruction from observed output and era-appropriate VGA technique. It is useful for recreating the effect, but it is not a claim about exact offsets.

A faithful main-frame loop would be:

wait for vertical retrace or timer tick

restore dynamic rectangles:
  central gear aperture
  star-field area
  bottom scroller strip

advance stars:
  for each star:
    erase old pixel from background or restore from saved background byte
    update x/y by a small speed
    wrap when it leaves the visible field
    plot one bright pixel if the destination is inside the black/masked field

advance gear:
  frame_index = (frame_index + 1) mod gear_frame_count
  for each row of the aperture:
    read left/right clip from a mask/span table
    copy only the clipped bytes from the current gear frame

advance scroller:
  scroll_x -= one or more pixels
  when a glyph column exits, fetch the next glyph column from the message text
  shade glyph pixels through a yellow/orange ramp
  clip to the lower text window

redraw or preserve foreground:
  either keep dynamic writes inside precomputed masks
  or redraw the dragon/ring/logo foreground over the dynamic layers

present frame

The gear aperture is the tightest loop to reproduce. A normal full rectangle copy would overwrite the dragon frame. The visible result needs either a mask test per pixel or, more efficiently, a per-scanline span table:

for y in aperture_top .. aperture_bottom:
  left, count = aperture_span[y]
  src = gear_frames[frame_index] + (y - aperture_top) * gear_pitch + left
  dst = vram + y * 320 + aperture_left + left
  copy count bytes

The bottom scroller can use the same idea: build a narrow offscreen strip from font columns, then copy only visible spans into the final screen. The screenshot shows the foreground ornament and lower frame still controlling the text boundaries, so a mask/span compositor is more likely than an unrestricted linear text copy.

The vertical reveal at 00:20.000 is probably a column/span transition rather than a palette-only fade. The frame shows tall purple columns at the center, which fits a loop that expands from center outward:

for radius = 0 .. max_radius:
  wait frame
  copy column center - radius from prepared main screen
  copy column center + radius from prepared main screen

The production/logo cards before the main loop can be implemented with the same screen-copy primitives: unpack or draw a 320x200 image, load a DAC palette, then wait/fade/wipe before the next card.

Runtime-To-Code Concordance

The media set combines two public Demozoo stills with a DOSBox-X contact sheet and six timestamped runtime frames from the original TBS_GEAR.EXE. This pass does not recapture, crop, pad, resize, regenerate, or alter those assets. The loader/depacker mapping below is direct static evidence; the post-unpack main-loop mapping is intentionally bounded because the final MAING runtime body has not yet been recovered to stable addresses.

Visual evidence Code / package evidence What it means
Public Demozoo production/main stills Archive identity, TBS_GEAR.EXE, HOME.COM, readme.txt, and Demozoo/Pouet metadata The runtime frames are being tied to the same March 1992 Gear production, not to an unrelated capture.
00:02.000 LOADING... frame Small DOS-loaded MZ image, appended payload beginning at 0x33AB, LOADG marker, and entry copy stub at 0x323E The visible loading screen belongs to the custom wrapper/loader stage, before the restored main body takes over.
00:10.000 Psygnosis-style card and 00:15.000 Sonic/Careless card MAING marker at 0x3928, high-entropy appended data, and final relocation/far-jump boundary at 0x3385 These full-screen cards are post-unpack presentation states loaded from the appended body, not normal DOS child programs or loose image files.
00:20.000 purple vertical reveal Reconstructed center-out column/span transition, bounded by missing post-unpack addresses The wipe is visible as column motion, but its exact loop address is not claimed until the MAING body is recovered.
00:25.000 transition into main screen and 00:30.000 steady main loop Observed dragon frame, star field, pre-rendered gear aperture, and bottom scroller; public comment also describes pre-rendered gear animation The main screen is a layered VGA scrolltro: static foreground art plus dynamic stars, gear-frame playback, and clipped scroller.
Gear aperture in the main screen Bounded reconstruction using per-row span/mask copy from gear frame data The gear is treated as pre-rendered frame material clipped into the aperture, not live 3D geometry.
Bottom scroller crossing the lower ornament Bounded reconstruction using a clipped text strip or mask/span compositor The scroller must respect the foreground frame boundaries; the article avoids assigning an exact font/scroller routine address.
MZ wrapper and depacker SONIC! header reuse, entry copy stub, bit bucket in BP, literal/match LZ tokens, overlapping ES:[BX+DI] copy loop, segment slide at 0x3301, relocation stream at 0x332C The strongest code proof is the custom loader: it reconstructs and relocates the real demo before the visible show runs.
Contact sheet as a whole Loader card, two credit cards, reveal, and main loop in one DOSBox-X run The capture proves a single compact loader-to-main-loop sequence rather than separate screenshots assembled by hand.

The useful conclusion is split in two. The packaging side is proven: a hand-shaped SONIC! MZ wrapper, appended LOADG/MAING body, LZ-style depacker, relocation repair, and final far transfer. The visible main loop is bounded but coherent: preauthored art and likely mask/span compositing drive the dragon frame, starfield, rotating gear aperture, and bottom scroller.

What Was Not Proven

The loader/depacker and relocation loops above are direct static disassembly of the loaded MZ image. The main visual-loop description is not yet an exact disassembly of the unpacked MAING body. A future pass could dump guest memory after the final far jump or emulate the depacker to recover address-stable code for the VGA/Sound Blaster routines.

Even with that boundary, this pass establishes the important shape of the demo: a hand-built SONIC! MZ wrapper, appended LOADG/MAING packed payload, literal/match bitstream depacker, relocation delta table, and a short but polished March 1992 VGA scrolltro loop built around pre-rendered art rather than computational 3D.