暂无描述

hooks.asm 5.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  1. _call_via_r0 equ 0x081E3BA8
  2. _call_via_r1 equ 0x081E3BAC
  3. //Ipatix sound stuff
  4. .org 0x080007B4
  5. .word 0x0203E000 // new PCM work area
  6. .org 0x081DD0B4
  7. .word main_mixer // new mixer ROM location
  8. .word 0x03005F50 // new mixer RAM location (used for loading)
  9. .halfword mixer_size
  10. .halfword 0x400 // CpuSet, copy code by 32 bit units
  11. .word 0x0203E000 // new PCM work area
  12. .org 0x081DD0C8
  13. // set correct sound driver operation mode
  14. // 12 channels at 31536 Hz samplerate
  15. .byte 0x00, 0xCC, 0x99, 0x00
  16. .org 0x081DC094
  17. .word 0x03005F50+1 // new mixer RAM location (used for branch)
  18. // repoint correctly to the new cry tables
  19. .org 0x080720C8
  20. .include "patches/disable_cry_table_blocks.s"
  21. // cry-ID = poke-ID
  22. .org 0x08043304
  23. LSL R0, R0, #0x10
  24. LSR R0, R0, #0x10
  25. BX LR
  26. // music overrides
  27. .org 0x0808064C // encounter music ([!] Box) song hook
  28. LDR R1, =mhk_intro_music_id_to_song|1
  29. BL _call_via_r1
  30. B 0x080806BA
  31. .pool
  32. .org 0x08044090
  33. LDR R1, =mhk_current_map_music_set_default_for_battle|1
  34. BX R1
  35. .pool
  36. .org 0x080156FE // trainer victory music hook
  37. LDR R0, =mhk_trainer_battle_play_defeat|1
  38. BL _call_via_r0
  39. B 0x0801576E
  40. .pool
  41. .org 0x08021D46 // wild poke defeated
  42. BL _call_via_r0
  43. .org 0x08021D94
  44. .word mhk_wild_poke_def_music|1
  45. .org 0x0807F9F8
  46. LDR R1, =0x0807FA3E
  47. BL _call_via_r1
  48. MOV R1, R0
  49. B 0x0807FA3E
  50. .pool
  51. .org 0x080159D0
  52. LDR R0, =mhk_fadeout|1
  53. BL _call_via_r0
  54. B 0x080159DC
  55. .pool
  56. //End of sound stuff
  57. //Don't know what thats all about... leaving it commented for now
  58. //.org 0x0800f268
  59. // .halfword 0xE000
  60. // disable help menu
  61. // see: https://www.pokecommunity.com/showthread.php?t=364909
  62. .org 0x0813B8C2
  63. .halfword 0xE01D
  64. // decrease amount of valid file handles from 20 to 12 to free up some IRAM
  65. NUM_FILE_HANDLES equ 12
  66. .org 0x081E9948
  67. cmp r1, #(NUM_FILE_HANDLES - 1)
  68. .org 0x081E99E4
  69. add r0, #((NUM_FILE_HANDLES - 1) * 8)
  70. .org 0x081E9AA4
  71. cmp r6, #NUM_FILE_HANDLES
  72. .org 0x081E9ADE
  73. cmp r6, #NUM_FILE_HANDLES
  74. .org 0x081E9B1C
  75. cmp r6, #NUM_FILE_HANDLES
  76. bge 0x081E9B2E
  77. .org 0x081E9BA6
  78. cmp r7, #NUM_FILE_HANDLES
  79. bge 0x081E9BB8
  80. .org 0x081E9BDA
  81. cmp r0, #NUM_FILE_HANDLES
  82. blo 0x081E9BE2
  83. .org 0x081E9C84
  84. cmp r1, #NUM_FILE_HANDLES
  85. bge 0x081E9C94
  86. //flag routine
  87. .org 0x0806E5D6
  88. ldr r0, =flag_hook|1
  89. bx r0
  90. lsl r0, #0
  91. .pool
  92. .org 0x0806E584
  93. ldr r3, =var_set_hack|1
  94. bx r3
  95. .pool
  96. .org 0x0806E568
  97. ldr r3, =var_get_hack|1
  98. bx r3
  99. .pool
  100. .org 0x0806E680
  101. ldr r1, =flag_set_hack|1
  102. bx r1
  103. .pool
  104. //end of flag routine
  105. //var routine
  106. .org 0x0806E45C
  107. ldr r0,=var_hook+1
  108. bx r0
  109. .pool
  110. .org 0x0806A390
  111. ldr r3, =var_set_script_hack|1
  112. bx r3
  113. .pool
  114. //end of var routine
  115. .org 0x0804C034
  116. ldr r0, =clear_sav1|1
  117. bx r0
  118. .pool
  119. //trainer Flag stuff
  120. .org 0x08080378
  121. ldr r1, =trainerflag_read_fix+1
  122. bx r1
  123. .pool
  124. .org 0x080800B8
  125. ldr r2, =trainerflag_opponent_fix+1
  126. bx r2
  127. .pool
  128. .org 0x08080424
  129. ldr r1, =trainerflag_check_fix+1
  130. bx r1
  131. .pool
  132. .org 0x0808043c
  133. ldr r1, =trainerflag_set_fix+1
  134. bx r1
  135. .pool
  136. .org 0x08080450
  137. ldr r1, =trainerflag_clear_fix+1
  138. bx r1
  139. .pool
  140. //end of trainer flag stuff
  141. //New behavior bytes for jumping
  142. .org 0x0806811A
  143. ldr r0,=jump_behavior|1
  144. bx r0
  145. .pool
  146. //behavior walk stuff
  147. .org 0x0806D720
  148. ldr r0,=on_step|1
  149. bx r0
  150. .pool
  151. //end of new behavior bytes for jumping
  152. //transparent textboxes and mugshots
  153. .org 0x08069410
  154. bx r0
  155. .org 0x0806941C
  156. .word trans_activate|1
  157. .org 0x08069504
  158. bx r1
  159. .org 0x0806950C
  160. .word trans_deactivate|1
  161. .org 0x08150000
  162. ldr r0, =pal_load_hook_2|1
  163. bx r0
  164. .pool
  165. .org 0x0815044A
  166. bx r1
  167. .org 0x08150450
  168. .word pal_load_hook|1
  169. .org 0x0809CEB2
  170. ldr r0, =trans_mug_close_fix+1
  171. bx r0
  172. lsl r0, #0
  173. .pool
  174. //end of transparent textboxes and mugshots
  175. //saveblock routine start
  176. .org 0x080D9EDC
  177. ldr r0, =load_hijack|1
  178. bx r0
  179. .pool
  180. .org 0x080d991E
  181. bx r7
  182. .org 0x080d995C
  183. .word store_hijack|1
  184. .org 0x083FEC94
  185. .include "patches/save_table/save_table.s"
  186. //end of saveblock routine
  187. //new battle script commands
  188. //replace tables
  189. .org 0x08014C1C
  190. .word bs_command_table
  191. .org 0x08015A28
  192. .word bs_command_table
  193. .org 0x08015C6C
  194. .word bs_command_table
  195. .org 0x08015C98
  196. .word bs_command_table
  197. .org 0x0801D054
  198. .word bs_command_table
  199. //end of new battle script commands
  200. //move effect table
  201. .org 0x08016364
  202. .word m_effect_table
  203. .org 0x08023328
  204. .word m_effect_table
  205. .org 0x08025CF8
  206. .word m_effect_table
  207. .org 0x08027464
  208. .word m_effect_table
  209. .org 0x080297F0
  210. .word m_effect_table
  211. .org 0x0802BE80
  212. .word m_effect_table
  213. //end of move effect table
  214. //move limits
  215. .org 0x080D75FC
  216. .byte 0,0,0,0,0,0
  217. //end of move limits
  218. //print string mod
  219. .org 0x080D77C0
  220. bx r1
  221. .org 0x080D77CC
  222. .word custom_print_string|1
  223. //end of print string mod
  224. //new move animation table
  225. .org 0x080725d0
  226. .word m_animation_table
  227. //end of new move animation table