Ok, to help unify the PC and PSX ports of FF7, there a little tutorial to help start data mining the PSX version. Let us start with the extraction of a texture.
Now I'm going to use the PC executable as a map, as I don't know exactly how the data is mapped in the PSX version. I'm also running Linux, so I have a few slick tools to help me.
Let us extract a texture, because that's the easiest. I have arbitrarily decided to extract from the PSX disk the blue bubble from the "aqua" enemy attack.
First I need to know where the texture is located. I start with the PC executable (There is a very good reason for this, I know we can just go into /magic/aqua.bin on the PSX CD-ROM but I want to show how you how the PC and the PSX formats link togeather.)
The first thing I do I look up the aqua attack in ff7.exe I have a command in Linux called "strings" that gets me pointed in the right direction.
>$ strings ff7.exe | less
This dumps all the readable text into a scrollable interface. I want to look for the aqua attack so I press the forward slash and put in "aqua" as my search string.
/aqua
The search will return with the following
...
goblinp1.spt
GOBLIN_2.TIM
goblinp2.spt
blue/goblinp
AQUA.TIM
AQUA.SPT
blue/aqua
MAGIKAL.TIM
MAGIKAL.SPT
blue/magikal
trainn_1.rsd
...
You can see the "blue/aqua" line. That's telling me that the aqua command is referenced in the /blue directory. I know that the "blue" dir is folded into the "magic" dir. Now I know what to look for in "magic/aqua.bin" on the PSX CD-ROM.
No you will notice that the actual files that make up aqua.bin are listed *BEFORE* the directory. This is not telling the order the data is in though, it's a refrence of what is in there.
Now, we are going want to extract aqua.tim, which is the texture for the command. We do that by opening auqa.bin on the PSX disk and finding the TIM header.
ABOUT TIM HEADERSA Texture In Memory (TIM) is raw PSX video memory image with a few headers. The PSX did not have the ability to directly access it's VRAM and pushes everything through the GPU. TIMs are an easy way to upload a texture into VRAM with little hassle. The header format is as follows.
Here is a 4 bpp TIM header
[1-4] - 10 00 00 00: ID Tag for TIM Format
[5-8] - 08 00 00 00: ID Tag for 4BPP
Here is a 8 bpp TIM header
[1-4] - 10 00 00 00: ID Tag for TIM Format
[5-8] - 09 00 00 00: ID Tag for 8BPP
Here is a 16 bpp TIM header
[1-4] - 10 00 00 00: ID Tag for TIM Format
[5-8] - 02 00 00 00: ID Tag for 16BPP
Here is a 24 bpp TIM header
[1-4] - 10 00 00 00: ID Tag for TIM Format
[5-8] - 03 00 00 00: ID Tag for 24BPP
So now what we do is search for the TIM and extract it out of the bin file.
I'll so a search with the hex command first.
>$ hex aqua.bin | less
now I need to search for the TIM header sequence
/10 00 00 00
I wind up with this.
0720 10 00 00 00 09 00 00 00 0c 02 00 00 00 03 ff 00 ........ ........
0730 00 01 01 00 ff ff de ff bc ff 9a ff 78 ff 56 ff ........ ....x.V.
AHA! One 8 bpp texture at an offset of 0720
Now here's the sad thing that will probably be a let-down for everyone.
I don't know how to extract it properly...
I usally strip out all the data before the 10 00 00 00 header and use a TIM ripper to extract the file. I than can use the imagemagik to view it as it can read TIM files natively.
.
.
.
.
.
Wait for it....
.
.
.
.
.
Wait for it....
.
.
.
.
.
TAAAADAAAAA!~
Here are some exercises for the reader.
We know this bin has a TIM and a SPR file. Where is the SPR file? What's in it? What's in the leftover data? Is there leftover data? Where is the script? Where is the file table in the PSX version?
Well, that's it for now. Lemme know what you guys thought of this.
-halkun