Fantafaust

HGSS Repel Chaining Research

Oct 31st, 2024 (edited)
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.03 KB | None | 0 0
  1. HGSS Repel Chain Research
  2. Adapted from: https://ds-pokemon-hacking.github.io/docs/generation-iv/guides/pt-reusable_repel/
  3.  
  4. PLATINUM
  5. Script File: 211
  6. Script Entry: 33
  7. Text Archive: 213
  8. MultiStandardText Text Archive: 361
  9.  
  10. HGSS
  11. Script File: 3
  12. Script Entry: 23
  13. Text Archive: 40
  14. MultiStandardText Text Archive: 191
  15.  
  16. ----------------------------------------------------------------------------------------------------
  17. -----------------------------------------Script File Edits------------------------------------------
  18. -----------------------------------------------DSPRE------------------------------------------------
  19.  
  20. Script File 3
  21. --------------------------------------------------SCRIPTS--------------------------------------------------
  22. Script 23:
  23. PlayFanfare 1500
  24. LockAll
  25. CheckItem 79 1 0x800C
  26. CompareVarValue 0x800C 1
  27. JumpIf EQUAL Function#177
  28. CheckItem 76 1 0x800C
  29. CompareVarValue 0x800C 1
  30. JumpIf EQUAL Function#177
  31. CheckItem 77 1 0x800C
  32. CompareVarValue 0x800C 1
  33. JumpIf EQUAL Function#177
  34. Message 65
  35. WaitAB
  36. CloseMessage
  37. ReleaseAll
  38. End
  39. -------------------------------------------------FUNCTIONS---------------------------------------------------
  40. Function 177:
  41. Message 66
  42. YesNoBox 0x800C
  43. CompareVarValue 0x800C 0
  44. JumpIf EQUAL Function#178
  45. CloseMessage
  46. ReleaseAll
  47. End
  48.  
  49. Function 178:
  50. CloseMessage
  51. MultiStandardText 1 1 0 1 0x800C
  52. CheckItem 79 1 0x8000
  53. CompareVarValue 0x8000 1
  54. CallIf EQUAL Function#179
  55. CheckItem 76 1 0x8000
  56. CompareVarValue 0x8000 1
  57. CallIf EQUAL Function#180
  58. CheckItem 77 1 0x8000
  59. CompareVarValue 0x8000 1
  60. CallIf EQUAL Function#181
  61. ShowMulti
  62. CompareVarValue 0x800C 0
  63. JumpIf EQUAL Function#182
  64. CompareVarValue 0x800C 1
  65. JumpIf EQUAL Function#183
  66. CompareVarValue 0x800C 2
  67. JumpIf EQUAL Function#184
  68. ReleaseAll
  69. End
  70.  
  71. Function 179:
  72. AddMultiOption 30 0
  73. Return
  74.  
  75. Function 180:
  76. AddMultiOption 31 1
  77. Return
  78.  
  79. Function 181:
  80. AddMultiOption 32 2
  81. Return
  82.  
  83. Function 182:
  84. AdrsValueSet 0x020FCB60 100
  85. DummyNationalDexCheck
  86. TakeItem 79 1 0x8000
  87. TextPlayerName 0
  88. TextItem 1 79
  89. Message 67
  90. WaitButton
  91. CloseMessage
  92. ReleaseAll
  93. Return
  94.  
  95. Function 183:
  96. AdrsValueSet 0x020FCB60 150
  97. DummyNationalDexCheck
  98. TakeItem 76 1 0x8000
  99. TextPlayerName 0
  100. TextItem 1 76
  101. Message 67
  102. WaitButton
  103. CloseMessage
  104. ReleaseAll
  105. Return
  106.  
  107. Function 184:
  108. AdrsValueSet 0x020FCB60 250
  109. DummyNationalDexCheck
  110. TakeItem 77 1 0x8000
  111. TextPlayerName 0
  112. TextItem 1 77
  113. Message 67
  114. WaitButton
  115. CloseMessage
  116. ReleaseAll
  117. Return
  118.  
  119. ----------------------------------------------------------------------------------------------------
  120. --------------------------------------Text Archive Additions----------------------------------------
  121. ----------------------------------------------------------------------------------------------------
  122.  
  123. [Text Archive 40]
  124. 66: Repel’s effect wore off...\nWould you like to use another one?
  125. 67: \v0103ぁ\x0000\x0000 used the\n\v0108ぁ\x0001\x0000.\rWild Pokémon will be repelled.
  126.  
  127. [Text Archive 191]
  128. 30: Repel
  129. 31: Super Repel
  130. 32: Max Repel
  131.  
  132. ------------------------------------------Hex Edit Setup--------------------------------------------
  133. ---------------------------------------------ARM9.bin-----------------------------------------------
  134. --------------------------(You Can Disregard This if you're only modding)---------------------------
  135.  
  136. OUR Step Count Holding Address - FCB60
  137. Full Address in ram - 020FCB60 | ENDIAN - 60 CB 0F 02
  138. Gets written to by script and read for "DummyNationalDexCheck" code
  139.  
  140. ----------------------------------------------------------------------------------------------------
  141.  
  142. REPEL DYNAMIC OFFSET POINTER - Found via guesswork, the platinum tutorial, and cheatengine(find counter, find what writes, etc)
  143. Full Address in ram - 02111880 | ENDIAN - 80 18 11 02
  144. This address has the pointer that leads to the address that has the active repel counter, on a given boot
  145. Must add 6919 to get final repel counter address
  146.  
  147. ----------------------------------------------------------------------------------------------------
  148. ------------------------------------------Hex Edit Actual-------------------------------------------
  149. ---------------------------------------------ARM9.bin-----------------------------------------------
  150.  
  151. DummyTextTrap has unused variables/arguments which interfere, I guess, so use DummyNationalDexCheck instead
  152. DummyNationalDexCheck pointer location: FB0DC
  153. OG HEX: 75 3D 04 02
  154. REPOINT TO: FCB21
  155. NEW HEX(use AdrsValueSet for compat.): 21 CB 0F 02
  156. --------------------------------------------------
  157. DummyNationalDexCheck Pointed Offset: FCB21
  158. BUT replace the hex starting from FCB20 with CTRL+B
  159.  
  160. REPLACE FROM OFFSET FCB20 OG HEX:
  161. 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  162. REPLACE FROM OFFSET FCB20 NEW HEX:
  163. 03 48 01 68 03 48 09 18 03 48 02 78 0A 70 70 47 80 18 11 02 19 69 00 00 60 CB 0F 02
  164.  
  165. New Code asm for posterity(OFFSET 020FCB20):
  166. ldr r0, =0x02111880
  167. ldr r1, [r0]
  168. ldr r0, =0x6919
  169. add r1, r1, r0
  170. ldr r0, =0x020FCB60
  171. ldrb r2, [r0]
  172. strb r2, [r1]
  173. bx lr
Advertisement
Add Comment
Please, Sign In to add comment