Advertisement
NewDenverCity

phantom/shadow force.s

Jan 4th, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.95 KB | None | 0 0
  1. .thumb
  2. .equ offset, 0x08800000
  3. .equ battle_script, 0x08810000
  4.  
  5. .align 2
  6. .org 0x0801D8D0
  7. hook:
  8. ldr r1, place
  9. bx r1
  10.  
  11. .align 2
  12. place: .word offset + 1
  13.  
  14. .align 2
  15. .org 0x081D6814
  16. .word battle_script
  17.  
  18. .align 2
  19. .org offset
  20. main:
  21. push {r0, lr}
  22. check_move_id:
  23. ldr r0, exec_attack
  24. ldrh r0, [r0]
  25. mov r1, #0x1 @you might have to add here as well
  26. cmp r0, r1
  27. beq bypass_protect
  28. mov r1, #0x2 @again, you'll probably have to throw in an add as well
  29. beq stomp_effect
  30. b return
  31. stomp_effect:
  32. ldr r0, attack_effect
  33. mov r1, #0x8
  34. strb r1, [r0]
  35. bypass_protect:
  36. ldr r0, defending_bank
  37. ldrb r0, [r0] @which pokemon takes the hit
  38. mov r1, #0x10 @length of protect structures
  39. mul r1, r0, r1
  40. ldr r0, protect_struct
  41. add r0, r0, r1 @correct position in r0
  42. ldrb r1, [r0] @takes the protect flag in r1
  43. lsr r1, r1, #0x1
  44. lsl r1, r1, #0x1 @clears the flag
  45. strb r1, [r0] @stores the cleared flag in the correct spot
  46. return:
  47. pop {r0}
  48. ldr r2, protect_struct
  49. ldr r1, defending_bank
  50. ldrb r2, [r1]
  51. lsl r0, r3, #0x4
  52. pop {pc}
  53.  
  54. .align 2
  55. defending_bank: .word 0x02023D6C
  56. protect_struct: .word 0x02023E8C
  57. attack_effect: .word 0x02023E85
  58. exec_attack: .word 0x02023D4A
  59.  
  60. .org battle_script
  61. .byte 0x1D, 0x1
  62. .word 0x00001000, 0x081D7D4F
  63.  
  64. .byte 0x2B, 0x4
  65. .word 0x02023DD0, 0x00000200, 0x081D7D4F
  66.  
  67. .byte 0x2A, 0x0
  68. .word 0x02023D4A
  69. .short 0x0013
  70. .word 0x081D7D3E
  71.  
  72. .byte 0x2A, 0x0
  73. .word 0x02023D4A
  74. .short 0x0123
  75. .word 0x081D7D33
  76.  
  77. .byte 0x2A, 0x0
  78. .word 0x02023D4A
  79. .short 0x0154
  80. .word 0x081D7D28
  81.  
  82. .byte 0x2A, 0x0
  83. .word 0x02023D4A
  84. .short 0x0001
  85. .word force
  86.  
  87. .byte 0x2A, 0x0
  88. .word 0x02023D4A
  89. .short 0x0002
  90. .word force
  91.  
  92. .byte 0x2E @setbyte 0x02023FD3 0x5
  93. .word 0x02023FD3
  94. .byte 0x5
  95.  
  96. .byte 0x28 @goto 0x081D7D44
  97. .word 0x081D7D44
  98.  
  99. force:
  100. .byte 0x2E @setbyte 0x02023FD3 0x6
  101. .word 0x02023FD3
  102. .byte 0x6
  103.  
  104. .byte 0x41 @call 0x081D6F58
  105. .word 0x081D6F58
  106.  
  107. .byte 0xC5 @hidepreattack
  108.  
  109. .byte 0x28 @goto 0x081D694E
  110. .word 0x081D694E
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement