Advertisement
MrCheeze

OoT ACE Payload - write to RAM based on controller input

Dec 24th, 2019
917
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. lui $t9, 0x0C07 # setup self to run every frame, by replacing the function that zeroes out controller 2
  2. addiu $t1, $t9, 0x741A
  3. lui $t6, 0x800A
  4. sw $t1, 0x2634($t6)
  5.  
  6. # a0 is already set up by the function we hook into to point at controller 2 buttons
  7. lw $t0 0x0006($a0) # load controller 3 buttons into upper half of word
  8. srl $t8, $t0, 0xA
  9. lw $a1 0x000A($a0) # load controller 4 buttons into lower half of word, with upper half as zeroes
  10. lui $t9, 0x8000
  11. or $a2, $t9, $t8
  12. lb $t1 0x0000($a0) # load upper byte of controller 2 buttons (A/B/Z/Start/D)
  13. lb $t0 0x0001($a0) # load lower byte of controller 2 buttons (L/R/C)
  14. beq $t0, $r0, 0x2 # write value only if controller 2 has pressed C button or L/R
  15.  
  16. or $t8, $a2, $a1
  17. sb $t1, 0x0000($t8) # *((controller3 << 6) | controller4) = controller2
  18.  
  19. jr $ra
  20. nop
  21.  
  22. 3C 19 0C 07
  23. 27 29 74 1A
  24. 3C 0E 80 0A
  25. AD C9 26 34
  26.  
  27. 8C 88 00 06
  28. 00 08 C2 82
  29. 8C 85 00 0A
  30. 3C 19 80 00
  31. 03 38 30 25
  32. 80 89 00 00
  33. 80 88 00 01
  34. 11 00 00 02
  35.  
  36. 00 C5 C0 25
  37. A3 09 00 00
  38.  
  39. 03 E4 00 08
  40. 00 00 00 00
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement