-
Notifications
You must be signed in to change notification settings - Fork 0
/
cutscenes.c
401 lines (378 loc) · 23.8 KB
/
cutscenes.c
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
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
#include <gb/gb.h>
#include "machine.c"
#include "hUGEDriver.h"
extern const hUGESong_t cutscenestheme;
extern UINT8 i, camtileidx, bossrushflg, animitr;
extern Machine * pl;
const UINT8 names[7][11] = {
{0x29, 0x1C, 0x21, 0x16, 0x18, 0x2E}, // Vince - 0xF7
{0x26, 0x16, 0x22, 0x25, 0x23, 0x2E}, // Scorp - 0xF8
{0x19, 0x18, 0x25, 0x1C, 0x28, 0x20, 0x2E}, // Ferium - 0xF9
{0x25, 0x14, 0x17, 0x1C, 0x28, 0x20, 0x2E}, // Radium - 0xFA
{0x1D, 0x28, 0x1A, 0x1A, 0x18, 0x25, 0x21, 0x14, 0x28, 0x27, 0x2E}, // Juggernaut - 0xFB
{0x28, 0x1F, 0x27, 0x1A, 0x18, 0x21, 0x2E}, // Ultgen - 0xFC
{0x14, 0x1C, 0x25, 0x15, 0x14, 0x26, 0x18, 0x00, 0x14, 0x1C, 0x2E} // Airbase AI - 0xFD
};
const UINT8 nameslengths[7] = {6, 6, 7, 7, 11, 7, 11};
const UINT8 playcutscthemeidxs[] = {0, 2, 4, 6, 8, 10, 12, 15, 16, 18};
const UINT8 playcutscthemeidxsnum = 10;
const UINT8 dialoguearr[] = {
// Boss 1 intro, idx: 0
0xF8, 0xFE,
0x26, 0x27, 0x22, 0x23, 0x00, 0x25, 0x1C, 0x1A, 0x1B, 0x27, 0x00, 0x27, 0x1B, 0x18, 0x25, 0x18, 0x30, 0xFE,
0x15, 0x2C, 0x00, 0x27, 0x1B, 0x18, 0x00, 0x22, 0x25, 0x17, 0x18, 0x25, 0x00, 0x22, 0x19, 0xFE,
0x28, 0x1F, 0x27, 0x1A, 0x18, 0x21, 0x32, 0x00, 0x26, 0x28, 0x25, 0x25, 0x18, 0x21, 0x17, 0x18, 0x25, 0x30, 0xFE,
0xF7, 0xFE,
0x14, 0x21, 0x17, 0x00, 0x2A, 0x1B, 0x14, 0x27, 0x31, 0xFE,
0x1D, 0x28, 0x26, 0x27, 0x00, 0x1A, 0x1C, 0x29, 0x18, 0x00, 0x2C, 0x22, 0x28, 0xFE,
0x22, 0x28, 0x25, 0x00, 0x15, 0x14, 0x26, 0x18, 0x31, 0x00, 0x21, 0x22, 0x27, 0xFE,
0x2A, 0x1C, 0x27, 0x1B, 0x22, 0x28, 0x27, 0x00, 0x14, 0x00, 0x19, 0x1C, 0x1A, 0x1B, 0x27, 0x30, 0xFE,
0xF8, 0xFE,
0x27, 0x1B, 0x18, 0x21, 0x00, 0x1C, 0x00, 0x2A, 0x1C, 0x1F, 0x1F, 0xFE,
0x17, 0x18, 0x26, 0x27, 0x25, 0x22, 0x2C, 0x00, 0x2C, 0x22, 0x28, 0x30, 0xFE, 0xFF,
// Boss 1 defeated, idx: 140
0xF8, 0xFE,
0x20, 0x2C, 0x00, 0x14, 0x25, 0x20, 0x22, 0x28, 0x25, 0x30, 0xFE,
0x23, 0x1C, 0x18, 0x25, 0x16, 0x18, 0x17, 0x31, 0xFE,
0x1C, 0x20, 0x23, 0x22, 0x26, 0x26, 0x1C, 0x15, 0x1F, 0x18, 0x30, 0xFE, 0xFF,
// Before boss 2, idx: 175
0xF9, 0xFE,
0x17, 0x1C, 0x17, 0x00, 0x2C, 0x22, 0x28, 0x00, 0x16, 0x22, 0x20, 0x18, 0x00, 0x1B, 0x18, 0x25, 0x18, 0xFE,
0x1D, 0x28, 0x26, 0x27, 0x00, 0x27, 0x22, 0x00, 0x15, 0x18, 0x16, 0x22, 0x20, 0x18, 0xFE,
0x22, 0x21, 0x18, 0x00, 0x22, 0x19, 0x00, 0x20, 0x2C, 0xFE,
0x1B, 0x22, 0x26, 0x27, 0x14, 0x1A, 0x18, 0x26, 0x31, 0xFE,
0xF7, 0xFE,
0x1C, 0x33, 0x20, 0x00, 0x1B, 0x18, 0x25, 0x18, 0x00, 0x27, 0x22, 0x00, 0x19, 0x25, 0x18, 0x18, 0xFE,
0x27, 0x1B, 0x1C, 0x26, 0x00, 0x16, 0x1C, 0x27, 0x2C, 0x00, 0x19, 0x25, 0x22, 0x20, 0x00, 0x2C, 0x22, 0x28, 0xFE,
0x14, 0x21, 0x17, 0x00, 0x2C, 0x22, 0x28, 0x25, 0x00, 0x23, 0x14, 0x2A, 0x21, 0x26, 0x2F, 0xFE,
0xF9, 0xFE,
0x1B, 0x22, 0x2A, 0x00, 0x14, 0x20, 0x28, 0x26, 0x1C, 0x21, 0x1A, 0x30, 0xFE,
0x1B, 0x22, 0x2A, 0x18, 0x29, 0x18, 0x25, 0x32, 0x00, 0x27, 0x1B, 0x1C, 0x26, 0x00, 0x1C, 0x26, 0xFE,
0x14, 0x26, 0x00, 0x19, 0x14, 0x25, 0x00, 0x14, 0x26, 0x00, 0x2C, 0x22, 0x28, 0x00, 0x2A, 0x1C, 0x1F, 0x1F, 0xFE,
0x1A, 0x22, 0x2F, 0x00, 0x27, 0x1B, 0x18, 0x00, 0x16, 0x1C, 0x27, 0x2C, 0x00, 0x2A, 0x1C, 0x1F, 0x1F, 0xFE,
0x25, 0x18, 0x20, 0x14, 0x1C, 0x21, 0x00, 0x28, 0x21, 0x17, 0x18, 0x25, 0x00, 0x22, 0x28, 0x25, 0xFE,
0x16, 0x22, 0x21, 0x27, 0x25, 0x22, 0x1F, 0x30, 0x00, 0x1F, 0x18, 0x27, 0x00, 0x20, 0x18, 0xFE,
0x26, 0x1B, 0x22, 0x2A, 0x00, 0x2C, 0x22, 0x28, 0x00, 0x1B, 0x22, 0x2A, 0x30, 0xFE, 0xFF,
// After boss 2, idx: 401
0xF9, 0xFE,
0x1B, 0x22, 0x2A, 0x00, 0x1C, 0x26, 0x00, 0x1B, 0x18, 0xFE,
0x27, 0x1B, 0x1C, 0x26, 0x00, 0x26, 0x27, 0x25, 0x22, 0x21, 0x1A, 0x31, 0xFE,
0x21, 0x22, 0x00, 0x20, 0x14, 0x27, 0x27, 0x18, 0x25, 0x30, 0xFE,
0x1B, 0x18, 0x00, 0x2A, 0x22, 0x21, 0x33, 0x27, 0x00, 0x26, 0x27, 0x14, 0x21, 0x17, 0xFE,
0x14, 0x00, 0x16, 0x1B, 0x14, 0x21, 0x16, 0x18, 0x00, 0x14, 0x1A, 0x14, 0x1C, 0x21, 0x26, 0x27, 0xFE,
0x15, 0x22, 0x27, 0x1B, 0x00, 0x22, 0x19, 0x00, 0x28, 0x26, 0x30, 0xFE, 0xFF,
// Before boss 3, idx: 482
0xFB, 0xFE,
0x27, 0x22, 0x00, 0x14, 0x29, 0x22, 0x1C, 0x17, 0x00, 0x26, 0x22, 0x00, 0x20, 0x14, 0x21, 0x2C, 0xFE,
0x22, 0x19, 0x00, 0x20, 0x2C, 0x00, 0x15, 0x22, 0x20, 0x15, 0x18, 0x25, 0x26, 0x32, 0xFE,
0x2C, 0x22, 0x28, 0x00, 0x25, 0x18, 0x14, 0x1F, 0x1F, 0x2C, 0x00, 0x14, 0x25, 0x18, 0xFE,
0x26, 0x1E, 0x1C, 0x1F, 0x1F, 0x18, 0x17, 0x2F, 0xFE,
0xF7, 0xFE,
0x1C, 0x00, 0x16, 0x22, 0x28, 0x1F, 0x17, 0x00, 0x22, 0x28, 0x27, 0x25, 0x28, 0x21, 0xFE,
0x2C, 0x22, 0x28, 0x00, 0x14, 0x26, 0x00, 0x2A, 0x18, 0x1F, 0x1F, 0x32, 0xFE,
0x15, 0x28, 0x27, 0x00, 0x1C, 0x33, 0x20, 0x00, 0x14, 0x19, 0x25, 0x14, 0x1C, 0x17, 0xFE,
0x1C, 0x00, 0x16, 0x14, 0x21, 0x33, 0x27, 0x00, 0x1F, 0x18, 0x27, 0x00, 0x2C, 0x22, 0x28, 0xFE,
0x20, 0x1C, 0x26, 0x28, 0x26, 0x18, 0x00, 0x26, 0x28, 0x16, 0x1B, 0x00, 0x1B, 0x28, 0x1A, 0x18, 0xFE,
0x19, 0x1C, 0x25, 0x18, 0x23, 0x22, 0x2A, 0x18, 0x25, 0x2F, 0xFE,
0xFB, 0xFE,
0x2C, 0x22, 0x28, 0x00, 0x14, 0x25, 0x18, 0x00, 0x1C, 0x21, 0x26, 0x14, 0x21, 0x18, 0xFE,
0x1C, 0x19, 0x00, 0x2C, 0x22, 0x28, 0x00, 0x27, 0x1B, 0x1C, 0x21, 0x1E, 0x00, 0x2C, 0x22, 0x28, 0xFE,
0x16, 0x14, 0x21, 0x00, 0x27, 0x14, 0x1E, 0x18, 0x00, 0x20, 0x18, 0x00, 0x17, 0x22, 0x2A, 0x21, 0x2F, 0xFE,
0x23, 0x25, 0x18, 0x23, 0x14, 0x25, 0x18, 0x00, 0x27, 0x22, 0x00, 0x15, 0x18, 0xFE,
0x16, 0x25, 0x28, 0x26, 0x1B, 0x18, 0x17, 0x30, 0xFE, 0xFF,
// After boss 3, idx: 705
0xFB, 0xFE,
0x18, 0x21, 0x18, 0x25, 0x1A, 0x2C, 0x00, 0x1F, 0x18, 0x29, 0x18, 0x1F, 0x26, 0x00, 0x14, 0x25, 0x18, 0xFE,
0x29, 0x18, 0x25, 0x2C, 0x00, 0x28, 0x21, 0x26, 0x27, 0x14, 0x15, 0x1F, 0x18, 0x30, 0xFE,
0x18, 0x1D, 0x18, 0x16, 0x27, 0x30, 0xFE, 0xFF,
// Before boss 4, idx: 748
0xFA, 0xFE,
0x27, 0x1B, 0x1C, 0x26, 0x00, 0x22, 0x21, 0x18, 0x00, 0x1A, 0x14, 0x29, 0x18, 0x00, 0x2C, 0x22, 0x28, 0xFE,
0x26, 0x22, 0x00, 0x20, 0x28, 0x16, 0x1B, 0x00, 0x27, 0x25, 0x22, 0x28, 0x15, 0x1F, 0x18, 0x31, 0xFE,
0x1B, 0x14, 0x1B, 0x14, 0x1B, 0x14, 0x30, 0xFE,
0xF9, 0xFE,
0x14, 0x25, 0x18, 0x00, 0x2C, 0x22, 0x28, 0x00, 0x17, 0x22, 0x21, 0x18, 0x31, 0x30, 0xFE,
0xFA, 0xFE,
0x2A, 0x18, 0x1F, 0x1F, 0x32, 0x00, 0x1B, 0x18, 0x00, 0x17, 0x1C, 0x17, 0x00, 0x20, 0x14, 0x1E, 0x18, 0xFE,
0x1C, 0x27, 0x00, 0x14, 0x1F, 0x1F, 0x00, 0x27, 0x1B, 0x18, 0x00, 0x2A, 0x14, 0x2C, 0xFE,
0x1B, 0x18, 0x25, 0x18, 0x2F, 0x00, 0x20, 0x14, 0x2C, 0x15, 0x18, 0x00, 0x27, 0x1B, 0x18, 0x25, 0x18, 0xFE,
0x1C, 0x26, 0x00, 0x20, 0x22, 0x25, 0x18, 0x00, 0x27, 0x22, 0x00, 0x1B, 0x1C, 0x20, 0xFE,
0x27, 0x1B, 0x14, 0x21, 0x00, 0x20, 0x18, 0x18, 0x27, 0x26, 0xFE,
0x27, 0x1B, 0x18, 0x00, 0x18, 0x2C, 0x18, 0x2F, 0xFE,
0xF9, 0xFE,
0x17, 0x22, 0x00, 0x21, 0x22, 0x27, 0x00, 0x27, 0x14, 0x1E, 0x18, 0x00, 0x1B, 0x1C, 0x20, 0xFE,
0x1F, 0x1C, 0x1A, 0x1B, 0x27, 0x1F, 0x2C, 0x30, 0x00, 0x1C, 0x00, 0x17, 0x22, 0x21, 0x33, 0x27, 0xFE,
0x18, 0x29, 0x18, 0x21, 0x00, 0x2A, 0x14, 0x21, 0x27, 0x00, 0x27, 0x22, 0x00, 0x27, 0x1B, 0x1C, 0x21, 0x1E, 0xFE,
0x14, 0x15, 0x22, 0x28, 0x27, 0x00, 0x25, 0x18, 0x23, 0x22, 0x25, 0x27, 0x1C, 0x21, 0x1A, 0xFE,
0x14, 0x21, 0x22, 0x27, 0x1B, 0x18, 0x25, 0x00, 0x19, 0x14, 0x1C, 0x1F, 0x28, 0x25, 0x18, 0xFE,
0x27, 0x22, 0x00, 0x27, 0x1B, 0x18, 0x00, 0x15, 0x22, 0x26, 0x26, 0x2F, 0xFE,
0xFA, 0xFE,
0x17, 0x22, 0x21, 0x33, 0x27, 0x00, 0x18, 0x29, 0x18, 0x21, 0x00, 0x26, 0x14, 0x2C, 0xFE,
0x27, 0x1B, 0x14, 0x27, 0x30, 0x00, 0x1C, 0x27, 0x00, 0x18, 0x21, 0x17, 0x26, 0xFE,
0x1B, 0x18, 0x25, 0x18, 0x30, 0x00, 0x1F, 0x18, 0x27, 0x33, 0x26, 0x00, 0x1A, 0x22, 0x30, 0xFE, 0xFF,
// Before boss 5, idx: 1045
0xFC, 0xFE,
0x26, 0x22, 0x00, 0x2C, 0x22, 0x28, 0x33, 0x25, 0x18, 0x00, 0x27, 0x1B, 0x18, 0x00, 0x22, 0x21, 0x18, 0xFE,
0x2A, 0x1B, 0x22, 0x00, 0x17, 0x18, 0x19, 0x18, 0x14, 0x27, 0x18, 0x17, 0x00, 0x27, 0x1B, 0x18, 0xFE,
0x20, 0x18, 0x16, 0x1B, 0x00, 0x15, 0x25, 0x22, 0x27, 0x1B, 0x18, 0x25, 0x26, 0x2F, 0xFE,
0x24, 0x28, 0x1C, 0x27, 0x18, 0x00, 0x14, 0x00, 0x19, 0x18, 0x14, 0x27, 0x30, 0xFE,
0x1D, 0x22, 0x1C, 0x21, 0x00, 0x20, 0x2C, 0x00, 0x19, 0x22, 0x25, 0x16, 0x18, 0x26, 0x00, 0x14, 0x21, 0x17, 0xFE,
0x1C, 0x00, 0x2A, 0x1C, 0x1F, 0x1F, 0x00, 0x19, 0x22, 0x25, 0x1A, 0x1C, 0x29, 0x18, 0xFE,
0x2C, 0x22, 0x28, 0x25, 0x00, 0x17, 0x18, 0x19, 0x1C, 0x14, 0x21, 0x16, 0x18, 0x30, 0xFE,
0xF7, 0xFE,
0x19, 0x22, 0x25, 0x1A, 0x1C, 0x29, 0x18, 0x31, 0x30, 0x00, 0x1C, 0x00, 0x17, 0x22, 0x00, 0x21, 0x22, 0x27, 0xFE,
0x14, 0x21, 0x26, 0x2A, 0x18, 0x25, 0x00, 0x27, 0x22, 0x00, 0x2C, 0x22, 0x28, 0x00, 0x14, 0x21, 0x17, 0xFE,
0x1B, 0x14, 0x29, 0x18, 0x00, 0x21, 0x22, 0x00, 0x17, 0x18, 0x26, 0x1C, 0x25, 0x18, 0x00, 0x27, 0x22, 0xFE,
0x1F, 0x1C, 0x29, 0x18, 0x00, 0x28, 0x21, 0x17, 0x18, 0x25, 0x00, 0x2C, 0x22, 0x28, 0x25, 0xFE,
0x1C, 0x25, 0x22, 0x21, 0x00, 0x19, 0x1C, 0x26, 0x27, 0x30, 0x00, 0x1C, 0x00, 0x2A, 0x14, 0x26, 0xFE,
0x26, 0x18, 0x21, 0x27, 0x00, 0x1B, 0x18, 0x25, 0x18, 0x00, 0x27, 0x22, 0xFE,
0x16, 0x14, 0x23, 0x27, 0x28, 0x25, 0x18, 0x00, 0x2C, 0x22, 0x28, 0x00, 0x14, 0x21, 0x17, 0xFE,
0x27, 0x1B, 0x14, 0x27, 0x00, 0x1C, 0x26, 0x00, 0x2A, 0x1B, 0x14, 0x27, 0x00, 0x1C, 0xFE,
0x2A, 0x1C, 0x1F, 0x1F, 0x00, 0x17, 0x22, 0x30, 0xFE,
0xFC, 0xFE,
0x16, 0x14, 0x23, 0x27, 0x28, 0x25, 0x18, 0x31, 0x30, 0x00, 0x20, 0x18, 0x31, 0x30, 0xFE,
0x1B, 0x22, 0x2A, 0x00, 0x17, 0x14, 0x25, 0x18, 0x00, 0x2C, 0x22, 0x28, 0x00, 0x26, 0x23, 0x18, 0x14, 0x1E, 0xFE,
0x27, 0x22, 0x00, 0x20, 0x18, 0x00, 0x1F, 0x1C, 0x1E, 0x18, 0x00, 0x27, 0x1B, 0x14, 0x27, 0x31, 0x30, 0xFE,
0x1E, 0x21, 0x22, 0x2A, 0x00, 0x2C, 0x22, 0x28, 0x25, 0x00, 0x23, 0x1F, 0x14, 0x16, 0x18, 0x32, 0xFE,
0x2A, 0x22, 0x25, 0x20, 0x30, 0xFE, 0xFF,
// Before boss 6, idx: 1381
0xF7, 0xFE,
0x27, 0x1B, 0x1C, 0x26, 0x00, 0x26, 0x1B, 0x22, 0x28, 0x1F, 0x17, 0x00, 0x15, 0x18, 0x00, 0x27, 0x1B, 0x18, 0xFE,
0x18, 0x21, 0x27, 0x18, 0x25, 0x14, 0x21, 0x16, 0x18, 0x00, 0x27, 0x22, 0x00, 0x27, 0x1B, 0x18, 0xFE,
0x23, 0x22, 0x2A, 0x18, 0x25, 0x00, 0x25, 0x22, 0x22, 0x20, 0x2F, 0xFE,
0xFD, 0xFE,
0x28, 0x21, 0x14, 0x28, 0x27, 0x1B, 0x22, 0x25, 0x1C, 0x2D, 0x18, 0x17, 0xFE,
0x14, 0x27, 0x27, 0x18, 0x20, 0x23, 0x27, 0x00, 0x27, 0x22, 0x00, 0x18, 0x21, 0x27, 0x18, 0x25, 0xFE,
0x25, 0x18, 0x26, 0x27, 0x25, 0x1C, 0x16, 0x27, 0x18, 0x17, 0x00, 0x14, 0x25, 0x18, 0x14, 0xFE,
0x17, 0x18, 0x27, 0x18, 0x16, 0x27, 0x18, 0x17, 0x2F, 0xFE,
0x27, 0x28, 0x25, 0x21, 0x00, 0x15, 0x14, 0x16, 0x1E, 0x00, 0x21, 0x22, 0x2A, 0xFE,
0x22, 0x25, 0x00, 0x15, 0x18, 0x00, 0x18, 0x1F, 0x1C, 0x20, 0x1C, 0x21, 0x14, 0x27, 0x18, 0x17, 0x2F, 0xFE,
0x22, 0x23, 0x18, 0x21, 0x1C, 0x21, 0x1A, 0x00, 0x19, 0x1C, 0x25, 0x18, 0x00, 0x1C, 0x21, 0xFE,
0x0D, 0x2F, 0x2F, 0x2F, 0xFE,
0x0C, 0x2F, 0x2F, 0x2F, 0xFE,
0x0B, 0x2F, 0x2F, 0x2F, 0xFE, 0xFF,
// Before boss 7 phase 1, idx: 1553
0xF7, 0xFE,
0x21, 0x22, 0x30, 0x00, 0x27, 0x1B, 0x18, 0x00, 0x16, 0x22, 0x21, 0x27, 0x25, 0x22, 0x1F, 0x26, 0xFE,
0x20, 0x28, 0x26, 0x27, 0x00, 0x15, 0x18, 0xFE,
0x26, 0x22, 0x20, 0x18, 0x2A, 0x1B, 0x18, 0x25, 0x18, 0x00, 0x18, 0x1F, 0x26, 0x18, 0x30, 0xFE,
0x1C, 0x00, 0x22, 0x21, 0x1F, 0x2C, 0x00, 0x1B, 0x14, 0x29, 0x18, 0xFE,
0x0F, 0x00, 0x20, 0x1C, 0x21, 0x28, 0x27, 0x18, 0x26, 0x00, 0x1F, 0x18, 0x19, 0x27, 0x30, 0xFE,
0x27, 0x1B, 0x18, 0x00, 0x22, 0x21, 0x1F, 0x2C, 0x00, 0x27, 0x1B, 0x1C, 0x21, 0x1A, 0xFE,
0x1C, 0x00, 0x16, 0x14, 0x21, 0x00, 0x17, 0x22, 0x00, 0x21, 0x22, 0x2A, 0x00, 0x1C, 0x26, 0x2F, 0x2F, 0x2F, 0xFE,
0xFD, 0xFE,
0x26, 0x18, 0x16, 0x28, 0x25, 0x1C, 0x27, 0x2C, 0x00, 0x15, 0x25, 0x18, 0x14, 0x16, 0x1B, 0xFE,
0x1F, 0x18, 0x29, 0x18, 0x1F, 0x00, 0x0B, 0x0A, 0x00, 0x17, 0x18, 0x27, 0x18, 0x16, 0x27, 0x18, 0x17, 0x30, 0xFE,
0x16, 0x22, 0x25, 0x18, 0x00, 0x17, 0x18, 0x19, 0x18, 0x21, 0x16, 0x18, 0xFE,
0x26, 0x2C, 0x26, 0x27, 0x18, 0x20, 0x26, 0x00, 0x18, 0x21, 0x1A, 0x14, 0x1A, 0x18, 0x17, 0x2F, 0xFE, 0xFF,
// After boss 4, Ferium defeated last, idx: 1726
0xF9, 0xFE,
0x17, 0x18, 0x19, 0x18, 0x14, 0x27, 0x18, 0x17, 0x00, 0x27, 0x2A, 0x1C, 0x16, 0x18, 0x30, 0xFE,
0x27, 0x1B, 0x18, 0x21, 0x00, 0x1C, 0x27, 0x33, 0x26, 0x00, 0x28, 0x23, 0x00, 0x27, 0x22, 0xFE,
0x27, 0x1B, 0x18, 0x00, 0x15, 0x22, 0x26, 0x26, 0x30, 0xFE, 0xFF,
// After boss 4, Radium defeated last, idx: 1771
0xFA, 0xFE,
0x1B, 0x18, 0x00, 0x15, 0x18, 0x26, 0x27, 0x18, 0x17, 0x00, 0x15, 0x22, 0x27, 0x1B, 0x00, 0x22, 0x19, 0xFE,
0x28, 0x26, 0x30, 0x00, 0x20, 0x14, 0x2C, 0x15, 0x18, 0x00, 0x1B, 0x18, 0x00, 0x16, 0x14, 0x21, 0xFE,
0x18, 0x21, 0x17, 0x00, 0x27, 0x1B, 0x1C, 0x26, 0x2F, 0xFE, 0xFF,
// After boss 5, part 1, idx: 1821
0xFC, 0xFE,
0x2C, 0x22, 0x28, 0x33, 0x25, 0x18, 0x00, 0x23, 0x18, 0x25, 0x26, 0x1C, 0x26, 0x27, 0x18, 0x21, 0x27, 0x30, 0xFE,
0x1C, 0x00, 0x2A, 0x14, 0x21, 0x27, 0x18, 0x17, 0x00, 0x27, 0x22, 0x00, 0x20, 0x14, 0x1E, 0x18, 0xFE,
0x14, 0x21, 0x00, 0x18, 0x2B, 0x14, 0x20, 0x23, 0x1F, 0x18, 0x00, 0x22, 0x28, 0x27, 0x00, 0x22, 0x19, 0xFE,
0x2C, 0x22, 0x28, 0x32, 0x00, 0x15, 0x28, 0x27, 0x00, 0x27, 0x1B, 0x1C, 0x26, 0x00, 0x1B, 0x14, 0x26, 0xFE,
0x1A, 0x22, 0x21, 0x18, 0x00, 0x27, 0x22, 0x22, 0x00, 0x19, 0x14, 0x25, 0x2F, 0xFE,
0x2C, 0x22, 0x28, 0x25, 0x00, 0x23, 0x25, 0x18, 0x16, 0x1C, 0x22, 0x28, 0x26, 0xFE,
0x16, 0x14, 0x23, 0x27, 0x1C, 0x29, 0x18, 0x00, 0x16, 0x1C, 0x27, 0x2C, 0xFE,
0x1C, 0x26, 0x00, 0x1B, 0x1C, 0x26, 0x27, 0x22, 0x25, 0x2C, 0x30, 0xFE,
0xF7, 0xFE,
0x2A, 0x1B, 0x14, 0x27, 0x31, 0x30, 0xFE,
0xFD, 0xFE,
0x19, 0x28, 0x1F, 0x1F, 0x00, 0x14, 0x21, 0x21, 0x1C, 0x1B, 0x1C, 0x1F, 0x14, 0x27, 0x22, 0x25, 0xFE,
0x16, 0x1B, 0x14, 0x25, 0x1A, 0x18, 0x00, 0x1C, 0x21, 0x1C, 0x27, 0x1C, 0x14, 0x27, 0x18, 0x17, 0x30, 0xFE,
0x18, 0x26, 0x27, 0x1C, 0x20, 0x14, 0x27, 0x18, 0x17, 0x00, 0x27, 0x1C, 0x20, 0x18, 0x2E, 0xFE,
0x0D, 0x0A, 0x00, 0x20, 0x1C, 0x21, 0x28, 0x27, 0x18, 0x26, 0x2F, 0xFE,
0xFC, 0xFE,
0x27, 0x1B, 0x14, 0x27, 0x00, 0x26, 0x1B, 0x22, 0x28, 0x1F, 0x17, 0x00, 0x1E, 0x18, 0x18, 0x23, 0xFE,
0x2C, 0x22, 0x28, 0x00, 0x15, 0x28, 0x26, 0x2C, 0x00, 0x19, 0x22, 0x25, 0xFE,
0x14, 0x00, 0x2A, 0x1B, 0x1C, 0x1F, 0x18, 0x30, 0x00, 0x1B, 0x14, 0x1B, 0x14, 0x1B, 0x14, 0x30, 0xFE,
0xF7, 0xFE,
0x21, 0x22, 0x32, 0x00, 0x1B, 0x22, 0x2A, 0x00, 0x20, 0x14, 0x17, 0x00, 0x14, 0x25, 0x18, 0xFE,
0x2C, 0x22, 0x28, 0x31, 0x30, 0x00, 0x2A, 0x1B, 0x14, 0x27, 0x00, 0x14, 0x15, 0x22, 0x28, 0x27, 0xFE,
0x14, 0x1F, 0x1F, 0x00, 0x27, 0x1B, 0x22, 0x26, 0x18, 0x00, 0x23, 0x18, 0x22, 0x23, 0x1F, 0x18, 0x31, 0xFE,
0xFC, 0xFE,
0x20, 0x14, 0x2C, 0x15, 0x18, 0x00, 0x21, 0x22, 0x2A, 0x00, 0x1B, 0x24, 0x00, 0x2A, 0x1C, 0x1F, 0x1F, 0xFE,
0x27, 0x14, 0x1E, 0x18, 0x00, 0x20, 0x2C, 0x00, 0x17, 0x18, 0x20, 0x14, 0x21, 0x17, 0x26, 0xFE,
0x14, 0x00, 0x1F, 0x1C, 0x27, 0x27, 0x1F, 0x18, 0x00, 0x20, 0x22, 0x25, 0x18, 0xFE,
0x26, 0x18, 0x25, 0x1C, 0x22, 0x28, 0x26, 0x1F, 0x2C, 0x30, 0xFE,
0x1C, 0x00, 0x2A, 0x1C, 0x1F, 0x1F, 0x00, 0x15, 0x18, 0x00, 0x15, 0x14, 0x16, 0x1E, 0x00, 0x27, 0x22, 0xFE,
0x19, 0x1C, 0x21, 0x1C, 0x26, 0x1B, 0x00, 0x2C, 0x22, 0x28, 0x00, 0x1F, 0x14, 0x27, 0x18, 0x25, 0x2F, 0xFE, 0xFF,
// After boss 5, part 2, idx: 2215
0xF7, 0xFE,
0x1A, 0x18, 0x27, 0x00, 0x15, 0x14, 0x16, 0x1E, 0x00, 0x1B, 0x18, 0x25, 0x18, 0x30, 0xFE,
0x1B, 0x22, 0x2A, 0x00, 0x16, 0x14, 0x21, 0x00, 0x1C, 0x00, 0x26, 0x27, 0x22, 0x23, 0xFE,
0x27, 0x1B, 0x1C, 0x26, 0x00, 0x1A, 0x28, 0x21, 0x31, 0x30, 0x00, 0x20, 0x14, 0x2C, 0x15, 0x18, 0xFE,
0x1C, 0x00, 0x16, 0x14, 0x21, 0x00, 0x27, 0x28, 0x25, 0x21, 0x00, 0x22, 0x19, 0x19, 0xFE,
0x27, 0x1B, 0x18, 0x00, 0x20, 0x14, 0x1C, 0x21, 0x00, 0x23, 0x22, 0x2A, 0x18, 0x25, 0xFE,
0x26, 0x22, 0x28, 0x25, 0x16, 0x18, 0x00, 0x1C, 0x19, 0x00, 0x1C, 0x00, 0x16, 0x14, 0x21, 0xFE,
0x19, 0x1C, 0x21, 0x17, 0x00, 0x1C, 0x27, 0x00, 0x24, 0x28, 0x1C, 0x16, 0x1E, 0x1F, 0x2C, 0xFE,
0x18, 0x21, 0x22, 0x28, 0x1A, 0x1B, 0x2F, 0xFE,
0x1C, 0x00, 0x1B, 0x14, 0x29, 0x18, 0x00, 0x21, 0x22, 0x00, 0x27, 0x1C, 0x20, 0x18, 0xFE,
0x27, 0x22, 0x00, 0x1F, 0x22, 0x26, 0x18, 0x30, 0xFE, 0xFF,
// After boss 6, idx: 2359
0xFD, 0xFE,
0x20, 0x14, 0x1C, 0x21, 0x00, 0x16, 0x22, 0x25, 0x18, 0x00, 0x1A, 0x14, 0x27, 0x18, 0xFE,
0x17, 0x18, 0x19, 0x18, 0x21, 0x16, 0x18, 0x00, 0x17, 0x18, 0x26, 0x27, 0x25, 0x22, 0x2C, 0x18, 0x17, 0x2F, 0xFE,
0x25, 0x18, 0x24, 0x28, 0x18, 0x26, 0x27, 0x1C, 0x21, 0x1A, 0xFE,
0x1C, 0x20, 0x20, 0x18, 0x17, 0x1C, 0x14, 0x27, 0x18, 0x00, 0x26, 0x18, 0x16, 0x28, 0x25, 0x1C, 0x27, 0x2C, 0xFE,
0x14, 0x26, 0x26, 0x1C, 0x26, 0x27, 0x14, 0x21, 0x16, 0x18, 0x2F, 0xFE,
0xF7, 0xFE,
0x27, 0x1C, 0x20, 0x18, 0x00, 0x27, 0x22, 0x00, 0x18, 0x21, 0x17, 0x00, 0x27, 0x1B, 0x1C, 0x26, 0xFE,
0x20, 0x14, 0x17, 0x21, 0x18, 0x26, 0x26, 0x30, 0xFE, 0xFF,
// Before boss 7 phase 2, idx: 2466
0xFC, 0xFE,
0x26, 0x22, 0x25, 0x25, 0x2C, 0x00, 0x27, 0x22, 0x00, 0x1E, 0x18, 0x18, 0x23, 0x00, 0x2C, 0x22, 0x28, 0xFE,
0x2A, 0x14, 0x1C, 0x27, 0x1C, 0x21, 0x1A, 0x30, 0xFE,
0x26, 0x18, 0x18, 0x00, 0x20, 0x2C, 0x00, 0x21, 0x18, 0x2A, 0x00, 0x27, 0x22, 0x2C, 0x31, 0xFE,
0x1C, 0x27, 0x00, 0x1C, 0x26, 0x00, 0x27, 0x1B, 0x18, 0x00, 0x20, 0x22, 0x26, 0x27, 0xFE,
0x23, 0x22, 0x2A, 0x18, 0x25, 0x19, 0x28, 0x1F, 0x00, 0x2A, 0x18, 0x14, 0x23, 0x22, 0x21, 0xFE,
0x1C, 0x21, 0x00, 0x27, 0x1B, 0x18, 0x00, 0x15, 0x14, 0x26, 0x18, 0x30, 0xFE,
0x1C, 0x27, 0x00, 0x16, 0x14, 0x21, 0x00, 0x28, 0x26, 0x18, 0x00, 0x21, 0x18, 0x14, 0x25, 0x15, 0x2C, 0xFE,
0x23, 0x22, 0x2A, 0x18, 0x25, 0x00, 0x26, 0x22, 0x28, 0x25, 0x16, 0x18, 0x26, 0x00, 0x27, 0x22, 0xFE,
0x25, 0x18, 0x16, 0x1B, 0x14, 0x25, 0x1A, 0x18, 0x00, 0x1C, 0x27, 0x26, 0xFE,
0x18, 0x21, 0x18, 0x25, 0x1A, 0x2C, 0x2F, 0xFE,
0x21, 0x18, 0x14, 0x25, 0x00, 0x27, 0x1B, 0x18, 0x00, 0x16, 0x22, 0x25, 0x18, 0xFE,
0x1C, 0x33, 0x20, 0x00, 0x23, 0x25, 0x14, 0x16, 0x27, 0x1C, 0x16, 0x14, 0x1F, 0x1F, 0x2C, 0xFE,
0x1C, 0x21, 0x29, 0x1C, 0x21, 0x16, 0x1C, 0x15, 0x1F, 0x18, 0x30, 0x00, 0x21, 0x22, 0x2A, 0x32, 0xFE,
0x23, 0x25, 0x18, 0x23, 0x14, 0x25, 0x18, 0x00, 0x27, 0x22, 0x00, 0x17, 0x1C, 0x18, 0x30, 0xFE,
0x1B, 0x14, 0x1B, 0x14, 0x1B, 0x14, 0x1B, 0x14, 0x1B, 0x14, 0x1B, 0x14, 0x30, 0xFE, 0xFF,
// After boss 7 phase 2, part 1, idx: 2690
0xFC, 0xFE,
0x21, 0x22, 0x30, 0x00, 0x27, 0x1B, 0x1C, 0x26, 0x00, 0x1C, 0x26, 0x00, 0x27, 0x22, 0x22, 0xFE,
0x20, 0x28, 0x16, 0x1B, 0x00, 0x18, 0x21, 0x18, 0x25, 0x1A, 0x2C, 0x30, 0xFE,
0x27, 0x1B, 0x18, 0x00, 0x20, 0x18, 0x16, 0x1B, 0x00, 0x16, 0x14, 0x21, 0x33, 0x27, 0xFE,
0x1B, 0x14, 0x21, 0x17, 0x1F, 0x18, 0x00, 0x1C, 0x27, 0x30, 0xFE,
0x2A, 0x1B, 0x14, 0x27, 0x00, 0x1B, 0x14, 0x29, 0x18, 0x00, 0x2C, 0x22, 0x28, 0xFE,
0x17, 0x22, 0x21, 0x18, 0x31, 0x30, 0xFE, 0xFF,
// After boss 7 phase 2, part 2, idx: 2769
0xFD, 0xFE,
0x16, 0x22, 0x25, 0x18, 0x00, 0x26, 0x27, 0x14, 0x15, 0x1C, 0x1F, 0x1C, 0x27, 0x2C, 0xFE,
0x16, 0x22, 0x20, 0x23, 0x25, 0x22, 0x20, 0x1C, 0x26, 0x18, 0x17, 0x2F, 0xFE,
0xFC, 0xFE,
0x21, 0x22, 0x30, 0x00, 0x20, 0x2C, 0x00, 0x23, 0x18, 0x25, 0x19, 0x18, 0x16, 0x27, 0xFE,
0x23, 0x1F, 0x14, 0x21, 0x30, 0x00, 0x25, 0x28, 0x1C, 0x21, 0x18, 0x17, 0x30, 0xFE,
0x14, 0x1F, 0x1F, 0x00, 0x15, 0x18, 0x16, 0x14, 0x28, 0x26, 0x18, 0x00, 0x22, 0x19, 0xFE,
0x2C, 0x22, 0x28, 0x30, 0xFE,
0xFD, 0xFE,
0x18, 0x26, 0x27, 0x1C, 0x20, 0x14, 0x27, 0x18, 0x17, 0xFE,
0x23, 0x25, 0x22, 0x15, 0x14, 0x15, 0x1C, 0x1F, 0x1C, 0x27, 0x2C, 0x00, 0x22, 0x19, 0x00, 0x14, 0xFE,
0x16, 0x1B, 0x14, 0x1C, 0x21, 0x00, 0x25, 0x18, 0x14, 0x16, 0x27, 0x1C, 0x22, 0x21, 0x2E, 0xFE,
0x0B, 0x0A, 0x0A, 0x00, 0x23, 0x18, 0x25, 0x16, 0x18, 0x21, 0x27, 0x2F, 0xFE,
0xFC, 0xFE,
0x17, 0x22, 0x00, 0x2C, 0x22, 0x28, 0x00, 0x1B, 0x18, 0x14, 0x25, 0x00, 0x27, 0x1B, 0x14, 0x27, 0x31, 0xFE,
0x27, 0x1B, 0x1C, 0x26, 0x00, 0x23, 0x1F, 0x14, 0x16, 0x18, 0x00, 0x2A, 0x1C, 0x1F, 0x1F, 0xFE,
0x15, 0x1F, 0x22, 0x2A, 0x00, 0x28, 0x23, 0x30, 0x00, 0x14, 0x27, 0x00, 0x1F, 0x18, 0x14, 0x26, 0x27, 0xFE,
0x2C, 0x22, 0x28, 0x33, 0x1F, 0x1F, 0x00, 0x23, 0x18, 0x25, 0x1C, 0x26, 0x1B, 0xFE,
0x2A, 0x1C, 0x27, 0x1B, 0x00, 0x20, 0x18, 0x30, 0x00, 0x1B, 0x14, 0x1B, 0x14, 0x1B, 0x14, 0x30, 0xFE, 0xFF,
// After boss 7 phase 2, part 3, idx: 2994
0xF7, 0xFE,
0x1C, 0x00, 0x1B, 0x14, 0x29, 0x18, 0x00, 0x27, 0x22, 0x00, 0x1A, 0x18, 0x27, 0x00, 0x22, 0x28, 0x27, 0x30, 0xFE,
0x20, 0x14, 0x2C, 0x15, 0x18, 0x00, 0x1C, 0x00, 0x16, 0x14, 0x21, 0x00, 0x26, 0x27, 0x1C, 0x1F, 0x1F, 0xFE,
0x18, 0x26, 0x16, 0x14, 0x23, 0x18, 0x2F, 0xFE, 0xFF
};
const UINT16 dialstartidx[] = {0, 140, 175, 401, 482, 705, 748, 99, 1045, 99, 1381, 99, 1553, 1726, 1771, 1819, 2220,
2364, 2471, 2694, 2773, 2998}; // 99 indicates cutscene skip
void custom_delay(UINT8 cycles) NONBANKED;
void incr_oam_sprite_tile_idx(INT8 steps) NONBANKED;
void reset_sprites(UINT8 fstsprite, UINT8 lastsprite) NONBANKED;
void anim_blackout() NONBANKED;
void anim_reverse_blackout() NONBANKED;
void place_machine(Machine * mch, UINT8 x, UINT8 y) NONBANKED;
void build_boss_road() NONBANKED;
void disable_bkg_scroll(UINT8 stageidx) NONBANKED;
inline UINT8 get_tile_idx(UINT8 newidxnum) NONBANKED;
void build_road() NONBANKED;
void move_machine(Machine * mch, INT8 speedx, INT8 speedy) NONBANKED;
void init_player() NONBANKED;
void toggle_mute_music(UINT8 toggleon) NONBANKED;
UINT8 wait_player_input(UINT8 crsridx) BANKED;
void scroll_textbox(UINT8 dialidx) BANKED;
UBYTE should_play_theme(UINT8 cutscidx) BANKED;
void se_advance_carriage() BANKED;
UINT8 wait_player_input(UINT8 crsridx) BANKED {
animitr = 0;
while(1) {
if(animitr % 32 == 0) {
set_win_tile_xy(crsridx, 0, 0);
} else if(animitr % 16 == 0) {
set_win_tile_xy(crsridx, 0, 255);
}
animitr++;
wait_vbl_done();
if(joypad() & J_A) {
waitpadup();
return J_A;
} else if(joypad() & J_START) {
waitpadup();
return J_START;
}
}
}
void scroll_textbox(UINT8 dialidx) BANKED {
if(dialstartidx[dialidx] == 99 || bossrushflg) {
return;
}
const UINT8 textoffsx = 1;
// Character limit per line - 18
fill_win_rect(0, 0, 20, 1, 0x00);
move_win(11, 134);
set_sprite_tile(39, 75);
set_win_tile_xy(0, 0, 255);
if(should_play_theme(dialidx)) {
hUGE_init(&cutscenestheme);
add_VBL(hUGE_dosound);
toggle_mute_music(0);
}
const UINT8 * textpos = dialoguearr + dialstartidx[dialidx];
for(i = 0; *textpos != 0xFF; textpos++, i++) { // Using 0xFF to indicate text end
if(*textpos == 0xFE) { // Using 0xFE to indicate end of line
fill_win_rect(i + 1, 0, 21 - i, 1, 0x00);
if(wait_player_input(i) == J_A) { // Print next line
i = 255; // Will be reset to 0 before next iteration
fill_win_rect(0, 0, 20, 1, 0x00);
continue;
} else { // Stop printing
break;
}
} else if(*textpos > 0xF6) { // Line with character name
fill_win_rect(0, 0, 20, 1, 0x00);
i = *textpos - 0xF7; // Character name array index
set_win_tiles(0, 0, nameslengths[i], 1, names[i]);
i = nameslengths[i] - 1; // Setting iterator for blinking animation
continue;
}
set_win_tile_xy(i, 0, *textpos);
set_win_tile_xy(i + 1, 0, 255);
se_advance_carriage();
custom_delay(3);
}
move_win(15, 134);
if(should_play_theme(dialidx)) {
toggle_mute_music(1);
remove_VBL(hUGE_dosound);
}
}
UBYTE should_play_theme(UINT8 cutscidx) BANKED {
for(i = 0; i < playcutscthemeidxsnum; i++) {
if(cutscidx == playcutscthemeidxs[i]) {
return 1;
}
}
return 0;
}
void se_advance_carriage() BANKED {
NR21_REG = 0x01;
NR22_REG = 0xF1;
NR23_REG = 0xA4;
NR24_REG = 0x86;
}