Difference between pages "FF8/String Encoding" and "FF8/Menu sp2"

From Final Fantasy Inside
< FF8(Difference between pages)
Jump to navigation Jump to search
m (2 revisions imported)
 
 
Line 1: Line 1:
= String Encoding =
+
by MaKi<br/>
FF8 strings are converted to byte arrays.[https://sourceforge.net/p/ifrit/code-0/HEAD/tree/trunk%20ifrit-code-0/Resources/textformat.ifr Char Table] Some of which aligns to the grid of text in the texture if you -32 from the value. Some values are 1 byte = 2 characters, most are 1 byte = 1 character. There are also special bytes that use up 1-3 bytes.
+
updated by Sebanisu
==Special Bytes==
+
 
These bytes are points where things are inserted or a change in formatting. Some just say to ignore this string unless the player unlocked something.
+
This file is a mapping file for atlas textures like icons.tex
 +
 
 +
== Layout of '''icon.sp1''': ==
 +
=== Header ===
 +
'''(4 x (PointerCount + 1))''' bytes
 
{| class="wikitable"
 
{| class="wikitable"
! Starting Byte
+
! Offset
! Size
+
! SizeOf
 
! Name
 
! Name
 
! Description
 
! Description
 
|-
 
|-
| 0x00
+
| 0
| 1
+
| UInt32
| NULL
+
| PointerCount
| End of string
+
| Number of entries
 
|-
 
|-
| 0x02
+
| 4
| 1
+
| Struct Pointer[PointerCount]
| \n
+
| Pointers
| Inserts new line
+
| Seek locations for entry groups
Some areas ignore this character.
+
|}
 +
 
 +
=== Pointer ===
 +
'''4''' bytes
 +
{| class="wikitable"
 +
! Offset
 +
! SizeOf
 +
! Name
 +
! Description
 +
|-
 +
| 0
 +
| UInt16
 +
| Pointer
 +
| Seek location for entry group
 
|-
 
|-
| 0x03
 
 
| 2
 
| 2
| Name
+
| UInt16
| When see 0x03??, in a string, it's usually a characters name.
+
| Count
 +
| Number of entries in group
 +
|}
 +
 
 +
=== Entry Group ===
 +
'''(8 x Count)''' bytes <br/>
 +
At pointer's location there will be '''Struct Entry[Count]'''. Example of an entry group is the direction pad is in eight pieces. Four of them are unpressed and four are pressed versions. It has four entries for the direction pad depending on the directions it is highlighting.
 +
 
 +
=== Entry ===
 +
'''8''' bytes
 +
{| class="wikitable"
 +
! Offset
 +
! SizeOf
 +
! Name
 +
! Description
 
|-
 
|-
| 0x05
+
|0
| 2
+
|Byte
| Icon
+
|xPos
| 0x05?? used to draw a symbol from icons.tex, like controller buttons.
+
|Pixel X coordinate in image atlas
On PC it draws the letter of keyboard keys assigned to the controls.
+
|-
 +
|1
 +
|Byte
 +
|yPos
 +
|Pixel Y coordinate in image atlas
 +
|-
 +
|2
 +
|Byte[2]
 +
|UNK
 +
|Unknown data
 +
|-
 +
|4
 +
|Byte
 +
|Width
 +
|Width of entry in pixels
 +
|-
 +
|5
 +
|Byte
 +
|Offset X
 +
|Offset of X coordinate for when drawing
 +
|-
 +
|6
 +
|Byte
 +
|Height
 +
|Height of entry in pixels
 +
|-
 +
|7
 +
|Byte
 +
|Offset Y
 +
|Offset of Y coordinate for when drawing
 +
|}
 +
Invalid Entries will have '''X''' and '''Y''' of '''zero'''. The top '''16x16''' pixel area is blank. Everything in '''icon.tex''' is aligned to a '''8x8 grid'''. Some entry groups leave out connecting pieces I think you are expected to fill in the blank. Some things like the menu border and menu background don't appear to be listed in this file.
 +
 
 +
===End of file===
 +
Everything at and beyond file pointer '''4272 {0x10C0}''' appears to be garbage.
 +
 
 +
== Layout of '''face.sp2''' and '''cardanm.sp2''': ==
 +
 
 +
Both '''face.sp2''' and '''cardanm.sp2''' have the same layout. Main difference is '''face.sp2''' has '''32''' valid and '''64''' total entries.  '''cardanm.sp2''' only has '''11''' valid entries and '''1''' invalid, as it has no dims. In each of the card texture files the final slot is the '''Triple Triad''' card back. If the entry had dims they would be  X='''192''',Y='''128''', W='''64''', H='''64'''.
 +
 
 +
=== Header ===
 +
{| class="wikitable"
 +
! Offset
 +
! SizeOf
 +
! Name
 +
! Description
 +
|-
 +
| 0
 +
| UInt32
 +
| Count
 +
| Number of entries
 +
Count can be more than the actual images in the texture.<br/>
 +
'''face.sp2''': There are 8 images per texture in 2 textures, and there are 32/64 valid entries. 1 is blank.<br/>
 +
'''cardanm.sp2''': There are 11 images pre texture in 10 textures, and there are 11/12 valid entries. The 12th entry is the card back but it's missing dims.
 +
 
 +
|-
 +
| 4
 +
| UInt32[Count]
 +
| Locations
 +
| Seek location for each entry
 +
|}
 +
=== Entry ===
 +
'''16''' bytes
 +
 
 +
{| class="wikitable"
 +
! Offset
 +
! SizeOf
 +
! Name
 +
! Description
 +
|-
 +
| 0
 +
| UInt32
 +
| Count
 +
| Number of entries at this location
 +
Always '''1'''
 +
|-
 +
| 4
 +
| byte
 +
| xPos
 +
| Pixel X coordinate in image atlas
 +
|-
 +
| 5
 +
| byte
 +
| yPos
 +
| Pixel Y coordinate in image atlas
 +
'''face.sp2''': Invalid entries seem to have '''yPos>=Texture.Height'''.<br />
 +
Detected switch from '''face1.tex''' to '''face2.tex''' when '''yPos<previous.yPos'''.
 +
|-
 +
| 6
 +
| byte[2]
 +
| UNK
 +
| Unknown
 +
'''face.sp2''': '''{0x20,0x36}''' on the valid entries. '''{0x60,0x36}''' on invalid entries.<br />
 +
'''cardanm.sp2''': '''{0x20,0xB6}''' on the valid entries. '''{0x00,0x00}''' on the invalid entry.
 +
|-
 +
| 8
 +
| UInt16
 +
| Width
 +
| Width of entry in pixels
 +
Possible this is really a '''byte''' with a '''0 x-offset'''.
 +
|-
 +
| 10
 +
| UInt16
 +
| Height
 +
| Height of entry in pixels
 +
Possible this is really a '''byte''' with a '''0 y-offset'''.
 +
|-
 +
| 12
 +
| byte[4]
 +
| UNK
 +
| Unknown
 +
'''face.sp2''': '''{0x00,0x00,0x8E,0x00}''' on most. Last one has all '''{0x00}'''<br />
 +
'''cardanm.sp2''': '''{0x00,0x00,0xAE,0x00}''' on most. Last one has all '''{0x00}'''
 +
|}
 +
 
 +
=== End of file ===
 +
'''face.sp2'''File ends with '''byte[16]''' of '''{0x00}'''
 +
 
 +
=== Content of '''face1.tex''' and '''face2.tex''' ===
 +
{| class="wikitable"
 +
!Name
 +
!File
 +
!X
 +
!Y
 +
!Width
 +
!Height
 +
|-
 +
|Squall Leonhart
 +
|face1.tex
 +
|0
 +
|0
 +
|32
 +
|48
 +
|-
 +
|Zell Dincht
 +
|face1.tex
 +
|32
 +
|0
 +
|32
 +
|48
 +
|-
 +
|Irvine Kinneas
 +
|face1.tex
 +
|64
 +
|0
 +
|32
 +
|48
 +
|-
 +
|Quistis Trepe
 +
|face1.tex
 +
|96
 +
|0
 +
|32
 +
|48
 +
|-
 +
|Rinoa Heartilly
 +
|face1.tex
 +
|128
 +
|0
 +
|32
 +
|48
 +
|-
 +
|Selphie Tilmitt
 +
|face1.tex
 +
|160
 +
|0
 +
|32
 +
|48
 +
|-
 +
|Seifer Almasy
 +
|face1.tex
 +
|192
 +
|0
 +
|32
 +
|48
 +
|-
 +
|Edea Kramer
 +
|face1.tex
 +
|224
 +
|0
 +
|32
 +
|48
 +
|-
 +
|Laguna Loire
 +
|face1.tex
 +
|0
 +
|48
 +
|32
 +
|48
 +
|-
 +
|Kiros Seagill
 +
|face1.tex
 +
|32
 +
|48
 +
|32
 +
|48
 +
|-
 +
|Ward Zabac
 +
|face1.tex
 +
|64
 +
|48
 +
|32
 +
|48
 +
|-
 +
|Lion
 +
|face1.tex
 +
|128
 +
|48
 +
|32
 +
|48
 +
|-
 +
|MiniMog
 +
|face1.tex
 +
|160
 +
|48
 +
|32
 +
|48
 +
|-
 +
|Boko
 +
|face1.tex
 +
|192
 +
|48
 +
|32
 +
|48
 +
|-
 +
|Angelo
 +
|face1.tex
 +
|224
 +
|48
 +
|32
 +
|48
 +
|-
 +
|Quezacotl
 +
|face2.tex
 +
|0
 +
|0
 +
|32
 +
|48
 +
|-
 +
|Shiva
 +
|face2.tex
 +
|32
 +
|0
 +
|32
 +
|48
 +
|-
 +
|Ifrit
 +
|face2.tex
 +
|64
 +
|0
 +
|32
 +
|48
 +
|-
 +
|Siren
 +
|face2.tex
 +
|96
 +
|0
 +
|32
 +
|48
 +
|-
 +
|Brothers
 +
|face2.tex
 +
|128
 +
|0
 +
|32
 +
|48
 +
|-
 +
|Diablos
 +
|face2.tex
 +
|160
 +
|0
 +
|32
 +
|48
 +
|-
 +
|Carbuncle
 +
|face2.tex
 +
|192
 +
|0
 +
|32
 +
|48
 +
|-
 +
|Leviathan
 +
|face2.tex
 +
|224
 +
|0
 +
|32
 +
|48
 +
|-
 +
|Pandemona
 +
|face2.tex
 +
|0
 +
|48
 +
|32
 +
|48
 +
|-
 +
|Cerberus
 +
|face2.tex
 +
|32
 +
|48
 +
|32
 +
|48
 +
|-
 +
|Alexander
 +
|face2.tex
 +
|64
 +
|48
 +
|32
 +
|48
 +
|-
 +
|Doomtrain
 +
|face2.tex
 +
|96
 +
|48
 +
|32
 +
|48
 
|-
 
|-
| 0x06
+
|Bahamut
| 2
+
|face2.tex
| Color
+
|128
| 0x06?? used to show a change in formatting like color
+
|48
 +
|32
 +
|48
 
|-
 
|-
| 0x0A
+
|Cactuar
| 2
+
|face2.tex
| Special_Value
+
|160
| 0x0A?? can be a string or number value.
+
|48
Depending on which string you are reading it can be a different value.
+
|32
 +
|48
 
|-
 
|-
| 0x0B
+
|Tonberry
| 2 or 3
+
|face2.tex
| Cursor_Locations
+
|192
| Might be number of possible return values that determine whether this is 3 or 2 bytes.
+
|48
Like YES or NO questions will only be 2 bytes<br/>
+
|32
but screens with a list of multiple selections will will use 3 bytes.
+
|48
 
|-
 
|-
| [http://forums.qhimm.com/index.php?topic=17120.msg243579#msg243579 0x0C]
+
|Eden
| 2
+
|face2.tex
| SpellID
+
|224
| Used to place a name of a spell.
+
|48
 +
|32
 +
|48
 
|}
 
|}
 +
There is one blank space in '''face1.tex''', I skipped that entry.
 +
=== Content of '''mc00.tex'''-'''mc09.tex''' ===
 +
Each level on the [https://finalfantasy.fandom.com/wiki/Final_Fantasy_VIII_Triple_Triad_cards fandom wiki page]is in the same order of the contents of the tex files.  The cardback is always the bottom right of each texture.

Latest revision as of 01:15, 15 July 2019

by MaKi
updated by Sebanisu

This file is a mapping file for atlas textures like icons.tex

Layout of icon.sp1:

Header

(4 x (PointerCount + 1)) bytes

Offset SizeOf Name Description
0 UInt32 PointerCount Number of entries
4 Struct Pointer[PointerCount] Pointers Seek locations for entry groups

Pointer

4 bytes

Offset SizeOf Name Description
0 UInt16 Pointer Seek location for entry group
2 UInt16 Count Number of entries in group

Entry Group

(8 x Count) bytes
At pointer's location there will be Struct Entry[Count]. Example of an entry group is the direction pad is in eight pieces. Four of them are unpressed and four are pressed versions. It has four entries for the direction pad depending on the directions it is highlighting.

Entry

8 bytes

Offset SizeOf Name Description
0 Byte xPos Pixel X coordinate in image atlas
1 Byte yPos Pixel Y coordinate in image atlas
2 Byte[2] UNK Unknown data
4 Byte Width Width of entry in pixels
5 Byte Offset X Offset of X coordinate for when drawing
6 Byte Height Height of entry in pixels
7 Byte Offset Y Offset of Y coordinate for when drawing

Invalid Entries will have X and Y of zero. The top 16x16 pixel area is blank. Everything in icon.tex is aligned to a 8x8 grid. Some entry groups leave out connecting pieces I think you are expected to fill in the blank. Some things like the menu border and menu background don't appear to be listed in this file.

End of file

Everything at and beyond file pointer 4272 {0x10C0} appears to be garbage.

Layout of face.sp2 and cardanm.sp2:

Both face.sp2 and cardanm.sp2 have the same layout. Main difference is face.sp2 has 32 valid and 64 total entries. cardanm.sp2 only has 11 valid entries and 1 invalid, as it has no dims. In each of the card texture files the final slot is the Triple Triad card back. If the entry had dims they would be X=192,Y=128, W=64, H=64.

Header

Offset SizeOf Name Description
0 UInt32 Count Number of entries

Count can be more than the actual images in the texture.
face.sp2: There are 8 images per texture in 2 textures, and there are 32/64 valid entries. 1 is blank.
cardanm.sp2: There are 11 images pre texture in 10 textures, and there are 11/12 valid entries. The 12th entry is the card back but it's missing dims.

4 UInt32[Count] Locations Seek location for each entry

Entry

16 bytes

Offset SizeOf Name Description
0 UInt32 Count Number of entries at this location

Always 1

4 byte xPos Pixel X coordinate in image atlas
5 byte yPos Pixel Y coordinate in image atlas

face.sp2: Invalid entries seem to have yPos>=Texture.Height.
Detected switch from face1.tex to face2.tex when yPos<previous.yPos.

6 byte[2] UNK Unknown

face.sp2: {0x20,0x36} on the valid entries. {0x60,0x36} on invalid entries.
cardanm.sp2: {0x20,0xB6} on the valid entries. {0x00,0x00} on the invalid entry.

8 UInt16 Width Width of entry in pixels

Possible this is really a byte with a 0 x-offset.

10 UInt16 Height Height of entry in pixels

Possible this is really a byte with a 0 y-offset.

12 byte[4] UNK Unknown

face.sp2: {0x00,0x00,0x8E,0x00} on most. Last one has all {0x00}
cardanm.sp2: {0x00,0x00,0xAE,0x00} on most. Last one has all {0x00}

End of file

face.sp2File ends with byte[16] of {0x00}

Content of face1.tex and face2.tex

Name File X Y Width Height
Squall Leonhart face1.tex 0 0 32 48
Zell Dincht face1.tex 32 0 32 48
Irvine Kinneas face1.tex 64 0 32 48
Quistis Trepe face1.tex 96 0 32 48
Rinoa Heartilly face1.tex 128 0 32 48
Selphie Tilmitt face1.tex 160 0 32 48
Seifer Almasy face1.tex 192 0 32 48
Edea Kramer face1.tex 224 0 32 48
Laguna Loire face1.tex 0 48 32 48
Kiros Seagill face1.tex 32 48 32 48
Ward Zabac face1.tex 64 48 32 48
Lion face1.tex 128 48 32 48
MiniMog face1.tex 160 48 32 48
Boko face1.tex 192 48 32 48
Angelo face1.tex 224 48 32 48
Quezacotl face2.tex 0 0 32 48
Shiva face2.tex 32 0 32 48
Ifrit face2.tex 64 0 32 48
Siren face2.tex 96 0 32 48
Brothers face2.tex 128 0 32 48
Diablos face2.tex 160 0 32 48
Carbuncle face2.tex 192 0 32 48
Leviathan face2.tex 224 0 32 48
Pandemona face2.tex 0 48 32 48
Cerberus face2.tex 32 48 32 48
Alexander face2.tex 64 48 32 48
Doomtrain face2.tex 96 48 32 48
Bahamut face2.tex 128 48 32 48
Cactuar face2.tex 160 48 32 48
Tonberry face2.tex 192 48 32 48
Eden face2.tex 224 48 32 48

There is one blank space in face1.tex, I skipped that entry.

Content of mc00.tex-mc09.tex

Each level on the fandom wiki pageis in the same order of the contents of the tex files. The cardback is always the bottom right of each texture.