Author Topic: Learning to Joker  (Read 6 times)

Offline Bot

  • Programmer
  • Registered User
  • *****
  • Posts: 95
  • Who Likes You? 10001
  • Administrator
    • View Profile
    • CodeCommunity.com
Learning to Joker
« on: December 21, 2011, 02:47:14 am »
Hello guys! I am Emu as you can see and I would like to show you guys how to do 3 different types of jokers.

Activation Joker:
 An activation joker is the activating of a code through button pressing. The bad thing is that you cannot turn off an activation unless you add a deactivation spot in your routine. Look at the example below.
[/code]lui t0, $0880 - this is our upper 16bits of our controller address and is now being loaded
lw t0, $1000(t0) - this is our lower 16bits of our controller and is now loading what is stored in 08801000
addiu t1, zero, $XXXX - this adds our button value in the address 08801000; also t1 = new value and 0 = old value
lui t2, $08a4 - loads our upper code address
bne t0, t1, $to the jr ra - now if our controller button isn't = to t1 then it jumps to the end of our routine
nop - slot delay
lui t3, $1000 - loads our upper value for our code we want to activate
addiu t3, t3, $0000 - this adds the lower half of the value making it 10000000
sw t3, $1425(t2) - this stores the value in t2 to the address 08a41425
jr ra
nop - slot delay
j $00000098 - this is our jump to the routine called a hook
nop - slot delay
Code: [Select]
The slot delay needs to be added in the code but, when your finished with the code and test the code, you can erase the slot delay lines called nop they contain the value 00000000.

Activation & Deactivation:
 In the above example you can see that you can only press a button and not be able to turn the code off. Bites doesn't it? Well there are many ways to make it deactivation and here is what you can do in this example below.
 (This was a quick edit of the activation example.)
lui t0, $0880 - this is our upper 16bits of our controller address and is now being loaded
lw t0, $1000(t0) - this is our lower 16bits of our controller and is now loading what is stored in 08801000
addiu t1, zero, $XXXX - this adds our button value in the address 08801000; also t1 = new value and 0 = old value
addiu t4, zero, $XXXX - this adds our button value in the address 08801000; also t4 = new value and 0 = old value
lui t2, $08a4 - loads our upper code address
bne t0, t1, $to the next bne - now if our controller button isn't = to t1 then it jumps to the end of our activation
nop - slot delay
lui t3, $1000 - loads our upper value for our code we want to activate
addiu t3, t3, $0000 - this adds the lower half of the value making it 10000000
sw t3, $1425(t2) - this stores the value in t2 to the address 08a41425
bne t0, t4, $to the jr ra - now if our controller button isn't = to t4 then it jumps to the end of our routine
nop - Slot delay
lui t3, $0000 - loads our upper off value for our deactivation
addiu t3, t3, $0000 - adds the lower half of our deactivation value to the upper making it 00000000
sw t3, $1425(t2) - stores our deactivation value to the code address 08a41425
jr ra
nop - slot delay
j $00000098 - this is our jump to the routine called a hook
nop - slot delay
Code: [Select]
Now, In this part in the code format below I want you to examine it....
lui t3, $0000 - loads our upper off value for our deactivation
addiu t3, t3, $0000 - adds the lower half of our deactivation value to the upper making it 00000000
sw t3, $1425(t2) - stores our deactivation value to the code address 08a41425
Code: [Select]
Note that you could do this to have made it shorter:
addiu t3, zero, $0 - adds the our deactivation value to the code address making it 00000000
sw t3, $1425(t2) - stores our deactivation value to the code address 08a41425
Code: [Select]
Button hold joker:
 A button hold joker is self explaining, if you hold this button then a block of code will be executed and if that button is let go then the code will stop running thus, deactivating it. Look at this example below.
 (Quick edit of the activation example)
lui t0, $0880 - this is our upper 16bits of our controller address and is now being loaded
lw t0, $1000(t0) - this is our lower 16bits of our controller and is now loading what is stored in 08801000
addiu t1, zero, $XXXX - this adds our button value in the address 08801000; also t1 = new value and 0 = old value
lui t3, $08a4
beq zero, t1, $to the next lui t2 - if our button = t1 then it jumps to the activation
nop - slot delay
addiu t2, zero, $0 - adds the our deactivation value to the code address making it 00000000
sw t2, $1425(t3) - stores our deactivation value to the code address 08a41425
jr ra
nop - slot delay
lui t2, $1000 - loads our upper value for our code we want to activate
addiu t2, t2, $0000 - this adds the lower half of the value making it 10000000
sw t2, $1425(t3) - this stores the value in t2 to the address 08a41425
jr ra
nop - slot delay
j $00000098 - this is our jump to the routine called a hook
nop - slot delay
Signed, Bot