Author Topic: WIKI Discrepancy and new information on KERNEL.BIN  (Read 3776 times)

_Ombra_

  • *
  • Posts: 110
    • View Profile
    • http://www.sadnescity.it
I was checking out something on the WIKI tonight about the KERNEL.BIN file format and you say that the section 3 (or the third gziped file) contains all the savemap but...

When we translated the game and had to expand the SCENE.BIN file we discovered that the file is divided in banks of 8192 bytes (0x2000). This means that if you have 5 files in the first bank, when you translate and repack them and they occupy more then 8192 bytes you have to move the last file to the beginning of the next bank and move all the files after it. To get each bank to the required bank size you just pad it with 00.

But here is the real problem. When you try to play with the modified SCENE.BIN all the battles are messed up. You are supposed to fight Ultima and the game jumps to another battle (for example).

The point is: we discovered that there is a little table in the third (3) file of KERNEL.BIN that tells us how many files there are in each bank of the SCENE.BIN file. To be exact, at offset 0x0F1C you have a 64 bytes table that goes like that:

Code: [Select]
00 0C 12 19 21 27 2D 35 3D 49 51 5A 62 69 72 7A
83 8B 94 9D A5 AB B2 B9 C1 C9 D2 D9 DE E3 E8 ED
F5 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF

This means:
Bank 1: 0x0C = 12 files
Bank 2: 0x12 - 0x0C = 6 files
Bank 3: 0x19 - 0x12 = 7 files
Bank 4: 0x21 - 0x19 = 8 files
and so on

So, by looking at the WIKI i see that:
0x0F15 to 0x0F2D = Name of location
0x0F2E to 0x0F63 = Unknown

While:
0x0F1C to 0x0F5C is that table i just described.

And btw, the file is not even as big as the WIKI say it is. Am i missing something? Am i looking at the wrong page? or did i just pointed out an error?

Hope to help.  :wink:

Akari

  • *
  • Posts: 766
    • View Profile
Re: WIKI Discrepancy and new information on KERNEL.BIN
« Reply #1 on: 2007-01-13 06:50:20 »
The most complete description of 3rd file in kernel.bin can be found here http://forums.qhimm.com/index.php?topic=5759.0

ps: Sad that this information not in wiki yet... it can be lost this way =(
« Last Edit: 2007-01-13 06:52:46 by Akari »

_Ombra_

  • *
  • Posts: 110
    • View Profile
    • http://www.sadnescity.it
Re: WIKI Discrepancy and new information on KERNEL.BIN
« Reply #2 on: 2007-01-13 14:55:56 »
Ooookkkk...

from Terence notes:
Quote
0xF1C: Scene.bin File Lookup Table - 64 bytes
            Each byte contains the ID of the first file in the specific 8192 byte block in Scene.bin
            For example, the first four bytes in this table are 00 0C 12 19
            This means that the first 8192 bytes in Scene.bin holds the compressed data for files 00 to 0B, while the next
            8192 holds the data for files 0C to 11 and so on
            Support is here for 64 blocks of 8192, and only 33 blocks are used, so there is a lot of empty space available

Looks like i discovered the hot water :-D

Btw, you guys should find somebody to update the wiki with all the new information that comes up. Even write it down as a note, it's important to keep it updated.