F1GP Media Container Files
Media container files are files that contain a number of items. The items are usually images or palette data, and some video/animation-related data.
A container file consists of a header which includes references to all the items stored within, followed by the actual data.
The first 8 bytes form the word "f1pcanim".
This is followed by a short value containing the number of items in the file.
The item descriptions are 14 bytes long. They repeat once for each item stored in the file.
There are a number of different item types that exist:
1768: Probably represents a frame in an animation, occurs in CHAMP.DAT et al
1769: Large full-screen images, as stored in BACKDROP.DAT and TRACKPIX.DAT
1774: Small images, as stored in FLAGS.DAT and HELMETS.DAT
1776: Palette information for the image of type 1769 that follows it
|Offset||int||Location later in the file where the data is stored|
|Length||int||Length (in bytes) of the stored data|
|Width||short||Width of image in pixels|
|Height||short||Height of image in pixels|
Parsing the various image types
Animation frames (type 1768)
The format of this is still unknown
Small images (type 1774)
Read a byte as a signed byte (-128 to 128). If the value is negative,
this represents a number of repeating pixels of the same colour.
Take the value and multiply it by -1 and then add 1 to get the number of times the same colour will appear.
Then read the next byte. This contains the palette index of the colour that should be repeated.
For example, all helmets in the default HELMET.DAT file start with the values "D1 DC D1 DC D1 DC D1 DC D1 DC". This is because the first five lines of all helmet images are the same type of blue.
D1 as a signed byte is -47. Multiplying this by -1 and adding 1 gives 48, which is the width of a helmet image. DC is 220, which is the index of the blue colour in the palette.
The number of repeating colours can never be greater than the width of the image.
If the value is positive it represents a number of pixels of different colours.
The value that has been read, plus 1, is the number of following bytes that should be read, where each byte contains the index in the menu palette.
This process then continues until the end of the data has been reached.
Large images (1774)
This data seems to differ from how the small images are structured, and is not yet fully understood.
Palette info (1776)
All palette info items have a width of 256 and a height of 0 (for some reason). They are always 768 bytes long, where each set of three pixels represents the amount of Red, Green and Blue in the colour. And 256 * 3 is 768...
Container File Details
The media container files in F1GP are BACKDROP.DAT, CHAMP.DAT, CRASH1.DAT, CRASH2.DAT, CRASH3.DAT, FLAGS.DAT, HELMETS.DAT, TRACKPIX.DAT and TROPHY.DAT. They are described below.
This file contains the images that are displayed in the background throughout the game, including the title screen. However, it does not include the images of tracks, those are stored in TRACKPIX.DAT.
|0||Palette data for image 1|
|1||Image of Nelson Piquet in the Benetton|
|2||Palette data for image 3|
|3||Image of marshall waving flag||Shown between races during a championship season|
|4||Palette data for image 5|
|5||Image of Honda engine||Shown when viewing the constructors championship standings|
|6||Palette data for image 7|
|8||Palette data for image 9|
|10||Palette data for image 11|
|11||Mansell's helmet||Background on the driver selection menu.|
|12||Palette data for image 13|
|13||Williams team member holding a pit board|
|14||Palette data for image 15|
|15||Nigel Mansell in the pits||Appears when pressing Esc during a session|
|16||Palette data for image 17|
|17||Car with Agip logos show from behind|
|18||Palette data for image 19|
|19||Car in pits||Setup screen|
|20||Palette data for image 21|
|21||Car in pits, wheels off||Setup screen|
|22||Palette data for image 23|
|23||Car in pits, bodywork off||Setup screen|
|24||Palette data for image 25|
|25||Senna spraying champagne|
|26||Palette data for image 27|
|27||Nose of car, rendered||Displayed after winning the championship?|
|28||Palette data for image 29|
|29||Senna and a Williams driving through the rain|
|30||Palette data for image 31|
|31||McLaren and Williams in Monaco||Main menu background|
|32||Palette data for image 33|
|33||Three drivers on the podium|
|34||Palette data for image 35|
|35||Driver sitting with other drivers behind|
Probably contains the animation that is displayed after winning the world championship.
CRASH1.DAT, CRASH2.DAT and CRASH3.DAT
The different animations that are displayed after retiring from a race in different ways.
The flags that are displayed when choosing the game language after startup. Note that these are dependent on the palette stored in BACKDROP.DAT, item index 6.
Contains the images that are displayed on the driver selection menu screen. Note that these are dependend on the palette stored in BACKDROP.DAT, item index 10.
Contains the 16 background images that appear when browsing tracks, plus the image that appears at the track selection screen.
The animation that appears after you have won a race?