diff options
Diffstat (limited to 'src/main_menu.c')
-rw-r--r-- | src/main_menu.c | 142 |
1 files changed, 116 insertions, 26 deletions
diff --git a/src/main_menu.c b/src/main_menu.c index 052035e34..3d8d5acc2 100644 --- a/src/main_menu.c +++ b/src/main_menu.c @@ -1,7 +1,5 @@ - -// Includes #include "global.h" -#include "battle_dome_cards.h" +#include "trainer_pokemon_sprites.h" #include "bg.h" #include "constants/flags.h" #include "constants/rgb.h" @@ -133,29 +131,121 @@ const u8 gUnknown_082FEEF0[] = INCBIN_U8("graphics/birch_speech/map.bin.lz"); const u16 gUnknown_082FF018[] = INCBIN_U16("graphics/birch_speech/bg2.gbapal"); const u16 gUnknown_082FF028[] = {0, 0, 0, 0, 0, 0, 0, 0}; -const struct WindowTemplate sWindowTemplates_NoSavedGame[] = { - {0, 2, 1, 26, 2, 15, 1}, - {0, 2, 5, 26, 2, 15, 0x35} +const struct WindowTemplate sWindowTemplates_NoSavedGame[] = +{ + { + .priority = 0, + .tilemapLeft = 2, + .tilemapTop = 1, + .width = 26, + .height = 2, + .paletteNum = 15, + .baseBlock = 1 + }, + { + .priority = 0, + .tilemapLeft = 2, + .tilemapTop = 5, + .width = 26, + .height = 2, + .paletteNum = 15, + .baseBlock = 0x35 + } }; -const struct WindowTemplate sWindowTemplates_HasSavedGame[] = { - {0, 2, 1, 26, 6, 15, 1}, - {0, 2, 9, 26, 2, 15, 0x9D}, - {0, 2, 13, 26, 2, 15, 0xD1}, - {0, 2, 17, 26, 2, 15, 0x105}, - {0, 2, 21, 26, 2, 15, 0x139} +const struct WindowTemplate sWindowTemplates_HasSavedGame[] = +{ + { + .priority = 0, + .tilemapLeft = 2, + .tilemapTop = 1, + .width = 26, + .height = 6, + .paletteNum = 15, + .baseBlock = 1 + }, + { + .priority = 0, + .tilemapLeft = 2, + .tilemapTop = 9, + .width = 26, + .height = 2, + .paletteNum = 15, + .baseBlock = 0x9D + }, + { + .priority = 0, + .tilemapLeft = 2, + .tilemapTop = 13, + .width = 26, + .height = 2, + .paletteNum = 15, + .baseBlock = 0xD1 + }, + { + .priority = 0, + .tilemapLeft = 2, + .tilemapTop = 17, + .width = 26, + .height = 2, + .paletteNum = 15, + .baseBlock = 0x105 + }, + { + .priority = 0, + .tilemapLeft = 2, + .tilemapTop = 21, + .width = 26, + .height = 2, + .paletteNum = 15, + .baseBlock = 0x139 + } }; -const struct WindowTemplate sWindowTemplate_ErrorWindow[] = { - {0, 2, 15, 26, 4, 15, 0x16D}, - {0xFF, 0, 0, 0, 0, 0, 0} +const struct WindowTemplate sWindowTemplate_ErrorWindow[] = +{ + { + .priority = 0, + .tilemapLeft = 2, + .tilemapTop = 15, + .width = 26, + .height = 4, + .paletteNum = 15, + .baseBlock = 0x16D + }, + DUMMY_WIN_TEMPLATE }; -const struct WindowTemplate gUnknown_082FF080[] = { - {0, 2, 15, 27, 4, 15, 1}, - {0, 3, 5, 6, 4, 15, 0x6D}, - {0, 3, 2, 9, 10, 15, 0x85}, - {0xFF, 0, 0, 0, 0, 0, 0} +const struct WindowTemplate gUnknown_082FF080[] = +{ + { + .priority = 0, + .tilemapLeft = 2, + .tilemapTop = 15, + .width = 27, + .height = 4, + .paletteNum = 15, + .baseBlock = 1 + }, + { + .priority = 0, + .tilemapLeft = 3, + .tilemapTop = 5, + .width = 6, + .height = 4, + .paletteNum = 15, + .baseBlock = 0x6D + }, + { + .priority = 0, + .tilemapLeft = 3, + .tilemapTop = 2, + .width = 9, + .height = 10, + .paletteNum = 15, + .baseBlock = 0x85 + }, + DUMMY_WIN_TEMPLATE }; const u16 gMainMenuBgPal[] = INCBIN_U16("graphics/misc/main_menu_bg.gbapal"); @@ -1018,7 +1108,7 @@ void task_new_game_prof_birch_speech_1(u8 taskId) ScanlineEffect_Stop(); ResetSpriteData(); FreeAllSpritePalettes(); - dp13_810BB8C(); + ResetAllPicSprites(); AddBirchSpeechObjects(taskId); BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, 0); gTasks[taskId].data[4] = 0; @@ -1336,7 +1426,7 @@ void task_new_game_prof_birch_speech_17(u8 taskId) if (!gPaletteFade.active) { FreeAllWindowBuffers(); - sub_818D820(gTasks[taskId].data[9]); + FreeAndDestroyMonPicSprite(gTasks[taskId].data[9]); set_default_player_name(Random() % 20); DestroyTask(taskId); DoNamingScreen(0, gSaveBlock2Ptr->playerName, gSaveBlock2Ptr->playerGender, 0, 0, new_game_prof_birch_speech_part2_start); @@ -1515,8 +1605,8 @@ void task_new_game_prof_birch_speech_part2_12(u8 taskId) if (!gPaletteFade.active) { FreeAllWindowBuffers(); - sub_818D820(gTasks[taskId].data[9]); - dp13_810BB8C(); + FreeAndDestroyMonPicSprite(gTasks[taskId].data[9]); + ResetAllPicSprites(); SetMainCallback2(CB2_NewGame); DestroyTask(taskId); } @@ -1558,7 +1648,7 @@ void new_game_prof_birch_speech_part2_start(void) ScanlineEffect_Stop(); ResetSpriteData(); FreeAllSpritePalettes(); - dp13_810BB8C(); + ResetAllPicSprites(); AddBirchSpeechObjects(taskId); if (gSaveBlock2Ptr->playerGender != MALE) { @@ -1613,7 +1703,7 @@ void sub_80318D8(struct Sprite *sprite) u8 sub_80318F4(u8 a, u8 b) { - return sub_818D3E4(SPECIES_LOTAD, 8, 0, 1, a, b, 14, -1); + return CreatePicSprite2(SPECIES_LOTAD, 8, 0, 1, a, b, 14, -1); } void AddBirchSpeechObjects(u8 taskId) |