Advertisement
Guest User

Untitled

a guest
Jan 16th, 2017
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.43 KB | None | 0 0
  1.  
  2. INJECT @ 8069b894 <-- TESTED CONFIRMED WORKING IN BRAWL
  3. ----
  4. #check if name is a repeat
  5. cmpwi r19, 0
  6. blt- rejectname
  7.  
  8. #prevent race condition other person entered name first
  9. #pretend name is a repeat
  10. lis r8, 0x8000
  11. ori r8,r8,0x2800
  12. lwz r8, 0(r8)
  13. cmpwi r8, 0
  14. beq setflag
  15. #set name index to FFFFFFFF so it will reject it
  16. lis r19, 0xFFFF
  17. ori r19,r19, 0xFFFF
  18. #branch to reject name
  19. rejectname:
  20. lis r7, 0x8069
  21. ori r7,r7,0xB9C4
  22. mtctr r7
  23. bctr
  24.  
  25.  
  26. #meets conditionals
  27. setflag:
  28. li r7, 0x1
  29. lis r8, 0x8000
  30. ori r8,r8,0x2800
  31. stw r7, 0(r8)
  32.  
  33. #set index of new name, store at offset 0x4(r8)
  34. stw r19, 4(r8)
  35. ----
  36.  
  37.  
  38. leave game if leave flag is set
  39. ---- VERIFIED WORKING +++++++++
  40. inject @ 8068d7c0
  41.  
  42. lis r8, 0x8000
  43. ori r8,r8,0x2800
  44. lwz r8, 0(r8)
  45. cmpwi r8,0
  46. beq replacedline
  47. #New name was entered, lets go to controls page
  48. #set up necessary register values
  49. li r0, 0xc
  50. li r3, 0x4
  51. li r6, 0x4
  52. li r29, 0x4
  53. li r30, 0x55
  54. li r31, 0x3
  55. #branch to leave vs. menu line and dont link
  56. lis r16, 0x8068
  57. ori r16,r16,0xd7f4
  58. mtctr r16
  59. bctr
  60. replacedline:
  61. cmpw r0, r30
  62. ----
  63.  
  64. if changing scene and leave flag is set, setNextSequence change r4 to custom controls page
  65. ----
  66. inject @ 8002d654
  67.  
  68. #check if leave flag was on, that means we want to go to controls page
  69. lis r8, 0x8000
  70. ori r8,r8,0x2800
  71. lwz r8, 0(r8)
  72. cmpwi r8,0
  73. beq replacedline
  74. cmpwi r8,1
  75. beq tocontrols
  76. cmpwi r8,2
  77. beq backtoversus
  78.  
  79. #code to run if we are going to controls page
  80. #replace r4 with the controls sequence
  81. tocontrols:
  82. lis r4, 0x8070
  83. ori r4,r4, 0x18ec
  84. #set flag to state 2, meaning when we leave controls we want to go back to vs.
  85. li r7, 0x2
  86. lis r8, 0x8000
  87. ori r8,r8,0x2800
  88. stw r7, 0(r8)
  89. b replacedline
  90.  
  91. backtoversus:
  92. #replace r4 with the vs. menu sequence
  93. lis r4, 0x8070
  94. ori r4,r4, 0x17e0
  95. #set flag to state 2, meaning when we leave controls we want to go back to vs.
  96. li r7, 0x0
  97. lis r8, 0x8000
  98. ori r8,r8,0x2800
  99. stw r7, 0(r8)
  100.  
  101.  
  102. #replace line that we overwrote for the hook
  103. replacedline:
  104. mr r26, r3
  105. ----
  106.  
  107. setNext/[sqButton] will go to correct name from vs. screen
  108. ---
  109. inject @ 806f8430
  110. #we could probably do without this code if we write to the place it reads from in the first place
  111.  
  112. #check if flag has been set
  113. lis r8, 0x8000
  114. ori r8,r8,0x2800
  115. lwz r20, 0(r8)
  116. cmpwi r20,0
  117. beq replacedline
  118.  
  119. #get the table index from our stored var
  120. lwz r20, 4(r8)
  121. b end
  122.  
  123. replacedline:
  124. #we get the variable from the normal place
  125. lbz r20, 0x0028(r17)
  126.  
  127. end:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement