diff options
author | GriffinR <griffin.g.richards@gmail.com> | 2022-01-23 18:51:56 -0500 |
---|---|---|
committer | GriffinR <griffin.g.richards@gmail.com> | 2022-01-23 18:52:04 -0500 |
commit | 2495d1813239cd8d888c160b08c23500ba4759a7 (patch) | |
tree | 722b48dad6b8798f4a4d04314386b4b2a383d1da /asm/macros | |
parent | 9f2b6ab2f2b7d5937342cef3166a652d882f1d94 (diff) |
Add missing :req, remove old macros
Diffstat (limited to 'asm/macros')
-rw-r--r-- | asm/macros/asm.inc | 4 | ||||
-rw-r--r-- | asm/macros/field_effect_script.inc | 14 | ||||
-rw-r--r-- | asm/macros/function.inc | 10 | ||||
-rw-r--r-- | asm/macros/m4a.inc | 10 | ||||
-rw-r--r-- | asm/macros/map.inc | 98 | ||||
-rw-r--r-- | asm/macros/pokemon_data.inc | 56 | ||||
-rw-r--r-- | asm/macros/window.inc | 35 |
7 files changed, 73 insertions, 154 deletions
diff --git a/asm/macros/asm.inc b/asm/macros/asm.inc index 4ac003fab..3f70145d3 100644 --- a/asm/macros/asm.inc +++ b/asm/macros/asm.inc @@ -1,4 +1,4 @@ - .macro inc x + .macro inc x:req .set \x, \x + 1 .endm @@ -6,7 +6,7 @@ .set __enum__, \x .endm - .macro enum constant + .macro enum constant:req .equiv \constant, __enum__ inc __enum__ .endm diff --git a/asm/macros/field_effect_script.inc b/asm/macros/field_effect_script.inc index 597b89acb..2a1e2abee 100644 --- a/asm/macros/field_effect_script.inc +++ b/asm/macros/field_effect_script.inc @@ -1,19 +1,19 @@ - .macro field_eff_loadtiles address + .macro field_eff_loadtiles address:req .byte 0 .4byte \address .endm - .macro field_eff_loadfadedpal address + .macro field_eff_loadfadedpal address:req .byte 1 .4byte \address .endm - .macro field_eff_loadpal address + .macro field_eff_loadpal address:req .byte 2 .4byte \address .endm - .macro field_eff_callnative address + .macro field_eff_callnative address:req .byte 3 .4byte \address .endm @@ -22,20 +22,20 @@ .byte 4 .endm - .macro field_eff_loadgfx_callnative tiles_address, palette_address, function_address + .macro field_eff_loadgfx_callnative tiles_address:req, palette_address:req, function_address:req .byte 5 .4byte \tiles_address .4byte \palette_address .4byte \function_address .endm - .macro field_eff_loadtiles_callnative tiles_address, function_address + .macro field_eff_loadtiles_callnative tiles_address:req, function_address:req .byte 6 .4byte \tiles_address .4byte \function_address .endm - .macro field_eff_loadfadedpal_callnative palette_address, function_address + .macro field_eff_loadfadedpal_callnative palette_address:req, function_address:req .byte 7 .4byte \palette_address .4byte \function_address diff --git a/asm/macros/function.inc b/asm/macros/function.inc index b109595df..0f4e6720c 100644 --- a/asm/macros/function.inc +++ b/asm/macros/function.inc @@ -1,15 +1,15 @@ - .macro arm_func_start name + .macro arm_func_start name:req .align 2, 0 .global \name .arm .type \name, %function .endm - .macro arm_func_end name + .macro arm_func_end name:req .size \name, .-\name .endm - .macro thumb_func_start name + .macro thumb_func_start name:req .align 2, 0 .global \name .thumb @@ -17,13 +17,13 @@ .type \name, %function .endm - .macro non_word_aligned_thumb_func_start name + .macro non_word_aligned_thumb_func_start name:req .global \name .thumb .thumb_func .type \name, %function .endm - .macro thumb_func_end name + .macro thumb_func_end name:req .size \name, .-\name .endm diff --git a/asm/macros/m4a.inc b/asm/macros/m4a.inc index 6c5abc09b..3407c3f69 100644 --- a/asm/macros/m4a.inc +++ b/asm/macros/m4a.inc @@ -1,13 +1,13 @@ - .macro song label, music_player, unknown + .macro song label:req, music_player:req, unknown:req .4byte \label .2byte \music_player .2byte \unknown .endm - .macro music_player info_struct, track_struct, unknown_1, unknown_2 + .macro music_player info_struct:req, track_struct:req, num_tracks:req, unknown:req .4byte \info_struct .4byte \track_struct - .byte \unknown_1 - .space 1 - .2byte \unknown_2 + .byte \num_tracks + .byte 0 @ Padding + .2byte \unknown .endm diff --git a/asm/macros/map.inc b/asm/macros/map.inc index 74ed06917..737a90006 100644 --- a/asm/macros/map.inc +++ b/asm/macros/map.inc @@ -1,78 +1,88 @@ - .macro map map_id + .macro map map_id:req .byte \map_id >> 8 @ map group .byte \map_id & 0xFF @ map num .endm - .macro map_script type, address + .macro map_script type:req, script:req .byte \type - .4byte \address + .4byte \script .endm - .macro map_script_2 word1, word2, address - .2byte \word1 - .2byte \word2 - .4byte \address + .macro map_script_2 var:req, compare:req, script:req + .2byte \var + .2byte \compare + .4byte \script .endm - .macro object_event index:req, gfx:req, replacement:req, x:req, y:req, elevation:req, movement_type:req, x_radius:req, y_radius:req, trainer_type:req, sight_radius_tree_etc:req, script:req, event_flag:req - .byte \index, \gfx, \replacement, 0 - .2byte \x - .2byte \y - .byte \elevation, \movement_type, ((\y_radius << 4) | \x_radius), 0 - .2byte \trainer_type, \sight_radius_tree_etc + .macro object_event index:req, gfx:req, inConnection:req, x:req, y:req, elevation:req, movement_type:req, x_radius:req, y_radius:req, trainer_type:req, sight_radius_tree_etc:req, script:req, event_flag:req + .byte \index + .byte \gfx + .byte \inConnection + .byte 0 @ Padding + .2byte \x, \y + .byte \elevation + .byte \movement_type + .byte ((\y_radius << 4) | \x_radius) + .byte 0 @ Padding + .2byte \trainer_type + .2byte \sight_radius_tree_etc .4byte \script .2byte \event_flag - .2byte 0 + .2byte 0 @ Padding inc _num_npcs .endm - .macro warp_def x, y, byte, warp, map_id + .macro warp_def x:req, y:req, elevation:req, warpId:req, map_id:req .2byte \x, \y - .byte \byte, \warp + .byte \elevation + .byte \warpId .byte \map_id & 0xFF @ map num .byte \map_id >> 8 @ map group inc _num_warps .endm - .macro coord_event x, y, elevation, trigger, index, script + .macro coord_event x:req, y:req, elevation:req, trigger:req, index:req, script:req .2byte \x, \y - .byte \elevation, 0 - .2byte \trigger, \index, 0 + .byte \elevation + .byte 0 @ Padding + .2byte \trigger + .2byte \index + .2byte 0 @ Padding .4byte \script inc _num_traps .endm - .macro coord_weather_event x, y, elevation, weather - .2byte \x, \y - .byte \elevation, 0 - .2byte \weather - .2byte 0, 0 - .4byte 0 - inc _num_traps + .macro coord_weather_event x:req, y:req, elevation:req, weather:req + coord_event \x, \y, \elevation, \weather, 0, NULL .endm - .macro bg_event x, y, elevation, kind, arg6, arg7 + .macro bg_event x:req, y:req, elevation:req, kind:req, arg6:req, arg7 .2byte \x, \y - .byte \elevation, \kind - .2byte 0 + .byte \elevation + .byte \kind + .2byte 0 @ Padding .if \kind != BG_EVENT_HIDDEN_ITEM - .4byte \arg6 + .4byte \arg6 .else - .2byte \arg6 - .2byte \arg7 + .2byte \arg6 + .2byte \arg7 .endif inc _num_signs .endm - .macro bg_hidden_item_event x, y, height, item, flag - bg_event \x, \y, \height, BG_EVENT_HIDDEN_ITEM, \item, ((\flag) - FLAG_HIDDEN_ITEMS_START) + .macro bg_sign_event x:req, y:req, elevation:req, facing_dir:req, script:req + bg_event \x, \y, \elevation, \facing_dir, \script + .endm + + .macro bg_hidden_item_event x:req, y:req, elevation:req, item:req, flag:req + bg_event \x, \y, \elevation, BG_EVENT_HIDDEN_ITEM, \item, ((\flag) - FLAG_HIDDEN_ITEMS_START) .endm - .macro bg_secret_base_event x, y, height, secret_base_id - bg_event \x, \y, \height, BG_EVENT_SECRET_BASE, \secret_base_id + .macro bg_secret_base_event x:req, y:req, elevation:req, secret_base_id:req + bg_event \x, \y, \elevation, BG_EVENT_SECRET_BASE, \secret_base_id .endm - .macro map_events npcs, warps, traps, signs + .macro map_events npcs:req, warps:req, traps:req, signs:req .byte _num_npcs, _num_warps, _num_traps, _num_signs .4byte \npcs, \warps, \traps, \signs reset_map_events @@ -88,14 +98,14 @@ reset_map_events - .equiv connection_down, 1 - .equiv connection_up, 2 - .equiv connection_left, 3 - .equiv connection_right, 4 - .equiv connection_dive, 5 - .equiv connection_emerge, 6 + .equiv connection_down, CONNECTION_SOUTH + .equiv connection_up, CONNECTION_NORTH + .equiv connection_left, CONNECTION_WEST + .equiv connection_right, CONNECTION_EAST + .equiv connection_dive, CONNECTION_DIVE + .equiv connection_emerge, CONNECTION_EMERGE - .macro connection direction, offset, map + .macro connection direction:req, offset:req, map:req .4byte connection_\direction .4byte \offset map \map diff --git a/asm/macros/pokemon_data.inc b/asm/macros/pokemon_data.inc deleted file mode 100644 index ce8ef98ac..000000000 --- a/asm/macros/pokemon_data.inc +++ /dev/null @@ -1,56 +0,0 @@ - .macro pokedex_entry height, width, text_pointer, pokemon_scale, pokemon_offset, trainer_scale, trainer_offset - .2byte \height @ in decimeters - .2byte \width @ in hectograms - .4byte \text_pointer - .2byte 0 @ unused - .2byte \pokemon_scale - .2byte \pokemon_offset - .2byte \trainer_scale - .2byte \trainer_offset - .2byte 0 @ padding - .endm - - .macro base_stats hp, attack, defense, speed, sp_attack, sp_defense - .byte \hp - .byte \attack - .byte \defense - .byte \speed - .byte \sp_attack - .byte \sp_defense - .endm - - .macro ev_yield hp, attack, defense, speed, sp_attack, sp_defense - .2byte (\sp_defense << 10) | (\sp_attack << 8) | (\speed << 6) | (\defense << 4) | (\attack << 2) | \hp - .endm - - .macro level_up_move level, move - .2byte (\level << 9) | \move - .endm - - .macro evo_entry method, parameter, target_species - .2byte \method - .2byte \parameter - .2byte \target_species - .2byte 0 @ padding - .endm - - .macro empty_evo_entries count - .fill 8 * \count, 1, 0 - .endm - - .macro egg_moves_begin species - .2byte 20000 + \species - .endm - -@ If the min level equals the max level, only one level argument is needed. - .macro wild_mon species, min_level, max_level - .byte \min_level - - .ifb \max_level - .byte \min_level - .else - .byte \max_level - .endif - - .2byte \species - .endm diff --git a/asm/macros/window.inc b/asm/macros/window.inc deleted file mode 100644 index a91782bbf..000000000 --- a/asm/macros/window.inc +++ /dev/null @@ -1,35 +0,0 @@ - .macro window_template bg_id, x, y, width, height, palette, vram_tile_offset - .byte \bg_id - .byte \x - .byte \y - .byte \width - .byte \height - .byte \palette - .2byte \vram_tile_offset - .endm - - .macro null_window_template - window_template 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0000 - .endm - - .macro glyph_width_func font_id, func - .4byte \font_id - .4byte \func - .endm - - .macro keypad_icon tile_offset, width, height - .2byte \tile_offset - .byte \width - .byte \height - .endm - - .macro font_info func, max_glyph_width, glyph_height, glyph_spacing, line_spacing, text_color, shadow_color, bg_color - .4byte \func - .byte \max_glyph_width - .byte \glyph_height - .byte \glyph_spacing - .byte \line_spacing - .byte \text_color << 4 @ low nybble seems unused - .byte (\shadow_color << 4) | \bg_color - .2byte 0 @ padding - .endm |