@ymyn You seem like one of the best Gateway coders in this thread. I'd appreciate your help with a question.
Do you know if (and how) it's possible to increase a float value with button press?
Say, I want to increase the value at offset 0x08123456 by tapping L-button one by one.
Base value: 0x3f800000 (1.0)
Value after first press: 0x40000000 (2.0)
Value after second press: 0x40400000 (3.0)
...
How would I achieve this? Increasing value of an integer is easy of course, not sure how to go about float values however...
Float values don't go up at a constant rate, so it's hard. But if you want something like that, then it's possible and very simple.
I would do something like this.
DD000000 00000YYY # YYY is the button activator
D3000000 XXXXXXXX # XXXXXXXX is an offset that you can write data to without it crashing the game, but without interfering with anything else.
D9000000 000000000 # Store values
D4000000 000000001 # Add 1
D6000000 000000000 # Write back the stored values + 1
Then, you would do a simple check on the address.
XXXXXXXX is still the offset that you chose earlier.
If XXXXXXXX = 0, then write 3F800000 to the offset 08123456
If XXXXXXXX = 1 (after one press), then write 40000000 to the offset 08123456
If XXXXXXXX = 2 (after two presses), then write 40400000 to the offset 08123456
EDIT: I pretty much made it for you here, just replace 12345678 with an address that isn't being used by the game, won't auto update (reset to 0, like some do), and doesn't crash when writing to it.
Code:
[Press L]
DD000000 00000200
D3000000 12345678
D9000000 00000000
D4000000 00000001
D6000000 00000000
D2000000 00000000
D3000000 12345678
50000000 00000000
D3000000 08123456
00000000 3F800000
D2000000 00000000
D3000000 12345678
50000000 00000001
D3000000 08123456
00000000 40000000
D2000000 00000000
D3000000 12345678
50000000 00000002
D3000000 08123456
00000000 40400000
D2000000 00000000
Hopefully you see what I did and can learn from it