SCAN (Metroid Prime)
This article is for the SCAN format from Metroid Prime. For other revisions of this format, see SCAN (File Format).
The SCAN file format describes scannable objects. It is a relatively simple format and has a static size.
The SCAN format is very simple; it has a header with data that contains general settings related to the scan, and then four structs defining how the scan images work. Even if a scan doesn't use four images, there are always four image structs, which means that the SCAN format has a static size; every SCAN file is 0x89 bytes (or 0xA0 bytes padded).
The header is rather simple, and consists of the following:
|0x0||4||Version; 3 for the demo, 5 for the final|
|0x4||4||Magic; always 0x0BADBEEF|
|0xC||4||Scan text STRG ID|
|0x10||4||Scan Speed Flag; 0 = normal fast scan, 1 = slower scan (usually found in boss fights)|
|0x14||4||Logbook Category; see below|
|0x18||1||Scan Icon Flag; 0 = orange icon, 1 = red icon|
|0x19||End of header|
There are six possible values:
|0||Not a logbook scan|
|1||Space Pirate Data|
Following the header is an array of four structs that contain settings for up to four scan images. Although there can be anywhere from 0 to 4 scan images attached to a scan, there are always four scan image entries here. Entries that aren't used have their TXTR ID set to 0xFFFFFFFF, with the rest of the settings mostly left at defaults. They follow this format:
|0x4||4||float||Appearance %; image will appear when the scan is this% complete. Should range from 0 to 1.|
|0x8||4||long||Image Position; See below.|
|0xC||4||long||Width; 0 = no animation|
|0x10||4||long||Height; 0 = no animation|
|0x14||4||float||Interval; 0.0 = no animation|
|0x18||4||float||Fade Duration; 0.0 = no fade|
|0x1C||End of entry|
There are 20 possible values for the scan image's position; there are ten for the left side, and ten for the right:
Fly In Behavior
The first scan image to appear (based on the appearance percent value) will "fly in" from the side of the screen toward the center. The remaining images will "fade in" without moving. The only exception to this is when the first image to appear is a "blank" image with no associated TXTR. In this case, no image will fly in (i.e., all images will fade in).
An extremely small number of scans display animated images in Metroid Prime. In the final version of the game, only a terminal in the Map Facility displays an animated image. In the demo version of the game, the aforementioned terminal scan and the Parasite Queen scan both display animated images. For most SCAN files, the last 32 bits of the scan image entry are zeroed out, but for the animated scans, these 32 bits have actual values in them. Strangely, the terminal directly to the left of the animated terminal in the Map Facility also has non-zero values for these 32 bits, even though it does not display any animated images.