11 March 2016 - Forum Rules

Main Menu

HatZen08 Bug Tracker

Started by HatZen08, December 29, 2012, 02:53:58 PM

Previous topic - Next topic



   If you have found a bug in HatZen08 patches, you can post it in this thread. If confirmed, it will be added in a log for future reference. Hopefully, it will help to track and fix bugs in the patches. You can also discuss future updates to the patches.


I have been using your recent FF6 patches (Lucky Slot and Runic Forever)

No issues so far in the builds i have been using. Ill be sure to update you if that changes.  I love seeing new content made for FF6 so thank you!


From Gi Nattak (Guest Adder Patch):

Gi Nattak: There's a bug in the patch's code I found while testing this patch that affects the Paladin Shield - it makes it act like a 'Guest Adder' item (like the creator's example item: 'Leo Doll'). I'd really like to contact the patch creator about this instead of write a review about it, but there seems to be no contact info for the person. Hopefully this will catch his attention and he can fix the issue in a 1.1 patch.

From HatZen08:

The code is triggered by a specific flag in the item database. I presumed it was unused and unset in all items. I was wrong. The Paladin Shield has the flag set by default.

I will fix it later. Thank you for the feedback.

Note: I couldn't contact you either. You can post in this thread if you need to contact me.

Gi Nattak

Hey there HatZen. I'm glad to see this thread here, I was hoping to get a hold of you somehow! =)
That's great news about fixing up the Guest Adder patch, it's a very fun patch. All your patches are really neat, keep up the good work - and thanks for breathing some fresh life into the FFVI hacking scene. :beer:


(Fair Hit patch)

Came across a rough code review for this patch, comparing it to Terri Senshi's Evade bug fix. Posting it here in case it is helpful.


Terii's is a bugfix.  it makes Evade work, and it activates all the code that was skipped as a result of the Evade Bug (e.g. Beads reducing hit rate).

HatZen08's fixes that bug, and also has a bit of a re-envisioning.  it apparently gives Reflect status priority over Clear.  also, it majorly changes L.X spells.  they'll end up with 255/Level_multiple as a hit rate.  however, because he never clears the top half of A before this division, the results might be gibberish.  also, with general attacks, he seems to use target Evade or MBlock as the hit rate, ignoring the attack's hit rate entirely.  that really makes no sense, so maybe i'm misunderstanding something.

Also, I sent you a personal message regarding the SwordTech Ready Stance patch.

I agree with Gi Nattak, your patches are very cool in scope! Thanks for sharing them with the community!


I successfully patched a clean FF6 rom with the hack Final Fantasy 6:Strategic Battle. Whenever I choose Sword Tech the game freezes. The music still plays but the guage for sword tech does not fill and there is no option for me to choose. If I am doing something wrong, please let me know.

EDIT: Also thank you for the work you have put into these hacks :)


There are two versions of this game for English. The differences between them aren't noticeable for the player but they have smaller differences in their code.

The patch is a set of patches aimed for the version 1.0 of the game. For the version 1.1, there are patches that won't work correctly.

I did a quick test in the version 1.1 of the game and the Sword Tech Ready Stance patch doesn't work. The game freezes when you select the Sword Tech command and the gauge never fills. It is similar to the description of the bug you have found. However, there are other patches that work correctly in the version 1.1.

I believe you used the version 1.1 instead of the version 1.0. Please, check if you used the correct version of the game.

Gi Nattak

Hi HatZen. The Half Health Warning patch seems to be conflicting with some other patch I've used, so I was hoping I could move the data somewhere else, like I did with Guest Adder, but there was not the usual readme document that are in your other patches that show what you did. Could you say the addresses here, or maybe update the patch with the document showing your asm work?


I forgot to include the source file. I will submit an update with it included.

In summary, the original code loads the maximum HP of the character and divide it by 8 using three LSR instructions. The resulting value is compared with the actual HP of the character. The near death flag is set or unset based if the actual HP of character is below 1/8 of max HP.

