Author Topic: [PSX/PC] KERNEL.BIN editor - WallMarket (v1.4.5)  (Read 415659 times)

gjoerulv

  • No life
  • *
  • Posts: 1159
  • Karma: 35
  • me
    • View Profile
    • My Youtube
Wall Market, FFVII KERNEL.BIN editor
« Reply #75 on: 2008-10-21 18:38:44 »
imo the exp curve is good in FF7. Basically all curves head towards their baseline.

NFITC1

  • No life
  • *
  • Posts: 2910
  • Karma: 73
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Wall Market, FFVII KERNEL.BIN editor
« Reply #76 on: 2008-10-21 19:30:19 »
It's flag 02h of attack byte 0x1A. Here is a list of all the attacks that have that. No Enemy specific attack has it either. If it's 0 it's on and if it's 1 it's off. Kinda backwards I think, but that's the way it works. 0x1A and 0x1B of attacks have a lot of special functions.

if this flag is off - this is magic attack.

Eh? What that mean?

Akari

  • Freak
  • *
  • Posts: 764
  • Karma: 29
    • View Profile
Wall Market, FFVII KERNEL.BIN editor
« Reply #77 on: 2008-10-21 19:49:10 »
It's flag 02h of attack byte 0x1A. Here is a list of all the attacks that have that. No Enemy specific attack has it either. If it's 0 it's on and if it's 1 it's off. Kinda backwards I think, but that's the way it works. 0x1A and 0x1B of attacks have a lot of special functions.

if this flag is off - this is magic attack.

Eh? What that mean?

I'm sorry 0x0004 is magic attack. But it's seems very stupid. Almost all attacks has it, but it removes from code if upper damage function is 0,1,3,6,a or b. FFVII very puzzled.

NFITC1

  • No life
  • *
  • Posts: 2910
  • Karma: 73
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Wall Market, FFVII KERNEL.BIN editor
« Reply #78 on: 2008-10-21 21:13:25 »
Are you talking about the way the attack data is stored or how it's used in the battle? And what are you calling upper damage function?

Akari

  • Freak
  • *
  • Posts: 764
  • Karma: 29
    • View Profile
Wall Market, FFVII KERNEL.BIN editor
« Reply #79 on: 2008-10-22 02:29:49 »
Are you talking about the way the attack data is stored or how it's used in the battle? And what are you calling upper damage function?

There are two damage functions that called during damage calculations. They are defind by damage function id byte in attack and weapon data. For example for most of weapons there is 0x11 damage function id. This give us upper four bits as upper damage function 0x1 and lower four bits as lower damage function 0x01. More info to come =)

Rufus95

  • Cool newbie
  • *
  • Posts: 97
  • Karma: -1
  • ....
    • View Profile
Wall Market, FFVII KERNEL.BIN editor
« Reply #80 on: 2008-10-29 19:19:40 »
thankyou I've been looking for a kernel.bin editor

NFITC1

  • No life
  • *
  • Posts: 2910
  • Karma: 73
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Wall Market, FFVII KERNEL.BIN editor
« Reply #81 on: 2008-10-30 17:48:28 »
Q: Hey there NFITC1! We haven't heard from you about this in a while. Have you got any updates to WallMarket?

A: Not quite yet. I'm re-writing the entire thing in VB9 (or VB2008 if you want to call it that). Among some speed and possibly size issues, this will eliminate the dependency on the comdlg32.ocx ActiveX control (which I never liked about VB6).

Q: Sweet! Will anything be added/changed?

A: Oh, maybe one or two things and a misspelling or two.

Gingercat

  • Cool newbie
  • *
  • Posts: 62
  • Karma: 0
    • View Profile
Wall Market, FFVII KERNEL.BIN editor
« Reply #82 on: 2008-10-31 00:24:15 »
Again I say: Awesome :lol:

Leaps and bounds forward.

NFITC1

  • No life
  • *
  • Posts: 2910
  • Karma: 73
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Wall Market, FFVII KERNEL.BIN editor
« Reply #83 on: 2008-10-31 06:14:35 »
As awesome as it looks, I've hit a really strange snag.

First off, the LZS compression is really weird. I just spent the last 20 minutes trying to figure it out. It doesn't seem that hard, but it's still not going to be a simple thing. However, I never learned how to compress things. Can anyone teach me how compressing works? Else we're going to end up with an uncompressed kernel2.bin, which would be easier on me at least. :)

