Difference between revisions of "FF7/Kernel/Kernel.bin"

From Final Fantasy Inside
< FF7‎ | Kernel
Jump to navigation Jump to search
my_wiki>Synergy Blades
m
m (49 revisions imported)
 
(44 intermediate revisions by 7 users not shown)
Line 1: Line 1:
== Important Files ==
+
== Important Files ==
  
[[Image:Gears_img_5.png]]
+
{| style="border: 1px solid black; border-collapse: collapse; background: rgb(0,255,0)" border="1" cellspacing="1" cellpadding="3" align="center"
 +
! align="center" | PSX Version
 +
! align="center" | PC Version
 +
|-
 +
| /INIT/KERNEL.BIN
 +
| /DATA/KERNEL/KERNEL.BIN
 +
|-
 +
|
 +
| /DATA/KERNEL/KERNEL2.BIN
 +
|}
  
== The KERNEL.BIN Archive ==
+
== The KERNEL.BIN Archive ==
  
The file /INIT/KERNEL.BIN is in BIN-GZIP format. This format is explained later in this document. It consists of 27 gziped sections concatenated together with a 6 byte header for each. This file is the same both on the PC and PSX versions. This holds all the static data and menu text for the game, with a look up table at the beginning of the section. Sections 10-27 are FF Text files.
+
The file KERNEL.BIN archive is in [[FF7/Kernel/Low_level_libraries#BIN-GZIP_Type_Archives|BIN-GZIP format]]. It consists of 27 gziped sections concatenated together with a 6 byte header for each. This file is the same both on the PC and PSX versions. This holds all the static data and menu text for the game, with a look up table at the beginning of the section. The first 9 sections of data (i.e. The non-text related items) are in typical BIN file archive format. Sections 10-27 are [[FF7/FF_Text|FF Text files]]. The text sections have a header of pointers at the beginning of each section and point to a text block below.
  
 
The KERNEL.BIN file consists of the following sections.
 
The KERNEL.BIN file consists of the following sections.
  
<table cellspacing="1" cellpadding="3" style="background: rgb(0, 0, 0);">
+
{| class="wikitable"
<tr>
+
! File
<th style="text-align: center; vertical-align: middle; width: 50px; height: 26px; background-color: rgb(204, 204, 204);">File</th>
+
! Data
<th style="vertical-align: middle; width: 175px; height: 26px; background-color: rgb(204, 204, 204);">Data</th>
+
! Offset
<th colspan="2" style="vertical-align: middle; width: 60px; height: 26px; background-color: rgb(204, 204, 204);">Offset</th>
+
|-
</tr>
+
| align="center" | 1
<tr style="background: rgb(255, 255, 255); height: 25px;">
+
|
<td style="text-align: center; height: 25px;">1</td>
+
[[FF7/Command_data|Command data]]
<td style="height: 25px;">Command data</td>
+
| 0x0006
<td style="height: 25px;">0x0006</td>
+
|-
</tr>
+
| align="center" | 2
<tr style="background: rgb(255, 255, 255); height: 25px;">
+
|
<td style="text-align: center; height: 25px;">2</td>
+
[[FF7/Attack_data|Attack data]]
<td style="height: 25px;">Attack data</td>
+
| 0x0086
<td style="height: 25px;">0x0086</td>
+
|-
</tr>
+
| align="center" | 3
<tr style="background: rgb(255, 255, 204);">
+
|
<td style="text-align: center; height: 25px;">3</td>
+
[[FF7/Battle_and_growth_data|Battle and growth data]]
<td style="height: 25px;">Unknown (Savemap?)</td>
+
| 0x063A
<td style="height: 25px;">0x063A</td>
+
|-
</tr>
+
| align="center" | 4
<tr style="background: rgb(255, 255, 255);">
+
|
<td style="text-align: center; height: 25px;">4</td>
+
[[FF7/Character_starting_stats|Initialization data]]
<td style="height: 25px;">Character starting stats</td>
+
| 0x0F7F
<td style="height: 25px;">0x0F7F</td>
+
|-
</tr>
+
| align="center" | 5
<tr style="background: rgb(255, 255, 255);">
+
|
<td style="text-align: center; height: 25px;">5</td>
+
[[FF7/Item_data|Item data]]
<td style="height: 25px;">Item data</td>
+
| 0x111B
<td style="height: 25px;">0x111B</td>
+
|-
</tr>
+
| align="center" | 6
<tr style="background: rgb(255, 255, 255);">
+
|
<td style="text-align: center; height: 25px;">6</td>
+
[[FF7/Weapon_data|Weapon data]]
<td style="height: 25px;">Weapon data</td>
+
| 0x137A
<td style="height: 25px;">0x137A</td>
+
|-
</tr>
+
| align="center" | 7
<tr style="background: rgb(255, 255, 255);">
+
|
<td style="text-align: center; height: 25px;">7</td>
+
[[FF7/Armor_data|Armor data]]
<td style="height: 25px;">Armor data</td>
+
| 0x1A30
<td style="height: 25px;">0x1A30</td>
+
|-
</tr>
+
| align="center" | 8
<tr style="background: rgb(255, 255, 255);">
+
|
<td style="text-align: center; height: 25px;">8</td>
+
[[FF7/Accessory_data|Accessory data]]
<td style="height: 25px;">Accessory data</td>
+
| 0x1B73
<td style="height: 25px;">0x1B73</td>
+
|-
</tr>
+
| align="center" | 9
<tr style="background: rgb(255, 255, 255);">
+
|
<td style="text-align: center; height: 25px;">9</td>
+
[[FF7/Materia_data|Materia data]]
<td style="height: 25px;">Materia data</td>
+
| 0x1C11
<td style="height: 25px;">0x1C11</td>
+
|-
</tr>
+
| align="center" | 10
<tr style="background: rgb(255, 255, 255);">
+
| Command descriptions
<td style="text-align: center; height: 25px;">10</td>
+
| 0x1F32
<td style="height: 25px;">Command Descriptions</td>
+
|-
<td style="height: 25px;">0x1F32</td>
+
| align="center" | 11
</tr>
+
| Magic descriptions
<tr style="background: rgb(255, 255, 255);">
+
| 0x2199
<td style="text-align: center; height: 25px;">11</td>
+
|-
<td style="height: 25px;">Magic Descriptions</td>
+
| align="center" | 12
<td style="height: 25px;">0x2199</td>
+
| Item descriptions
</tr>
+
| 0x28D4
<tr style="background: rgb(255, 255, 255);">
+
|-
<td style="text-align: center; height: 25px;">12</td>
+
| align="center" | 13
<td style="height: 25px;">Item Descriptions</td>
+
| Weapon descriptions
<td style="height: 25px;">0x28D4</td>
+
| 0x2EE2
</tr>
+
|-
<tr style="background: rgb(255, 255, 255);">
+
| align="center" | 14
<td style="text-align: center; height: 25px;">13</td>
+
| Armor descriptions
<td style="height: 25px;">Weapon Descriptions</td>
+
| 0x307B
<td style="height: 25px;">0x2EE2</td>
+
|-
</tr>
+
| align="center" | 15
<tr style="background: rgb(255, 255, 255);">
+
| Accessory descriptions
<td style="text-align: center; height: 25px;">14</td>
+
| 0x315F
<td style="height: 25px;">Armor Descriptions</td>
+
|-
<td style="height: 25px;">0x307B</td>
+
| align="center" | 16
</tr>
+
| Materia descriptions
<tr style="background: rgb(255, 255, 255);">
+
| 0x3384
<td style="text-align: center; height: 25px;">15</td>
+
|-
<td style="height: 25px;">Accessory Descriptions</td>
+
| align="center" | 17
<td style="height: 25px;">0x315F</td>
+
| Key Item descriptions
</tr>
+
| 0x3838
<tr style="background: rgb(255, 255, 255);">
+
|-
<td style="text-align: center; height: 25px;">16</td>
+
| align="center" | 18
<td style="height: 25px;">Materia Descriptions</td>
+
| Command Names
<td style="height: 25px;">0x3384</td>
+
| 0x3BE2
</tr>
+
|-
<tr style="background: rgb(255, 255, 255);">
+
| align="center" | 19
<td style="text-align: center; height: 25px;">17</td>
+
| Magic Names
<td style="height: 25px;">Key Item Descriptions</td>
+
| 0x3CCA
<td style="height: 25px;">0x3838</td>
+
|-
</tr>
+
| align="center" | 20
<tr style="background: rgb(255, 255, 255);">
+
| Item Names
<td style="text-align: center; height: 25px;">18</td>
+
| 0x4293
<td style="height: 25px;">Command Names</td>
+
|-
<td style="height: 25px;">0x3BE2</td>
+
| align="center" | 21
</tr>
+
| Weapon Names
<tr style="background: rgb(255, 255, 255);">
+
| 0x4651
<td style="text-align: center; height: 25px;">19</td>
+
|-
<td style="height: 25px;">Magic Names</td>
+
| align="center" | 22
<td style="height: 25px;">0x3CCA</td>
+
| Armor Names
</tr>
+
| 0x4B02
<tr style="background: rgb(255, 255, 255);">
+
|-
<td style="text-align: center; height: 25px;">20</td>
+
| align="center" | 23
<td style="height: 25px;">Item Names</td>
+
| Accessory Names
<td style="height: 25px;">0x4293</td>
+
| 0x4C4B
</tr>
+
|-
<tr style="background: rgb(255, 255, 255);">
+
| align="center" | 24
<td style="text-align: center; height: 25px;">21</td>
+
| Materia Names
<td style="height: 25px;">Weapon Names</td>
+
| 0x4D90
<td style="height: 25px;">0x4651</td>
+
|-
</tr>
+
| align="center" | 25
<tr style="background: rgb(255, 255, 255);">
+
| Key Item Names
<td style="text-align: center; height: 25px;">22</td>
+
| 0x5040
<td style="height: 25px;">Armor Names</td>
+
|-
<td style="height: 25px;">0x4B02</td>
+
| align="center" | 26
</tr>
+
| Battle and Battle-Screen Text
<tr style="background: rgb(255, 255, 255);">
+
| 0x5217
<td style="text-align: center; height: 25px;">23</td>
+
|-
<td style="height: 25px;">Accessory Names</td>
+
| align="center" | 27
<td style="height: 25px;">0x4C4B</td>
+
| Summon Attack Names
</tr>
+
| 0x5692
<tr style="background: rgb(255, 255, 255);">
+
|}
<td style="text-align: center; height: 25px;">24</td>
 
<td style="height: 25px;">Materia Names</td>
 
<td style="height: 25px;">0x4D90</td>
 
</tr>
 
<tr style="background: rgb(255, 255, 255);">
 
<td style="text-align: center; height: 25px;">25</td>
 
<td style="height: 25px;">Key Item Names</td>
 
<td style="height: 25px;">0x5040</td>
 
</tr>
 
<tr style="background: rgb(255, 255, 255);">
 
<td style="text-align: center; height: 25px;">26</td>
 
<td style="height: 25px;">Battle and Battle-Screen Text</td>
 
<td style="height: 25px;">0x5217</td>
 
</tr>
 
<tr style="background: rgb(255, 255, 255);">
 
<td style="text-align: center; height: 25px;">27</td>
 
<td style="height: 25px;">Summon Attack Names</td>
 
<td style="height: 25px;">0x5692</td>
 
</tr>
 
</table>
 
  
== KERNEL.BIN Section formats ==
+
== The KERNEL2.BIN Archive  ==
  
The first 9 sections of data (i.e. The non-text related items) have a typical BIN file format. The text sections (10-27) do not have the typical 6 byte header. The text sections have a header of pointers to the text block. The text is in FF text format.
+
On the PC version there exists a secondary kernel archive called KERNEL2.BIN. This archive contains only sections 10-27 (Text data) of KERNEL.BIN. The data was ungzipped from the original archive, concatenated together, and then LZSed into a single archive with a 4 byte header giving the length of the file.
  
=== Section 1: Command data format ===
+
The maximum allotted storage space on the PC version for all un-LZSed data in the kernel2.bin is 27KB (27648 bytes). This means that the total size of the extracted files (text and pointers) must be less than this.
 
 
This contains the data for Menu commands. Each recored is 16 bytes long.
 
 
 
 
 
<table cellspacing="1" style="background: rgb(0, 0, 0);">
 
<tr>
 
<th style="text-align: center; vertical-align: middle; width: 50px; height: 26px; background-color: rgb(204, 204, 204);">
 
Offset</th>
 
<th style="vertical-align: middle; width: 50px; height: 26px; background-color: rgb(204, 204, 204);">
 
Length</th>
 
<th colspan="2" style="vertical-align: middle; width: 250px; height: 26px; background-color: rgb(204, 204, 204);">
 
Description</th>
 
</tr>
 
 
 
<tr style="background: rgb(255, 255, 255);">
 
<td style="text-align: center">&nbsp;</td>
 
<td style="height: 25px;">&nbsp;</td>
 
<td style="width: 125px; height: 25px;">&nbsp;</td>
 
<td style="width: 125px; height: 25px;">&nbsp;</td>
 
</tr>
 
 
 
<tr style="background: rgb(255, 255, 255);">
 
<td style="text-align: center">&nbsp;</td>
 
<td style="height: 25px;">&nbsp;</td>
 
<td style="height: 25px;">&nbsp;</td>
 
<td style="height: 25px;">&nbsp;</td>
 
</tr>
 
 
 
<tr style="background: rgb(255, 255, 255);">
 
<td style="text-align: center; height: 25px; margin-bottom: 53px;">&nbsp;</td>
 
<td style="height: 25px;">&nbsp;</td>
 
<td style="height: 25px;">&nbsp;</td>
 
<td style="height: 25px;">&nbsp;</td>
 
</tr>
 
 
 
<tr style="background: rgb(255, 255, 255);">
 
<td style="text-align: center" style="margin-bottom: 53px;">&nbsp;</td>
 
<td style="height: 25px;">&nbsp;</td style="height: 25px;">
 
<td style="height: 25px;">&nbsp;</td>
 
<td style="height: 25px;">&nbsp;</td>
 
</tr>
 
 
 
<tr style="background: rgb(255, 255, 255);">
 
<td style="text-align: center" style="margin-bottom: 53px;">&nbsp;</td>
 
<td style="height: 25px;">&nbsp;</td style="height: 25px;">
 
<td style="height: 25px;">&nbsp;</td>
 
<td style="height: 25px;">&nbsp;</td>
 
</tr>
 
 
 
<tr style="background: rgb(255, 255, 255);">
 
<td style="text-align: center" style="margin-bottom: 53px;">&nbsp;</td>
 
<td style="height: 25px;">&nbsp;</td style="height: 25px;">
 
<td style="height: 25px;">&nbsp;</td>
 
<td style="height: 25px;">&nbsp;</td>
 
</tr>
 
 
 
<tr style="background: rgb(255, 255, 255);">
 
<td style="text-align: center" style="margin-bottom: 53px;">&nbsp;</td>
 
<td style="height: 25px;">&nbsp;</td style="height: 25px;">
 
<td style="height: 25px;">&nbsp;</td>
 
<td style="height: 25px;">&nbsp;</td>
 
</tr>
 
 
 
<tr style="background: rgb(255, 255, 255);">
 
<td style="text-align: center" style="margin-bottom: 53px;">&nbsp;</td>
 
<td style="height: 25px;">&nbsp;</td style="height: 25px;">
 
<td style="height: 25px;">&nbsp;</td>
 
<td style="height: 25px;">&nbsp;</td>
 
</tr>
 
 
 
<tr style="background: rgb(255, 255, 255);">
 
<td style="text-align: center" style="margin-bottom: 53px;">&nbsp;</td>
 
<td style="height: 25px;">&nbsp;</td style="height: 25px;">
 
<td style="height: 25px;">&nbsp;</td>
 
<td style="height: 25px;">&nbsp;</td>
 
</tr>
 
 
 
<tr style="background: rgb(255, 255, 255);">
 
<td style="text-align: center" style="margin-bottom: 53px;">&nbsp;</td>
 
<td style="height: 25px;">&nbsp;</td style="height: 25px;">
 
<td style="height: 25px;">&nbsp;</td>
 
<td style="height: 25px;">&nbsp;</td>
 
</tr>
 
 
 
<tr style="background: rgb(255, 255, 255);">
 
<td style="text-align: center" style="margin-bottom: 53px;">&nbsp;</td>
 
<td style="height: 25px;">&nbsp;</td style="height: 25px;">
 
<td style="height: 25px;">&nbsp;</td>
 
<td style="height: 25px;">&nbsp;</td>
 
</tr>
 
</table>
 
 
 
 
 
=== Section 2: Attack data format ===
 
 
 
This contains the data for the different attacks. Each record is 28 bytes long.
 
 
 
 
 
<table cellpadding="3" cellspacing="1" style="margin-bottom: 53px; background: rgb(0, 0, 0);">
 
<tr>
 
<th style="text-align: center; vertical-align: middle; width: 50px; height: 26px; background-color: rgb(204, 204, 204);">
 
Offset</th>
 
<th style="vertical-align: middle; width: 50px; height: 26px; background-color: rgb(204, 204, 204);">
 
Length</th>
 
<th colspan="2" style="vertical-align: middle; width: 250px; height: 26px; background-color: rgb(204, 204, 204);">
 
Description</th>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 204);">
 
<td style="text-align: center; margin-bottom: 53px; height: 25px;">0x00</td>
 
<td>4 bytes</td>
 
<td colspan="2" style="width: 125px;">Unknown</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255); height: 25px;">
 