The patch nulls two of the three LSR and replaces them with two NOP instructions. Instead of 1/8, now it uses ½ of max HP.

Original code:

C2/4536  B9 1C 3C LDA $3C1C,Y load max HP
C2/4539  4A LSR divide by two (now 1/2)
C2/453A  4A LSR divide by two (now 1/4)
C2/453B  4A LSR divide by two (now 1/8)
C2/453C  D9 F4 3B CMP $3BF4,Y compare current HP
... The following code set or unset the near death flag based in the result.

Patch changes:

C2/453A EA NOP
C2/453B EA NOP


Stupid question, but how you tell if a ROM is "clean?"

Game: Final Fantasy III (U)
Emulator: ZSNES 1.51
Patch: Final Fantasy 6: Strategic Battle (1.0)

I am using a non-interleaved NTSCU ROM (A27F1C7A) with LunarIPS to patch. However, once the game is loaded, it will hang after the title screen fades out.



like the webpage where you found the patch says, the ROM needs a header.  that CRC32 is right for v1.0.

Gi Nattak

About the Guest Adder patch - version 1.0 as I recall, the character selection special field was done by changing some attributes in the item itself, and now I see version 2.0 of the patch has it now so where the changing of the character is done by the extra hp and extra mp in the actor editor. What was the reason for that change? Was it due to the Paliden Shield issue? I preferred the other way just because I do find a little use for the extra HP and MP in the 1st half of the game.

And just to make real sure, with this code the extra HP and MP will no longer work?



For compatibility issues, I choose to use only the startup actor data. The item data won't be used.

Because of technical issues, the calculation of HP and MP doesn't follow the traditional game engine approach. The extra HP and extra MP fields aren't used in the HP or MP calculation. It includes versions 1.0 e 2.0.

Gi Nattak

Quote from: HatZen08 on June 21, 2013, 09:10:56 AM
For compatibility issues, I choose to use only the startup actor data. The item data won't be used.

Because of technical issues, the calculation of HP and MP doesn't follow the traditional game engine approach. The extra HP and extra MP fields aren't used in the HP or MP calculation. It includes versions 1.0 e 2.0.

I'm curious, what were the compatibility issues?
And are you saying that in version 1.0 of this patch the extra HP and MP fields have been dropped also?

I'd really, really love to use this patch, but as it is I just can't bare to sacrifice the extra HP and MP fields for my hack :'( Unless there's another way to give characters extra HP and MP upon startup...? (not by equipment)


I'm curious, what were the compatibility issues?

In the version 1.0, the Guest Adder patch checks specific flags in the items. If the item is used and the flags are set, the guest character is added to the party. To work correctly, the flags must be set or unset accordingly to every item. If the item is a guest adder item, the correct flag must be set in the item. If the item is a common one, the flag must be unset in the item. It must be correct to all items in the game.

In the item database, I wrongly assumed all the flags for the patch activation were unset, for all items. Unfortunately, it wasn't the case. The Paladin Shield item has the flag set by default and wrongly activates the patch when used as a item. It may be possible another items unexpectedly have the activation flag set by default.

To avoid unexpected activation of the patch for unexpected flags which wrongfully are set, I choose to use only the start-up actor database. The activation of the patch (in version 2.0) is based only in two fields of the guest characters. It is better than check every item to discovery if the flags are correctly set or unset.

And are you saying that in version 1.0 of this patch the extra HP and MP fields have been dropped also?

Yes. The calculation of HP, MP and Exp for the guest character is different from the official ones.

In the traditional HP calculation, a list of additional HP by level is used. Every level is associated with a HP value. The base HP (without equipments or special effects) is calculated by the sum of all designated HP for every level lower than the actual character level. As example, suppose the list is:

100 Level 1
200 Level 2
300 Level 3
400 Level 4
500 Level 5

The HP for level 5 is the sum of the levels 4 (400), 3 (300), 2 (200) and 1 (100). It is 1000.

The extra HP field is added to the sum. If the value of the extra HP field is 100, the base HP value will be 1100.

