Language…
10 users online: Darolac, howardadam1126, isaix, lean4, obiet, Oskise,  Segment1Zone2, Shiki_Makiro, SpacePea, Zavok - Guests: 254 - Bots: 316
Users: 64,795 (2,377 active)
Latest user: mathew

Does uberasm tool moves other patches around in the ROM data? [solved]

Link Thread Closed
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:
  1. Open a clean rom and saved a level using LM.
  2. Patch EnemyHPMeter.asm to not only have codes inserted, but also have addresses:
    Code
    SubrAddr_RemoveRecordEffect...................JSL $9082A7 <- use this for custom sprites (every frame)
    SubrAddr_LoseHP...............................JSL $9082B9
    SubrAddr_DisplayHP............................JSL $9082F0
    SubrAddr_GetHPPercent.........................JSL $908410
  3. Copy and pasted those addresses into SubroutinesLocations.asm:
    Code
    !SubrAddr_RemoveRecordEffect	= $9082A7
    !SubrAddr_LoseHP		= $9082B9
    !SubrAddr_DisplayHP		= $9082F0
    !SubrAddr_GetHPPercent		= $908410
  4. Now run UberASMTool.exe to apply the code
  5. Test the game to see if the game crashes, and it did.
  6. I re-patch EnemyHPMeter.asm to see any changes, and indeed, the code was moved:
    Code
    SubrAddr_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.
Link Thread Closed