-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmetadata.h
328 lines (310 loc) · 15.2 KB
/
metadata.h
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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
//
// Created by Allen on 2/5/2020.
//
#ifndef METADATA
#define METADATA
#include <stdbool.h>
/*
* Note: if the sprite is persistent, then the layer will be ignored when painting the background, so send them in the right order!
*/
#define LAYER_NULL 0
#define LAYER_BOTTOM 1
#define LAYER_BACKGROUND 10
#define LAYER_BACKGROUND_ANIMATION 20
#define LAYER_CHARACTER 30
#define LAYER_CHARACTER_ATTACK 40
#define LAYER_NAMETAG 50
#define LAYER_CHARACTER_PROJECTILE 60
#define LAYER_OVERLAY 100
#define LAYER_PERCENTAGE 110
#define LAYER_TOP 255
#define CHARACTER_KIRBY 0
#define CHARACTER_GAMEANDWATCH 1
#define CHARACTER_VALVANO 2
#define STAGE_FINALDESTINATION 0
#define STAGE_TOWER 1
#define STAGE_BATTLEFIELD 2
#define STAGE_SMASHVILLE 3
#define STAGE_EER 4
#define STAGE_GREGORYGYM 5
#define BACKGROUND_FINALDESTINATION 0
#define BACKGROUND_TOWER 1
#define BACKGROUND_BATTLEFIELD 2
#define BACKGROUND_SMASHVILLE 3
#define BACKGROUND_EER 4
#define BACKGROUND_GREGORYGYM 5
#define BACKGROUND_MENU 10
#define BACKGROUND_STAGEMENU 11
#define BACKGROUND_TITLESCREEN 12
#define BACKGROUND_WIN_P1_KIRBY 14
#define BACKGROUND_WIN_P2_KIRBY 15
#define BACKGROUND_WIN_P1_GAMEANDWATCH 16
#define BACKGROUND_WIN_P2_GAMEANDWATCH 17
#define BACKGROUND_WIN_P1_VALVANO 18
#define BACKGROUND_WIN_P2_VALVANO 19
#define BACKGROUND_WIN_P1_KIRBY_CHINESE 20
#define BACKGROUND_WIN_P2_KIRBY_CHINESE 21
#define BACKGROUND_WIN_P1_GAMEANDWATCH_CHINESE 22
#define BACKGROUND_WIN_P2_GAMEANDWATCH_CHINESE 23
#define BACKGROUND_WIN_P1_VALVANO_CHINESE 24
#define BACKGROUND_WIN_P2_VALVANO_CHINESE 25
#define CHARACTERS 5
const char characterNames[CHARACTERS][14] = {
{"kirby"},
{"gaw"},
{"valvano"}, // TODO: CHANGE THIS BACK TO SHORTER "VAL" WHEN PORTING TO TM4C
{"misc"},
{"menu"}
};
const char persistentSprites[26][7] = {
/* 0 */{"fdst"},
{"tower"},
{"battl"},
{"smvl"},
{"eer"},
{"greg"},
{""},
{""},
{""},
{""},
/* 10 */{"cmenu"},
{"smenu"},
{"title"},
{""},
{"w1kb"},
{"w2kb"},
{"w1gw"},
{"w2gw"},
{"w1va"},
{"w2va"},
/* 20 */{"w1kbc"},
{"w2kbc"},
{"w1gwc"},
{"w2gwc"},
{"w1vac"},
{"w2vac"}
};
const uint16_t numberOfAnimations = 64;
const char animations[CHARACTERS][64][12] = {
{ // frames
/* 0 */ {"crouch"}, // 1
{"dash"}, // 8
{"fall"}, // 2
{"fallnojmp"}, // 2
{"firstjmp"}, // 8 (use 7 bc staggered)
{"multijmp"}, // 4 (use 3)
{"rest"}, // 7
{"slow"}, // 5
{"slowstop"}, // 2
{"walk"}, // 12
/* 10 */ {"jab"}, // 3(single)+2(doub)+(1+6)(repeat)
{"fair"}, // 8
{"fsmash"}, // 10
{"fspecial"}, // 11
{"ftilt"}, // 8
{"downtilt"}, // 4
{"uptilt"}, // 7
{"upsmash"}, // 8
{"ledge"}, // 1
{"upbproj"}, // 1 up special landing projectile
/* 20 */ {"upbinit"}, // 3
{"upbrise"}, // 1
{"upbtop"}, // 6
{"upbfall"}, // 1(fall)+1(followthrough)
{"backair"}, // 9
{"downair"}, // 11
{"fwdair"}, // 8
{"upair"}, // 6
{"nair"}, // 8
{"dashatk"}, // 7
/* 30 */ {""},
{"starproj"}, // 1 + 3
{"neutralb"}, // 4
{"fwdspec"}, // 10
{"downspec"}, // 3
{"downsmash"}, // 12
{""},
{""},
{""},
{""},
/* 40 */ {"hit"}, // 3
{"hurt"}, // 8
{"hurtfall"}, // 3
{"knockout"}, // 1
{"stun"}, // 8
{"shield"}, // 1
{""},
},
{
/* 0 */ {"rest"}, // 1 + 1
{"walk"}, // 1 (start) + 2
{"dash"}, // 2
{"jump"}, // 4
{"djump"}, // 4
{"fall"}, // 2
{"crouch"}, // 1
{""},
{""},
{""},
/* 10 */ {"ftilt"}, // 2
{"utilt"}, // 3
{"dtilt"}, // 4
{"dashatk"}, // 1
{"fsmash"}, // 2 (charge) + 2
{"dsmash"}, // 2 (charge) + 1
{"usmash"}, // 2 (charge) + 2
{"neuatk"}, // 2
{""},
{""},
/* 20 */ {"nair"}, // 3
{"fair"}, // 3
{"bair"}, // 3
{"dair"}, // 3
{"uair"}, // 5
{""},
{""},
{""},
{""},
{""},
/* 30 */ {"neub"}, // 3
{"neubproj"}, // 4 (each frame is another projectile)
{"sideb"}, // 3
{"sidebnum"}, // 9 (each frame is a number, frame 0 = 1)
{"downb"}, // 1 (catch) + 1 (let go) + 3 (charge levels) + 1 (release)
{"downbproj"}, // 1
{"upb"}, // 2 (up) + 1 (peak) + 2 (down)
{"upbfall"}, // 1 (start) + 8 (loop)
{""},
{""},
/* 40 */ {"hurt"}, // 2
{"shield"}, // 1
{"ledge"}, // 1
{"stun"} // 4
},
{
/* 0 */ {"rest"}, // 1 + 3 (blink)
{"crouch"}, // 1
{"run"}, // 5
{"jump"}, // 1
{"falling"}, // 2
{"ledge"}, // 1
{"shield"}, // 1
{"hurt"}, // 2
{"stun"}, // 4
{""},
/* 10 */ {"dashattack"}, // 5
{"jab"}, // 5 (first jab) + 3 (second jab)
{"ftilt"}, // 4
{"dtilt"}, // 2
{"utilt"}, // 5
{""},
{""},
{""},
{""},
{""},
/* 20 */ {"nair"}, // 4
{"fair"}, // 6
{"dair"}, // 2
{"uair"}, // 3
{""},
{""},
{""},
{""},
{""},
{""},
/* 30 */ {"neutralb"}, // 3
{"sidespecial"}, // 8
{"upspecial"}, // 5
{"laserproj"}, // 1
{"downspecial"}, // 2
{"robotcar"}, // 2 + 3 (explosion)
{""},
{""},
{""},
{""},
/* 40 */ {""},
{""},
{""},
{""},
{""},
{""},
{""},
{""},
{""},
{""},
},
{
/* 0 */ {"num0"}, // 1
{"num1"}, // 1
{"num2"}, // 1
{"num3"}, // 1
{"numdot"}, // 1
{"blastdown"}, // 17
{"blastleft"}, // 17
{"blastright"}, // 17
{"blastup"}, // 17
{"321go"}, // 36
/* 10 */ {"game"}, // 25
{"shield"}, // 3 (red) + 3 (blue)
{""},
{""},
{""},
{""},
{""},
{""},
{""},
{""},
/* 20 */ {"platform"},
{""},
{""},
{""},
{""},
{""},
},
{
/* 0 */ {"p1small"},
{"p1big"},
{"p2small"},
{"p2big"},
{"stageselect"},
{"selectbox"},
{"titlemsg"}, // 1 (words) + 1 (blank)
{""},
{""},
{""},
/* 10 */ {"prvwkirby"},
{"prvwvalvano"},
{"prvwgaw"},
{""},
{""},
{""},
{""},
{""},
{""},
{""},
{""},
{""},
}
};
struct Animation {
uint32_t memLocation;
uint8_t width;
uint8_t height;
uint8_t frames;
uint8_t characterIndex;
uint8_t animationIndex;
};
struct SpriteSendable {
int16_t x;
int16_t y;
uint8_t charIndex;
uint8_t animationIndex;
uint8_t frame; // current frame of animation
bool persistent; // if the animation is persistent,
uint8_t layer; // priority for layering over other sprites. high layer value = top layer
bool continuous; // continue to next frame of animation
uint8_t framePeriod; // how many updates each frame lasts
uint8_t currentframeLength;
bool mirrored;
};
#endif //METADATA