hook
lui t0 $XXXX - (1st half of controler address) + 0880
lw t0 $XXXX(t0) - (2nd half of controller address)
addiu t1 zero - first code button(s)
addiu t2 zero - seconed code button(s)
bne t0 t1 $to next bne
nop
lui t3 $XXXX - (first half of 1st code address) + 0880
lui t4 $XXXX - (first half of 1st code value)
addiu t4 t4 $XXXX - (seconed half of 1st code value)
sw t4 $XXXX(t3) - (seconed half of 1st code address)
bne t0 t2 $to jr ra
nop
lui t3 $XXXX - (first half of 2nd code address) + 0880
lui t4 $XXXX - (first half of 2nd code value)
addiu t4 t4 $XXXX - (seconed half of 2nd code value)
sw t4 $XXXX(t3) - (seconed half of 2nd code address)
jr ra

EXPLANATION:

HOOK //jumps to the start of the subroutine

lui t0 $XXXX - (1st half of controler address) + 0880 //loads fist half of controller addres easy enough

lw t0 $XXXX(t0) - (2nd half of controller address ) // loads the seconed half of controller address easy enough

addiu t1 zero - first code button(s) // easy enough loads the value of a button. to joker two buttons you just add the
button values of both the buttons and there you go

addiu t2 zero - seconed code button(s) //same as above

bne t0 t1 $to next bne //branch to the next bne if you dont press the button stored in t1

nop//delay slot

lui t3 $XXXX - (first half of 1st code address) + 0880 //easy enough loads first half of code

lui t4 $XXXX - (first half of 1st code value) //easy enough loads the first half of value

addiu t4 t4 $XXXX - (seconed half of 1st code value) // loads seconed half of code value

sw t4 $XXXX(t3) - (seconed half of 1st code address) stores the value id like to think of it back to the first half of address

bne t0 t2 $to jr ra // branch if you dont press the button stored in t2

nop //delay slot

lui t3 $XXXX - (first half of 2nd code address) + 0880 //easy enough loads first half of code

lui t4 $XXXX - (first half of 2nd code value) //easy enough loads the first half of value

addiu t4 t4 $XXXX - (seconed half of 2nd code value) //loads seconed half of code value

sw t4 $XXXX(t3) - (seconed half of 2nd code address) //stores the value id like to think of it back to the first half of address

jr ra //ends our subroutine and returns back to normal

~~FoodFx~~

thumb