Advertisement
Doesnt

FE8 reverse source

Mar 16th, 2017
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. .thumb
  2.  
  3. # org x2AEDA
  4. .org 0xA
  5. ldr r0, MethodAddr
  6. bx r0
  7.  
  8. .align 2
  9. MethodAddr: .word 0x09000001
  10.  
  11.  
  12. .org 0x40
  13. # check that the attacker is not red
  14. # and check that the defender is red
  15. ldr r0, AttackerAddr
  16. ldr r1, DefenderAddr
  17. ldrb r0, [r0, #0xB]
  18. ldrb r1, [r1, #0xB]
  19. mov r2, #0x80
  20. and r0, r2
  21. and r1, r2
  22. cmp r0, #0x0
  23. bne Abort
  24. cmp r1, #0x80
  25. bne Abort
  26.  
  27. # check that the defending red unit is armed
  28. # a unit not being armed is the game's signal not to counter
  29. ldr r0, DefenderAddr
  30. mov r1, #0x48
  31. ldrh r0, [r0, r1]
  32. cmp r0, #0x0
  33. beq Abort
  34.  
  35. # reverse turn order here
  36. mov r0, r13
  37. mov r1, r4
  38. ldr r2, DefenderAddr
  39. str r2, [r0]
  40. ldr r0, AttackerAddr
  41. str r0, [r1]
  42. b Return
  43.  
  44. Abort:
  45. mov r0, r13
  46. mov r1, r4
  47. ldr r2, AttackerAddr
  48. str r2, [r0]
  49. ldr r0, DefenderAddr
  50. str r0, [r1]
  51.  
  52. Return:
  53. ldr r0, ReturnAddr
  54. bx r0
  55.  
  56. .align 2
  57. AttackerAddr: .word 0x0203A4EC
  58. DefenderAddr: .word 0x0203A56C
  59. ReturnAddr: .word 0x0802AEE5
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement