I'm updating my enemy HP meter patch to use the newest graphical bar routine. Every time I patch the main patch and insert uberasm tool codes afterwards, the game crashes on gamemode, due to jumping into incorrect addresses.
The uberasm code needed uses JSL to the patch code, and thats why there is a define for the addresses since they vary depending on what you patched into your game (freespace used alters this).
Here is the steps so far:
Is there a way to prevent this? I did not modify EnemyHPMeter.asm, and repatching causes asar to patch it to a different location rather than writing it in the same place the first patching. I tried to re-insert both of them to see if the addresses would sync and still, uberasm keeps moving the patch around.
Edit: I was wrong, there was an insertion error I forgot the "!" in the defines, causing asar to not insert the HP patch itself. Uberasm tool does not move patches around the ROM.
Give thanks to RPG hacker for working on Asar.
The uberasm code needed uses JSL to the patch code, and thats why there is a define for the addresses since they vary depending on what you patched into your game (freespace used alters this).
Here is the steps so far:
- Open a clean rom and saved a level using LM.
- Patch EnemyHPMeter.asm to not only have codes inserted, but also have addresses:
CodeSubrAddr_RemoveRecordEffect...................JSL $9082A7 <- use this for custom sprites (every frame) SubrAddr_LoseHP...............................JSL $9082B9 SubrAddr_DisplayHP............................JSL $9082F0 SubrAddr_GetHPPercent.........................JSL $908410
- Copy and pasted those addresses into SubroutinesLocations.asm:
Code!SubrAddr_RemoveRecordEffect = $9082A7 !SubrAddr_LoseHP = $9082B9 !SubrAddr_DisplayHP = $9082F0 !SubrAddr_GetHPPercent = $908410
- Now run UberASMTool.exe to apply the code
- Test the game to see if the game crashes, and it did.
- I re-patch EnemyHPMeter.asm to see any changes, and indeed, the code was moved:
CodeSubrAddr_RemoveRecordEffect...................JSL $909D82 <- use this for custom sprites (every frame) SubrAddr_LoseHP...............................JSL $909D94 SubrAddr_DisplayHP............................JSL $909DCB SubrAddr_GetHPPercent.........................JSL $909EEB
The code was moved not because I repatch EnemyHPMeter.asm, when debugging, uberasm code JSLs to an invalid address
Is there a way to prevent this? I did not modify EnemyHPMeter.asm, and repatching causes asar to patch it to a different location rather than writing it in the same place the first patching. I tried to re-insert both of them to see if the addresses would sync and still, uberasm keeps moving the patch around.
Edit: I was wrong, there was an insertion error I forgot the "!" in the defines, causing asar to not insert the HP patch itself. Uberasm tool does not move patches around the ROM.
Give thanks to RPG hacker for working on Asar.