5,389
edits
(oops) |
(→PS2 implementation: finishing/fixing up the PS2 TXMP writeup) |
||
Line 106: | Line 106: | ||
*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) | *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. | |||
Here is how the end of the rl_1 TXMP looks in level3_Final.dat of the English retail PS2 version. | Here is how the end of the rl_1 TXMP looks in level3_Final.dat of the English retail PS2 version. | ||
Line 113: | Line 114: | ||
|- ALIGN=CENTER VALIGN=TOP | |- ALIGN=CENTER VALIGN=TOP | ||
{{OBDtr| 0x90 | int32 |C8FFC8| 56 00 | 86 | index of the 256-color palette used by this texture (starts at 0x15800 in level3_palette.pal) }} | {{OBDtr| 0x90 | int32 |C8FFC8| 56 00 | 86 | index of the 256-color palette used by this texture (starts at 0x15800 in level3_palette.pal) }} | ||
{{OBDtr| 0x94 | int32 |C8FFFF| 10 00 00 00 | 16 | | {{OBDtr| 0x94 | int32 |C8FFFF| 10 00 00 00 | 16 | palette pixel format #16 (32-bit RGB, with inactive alpha); the other recurrent format is #17 (32-bit RGBA) }} | ||
{{OBDtr| 0x98 | link |FFC8FF| 00 00 00 00 | unused | link to a [[OBD:TXAN|TXAN]] file; used if this texture is animated }} | {{OBDtr| 0x98 | link |FFC8FF| 00 00 00 00 | unused | link to a [[OBD:TXAN|TXAN]] file; used if this texture is animated }} | ||
{{OBDtr| 0x9C | link |FFC800| 00 00 00 00 | unused | link to a TXMP file that | {{OBDtr| 0x9C | link |FFC800| 00 00 00 00 | unused | link to a TXMP file that contains the environment map }} | ||
{{OBDtr| 0xA0 | offset |C800C8| C0 05 00 00 |00 00 05 C0| position of the pixel data in the .raw file }} | {{OBDtr| 0xA0 | offset |C800C8| C0 05 00 00 |00 00 05 C0| position of the pixel data in the .raw file }} | ||
{{OBDtr| 0xA4 | offset |C87C64| 00 00 00 00 | unused | position of the pixel data in the .sep file (unused) }} | {{OBDtr| 0xA4 | offset |C87C64| 00 00 00 00 | unused | position of the pixel data in the .sep file (unused) }} | ||
{{OBDtr| 0xA8 | int32 |B0C3D4| 00 00 00 00 | 0 | "material type" ( | {{OBDtr| 0xA8 | int32 |B0C3D4| 00 00 00 00 | 0 | always 0; supposedly the same "material type" (set at runtime) as for Windows demo and Mac }} | ||
{{OBDtr| 0xAC | char[4] |B0C3D4| AD DE AD DE | dead | | {{OBDtr| 0xAC | char[4] |B0C3D4| AD DE AD DE | dead | supposedly the same texture name pointer (used at runtime) as for Windows demo and Mac }} | ||
{{OBDtr| 0xB0 | char[4] |B0C3D4| AD DE AD DE | dead | | {{OBDtr| 0xB0 | char[4] |B0C3D4| AD DE AD DE | dead | supposedly the same rendering optimization flags (runtime) as for Windows demo and Mac }} | ||
{{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) }} | ||
|} | |} | ||
;Textures using .raw 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). | |||
Examples of textures using .sep storage are: all [[:Category:Fly-in_portraits|fly-in portraits]]; all [[:Category:Splashscreens|splashscreen]] components; some illustrations in Konoko's "data comlink" (namely, [[:File:TXMPLevel02move.png|combat move illustrations]] and [[:File:TXMPhypo.png|item illustrations]] (objectives and weapon illustrations use .raw storage). | |||
Environment/character/particle TXMPs seem to be using .raw storage consistently (not checked beyond level1_Final). As a notable anomaly, .sep storage is used for the following three textures (console screens) in level0_Final: _CON_SAVEGAME (main TXMP only; the animation frames use .raw storage), _CON_SAVEGAME_USED, _CON_USED. | |||
<!-- | <!-- | ||
;Oni's internal storage types | ;Oni's internal storage types |