123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313 |
- _call_via_r0 equ 0x081E3BA8
- _call_via_r1 equ 0x081E3BAC
-
- //----------------------
- // ipatix sound stuff
- //----------------------
-
- .org 0x080007B4
- .word 0x0203E000 // new PCM work area
- .org 0x081DD0B4
- .word main_mixer // new mixer ROM location
- .word 0x03005F50 // new mixer RAM location (used for loading)
- .halfword mixer_size
- .halfword 0x400 // CpuSet, copy code by 32 bit units
- .word 0x0203E000 // new PCM work area
- .org 0x081DD0C8
- // set correct sound driver operation mode
- // 12 channels at 31536 Hz samplerate
- .byte 0x00, 0xCC, 0x99, 0x00
- .org 0x081DC094
- .word 0x03005F50+1 // new mixer RAM location (used for branch)
-
- // repoint correctly to the new cry tables
- .org 0x080720C8
- .include "patches/disable_cry_table_blocks.s"
-
- // cry-ID = poke-ID
- .org 0x08043304
- LSL R0, R0, #0x10
- LSR R0, R0, #0x10
- BX LR
-
- // music overrides
-
- .org 0x0808064C // encounter music ([!] Box) song hook
- LDR R1, =mhk_intro_music_id_to_song|1
- BL _call_via_r1
- B 0x080806BA
- .pool
-
- .org 0x08044090
- LDR R1, =mhk_current_map_music_set_default_for_battle|1
- BX R1
- .pool
-
- .org 0x080156FE // trainer victory music hook
- LDR R0, =mhk_trainer_battle_play_defeat|1
- BL _call_via_r0
- B 0x0801576E
- .pool
-
- .org 0x08021D46 // wild poke defeated
- BL _call_via_r0
- .org 0x08021D94
- .word mhk_wild_poke_def_music|1
-
- .org 0x0807F9F8
- LDR R1, =0x0807FA3E
- BL _call_via_r1
- MOV R1, R0
- B 0x0807FA3E
- .pool
-
- .org 0x080159D0
- LDR R0, =mhk_fadeout|1
- BL _call_via_r0
- B 0x080159DC
- .pool
-
- //---------------------
- // ipatix misc stuff
- //---------------------
-
- // disable help menu
- // see: https://www.pokecommunity.com/showthread.php?t=364909
- .org 0x0813B8C2
- .halfword 0xE01D
-
- // idle loop eliminiation
- .org 0x080008A4
- cmp r0, #0
- bne ile_end_wait
- mov r3, #1
- ile_idle_loop:
- swi #2
- ldrh r1, [r2, #0x1c]
- mov r0, r3
- and r0, r1
- beq ile_idle_loop
- ile_end_wait:
- pop {r0}
- bx r0
-
- //--------------
- // IRAM hacks
- //--------------
-
- // decrease amount of valid file handles from 20 to 12 to free up some IRAM
- NUM_FILE_HANDLES equ 12
- .org 0x081E9948
- cmp r1, #(NUM_FILE_HANDLES - 1)
- .org 0x081E99E4
- add r0, #((NUM_FILE_HANDLES - 1) * 8)
- .org 0x081E9AA4
- cmp r6, #NUM_FILE_HANDLES
- .org 0x081E9ADE
- cmp r6, #NUM_FILE_HANDLES
- .org 0x081E9B1C
- cmp r6, #NUM_FILE_HANDLES
- bge 0x081E9B2E
- .org 0x081E9BA6
- cmp r7, #NUM_FILE_HANDLES
- bge 0x081E9BB8
- .org 0x081E9BDA
- cmp r0, #NUM_FILE_HANDLES
- blo 0x081E9BE2
- .org 0x081E9C84
- cmp r1, #NUM_FILE_HANDLES
- bge 0x081E9C94
-
- //----------------
- // S-Bird stuff
- //----------------
-
- //Don't know what thats all about... leaving it commented for now
- //.org 0x0800f268
- // .halfword 0xE000
-
-
- //flag routine
- .org 0x0806E5D6
- ldr r0, =flag_hook|1
- bx r0
- lsl r0, #0
- .pool
-
- .org 0x0806E584
- ldr r3, =var_set_hack|1
- bx r3
- .pool
-
- .org 0x0806E568
- ldr r3, =var_get_hack|1
- bx r3
- .pool
-
- .org 0x0806E680
- ldr r1, =flag_set_hack|1
- bx r1
- .pool
- //end of flag routine
-
- //var routine
- .org 0x0806E45C
- ldr r0,=var_hook+1
- bx r0
- .pool
-
- .org 0x0806A390
- ldr r3, =var_set_script_hack|1
- bx r3
- .pool
-
- //end of var routine
-
- .org 0x0804C034
- ldr r0, =clear_sav1|1
- bx r0
- .pool
-
- //trainer Flag stuff
- .org 0x08080378
- ldr r1, =trainerflag_read_fix+1
- bx r1
- .pool
-
- .org 0x080800B8
- ldr r2, =trainerflag_opponent_fix+1
- bx r2
- .pool
-
- .org 0x08080424
- ldr r1, =trainerflag_check_fix+1
- bx r1
- .pool
-
- .org 0x0808043c
- ldr r1, =trainerflag_set_fix+1
- bx r1
- .pool
-
- .org 0x08080450
- ldr r1, =trainerflag_clear_fix+1
- bx r1
- .pool
- //end of trainer flag stuff
-
- //New behavior bytes for jumping
-
- .org 0x0806811A
- ldr r0,=jump_behavior|1
- bx r0
- .pool
-
- //behavior walk stuff
- .org 0x0806D720
- ldr r0,=on_step|1
- bx r0
- .pool
-
- //end of new behavior bytes for jumping
-
- //transparent textboxes and mugshots
- .org 0x08069410
- bx r0
-
- .org 0x0806941C
- .word trans_activate|1
-
- .org 0x08069504
- bx r1
-
- .org 0x0806950C
- .word trans_deactivate|1
-
- .org 0x08150000
- ldr r0, =pal_load_hook_2|1
- bx r0
- .pool
-
- .org 0x0815044A
- bx r1
-
- .org 0x08150450
- .word pal_load_hook|1
-
- .org 0x0809CEB2
- ldr r0, =trans_mug_close_fix+1
- bx r0
- lsl r0, #0
- .pool
-
- //end of transparent textboxes and mugshots
-
- //saveblock routine start
-
- .org 0x080D9EDC
- ldr r0, =load_hijack|1
- bx r0
- .pool
-
- .org 0x080d991E
- bx r7
- .org 0x080d995C
- .word store_hijack|1
-
- .org 0x083FEC94
- .include "patches/save_table/save_table.s"
-
- //end of saveblock routine
- //new battle script commands
- //replace tables
- .org 0x08014C1C
- .word bs_command_table
- .org 0x08015A28
- .word bs_command_table
- .org 0x08015C6C
- .word bs_command_table
- .org 0x08015C98
- .word bs_command_table
- .org 0x0801D054
- .word bs_command_table
-
- //end of new battle script commands
-
- //move effect table
-
- .org 0x08016364
- .word m_effect_table
- .org 0x08023328
- .word m_effect_table
- .org 0x08025CF8
- .word m_effect_table
- .org 0x08027464
- .word m_effect_table
- .org 0x080297F0
- .word m_effect_table
- .org 0x0802BE80
- .word m_effect_table
-
- //end of move effect table
-
- //move limits
-
- .org 0x080D75FC
- .byte 0,0,0,0,0,0
-
- //end of move limits
-
- //print string mod
-
- .org 0x080D77C0
- bx r1
-
- .org 0x080D77CC
- .word custom_print_string|1
-
- //end of print string mod
-
- //new move animation table
- .org 0x080725d0
- .word m_animation_table
- //end of new move animation table
|