Blah
Free supporter
- 1,924
- Posts
- 12
- Years
- Unknown Island
- Seen Feb 19, 2025
Ok thanks, I'll fix up those bits about ldr :). I think I'm clearer on what's happening now after rereading SQ's and your tutorials (in particular, looking at definitions and patterns of coding).
With the hook, I was worried exactly where I'd be needing it. In my head I still think in terms of scripts I'm afraid >< checking flags is easy in scripts, so I didn't see any need to hook. I think I'm going to drop the badges thing for now and instead focus on getting the change done.
So my routine so far does half it's job, once I've added the 0x5 how do I get it to store at the location? Storing at the variable seemed easy enough, but then again that's RAM location not ROM, I tried using strb to get it back to 8250cb9, but that seems illogical anyway (and didn't work).
Oh you're thinking about the problem wrong in general. Even ASM can't write to the ROM. Here's what you do:
Hook at where Cut's power is loaded (lets pretend it was loaded into r0).
So when you reach your routine, r0 will contain Cut's power. You will merely add five to r0 (for 5 extra power) and then return. This way it's like the game read Cut's power as 5 more than what it is. You don't need to store anything, you just need to modify the power and return. Simple simple :D
EDIT:
It's like this in scripting terms:
Code:
#dyn 0x740000
#org @start
setvar 0x8000 0x0
call addFive
'then game applies it's formula
end
'Think of add five as your routine. The call addFive is like the hook
#org @addFive
addvar 0x8000 0x5
return