Advertisement
NewDenverCity

phantom/shadow force asm

Dec 31st, 2015
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. .thumb
  2. .align 2
  3.  
  4. main:
  5. push {lr}
  6. check_move_id:
  7. ldr r0, exec_attack
  8. ldrh r0, [r0]
  9. mov r1, #0x(move id for shadow force) @you might have to add here as well
  10. cmp r0, r1
  11. beq bypass_protect
  12. mov r1, #0x(move id for phantom force) @again, you'll probably have to throw in an add as well
  13. cmp r0, r1
  14. bne end
  15. stomp_effect:
  16. ldr r0, attack_effect @phantom force hits harder on minimized targets
  17. mov r1, #0x8
  18. strb r1, [r0]
  19. bypass_protect:
  20. ldr r0, defending_bank
  21. ldrb r0, [r0] @which pokemon takes the hit
  22. mov r1, #0x10 @length of protect structures
  23. mul r1, r0, r1
  24. ldr r0, protect_struct
  25. add r0, r0, r1 @correct position in r0
  26. ldrb r1, [r0] @takes the protect flag in r1
  27. lsr r1, r1, #0x1
  28. lsl r1, r1, #0x1 @clears the flag
  29. strb r1, [r0] @stores the cleared flag in the correct spot
  30. end:
  31. pop {pc}
  32.  
  33. .align 2
  34. defending_bank: .word 0x02023D6C
  35. protect_struct: .word 0x02023E8C
  36. attack_effect: .word 0x02023E85
  37. exec_attack: .word 0x02023D4A
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement