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

From Final Fantasy Inside
< FF7‎ | Kernel
Jump to navigation Jump to search
my_wiki>Halkun
(The KERNEL.BIN Archive)
m (49 revisions imported)
 
(14 intermediate revisions by 5 users not shown)
Line 1: Line 1:
== Important Files ==
+
== Important Files ==
  
<center>[[Image:Gears_img_5.png]]</center>
+
{| 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 KERNEL.BIN archive is in [[FF7/BIN-GZIP|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 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.
  
{| border="0" cellspacing="1" cellpadding="3" style="background: rgb(0,0,0)" align="center"
+
{| class="wikitable"
! style="background:rgb(204,204,204)" align="center" | File
+
! File
! style="background:rgb(204,204,204)" | Data
+
! Data
! style="background:rgb(204,204,204)" | Offset
+
! Offset
 
|-
 
|-
|style="background:rgb(255,255,255)" align="center" | 1
+
| align="center" | 1
|style="background:rgb(255,255,255)" | [[FF7/Command data|Command data]]
+
|
|style="background:rgb(255,255,255)" | 0x0006
+
[[FF7/Command_data|Command data]]
 +
| 0x0006
 
|-
 
|-
|style="background:rgb(255,255,255)" align="center" | 2
+
| align="center" | 2
|style="background:rgb(255,255,255)" | [[FF7/Attack data|Attack data]]
+
|
|style="background:rgb(255,255,255)" | 0x0086
+
[[FF7/Attack_data|Attack data]]
 +
| 0x0086
 
|-
 
|-
|style="background:rgb(255,255,255)" align="center" | 3
+
| align="center" | 3
|style="background:rgb(255,255,255)" | [[FF7/Savemap|Savemap]]
+
|
|style="background:rgb(255,255,255)" | 0x063A
+
[[FF7/Battle_and_growth_data|Battle and growth data]]
 +
| 0x063A
 
|-
 
|-
|style="background:rgb(255,255,255)" align="center" | 4
+
| align="center" | 4
|style="background:rgb(255,255,255)" | [[FF7/Character starting stats|Character starting stats]]
+
|
|style="background:rgb(255,255,255)" | 0x0F7F
+
[[FF7/Character_starting_stats|Initialization data]]
 +
| 0x0F7F
 
|-
 
|-
|style="background:rgb(255,255,255)" align="center" | 5
+
| align="center" | 5
|style="background:rgb(255,255,255)" | [[FF7/Item data|Item data]]
+
|
|style="background:rgb(255,255,255)" | 0x111B
+
[[FF7/Item_data|Item data]]
 +
| 0x111B
 
|-
 
|-
|style="background:rgb(255,255,255)" align="center" | 6
+
| align="center" | 6
|style="background:rgb(255,255,255)" | [[FF7/Weapon data|Weapon data]]
+
|
|style="background:rgb(255,255,255)" | 0x137A
+
[[FF7/Weapon_data|Weapon data]]
 +
| 0x137A
 
|-
 
|-
|style="background:rgb(255,255,255)" align="center" | 7
+
| align="center" | 7
|style="background:rgb(255,255,255)" | [[FF7/Armor data|Armor data]]
+
|
|style="background:rgb(255,255,255)" | 0x1A30
+
[[FF7/Armor_data|Armor data]]
 +
| 0x1A30
 
|-
 
|-
|style="background:rgb(255,255,255)" align="center" | 8
+
| align="center" | 8
|style="background:rgb(255,255,255)" | [[FF7/Accessory data|Accessory data]]
+
|
|style="background:rgb(255,255,255)" | 0x1B73
+
[[FF7/Accessory_data|Accessory data]]
 +
| 0x1B73
 
|-
 
|-
|style="background:rgb(255,255,255)" align="center" | 9
+
| align="center" | 9
|style="background:rgb(255,255,255)" | [[FF7/Materia data|Materia data]]
+
|
|style="background:rgb(255,255,255)" | 0x1C11
+
[[FF7/Materia_data|Materia data]]
 +
| 0x1C11
 
|-
 
|-
|style="background:rgb(255,255,255)" align="center" | 10
+
| align="center" | 10
|style="background:rgb(255,255,255)" | Command descriptions
+
| Command descriptions
|style="background:rgb(255,255,255)" | 0x1F32
+
| 0x1F32
 
|-
 
|-
|style="background:rgb(255,255,255)" align="center" | 11
+
| align="center" | 11
|style="background:rgb(255,255,255)" | Magic descriptions
+
| Magic descriptions
|style="background:rgb(255,255,255)" | 0x2199
+
| 0x2199
 
|-
 
|-
|style="background:rgb(255,255,255)" align="center" | 12
+
| align="center" | 12
|style="background:rgb(255,255,255)" | Item descriptions
+
| Item descriptions
|style="background:rgb(255,255,255)" | 0x28D4
+
| 0x28D4
 
|-
 
|-
|style="background:rgb(255,255,255)" align="center" | 13
+
| align="center" | 13
|style="background:rgb(255,255,255)" | Weapon descriptions
+
| Weapon descriptions
|style="background:rgb(255,255,255)" | 0x2EE2
+
| 0x2EE2
 
|-
 
|-
|style="background:rgb(255,255,255)" align="center" | 14
+
| align="center" | 14
|style="background:rgb(255,255,255)" | Armor descriptions
+
| Armor descriptions
|style="background:rgb(255,255,255)" | 0x307B
+
| 0x307B
 
|-
 
|-
|style="background:rgb(255,255,255)" align="center" | 15
+
| align="center" | 15
|style="background:rgb(255,255,255)" | Accessory descriptions
+
| Accessory descriptions
|style="background:rgb(255,255,255)" | 0x315F
+
| 0x315F
 
|-
 
|-
|style="background:rgb(255,255,255)" align="center" | 16
+
| align="center" | 16
|style="background:rgb(255,255,255)" | Materia descriptions
+
| Materia descriptions
|style="background:rgb(255,255,255)" | 0x3384
+
| 0x3384
 
|-
 
|-
|style="background:rgb(255,255,255)" align="center" | 17
+
| align="center" | 17
|style="background:rgb(255,255,255)" | Key Item descriptions
+
| Key Item descriptions
|style="background:rgb(255,255,255)" | 0x3838
+
| 0x3838
 
|-
 
|-
|style="background:rgb(255,255,255)" align="center" | 18
+
| align="center" | 18
|style="background:rgb(255,255,255)" | Command Names
+
| Command Names
|style="background:rgb(255,255,255)" | 0x3BE2
+
| 0x3BE2
 
|-
 
|-
|style="background:rgb(255,255,255)" align="center" | 19
+
| align="center" | 19
|style="background:rgb(255,255,255)" | Magic Names
+
| Magic Names
|style="background:rgb(255,255,255)" | 0x3CCA
+
| 0x3CCA
 
|-
 
|-
|style="background:rgb(255,255,255)" align="center" | 20
+
| align="center" | 20
|style="background:rgb(255,255,255)" | Item Names
+
| Item Names
|style="background:rgb(255,255,255)" | 0x4293
+
| 0x4293
 
|-
 
|-
|style="background:rgb(255,255,255)" align="center" | 21
+
| align="center" | 21
|style="background:rgb(255,255,255)" | Weapon Names
+
| Weapon Names
|style="background:rgb(255,255,255)" | 0x4651
+
| 0x4651
 
|-
 
|-
|style="background:rgb(255,255,255)" align="center" | 22
+
| align="center" | 22
|style="background:rgb(255,255,255)" | Armor Names
+
| Armor Names
|style="background:rgb(255,255,255)" | 0x4B02
+
| 0x4B02
 
|-
 
|-
|style="background:rgb(255,255,255)" align="center" | 23
+
| align="center" | 23
|style="background:rgb(255,255,255)" | Accessory Names
+
| Accessory Names
|style="background:rgb(255,255,255)" | 0x4C4B
+
| 0x4C4B
 
|-
 
|-
|style="background:rgb(255,255,255)" align="center" | 24
+
| align="center" | 24
|style="background:rgb(255,255,255)" | Materia Names
+
| Materia Names
|style="background:rgb(255,255,255)" | 0x4D90
+
| 0x4D90
 
|-
 
|-
|style="background:rgb(255,255,255)" align="center" | 25
+
| align="center" | 25
|style="background:rgb(255,255,255)" | Key Item Names
+
| Key Item Names
|style="background:rgb(255,255,255)" | 0x5040
+
| 0x5040
 
|-
 
|-
|style="background:rgb(255,255,255)" align="center" | 26
+
| align="center" | 26
|style="background:rgb(255,255,255)" | Battle and Battle-Screen Text
+
| Battle and Battle-Screen Text
|style="background:rgb(255,255,255)" | 0x5217
+
| 0x5217
 
|-
 
|-
|style="background:rgb(255,255,255)" align="center" | 27
+
| align="center" | 27
|style="background:rgb(255,255,255)" | Summon Attack Names
+
| Summon Attack Names
|style="background:rgb(255,255,255)" | 0x5692
+
| 0x5692
 
|}
 
|}
  
 +
==  The KERNEL2.BIN Archive  ==
  
== KERNEL.BIN Section formats ==
+
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 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.
 
 
 
== 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. See the section on BIN types and LZS compression later in this document for more information.
+
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.

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.