<td style="text-align: center" style="margin-bottom: 53px; height: 25px;">0x04</td>
 
<td style="height: 25px;">1 bytes</td>
 
<td colspan="2" style="width: 125px; height: 25px;">Casting cost</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 204);">
 
<td style="text-align: center" style="margin-bottom: 53px; height: 25px;">0x05</td>
 
<td style="height: 25px;">5 bytes</td>
 
<td colspan="2" style="width: 125px; height: 25px;">Unknown</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td style="text-align: center" style="margin-bottom: 53px; height: 25px;">0x0A</td>
 
<td style="height: 25px;">1 bytes</td>
 
<td colspan="2" style="width: 125px; height: 25px;">Attack type</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td style="text-align: center" style="margin-bottom: 53px; height: 25px;">0x0B</td>
 
<td style="height: 25px;">2 bytes</td>
 
<td colspan="2" style="width: 125px; height: 25px;">Attack attribute</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td colspan="2" rowspan="16" style="text-align: center; height: 25px; background-color: rgb(204, 204, 255); margin-bottom: 53px;" >&nbsp;</td>
 
<td style="width: 110px; height: 25px;">0x0000</td>
 
<td style="width: 140px; height: 25px;">Escape/Exit-Type</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td style="width: 110px; height: 25px;">0x0001</td>
 
