Commandos2&3 Y64 File Structure Table
Commandos2&3 Y64 File Structure Table
Arranged by F.R.C.
Data Area |
Data Block |
Sub Data Block |
Data Section |
Data |
Data Type |
Length |
Description |
Sample Data |
Header DA |
Identifying DB |
|
|
Identifying Sign |
String |
6 |
Fixed |
464344450000(FCDE) |
|
|
Version Sign |
Int16 |
2 |
Commandos Version. |
0200/0300,0400 |
||
|
Comment DS |
|
|
40/105 |
40 Bytes in Comm2, 105 Bytes in Comm3. |
|
||
Palette DB 0 |
|
Y DS 0 |
|
|
16 |
Fixed. This block contains Y values. Each DS is formed by a increasing sequence of Y values. |
|
|
...... 16*16 = |
|
|||||||
Palette DB 1 |
|
Cb DS |
|
|
32 |
This block is formed by a increasing sequence of Cb values. |
|
|
Palette DB 2 |
|
Cr DS |
|
|
32 |
This block is formed by a increasing sequence of Cr values. |
|
|
Info DB for Angles of View |
|
Number DS |
Number of Views |
Int32 |
4 |
This indicates the number of angles of view. |
04000000 |
|
Number of Pics |
Int32 |
4 |
This indicates the number of pictures of each view. |
02000000 |
||||
|
Address DS |
Pic Address |
Int32 |
4 |
The starting address of View 00, Pic 00 |
98010000 |
||
Pic Address |
Int32 |
4 |
The starting address of View 00, Pic 01 |
A4210B00 |
||||
Pic Address |
Int32 |
4 |
The starting address of View 01, Pic 00 |
F01D1100 |
||||
...... Pic Addresses: total number is defined by Number DS |
||||||||
Picture DA 0 |
Info DB |
|
|
Zoom Layer Number |
Int32 |
4 |
This indicates the layer number in zooming. |
00000000 |
|
|
Pic Width |
Int32 |
4 |
Width of the picture. |
29040000 |
||
|
|
Pic Height |
Int32 |
4 |
Height of the picture. |
E1020000 |
||
|
|
Number of Pic Block |
Int32 |
4 |
This indicates the number of Picture DBs(including extras, excluding nulls). |
CC000000 |
||
|
|
Number of Extra Pic Block Index |
Int32 |
4 |
This indicates the numbers of extra Picture DB index. |
00000000 |
||
Block Locating DB |
Index Table SDB |
|
Index / Address |
Int16 |
2 |
This is the index/address table to locate Picture DBs on the map. Index 0xFFFF stands for a null block filled with things such as water. |
0000,0100 |
|
...... Index: total number is defined by Pic Width and Pic Height |
||||||||
Extra Index Table SDB |
Extra Index DS |
Unknown Sign |
Int32 |
4 |
Fixed |
00000000 |
||
X Index |
Int32 |
4 |
The horizontal index in Picture DB's size. |
09000000 |
||||
Y Index |
Int32 |
4 |
The vertical index in Picture DB's size. |
09000000 |
||||
Index / Address |
Int32 |
4 |
The Picture DB's index/address. |
59070000 |
||||
...... Extra Index DS: total number is defined by Number of Extra Pic Block Index |
||||||||
Picture DB |
|
|
Separator |
Int64 |
8 |
Usually 0xFFFFFFFFFFFFFFFF, but sometimes it turns to be 0xFFFFFFF |
FFFFFFFFFFFFFFFF |
|
Picture SDB |
DS 0 |
Middle Digits |
|
4bits |
To generate a pointer, these bits should be put directly in Digit 7 to Digit 4. But first you should swap the two bytes of the DS0 as they are a int |
1000.b |
||
...... 4*4bits = 2 Bytes in total |
||||||||
Unknown Sign |
|
2 |
Fixed |
0000 |
||||
DS 1 |
High Digits |
|
10bits |
To generate a pointer, these bits should be put directly in Digit 17 to Digit 8. But first you should reverse each 4 bytes of the DS1 as they are considered to be a Int |
1110101001.b |
|||
...... 16*10bits = 20 Bytes in total |
||||||||
DS 2 |
Low Digits |
|
4bits |
To generate a pointer, these bits should be put directly in Digit 3 to Digit 0. But first you should reverse each 4 bytes of the DS2 as they are considered to be a Int |
0000.b |
|||
...... 64*4bits = 32 Bytes in total |
||||||||
...... 8*8 Picture SDBs in total |
||||||||
...... Picture DBs: total number is defined by Number of Pic Block |
||||||||
Nothing/Unknown |
|
|
|
|
0 / 6, Uncertain |
6 Bytes in version 3, very long in version 4 |
14FF00000000 |
|
...... Picture DAs: total number is defined by Number DS |
Notice:
1. All numerical data types are in little-endian.
2.In the items with "/", names in the right is for Commandos 2, and names in the right is for Commandos 3.
3.When generating the Palette, select v0,v1,v2 from position n0,n1,n
(v0,v1,v2) is a color vector in the YCbCr space, you can find the conversion formula as follows:
R = Y + 1.402 * (Cr - 128)
G = Y - 0.34414 * (Cb - 128) - 0.71414 * (Cr - 128)
B = Y + 1.772 * (Cb - 128)
Y = 0.299 * R + 0.587 * G + 0.114 * B
Cb = -0.1687 * R - 0.3313 * G + 0.5 * B + 128
Cr = 0.5 * R - 0.4187 * G - 0.0813 * B + 128
Notice that these values may be out of the range[0,255], so you may need to replace some of them with 0 or 255.
The index(pointer) of the color in the Palette is (n1 << 13) Or (n2 << 8) Or n0.
Reference:
[1]invox