imported>Paul Siramy |
imported>Ikskoks |
| (44 intermediate revisions by 3 users not shown) |
| Line 1: |
Line 1: |
| * [[GRAFs|Return to the list of games]]
| | #REDIRECT [[Sacred PAK]] |
| | |
| Choose archive extension:
| |
| | |
| == PAK ==
| |
| | |
| * ''' Format Type ''': Archive <br>
| |
| * ''' [http://en.wikipedia.org/wiki/Endianness Endian Order] ''': Little Endian <br>
| |
| | |
| | |
| === Format Specifications ===
| |
| | |
| <tt><b>
| |
| byte {3} - Header <br>
| |
| byte {1} - Type ID <br>
| |
| <br>
| |
| <font color="blue"> ''' if (header == TEX && id == 3){ ''' </font> <br>
| |
| : uint32 {4} - Number Of Files <br>
| |
| : uint32 {4} - <font color="red"> '' Unknown '' </font> <br>
| |
| : byte {244} - null <br>
| |
| <br>
| |
| : <font color="blue"> ''' // for each file ''' </font> <br>
| |
| :: uint32 {4} - Type ID <br>
| |
| :: uint32 {4} - Offset <br>
| |
| :: uint32 {4} - Compressed Size <br>
| |
| <br>
| |
| : <font color="blue"> ''' // for each file ''' </font> <br>
| |
| :: char {32} - Filename <font color="purple">(null)</font> <br>
| |
| :: uint16 {2} - X Image Size <br>
| |
| :: uint16 {2} - Y Image Size <br>
| |
| :: byte {1} - Type ID <br>
| |
| :: uint32 {4} - Compressed Size <br>
| |
| :: byte {39} - null Padding <br>
| |
| :: byte {X} - File Data <br>
| |
| <br>
| |
| : <font color="blue"> ''' } ''' </font> <br>
| |
| <br>
| |
| <font color="blue"> ''' else if (header == CIF && id == 0){ ''' </font> <br>
| |
| : uint32 {4} - Number Of Files <br>
| |
| : uint32 {4} - <font color="red"> '' Unknown '' </font> <br>
| |
| : byte {244} - null <br>
| |
| <br>
| |
| : <font color="blue"> ''' // for each file ''' </font> <br>
| |
| :: byte {64} - File Data <br>
| |
| <br>
| |
| : <font color="blue"> ''' } ''' </font> <br>
| |
| <br>
| |
| <font color="blue"> ''' else if (header == WPN && id == 8){ ''' </font> <br>
| |
| : uint32 {4} - Number Of Files <br>
| |
| : uint32 {4} - <font color="red"> '' Unknown '' </font> <br>
| |
| <br>
| |
| : <font color="blue"> ''' // for each file ''' </font> <br>
| |
| :: byte {322} - File Data <br>
| |
| <br>
| |
| : <font color="blue"> ''' } ''' </font> <br>
| |
| <br>
| |
| <font color="blue"> ''' else if (header == SND && id == 1){ ''' </font> <br>
| |
| : uint32 {4} - Number Of Files <br>
| |
| : uint32 {4} - <font color="red"> '' Unknown '' </font> <br>
| |
| : byte {244} - null <br>
| |
| <br>
| |
| : <font color="blue"> ''' // for each file ''' </font> <br>
| |
| :: uint32 {4} - Type ID <br>
| |
| :: uint32 {4} - Offset <br>
| |
| :: uint32 {4} - Compressed Size <br>
| |
| <br>
| |
| : <font color="blue"> ''' } ''' </font> <br>
| |
| <br>
| |
| <font color="blue"> ''' else if (header == ITM && id == 5){ ''' </font> <br>
| |
| : uint32 {4} - Number Of Files <br>
| |
| : uint32 {4} - <font color="red"> '' Unknown '' </font> <br>
| |
| : byte {244} - null <br>
| |
| <br>
| |
| : <font color="blue"> ''' // for each file ''' </font> <br>
| |
| :: uint32 {4} - Type ID <br>
| |
| :: uint32 {4} - Offset <br>
| |
| :: uint32 {4} - Compressed Size <br>
| |
| <br>
| |
| : <font color="blue"> ''' // for each file ''' </font> <br>
| |
| :: byte {56} - <font color="red"> '' Unknown '' </font> <br>
| |
| :: char {32} - Filename <font color="purple">(null)</font> <br>
| |
| :: byte {X} - File Data <br>
| |
| <br>
| |
| : <font color="blue"> ''' } ''' </font> <br>
| |
| <br>
| |
| <font color="blue"> ''' else if (header == ITM && id == 3){ ''' </font> <br>
| |
| : uint32 {4} - Number Of Files <br>
| |
| : uint32 {4} - <font color="red"> '' Unknown '' </font> <br>
| |
| : byte {244} - null <br>
| |
| <br>
| |
| : <font color="blue"> ''' // for each file ''' </font> <br>
| |
| :: uint32 {4} - Type ID <br>
| |
| :: uint32 {4} - Offset <br>
| |
| :: uint32 {4} - Compressed Size <br>
| |
| <br>
| |
| : <font color="blue"> ''' // for each file ''' </font> <br>
| |
| :: char {32} - Filename <font color="purple">(null)</font> <br>
| |
| :: byte {X} - File Data <br>
| |
| <br>
| |
| : <font color="blue"> ''' } ''' </font> <br>
| |
| <br>
| |
| </b></tt>
| |
| <br>
| |
| | |
| === File Data Format in TEX (textures) PAK ===
| |
| | |
| <tt>
| |
| This is a simple zlib-compressed image, as the first character of the File Data indicates (it's an 'x'). The size of this File Data is 'Compressed Size' bytes, the size of the uncompressed file is :<br><br>
| |
| <b> Uncompressed File Data Size = (X Image Size) * (Y Image Size) * 2</b><br><br>
| |
| Once uncompressed, you have directly the pixels. Each pixel is an unsigned word (16 bits). It contains Alpha, Red, Green and Blue componant values, and each are 4 bits. A mapping of these bits would give :<br>
| |
| <br>
| |
| <b> (highest bit) AAAARRRRGGGGBBBB (lowest bit)</b><br>
| |
| <br>
| |
| The encoding of the pixel is Top to Bottom, and for each line is Left to Right. Note : the Alpha channel IS really used (it's not just for padding), check H_KEULE_02_1.TGA from texture00.pak for a good example (16 levels of alpha here)<br>
| |
| <br>
| |
| </tt>
| |
| | |
| === MultiEx BMS Script ===
| |
| | |
| Not written yet<br><br>
| |
| | |
| === Compatible Programs ===
| |
| | |
| * [[Game Extractor|Game Extractor]]<br>
| |