<td style="width: 140px; height: 25px;">Ribbon-Like</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td style="width: 110px; height: 25px;">0x0003</td>
 
<td style="width: 140px; height: 25px;background-color: rgb(255, 255, 204);">Enemy Skill (?)
 
</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td style="width: 110px; height: 25px;">0x0005</td>
 
<td style="width: 140px; height: 25px; background-color: rgb(255, 255, 204);">Enemy Skill (?)</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td style="width: 110px; height: 25px;">0x0007</td>
 
<td style="width: 140px; height: 25px;background-color: rgb(255, 255, 204);">Enemy Skill (?)</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td style="width: 110px; height: 25px;">0x000D</td>
 
<td style="width: 140px; height: 25px;">Restorative/Protective</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td style="width: 110px; height: 25px;">0x000F</td>
 
<td style="width: 140px; height: 25px;">Status-giving/Elemental</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td style="width: 110px; height: 25px;">0x0011</td>
 
<td style="width: 140px; height: 25px;">Shield</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td style="width: 110px; height: 25px;">0x0013</td>
 
<td style="width: 140px; height: 25px;">Limit Break</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td style="width: 110px; height: 25px;">0x0015</td>
 
<td style="width: 140px; height: 25px;">Cait Sith Limit Break</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td style="width: 110px; height: 25px;">0x0017</td>
 
