pokeemerald/asm/macros.inc

137 lines
2.8 KiB
PHP
Raw Normal View History

2016-11-01 16:29:13 +01:00
.include "asm/macros/asm.inc"
.include "asm/macros/function.inc"
2017-10-24 04:18:49 +02:00
.include "asm/macros/movement.inc"
2016-11-01 16:29:13 +01:00
.include "asm/macros/window.inc"
.include "asm/macros/pokemon_data.inc"
.include "asm/macros/ec.inc"
.include "asm/macros/map.inc"
.include "asm/macros/field_effect_script.inc"
.include "asm/macros/battle_frontier.inc"
2015-10-19 18:42:57 +02:00
2015-10-18 14:11:30 +02:00
.macro region_map_entry x, y, width, height, name
.byte \x
.byte \y
.byte \width
.byte \height
.4byte gMapName_\name
.endm
2015-11-08 00:09:26 +01:00
.macro obj_tiles address, uncompressed_size, tag = 0
2015-11-08 00:09:26 +01:00
.4byte \address
.2byte \uncompressed_size
.2byte \tag
.endm
2017-09-25 23:26:45 +02:00
.macro null_obj_tiles
obj_tiles 0, 0, 0
.endm
2015-11-08 00:09:26 +01:00
.macro obj_pal address, tag
.4byte \address
.2byte \tag
2016-09-03 04:51:16 +02:00
.2byte 0@ padding
2015-11-08 00:09:26 +01:00
.endm
2017-09-25 23:26:45 +02:00
.macro null_obj_pal
obj_pal 0, 0
.endm
.macro paired_pals tag, address
.2byte \tag
.2byte 0 @ padding
.4byte \address
.endm
@ For object animation frames.
.macro obj_frame_tiles address, uncompressed_size
.4byte \address
.2byte \uncompressed_size
.2byte 0 @ padding
.endm
.macro spr_template tile_tag, pal_tag, oam, anims, images, affine_anims, callback
.2byte \tile_tag
.2byte \pal_tag
.4byte \oam
.4byte \anims
.4byte \images
.4byte \affine_anims
.4byte \callback
.endm
2016-09-03 04:51:16 +02:00
@ Berry trees have a table defining the palette slot used for each of their 5
@ stages. However, the first 2 stages always use the same slots regardless of
@ the type of tree and the slots of the last 3 stages always equal each other.
2015-11-21 10:39:40 +01:00
.macro berry_tree_palette_slot_table slot
.byte 3, 4, \slot, \slot, \slot
.endm
.macro subsprite x, y, priority, tile_num_offset, size
2015-11-21 10:39:40 +01:00
.byte \x
.byte \y
.2byte ((\priority) << 14) | ((\tile_num_offset) << 4) | SPRITE_SIZE_\size
.endm
.macro obj_image_anim_frame pic_id, duration, flags = 0
.2byte \pic_id
.byte (\flags) | (\duration)
2016-09-03 04:51:16 +02:00
.byte 0 @ padding
2015-11-21 10:39:40 +01:00
.endm
.macro obj_image_anim_loop count
.2byte 0xfffd
.byte \count
2016-09-03 04:51:16 +02:00
.byte 0 @ padding
2015-11-21 10:39:40 +01:00
.endm
.macro obj_image_anim_jump target_index
.2byte 0xfffe
.byte \target_index
2016-09-03 04:51:16 +02:00
.byte 0 @ padding
2015-11-21 10:39:40 +01:00
.endm
.macro obj_image_anim_end
.2byte 0xffff
2016-09-03 04:51:16 +02:00
.2byte 0 @ padding
2015-11-21 10:39:40 +01:00
.endm
.macro obj_rot_scal_anim_frame delta_x_scale, delta_y_scale, delta_angle, duration
.2byte \delta_x_scale
.2byte \delta_y_scale
.byte \delta_angle
.byte \duration
2016-09-03 04:51:16 +02:00
.2byte 0 @ padding
2015-11-21 10:39:40 +01:00
.endm
.macro obj_rot_scal_anim_loop count
.2byte 0x7ffd
.2byte \count
2016-09-03 04:51:16 +02:00
.4byte 0 @ padding
2015-11-21 10:39:40 +01:00
.endm
.macro obj_rot_scal_anim_jump target_index
.2byte 0x7ffe
.2byte \target_index
2016-09-03 04:51:16 +02:00
.4byte 0 @ padding
2015-11-21 10:39:40 +01:00
.endm
.macro obj_rot_scal_anim_end unknown=0
2015-11-21 10:39:40 +01:00
.2byte 0x7fff
.2byte \unknown
.fill 4 @ padding
2015-11-21 10:39:40 +01:00
.endm
2018-01-07 08:29:26 +01:00
.macro door_anim_frame unknown, offset
.byte \unknown
.byte 0 @ padding
.2byte \offset
.endm
.macro door_anim_gfx metatile_num, unknown, unknown2, tile_addr, palette_addr
.2byte \metatile_num
.byte \unknown
.byte \unknown2
.4byte \tile_addr
.4byte \palette_addr
.endm