5,389
edits
(→PS2 implementation: finishing/fixing up the PS2 TXMP writeup) |
|||
Line 105: | Line 105: | ||
*The extra 4 bytes come from a palette index (int32) inserted at 0x90, before the pixel format (which is shifted to 0x94 along with everything else that follows). | *The extra 4 bytes come from a palette index (int32) inserted at 0x90, before the pixel format (which is shifted to 0x94 along with everything else that follows). | ||
*Valid palette indices start at 1. Palettes are stored per-level in level#_palette.pal files. Each palette consists of 256 32-bit colors and takes up 1024 bytes. | *Valid palette indices start at 1. Palettes are stored per-level in level#_palette.pal files. Each palette consists of 256 32-bit colors and takes up 1024 bytes. | ||
*The level#_palette.pal files have between 85 and 179 palettes, not counting the first palette (index 0) at the start of each .pal file, which is always blank | *The level#_palette.pal files have between 85 and 179 palettes, not counting the first palette (index 0) at the start of each .pal file, which is always blank. | ||
*The pixel format (shifted to 0x94) has only two variants: 0x10 for opaque textures, meaning 32-bit RGB with ignored alpha, or 0x11 for transparent textures. | *The pixel format (shifted to 0x94) has only two variants: 0x10 for opaque textures, meaning 32-bit RGB with ignored alpha, or 0x11 for transparent textures. | ||
*The pixel data (color indices) can be stored either in the .raw file (pointer field at 0xA0) or in the .sep file (pointer at 0xA4). See below for an overview. | *The pixel data (color indices) can be stored either in the .raw file (pointer field at 0xA0) or in the .sep file (pointer at 0xA4). See below for an overview. | ||
Line 124: | Line 124: | ||
{{OBDtr| 0xB4 | char[12] |B0C3D4| AD DE | dead | completely unused bytes (not part of the template) }} | {{OBDtr| 0xB4 | char[12] |B0C3D4| AD DE | dead | completely unused bytes (not part of the template) }} | ||
|} | |} | ||
; | ;Alternative use of .raw or .sep storage | ||
Unlike for PC or Mac game data (where pixel data is stored exclusively in .raw or exclusively in .sep for all TXMPs), PS2 TXMPs use .raw and .sep storage alternatively, depending on the TXMP. The engine apparently uses the .sep pointer only if there is no .raw pointer (or vice-versa). | Unlike for PC or Mac game data (where pixel data is stored exclusively in .raw or exclusively in .sep for all TXMPs), PS2 TXMPs use .raw and .sep storage alternatively, depending on the TXMP. The engine apparently uses the .sep pointer only if there is no .raw pointer (or vice-versa). | ||