-
Notifications
You must be signed in to change notification settings - Fork 2.6k
/
pokemon_summary_screen.c
4155 lines (3854 loc) · 132 KB
/
pokemon_summary_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 "main.h"
#include "battle.h"
#include "battle_anim.h"
#include "frontier_util.h"
#include "battle_message.h"
#include "battle_tent.h"
#include "battle_factory.h"
#include "bg.h"
#include "contest.h"
#include "contest_effect.h"
#include "data.h"
#include "daycare.h"
#include "decompress.h"
#include "dynamic_placeholder_text_util.h"
#include "event_data.h"
#include "gpu_regs.h"
#include "graphics.h"
#include "international_string_util.h"
#include "item.h"
#include "link.h"
#include "m4a.h"
#include "malloc.h"
#include "menu.h"
#include "menu_helpers.h"
#include "mon_markings.h"
#include "party_menu.h"
#include "palette.h"
#include "pokeball.h"
#include "pokemon.h"
#include "pokemon_storage_system.h"
#include "pokemon_summary_screen.h"
#include "region_map.h"
#include "scanline_effect.h"
#include "sound.h"
#include "sprite.h"
#include "string_util.h"
#include "strings.h"
#include "task.h"
#include "text.h"
#include "tv.h"
#include "window.h"
#include "constants/items.h"
#include "constants/moves.h"
#include "constants/party_menu.h"
#include "constants/region_map_sections.h"
#include "constants/rgb.h"
#include "constants/songs.h"
enum {
PSS_PAGE_INFO,
PSS_PAGE_SKILLS,
PSS_PAGE_BATTLE_MOVES,
PSS_PAGE_CONTEST_MOVES,
PSS_PAGE_COUNT,
};
// Screen titles (upper left)
#define PSS_LABEL_WINDOW_POKEMON_INFO_TITLE 0
#define PSS_LABEL_WINDOW_POKEMON_SKILLS_TITLE 1
#define PSS_LABEL_WINDOW_BATTLE_MOVES_TITLE 2
#define PSS_LABEL_WINDOW_CONTEST_MOVES_TITLE 3
// Button control text (upper right)
#define PSS_LABEL_WINDOW_PROMPT_CANCEL 4
#define PSS_LABEL_WINDOW_PROMPT_INFO 5
#define PSS_LABEL_WINDOW_PROMPT_SWITCH 6
#define PSS_LABEL_WINDOW_UNUSED1 7
// Info screen
#define PSS_LABEL_WINDOW_POKEMON_INFO_RENTAL 8
#define PSS_LABEL_WINDOW_POKEMON_INFO_TYPE 9
// Skills screen
#define PSS_LABEL_WINDOW_POKEMON_SKILLS_STATS_LEFT 10 // HP, Attack, Defense
#define PSS_LABEL_WINDOW_POKEMON_SKILLS_STATS_RIGHT 11 // Sp. Attack, Sp. Defense, Speed
#define PSS_LABEL_WINDOW_POKEMON_SKILLS_EXP 12 // EXP, Next Level
#define PSS_LABEL_WINDOW_POKEMON_SKILLS_STATUS 13
// Moves screen
#define PSS_LABEL_WINDOW_MOVES_POWER_ACC 14 // Also contains the power and accuracy values
#define PSS_LABEL_WINDOW_MOVES_APPEAL_JAM 15
#define PSS_LABEL_WINDOW_UNUSED2 16
// Above/below the pokemon's portrait (left)
#define PSS_LABEL_WINDOW_PORTRAIT_DEX_NUMBER 17
#define PSS_LABEL_WINDOW_PORTRAIT_NICKNAME 18 // The upper name
#define PSS_LABEL_WINDOW_PORTRAIT_SPECIES 19 // The lower name
#define PSS_LABEL_WINDOW_END 20
// Dynamic fields for the Pokémon Info page
#define PSS_DATA_WINDOW_INFO_ORIGINAL_TRAINER 0
#define PSS_DATA_WINDOW_INFO_ID 1
#define PSS_DATA_WINDOW_INFO_ABILITY 2
#define PSS_DATA_WINDOW_INFO_MEMO 3
// Dynamic fields for the Pokémon Skills page
#define PSS_DATA_WINDOW_SKILLS_HELD_ITEM 0
#define PSS_DATA_WINDOW_SKILLS_RIBBON_COUNT 1
#define PSS_DATA_WINDOW_SKILLS_STATS_LEFT 2 // HP, Attack, Defense
#define PSS_DATA_WINDOW_SKILLS_STATS_RIGHT 3 // Sp. Attack, Sp. Defense, Speed
#define PSS_DATA_WINDOW_EXP 4 // Exp, next level
// Dynamic fields for the Battle Moves and Contest Moves pages.
#define PSS_DATA_WINDOW_MOVE_NAMES 0
#define PSS_DATA_WINDOW_MOVE_PP 1
#define PSS_DATA_WINDOW_MOVE_DESCRIPTION 2
#define MOVE_SELECTOR_SPRITES_COUNT 10
#define TYPE_ICON_SPRITE_COUNT (MAX_MON_MOVES + 1)
// for the spriteIds field in PokemonSummaryScreenData
enum
{
SPRITE_ARR_ID_MON,
SPRITE_ARR_ID_BALL,
SPRITE_ARR_ID_STATUS,
SPRITE_ARR_ID_TYPE, // 2 for mon types, 5 for move types(4 moves and 1 to learn), used interchangeably, because mon types and move types aren't shown on the same screen
SPRITE_ARR_ID_MOVE_SELECTOR1 = SPRITE_ARR_ID_TYPE + TYPE_ICON_SPRITE_COUNT, // 10 sprites that make up the selector
SPRITE_ARR_ID_MOVE_SELECTOR2 = SPRITE_ARR_ID_MOVE_SELECTOR1 + MOVE_SELECTOR_SPRITES_COUNT,
SPRITE_ARR_ID_COUNT = SPRITE_ARR_ID_MOVE_SELECTOR2 + MOVE_SELECTOR_SPRITES_COUNT
};
#define TILE_EMPTY_APPEAL_HEART 0x1039
#define TILE_FILLED_APPEAL_HEART 0x103A
#define TILE_FILLED_JAM_HEART 0x103C
#define TILE_EMPTY_JAM_HEART 0x103D
static EWRAM_DATA struct PokemonSummaryScreenData
{
/*0x00*/ union {
struct Pokemon *mons;
struct BoxPokemon *boxMons;
} monList;
/*0x04*/ MainCallback callback;
/*0x08*/ struct Sprite *markingsSprite;
/*0x0C*/ struct Pokemon currentMon;
/*0x70*/ struct PokeSummary
{
u16 species; // 0x0
u16 species2; // 0x2
u8 isEgg; // 0x4
u8 level; // 0x5
u8 ribbonCount; // 0x6
u8 ailment; // 0x7
u8 abilityNum; // 0x8
u8 metLocation; // 0x9
u8 metLevel; // 0xA
u8 metGame; // 0xB
u32 pid; // 0xC
u32 exp; // 0x10
u16 moves[MAX_MON_MOVES]; // 0x14
u8 pp[MAX_MON_MOVES]; // 0x1C
u16 currentHP; // 0x20
u16 maxHP; // 0x22
u16 atk; // 0x24
u16 def; // 0x26
u16 spatk; // 0x28
u16 spdef; // 0x2A
u16 speed; // 0x2C
u16 item; // 0x2E
u16 friendship; // 0x30
u8 OTGender; // 0x32
u8 nature; // 0x33
u8 ppBonuses; // 0x34
u8 sanity; // 0x35
u8 OTName[17]; // 0x36
u32 OTID; // 0x48
} summary;
u16 bgTilemapBuffers[PSS_PAGE_COUNT][2][0x400];
u8 mode;
bool8 isBoxMon;
u8 curMonIndex;
u8 maxMonIndex;
u8 currPageIndex;
u8 minPageIndex;
u8 maxPageIndex;
bool8 lockMonFlag; // This is used to prevent the player from changing Pokémon in the move deleter select, etc, but it is not needed because the input is handled differently there
u16 newMove;
u8 firstMoveIndex;
u8 secondMoveIndex;
bool8 lockMovesFlag; // This is used to prevent the player from changing position of moves in a battle or when trading.
u8 bgDisplayOrder; // Determines the order page backgrounds are loaded while scrolling between them
u8 filler40CA;
u8 windowIds[8];
u8 spriteIds[SPRITE_ARR_ID_COUNT];
bool8 handleDeoxys;
s16 switchCounter; // Used for various switch statement cases that decompress/load graphics or Pokémon data
u8 unk_filler4[6];
} *sMonSummaryScreen = NULL;
EWRAM_DATA u8 gLastViewedMonIndex = 0;
static EWRAM_DATA u8 sMoveSlotToReplace = 0;
ALIGNED(4) static EWRAM_DATA u8 sAnimDelayTaskId = 0;
// forward declarations
static bool8 LoadGraphics(void);
static void CB2_InitSummaryScreen(void);
static void InitBGs(void);
static bool8 DecompressGraphics(void);
static void CopyMonToSummaryStruct(struct Pokemon *);
static bool8 ExtractMonDataToSummaryStruct(struct Pokemon *);
static void SetDefaultTilemaps(void);
static void CloseSummaryScreen(u8);
static void Task_HandleInput(u8);
static void ChangeSummaryPokemon(u8, s8);
static void Task_ChangeSummaryMon(u8);
static s8 AdvanceMonIndex(s8);
static s8 AdvanceMultiBattleMonIndex(s8);
static bool8 IsValidToViewInMulti(struct Pokemon *);
static void ChangePage(u8, s8);
static void PssScrollRight(u8);
static void PssScrollRightEnd(u8);
static void PssScrollLeft(u8);
static void PssScrollLeftEnd(u8);
static void TryDrawExperienceProgressBar(void);
static void SwitchToMoveSelection(u8);
static void Task_HandleInput_MoveSelect(u8);
static bool8 HasMoreThanOneMove(void);
static void ChangeSelectedMove(s16 *, s8, u8 *);
static void CloseMoveSelectMode(u8);
static void SwitchToMovePositionSwitchMode(u8);
static void Task_HandleInput_MovePositionSwitch(u8);
static void ExitMovePositionSwitchMode(u8, bool8);
static void SwapMonMoves(struct Pokemon *, u8, u8);
static void SwapBoxMonMoves(struct BoxPokemon *, u8, u8);
static void Task_SetHandleReplaceMoveInput(u8);
static void Task_HandleReplaceMoveInput(u8);
static bool8 CanReplaceMove(void);
static void ShowCantForgetHMsWindow(u8);
static void Task_HandleInputCantForgetHMsMoves(u8);
static void DrawPagination(void);
static void HandlePowerAccTilemap(u16, s16);
static void Task_ShowPowerAccWindow(u8);
static void HandleAppealJamTilemap(u16, s16, u16);
static void Task_ShowAppealJamWindow(u8);
static void HandleStatusTilemap(u16, s16);
static void Task_ShowStatusWindow(u8);
static void TilemapFiveMovesDisplay(u16 *, u16, bool8);
static void DrawPokerusCuredSymbol(struct Pokemon *);
static void DrawExperienceProgressBar(struct Pokemon *);
static void DrawContestMoveHearts(u16);
static void LimitEggSummaryPageDisplay(void);
static void ResetWindows(void);
static void PrintMonInfo(void);
static void PrintNotEggInfo(void);
static void PrintEggInfo(void);
static void PrintGenderSymbol(struct Pokemon *, u16);
static void PrintPageNamesAndStats(void);
static void PutPageWindowTilemaps(u8);
static void ClearPageWindowTilemaps(u8);
static void RemoveWindowByIndex(u8);
static void PrintPageSpecificText(u8);
static void CreateTextPrinterTask(u8);
static void PrintInfoPageText(void);
static void Task_PrintInfoPage(u8);
static void PrintMonOTName(void);
static void PrintMonOTID(void);
static void PrintMonAbilityName(void);
static void PrintMonAbilityDescription(void);
static void BufferMonTrainerMemo(void);
static void PrintMonTrainerMemo(void);
static void BufferNatureString(void);
static void GetMetLevelString(u8 *);
static bool8 DoesMonOTMatchOwner(void);
static bool8 DidMonComeFromGBAGames(void);
static bool8 IsInGamePartnerMon(void);
static void PrintEggOTName(void);
static void PrintEggOTID(void);
static void PrintEggState(void);
static void PrintEggMemo(void);
static void Task_PrintSkillsPage(u8);
static void PrintHeldItemName(void);
static void PrintSkillsPageText(void);
static void PrintRibbonCount(void);
static void BufferLeftColumnStats(void);
static void PrintLeftColumnStats(void);
static void BufferRightColumnStats(void);
static void PrintRightColumnStats(void);
static void PrintExpPointsNextLevel(void);
static void PrintBattleMoves(void);
static void Task_PrintBattleMoves(u8);
static void PrintMoveNameAndPP(u8);
static void PrintContestMoves(void);
static void Task_PrintContestMoves(u8);
static void PrintContestMoveDescription(u8);
static void PrintMoveDetails(u16);
static void PrintNewMoveDetailsOrCancelText(void);
static void AddAndFillMoveNamesWindow(void);
static void SwapMovesNamesPP(u8, u8);
static void PrintHMMovesCantBeForgotten(void);
static void ResetSpriteIds(void);
static void SetSpriteInvisibility(u8, bool8);
static void HidePageSpecificSprites(void);
static void SetTypeIcons(void);
static void CreateMoveTypeIcons(void);
static void SetMonTypeIcons(void);
static void SetMoveTypeIcons(void);
static void SetContestMoveTypeIcons(void);
static void SetNewMoveTypeIcon(void);
static void SwapMovesTypeSprites(u8, u8);
static u8 LoadMonGfxAndSprite(struct Pokemon *, s16 *);
static u8 CreateMonSprite(struct Pokemon *);
static void SpriteCB_Pokemon(struct Sprite *);
static void StopPokemonAnimations(void);
static void CreateMonMarkingsSprite(struct Pokemon *);
static void RemoveAndCreateMonMarkingsSprite(struct Pokemon *);
static void CreateCaughtBallSprite(struct Pokemon *);
static void CreateSetStatusSprite(void);
static void CreateMoveSelectorSprites(u8);
static void SpriteCB_MoveSelector(struct Sprite *);
static void DestroyMoveSelectorSprites(u8);
static void SetMainMoveSelectorColor(u8);
static void KeepMoveSelectorVisible(u8);
static void SummaryScreen_DestroyAnimDelayTask(void);
// const rom data
#include "data/text/move_descriptions.h"
#include "data/text/nature_names.h"
static const struct BgTemplate sBgTemplates[] =
{
{
.bg = 0,
.charBaseIndex = 0,
.mapBaseIndex = 31,
.screenSize = 0,
.paletteMode = 0,
.priority = 0,
.baseTile = 0,
},
{
.bg = 1,
.charBaseIndex = 2,
.mapBaseIndex = 27,
.screenSize = 1,
.paletteMode = 0,
.priority = 1,
.baseTile = 0,
},
{
.bg = 2,
.charBaseIndex = 2,
.mapBaseIndex = 25,
.screenSize = 1,
.paletteMode = 0,
.priority = 2,
.baseTile = 0,
},
{
.bg = 3,
.charBaseIndex = 2,
.mapBaseIndex = 29,
.screenSize = 1,
.paletteMode = 0,
.priority = 3,
.baseTile = 0,
},
};
struct TilemapCtrl
{
const u16 *gfx;
u16 field_4;
u8 field_6;
u8 field_7;
u8 field_8;
u8 field_9;
};
static const u16 sStatusTilemap[] = INCBIN_U16("graphics/summary_screen/status_tilemap.bin");
static const struct TilemapCtrl sStatusTilemapCtrl1 =
{
sStatusTilemap, 1, 10, 2, 0, 18
};
static const struct TilemapCtrl sStatusTilemapCtrl2 =
{
sStatusTilemap, 1, 10, 2, 0, 50
};
static const struct TilemapCtrl sBattleMoveTilemapCtrl =
{
gSummaryScreen_MoveEffect_Battle_Tilemap, 0, 10, 7, 0, 45
};
static const struct TilemapCtrl sContestMoveTilemapCtrl =
{
gSummaryScreen_MoveEffect_Contest_Tilemap, 0, 10, 7, 0, 45
};
static const s8 sMultiBattleOrder[] = {0, 2, 3, 1, 4, 5};
static const struct WindowTemplate sSummaryTemplate[] =
{
[PSS_LABEL_WINDOW_POKEMON_INFO_TITLE] = {
.bg = 0,
.tilemapLeft = 0,
.tilemapTop = 0,
.width = 11,
.height = 2,
.paletteNum = 6,
.baseBlock = 1,
},
[PSS_LABEL_WINDOW_POKEMON_SKILLS_TITLE] = {
.bg = 0,
.tilemapLeft = 0,
.tilemapTop = 0,
.width = 11,
.height = 2,
.paletteNum = 6,
.baseBlock = 23,
},
[PSS_LABEL_WINDOW_BATTLE_MOVES_TITLE] = {
.bg = 0,
.tilemapLeft = 0,
.tilemapTop = 0,
.width = 11,
.height = 2,
.paletteNum = 6,
.baseBlock = 45,
},
[PSS_LABEL_WINDOW_CONTEST_MOVES_TITLE] = {
.bg = 0,
.tilemapLeft = 0,
.tilemapTop = 0,
.width = 11,
.height = 2,
.paletteNum = 6,
.baseBlock = 67,
},
[PSS_LABEL_WINDOW_PROMPT_CANCEL] = {
.bg = 0,
.tilemapLeft = 22,
.tilemapTop = 0,
.width = 8,
.height = 2,
.paletteNum = 7,
.baseBlock = 89,
},
[PSS_LABEL_WINDOW_PROMPT_INFO] = {
.bg = 0,
.tilemapLeft = 22,
.tilemapTop = 0,
.width = 8,
.height = 2,
.paletteNum = 7,
.baseBlock = 105,
},
[PSS_LABEL_WINDOW_PROMPT_SWITCH] = {
.bg = 0,
.tilemapLeft = 22,
.tilemapTop = 0,
.width = 8,
.height = 2,
.paletteNum = 7,
.baseBlock = 121,
},
[PSS_LABEL_WINDOW_UNUSED1] = {
.bg = 0,
.tilemapLeft = 11,
.tilemapTop = 4,
.width = 0,
.height = 2,
.paletteNum = 6,
.baseBlock = 137,
},
[PSS_LABEL_WINDOW_POKEMON_INFO_RENTAL] = {
.bg = 0,
.tilemapLeft = 11,
.tilemapTop = 4,
.width = 18,
.height = 2,
.paletteNum = 6,
.baseBlock = 137,
},
[PSS_LABEL_WINDOW_POKEMON_INFO_TYPE] = {
.bg = 0,
.tilemapLeft = 11,
.tilemapTop = 6,
.width = 18,
.height = 2,
.paletteNum = 6,
.baseBlock = 173,
},
[PSS_LABEL_WINDOW_POKEMON_SKILLS_STATS_LEFT] = {
.bg = 0,
.tilemapLeft = 10,
.tilemapTop = 7,
.width = 6,
.height = 6,
.paletteNum = 6,
.baseBlock = 209,
},
[PSS_LABEL_WINDOW_POKEMON_SKILLS_STATS_RIGHT] = {
.bg = 0,
.tilemapLeft = 22,
.tilemapTop = 7,
.width = 5,
.height = 6,
.paletteNum = 6,
.baseBlock = 245,
},
[PSS_LABEL_WINDOW_POKEMON_SKILLS_EXP] = {
.bg = 0,
.tilemapLeft = 10,
.tilemapTop = 14,
.width = 11,
.height = 4,
.paletteNum = 6,
.baseBlock = 275,
},
[PSS_LABEL_WINDOW_POKEMON_SKILLS_STATUS] = {
.bg = 0,
.tilemapLeft = 0,
.tilemapTop = 18,
.width = 6,
.height = 2,
.paletteNum = 6,
.baseBlock = 319,
},
[PSS_LABEL_WINDOW_MOVES_POWER_ACC] = {
.bg = 0,
.tilemapLeft = 1,
.tilemapTop = 15,
.width = 9,
.height = 4,
.paletteNum = 6,
.baseBlock = 331,
},
[PSS_LABEL_WINDOW_MOVES_APPEAL_JAM] = {
.bg = 0,
.tilemapLeft = 1,
.tilemapTop = 15,
.width = 5,
.height = 4,
.paletteNum = 6,
.baseBlock = 367,
},
[PSS_LABEL_WINDOW_UNUSED2] = {
.bg = 0,
.tilemapLeft = 22,
.tilemapTop = 4,
.width = 0,
.height = 2,
.paletteNum = 6,
.baseBlock = 387,
},
[PSS_LABEL_WINDOW_PORTRAIT_DEX_NUMBER] = {
.bg = 0,
.tilemapLeft = 1,
.tilemapTop = 2,
.width = 4,
.height = 2,
.paletteNum = 7,
.baseBlock = 387,
},
[PSS_LABEL_WINDOW_PORTRAIT_NICKNAME] = {
.bg = 0,
.tilemapLeft = 1,
.tilemapTop = 12,
.width = 9,
.height = 2,
.paletteNum = 6,
.baseBlock = 395,
},
[PSS_LABEL_WINDOW_PORTRAIT_SPECIES] = {
.bg = 0,
.tilemapLeft = 1,
.tilemapTop = 14,
.width = 9,
.height = 4,
.paletteNum = 6,
.baseBlock = 413,
},
[PSS_LABEL_WINDOW_END] = DUMMY_WIN_TEMPLATE
};
static const struct WindowTemplate sPageInfoTemplate[] =
{
[PSS_DATA_WINDOW_INFO_ORIGINAL_TRAINER] = {
.bg = 0,
.tilemapLeft = 11,
.tilemapTop = 4,
.width = 11,
.height = 2,
.paletteNum = 6,
.baseBlock = 449,
},
[PSS_DATA_WINDOW_INFO_ID] = {
.bg = 0,
.tilemapLeft = 22,
.tilemapTop = 4,
.width = 7,
.height = 2,
.paletteNum = 6,
.baseBlock = 471,
},
[PSS_DATA_WINDOW_INFO_ABILITY] = {
.bg = 0,
.tilemapLeft = 11,
.tilemapTop = 9,
.width = 18,
.height = 4,
.paletteNum = 6,
.baseBlock = 485,
},
[PSS_DATA_WINDOW_INFO_MEMO] = {
.bg = 0,
.tilemapLeft = 11,
.tilemapTop = 14,
.width = 18,
.height = 6,
.paletteNum = 6,
.baseBlock = 557,
},
};
static const struct WindowTemplate sPageSkillsTemplate[] =
{
[PSS_DATA_WINDOW_SKILLS_HELD_ITEM] = {
.bg = 0,
.tilemapLeft = 10,
.tilemapTop = 4,
.width = 10,
.height = 2,
.paletteNum = 6,
.baseBlock = 449,
},
[PSS_DATA_WINDOW_SKILLS_RIBBON_COUNT] = {
.bg = 0,
.tilemapLeft = 20,
.tilemapTop = 4,
.width = 10,
.height = 2,
.paletteNum = 6,
.baseBlock = 469,
},
[PSS_DATA_WINDOW_SKILLS_STATS_LEFT] = {
.bg = 0,
.tilemapLeft = 16,
.tilemapTop = 7,
.width = 6,
.height = 6,
.paletteNum = 6,
.baseBlock = 489,
},
[PSS_DATA_WINDOW_SKILLS_STATS_RIGHT] = {
.bg = 0,
.tilemapLeft = 27,
.tilemapTop = 7,
.width = 3,
.height = 6,
.paletteNum = 6,
.baseBlock = 525,
},
[PSS_DATA_WINDOW_EXP] = {
.bg = 0,
.tilemapLeft = 24,
.tilemapTop = 14,
.width = 6,
.height = 4,
.paletteNum = 6,
.baseBlock = 543,
},
};
static const struct WindowTemplate sPageMovesTemplate[] = // This is used for both battle and contest moves
{
[PSS_DATA_WINDOW_MOVE_NAMES] = {
.bg = 0,
.tilemapLeft = 15,
.tilemapTop = 4,
.width = 9,
.height = 10,
.paletteNum = 6,
.baseBlock = 449,
},
[PSS_DATA_WINDOW_MOVE_PP] = {
.bg = 0,
.tilemapLeft = 24,
.tilemapTop = 4,
.width = 6,
.height = 10,
.paletteNum = 8,
.baseBlock = 539,
},
[PSS_DATA_WINDOW_MOVE_DESCRIPTION] = {
.bg = 0,
.tilemapLeft = 10,
.tilemapTop = 15,
.width = 20,
.height = 4,
.paletteNum = 6,
.baseBlock = 599,
},
};
static const u8 sTextColors[][3] =
{
{0, 1, 2},
{0, 3, 4},
{0, 5, 6},
{0, 7, 8},
{0, 9, 10},
{0, 11, 12},
{0, 13, 14},
{0, 7, 8},
{13, 15, 14},
{0, 1, 2},
{0, 3, 4},
{0, 5, 6},
{0, 7, 8}
};
static const u8 sButtons_Gfx[][4 * TILE_SIZE_4BPP] = {
INCBIN_U8("graphics/summary_screen/a_button.4bpp"),
INCBIN_U8("graphics/summary_screen/b_button.4bpp"),
};
static void (*const sTextPrinterFunctions[])(void) =
{
[PSS_PAGE_INFO] = PrintInfoPageText,
[PSS_PAGE_SKILLS] = PrintSkillsPageText,
[PSS_PAGE_BATTLE_MOVES] = PrintBattleMoves,
[PSS_PAGE_CONTEST_MOVES] = PrintContestMoves
};
static void (*const sTextPrinterTasks[])(u8 taskId) =
{
[PSS_PAGE_INFO] = Task_PrintInfoPage,
[PSS_PAGE_SKILLS] = Task_PrintSkillsPage,
[PSS_PAGE_BATTLE_MOVES] = Task_PrintBattleMoves,
[PSS_PAGE_CONTEST_MOVES] = Task_PrintContestMoves
};
static const u8 sMemoNatureTextColor[] = _("{COLOR LIGHT_RED}{SHADOW GREEN}");
static const u8 sMemoMiscTextColor[] = _("{COLOR WHITE}{SHADOW DARK_GRAY}"); // This is also affected by palettes, apparently
static const u8 sStatsLeftColumnLayout[] = _("{DYNAMIC 0}/{DYNAMIC 1}\n{DYNAMIC 2}\n{DYNAMIC 3}");
static const u8 sStatsRightColumnLayout[] = _("{DYNAMIC 0}\n{DYNAMIC 1}\n{DYNAMIC 2}");
static const u8 sMovesPPLayout[] = _("{PP}{DYNAMIC 0}/{DYNAMIC 1}");
#define TAG_MOVE_SELECTOR 30000
#define TAG_MON_STATUS 30001
#define TAG_MOVE_TYPES 30002
#define TAG_MON_MARKINGS 30003
static const struct OamData sOamData_MoveTypes =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_NORMAL,
.mosaic = FALSE,
.bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(32x16),
.x = 0,
.matrixNum = 0,
.size = SPRITE_SIZE(32x16),
.tileNum = 0,
.priority = 1,
.paletteNum = 0,
.affineParam = 0,
};
static const union AnimCmd sSpriteAnim_TypeNormal[] = {
ANIMCMD_FRAME(TYPE_NORMAL * 8, 0, FALSE, FALSE),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_TypeFighting[] = {
ANIMCMD_FRAME(TYPE_FIGHTING * 8, 0, FALSE, FALSE),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_TypeFlying[] = {
ANIMCMD_FRAME(TYPE_FLYING * 8, 0, FALSE, FALSE),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_TypePoison[] = {
ANIMCMD_FRAME(TYPE_POISON * 8, 0, FALSE, FALSE),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_TypeGround[] = {
ANIMCMD_FRAME(TYPE_GROUND * 8, 0, FALSE, FALSE),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_TypeRock[] = {
ANIMCMD_FRAME(TYPE_ROCK * 8, 0, FALSE, FALSE),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_TypeBug[] = {
ANIMCMD_FRAME(TYPE_BUG * 8, 0, FALSE, FALSE),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_TypeGhost[] = {
ANIMCMD_FRAME(TYPE_GHOST * 8, 0, FALSE, FALSE),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_TypeSteel[] = {
ANIMCMD_FRAME(TYPE_STEEL * 8, 0, FALSE, FALSE),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_TypeMystery[] = {
ANIMCMD_FRAME(TYPE_MYSTERY * 8, 0, FALSE, FALSE),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_TypeFire[] = {
ANIMCMD_FRAME(TYPE_FIRE * 8, 0, FALSE, FALSE),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_TypeWater[] = {
ANIMCMD_FRAME(TYPE_WATER * 8, 0, FALSE, FALSE),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_TypeGrass[] = {
ANIMCMD_FRAME(TYPE_GRASS * 8, 0, FALSE, FALSE),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_TypeElectric[] = {
ANIMCMD_FRAME(TYPE_ELECTRIC * 8, 0, FALSE, FALSE),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_TypePsychic[] = {
ANIMCMD_FRAME(TYPE_PSYCHIC * 8, 0, FALSE, FALSE),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_TypeIce[] = {
ANIMCMD_FRAME(TYPE_ICE * 8, 0, FALSE, FALSE),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_TypeDragon[] = {
ANIMCMD_FRAME(TYPE_DRAGON * 8, 0, FALSE, FALSE),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_TypeDark[] = {
ANIMCMD_FRAME(TYPE_DARK * 8, 0, FALSE, FALSE),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_CategoryCool[] = {
ANIMCMD_FRAME((CONTEST_CATEGORY_COOL + NUMBER_OF_MON_TYPES) * 8, 0, FALSE, FALSE),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_CategoryBeauty[] = {
ANIMCMD_FRAME((CONTEST_CATEGORY_BEAUTY + NUMBER_OF_MON_TYPES) * 8, 0, FALSE, FALSE),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_CategoryCute[] = {
ANIMCMD_FRAME((CONTEST_CATEGORY_CUTE + NUMBER_OF_MON_TYPES) * 8, 0, FALSE, FALSE),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_CategorySmart[] = {
ANIMCMD_FRAME((CONTEST_CATEGORY_SMART + NUMBER_OF_MON_TYPES) * 8, 0, FALSE, FALSE),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_CategoryTough[] = {
ANIMCMD_FRAME((CONTEST_CATEGORY_TOUGH + NUMBER_OF_MON_TYPES) * 8, 0, FALSE, FALSE),
ANIMCMD_END
};
static const union AnimCmd *const sSpriteAnimTable_MoveTypes[NUMBER_OF_MON_TYPES + CONTEST_CATEGORIES_COUNT] = {
sSpriteAnim_TypeNormal,
sSpriteAnim_TypeFighting,
sSpriteAnim_TypeFlying,
sSpriteAnim_TypePoison,
sSpriteAnim_TypeGround,
sSpriteAnim_TypeRock,
sSpriteAnim_TypeBug,
sSpriteAnim_TypeGhost,
sSpriteAnim_TypeSteel,
sSpriteAnim_TypeMystery,
sSpriteAnim_TypeFire,
sSpriteAnim_TypeWater,
sSpriteAnim_TypeGrass,
sSpriteAnim_TypeElectric,
sSpriteAnim_TypePsychic,
sSpriteAnim_TypeIce,
sSpriteAnim_TypeDragon,
sSpriteAnim_TypeDark,
sSpriteAnim_CategoryCool,
sSpriteAnim_CategoryBeauty,
sSpriteAnim_CategoryCute,
sSpriteAnim_CategorySmart,
sSpriteAnim_CategoryTough,
};
static const struct CompressedSpriteSheet sSpriteSheet_MoveTypes =
{
.data = gMoveTypes_Gfx,
.size = (NUMBER_OF_MON_TYPES + CONTEST_CATEGORIES_COUNT) * 0x100,
.tag = TAG_MOVE_TYPES
};
static const struct SpriteTemplate sSpriteTemplate_MoveTypes =
{
.tileTag = TAG_MOVE_TYPES,
.paletteTag = TAG_MOVE_TYPES,
.oam = &sOamData_MoveTypes,
.anims = sSpriteAnimTable_MoveTypes,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy
};
static const u8 sMoveTypeToOamPaletteNum[NUMBER_OF_MON_TYPES + CONTEST_CATEGORIES_COUNT] =
{
[TYPE_NORMAL] = 13,
[TYPE_FIGHTING] = 13,
[TYPE_FLYING] = 14,
[TYPE_POISON] = 14,
[TYPE_GROUND] = 13,
[TYPE_ROCK] = 13,
[TYPE_BUG] = 15,
[TYPE_GHOST] = 14,
[TYPE_STEEL] = 13,
[TYPE_MYSTERY] = 15,
[TYPE_FIRE] = 13,
[TYPE_WATER] = 14,
[TYPE_GRASS] = 15,
[TYPE_ELECTRIC] = 13,
[TYPE_PSYCHIC] = 14,
[TYPE_ICE] = 14,
[TYPE_DRAGON] = 15,
[TYPE_DARK] = 13,
[NUMBER_OF_MON_TYPES + CONTEST_CATEGORY_COOL] = 13,
[NUMBER_OF_MON_TYPES + CONTEST_CATEGORY_BEAUTY] = 14,
[NUMBER_OF_MON_TYPES + CONTEST_CATEGORY_CUTE] = 14,
[NUMBER_OF_MON_TYPES + CONTEST_CATEGORY_SMART] = 15,
[NUMBER_OF_MON_TYPES + CONTEST_CATEGORY_TOUGH] = 13,
};
static const struct OamData sOamData_MoveSelector =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_NORMAL,
.mosaic = FALSE,
.bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(16x16),
.x = 0,
.matrixNum = 0,
.size = SPRITE_SIZE(16x16),
.tileNum = 0,
.priority = 1,
.paletteNum = 0,
.affineParam = 0,
};
static const union AnimCmd sSpriteAnim_MoveSelector0[] = {
ANIMCMD_FRAME(0, 0, FALSE, FALSE),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_MoveSelector1[] = {
ANIMCMD_FRAME(4, 0, FALSE, FALSE),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_MoveSelector2[] = {
ANIMCMD_FRAME(8, 0, FALSE, FALSE),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_MoveSelector3[] = {
ANIMCMD_FRAME(12, 0, FALSE, FALSE),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_MoveSelectorLeft[] = {
ANIMCMD_FRAME(16, 0, FALSE, FALSE),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_MoveSelectorRight[] = {
ANIMCMD_FRAME(16, 0, TRUE, FALSE),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_MoveSelectorMiddle[] = {
ANIMCMD_FRAME(20, 0, FALSE, FALSE),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_MoveSelector7[] = {
ANIMCMD_FRAME(24, 0, FALSE, FALSE),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_MoveSelector8[] = {
ANIMCMD_FRAME(24, 0, TRUE, FALSE),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_MoveSelector9[] = {
ANIMCMD_FRAME(28, 0, FALSE, FALSE),
ANIMCMD_END
};
// All except left, middle and right are unused
static const union AnimCmd *const sSpriteAnimTable_MoveSelector[] = {
sSpriteAnim_MoveSelector0,
sSpriteAnim_MoveSelector1,
sSpriteAnim_MoveSelector2,
sSpriteAnim_MoveSelector3,
sSpriteAnim_MoveSelectorLeft,
sSpriteAnim_MoveSelectorRight,
sSpriteAnim_MoveSelectorMiddle,
sSpriteAnim_MoveSelector7,
sSpriteAnim_MoveSelector8,
sSpriteAnim_MoveSelector9,
};
static const struct CompressedSpriteSheet sMoveSelectorSpriteSheet =
{
.data = gSummaryMoveSelect_Gfx,
.size = 0x400,
.tag = TAG_MOVE_SELECTOR
};
static const struct CompressedSpritePalette sMoveSelectorSpritePal =
{
.data = gSummaryMoveSelect_Pal,
.tag = TAG_MOVE_SELECTOR
};
static const struct SpriteTemplate sMoveSelectorSpriteTemplate =
{
.tileTag = TAG_MOVE_SELECTOR,
.paletteTag = TAG_MOVE_SELECTOR,
.oam = &sOamData_MoveSelector,
.anims = sSpriteAnimTable_MoveSelector,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,