Changes

Jump to navigation Jump to search

FF8/FileFormat X

3,902 bytes added, 21:55, 23 December 2020
m
0 Default: fix size of animation frame
|-
| Texture
| 01 10 00 00 00 09 (Always)| Contains one .TIM texture , 8 BPP
|}
| 0
| uInt16
| Pointers count. Fixed (02 00 () '''[Unused in code)/ pointers count]'''
|-
| 2
| uInt16
| Relative jump to CameraSetting. Should be (08 00)
|-
| 4
| uInt16
| Relative jump to CameraAnimationCollection. Should be (20 00)
|-
| 6
| uInt16
| Camera data size (starting from 0) '''[unused in code]'''
|-
| 8
=====CameraAnimationSet=====
Seems to be 8 pointers in each set.
{| border="1" cellspacing="1" cellpadding="3" align="center" style="border: 1px solid black; border-collapse: collapse;"
! style="background:rgb(204,204,204)" | Offset
|}
==Camera Animation (WIP) == All this is based on best effort knowledge from reversing by Maki. I'm just trying to understand it.=== Control Word ==={| border="1" cellspacing="1" cellpadding="3" align="center" style="border: 1px solid black; border-collapse: collapse;"! style="background:rgb(204,204,204)" | Offset! style="background:rgb(204,204,204)" | Length! style="background:rgb(204,204,204)" | Description|-| 0| uint16_t (bit varies)| Main controller. If 0xFFFFU END|}==== FOV ==== Control Word & 0b0000'0000'1100'0000U===== 1 Default ====={| border="1" cellspacing="1" cellpadding="3" align="center" style="border: 1px solid black; border-collapse: collapse;"! style="background:rgb(204,204,204)" | Offset! style="background:rgb(204,204,204)" | Length! style=Camera Animation "background:rgb(WIP204,204,204)" | Description|-| None| None| Start = 0x200|-| None| None| End = 0x200|}===== 2 Same ====={| border="1" cellspacing="1" cellpadding="3" align="center" style="border: 1px solid black; border-collapse: collapse;"! style="background:rgb(204,204,204)" | Offset! style="background:rgb(204,204,204)" | Length! style="background:rgb(204,204,204)" | Description|-| 0| uint16_t| Start|-| 2| uint16_t| Padding|-| None| None| End = Start|}===== 2 Different =====
{| border="1" cellspacing="1" cellpadding="3" align="center" style="border: 1px solid black; border-collapse: collapse;"
! style="background:rgb(204,204,204)" | Offset
|-
| 0
| WORD (bit varies)uint16_t| Main controller, if 0xFFFF then return, stored into camera struct+2Start
|-
| 2
| WORDuint16_t| Unknown, stored into camera struct+4 (2nd controller?)Padding
|-
| 4
| WORDuint16_t| End|} ==== ROLL ==== Control Word & 0b0000'0011'0000'0000U===== 0 Unknown===== TODO===== 1 Default ====={| border="1" cellspacing="1" cellpadding="3" align="center" style="border: 1px solid black; border-collapse: collapse;"! style="background:rgb(204,204, stored into camera struct+6 204)" | Offset! style="background:rgb(3rd controller?204,204,204)" | Length! style="background:rgb(204,204,204)" | Description|-| None| None| Start = 0x000
|-
| 6None| WORDNone| UnknownEnd = 0x000|}===== 2 Same ====={| border="1" cellspacing="1" cellpadding="3" align="center" style="border: 1px solid black; border-collapse: collapse;"! style="background:rgb(204, stored into camera struct204, varies by 4>>8&204)" | Offset! style="background:rgb(204,204,204)" | Length! style="background:rgb(204,204,204)" | Description|-| 0| uint16_t| Start|-| None| None| End = Start|}===== 2 Different ====={| border="1" cellspacing="1" cellpadding="3 case switch" align="center" style="border: 1px solid black; border-collapse: collapse;"! style="background:rgb(204,204,204)" | Offset! style="background:rgb(204,204,204)" | Length! style="background:rgb(204,204,204)" | Description
|-
| 80| WORDuint16_t| UnknownStart
|-
| 102| WORDuint16_t| Animation speed End|} ==== LAYOUT ==== Control Word & 0b0000'0000'0000'0001U===== 0 Default ===== You'll loop through the data till the first value is less than 0. pushing back to a variable length container.{| border="1" cellspacing="1" cellpadding="3" align="center" style="border: 1px solid black; border-collapse: collapse;"! style="background:rgb(confirmed204,204,204)" | Offset! style="background:rgb(204,204,204)" | Length! style="background:rgb(204,204,204)" | Description
|-
| 120| WORDint16_t| Word field if < 0 break; could be related to camera index? crashed when 0x0070time of frame.
|-
| ???2| ???16 bytes| ???Animation Frame
|}
===== 1 Other =====
TODO
===Time===
Time is calculated from number of frames. You basically set starting position World+lookat and ending position, then mark number of frames to interpolate between them. Every frame is one draw call and it costs 16. Starting time needs to be equal or higher for next animation frame to be read; If next frame==0xFFFF then it's all done.
=== Animation Frame ===
{| border="1" cellspacing="1" cellpadding="3" align="center" style="border: 1px solid black; border-collapse: collapse;"
! style="background:rgb(204,204,204)" | Offset
! style="background:rgb(204,204,204)" | Length
! style="background:rgb(204,204,204)" | Description
|-
| 0
| uint16_t
| is frame durations shot
|-
| 2
| Vertice<uint16_t> (x,y,z)
| World
|-
| 8
| uint16_t
| is frame ending shot
|-
| 10
| Vertice<uint16_t> (x,y,z)
| Look At
|}
=====Dependency=====
=====Example: a0stg006.x: 0x5d8 -> 02 00 08 00 20 00 1. Get EOF-> *(0x5d8 + 8) -> 32=====
2a0stg006. x:<br>0x5d8 -> 02 00 08 00 20 00 # Get EOF-> *(0x5d8 + 8) -> 32# Jump to EOF -> 0x5d8 + 32 = 0x5F8 (This is now Camera Animation Collection) 3. # Get pointer to correct anim collection. In this case we will use AnimCollectionID == 0, so: *(0x5F8 + 0*2 + 2) -> 0x0c  4. # Jump to Anim collection data: 0x5F8 + 0x0c = 0x604 (This is now Camera Animation Set) 5. # Jump to Camera animation by cameraAnimSetID, let's take for example cameraAnimSetID == 7, so: *(0x604 + 7*2) -> 0x25E. Now carefully, jump by multiplying it by 2!  5a. ## 0x604 + (0x25E * 2) = 0xAC0
Therefore: a0stg006.x Camera animation 7 in camera collection 0 is at 0xAC0
=== Texture page calculation ===
Byte TPage = InputBytes[TexturePage_index] & 0F;
Bitwise TPage byte AND 0F, to delete first 4 bits
int TPageINT = TPage * 64;
For 16 bit TIM's, the texture page is 64 pixels wide
 
====Example====
For 24-bit TIM:
0xB2 byte is: 2*48 = 96
Unsure about this one. It could be 42.667 instead of 48. It takes 1.5x the space of 16 bit. I haven't seen a file that uses 24-bit yet.
 
For 16-bit TIM:
0xB2 byte is: 2*64= 128
 
For 8-bit TIM:
0xB2 byte is: 2*128 = 256
Byte TPage = InputBytes[TexturePage_index] & 0F; //Bitwise TPage byte AND 0F, to delete first For 4 bits int TPageINT = TPage * 128; //For 16 -bit TIM's, the texture page : 0xB2 byte is 128 sized: 2*256 = 512
Example:0xB2 byte Each time you half the number of bits you double the amount of data you can store in the same space. So the calculated Texture Page is:2*128 = 256different.
=== Face order / Translation/ triangulation ===
27
edits

Navigation menu