A couple ROM hacking questions


#1

I’m making a humble starter ROM hack of FE8 for my friends and I, and I will have some noobish questions for all of you experienced ROM hackers on these forums. I can use EA to some extent as well as FEditor and FEBuilder. I appreciate the assistance!

I only have one question for starters: looking at the weapon stat bonuses in a couple editors, it looks like they are unsigned bytes. I would like to make a weapon that imposes a stat penalty instead of a buff. How would I go about doing this? I know debuffs are possible since circleseverywhere’s skill system makes use of them.


#2

In the skill system 0xFF in the weapon’s stat boosts will be -1, I don’t know if this is the case in vanilla or not since the skill system uses Stan’s modular stat getters


#3

Thanks. To clarify, if I want to give a weapon -3 DEF for example, how would I go about it in FE Builder for starters? Or would I need to use NMM or EA instead?


#4

If SkillSystems can take a value with signed on stat booster,
Please enter the value in 2’s complement on the stat booster screen of FEBuilderGBA.

Since vanilla ROM can not use a negative statbooster, this item is supposed to be entered with byte (unsigned char).

255 == 0xff == -1.
254 == 0xfe == -2.
253 == 0xfd == -3.

For detailed calculation method, please see the literature describing 2’s complement.



#5

From FEBuilderGBA ver 20180316.06, using the MOD system,
when skill system expansion is included, support Negative number.

Whether the skill system is valid or not is determined by the following address.

IF:0x0800=0x0 0xC0 0x9F 0xE5 0x1C 0xFF 0x2F 0xE1 0xA1 0xD8 0xB4 0x8
or
IF:0x0800=0x0 0xC0 0x9F 0xE5 0x1C 0xFF 0x2F 0xE1 0x5 0xDE 0xB4 0x8

I do not know where the routine supports negative stats booster,
so it is determined by the presence or absence of a skill system.


#6

Item Stat bonuses are already signed in regular FE8 (or at least FE8U), nothing to do with the skill system (the skill system may or may not be responsible for making them display properly, however).

For example, here’s the loading asm for the power bonus:

ldrb r0, [r0, #1]
lsl r0, #0x18
asr r0, #0x18

After loading the bonus value, it’s sign-extended, effectively making it signed.

Here’s a list of reference function addresses (FE8U):

  • GetItemHealthBonus : 080163F0
  • GetItemPowerBonus : 08016420
  • GetItemSkillBonus : 08016450
  • GetItemSpeedBonus : 08016480
  • GetItemDefenseBonus : 080164B0
  • GetItemResistanceBonus : 080164E0
  • GetItemLuckBonus : 08016510

(They all do the same sign extension trick)

Also you’ll note that there’s no such thing as mov & con stat bonuses from items (or at least they do no work) (again, in the vanilla game).


#7

Very informative, thanks!


#8

Another question, this time about staff range. I am using the EA-based freerange hack by StanH to display non-conventional weapon ranges. This works for everything I’ve tried so far. However, I am having problems with the offensive staff weapons. I want to reduce the range of Sleep, etc. but balance this by giving them more uses. When I set the range of Sleep to 3, it correctly displays the colored squares for 3 range, but the actual range that you can target units with is unchanged. I assume that this means the staff range is hardcoded somehow. After poking around, I found an FE8 staff range fix by Tequila here:

However, this appears to duplicate a lot of the functionality of StanH’s freerange patch, so I am reluctant to install it on top of it. I am also too noobish to know how to take only the staff range unlock features from it. If someone could point me in the right direction for how to alter the range of offensive staff items, I would very much appreciate it! Thanks.