<td style="width: 140px; height: 25px;">Summon</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td style="width: 110px; height: 25px;">0x00C7</td>
 
<td style="width: 140px; height: 25px;">Roulette</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td style="width: 110px; height: 25px;">0x0097</td>
 
<td style="width: 140px; height: 25px;">Multiple Strike Limit Breaks</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td style="width: 110px; height: 25px;">0xFF01</td>
 
<td style="width: 140px; height: 25px;">Phoenix Down</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td style="width: 110px; height: 25px;">0xFF03</td>
 
<td style="width: 140px; height: 25px;">X-needles attack</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td style="width: 110px; height: 25px;">0xFF17</td>
 
<td style="width: 140px; height: 25px;">Final Limit Break</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td style="text-align: center" style="margin-bottom: 53px;">0x0D</td>
 
<td style="height: 25px;">1 byte</td>
 
<td colspan="2" style="width: 125px; height: 25px;">ID Number</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td style="text-align: center" style="margin-bottom: 53px; height: 25px;">0x0E</td>
 
<td style="height: 25px;">1 byte</td>
 
<td colspan="2" style="width: 125px; height: 25px;">Restore Apply</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td style="text-align: center" style="margin-bottom: 53px; height: 25px;">0x0F</td>
 
<td style="height: 25px;">1 byte</td>
 
