Brak opisu

hooks.asm 4.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  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 26758 Hz samplerate
  15. .byte 0x00, 0xCC, 0x98, 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 0x081DD0F4
  28. LDR R1, =music_override|1 // TODO wait for replacement by functions below, but can stay for now
  29. BX R1
  30. .pool
  31. .org 0x0808064C // intro music (!) song hook
  32. LDR R1, =mhk_intro_music_id_to_song|1
  33. BL _call_via_r1
  34. B 0x080806BA
  35. .pool
  36. .org 0x08043FD4 // batle music song hook
  37. LDR R0, =mhk_song_id_for_battle|1
  38. BX R0
  39. .pool
  40. .org 0x080156FE // trainer victory music hook
  41. LDR R0, =mhk_trainer_battle_play_defeat|1
  42. BL _call_via_r0
  43. B 0x0801576E
  44. .pool
  45. .org 0x08021D46 // wild poke defeated
  46. BL _call_via_r0 // call via r0
  47. .org 0x08021D94
  48. .word mhk_wild_poke_def_music|1
  49. .org 0x0807F9F8
  50. LDR R1, =0x0807FA3E
  51. BL _call_via_r1 // call via r1
  52. MOV R1, R0
  53. B 0x0807FA3E
  54. .pool
  55. //End of sound stuff
  56. //Don't know what thats all about... leaving it commented for now
  57. //.org 0x0800f268
  58. // .halfword 0xE000
  59. //Battle bg use new table
  60. .org 0x0800F2A0
  61. .word battle_bg_table
  62. .org 0x0800F2E0
  63. .word battle_bg_table
  64. .org 0x0800F320
  65. .word battle_bg_table
  66. .org 0x0800F40E
  67. ldr r0, =battle_bg_hook|1
  68. bx r0
  69. lsl r0, #0
  70. .pool
  71. .org 0x0800FD5C
  72. .word battle_bg_table
  73. .org 0x0800FD88
  74. .word battle_bg_table
  75. //end of battle bg table
  76. //flag routine
  77. .org 0x0806E5D6
  78. ldr r0, =flag_hook|1
  79. bx r0
  80. lsl r0, #0
  81. .pool
  82. //end of flag routine
  83. //var routine
  84. .org 0x0806E45C
  85. ldr r0,=var_hook+1
  86. bx r0
  87. .pool
  88. //end of var routine
  89. //trainer Flag stuff
  90. .org 0x08080382
  91. mov r1, #0x80
  92. lsl r1, #0x15
  93. .org 0x080800BA
  94. mov r2, #0x80
  95. lsl r2, #0x5
  96. .org 0x08080428
  97. mov r1, #0x80
  98. lsl r1, #0x15
  99. .org 0x08080440
  100. mov r1, #0x80
  101. lsl r1, #0x15
  102. .org 0x08080454
  103. mov r1, #0x80
  104. lsl r1, #0x15
  105. //end of trainer flag stuff
  106. //New behavior bytes for jumping
  107. .org 0x0806811A
  108. ldr r0,=jump_behavior|1
  109. bx r0
  110. .pool
  111. //behavior walk stuff
  112. .org 0x0806D720
  113. ldr r0,=on_step|1
  114. bx r0
  115. .pool
  116. //end of new behavior bytes for jumping
  117. //transparent textboxes and mugshots
  118. .org 0x08069410
  119. bx r0
  120. .org 0x0806941C
  121. .word trans_activate|1
  122. .org 0x08069504
  123. bx r1
  124. .org 0x0806950C
  125. .word trans_deactivate|1
  126. .org 0x08150000
  127. ldr r0, =pal_load_hook_2|1
  128. bx r0
  129. .pool
  130. .org 0x0815044A
  131. bx r1
  132. .org 0x08150450
  133. .word pal_load_hook|1
  134. .org 0x0809CEB2
  135. ldr r0, =trans_mug_close_fix+1
  136. bx r0
  137. lsl r0, #0
  138. .pool
  139. //end of transparent textboxes and mugshots
  140. //saveblock routine start
  141. .org 0x080D9EDC
  142. ldr r0, =load_hijack|1
  143. bx r0
  144. .pool
  145. .org 0x080d991E
  146. bx r7
  147. .org 0x080d995C
  148. .word store_hijack|1
  149. .org 0x083FEC94
  150. .include "patches/save_table/save_table.S"
  151. //end of saveblock routine
  152. //new battle script commands
  153. //replace tables
  154. .org 0x08014C1C
  155. .word bs_command_table
  156. .org 0x08015A28
  157. .word bs_command_table
  158. .org 0x08015C6C
  159. .word bs_command_table
  160. .org 0x08015C98
  161. .word bs_command_table
  162. .org 0x0801D054
  163. .word bs_command_table
  164. //end of new battle script commands
  165. //move effect table
  166. .org 0x08016364
  167. .word m_effect_table
  168. .org 0x08023328
  169. .word m_effect_table
  170. .org 0x08025CF8
  171. .word m_effect_table
  172. .org 0x08027464
  173. .word m_effect_table
  174. .org 0x080297F0
  175. .word m_effect_table
  176. .org 0x0802BE80
  177. .word m_effect_table
  178. //end of move effect table
  179. //move limits
  180. .org 0x080D75FC
  181. .byte 0,0,0,0,0,0
  182. //end of move limits
  183. //print string mod
  184. .org 0x080D77C0
  185. bx r1
  186. .org 0x080D77CC
  187. .word custom_print_string|1
  188. //end of print string mod
  189. //new move animation table
  190. .org 0x080725d0
  191. .word m_animation_table
  192. //end of new move animation table