Fading tables (FADING.DAT)
File formats · Field reference · Schema
In brief
FADING.DAT holds seven colour tables that the
introduction uses in the VGA display mode to draw
pictures fading in or out. A table gives, for each colour number, the
colour number drawn instead.
Organization
| Bytes | Contents |
|---|---|
| 0–255 | Table 0: the colour drawn for each colour 0 to 255. |
| 256–511 | Table 1. |
| … | … |
| 1536–1791 | Table 6. |
Reading the file
The introduction reads the file, in the VGA display mode only, and does not check how many bytes it got. The game does not need the file: when it is missing, the introduction builds the tables and writes the file, then reads it at the next start.1
When it builds the tables, table k takes each colour of the current palette part of the way, weight 36 × (k + 1) out of 256, towards colour 18, and keeps the nearest colour of the palette; entry 0 is 0.2
The tables of the original file are not those that this rule gives with the
introduction's palettes. Running the display driver's own table builder on
PALETTE1.PAL, the palette the introduction has set at that moment in the
VGA mode, gives tables that agree with the file on 129 to 146 of the 256
entries of tables 0 to 5 and on all of table 6. Neither another weight with
PALETTE0 or PALETTE1, nor another palette file of the game with the
game's weights, gives the file's tables.3 Which palette
they were built from is unknown. Deleting the file therefore changes the
fades of the introduction slightly: the game then builds its own tables and
writes them in place of the original ones. A reimplementation that keeps
the file uses its tables as they are.
What it becomes in memory
To draw a shape at fade level n from 1 to 7, the introduction installs table n − 1 as the display driver's colour table and draws the shape through it; level 0 restores the background instead.4
Example
The start of table 0:
0000 00 5f 56 c0 ff 91 74 a0 … colours 0, 1, 2, 3 … are drawn as 0, 95, 86, 192 …
Sources
Locations refer to the game executable reference; the file is identified in the file inventory.