<td colspan="2" style="width: 125px; height: 25px;">Strength</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td style="text-align: center" style="margin-bottom: 53px; height: 25px;">0x10</td>
 
<td style="height: 25px;">1 byte</td>
 
<td colspan="2" style="width: 125px; height: 25px;">Restore type</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td colspan="2" rowspan="4" style="text-align: center" style="background-color: rgb(204, 204, 255); margin-bottom: 53px;" >&nbsp;</td>
 
<td style="width: 110px; height: 25px;">0x00</td>
 
<td style="width: 140px; height: 25px;">Restore HP</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td style="width: 110px; height: 25px;">0x01</td>
 
<td style="width: 140px; height: 25px;">Restore MP</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td style="width: 110px; height: 25px;">0x02</td>
 
<td style="width: 140px; height: 25px;">Restore Ailment</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td style="width: 110px; height: 25px;">0xFF</td>
 
<td style="width: 140px; height: 25px;">None</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 204);">
 
<td style="text-align: center" style="margin-bottom: 53px; height: 25px;">0x11</td>
 
<td style="height: 25px;">2 bytes</td>
 
<td colspan="2" style="width: 125px; height: 25px;">Unknown</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td style="text-align: center" style="margin-bottom: 53px; height: 25px;">0x13</td>
 
