Advertisement
NewDenverCity

relic song asm(needs animation/battle string)

Nov 9th, 2015
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.75 KB | None | 0 0
  1. .thumb
  2. @in this example, pirouette form is 0xF1, and aria is 0xF0
  3. @i used the decrypting thing that Doesnt posted so that's why i'm not calling the
  4. @decrypting function or encrypting function.
  5.  
  6. check_pkmn_id:
  7. push {lr}
  8. ldr r0, attacking_bank
  9. ldrb r1, [r0] @which mon did the attack
  10. ldr r0, ram_pointer
  11. ldr r0, [r0]
  12. add r0, r0, #0x60
  13. cmp r1, #0x0
  14. beq set_player_singles
  15. cmp r1, #0x1
  16. beq set_enemy_singles
  17. cmp r1, #0x2
  18. beq set_player_doubles
  19. cmp r1, #0x3
  20. beq set_enemy_doubles
  21. get_battle_struct:
  22. ldr r0, attacking_bank
  23. ldrb r1, [r0] @which mon did the attack
  24. mov r0, #0x58 @length of battle structs
  25. mul r1, r0, r1 @multiplies length of battle structs with which mon did the attack to get the the battle structure i'm working with
  26. ldr r0, battle_struct
  27. add r0, r1, r0 @r0 is the battle struct i'm working with
  28. check_if_aria:
  29. add r2, r2, #0x20
  30. ldrh r1, [r2]
  31. cmp r1, #0xF0
  32. bne end
  33. set_pirouette_forme:
  34. mov r1, #0xF1
  35. strh r1, [r0] @species in battle struct is now the correct thing
  36. strh r1, [r2] @species in party is now pirouette's
  37. sub r2, r2, #0x20 @makes r2 go to the beginning of the party again
  38. push {r0}
  39. mov r0, r2
  40. mov r1, r2
  41. push {r2}
  42. ldr r3, calc_stats
  43. bl jump @stats should be calculated
  44. pop {r2}
  45. pop {r0} @r2 is the beginning of the party slot, r0 is the beginning of the battle struct
  46. update_type:
  47. add r0, #0x22
  48. mov r1, #0x1
  49. strb r1, [r0] @second type in battle struct is now fighting
  50. update_battl_struct:
  51. sub r0, r0, #0x20
  52. add r2, r2, #0x5A @r0 is at the attack stat, r2 is at the party attack stat
  53. mov r3, #0x0
  54. stat_loop:
  55. ldrh r1, [r2]
  56. strh r1, [r0]
  57. add r0, r0, #0x2
  58. add r2, r2, #0x2
  59. add r3, r3, #0x1
  60. cmp r3, #0x4
  61. bne stat_loop
  62. end:
  63. pop {pc}
  64. jump:
  65. mov pc, r3
  66. set_player_singles:
  67. ldrb r0, [r0]
  68. lsr r0, #0x4 @only one digit is left
  69. mov r1, #0x64 @length of party entry
  70. ldr r2, player_party
  71. mul r0, r0, r1
  72. add r2, r0, r2 @gets r2 to the correct slot
  73. b get_battle_struct
  74. set_enemy_singles:
  75. add r0, r0, #0x3 @gets to party order for enemy
  76. ldrb r0, [r0]
  77. lsr r0, #0x4
  78. mov r1, #0x64
  79. ldr r2, enemy_party
  80. mul r0, r0, r1
  81. add r2, r0, r2
  82. b get_battle_struct
  83. set_player_doubles:
  84. ldrb r0, [r0]
  85. lsl r0, #0x1C
  86. lsr r0, #0x1C @gets the second pokemon's location
  87. mov r1, #0x64
  88. ldr r2, player_party
  89. mul r0, r0, r1
  90. add r2, r0, r2
  91. b get_battle_struct
  92. set_enemy_doubles:
  93. add r0, r0, #0x3
  94. ldrb r0, [r0]
  95. lsl r0, #0x1C
  96. lsr r0, #0x1C
  97. mov r1, #0x64
  98. ldr r2, enemy_party
  99. mul r0, r0, r1
  100. add r2, r0, r2
  101. b get_battle_struct
  102.  
  103. .align 2
  104. battle_struct: .word 0x02023BE4
  105. player_party: .word 0x02024284
  106. enemy_party: .word 0x0202402C
  107. order_pointer: .word 0x02023FE8
  108. attacking_bank: .word 0x02023D6B
  109. calc_stats: .word 0x0803E47C
  110. ram_pointer: .word 0x02023FE8
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement