Introduction
Tyrian, the scrolling shooter Eclipse Software made and Epic MegaGames published in
1995, keeps the lines of its end credits in tyrian.cdt. Despite the
extension, the file is not a saved game: Tyrian saves games in tyrian.sav
and its settings in tyrian.cfg. The credits file never changes.
The file is a list of 131 short strings, one for each line of the credits, encrypted the way all of Tyrian’s text files are. Nothing about it was published. It is described here from the source of OpenTyrian, the open-source version of the game that reads the original data files, and checked against a real copy: 1,125 bytes, the same file as in the freeware Tyrian 2.1 data.
A .cdt file dropped on any page opens in the explorer, which tells
Tyrian’s credits from a CorelDRAW template and shows each line decrypted.
Structure
The file is 131 strings one after the other, with no header and nothing after them. Each string is a length byte and then that many bytes, the way Turbo Pascal stores strings.
0Line 1 a length byte, then the encrypted text1 + n…Line 2 to line 130, the same way1 + n each…Line 131, ending with the file1 + n
| Offset | Size | Name | Description |
|---|---|---|---|
+0 | 1 | Length | The number of bytes in the string, 0 to 255. Tyrian keeps at most 65 characters of a credits line. |
+1 | length | Text | The line, encrypted as below. It decrypts to plain ASCII. |
Encryption
Each string is encrypted on its own, with a fixed key of ten bytes:
204 129 63 255 71 19 25 62 1 99
Byte i of the decrypted text (counting from 0) is the encrypted byte
i, XOR key byte i mod 10, XOR the encrypted byte before it
(nothing for the first byte). So the first line of the real file, the bytes
0B E6 47 3B 96 …, is 11 bytes long and starts E6 XOR
CC = 2A, “*”, then 47 XOR 81 XOR
E6 = 20, a space. It reads “* CREDITS *”.
To encrypt, go forwards: each encrypted byte is the plain byte XOR the key byte XOR
the encrypted byte just made. Tyrian’s other text files, such as the data cube texts
cubetxt1.dat to cubetxt4.dat, use the same scheme.
The lines
The credits scroll up the screen one string at a time. Tyrian reads exactly 131 of them.
- A string that is empty, or starts with a full stop, is a gap: a blank line. The real file has 74 of them, each a single “.”.
- Any other string starts with a letter that names its colour,
Afor 0,Bfor 1 and so on; the rest of the string is the text shown. In “MJason Emery”,Mis the colour and “Jason Emery” the text. The first line, “* CREDITS *”, starts with*instead of a letter.
Telling it apart
A CorelDRAW template, the other common .cdt file, starts with
RIFF, WL or PK. Read as a length byte, the
R of RIFF would be a string of 82 bytes, and those decrypt to
bytes that are not text. The explorer’s reader takes a file as Tyrian’s credits only
when every string decrypts to printable text and the last one ends where the file
does.
Also used for
- Amstrad CPC tape image – A Spectrum cassette with its timings, so turbo loaders survive.
- CorelDRAW template – CorelDRAW's working file: RIFF chunks in older versions, a ZIP archive since X4.
Links
Software
- Tyrian – the game, which shows the credits at the end (MS-DOS)
- OpenTyrian – open-source version of Tyrian that reads the original data files (Windows, macOS, Linux)
Reference
- OpenTyrian mainint.c – the source that plays the credits (JE_playCredits): 131 lines and their colours
- OpenTyrian helptext.c – the source that reads and decrypts Tyrian’s encrypted strings, with the key