<td style="height: 25px;">1 byte</td>
 
<td colspan="2" style="width: 125px">Times attacking</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td style="text-align: center" style="margin-bottom: 53px; height: 25px;">0x14</td>
 
<td>4 bytes</td>
 
<td colspan="2" style="width: 125px; height: 25px;">Status</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td style="text-align: center" style="margin-bottom: 53px; height: 25px;">0x18</td>
 
<td style="height: 25px;">2 bytes</td>
 
<td colspan="2" style="width: 125px; height: 25px;">Element</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 204);">
 
<td style="text-align: center" style="margin-bottom: 53px;">0x20</td>
 
<td style="height: 25px;">2 bytes</td>
 
<td colspan="2" style="width: 125px; height: 25px;">Unknown</td>
 
</tr>
 
</table>
 
 
 
=== Section 3: Savemap ===
 
 
 
This is all the initial values and structure for most of the Savemap, excluding the header data and the tail of the last bank (0x0054 to 0x0FE7). This is copied into RAM on initialization. This format is explained in the "Menu" Section.
 
 
 
=== Section 4: Initialization data ===
 
 
 
This contains the starting stats for the characters and related game states. On "New Game", this data is copied directly into the save map (from offset 0x0054 to 0x0BAF) which is explained in the "Menu" section. This data has the same format as the data explained in that section.
 
 
 
=== Section 5: Item data format ===
 
 
 
