forked from WerWolv/ImHex-Patterns
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fas_oskasoftware.hexpat
111 lines (99 loc) · 2.63 KB
/
fas_oskasoftware.hexpat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#pragma author DmitriLeon2000
#pragma description Oska Software DeskMates FAS (Frames and Sequences) file
#pragma endian little
enum Compression : u32 {
BI_RGB,
BI_RLE8,
BI_RLE4,
BI_BITFIELDS,
BI_JPEG,
BI_PNG,
BI_ALPHABITFIELDS,
BI_CMYK,
BI_CMYKRLE8,
BI_CMYKRLE4,
};
struct Colors {
u8 blue;
u8 green;
u8 red;
u8 reserved;
};
struct FASHeader {
char name[50]; // name of the pack, may include garbage data
u16 version; // Format version number
s16 frameIDFirst; // assigned ID of the first frame
s16 frameIDLast; // assigned ID of the last frame
s32 width; // width of the animation (in pixels)
s32 height; // height of the animation (in pixels)
u16 frameSize; // size of the animation ((frameWidth * BPP + 31) // 32 * 4 * frameHeight)
u16 DblHeaderCount; // amount of BitmapInfoHeader pairs (one for color, one for masking)
};
struct BitmapInfoHeader { // bog-standard BitmapInfoHeaderV1
u32 biSize;
s32 biWidth;
s32 biHeight;
u16 biPlanes;
u16 biBitCount;
Compression compression;
u32 biSizeImage;
s32 biXPelsPerMeter;
s32 biYPelsPerMeter;
u32 biClrUsed;
u32 biClrImportant;
};
struct BitmapInfo {
BitmapInfoHeader header;
Colors colorMap[header.biClrUsed == 0 ?
1 << header.biBitCount : header.biClrUsed];
};
struct ExtraSprite {
char name[];
};
struct AnimSequence {
char name[];
char sequence[];
};
struct SeqHeader {
le u32 size;
le u32 count;
le u32 strPointers[count*2];
};
struct Bitmap {
u8 byte[fas.fasHeader.version >= 3 ? fas.fasHeader.frameSize + (fas.frameSizeHigh << 16) : fas.fasHeader.frameSize];
};
struct FramesHeader {
le u32 count;
le s16 frameID[count];
u8 frameDblHdrID[count];
};
struct FAS {
FASHeader fasHeader;
BitmapInfo dibHeaders[fasHeader.DblHeaderCount * 2];
if (fasHeader.version >= 1)
u8 charID;
if (fasHeader.version >= 2)
{
u32 extraEndOffset;
u16 extraSpritesCount;
if (extraSpritesCount)
// char extraSpriteList[touchOffset - 6];
ExtraSprite extraSprites[extraSpritesCount];
}
if (fasHeader.version >= 3)
le u16 frameSizeHigh;
le u16 touchColors;
if (touchColors)
{
u32 touchColorMap[touchColors];
u16 touchWidth;
u8 touchBitmap[this.touchWidth * fasHeader.height];
}
SeqHeader seqHeader;
if (fasHeader.version >= 1)
u8 filenameChecksum; // a checksum for a filename in ASCII
AnimSequence sequences[seqHeader.count];
FramesHeader framesHeader;
};
FAS fas @ 0x00;
Bitmap framesBitmap[fas.framesHeader.count] @ $;