Secondly, and most importantly, in the KERNEL.BIN for the PSX there are some weird goings on with the descriptions and names. There seems to be a function, F9h, that takes a single byte argument that somehow references what it has already written. As an example, here's the description (raw and decoded) for Poison Ring (begins at offset 0:94 and is entry index 7):

Code: [Select]
24 52 41 49 4E 53 00 3B 30 4F 49 53 4F 4E 3D 00 41 54 54 41 43 4B 53 0C 00 50 52 4F 54 45 43 54 53 00 41 47 F9 21 54 F9 A0 3D
 D  r  a  i  n  s     [  P  o  i  s  o  n  ]     a  t  t  a  c  k  s  ,     p  r  o  t  e  c  t  s     a  g ** ??  t ** ??  ]

There at the end are two "text calls". The first, F9h 21h, references "ains" from the word "Drains" (offset 0:96) to complete the word "against". The second one, F9h A0h, references the "[Poison" (offset 0:9B) at the beginning. It's likely that this "text call" can only return up to eight characters or else it could have retrieved the nine characters that make up the first "[Poison]" instead of leaving the "]" on at the end.

This happens a LOT in all the FFText files of the KERNEL. It doesn't have to reference just its entry. Quite often it will reference an entry several indexes back. Can anyone explain just how it's coming up with this?
« Last Edit: 2008-10-31 12:06:03 by NFITC1 »

dziugo

  • No life
  • *
  • Posts: 1474
  • Karma: 3
    • View Profile
    • A new copy of FF7 thanks to Salk. Pack (zip/rar/etc) your saved game before sending it to me.
Wall Market, FFVII KERNEL.BIN editor
« Reply #84 on: 2008-10-31 16:49:37 »
Just a blind guess:
0x21 -> 00100001b -> 00 | 100001
0xA0 -> 10100000b -> 10 | 100000

First two bits:
00 - copy 4 bytes
01 - copy 6 bytes
10 - copy 8 bytes
11 - copy ?10? bytes
It starts at 4 bytes, because the special command already occupies 2 bytes, so if you'd want to copy only 2 bytes, you could just aswell write them to the output as regular characters.

The remaining 6 bits:
100001b is 0x21 (or 33 decimal) and the 'ains' string is exactly 34 bytes from the 0xF9 character
100000b is 0x20 (or 32 decimal) and the '_[Poison' string is exactly 33 bytes from the 0xF9 character
The deltas are decreased by 1 because it would make no sense to reference text zero bytes from the current offset.

Again, just a blind guess. You're better off asking Akari for help, as he is the master of the PSX version disassembly.

Akari

  • Freak
  • *
  • Posts: 764
  • Karma: 29
    • View Profile
Wall Market, FFVII KERNEL.BIN editor
« Reply #85 on: 2008-10-31 16:55:05 »
Topic about text in kernel

http://forums.qhimm.com/index.php?topic=6878.0

Compression.
Code: [Select]
            temp = file->GetU8(offset);

            if (temp == 0xF9)
            {
                // simple string compression, reference an earlier substring
                ++offset;
                int dist  = (file->GetU8(offset) & 0x3F) + 2;

                int count = (file->GetU8(offset) >> 6) * 2 + 4;
                for (int k = 0; (k < count) && (file->GetU8(offset - dist + k) != 0xFF); ++k)
                {
                    name.push_back(file->GetU8(offset - dist + k));
                }
            }

NFITC1

  • No life
  • *
  • Posts: 2910
  • Karma: 73
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Wall Market, FFVII KERNEL.BIN editor
« Reply #86 on: 2008-10-31 20:08:06 »
Once again, that was marvelously helpful! Because of it, the accessory descriptions are now displaying correctly. Also, I now have a (more or less) complete mapping of FF7's font.

More than ever I wish I had a wiki account because I'm always seeing small errors all over the place. There's an error on the LZS description page's example that had me scratching my head for several minutes. Almost all the sections to the kernel's contents are wrong or are lacking in information to some degree.


EDIT: I don't remember this ever said in the game. :)
« Last Edit: 2008-11-02 15:34:39 by NFITC1 »

BlitzNCS

  • Freak
  • *
  • Posts: 891
  • Karma: 2
  • Master of nothing in particular
    • View Profile
    • My Youtube
Wall Market, FFVII KERNEL.BIN editor
« Reply #87 on: 2008-11-02 15:46:16 »
I don't remember this ever said in the game. :)


those look like 2 letter refferals to bigger words. for instance "At" being attack? who knows :P