This contains the item data. Each item record is 27 bytes long.
 
 
 
 
 
<table cellpadding="3" cellspacing="1" style="margin-bottom: 53px; background: rgb(0, 0, 0);">
 
<tr>
 
<th style="text-align: center; vertical-align: middle; width: 50px; height: 26px; background-color: rgb(204, 204, 204);">
 
Offset</th>
 
<th style="vertical-align: middle; width: 50px; height: 26px; background-color: rgb(204, 204, 204);">
 
Length</th>
 
<th colspan="2" style="vertical-align: middle; width: 350px; height: 26px; background-color: rgb(204, 204, 204);">
 
Description</th>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td style="text-align: center" style="margin-bottom: 53px;">0x00</td>
 
<td>8 bytes</td>
 
<td style="width: 100px">Unknown</td>
 
<td>Always 0xFFFFFFFF</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td style="text-align: center" style="margin-bottom: 53px;">0x08</td>
 
<td>2 bytes</td>
 
<td colspan="2" style="width: 275px; background-color: rgb(255, 255, 205);">Unknown</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td style="text-align: center" style="margin-bottom: 53px;">0x0A</td>
 
<td>1 byte</td>
 
<td colspan="2">Restriction Mask</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td colspan="2" rowspan="10" style="text-align: center" style="margin-bottom: 53px; background-color: rgb(205, 205, 255);">&nbsp;</td>
 
<td style="width:100px;">0xFF</td><td>
 
Appears in Item Menu. Does not appear in<br />
 
Battle Menu (Not usable at all)</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td>0xFE</td>
 
<td>Appears in Battle Menu & Item Menu (Not<br />
 
usable at all)</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td>0xFD</td>
 
<td>Appears in Item Menu. Does not appear in<br />
 
Battle Menu (Usable in Battle Menu) </td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td>0xFC</td><td>
 
Appears in Battle Menu & Item Menu (Usable<br />
 
in Battle Menu) </td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td>0xFB</td>
 
<td>Appears in Item Menu. Does not appear in<br />
 
Battle Menu (Usable in Item Menu) </td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td>0xFA</td>
 
<td>Appears in Battle Menu & Item Menu (Usable<br />
 
in Item Menu)</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td>0xF9</td>
 
<td>Appears in Item Menu. Does not appear in <br />
 
Battle Menu (Usable in Item Menu & Battle Menu)</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td>0xF8</td>
 
<td>Appears in Battle Menu & Item Menu (Usable<br />
 
in Item Menu & Battle Menu)</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td>0xF7</td>
 
<td>Appears in Item Menu. Does not appear in<br />
 
Battle Menu (Usable in Battle Menu)
 
</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td>0xF6</td>
 
<td>Appears in Battle Menu & Item Menu (Usable<br />
 
in Battle Menu)</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td style="text-align: center" style="margin-bottom: 53px;">0x0B</td>
 
<td>2 bytes</td>
 
<td colspan="2">Attack Target</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td colspan="2" rowspan="5" style="text-align: center" style="margin-bottom: 53px; background-color: rgb(205, 205, 255);">&nbsp;</td>
 
<td style="width:100px;">0x01</td>
 
<td>One Target</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td>0x03</td>
 
<td style="background-color: rgb(255, 255, 204);">Unknown</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td>0x05</td>
 
<td>Multiple Targets</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td>0x07</td>
 
<td style="background-color: rgb(255, 255, 204);">Unknown</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td>0x10</td>
 
<td>On Party Only</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td style="text-align: center">0x0D</td>
 
<td>1 byte</td>
 
<td colspan="2">Item ID</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td style="text-align: center">0x0E</td>
 
<td>1 byte</td>
 
<td colspan="2">Restore Apply</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td colspan="2" rowspan="10" style="text-align: center" style="margin-bottom: 53px; background-color: rgb(205, 205, 255);">&nbsp;</td>
 
<td style="width:100px;">0x00</td>
 
<td style="background-color: rgb(255, 255, 204);">Unknown</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td>0x08</td>
 
<td>Apply also to MP</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td>0x22</td>
 
