WiiRd forum

Wii & Gamecube Hacking => Wii Game hacking help => Topic started by: lindtec on October 13, 2008, 07:46:38 PM

Title: Constant write with gecko-registers possible?
Post by: lindtec on October 13, 2008, 07:46:38 PM
Hello,

like the topic said, I wonder, if it is possible to realise a "dynamic" constant
write with registers.

What do you think, would the following code work?

82200000 8047F060  <-- Load value at 8047F060 into register 0
A247F060 0F000000  <-- Check, if register 0 is not equal to the value at 8047F060. If yes, then
84200000 8047F060  <-- Write content of register 0 to 8047F060

Honestly, I have no idea, how this A2-Code really works.
I want to compare the content of a gecko-register with the value of an address.

I hope, someone could lend me a helping hand (and a bit of his brain).

PS. This code is fictional. I just put some random numbers together.
Title: Re: Constant write with gecko-registers possible?
Post by: spunit262 on October 14, 2008, 12:27:52 AM
Just about, you need to end the if though.
E0000000 80008000
That will end all open ifs, as well as reset the ba and po.
Title: Re: Constant write with gecko-registers possible?
Post by: lindtec on October 14, 2008, 01:38:33 AM
Thanks for the advice, but I tried that allready, of course with a correct code (not this fictional one).
Unfortunatly, the game freezes each time, I run the code.

Maybe someone could explain the A2- (or A- in general) code in detail (at least more detail, than the
codetype-list offers).

Edit: Maybe the problem is, that I load 32 bit of data into register 0 and use a 16 bit (there is only 16 bit)
code to compare. I'll test this, as soon as I get the chance...
Title: Re: Constant write with gecko-registers possible?
Post by: spunit262 on October 15, 2008, 12:56:50 AM
I don't see anything wrong in principle with the code.
It be easier to help you if I had that actual code, and what game your hacking.
Title: Re: Constant write with gecko-registers possible?
Post by: lindtec on October 15, 2008, 08:43:02 AM
Sorry, the actual code is the following:

Samurai Warrior Katana Pal [RS5PC8]

[Infinite Gold]
82200000 804980F6
A24980F6 0F000000
84200000 804980F6
E0000000 80008000

As I stated above, as soon as I activate this code in WiiRD, the game freezes.
Title: Re: Constant write with gecko-registers possible?
Post by: spunit262 on October 15, 2008, 10:36:22 PM
I just realized that A2 deference (use as a pointer) the gecko register. I should also note that even if it did work it wouldn't do anything because the gecko register is load anew each time the code is executed (and you shouldn't try to save anything in a gecko register between code runs), I didn't mention this earlier because you sad the code was just a fictional example.

Why can't you just use a single 04 code like

044980F6 0000270F

Assuming the max gold is 9999.


Ah, I think I know what your underling problem is. Set a write breakpoint for 804980F6, and try noping that instruction.