Incrementing/Decrementing codes
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:
Code:
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:
Code:
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.
Re: Incrementing/Decrementing codes
Weird Thing You Just Posted Cuz It Doesn't Mk Sense In Sum Parts....
Re: Incrementing/Decrementing codes
Quote:
Originally Posted by
WorldKing
Weird Thing You Just Posted Cuz It Doesn't Mk Sense In Sum Parts....
Exactly :L
Re: Incrementing/Decrementing codes
Quote:
Originally Posted by
Emu
Exactly :L
wow wat is =L ? Are You Still Playing Stupid?
Re: Incrementing/Decrementing codes
I'll let you figure that out...
Re: Incrementing/Decrementing codes
Quote:
Originally Posted by
Emu
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
Re: Incrementing/Decrementing codes
You guessed correctly it is :L
Re: Incrementing/Decrementing codes
Quote:
Originally Posted by
Emu
You guessed wrong it is :L
yea..
Re: Incrementing/Decrementing codes
that wasnt to hard to guess ....
and stop going off topic post this stuff in junk or free chat not to be mean
<(<>,..,<>)>
Re: Incrementing/Decrementing codes
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.