<td style="background-color: rgb(255, 255, 204);">Unknown</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td>0x23</td>
 
<td style="background-color: rgb(255, 255, 204);">Unknown</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td>0x24</td>
 
<td>Damage / Restore by %</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td>0x26</td>
 
<td>Damage / Restore by 20 X Amount Multiplier </td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td>0x37</td>
 
<td>Causes Damage</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td>0x47</td>
 
<td style="background-color: rgb(255, 255, 204);">Unknown</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td>0x50</td>
 
<td>Affects Stats</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td>0xFF</td>
 
<td>None</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td style="text-align: center">0x0F</td>
 
<td>1 byte</td>
 
<td colspan="2">Amount Multiplier</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td style="text-align: center">0x10</td>
 
<td>1 byte</td>
 
<td colspan="2">Restore Type</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td colspan="2" rowspan="4" style="text-align: center" style="margin-bottom: 53px; background-color: rgb(205, 205, 255);">&nbsp;</td>
 
<td style="width:100px;">0x00</td>
 
<td>Restore HP</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td style="width:100px;">0x01</td>
 
<td>Restore MP</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td style="width:100px;">0x02</td>
 
<td>Restore Ailment</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td style="width:100px;">0xFF</td>
 
<td>None</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 204);">
 
<td style="text-align: center">0x11</td>
 
<td>3 bytes</td>
 
<td colspan="2">Unknown</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td style="text-align: center">0x14</td>
 
<td>4 bytes</td>
 
<td colspan="2">Status effects</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 255);">
 
<td style="text-align: center">0x18</td>
 
<td>2 bytes</td>
 
<td colspan="2">Element</td>
 
</tr>
 
 
 
<tr style="background-color: rgb(255, 255, 204);">
 
<td style="text-align: center">0x1A</td>
 
<td>2 bytes</td>
 
<td colspan="2">Unknown</td>
 
</tr>
 
 
 
</table>
 

Latest revision as of 05:19, 23 May 2019

Important Files

PSX Version PC Version
/INIT/KERNEL.BIN /DATA/KERNEL/KERNEL.BIN
/DATA/KERNEL/KERNEL2.BIN

The KERNEL.BIN Archive

The file KERNEL.BIN archive is in BIN-GZIP format. It consists of 27 gziped sections concatenated together with a 6 byte header for each. This file is the same both on the PC and PSX versions. This holds all the static data and menu text for the game, with a look up table at the beginning of the section. The first 9 sections of data (i.e. The non-text related items) are in typical BIN file archive format. Sections 10-27 are FF Text files. The text sections have a header of pointers at the beginning of each section and point to a text block below.

The KERNEL.BIN file consists of the following sections.

File Data Offset
1

Command data

0x0006
2

Attack data

0x0086
3

Battle and growth data

0x063A
4

Initialization data

0x0F7F
5

Item data

0x111B
6

Weapon data

0x137A
7

Armor data

0x1A30
8

Accessory data

0x1B73
9

Materia data

0x1C11
10 Command descriptions 0x1F32
11 Magic descriptions 0x2199
12 Item descriptions 0x28D4
13 Weapon descriptions 0x2EE2
14 Armor descriptions 0x307B
15 Accessory descriptions 0x315F
16 Materia descriptions 0x3384
17 Key Item descriptions 0x3838
18 Command Names 0x3BE2
19 Magic Names 0x3CCA
20 Item Names 0x4293
21 Weapon Names 0x4651
22 Armor Names 0x4B02
23 Accessory Names 0x4C4B
24 Materia Names 0x4D90
25 Key Item Names 0x5040
26 Battle and Battle-Screen Text 0x5217
27 Summon Attack Names 0x5692

The KERNEL2.BIN Archive

On the PC version there exists a secondary kernel archive called KERNEL2.BIN. This archive contains only sections 10-27 (Text data) of KERNEL.BIN. The data was ungzipped from the original archive, concatenated together, and then LZSed into a single archive with a 4 byte header giving the length of the file.

The maximum allotted storage space on the PC version for all un-LZSed data in the kernel2.bin is 27KB (27648 bytes). This means that the total size of the extracted files (text and pointers) must be less than this.