The same procedure is used for MP and Exp calculation, with different lists with different values. The HP and MP list are 16-bits values and the Exp list is 24-bits values.

The Guest Adder patch finds the average level of all encountered official characters. After it is calculated, a official character near the average level is selected. The HP, MP and Exp values are copied from the selected character to the guest character.

This may look a lazy approach. However, the lists of HP, MP and Exp are fixed. All characters gains the same amount of HP by level. Unless I am mistaken, without the interference of Espers boosts and the extra HP field, two characters with the same level have the same HP value.

The extra HP field is only one byte and can only add the maximum value of 255. The maximum value of HP is 9999 and the extra HP value is too low to be significant in the HP calculation. The maximum value of MP is 999 and the extra MP (maximum of 255) may be significant. However, guest characters can't use magic and it renders the MP value almost useless. I used the extra HP and extra MP fields as data storage for the patch configurations. I believe it is more useful than its original purpose.

I'd really, really love to use this patch, but as it is I just can't bare to sacrifice the extra HP and MP fields for my hack  Unless there's another way to give characters extra HP and MP upon startup...? (not by equipment)

Official characters use the original calculation of HP/MP values. The extra HP and extra MP fields are used. Only the characters created with the guest adder items use different HP/MP calculations.

I am open to suggestions of HP, MP or Exp calculations for the guest characters. If it has valid points, I can change the actual approach and eventually update the Guest Adder patch.

If you are comfortable with the actual approach for HP/MP calculation, it shouldn't be difficult to add a fixed value for HP or MP after it is calculated. If it is the case, I can implement it in the next update of the Guest Adder patch.

Gi Nattak

Ohhh, so the fields only change for the Guest Characters, actors 48 and 49?!?!
Perfect, no problem at all then! I thought it took out the Extra HP and MP feature for all the actors >_< Good stuff, and thank you very much for the detailed explanation.

Thank you, and keep up the good work =)

July 12, 2013, 07:30:28 PM - (Auto Merged - Double Posts are not allowed before 7 days.)

Everything works great with the Guest Adder. The only issue I see, and it's purely cosmetic, is that in Cyan's Dream, if the Guest character is one of the characters after the Imp and in the lead spot, they get their graphic distorted while walking around in the Magitek Armor, due to them not having riding sprites.. this also goes for the Chocobo riding, but I edited that one's event to switch characters if guest is in the party.

Anyways, I'm 99% sure there's nothing you can do about this aside from hacking in riding sprites for them, so it's a moot point.

I suppose if one was really perturbed about it they could assign the guest adder items after that event, but overall its no biggie.

Love the patch!


Subject: Imbued Magic patch


I am developing a new patch called "Imbued Magic" patch. In summary, the availability of the spells in the magic command will be determined by the character equipment. It includes all equipable items and espers. If the equipment teaches a spell, it will be automatically enabled in the magic menu. Otherwise, it will be disabled. It is an alternative for the current magic system.

Unfortunately, it is a complex patch which required changes to the game engine. I won't annoy you with the details, but it wasn't smoothly. Because it is somehow complex, I am releasing a beta patch for beta testing. If someone is interested, the patch and the code can be downloaded here .

Please, note that summon, magic and lore spells are affected by the patch. They are managed  together by the game engine. Also, the field menu and the combat menu are different and they use different codes.

Two issues still need to be fixed: The cursed shield exchange after 256 battles and the magic command for the guest characters. For now, they don't work correctly. I will try to fix them later.

Thank you for your attention.

Gi Nattak

This looks to be a really awesome patch HatZen! Great job. I will be happy to give it a try here and help test it out.

This patch doesn't use up any "free space" either, unless I'm mistaken - it only alters pre-existing code?


The beta version code doesn't use the free space regions in the rom, like from C2/A65A to C2/A7FF, C2/FAA4 to C2/FC6C and C3/F091 to C3/FFFF. I removed the code related to the old magic system and replaced it with the new one.


I'm unable to get the SwdTech Ready Stance patch to work. Which version of the game is it for? There is no information given on the RHDN page, nor the readme files.