Reverse-engineering notes on Legends (Krisalis Software, 1996) for the Amiga CD32 -- a six-floppy A1200 game copied onto a compact disc, given sixty-five minutes of Red Book audio, and shipped with the floppy release's hard-disk installer still on it.
This repository documents the Guildhall Leisure Services release: one data track, 111 files, 79 of them packed with a decruncher the game carries in 201 bytes, and five level executables that call themselves version 0.99.
Documentation only. No game assets, no extracted art, no audio, no
executable code is committed here. The tools in tools/ reproduce
every figure, table and image in these pages from your own legally obtained
copy.
| Doc | Contents |
|---|---|
| 00-overview.md | The release, the disc, the two programs, and the four sittings the timestamps describe |
| 01-disc-image.md | The cue sheet, 28 audio tracks, the sector map, and 89 % of a CD |
| 02-trademark-block.md | The .TM block, and the fourth disc to carry the same 2,048 bytes |
| 03-filesystem.md | ISO 9660 field by field, a named preparer, and one impossible date |
| 04-boot-chain.md | Two StartUp-Sequences, three commands, and 100 bytes that delete a library |
| 05-compression.md | The .Pak codec: Bytekiller, transcribed out of the loader, and the checksum nobody reads |
| 06-executables.md | The front end, LoadSeg written out by hand, and how much machine the game takes |
| 07-graphics.md | 320x200 at eight separated planes, 24-bit AGA palettes, a 77-glyph font, and one solved mystery file |
| 08-sprites-and-levels.md | 34 sprite banks, the manifests that name every object in them, and the level designer's palette names |
| 09-text.md | RDT!, three languages kept in step by hand, and a font that draws its own boxes |
| 10-audio.md | 28 CD tracks, one ProTracker module, and eight IFF samples that kept their wrappers |
| 11-leftovers.md | The archaeology: six floppies, a missing disk 4, an installer, two version numbers, and photographs of the team |
| 12-open-questions.md | Everything unresolved, with the measurement behind it |
| notes/file-inventory.md | All 118 directory records with LBA, size, timestamp, unpacked size and hash |
| notes/sprite-manifests.md | All 34 sprite-bank manifests, and the check that they match the banks |
| notes/dialogue.md | Every in-level text record, and the story screens in three languages |
| notes/string-inventory.md | Every legible string, by file and offset |
| cd32-platformnotes-doc | Platform checklist -- what to look for on any CD32 or CDTV disc. Shared by every Amiga CD pipeline; this repo does not keep a copy |
The game is 0.72 % of the disc and the music is 88.6 %. 28 Red Book
tracks, 65 minutes 36 seconds, 295,209 sectors, on top of a data track of
2,404. That makes this the fullest CD32 disc in the series by a wide margin
and the second smallest game on one -- Legends spends almost exactly as much
of a CD on itself as The Speris Legacy does, and then fills
the rest to the edge with audio. The credits name the difference: the floppy
game's music is MATT FURNISS (PC & AMIGA) and ALAN HACKNEY (PC & AMIGA),
and the CD audio is JOHN AVERY (CD ROM & CD32).
The disc reconstructs its own six-floppy ancestor four separate ways. The
boot script assigns Legends_Disk1: through Legends_Disk6: to CD0:; each
level executable still names the one floppy it lived on; each level's text
file still holds INSERT LEGENDS DISK 5 for that same disk; and the front
end still says Please Insert : in three languages. Four witnesses, no
disagreement -- and Legends_Disk4: is named by the boot script, named by the
installer, and named by nothing else on the disc at all.
The A1200 hard-disk installer shipped on the CD, intact. /InstallHD
formats a floppy in DF0:, copies six volumes, and draws
L E G E N D S A 1 2 0 0 H D I N S T A L L in ASCII art. Its help text
asks for 4.7 MB of hard disk space -- which is the size of this disc's data
track. Its two boot files sit in the root beside it, pointing at
Work:Legends, where the CD32 will never look.
Nothing on the disc is packed with a named codec, and 79 files are packed.
No RNC, no IMP!, no PP20, no XPKF anywhere. What there is instead is
201 bytes at hunk offset 0x703E of /Legends: a backwards longword
bitstream with a sentinel bit, literal runs of 1-8 and 9-264 bytes, and
matches of 2, 3, 4 and 1-256 bytes at 8-, 9-, 10- and 12-bit offsets. That is
Bytekiller, the demo-scene cruncher best known outside the scene as the
one Another World used in 1991, in a 1996 CD32 title -- with the checksum
verification taken out. Every packed file still carries a 32-bit checksum in
its trailer; the decruncher steps over it with subq.w #4,a0 and never looks.
tools/pak.py is a transcription of the routine and unpacks
all 79 files, 4.17 MB to 11.84 MB.
The front end re-implements LoadSeg, because it has to. There is no
jsr -150(a6) anywhere in /Legends, and it loads five hunk files anyway --
with its own 15-entry dispatch table over HUNK_UNIT to 0x3F5, handling
HEADER, CODE, DATA, BSS, RELOC32 and END and rejecting the rest.
The reason is in the CODE handler: it reads the packed hunk body 32 bytes
below the hunk base, unpacks it in place, and only then runs the relocation
loop. The level files' relocation offsets reach 940,974 while their packed
bodies are 572,984 bytes, so AmigaDOS's LoadSeg would relocate memory the
decruncher had not written yet and then have its work overwritten. Krisalis's
answer was four hundred bytes of hand-written loader with the decruncher
spliced into the middle.
The sprite banks have no names, and the executable names every object in
them. Each level carries one compiled string like
xB01xB03xB05x...xENDxB21xE05x...xEND -- a code of one letter and two digits
per object, xEND between banks. The number of groups is the number of
spritesN.pak files, and the number of codes in each group is exactly
half the number of offsets in the matching bank, on all 34 banks with no
exceptions. Every object takes two slots: an image and a one-plane mask, and
the ratio of their lengths is the plane count -- 5 in 552 pairs, 4 in 48.
Which also means Level4/sprites5, 6 and 7, three 51,892-byte banks that
are 97 % identical, differ by exactly one code: R03, R05, R07.
Photographs of the developers, pressed onto a CD32 disc. Three of the
64,000-byte screens are digitised team photos: THE PROGRAMMERS
(PETER HARRAP (PC), RICHARD TEATHER (AMIGA)), THE GRAPHIC ARTISTS
(MARK POTENTE, MARK EDWARDS, PHIL HACKNEY) and THE MAIN AMIGA TEAM.
And Richard Teather is also in the volume descriptor -- the ISO's
data-preparer field reads Richard Teather (Programmer) - ISOCD 1.04 by Pantaray, Inc. USA -, so the man in the photograph is the man who ran the
mastering tool.
Three of those names turn up again on a Philips CD-i. Krisalis's Ultra CD-i Soccer (1997) credits Pete Harrap with the arcade engine, Phil Hackney with artwork and John Avery with music and sound. Same studio in Rotherham, same people, two consoles that could hardly be less alike, both crediting them by name in the shipped data.
Two version numbers, and neither of them is right. The front end says
Legends A1200 V1.00. All five level executables -- the actual game -- say
Legends 1200/CD32 Version 0.99, on a pressed, published disc. Beside them
sit trackdisk.device and arp.library on a disc with no floppy drive, a
QWERTYUIOP / ASDFGHJKL keyboard layout on a console that shipped with a
joypad, a c/Assign from April 1991, and a c/SetPatch that warns
This disk requires Kickstart version 2.0 or greater.
The build machine's clock was four years out. All 118 directory records read 1992-03-06 -- a date on which the CD32 did not exist. What survives is the time, and it is a log: 103 entries between 18:09:10 and 18:15:20, two commands copied off a Workbench disk at 18:20, the boot chain written at 18:22, and then, two hours later, the five level executables re-crunched and copied in 47 seconds flat, in level order, six to eight seconds apart.
Thirty-three placeholder strings shipped, and the interesting part is
which. SIGN MESSAGE 1 through SIGN MESSAGE 8 survive in the English text
of levels 3 and 5 and one in level 4 -- but at those same record indices the
French and German files hold empty strings. The translators were handed a
file with placeholders in it, left those slots blank rather than translating
"SIGN MESSAGE 4", and nobody went back and did the same to the English.
The most AGA-dependent disc in the series, in the front end only. Every full-screen image is 320x200 at eight bitplanes, plane-separated, with a 768-byte 24-bit palette -- 256 colours, eight bits per gun, no ECS fallback. And every sprite in the levels is four or five planes with a 32-entry 12-bit palette. The front end is an AGA showcase bolted to a 32-colour game.
Put the .cue, the .iso and the 28 .wav files in the repository root and:
python tools/pvd.py "Legends ... (Track 01 of 29)[!].iso" # descriptors
python tools/tmblock.py "Legends ... (Track 01 of 29)[!].iso" # trademark block
python tools/sectormap.py "Legends ... (Track 01 of 29)[!].iso" # the sector map
python tools/isofs.py "Legends ... (Track 01 of 29)[!].iso" # the directory
cd tools && python extract.py "../Legends ... .iso" ../_work/ext && cd ..
python tools/unpackall.py # all 79 .Pak files
python tools/rdt.py _work/unpak/Level1/English.Pak.bin # the in-level text
python tools/eightsvx.py # the IFF samples
python tools/planar.py _work/unpak/TitleScr.Pak.bin _work/ext/TitleScr.Pal sep out.png
python tools/scan.py _work/ext # no compression magic
python tools/m68k.py _work/ext/Legends 0x703E 0xD0 # the decruncher
tools/ needs Python 3, and planar.py needs Pillow, m68k.py needs
Capstone.
| cd32-platformnotes-doc | The Amiga CD32 / CDTV platform checklist this pipeline follows and feeds |
| cd32-thesperislegacy-doc | The other CD32 disc that is a floppy game with its volumes assigned to CD0: |
| cd32-dragonstone-doc | The other CD32 disc that still asks you to insert a floppy |
| cd32-marvinsmarvellousadventure-doc | Byte-identical c/SetPatch, and the previous record holder for disc occupancy |
| cd32-prey-doc | The other disc with plane-separated graphics |
| cdi-ultracdisoccer-doc | Krisalis on the Philips CD-i, one year later, with three of the same people |