Logging game events to text file
#14
(03-12-2024, 09:13 PM)Vega Wrote: The issue I think you're having is assuming this r23 + 0x0020 address is some sort of constant. It's not. The address number itself varies.

Yes, this was absolutely a misconception on my part.  I get it now, the address is always different but the equation to find the address stays the same.

(03-12-2024, 09:13 PM)Vega Wrote: You should see this instruction:
lwz r31, 0x008C (r3) # This is loading some value from dynamic memory into r3.

Is it loading from dynamic memory into r3 or into r31?  I'm still new to this but I thought the destination register came first, which would mean it's loading from dynamic memory into r31.

(03-12-2024, 09:13 PM)Vega Wrote: Since the original instruction loads the Item Value from r3 + 0x008C, we can conclude that....
Item Value is located at r3 + 0x008C
Item Number is located at r3 + 0x0090

So, if I'm understanding you correctly, we need to write ASM code that will figure out what value is at r3 + 0x008C, and store it in a register.  I'm guessing this will look something like the default instruction: 
lwz r31, 0x008C (r3)
Unless...that part is already happening, because it's the default instruction?  But it doesn't seem to be, since r31 doesn't seem to ever contain anything that looks like the item codes listed on that page

Anyway, after we figure out how to store it in a register, we have to write from that register to static memory using a stw command.  That's where the exception vector area you mentioned will come in, because we can safely store values in that portion of memory.  Am I right so far?

---

In regards to the question at the end, it doesn't seem that breakpoint has any consistent numerical values stored in registers when the breakpoint is hit.  27 and 29 seem to be consistently changing when we hit that breakpoint, but the values look something like 81247ebc, and do not repeat each time P1 uses an item.

(03-12-2024, 09:13 PM)Vega Wrote: I've just gotten out of the hospital so my mind may not be 100%.

I'm very sorry to hear this.  I wish you all the best and a swift recovery!
Reply


Messages In This Thread
Logging game events to text file - by seanmcnally - 03-02-2024, 09:56 PM
RE: Logging game events to text file - by Vega - 03-04-2024, 01:38 AM
RE: Logging game events to text file - by Vega - 03-04-2024, 09:37 PM
RE: Logging game events to text file - by Vega - 03-07-2024, 01:02 AM
RE: Logging game events to text file - by Vega - 03-08-2024, 12:25 AM
RE: Logging game events to text file - by Vega - 03-08-2024, 06:44 PM
RE: Logging game events to text file - by Vega - 03-12-2024, 09:13 PM
RE: Logging game events to text file - by seanmcnally - 03-13-2024, 06:17 AM
RE: Logging game events to text file - by Vega - 03-13-2024, 11:36 PM
RE: Logging game events to text file - by Vega - 03-14-2024, 06:28 PM
RE: Logging game events to text file - by Vega - 03-16-2024, 02:23 AM
RE: Logging game events to text file - by Vega - 03-16-2024, 04:54 PM
RE: Logging game events to text file - by Vega - 03-16-2024, 11:13 PM
RE: Logging game events to text file - by Vega - 03-18-2024, 05:20 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)