Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
battle_test.c
Go to the documentation of this file.
1#include "debug/battle_test.h"
2
3/* Sets up the display and the battle test's layers */
7
8/* Loads the battle test's images into VRAM */
10 TimLoader loader;
11
12 initTimLoader(&loader);
13 loader.setImagePos(0x200, 0);
15 loader.setImagePos(0, 0xF4);
17 loader.setImagePos(0x140, 0x100);
19 loader.setImagePos(0x1C0, 0x100);
21 loader.setImagePos(0x200, 0x100);
23 loader.setImagePos(0x240, 0x100);
25}
26
27/* Frees the files, loads the sound bank and plays the music, loads the
28 images, then creates the battle's tasks and the mode's pair of fighters */
29static inline void setUpBattle(BattleTest *task, BattleTestChildren *children) {
30 s32 arg;
31
32 switch (task->substate) {
33 case 0:
34 default:
37 task->nextSubstate(task);
38 /* fallthrough */
39 case 1:
40 switch (task->step) {
41 case 0:
42 default:
43 SOUND.loadBank(2);
44 task->nextStep(task);
45 /* fallthrough */
46 case 1:
47 if (SOUND.isLoading() == 0) {
50 task->nextSubstate(task);
51 }
52 break;
53 }
54 break;
55 case 2:
57 task->nextSubstate(task);
58 /* fallthrough */
59 case 3:
60 switch (task->step) {
61 case 0:
62 default:
66 children->models = FIGHTSTG_createModels();
68 task->nextStep(task);
69 break;
70 case 1:
71 arg = GAME.funcs.getModeArg();
72 children->models->add(children->models, 0, WFIGHTTS_fighters[arg][0], 1);
73 children->models->face(children->models, 0);
74 children->models->add(children->models, 0x10, WFIGHTTS_fighters[arg][1], 1);
75 children->models->face(children->models, 0x10);
76 children->camera->set(children->camera, children->camera->getEnemyView(children->camera));
78 task->page = 1;
79 task->nextState(task);
80 break;
81 }
82 break;
83 }
84}
85
86/* Page 0: CROSS goes back to the last list, and R1, R2 and L2 play an
87 entrance, a Digimon change and a camera turn when nothing plays */
88static inline void runPlayPage(BattleTest *task, BattleTestChildren *children) {
89 s32 pressed;
90
91 switch (task->step) {
92 case 0:
93 default:
95 task->nextStep(task);
96 /* fallthrough */
97 case 1:
98 pressed = PAD.getPressed(0);
99 if (pressed & (1 << PAD_CROSS)) {
101 task->setSubstate(task, task->page);
102 }
103 if ((pressed & (1 << PAD_R1)) && children->task.task == NULL) {
104 children->task.entrance = FIGHTSTG_startEntrance(0x94, 0, 0);
105 }
106 if ((pressed & (1 << PAD_R2)) && children->task.task == NULL) {
107 children->task.change = FIGHTSTG_startDigimonChange(0x3B, 0);
108 }
109 if ((pressed & (1 << PAD_L2)) && children->task.task == NULL) {
111 }
112 break;
113 }
114}
115
116/* Page 1: the fighter list; L1 and R1 go to the next and previous lists,
117 and a fighter picked replaces the one of its side */
118static inline void runFighterList(BattleTest *task, BattleTestChildren *children) {
119 switch (task->step) {
120 case 0:
121 default:
122 task->page = 1;
123 children->fighters = WFIGHTTS_createFighterList(&task->side, &task->fighter);
124 task->nextStep(task);
125 break;
126 case 1:
127 if (PAD.getPressed(0) & (1 << PAD_L1)) {
128 task->setSubstate(task, 2);
129 children->fighters->setState(children->fighters, 3);
130 } else if (PAD.getPressed(0) & (1 << PAD_R1)) {
131 task->setSubstate(task, 5);
132 children->fighters->setState(children->fighters, 3);
133 } else if (children->fighters == NULL) {
134 if (task->side != -1) {
135 if (task->side == 0) {
136 children->models->add(children->models, 0, task->fighter, 1);
137 children->models->face(children->models, 0);
138 } else {
139 children->models->add(children->models, 0x10, task->fighter, 1);
140 children->models->face(children->models, 0x10);
141 }
142 children->camera->set(children->camera, children->camera->getEnemyView(children->camera));
143 }
144 task->setSubstate(task, 0);
145 }
146 break;
147 }
148}
149
150/* Page 2: the camera list; L1 and R1 go to the next and previous lists,
151 and a camera picked of a side's fighter fades the view to it */
152static inline void runCameraList(BattleTest *task, BattleTestChildren *children) {
153 FighterInfo *partner;
154 FighterInfoEnemy *enemy;
155
156 switch (task->step) {
157 case 0:
158 default:
159 task->page = 2;
160 children->cameras = WFIGHTTS_createCameraList(&task->side, &task->camera);
161 task->nextStep(task);
162 break;
163 case 1:
164 if (PAD.getPressed(0) & (1 << PAD_L1)) {
165 children->cameras->setState(children->cameras, 3);
166 task->setSubstate(task, 3);
167 } else if (PAD.getPressed(0) & (1 << PAD_R1)) {
168 children->cameras->setState(children->cameras, 3);
169 task->setSubstate(task, 1);
170 } else if (children->cameras == NULL) {
171 if (task->side != -1) {
172 if (task->side == 0) {
173 partner = FIGHTSTG_fighterCache.funcs.getInfo(children->models->getFighter(children->models, 0));
174 WFIGHTTS_partnerView.vpx = partner->camPos[task->camera].x;
175 WFIGHTTS_partnerView.vpy = -partner->camPos[task->camera].y;
176 WFIGHTTS_partnerView.vpz = -partner->camPos[task->camera].z;
177 WFIGHTTS_partnerView.vrx = partner->camRef[task->camera].x;
178 WFIGHTTS_partnerView.vry = -partner->camRef[task->camera].y;
179 WFIGHTTS_partnerView.vrz = -partner->camRef[task->camera].z;
181 WFIGHTTS_partnerView.proj = partner->camProj[task->camera];
182 children->camera->fade(children->camera, 0, &WFIGHTTS_partnerView, 60);
183 } else {
184 /* an enemy's info, with its 3 cameras */
185 enemy = (FighterInfoEnemy *)FIGHTSTG_fighterCache.funcs.getInfo(children->models->getFighter(children->models, 0x10));
186 WFIGHTTS_enemyView.vpx = enemy->camPos[task->camera].x;
187 WFIGHTTS_enemyView.vpy = -enemy->camPos[task->camera].y;
188 WFIGHTTS_enemyView.vpz = -enemy->camPos[task->camera].z;
189 WFIGHTTS_enemyView.vrx = enemy->camRef[task->camera].x;
190 WFIGHTTS_enemyView.vry = -enemy->camRef[task->camera].y;
191 WFIGHTTS_enemyView.vrz = -enemy->camRef[task->camera].z;
193 WFIGHTTS_enemyView.proj = enemy->camProj[task->camera];
194 children->camera->fade(children->camera, 0, &WFIGHTTS_enemyView, 60);
195 }
196 }
197 task->setSubstate(task, 0);
198 }
199 break;
200 }
201}
202
203/* Page 3: the stage list; L1 and R1 go to the next and previous lists,
204 and a stage picked replaces the battle's */
205static inline void runStageList(BattleTest *task, BattleTestChildren *children) {
206 switch (task->step) {
207 case 0:
208 default:
209 task->page = 3;
210 children->stages = WFIGHTTS_createStageList(&task->stage);
211 task->nextStep(task);
212 break;
213 case 1:
214 if (PAD.getPressed(0) & (1 << PAD_L1)) {
215 children->stages->setState(children->stages, 3);
216 task->setSubstate(task, 4);
217 } else if (PAD.getPressed(0) & (1 << PAD_R1)) {
218 children->stages->setState(children->stages, 3);
219 task->setSubstate(task, 2);
220 } else if (children->stages == NULL) {
221 if (task->stage != -1) {
222 BATTLE_SETUP.stage = task->stage;
223 children->stage->setStage(children->stage, task->stage, 60, 60);
224 }
225 task->setSubstate(task, 0);
226 }
227 break;
228 }
229}
230
231/* Page 4: the motion list; L1 and R1 go to the next and previous lists,
232 and a motion picked is given to the fighter of its side */
233static inline void runMotionList(BattleTest *task, BattleTestChildren *children) {
234 switch (task->step) {
235 case 0:
236 default:
237 task->page = 4;
238 children->motions = WFIGHTTS_createMotionList(&task->side, &task->motion);
239 task->nextStep(task);
240 break;
241 case 1:
242 if (PAD.getPressed(0) & (1 << PAD_L1)) {
243 children->motions->setState(children->motions, 3);
244 task->setSubstate(task, 5);
245 } else if (PAD.getPressed(0) & (1 << PAD_R1)) {
246 children->motions->setState(children->motions, 3);
247 task->setSubstate(task, 3);
248 } else if (children->motions == NULL) {
249 /* the match depends on the call in each branch: one call after the
250 if loses a move of task into a0 */
251 if (task->side == -1) {
252 task->setSubstate(task, 0);
253 } else {
254 children->models->get(children->models, (task->side != 0) * 0x10)->motion = task->motion;
255 task->setSubstate(task, 0);
256 }
257 }
258 break;
259 }
260}
261
262/* Page 5 once its list is open: L1 and R1 go to the next and previous lists,
263 and an effect picked plays as a battle script of its side (0x12 as a hit
264 effect) */
265static inline void pickEffect(BattleTest *task, BattleTestChildren *children) {
266 if (PAD.getPressed(0) & (1 << PAD_L1)) {
267 children->effects->setState(children->effects, 3);
268 task->setSubstate(task, 1);
269 } else if (PAD.getPressed(0) & (1 << PAD_R1)) {
270 children->effects->setState(children->effects, 3);
271 task->setSubstate(task, 4);
272 } else if (children->effects == NULL) {
273 if (task->side == -1) {
274 task->setSubstate(task, 0);
275 } else {
276 if (task->effect != 0x12) {
278 children->task.script->index = task->effect;
279 children->task.script->enemy = task->side;
280 children->task.script->hits[0] = 3;
281 children->task.script->hits[1] = 3;
282 children->task.script->hits[2] = 3;
283 children->task.script->hits[3] = 2;
284 children->task.script->stage = -1;
285 children->task.script->sound = 0x39;
286 } else {
287 children->task.hitEffect = FIGHTSTG_startHitEffect(1, 0);
288 }
289 task->nextStep(task);
290 }
291 }
292}
293
294/* With R2 held, the pad moves the display and START puts it back; without,
295 sets the normal display mode */
296static inline void moveDisplay(void) {
297 if (PAD_HELD(PAD_R2)) {
298 if (PAD_HELD(PAD_LEFT)) {
299 WFIGHTTS_displayX -= 10;
300 } else if (PAD_HELD(PAD_RIGHT)) {
301 WFIGHTTS_displayX += 10;
302 } else if (PAD_HELD(PAD_UP)) {
303 WFIGHTTS_displayY -= 10;
304 } else if (PAD_HELD(PAD_DOWN)) {
305 WFIGHTTS_displayY += 10;
306 } else if (PAD_PRESSED(PAD_START)) {
309 }
311 } else {
313 }
314}
315
316/* The battle test: sets up the battle (setUpBattle), then runs its pages.
317 Page 0 (runPlayPage) plays things on CROSS (back to the last list), R1, R2
318 and L2; the lists pick the fighters, the camera, the stage, a motion and an
319 effect (runFighterList, runCameraList, runStageList, runMotionList,
320 pickEffect). SELECT cycles WFIGHTTS_speedMode and R2 with the pad moves the
321 display (moveDisplay) */
323 CameraView unused; /* unused, but it is in the original stack frame */
324 s32 list = 0;
325
326 switch (task->state) {
327 case 0:
328 default:
329 setUpBattle(task, children);
330 break;
331 case 1:
332 switch (task->substate) {
333 case 0:
334 default:
335 runPlayPage(task, children);
336 break;
337 case 1:
338 list = 1;
339 runFighterList(task, children);
340 break;
341 case 2:
342 list = 1;
343 runCameraList(task, children);
344 break;
345 case 3:
346 list = 1;
347 runStageList(task, children);
348 break;
349 case 4:
350 list = 1;
351 runMotionList(task, children);
352 break;
353 case 5:
354 list = 1;
355 switch (task->step) {
356 case 0:
357 default:
358 task->page = 5;
359 children->effects = WFIGHTTS_createEffectList(&task->side, &task->effect);
360 task->nextStep(task);
361 break;
362 case 1:
363 pickEffect(task, children);
364 break;
365 case 2:
366 list = 0;
367 if (children->task.task == NULL) {
368 task->setSubstate(task, 0);
369 }
370 break;
371 }
372 break;
373 }
374 if (list) {
376 }
377 if (PAD.getPressed(0) & (1 << PAD_SELECT)) {
378 if (++WFIGHTTS_speedMode == 4) {
380 }
382 }
383 moveDisplay();
384 break;
385 case 2:
386 case 3:
387 break;
388 }
389}
390
391/* WFIGHTTS's entry point: creates the battle test, though with 0 bytes for
392 its fields and for its children */
394 return createTaskWithId(WFIGHTTS_battleTest, 0, 0, 0);
395}
396
397/* The fighter list: the partners on the right and the enemies on the left,
398 fourteen shown at a time (RIGHT and LEFT pick the list, UP and DOWN the
399 fighter, ten at a time with SQUARE held), the cursor's one blinking; CROSS
400 sets the side and the fighter, TRIANGLE the side to -1. Match depends on
401 the loop around the pad handling, whose breaks leave it early, and on
402 each list having its own counter */
404 s32 pressed;
405 s32 steps;
406 s32 i;
407 s32 j;
408 s32 k;
409 s32 m;
410 s32 n;
411
412 switch (task->state) {
413 case 0:
414 default:
415 for (i = 0; i < 2; i++) {
416 for (j = 0; j < 14; j++) {
417 windows->windows[i][j] = createTextWindow(BATTLE_LAYER_MENUS, 1, 0xB4 - i * 0xA0, 0x28 + j * 12);
418 }
419 }
420 task->nextState(task);
421 break;
422 case 1:
423 while (1) {
424 pressed = PAD.getPressed(0) | PAD.getRepeated(0);
425 if (PAD.getHeld(0) & (1 << PAD_SQUARE)) {
426 steps = 10;
427 } else {
428 steps = 1;
429 }
430 if (pressed & (1 << PAD_RIGHT)) {
432 break;
433 }
434 if (pressed & (1 << PAD_LEFT)) {
436 break;
437 }
438 if (pressed & (1 << PAD_UP)) {
439 for (k = 0; k < steps; k++) {
444 }
445 }
446 break;
447 }
448 if (pressed & (1 << PAD_DOWN)) {
449 for (k = 0; k < steps; k++) {
452 } else if (WFIGHTTS_fighterScrolls[WFIGHTTS_fighterSide] != (WFIGHTTS_fighterSide != 0 ? 0xB3 : 0x29)) {
454 }
455 }
456 break;
457 }
458 if (pressed & (1 << PAD_CROSS)) {
459 *task->side = WFIGHTTS_fighterSide;
460 if (WFIGHTTS_fighterSide == 0) {
462 } else {
464 }
466 task->setState(task, 3);
467 }
468 if (pressed & (1 << PAD_TRIANGLE)) {
469 *task->side = -1;
470 task->setState(task, 3);
471 }
472 break;
473 }
474 for (m = 0; m < 14; m++) {
475 if (WFIGHTTS_fighterSide == 0 && WFIGHTTS_fighterCursors[0] == m && (GFX.funcs.getTime() & 8)) {
476 windows->windows[0][m]->setVisible(windows->windows[0][m], 0);
477 } else {
479 windows->windows[0][m]->setVisible(windows->windows[0][m], 1);
481 }
482 }
483 for (n = 0; n < 14; n++) {
484 /* the match depends on the blinking cursor's test split in two,
485 with the fighter's load written in both branches */
486 if (WFIGHTTS_fighterSide == 1 && WFIGHTTS_fighterCursors[1] == n) {
487 if (GFX.funcs.getTime() & 8) {
488 windows->windows[1][n]->setVisible(windows->windows[1][n], 0);
489 continue;
490 }
492 } else {
494 }
495 windows->windows[1][n]->setVisible(windows->windows[1][n], 1);
497 }
498 break;
499 case 2:
500 case 3:
501 break;
502 }
503}
504
505/* Starts the fighter list, which sets *SIDE and *PICK */
508
509 task->side = side;
510 task->pick = pick;
511 *pick = 0;
512 return task;
513}
514
515/* The camera list: the partner's 12 cameras on the right and the enemy's 3
516 on the left (RIGHT and LEFT pick the list, UP and DOWN the camera, ten at
517 a time with R1 held); CROSS sets the side to 0 or 1 and the camera,
518 TRIANGLE the side to -1. Match depends on the loop around the pad
519 handling, whose breaks leave it early */
521 s32 pressed;
522 s32 steps;
523 s32 i;
524 s32 j;
525 s32 k;
526
527 switch (task->state) {
528 case 0:
529 default:
530 for (i = 0; i < 12; i++) {
531 windows->partner[i] = createTextWindow(BATTLE_LAYER_MENUS, 1, 0xB4, 0x28 + i * 12);
532 }
533 for (i = 0; i < 3; i++) {
534 windows->enemy[i] = createTextWindow(BATTLE_LAYER_MENUS, 1, 0x14, 0x28 + i * 12);
535 }
536 task->nextState(task);
537 break;
538 case 1:
539 pressed = PAD.getPressed(0) | PAD.getRepeated(0);
540 if (PAD.getHeld(0) & (1 << PAD_R1)) {
541 steps = 10;
542 } else {
543 steps = 1;
544 }
545 while (1) {
546 if (pressed & (1 << PAD_RIGHT)) {
548 break;
549 }
550 if (pressed & (1 << PAD_LEFT)) {
552 break;
553 }
554 if (pressed & (1 << PAD_UP)) {
555 for (k = 0; k < steps; k++) {
558 }
559 }
560 break;
561 }
562 if (pressed & (1 << PAD_DOWN)) {
563 for (k = 0; k < steps; k++) {
566 }
567 }
568 break;
569 }
570 if (pressed & (1 << PAD_CROSS)) {
571 *task->side = WFIGHTTS_cameraSide;
573 task->setState(task, TASK_KILL);
574 }
575 if (pressed & (1 << PAD_TRIANGLE)) {
576 *task->side = -1;
577 task->setState(task, TASK_KILL);
578 }
579 break;
580 }
581 for (j = 0; j < 12; j++) {
582 if (WFIGHTTS_cameraSide == 0 && WFIGHTTS_cameraPicks[0] == j && (GFX.funcs.getTime() & 8)) {
583 windows->partner[j]->setVisible(windows->partner[j], 0);
584 } else {
585 windows->partner[j]->setVisible(windows->partner[j], 1);
586 windows->partner[j]->setText(windows->partner[j], WFIGHTTS_partnerCameraNames[j]);
587 }
588 }
589 for (j = 0; j < 3; j++) {
590 if (WFIGHTTS_cameraSide == 1 && WFIGHTTS_cameraPicks[1] == j && (GFX.funcs.getTime() & 8)) {
591 windows->enemy[j]->setVisible(windows->enemy[j], 0);
592 } else {
593 windows->enemy[j]->setVisible(windows->enemy[j], 1);
594 windows->enemy[j]->setText(windows->enemy[j], WFIGHTTS_enemyCameraNames[j]);
595 }
596 }
597 break;
598 case TASK_DONE:
599 case TASK_KILL:
600 break;
601 }
602}
603
604/* Starts the camera list, which sets *SIDE and *PICK */
607
608 task->side = side;
609 task->pick = pick;
610 *pick = 0;
611 return task;
612}
613
614/* The fight stage list: 14 of the 55 stages at a time (UP and DOWN, ten at a
615 time with SQUARE held); it sets *result to the stage, 1-55, or to -1 */
617 s32 pressed;
618 s32 steps;
619 s32 i;
620 s32 j;
621 s32 n;
622
623 switch (task->state) {
624 case 0:
625 default:
626 for (n = 0; n < 14; n++) {
627 windows[n] = createTextWindow(BATTLE_LAYER_MENUS, 1, 0xB4, 0x28 + n * 12);
628 }
629 task->nextState(task);
630 break;
631 case 1:
632 pressed = PAD.getPressed(0) | PAD.getRepeated(0);
633 if (PAD.getHeld(0) & (1 << PAD_SQUARE)) {
634 steps = 10;
635 } else {
636 steps = 1;
637 }
638 if (pressed & (1 << PAD_UP)) {
639 for (j = 0; j < steps; j++) {
640 if (WFIGHTTS_stageCursor != 0) {
642 } else if (WFIGHTTS_stageScroll != 0) {
644 }
645 }
646 } else if (pressed & (1 << PAD_DOWN)) {
647 for (j = 0; j < steps; j++) {
648 if (WFIGHTTS_stageCursor != 13) {
650 } else if (WFIGHTTS_stageScroll != 41) {
652 }
653 }
654 } else {
655 if (pressed & (1 << PAD_CROSS)) {
657 task->setState(task, TASK_KILL);
658 }
659 if (pressed & (1 << PAD_TRIANGLE)) {
660 *task->result = -1;
661 task->setState(task, TASK_KILL);
662 }
663 }
664 for (i = 0; i < 14; i++) {
665 if (WFIGHTTS_stageCursor == i && (GFX.funcs.getTime() & 8)) {
666 windows[i]->setVisible(windows[i], 0);
667 } else {
668 windows[i]->setVisible(windows[i], 1);
669 windows[i]->setText(windows[i], WFIGHTTS_stageNames[i + WFIGHTTS_stageScroll]);
670 }
671 }
672 break;
673 case TASK_DONE:
674 case TASK_KILL:
675 break;
676 }
677}
678
679/* Starts the stage list, which sets *RESULT */
682
683 task->result = result;
684 return task;
685}
686
687/* The motion list: the partner's motions on the right and the enemy's on the
688 left, fourteen shown at a time (RIGHT and LEFT pick the list, UP and DOWN
689 the motion, ten at a time with SQUARE held); CROSS sets the side and the
690 motion plus 1, TRIANGLE the side to -1. The cursors stay while the
691 fighters do. Match depends on the loop around the pad handling, whose
692 breaks leave it early */
694 Models *models;
696 s32 *motions;
697 s32 pressed;
698 s32 steps;
699 s32 fighter;
700 s32 n;
701 s32 i;
702 s32 side;
703 s32 j;
704 s32 k;
705 s32 m;
706
707 switch (task->state) {
708 case 0:
709 default:
710 models = TASK_REGISTRY.funcs.find(BATTLE_TASK_MODELS, -1, -1);
711 for (i = 0; i < 2; i++) {
712 list = &task->lists[i];
713 fighter = models->getFighter(models, i * 16);
714 if (WFIGHTTS_motionCursors.fighter[i] != fighter) {
715 WFIGHTTS_motionCursors.fighter[i] = fighter;
718 }
720 /* getEntry gives the entry's address as a number */
722 list->count = 0;
723 for (j = 0; j < 0x3E; j++) {
724 if (motions[j] != 0) {
725 list->motions[list->count] = j;
726 list->count++;
727 }
728 }
729 n = list->count;
730 if (n >= 15) {
731 n = 14;
732 }
733 list->shown = n;
734 for (j = 0; j < list->shown; j++) {
735 windows->windows[i][j] = createTextWindow(BATTLE_LAYER_MENUS, 1, 0xB4 - i * 0xA0, 0x28 + j * 12);
736 }
737 }
738 task->nextState(task);
739 break;
740 case 1:
741 pressed = PAD.getPressed(0) | PAD.getRepeated(0);
742 if (PAD.getHeld(0) & (1 << PAD_SQUARE)) {
743 steps = 10;
744 } else {
745 steps = 1;
746 }
747 while (1) {
748 if (pressed & (1 << PAD_RIGHT)) {
750 break;
751 }
752 if (pressed & (1 << PAD_LEFT)) {
754 break;
755 }
756 if (pressed & (1 << PAD_UP)) {
757 for (k = 0; k < steps; k++) {
762 }
763 }
764 break;
765 }
766 if (pressed & (1 << PAD_DOWN)) {
767 for (k = 0; k < steps; k++) {
772 }
773 }
774 break;
775 }
776 if (pressed & (1 << PAD_TRIANGLE)) {
777 *task->side = -1;
778 task->setState(task, TASK_KILL);
779 break;
780 }
781 if (pressed & (1 << PAD_CROSS)) {
784 task->setState(task, TASK_KILL);
785 }
786 break;
787 }
788 for (side = 0; side < 2; side++) {
789 for (m = 0; m < task->lists[side].shown; m++) {
790 if (WFIGHTTS_motionCursors.side == side && WFIGHTTS_motionCursors.cursor[side] == m && (GFX.funcs.getTime() & 8)) {
791 windows->windows[side][m]->setVisible(windows->windows[side][m], 0);
792 } else {
793 windows->windows[side][m]->setVisible(windows->windows[side][m], 1);
794 windows->windows[side][m]->setText(windows->windows[side][m], WFIGHTTS_motionNames[task->lists[side].motions[m + WFIGHTTS_motionCursors.scroll[side]]]);
795 }
796 }
797 }
798 break;
799 case TASK_DONE:
800 case TASK_KILL:
801 break;
802 }
803}
804
805/* Starts the motion list, which sets *SIDE and *MOTION */
808
809 task->side = side;
810 task->motion = motion;
811 return task;
812}
813
814/* Fills both sides' lists with the effects their fighter has (only "none"
815 without any) and creates their windows */
816static inline void fillEffectLists(BattleTestEffects *task, BattleTestWindows *windows) {
817 Models *models;
819 s32 *effects;
820 s32 fighter;
821 s32 n;
822 s32 i;
823 s32 j;
824
825 models = TASK_REGISTRY.funcs.find(BATTLE_TASK_MODELS, -1, -1);
826 for (i = 0; i < 2; i++) {
827 list = &task->lists[i];
828 fighter = models->getFighter(models, i * 16);
829 if (WFIGHTTS_effectCursors.fighter[i] != fighter) {
830 WFIGHTTS_effectCursors.fighter[i] = fighter;
833 }
836 /* getEntry gives the entry's address as a number */
838 if (effects[0] == 0) {
839 list->effects[0] = 0;
840 list->count = 1;
841 list->shown = 1;
842 } else {
843 list->count = 0;
844 for (j = 0; j < 0x13; j++) {
845 if (effects[j] != 0) {
846 list->effects[list->count] = j + 1;
847 list->count++;
848 }
849 }
850 }
851 n = list->count;
852 if (n >= 15) {
853 n = 14;
854 }
855 list->shown = n;
856 } else {
857 list->effects[0] = 0;
858 list->count = 1;
859 list->shown = 1;
860 }
861 for (j = 0; j < list->shown; j++) {
862 windows->windows[i][j] = createTextWindow(BATTLE_LAYER_MENUS, 1, 0xB4 - i * 0xA0, 0x28 + j * 12);
863 }
864 }
865}
866
867/* Draws both sides' effect names, the one under the cursor blinking */
868static inline void drawEffectNames(BattleTestEffects *task, BattleTestWindows *windows) {
869 s32 side;
870 s32 m;
871
872 for (side = 0; side < 2; side++) {
873 for (m = 0; m < task->lists[side].shown; m++) {
874 if (WFIGHTTS_effectCursors.side == side && WFIGHTTS_effectCursors.cursor[side] == m && (GFX.funcs.getTime() & 8)) {
875 windows->windows[side][m]->setVisible(windows->windows[side][m], 0);
876 } else {
877 windows->windows[side][m]->setVisible(windows->windows[side][m], 1);
878 windows->windows[side][m]->setText(windows->windows[side][m], WFIGHTTS_effectNames[task->lists[side].effects[m + WFIGHTTS_effectCursors.scroll[side]]]);
879 }
880 }
881 }
882}
883
884/* The effect list, like the motion list: fills its lists (fillEffectLists),
885 then CROSS sets the side and the effect, on any but a fighter's "none",
886 while the names are drawn (drawEffectNames). Match depends on the loop
887 around the pad handling, whose breaks leave it early */
889 s32 pressed;
890 s32 steps;
891 s32 k;
892
893 switch (task->state) {
894 case 0:
895 default:
896 fillEffectLists(task, windows);
897 task->nextState(task);
898 break;
899 case 1:
900 pressed = PAD.getPressed(0) | PAD.getRepeated(0);
901 if (PAD.getHeld(0) & (1 << PAD_SQUARE)) {
902 steps = 10;
903 } else {
904 steps = 1;
905 }
906 while (1) {
907 if (pressed & (1 << PAD_RIGHT)) {
909 break;
910 }
911 if (pressed & (1 << PAD_LEFT)) {
913 break;
914 }
915 if (pressed & (1 << PAD_UP)) {
916 for (k = 0; k < steps; k++) {
921 }
922 }
923 break;
924 }
925 if (pressed & (1 << PAD_DOWN)) {
926 for (k = 0; k < steps; k++) {
931 }
932 }
933 break;
934 }
935 if (pressed & (1 << PAD_TRIANGLE)) {
936 *task->side = -1;
937 task->setState(task, TASK_KILL);
938 break;
939 }
940 if (pressed & (1 << PAD_CROSS)) {
944 task->setState(task, TASK_KILL);
945 }
946 }
947 break;
948 }
949 drawEffectNames(task, windows);
950 break;
951 case TASK_DONE:
952 case TASK_KILL:
953 break;
954 }
955}
956
957/* Starts the effect list, which sets *SIDE and *EFFECT */
960
961 task->side = side;
962 task->effect = effect;
963 return task;
964}
965
966/* The strings of the tables below, as GCC emitted them: each table's last
967 to first, and each padded to a word. The padding after a table's last
968 string isn't zeros but what the assembler left there, which differs
969 between the versions; the size leaves out the closing NUL */
970const char WFIGHTTS_strings[0x9C0] =
971 /* 0x000 デッド */
972 "\x83\x66\x83\x62\x83\x68\0\0"
973 /* 0x008 かいふく */
974 "\x82\xA9\x82\xA2\x82\xD3\x82\xAD\0\0\0\0"
975 /* 0x014 キメポーズ */
976 "\x83\x4C\x83\x81\x83\x7C\x81\x5B\x83\x59\0\0"
977 /* 0x020 ダメージ */
978 "\x83\x5F\x83\x81\x81\x5B\x83\x57\0\0\0\0"
979 /* 0x02C Sフェイスアップ */
980 "\x82\x72\x83\x74\x83\x46\x83\x43\x83\x58\x83\x41\x83\x62\x83\x76\0\0\0\0"
981 /* 0x040 フェイスアップ */
982 "\x83\x74\x83\x46\x83\x43\x83\x58\x83\x41\x83\x62\x83\x76\0\0"
983 /* 0x050 たたかう−6 */
984 "\x82\xBD\x82\xBD\x82\xA9\x82\xA4\x81\x7C\x82\x55\0\0\0\0"
985 /* 0x060 たたかう−5 */
986 "\x82\xBD\x82\xBD\x82\xA9\x82\xA4\x81\x7C\x82\x54\0\0\0\0"
987 /* 0x070 たたかう−4 */
988 "\x82\xBD\x82\xBD\x82\xA9\x82\xA4\x81\x7C\x82\x53\0\0\0\0"
989 /* 0x080 たたかう−3 */
990 "\x82\xBD\x82\xBD\x82\xA9\x82\xA4\x81\x7C\x82\x52\0\0\0\0"
991 /* 0x090 たたかう−2 */
992 "\x82\xBD\x82\xBD\x82\xA9\x82\xA4\x81\x7C\x82\x51\0\0\0\0"
993 /* 0x0A0 たたかう−1 */
994 "\x82\xBD\x82\xBD\x82\xA9\x82\xA4\x81\x7C\x82\x50"
995#if VERSION_US
996 "\0\0\x62\xAC"
997#elif VERSION_EU
998 "\0\0\x62\x10"
999#elif VERSION_JP
1000 "\0\x40\x08\x80"
1001#endif
1002 /* 0x0B0 MEFT0055 */
1003 "\x82\x6C\x82\x64\x82\x65\x82\x73\x82\x4F\x82\x4F\x82\x54\x82\x54\0\0\0\0"
1004 /* 0x0C4 MEFT0054 */
1005 "\x82\x6C\x82\x64\x82\x65\x82\x73\x82\x4F\x82\x4F\x82\x54\x82\x53\0\0\0\0"
1006 /* 0x0D8 MEFT0053 */
1007 "\x82\x6C\x82\x64\x82\x65\x82\x73\x82\x4F\x82\x4F\x82\x54\x82\x52\0\0\0\0"
1008 /* 0x0EC MEFT0052 */
1009 "\x82\x6C\x82\x64\x82\x65\x82\x73\x82\x4F\x82\x4F\x82\x54\x82\x51\0\0\0\0"
1010 /* 0x100 MEFT0051 */
1011 "\x82\x6C\x82\x64\x82\x65\x82\x73\x82\x4F\x82\x4F\x82\x54\x82\x50\0\0\0\0"
1012 /* 0x114 MEFT0050 */
1013 "\x82\x6C\x82\x64\x82\x65\x82\x73\x82\x4F\x82\x4F\x82\x54\x82\x4F\0\0\0\0"
1014 /* 0x128 MEFT0049 */
1015 "\x82\x6C\x82\x64\x82\x65\x82\x73\x82\x4F\x82\x4F\x82\x53\x82\x58\0\0\0\0"
1016 /* 0x13C MEFT0048 */
1017 "\x82\x6C\x82\x64\x82\x65\x82\x73\x82\x4F\x82\x4F\x82\x53\x82\x57\0\0\0\0"
1018 /* 0x150 MEFT0047 */
1019 "\x82\x6C\x82\x64\x82\x65\x82\x73\x82\x4F\x82\x4F\x82\x53\x82\x56\0\0\0\0"
1020 /* 0x164 MEFT0046 */
1021 "\x82\x6C\x82\x64\x82\x65\x82\x73\x82\x4F\x82\x4F\x82\x53\x82\x55\0\0\0\0"
1022 /* 0x178 MEFT0045 */
1023 "\x82\x6C\x82\x64\x82\x65\x82\x73\x82\x4F\x82\x4F\x82\x53\x82\x54\0\0\0\0"
1024 /* 0x18C MEFT0044 */
1025 "\x82\x6C\x82\x64\x82\x65\x82\x73\x82\x4F\x82\x4F\x82\x53\x82\x53\0\0\0\0"
1026 /* 0x1A0 MEFT0043 */
1027 "\x82\x6C\x82\x64\x82\x65\x82\x73\x82\x4F\x82\x4F\x82\x53\x82\x52\0\0\0\0"
1028 /* 0x1B4 MEFT0042 */
1029 "\x82\x6C\x82\x64\x82\x65\x82\x73\x82\x4F\x82\x4F\x82\x53\x82\x51\0\0\0\0"
1030 /* 0x1C8 MEFT0041 */
1031 "\x82\x6C\x82\x64\x82\x65\x82\x73\x82\x4F\x82\x4F\x82\x53\x82\x50\0\0\0\0"
1032 /* 0x1DC MEFT0040 */
1033 "\x82\x6C\x82\x64\x82\x65\x82\x73\x82\x4F\x82\x4F\x82\x53\x82\x4F\0\0\0\0"
1034 /* 0x1F0 MEFT0039 */
1035 "\x82\x6C\x82\x64\x82\x65\x82\x73\x82\x4F\x82\x4F\x82\x52\x82\x58\0\0\0\0"
1036 /* 0x204 MEFT0038 */
1037 "\x82\x6C\x82\x64\x82\x65\x82\x73\x82\x4F\x82\x4F\x82\x52\x82\x57\0\0\0\0"
1038 /* 0x218 MEFT0037 */
1039 "\x82\x6C\x82\x64\x82\x65\x82\x73\x82\x4F\x82\x4F\x82\x52\x82\x56\0\0\0\0"
1040 /* 0x22C MEFT0036 */
1041 "\x82\x6C\x82\x64\x82\x65\x82\x73\x82\x4F\x82\x4F\x82\x52\x82\x55\0\0\0\0"
1042 /* 0x240 MEFT0035 */
1043 "\x82\x6C\x82\x64\x82\x65\x82\x73\x82\x4F\x82\x4F\x82\x52\x82\x54\0\0\0\0"
1044 /* 0x254 MEFT0034 */
1045 "\x82\x6C\x82\x64\x82\x65\x82\x73\x82\x4F\x82\x4F\x82\x52\x82\x53\0\0\0\0"
1046 /* 0x268 MEFT0033 */
1047 "\x82\x6C\x82\x64\x82\x65\x82\x73\x82\x4F\x82\x4F\x82\x52\x82\x52\0\0\0\0"
1048 /* 0x27C MEFT0032 */
1049 "\x82\x6C\x82\x64\x82\x65\x82\x73\x82\x4F\x82\x4F\x82\x52\x82\x51\0\0\0\0"
1050 /* 0x290 MEFT0031 */
1051 "\x82\x6C\x82\x64\x82\x65\x82\x73\x82\x4F\x82\x4F\x82\x52\x82\x50\0\0\0\0"
1052 /* 0x2A4 MEFT0030 */
1053 "\x82\x6C\x82\x64\x82\x65\x82\x73\x82\x4F\x82\x4F\x82\x52\x82\x4F\0\0\0\0"
1054 /* 0x2B8 MFSTG029 */
1055 "\x82\x6C\x82\x65\x82\x72\x82\x73\x82\x66\x82\x4F\x82\x51\x82\x58\0\0\0\0"
1056 /* 0x2CC MFSTG028 */
1057 "\x82\x6C\x82\x65\x82\x72\x82\x73\x82\x66\x82\x4F\x82\x51\x82\x57\0\0\0\0"
1058 /* 0x2E0 MFSTG027 */
1059 "\x82\x6C\x82\x65\x82\x72\x82\x73\x82\x66\x82\x4F\x82\x51\x82\x56\0\0\0\0"
1060 /* 0x2F4 MFSTG026 */
1061 "\x82\x6C\x82\x65\x82\x72\x82\x73\x82\x66\x82\x4F\x82\x51\x82\x55\0\0\0\0"
1062 /* 0x308 MFSTG025 */
1063 "\x82\x6C\x82\x65\x82\x72\x82\x73\x82\x66\x82\x4F\x82\x51\x82\x54\0\0\0\0"
1064 /* 0x31C MFSTG024 */
1065 "\x82\x6C\x82\x65\x82\x72\x82\x73\x82\x66\x82\x4F\x82\x51\x82\x53\0\0\0\0"
1066 /* 0x330 MFSTG023 */
1067 "\x82\x6C\x82\x65\x82\x72\x82\x73\x82\x66\x82\x4F\x82\x51\x82\x52\0\0\0\0"
1068 /* 0x344 MFSTG022 */
1069 "\x82\x6C\x82\x65\x82\x72\x82\x73\x82\x66\x82\x4F\x82\x51\x82\x51\0\0\0\0"
1070 /* 0x358 MFSTG021 */
1071 "\x82\x6C\x82\x65\x82\x72\x82\x73\x82\x66\x82\x4F\x82\x51\x82\x50\0\0\0\0"
1072 /* 0x36C MFSTG020 */
1073 "\x82\x6C\x82\x65\x82\x72\x82\x73\x82\x66\x82\x4F\x82\x51\x82\x4F\0\0\0\0"
1074 /* 0x380 MFSTG019 */
1075 "\x82\x6C\x82\x65\x82\x72\x82\x73\x82\x66\x82\x4F\x82\x50\x82\x58\0\0\0\0"
1076 /* 0x394 MFSTG018 */
1077 "\x82\x6C\x82\x65\x82\x72\x82\x73\x82\x66\x82\x4F\x82\x50\x82\x57\0\0\0\0"
1078 /* 0x3A8 MFSTG017 */
1079 "\x82\x6C\x82\x65\x82\x72\x82\x73\x82\x66\x82\x4F\x82\x50\x82\x56\0\0\0\0"
1080 /* 0x3BC MFSTG016 */
1081 "\x82\x6C\x82\x65\x82\x72\x82\x73\x82\x66\x82\x4F\x82\x50\x82\x55\0\0\0\0"
1082 /* 0x3D0 MFSTG015 */
1083 "\x82\x6C\x82\x65\x82\x72\x82\x73\x82\x66\x82\x4F\x82\x50\x82\x54\0\0\0\0"
1084 /* 0x3E4 MFSTG014 */
1085 "\x82\x6C\x82\x65\x82\x72\x82\x73\x82\x66\x82\x4F\x82\x50\x82\x53\0\0\0\0"
1086 /* 0x3F8 MFSTG013 */
1087 "\x82\x6C\x82\x65\x82\x72\x82\x73\x82\x66\x82\x4F\x82\x50\x82\x52\0\0\0\0"
1088 /* 0x40C MFSTG012 */
1089 "\x82\x6C\x82\x65\x82\x72\x82\x73\x82\x66\x82\x4F\x82\x50\x82\x51\0\0\0\0"
1090 /* 0x420 MFSTG011 */
1091 "\x82\x6C\x82\x65\x82\x72\x82\x73\x82\x66\x82\x4F\x82\x50\x82\x50\0\0\0\0"
1092 /* 0x434 MFSTG010 */
1093 "\x82\x6C\x82\x65\x82\x72\x82\x73\x82\x66\x82\x4F\x82\x50\x82\x4F\0\0\0\0"
1094 /* 0x448 MFSTG009 */
1095 "\x82\x6C\x82\x65\x82\x72\x82\x73\x82\x66\x82\x4F\x82\x4F\x82\x58\0\0\0\0"
1096 /* 0x45C MFSTG008 */
1097 "\x82\x6C\x82\x65\x82\x72\x82\x73\x82\x66\x82\x4F\x82\x4F\x82\x57\0\0\0\0"
1098 /* 0x470 MFSTG007 */
1099 "\x82\x6C\x82\x65\x82\x72\x82\x73\x82\x66\x82\x4F\x82\x4F\x82\x56\0\0\0\0"
1100 /* 0x484 MFSTG006 */
1101 "\x82\x6C\x82\x65\x82\x72\x82\x73\x82\x66\x82\x4F\x82\x4F\x82\x55\0\0\0\0"
1102 /* 0x498 MFSTG005 */
1103 "\x82\x6C\x82\x65\x82\x72\x82\x73\x82\x66\x82\x4F\x82\x4F\x82\x54\0\0\0\0"
1104 /* 0x4AC MFSTG004 */
1105 "\x82\x6C\x82\x65\x82\x72\x82\x73\x82\x66\x82\x4F\x82\x4F\x82\x53\0\0\0\0"
1106 /* 0x4C0 MFSTG003 */
1107 "\x82\x6C\x82\x65\x82\x72\x82\x73\x82\x66\x82\x4F\x82\x4F\x82\x52\0\0\0\0"
1108 /* 0x4D4 MFSTG002 */
1109 "\x82\x6C\x82\x65\x82\x72\x82\x73\x82\x66\x82\x4F\x82\x4F\x82\x51\0\0\0\0"
1110 /* 0x4E8 MFSTG001 */
1111 "\x82\x6C\x82\x65\x82\x72\x82\x73\x82\x66\x82\x4F\x82\x4F\x82\x50"
1112#if VERSION_US
1113 "\0\xFF\0\0"
1114#elif VERSION_EU
1115 "\0\xF8\x40\0"
1116#elif VERSION_JP
1117 "\0\xD9\x08\x80"
1118#endif
1119 /* 0x4FC ジョグレス−5 */
1120 "\x83\x57\x83\x87\x83\x4F\x83\x8C\x83\x58\x81\x7C\x82\x54\0\0"
1121 /* 0x50C ジョグレス−4 */
1122 "\x83\x57\x83\x87\x83\x4F\x83\x8C\x83\x58\x81\x7C\x82\x53\0\0"
1123 /* 0x51C ジョグレス−3 */
1124 "\x83\x57\x83\x87\x83\x4F\x83\x8C\x83\x58\x81\x7C\x82\x52\0\0"
1125 /* 0x52C ジョグレス−2 */
1126 "\x83\x57\x83\x87\x83\x4F\x83\x8C\x83\x58\x81\x7C\x82\x51\0\0"
1127 /* 0x53C ジョグレス−1 */
1128 "\x83\x57\x83\x87\x83\x4F\x83\x8C\x83\x58\x81\x7C\x82\x50\0\0"
1129 /* 0x54C ジョグレス−0 */
1130 "\x83\x57\x83\x87\x83\x4F\x83\x8C\x83\x58\x81\x7C\x82\x4F\0\0"
1131 /* 0x55C ヒッサツ−5 */
1132 "\x83\x71\x83\x62\x83\x54\x83\x63\x81\x7C\x82\x54\0\0\0\0"
1133 /* 0x56C ヒッサツ−4 */
1134 "\x83\x71\x83\x62\x83\x54\x83\x63\x81\x7C\x82\x53\0\0\0\0"
1135 /* 0x57C ヒッサツ−3 */
1136 "\x83\x71\x83\x62\x83\x54\x83\x63\x81\x7C\x82\x52\0\0\0\0"
1137 /* 0x58C ヒッサツ−2 */
1138 "\x83\x71\x83\x62\x83\x54\x83\x63\x81\x7C\x82\x51\0\0\0\0"
1139 /* 0x59C ヒッサツ−1 */
1140 "\x83\x71\x83\x62\x83\x54\x83\x63\x81\x7C\x82\x50\0\0\0\0"
1141 /* 0x5AC ヒッサツ−0 */
1142 "\x83\x71\x83\x62\x83\x54\x83\x63\x81\x7C\x82\x4F\0\0\0\0"
1143 /* 0x5BC ワ:マ:カ−5 */
1144 "\x83\x8F\x81\x46\x83\x7D\x81\x46\x83\x4A\x81\x7C\x82\x54\0\0"
1145 /* 0x5CC ワ:マ:カ−4 */
1146 "\x83\x8F\x81\x46\x83\x7D\x81\x46\x83\x4A\x81\x7C\x82\x53\0\0"
1147 /* 0x5DC ワ:マ:カ−3 */
1148 "\x83\x8F\x81\x46\x83\x7D\x81\x46\x83\x4A\x81\x7C\x82\x52\0\0"
1149 /* 0x5EC ワ:マ:カ−2 */
1150 "\x83\x8F\x81\x46\x83\x7D\x81\x46\x83\x4A\x81\x7C\x82\x51\0\0"
1151 /* 0x5FC ワ:マ:カ−1 */
1152 "\x83\x8F\x81\x46\x83\x7D\x81\x46\x83\x4A\x81\x7C\x82\x50\0\0"
1153 /* 0x60C ワ:マ:カ−0 */
1154 "\x83\x8F\x81\x46\x83\x7D\x81\x46\x83\x4A\x81\x7C\x82\x4F\0\0"
1155 /* 0x61C ワ:マ:ウ−5 */
1156 "\x83\x8F\x81\x46\x83\x7D\x81\x46\x83\x45\x81\x7C\x82\x54\0\0"
1157 /* 0x62C ワ:マ:ウ−4 */
1158 "\x83\x8F\x81\x46\x83\x7D\x81\x46\x83\x45\x81\x7C\x82\x53\0\0"
1159 /* 0x63C ワ:マ:ウ−3 */
1160 "\x83\x8F\x81\x46\x83\x7D\x81\x46\x83\x45\x81\x7C\x82\x52\0\0"
1161 /* 0x64C ワ:マ:ウ−2 */
1162 "\x83\x8F\x81\x46\x83\x7D\x81\x46\x83\x45\x81\x7C\x82\x51\0\0"
1163 /* 0x65C ワ:マ:ウ−1 */
1164 "\x83\x8F\x81\x46\x83\x7D\x81\x46\x83\x45\x81\x7C\x82\x50\0\0"
1165 /* 0x66C ワ:マ:ウ−0 */
1166 "\x83\x8F\x81\x46\x83\x7D\x81\x46\x83\x45\x81\x7C\x82\x4F\0\0"
1167 /* 0x67C ワ:ブ:3−5 */
1168 "\x83\x8F\x81\x46\x83\x75\x81\x46\x82\x52\x81\x7C\x82\x54\0\0"
1169 /* 0x68C ワ:ブ:3−4 */
1170 "\x83\x8F\x81\x46\x83\x75\x81\x46\x82\x52\x81\x7C\x82\x53\0\0"
1171 /* 0x69C ワ:ブ:3−3 */
1172 "\x83\x8F\x81\x46\x83\x75\x81\x46\x82\x52\x81\x7C\x82\x52\0\0"
1173 /* 0x6AC ワ:ブ:3−2 */
1174 "\x83\x8F\x81\x46\x83\x75\x81\x46\x82\x52\x81\x7C\x82\x51\0\0"
1175 /* 0x6BC ワ:ブ:3−1 */
1176 "\x83\x8F\x81\x46\x83\x75\x81\x46\x82\x52\x81\x7C\x82\x50\0\0"
1177 /* 0x6CC ワ:ブ:3−0 */
1178 "\x83\x8F\x81\x46\x83\x75\x81\x46\x82\x52\x81\x7C\x82\x4F\0\0"
1179 /* 0x6DC ワ:ブ:2−5 */
1180 "\x83\x8F\x81\x46\x83\x75\x81\x46\x82\x51\x81\x7C\x82\x54\0\0"
1181 /* 0x6EC ワ:ブ:2−4 */
1182 "\x83\x8F\x81\x46\x83\x75\x81\x46\x82\x51\x81\x7C\x82\x53\0\0"
1183 /* 0x6FC ワ:ブ:2−3 */
1184 "\x83\x8F\x81\x46\x83\x75\x81\x46\x82\x51\x81\x7C\x82\x52\0\0"
1185 /* 0x70C ワ:ブ:2−2 */
1186 "\x83\x8F\x81\x46\x83\x75\x81\x46\x82\x51\x81\x7C\x82\x51\0\0"
1187 /* 0x71C ワ:ブ:2−1 */
1188 "\x83\x8F\x81\x46\x83\x75\x81\x46\x82\x51\x81\x7C\x82\x50\0\0"
1189 /* 0x72C ワ:ブ:2−0 */
1190 "\x83\x8F\x81\x46\x83\x75\x81\x46\x82\x51\x81\x7C\x82\x4F\0\0"
1191 /* 0x73C ワ:ブ:1−5 */
1192 "\x83\x8F\x81\x46\x83\x75\x81\x46\x82\x50\x81\x7C\x82\x54\0\0"
1193 /* 0x74C ワ:ブ:1−4 */
1194 "\x83\x8F\x81\x46\x83\x75\x81\x46\x82\x50\x81\x7C\x82\x53\0\0"
1195 /* 0x75C ワ:ブ:1−3 */
1196 "\x83\x8F\x81\x46\x83\x75\x81\x46\x82\x50\x81\x7C\x82\x52\0\0"
1197 /* 0x76C ワ:ブ:1−2 */
1198 "\x83\x8F\x81\x46\x83\x75\x81\x46\x82\x50\x81\x7C\x82\x51\0\0"
1199 /* 0x77C ワ:ブ:1−1 */
1200 "\x83\x8F\x81\x46\x83\x75\x81\x46\x82\x50\x81\x7C\x82\x50\0\0"
1201 /* 0x78C ワ:ブ:1−0 */
1202 "\x83\x8F\x81\x46\x83\x75\x81\x46\x82\x50\x81\x7C\x82\x4F\0\0"
1203 /* 0x79C タタカウ−5 */
1204 "\x83\x5E\x83\x5E\x83\x4A\x83\x45\x81\x7C\x82\x54\0\0\0\0"
1205 /* 0x7AC タタカウ−4 */
1206 "\x83\x5E\x83\x5E\x83\x4A\x83\x45\x81\x7C\x82\x53\0\0\0\0"
1207 /* 0x7BC タタカウ−3 */
1208 "\x83\x5E\x83\x5E\x83\x4A\x83\x45\x81\x7C\x82\x52\0\0\0\0"
1209 /* 0x7CC タタカウ−2 */
1210 "\x83\x5E\x83\x5E\x83\x4A\x83\x45\x81\x7C\x82\x51\0\0\0\0"
1211 /* 0x7DC タタカウ−1 */
1212 "\x83\x5E\x83\x5E\x83\x4A\x83\x45\x81\x7C\x82\x50\0\0\0\0"
1213 /* 0x7EC タタカウ−0 */
1214 "\x83\x5E\x83\x5E\x83\x4A\x83\x45\x81\x7C\x82\x4F\0\0\0\0"
1215 /* 0x7FC いかり */
1216 "\x82\xA2\x82\xA9\x82\xE8\0\0"
1217 /* 0x804 キメポーズ */
1218 "\x83\x4C\x83\x81\x83\x7C\x81\x5B\x83\x59\0\0"
1219 /* 0x810 おきあがり */
1220 "\x82\xA8\x82\xAB\x82\xA0\x82\xAA\x82\xE8\0\0"
1221 /* 0x81C デッド */
1222 "\x83\x66\x83\x62\x83\x68\0\0"
1223 /* 0x824 Lダメージ−5 */
1224 "\x82\x6B\x83\x5F\x83\x81\x81\x5B\x83\x57\x81\x7C\x82\x54\0\0"
1225 /* 0x834 Lダメージ−4 */
1226 "\x82\x6B\x83\x5F\x83\x81\x81\x5B\x83\x57\x81\x7C\x82\x53\0\0"
1227 /* 0x844 Lダメージ−3 */
1228 "\x82\x6B\x83\x5F\x83\x81\x81\x5B\x83\x57\x81\x7C\x82\x52\0\0"
1229 /* 0x854 Lダメージ−2 */
1230 "\x82\x6B\x83\x5F\x83\x81\x81\x5B\x83\x57\x81\x7C\x82\x51\0\0"
1231 /* 0x864 Lダメージ−1 */
1232 "\x82\x6B\x83\x5F\x83\x81\x81\x5B\x83\x57\x81\x7C\x82\x50\0\0"
1233 /* 0x874 Lダメージ−0 */
1234 "\x82\x6B\x83\x5F\x83\x81\x81\x5B\x83\x57\x81\x7C\x82\x4F\0\0"
1235 /* 0x884 Sダメージ */
1236 "\x82\x72\x83\x5F\x83\x81\x81\x5B\x83\x57\0\0"
1237 /* 0x890 ガード */
1238 "\x83\x4B\x81\x5B\x83\x68\0\0"
1239 /* 0x898 ウェイト−1 */
1240 "\x83\x45\x83\x46\x83\x43\x83\x67\x81\x7C\x82\x50\0\0\0\0"
1241 /* 0x8A8 ウェイト−0 */
1242 "\x83\x45\x83\x46\x83\x43\x83\x67\x81\x7C\x82\x4F"
1243#if VERSION_US
1244 "\0\x02\xC3\x02"
1245#elif VERSION_EU
1246 "\0\xF8\x40\0"
1247#elif VERSION_JP
1248 "\0\x90\xA0\0"
1249#endif
1250 /* 0x8B8 PRO:どく */
1251 "\x82\x6F\x82\x71\x82\x6E\x81\x46\x82\xC7\x82\xAD\0\0\0\0"
1252 /* 0x8C8 ステータス:ダア */
1253 "\x83\x58\x83\x65\x81\x5B\x83\x5E\x83\x58\x81\x46\x83\x5F\x83\x41\0\0\0\0"
1254 /* 0x8DC ステータス:ダ */
1255 "\x83\x58\x83\x65\x81\x5B\x83\x5E\x83\x58\x81\x46\x83\x5F\0\0"
1256 /* 0x8EC フィールド:コ */
1257 "\x83\x74\x83\x42\x81\x5B\x83\x8B\x83\x68\x81\x46\x83\x52\0\0"
1258 /* 0x8FC アイテム:ダ */
1259 "\x83\x41\x83\x43\x83\x65\x83\x80\x81\x46\x83\x5F\0\0\0\0"
1260 /* 0x90C ワ:マ:ウ:3 */
1261 "\x83\x8F\x81\x46\x83\x7D\x81\x46\x83\x45\x81\x46\x82\x52\0\0"
1262 /* 0x91C ジョグレス */
1263 "\x83\x57\x83\x87\x83\x4F\x83\x8C\x83\x58\0\0"
1264 /* 0x928 ヒッサツ */
1265 "\x83\x71\x83\x62\x83\x54\x83\x63\0\0\0\0"
1266 /* 0x934 ワ:マ:カ */
1267 "\x83\x8F\x81\x46\x83\x7D\x81\x46\x83\x4A\0\0"
1268 /* 0x940 ワ:マ:ウ */
1269 "\x83\x8F\x81\x46\x83\x7D\x81\x46\x83\x45\0\0"
1270 /* 0x94C ワ:ブ:3 */
1271 "\x83\x8F\x81\x46\x83\x75\x81\x46\x82\x52\0\0"
1272 /* 0x958 ワ:ブ:2 */
1273 "\x83\x8F\x81\x46\x83\x75\x81\x46\x82\x51\0\0"
1274 /* 0x964 ワ:ブ:1 */
1275 "\x83\x8F\x81\x46\x83\x75\x81\x46\x82\x50\0\0"
1276 /* 0x970 たたかう */
1277 "\x82\xBD\x82\xBD\x82\xA9\x82\xA4\0\0\0\0"
1278 /* 0x97C ガード */
1279 "\x83\x4B\x81\x5B\x83\x68\0\0"
1280 /* 0x984 デッド */
1281 "\x83\x66\x83\x62\x83\x68\0\0"
1282 /* 0x98C Lダメージ */
1283 "\x82\x6B\x83\x5F\x83\x81\x81\x5B\x83\x57\0\0"
1284 /* 0x998 Sダメージ */
1285 "\x82\x72\x83\x5F\x83\x81\x81\x5B\x83\x57\0\0"
1286 /* 0x9A4 ウェイト */
1287 "\x83\x45\x83\x46\x83\x43\x83\x67\0\0\0\0"
1288 /* 0x9B0 −NONE− */
1289 "\x81\x7C\x82\x6D\x82\x6E\x82\x6D\x82\x64\x81\x7C"
1290#if VERSION_US
1291 "\0\0\0\0";
1292#elif VERSION_EU
1293 "\0\0\x84\x8E";
1294#elif VERSION_JP
1295 "\0\0\xB7\xAF";
1296#endif
1297#define WFIGHTTS_STR(offset) ((char *)WFIGHTTS_strings + (offset))
1298
1299/* The screen, for the layers */
1301/* The partner and the enemy the battle test starts with, by the mode's
1302 argument */
1304 {0x017A, 0x01B9}, {0x016E, 0x0073}, {0x0103, 0x00CA}, {0x016E, 0x01B4},
1305 {0x0091, 0x00C5}, {0x001F, 0x0089}, {0x0097, 0x006C},
1306};
1307/* the full-screen quad behind the lists, and its grey */
1309 { 0, 0 }, { 320, 0 }, { 0, 240 }, { 320, 240 },
1310};
1312 { 0x80, 0x80, 0x80, 0 }, { 0x80, 0x80, 0x80, 0 },
1313 { 0x80, 0x80, 0x80, 0 }, { 0x80, 0x80, 0x80, 0 },
1314};
1315/* the battle's speed (FIGHTSTG_battle.speed.mode), which SELECT cycles */
1317/* the fighter list's side, and each side's cursor and scroll */
1321/* the camera list's side, and each side's camera */
1324/* the cameras' names: the partner's 12 and the enemy's 3 */
1326 WFIGHTTS_STR(0x0A0), WFIGHTTS_STR(0x090), WFIGHTTS_STR(0x080), WFIGHTTS_STR(0x070),
1327 WFIGHTTS_STR(0x060), WFIGHTTS_STR(0x050), WFIGHTTS_STR(0x040), WFIGHTTS_STR(0x02C),
1328 WFIGHTTS_STR(0x020), WFIGHTTS_STR(0x014), WFIGHTTS_STR(0x008), WFIGHTTS_STR(0x000),
1329};
1331 WFIGHTTS_STR(0x020), WFIGHTTS_STR(0x014), WFIGHTTS_STR(0x008),
1332};
1336 WFIGHTTS_STR(0x4E8), WFIGHTTS_STR(0x4D4), WFIGHTTS_STR(0x4C0), WFIGHTTS_STR(0x4AC),
1337 WFIGHTTS_STR(0x498), WFIGHTTS_STR(0x484), WFIGHTTS_STR(0x470), WFIGHTTS_STR(0x45C),
1338 WFIGHTTS_STR(0x448), WFIGHTTS_STR(0x434), WFIGHTTS_STR(0x420), WFIGHTTS_STR(0x40C),
1339 WFIGHTTS_STR(0x3F8), WFIGHTTS_STR(0x3E4), WFIGHTTS_STR(0x3D0), WFIGHTTS_STR(0x3BC),
1340 WFIGHTTS_STR(0x3A8), WFIGHTTS_STR(0x394), WFIGHTTS_STR(0x380), WFIGHTTS_STR(0x36C),
1341 WFIGHTTS_STR(0x358), WFIGHTTS_STR(0x344), WFIGHTTS_STR(0x330), WFIGHTTS_STR(0x31C),
1342 WFIGHTTS_STR(0x308), WFIGHTTS_STR(0x2F4), WFIGHTTS_STR(0x2E0), WFIGHTTS_STR(0x2CC),
1343 WFIGHTTS_STR(0x2B8), WFIGHTTS_STR(0x2A4), WFIGHTTS_STR(0x290), WFIGHTTS_STR(0x27C),
1344 WFIGHTTS_STR(0x268), WFIGHTTS_STR(0x254), WFIGHTTS_STR(0x240), WFIGHTTS_STR(0x22C),
1345 WFIGHTTS_STR(0x218), WFIGHTTS_STR(0x204), WFIGHTTS_STR(0x1F0), WFIGHTTS_STR(0x1DC),
1346 WFIGHTTS_STR(0x1C8), WFIGHTTS_STR(0x1B4), WFIGHTTS_STR(0x1A0), WFIGHTTS_STR(0x18C),
1347 WFIGHTTS_STR(0x178), WFIGHTTS_STR(0x164), WFIGHTTS_STR(0x150), WFIGHTTS_STR(0x13C),
1348 WFIGHTTS_STR(0x128), WFIGHTTS_STR(0x114), WFIGHTTS_STR(0x100), WFIGHTTS_STR(0x0EC),
1349 WFIGHTTS_STR(0x0D8), WFIGHTTS_STR(0x0C4), WFIGHTTS_STR(0x0B0),
1350};
1351/* the motions' and the effects' names, for their lists */
1353 WFIGHTTS_STR(0x8A8), WFIGHTTS_STR(0x898), WFIGHTTS_STR(0x890), WFIGHTTS_STR(0x884),
1354 WFIGHTTS_STR(0x874), WFIGHTTS_STR(0x864), WFIGHTTS_STR(0x854), WFIGHTTS_STR(0x844),
1355 WFIGHTTS_STR(0x834), WFIGHTTS_STR(0x824), WFIGHTTS_STR(0x81C), WFIGHTTS_STR(0x810),
1356 WFIGHTTS_STR(0x804), WFIGHTTS_STR(0x7FC), WFIGHTTS_STR(0x7EC), WFIGHTTS_STR(0x7DC),
1357 WFIGHTTS_STR(0x7CC), WFIGHTTS_STR(0x7BC), WFIGHTTS_STR(0x7AC), WFIGHTTS_STR(0x79C),
1358 WFIGHTTS_STR(0x78C), WFIGHTTS_STR(0x77C), WFIGHTTS_STR(0x76C), WFIGHTTS_STR(0x75C),
1359 WFIGHTTS_STR(0x74C), WFIGHTTS_STR(0x73C), WFIGHTTS_STR(0x72C), WFIGHTTS_STR(0x71C),
1360 WFIGHTTS_STR(0x70C), WFIGHTTS_STR(0x6FC), WFIGHTTS_STR(0x6EC), WFIGHTTS_STR(0x6DC),
1361 WFIGHTTS_STR(0x6CC), WFIGHTTS_STR(0x6BC), WFIGHTTS_STR(0x6AC), WFIGHTTS_STR(0x69C),
1362 WFIGHTTS_STR(0x68C), WFIGHTTS_STR(0x67C), WFIGHTTS_STR(0x66C), WFIGHTTS_STR(0x65C),
1363 WFIGHTTS_STR(0x64C), WFIGHTTS_STR(0x63C), WFIGHTTS_STR(0x62C), WFIGHTTS_STR(0x61C),
1364 WFIGHTTS_STR(0x60C), WFIGHTTS_STR(0x5FC), WFIGHTTS_STR(0x5EC), WFIGHTTS_STR(0x5DC),
1365 WFIGHTTS_STR(0x5CC), WFIGHTTS_STR(0x5BC), WFIGHTTS_STR(0x5AC), WFIGHTTS_STR(0x59C),
1366 WFIGHTTS_STR(0x58C), WFIGHTTS_STR(0x57C), WFIGHTTS_STR(0x56C), WFIGHTTS_STR(0x55C),
1367 WFIGHTTS_STR(0x54C), WFIGHTTS_STR(0x53C), WFIGHTTS_STR(0x52C), WFIGHTTS_STR(0x51C),
1368 WFIGHTTS_STR(0x50C), WFIGHTTS_STR(0x4FC),
1369};
1371 WFIGHTTS_STR(0x9B0), WFIGHTTS_STR(0x9A4), WFIGHTTS_STR(0x998), WFIGHTTS_STR(0x98C),
1372 WFIGHTTS_STR(0x984), WFIGHTTS_STR(0x97C), WFIGHTTS_STR(0x970), WFIGHTTS_STR(0x964),
1373 WFIGHTTS_STR(0x958), WFIGHTTS_STR(0x94C), WFIGHTTS_STR(0x940), WFIGHTTS_STR(0x934),
1374 WFIGHTTS_STR(0x928), WFIGHTTS_STR(0x91C), WFIGHTTS_STR(0x90C), WFIGHTTS_STR(0x8FC),
1375 WFIGHTTS_STR(0x8EC), WFIGHTTS_STR(0x8DC), WFIGHTTS_STR(0x8C8), WFIGHTTS_STR(0x8B8),
1376};
1377/* the views the camera list fades to, from the partner's and the enemy's
1378 cameras */
1380s32 WFIGHTTS_unused[3] = { 0, 0, 0 };
1382/* where R2 with the pad moves the display to */
1385BattleTestCursors WFIGHTTS_motionCursors = { { 0, 0 }, 0, { 0, 0 }, { 0, 0 } };
1386BattleTestCursors WFIGHTTS_effectCursors = { { 0, 0 }, 0, { 0, 0 }, { 0, 0 } };
FighterCache FIGHTSTG_fighterCache
the fighters' data, loaded one at a time
Definition battle.c:21
Battle FIGHTSTG_battle
the battle: its fighters, speed and drawing functions
Definition battle.c:16
#define BATTLE_LAYER_MENUS
the HUD, the menus and the messages
Definition types.h:31
#define BATTLE_LAYER_CAMERA
The battle's layers, over the screen's (SCREEN_LAYER)
Definition types.h:27
#define BATTLE_TASK_MODELS
the fighters'
Definition types.h:23
#define FIGHTSTG_CREATE_LAYERS(screen, frontCallbacks)
The body of WFIGHTMN's and WFIGHTTS's layer setups: the display and the battle's layers on SCREEN (a ...
Definition types.h:38
BattleCamera * FIGHTSTG_createBattleCamera(s32 layerId)
Creates the battle camera (BATTLE_TASK_CAMERA) on a layer.
BattleScript * FIGHTSTG_createBattleScript(void)
Creates a battle script, which plays a technique (FIGHTSTG_updateBattleScript)
static void setUpBattle(BattleTest *task, BattleTestChildren *children)
Frees the files, loads the sound bank and plays the music, loads the images, then creates the battle'...
Definition battle_test.c:29
CameraView WFIGHTTS_enemyView
char * WFIGHTTS_stageNames[]
s16 WFIGHTTS_fighters[][2]
The partner and the enemy the battle test starts with, by the mode's argument.
void WFIGHTTS_initLayers(void)
Sets up the display and the battle test's layers.
Definition battle_test.c:4
void WFIGHTTS_cameraList(BattleTestList *task, CameraListWindows *windows)
The camera list: the partner's 12 cameras on the right and the enemy's 3 on the left (RIGHT and LEFT ...
char * WFIGHTTS_effectNames[]
s32 WFIGHTTS_fighterScrolls[2]
static void runCameraList(BattleTest *task, BattleTestChildren *children)
Page 2: the camera list; L1 and R1 go to the next and previous lists, and a camera picked of a side's...
s32 WFIGHTTS_unused[3]
static void runPlayPage(BattleTest *task, BattleTestChildren *children)
Page 0: CROSS goes back to the last list, and R1, R2 and L2 play an entrance, a Digimon change and a ...
Definition battle_test.c:88
void WFIGHTTS_fighterList(BattleTestList *task, BattleTestWindows *windows)
The fighter list: the partners on the right and the enemies on the left, fourteen shown at a time (RI...
s32 WFIGHTTS_fighterCursors[2]
BattleTestMotions * WFIGHTTS_createMotionList(s32 *side, s32 *motion)
Starts the motion list, which sets *SIDE and *MOTION.
Task * WFIGHTTS_start(void)
WFIGHTTS's entry point: creates the battle test, though with 0 bytes for its fields and for its child...
char * WFIGHTTS_partnerCameraNames[]
the cameras' names: the partner's 12 and the enemy's 3
void WFIGHTTS_loadImages(void)
Loads the battle test's images into VRAM.
Definition battle_test.c:9
BattleTestList * WFIGHTTS_createFighterList(s32 *side, s32 *pick)
Starts the fighter list, which sets *SIDE and *PICK.
BattleTestCursors WFIGHTTS_effectCursors
s32 WFIGHTTS_displayY
static void runStageList(BattleTest *task, BattleTestChildren *children)
Page 3: the stage list; L1 and R1 go to the next and previous lists, and a stage picked replaces the ...
DVECTOR WFIGHTTS_backPoints[4]
the full-screen quad behind the lists, and its grey
static void moveDisplay(void)
With R2 held, the pad moves the display and START puts it back; without, sets the normal display mode...
static void pickEffect(BattleTest *task, BattleTestChildren *children)
Page 5 once its list is open: L1 and R1 go to the next and previous lists, and an effect picked plays...
void WFIGHTTS_effectList(BattleTestEffects *task, BattleTestWindows *windows)
The effect list, like the motion list: fills its lists (fillEffectLists), then CROSS sets the side an...
CVECTOR WFIGHTTS_backColors[4]
BattleTestList * WFIGHTTS_createCameraList(s32 *side, s32 *pick)
Starts the camera list, which sets *SIDE and *PICK.
s32 WFIGHTTS_stageCursor
s32 WFIGHTTS_displayX
where R2 with the pad moves the display to
s32 WFIGHTTS_cameraSide
the camera list's side, and each side's camera
void WFIGHTTS_battleTest(BattleTest *task, BattleTestChildren *children)
The battle test: sets up the battle (setUpBattle), then runs its pages.
static void drawEffectNames(BattleTestEffects *task, BattleTestWindows *windows)
Draws both sides' effect names, the one under the cursor blinking.
static void runMotionList(BattleTest *task, BattleTestChildren *children)
Page 4: the motion list; L1 and R1 go to the next and previous lists, and a motion picked is given to...
static void fillEffectLists(BattleTestEffects *task, BattleTestWindows *windows)
Fills both sides' lists with the effects their fighter has (only "none" without any) and creates thei...
BattleTestStageList * WFIGHTTS_createStageList(s32 *result)
Starts the stage list, which sets *RESULT.
s32 WFIGHTTS_cameraPicks[2]
#define WFIGHTTS_STR(offset)
const char WFIGHTTS_strings[0x9C0]
The strings of the tables below, as GCC emitted them: each table's last to first, and each padded to ...
s32 WFIGHTTS_fighterSide
the fighter list's side, and each side's cursor and scroll
char * WFIGHTTS_motionNames[]
the motions' and the effects' names, for their lists
void WFIGHTTS_motionList(BattleTestMotions *task, BattleTestWindows *windows)
The motion list: the partner's motions on the right and the enemy's on the left, fourteen shown at a ...
s32 WFIGHTTS_speedMode
the battle's speed (FIGHTSTG_battle.speed.mode), which SELECT cycles
BattleTestCursors WFIGHTTS_motionCursors
char * WFIGHTTS_enemyCameraNames[]
void WFIGHTTS_stageList(BattleTestStageList *task, TextWindow **windows)
The fight stage list: 14 of the 55 stages at a time (UP and DOWN, ten at a time with SQUARE held); it...
CameraView WFIGHTTS_partnerView
the views the camera list fades to, from the partner's and the enemy's cameras
BattleTestEffects * WFIGHTTS_createEffectList(s32 *side, s32 *effect)
Starts the effect list, which sets *SIDE and *EFFECT.
RECT WFIGHTTS_screen
The screen, for the layers.
s32 WFIGHTTS_stageScroll
static void runFighterList(BattleTest *task, BattleTestChildren *children)
Page 1: the fighter list; L1 and R1 go to the next and previous lists, and a fighter picked replaces ...
WFIGHTTS.PRO: the battle test, a debug menu.
CameraTurn * FIGHTSTG_startCameraTurn(void)
Starts the camera's turn around the fighters.
Definition camera_turn.h:59
#define NULL
Definition common.h:17
signed int s32
Definition common.h:11
signed short s16
Definition common.h:9
DigimonChange * FIGHTSTG_startDigimonChange(s32 key1, s32 key2)
Starts a partner's Digimon change (FIGHTSTG_updateDigimonChange)
GfxState GFX
GFX: the graphics state and its methods.
Definition display.c:209
HitEffect * FIGHTSTG_startHitEffect()
WFIGHTMN passes the damage as a third argument, which it doesn't read; its code loads it,...
GameState GAME
The save data, the game mode and the methods.
Definition state.c:64
#define TASK_KILL
Definition task.h:37
#define TASK_DONE
Definition task.h:36
Entrance * FIGHTSTG_startEntrance(s32 id, s32 side, s32 weak)
Starts a fighter's entrance: Digimon id on the player's side (side 0) or the enemy's.
Definition entrance.c:175
#define FILE_BATTLE_IMAGES_3
Definition file.h:298
#define FILE_BATTLE_IMAGES_4
Definition file.h:299
#define TEXT_FILE(file)
Definition file.h:190
#define FILE_BATTLE_IMAGES_1
Definition file.h:296
#define FILE_BATTLE_IMAGES_2
Definition file.h:297
#define TEXT_DIGIMON_NAMES
DIGNAM.
Definition file.h:211
#define FILE_BATTLE_IMAGES
Definition file.h:295
FileCache FILE_CACHE
The file cache.
Definition file_cache.c:7
#define SCREEN_WIDTH
The screen the modes draw on (setDisplayMode, their layers' rects)
Definition gfx.h:36
#define SCREEN_HEIGHT
Definition gfx.h:37
BattleSetup BATTLE_SETUP
Definition items.c:886
Lights * FIGHTSTG_createLights(s32 layerId)
Creates the stage lights (id 0x13) for layer layerId.
Definition lights.c:118
Models * FIGHTSTG_createModels(void)
Creates the fighters' models (Models), with no fighters yet.
Definition models.c:154
PadState PAD
Controller input: cleared by initPad, then the methods.
Definition pad.c:168
#define PAD_CROSS
Definition pad.h:31
#define PAD_SELECT
Logical buttons: bits of PadSlot.held/pressed/repeated, which readPadButtons builds from the raw pad ...
Definition pad.h:18
#define PAD_START
Definition pad.h:21
#define PAD_DOWN
Definition pad.h:24
#define PAD_RIGHT
Definition pad.h:23
#define PAD_SQUARE
Definition pad.h:33
#define PAD_TRIANGLE
Definition pad.h:32
#define PAD_L2
Definition pad.h:26
#define PAD_PRESSED(button)
One button of pad 1: newly pressed, auto-repeated while held, or held.
Definition pad.h:140
#define PAD_UP
Definition pad.h:22
#define PAD_L1
Definition pad.h:28
#define PAD_LEFT
Definition pad.h:25
#define PAD_HELD(button)
Definition pad.h:142
#define PAD_R2
Definition pad.h:27
#define PAD_R1
Definition pad.h:29
void FIGHTSTG_setPlayerTurnStep(s32 substate)
Sets the player's turn's substate, while it runs (4 picks the next fighter)
PlayerTurn * FIGHTSTG_startPlayerTurn(void)
Starts the player's turn (FIGHTSTG_updatePlayerTurn, id 0xE)
TaskRegistry TASK_REGISTRY
Definition registry.c:122
SoundState SOUND
rsin and rcos (libgte) read rsin_tbl[a - 0x800] and the like: their addresses before the table fall i...
Definition sound.c:180
#define MUSIC_BATTLE
BATL0000: the maps' random battles (AreaBattle, nearly all of them)
Definition sound.h:76
FightStage * FIGHTSTG_createStage(s32 id, s32 fadeInTime)
Creates the fight stage (id 0x15), which loads stage id and fades it in over fadeInTime.
Definition stage.c:213
CameraView *(* getEnemyView)(struct BattleCamera *task)
Definition camera.h:76
void(* set)(struct BattleCamera *task, CameraView *view)
Definition camera.h:74
void(* fade)(struct BattleCamera *task, CameraView *from, CameraView *to, s32 time)
from: NULL for the current
Definition camera.h:75
s32 enemy
the script is the enemy's (nonzero) or the partner's
Definition effect.h:146
s32 sound
what the sound commands' 0x62 and 0x63 stand for on a hit
Definition effect.h:151
s32 hits[4]
0 a hit, 3 a miss; [3] how it ended
Definition effect.h:148
s32 index
the script, in the fighter's archive
Definition effect.h:147
s32 stage
what the stage command's 0x38 stands for
Definition effect.h:149
s32 music
the battle's music
Definition game_state.h:385
s32 stage
the battle's fight stage
Definition game_state.h:383
The battle test's children.
Definition battle_test.h:90
BattleChild task
what plays, NULL when done
Definition battle_test.h:91
BattleTestList * fighters
Definition battle_test.h:96
FightStage * stage
Definition battle_test.h:95
BattleTestStageList * stages
Definition battle_test.h:98
BattleCamera * camera
Definition battle_test.h:93
BattleTestMotions * motions
Definition battle_test.h:99
PlayerTurn * commands
the player's turn (FIGHTSTG_startPlayerTurn)
Definition battle_test.h:92
BattleTestList * cameras
Definition battle_test.h:97
BattleTestEffects * effects
Where the motion and the effect lists are: the fighters they were made for, the list LEFT and RIGHT p...
Definition battle_test.h:41
A fighter's effects, in the effect list (WFIGHTTS_effectList): each one plus 1, or just a 0 for a fig...
Definition battle_test.h:33
The effect list's task.
Definition battle_test.h:68
BattleTestEffectList lists[2]
the partner's, the enemy's
Definition battle_test.h:70
void(* nextState)(struct BattleTestEffects *task)
Definition battle_test.h:69
void(* setState)(struct BattleTestEffects *task, s32 state)
Definition battle_test.h:69
s32 * effect
the effect picked
Definition battle_test.h:72
The fighters' and the cameras' lists (WFIGHTTS_fighterList, WFIGHTTS_cameraList)
Definition battle_test.h:12
void(* setState)(struct BattleTestList *task, s32 state)
Definition battle_test.h:13
s32 * side
0 the partner, 1 the enemy, -1 for none
Definition battle_test.h:14
s32 * pick
set to 0 when it starts
Definition battle_test.h:15
void(* nextState)(struct BattleTestList *task)
Definition battle_test.h:13
A fighter's motions, in the motion list (WFIGHTTS_motionList)
Definition battle_test.h:25
s32 motions[0x3E]
the ones the fighter has
Definition battle_test.h:26
The motion list's task.
Definition battle_test.h:60
void(* setState)(struct BattleTestMotions *task, s32 state)
Definition battle_test.h:61
BattleTestMotionList lists[2]
the partner's, the enemy's
Definition battle_test.h:62
s32 * motion
the motion picked
Definition battle_test.h:64
void(* nextState)(struct BattleTestMotions *task)
Definition battle_test.h:61
The stage list's task.
Definition battle_test.h:19
void(* nextState)(struct BattleTestStageList *task)
Definition battle_test.h:20
s32 * result
the stage picked, 1-55, or -1
Definition battle_test.h:21
void(* setState)(struct BattleTestStageList *task, s32 state)
Definition battle_test.h:20
The fighter, motion and effect lists' windows, by list.
Definition battle_test.h:49
TextWindow * windows[2][14]
Definition battle_test.h:50
The battle test (WFIGHTTS_battleTest).
Definition battle_test.h:78
s32 page
the last list, which CROSS goes back to
Definition battle_test.h:80
s32 camera
by the fighter's motion
Definition battle_test.h:83
s32 stage
1-55, or -1
Definition battle_test.h:84
void(* nextSubstate)(struct BattleTest *task)
Definition battle_test.h:79
void(* nextStep)(struct BattleTest *task)
Definition battle_test.h:79
s32 side
0 the partner, 1 the enemy, -1 for none
Definition battle_test.h:81
void(* setSubstate)(struct BattleTest *task, s32 substate)
Definition battle_test.h:79
void(* nextState)(struct BattleTest *task)
Definition battle_test.h:79
void(* drawBlendedQuad)(s32 layerId, s32 depth, DVECTOR *xy, CVECTOR *colors)
Definition battle.h:246
void(* setSpeed)(s32 mode)
Definition battle.h:243
The camera list's windows: the partners' cameras and the enemies'.
Definition battle_test.h:54
TextWindow * partner[12]
Definition battle_test.h:55
TextWindow * enemy[3]
Definition battle_test.h:56
Where the battle camera looks from and to, as a GsRVIEW2 with the transform of its coordinate system.
Definition camera.h:49
s32 vry
Definition camera.h:54
s32 vpy
Definition camera.h:51
s32 vrx
Definition camera.h:53
s32 rz
the roll, in degrees
Definition camera.h:60
s32 vpx
Definition camera.h:50
s32 vpz
Definition camera.h:52
s32 proj
the projection distance
Definition camera.h:61
s32 vrz
Definition camera.h:55
void(* setStage)(struct FightStage *task, s32 stage, s32 fadeOutTime, s32 fadeInTime)
Definition stage.h:54
FighterInfo * partnerInfo
both hold the info found, read by isEnemy
Definition model.h:270
FighterInfoFuncs funcs
Definition model.h:272
An enemy's FighterInfo: it has 3 cameras where a partner has 12.
Definition model.h:242
ShortVec3 camPos[3]
Definition model.h:250
s16 camProj[3]
Definition model.h:252
ShortVec3 camRef[3]
Definition model.h:251
void(* cacheEntry)(s32 index)
FIGHTSTG_cacheFighter: the list's entry at index.
Definition model.h:259
FighterInfo *(* getInfo)(s32 id)
Definition model.h:258
A fighter's entry in its file, from FIGHTSTG_fighterCache.funcs.getInfo.
Definition model.h:225
s16 camProj[12]
Definition model.h:236
ShortVec3 camPos[12]
the cameras that look at it; an enemy has 3 of each and then their count
Definition model.h:233
ShortVec3 camRef[12]
Definition model.h:235
s32 motions
Definition model.h:227
s32 effects
its effect scripts' archive
Definition model.h:228
void *(* load)(u32 file)
Definition file.h:92
void *(* getEntry)(u32 fileAndIndex)
Definition file.h:96
void(* freeAll)(void)
Definition file.h:94
s32(* getModeArg)()
Definition game_state.h:20
GameFuncs funcs
Definition game_state.h:582
void(* setDisplayMode)(s32 w, s32 h, s32 hires, s32 interlace)
Definition gfx.h:26
s32(* getTime)(void)
Definition gfx.h:31
void(* setDisplayArea)()
Definition gfx.h:27
GfxFuncs funcs
Definition gfx.h:77
s32 motion
the motion to play
Definition model.h:102
The fighters' models (FIGHTSTG_createModels), registered as BATTLE_TASK_MODELS: up to four,...
Definition model.h:284
void(* face)(struct Models *task, s32 id)
ids under 0x10 are one side
Definition model.h:292
void(* add)(struct Models *task, s32 id, s32 fighter, s32 visible)
Definition model.h:288
s32(* getFighter)(struct Models *task, s32 id)
Definition model.h:291
ModelControl *(* get)(struct Models *task, s32 id)
Definition model.h:289
s32(* getRepeated)(s32 pad)
Definition pad.h:127
s32(* getHeld)(s32 pad)
Definition pad.h:126
s32(* getPressed)(s32 pad)
Definition pad.h:125
s16 x
Definition model.h:15
s16 z
Definition model.h:17
s16 y
Definition model.h:16
s32(* isLoading)(void)
Definition sound.h:193
void(* loadBank)(s32 id)
Definition sound.h:190
short(* playSound)(s32 id)
returns the voice of a key-on
Definition sound.h:187
void *(* find)(s32 id, s32 key1, s32 key2)
Definition task.h:18
TaskFuncs funcs
Definition task.h:76
Any task, seen through its header.
Definition task.h:62
A text window (createTextWindow): up to six text buffers (0 is shown, 1-5 are "work" buffers that con...
Definition text.h:131
void(* setText)()
Definition text.h:164
void(* setString)()
Definition text.h:165
void(* setVisible)(struct TextWindow *obj, u8 arg)
Definition text.h:177
Uploads TIM images to VRAM (initTimLoader); acts on TIM_LOADER.
Definition gfx.h:325
void(* setImagePos)()
(x, y)
Definition gfx.h:336
void(* load)()
(TIM)
Definition gfx.h:335
void(* loadArchive)()
(archive): each image 64 halfwords to the right
Definition gfx.h:338
void * createTask(void(*update)(), s32 size, s32 childrenSize)
createTaskWithId for a task nothing needs to find
Definition task.c:105
void * createTaskWithId(void(*update)(), s32 size, s32 childrenSize, s32 id)
Allocates a zeroed task of size bytes (header included) with room for childrenSize / 4 child tasks.
Definition task.c:80
TextWindow * createTextWindow(s16 layerId, s16 style, s16 x, s16 y)
A text window on a layer, in a font style, at (x, y)
void initTimLoader(TimLoader *obj)
Clears a TIM loader, gives it its methods and binds it.
Definition tim_loader.c:119
Entrance * entrance
a fighter's (FIGHTSTG_startEntrance)
Definition task.h:20
DigimonChange * change
a partner's Digimon change (FIGHTSTG_startDigimonChange)
Definition task.h:21
Task * task
Definition task.h:17
HitEffect * hitEffect
effect 0x33, then a script (FIGHTSTG_startHitEffect)
Definition task.h:26
BattleScript * script
a technique's (FIGHTSTG_createBattleScript)
Definition task.h:19
CameraTurn * cameraTurn
when the player loses (FIGHTSTG_startCameraTurn)
Definition task.h:29