WiiRd forum

Wii & Gamecube Hacking => Wii Game hacking help => Topic started by: Lunar on December 15, 2008, 04:39:03 AM

Title: Adding to a value then setting it back to default?
Post by: Lunar on December 15, 2008, 04:39:03 AM
Ok so im trying to edit one of ukuneko's codes so Link grows, shrinks and sets his height back to the default. Im not 100% sure on how to do this (infact im not even 10% sure :S). I know how to set the value back to the default, but i have no idea on how to increase the value on that address.

Here's the code V V V, and i wanna add/subtract the values

Link Size Modifier [ukuneko]
48000000 804862BC
DE000000 80008180
12000018 0000XXXX \\ Here
1200001C 0000XXXX \\ Here
12000020 0000XXXX \\ And Here
E0000000 80008000

Help would be greatly appreciated.

Thanks
Title: Re: Adding to a value then setting it back to default?
Post by: Link on December 15, 2008, 11:42:06 AM
Increasing and decreasing is possible via Gecko Registers:

What you can do:

48000000 804862BC  //Load ptr
DE000000 80008180  //Check ptr
92210000 00000018 //load po+18 into gR 0
28XXXXXX 0000____ //grow button activator
86B10000 3F828F5C //gr0 = gr0 * 1.02
28XXXXXY 0000____ //shrink button (XXXXXY = XXXXXX+1)
86B10000 3F7AFAFB // gr0 = gr0 * 0.9803.... = gr0 / 1.02
28XXXXXY 0000____ //normal size button
80000000 3F800000 //gr0 = 3F800000 = 1.0
E2000001 00000000 //endif
94210020 00000018 //store gr0 to po+18, po+1C, po+20
E2000000 80008000 //terminator
Title: Re: Adding to a value then setting it back to default?
Post by: Lunar on December 16, 2008, 12:28:11 AM
Thank you Link. Ill try it soon
Title: Re: Adding to a value then setting it back to default?
Post by: brkirch on December 16, 2008, 01:19:12 AM
Quote from: Link on December 15, 2008, 11:42:06 AM
96B10000 3F828F5C //gr0 = gr0 * 1.02
96B10000 3F7AFAFB // gr0 = gr0 * 0.9803.... = gr0 / 1.02
Shouldn't these be 86B1 instead of 96B1?
Title: Re: Adding to a value then setting it back to default?
Post by: Link on December 16, 2008, 10:29:28 AM
very probable, I didn't test the code..