暂无描述

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. _call_via_r0 equ 0x081E3BA8
  2. _call_via_r1 equ 0x081E3BAC
  3. // disable help menu
  4. // see: https://www.pokecommunity.com/showthread.php?t=364909
  5. .org 0x0813B8C2
  6. .halfword 0xE01D
  7. // idle loop eliminiation
  8. .org 0x080008A4
  9. cmp r0, #0
  10. bne ile_end_wait
  11. mov r3, #1
  12. ile_idle_loop:
  13. swi #2
  14. ldrh r1, [r2, #0x1c]
  15. mov r0, r3
  16. and r0, r1
  17. beq ile_idle_loop
  18. ile_end_wait:
  19. pop {r0}
  20. bx r0
  21. //--------------
  22. // IRAM hacks
  23. //--------------
  24. // decrease amount of valid file handles from 20 to 12 to free up some IRAM
  25. NUM_FILE_HANDLES equ 12
  26. .org 0x081E9948
  27. cmp r1, #(NUM_FILE_HANDLES - 1)
  28. .org 0x081E99E4
  29. add r0, #((NUM_FILE_HANDLES - 1) * 8)
  30. .org 0x081E9AA4
  31. cmp r6, #NUM_FILE_HANDLES
  32. .org 0x081E9ADE
  33. cmp r6, #NUM_FILE_HANDLES
  34. .org 0x081E9B1C
  35. cmp r6, #NUM_FILE_HANDLES
  36. bge 0x081E9B2E
  37. .org 0x081E9BA6
  38. cmp r7, #NUM_FILE_HANDLES
  39. bge 0x081E9BB8
  40. .org 0x081E9BDA
  41. cmp r0, #NUM_FILE_HANDLES
  42. blo 0x081E9BE2
  43. .org 0x081E9C84
  44. cmp r1, #NUM_FILE_HANDLES
  45. bge 0x081E9C94
  46. //----------------
  47. // S-Bird stuff
  48. //----------------
  49. //Don't know what thats all about... leaving it commented for now
  50. //.org 0x0800f268
  51. // .halfword 0xE000
  52. //flag routine
  53. .org 0x0806E5D6
  54. ldr r0, =flag_hook|1
  55. bx r0
  56. lsl r0, #0
  57. .pool
  58. .org 0x0806E584
  59. ldr r3, =var_set_hack|1
  60. bx r3
  61. .pool
  62. .org 0x0806E568
  63. ldr r3, =var_get_hack|1
  64. bx r3
  65. .pool
  66. .org 0x0806E680
  67. ldr r1, =flag_set_hack|1
  68. bx r1
  69. .pool
  70. //end of flag routine
  71. //var routine
  72. .org 0x0806E45C
  73. ldr r0,=var_hook+1
  74. bx r0
  75. .pool
  76. .org 0x0806A390
  77. ldr r3, =var_set_script_hack|1
  78. bx r3
  79. .pool
  80. //end of var routine
  81. .org 0x0804C034
  82. ldr r0, =clear_sav1|1
  83. bx r0
  84. .pool
  85. //trainer Flag stuff
  86. .org 0x08080378
  87. ldr r1, =trainerflag_read_fix+1
  88. bx r1
  89. .pool
  90. .org 0x080800B8
  91. ldr r2, =trainerflag_opponent_fix+1
  92. bx r2
  93. .pool
  94. .org 0x08080424
  95. ldr r1, =trainerflag_check_fix+1
  96. bx r1
  97. .pool
  98. .org 0x0808043c
  99. ldr r1, =trainerflag_set_fix+1
  100. bx r1
  101. .pool
  102. .org 0x08080450
  103. ldr r1, =trainerflag_clear_fix+1
  104. bx r1
  105. .pool
  106. //end of trainer flag stuff
  107. //New behavior bytes for jumping
  108. .org 0x0806811A
  109. ldr r0,=jump_behavior|1
  110. bx r0
  111. .pool
  112. //behavior walk stuff
  113. .org 0x0806D720
  114. ldr r0,=on_step|1
  115. bx r0
  116. .pool
  117. //end of new behavior bytes for jumping
  118. //transparent textboxes and mugshots
  119. .org 0x08069410
  120. bx r0
  121. .org 0x0806941C
  122. .word trans_activate|1
  123. .org 0x08069504
  124. bx r1
  125. .org 0x0806950C
  126. .word trans_deactivate|1
  127. .org 0x08150000
  128. ldr r0, =pal_load_hook_2|1
  129. bx r0
  130. .pool
  131. .org 0x0815044A
  132. bx r1
  133. .org 0x08150450
  134. .word pal_load_hook|1
  135. .org 0x0809CEB2
  136. ldr r0, =trans_mug_close_fix+1
  137. bx r0
  138. lsl r0, #0
  139. .pool
  140. //end of transparent textboxes and mugshots
  141. //saveblock routine start
  142. .org 0x080D9EDC
  143. ldr r0, =load_hijack|1
  144. bx r0
  145. .pool
  146. .org 0x080d991E
  147. bx r7
  148. .org 0x080d995C
  149. .word store_hijack|1
  150. .org 0x083FEC94
  151. .include "patches/save_table/save_table.s"
  152. //end of saveblock routine
  153. //new battle script commands
  154. //replace tables
  155. .org 0x08014C1C
  156. .word bs_command_table
  157. .org 0x08015A28
  158. .word bs_command_table
  159. .org 0x08015C6C
  160. .word bs_command_table
  161. .org 0x08015C98
  162. .word bs_command_table
  163. .org 0x0801D054
  164. .word bs_command_table
  165. //end of new battle script commands
  166. //move effect table
  167. .org 0x08016364
  168. .word m_effect_table
  169. .org 0x08023328
  170. .word m_effect_table
  171. .org 0x08025CF8
  172. .word m_effect_table
  173. .org 0x08027464
  174. .word m_effect_table
  175. .org 0x080297F0
  176. .word m_effect_table
  177. .org 0x0802BE80
  178. .word m_effect_table
  179. //end of move effect table
  180. //move limits
  181. .org 0x080D75FC
  182. .byte 0,0,0,0,0,0
  183. //end of move limits
  184. //print string mod
  185. .org 0x080D77C0
  186. bx r1
  187. .org 0x080D77CC
  188. .word custom_print_string|1
  189. //end of print string mod
  190. //new move animation table
  191. .org 0x080725d0
  192. .word m_animation_table
  193. //end of new move animation table