Analysis model: gpt-5.5 xhigh, sol high
Last edited: 2026-08-25
Space by UltraForce - Technical Dissection
Space is a December 1990 MS-DOS demo by UltraForce. Pouet lists it as an
MS-DOS demo released in December 1990, and Demozoo lists Space Demo by
Ultraforce with the same month and year. The Hornet 1990 demo index lists
space.zip as Space by Ultraforce and rates it ***.
Release year: 1990
This one is historically interesting for a different reason than most later PC demos in this set. It is not a custom VGA effect engine built around a hand-coded tunnel, polygon filler, or music player. The bundled text says the demo was converted from an Amiga original to PC in three days, using GRASP 3.00 and Deluxe Paint II Enhanced on the PC side. The shipped program is therefore a small DOS launcher plus the GRASP 3.00 interpreter plus a large encrypted GRASP library.
That still leaves plenty to dissect:
- the tiny launcher is LZEXE-packed and installs a resident INT 21h read filter;
SPACE.DATis byte-transformed on disk and becomes a normal GRASP library only after that filter is applied;- the decoded library contains a plaintext GRASP script and 123 picture, clip, and font assets;
SPACE.ULTis also LZEXE-packed and expands to a full GRASP 3.00 interpreter;- the useful inner loops are the loader's stream decoder, GRASP's directory lookup/loading path, rectangle fill/move, DAC palette streaming, and scripted clip movement/blit paths.
So this article treats Space as an early PC multimedia conversion with a
custom protected data path, not as a normal hand-coded demoscene renderer.
Sources
- Pouet production page: https://www.pouet.net/prod.php?which=4079
- Demozoo production page: https://demozoo.org/productions/341075/
- Hornet 1990 demo index: https://files.scene.org/get/mirrors/hornet/demos/1990/00_index.txt
- Scene.org archive: https://files.scene.org/get/mirrors/hornet/demos/1990/space.zip
- Scene.org file page: https://files.scene.org/view/mirrors/hornet/demos/1990/space.zip
The bundled text contains only project credits and release notes, not a compo placement. It says the PC conversion used an IBM-compatible XT with VGA and requires VGA/MCGA plus at least 380K of free conventional memory.
Old distribution-era personal details are not reproduced here.
Archive
The examined archive is the Hornet mirror space.zip:
a9aa8dd6cb953dd07c8303cdc0abdacd1964b20842eee68d189e458ba8c720f5 space.zip
Archive contents:
SPACE.DAT 577319 bytes 1993-12-27 11:00
SPACE.EXE 1069 bytes 1993-12-27 11:00
SPACE.TXT 2325 bytes 1993-12-27 11:00
SPACE.ULT 42637 bytes 1993-12-27 11:00
Important file hashes:
8e94b30c6e0993b93ca93e35093f47c780f6b572f913d04bf342b9cf64224daf SPACE.EXE packed
f895d45562415c3b010d8e490c3bfa5612d57bf7a3b41910890ad0249358616a SPACE.ULT packed
ab796e772de3901b58f507d752b7f9928a2ea3e4913b3d0f72dc8ff20f725eed SPACE.DAT encoded
5f256dbecf9dba8e2633417c90b86ec39304de6564f3e12c12a3abd987f47e27 SPACE.TXT
17decd002cce3b3b3ec8eba26379deb19a9e5ff183a8ec07773a7c6a35a527b7 SPACE.EXE after UNP
1a0c6c47a7b6697210160dec8cce451dc682d8332ff99b6b184e18913e4e64e0 SPACEULT.EXE after UNP
f2bf8bd8d3d265cab3e17dad229f394ce4443f2c64c595da4bbd498e2f6d4fa3 SPACE.DAT decoded
File roles:
SPACE.EXE tiny LZEXE-packed launcher and SPACE.DAT read filter
SPACE.ULT LZEXE-packed GRASP 3.00 interpreter
SPACE.DAT encrypted GRASP library containing script, pictures, clips, font
SPACE.TXT release note and PC conversion credits
SPACE.ULT is not an UltraTracker module despite the extension. It is an MZ
program. After LZEXE expansion it contains the visible GRASP strings:
The GRASP Interpreter
Graphic Animation System for Professionals
Version 3.00 10-20-87
The production has no separate music module in this package. The story is told through static artwork, clip fades, screen moves, waits, and text.
LZEXE Expansion
Both executable-looking files contain the LZ09 marker.
After UNP expansion, the small launcher is:
file size: 1141 bytes
header bytes: 32 bytes
load image: 1109 bytes
relocations: 0
entry in header: fff0:0100
stack in header: fff0:fffe
The header is still COM-style after unpacking. The useful view is therefore the
load image with a logical 100h base: image offset 0x0000 corresponds to
runtime offset 0x0100.
SPACE.ULT, copied as SPACEULT.EXE for the 8.3 unpack run, expands to:
file size: 68017 bytes
header bytes: 32 bytes
load image: 67985 bytes
relocations: 0
entry: 1084:0012 image offset 0x10852
stack: 1111:0080 image offset 0x11190
The expanded SPACE.ULT image is a compiler-built interpreter with a large
embedded command table and many file, memory, video, and palette helpers. The
demo-specific logic mostly lives in SPACE.DAT.
Launcher Shape
The launcher does four things:
- prints the
Space demo from Ultra Forcebanner; - checks DOS version and available conventional memory;
- installs temporary INT 21h and INT 24h vectors;
- executes
space.ult, passingspace.datas the command tail.
The EXEC setup in image offsets:
0000 ba 82 01 mov dx,0182h ; banner, logical offset
0003 b4 09 mov ah,09h
0005 cd 21 int 21h
...
002b e8 1c 02 call 024a ; install vectors
...
003e ba 5e 02 mov dx,025eh ; "space.ult", logical offset
0041 bb 68 02 mov bx,0268h ; EXEC parameter block
0044 b8 00 4b mov ax,4b00h
0051 cd 21 int 21h
...
0067 push dx
0068 call 0287 ; restore vectors
The logical offsets matter. The INT 21h vector is installed as CS:03B0h,
which maps to image offset 0x02b0. The INT 24h vector is installed as
CS:0435h, which maps to image offset 0x0335.
The command tail embedded in the launcher is:
space.dat
GRASP sees SPACE.DAT as its library/script input, but the disk file is not
plain GRASP data. It becomes readable only because the launcher remains in
memory and filters DOS reads.
The INT 21h Read Filter
The launcher hook intercepts only DOS function AH=3Fh, the file-read call.
All other functions tail-jump to the previous INT 21h vector.
The body starts at logical 03B0h, image offset 0x02b0:
02b0 cmp ah,3fh
02b3 je 02ba
02b5 jmp far [cs:0383h] ; old INT 21h vector
The hook also checks the interrupt return CS. If the caller is still inside the launcher's segment, it does not transform the buffer. If the caller is the child interpreter segment, it calls the original DOS handler and decodes the bytes that DOS just placed in the caller's buffer.
The transform loop is tiny:
02e1 call far [cs:0383h] ; original INT 21h
02e6 jc done
02e8 or ax,ax ; AX = bytes read
02eb je done
02ed pushf
02ee push ax
02ef push cx
02f0 push di
02f1 push es
02f2 mov cx,ax ; decode byte count
02f4 mov di,[cs:0451h] ; saved caller DX buffer offset
02f9 mov es,[cs:0453h] ; saved caller DS buffer segment
02fe cld
02ff mov al,es:[di]
0302 add al,0adh
0304 rol al,1
0306 rol al,1
0308 sub al,0adh
030a stosb
030b loop 02ff
In high-level terms:
decoded = rol8(encoded + 0xad, 2) - 0xad
The transform is symmetric only in spirit, not by using the same operation. The encoder on the original tool side would have applied the inverse:
encoded = ror8(decoded + 0xad, 2) - 0xad
Applying the runtime decode operation to the full SPACE.DAT file produces a
normal GRASP library with a plaintext script at the front.
The loop also has a simple exact traffic ledger. For a successful DOS read
that returns N bytes in AX, the hook performs N source-buffer reads and
N in-place writes. Each iteration executes one add, two one-bit rotates, one
subtract, one STOSB, and one LOOP; there is no block-size-dependent setup
inside the body. An offline whole-file pass over the 577,319-byte DAT therefore
means exactly 577,319 transformed reads and 577,319 transformed writes. That is
an offline equivalence figure, not a claim that GRASP reads the entire library
in one DOS call: at runtime the same loop is entered once per successful
AH=3Fh result and uses the byte count DOS actually returned.
The hook is clever for 1990 because it avoids changing GRASP itself. The interpreter opens and reads a normal-looking file. DOS supplies encrypted bytes. The resident parent rewrites them in-place before GRASP parses them.
Decoded SPACE.DAT Layout
Decoded SPACE.DAT begins:
4d 08 4f 08 00 00 74 6d 70 66 69 6c 65 2e 74 78
The first two words are:
0x084d directory byte limit
0x084f first member offset
The directory begins at offset 0x0006. Each record is 17 bytes:
13 bytes null-padded filename
4 bytes little-endian end offset of that member
Each member starts with a 32-bit payload length, followed by that many payload
bytes. The first member starts at offset 0x084f; its length word is 0x39c9,
and the payload starts at 0x0853.
This parser recovers 124 members. Selected entries:
tmpfile.txt start=0x0084f payload=14793
prf1.clp start=0x0421c payload= 992
planet0.pic start=0x09c7d payload= 6950
plan4.clp start=0x0f4c0 payload=18187
pigfont.set start=0x32572 payload= 775
site6.pic start=0x36ff0 payload= 867
headfram.pic start=0x582c0 payload=10123
skb1.clp start=0x5ca03 payload= 6851
ultra.pic start=0x8966b payload=13649
profade.pic start=0x8cbc0 payload= 867
The member names match the script's commands: CLOAD PLAN1, PLOAD PLANET0,
FLOAD PIGFONT, PLOAD ULTRA, and so on. The PC demo is a GRASP library
project bundled into one transformed DAT file.
GRASP Script
The first member, tmpfile.txt, is the demo script. It begins:
video l
; STARTUP SEQUENCE
startup:
GOSUB TITLE
GOSUB OPEN
GOSUB PLANETS
GOSUB SITE
GOSUB SKULL
GOSUB GREEN
GOSUB ANIM
GOSUB LOGOFF
GOSUB END
WAITKEY 400
goto startup
EXIT
The full script is about 14.8 KB. Its static source-line usage is mostly:
117 PUTUP
109 WAITKEY
109 CLOAD
97 TEXT
83 COLOR
67 MOVE
41 RECT
31 CFADE
27 EDGE
21 MARK
21 LOOP
These are source counts, not loop-expanded runtime totals. The profile still explains the visual style: it is mostly prepainted clips, small repeated animations, fades, windowed text, screen scrolling, and timed presentation.
The named sections are:
TITLE title/logo buildup and story text
OPEN logon screen and planet setup
PLANETS scan/zoom sequence over planet clips
SITE fossil/site zoom sequence
SKULL reconstructed skull/fossil animation
GREEN color/foreground transition
ANIM head rotation frames and status text
LOGOFF return through the logon-style screen
END UltraForce end logo and scrolling credit text
Representative animation from ANIM:
mark 5
PUTUP 110,86,2
PUTUP 110,63,12
WAITKEY 5
PUTUP 110,86,3
PUTUP 110,63,13
WAITKEY 5
...
loop
That is not a 3D object renderer. It is a flipbook made from preloaded clip members, with small delays between frames. The script calls it a rotation scan, but the implementation is clip playback.
The end sequence uses MOVE as a rectangular scroll:
mark 30
move 0,1,319,87,0,0
loop
mark 25
move 0,88,319,158,0,89
loop
This moves rectangular screen regions upward/downward for a transition, then
uses repeated TEXT plus MOVE calls to scroll credit text through a small
window.
Library/Script-To-Code Concordance
The strongest evidence for Space is not a local runtime capture; it is the
decoded SPACE.DAT library and the recovered GRASP script. The launcher makes
that possible by staying resident and filtering DOS reads: its INT 21h
handler at logical 03B0h intercepts AH=3Fh, calls the old DOS handler, and
decodes the returned bytes with rol8(encoded + 0ADh, 2) - 0ADh. The decoded
file then becomes a normal GRASP library with a directory at 0006h, a first
member offset of 084Fh, and script member tmpfile.txt.
The top-level script is therefore real runtime material, not a guessed outline.
Its GOSUB TITLE, OPEN, PLANETS, SITE, SKULL, GREEN, ANIM,
LOGOFF, and END sequence maps to repeated GRASP object loads and draw
commands. CLOAD and PLOAD go through the interpreter's library lookup and
object installation paths, while the decoded member headers show conventional
GRASP picture and clip records rather than a custom UltraForce image format.
The script's heavy PUTUP use maps to handler 0x1EDC: it parses x, y, and
clip-slot arguments, checks the slot through 4DABh, applies the current draw
offsets at 0838h/083Ah, calls C62Dh to set the draw position, and finally
calls 5406h on the 16-byte clip record. That ties flipbook lines such as
PUTUP 110,86,2 directly to GRASP's clip-slot renderer rather than to a hidden
polygon or sprite engine.
The script's MOVE-based scrolling maps to handler 0x2A19. It parses six
coordinates, validates them through 4D1Dh/4D7Dh, then calls the low-level
rectangle mover at 6AB5h. The end-credit loop that alternates TEXT with
move 91,60,258,103,91,61 is therefore a scripted rectangular screen copy, not
a character scroller. The visual motion comes from copying a window by one row
and printing the next line into the exposed area.
Palette-heavy commands also have concrete interpreter backing. The command
table routes PALETTE, PFADE, CFADE, and related script effects into the
DAC streaming paths around 0xC027 and the fade/current-palette helpers. This
matches the script profile: Space is mostly prepainted pictures and clips,
palette fades, rectangular moves, and timed waits.
So the trusted claim is bounded: the article reconstructs the launcher decoder, the decoded library/script, and the GRASP command handlers exercised by that script. It does not claim a hand-coded 3D or per-pixel UltraForce effect engine, and it does not publish a local runtime image sequence for this page.
GRASP Command Table
The expanded SPACE.ULT image contains a 66-command table at image offset
0xf683. The command strings begin at 0xf893.
Each command record is eight bytes:
word name pointer in GRASP data segment
word handler offset
word argument count / command arity value
word flag
The command-name pointers are not raw image offsets. For this image, the GRASP
data-segment base maps them by adding 0xf1f7. For example, the first record
uses name pointer 0x069c; 0x069c + 0xf1f7 = 0xf893, the string box.
Selected records:
box handler=0x1a95 args=5 flag=1
cfade handler=0x1091 args=4 flag=1
clearscr handler=0x121f args=1 flag=1
cload handler=0x43d2 args=2 flag=0
color handler=0x1c96 args=2 flag=0
edge handler=0x2d9c args=1 flag=0
fload handler=0x42eb args=2 flag=0
move handler=0x2a19 args=7 flag=0
palette handler=0x22e2 args=1 flag=0
pfade handler=0x0eda args=2 flag=1
pload handler=0x0e4f args=2 flag=0
putup handler=0x1edc args=1 flag=1
rect handler=0x2af0 args=5 flag=1
setrgb handler=0x2e05 args=4 flag=0
text handler=0x1d11 args=4 flag=1
waitkey handler=0x1309 args=1 flag=0
window handler=0x255c args=1 flag=0
This is enough to tie the script back to actual interpreter code. CLOAD and
PLOAD are not magic demo commands; they are GRASP command handlers that fetch
members from the decoded library and install them in clip/picture slots.
Interpreter Startup
The SPACE.ULT entry path is compiler-shaped. The header entry points to image
offset 0x10852, but the startup code near image offset 0x0000 is still
useful because it sets up the data segment, stack, command tail, zeroed data,
and exit path.
The core call chain near startup:
00a8 mov di,1daeh
00ab mov cx,2d9ch
00ae sub cx,di
00b0 xor ax,ax
00b2 rep stosb ; clear interpreter state block
00b4 call 83fd ; parse command tail / startup parameters
00c1 push ax
00c2 call 58eb ; close/free open handles
00c5 call 7a96 ; init state words
00c8 call 5c19 ; cleanup on exit
The visible command-table strings and error strings are built into the interpreter, not generated by the demo-specific script.
Library Loading
PLOAD begins at handler 0x0e4f. It validates the destination picture slot,
frees any previous object in that slot, resolves the member name, and stores the
loaded picture pointer in the picture-slot table at 0x2772 + slot*2.
Important part:
0e59 mov word [bp-2],0001h ; default slot 1
0e67 push word [si+04h]
0e6a call 8146 ; parse numeric argument
...
0e93 push word [bp-2]
0e96 call 369c ; free previous picture slot
0e9a push word [si+02h]
0e9d call 427f ; resolve/load member
0ea1 mov bx,[bp-2]
0ea4 shl bx,1
0ea6 mov [bx+2772h],ax ; slot pointer
FLOAD at 0x42eb and CLOAD at 0x43d2 share the same broad pattern:
copy/normalize the member name, open/locate it in the library, load the payload,
then validate the loaded object type.
CLOAD also clears the target clip slot before installing the new object:
4453 xor di,di
4456 mov ax,[bp-4] ; slot
4459 shl ax,4 ; 16-byte slot record
445e mov cx,di
4460 shl cx,1
4462 add ax,cx
4464 add ax,1f72h
4467 push ax
4468 call 6817 ; release and clear one pointer field
446c inc di
446d cmp di,8
4470 jl 4456 ; clear 8 words in the slot record
That slot stride explains later code such as slot << 4 + 0x1f72. Each loaded
clip has a 16-byte runtime record containing eight pointer fields. Helper
6817h is lifecycle code, not just a store-zero helper: it exchanges the field
with zero, then, when the old pointer was nonzero, releases the object's main
allocation, its optional pointer at +0Eh, and finally the object record.
Thus every CLOAD begins with eight bounded release-and-zero calls before it
installs the replacement. This is why the script can repeatedly reuse clip
slot numbers across sections without accumulating every old decoded object.
Text Clear Versus Graphics Fill
The generic helper at 0x00de is specifically the text-style clear. It fills
the selected surface with a word whose high byte is the current attribute and
whose low byte is 0x20, the space character.
00de cld
00e2 mov ah,[bp+04h] ; color
00e5 mov al,20h ; blank/space byte
00e7 mov cx,[1425h] ; active text-surface byte count
00eb shr cx,1
00ed mov es,[12e2h] ; active video/work segment
00f1 xor di,di
...
0114 call 6d31 ; retrace/timing helper
0117 rep stosw
There is also a four-pass branch for a specific planar/text mode:
00f3 cmp byte [12e0h],31h
00f8 jne 0114
00fa cmp byte [181bh],00h
00ff jne 0114
0101 shr cx,1
0103 shr cx,1
0105 mov bl,04h
0107 push cx
0108 call 6d31
010b rep stosw
010d pop cx
010e dec bl
0110 jne 0107
That loop should not be charged to Space's graphics presentation. The
CLEARSCR handler at 121Fh tests the current video-mode code: modes below
A call this text helper, while graphics modes call the rectangular graphics
fill path at 88D4h with the current window bounds. Space selects video l
and its recovered script contains no CLEARSCR command at all. Its visible
cleanup is instead expressed through RECT, BOX, fades, and full pictures.
This distinction matters because treating the 20h:color word as a mode-L
64,000-byte clear would assign a text-buffer loop to a path the demo does not
execute.
Palette Output
GRASP's DAC streamer at 0xc027 receives:
DX = pointer to RGB bytes
BX = first palette index
CX = number of RGB triples
The hardware path waits for vertical retrace, sets the DAC write index, and then chooses between a one-byte stream and an RGB-triple stream:
c047 mov dx,[17fah] ; status port, normally 03dah
c04c in al,dx
c04d and al,08h
c04f jne c04c ; wait outside retrace
c052 in al,dx
c053 and al,08h
c056 je c051 ; wait inside retrace
c058 mov dx,03c6h
c05b mov al,0ffh
c05d out dx,al
c05e inc dx
c05f inc dx ; 03c8h
c060 mov al,bl
c062 out dx,al ; start index
c063 inc dx ; 03c9h
c06b rep outsb ; one-byte-format branch: CX source bytes
The branch selected for three-byte palette buffers outputs one complete RGB
triple per CX iteration and can break for retrace again after a configured
entry count:
c073 dec bl
c075 je c082 ; refresh sync chunk
c077 lodsb
c078 out dx,al
c079 lodsb
c07a out dx,al
c07b lodsb
c07c out dx,al
c07d loop c073
For N entries, that RGB path consumes exactly 3N source bytes and performs
3N writes to 03C9h, plus one write to the pixel mask at 03C6h and one to
the start-index register at 03C8h. Retrace polling is data-independent but
not cycle-fixed: every synchronization point performs at least one status-port
read while waiting to leave retrace and at least one while waiting to enter it,
with additional reads for however long each phase lasts. That is the runtime
basis for PALETTE, PFADE, CFADE, and related commands. The script leans
on those commands constantly, so this is one of the few hardware-near loops
the production exercises heavily.
SETRGB And Generated Ramps
The setrgb handler at 0x2e05 constructs RGB bytes in a temporary buffer and
then calls the DAC upload helper. The script does not explicitly use SETRGB,
but it is a useful compact example of GRASP's palette-side code.
The generated-ramp path parses a start color and RGB deltas, allocates
count * 3 bytes, writes one RGB triple per palette entry, and advances each
component by its delta:
2e7f mov ax,[bp-0ch] ; count
2e82 mov dx,ax
2e84 shl ax,1
2e86 add ax,dx ; count * 3
2e89 call 871e ; allocate temp buffer
2e90 mov di,ax
2e92 mov word [bp-0ah],0
...
2e9a mov al,[bp-0fh] ; B
2e9d mov [di],al
2e9f inc di
2ea0 mov al,[bp-10h] ; G
2ea3 mov [di],al
2ea5 inc di
2ea6 mov al,[bp-11h] ; R
2ea9 mov [di],al
2eab inc di
2eac mov al,[bp-0fh]
2eb1 add ax,[bp-04h] ; B += delta
2eb4 mov [bp-0fh],al
2eb7 mov al,[bp-10h]
2ebc add ax,[bp-06h] ; G += delta
2ebf mov [bp-10h],al
2ec2 mov al,[bp-11h]
2ec7 add ax,[bp-08h] ; R += delta
2eca mov [bp-11h],al
2ecd inc word [bp-0ah]
2ed0 cmp [bp-0ah],[bp-0ch]
2ed6 jl 2e9a
2f26 push word [bp-0ch]
2f29 push word [bp-02h]
2f2c push word [bp-0eh]
2f2f call c027 ; DAC upload
The fixed-color path is similar but writes the same RGB triple repeatedly.
PUTUP And Clip Blitting
PUTUP at handler 0x1edc validates a clip slot, applies the current offsets,
and calls the lower-level blitter.
1ef9 push word [si+02h]
1efc call 0e0c ; x argument
1f00 mov [bp-02h],ax
1f03 push word [si+04h]
1f06 call 8146 ; y argument
1f0a mov [bp-04h],ax
1f0d push word [si+06h]
1f10 call 8146 ; clip slot
1f14 mov [bp-06h],ax
...
1f24 push word [bp-06h]
1f27 call 4dab ; slot loaded and in range?
...
1f3a mov ax,[bp-04h]
1f3d add ax,[083ah] ; y offset
1f41 push ax
1f42 mov ax,[bp-02h]
1f45 add ax,[0838h] ; x offset
1f49 push ax
1f4a call c62d ; set draw position
...
1f5d mov ax,[bp-06h]
1f60 shl ax,4
1f65 add ax,1f72h ; clip record
1f68 push ax
1f69 call 5406 ; draw clip
So a script line such as:
PUTUP 110,86,2
is not interpreted as direct filename drawing. It draws whatever clip object
slot 2 currently points at. The script's repeated CLOAD blocks set up those
slots in advance.
5406h is a dispatcher rather than the pixel loop itself. It selects the
active pointer from the 16-byte slot record and routes compatible planar clip
objects to BC0Eh; the general clipped renderer is at CC83h. The latter
first intersects the object rectangle with the current window, advances the
source offset for top/left clipping, computes the visible packed-byte width
and row count, and then selects a format-specific row kernel. Its eight-bit
kernel is the relevant one for video l: each row is copied with REP MOVSW
and an optional MOVSB, followed by the decoded object's source-row stride.
An unclipped w by h clip therefore costs exactly w*h decoded-source reads
and w*h video writes. The older target labels BE0Eh/CE83h were file
offsets from a padded unpacked EXE; BC0Eh/CC83h are the correct load-image
offsets used here.
The ANIM section gives a useful complete ledger. It loads ten head clips
(121..156 pixels wide and 89..100 high), ten eight-pixel-high status-text
clips, and the 85x111 spier clip. MARK 5 stores count-1; LOOP decrements
that counter and jumps back while it remains positive, so the enclosed
18 head/text pairs run five times, not six. Five trailing pairs follow. With
no clipping at the script's coordinates, those 95 head draws plus 95 text
draws move 1,315,583 bytes; the initial spier draw adds 9,435. The section's
clip playback therefore performs exactly 1,325,018 decoded-pixel reads and
1,325,018 VGA writes. That byte count is the implementation of the advertised
“3D ROTATION SCAN”: authored frames are copied, not vertices transformed.
MOVE And Rectangular Copies
MOVE handler 0x2a19 parses six coordinates:
source x1, source y1, source x2, source y2, destination x, destination y
The handler validates x/y bounds against the current window, then delegates to the low-level rectangle copy helper:
2a23 parse x1
2a31 parse y1
2a3f parse x2
2a4d parse y2
2a5b parse dest x
2a69 parse dest y
...
2a77 push [bp-02h]
2a7a call 4d1d ; x1 valid?
...
2aa1 push [bp-04h]
2aa4 call 4d7d ; y1 valid?
...
2ad3 push [bp-0ch]
2ad6 push [bp-0ah]
2ad9 push [bp-08h]
2adc push [bp-06h]
2adf push [bp-04h]
2ae2 push [bp-02h]
2ae5 call 6ab5 ; rectangle copy/move
The end credits use this constantly to scroll a window:
text 91,56," Animation building by ... "
move 91,60,258,103,91,61
text 91,57," Animation building by ... "
move 91,60,258,103,91,61
That pattern writes a text line near the top of the window, copies the region down by one pixel/row step, writes the next line, and repeats. It is a scripted scroll effect rather than a character-by-character scroller.
The mover at 6AB5h is overlap-safe. In mode l it derives an inclusive byte
width of x2-x1+1 and an inclusive row count of y2-y1+1. If the destination
starts to the right, it sets DF and copies each row backward; if the
destination starts below the source, it begins with the last row and walks the
scanline-pointer table backward. Each row is one REP MOVSW plus an optional
MOVSB, so every moved byte is read once and written once.
That makes the entire END section quantifiable from the script. Its opening
30 copies of a 320x87 band move 835,200 bytes, followed by 25 copies of a
320x71 band for 568,000 bytes. The credit window uses 200 calls on a 168x44
rectangle--50 explicitly written calls plus 150 MARK/LOOP repetitions--for
1,478,400 bytes. The four closing loops add 844,800, 560,000, 720,000, and
784,000 bytes. In total, END performs 5,790,400 video-source byte reads and
5,790,400 video writes through MOVE, or 11,580,800 byte accesses before
counting text drawing, fades, and control overhead.
CLOAD/PLOAD Object Headers
Decoded clip and picture members start with recognizable GRASP object headers. Examples:
prf1.clp:
34 12 9a 00 15 00 00 00 00 00 08 ff 4c 00 00 00 ...
planet0.pic:
34 12 40 01 c8 00 00 00 00 00 08 ff 4c 04 00 00 ...
ultra.pic:
34 12 40 01 c8 00 00 00 00 00 08 ff 4c 04 00 00 ...
0x1234 is a convenient marker. The full-screen .pic members carry dimensions
consistent with 320x200-style GRASP pictures (0x0140 by 0x00c8). Clip
members carry smaller dimensions, e.g. prf1.clp has 0x009a by 0x0015.
The interpreter's loader validates several object flavors. For example, the
clip loader helper at 0x9dad reads 12 header bytes and then branches through
format tests:
9dcc push di
9dcd push [bp+04h]
9dd0 call 7582 ; read header bytes
9ddd cmp byte [di],34h
9de5 cmp byte [di+01h],12h
9dee mov al,[di+0bh]
9df3 cmp ax,00ffh
...
9e1d cmp ax,00fdh
9e29 cmp ax,00feh
...
9e9f cmp byte [di],0ah
9eb0 cmp byte [di+01h],10h
Different header shapes dispatch to different unpack/load paths. Space relies
on GRASP's existing object codec rather than carrying a demo-specific picture
decoder in the launcher.
What Each Script Part Does
TITLE loads a font, the PROFADE picture, six PRF clips, and six RT
clips. It stacks several PUTUP calls with one- or two-pixel offsets, waits,
moves a rectangle, and prints the opening story text.
OPEN loads the planet picture and two opening clips. It alternates logon text
with rectangle clears, draws the planet/system labels, and uses CFADE for the
animated scan window.
PLANETS loads planet tiles, labels, and edge/overlay clips. It repeatedly
draws a monitor-like large image at 273,33, fades a clip over the planet
viewport, prints status text, waits, and moves to the next prepainted scan
state.
SITE is the same method on a fossil/site sequence: base clip, highlighted
box, zoom clip, background clear, smoothing clip, and cleanup.
SKULL switches to skull reconstruction clips. The repeated PUTUP and
WAITKEY calls make a short flipbook; later CFADE overlays muscle/connection
art and final site elements.
GREEN is a transition around end3, col_e, colran, and cupric, with
small rectangle clears and a few clip overlays.
ANIM loads headfram.pic, spier.clp, head1 through head10, and ten
ctext clips. It plays the head frame sequence forward and backward with
WAITKEY 5 delays. This is the most animation-like section, but it is still
prepainted frame playback.
LOGOFF repeats the login-screen style with LOGOFF text, clears the screen,
and frees the loaded objects.
END loads ultra.pic, fades it in, scrolls rectangular bands, then uses
repeated TEXT plus MOVE to roll credits through a window. After a fade out
and a few more rectangular moves, it returns to the top-level script, which
loops the whole show.
What Is Actually Custom
The custom part of Space is not the GRASP renderer. It is the deployment
wrapper:
- a tiny launcher around GRASP;
- a DOS read hook that transforms bytes after every successful file read;
- a single-file GRASP library that looks meaningless until decoded;
- a script and asset bundle that reconstruct an Amiga-style presentation on 1990 VGA/MCGA hardware.
This explains why the production can feel polished for such an early PC demo while containing no custom vector engine. The heavy lifting is asset preparation and GRASP scripting. The demoscene-relevant trick is wrapping that presentation in a small executable and an encoded library so it runs like a single demo package.
Limits Of This Pass
This pass reconstructs the launcher, the file-read transformation, the decoded
library table, the script structure, the GRASP command table, object cleanup,
clip clipping/copy kernels, overlap-safe rectangle movement, palette traffic,
and exact byte ledgers for the rotation flipbook and end scroll. It does not
fully reimplement the GRASP .pic/.clp load-time codecs, and it does not
convert every embedded asset to modern image files.
For Space, that boundary is appropriate: the demo-specific code is the
launcher and the script. The per-pixel visual routines are GRASP 3.00 runtime
code, not original UltraForce effect code.