Coding Questions and other Quandaries
#2
EDIT

The address for the stw instruction changes too? That's odd. I'm guessing the game uses some relocatable module of some sort. Still try out what I crossed below just in case as the way you are writing your source out is incorrect.

Code:
80E9AA08 stw r3, 0x0014 (r29)

This instruction is storing the Health (what's in r3) to its designated spot in dynamic memory. That spot is at r29 + 0x0014. Thus the value of r29 itself is a dynamic memory address. This is why you are having different mem91 addresses.

What's good though is that r29+0x0014 will always point to where the Health is at. Regardless of what r29 is at the time. What you need to do is modify what's in r3 before it gets stored to dynamic memory.

So like this...

Code:
li r3, 0xC8 #Set custom Health amount
stw r3, 0x0014 (r29) #Default Instruction, Health gets stored to Dynamic Memory
Reply


Messages In This Thread
RE: Coding Questions and other Quandaries - by Vega - 12-06-2021, 12:47 AM

Forum Jump:


Users browsing this thread: 2 Guest(s)