diff options
-rw-r--r-- | asm/macros/battle_ai_script.inc | 170 | ||||
-rw-r--r-- | asm/macros/battle_anim_script.inc | 112 | ||||
-rw-r--r-- | asm/macros/battle_script.inc | 438 | ||||
-rw-r--r-- | asm/macros/event.inc | 370 | ||||
-rw-r--r-- | include/event_object_movement.h | 25 | ||||
-rw-r--r-- | include/overworld.h | 7 | ||||
-rw-r--r-- | include/string_util.h | 1 | ||||
-rw-r--r-- | src/data/items.h | 14 | ||||
-rw-r--r-- | src/event_object_movement.c | 22 |
9 files changed, 576 insertions, 583 deletions
diff --git a/asm/macros/battle_ai_script.inc b/asm/macros/battle_ai_script.inc index 28f60be46..4c7646d6f 100644 --- a/asm/macros/battle_ai_script.inc +++ b/asm/macros/battle_ai_script.inc @@ -1,206 +1,206 @@ - .macro if_random_less_than param0, param1 + .macro if_random_less_than param0:req, param1:req .byte 0x0 .byte \param0 .4byte \param1 .endm - .macro if_random_greater_than param0, param1 + .macro if_random_greater_than param0:req, param1:req .byte 0x1 .byte \param0 .4byte \param1 .endm - .macro if_random_equal param0, param1 + .macro if_random_equal param0:req, param1:req .byte 0x2 .byte \param0 .4byte \param1 .endm - .macro if_random_not_equal param0, param1 + .macro if_random_not_equal param0:req, param1:req .byte 0x3 .byte \param0 .4byte \param1 .endm - .macro score param0 + .macro score param0:req .byte 0x4 .byte \param0 .endm - .macro if_hp_less_than battler, param1, param2 + .macro if_hp_less_than battler:req, param1:req, param2:req .byte 0x5 .byte \battler .byte \param1 .4byte \param2 .endm - .macro if_hp_more_than battler, param1, param2 + .macro if_hp_more_than battler:req, param1:req, param2:req .byte 0x6 .byte \battler .byte \param1 .4byte \param2 .endm - .macro if_hp_equal battler, param1, param2 + .macro if_hp_equal battler:req, param1:req, param2:req .byte 0x7 .byte \battler .byte \param1 .4byte \param2 .endm - .macro if_hp_not_equal battler, param1, param2 + .macro if_hp_not_equal battler:req, param1:req, param2:req .byte 0x8 .byte \battler .byte \param1 .4byte \param2 .endm - .macro if_status battler, status1, param2 + .macro if_status battler:req, status1:req, param2:req .byte 0x9 .byte \battler .4byte \status1 .4byte \param2 .endm - .macro if_not_status battler, status1, param2 + .macro if_not_status battler:req, status1:req, param2:req .byte 0xa .byte \battler .4byte \status1 .4byte \param2 .endm - .macro if_status2 battler, status2, param2 + .macro if_status2 battler:req, status2:req, param2:req .byte 0xb .byte \battler .4byte \status2 .4byte \param2 .endm - .macro if_not_status2 battler, status2, param2 + .macro if_not_status2 battler:req, status2:req, param2:req .byte 0xc .byte \battler .4byte \status2 .4byte \param2 .endm - .macro if_status3 battler, status3, param2 + .macro if_status3 battler:req, status3:req, param2:req .byte 0xd .byte \battler .4byte \status3 .4byte \param2 .endm - .macro if_not_status3 battler, status3, param2 + .macro if_not_status3 battler:req, status3:req, param2:req .byte 0xe .byte \battler .4byte \status3 .4byte \param2 .endm - .macro if_side_affecting battler, sidestatus, param2 + .macro if_side_affecting battler:req, sidestatus:req, param2:req .byte 0xf .byte \battler .4byte \sidestatus .4byte \param2 .endm - .macro if_not_side_affecting battler, sidestatus, param2 + .macro if_not_side_affecting battler:req, sidestatus:req, param2:req .byte 0x10 .byte \battler .4byte \sidestatus .4byte \param2 .endm - .macro if_less_than param0, param1 + .macro if_less_than param0:req, param1:req .byte 0x11 .byte \param0 .4byte \param1 .endm - .macro if_more_than param0, param1 + .macro if_more_than param0:req, param1:req .byte 0x12 .byte \param0 .4byte \param1 .endm - .macro if_equal param0, param1 + .macro if_equal param0:req, param1:req .byte 0x13 .byte \param0 .4byte \param1 .endm - .macro if_not_equal param0, param1 + .macro if_not_equal param0:req, param1:req .byte 0x14 .byte \param0 .4byte \param1 .endm - .macro if_less_than_ptr param0, param1 + .macro if_less_than_ptr param0:req, param1:req .byte 0x15 .4byte \param0 .4byte \param1 .endm - .macro if_more_than_ptr param0, param1 + .macro if_more_than_ptr param0:req, param1:req .byte 0x16 .4byte \param0 .4byte \param1 .endm - .macro if_equal_ptr param0, param1 + .macro if_equal_ptr param0:req, param1:req .byte 0x17 .4byte \param0 .4byte \param1 .endm - .macro if_not_equal_ptr param0, param1 + .macro if_not_equal_ptr param0:req, param1:req .byte 0x18 .4byte \param0 .4byte \param1 .endm - .macro if_move param0, param1 + .macro if_move param0:req, param1:req .byte 0x19 .2byte \param0 .4byte \param1 .endm - .macro if_not_move param0, param1 + .macro if_not_move param0:req, param1:req .byte 0x1a .2byte \param0 .4byte \param1 .endm - .macro if_in_bytes param0, param1 + .macro if_in_bytes param0:req, param1:req .byte 0x1b .4byte \param0 .4byte \param1 .endm - .macro if_not_in_bytes param0, param1 + .macro if_not_in_bytes param0:req, param1:req .byte 0x1c .4byte \param0 .4byte \param1 .endm - .macro if_in_hwords param0, param1 + .macro if_in_hwords param0:req, param1:req .byte 0x1d .4byte \param0 .4byte \param1 .endm - .macro if_not_in_hwords param0, param1 + .macro if_not_in_hwords param0:req, param1:req .byte 0x1e .4byte \param0 .4byte \param1 .endm - .macro if_user_has_attacking_move param0 + .macro if_user_has_attacking_move param0:req .byte 0x1f .4byte \param0 .endm - .macro if_user_has_no_attacking_moves param0 + .macro if_user_has_no_attacking_moves param0:req .byte 0x20 .4byte \param0 .endm @@ -209,7 +209,7 @@ .byte 0x21 .endm - .macro get_type param0 + .macro get_type param0:req .byte 0x22 .byte \param0 .endm @@ -222,30 +222,30 @@ .byte 0x24 .endm - .macro get_last_used_bank_move battler + .macro get_last_used_bank_move battler:req .byte 0x25 .byte \battler .endm - .macro if_equal_ param0, param1 + .macro if_equal_ param0:req, param1:req .byte 0x26 .byte \param0 .4byte \param1 .endm - .macro if_not_equal_ param0, param1 + .macro if_not_equal_ param0:req, param1:req .byte 0x27 .byte \param0 .4byte \param1 .endm - .macro if_user_goes param0, param1 + .macro if_user_goes param0:req, param1:req .byte 0x28 .byte \param0 .4byte \param1 .endm - .macro if_user_doesnt_go param0, param1 + .macro if_user_doesnt_go param0:req, param1:req .byte 0x29 .byte \param0 .4byte \param1 @@ -259,7 +259,7 @@ .byte 0x2b .endm - .macro count_usable_party_mons battler + .macro count_usable_party_mons battler:req .byte 0x2c .byte \battler .endm @@ -272,7 +272,7 @@ .byte 0x2e .endm - .macro get_ability battler + .macro get_ability battler:req .byte 0x2f .byte \battler .endm @@ -281,7 +281,7 @@ .byte 0x30 .endm - .macro if_type_effectiveness param0, param1 + .macro if_type_effectiveness param0:req, param1:req .byte 0x31 .byte \param0 .4byte \param1 @@ -295,14 +295,14 @@ .byte 0x33 .endm - .macro if_status_in_party battler, status1, param2 + .macro if_status_in_party battler:req, status1:req, param2:req .byte 0x34 .byte \battler .4byte \status1 .4byte \param2 .endm - .macro if_status_not_in_party battler, status1, param2 + .macro if_status_not_in_party battler:req, status1:req, param2:req .byte 0x35 .byte \battler .4byte \status1 @@ -313,19 +313,19 @@ .byte 0x36 .endm - .macro if_effect param0, param1 + .macro if_effect param0:req, param1:req .byte 0x37 .byte \param0 .4byte \param1 .endm - .macro if_not_effect param0, param1 + .macro if_not_effect param0:req, param1:req .byte 0x38 .byte \param0 .4byte \param1 .endm - .macro if_stat_level_less_than battler, stat, param2, param3 + .macro if_stat_level_less_than battler:req, stat:req, param2:req, param3:req .byte 0x39 .byte \battler .byte \stat @@ -333,7 +333,7 @@ .4byte \param3 .endm - .macro if_stat_level_more_than battler, stat, param2, param3 + .macro if_stat_level_more_than battler:req, stat:req, param2:req, param3:req .byte 0x3a .byte \battler .byte \stat @@ -341,7 +341,7 @@ .4byte \param3 .endm - .macro if_stat_level_equal battler, stat, param2, param3 + .macro if_stat_level_equal battler:req, stat:req, param2:req, param3:req .byte 0x3b .byte \battler .byte \stat @@ -349,7 +349,7 @@ .4byte \param3 .endm - .macro if_stat_level_not_equal battler, stat, param2, param3 + .macro if_stat_level_not_equal battler:req, stat:req, param2:req, param3:req .byte 0x3c .byte \battler .byte \stat @@ -357,52 +357,52 @@ .4byte \param3 .endm - .macro if_can_faint param0 + .macro if_can_faint param0:req .byte 0x3d .4byte \param0 .endm - .macro if_cant_faint param0 + .macro if_cant_faint param0:req .byte 0x3e .4byte \param0 .endm - .macro if_has_move battler, param1, param2 + .macro if_has_move battler:req, param1:req, param2:req .byte 0x3f .byte \battler .2byte \param1 .4byte \param2 .endm - .macro if_doesnt_have_move battler, param1, param2 + .macro if_doesnt_have_move battler:req, param1:req, param2:req .byte 0x40 .byte \battler .2byte \param1 .4byte \param2 .endm - .macro if_has_move_with_effect battler, param1, param2 + .macro if_has_move_with_effect battler:req, param1:req, param2:req .byte 0x41 .byte \battler .byte \param1 .4byte \param2 .endm - .macro if_doesnt_have_move_with_effect battler, param1, param2 + .macro if_doesnt_have_move_with_effect battler:req, param1:req, param2:req .byte 0x42 .byte \battler .byte \param1 .4byte \param2 .endm - .macro if_any_move_disabled_or_encored battler, param1, param2 + .macro if_any_move_disabled_or_encored battler:req, param1:req, param2:req .byte 0x43 .byte \battler .byte \param1 .4byte \param2 .endm - .macro if_curr_move_disabled_or_encored param0, param1 + .macro if_curr_move_disabled_or_encored param0:req, param1:req .byte 0x44 .byte \param0 .4byte \param1 @@ -412,7 +412,7 @@ .byte 0x45 .endm - .macro if_random_safari_flee param0 + .macro if_random_safari_flee param0:req .byte 0x46 .4byte \param0 .endm @@ -421,22 +421,22 @@ .byte 0x47 .endm - .macro get_hold_effect battler + .macro get_hold_effect battler:req .byte 0x48 .byte \battler .endm - .macro get_gender battler + .macro get_gender battler:req .byte 0x49 .byte \battler .endm - .macro is_first_turn_for battler + .macro is_first_turn_for battler:req .byte 0x4a .byte \battler .endm - .macro get_stockpile_count battler + .macro get_stockpile_count battler:req .byte 0x4b .byte \battler .endm @@ -445,7 +445,7 @@ .byte 0x4c .endm - .macro get_used_held_item battler + .macro get_used_held_item battler:req .byte 0x4d .byte \battler .endm @@ -462,7 +462,7 @@ .byte 0x50 .endm - .macro get_protect_count battler + .macro get_protect_count battler:req .byte 0x51 .byte \battler .endm @@ -491,12 +491,12 @@ .byte 0x57 .endm - .macro call param0 + .macro call param0:req .byte 0x58 .4byte \param0 .endm - .macro goto param0 + .macro goto param0:req .byte 0x59 .4byte \param0 .endm @@ -505,46 +505,46 @@ .byte 0x5a .endm - .macro if_level_cond param0, param1 + .macro if_level_cond param0:req, param1:req .byte 0x5b .byte \param0 .4byte \param1 .endm - .macro if_target_taunted param0 + .macro if_target_taunted param0:req .byte 0x5c .4byte \param0 .endm - .macro if_target_not_taunted param0 + .macro if_target_not_taunted param0:req .byte 0x5d .4byte \param0 .endm - .macro if_target_is_ally param0 + .macro if_target_is_ally param0:req .byte 0x5e .4byte \param0 .endm - .macro is_of_type battler, type + .macro is_of_type battler:req, type:req .byte 0x5f .byte \battler .byte \type .endm - .macro check_ability battler, ability + .macro check_ability battler:req, ability:req .byte 0x60 .byte \battler .byte \ability .endm - .macro if_flash_fired battler, param1 + .macro if_flash_fired battler:req, param1:req .byte 0x61 .byte \battler .4byte \param1 .endm - .macro if_holds_item battler, param1, param2 + .macro if_holds_item battler:req, param1:req, param2:req .byte 0x62 .byte \battler .2byte \param1 @@ -572,48 +572,48 @@ get_type AI_TYPE2_TARGET .endm - .macro if_ability battler, ability, ptr + .macro if_ability battler:req, ability:req, ptr:req check_ability \battler, \ability if_equal 1, \ptr .endm - .macro if_no_ability battler, ability, ptr + .macro if_no_ability battler:req, ability:req, ptr:req check_ability \battler, \ability if_equal 0, \ptr .endm - .macro if_type battler, type, ptr + .macro if_type battler:req, type:req, ptr:req is_of_type \battler, \type if_equal 1, \ptr .endm - .macro if_no_type battler, type, ptr + .macro if_no_type battler:req, type:req, ptr:req is_of_type \battler, \type if_equal 0, \ptr .endm - .macro if_target_faster ptr + .macro if_target_faster ptr:req if_user_goes 1, \ptr .endm - .macro if_user_faster ptr + .macro if_user_faster ptr:req if_user_goes 0, \ptr .endm - .macro if_double_battle ptr + .macro if_double_battle ptr:req is_double_battle if_equal 1, \ptr .endm - .macro if_not_double_battle ptr + .macro if_not_double_battle ptr:req is_double_battle if_equal 0, \ptr .endm - .macro if_any_move_disabled battler, ptr + .macro if_any_move_disabled battler:req, ptr:req if_any_move_disabled_or_encored \battler, 0, \ptr .endm - .macro if_any_move_encored battler, ptr + .macro if_any_move_encored battler:req, ptr:req if_any_move_disabled_or_encored \battler, 1, \ptr .endm diff --git a/asm/macros/battle_anim_script.inc b/asm/macros/battle_anim_script.inc index ab27bc23d..6ccd8d505 100644 --- a/asm/macros/battle_anim_script.inc +++ b/asm/macros/battle_anim_script.inc @@ -1,16 +1,16 @@ @ commands - .macro loadspritegfx param0 + .macro loadspritegfx tag:req .byte 0x0 - .2byte \param0 + .2byte \tag .endm - .macro unloadspritegfx param0 + .macro unloadspritegfx tag:req .byte 0x1 - .2byte \param0 + .2byte \tag .endm -.macro createsprite template, anim_battler, subpriority_offset, argv:vararg +.macro createsprite template:req, anim_battler:req, subpriority_offset:req, argv:vararg .byte 0x02 .4byte \template .if \anim_battler == ANIM_TARGET @@ -24,7 +24,7 @@ .Lsprite_\@_2: .endm - .macro createvisualtask addr, priority, argv:vararg + .macro createvisualtask addr:req, priority:req, argv:vararg .byte 0x03 .4byte \addr .byte \priority @@ -34,7 +34,7 @@ .Lcreatetask_\@_2: .endm - .macro delay param0 + .macro delay param0:req .byte 0x4 .byte \param0 .endm @@ -55,22 +55,22 @@ .byte 0x8 .endm - .macro playse param0 + .macro playse se:req .byte 0x9 - .2byte \param0 + .2byte \se .endm - .macro monbg battler + .macro monbg battler:req .byte 0xa .byte \battler .endm - .macro clearmonbg battler + .macro clearmonbg battler:req .byte 0xb .byte \battler .endm - .macro setalpha eva, evb + .macro setalpha eva:req, evb:req .byte 0x0C .2byte ((\evb) << 8) | (\eva) .endm @@ -79,7 +79,7 @@ .byte 0xd .endm - .macro call param0 + .macro call param0:req .byte 0xe .4byte \param0 .endm @@ -88,32 +88,32 @@ .byte 0xf .endm - .macro setarg param0, param1 + .macro setarg param0:req, param1:req .byte 0x10 .byte \param0 .2byte \param1 .endm - .macro choosetwoturnanim param0, param1 + .macro choosetwoturnanim param0:req, param1:req .byte 0x11 .4byte \param0 .4byte \param1 .endm - .macro jumpifmoveturn param0, param1 + .macro jumpifmoveturn param0:req, ptr:req .byte 0x12 .byte \param0 - .4byte \param1 + .4byte \ptr .endm - .macro goto param0 + .macro goto ptr:req .byte 0x13 - .4byte \param0 + .4byte \ptr .endm - .macro fadetobg param0 + .macro fadetobg bg:req .byte 0x14 - .byte \param0 + .byte \bg .endm .macro restorebg @@ -128,52 +128,52 @@ .byte 0x17 .endm - .macro changebg param0 + .macro changebg bg:req .byte 0x18 - .byte \param0 + .byte \bg .endm - .macro playsewithpan param0, param1 + .macro playsewithpan se:req, pan:req .byte 0x19 - .2byte \param0 - .byte \param1 + .2byte \se + .byte \pan .endm - .macro setpan param0 + .macro setpan pan:req .byte 0x1a - .byte \param0 + .byte \pan .endm - .macro panse_1B param0, param1, param2, param3, param4 + .macro panse_1B se:req, param1:req, param2:req, param3:req, param4 .byte 0x1b - .2byte \param0 + .2byte \se .byte \param1 .byte \param2 .byte \param3 .byte \param4 .endm - .macro loopsewithpan param0, param1, param2, param3 + .macro loopsewithpan se:req, param1:req, param2:req, param3:req .byte 0x1c - .2byte \param0 + .2byte \se .byte \param1 .byte \param2 .byte \param3 .endm - .macro waitplaysewithpan param0, param1, param2 + .macro waitplaysewithpan se:req, param1:req, param2:req .byte 0x1d - .2byte \param0 + .2byte \se .byte \param1 .byte \param2 .endm - .macro setbldcnt param0 + .macro setbldcnt param0:req .byte 0x1e .2byte \param0 .endm - .macro createsoundtask addr, argv:vararg + .macro createsoundtask addr:req, argv:vararg .byte 0x1F .4byte \addr .byte (.Lcreatetask_1F_\@_2 - .Lcreatetask_1F_\@_1) / 2 @@ -186,54 +186,54 @@ .byte 0x20 .endm - .macro jumpargeq param0, param1, param2 + .macro jumpargeq param0:req, param1:req, ptr:req .byte 0x21 .byte \param0 .2byte \param1 - .4byte \param2 + .4byte \ptr .endm - .macro monbg_22 battler + .macro monbg_22 battler:req .byte 0x22 .byte \battler .endm - .macro clearmonbg_23 battler + .macro clearmonbg_23 battler:req .byte 0x23 .byte \battler .endm - .macro jumpifcontest param0 + .macro jumpifcontest ptr:req .byte 0x24 - .4byte \param0 + .4byte \ptr .endm - .macro fadetobgfromset param0, param1, param2 + .macro fadetobgfromset param0:req, param1:req, param2:req .byte 0x25 .byte \param0 .byte \param1 .byte \param2 .endm - .macro panse_26 param0, param1, param2, param3, param4 + .macro panse_26 se:req, param1:req, param2:req, param3:req, param4 .byte 0x26 - .2byte \param0 + .2byte \se .byte \param1 .byte \param2 .byte \param3 .byte \param4 .endm - .macro panse_27 param0, param1, param2, param3, param4 + .macro panse_27 se:req, param1:req, param2:req, param3:req, param4 .byte 0x27 - .2byte \param0 + .2byte \se .byte \param1 .byte \param2 .byte \param3 .byte \param4 .endm - .macro monbgprio_28 battler + .macro monbgprio_28 battler:req .byte 0x28 .byte \battler .endm @@ -242,27 +242,27 @@ .byte 0x29 .endm - .macro monbgprio_2A battler + .macro monbgprio_2A battler:req .byte 0x2a .byte \battler .endm - .macro invisible battler + .macro invisible battler:req .byte 0x2b .byte \battler .endm - .macro visible battler + .macro visible battler:req .byte 0x2c .byte \battler .endm - .macro doublebattle_2D battler + .macro doublebattle_2D battler:req .byte 0x2d .byte \battler .endm - .macro doublebattle_2E battler + .macro doublebattle_2E battler:req .byte 0x2e .byte \battler .endm @@ -272,14 +272,14 @@ .endm @ useful macros - .macro jumpreteq value, ptr + .macro jumpreteq value:req, ptr:req jumpargeq ARG_RET_ID, \value, \ptr .endm - .macro jumprettrue ptr + .macro jumprettrue ptr:req jumpreteq TRUE, \ptr .endm - .macro jumpretfalse ptr + .macro jumpretfalse ptr:req jumpreteq FALSE, \ptr .endm diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index 8ab0f3ce5..6b0e285b6 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -3,7 +3,7 @@ .byte 0x0 .endm - .macro accuracycheck param0, param1 + .macro accuracycheck param0:req, param1:req .byte 0x1 .4byte \param0 .2byte \param1 @@ -45,12 +45,12 @@ .byte 0xa .endm - .macro healthbarupdate battler + .macro healthbarupdate battler:req .byte 0xb .byte \battler .endm - .macro datahpupdate battler + .macro datahpupdate battler:req .byte 0xc .byte \battler .endm @@ -67,29 +67,29 @@ .byte 0xf .endm - .macro printstring param0 + .macro printstring id:req .byte 0x10 - .2byte \param0 + .2byte \id .endm - .macro printselectionstring param0 + .macro printselectionstring id:req .byte 0x11 - .2byte \param0 + .2byte \id .endm - .macro waitmessage param0 + .macro waitmessage param0:req .byte 0x12 .2byte \param0 .endm - .macro printfromtable param0 + .macro printfromtable ptr:req .byte 0x13 - .4byte \param0 + .4byte \ptr .endm - .macro printselectionstringfromtable param0 + .macro printselectionstringfromtable ptr:req .byte 0x14 - .4byte \param0 + .4byte \ptr .endm .macro seteffectwithchance @@ -104,110 +104,110 @@ .byte 0x17 .endm - .macro clearstatusfromeffect battler + .macro clearstatusfromeffect battler:req .byte 0x18 .byte \battler .endm - .macro tryfaintmon battler, param1, param2 + .macro tryfaintmon battler:req, param1:req, ptr:req .byte 0x19 .byte \battler .byte \param1 - .4byte \param2 + .4byte \ptr .endm - .macro dofaintanimation battler + .macro dofaintanimation battler:req .byte 0x1a .byte \battler .endm - .macro cleareffectsonfaint battler + .macro cleareffectsonfaint battler:req .byte 0x1b .byte \battler .endm - .macro jumpifstatus battler, status1, param2 + .macro jumpifstatus battler:req, status1:req, ptr:req .byte 0x1c .byte \battler .4byte \status1 - .4byte \param2 + .4byte \ptr .endm - .macro jumpifstatus2 battler, status2, param2 + .macro jumpifstatus2 battler:req, status2:req, ptr:req .byte 0x1d .byte \battler .4byte \status2 - .4byte \param2 + .4byte \ptr .endm - .macro jumpifability param0, ability, param2 + .macro jumpifability param0:req, ability:req, ptr:req .byte 0x1e .byte \param0 .byte \ability - .4byte \param2 + .4byte \ptr .endm - .macro jumpifsideaffecting battler, sidestatus, param2 + .macro jumpifsideaffecting battler:req, sidestatus:req, ptr:req .byte 0x1f .byte \battler .2byte \sidestatus - .4byte \param2 + .4byte \ptr .endm - .macro jumpifstat battler, ifflag, stat, param3, param4 + .macro jumpifstat battler:req, ifflag:req, stat:req, value:req, ptr .byte 0x20 .byte \battler .byte \ifflag .byte \stat - .byte \param3 - .4byte \param4 + .byte \value + .4byte \ptr .endm - .macro jumpifstatus3condition battler, status3, param2, param3 + .macro jumpifstatus3condition battler:req, status3:req, param2:req, ptr:req .byte 0x21 .byte \battler .4byte \status3 .byte \param2 - .4byte \param3 + .4byte \ptr .endm - .macro jumpiftype battler, type, param2 + .macro jumpiftype battler:req, type:req, ptr:req .byte 0x22 .byte \battler .byte \type - .4byte \param2 + .4byte \ptr .endm - .macro getexp battler + .macro getexp battler:req .byte 0x23 .byte \battler .endm - .macro atk24 param0 + .macro atk24 ptr:req .byte 0x24 - .4byte \param0 + .4byte \ptr .endm .macro movevaluescleanup .byte 0x25 .endm - .macro setmultihit param0 + .macro setmultihit value:req .byte 0x26 - .byte \param0 + .byte \value .endm - .macro decrementmultihit param0 + .macro decrementmultihit value:req .byte 0x27 - .4byte \param0 + .4byte \value .endm - .macro goto param0 + .macro goto ptr:req .byte 0x28 - .4byte \param0 + .4byte \ptr .endm - .macro jumpifbyte ifflag, param1, param2, param3 + .macro jumpifbyte ifflag:req, param1:req, param2:req, param3:req .byte 0x29 .byte \ifflag .4byte \param1 @@ -215,7 +215,7 @@ .4byte \param3 .endm - .macro jumpifhalfword ifflag, param1, param2, param3 + .macro jumpifhalfword ifflag:req, param1:req, param2:req, param3:req .byte 0x2a .byte \ifflag .4byte \param1 @@ -223,7 +223,7 @@ .4byte \param3 .endm - .macro jumpifword ifflag, param1, param2, param3 + .macro jumpifword ifflag:req, param1:req, param2:req, param3:req .byte 0x2b .byte \ifflag .4byte \param1 @@ -231,7 +231,7 @@ .4byte \param3 .endm - .macro jumpifarrayequal param0, param1, param2, param3 + .macro jumpifarrayequal param0:req, param1:req, param2:req, param3:req .byte 0x2c .4byte \param0 .4byte \param1 @@ -239,7 +239,7 @@ .4byte \param3 .endm - .macro jumpifarraynotequal param0, param1, param2, param3 + .macro jumpifarraynotequal param0:req, param1:req, param2:req, param3:req .byte 0x2d .4byte \param0 .4byte \param1 @@ -247,32 +247,32 @@ .4byte \param3 .endm - .macro setbyte param0, param1 + .macro setbyte ptr:req, param1:req .byte 0x2e - .4byte \param0 + .4byte \ptr .byte \param1 .endm - .macro addbyte param0, param1 + .macro addbyte ptr:req, param1:req .byte 0x2f - .4byte \param0 + .4byte \ptr .byte \param1 .endm - .macro subbyte param0, param1 + .macro subbyte ptr:req, param1:req .byte 0x30 - .4byte \param0 + .4byte \ptr .byte \param1 .endm - .macro copyarray param0, param1, param2 + .macro copyarray param0:req, param1:req, param2:req .byte 0x31 .4byte \param0 .4byte \param1 .byte \param2 .endm - .macro copyarraywithindex param0, param1, param2, param3 + .macro copyarraywithindex param0:req, param1:req, param2:req, param3:req .byte 0x32 .4byte \param0 .4byte \param1 @@ -280,43 +280,43 @@ .byte \param3 .endm - .macro orbyte param0, param1 + .macro orbyte ptr:req, param1:req .byte 0x33 - .4byte \param0 + .4byte \ptr .byte \param1 .endm - .macro orhalfword param0, param1 + .macro orhalfword ptr:req, param1:req .byte 0x34 - .4byte \param0 + .4byte \ptr .2byte \param1 .endm - .macro orword param0, param1 + .macro orword ptr:req, param1:req .byte 0x35 - .4byte \param0 + .4byte \ptr .4byte \param1 .endm - .macro bicbyte param0, param1 + .macro bicbyte ptr:req, param1:req .byte 0x36 - .4byte \param0 + .4byte \ptr .byte \param1 .endm - .macro bichalfword param0, param1 + .macro bichalfword ptr:req, param1:req .byte 0x37 - .4byte \param0 + .4byte \ptr .2byte \param1 .endm - .macro bicword param0, param1 + .macro bicword ptr:req, param1:req .byte 0x38 - .4byte \param0 + .4byte \ptr .4byte \param1 .endm - .macro pause param0 + .macro pause param0:req .byte 0x39 .2byte \param0 .endm @@ -325,7 +325,7 @@ .byte 0x3a .endm - .macro healthbar_update battler + .macro healthbar_update battler:req .byte 0x3b .byte \battler .endm @@ -346,41 +346,41 @@ .byte 0x3f .endm - .macro jumpifaffectedbyprotect param0 + .macro jumpifaffectedbyprotect ptr:req .byte 0x40 - .4byte \param0 + .4byte \ptr .endm - .macro call param0 + .macro call ptr:req .byte 0x41 - .4byte \param0 + .4byte \ptr .endm - .macro jumpiftype2 battler, type, param2 + .macro jumpiftype2 battler:req, type:req, ptr:req .byte 0x42 .byte \battler .byte \type - .4byte \param2 + .4byte \ptr .endm - .macro jumpifabilitypresent ability, param1 + .macro jumpifabilitypresent ability:req, ptr:req .byte 0x43 .byte \ability - .4byte \param1 + .4byte \ptr .endm .macro endselectionscript .byte 0x44 .endm - .macro playanimation battler, param1, param2 + .macro playanimation battler:req, param1:req, param2:req .byte 0x45 .byte \battler .byte \param1 .4byte \param2 .endm - .macro playanimation2 battler, param1, param2 + .macro playanimation2 battler:req, param1:req, param2:req .byte 0x46 .byte \battler .4byte \param1 @@ -391,14 +391,14 @@ .byte 0x47 .endm - .macro playstatchangeanimation battler, param1, param2 + .macro playstatchangeanimation battler:req, param1:req, param2:req .byte 0x48 .byte \battler .byte \param1 .byte \param2 .endm - .macro moveend param0, param1 + .macro moveend param0:req, param1:req .byte 0x49 .byte \param0 .byte \param1 @@ -412,61 +412,61 @@ .byte 0x4b .endm - .macro getswitchedmondata battler + .macro getswitchedmondata battler:req .byte 0x4c .byte \battler .endm - .macro switchindataupdate battler + .macro switchindataupdate battler:req .byte 0x4d .byte \battler .endm - .macro switchinanim battler, dontclearsubstitutebit + .macro switchinanim battler:req, dontclearsubstitutebit:req .byte 0x4e .byte \battler .byte \dontclearsubstitutebit .endm - .macro jumpifcantswitch battler, param1 + .macro jumpifcantswitch battler:req, ptr:req .byte 0x4f .byte \battler - .4byte \param1 + .4byte \ptr .endm - .macro openpartyscreen param0, param1 + .macro openpartyscreen param0:req, param1:req .byte 0x50 .byte \param0 .4byte \param1 .endm - .macro switchhandleorder battler, param1 + .macro switchhandleorder battler:req, param1:req .byte 0x51 .byte \battler .byte \param1 .endm - .macro switchineffects battler + .macro switchineffects battler:req .byte 0x52 .byte \battler .endm - .macro trainerslidein battler + .macro trainerslidein battler:req .byte 0x53 .byte \battler .endm - .macro playse param0 + .macro playse param0:req .byte 0x54 .2byte \param0 .endm - .macro fanfare param0 + .macro fanfare param0:req .byte 0x55 .2byte \param0 .endm - .macro playfaintcry battler + .macro playfaintcry battler:req .byte 0x56 .byte \battler .endm @@ -475,29 +475,29 @@ .byte 0x57 .endm - .macro returntoball battler + .macro returntoball battler:req .byte 0x58 .byte \battler .endm - .macro handlelearnnewmove param0, param1, param2 + .macro handlelearnnewmove param0:req, param1:req, param2:req .byte 0x59 .4byte \param0 .4byte \param1 .byte \param2 .endm - .macro yesnoboxlearnmove param0 + .macro yesnoboxlearnmove param0:req .byte 0x5a .4byte \param0 .endm - .macro yesnoboxstoplearningmove param0 + .macro yesnoboxstoplearningmove param0:req .byte 0x5b .4byte \param0 .endm - .macro hitanimation battler + .macro hitanimation battler:req .byte 0x5c .byte \battler .endm @@ -506,7 +506,7 @@ .byte 0x5d .endm - .macro atk5E battler + .macro atk5E battler:req .byte 0x5e .byte \battler .endm @@ -515,38 +515,38 @@ .byte 0x5f .endm - .macro incrementgamestat param0 + .macro incrementgamestat param0:req .byte 0x60 .byte \param0 .endm - .macro drawpartystatussummary battler + .macro drawpartystatussummary battler:req .byte 0x61 .byte \battler .endm - .macro hidepartystatussummary battler + .macro hidepartystatussummary battler:req .byte 0x62 .byte \battler .endm - .macro jumptocalledmove param0 + .macro jumptocalledmove param0:req .byte 0x63 .byte \param0 .endm - .macro statusanimation battler + .macro statusanimation battler:req .byte 0x64 .byte \battler .endm - .macro status2animation battler, status2 + .macro status2animation battler:req, status2:req .byte 0x65 .byte \battler .4byte \status2 .endm - .macro chosenstatusanimation battler, param1, param2 + .macro chosenstatusanimation battler:req, param1:req, param2:req .byte 0x66 .byte \battler .byte \param1 @@ -565,7 +565,7 @@ .byte 0x69 .endm - .macro removeitem battler + .macro removeitem battler:req .byte 0x6a .byte \battler .endm @@ -586,12 +586,12 @@ .byte 0x6e .endm - .macro makevisible battler + .macro makevisible battler:req .byte 0x6f .byte \battler .endm - .macro recordlastability battler + .macro recordlastability battler:req .byte 0x70 .byte \battler .endm @@ -600,17 +600,17 @@ .byte 0x71 .endm - .macro jumpifplayerran param0 + .macro jumpifplayerran ptr:req .byte 0x72 - .4byte \param0 + .4byte \ptr .endm - .macro hpthresholds battler + .macro hpthresholds battler:req .byte 0x73 .byte \battler .endm - .macro hpthresholds2 battler + .macro hpthresholds2 battler:req .byte 0x74 .byte \battler .endm @@ -619,7 +619,7 @@ .byte 0x75 .endm - .macro various battler, param1 + .macro various battler:req, param1:req .byte 0x76 .byte \battler .byte \param1 @@ -637,12 +637,12 @@ .byte 0x79 .endm - .macro jumpifnexttargetvalid param0 + .macro jumpifnexttargetvalid ptr:req .byte 0x7a - .4byte \param0 + .4byte \ptr .endm - .macro tryhealhalfhealth param0, battler + .macro tryhealhalfhealth param0:req, battler:req .byte 0x7b .4byte \param0 .byte \battler @@ -664,26 +664,26 @@ .byte 0x7f .endm - .macro manipulatedamage param0 + .macro manipulatedamage param0:req .byte 0x80 .byte \param0 .endm - .macro trysetrest param0 + .macro trysetrest param0:req .byte 0x81 .4byte \param0 .endm - .macro jumpifnotfirstturn param0 + .macro jumpifnotfirstturn ptr:req .byte 0x82 - .4byte \param0 + .4byte \ptr .endm .macro nop .byte 0x83 .endm - .macro jumpifcantmakeasleep param0 + .macro jumpifcantmakeasleep param0:req .byte 0x84 .4byte \param0 .endm @@ -692,12 +692,12 @@ .byte 0x85 .endm - .macro stockpiletobasedamage param0 + .macro stockpiletobasedamage param0:req .byte 0x86 .4byte \param0 .endm - .macro stockpiletohpheal param0 + .macro stockpiletohpheal param0:req .byte 0x87 .4byte \param0 .endm @@ -706,7 +706,7 @@ .byte 0x88 .endm - .macro statbuffchange param0, param1 + .macro statbuffchange param0:req, param1:req .byte 0x89 .byte \param0 .4byte \param1 @@ -724,7 +724,7 @@ .byte 0x8c .endm - .macro setmultihitcounter param0 + .macro setmultihitcounter param0:req .byte 0x8d .byte \param0 .endm @@ -733,12 +733,12 @@ .byte 0x8e .endm - .macro forcerandomswitch param0 + .macro forcerandomswitch param0:req .byte 0x8f .4byte \param0 .endm - .macro tryconversiontypechange param0 + .macro tryconversiontypechange param0:req .byte 0x90 .4byte \param0 .endm @@ -751,7 +751,7 @@ .byte 0x92 .endm - .macro tryKO param0 + .macro tryKO param0:req .byte 0x93 .4byte \param0 .endm @@ -768,12 +768,12 @@ .byte 0x96 .endm - .macro tryinfatuating param0 + .macro tryinfatuating param0:req .byte 0x97 .4byte \param0 .endm - .macro updatestatusicon battler + .macro updatestatusicon battler:req .byte 0x98 .byte \battler .endm @@ -794,7 +794,7 @@ .byte 0x9c .endm - .macro mimicattackcopy param0 + .macro mimicattackcopy param0:req .byte 0x9d .4byte \param0 .endm @@ -811,32 +811,32 @@ .byte 0xa0 .endm - .macro counterdamagecalculator param0 + .macro counterdamagecalculator param0:req .byte 0xa1 .4byte \param0 .endm - .macro mirrorcoatdamagecalculator param0 + .macro mirrorcoatdamagecalculator param0:req .byte 0xa2 .4byte \param0 .endm - .macro disablelastusedattack param0 + .macro disablelastusedattack param0:req .byte 0xa3 .4byte \param0 .endm - .macro trysetencore param0 + .macro trysetencore param0:req .byte 0xa4 .4byte \param0 .endm - .macro painsplitdmgcalc param0 + .macro painsplitdmgcalc param0:req .byte 0xa5 .4byte \param0 .endm - .macro settypetorandomresistance param0 + .macro settypetorandomresistance param0:req .byte 0xa6 .4byte \param0 .endm @@ -845,12 +845,12 @@ .byte 0xa7 .endm - .macro copymovepermanently param0 + .macro copymovepermanently param0:req .byte 0xa8 .4byte \param0 .endm - .macro trychoosesleeptalkmove param0 + .macro trychoosesleeptalkmove param0:req .byte 0xa9 .4byte \param0 .endm @@ -867,7 +867,7 @@ .byte 0xac .endm - .macro tryspiteppreduce param0 + .macro tryspiteppreduce param0:req .byte 0xad .4byte \param0 .endm @@ -876,12 +876,12 @@ .byte 0xae .endm - .macro cursetarget param0 + .macro cursetarget param0:req .byte 0xaf .4byte \param0 .endm - .macro trysetspikes param0 + .macro trysetspikes param0:req .byte 0xb0 .4byte \param0 .endm @@ -890,7 +890,7 @@ .byte 0xb1 .endm - .macro trysetperishsong param0 + .macro trysetperishsong param0:req .byte 0xb2 .4byte \param0 .endm @@ -899,10 +899,10 @@ .byte 0xb3 .endm - .macro jumpifconfusedandstatmaxed stat, param1 + .macro jumpifconfusedandstatmaxed stat:req, ptr:req .byte 0xb4 .byte \stat - .4byte \param1 + .4byte \ptr .endm .macro furycuttercalc @@ -925,7 +925,7 @@ .byte 0xb9 .endm - .macro jumpifnopursuitswitchdmg param0 + .macro jumpifnopursuitswitchdmg param0:req .byte 0xba .4byte \param0 .endm @@ -934,12 +934,12 @@ .byte 0xbb .endm - .macro maxattackhalvehp param0 + .macro maxattackhalvehp param0:req .byte 0xbc .4byte \param0 .endm - .macro copyfoestats param0 + .macro copyfoestats param0:req .byte 0xbd .4byte \param0 .endm @@ -952,7 +952,7 @@ .byte 0xbf .endm - .macro recoverbasedonsunlight param0 + .macro recoverbasedonsunlight param0:req .byte 0xc0 .4byte \param0 .endm @@ -965,12 +965,12 @@ .byte 0xc2 .endm - .macro trysetfutureattack param0 + .macro trysetfutureattack param0:req .byte 0xc3 .4byte \param0 .endm - .macro trydobeatup param0, param1 + .macro trydobeatup param0:req, param1:req .byte 0xc4 .4byte \param0 .4byte \param1 @@ -992,9 +992,9 @@ .byte 0xc8 .endm - .macro jumpifattackandspecialattackcannotfall param0 + .macro jumpifattackandspecialattackcannotfall ptr:req .byte 0xc9 - .4byte \param0 + .4byte \ptr .endm .macro setforcedtarget @@ -1009,48 +1009,48 @@ .byte 0xcc .endm - .macro cureifburnedparalysedorpoisoned param0 + .macro cureifburnedparalysedorpoisoned param0:req .byte 0xcd .4byte \param0 .endm - .macro settorment param0 + .macro settorment param0:req .byte 0xce .4byte \param0 .endm - .macro jumpifnodamage param0 + .macro jumpifnodamage param0:req .byte 0xcf .4byte \param0 .endm - .macro settaunt param0 + .macro settaunt param0:req .byte 0xd0 .4byte \param0 .endm - .macro trysethelpinghand param0 + .macro trysethelpinghand param0:req .byte 0xd1 .4byte \param0 .endm - .macro tryswapitems param0 + .macro tryswapitems param0:req .byte 0xd2 .4byte \param0 .endm - .macro trycopyability param0 + .macro trycopyability param0:req .byte 0xd3 .4byte \param0 .endm - .macro trywish param0, param1 + .macro trywish param0:req, param1:req .byte 0xd4 .byte \param0 .4byte \param1 .endm - .macro trysetroots param0 + .macro trysetroots param0:req .byte 0xd5 .4byte \param0 .endm @@ -1059,12 +1059,12 @@ .byte 0xd6 .endm - .macro setyawn param0 + .macro setyawn param0:req .byte 0xd7 .4byte \param0 .endm - .macro setdamagetohealthdifference param0 + .macro setdamagetohealthdifference param0:req .byte 0xd8 .4byte \param0 .endm @@ -1073,17 +1073,17 @@ .byte 0xd9 .endm - .macro tryswapabilities param0 + .macro tryswapabilities param0:req .byte 0xda .4byte \param0 .endm - .macro tryimprision param0 + .macro tryimprision param0:req .byte 0xdb .4byte \param0 .endm - .macro trysetgrudge param0 + .macro trysetgrudge param0:req .byte 0xdc .4byte \param0 .endm @@ -1092,32 +1092,32 @@ .byte 0xdd .endm - .macro asistattackselect param0 + .macro asistattackselect param0:req .byte 0xde .4byte \param0 .endm - .macro trysetmagiccoat param0 + .macro trysetmagiccoat param0:req .byte 0xdf .4byte \param0 .endm - .macro trysetsnatch param0 + .macro trysetsnatch param0:req .byte 0xe0 .4byte \param0 .endm - .macro trygetintimidatetarget param0 + .macro trygetintimidatetarget param0:req .byte 0xe1 .4byte \param0 .endm - .macro switchoutabilities battler + .macro switchoutabilities battler:req .byte 0xe2 .byte \battler .endm - .macro jumpifhasnohp battler, param1 + .macro jumpifhasnohp battler:req, param1:req .byte 0xe3 .byte \battler .4byte \param1 @@ -1139,7 +1139,7 @@ .byte 0xe7 .endm - .macro settypebasedhalvers param0 + .macro settypebasedhalvers param0:req .byte 0xe8 .4byte \param0 .endm @@ -1148,17 +1148,17 @@ .byte 0xe9 .endm - .macro tryrecycleitem param0 + .macro tryrecycleitem param0:req .byte 0xea .4byte \param0 .endm - .macro settypetoterrain param0 + .macro settypetoterrain param0:req .byte 0xeb .4byte \param0 .endm - .macro pursuitrelated param0 + .macro pursuitrelated param0:req .byte 0xec .4byte \param0 .endm @@ -1179,7 +1179,7 @@ .byte 0xf0 .endm - .macro trysetcaughtmondexflags param0 + .macro trysetcaughtmondexflags param0:req .byte 0xf1 .4byte \param0 .endm @@ -1188,7 +1188,7 @@ .byte 0xf2 .endm - .macro trygivecaughtmonnick param0 + .macro trygivecaughtmonnick param0:req .byte 0xf3 .4byte \param0 .endm @@ -1209,45 +1209,45 @@ .byte 0xf7 .endm - .macro trainerslideout param0 + .macro trainerslideout param0:req .byte 0xf8 .byte \param0 .endm @ various command changed to more readable macros - .macro cancelmultiturnmoves battler + .macro cancelmultiturnmoves battler:req various \battler, VARIOUS_CANCEL_MULTI_TURN_MOVES .endm - .macro setmagiccoattarget battler + .macro setmagiccoattarget battler:req various \battler, VARIOUS_SET_MAGIC_COAT_TARGET .endm - .macro getifcantrunfrombattle battler + .macro getifcantrunfrombattle battler:req various \battler, VARIOUS_IS_RUNNING_IMPOSSIBLE .endm - .macro getmovetarget battler + .macro getmovetarget battler:req various \battler, VARIOUS_GET_MOVE_TARGET .endm - .macro various4 battler + .macro various4 battler:req various \battler, 4 .endm - .macro resetintrimidatetracebits battler + .macro resetintrimidatetracebits battler:req various \battler, VARIOUS_RESET_INTIMIDATE_TRACE_BITS .endm - .macro updatechoicemoveonlvlup battler + .macro updatechoicemoveonlvlup battler:req various \battler, VARIOUS_UPDATE_CHOICE_MOVE_ON_LVL_UP .endm - .macro various7 battler + .macro various7 battler:req various \battler, 7 .endm - .macro various8 battler + .macro various8 battler:req various \battler, 8 .endm @@ -1267,35 +1267,35 @@ various BS_ATTACKER, VARIOUS_ARENA_BOTH_MONS_LOST .endm - .macro forfeityesnobox battler + .macro forfeityesnobox battler:req various \battler, VARIOUS_EMIT_YESNOBOX .endm - .macro various14 battler + .macro various14 battler:req various \battler, 14 .endm - .macro various15 battler + .macro various15 battler:req various \battler, 15 .endm - .macro arenajudmengtstring id + .macro arenajudmengtstring id:req various \id, VARIOUS_ARENA_JUDGMENT_STRING .endm - .macro arenawaitmessage id + .macro arenawaitmessage id:req various \id, VARIOUS_ARENA_WAIT_STRING .endm - .macro waitcry battler + .macro waitcry battler:req various \battler, VARIOUS_WAIT_CRY .endm - .macro returnopponentmon1toball battler + .macro returnopponentmon1toball battler:req various \battler, VARIOUS_RETURN_OPPONENT_MON1 .endm - .macro returnopponentmon2toball battler + .macro returnopponentmon2toball battler:req various \battler, VARIOUS_RETURN_OPPONENT_MON2 .endm @@ -1307,95 +1307,95 @@ various BS_ATTACKER, VARIOUS_VOLUME_UP .endm - .macro setalreadystatusedmoveattempt battler + .macro setalreadystatusedmoveattempt battler:req various \battler, 23 .endm - .macro various24 battler + .macro various24 battler:req various \battler, 24 .endm - .macro setoutcomeonteleport battler + .macro setoutcomeonteleport battler:req various \battler, VARIOUS_SET_TELEPORT_OUTCOME .endm - .macro playtrainerdefeatbgm battler + .macro playtrainerdefeatbgm battler:req various \battler, VARIOUS_PLAY_TRAINER_DEFEATED_MUSIC .endm @ helpful macros - .macro setstatchanger stat, stages, down + .macro setstatchanger stat:req, stages:req, down:req setbyte sSTATCHANGER \stat | \stages << 4 | \down << 7 .endm - .macro setmoveeffect effect + .macro setmoveeffect effect:req setbyte cEFFECT_CHOOSER \effect .endm - .macro chosenstatus1animation battler, status + .macro chosenstatus1animation battler:req, status:req chosenstatusanimation \battler 0x0 \status .endm - .macro chosenstatus2animation battler, status + .macro chosenstatus2animation battler:req, status:req chosenstatusanimation \battler 0x1 \status .endm - .macro sethword dst, value + .macro sethword dst:req, value:req setbyte \dst, \value & 0xFF setbyte \dst + 1, (\value >> 8) & 0xFF .endm - .macro setword dst, value + .macro setword dst:req, value:req setbyte \dst, \value & 0xFF setbyte \dst + 1, (\value >> 8) & 0xFF setbyte \dst + 2, (\value >> 16) & 0xFF setbyte \dst + 3, (\value >> 24) & 0xFF .endm - .macro copybyte dst, src + .macro copybyte dst:req, src:req copyarray \dst, \src, 0x1 .endm - .macro copyhword dst, src + .macro copyhword dst:req, src:req copyarray \dst, \src, 0x2 .endm - .macro copyword dst, src + .macro copyword dst:req, src:req copyarray \dst, \src, 0x4 .endm - .macro jumpifbytenotequal byte1, byte2, jumpptr + .macro jumpifbytenotequal byte1:req, byte2:req, jumpptr:req jumpifarraynotequal \byte1, \byte2, 0x1, \jumpptr .endm - .macro jumpifbyteequal byte1, byte2, jumpptr + .macro jumpifbyteequal byte1:req, byte2:req, jumpptr:req jumpifarrayequal \byte1, \byte2, 0x1, \jumpptr .endm - .macro jumpifmove move, jumpptr + .macro jumpifmove move:req, jumpptr:req jumpifhalfword CMP_EQUAL, gCurrentMove, \move, \jumpptr .endm - .macro jumpifnotmove move, jumpptr + .macro jumpifnotmove move:req, jumpptr:req jumpifhalfword CMP_NOT_EQUAL, gCurrentMove, \move, \jumpptr .endm - .macro jumpifstatus3 battler, status, jumpptr + .macro jumpifstatus3 battler:req, status:req, jumpptr:req jumpifstatus3condition \battler, \status, 0x0, \jumpptr .endm - .macro jumpifnostatus3 battler, status, jumpptr + .macro jumpifnostatus3 battler:req, status:req, jumpptr:req jumpifstatus3condition \battler, \status, 0x1, \jumpptr .endm - .macro jumpifmovehadnoeffect jumpptr + .macro jumpifmovehadnoeffect jumpptr:req jumpifbyte CMP_COMMON_BITS, gMoveResultFlags, MOVE_RESULT_NO_EFFECT, \jumpptr .endm - .macro jumpifbattletype flags, jumpptr + .macro jumpifbattletype flags:req, jumpptr:req jumpifword CMP_COMMON_BITS, gBattleTypeFlags, \flags, \jumpptr .endm - .macro jumpifnotbattletype flags, jumpptr + .macro jumpifnotbattletype flags:req, jumpptr:req jumpifword CMP_NO_COMMON_BITS, gBattleTypeFlags, \flags, \jumpptr .endm diff --git a/asm/macros/event.inc b/asm/macros/event.inc index e59f18b32..33afdc3b3 100644 --- a/asm/macros/event.inc +++ b/asm/macros/event.inc @@ -19,33 +19,33 @@ .endm @ Jumps to destination and continues script execution from there. The location of the calling script is remembered and can be returned to later. - .macro call destination + .macro call destination:req .byte 0x04 .4byte \destination .endm @ Jumps to destination and continues script execution from there. - .macro goto destination + .macro goto destination:req .byte 0x05 .4byte \destination .endm @ If the result of the last comparison matches condition (see Comparison operators), jumps to destination and continues script execution from there. - .macro goto_if condition, destination + .macro goto_if condition:req, destination:req .byte 0x06 .byte \condition .4byte \destination .endm @ If the result of the last comparison matches condition (see Comparison operators), calls destination. - .macro call_if condition, destination + .macro call_if condition:req, destination:req .byte 0x07 .byte \condition .4byte \destination .endm @ Jumps to the standard function at index function. - .macro gotostd function + .macro gotostd function:req .byte 0x08 .byte \function .endm @@ -57,20 +57,20 @@ STD_REGISTER_MATCH_CALL = 8 @ Calls the standard function at index function. - .macro callstd function + .macro callstd function:req .byte 0x09 .byte \function .endm @ If the result of the last comparison matches condition (see Comparison operators), jumps to the standard function at index function. - .macro gotostd_if condition, function + .macro gotostd_if condition:req, function:req .byte 0x0a .byte \condition .byte \function .endm @ If the result of the last comparison matches condition (see Comparison operators), calls the standard function at index function. - .macro callstd_if condition, function + .macro callstd_if condition:req, function:req .byte 0x0b .byte \condition .byte \function @@ -87,146 +87,146 @@ .endm @ Sets some status related to Mystery Event. - .macro setmysteryeventstatus value + .macro setmysteryeventstatus value:req .byte 0x0e .byte \value .endm @ Sets the specified script bank to value. - .macro loadword destination, value + .macro loadword destination:req, value:req .byte 0x0f .byte \destination .4byte \value .endm @ Sets the specified script bank to value. - .macro loadbyte destination, value + .macro loadbyte destination:req, value:req .byte 0x10 .byte \destination .byte \value .endm @ Sets the byte at offset to value. - .macro writebytetoaddr value, offset + .macro writebytetoaddr value:req, offset:req .byte 0x11 .byte \value .4byte \offset .endm @ Copies the byte value at source into the specified script bank. - .macro loadbytefromaddr destination, source + .macro loadbytefromaddr destination:req, source:req .byte 0x12 .byte \destination .4byte \source .endm @ Not sure. Judging from XSE's description I think it takes the least-significant byte in bank source and writes it to destination. - .macro setptrbyte source, destination + .macro setptrbyte source:req, destination:req .byte 0x13 .byte \source .4byte \destination .endm @ Copies the contents of bank source into bank destination. - .macro copylocal destination, source + .macro copylocal destination:req, source:req .byte 0x14 .byte \destination .byte \source .endm @ Copies the byte at source to destination, replacing whatever byte was previously there. - .macro copybyte destination, source + .macro copybyte destination:req, source:req .byte 0x15 .4byte \destination .4byte \source .endm @ Changes the value of destination to value. - .macro setvar destination, value + .macro setvar destination:req, value:req .byte 0x16 .2byte \destination .2byte \value .endm @ Changes the value of destination by adding value to it. Overflow is not prevented (0xFFFF + 1 = 0x0000). - .macro addvar destination, value + .macro addvar destination:req, value:req .byte 0x17 .2byte \destination .2byte \value .endm @ Changes the value of destination by subtracting value to it. Overflow is not prevented (0x0000 - 1 = 0xFFFF). - .macro subvar destination, value + .macro subvar destination:req, value:req .byte 0x18 .2byte \destination .2byte \value .endm @ Copies the value of source into destination. - .macro copyvar destination, source + .macro copyvar destination:req, source:req .byte 0x19 .2byte \destination .2byte \source .endm @ If source is not a variable, then this function acts like setvar. Otherwise, it acts like copyvar. - .macro setorcopyvar destination, source + .macro setorcopyvar destination:req, source:req .byte 0x1a .2byte \destination .2byte \source .endm @ Compares the values of script banks a and b, after forcing the values to bytes. - .macro compare_local_to_local byte1, byte2 + .macro compare_local_to_local byte1:req, byte2:req .byte 0x1b .byte \byte1 .byte \byte2 .endm @ Compares the least-significant byte of the value of script bank a to a fixed byte value (b). - .macro compare_local_to_value a, b + .macro compare_local_to_value a:req, b:req .byte 0x1c .byte \a .byte \b .endm @ Compares the least-significant byte of the value of script bank a to the byte located at offset b. - .macro compare_local_to_addr a, b + .macro compare_local_to_addr a:req, b:req .byte 0x1d .byte \a .4byte \b .endm @ Compares the byte located at offset a to the least-significant byte of the value of script bank b. - .macro compare_addr_to_local a, b + .macro compare_addr_to_local a:req, b:req .byte 0x1e .4byte \a .byte \b .endm @ Compares the byte located at offset a to a fixed byte value (b). - .macro compare_addr_to_value a, b + .macro compare_addr_to_value a:req, b:req .byte 0x1f .4byte \a .byte \b .endm @ Compares the byte located at offset a to the byte located at offset b. - .macro compare_addr_to_addr a, b + .macro compare_addr_to_addr a:req, b:req .byte 0x20 .4byte \a .4byte \b .endm @ Compares the value of `var` to a fixed word value (b). - .macro compare_var_to_value var, value + .macro compare_var_to_value var:req, value:req .byte 0x21 .2byte \var .2byte \value .endm @ Compares the value of `var1` to the value of `var2`. - .macro compare_var_to_var var1, var2 + .macro compare_var_to_var var1:req, var2:req .byte 0x22 .2byte \var1 .2byte \var2 @@ -234,7 +234,7 @@ @ Generic compare macro which attempts to deduce argument types based on their values @ Any values between 0x4000 to 0x4FFF and 0x8000 to 0x8FFF are considered event variable identifiers - .macro compare arg1, arg2 + .macro compare arg1:req, arg2:req .if ((\arg1 >> 12) == 4 || (\arg1 >> 12) == 8) && ((\arg2 >> 12) == 4 || (\arg2 >> 12) == 8) compare_var_to_var \arg1, \arg2 .elseif ((\arg1 >> 12) == 4 || (\arg1 >> 12) == 8) && (\arg2 >= 0 && \arg2 <= 0xFFFF) @@ -245,32 +245,32 @@ .endm @ Calls the native C function stored at `func`. - .macro callnative func + .macro callnative func:req .byte 0x23 .4byte \func .endm @ Replaces the script with the function stored at `func`. Execution returns to the bytecode script when func returns TRUE. - .macro gotonative func + .macro gotonative func:req .byte 0x24 .4byte \func .endm @ Calls a special function; that is, a function designed for use by scripts and listed in a table of pointers. - .macro special function + .macro special function:req .byte 0x25 .2byte SPECIAL_\function .endm @ Calls a special function. That function's output (if any) will be written to the variable you specify. - .macro specialvar output, function + .macro specialvar output:req, function:req .byte 0x26 .2byte \output .2byte SPECIAL_\function .endm @ temporary solution - .macro specialvar_ output, functionId + .macro specialvar_ output:req, functionId:req .byte 0x26 .2byte \output .2byte \functionId @@ -282,31 +282,31 @@ .endm @ Blocks script execution for time (frames? milliseconds?). - .macro delay time + .macro delay time:req .byte 0x28 .2byte \time .endm @ Sets a to 1. - .macro setflag a + .macro setflag a:req .byte 0x29 .2byte \a .endm @ Sets a to 0. - .macro clearflag a + .macro clearflag a:req .byte 0x2a .2byte \a .endm @ Compares a to 1. - .macro checkflag a + .macro checkflag a:req .byte 0x2b .2byte \a .endm @ Initializes the RTC`s local time offset to the given hour and minute. In FireRed, this command is a nop. - .macro initclock hour, minute + .macro initclock hour:req, minute:req .byte 0x2c .2byte \hour .2byte \minute @@ -323,7 +323,7 @@ .endm @ Plays the specified (sound_number) sound. Only one sound may play at a time, with newer ones interrupting older ones. - .macro playse sound_number + .macro playse sound_number:req .byte 0x2f .2byte \sound_number .endm @@ -334,7 +334,7 @@ .endm @ Plays the specified (fanfare_number) fanfare. - .macro playfanfare fanfare_number + .macro playfanfare fanfare_number:req .byte 0x31 .2byte \fanfare_number .endm @@ -345,14 +345,14 @@ .endm @ Plays the specified (song_number) song. The byte is apparently supposed to be 0x00. - .macro playbgm song_number, unknown + .macro playbgm song_number:req, unknown:req .byte 0x33 .2byte \song_number .byte \unknown .endm @ Saves the specified (song_number) song to be played later. - .macro savebgm song_number + .macro savebgm song_number:req .byte 0x34 .2byte \song_number .endm @@ -363,25 +363,25 @@ .endm @ Crossfades the currently-playng song into the specified (song_number) song. - .macro fadenewbgm song_number + .macro fadenewbgm song_number:req .byte 0x36 .2byte \song_number .endm @ Fades out the currently-playing song. - .macro fadeoutbgm speed + .macro fadeoutbgm speed:req .byte 0x37 .byte \speed .endm @ Fades the previously-playing song back in. - .macro fadeinbgm speed + .macro fadeinbgm speed:req .byte 0x38 .byte \speed .endm @ Sends the player to Warp warp on Map bank.map. If the specified warp is 0xFF, then the player will instead be sent to (X, Y) on the map. - .macro warp map, warp, X, Y + .macro warp map:req, warp:req, X:req, Y:req .byte 0x39 map \map .byte \warp @@ -390,7 +390,7 @@ .endm @ Clone of warp that does not play a sound effect. - .macro warpsilent map, warp, X, Y + .macro warpsilent map:req, warp:req, X:req, Y:req .byte 0x3a map \map .byte \warp @@ -399,7 +399,7 @@ .endm @ Clone of warp that plays a door opening animation before stepping upwards into it. - .macro warpdoor map, warp, X, Y + .macro warpdoor map:req, warp:req, X:req, Y:req .byte 0x3b map \map .byte \warp @@ -408,13 +408,13 @@ .endm @ Warps the player to another map using a hole animation. - .macro warphole map + .macro warphole map:req .byte 0x3c map \map .endm @ Clone of warp that uses a teleport effect. It is apparently only used in R/S/E. - .macro warpteleport map, warp, X, Y + .macro warpteleport map:req, warp:req, X:req, Y:req .byte 0x3d map \map .byte \warp @@ -423,7 +423,7 @@ .endm @ Sets the warp destination to be used later. - .macro setwarp map, warp, X, Y + .macro setwarp map:req, warp:req, X:req, Y:req .byte 0x3e map \map .byte \warp @@ -432,7 +432,7 @@ .endm @ Sets the warp destination that a warp to Warp 127 on Map 127.127 will connect to. Useful when a map has warps that need to go to script-controlled locations (i.e. elevators). - .macro setdynamicwarp map, warp, X, Y + .macro setdynamicwarp map:req, warp:req, X:req, Y:req .byte 0x3f map \map .byte \warp @@ -441,7 +441,7 @@ .endm @ Sets the destination that diving or emerging from a dive will take the player to. - .macro setdivewarp map, warp, X, Y + .macro setdivewarp map:req, warp:req, X:req, Y:req .byte 0x40 map \map .byte \warp @@ -450,7 +450,7 @@ .endm @ Sets the destination that falling into a hole will take the player to. - .macro setholewarp map, warp, X, Y + .macro setholewarp map:req, warp:req, X:req, Y:req .byte 0x41 map \map .byte \warp @@ -459,7 +459,7 @@ .endm @ Retrieves the player's zero-indexed X- and Y-coordinates in the map, and stores them in the specified variables. - .macro getplayerxy X, Y + .macro getplayerxy X:req, Y:req .byte 0x42 .2byte \X .2byte \Y @@ -471,80 +471,80 @@ .endm @ Attempts to add quantity of item index to the player's Bag. If the player has enough room, the item will be added and variable 0x800D (LASTRESULT) will be set to 0x0001; otherwise, LASTRESULT is set to 0x0000. - .macro giveitem index, quantity + .macro giveitem index:req, quantity:req .byte 0x44 .2byte \index .2byte \quantity .endm @ Removes quantity of item index from the player's Bag. - .macro takeitem index, quantity + .macro takeitem index:req, quantity:req .byte 0x45 .2byte \index .2byte \quantity .endm @ Checks if the player has enough space in their Bag to hold quantity more of item index. Sets variable 0x800D (LASTRESULT) to 0x0001 if there is room, or 0x0000 is there is no room. - .macro checkitemspace index, quantity + .macro checkitemspace index:req, quantity:req .byte 0x46 .2byte \index .2byte \quantity .endm @ Checks if the player has quantity or more of item index in their Bag. Sets variable 0x800D (LASTRESULT) to 0x0001 if the player has enough of the item, or 0x0000 if they have fewer than quantity of the item. - .macro checkitem index, quantity + .macro checkitem index:req, quantity:req .byte 0x47 .2byte \index .2byte \quantity .endm @ Checks which Bag pocket the specified (index) item belongs in, and writes the value to variable 0x800D (LASTRESULT). This script is used to show the name of the proper Bag pocket when the player receives an item via callstd (simplified to giveitem in XSE). - .macro checkitemtype index + .macro checkitemtype index:req .byte 0x48 .2byte \index .endm @ Adds a quantity amount of item index to the player's PC. Both arguments can be variables. - .macro givepcitem index, quantity + .macro givepcitem index:req, quantity:req .byte 0x49 .2byte \index .2byte \quantity .endm @ Checks for quantity amount of item index in the player's PC. Both arguments can be variables. - .macro checkpcitem index, quantity + .macro checkpcitem index:req, quantity:req .byte 0x4a .2byte \index .2byte \quantity .endm @ Adds decoration to the player's PC. In FireRed, this command is a nop. (The argument is read, but not used for anything.) - .macro givedecoration decoration + .macro givedecoration decoration:req .byte 0x4b .2byte \decoration .endm @ Removes a decoration from the player's PC. In FireRed, this command is a nop. (The argument is read, but not used for anything.) - .macro takedecoration decoration + .macro takedecoration decoration:req .byte 0x4c .2byte \decoration .endm @ Checks for decoration in the player's PC. In FireRed, this command is a nop. (The argument is read, but not used for anything.) - .macro checkdecor decoration + .macro checkdecor decoration:req .byte 0x4d .2byte \decoration .endm @ Checks if the player has enough space in their PC to hold decoration. Sets variable 0x800D (LASTRESULT) to 0x0001 if there is room, or 0x0000 is there is no room. In FireRed, this command is a nop. (The argument is read, but not used for anything.) - .macro checkdecorspace decoration + .macro checkdecorspace decoration:req .byte 0x4e .2byte \decoration .endm @ Applies the movement data at movements to the specified (index) Object. Also closes any standard message boxes that are still open. @ If no map is specified, then the current map is used. - .macro applymovement index, movements, map + .macro applymovement index:req, movements:req, map .ifb \map .byte 0x4f .2byte \index @@ -560,7 +560,7 @@ @ Blocks script execution until the movements being applied to the specified (index) Object finish. If the specified Object is 0x0000, then the command will block script execution until all Objects affected by applymovement finish their movements. If the specified Object is not currently being manipulated with applymovement, then this command does nothing. @ If no map is specified, then the current map is used. - .macro waitmovement index, map + .macro waitmovement index:req, map .ifb \map .byte 0x51 .2byte \index @@ -573,7 +573,7 @@ @ Attempts to hide the specified (index) Object on the specified (map_group, map_num) map, by setting its visibility flag if it has a valid one. If the Object does not have a valid visibility flag, this command does nothing. @ If no map is specified, then the current map is used. - .macro removeobject index, map + .macro removeobject index:req, map .ifb \map .byte 0x53 .2byte \index @@ -586,7 +586,7 @@ @ Unsets the specified (index) Object's visibility flag on the specified (map_group, map_num) map if it has a valid one. If the Object does not have a valid visibility flag, this command does nothing. @ If no map is specified, then the current map is used. - .macro addobject index, map + .macro addobject index:req, map .ifb \map .byte 0x55 .2byte \index @@ -598,20 +598,20 @@ .endm @ Sets the specified (index) Object's position on the current map. - .macro setobjectxy index, x, y + .macro setobjectxy index:req, x:req, y:req .byte 0x57 .2byte \index .2byte \x .2byte \y .endm - .macro showobjectat index, map + .macro showobjectat index:req, map:req .byte 0x58 .2byte \index map \map .endm - .macro hideobjectat index, map + .macro hideobjectat index:req, map:req .byte 0x59 .2byte \index map \map @@ -622,14 +622,14 @@ .byte 0x5a .endm - .macro turnobject index, direction + .macro turnobject index:req, direction:req .byte 0x5b .2byte \index .byte \direction .endm @ If the Trainer flag for Trainer index is not set, this command does absolutely nothing. - .macro trainerbattle type, trainer, word, pointer1, pointer2, pointer3, pointer4 + .macro trainerbattle type:req, trainer:req, word:req, pointer1:req, pointer2, pointer3, pointer4 .byte 0x5c .byte \type .2byte \trainer @@ -700,36 +700,36 @@ .endm @ Compares Flag (trainer + 0x500) to 1. (If the flag is set, then the trainer has been defeated by the player.) - .macro checktrainerflag trainer + .macro checktrainerflag trainer:req .byte 0x60 .2byte \trainer .endm @ Sets Flag (trainer + 0x500). - .macro settrainerflag trainer + .macro settrainerflag trainer:req .byte 0x61 .2byte \trainer .endm @ Clears Flag (trainer + 0x500). - .macro cleartrainerflag trainer + .macro cleartrainerflag trainer:req .byte 0x62 .2byte \trainer .endm - .macro setobjectxyperm index, x, y + .macro setobjectxyperm index:req, x:req, y:req .byte 0x63 .2byte \index .2byte \x .2byte \y .endm - .macro moveobjectoffscreen index + .macro moveobjectoffscreen index:req .byte 0x64 .2byte \index .endm - .macro setobjectmovementtype word, byte + .macro setobjectmovementtype word:req, byte:req .byte 0x65 .2byte \word .byte \byte @@ -741,7 +741,7 @@ .endm @ Starts displaying a standard message box containing the specified text. If text is a pointer, then the string at that offset will be loaded and used. If text is script bank 0, then the value of script bank 0 will be treated as a pointer to the text. (You can use loadpointer to place a string pointer in a script bank.) - .macro message text + .macro message text:req .byte 0x67 .4byte \text .endm @@ -777,14 +777,14 @@ .endm @ Displays a YES/NO multichoice box at the specified coordinates, and blocks script execution until the user makes a selection. Their selection is stored in variable 0x800D (LASTRESULT); 0x0000 for "NO" or if the user pressed B, and 0x0001 for "YES". - .macro yesnobox x, y + .macro yesnobox x:req, y:req .byte 0x6e .byte \x .byte \y .endm @ Displays a multichoice box from which the user can choose a selection, and blocks script execution until a selection is made. Lists of options are predefined and the one to be used is specified with list. If b is set to a non-zero value, then the user will not be allowed to back out of the multichoice with the B button. - .macro multichoice x, y, list, b + .macro multichoice x:req, y:req, list:req, b:req .byte 0x6f .byte \x .byte \y @@ -793,7 +793,7 @@ .endm @ Displays a multichoice box from which the user can choose a selection, and blocks script execution until a selection is made. Lists of options are predefined and the one to be used is specified with list. The default argument determines the initial position of the cursor when the box is first opened; it is zero-indexed, and if it is too large, it is treated as 0x00. If b is set to a non-zero value, then the user will not be allowed to back out of the multichoice with the B button. - .macro multichoicedefault x, y, list, default, b + .macro multichoicedefault x:req, y:req, list:req, default:req, b:req .byte 0x70 .byte \x .byte \y @@ -803,7 +803,7 @@ .endm @ Displays a multichoice box from which the user can choose a selection, and blocks script execution until a selection is made. Lists of options are predefined and the one to be used is specified with list. The per_row argument determines how many list items will be shown on a single row of the box. - .macro multichoicegrid x, y, list, per_row, B + .macro multichoicegrid x:req, y:req, list:req, per_row:req, B:req .byte 0x71 .byte \x .byte \y @@ -818,7 +818,7 @@ .endm @ Nopped in Emerald, but still consumes parameters. - .macro erasebox byte1, byte2, byte3, byte4 + .macro erasebox byte1:req, byte2:req, byte3:req, byte4:req .byte 0x73 .byte \byte1 .byte \byte2 @@ -827,7 +827,7 @@ .endm @ Nopped in Emerald, but still consumes parameters. - .macro drawboxtext byte1, byte2, byte3, byte4 + .macro drawboxtext byte1:req, byte2:req, byte3:req, byte4:req .byte 0x74 .byte \byte1 .byte \byte2 @@ -836,7 +836,7 @@ .endm @ Displays a box containing the front sprite for the specified (species) Pokemon species. - .macro drawmonpic species, x, y + .macro drawmonpic species:req, x:req, y:req .byte 0x75 .2byte \species .byte \x @@ -849,19 +849,19 @@ .endm @ Draws an image of the winner of the contest. In FireRed, this command is a nop. (The argument is discarded.) - .macro drawcontestwinner a + .macro drawcontestwinner a:req .byte 0x77 .byte \a .endm @ Displays the string at pointer as braille text in a standard message box. The string must be formatted to use braille characters and needs to provide six extra starting characters that are skipped (in RS, these characters determined the box's size and position, but in Emerald these are calculated automatically). - .macro braillemessage text + .macro braillemessage text:req .byte 0x78 .4byte \text .endm @ Gives the player one of the specified (species) Pokemon at level level holding item. The unknown arguments should all be zeroes. - .macro givemon species, level, item, unknown1, unknown2, unknown3 + .macro givemon species:req, level:req, item:req, unknown1:req, unknown2:req, unknown3:req .byte 0x79 .2byte \species .byte \level @@ -871,12 +871,12 @@ .byte \unknown3 .endm - .macro giveegg species + .macro giveegg species:req .byte 0x7a .2byte \species .endm - .macro setmonmove index, slot, move + .macro setmonmove index:req, slot:req, move:req .byte 0x7b .byte \index .byte \slot @@ -884,99 +884,99 @@ .endm @ Checks if at least one Pokemon in the player's party knows the specified (index) attack. If so, variable 0x800D (LASTRESULT) is set to the (zero-indexed) slot number of the first Pokemon that knows the move. If not, LASTRESULT is set to 0x0006. Variable 0x8004 is also set to this Pokemon's species. - .macro checkpartymove index + .macro checkpartymove index:req .byte 0x7c .2byte \index .endm @ Writes the name of the Pokemon at index species to the specified buffer. - .macro bufferspeciesname out, species + .macro bufferspeciesname out:req, species:req .byte 0x7d .byte \out .2byte \species .endm @ Writes the name of the species of the first Pokemon in the player's party to the specified buffer. - .macro bufferleadmonspeciesname out + .macro bufferleadmonspeciesname out:req .byte 0x7e .byte \out .endm @ Writes the nickname of the Pokemon in slot slot (zero-indexed) of the player's party to the specified buffer. If an empty or invalid slot is specified, ten spaces ("") are written to the buffer. - .macro bufferpartymonnick out, slot + .macro bufferpartymonnick out:req, slot:req .byte 0x7f .byte \out .2byte \slot .endm @ Writes the name of the item at index item to the specified buffer. If the specified index is larger than the number of items in the game (0x176), the name of item 0 ("????????") is buffered instead. - .macro bufferitemname out, item + .macro bufferitemname out:req, item:req .byte 0x80 .byte \out .2byte \item .endm @ Writes the name of the decoration at index decoration to the specified buffer. In FireRed, this command is a nop. - .macro bufferdecorationname out, decoration + .macro bufferdecorationname out:req, decoration:req .byte 0x81 .byte \out .2byte \decoration .endm @ Writes the name of the move at index move to the specified buffer. - .macro buffermovename out, move + .macro buffermovename out:req, move:req .byte 0x82 .byte \out .2byte \move .endm @ Converts the value of input to a decimal string, and writes that string to the specified buffer. - .macro buffernumberstring out, input + .macro buffernumberstring out:req, input:req .byte 0x83 .byte \out .2byte \input .endm @ Writes the standard string identified by index to the specified buffer. This command has no protections in place at all, so specifying an invalid standard string (e.x. 0x2B) can and usually will cause data corruption. - .macro bufferstdstring out, index + .macro bufferstdstring out:req, index:req .byte 0x84 .byte \out .2byte \index .endm @ Copies the string at offset to the specified buffer. - .macro bufferstring out, offset + .macro bufferstring out:req, offset:req .byte 0x85 .byte \out .4byte \offset .endm @ Opens the Pokemart system, offering the specified products for sale. - .macro pokemart products + .macro pokemart products:req .byte 0x86 .4byte \products .endm @ Opens the Pokemart system and treats the list of items as decorations. - .macro pokemartdecoration products + .macro pokemartdecoration products:req .byte 0x87 .4byte \products .endm @ Apparent clone of pokemartdecoration. - .macro pokemartdecoration2 products + .macro pokemartdecoration2 products:req .byte 0x88 .4byte \products .endm @ Starts up the slot machine minigame. - .macro playslotmachine word + .macro playslotmachine word:req .byte 0x89 .2byte \word .endm @ Sets a berry tree's specific berry and growth stage. In FireRed, this command is a nop. - .macro setberrytree tree_id, berry, growth_stage + .macro setberrytree tree_id:req, berry:req, growth_stage:req .byte 0x8a .byte \tree_id .byte \berry @@ -1004,34 +1004,34 @@ .endm @ Stores a random integer between 0 and limit in variable 0x800D (LASTRESULT). - .macro random limit + .macro random limit:req .byte 0x8f .2byte \limit .endm @ If check is 0x00, this command adds value to the player's money. - .macro givemoney value, check + .macro givemoney value:req, check:req .byte 0x90 .4byte \value .byte \check .endm @ If check is 0x00, this command subtracts value from the player's money. - .macro takemoney value, check + .macro takemoney value:req, check:req .byte 0x91 .4byte \value .byte \check .endm @ If check is 0x00, this command will check if the player has value or more money; script variable 0x800D (LASTRESULT) is set to 0x0001 if the player has enough money, or 0x0000 if the do not. - .macro checkmoney value, check + .macro checkmoney value:req, check:req .byte 0x92 .4byte \value .byte \check .endm @ Spawns a secondary box showing how much money the player has. - .macro showmoneybox x, y, check + .macro showmoneybox x:req, y:req, check:req .byte 0x93 .byte \x .byte \y @@ -1044,67 +1044,67 @@ .endm @ Updates the secondary box spawned by showmoney. Consumes but does not use arguments. - .macro updatemoneybox x, y + .macro updatemoneybox x:req, y:req .byte 0x95 .byte \x .byte \y .endm @ Gets the price reduction for the index given. In FireRed, this command is a nop. - .macro getpricereduction index + .macro getpricereduction index:req .byte 0x96 .2byte \index .endm @ Fades the screen to and from black and white. Mode 0x00 fades from black, mode 0x01 fades out to black, mode 0x2 fades in from white, and mode 0x3 fades out to white. - .macro fadescreen effect + .macro fadescreen effect:req .byte 0x97 .byte \effect .endm @ Fades the screen to and from black and white. Mode 0x00 fades from black, mode 0x01 fades out to black, mode 0x2 fades in from white, and mode 0x3 fades out to white. Other modes may exist. - .macro fadescreenspeed effect, speed + .macro fadescreenspeed effect:req, speed:req .byte 0x98 .byte \effect .byte \speed .endm - .macro setflashradius word + .macro setflashradius word:req .byte 0x99 .2byte \word .endm - .macro animateflash byte + .macro animateflash byte:req .byte 0x9a .byte \byte .endm - .macro messageautoscroll pointer + .macro messageautoscroll pointer:req .byte 0x9b .4byte \pointer .endm @ Executes the specified field move animation. - .macro dofieldeffect animation + .macro dofieldeffect animation:req .byte 0x9c .2byte \animation .endm @ Sets up the field effect argument argument with the value value. - .macro setfieldeffectargument argument, param + .macro setfieldeffectargument argument:req, param:req .byte 0x9d .byte \argument .2byte \param .endm @ Blocks script execution until all playing field move animations complete. - .macro waitfieldeffect animation + .macro waitfieldeffect animation:req .byte 0x9e .2byte \animation .endm @ Sets which healing place the player will return to if all of the Pokemon in their party faint. - .macro setrespawn heallocation + .macro setrespawn heallocation:req .byte 0x9f .2byte \heallocation .endm @@ -1115,14 +1115,14 @@ .endm @ Plays the specified (species) Pokemon's cry. You can use waitcry to block script execution until the sound finishes. - .macro playmoncry species, effect + .macro playmoncry species:req, effect:req .byte 0xa1 .2byte \species .2byte \effect .endm @ Changes the metatile at (x, y) on the current map. - .macro setmetatile x, y, metatile_number, tile_attrib + .macro setmetatile x:req, y:req, metatile_number:req, tile_attrib:req .byte 0xa2 .2byte \x .2byte \y @@ -1136,7 +1136,7 @@ .endm @ Queues a weather change to type weather. - .macro setweather type + .macro setweather type:req .byte 0xa4 .2byte \type .endm @@ -1147,30 +1147,30 @@ .endm @ This command manages cases in which maps have tiles that change state when stepped on (specifically, cracked/breakable floors). - .macro setstepcallback subroutine + .macro setstepcallback subroutine:req .byte 0xa6 .byte \subroutine .endm - .macro setmaplayoutindex index + .macro setmaplayoutindex index:req .byte 0xa7 .2byte \index .endm - .macro setobjectpriority index, map, priority + .macro setobjectpriority index:req, map:req, priority:req .byte 0xa8 .2byte \index map \map .byte \priority .endm - .macro resetobjectpriority index, map + .macro resetobjectpriority index:req, map:req .byte 0xa9 .2byte \index map \map .endm - .macro createvobject sprite, byte2, x, y, elevation, direction + .macro createvobject sprite:req, byte2:req, x:req, y:req, elevation, direction .byte 0xaa .byte \sprite .byte \byte2 @@ -1180,21 +1180,21 @@ .byte \direction .endm - .macro turnvobject index, direction + .macro turnvobject index:req, direction:req .byte 0xab .byte \index .byte \direction .endm @ Opens the door metatile at (X, Y) with an animation. - .macro opendoor x, y + .macro opendoor x:req, y:req .byte 0xac .2byte \x .2byte \y .endm @ Closes the door metatile at (X, Y) with an animation. - .macro closedoor x, y + .macro closedoor x:req, y:req .byte 0xad .2byte \x .2byte \y @@ -1206,21 +1206,21 @@ .endm @ Sets the door tile at (x, y) to be open without an animation. - .macro setdooropen x, y + .macro setdooropen x:req, y:req .byte 0xaf .2byte \x .2byte \y .endm @ Sets the door tile at (x, y) to be closed without an animation. - .macro setdoorclosed x, y + .macro setdoorclosed x:req, y:req .byte 0xb0 .2byte \x .2byte \y .endm @ In Emerald, this command consumes its parameters and does nothing. In FireRed, this command is a nop. - .macro addelevmenuitem a, b, c, d + .macro addelevmenuitem a:req, b:req, c:req, d:req .byte 0xb1 .byte \a .2byte \b @@ -1233,23 +1233,23 @@ .byte 0xb2 .endm - .macro checkcoins out + .macro checkcoins out:req .byte 0xb3 .2byte \out .endm - .macro givecoins count + .macro givecoins count:req .byte 0xb4 .2byte \count .endm - .macro takecoins count + .macro takecoins count:req .byte 0xb5 .2byte \count .endm @ Prepares to start a wild battle against a species at Level level holding item. Running this command will not affect normal wild battles. You start the prepared battle with dowildbattle. - .macro setwildbattle species, level, item + .macro setwildbattle species:req, level:req, item:req .byte 0xb6 .2byte \species .byte \level @@ -1261,78 +1261,78 @@ .byte 0xb7 .endm - .macro setvaddress pointer + .macro setvaddress pointer:req .byte 0xb8 .4byte \pointer .endm - .macro vgoto pointer + .macro vgoto pointer:req .byte 0xb9 .4byte \pointer .endm - .macro vcall pointer + .macro vcall pointer:req .byte 0xba .4byte \pointer .endm - .macro vgoto_if byte, pointer + .macro vgoto_if byte:req, pointer:req .byte 0xbb .byte \byte .4byte \pointer .endm - .macro vcall_if byte, pointer + .macro vcall_if byte:req, pointer:req .byte 0xbc .byte \byte .4byte \pointer .endm - .macro vmessage pointer + .macro vmessage pointer:req .byte 0xbd .4byte \pointer .endm - .macro vloadptr pointer + .macro vloadptr pointer:req .byte 0xbe .4byte \pointer .endm - .macro vbufferstring byte, pointer + .macro vbufferstring byte:req, pointer:req .byte 0xbf .byte \byte .4byte \pointer .endm @ Spawns a secondary box showing how many Coins the player has. - .macro showcoinsbox x, y + .macro showcoinsbox x:req, y:req .byte 0xc0 .byte \x .byte \y .endm @ Hides the secondary box spawned by showcoins. It consumes its arguments but doesn't use them. - .macro hidecoinsbox x, y + .macro hidecoinsbox x:req, y:req .byte 0xc1 .byte \x .byte \y .endm @ Updates the secondary box spawned by showcoins. It consumes its arguments but doesn't use them. - .macro updatecoinsbox x, y + .macro updatecoinsbox x:req, y:req .byte 0xc2 .byte \x .byte \y .endm @ Increases the value of the specified game stat by 1. The stat's value will not be allowed to exceed 0x00FFFFFF. - .macro incrementgamestat stat + .macro incrementgamestat stat:req .byte 0xc3 .byte \stat .endm @ Sets the destination that using an Escape Rope or Dig will take the player to. - .macro setescapewarp map, warp, x, y + .macro setescapewarp map:req, warp:req, x:req, y:req .byte 0xc4 map \map .byte \warp @@ -1346,20 +1346,20 @@ .endm @ Writes the name of the specified (box) PC box to the specified buffer. - .macro bufferboxname out, box + .macro bufferboxname out:req, box:req .byte 0xc6 .byte \out .2byte \box .endm @ Sets the color of the text in standard message boxes. 0x00 produces blue (male) text, 0x01 produces red (female) text, 0xFF resets the color to the default for the current OW's gender, and all other values produce black text. - .macro textcolor color + .macro textcolor color:req .byte 0xc7 .byte \color .endm @ The exact purpose of this command is unknown, but it is related to the blue help-text box that appears on the bottom of the screen when the Main Menu is opened. - .macro loadhelp pointer + .macro loadhelp pointer:req .byte 0xc8 .4byte \pointer .endm @@ -1380,20 +1380,20 @@ .endm @ Compares the value of a hidden variable to a dword. - .macro comparehiddenvar a, value + .macro comparehiddenvar a:req, value:req .byte 0xcc .byte \a .4byte \value .endm @ Makes the Pokemon in the specified slot of the player's party obedient. It will not randomly disobey orders in battle. - .macro setmonobedient slot + .macro setmonobedient slot:req .byte 0xcd .2byte \slot .endm @ Checks if the Pokemon in the specified slot of the player's party is obedient. If the Pokemon is disobedient, 0x0001 is written to script variable 0x800D (LASTRESULT). If the Pokemon is obedient (or if the specified slot is empty or invalid), 0x0000 is written. - .macro checkmonobedience slot + .macro checkmonobedience slot:req .byte 0xce .2byte \slot .endm @@ -1404,13 +1404,13 @@ .endm @ Sets worldmapflag to 1. This allows the player to Fly to the corresponding map, if that map has a flightspot. - .macro setworldmapflag worldmapflag + .macro setworldmapflag worldmapflag:req .byte 0xd0 .2byte \worldmapflag .endm @ Clone of warpteleport? It is apparently only used in FR/LG, and only with specials.[source] - .macro warpteleport2 map, warp, x, y + .macro warpteleport2 map:req, warp:req, x:req, y:req .byte 0xd1 map \map .byte \warp @@ -1419,13 +1419,13 @@ .endm @ Changes the location where the player caught the Pokemon in the specified slot of their party. - .macro setmonmetlocation slot, location + .macro setmonmetlocation slot:req, location:req .byte 0xd2 .2byte \slot .byte \location .endm - .macro mossdeepgym1 unknown + .macro mossdeepgym1 unknown:req .byte 0xd3 .2byte \unknown .endm @@ -1435,7 +1435,7 @@ .endm @ In FireRed, this command is a nop. - .macro mossdeepgym3 var + .macro mossdeepgym3 var:req .byte 0xd5 .2byte \var .endm @@ -1444,7 +1444,7 @@ .byte 0xd6 .endm - .macro warp7 map, byte, word1, word2 + .macro warp7 map:req, byte:req, word1:req, word2:req .byte 0xd7 map \map .byte \byte @@ -1464,34 +1464,34 @@ .byte 0xda .endm - .macro message3 pointer + .macro message3 pointer:req .byte 0xdb .4byte \pointer .endm - .macro fadescreenswapbuffers byte + .macro fadescreenswapbuffers byte:req .byte 0xdc .byte \byte .endm - .macro buffertrainerclassname out, class + .macro buffertrainerclassname out:req, class:req .byte 0xdd .byte \out .2byte \class .endm - .macro buffertrainername out, trainer + .macro buffertrainername out:req, trainer:req .byte 0xde .byte \out .2byte \trainer .endm - .macro pokenavcall pointer + .macro pokenavcall pointer:req .byte 0xdf .4byte \pointer .endm - .macro warp8 map, byte, word1, word2 + .macro warp8 map:req, byte:req, word1:req, word2:req .byte 0xe0 map \map .byte \byte @@ -1499,14 +1499,14 @@ .2byte \word2 .endm - .macro buffercontesttypestring out, word + .macro buffercontesttypestring out:req, word:req .byte 0xe1 .byte \out .2byte \word .endm @ Writes the name of the specified (item) item to the specified buffer. If the specified item is a Berry (0x85 - 0xAE) or Poke Ball (0x4) and if the quantity is 2 or more, the buffered string will be pluralized ("IES" or "S" appended). If the specified item is the Enigma Berry, I have no idea what this command does (but testing showed no pluralization). If the specified index is larger than the number of items in the game (0x176), the name of item 0 ("????????") is buffered instead. - .macro bufferitemnameplural out, item, quantity + .macro bufferitemnameplural out:req, item:req, quantity:req .byte 0xe2 .byte \out .2byte \item @@ -1516,15 +1516,15 @@ @ Supplementary - .macro goto_eq dest + .macro goto_eq dest:req goto_if 1, \dest .endm - .macro switch var + .macro switch var:req copyvar 0x8000, \var .endm - .macro case condition, dest + .macro case condition:req, dest:req compare 0x8000, \condition goto_eq \dest .endm @@ -1539,23 +1539,23 @@ YES = 1 NO = 0 - .macro msgbox text, type=MSGBOX_DEFAULT + .macro msgbox text:req, type=MSGBOX_DEFAULT loadword 0, \text callstd \type .endm - .macro giveitem_std item, amount=1, function=0 + .macro giveitem_std item:req, amount=1, function=0 setorcopyvar 0x8000, \item setorcopyvar 0x8001, \amount callstd \function .endm - .macro givedecoration_std decoration + .macro givedecoration_std decoration:req setorcopyvar 0x8000, \decoration callstd STD_OBTAIN_DECORATION .endm - .macro register_matchcall trainer + .macro register_matchcall trainer:req setvar VAR_0x8004, \trainer special SetMatchCallRegisteredFlag setorcopyvar VAR_0x8000, \trainer diff --git a/include/event_object_movement.h b/include/event_object_movement.h index 6515791c3..cc45f1531 100644 --- a/include/event_object_movement.h +++ b/include/event_object_movement.h @@ -19,7 +19,8 @@ enum SpinnerRunnerFollowPatterns RUNFOLLOW_SOUTH_EAST_WEST }; -struct UnkStruct_085094AC { +struct UnkStruct_085094AC +{ const union AnimCmd *const *anims; u8 animPos[4]; }; @@ -45,28 +46,6 @@ struct UnkStruct_085094AC { #define GROUND_EFFECT_FLAG_HOT_SPRINGS (1 << 18) #define GROUND_EFFECT_FLAG_SEAWEED (1 << 19) -#define movement_type_def(setup, table) \ -static u8 setup##_callback(struct EventObject *, struct Sprite *);\ -void setup(struct Sprite *sprite)\ -{\ - UpdateEventObjectCurrentMovement(&gEventObjects[sprite->data[0]], sprite, setup##_callback);\ -}\ -static u8 setup##_callback(struct EventObject *eventObject, struct Sprite *sprite)\ -{\ - return table[sprite->data[1]](eventObject, sprite);\ -} - -#define movement_type_empty_callback(setup) \ -static u8 setup##_callback(struct EventObject *, struct Sprite *);\ -void setup(struct Sprite *sprite)\ -{\ - UpdateEventObjectCurrentMovement(&gEventObjects[sprite->data[0]], sprite, setup##_callback);\ -}\ -static u8 setup##_callback(struct EventObject *eventObject, struct Sprite *sprite)\ -{\ - return 0;\ -} - struct PairedPalettes { u16 tag; diff --git a/include/overworld.h b/include/overworld.h index 6f7801905..60d9d5133 100644 --- a/include/overworld.h +++ b/include/overworld.h @@ -47,13 +47,8 @@ void Overworld_SetEventObjTemplateMovementType(u8 localId, u8 movementType); const struct MapLayout *GetMapLayout(void); void ApplyCurrentWarp(void); void set_warp2_warp3_to_neg_1(void); -static void SetWarpData(struct WarpData *warp, s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y); -static bool32 IsDummyWarp(struct WarpData *warp); struct MapHeader const *const Overworld_GetMapHeaderByGroupAndId(u16 mapGroup, u16 mapNum); struct MapHeader const *const GetDestinationWarpMapHeader(void); -static void LoadCurrentMapData(void); -static void LoadSaveblockMapHeader(void); -static void SetPlayerCoordsFromWarp(void); void WarpIntoMap(void); void Overworld_SetWarpDestination(s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y); void warp1_set_2(s8 mapGroup, s8 mapNum, s8 warpId); @@ -67,7 +62,6 @@ void sub_8084D5C(s16 a1, s16 a2); void sub_8084DD4(s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y); void sub_8084E14(void); void SetFixedDiveWarp(s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y); -static void SetFixedDiveWarpAsDestination(void); void SetFixedHoleWarp(s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y); void SetFixedHoleWarpAsDestination(s16 x, s16 y); void warp1_set_to_sav1w(void); @@ -75,7 +69,6 @@ void sub_8084F2C(s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y); void sub_8084F6C(u8 a1); void sub_8084FAC(int unused); const struct MapConnection *GetMapConnection(u8 dir); -static bool8 SetDiveWarp(u8 dir, u16 x, u16 y); bool8 SetDiveWarpEmerge(u16 x, u16 y); bool8 SetDiveWarpDive(u16 x, u16 y); void mliX_load_map(u8 mapGroup, u8 mapNum); diff --git a/include/string_util.h b/include/string_util.h index 67149bca0..d7a005ec5 100644 --- a/include/string_util.h +++ b/include/string_util.h @@ -39,7 +39,6 @@ u8 *WriteColorChangeControlCode(u8 *dest, u32 colorType, u8 color); bool32 IsStringJapanese(u8 *str); bool32 sub_800924C(u8 *str, s32 n); u8 GetExtCtrlCodeLength(u8 code); -static const u8 *SkipExtCtrlCode(const u8 *s); s32 StringCompareWithoutExtCtrlCodes(const u8 *str1, const u8 *str2); void ConvertInternationalString(u8 *s, u8 language); void StripExtCtrlCodes(u8 *str); diff --git a/src/data/items.h b/src/data/items.h index 49f981faf..2293bcfac 100644 --- a/src/data/items.h +++ b/src/data/items.h @@ -5961,7 +5961,7 @@ const struct Item gItems[] = .battleUseFunc = NULL, .secondaryId = 0, }, - { + { .name = _("MYSTICTICKET"), .itemId = ITEM_MYSTIC_TICKET, .price = 0, @@ -5977,7 +5977,7 @@ const struct Item gItems[] = .battleUseFunc = NULL, .secondaryId = 0, }, - { + { .name = _("AURORATICKET"), .itemId = ITEM_AURORA_TICKET, .price = 0, @@ -5993,7 +5993,7 @@ const struct Item gItems[] = .battleUseFunc = NULL, .secondaryId = 0, }, - { + { .name = _("POWDER JAR"), .itemId = ITEM_POWDER_JAR, .price = 0, @@ -6009,7 +6009,7 @@ const struct Item gItems[] = .battleUseFunc = NULL, .secondaryId = 0, }, - { + { .name = _("RUBY"), .itemId = ITEM_RUBY, .price = 0, @@ -6025,7 +6025,7 @@ const struct Item gItems[] = .battleUseFunc = NULL, .secondaryId = 0, }, - { + { .name = _("SAPPHIRE"), .itemId = ITEM_SAPPHIRE, .price = 0, @@ -6044,7 +6044,7 @@ const struct Item gItems[] = //Emerald-specific key items - { + { .name = _("MAGMA EMBLEM"), .itemId = ITEM_MAGMA_EMBLEM, .price = 0, @@ -6060,7 +6060,7 @@ const struct Item gItems[] = .battleUseFunc = NULL, .secondaryId = 0, }, - { + { .name = _("OLD SEA MAP"), .itemId = ITEM_OLD_SEA_MAP, .price = 0, diff --git a/src/event_object_movement.c b/src/event_object_movement.c index cd5a547a9..e509c7738 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -27,6 +27,28 @@ // this file was known as evobjmv.c in Game Freak's original source +#define movement_type_def(setup, table) \ +static u8 setup##_callback(struct EventObject *, struct Sprite *);\ +void setup(struct Sprite *sprite)\ +{\ + UpdateEventObjectCurrentMovement(&gEventObjects[sprite->data[0]], sprite, setup##_callback);\ +}\ +static u8 setup##_callback(struct EventObject *eventObject, struct Sprite *sprite)\ +{\ + return table[sprite->data[1]](eventObject, sprite);\ +} + +#define movement_type_empty_callback(setup) \ +static u8 setup##_callback(struct EventObject *, struct Sprite *);\ +void setup(struct Sprite *sprite)\ +{\ + UpdateEventObjectCurrentMovement(&gEventObjects[sprite->data[0]], sprite, setup##_callback);\ +}\ +static u8 setup##_callback(struct EventObject *eventObject, struct Sprite *sprite)\ +{\ + return 0;\ +} + EWRAM_DATA u8 sCurrentReflectionType = 0; EWRAM_DATA u16 sCurrentSpecialObjectPaletteTag = 0; EWRAM_DATA struct LockedAnimEventObjects *gLockedAnimEventObjects = {0}; |