OKAY RAI I WILL WALK YOU THROUGH THE FRY PTA FILE SO YOU MAYBE UNDERSTAND, AND SO MAYBE PEOPLE THAT WILL NEVER UNDERSTAND WILL LEAVE THIS THREAD ALONE
Some of this I actually only discovered last night.
These are all little endian.
CODE
00000000: 50 54 41 00 10 00 00 00 90 01 00 00 00 00 00 00
PTA header.
Int: Identifier, "PTA" (50 54 41 00)
Int: Animation info offsets offset (10 00 00 00)
Int: Frame info offsets offset (90 01 00 00)
Int: Probably padding. (00 00 00 00)
CODE
00000010: 20 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000070: 00 00 00 00 48 01 00 00 00 00 00 00 00 00 00 00
00000080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000090: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
000000A0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
000000B0: 00 00 00 00 00 00 00 00 00 00 00 00 FF FF FF FF
Animation info offsets.
Fry's idle animation would be the first one (20 01 00 00), his other animation (not sure exactly what it is) is the one half way through (48 01 00 00). I think the spacing has to do with the script wanting to call a certain animation, like the idle animation is always animation indice zero, and whatever animation is described at 0x148 is always animation indice 24. The FF FF FF FF at the end I believe merely signifies the end of the section.
CODE
000000C0: 00 00 FC FF 04 00 00 00 01 00 FC FF 04 00 00 00
000000D0: 02 00 FC FF 04 00 00 00 03 00 FC FF 04 00 00 00
000000E0: 04 00 FC FF 04 00 00 00 05 00 FC FF 04 00 00 00
000000F0: 06 00 FC FF 04 00 00 00 07 00 FC FF 04 00 00 00
00000100: 08 00 FC FF 04 00 00 00 09 00 FC FF 04 00 00 00
00000110: 0A 00 FC FF 04 00 00 00 0B 00 FC FF 04 00 00 00
Animation info p1. They're split into chunks of four shorts (eight bytes)
Short: Frame ID. *
Short: Unknown.
Short: Unknown.
Short: Unknown.
This won't be read directly, so no end-of-section marker is necessary, unlike with most of the others.
CODE
00000120: C0 00 00 00 01 00 0C 00 C8 00 00 00 01 00 0C 00
00000130: D0 00 00 00 01 00 0C 00 D8 00 00 00 01 00 0C 00
00000140: 00 00 00 00 00 00 00 00 E0 00 00 00 01 00 0C 00
00000150: E8 00 00 00 01 00 0C 00 F0 00 00 00 01 00 0C 00
00000160: F8 00 00 00 01 00 0C 00 00 01 00 00 01 00 0C 00
00000170: 08 01 00 00 01 00 0C 00 10 01 00 00 01 00 0C 00
00000180: 18 01 00 00 01 00 0C 00 00 00 00 00 00 00 04 00
Animation info p2.
Int: Number of frames. It seems. (C0 00 00 00)
Following are a list of frames, each split into eight byte chunks of data.
Short: Unknown (01 00)
Short: Unknown (0C 00)
Int: Offset in Animation info p1 of corresponding data (C8 00 00 00) **
I think the two shorts may somehow indicate the type of frame, for example, in this it's always 01000C00, but in other ones I'll find mixed values, such as 01000800, 01000400, etc.
CODE
00000190: 50 00 00 00 01 00 00 00 18 00 00 00 0C 00 00 00
000001A0: 48 00 00 00 01 00 00 00 90 00 00 00 64 01 00 00
000001B0: 00 03 00 00 64 01 00 00 90 00 00 00 EC 04 00 00
000001C0: FC 05 00 00 0C 07 00 00 94 08 00 00 F4 09 00 00
000001D0: 40 0B 00 00 F4 09 00 00 D0 0C 00 00 90 90 90 90
Frame assembly offsets. And some other info. Offset of beginning of this section = OffsetX (0x190 in this case)
Int: Length of section/offset to palette (50 00 00 00)
Int: Unknown (01 00 00 00)
Int: Offset from OffsetX to start of frame assembly offsets. (18 00 00 00 - probably always this)
Int: Number of frames (0C 00 00 00)
Int: Offset from OffsetX to PTX file/pixel data (48 00 00 00)
Int: Palettes (01 00 00 00)
Now we're at the offsets. There are twelve in this one, meaning, well, there are twelve int in a row, indicating the offset from OffsetX to the data for the frame's assembly.
After those twelve offsets will almost certainly be the PTX offset earlier mentioned, and, then, padding to align it to a sixteen-byte boundary (90 90 90 90).
CODE
000001E0: B0 B1 80 00 00 00 00 FF 50 22 4C FF B3 57 78 FF
000001F0: ...
Palette. Really no point in going into this. Just like all Sting image palettes it's apparently in BGRA format, a byte per colour field.
CODE
00000220: 0A 00 00 00 00 00 40 00 50 00 00 00 00 00 18 00
00000230: 08 00 00 00 18 00 08 00 30 00 10 00 00 00 18 00
00000240: 00 00 18 00 10 00 00 00 40 00 08 00 40 00 18 00
00000250: 00 00 40 00 00 00 18 00 18 00 00 00 68 00 08 00
00000260: 40 00 20 00 00 00 68 00 00 00 18 00 20 00 00 00
00000270: 88 00 08 00 38 00 28 00 00 00 88 00 00 00 10 00
00000280: 28 00 00 00 B8 00 08 00 40 00 30 00 00 00 B8 00
00000290: 00 00 10 00 30 00 00 00 E8 00 08 00 40 00 38 00
000002A0: 00 00 E8 00 00 00 10 00 38 00 00 00 18 01 08 00
000002B0: 40 00 40 00 00 00 E8 00 00 00 10 00 40 00 00 00
000002C0: F0 00 08 00 18 00 48 00 00 00 18 01 00 00 18 00
000002D0: 40 00 00 00 40 01 08 00 40 00 48 00 00 00 40 01
000002E0: 00 00 10 00 48 00 00 00 68 01 08 00 38 00 50 00
000002F0: 00 00 00 00
Frame assembly data. I am very not sure how this works. This following information is how I THINK it might work, but some of it either doesn't quite fit, or I am unable to test it for lack of other information.
Int: Unknown (0A 00 00 00)
Short: Unknown (00 00)
Short: Width maybe (40 00)
Short: Height maybe (50 00)
Short: Counter as found in LIM files and PTG files [I'm pretty sure about this, it seems to roll over at 0x200 just as always before, though I don't know exactly what it counts] (00 00)
Then I'm uncertain. I think what follows is either locations, or areas of pixels to read/write. I'm not sure, but multiples of eight (heights of the tiles) occur a lot. The counter means it could very well be like LIM/PTG files, meaning we write so many blank pixels/tiles, then so many filled in pixels/tiles, etc, and that's what these numbers indicate.
Following this info comes the PTX data - pretty much just ignore the first 32 bytes and you're right at the pixel data, which is stored two pixels per byte.
NOW, FOR A LITTLE DEMONSTRATION OF HOW ALL THE DATA GOES TOGETHER:
The first frame, putting together the animation data, you get this:
CODE
00000120:
000000C0
>>>0000 FFFC 0004 0000
0001, 000C
000000C8
>>>0001 FFFC 0004 0000
0001, 000C
000000D0
>>>0002 FFFC 0004 0000
0001, 000C
000000D8
>>>0003 FFFC 0004 0000
0001, 000C
So the only thing we know is that this animation is four frames, and we want frames 0, 1, 2 and 3.
They are located at OffsetX + 0x90, OffsetX + 0x164, OffsetX + 0x300 and OffsetX + 0x164 respectively. Note that the last frame is the same data as the second frame, that's because it loops 1->2->3->2, 1->2->3->2, etc.
So, here's said frame data:
Frame 1:
» Click to show Spoiler - click again to hide... «
CODE
0A 00 00 00 00 00 40 00 50 00 00 00 00 00 18 00
08 00 00 00 18 00 08 00 30 00 10 00 00 00 18 00
00 00 18 00 10 00 00 00 40 00 08 00 40 00 18 00
00 00 40 00 00 00 18 00 18 00 00 00 68 00 08 00
40 00 20 00 00 00 68 00 00 00 18 00 20 00 00 00
88 00 08 00 38 00 28 00 00 00 88 00 00 00 10 00
28 00 00 00 B8 00 08 00 40 00 30 00 00 00 B8 00
00 00 10 00 30 00 00 00 E8 00 08 00 40 00 38 00
00 00 E8 00 00 00 10 00 38 00 00 00 18 01 08 00
40 00 40 00 00 00 E8 00 00 00 10 00 40 00 00 00
F0 00 08 00 18 00 48 00 00 00 18 01 00 00 18 00
40 00 00 00 40 01 08 00 40 00 48 00 00 00 40 01
00 00 10 00 48 00 00 00 68 01 08 00 38 00 50 00
00 00 00 00
Frame 2:
» Click to show Spoiler - click again to hide... «
CODE
14 00 00 00 00 00 40 00 50 00 68 01
00 00 18 00 08 00 00 00 78 01 08 00 28 00 10 00
00 00 10 00 00 00 28 00 08 00 00 00 18 00 08 00
30 00 10 00 00 00 78 01 00 00 18 00 10 00 00 00
88 01 08 00 28 00 18 00 00 00 28 00 00 00 28 00
10 00 00 00 30 00 08 00 30 00 18 00 00 00 88 01
00 00 30 00 10 00 00 00 98 01 08 00 40 00 18 00
00 00 40 00 00 00 18 00 18 00 00 00 48 00 08 00
20 00 20 00 00 00 98 01 00 00 20 00 18 00 00 00
B8 01 08 00 40 00 20 00 00 00 B8 01 00 00 18 00
20 00 00 00 D8 01 08 00 38 00 28 00 00 00 88 00
00 00 10 00 28 00 00 00 90 00 08 00 18 00 30 00
00 00 D8 01 00 00 18 00 28 00 00 00 F8 01 08 00
38 00 30 00 00 00 B0 00 00 00 38 00 28 00 00 00
B8 00 08 00 40 00 30 00 00 00 B8 00 00 00 10 00
30 00 00 00 C0 00 08 00 18 00 38 00 00 00 F8 01
00 00 18 00 30 00 00 00 00 02 08 00 20 00 38 00
00 00 00 00 08 00 20 00 30 00 00 00 08 00 10 00
28 00 38 00 00 00 D0 00 00 00 28 00 30 00 00 00
E8 00 08 00 40 00 38 00 00 00 E8 00 00 00 10 00
38 00 00 00 F0 00 08 00 18 00 40 00 00 00 08 00
08 00 18 00 38 00 00 00 30 00 10 00 40 00 40 00
00 00 E8 00 00 00 10 00 40 00 00 00 F0 00 08 00
18 00 48 00 00 00 30 00 08 00 18 00 40 00 00 00
58 00 10 00 40 00 48 00 00 00 40 01 00 00 10 00
48 00 00 00 68 01 08 00 38 00 50 00 00 00 00 00
Frame 3:
» Click to show Spoiler - click again to hide... «
CODE
18 00 00 00 00 00 40 00 50 00 58 00 08 00 18 00
08 00 00 00 68 00 10 00 28 00 10 00 00 00 10 00
00 00 28 00 08 00 00 00 18 00 08 00 30 00 10 00
00 00 68 00 08 00 30 00 08 00 00 00 70 00 10 00
38 00 10 00 00 00 70 00 08 00 18 00 10 00 00 00
80 00 10 00 28 00 18 00 00 00 28 00 00 00 28 00
10 00 00 00 30 00 08 00 30 00 18 00 00 00 80 00
08 00 30 00 10 00 00 00 90 00 10 00 40 00 18 00
00 00 40 00 00 00 18 00 18 00 00 00 48 00 08 00
20 00 20 00 00 00 98 01 00 00 20 00 18 00 00 00
A8 01 08 00 30 00 20 00 00 00 90 00 08 00 30 00
18 00 00 00 A0 00 10 00 40 00 20 00 00 00 A0 00
08 00 18 00 20 00 00 00 C0 00 10 00 38 00 28 00
00 00 88 00 00 00 10 00 28 00 00 00 90 00 08 00
18 00 30 00 00 00 C0 00 08 00 18 00 28 00 00 00
D8 00 10 00 30 00 30 00 00 00 F0 01 00 00 30 00
28 00 00 00 F8 01 08 00 38 00 30 00 00 00 B0 00
00 00 38 00 28 00 00 00 B8 00 08 00 40 00 30 00
00 00 B8 00 00 00 10 00 30 00 00 00 C0 00 08 00
18 00 38 00 00 00 D8 00 08 00 18 00 30 00 00 00
E0 00 10 00 20 00 38 00 00 00 00 00 08 00 20 00
30 00 00 00 08 00 10 00 28 00 38 00 00 00 E0 00
08 00 28 00 30 00 00 00 E8 00 10 00 30 00 38 00
00 00 D8 00 00 00 30 00 30 00 00 00 E8 00 08 00
40 00 38 00 00 00 E8 00 00 00 10 00 38 00 00 00
F0 00 08 00 18 00 40 00 00 00 E8 00 08 00 18 00
38 00 00 00 10 01 10 00 40 00 40 00 00 00 E8 00
00 00 10 00 40 00 00 00 F0 00 08 00 18 00 48 00
00 00 10 01 08 00 18 00 40 00 00 00 38 01 10 00
40 00 48 00 00 00 40 01 00 00 10 00 48 00 00 00
68 01 08 00 38 00 50 00 00 00 00 00
Frame 4:
(see Frame 2)
So. Rai. THINK YOU CAN HELP NOW THAT I'VE GIVEN YOU MORE INFO AND A THOROUGH THROUGH TO PRETTY MUCH EVERYTHING I KNOW ABOUT THE FILE FORMAT?
* There's a failing in this filetype at this point, because there are different frame IDs, but often the ID will reference the same data as another ID, thus wasting (minimum) four bytes everytime this happens. Potentially more.
** Another failing, as, if all the animation info had been put together it would have saved more than splitting it up saves. A guaranteed four bytes per frame rather than a potential billion bytes for the stupidest animation ever.
Писатель всегда будет в оппозиции к политике, пока сама политика будет в оппозиции к культуре.