SCAN (Metroid Prime)

Revision as of 05:29, 23 February 2015 by >Darkeye

The .SCAN file format describes scannable objects and has references to several resources. It is a relatively simple format and has a static size.

This file format needs more research
Too many unknowns.

Format

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).

Header

The header is rather simple, and consists of the following:

Offset Size Description
0x0 4 Version; 3 for the demo, 5 for the final
0x4 4 Magic; always 0x0BADBEEF
0x8 4 FRME ID
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

Logbook Category

There are five possible values:

ID Category
0 Not a logbook scan
1 Space Pirate Data
2 Chozo Lore
3 Creatures
4 Research

Scan Images

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:

Offset Size Type Description
0x0 4 long TXTR ID
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 Unknown
0x10 4 long Unknown
0x14 4 long Unknown
0x18 4 float Unknown
0x1C End of entry

Image Position

 
Image positions 0x00, 0x01, and 0x02
 
Image positions for 0x04, 0x06, 0x0E, and 0x10
File:Scan offsets 4.png
Image positions for 0x05 and 0x0F
 
Image positions for 0x09 and 0x13

There are 20 possible values for the scan image's position; there are ten for the left side, and ten for the right:

Value Size Position
0x00 1/4 Top-left corner
0x01 1/4 Upper-middle-left
0x02 1/4 Lower-middle-left
0x03 1/4 Bottom-left corner
0x04 1/2 Top-left corner
0x05 1/2 Middle-left
0x06 1/2 Bottom-left corner
0x07 3/4 Top-left corner
0x08 3/4 Bottom-left corner
0x09 1 Left side
0x0A 1/4 Top-right corner
0x0B 1/4 Upper-middle-right
0x0C 1/4 Lower-middle-right
0x0D 1/4 Bottom-right corner
0x0E 1/2 Top-right corner
0x0F 1/2 Middle-right
0x10 1/2 Bottom-right corner
0x11 3/4 Top-right corner
0x12 3/4 Bottom-right corner
0x13 1 Right side