PDA

View Full Version : Incrementing/Decrementing codes



Emu
05-16-2010, 12:17 AM
This tutorial was by me..

Now we will use a money code for any game you wish.

this is what we (as in I) would do:


load the upper controller address into t0
then you would load the lower half of the controller into t0 and back to (t0)
we then load our button and 0 into t1 and set your button value to Increase
we then load our button and 0 into t2 and set your button value to Decrease
now we load our upper code address into t3
we branch our controller t0 and our button t1 to the next branch address
nop is our line delay
now load the 2nd half of you code address into t4 and back to (t3)
we then load our button and 0 into t5 and set your increment rate
now we add t6 t4 and t5 - this says add t4 and t5 and store result into t6
now we store the 2nd half of our code into t6 and back to (t3)
we now branch our controller t0 and our button t2 to the end line which is jr ra
nop is our line delay
now load the 2nd half of you code address into t4 and back to (t3)
we then load our button and 0 into t5 and set your increment rate
now we subtract t6 t4 and t5 - this says add t4 and t5 and store result into t6
now we store the 2nd half of our code into t6 and back to (t3)
jr ra - ends our routine

Use thes commands:

lui
addiu
sw
add or addu
sub or subu
lw
bne
jr ra
j - for your hook

Don't forget the Negative rule and your hook.

WorldKing
05-18-2010, 07:49 PM
Weird Thing You Just Posted Cuz It Doesn't Mk Sense In Sum Parts....

Emu
05-18-2010, 08:49 PM
Weird Thing You Just Posted Cuz It Doesn't Mk Sense In Sum Parts....

Exactly :L

WorldKing
05-18-2010, 11:25 PM
Exactly :L

wow wat is =L ? Are You Still Playing Stupid?

Emu
05-19-2010, 04:24 PM
I'll let you figure that out...

WorldKing
05-19-2010, 07:37 PM
I'll let you figure that out...

Sure Nobody Can Find That Out But Ill Take A Guess Of What It Is Cus It Looks Like A Bent Smile Off Your Face...=L

Emu
05-19-2010, 11:18 PM
You guessed correctly it is :L

WorldKing
05-22-2010, 11:41 AM
You guessed wrong it is :L

yea..

ACiiD TRiiP
05-24-2010, 03:49 PM
that wasnt to hard to guess ....
and stop going off topic post this stuff in junk or free chat not to be mean

<(<>,..,<>)>

xKVQ8x
06-04-2010, 10:37 AM
Some of this is slightly incorrect.

If we where going to "load" are controller address we would do this:

Lui t0, $First half of controller
Ori t0, t0, $Second half of controller

We want to load the VALUE AT the controller address like this:

Lui t0, $First half of controller address
Lw t0, $Second half of controller address

And since most button values are no more than 16bits we can use Lh and not Lw. I think you would use Lw/Lh but you should say that we are going load the value at the controller address.

The button value lines are not that well put together. I would say some thing like this:

Add the button value to zero then assign the result to another register.

or if we where using the ori command:

Or the button value and zero to produce a result that will be assigned to another register.

The branch isn't 'branching' are controller address and button values. Branches check the data in registers, like bne checks if the contents of two registers are not equal, if they are not equal it branches to the target address and then executes the delay slot that was after the branch.

The rest up until jr ra I already covered. But the jr ra does not 'ends out routine' it jumps to the contents of the register ra, ra is the return address. In C/C++ this is like returning a value in a function, like this:

return x + y;

the result address basically 'resets' the address's values to there default values, then are hook acts like a function call and jumps us back to are subroutine, which is basically a function that we have created in empty areas of the game.


I am sure you would do what I said here, but some of the wording is incorrect, and I thought I would point that out. I mean no offence though.

Emu
08-24-2010, 03:24 PM
Okay I know you know what I fucking meant, I am not good at explaining I did it the best way I could. What I said was incorrect but the guide will work.

xWhite_Shadowx
08-24-2010, 06:02 PM
Emu there's no reason to cuss at him, he did nothing but try to help you out by clearing your guide up, he was being nice about it and even said no offense, try not to flame him, he's simply trying to help.

Emu
08-25-2010, 04:42 PM
He knows who I am I know who he is, he will be cool with it as we are very close in online friends.

demon450
08-25-2010, 07:32 PM
then why would you swear at your friend :O

silvercola
09-19-2010, 12:02 PM
Wow, you know a lot xD