Greetings:
I'm trying to do a simple ASM hack to the GBA game Castlevania - Harmony of Dissonance.
I want to be able to change weapons each time I use a potion, high potion or elixir.
My first approach was to just replace some of the code involved in using these items:
(
NOTE: Opcodes are reversed, as they are stored that way in the ROM).
08029752,
8242 2ED2 0125 D888 1018 0880 => A07B 0130 0728 00D1 0120 A073
7BA0 LDRB R0, [R4 + #0e]
3001 ADD R0, 01
2807 CMP R0, 07
D100 BNE 000001a6 (00)
2001 MOV R0, 01
73A0 STRB R0, [R4 + #0e]
I did the above hack several years ago and worked very well. This time I wanted to keep the original code and jump to a sub routine instead.
I found lots of free space at the offset 080DADA4.
So I wanted to insert a BL at offset 0802974E
I had to modify the opcode since it made No$GBA to stop because the one I used with VBA was read as invalid. I don't understand why.
0A88 E08A => B1F0 29FB (F0B1 FB29 BL 080DADA4) (No$GBA) - B1F0 29DB (F0B1 DB29) (VBA)
080DADA4,
7BA0 LDRB R0, [R4 + #0e]
3001 ADD R0, 01
2807 CMP R0, 07
D100 BNE 000001a6 (00)
2001 MOV R0, 01
73A0 STRB R0, [R4 + #0e]
0A88 LDRH R2, [R1, #000] (Replaced instruction at 0802974E)
E08A LDRH R0, [R4, #016] (Replaced instruction at 08029750)
7047 BX R14 (Return to 8029752)
The problem I'm facing is that the jump never happens. It just continues execution at next instruction (8029752).
I tried looking for help in several documents I found in the web, with no luck. I can't figure what I'm doing wrong.
Also I searched in several trace text files, in hope to find if I'm missing some opcodes, but it seems that's not the issue.
I wanted to learn how to jump and return from subroutines to improve my GBA hacking skills.
I'll really appreciate if somebody can lend me a hand.
Thanks in advance

.
Whipon.