forked from pret/pokefirered
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmacros.inc
169 lines (144 loc) · 3.51 KB
/
macros.inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
.include "asm/macros/asm.inc"
.include "asm/macros/function.inc"
.include "asm/macros/movement.inc"
.include "asm/macros/ec.inc"
.include "asm/macros/map.inc"
.include "asm/macros/m4a.inc"
.include "asm/macros/trainer_tower.inc"
.macro region_map_location x, y, width, height, name
.byte \x
.byte \y
.byte \width
.byte \height
.4byte gMapName_\name
.endm
.macro obj_tiles address, uncompressed_size, tag
.4byte \address
.2byte \uncompressed_size
.2byte \tag
.endm
.macro null_obj_tiles
obj_tiles 0, 0, 0
.endm
.macro obj_pal address, tag
.4byte \address
.2byte \tag
.2byte 0 @ padding
.endm
.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
@ 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.
.macro berry_tree_palette_slot_table slot
.byte 3, 4, \slot, \slot, \slot
.endm
.macro subsprite x, y, priority, tile_num_offset, size
.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)
.byte 0 @ padding
.endm
.macro obj_image_anim_loop count
.2byte 0xfffd
.byte \count
.byte 0 @ padding
.endm
.macro obj_image_anim_jump target_index
.2byte 0xfffe
.byte \target_index
.byte 0 @ padding
.endm
.macro obj_image_anim_end
.2byte 0xffff
.2byte 0 @ padding
.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
.2byte 0 @ padding
.endm
.macro obj_rot_scal_anim_loop count
.2byte 0x7ffd
.2byte \count
.4byte 0 @ padding
.endm
.macro obj_rot_scal_anim_jump target_index
.2byte 0x7ffe
.2byte \target_index
.4byte 0 @ padding
.endm
.macro obj_rot_scal_anim_end unknown=0
.2byte 0x7fff
.2byte \unknown
.fill 4 @ padding
.endm
.macro overworld_frame ptr:req, width:req, height:req, frame:req
.4byte (\ptr + (\width * \height * \frame * 64) / 2)
.2byte (\width * \height * 64) / 2
.2byte 0 @ padding
.endm
.macro credits_entry number, text
.4byte \number
.4byte \text
.endm
.macro door_anim_frame unknown, offset
.byte \unknown
.byte 0 @ padding
.2byte \offset
.endm
.macro door_anim_gfx metatile_num, unknown, tile_addr, palette_addr
.2byte \metatile_num
.2byte \unknown
.4byte \tile_addr
.4byte \palette_addr
.endm
.macro trainer_eye_trainer opp_1, opp_2, opp_3, opp_4, opp_5, map_name
.2byte OPPONENT_\opp_1
.2byte OPPONENT_\opp_2
.2byte OPPONENT_\opp_3
.2byte OPPONENT_\opp_4
.2byte OPPONENT_\opp_5
.2byte GROUP_\map_name
.2byte MAP_\map_name
.space 2
.endm
.macro window_template bg, top, left, height, width, palno, baseBlock
.byte \bg, \top, \left, \height, \width, \palno
.2byte \baseBlock
.endm
.macro abspath relative
.if REVISION == 0
.ascii "C:/WORK/POKeFRLG/src/pm_lgfr_ose/source/"
.else
.ascii "C:/WORK/POKeFRLG/Src/pm_lgfr_ose/source/"
.endif
.asciz "\relative"
.endm