NFITC1

  • No life
  • *
  • Posts: 2910
  • Karma: 73
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Wall Market, FFVII KERNEL.BIN editor
« Reply #88 on: 2008-11-03 00:57:25 »
those look like 2 letter refferals to bigger words. for instance "At" being attack? who knows :P

It looks more like two character references to elements and statuses:
Code: [Select]
Fr - Fire
Ic - Ice
Lt - Lightning
Et - Earth
Ps - Poison
Dm - Gravity? (Dark matter?)
Wt - Water
Wi - Wind
Hl - Heal/Holy (could be either, I'm betting on Holy)
Dt - Death
Re - Regen
Sp - Sleep
Po - Poisoned
Sd - Sadness
An - Fury (Angry?)
Cn - Confuse
Si - Silence
Fa - Haste
Sl - Slow
St - Stop
Td - Toad
Mn - Mini
Sn - Slow-Numb
Dg - ?
At - Barrier (Attack Def?)
Mg - MBarrier (Magic Def?)
Rf - Reflect
Ab - ?
Gd - ?
Cn - ?
Mn - Manipulate
Bs - Berserk
No - Peerless (No damage?)
Pl - Paralyze
Dk - Darkness

Some statuses are missing and they aren't in order nor are they unique. I'm not sure they really serve a purpose...

UPDATE:
Here're some features planned for WallMarket.NET 1.0:
  • Immediate switching from PC to PSX names/descs and saving/compiling of same. (successfully working already, but kernel2.bin gets larger cause I have no idea how to compress it. :) Should still work either way.)
  • Can edit any of the text or battle data sections (still working on battle growth and initial data, that will be versions 1.1 and 1.2)
  • Editing any part of the raw data, even battle data not shown directly in the editor! This includes inserting special characters into names/descs. (Mostly working)
  • All the original features from WallMarket 0.9.29 :D (No longer working on this version. It will become legacy soon enough.)

I'm estimating this will take a week at least. I have to rebuild the interface mostly from scratch, but I have all the code still written (though some will have to go through re-writes since this is in a different language). Donations are still welcome, but not required. ;)

EDIT: I had an epiphany about what is currently labeled as "status chance" (0x11 of the attack data). It is split into three sections:
80h: remove status if inflicted, inflict at (chance/63)% success rate
40h: remove status if inflicted with (chance/63)% success rate
20h - 00h: (0 - 63/63) % chance of inflicting indicated status(es)

I don't think I would have noticed this if Frog Song hadn't been BFh while Toad/Mini is just 92h. Toad will miss, but Frog Song will Inflict and Remove Frog and Sleep from a target without missing (as long as the target CAN be frogged/sleeped of course). Learning this kinda made me want to turn on the "ignore status def" of Frog Song and cast it on Safer Sephiroth. :D

