Advertisement
Rainchus

OOT ACE Writing Code With Control Sticks

Dec 20th, 2019
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.53 KB | None | 0 0
  1. Ocarina of time payload for writing a bigger payload with control stick positions on all 4 players
  2. Each stick has a x and y pos, so we can write 8 bytes per frame with 4 control sticks
  3. To start executing the payload, hold L on player 4
  4. Yes you can easily use less registers, but with where the hook is it seems we are free to use any t registers we want
  5.  
  6. //prologue of payload, only ran once
  7. addiu t9, r0, 0x000C //revert the 000C corruption
  8. lui $at, 0x800D
  9. addiu $at, $at, 0x1020 //needed because we can't type E0 or F2
  10. sh $t9, 0xD0D2($at)
  11. //
  12. LUI t9, 0x800A
  13. ORI t9, t9, 0x2634 //pointer to JAL that disables p2 controller
  14. SW r0, 0x0000 (t9) //remove p2 JAL
  15. SW r0, 0x000C (t9) //remove p4 JAL
  16. LUI t9, 0x800A
  17. ORI t9, t9, 0x0BC8
  18. LUI t8, 0x0807
  19. ORI t8, t8, 0x7428
  20. JR RA
  21. SW t8, 0x0000 (t9) //write a jump to 0x801DD0A0 to address 800A0BC8
  22. //payload ran every frame
  23. LUI t0, 0x801C
  24. ORI t0, t0, 0x84B6 //p1 analog stick address
  25. LH t6, 0x0000 (t0) //load controller 1 input
  26. LH t1, 0x0018 (t0) //load controller 2 input
  27. LH t2, 0x0030 (t0) //load controller 3 input
  28. LH t3, 0x0048 (t0) //load controller 4 input
  29. LUI at, 0x8040
  30. LW t4, 0x0000 (at)
  31. ADD t5, at, t4
  32. SH t6, 0x0004 (t5) //store controller 1 input
  33. SH t1, 0x0006 (t5) //store controller 2 input
  34. SH t2, 0x0008 (t5) //store controller 3 input
  35. SH t3, 0x000A (t5) //store controller 4 input
  36. ADDIU t4, t4, 0x0008 //increase by 8 bytes
  37. ORI t5, r0, 0x0020
  38. LB t6, 0x0047 (t0)
  39. BEQ t6, t5, 0x801DD0F0 //if p4 is holding L, execute
  40. NOP
  41. JR RA
  42. SW t4, 0x0000 (at)
  43. .runpayload
  44. J 0x80400004
  45. NOP
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement