forked from danenders/pkedx
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbattle_factory_screen.c
4108 lines (3800 loc) · 125 KB
/
battle_factory_screen.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
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#include "global.h"
#include "battle.h"
#include "battle_factory_screen.h"
#include "battle_factory.h"
#include "sprite.h"
#include "event_data.h"
#include "overworld.h"
#include "random.h"
#include "battle_tower.h"
#include "text.h"
#include "palette.h"
#include "task.h"
#include "main.h"
#include "alloc.h"
#include "bg.h"
#include "gpu_regs.h"
#include "string_util.h"
#include "international_string_util.h"
#include "window.h"
#include "data2.h"
#include "decompress.h"
#include "pokemon_summary_screen.h"
#include "sound.h"
#include "pokedex.h"
#include "util.h"
#include "trainer_pokemon_sprites.h"
#include "constants/battle_frontier.h"
#include "constants/songs.h"
#include "constants/rgb.h"
// Select_ refers to the first Pokemon selection screen where you choose 3 Pokemon.
// Swap_ refers to the consecutive selection screen where you can keep your Pokemon or swap one with beaten trainer's.
#define MENU_SUMMARY 0
#define MENU_RENT 1
#define MENU_DESELECT 1
#define MENU_OTHERS 2
#define MENU_OPTIONS_COUNT 3
#define SELECTABLE_MONS_COUNT 6
#define TAG_PAL_BALL_GREY 0x64
#define TAG_PAL_BALL_SELECTED 0x65
#define TAG_PAL_66 0x66
#define TAG_PAL_67 0x67
#define TAG_TILE_64 0x64
#define TAG_TILE_65 0x65
#define TAG_TILE_66 0x66
#define TAG_TILE_67 0x67
#define TAG_TILE_68 0x68
#define TAG_TILE_69 0x69
#define TAG_TILE_6A 0x6A
#define TAG_TILE_6B 0x6B
#define TAG_TILE_6C 0x6C
#define TAG_TILE_6D 0x6D
struct FactorySelecteableMon
{
u16 monSetId;
u16 spriteId;
u8 selectedId; // 0 - not selected, 1 - first pokemon, 2 - second pokemon, 3 - third pokemon
struct Pokemon monData;
};
struct UnkFactoryStruct
{
u8 field0;
u8 field1;
};
struct FactorySelectMonsStruct
{
u8 menuCursorPos;
u8 menuCursor1SpriteId;
u8 menuCursor2SpriteId;
u8 cursorPos;
u8 cursorSpriteId;
u8 selectingMonsState;
bool8 fromSummaryScreen;
u8 yesNoCursorPos;
u8 unused8;
struct FactorySelecteableMon mons[SELECTABLE_MONS_COUNT];
struct UnkFactoryStruct unk294[3];
bool8 unk2A0;
u8 fadeSpeciesNameTaskId;
bool8 unk2A2;
u16 unk2A4;
bool8 unk2A6;
u8 unk2A7;
u8 unk2A8;
u8 unk2A9;
};
// 'Action' refers to the 3 Selectable mons, Cancel, Pknm for swap windows.
#define ACTIONS_PLAYER_SCREEN 0
#define ACTIONS_ENEMY_SCREEN 1
struct SwapActionIdAndFunc
{
u8 id;
void (*func)(u8 taskId);
};
struct FactorySwapMonsStruct
{
u8 menuCursorPos;
u8 menuCursor1SpriteId;
u8 menuCursor2SpriteId;
u8 cursorPos;
u8 cursorSpriteId;
u8 ballSpriteIds[3];
u8 unk8[2][3];
u8 unkE[2][2];
u8 playerMonId;
u8 enemyMonId;
bool8 inEnemyScreen;
bool8 fromSummaryScreen;
u8 yesNoCursorPos;
u8 actionsCount;
const struct SwapActionIdAndFunc *actionsData;
u8 unused1C[4];
bool8 monSwapped;
u8 fadeSpeciesNameTaskId;
bool8 unk22;
u16 unk24;
bool8 unk26;
u8 unk27;
u8 unk28;
u8 unk29;
struct UnkFactoryStruct unk2C;
bool8 unk30;
};
extern const u32 gUnknown_085B18AC[];
// This file's functions.
static void sub_819A44C(struct Sprite *sprite);
static void CB2_InitSelectScreen(void);
static void Select_SetWinRegs(s16 mWin0H, s16 nWin0H, s16 mWin0V, s16 nWin0V);
static void Select_InitMonsData(void);
static void Select_InitAllSprites(void);
static void Select_ShowSummaryMonSprite(void);
static void Select_PrintSelectMonString(void);
static void Select_PrintMonSpecies(void);
static void Select_PrintMonCategory(void);
static void Select_PrintRentalPkmnString(void);
static void Select_CopyMonsToPlayerParty(void);
static void sub_819C4B4(void);
static void Select_ShowYesNoOptions(void);
static void sub_819C568(void);
static void Select_ShowMenuOptions(void);
static void Select_PrintMenuOptions(void);
static void Select_PrintYesNoOptions(void);
static void Task_SelectFadeSpeciesName(u8 taskId);
static void sub_819C1D0(u8 taskId);
static void Task_HandleSelectionScreenChooseMons(u8 taskId);
static void Task_HandleSelectionScreenMenu(u8 taskId);
static void CreateFrontierFactorySelectableMons(u8 firstMonId);
static void CreateTentFactorySelectableMons(u8 firstMonId);
static void Select_SetBallSpritePaletteNum(u8 id);
static void sub_819F444(struct UnkFactoryStruct arg0, bool8 *arg1);
static void sub_819B958(u8 windowId);
static void sub_819F2B4(u8 *arg0, bool8 *arg1, bool8 swapScreen);
static void sub_819F3F8(struct UnkFactoryStruct arg0, bool8 *arg1, bool8 swapScreen);
static u8 Select_RunMenuOptionFunc(void);
static u8 sub_819BC9C(void);
static u8 Select_OptionSummary(void);
static u8 Select_OptionOthers(void);
static u8 Select_OptionRentDeselect(void);
static bool32 Select_AreSpeciesValid(u16 monSetId);
static void Swap_DestroyAllSprites(void);
static void Swap_ShowYesNoOptions(void);
static void sub_819E8EC(void);
static void sub_819EAC0(void);
static void Swap_UpdateYesNoCursorPosition(s8 direction);
static void Swap_UpdateMenuCursorPosition(s8 direction);
static void sub_819EA64(u8 windowId);
static void sub_819D770(u8 taskId);
static void Task_HandleSwapScreenChooseMons(u8 taskId);
static void sub_819D588(u8 taskId);
static void sub_819F7B4(u8 taskId);
static void Swap_PrintOnInfoWindow(const u8 *str);
static void Swap_ShowMenuOptions(void);
static void Swap_PrintMenuOptions(void);
static void Swap_PrintYesNoOptions(void);
static void Swap_PrintMonSpecies(void);
static void Swap_PrintMonSpecies2(void);
static void Swap_PrintMonSpecies3(void);
static void Swap_PrintMonCategory(void);
static void Swap_InitAllSprites(void);
static void Swap_PrintPkmnSwap(void);
static void sub_819EADC(void);
static void sub_819EAF8(void);
static void CB2_InitSwapScreen(void);
static void Swap_ShowSummaryMonSprite(void);
static void Swap_UpdateActionCursorPosition(s8 direction);
static void Swap_UpdateBallCursorPosition(s8 direction);
static void Swap_RunMenuOptionFunc(u8 taskId);
static void sub_819F0CC(u8 taskId);
static void sub_819F114(u8 taskId);
static void sub_819F134(u8 taskId);
static void Swap_RunActionFunc(u8 taskId);
static void sub_819F69C(u8 taskId);
static void Task_SwapCantHaveSameMons(u8 taskId);
static void Swap_ShowMonSprite(void);
static void Swap_PrintActionStrings(void);
static void Swap_PrintActionStrings2(void);
static void Swap_PrintOneActionString(u8 which);
static void Swap_InitActions(u8 id);
static void sub_819E838(u8 arg0);
static bool8 Swap_AlreadyHasSameSpecies(u8 monId);
static void sub_819F600(struct Sprite *sprite);
static void Swap_ActionMon(u8 taskId);
static void Swap_ActionCancel(u8 taskId);
static void Swap_ActionPkmnForSwap(u8 taskId);
// Ewram variables
static EWRAM_DATA u8 *sSelectMenuTilesetBuffer = NULL;
static EWRAM_DATA u8 *sSelectMonCardBgTilesetBuffer = NULL;
static EWRAM_DATA u8 *sSelectMenuTilemapBuffer = NULL;
static EWRAM_DATA u8 *sSelectMonCardBgTilemapBuffer = NULL;
static EWRAM_DATA struct Pokemon *sFactorySelectMons = NULL;
static EWRAM_DATA u8 *sSwapMenuTilesetBuffer = NULL;
static EWRAM_DATA u8 *sSwapMonCardBgTilesetBuffer = NULL;
static EWRAM_DATA u8 *sSwapMenuTilemapBuffer = NULL;
static EWRAM_DATA u8 *sSwapMonCardBgTilemapBuffer = NULL;
// IWRAM bss
static IWRAM_DATA struct FactorySelectMonsStruct *sFactorySelectScreen;
static IWRAM_DATA void (*sSwap_CurrentTableFunc)(u8 taskId);
static IWRAM_DATA struct FactorySwapMonsStruct *sFactorySwapScreen;
// IWRAM common
u8 (*gUnknown_030062E8)(void);
// Const rom data.
static const u16 gUnknown_0860F13C[] = INCBIN_U16("graphics/unknown/unknown_60F13C.gbapal");
static const u16 gUnknown_0860F15C[] = INCBIN_U16("graphics/unknown/unknown_60F15C.gbapal");
static const u16 gUnknown_0860F17C[] = INCBIN_U16("graphics/unknown/unknown_60F17C.gbapal");
static const u8 gUnknown_0860F1BC[] = INCBIN_U8("graphics/unknown/unknown_60F1BC.4bpp");
static const u8 gUnknown_0860F3BC[] = INCBIN_U8("graphics/unknown/unknown_60F3BC.4bpp");
static const u8 gUnknown_0860F43C[] = INCBIN_U8("graphics/unknown/unknown_60F43C.4bpp");
static const u8 gUnknown_0860F53C[] = INCBIN_U8("graphics/unknown/unknown_60F53C.4bpp");
static const u8 gUnknown_0860F63C[] = INCBIN_U8("graphics/unknown/unknown_60F63C.4bpp");
static const u8 gUnknown_0860F6BC[] = INCBIN_U8("graphics/unknown/unknown_60F6BC.4bpp");
static const u8 gUnknown_0860F7BC[] = INCBIN_U8("graphics/unknown/unknown_60F7BC.4bpp");
static const u8 gUnknown_0860F83C[] = INCBIN_U8("graphics/unknown/unknown_60F83C.4bpp");
static const u8 gUnknown_0860F93C[] = INCBIN_U8("graphics/unknown/unknown_60F93C.4bpp");
static const u8 gUnknown_0860FA3C[] = INCBIN_U8("graphics/unknown/unknown_60FA3C.4bpp");
static const u8 gUnknown_0861023C[] = INCBIN_U8("graphics/unknown/unknown_61023C.bin");
static const u8 gUnknown_0861033C[] = INCBIN_U8("graphics/unknown/unknown_61033C.4bpp");
static const u16 gUnknown_0861039C[] = INCBIN_U16("graphics/unknown/unknown_61039C.gbapal");
static const struct SpriteSheet gUnknown_086103BC[] =
{
{gUnknown_0860F3BC, sizeof(gUnknown_0860F3BC), TAG_TILE_65},
{gUnknown_0860F43C, sizeof(gUnknown_0860F43C), TAG_TILE_66},
{gUnknown_0860F53C, sizeof(gUnknown_0860F53C), TAG_TILE_67},
{gUnknown_0860FA3C, sizeof(gUnknown_0860FA3C), TAG_TILE_6D},
{},
};
static const struct CompressedSpriteSheet gUnknown_086103E4[] =
{
{gUnknown_085B18AC, 0x800, TAG_TILE_64},
{},
};
static const struct SpritePalette gUnknown_086103F4[] =
{
{gUnknown_0860F13C, TAG_PAL_BALL_GREY},
{gUnknown_0860F15C, TAG_PAL_BALL_SELECTED},
{gUnknown_0860F17C, TAG_PAL_66},
{gUnknown_0861039C, TAG_PAL_67},
{},
};
u8 static (* const sSelect_MenuOptionFuncs[])(void) =
{
[MENU_SUMMARY] = Select_OptionSummary,
[MENU_RENT] /*Or Deselect*/ = Select_OptionRentDeselect,
[MENU_OTHERS] = Select_OptionOthers
};
static const struct BgTemplate sSelect_BgTemplates[] =
{
{
.bg = 0,
.charBaseIndex = 0,
.mapBaseIndex = 24,
.screenSize = 0,
.paletteMode = 0,
.priority = 0,
.baseTile = 0
},
{
.bg = 1,
.charBaseIndex = 1,
.mapBaseIndex = 25,
.screenSize = 0,
.paletteMode = 0,
.priority = 3,
.baseTile = 0
},
{
.bg = 3,
.charBaseIndex = 2,
.mapBaseIndex = 27,
.screenSize = 0,
.paletteMode = 0,
.priority = 2,
.baseTile = 0
},
};
static const struct WindowTemplate sSelect_WindowTemplates[] =
{
{
.bg = 0,
.tilemapLeft = 0,
.tilemapTop = 2,
.width = 12,
.height = 2,
.paletteNum = 15,
.baseBlock = 0x0001,
},
{
.bg = 0,
.tilemapLeft = 19,
.tilemapTop = 2,
.width = 11,
.height = 2,
.paletteNum = 14,
.baseBlock = 0x0019,
},
{
.bg = 0,
.tilemapLeft = 0,
.tilemapTop = 15,
.width = 20,
.height = 3,
.paletteNum = 15,
.baseBlock = 0x002f,
},
{
.bg = 0,
.tilemapLeft = 22,
.tilemapTop = 14,
.width = 8,
.height = 6,
.paletteNum = 15,
.baseBlock = 0x006b,
},
{
.bg = 0,
.tilemapLeft = 22,
.tilemapTop = 14,
.width = 8,
.height = 4,
.paletteNum = 15,
.baseBlock = 0x009b,
},
{
.bg = 0,
.tilemapLeft = 15,
.tilemapTop = 0,
.width = 15,
.height = 2,
.paletteNum = 15,
.baseBlock = 0x00bb,
},
DUMMY_WIN_TEMPLATE,
};
static const u16 gUnknown_0861046C[] = INCBIN_U16("graphics/unknown/unknown_61046C.gbapal");
static const u8 gUnknown_08610476[] = {0x00, 0x02, 0x00};
static const u8 gUnknown_08610479[] = {0x00, 0x04, 0x00};
static const struct OamData gUnknown_0861047C =
{
.y = 0,
.affineMode = 0,
.objMode = 0,
.mosaic = 0,
.bpp = 0,
.shape = 0,
.x = 0,
.matrixNum = 0,
.size = 2,
.tileNum = 0,
.priority = 3,
.paletteNum = 0,
.affineParam = 0,
};
static const struct OamData gUnknown_08610484 =
{
.y = 0,
.affineMode = 0,
.objMode = 0,
.mosaic = 0,
.bpp = 0,
.shape = 0,
.x = 0,
.matrixNum = 0,
.size = 1,
.tileNum = 0,
.priority = 3,
.paletteNum = 0,
.affineParam = 0,
};
static const struct OamData gUnknown_0861048C =
{
.y = 0,
.affineMode = 0,
.objMode = 0,
.mosaic = 0,
.bpp = 0,
.shape = 1,
.x = 0,
.matrixNum = 0,
.size = 2,
.tileNum = 0,
.priority = 2,
.paletteNum = 0,
.affineParam = 0,
};
static const struct OamData gUnknown_08610494 =
{
.y = 0,
.affineMode = 3,
.objMode = 1,
.mosaic = 0,
.bpp = 0,
.shape = 0,
.x = 0,
.matrixNum = 0,
.size = 3,
.tileNum = 0,
.priority = 0,
.paletteNum = 0,
.affineParam = 1,
};
static const union AnimCmd gUnknown_0861049C[] =
{
ANIMCMD_FRAME(0, 1),
ANIMCMD_END,
};
static const union AnimCmd gUnknown_086104A4[] =
{
ANIMCMD_FRAME(0, 1),
ANIMCMD_END,
};
static const union AnimCmd gUnknown_086104AC[] =
{
ANIMCMD_FRAME(0, 30),
ANIMCMD_END,
};
static const union AnimCmd gUnknown_086104B4[] =
{
ANIMCMD_FRAME(16, 4),
ANIMCMD_FRAME(0, 4),
ANIMCMD_FRAME(32, 4),
ANIMCMD_FRAME(0, 4),
ANIMCMD_FRAME(16, 4),
ANIMCMD_FRAME(0, 4),
ANIMCMD_FRAME(32, 4),
ANIMCMD_FRAME(0, 4),
ANIMCMD_FRAME(0, 32),
ANIMCMD_FRAME(16, 8),
ANIMCMD_FRAME(0, 8),
ANIMCMD_FRAME(32, 8),
ANIMCMD_FRAME(0, 8),
ANIMCMD_FRAME(16, 8),
ANIMCMD_FRAME(0, 8),
ANIMCMD_FRAME(32, 8),
ANIMCMD_FRAME(0, 8),
ANIMCMD_END,
};
static const union AnimCmd * const gUnknown_086104FC[] =
{
gUnknown_0861049C,
};
static const union AnimCmd * const gUnknown_08610500[] =
{
gUnknown_086104A4,
};
static const union AnimCmd * const gUnknown_08610504[] =
{
gUnknown_086104AC,
gUnknown_086104B4,
};
static const union AffineAnimCmd gUnknown_0861050C[] =
{
AFFINEANIMCMD_FRAME(5, 5, 0, 0),
AFFINEANIMCMD_FRAME(0, 0, 0, 1),
AFFINEANIMCMD_FRAME(16, 5, 0, 0),
AFFINEANIMCMD_FRAME(0, 0, 0, 1),
AFFINEANIMCMD_FRAME(32, 5, 0, 0),
AFFINEANIMCMD_FRAME(0, 0, 0, 1),
AFFINEANIMCMD_FRAME(64, 5, 0, 0),
AFFINEANIMCMD_FRAME(0, 0, 0, 1),
AFFINEANIMCMD_FRAME(128, 5, 0, 0),
AFFINEANIMCMD_FRAME(0, 0, 0, 1),
AFFINEANIMCMD_FRAME(256, 5, 0, 0),
AFFINEANIMCMD_END,
};
static const union AffineAnimCmd gUnknown_0861056C[] =
{
AFFINEANIMCMD_FRAME(128, 5, 0, 0),
AFFINEANIMCMD_FRAME(0, 0, 0, 1),
AFFINEANIMCMD_FRAME(64, 5, 0, 0),
AFFINEANIMCMD_FRAME(0, 0, 0, 1),
AFFINEANIMCMD_FRAME(32, 5, 0, 0),
AFFINEANIMCMD_FRAME(0, 0, 0, 1),
AFFINEANIMCMD_FRAME(16, 5, 0, 0),
AFFINEANIMCMD_FRAME(0, 0, 0, 1),
AFFINEANIMCMD_FRAME(5, 5, 0, 0),
AFFINEANIMCMD_END,
};
static const union AffineAnimCmd gUnknown_086105BC[] =
{
AFFINEANIMCMD_FRAME(256, 256, 0, 0),
AFFINEANIMCMD_END,
};
static const union AffineAnimCmd * const gUnknown_086105CC[] =
{
gUnknown_0861050C,
gUnknown_0861056C,
gUnknown_086105BC,
};
static const struct SpriteTemplate gUnknown_086105D8 =
{
.tileTag = TAG_TILE_64,
.paletteTag = TAG_PAL_BALL_GREY,
.oam = &gUnknown_0861047C,
.anims = gUnknown_08610504,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = sub_819A44C
};
static const struct SpriteTemplate gUnknown_086105F0 =
{
.tileTag = TAG_TILE_65,
.paletteTag = TAG_PAL_66,
.oam = &gUnknown_08610484,
.anims = gUnknown_086104FC,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy
};
static const struct SpriteTemplate gUnknown_08610608 =
{
.tileTag = TAG_TILE_66,
.paletteTag = TAG_PAL_66,
.oam = &gUnknown_0861048C,
.anims = gUnknown_086104FC,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy
};
static const struct SpriteTemplate gUnknown_08610620 =
{
.tileTag = TAG_TILE_67,
.paletteTag = TAG_PAL_66,
.oam = &gUnknown_0861048C,
.anims = gUnknown_086104FC,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy
};
static const struct SpriteTemplate gUnknown_08610638 =
{
.tileTag = TAG_TILE_6D,
.paletteTag = TAG_PAL_67,
.oam = &gUnknown_08610494,
.anims = gUnknown_08610500,
.images = NULL,
.affineAnims = gUnknown_086105CC,
.callback = SpriteCallbackDummy
};
static const struct SpriteSheet gUnknown_08610650[] =
{
{gUnknown_0860F3BC, sizeof(gUnknown_0860F3BC), TAG_TILE_65},
{gUnknown_0860F43C, sizeof(gUnknown_0860F43C), TAG_TILE_66},
{gUnknown_0860F53C, sizeof(gUnknown_0860F53C), TAG_TILE_67},
{gUnknown_0860F63C, sizeof(gUnknown_0860F63C), TAG_TILE_68},
{gUnknown_0860F6BC, sizeof(gUnknown_0860F6BC), TAG_TILE_69},
{gUnknown_0860F7BC, 0x100, TAG_TILE_6A},
{gUnknown_0860F83C, sizeof(gUnknown_0860F83C), TAG_TILE_6B},
{gUnknown_0860F93C, sizeof(gUnknown_0860F93C), TAG_TILE_6C},
{gUnknown_0860FA3C, sizeof(gUnknown_0860FA3C), TAG_TILE_6D},
{},
};
static const struct CompressedSpriteSheet gUnknown_086106A0[] =
{
{gUnknown_085B18AC, 0x800, TAG_TILE_64},
{},
};
static const struct SpritePalette gUnknown_086106B0[] =
{
{gUnknown_0860F13C, TAG_PAL_BALL_GREY},
{gUnknown_0860F15C, TAG_PAL_BALL_SELECTED},
{gUnknown_0860F17C, TAG_PAL_66},
{gUnknown_0861039C, TAG_PAL_67},
{},
};
static const struct OamData gUnknown_086106D8 =
{
.y = 0,
.affineMode = 0,
.objMode = 0,
.mosaic = 0,
.bpp = 0,
.shape = 0,
.x = 0,
.matrixNum = 0,
.size = 2,
.tileNum = 0,
.priority = 3,
.paletteNum = 0,
.affineParam = 0,
};
static const struct OamData gUnknown_086106E0 =
{
.y = 0,
.affineMode = 0,
.objMode = 0,
.mosaic = 0,
.bpp = 0,
.shape = 0,
.x = 0,
.matrixNum = 0,
.size = 1,
.tileNum = 0,
.priority = 3,
.paletteNum = 0,
.affineParam = 0,
};
static const struct OamData gUnknown_086106E8 =
{
.y = 0,
.affineMode = 0,
.objMode = 0,
.mosaic = 0,
.bpp = 0,
.shape = 1,
.x = 0,
.matrixNum = 0,
.size = 2,
.tileNum = 0,
.priority = 2,
.paletteNum = 0,
.affineParam = 0,
};
static const struct OamData gUnknown_086106F0 =
{
.y = 0,
.affineMode = 3,
.objMode = 1,
.mosaic = 0,
.bpp = 0,
.shape = 0,
.x = 0,
.matrixNum = 0,
.size = 3,
.tileNum = 0,
.priority = 0,
.paletteNum = 0,
.affineParam = 1,
};
static const union AnimCmd gUnknown_086106F8[] =
{
ANIMCMD_FRAME(0, 1),
ANIMCMD_END,
};
static const union AnimCmd gUnknown_08610700[] =
{
ANIMCMD_FRAME(0, 1),
ANIMCMD_END,
};
static const union AnimCmd gUnknown_08610708[] =
{
ANIMCMD_FRAME(0, 30),
ANIMCMD_END,
};
static const union AnimCmd gUnknown_08610710[] =
{
ANIMCMD_FRAME(16, 4),
ANIMCMD_FRAME(0, 4),
ANIMCMD_FRAME(32, 4),
ANIMCMD_FRAME(0, 4),
ANIMCMD_FRAME(16, 4),
ANIMCMD_FRAME(0, 4),
ANIMCMD_FRAME(32, 4),
ANIMCMD_FRAME(0, 4),
ANIMCMD_FRAME(0, 32),
ANIMCMD_FRAME(16, 8),
ANIMCMD_FRAME(0, 8),
ANIMCMD_FRAME(32, 8),
ANIMCMD_FRAME(0, 8),
ANIMCMD_FRAME(16, 8),
ANIMCMD_FRAME(0, 8),
ANIMCMD_FRAME(32, 8),
ANIMCMD_FRAME(0, 8),
ANIMCMD_END,
};
static const union AnimCmd * const gUnknown_08610758[] =
{
gUnknown_086106F8,
};
static const union AnimCmd * const gUnknown_0861075C[] =
{
gUnknown_08610700,
};
static const union AnimCmd * const gUnknown_08610760[] =
{
gUnknown_08610708,
gUnknown_08610710,
};
static const union AffineAnimCmd gUnknown_08610768[] =
{
AFFINEANIMCMD_FRAME(5, 5, 0, 0),
AFFINEANIMCMD_FRAME(0, 0, 0, 1),
AFFINEANIMCMD_FRAME(16, 5, 0, 0),
AFFINEANIMCMD_FRAME(0, 0, 0, 1),
AFFINEANIMCMD_FRAME(32, 5, 0, 0),
AFFINEANIMCMD_FRAME(0, 0, 0, 1),
AFFINEANIMCMD_FRAME(64, 5, 0, 0),
AFFINEANIMCMD_FRAME(0, 0, 0, 1),
AFFINEANIMCMD_FRAME(128, 5, 0, 0),
AFFINEANIMCMD_FRAME(0, 0, 0, 1),
AFFINEANIMCMD_FRAME(256, 5, 0, 0),
AFFINEANIMCMD_END,
};
static const union AffineAnimCmd gUnknown_086107C8[] =
{
AFFINEANIMCMD_FRAME(128, 5, 0, 0),
AFFINEANIMCMD_FRAME(0, 0, 0, 1),
AFFINEANIMCMD_FRAME(64, 5, 0, 0),
AFFINEANIMCMD_FRAME(0, 0, 0, 1),
AFFINEANIMCMD_FRAME(32, 5, 0, 0),
AFFINEANIMCMD_FRAME(0, 0, 0, 1),
AFFINEANIMCMD_FRAME(16, 5, 0, 0),
AFFINEANIMCMD_FRAME(0, 0, 0, 1),
AFFINEANIMCMD_FRAME(5, 5, 0, 0),
AFFINEANIMCMD_END,
};
static const union AffineAnimCmd gUnknown_08610818[] =
{
AFFINEANIMCMD_FRAME(256, 256, 0, 0),
AFFINEANIMCMD_END,
};
static const union AffineAnimCmd * const gUnknown_08610828[] =
{
gUnknown_08610768,
gUnknown_086107C8,
gUnknown_08610818,
};
static const struct SpriteTemplate gUnknown_08610834 =
{
.tileTag = TAG_TILE_64,
.paletteTag = TAG_PAL_BALL_GREY,
.oam = &gUnknown_086106D8,
.anims = gUnknown_08610760,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = sub_819A44C
};
static const struct SpriteTemplate gUnknown_0861084C =
{
.tileTag = TAG_TILE_65,
.paletteTag = TAG_PAL_66,
.oam = &gUnknown_086106E0,
.anims = gUnknown_08610758,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy
};
static const struct SpriteTemplate gUnknown_08610864 =
{
.tileTag = TAG_TILE_66,
.paletteTag = TAG_PAL_66,
.oam = &gUnknown_086106E8,
.anims = gUnknown_08610758,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy
};
static const struct SpriteTemplate gUnknown_0861087C =
{
.tileTag = TAG_TILE_67,
.paletteTag = TAG_PAL_66,
.oam = &gUnknown_086106E8,
.anims = gUnknown_08610758,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy
};
static const struct SpriteTemplate gUnknown_08610894 =
{
.tileTag = TAG_TILE_6D,
.paletteTag = TAG_PAL_67,
.oam = &gUnknown_086106F0,
.anims = gUnknown_0861075C,
.images = NULL,
.affineAnims = gUnknown_08610828,
.callback = SpriteCallbackDummy
};
void static (* const sSwap_MenuOptionFuncs[])(u8 taskId) =
{
sub_819F114,
sub_819F0CC,
sub_819F134,
};
static const struct BgTemplate sSwap_BgTemplates[4] =
{
{
.bg = 0,
.charBaseIndex = 0,
.mapBaseIndex = 24,
.screenSize = 0,
.paletteMode = 0,
.priority = 1,
.baseTile = 0
},
{
.bg = 1,
.charBaseIndex = 1,
.mapBaseIndex = 25,
.screenSize = 0,
.paletteMode = 0,
.priority = 3,
.baseTile = 0
},
{
.bg = 2,
.charBaseIndex = 2,
.mapBaseIndex = 26,
.screenSize = 0,
.paletteMode = 0,
.priority = 0,
.baseTile = 0
},
{
.bg = 3,
.charBaseIndex = 2,
.mapBaseIndex = 27,
.screenSize = 0,
.paletteMode = 0,
.priority = 2,
.baseTile = 0
},
};
static const struct WindowTemplate sSwap_WindowTemplates[] =
{
{
.bg = 0,
.tilemapLeft = 0,
.tilemapTop = 2,
.width = 12,
.height = 2,
.paletteNum = 15,
.baseBlock = 0x0001,
},
{
.bg = 2,
.tilemapLeft = 19,
.tilemapTop = 2,
.width = 11,
.height = 2,
.paletteNum = 14,
.baseBlock = 0x0019,
},
{
.bg = 0,
.tilemapLeft = 0,
.tilemapTop = 15,
.width = 20,
.height = 3,
.paletteNum = 15,
.baseBlock = 0x002f,
},
{
.bg = 0,
.tilemapLeft = 21,
.tilemapTop = 14,
.width = 9,
.height = 6,
.paletteNum = 15,
.baseBlock = 0x006b,
},
{
.bg = 0,
.tilemapLeft = 22,
.tilemapTop = 14,
.width = 8,
.height = 4,
.paletteNum = 15,
.baseBlock = 0x00a1,
},
{
.bg = 2,
.tilemapLeft = 21,
.tilemapTop = 15,
.width = 9,
.height = 5,
.paletteNum = 14,
.baseBlock = 0x006b,
},
{
.bg = 2,
.tilemapLeft = 10,
.tilemapTop = 2,
.width = 4,
.height = 2,
.paletteNum = 14,
.baseBlock = 0x00c1,
},
{
.bg = 0,
.tilemapLeft = 19,
.tilemapTop = 2,
.width = 11,
.height = 2,
.paletteNum = 15,
.baseBlock = 0x00c9,
},
{
.bg = 0,
.tilemapLeft = 15,
.tilemapTop = 0,
.width = 15,
.height = 2,
.paletteNum = 15,
.baseBlock = 0x00df,
},
DUMMY_WIN_TEMPLATE,
};
static const u16 gUnknown_08610918[] = {RGB_BLACK, RGB_BLACK, RGB_WHITE, RGB_BLACK, RGB_RED}; // Palette.
static const u8 gUnknown_08610922[] = {0x0, 0x02, 0x0};
static const u8 gUnknown_08610925[] = {0x0, 0x04, 0x0};
static const struct SwapActionIdAndFunc sSwap_PlayerScreenActions[] =
{
{1, Swap_ActionMon},
{1, Swap_ActionMon},
{1, Swap_ActionMon},
{3, Swap_ActionCancel},
};
static const struct SwapActionIdAndFunc sSwap_EnemyScreenActions[] =
{