forked from pret/pokeemerald
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathpokedex.c
5707 lines (5254 loc) · 171 KB
/
pokedex.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_main.h"
#include "bg.h"
#include "data.h"
#include "decompress.h"
#include "event_data.h"
#include "gpu_regs.h"
#include "graphics.h"
#include "international_string_util.h"
#include "main.h"
#include "malloc.h"
#include "menu.h"
#include "m4a.h"
#include "overworld.h"
#include "palette.h"
#include "pokedex.h"
#include "pokedex_area_screen.h"
#include "pokedex_cry_screen.h"
#include "scanline_effect.h"
#include "sound.h"
#include "sprite.h"
#include "string_util.h"
#include "strings.h"
#include "task.h"
#include "text_window.h"
#include "trainer_pokemon_sprites.h"
#include "trig.h"
#include "window.h"
#include "constants/rgb.h"
#include "constants/songs.h"
#if EUROPE
#define WEIGHT_LEFT 0x90
#else //ENGLISH
#define WEIGHT_LEFT 0x81
#endif
enum
{
PAGE_MAIN,
PAGE_INFO,
PAGE_SEARCH,
PAGE_SEARCH_RESULTS,
PAGE_UNK,
PAGE_AREA,
PAGE_CRY,
PAGE_SIZE
};
enum
{
AREA_SCREEN,
CRY_SCREEN,
SIZE_SCREEN,
CANCEL_SCREEN,
SCREEN_COUNT
};
enum
{
SEARCH_NAME,
SEARCH_COLOR,
SEARCH_TYPE_LEFT,
SEARCH_TYPE_RIGHT,
SEARCH_ORDER,
SEARCH_MODE,
SEARCH_OK,
SEARCH_COUNT
};
enum
{
SEARCH_TOPBAR_SEARCH,
SEARCH_TOPBAR_SHIFT,
SEARCH_TOPBAR_CANCEL,
SEARCH_TOPBAR_COUNT
};
enum
{
ORDER_NUMERICAL,
ORDER_ALPHABETICAL,
ORDER_HEAVIEST,
ORDER_LIGHTEST,
ORDER_TALLEST,
ORDER_SMALLEST
};
enum
{
NAME_ABC = 1,
NAME_DEF,
NAME_GHI,
NAME_JKL,
NAME_MNO,
NAME_PQR,
NAME_STU,
NAME_VWX,
NAME_YZ,
};
enum {
WIN_INFO,
WIN_FOOTPRINT,
WIN_CRY_WAVE,
WIN_VU_METER,
};
// For scrolling search parameter
#define MAX_SEARCH_PARAM_ON_SCREEN 6
#define MAX_SEARCH_PARAM_CURSOR_POS (MAX_SEARCH_PARAM_ON_SCREEN - 1)
#define MAX_MONS_ON_SCREEN 4
#define LIST_SCROLL_STEP 16
#define POKEBALL_ROTATION_TOP 64
#define POKEBALL_ROTATION_BOTTOM (POKEBALL_ROTATION_TOP - 16)
// Coordinates of the Pokémon sprite on its page (info/cry screens)
#define MON_PAGE_X 48
#define MON_PAGE_Y 56
static EWRAM_DATA struct PokedexView *sPokedexView = NULL;
static EWRAM_DATA u16 sLastSelectedPokemon = 0;
static EWRAM_DATA u8 sPokeBallRotation = 0;
static EWRAM_DATA struct PokedexListItem *sPokedexListItem = NULL;
// This is written to, but never read.
COMMON_DATA u8 gUnusedPokedexU8 = 0;
COMMON_DATA void (*gPokedexVBlankCB)(void) = NULL;
struct SearchOptionText
{
const u8 *description;
const u8 *title;
};
struct SearchOption
{
const struct SearchOptionText *texts;
u8 taskDataCursorPos;
u8 taskDataScrollOffset;
u16 numOptions;
};
struct SearchMenuTopBarItem
{
const u8 *description;
u8 highlightX;
u8 highlightY;
u8 highlightWidth;
};
struct SearchMenuItem
{
const u8 *description;
u8 titleBgX;
u8 titleBgY;
u8 titleBgWidth;
u8 selectionBgX;
u8 selectionBgY;
u8 selectionBgWidth;
};
struct PokedexListItem
{
u16 dexNum;
u16 seen:1;
u16 owned:1;
};
struct PokedexView
{
struct PokedexListItem pokedexList[NATIONAL_DEX_COUNT + 1];
u16 pokemonListCount;
u16 selectedPokemon;
u16 selectedPokemonBackup;
u16 dexMode;
u16 dexModeBackup;
u16 dexOrder;
u16 dexOrderBackup;
u16 seenCount;
u16 ownCount;
u16 monSpriteIds[MAX_MONS_ON_SCREEN];
u16 selectedMonSpriteId;
u16 pokeBallRotationStep;
u16 pokeBallRotationBackup;
u8 pokeBallRotation;
u8 initialVOffset;
u8 scrollTimer;
u8 scrollDirection;
s16 listVOffset;
s16 listMovingVOffset;
u16 scrollMonIncrement;
u16 maxScrollTimer;
u16 scrollSpeed;
u16 unkArr1[4]; // Cleared, never read
u8 filler[8];
u8 currentPage;
u8 currentPageBackup;
bool8 isSearchResults:1;
u8 selectedScreen;
u8 screenSwitchState;
u8 menuIsOpen;
u16 menuCursorPos;
s16 menuY; //Menu Y position (inverted because we use REG_BG0VOFS for this)
u8 unkArr2[8]; // Cleared, never read
u8 unkArr3[8]; // Cleared, never read
};
// this file's functions
static void CB2_Pokedex(void);
static void Task_OpenPokedexMainPage(u8);
static void Task_HandlePokedexInput(u8);
static void Task_WaitForScroll(u8);
static void Task_HandlePokedexStartMenuInput(u8);
static void Task_OpenInfoScreenAfterMonMovement(u8);
static void Task_WaitForExitInfoScreen(u8);
static void Task_WaitForExitSearch(u8);
static void Task_ClosePokedex(u8);
static void Task_OpenSearchResults(u8);
static void Task_HandleSearchResultsInput(u8);
static void Task_WaitForSearchResultsScroll(u8);
static void Task_HandleSearchResultsStartMenuInput(u8);
static void Task_OpenSearchResultsInfoScreenAfterMonMovement(u8);
static void Task_WaitForExitSearchResultsInfoScreen(u8);
static void Task_ReturnToPokedexFromSearchResults(u8);
static void Task_ClosePokedexFromSearchResultsStartMenu(u8);
static bool8 LoadPokedexListPage(u8);
static void LoadPokedexBgPalette(bool8);
static void FreeWindowAndBgBuffers(void);
static void CreatePokedexList(u8, u8);
static void CreateMonDexNum(u16, u8, u8, u16);
static void CreateCaughtBall(u16, u8, u8, u16);
static u8 CreateMonName(u16, u8, u8);
static void ClearMonListEntry(u8 x, u8 y, u16 unused);
static void CreateMonSpritesAtPos(u16, u16);
static bool8 UpdateDexListScroll(u8, u8, u8);
static u16 TryDoPokedexScroll(u16, u16);
static void UpdateSelectedMonSpriteId(void);
static bool8 TryDoInfoScreenScroll(void);
static u8 ClearMonSprites(void);
static u16 GetPokemonSpriteToDisplay(u16);
static u32 CreatePokedexMonSprite(u16, s16, s16);
static void CreateInterfaceSprites(u8);
static void SpriteCB_MoveMonForInfoScreen(struct Sprite *sprite);
static void SpriteCB_Scrollbar(struct Sprite *sprite);
static void SpriteCB_ScrollArrow(struct Sprite *sprite);
static void SpriteCB_DexListInterfaceText(struct Sprite *sprite);
static void SpriteCB_RotatingPokeBall(struct Sprite *sprite);
static void SpriteCB_SeenOwnInfo(struct Sprite *sprite);
static void SpriteCB_DexListStartMenuCursor(struct Sprite *sprite);
static void SpriteCB_PokedexListMonSprite(struct Sprite *sprite);
static u8 LoadInfoScreen(struct PokedexListItem *, u8 monSpriteId);
static bool8 IsInfoScreenScrolling(u8);
static u8 StartInfoScreenScroll(struct PokedexListItem *, u8);
static void Task_LoadInfoScreen(u8);
static void Task_HandleInfoScreenInput(u8);
static void Task_SwitchScreensFromInfoScreen(u8);
static void Task_LoadInfoScreenWaitForFade(u8);
static void Task_ExitInfoScreen(u8);
static void Task_LoadAreaScreen(u8);
static void Task_WaitForAreaScreenInput(u8 taskId);
static void Task_SwitchScreensFromAreaScreen(u8);
static void Task_LoadCryScreen(u8);
static void Task_HandleCryScreenInput(u8);
static void Task_SwitchScreensFromCryScreen(u8);
static void LoadPlayArrowPalette(bool8);
static void Task_LoadSizeScreen(u8);
static void Task_HandleSizeScreenInput(u8);
static void Task_SwitchScreensFromSizeScreen(u8);
static void LoadScreenSelectBarMain(u16);
static void LoadScreenSelectBarSubmenu(u16);
static void HighlightScreenSelectBarItem(u8, u16);
static void HighlightSubmenuScreenSelectBarItem(u8, u16);
static void Task_DisplayCaughtMonDexPage(u8);
static void Task_HandleCaughtMonPageInput(u8);
static void Task_ExitCaughtMonPage(u8);
static void SpriteCB_SlideCaughtMonToCenter(struct Sprite *sprite);
static void PrintMonInfo(u32 num, u32, u32 owned, u32 newEntry);
static void PrintMonHeight(u16 height, u8 left, u8 top);
static void PrintMonWeight(u16 weight, u8 left, u8 top);
static void ResetOtherVideoRegisters(u16);
static u8 PrintCryScreenSpeciesName(u8, u16, u8, u8);
static void PrintDecimalNum(u8 windowId, u16 num, u8 left, u8 top);
static void DrawFootprint(u8 windowId, u16 dexNum);
static u16 CreateSizeScreenTrainerPic(u16, s16, s16, s8);
static u16 GetNextPosition(u8, u16, u16, u16);
static u8 LoadSearchMenu(void);
static void Task_LoadSearchMenu(u8);
static void Task_SwitchToSearchMenuTopBar(u8);
static void Task_HandleSearchTopBarInput(u8);
static void Task_SwitchToSearchMenu(u8);
static void Task_HandleSearchMenuInput(u8);
static void Task_StartPokedexSearch(u8);
static void Task_WaitAndCompleteSearch(u8);
static void Task_SearchCompleteWaitForInput(u8);
static void Task_SelectSearchMenuItem(u8);
static void Task_HandleSearchParameterInput(u8);
static void Task_ExitSearch(u8);
static void Task_ExitSearchWaitForFade(u8);
static void HighlightSelectedSearchTopBarItem(u8);
static void HighlightSelectedSearchMenuItem(u8, u8);
static void PrintSelectedSearchParameters(u8);
static void DrawOrEraseSearchParameterBox(bool8);
static void PrintSearchParameterText(u8);
static u8 GetSearchModeSelection(u8 taskId, u8 option);
static void SetDefaultSearchModeAndOrder(u8);
static void CreateSearchParameterScrollArrows(u8);
static void EraseAndPrintSearchTextBox(const u8 *);
static void EraseSelectorArrow(u32);
static void PrintSelectorArrow(u32);
static void PrintSearchParameterTitle(u32, const u8 *);
static void ClearSearchParameterBoxText(void);
// const rom data
#include "data/pokemon/pokedex_orders.h"
static const struct OamData sOamData_ScrollBar =
{
.y = DISPLAY_HEIGHT,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_NORMAL,
.mosaic = FALSE,
.bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(8x8),
.x = 0,
.matrixNum = 0,
.size = SPRITE_SIZE(8x8),
.tileNum = 0,
.priority = 1,
.paletteNum = 0,
.affineParam = 0
};
static const struct OamData sOamData_ScrollArrow =
{
.y = DISPLAY_HEIGHT,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_NORMAL,
.mosaic = FALSE,
.bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(16x8),
.x = 0,
.matrixNum = 0,
.size = SPRITE_SIZE(16x8),
.tileNum = 0,
.priority = 0,
.paletteNum = 0,
.affineParam = 0
};
static const struct OamData sOamData_InterfaceText =
{
.y = DISPLAY_HEIGHT,
.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 = 0,
.paletteNum = 0,
.affineParam = 0
};
static const struct OamData sOamData_RotatingPokeBall =
{
.y = DISPLAY_HEIGHT,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_WINDOW,
.mosaic = FALSE,
.bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(32x32),
.x = 0,
.matrixNum = 0,
.size = SPRITE_SIZE(32x32),
.tileNum = 0,
.priority = 1,
.paletteNum = 0,
.affineParam = 0
};
static const struct OamData sOamData_SeenOwnText =
{
.y = DISPLAY_HEIGHT,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_NORMAL,
.mosaic = FALSE,
.bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(64x32),
.x = 0,
.matrixNum = 0,
.size = SPRITE_SIZE(64x32),
.tileNum = 0,
.priority = 0,
.paletteNum = 0,
.affineParam = 0
};
static const struct OamData sOamData_Dex8x16 =
{
.y = DISPLAY_HEIGHT,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_NORMAL,
.mosaic = FALSE,
.bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(8x16),
.x = 0,
.matrixNum = 0,
.size = SPRITE_SIZE(8x16),
.tileNum = 0,
.priority = 0,
.paletteNum = 0,
.affineParam = 0
};
static const union AnimCmd sSpriteAnim_ScrollBar[] =
{
ANIMCMD_FRAME(3, 30),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_ScrollArrow[] =
{
ANIMCMD_FRAME(1, 30),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_RotatingPokeBall[] =
{
ANIMCMD_FRAME(16, 30),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_StartButton[] =
{
ANIMCMD_FRAME(48, 30),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_SearchText[] =
{
ANIMCMD_FRAME(40, 30),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_SelectButton[] =
{
ANIMCMD_FRAME(32, 30),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_MenuText[] =
{
ANIMCMD_FRAME(56, 30),
ANIMCMD_END
};
#if FRENCH
static const union AnimCmd sSpriteAnim_Unused[] =
{
ANIMCMD_FRAME(200, 30),
ANIMCMD_END
};
#endif
static const union AnimCmd sSpriteAnim_SeenText[] =
{
ANIMCMD_FRAME(64, 30),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_OwnText[] =
{
ANIMCMD_FRAME(96, 30),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_HoennText[] =
{
ANIMCMD_FRAME(160, 30),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_NationalText[] =
{
ANIMCMD_FRAME(168, 30),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_HoennSeenOwnDigit0[] =
{
ANIMCMD_FRAME(128, 30),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_HoennSeenOwnDigit1[] =
{
ANIMCMD_FRAME(130, 30),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_HoennSeenOwnDigit2[] =
{
ANIMCMD_FRAME(132, 30),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_HoennSeenOwnDigit3[] =
{
ANIMCMD_FRAME(134, 30),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_HoennSeenOwnDigit4[] =
{
ANIMCMD_FRAME(136, 30),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_HoennSeenOwnDigit5[] =
{
ANIMCMD_FRAME(138, 30),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_HoennSeenOwnDigit6[] =
{
ANIMCMD_FRAME(140, 30),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_HoennSeenOwnDigit7[] =
{
ANIMCMD_FRAME(142, 30),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_HoennSeenOwnDigit8[] =
{
ANIMCMD_FRAME(144, 30),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_HoennSeenOwnDigit9[] =
{
ANIMCMD_FRAME(146, 30),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_NationalSeenOwnDigit0[] =
{
ANIMCMD_FRAME(176, 30),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_NationalSeenOwnDigit1[] =
{
ANIMCMD_FRAME(178, 30),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_NationalSeenOwnDigit2[] =
{
ANIMCMD_FRAME(180, 30),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_NationalSeenOwnDigit3[] =
{
ANIMCMD_FRAME(182, 30),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_NationalSeenOwnDigit4[] =
{
ANIMCMD_FRAME(184, 30),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_NationalSeenOwnDigit5[] =
{
ANIMCMD_FRAME(186, 30),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_NationalSeenOwnDigit6[] =
{
ANIMCMD_FRAME(188, 30),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_NationalSeenOwnDigit7[] =
{
ANIMCMD_FRAME(190, 30),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_NationalSeenOwnDigit8[] =
{
ANIMCMD_FRAME(192, 30),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_NationalSeenOwnDigit9[] =
{
ANIMCMD_FRAME(194, 30),
ANIMCMD_END
};
static const union AnimCmd sSpriteAnim_DexListStartMenuCursor[] =
{
ANIMCMD_FRAME(4, 30),
ANIMCMD_END
};
static const union AnimCmd *const sSpriteAnimTable_ScrollBar[] =
{
sSpriteAnim_ScrollBar
};
static const union AnimCmd *const sSpriteAnimTable_ScrollArrow[] =
{
sSpriteAnim_ScrollArrow
};
static const union AnimCmd *const sSpriteAnimTable_RotatingPokeBall[] =
{
sSpriteAnim_RotatingPokeBall
};
static const union AnimCmd *const sSpriteAnimTable_InterfaceText[] =
{
sSpriteAnim_StartButton,
sSpriteAnim_SearchText,
sSpriteAnim_SelectButton,
sSpriteAnim_MenuText
};
#if FRENCH
static const union AnimCmd *const sSpriteAnimTable_Unused[] =
{
sSpriteAnim_Unused
};
#endif
static const union AnimCmd *const sSpriteAnimTable_SeenOwnText[] =
{
sSpriteAnim_SeenText,
sSpriteAnim_OwnText
};
static const union AnimCmd *const sSpriteAnimTable_HoennNationalText[] =
{
sSpriteAnim_HoennText,
sSpriteAnim_NationalText
};
static const union AnimCmd *const sSpriteAnimTable_HoennSeenOwnNumber[] =
{
sSpriteAnim_HoennSeenOwnDigit0,
sSpriteAnim_HoennSeenOwnDigit1,
sSpriteAnim_HoennSeenOwnDigit2,
sSpriteAnim_HoennSeenOwnDigit3,
sSpriteAnim_HoennSeenOwnDigit4,
sSpriteAnim_HoennSeenOwnDigit5,
sSpriteAnim_HoennSeenOwnDigit6,
sSpriteAnim_HoennSeenOwnDigit7,
sSpriteAnim_HoennSeenOwnDigit8,
sSpriteAnim_HoennSeenOwnDigit9
};
static const union AnimCmd *const sSpriteAnimTable_NationalSeenOwnNumber[] =
{
sSpriteAnim_NationalSeenOwnDigit0,
sSpriteAnim_NationalSeenOwnDigit1,
sSpriteAnim_NationalSeenOwnDigit2,
sSpriteAnim_NationalSeenOwnDigit3,
sSpriteAnim_NationalSeenOwnDigit4,
sSpriteAnim_NationalSeenOwnDigit5,
sSpriteAnim_NationalSeenOwnDigit6,
sSpriteAnim_NationalSeenOwnDigit7,
sSpriteAnim_NationalSeenOwnDigit8,
sSpriteAnim_NationalSeenOwnDigit9
};
static const union AnimCmd *const sSpriteAnimTable_DexListStartMenuCursor[] =
{
sSpriteAnim_DexListStartMenuCursor
};
#define TAG_DEX_INTERFACE 4096 // Tile and pal tag used for all interface sprites.
static const struct SpriteTemplate sScrollBarSpriteTemplate =
{
.tileTag = TAG_DEX_INTERFACE,
.paletteTag = TAG_DEX_INTERFACE,
.oam = &sOamData_ScrollBar,
.anims = sSpriteAnimTable_ScrollBar,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCB_Scrollbar,
};
static const struct SpriteTemplate sScrollArrowSpriteTemplate =
{
.tileTag = TAG_DEX_INTERFACE,
.paletteTag = TAG_DEX_INTERFACE,
.oam = &sOamData_ScrollArrow,
.anims = sSpriteAnimTable_ScrollArrow,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCB_ScrollArrow,
};
static const struct SpriteTemplate sInterfaceTextSpriteTemplate =
{
.tileTag = TAG_DEX_INTERFACE,
.paletteTag = TAG_DEX_INTERFACE,
.oam = &sOamData_InterfaceText,
.anims = sSpriteAnimTable_InterfaceText,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCB_DexListInterfaceText,
};
static const struct SpriteTemplate sRotatingPokeBallSpriteTemplate =
{
.tileTag = TAG_DEX_INTERFACE,
.paletteTag = TAG_DEX_INTERFACE,
.oam = &sOamData_RotatingPokeBall,
.anims = sSpriteAnimTable_RotatingPokeBall,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCB_RotatingPokeBall,
};
static const struct SpriteTemplate sSeenOwnTextSpriteTemplate =
{
.tileTag = TAG_DEX_INTERFACE,
.paletteTag = TAG_DEX_INTERFACE,
.oam = &sOamData_SeenOwnText,
.anims = sSpriteAnimTable_SeenOwnText,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCB_SeenOwnInfo,
};
static const struct SpriteTemplate sHoennNationalTextSpriteTemplate =
{
.tileTag = TAG_DEX_INTERFACE,
.paletteTag = TAG_DEX_INTERFACE,
.oam = &sOamData_InterfaceText,
.anims = sSpriteAnimTable_HoennNationalText,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCB_SeenOwnInfo,
};
static const struct SpriteTemplate sHoennDexSeenOwnNumberSpriteTemplate =
{
.tileTag = TAG_DEX_INTERFACE,
.paletteTag = TAG_DEX_INTERFACE,
.oam = &sOamData_Dex8x16,
.anims = sSpriteAnimTable_HoennSeenOwnNumber,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCB_SeenOwnInfo,
};
static const struct SpriteTemplate sNationalDexSeenOwnNumberSpriteTemplate =
{
.tileTag = TAG_DEX_INTERFACE,
.paletteTag = TAG_DEX_INTERFACE,
.oam = &sOamData_Dex8x16,
.anims = sSpriteAnimTable_NationalSeenOwnNumber,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCB_SeenOwnInfo,
};
static const struct SpriteTemplate sDexListStartMenuCursorSpriteTemplate =
{
.tileTag = TAG_DEX_INTERFACE,
.paletteTag = TAG_DEX_INTERFACE,
.oam = &sOamData_Dex8x16,
.anims = sSpriteAnimTable_DexListStartMenuCursor,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCB_DexListStartMenuCursor,
};
static const struct CompressedSpriteSheet sInterfaceSpriteSheet[] =
{
{gPokedexInterface_Gfx, 0x2000, TAG_DEX_INTERFACE},
{0}
};
static const struct SpritePalette sInterfaceSpritePalette[] =
{
{gPokedexBgHoenn_Pal, TAG_DEX_INTERFACE},
{0}
};
// By scroll speed. Last element of each unused
static const u8 sScrollMonIncrements[] = {4, 8, 16, 32, 32};
static const u8 sScrollTimers[] = {8, 4, 2, 1, 1};
static const struct BgTemplate sPokedex_BgTemplate[] =
{
{
.bg = 0,
.charBaseIndex = 0,
.mapBaseIndex = 12,
.screenSize = 0,
.paletteMode = 0,
.priority = 0,
.baseTile = 0
},
{
.bg = 1,
.charBaseIndex = 0,
.mapBaseIndex = 13,
.screenSize = 0,
.paletteMode = 0,
.priority = 1,
.baseTile = 0
},
{
.bg = 2,
.charBaseIndex = 2,
.mapBaseIndex = 14,
.screenSize = 0,
.paletteMode = 0,
.priority = 2,
.baseTile = 0
},
{
.bg = 3,
.charBaseIndex = 0,
.mapBaseIndex = 15,
.screenSize = 0,
.paletteMode = 0,
.priority = 3,
.baseTile = 0
}
};
static const struct WindowTemplate sPokemonList_WindowTemplate[] =
{
{
.bg = 2,
.tilemapLeft = 0,
.tilemapTop = 0,
.width = 32,
.height = 32,
.paletteNum = 0,
.baseBlock = 1,
},
DUMMY_WIN_TEMPLATE
};
static const u8 sText_No000[] = _("{NO}000");
static const u8 sCaughtBall_Gfx[] = INCBIN_U8("graphics/pokedex/caught_ball.4bpp");
static const u8 sText_TenDashes[] = _("----------");
ALIGNED(4) static const u8 sExpandedPlaceholder_PokedexDescription[] = _("");
#if FRENCH
#include "data/pokemon/french/pokedex_text.h"
#elif ITALIAN
#include "data/pokemon/italian/pokedex_text.h"
#elif SPANISH
#include "data/pokemon/spanish/pokedex_text.h"
#else //ENGLISH
#include "data/pokemon/pokedex_text.h"
#endif
#include "data/pokemon/pokedex_entries.h"
static const u16 sSizeScreenSilhouette_Pal[] = INCBIN_U16("graphics/pokedex/size_silhouette.gbapal");
static const struct BgTemplate sInfoScreen_BgTemplate[] =
{
{
.bg = 0,
.charBaseIndex = 2,
.mapBaseIndex = 12,
.screenSize = 0,
.paletteMode = 0,
.priority = 3,
.baseTile = 0
},
{
.bg = 1,
.charBaseIndex = 0,
.mapBaseIndex = 13,
.screenSize = 0,
.paletteMode = 0,
.priority = 0,
.baseTile = 0
},
{
.bg = 2,
.charBaseIndex = 2,
.mapBaseIndex = 14,
.screenSize = 0,
.paletteMode = 0,
.priority = 1,
.baseTile = 0
},
{
.bg = 3,
.charBaseIndex = 0,
.mapBaseIndex = 15,
.screenSize = 0,
.paletteMode = 0,
.priority = 2,
.baseTile = 0
}
};
static const struct WindowTemplate sInfoScreen_WindowTemplates[] =
{
[WIN_INFO] =
{
.bg = 2,
.tilemapLeft = 0,
.tilemapTop = 0,
.width = 32,
.height = 20,
.paletteNum = 0,
.baseBlock = 1,
},
[WIN_FOOTPRINT] =
{
.bg = 2,
.tilemapLeft = 25,
.tilemapTop = 8,
.width = 2,
.height = 2,
.paletteNum = 15,
.baseBlock = 641,
},
[WIN_CRY_WAVE] =
{
.bg = 0,
.tilemapLeft = 0,
.tilemapTop = 12,
.width = 32,
.height = 7,
.paletteNum = 8,
.baseBlock = 645,
},
[WIN_VU_METER] =
{
.bg = 2,
.tilemapLeft = 18,
.tilemapTop = 3,
.width = 10,
.height = 8,
.paletteNum = 9,
.baseBlock = 869,
},
DUMMY_WIN_TEMPLATE
};
static const struct BgTemplate sNewEntryInfoScreen_BgTemplate[] =
{
{
.bg = 2,
.charBaseIndex = 2,
.mapBaseIndex = 14,
.screenSize = 0,
.paletteMode = 0,
.priority = 2,
.baseTile = 0
},
{
.bg = 3,
.charBaseIndex = 1,
.mapBaseIndex = 15,
.screenSize = 0,
.paletteMode = 0,
.priority = 3,
.baseTile = 0
},
};
static const struct WindowTemplate sNewEntryInfoScreen_WindowTemplates[] =
{
[WIN_INFO] =
{
.bg = 2,
.tilemapLeft = 0,
.tilemapTop = 0,