RE-EDIT: Forget what this sentence was before. Someone did something about it and it is no longer valid. Thanks to whomever it was. :D
WallMarket.NET will not enforce materia links like WallMarket 0.9.x does. I didn't like doing that, but I didn't ever test it before. Now that I have I discovered that Materia Slots 01h and 04h are empty single slots. To my knowledge, these do not appear in the game anywhere. Only the Ultimate Weapons are no-growth and they are all 8-linked slots (except Aeris's which is 6-L 1-U and normal growth). I just realized that the Gigas Armlet has 0 growth and a 2-L 1-U slots. So this will the only item in the game with a Materia Slot of 01h. These empty ones are just cosmetic as a materia can still gain triple AP in an empty slot.
I played around with some links and it seems like they only work if the odd-numbered slots are linked to the right and the slot they are linked to links to the left:

O O==O O <--- looks fine, but does not work

=O =O O O <-- looks odd on the left, also does not work

O O O==O <-- works just fine

If I put non-support materia in those link slots they work fine and their effects show up in battle. Any value higher than 7 just seems to create unlinked slots. They work fine too.
« Last Edit: 2008-11-10 21:30:09 by NFITC1 »

The Seer of Shadows

  • No life
  • *
  • Posts: 1146
  • Karma: 0
  • I used to be indecisive. But now, I'm not sure...
    • View Profile
Wall Market, FFVII KERNEL.BIN editor
« Reply #89 on: 2008-11-08 10:45:25 »
This is kind of off the topic of materia slots, but it still classifies as kernel.bin editing.

So I used the information of the Mega All materia to make a "Mega Quadra Magic" materia.  I selected "34" as the materia type, "99" as the materia type attribute [1], and "1" to "5" as the materia type attributes [2] to [6] respectively.  When I tried it in battle, however, it worked perfectly, but as a Mega All materia, not a "Mega Quadra Magic" materia.  And I swear, I did everything perfectly.

I'm thinking that materia type 34 is just for Mega All, but so far, I've only tried out "Mega Quadra Magic" (theoretically, it should also work with Final Attack and maybe other things, as "All", "Quadra Magic", and "Final Attack" are all of the materia type "35").  I might come up with something later.

Until then, does anyone have any answers?  (Or is my guess correct?)  Anyone?

Cheers!

Kudistos Megistos

  • Banned
  • No life
  • *
  • Posts: 3936
  • Karma: 1
    • View Profile
Wall Market, FFVII KERNEL.BIN editor
« Reply #90 on: 2008-11-08 13:13:32 »
A lot of things are hard-coded into the game (as I found when trying to play with the amount of summons the player could perform with different materia levels). Perhaps quadra magic is hard-coded the same way. I'll try this today and I'll see what happens.

EDIT: I've just tried this. Didn't work for me either. Looks like materia type 34 can only do "all" (unless I'm doing something wrong as well).
« Last Edit: 2008-11-08 15:11:39 by Leighos Kudistos Megistos »

ModHelp

  • Cool newbie
  • *
  • Posts: 79
  • Karma: 0
  • WAKKA
    • View Profile
Wall Market, FFVII KERNEL.BIN editor
« Reply #91 on: 2008-11-08 15:07:43 »
thanks dude ive been wanting a kernel bin editor for a while now

thanks

Akari

  • Freak
  • *
  • Posts: 764
  • Karma: 29
    • View Profile
Wall Market, FFVII KERNEL.BIN editor
« Reply #92 on: 2008-11-08 16:24:37 »
Weapon and armor slots parsed by pairs so you cant link 1 and 2 slot, only 0-1 2-3 4-5 6-7
Slot types only checked as is
Code: [Select]
if ((slot1 == 2 && slot2 == 3) || (slot1 == 6 && slot2 == 7)) // if linked
{
    [SP + 10] = w(S1);
    A0 = materia1_data;
    A1 = materia2_data;
    A2 = S3;
    A3 = S4;
    system_add_pair_materia_unordered();
}

About megaall. Materia with type 0xX4 ignored during all parse (pairead and single) and only used in special megaall parse function. It doenn't matter if you set type to 0x44 or 0x94. It check lower 4 bits.
And mega all doesn't use any other info in data exept exp needed for materia grouth. It calculate number of activated stars and add this number to all atributes for activated magic, attacks. Many materias work this way.
« Last Edit: 2008-11-08 16:26:24 by Akari »

NFITC1

  • No life
  • *
  • Posts: 2910
  • Karma: 73
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Wall Market, FFVII KERNEL.BIN editor
« Reply #93 on: 2008-11-08 19:32:16 »
About megaall. Materia with type 0xX4 ignored during all parse (pairead and single) and only used in special megaall parse function. It doenn't matter if you set type to 0x44 or 0x94. It check lower 4 bits.
And mega all doesn't use any other info in data exept exp needed for materia grouth. It calculate number of activated stars and add this number to all atributes for activated magic, attacks. Many materias work this way.

This is, indeed, the most unfortunate setback. It looks like the developers just copied the All materia and changed that type and the AP leveling requirements while making a dedicated function to handle type X4h. Perhaps this saved a few flops during processing, but I doubt it would have been significant. A Master-Steal-As-Well would have been good.

Akari

  • Freak
  • *
  • Posts: 764
  • Karma: 29
    • View Profile
Wall Market, FFVII KERNEL.BIN editor
« Reply #94 on: 2008-11-08 19:59:47 »
About megaall. Materia with type 0xX4 ignored during all parse (pairead and single) and only used in special megaall parse function. It doenn't matter if you set type to 0x44 or 0x94. It check lower 4 bits.
And mega all doesn't use any other info in data exept exp needed for materia grouth. It calculate number of activated stars and add this number to all atributes for activated magic, attacks. Many materias work this way.

This is, indeed, the most unfortunate setback. It looks like the developers just copied the All materia and changed that type and the AP leveling requirements while making a dedicated function to handle type X4h. Perhaps this saved a few flops during processing, but I doubt it would have been significant. A Master-Steal-As-Well would have been good.

Maybe it was in design document but they didn't make it in time, or they deside that this is not need for game. Anyway we may add all this features in Q-Gears as anyone needs them to use ingame. For the editor I think you could make this fields not editable. Just "megaall type", exp and stats boosting.

adventsoldier

  • Fast newbie
  • *
  • Posts: 37
  • Karma: 0
    • View Profile
Wall Market, FFVII KERNEL.BIN editor
« Reply #95 on: 2008-11-08 20:24:55 »
sweet.. i'm gonna modify mah buster sword lol. awesome stuff!

NFITC1

  • No life
  • *
  • Posts: 2910
  • Karma: 73
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Wall Market, FFVII KERNEL.BIN editor
« Reply #96 on: 2008-11-09 02:15:30 »
Maybe it was in design document but they didn't make it in time, or they deside that this is not need for game. Anyway we may add all this features in Q-Gears as anyone needs them to use ingame. For the editor I think you could make this fields not editable. Just "megaall type", exp and stats boosting.

I don't see any reason to make them not editable (it's annoying to make exceptions like that anyway), but I will have to make a note about materia types X4h in the description saying they have no effect. I'll do the same with the summon materia saying that modifiers 2-6 have no effect. There just are a lot of exceptions to these modifiers. Several effects (through modifier 1) don't take certain parameters either. If Steal As Well has a non-0 modifier it will always modify as many times as it wants regardless of what the materia type is (either 25h and 35h). Materia is one of those things I have little actual data on and I'm just basing it on observation of existing combinations. Changing these often doesn't work. :(

Kudistos Megistos

  • Banned
  • No life
  • *
  • Posts: 3936
  • Karma: 1
    • View Profile
Wall Market, FFVII KERNEL.BIN editor
« Reply #97 on: 2008-11-09 02:36:02 »
Quote from: Akari
Anyway we may add all this features in Q-Gears as anyone needs them to use ingame.

Interesting. How mod-able is Q-Gears likely to be? Will we, for example, be able to change things like what 34h does, as well as which materias have it?

Akari

  • Freak
  • *
  • Posts: 764
  • Karma: 29
    • View Profile
Wall Market, FFVII KERNEL.BIN editor
« Reply #98 on: 2008-11-09 15:36:03 »
Quote from: Akari
Anyway we may add all this features in Q-Gears as anyone needs them to use ingame.

Interesting. How mod-able is Q-Gears likely to be? Will we, for example, be able to change things like what 34h does, as well as which materias have it?

This thing isn't completly understood so I cant tell how it will be done. Most likely there will be hardcoded materia types. Maybe it will be in LUA. In any case there won't be hardcoded materia ID or anything like this.

NFITC1

  • No life
  • *
  • Posts: 2910
  • Karma: 73
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Wall Market, FFVII KERNEL.BIN editor
« Reply #99 on: 2008-11-17 19:53:00 »
Rejoice with me. I have successfully (and I believe accurately) created a working kernel2.bin file from scratch! Well, scratch in the sense that I extracted it the original and then re-compressed it. I emailed Ficedula for help (rather bluntly) but he hasn't gotten back to me so I tackled it on my own. Fun thing is, it is the exact size of the original kernel2.bin even though the contents are different from the original, I can see this with a Hex editor, but it functions identically. Now all that's really left to do is to is learn how to encode the PSX text (probably not as hard) and get it all saving everything and version 1.0 will be ready to be released.

I wasn't able to show this earlier because imageshack was acting up (That is Bahamut ZERO's attack which WAS named "Tera Flare" that he's about to perform).

EDIT: I would also like to add that the one that the one I can make is actually SMALLER than the delivered one. Why? Because there are objects (especially weapons and armors) that have no description. The way the file is formated, it has a bunch of pointers at the beginning of the file that points to the start of the description. During the original file's creation, if an object's description is blank it adds a terminator to the data and moves on. What I did was reference the previous terminator instead of add a new one. This saved a total of 493 bytes all together (I COULD potentially make my file even smaller and save more space, but it works as it is so I don't want to tempt fate), but that's that many more that you can use to change things around. :)

RE-EDIT: .NET actually has a GZip stream to work with! Unfortunately, it only uses the basest of compression levels (1) where KERNEL.BIN uses the highest (9). Since there's no way to change this (at least not without paying someone) we're still restricted to using an external gzip program to remake KERNEL.BIN. Expect version 1.0 to be released later this month (by the end of the week maybe). All that's left is to recompress the KERNEL.BIN's text the way the PSX has it. This is a modified version of the LZS so it shouldn't pose to great a challenge since I have that tackled.
« Last Edit: 2008-12-02 19:34:11 by NFITC1 »