Advertisement
NewDenverCity

Untitled

May 3rd, 2017
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.38 KB | None | 0 0
  1. .thumb
  2.  
  3. @08257510 is the asm
  4. @089063FB is the pointer to it
  5.  
  6. @0x10 = 00010000 = stealth rocks
  7. @0x04-8 = 00001100 = toxic spikes
  8. @0x01-3 = 00000011 = spikes but we already knew that
  9.  
  10. .equ rom, 0x08000000
  11.  
  12. .equ Fighting, 0x1
  13. .equ Flying, 0x2
  14. .equ Poison, 0x3
  15. .equ Steel, 0x8
  16.  
  17. .equ Spikes, 0xBF
  18. .equ Toxic_Spikes, 0x1D5
  19. .equ Stealth_Rock, 0x1D4
  20. .equ Sticky_Web, 0x1E1
  21.  
  22. .equ Immunity, 0x11
  23. .equ Levitate, 0x1A
  24. .equ Skill_Link, 0x5D
  25.  
  26. @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  27.  
  28. .org 0x257510
  29. toxic_spikes_something:
  30. mov r0, #0
  31. bl 0x016E24 @get side of something
  32. mov r4, r0
  33. bl 0x0751C4 @battle side get owner
  34. ldr r1, timers
  35. mov r2, #0xC @size_of(timers)
  36. mul r0, r2
  37. add r0, r1 @the timer struct is in r0
  38. mov r5, r0
  39. ldrb r0, [r0, #0xA] @spike counter
  40. mov r3, #0xC @toxic spikes bits
  41. and r0, r3
  42. lsr r0, #2 @1100 -> 0011 or 0011 -> 0000
  43. ldr r1, movescr_cursor
  44. cmp r0, #0
  45. beq loc_257570
  46. mov r6, r0 @r4 is battle side something, r5 is timer struct, r6 is the timer value
  47. ldr r0, battle_struct
  48. mov r1, #0x58 @size_of(battle_struct)
  49. mul r1, r4
  50. add r0, r1
  51. add r0, #0x20 @ability of something, i assume the defender
  52. mov r7, r0
  53. ldrb r1, [r7] @ability into r1
  54. cmp r1, #Levitate
  55. beq loc_257570
  56. cmp r1, #Immunity
  57. beq loc_257570
  58. ldrb r1, [r7, #1]
  59. ldrb r1, [r7, #2]
  60. cmp r0, #Flying
  61. beq loc_257570
  62. cmp r1, #Flying
  63. beq loc_257570
  64. cmp r0, #Poison
  65. beq loc_257588
  66. cmp r1, #Poison
  67. beq loc_257588
  68. cmp r0, #Steel
  69. beq loc_257570
  70. cmp r1, #Steel
  71. beq loc_257570
  72. cmp r6, #1
  73. beq loc_257578
  74. b loc_257580
  75.  
  76. loc_257570:
  77. ldr r0, label_a
  78. ldr r1, movescr_cursor
  79. str r0, [r1]
  80. b loc_257598 @default?
  81.  
  82. loc_257578:
  83. ldr r0, label_b
  84. ldr r1, movescr_cursor
  85. str r0, [r1]
  86. b loc_257598
  87.  
  88. loc_257580:
  89. ldr r0, label_c
  90. ldr r1, movescr_cursor
  91. str r0, [r1]
  92. b loc_257598
  93.  
  94. loc_257588:
  95. mov r0, r5
  96. ldrb r1, [r0, #0xA]
  97. mov r2, #0xF3 @11110011
  98. and r1, r2
  99. strb r1, [r0, #0xA]
  100. ldr r0, label_d
  101. ldr r1, movescr_cursor
  102. str r0, [r1]
  103. loc_275798:
  104. pop {r0}
  105. bx r0
  106.  
  107. .align 2
  108. timers: .word 0x02023DE4
  109. movescr_cursor: .word 0x02023D74
  110. battle_struct: .word 0x02023BE4
  111. label_a: .word 0x082575C0
  112. label_b: .word 0x082575D0
  113. label_c: .word 0x082575F0
  114. label_d: .word 0x08257607
  115.  
  116. @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  117.  
  118. .org 0x2575C0
  119. label_a:
  120. .word 0xDDDDDDDD @wtf tbh
  121. .byte 0xDD, 0xF8
  122. .word 0x08257620 + 1
  123.  
  124. @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  125.  
  126. .org 0x08257620 @handles spikes and stealth rocks
  127. spikes_damage_maybe:
  128. push {lr}
  129. mov r0, #0
  130. bl 0x016E24 @get side of something
  131. ldr r4, battle_side_unknown
  132. strb r0, [r4]
  133. mov r4, r0
  134. bl 0x0751C4 @get side of owner
  135. ldr r1, timers0
  136. mov r2, #0xC
  137. mul r0, r2
  138. add r0, r1
  139. mov r5, r0 @r5 is timer struct
  140. ldrb r0, [r0, #0xA]
  141. mov r3, #3 @spike bits
  142. and r0, r3
  143. cmp r0, #0
  144. beq loc_257684
  145. mov r6, r0 @r6 is the spike bits
  146. ldr r0, battle_struct0
  147. mov r1, #0x58
  148. mul r1, r4
  149. add r0, r1
  150. add r0, #0x20
  151. mov r7, r0 @r7 is the battle_struct at ability
  152. ldrb r1, [r7]
  153. cmp r1, #Levitate
  154. beq loc_257684
  155. cmp r1, #Skill_Link
  156. beq loc_257684
  157. ldrb r0, [r7, #1]
  158. ldrb r1, [r7, #2]
  159. cmp r0, #Flying
  160. beq loc_257684
  161. cmp r1, #Flying
  162. beq loc_257684
  163. ldrh r0, [r7, #0xC] @hp i presume
  164. mov r1, #0xA
  165. mov r2, r6 @r2 is also the spike bits now
  166. add r2, r6
  167. sub r1, r2 @i have no fucking clue mate
  168. bl 0x1E4018 @divsi3
  169.  
  170.  
  171. .align 2
  172. battle_side_unknown: .word 0x02023FDB
  173. timers0: .word 0x02023DE4
  174. battle_struct0: .word 0x02023BE4
  175.  
  176. @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  177.  
  178. .org 0x257880
  179. spikes_battle_script:
  180. .byte 0x2A, 0 @jumpifhalwford
  181. .word 0x02023D4A
  182. .hword Toxic_Spikes
  183. .word 0x082578C0
  184.  
  185. .byte 0x2A, 0
  186. .word 0x02023D4A
  187. .hword Stealth_Rock
  188. .word 0x082578E0
  189.  
  190. .byte 0x2A, 0
  191. .word 0x02023D4A
  192. .hword Sticky_Web
  193. .word 0x08257900
  194.  
  195. .byte 0x0 @attack canceler
  196.  
  197. .byte 0xF8 @callasm
  198. .word 0x08257920 + 1 @sets spikes and whatnot
  199.  
  200. .byte 0x2 @attackstring
  201. .byte 0x3 @ppreduce
  202. .byte 0x9 @attackanimation
  203. .byte 0xA @waitanimation
  204. .byte 0x10 @printstring
  205. .hword 0x0094
  206. .byte 0x12 @waitmessage
  207. .hword 0x0040
  208. .byte 0x28 @goto
  209. .word 0x081D694E @end
  210.  
  211. @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  212.  
  213. .org 0x9063FA
  214. damage_bs_i_think:
  215. .byte 0xF8 @callasm
  216. .word toxic_spikes_something + rom + 1
  217.  
  218. .byte 0x29, 1 @jumpifbyte
  219. .word 0x0203D8FE
  220. .byte 0
  221. .word 0x0890641F
  222.  
  223. .byte 0xFF @idk why this happens tbh
  224.  
  225. @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement