• Welcome to Final Fantasy Hacktics. Please login or sign up.
 
April 23, 2024, 03:52:01 pm

News:

Please use .png instead of .bmp when uploading unfinished sprites to the forum!


ASM hacking: Finding freespace (and a few other small questions)

Started by Kaijyuu, August 10, 2015, 08:13:32 am

Kaijyuu

So, I was successfully able to apply the reaction overwrite fix, but it turns out it comes with a display error: Innate reaction abilities do not show up in battle on the predicted damage window. In other words, when you target someone with an ability and they have an innate reaction, you won't be able to see any reaction ability at all until they counter you in the face. This is really only a problem for monsters, which only have reactions set as innates.

I'm not posting this in the ASM request area since I already know how to fix it. However, I don't know where to place my hijack, as it will require additional code and not just a NOP.

Here's the relevant code (SCUS_942_21):
Quote0005b848: 10400002 beq r2,r0,0x0005b854      Branch if Ability is not a reaction
0005b84c: 00000000 nop
0005b850: a4830014 sh r3,0x0014(r4)      Store Ability as Unit's Reaction Ability


I need space to add another conditional. It will fix the problem entirely to store the ability to the reaction ability slot if and only if the reaction ability slot is currently empty. This should take at least 3 more lines of code though, and I can't fit that into the routine.

So, where do I put my new code? I know in BATTLE.BIN there's the kanji space, but I dunno about the SCUS file.


Oh and some other random questions, since I'm very much new at MIPS:
- How do I know which registers are safe to use? I can see which registers the routine I'm modifying uses, but do I need to trace even further back, or can I assume things are properly preserved in the stack?
- Do I need to do anything special for absolute addressing (subroutine calls, etc)? When hacking a PSP game I had to fill out a redirect table so absolute addresses would be properly updated to their locations in RAM when the game was loaded.
  • Modding version: PSX