diff --git a/graphics/battle_frontier/factory_menu1.png b/graphics/battle_frontier/factory_menu1.png deleted file mode 100644 index 52f073ff3081..000000000000 Binary files a/graphics/battle_frontier/factory_menu1.png and /dev/null differ diff --git a/graphics/battle_frontier/factory_menu2.png b/graphics/battle_frontier/factory_menu2.png deleted file mode 100644 index 0d103927e439..000000000000 Binary files a/graphics/battle_frontier/factory_menu2.png and /dev/null differ diff --git a/graphics/battle_frontier/factory_menu.bin b/graphics/battle_frontier/factory_screen/menu.bin similarity index 100% rename from graphics/battle_frontier/factory_menu.bin rename to graphics/battle_frontier/factory_screen/menu.bin diff --git a/graphics/battle_frontier/factory_screen/menu.png b/graphics/battle_frontier/factory_screen/menu.png new file mode 100644 index 000000000000..5271973b3109 Binary files /dev/null and b/graphics/battle_frontier/factory_screen/menu.png differ diff --git a/graphics/battle_frontier/tourney.pal b/graphics/battle_frontier/tourney.pal deleted file mode 100644 index eec4c7d71ada..000000000000 --- a/graphics/battle_frontier/tourney.pal +++ /dev/null @@ -1,259 +0,0 @@ -JASC-PAL -0100 -256 -0 0 0 -255 172 65 -255 255 131 -222 213 180 -255 255 255 -230 222 222 -197 197 197 -213 57 49 -230 230 213 -255 246 205 -255 82 49 -164 24 0 -0 0 0 -106 106 106 -0 0 0 -0 0 0 -0 0 0 -90 172 131 -106 156 123 -123 222 139 -246 255 255 -0 0 0 -246 255 246 -0 0 0 -0 0 0 -0 0 0 -230 238 246 -222 255 238 -189 238 197 -123 123 123 -115 197 156 -0 0 0 -0 0 0 -197 205 230 -32 115 139 -255 255 255 -222 238 222 -0 0 0 -131 197 139 -0 0 0 -139 156 197 -115 139 189 -0 90 82 -106 164 139 -57 115 90 -189 222 197 -0 0 0 -0 0 0 -0 0 0 -205 205 246 -230 238 230 -213 213 255 -156 156 222 -238 238 255 -189 189 238 -230 230 255 -222 222 255 -197 197 246 -189 189 238 -180 180 230 -172 172 230 -164 164 222 -156 156 222 -0 0 0 -0 0 0 -131 148 180 -213 230 246 -189 189 222 -90 98 115 -230 238 255 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -197 238 222 -255 205 205 -205 222 255 -222 255 255 -246 230 164 -0 0 0 -189 246 180 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -255 255 255 -0 0 0 -0 255 0 -164 180 180 -255 74 0 -246 255 246 -246 255 255 -0 0 0 -246 255 246 -0 0 0 -0 0 0 -0 0 0 -230 238 246 -0 0 0 -189 238 197 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -255 213 106 -255 74 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -246 255 255 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 diff --git a/graphics/battle_frontier/tourney_tree.png b/graphics/battle_frontier/tourney_tree.png index f60dd49d36b7..4dc8cecc13e0 100644 Binary files a/graphics/battle_frontier/tourney_tree.png and b/graphics/battle_frontier/tourney_tree.png differ diff --git a/include/constants/trainer_hill.h b/include/constants/trainer_hill.h index e0f660b6f004..610cb81c68db 100644 --- a/include/constants/trainer_hill.h +++ b/include/constants/trainer_hill.h @@ -55,7 +55,7 @@ #define TRAINER_HILL_OTID 0x10000000 // The full map of each Trainer Hill floor is 16x21. -// The first 5x21 at the top is the entrance/exit area, +// The first 16x5 at the top is the entrance/exit area, // and the remaining 16x16 is the randomized portion of // the room where the trainers are. #define HILL_FLOOR_WIDTH 16 diff --git a/include/graphics.h b/include/graphics.h index 2bfdc55372c4..9e3cf4148de1 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -5018,9 +5018,9 @@ extern const u32 gPokenavOptions_Gfx[]; extern const u16 gPokenavOptions_Pal[]; // Battle Factory Screen -extern const u16 gFrontierFactorySelectMenu_Gfx[]; -extern const u16 gFrontierFactorySelectMenu_Tilemap[]; -extern const u16 gFrontierFactorySelectMenu_Pal[]; +extern const u16 gFrontierFactoryMenu_Gfx[34 * TILE_SIZE_4BPP / 2]; +extern const u16 gFrontierFactoryMenu_Tilemap[]; +extern const u16 gFrontierFactoryMenu_Pal[]; // Object event pals extern const u16 gObjectEventPal_Brendan[]; diff --git a/include/script_menu.h b/include/script_menu.h index 36b66bf987be..734c717cff0f 100644 --- a/include/script_menu.h +++ b/include/script_menu.h @@ -1,6 +1,8 @@ #ifndef GUARD_SCRIPT_MENU_H #define GUARD_SCRIPT_MENU_H +#include "constants/script_menu.h" + extern const u8 *const gStdStrings[]; bool8 ScriptMenu_Multichoice(u8 left, u8 top, u8 multichoiceId, bool8 ignoreBPress); diff --git a/src/apprentice.c b/src/apprentice.c index 89017de33ab6..9ce5ec0dc214 100644 --- a/src/apprentice.c +++ b/src/apprentice.c @@ -346,11 +346,10 @@ static u16 GetRandomAlternateMove(u8 monId) learnset = gLevelUpLearnsets[species]; j = 0; - // Despite being open level, level up moves are only read up to level 60 if (PLAYER_APPRENTICE.lvlMode == APPRENTICE_LVL_MODE_50) - level = 50; + level = FRONTIER_MAX_LEVEL_50; else // == APPRENTICE_LVL_MODE_OPEN - level = 60; + level = 60; // Despite being open level, level up moves are only read up to level 60 for (j = 0; learnset[j] != LEVEL_UP_END; j++) { @@ -464,7 +463,7 @@ static void GetLatestLearnedMoves(u16 species, u16 *moves) const u16 *learnset; if (PLAYER_APPRENTICE.lvlMode == APPRENTICE_LVL_MODE_50) - level = 50; + level = FRONTIER_MAX_LEVEL_50; else // == APPRENTICE_LVL_MODE_OPEN level = 60; @@ -666,11 +665,12 @@ static void Task_ChooseAnswer(u8 taskId) case MENU_NOTHING_CHOSEN: return; case MENU_B_PRESSED: + // Only ever true. Answering Apprentice questions is required. if (tNoBButton) return; PlaySE(SE_SELECT); - gSpecialVar_Result = 0x7F; + gSpecialVar_Result = MULTI_B_PRESSED; break; default: gSpecialVar_Result = input; diff --git a/src/battle_dome.c b/src/battle_dome.c index 32a43c3d94f8..ffb7fa5bb3b9 100644 --- a/src/battle_dome.c +++ b/src/battle_dome.c @@ -40,6 +40,8 @@ #include "constants/battle_frontier.h" #include "constants/rgb.h" +#define TAG_BUTTONS 0 + // Enough space to hold 2 match info cards worth of trainers and their parties #define NUM_INFOCARD_SPRITES ((FRONTIER_PARTY_SIZE + 1) * 4) #define NUM_INFOCARD_TRAINERS 2 @@ -56,7 +58,7 @@ struct TourneyTreeLineSection { u8 x; u8 y; - u16 src; + u16 tile; }; #define DOME_TRAINERS gSaveBlock2Ptr->frontier.domeTrainers @@ -904,14 +906,14 @@ static const struct ScanlineEffectParams sTourneyTreeScanlineEffectParams = static const struct CompressedSpriteSheet sTourneyTreeButtonsSpriteSheet[] = { - {gDomeTourneyTreeButtons_Gfx, 0x0600, 0x0000}, + {.data = gDomeTourneyTreeButtons_Gfx, .size = 0x0600, .tag = TAG_BUTTONS}, {}, }; // Unused static const struct CompressedSpritePalette sTourneyTreeButtonsSpritePal[] = { - {gDomeTourneyTreeButtons_Pal, 0x0000}, + {.data = gDomeTourneyTreeButtons_Pal, .tag = TAG_BUTTONS}, {}, }; @@ -1004,7 +1006,7 @@ static const union AnimCmd * const sSpriteAnimTable_TourneyTreePokeball[] = // Sprite template for the pokeballs on the tourney tree that act as buttons to view a trainer/match info card static const struct SpriteTemplate sTourneyTreePokeballSpriteTemplate = { - .tileTag = 0x0000, + .tileTag = TAG_BUTTONS, .paletteTag = TAG_NONE, .oam = &sOamData_TourneyTreePokeball, .anims = sSpriteAnimTable_TourneyTreePokeball, @@ -1033,7 +1035,7 @@ static const union AnimCmd * const sSpriteAnimTable_TourneyTreeCancelButton[] = static const struct SpriteTemplate sCancelButtonSpriteTemplate = { - .tileTag = 0x0000, + .tileTag = TAG_BUTTONS, .paletteTag = TAG_NONE, .oam = &sOamData_TourneyTreeCloseButton, .anims = sSpriteAnimTable_TourneyTreeCancelButton, @@ -1062,7 +1064,7 @@ static const union AnimCmd * const sSpriteAnimTable_TourneyTreeExitButton[] = static const struct SpriteTemplate sExitButtonSpriteTemplate = { - .tileTag = 0x0000, + .tileTag = TAG_BUTTONS, .paletteTag = TAG_NONE, .oam = &sOamData_TourneyTreeCloseButton, .anims = sSpriteAnimTable_TourneyTreeExitButton, @@ -1109,7 +1111,7 @@ static const union AnimCmd * const sSpriteAnimTable_HorizontalScrollArrow[] = static const struct SpriteTemplate sHorizontalScrollArrowSpriteTemplate = { - .tileTag = 0x0000, + .tileTag = TAG_BUTTONS, .paletteTag = TAG_NONE, .oam = &sOamData_HorizontalScrollArrow, .anims = sSpriteAnimTable_HorizontalScrollArrow, @@ -1120,7 +1122,7 @@ static const struct SpriteTemplate sHorizontalScrollArrowSpriteTemplate = static const struct SpriteTemplate sVerticalScrollArrowSpriteTemplate = { - .tileTag = 0x0000, + .tileTag = TAG_BUTTONS, .paletteTag = TAG_NONE, .oam = &sOamData_VerticalScrollArrow, .anims = sSpriteAnimTable_VerticalScrollArrow, @@ -1482,589 +1484,617 @@ static const u8 sTourneyTreePokeballCoords[DOME_TOURNAMENT_TRAINERS_COUNT + DOME {120, 89}, // Final match }; +// Tile values from tourney_tree.png for the highlighted lines of the tourney tree. +// These tiles will be used to replace the existing, unhighlighted line tiles on the tourney tree tilemap. +#define LINE_PAL (6 << 12) +#define LINE_H (LINE_PAL | 0x21) // Horizontal +#define LINE_CORNER_R (LINE_PAL | 0x23) // Horizontal into a right-side vertical +#define LINE_CORNER_L (LINE_PAL | 0x25) // Horizontal into a left-side vertical +#define LINE_V_R (LINE_PAL | 0x27) // Right-side vertical +#define LINE_V_L (LINE_PAL | 0x29) // Left-side vertical +#define LINE_H_BOTTOM (LINE_PAL | 0x2B) // Horizontal on the bottom of the tree +#define LINE_H_LOGO1 (LINE_PAL | 0x2C) // Horizontal, logo behind +#define LINE_H_LOGO2 (LINE_PAL | 0x2D) // Horizontal, logo behind +#define LINE_H_LOGO3 (LINE_PAL | 0x2E) // Horizontal, logo behind +#define LINE_H_LOGO4 (LINE_PAL | 0x2F) // Horizontal, logo behind +#define LINE_V_R_LOGO1 (LINE_PAL | 0x30) // Right-side vertical, logo behind +#define LINE_V_R_LOGO2 (LINE_PAL | 0x31) // Right-side vertical, logo behind +#define LINE_V_R_LOGO3 (LINE_PAL | 0x32) // Right-side vertical, logo behind +#define LINE_V_R_LOGO4 (LINE_PAL | 0x33) // Right-side vertical, logo behind +#define LINE_V_L_LOGO1 (LINE_PAL | 0x35) // Left-side vertical, logo behind +#define LINE_V_L_LOGO2 (LINE_PAL | 0x36) // Left-side vertical, logo behind +#define LINE_V_L_LOGO3 (LINE_PAL | 0x37) // Left-side vertical, logo behind +#define LINE_V_L_LOGO4 (LINE_PAL | 0x38) // Left-side vertical, logo behind +#define LINE_V_R_HALF_LOGO (LINE_PAL | 0x3B) // Right-side vertical, half lit from the top, logo behind +#define LINE_V_L_HALF_LOGO (LINE_PAL | 0x3C) // Left-side vertical, half lit from the top, logo behind +#define LINE_CORNER_R_HALF (LINE_PAL | 0x43) // Lit horizontal, unlit right-side vertical +#define LINE_CORNER_L_HALF (LINE_PAL | 0x45) // Lit horizontal, unlit left-side vertical +#define LINE_V_R_HALF (LINE_PAL | 0x47) // Right-side vertical, half lit from the top +#define LINE_V_L_HALF (LINE_PAL | 0x49) // Left-side vertical, half lit from the top + // Each of these line sections define the position of the advancement line on the tourney tree for the victor of that round // The trainers here are numbered by tourney ID (rank/seed) and ordered according to where they start on the tourney tree -#define LINESECTION_ROUND1_TRAINER1(lastSrc) \ - {.src = 0x6021, .y = 0x04, .x = 0x09}, \ - {.src = 0x6023, .y = 0x04, .x = 0x0a}, \ - {.src = 0x6047, .y = 0x05, .x = 0x0a}, \ - {.src = lastSrc, .y = 0x05, .x = 0x0b}, - -#define LINESECTION_ROUND1_TRAINER9(lastSrc) \ - {.src = 0x6021, .y = 0x06, .x = 0x09}, \ - {.src = 0x6021, .y = 0x06, .x = 0x0a}, \ - {.src = 0x6027, .y = 0x05, .x = 0x0a}, \ - {.src = lastSrc, .y = 0x05, .x = 0x0b}, - -#define LINESECTION_ROUND1_TRAINER13(lastSrc) \ - {.src = 0x6021, .y = 0x08, .x = 0x09}, \ - {.src = 0x6023, .y = 0x08, .x = 0x0a}, \ - {.src = 0x6047, .y = 0x09, .x = 0x0a}, \ - {.src = lastSrc, .y = 0x09, .x = 0x0b}, - -#define LINESECTION_ROUND1_TRAINER5(lastSrc) \ - {.src = 0x6021, .y = 0x0a, .x = 0x09}, \ - {.src = 0x6021, .y = 0x0a, .x = 0x0a}, \ - {.src = 0x6027, .y = 0x09, .x = 0x0a}, \ - {.src = lastSrc, .y = 0x09, .x = 0x0b}, - -#define LINESECTION_ROUND1_TRAINER8(lastSrc) \ - {.src = 0x6021, .y = 0x0c, .x = 0x09}, \ - {.src = 0x6023, .y = 0x0c, .x = 0x0a}, \ - {.src = 0x6047, .y = 0x0d, .x = 0x0a}, \ - {.src = lastSrc, .y = 0x0d, .x = 0x0b}, - -#define LINESECTION_ROUND1_TRAINER16(lastSrc) \ - {.src = 0x6021, .y = 0x0e, .x = 0x09}, \ - {.src = 0x6021, .y = 0x0e, .x = 0x0a}, \ - {.src = 0x6027, .y = 0x0d, .x = 0x0a}, \ - {.src = lastSrc, .y = 0x0d, .x = 0x0b}, - -#define LINESECTION_ROUND1_TRAINER12(lastSrc) \ - {.src = 0x6021, .y = 0x10, .x = 0x09}, \ - {.src = 0x6023, .y = 0x10, .x = 0x0a}, \ - {.src = 0x6047, .y = 0x11, .x = 0x0a}, \ - {.src = lastSrc, .y = 0x11, .x = 0x0b}, - -#define LINESECTION_ROUND1_TRAINER4(lastSrc) \ - {.src = 0x602b, .y = 0x12, .x = 0x09}, \ - {.src = 0x602b, .y = 0x12, .x = 0x0a}, \ - {.src = 0x6027, .y = 0x11, .x = 0x0a}, \ - {.src = lastSrc, .y = 0x11, .x = 0x0b}, - -#define LINESECTION_ROUND1_TRAINER3(lastSrc) \ - {.src = 0x6021, .y = 0x04, .x = 0x14}, \ - {.src = 0x6025, .y = 0x04, .x = 0x13}, \ - {.src = 0x6049, .y = 0x05, .x = 0x13}, \ - {.src = lastSrc, .y = 0x05, .x = 0x12}, - -#define LINESECTION_ROUND1_TRAINER11(lastSrc) \ - {.src = 0x6021, .y = 0x06, .x = 0x14}, \ - {.src = 0x6021, .y = 0x06, .x = 0x13}, \ - {.src = 0x6029, .y = 0x05, .x = 0x13}, \ - {.src = lastSrc, .y = 0x05, .x = 0x12}, - -#define LINESECTION_ROUND1_TRAINER15(lastSrc) \ - {.src = 0x6021, .y = 0x08, .x = 0x14}, \ - {.src = 0x6025, .y = 0x08, .x = 0x13}, \ - {.src = 0x6049, .y = 0x09, .x = 0x13}, \ - {.src = lastSrc, .y = 0x09, .x = 0x12}, - -#define LINESECTION_ROUND1_TRAINER7(lastSrc) \ - {.src = 0x6021, .y = 0x0a, .x = 0x14}, \ - {.src = 0x6021, .y = 0x0a, .x = 0x13}, \ - {.src = 0x6029, .y = 0x09, .x = 0x13}, \ - {.src = lastSrc, .y = 0x09, .x = 0x12}, - -#define LINESECTION_ROUND1_TRAINER6(lastSrc) \ - {.src = 0x6021, .y = 0x0c, .x = 0x14}, \ - {.src = 0x6025, .y = 0x0c, .x = 0x13}, \ - {.src = 0x6049, .y = 0x0d, .x = 0x13}, \ - {.src = lastSrc, .y = 0x0d, .x = 0x12}, - -#define LINESECTION_ROUND1_TRAINER14(lastSrc) \ - {.src = 0x6021, .y = 0x0e, .x = 0x14}, \ - {.src = 0x6021, .y = 0x0e, .x = 0x13}, \ - {.src = 0x6029, .y = 0x0d, .x = 0x13}, \ - {.src = lastSrc, .y = 0x0d, .x = 0x12}, - -#define LINESECTION_ROUND1_TRAINER10(lastSrc) \ - {.src = 0x6021, .y = 0x10, .x = 0x14}, \ - {.src = 0x6025, .y = 0x10, .x = 0x13}, \ - {.src = 0x6049, .y = 0x11, .x = 0x13}, \ - {.src = lastSrc, .y = 0x11, .x = 0x12}, - -#define LINESECTION_ROUND1_TRAINER2(lastSrc) \ - {.src = 0x602b, .y = 0x12, .x = 0x14}, \ - {.src = 0x602b, .y = 0x12, .x = 0x13}, \ - {.src = 0x6029, .y = 0x11, .x = 0x13}, \ - {.src = lastSrc, .y = 0x11, .x = 0x12}, - -#define LINESECTION_ROUND2_MATCH1(lastSrc) \ - {.src = 0x6027, .y = 0x06, .x = 0x0b}, \ - {.src = 0x6047, .y = 0x07, .x = 0x0b}, \ - {.src = lastSrc, .y = 0x07, .x = 0x0c}, - -#define LINESECTION_ROUND2_MATCH2(lastSrc) \ - {.src = 0x6027, .y = 0x08, .x = 0x0b}, \ - {.src = 0x6027, .y = 0x07, .x = 0x0b}, \ - {.src = lastSrc, .y = 0x07, .x = 0x0c}, - -#define LINESECTION_ROUND2_MATCH3(lastSrc) \ - {.src = 0x6027, .y = 0x0e, .x = 0x0b}, \ - {.src = 0x6047, .y = 0x0f, .x = 0x0b}, \ - {.src = lastSrc, .y = 0x0f, .x = 0x0c}, - -#define LINESECTION_ROUND2_MATCH4(lastSrc) \ - {.src = 0x6027, .y = 0x10, .x = 0x0b}, \ - {.src = 0x6027, .y = 0x0f, .x = 0x0b}, \ - {.src = lastSrc, .y = 0x0f, .x = 0x0c}, - -#define LINESECTION_ROUND2_MATCH5(lastSrc) \ - {.src = 0x6029, .y = 0x06, .x = 0x12}, \ - {.src = 0x6049, .y = 0x07, .x = 0x12}, \ - {.src = lastSrc, .y = 0x07, .x = 0x11}, - -#define LINESECTION_ROUND2_MATCH6(lastSrc) \ - {.src = 0x6029, .y = 0x08, .x = 0x12}, \ - {.src = 0x6029, .y = 0x07, .x = 0x12}, \ - {.src = lastSrc, .y = 0x07, .x = 0x11}, - -#define LINESECTION_ROUND2_MATCH7(lastSrc) \ - {.src = 0x6029, .y = 0x0e, .x = 0x12}, \ - {.src = 0x6049, .y = 0x0f, .x = 0x12}, \ - {.src = lastSrc, .y = 0x0f, .x = 0x11}, - -#define LINESECTION_ROUND2_MATCH8(lastSrc) \ - {.src = 0x6029, .y = 0x10, .x = 0x12}, \ - {.src = 0x6029, .y = 0x0f, .x = 0x12}, \ - {.src = lastSrc, .y = 0x0f, .x = 0x11}, - -#define LINESECTION_SEMIFINAL_TOP_LEFT \ - {.src = 0x6027, .y = 0x08, .x = 0x0c}, \ - {.src = 0x6027, .y = 0x09, .x = 0x0c}, \ - {.src = 0x6027, .y = 0x0a, .x = 0x0c}, \ - {.src = 0x603b, .y = 0x0b, .x = 0x0c}, - -#define LINESECTION_SEMIFINAL_BOTTOM_LEFT \ - {.src = 0x6033, .y = 0x0e, .x = 0x0c}, \ - {.src = 0x6032, .y = 0x0d, .x = 0x0c}, \ - {.src = 0x6031, .y = 0x0c, .x = 0x0c}, \ - {.src = 0x6030, .y = 0x0b, .x = 0x0c}, - -#define LINESECTION_SEMIFINAL_TOP_RIGHT \ - {.src = 0x6029, .y = 0x08, .x = 0x11}, \ - {.src = 0x6029, .y = 0x09, .x = 0x11}, \ - {.src = 0x6029, .y = 0x0a, .x = 0x11}, \ - {.src = 0x603c, .y = 0x0b, .x = 0x11}, - +#define LINESECTION_ROUND1_TRAINER1(lastTile) \ + {.tile = LINE_H, .y = 4, .x = 9}, \ + {.tile = LINE_CORNER_R, .y = 4, .x = 10}, \ + {.tile = LINE_V_R_HALF, .y = 5, .x = 10}, \ + {.tile = lastTile, .y = 5, .x = 11}, + +#define LINESECTION_ROUND1_TRAINER9(lastTile) \ + {.tile = LINE_H, .y = 6, .x = 9}, \ + {.tile = LINE_H, .y = 6, .x = 10}, \ + {.tile = LINE_V_R, .y = 5, .x = 10}, \ + {.tile = lastTile, .y = 5, .x = 11}, + +#define LINESECTION_ROUND1_TRAINER13(lastTile) \ + {.tile = LINE_H, .y = 8, .x = 9}, \ + {.tile = LINE_CORNER_R, .y = 8, .x = 10}, \ + {.tile = LINE_V_R_HALF, .y = 9, .x = 10}, \ + {.tile = lastTile, .y = 9, .x = 11}, + +#define LINESECTION_ROUND1_TRAINER5(lastTile) \ + {.tile = LINE_H, .y = 10, .x = 9}, \ + {.tile = LINE_H, .y = 10, .x = 10}, \ + {.tile = LINE_V_R, .y = 9, .x = 10}, \ + {.tile = lastTile, .y = 9, .x = 11}, + +#define LINESECTION_ROUND1_TRAINER8(lastTile) \ + {.tile = LINE_H, .y = 12, .x = 9}, \ + {.tile = LINE_CORNER_R, .y = 12, .x = 10}, \ + {.tile = LINE_V_R_HALF, .y = 13, .x = 10}, \ + {.tile = lastTile, .y = 13, .x = 11}, + +#define LINESECTION_ROUND1_TRAINER16(lastTile) \ + {.tile = LINE_H, .y = 14, .x = 9}, \ + {.tile = LINE_H, .y = 14, .x = 10}, \ + {.tile = LINE_V_R, .y = 13, .x = 10}, \ + {.tile = lastTile, .y = 13, .x = 11}, + +#define LINESECTION_ROUND1_TRAINER12(lastTile) \ + {.tile = LINE_H, .y = 16, .x = 9}, \ + {.tile = LINE_CORNER_R, .y = 16, .x = 10}, \ + {.tile = LINE_V_R_HALF, .y = 17, .x = 10}, \ + {.tile = lastTile, .y = 17, .x = 11}, + +#define LINESECTION_ROUND1_TRAINER4(lastTile) \ + {.tile = LINE_H_BOTTOM, .y = 18, .x = 9}, \ + {.tile = LINE_H_BOTTOM, .y = 18, .x = 10}, \ + {.tile = LINE_V_R, .y = 17, .x = 10}, \ + {.tile = lastTile, .y = 17, .x = 11}, + +#define LINESECTION_ROUND1_TRAINER3(lastTile) \ + {.tile = LINE_H, .y = 4, .x = 20}, \ + {.tile = LINE_CORNER_L, .y = 4, .x = 19}, \ + {.tile = LINE_V_L_HALF, .y = 5, .x = 19}, \ + {.tile = lastTile, .y = 5, .x = 18}, + +#define LINESECTION_ROUND1_TRAINER11(lastTile) \ + {.tile = LINE_H, .y = 6, .x = 20}, \ + {.tile = LINE_H, .y = 6, .x = 19}, \ + {.tile = LINE_V_L, .y = 5, .x = 19}, \ + {.tile = lastTile, .y = 5, .x = 18}, + +#define LINESECTION_ROUND1_TRAINER15(lastTile) \ + {.tile = LINE_H, .y = 8, .x = 20}, \ + {.tile = LINE_CORNER_L, .y = 8, .x = 19}, \ + {.tile = LINE_V_L_HALF, .y = 9, .x = 19}, \ + {.tile = lastTile, .y = 9, .x = 18}, + +#define LINESECTION_ROUND1_TRAINER7(lastTile) \ + {.tile = LINE_H, .y = 10, .x = 20}, \ + {.tile = LINE_H, .y = 10, .x = 19}, \ + {.tile = LINE_V_L, .y = 9, .x = 19}, \ + {.tile = lastTile, .y = 9, .x = 18}, + +#define LINESECTION_ROUND1_TRAINER6(lastTile) \ + {.tile = LINE_H, .y = 12, .x = 20}, \ + {.tile = LINE_CORNER_L, .y = 12, .x = 19}, \ + {.tile = LINE_V_L_HALF, .y = 13, .x = 19}, \ + {.tile = lastTile, .y = 13, .x = 18}, + +#define LINESECTION_ROUND1_TRAINER14(lastTile) \ + {.tile = LINE_H, .y = 14, .x = 20}, \ + {.tile = LINE_H, .y = 14, .x = 19}, \ + {.tile = LINE_V_L, .y = 13, .x = 19}, \ + {.tile = lastTile, .y = 13, .x = 18}, + +#define LINESECTION_ROUND1_TRAINER10(lastTile) \ + {.tile = LINE_H, .y = 16, .x = 20}, \ + {.tile = LINE_CORNER_L, .y = 16, .x = 19}, \ + {.tile = LINE_V_L_HALF, .y = 17, .x = 19}, \ + {.tile = lastTile, .y = 17, .x = 18}, + +#define LINESECTION_ROUND1_TRAINER2(lastTile) \ + {.tile = LINE_H_BOTTOM, .y = 18, .x = 20}, \ + {.tile = LINE_H_BOTTOM, .y = 18, .x = 19}, \ + {.tile = LINE_V_L, .y = 17, .x = 19}, \ + {.tile = lastTile, .y = 17, .x = 18}, + +#define LINESECTION_ROUND2_MATCH1(lastTile) \ + {.tile = LINE_V_R, .y = 6, .x = 11}, \ + {.tile = LINE_V_R_HALF, .y = 7, .x = 11}, \ + {.tile = lastTile, .y = 7, .x = 12}, + +#define LINESECTION_ROUND2_MATCH2(lastTile) \ + {.tile = LINE_V_R, .y = 8, .x = 11}, \ + {.tile = LINE_V_R, .y = 7, .x = 11}, \ + {.tile = lastTile, .y = 7, .x = 12}, + +#define LINESECTION_ROUND2_MATCH3(lastTile) \ + {.tile = LINE_V_R, .y = 14, .x = 11}, \ + {.tile = LINE_V_R_HALF, .y = 15, .x = 11}, \ + {.tile = lastTile, .y = 15, .x = 12}, + +#define LINESECTION_ROUND2_MATCH4(lastTile) \ + {.tile = LINE_V_R, .y = 16, .x = 11}, \ + {.tile = LINE_V_R, .y = 15, .x = 11}, \ + {.tile = lastTile, .y = 15, .x = 12}, + +#define LINESECTION_ROUND2_MATCH5(lastTile) \ + {.tile = LINE_V_L, .y = 6, .x = 18}, \ + {.tile = LINE_V_L_HALF, .y = 7, .x = 18}, \ + {.tile = lastTile, .y = 7, .x = 17}, + +#define LINESECTION_ROUND2_MATCH6(lastTile) \ + {.tile = LINE_V_L, .y = 8, .x = 18}, \ + {.tile = LINE_V_L, .y = 7, .x = 18}, \ + {.tile = lastTile, .y = 7, .x = 17}, + +#define LINESECTION_ROUND2_MATCH7(lastTile) \ + {.tile = LINE_V_L, .y = 14, .x = 18}, \ + {.tile = LINE_V_L_HALF, .y = 15, .x = 18}, \ + {.tile = lastTile, .y = 15, .x = 17}, + +#define LINESECTION_ROUND2_MATCH8(lastTile) \ + {.tile = LINE_V_L, .y = 16, .x = 18}, \ + {.tile = LINE_V_L, .y = 15, .x = 18}, \ + {.tile = lastTile, .y = 15, .x = 17}, + +#define LINESECTION_SEMIFINAL_TOP_LEFT \ + {.tile = LINE_V_R, .y = 8, .x = 12}, \ + {.tile = LINE_V_R, .y = 9, .x = 12}, \ + {.tile = LINE_V_R, .y = 10, .x = 12}, \ + {.tile = LINE_V_R_HALF_LOGO, .y = 11, .x = 12}, + +#define LINESECTION_SEMIFINAL_BOTTOM_LEFT \ + {.tile = LINE_V_R_LOGO4, .y = 14, .x = 12}, \ + {.tile = LINE_V_R_LOGO3, .y = 13, .x = 12}, \ + {.tile = LINE_V_R_LOGO2, .y = 12, .x = 12}, \ + {.tile = LINE_V_R_LOGO1, .y = 11, .x = 12}, + +#define LINESECTION_SEMIFINAL_TOP_RIGHT \ + {.tile = LINE_V_L, .y = 8, .x = 17}, \ + {.tile = LINE_V_L, .y = 9, .x = 17}, \ + {.tile = LINE_V_L, .y = 10, .x = 17}, \ + {.tile = LINE_V_L_HALF_LOGO, .y = 11, .x = 17}, + #define LINESECTION_SEMIFINAL_BOTTOM_RIGHT \ - {.src = 0x6038, .y = 0x0e, .x = 0x11}, \ - {.src = 0x6037, .y = 0x0d, .x = 0x11}, \ - {.src = 0x6036, .y = 0x0c, .x = 0x11}, \ - {.src = 0x6035, .y = 0x0b, .x = 0x11}, - -#define LINESECTION_FINAL_LEFT \ - {.src = 0x602c, .y = 0x0b, .x = 0x0d}, \ - {.src = 0x602d, .y = 0x0b, .x = 0x0e}, + {.tile = LINE_V_L_LOGO4, .y = 14, .x = 17}, \ + {.tile = LINE_V_L_LOGO3, .y = 13, .x = 17}, \ + {.tile = LINE_V_L_LOGO2, .y = 12, .x = 17}, \ + {.tile = LINE_V_L_LOGO1, .y = 11, .x = 17}, + +#define LINESECTION_FINAL_LEFT \ + {.tile = LINE_H_LOGO1, .y = 11, .x = 13}, \ + {.tile = LINE_H_LOGO2, .y = 11, .x = 14}, -#define LINESECTION_FINAL_RIGHT \ - {.src = 0x602f, .y = 0x0b, .x = 0x10}, \ - {.src = 0x602e, .y = 0x0b, .x = 0x0f}, +#define LINESECTION_FINAL_RIGHT \ + {.tile = LINE_H_LOGO4, .y = 11, .x = 16}, \ + {.tile = LINE_H_LOGO3, .y = 11, .x = 15}, static const struct TourneyTreeLineSection sLineSectionTrainer1Round1[] = { - LINESECTION_ROUND1_TRAINER1(0x6043) + LINESECTION_ROUND1_TRAINER1(LINE_CORNER_R_HALF) }; static const struct TourneyTreeLineSection sLineSectionTrainer1Round2[] = { - LINESECTION_ROUND1_TRAINER1(0x6023) - LINESECTION_ROUND2_MATCH1(0x6043) + LINESECTION_ROUND1_TRAINER1(LINE_CORNER_R) + LINESECTION_ROUND2_MATCH1(LINE_CORNER_R_HALF) }; static const struct TourneyTreeLineSection sLineSectionTrainer1Semifinal[] = { - LINESECTION_ROUND1_TRAINER1(0x6023) - LINESECTION_ROUND2_MATCH1(0x6023) + LINESECTION_ROUND1_TRAINER1(LINE_CORNER_R) + LINESECTION_ROUND2_MATCH1(LINE_CORNER_R) LINESECTION_SEMIFINAL_TOP_LEFT }; static const struct TourneyTreeLineSection sLineSectionTrainer1Final[] = { - LINESECTION_ROUND1_TRAINER1(0x6023) - LINESECTION_ROUND2_MATCH1(0x6023) + LINESECTION_ROUND1_TRAINER1(LINE_CORNER_R) + LINESECTION_ROUND2_MATCH1(LINE_CORNER_R) LINESECTION_SEMIFINAL_TOP_LEFT LINESECTION_FINAL_LEFT }; static const struct TourneyTreeLineSection sLineSectionTrainer9Round1[] = { - LINESECTION_ROUND1_TRAINER9(0x6043) + LINESECTION_ROUND1_TRAINER9(LINE_CORNER_R_HALF) }; static const struct TourneyTreeLineSection sLineSectionTrainer9Round2[] = { - LINESECTION_ROUND1_TRAINER9(0x6023) - LINESECTION_ROUND2_MATCH1(0x6043) + LINESECTION_ROUND1_TRAINER9(LINE_CORNER_R) + LINESECTION_ROUND2_MATCH1(LINE_CORNER_R_HALF) }; static const struct TourneyTreeLineSection sLineSectionTrainer9Semifinal[] = { - LINESECTION_ROUND1_TRAINER9(0x6023) - LINESECTION_ROUND2_MATCH1(0x6023) + LINESECTION_ROUND1_TRAINER9(LINE_CORNER_R) + LINESECTION_ROUND2_MATCH1(LINE_CORNER_R) LINESECTION_SEMIFINAL_TOP_LEFT }; static const struct TourneyTreeLineSection sLineSectionTrainer9Final[] = { - LINESECTION_ROUND1_TRAINER9(0x6023) - LINESECTION_ROUND2_MATCH1(0x6023) + LINESECTION_ROUND1_TRAINER9(LINE_CORNER_R) + LINESECTION_ROUND2_MATCH1(LINE_CORNER_R) LINESECTION_SEMIFINAL_TOP_LEFT LINESECTION_FINAL_LEFT }; static const struct TourneyTreeLineSection sLineSectionTrainer13Round1[] = { - LINESECTION_ROUND1_TRAINER13(0x6021) + LINESECTION_ROUND1_TRAINER13(LINE_H) }; static const struct TourneyTreeLineSection sLineSectionTrainer13Round2[] = { - LINESECTION_ROUND1_TRAINER13(0x6021) - LINESECTION_ROUND2_MATCH2(0x6043) + LINESECTION_ROUND1_TRAINER13(LINE_H) + LINESECTION_ROUND2_MATCH2(LINE_CORNER_R_HALF) }; static const struct TourneyTreeLineSection sLineSectionTrainer13Semifinal[] = { - LINESECTION_ROUND1_TRAINER13(0x6021) - LINESECTION_ROUND2_MATCH2(0x6023) + LINESECTION_ROUND1_TRAINER13(LINE_H) + LINESECTION_ROUND2_MATCH2(LINE_CORNER_R) LINESECTION_SEMIFINAL_TOP_LEFT }; static const struct TourneyTreeLineSection sLineSectionTrainer13Final[] = { - LINESECTION_ROUND1_TRAINER13(0x6021) - LINESECTION_ROUND2_MATCH2(0x6023) + LINESECTION_ROUND1_TRAINER13(LINE_H) + LINESECTION_ROUND2_MATCH2(LINE_CORNER_R) LINESECTION_SEMIFINAL_TOP_LEFT LINESECTION_FINAL_LEFT }; static const struct TourneyTreeLineSection sLineSectionTrainer5Round1[] = { - LINESECTION_ROUND1_TRAINER5(0x6021) + LINESECTION_ROUND1_TRAINER5(LINE_H) }; static const struct TourneyTreeLineSection sLineSectionTrainer5Round2[] = { - LINESECTION_ROUND1_TRAINER5(0x6021) - LINESECTION_ROUND2_MATCH2(0x6043) + LINESECTION_ROUND1_TRAINER5(LINE_H) + LINESECTION_ROUND2_MATCH2(LINE_CORNER_R_HALF) }; static const struct TourneyTreeLineSection sLineSectionTrainer5Semifinal[] = { - LINESECTION_ROUND1_TRAINER5(0x6021) - LINESECTION_ROUND2_MATCH2(0x6023) + LINESECTION_ROUND1_TRAINER5(LINE_H) + LINESECTION_ROUND2_MATCH2(LINE_CORNER_R) LINESECTION_SEMIFINAL_TOP_LEFT }; static const struct TourneyTreeLineSection sLineSectionTrainer5Final[] = { - LINESECTION_ROUND1_TRAINER5(0x6021) - LINESECTION_ROUND2_MATCH2(0x6023) + LINESECTION_ROUND1_TRAINER5(LINE_H) + LINESECTION_ROUND2_MATCH2(LINE_CORNER_R) LINESECTION_SEMIFINAL_TOP_LEFT LINESECTION_FINAL_LEFT }; static const struct TourneyTreeLineSection sLineSectionTrainer8Round1[] = { - LINESECTION_ROUND1_TRAINER8(0x6043) + LINESECTION_ROUND1_TRAINER8(LINE_CORNER_R_HALF) }; static const struct TourneyTreeLineSection sLineSectionTrainer8Round2[] = { - LINESECTION_ROUND1_TRAINER8(0x6023) - LINESECTION_ROUND2_MATCH3(0x6021) + LINESECTION_ROUND1_TRAINER8(LINE_CORNER_R) + LINESECTION_ROUND2_MATCH3(LINE_H) }; static const struct TourneyTreeLineSection sLineSectionTrainer8Semifinal[] = { - LINESECTION_ROUND1_TRAINER8(0x6023) - LINESECTION_ROUND2_MATCH3(0x6021) + LINESECTION_ROUND1_TRAINER8(LINE_CORNER_R) + LINESECTION_ROUND2_MATCH3(LINE_H) LINESECTION_SEMIFINAL_BOTTOM_LEFT }; static const struct TourneyTreeLineSection sLineSectionTrainer8Final[] = { - LINESECTION_ROUND1_TRAINER8(0x6023) - LINESECTION_ROUND2_MATCH3(0x6021) + LINESECTION_ROUND1_TRAINER8(LINE_CORNER_R) + LINESECTION_ROUND2_MATCH3(LINE_H) LINESECTION_SEMIFINAL_BOTTOM_LEFT LINESECTION_FINAL_LEFT }; static const struct TourneyTreeLineSection sLineSectionTrainer16Round1[] = { - LINESECTION_ROUND1_TRAINER16(0x6043) + LINESECTION_ROUND1_TRAINER16(LINE_CORNER_R_HALF) }; static const struct TourneyTreeLineSection sLineSectionTrainer16Round2[] = { - LINESECTION_ROUND1_TRAINER16(0x6023) - LINESECTION_ROUND2_MATCH3(0x6021) + LINESECTION_ROUND1_TRAINER16(LINE_CORNER_R) + LINESECTION_ROUND2_MATCH3(LINE_H) }; static const struct TourneyTreeLineSection sLineSectionTrainer16Semifinal[] = { - LINESECTION_ROUND1_TRAINER16(0x6023) - LINESECTION_ROUND2_MATCH3(0x6021) + LINESECTION_ROUND1_TRAINER16(LINE_CORNER_R) + LINESECTION_ROUND2_MATCH3(LINE_H) LINESECTION_SEMIFINAL_BOTTOM_LEFT }; static const struct TourneyTreeLineSection sLineSectionTrainer16Final[] = { - LINESECTION_ROUND1_TRAINER16(0x6023) - LINESECTION_ROUND2_MATCH3(0x6021) + LINESECTION_ROUND1_TRAINER16(LINE_CORNER_R) + LINESECTION_ROUND2_MATCH3(LINE_H) LINESECTION_SEMIFINAL_BOTTOM_LEFT LINESECTION_FINAL_LEFT }; static const struct TourneyTreeLineSection sLineSectionTrainer12Round1[] = { - LINESECTION_ROUND1_TRAINER12(0x6021) + LINESECTION_ROUND1_TRAINER12(LINE_H) }; static const struct TourneyTreeLineSection sLineSectionTrainer12Round2[] = { - LINESECTION_ROUND1_TRAINER12(0x6021) - LINESECTION_ROUND2_MATCH4(0x6021) + LINESECTION_ROUND1_TRAINER12(LINE_H) + LINESECTION_ROUND2_MATCH4(LINE_H) }; static const struct TourneyTreeLineSection sLineSectionTrainer12Semifinal[] = { - LINESECTION_ROUND1_TRAINER12(0x6021) - LINESECTION_ROUND2_MATCH4(0x6021) + LINESECTION_ROUND1_TRAINER12(LINE_H) + LINESECTION_ROUND2_MATCH4(LINE_H) LINESECTION_SEMIFINAL_BOTTOM_LEFT }; static const struct TourneyTreeLineSection sLineSectionTrainer12Final[] = { - LINESECTION_ROUND1_TRAINER12(0x6021) - LINESECTION_ROUND2_MATCH4(0x6021) + LINESECTION_ROUND1_TRAINER12(LINE_H) + LINESECTION_ROUND2_MATCH4(LINE_H) LINESECTION_SEMIFINAL_BOTTOM_LEFT LINESECTION_FINAL_LEFT }; static const struct TourneyTreeLineSection sLineSectionTrainer4Round1[] = { - LINESECTION_ROUND1_TRAINER4(0x6021) + LINESECTION_ROUND1_TRAINER4(LINE_H) }; static const struct TourneyTreeLineSection sLineSectionTrainer4Round2[] = { - LINESECTION_ROUND1_TRAINER4(0x6021) - LINESECTION_ROUND2_MATCH4(0x6021) + LINESECTION_ROUND1_TRAINER4(LINE_H) + LINESECTION_ROUND2_MATCH4(LINE_H) }; static const struct TourneyTreeLineSection sLineSectionTrainer4Semifinal[] = { - LINESECTION_ROUND1_TRAINER4(0x6021) - LINESECTION_ROUND2_MATCH4(0x6021) + LINESECTION_ROUND1_TRAINER4(LINE_H) + LINESECTION_ROUND2_MATCH4(LINE_H) LINESECTION_SEMIFINAL_BOTTOM_LEFT }; static const struct TourneyTreeLineSection sLineSectionTrainer4Final[] = { - LINESECTION_ROUND1_TRAINER4(0x6021) - LINESECTION_ROUND2_MATCH4(0x6021) + LINESECTION_ROUND1_TRAINER4(LINE_H) + LINESECTION_ROUND2_MATCH4(LINE_H) LINESECTION_SEMIFINAL_BOTTOM_LEFT LINESECTION_FINAL_LEFT }; static const struct TourneyTreeLineSection sLineSectionTrainer3Round1[] = { - LINESECTION_ROUND1_TRAINER3(0x6045) + LINESECTION_ROUND1_TRAINER3(LINE_CORNER_L_HALF) }; static const struct TourneyTreeLineSection sLineSectionTrainer3Round2[] = { - LINESECTION_ROUND1_TRAINER3(0x6025) - LINESECTION_ROUND2_MATCH5(0x6045) + LINESECTION_ROUND1_TRAINER3(LINE_CORNER_L) + LINESECTION_ROUND2_MATCH5(LINE_CORNER_L_HALF) }; static const struct TourneyTreeLineSection sLineSectionTrainer3Semifinal[] = { - LINESECTION_ROUND1_TRAINER3(0x6025) - LINESECTION_ROUND2_MATCH5(0x6025) + LINESECTION_ROUND1_TRAINER3(LINE_CORNER_L) + LINESECTION_ROUND2_MATCH5(LINE_CORNER_L) LINESECTION_SEMIFINAL_TOP_RIGHT }; static const struct TourneyTreeLineSection sLineSectionTrainer3Final[] = { - LINESECTION_ROUND1_TRAINER3(0x6025) - LINESECTION_ROUND2_MATCH5(0x6025) + LINESECTION_ROUND1_TRAINER3(LINE_CORNER_L) + LINESECTION_ROUND2_MATCH5(LINE_CORNER_L) LINESECTION_SEMIFINAL_TOP_RIGHT LINESECTION_FINAL_RIGHT }; static const struct TourneyTreeLineSection sLineSectionTrainer11Round1[] = { - LINESECTION_ROUND1_TRAINER11(0x6045) + LINESECTION_ROUND1_TRAINER11(LINE_CORNER_L_HALF) }; static const struct TourneyTreeLineSection sLineSectionTrainer11Round2[] = { - LINESECTION_ROUND1_TRAINER11(0x6025) - LINESECTION_ROUND2_MATCH5(0x6045) + LINESECTION_ROUND1_TRAINER11(LINE_CORNER_L) + LINESECTION_ROUND2_MATCH5(LINE_CORNER_L_HALF) }; static const struct TourneyTreeLineSection sLineSectionTrainer11Semifinal[] = { - LINESECTION_ROUND1_TRAINER11(0x6025) - LINESECTION_ROUND2_MATCH5(0x6025) + LINESECTION_ROUND1_TRAINER11(LINE_CORNER_L) + LINESECTION_ROUND2_MATCH5(LINE_CORNER_L) LINESECTION_SEMIFINAL_TOP_RIGHT }; static const struct TourneyTreeLineSection sLineSectionTrainer11Final[] = { - LINESECTION_ROUND1_TRAINER11(0x6025) - LINESECTION_ROUND2_MATCH5(0x6025) + LINESECTION_ROUND1_TRAINER11(LINE_CORNER_L) + LINESECTION_ROUND2_MATCH5(LINE_CORNER_L) LINESECTION_SEMIFINAL_TOP_RIGHT LINESECTION_FINAL_RIGHT }; static const struct TourneyTreeLineSection sLineSectionTrainer15Round1[] = { - LINESECTION_ROUND1_TRAINER15(0x6021) + LINESECTION_ROUND1_TRAINER15(LINE_H) }; static const struct TourneyTreeLineSection sLineSectionTrainer15Round2[] = { - LINESECTION_ROUND1_TRAINER15(0x6021) - LINESECTION_ROUND2_MATCH6(0x6045) + LINESECTION_ROUND1_TRAINER15(LINE_H) + LINESECTION_ROUND2_MATCH6(LINE_CORNER_L_HALF) }; static const struct TourneyTreeLineSection sLineSectionTrainer15Semifinal[] = { - LINESECTION_ROUND1_TRAINER15(0x6021) - LINESECTION_ROUND2_MATCH6(0x6025) + LINESECTION_ROUND1_TRAINER15(LINE_H) + LINESECTION_ROUND2_MATCH6(LINE_CORNER_L) LINESECTION_SEMIFINAL_TOP_RIGHT }; static const struct TourneyTreeLineSection sLineSectionTrainer15Final[] = { - LINESECTION_ROUND1_TRAINER15(0x6021) - LINESECTION_ROUND2_MATCH6(0x6025) + LINESECTION_ROUND1_TRAINER15(LINE_H) + LINESECTION_ROUND2_MATCH6(LINE_CORNER_L) LINESECTION_SEMIFINAL_TOP_RIGHT LINESECTION_FINAL_RIGHT }; static const struct TourneyTreeLineSection sLineSectionTrainer7Round1[] = { - LINESECTION_ROUND1_TRAINER7(0x6021) + LINESECTION_ROUND1_TRAINER7(LINE_H) }; static const struct TourneyTreeLineSection sLineSectionTrainer7Round2[] = { - LINESECTION_ROUND1_TRAINER7(0x6021) - LINESECTION_ROUND2_MATCH6(0x6045) + LINESECTION_ROUND1_TRAINER7(LINE_H) + LINESECTION_ROUND2_MATCH6(LINE_CORNER_L_HALF) }; static const struct TourneyTreeLineSection sLineSectionTrainer7Semifinal[] = { - LINESECTION_ROUND1_TRAINER7(0x6021) - LINESECTION_ROUND2_MATCH6(0x6025) + LINESECTION_ROUND1_TRAINER7(LINE_H) + LINESECTION_ROUND2_MATCH6(LINE_CORNER_L) LINESECTION_SEMIFINAL_TOP_RIGHT }; static const struct TourneyTreeLineSection sLineSectionTrainer7Final[] = { - LINESECTION_ROUND1_TRAINER7(0x6021) - LINESECTION_ROUND2_MATCH6(0x6025) + LINESECTION_ROUND1_TRAINER7(LINE_H) + LINESECTION_ROUND2_MATCH6(LINE_CORNER_L) LINESECTION_SEMIFINAL_TOP_RIGHT LINESECTION_FINAL_RIGHT }; static const struct TourneyTreeLineSection sLineSectionTrainer6Round1[] = { - LINESECTION_ROUND1_TRAINER6(0x6045) + LINESECTION_ROUND1_TRAINER6(LINE_CORNER_L_HALF) }; static const struct TourneyTreeLineSection sLineSectionTrainer6Round2[] = { - LINESECTION_ROUND1_TRAINER6(0x6025) - LINESECTION_ROUND2_MATCH7(0x6021) + LINESECTION_ROUND1_TRAINER6(LINE_CORNER_L) + LINESECTION_ROUND2_MATCH7(LINE_H) }; static const struct TourneyTreeLineSection sLineSectionTrainer6Semifinal[] = { - LINESECTION_ROUND1_TRAINER6(0x6025) - LINESECTION_ROUND2_MATCH7(0x6021) + LINESECTION_ROUND1_TRAINER6(LINE_CORNER_L) + LINESECTION_ROUND2_MATCH7(LINE_H) LINESECTION_SEMIFINAL_BOTTOM_RIGHT }; static const struct TourneyTreeLineSection sLineSectionTrainer6Final[] = { - LINESECTION_ROUND1_TRAINER6(0x6025) - LINESECTION_ROUND2_MATCH7(0x6021) + LINESECTION_ROUND1_TRAINER6(LINE_CORNER_L) + LINESECTION_ROUND2_MATCH7(LINE_H) LINESECTION_SEMIFINAL_BOTTOM_RIGHT LINESECTION_FINAL_RIGHT }; static const struct TourneyTreeLineSection sLineSectionTrainer14Round1[] = { - LINESECTION_ROUND1_TRAINER14(0x6045) + LINESECTION_ROUND1_TRAINER14(LINE_CORNER_L_HALF) }; static const struct TourneyTreeLineSection sLineSectionTrainer14Round2[] = { - LINESECTION_ROUND1_TRAINER14(0x6025) - LINESECTION_ROUND2_MATCH7(0x6021) + LINESECTION_ROUND1_TRAINER14(LINE_CORNER_L) + LINESECTION_ROUND2_MATCH7(LINE_H) }; static const struct TourneyTreeLineSection sLineSectionTrainer14Semifinal[] = { - LINESECTION_ROUND1_TRAINER14(0x6025) - LINESECTION_ROUND2_MATCH7(0x6021) + LINESECTION_ROUND1_TRAINER14(LINE_CORNER_L) + LINESECTION_ROUND2_MATCH7(LINE_H) LINESECTION_SEMIFINAL_BOTTOM_RIGHT }; static const struct TourneyTreeLineSection sLineSectionTrainer14Final[] = { - LINESECTION_ROUND1_TRAINER14(0x6025) - LINESECTION_ROUND2_MATCH7(0x6021) + LINESECTION_ROUND1_TRAINER14(LINE_CORNER_L) + LINESECTION_ROUND2_MATCH7(LINE_H) LINESECTION_SEMIFINAL_BOTTOM_RIGHT LINESECTION_FINAL_RIGHT }; static const struct TourneyTreeLineSection sLineSectionTrainer10Round1[] = { - LINESECTION_ROUND1_TRAINER10(0x6021) + LINESECTION_ROUND1_TRAINER10(LINE_H) }; static const struct TourneyTreeLineSection sLineSectionTrainer10Round2[] = { - LINESECTION_ROUND1_TRAINER10(0x6021) - LINESECTION_ROUND2_MATCH8(0x6021) + LINESECTION_ROUND1_TRAINER10(LINE_H) + LINESECTION_ROUND2_MATCH8(LINE_H) }; static const struct TourneyTreeLineSection sLineSectionTrainer10Semifinal[] = { - LINESECTION_ROUND1_TRAINER10(0x6021) - LINESECTION_ROUND2_MATCH8(0x6021) + LINESECTION_ROUND1_TRAINER10(LINE_H) + LINESECTION_ROUND2_MATCH8(LINE_H) LINESECTION_SEMIFINAL_BOTTOM_RIGHT }; static const struct TourneyTreeLineSection sLineSectionTrainer10Final[] = { - LINESECTION_ROUND1_TRAINER10(0x6021) - LINESECTION_ROUND2_MATCH8(0x6021) + LINESECTION_ROUND1_TRAINER10(LINE_H) + LINESECTION_ROUND2_MATCH8(LINE_H) LINESECTION_SEMIFINAL_BOTTOM_RIGHT LINESECTION_FINAL_RIGHT }; static const struct TourneyTreeLineSection sLineSectionTrainer2Round1[] = { - LINESECTION_ROUND1_TRAINER2(0x6021) + LINESECTION_ROUND1_TRAINER2(LINE_H) }; static const struct TourneyTreeLineSection sLineSectionTrainer2Round2[] = { - LINESECTION_ROUND1_TRAINER2(0x6021) - LINESECTION_ROUND2_MATCH8(0x6021) + LINESECTION_ROUND1_TRAINER2(LINE_H) + LINESECTION_ROUND2_MATCH8(LINE_H) }; static const struct TourneyTreeLineSection sLineSectionTrainer2Semifinal[] = { - LINESECTION_ROUND1_TRAINER2(0x6021) - LINESECTION_ROUND2_MATCH8(0x6021) + LINESECTION_ROUND1_TRAINER2(LINE_H) + LINESECTION_ROUND2_MATCH8(LINE_H) LINESECTION_SEMIFINAL_BOTTOM_RIGHT }; static const struct TourneyTreeLineSection sLineSectionTrainer2Final[] = { - LINESECTION_ROUND1_TRAINER2(0x6021) - LINESECTION_ROUND2_MATCH8(0x6021) + LINESECTION_ROUND1_TRAINER2(LINE_H) + LINESECTION_ROUND2_MATCH8(LINE_H) LINESECTION_SEMIFINAL_BOTTOM_RIGHT LINESECTION_FINAL_RIGHT }; @@ -5538,7 +5568,7 @@ static void DrawTourneyAdvancementLine(u8 tournamentId, u8 roundId) const struct TourneyTreeLineSection *lineSection = sTourneyTreeLineSections[tournamentId][roundId]; for (i = 0; i < sTourneyTreeLineSectionArrayCounts[tournamentId][roundId]; i++) - CopyToBgTilemapBufferRect_ChangePalette(1, &lineSection[i].src, lineSection[i].x, lineSection[i].y, 1, 1, 17); + CopyToBgTilemapBufferRect_ChangePalette(1, &lineSection[i].tile, lineSection[i].x, lineSection[i].y, 1, 1, 17); CopyBgTilemapBufferToVram(1); } diff --git a/src/battle_factory.c b/src/battle_factory.c index eac9f0403eaf..4cb1c8676c48 100644 --- a/src/battle_factory.c +++ b/src/battle_factory.c @@ -525,13 +525,13 @@ static void GenerateInitialRentalMons(void) gFacilityTrainers = gBattleFrontierTrainers; for (i = 0; i < PARTY_SIZE; i++) { - species[i] = 0; + species[i] = SPECIES_NONE; monIds[i] = 0; - heldItems[i] = 0; + heldItems[i] = ITEM_NONE; } lvlMode = gSaveBlock2Ptr->frontier.lvlMode; battleMode = VarGet(VAR_FRONTIER_BATTLE_MODE); - challengeNum = gSaveBlock2Ptr->frontier.factoryWinStreaks[battleMode][lvlMode] / 7; + challengeNum = gSaveBlock2Ptr->frontier.factoryWinStreaks[battleMode][lvlMode] / FRONTIER_STAGES_PER_CHALLENGE; if (VarGet(VAR_FRONTIER_BATTLE_MODE) == FRONTIER_MODE_DOUBLES) factoryBattleMode = FRONTIER_MODE_DOUBLES; else @@ -582,7 +582,7 @@ static void GenerateInitialRentalMons(void) // Cannot have two same held items. for (j = firstMonId; j < firstMonId + i; j++) { - if (heldItems[j] != 0 && heldItems[j] == gBattleFrontierHeldItems[gFacilityTrainerMons[monId].itemTableId]) + if (heldItems[j] != ITEM_NONE && heldItems[j] == gBattleFrontierHeldItems[gFacilityTrainerMons[monId].itemTableId]) { if (gFacilityTrainerMons[monId].species == currSpecies) currSpecies = SPECIES_NONE; @@ -761,7 +761,7 @@ void FillFactoryBrainParty(void) u8 lvlMode = gSaveBlock2Ptr->frontier.lvlMode; u8 battleMode = VarGet(VAR_FRONTIER_BATTLE_MODE); - u8 challengeNum = gSaveBlock2Ptr->frontier.factoryWinStreaks[battleMode][lvlMode] / 7; + u8 challengeNum = gSaveBlock2Ptr->frontier.factoryWinStreaks[battleMode][lvlMode] / FRONTIER_STAGES_PER_CHALLENGE; fixedIV = GetFactoryMonFixedIV(challengeNum + 2, FALSE); monLevel = SetFacilityPtrsGetLevel(); i = 0; @@ -890,7 +890,7 @@ u32 GetAiScriptsInBattleFactory(void) else { int battleMode = VarGet(VAR_FRONTIER_BATTLE_MODE); - int challengeNum = gSaveBlock2Ptr->frontier.factoryWinStreaks[battleMode][lvlMode] / 7; + int challengeNum = gSaveBlock2Ptr->frontier.factoryWinStreaks[battleMode][lvlMode] / FRONTIER_STAGES_PER_CHALLENGE; if (gTrainerBattleOpponent_A == TRAINER_FRONTIER_BRAIN) return AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY; diff --git a/src/battle_factory_screen.c b/src/battle_factory_screen.c index c5633ce28c15..a543e64c9317 100644 --- a/src/battle_factory_screen.c +++ b/src/battle_factory_screen.c @@ -28,6 +28,7 @@ #include "strings.h" #include "graphics.h" #include "constants/battle_frontier.h" +#include "constants/battle_tent.h" #include "constants/songs.h" #include "constants/rgb.h" @@ -43,6 +44,9 @@ #define SELECTABLE_MONS_COUNT 6 +#define PALNUM_FADE_TEXT 14 +#define PALNUM_TEXT 15 + enum { PALTAG_BALL_GRAY = 100, PALTAG_BALL_SELECTED, @@ -350,7 +354,7 @@ static const struct WindowTemplate sSelect_WindowTemplates[] = .tilemapTop = 2, .width = 12, .height = 2, - .paletteNum = 15, + .paletteNum = PALNUM_TEXT, .baseBlock = 0x0001, }, [SELECT_WIN_SPECIES] = { @@ -359,7 +363,7 @@ static const struct WindowTemplate sSelect_WindowTemplates[] = .tilemapTop = 2, .width = 11, .height = 2, - .paletteNum = 14, + .paletteNum = PALNUM_FADE_TEXT, .baseBlock = 0x0019, }, [SELECT_WIN_INFO] = { @@ -368,7 +372,7 @@ static const struct WindowTemplate sSelect_WindowTemplates[] = .tilemapTop = 15, .width = 20, .height = 3, - .paletteNum = 15, + .paletteNum = PALNUM_TEXT, .baseBlock = 0x002f, }, [SELECT_WIN_OPTIONS] = { @@ -377,7 +381,7 @@ static const struct WindowTemplate sSelect_WindowTemplates[] = .tilemapTop = 14, .width = 8, .height = 6, - .paletteNum = 15, + .paletteNum = PALNUM_TEXT, .baseBlock = 0x006b, }, [SELECT_WIN_YES_NO] = { @@ -386,7 +390,7 @@ static const struct WindowTemplate sSelect_WindowTemplates[] = .tilemapTop = 14, .width = 8, .height = 4, - .paletteNum = 15, + .paletteNum = PALNUM_TEXT, .baseBlock = 0x009b, }, [SELECT_WIN_MON_CATEGORY] = { @@ -395,7 +399,7 @@ static const struct WindowTemplate sSelect_WindowTemplates[] = .tilemapTop = 0, .width = 15, .height = 2, - .paletteNum = 15, + .paletteNum = PALNUM_TEXT, .baseBlock = 0x00bb, }, DUMMY_WIN_TEMPLATE, @@ -634,7 +638,11 @@ static const struct SpriteSheet sSwap_SpriteSheets[] = {sMenuHighlightRight_Gfx, sizeof(sMenuHighlightRight_Gfx), GFXTAG_MENU_HIGHLIGHT_RIGHT}, {sActionBoxLeft_Gfx, sizeof(sActionBoxLeft_Gfx), GFXTAG_ACTION_BOX_LEFT}, {sActionBoxRight_Gfx, sizeof(sActionBoxRight_Gfx), GFXTAG_ACTION_BOX_RIGHT}, - {sActionHighlightLeft_Gfx, 0x100, GFXTAG_ACTION_HIGHLIGHT_LEFT}, +#ifdef BUGFIX + {sActionHighlightLeft_Gfx, sizeof(sActionHighlightLeft_Gfx), GFXTAG_ACTION_HIGHLIGHT_LEFT}, +#else + {sActionHighlightLeft_Gfx, 8 * TILE_SIZE_4BPP, /* Incorrect size */ GFXTAG_ACTION_HIGHLIGHT_LEFT}, +#endif {sActionHighlightMiddle_Gfx, sizeof(sActionHighlightMiddle_Gfx), GFXTAG_ACTION_HIGHLIGHT_MIDDLE}, {sActionHighlightRight_Gfx, sizeof(sActionHighlightRight_Gfx), GFXTAG_ACTION_HIGHLIGHT_RIGHT}, {sMonPicBgAnim_Gfx, sizeof(sMonPicBgAnim_Gfx), GFXTAG_MON_PIC_BG_ANIM}, @@ -945,7 +953,7 @@ static const struct WindowTemplate sSwap_WindowTemplates[] = .tilemapTop = 2, .width = 12, .height = 2, - .paletteNum = 15, + .paletteNum = PALNUM_TEXT, .baseBlock = 0x0001, }, [SWAP_WIN_SPECIES] = { @@ -954,7 +962,7 @@ static const struct WindowTemplate sSwap_WindowTemplates[] = .tilemapTop = 2, .width = 11, .height = 2, - .paletteNum = 14, + .paletteNum = PALNUM_FADE_TEXT, .baseBlock = 0x0019, }, [SWAP_WIN_INFO] = { @@ -963,7 +971,7 @@ static const struct WindowTemplate sSwap_WindowTemplates[] = .tilemapTop = 15, .width = 20, .height = 3, - .paletteNum = 15, + .paletteNum = PALNUM_TEXT, .baseBlock = 0x002f, }, [SWAP_WIN_OPTIONS] = { @@ -972,7 +980,7 @@ static const struct WindowTemplate sSwap_WindowTemplates[] = .tilemapTop = 14, .width = 9, .height = 6, - .paletteNum = 15, + .paletteNum = PALNUM_TEXT, .baseBlock = 0x006b, }, [SWAP_WIN_YES_NO] = { @@ -981,7 +989,7 @@ static const struct WindowTemplate sSwap_WindowTemplates[] = .tilemapTop = 14, .width = 8, .height = 4, - .paletteNum = 15, + .paletteNum = PALNUM_TEXT, .baseBlock = 0x00a1, }, [SWAP_WIN_ACTION_FADE] = { @@ -990,7 +998,7 @@ static const struct WindowTemplate sSwap_WindowTemplates[] = .tilemapTop = 15, .width = 9, .height = 5, - .paletteNum = 14, + .paletteNum = PALNUM_FADE_TEXT, .baseBlock = 0x006b, }, [SWAP_WIN_UNUSED] = { @@ -999,7 +1007,7 @@ static const struct WindowTemplate sSwap_WindowTemplates[] = .tilemapTop = 2, .width = 4, .height = 2, - .paletteNum = 14, + .paletteNum = PALNUM_FADE_TEXT, .baseBlock = 0x00c1, }, [SWAP_WIN_SPECIES_AT_FADE] = { @@ -1008,7 +1016,7 @@ static const struct WindowTemplate sSwap_WindowTemplates[] = .tilemapTop = 2, .width = 11, .height = 2, - .paletteNum = 15, + .paletteNum = PALNUM_TEXT, .baseBlock = 0x00c9, }, [SWAP_WIN_MON_CATEGORY] = { @@ -1017,7 +1025,7 @@ static const struct WindowTemplate sSwap_WindowTemplates[] = .tilemapTop = 0, .width = 15, .height = 2, - .paletteNum = 15, + .paletteNum = PALNUM_TEXT, .baseBlock = 0x00df, }, DUMMY_WIN_TEMPLATE, @@ -1142,8 +1150,12 @@ static void CB2_InitSelectScreen(void) gMain.state++; break; case 1: - sSelectMenuTilesetBuffer = Alloc(0x440); - sSelectMonPicBgTilesetBuffer = AllocZeroed(0x440); + sSelectMenuTilesetBuffer = Alloc(sizeof(gFrontierFactoryMenu_Gfx)); +#ifdef BUGFIX + sSelectMonPicBgTilesetBuffer = AllocZeroed(sizeof(sMonPicBg_Gfx)); +#else + sSelectMonPicBgTilesetBuffer = AllocZeroed(sizeof(gFrontierFactoryMenu_Gfx)); // Incorrect size +#endif sSelectMenuTilemapBuffer = Alloc(BG_SCREEN_SIZE); sSelectMonPicBgTilemapBuffer = AllocZeroed(BG_SCREEN_SIZE); ChangeBgX(0, 0, BG_COORD_SET); @@ -1169,21 +1181,21 @@ static void CB2_InitSelectScreen(void) ResetSpriteData(); ResetTasks(); FreeAllSpritePalettes(); - CpuCopy16(gFrontierFactorySelectMenu_Gfx, sSelectMenuTilesetBuffer, 0x440); - CpuCopy16(sMonPicBg_Gfx, sSelectMonPicBgTilesetBuffer, 0x60); - LoadBgTiles(1, sSelectMenuTilesetBuffer, 0x440, 0); - LoadBgTiles(3, sSelectMonPicBgTilesetBuffer, 0x60, 0); - CpuCopy16(gFrontierFactorySelectMenu_Tilemap, sSelectMenuTilemapBuffer, BG_SCREEN_SIZE); + CpuCopy16(gFrontierFactoryMenu_Gfx, sSelectMenuTilesetBuffer, sizeof(gFrontierFactoryMenu_Gfx)); + CpuCopy16(sMonPicBg_Gfx, sSelectMonPicBgTilesetBuffer, sizeof(sMonPicBg_Gfx)); + LoadBgTiles(1, sSelectMenuTilesetBuffer, sizeof(gFrontierFactoryMenu_Gfx), 0); + LoadBgTiles(3, sSelectMonPicBgTilesetBuffer, sizeof(sMonPicBg_Gfx), 0); + CpuCopy16(gFrontierFactoryMenu_Tilemap, sSelectMenuTilemapBuffer, BG_SCREEN_SIZE); LoadBgTilemap(1, sSelectMenuTilemapBuffer, BG_SCREEN_SIZE, 0); - LoadPalette(gFrontierFactorySelectMenu_Pal, 0, 2 * PLTT_SIZE_4BPP); - LoadPalette(sSelectText_Pal, BG_PLTT_ID(15), PLTT_SIZEOF(4)); - LoadPalette(sSelectText_Pal, BG_PLTT_ID(14), PLTT_SIZEOF(5)); + LoadPalette(gFrontierFactoryMenu_Pal, 0, 2 * PLTT_SIZE_4BPP); + LoadPalette(sSelectText_Pal, BG_PLTT_ID(PALNUM_TEXT), PLTT_SIZEOF(4)); + LoadPalette(sSelectText_Pal, BG_PLTT_ID(PALNUM_FADE_TEXT), PLTT_SIZEOF(5)); #ifdef UBFIX if (sFactorySelectScreen && sFactorySelectScreen->fromSummaryScreen) #else if (sFactorySelectScreen->fromSummaryScreen == TRUE) #endif - gPlttBufferUnfaded[BG_PLTT_ID(14) + 4] = sFactorySelectScreen->speciesNameColorBackup; + gPlttBufferUnfaded[BG_PLTT_ID(PALNUM_FADE_TEXT) + 4] = sFactorySelectScreen->speciesNameColorBackup; LoadPalette(sMonPicBg_Pal, BG_PLTT_ID(2), PLTT_SIZEOF(2)); gMain.state++; break; @@ -1449,7 +1461,7 @@ static void Select_Task_OpenSummaryScreen(u8 taskId) switch (gTasks[taskId].tState) { case STATE_SUMMARY_FADE: - gPlttBufferUnfaded[BG_PLTT_ID(14) + 4] = gPlttBufferFaded[BG_PLTT_ID(14) + 4]; + gPlttBufferUnfaded[BG_PLTT_ID(PALNUM_FADE_TEXT) + 4] = gPlttBufferFaded[BG_PLTT_ID(PALNUM_FADE_TEXT) + 4]; BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); gTasks[taskId].tState = STATE_SUMMARY_CLEAN; break; @@ -1468,7 +1480,7 @@ static void Select_Task_OpenSummaryScreen(u8 taskId) } break; case STATE_SUMMARY_SHOW: - sFactorySelectScreen->speciesNameColorBackup = gPlttBufferUnfaded[BG_PLTT_ID(14) + 4]; + sFactorySelectScreen->speciesNameColorBackup = gPlttBufferUnfaded[BG_PLTT_ID(PALNUM_FADE_TEXT) + 4]; DestroyTask(taskId); sFactorySelectScreen->fromSummaryScreen = TRUE; currMonId = sFactorySelectScreen->cursorPos; @@ -1641,8 +1653,8 @@ static void Select_Task_HandleMenu(u8 taskId) { if (sFactorySelectScreen->fromSummaryScreen == TRUE) { - gPlttBufferFaded[BG_PLTT_ID(14) + 4] = sFactorySelectScreen->speciesNameColorBackup; - gPlttBufferUnfaded[BG_PLTT_ID(14) + 4] = gPlttBufferUnfaded[BG_PLTT_ID(15) + 4]; + gPlttBufferFaded[BG_PLTT_ID(PALNUM_FADE_TEXT) + 4] = sFactorySelectScreen->speciesNameColorBackup; + gPlttBufferUnfaded[BG_PLTT_ID(PALNUM_FADE_TEXT) + 4] = gPlttBufferUnfaded[BG_PLTT_ID(PALNUM_TEXT) + 4]; } sFactorySelectScreen->fromSummaryScreen = FALSE; gTasks[taskId].tState = STATE_MENU_HANDLE_INPUT; @@ -1735,9 +1747,9 @@ static void CreateFrontierFactorySelectableMons(u8 firstMonId) gFacilityTrainerMons = gBattleFrontierMons; if (gSaveBlock2Ptr->frontier.lvlMode != FRONTIER_LVL_50) - level = 100; + level = FRONTIER_MAX_LEVEL_OPEN; else - level = 50; + level = FRONTIER_MAX_LEVEL_50; rentalRank = GetNumPastRentalsRank(battleMode, lvlMode); otId = T1_READ_32(gSaveBlock2Ptr->playerTrainerId); @@ -1769,7 +1781,7 @@ static void CreateSlateportTentSelectableMons(u8 firstMonId) { u8 i, j; u8 ivs = 0; - u8 level = 30; + u8 level = TENT_MIN_LEVEL; u8 friendship = 0; u32 otId = 0; @@ -1993,7 +2005,7 @@ static void Select_PrintMonCategory(void) FillWindowPixelBuffer(SELECT_WIN_MON_CATEGORY, PIXEL_FILL(0)); species = GetMonData(&sFactorySelectScreen->mons[monId].monData, MON_DATA_SPECIES, NULL); CopyMonCategoryText(SpeciesToNationalPokedexNum(species), text); - x = GetStringRightAlignXOffset(FONT_NORMAL, text, 0x76); + x = GetStringRightAlignXOffset(FONT_NORMAL, text, 118); AddTextPrinterParameterized(SELECT_WIN_MON_CATEGORY, FONT_NORMAL, text, x, 1, 0, NULL); CopyWindowToVram(SELECT_WIN_MON_CATEGORY, COPYWIN_GFX); } @@ -2290,7 +2302,7 @@ static void Select_Task_FadeSpeciesName(u8 taskId) else sFactorySelectScreen->fadeSpeciesNameCoeff++; } - BlendPalettes(0x4000, sFactorySelectScreen->fadeSpeciesNameCoeff, 0); + BlendPalettes(1 << PALNUM_FADE_TEXT, sFactorySelectScreen->fadeSpeciesNameCoeff, 0); if (sFactorySelectScreen->fadeSpeciesNameCoeff > 5) { sFactorySelectScreen->fadeSpeciesNameFadeOut = FALSE; @@ -2388,7 +2400,7 @@ static void Swap_Task_OpenSummaryScreen(u8 taskId) case STATE_SUMMARY_SHOW: DestroyTask(taskId); sFactorySwapScreen->fromSummaryScreen = TRUE; - sFactorySwapScreen->speciesNameColorBackup = gPlttBufferUnfaded[BG_PLTT_ID(15) + 4]; + sFactorySwapScreen->speciesNameColorBackup = gPlttBufferUnfaded[BG_PLTT_ID(PALNUM_TEXT) + 4]; ShowPokemonSummaryScreen(SUMMARY_MODE_NORMAL, gPlayerParty, sFactorySwapScreen->cursorPos, FRONTIER_PARTY_SIZE - 1, CB2_InitSwapScreen); break; } @@ -2709,7 +2721,7 @@ static void Swap_Task_FadeSpeciesName(u8 taskId) else sFactorySwapScreen->fadeSpeciesNameCoeff++; } - BlendPalettes(0x4000, sFactorySwapScreen->fadeSpeciesNameCoeff, 0); + BlendPalettes(1 << PALNUM_FADE_TEXT, sFactorySwapScreen->fadeSpeciesNameCoeff, 0); if (sFactorySwapScreen->fadeSpeciesNameCoeff > 5) { sFactorySwapScreen->fadeSpeciesNameFadeOut = FALSE; @@ -2748,7 +2760,7 @@ static void Swap_Task_FadeOutSpeciesName(u8 taskId) gTasks[taskId].tState++; break; case 1: - LoadPalette(&gPlttBufferUnfaded[BG_PLTT_ID(15)], BG_PLTT_ID(14), PLTT_SIZEOF(5)); + LoadPalette(&gPlttBufferUnfaded[BG_PLTT_ID(PALNUM_TEXT)], BG_PLTT_ID(PALNUM_FADE_TEXT), PLTT_SIZEOF(5)); gTasks[taskId].tState++; break; case 2: @@ -2761,10 +2773,10 @@ static void Swap_Task_FadeOutSpeciesName(u8 taskId) if (sFactorySwapScreen->fadeSpeciesNameCoeffDelay > 3) { sFactorySwapScreen->fadeSpeciesNameCoeffDelay = 0; - gPlttBufferUnfaded[BG_PLTT_ID(15) + 4] = gPlttBufferFaded[BG_PLTT_ID(14) + 4]; + gPlttBufferUnfaded[BG_PLTT_ID(PALNUM_TEXT) + 4] = gPlttBufferFaded[BG_PLTT_ID(PALNUM_FADE_TEXT) + 4]; sFactorySwapScreen->fadeSpeciesNameCoeff++; } - BlendPalettes(0x4000, sFactorySwapScreen->fadeSpeciesNameCoeff, 0); + BlendPalettes(1 << PALNUM_FADE_TEXT, sFactorySwapScreen->fadeSpeciesNameCoeff, 0); break; } } @@ -2994,7 +3006,7 @@ static void Swap_Task_ScreenInfoTransitionOut(u8 taskId) switch (gTasks[taskId].tState) { case 0: - LoadPalette(sSwapText_Pal, BG_PLTT_ID(14), sizeof(sSwapText_Pal)); + LoadPalette(sSwapText_Pal, BG_PLTT_ID(PALNUM_FADE_TEXT), sizeof(sSwapText_Pal)); Swap_PrintActionStrings(); PutWindowTilemap(SWAP_WIN_ACTION_FADE); gTasks[taskId].tState++; @@ -3004,7 +3016,7 @@ static void Swap_Task_ScreenInfoTransitionOut(u8 taskId) gTasks[taskId].tState++; break; case 2: - BeginNormalPaletteFade(0x4000, 0, 0, 16, sPokeballGray_Pal[37]); + BeginNormalPaletteFade(1 << PALNUM_FADE_TEXT, 0, 0, 16, sPokeballGray_Pal[37]); gTasks[taskId].tState++; break; case 3: @@ -3125,14 +3137,14 @@ static void Swap_Task_ScreenInfoTransitionIn(u8 taskId) if (gTasks[taskId].tSlideFinishedPkmn == TRUE && gTasks[taskId].tSlideFinishedCancel == TRUE) { - gPlttBufferFaded[BG_PLTT_ID(14) + 2] = sPokeballGray_Pal[37]; + gPlttBufferFaded[BG_PLTT_ID(PALNUM_FADE_TEXT) + 2] = sPokeballGray_Pal[37]; Swap_PrintActionStrings(); PutWindowTilemap(SWAP_WIN_ACTION_FADE); gTasks[taskId].tState++; } break; case 3: - BeginNormalPaletteFade(0x4000, 0, 16, 0, sPokeballGray_Pal[37]); + BeginNormalPaletteFade(1 << PALNUM_FADE_TEXT, 0, 16, 0, sPokeballGray_Pal[37]); gTasks[taskId].tState++; break; case 4: @@ -3275,8 +3287,12 @@ static void CB2_InitSwapScreen(void) gMain.state++; break; case 1: - sSwapMenuTilesetBuffer = Alloc(0x440); - sSwapMonPicBgTilesetBuffer = AllocZeroed(0x440); + sSwapMenuTilesetBuffer = Alloc(sizeof(gFrontierFactoryMenu_Gfx)); +#ifdef BUGFIX + sSwapMonPicBgTilesetBuffer = AllocZeroed(sizeof(sMonPicBg_Gfx)); +#else + sSwapMonPicBgTilesetBuffer = AllocZeroed(sizeof(gFrontierFactoryMenu_Gfx)); // Incorrect size +#endif sSwapMenuTilemapBuffer = Alloc(BG_SCREEN_SIZE); sSwapMonPicBgTilemapBuffer = AllocZeroed(BG_SCREEN_SIZE); ChangeBgX(0, 0, BG_COORD_SET); @@ -3303,15 +3319,15 @@ static void CB2_InitSwapScreen(void) ResetTasks(); FreeAllSpritePalettes(); ResetAllPicSprites(); - CpuCopy16(gFrontierFactorySelectMenu_Gfx, sSwapMenuTilesetBuffer, 0x440); - CpuCopy16(sMonPicBg_Gfx, sSwapMonPicBgTilesetBuffer, 0x60); - LoadBgTiles(1, sSwapMenuTilesetBuffer, 0x440, 0); - LoadBgTiles(3, sSwapMonPicBgTilesetBuffer, 0x60, 0); - CpuCopy16(gFrontierFactorySelectMenu_Tilemap, sSwapMenuTilemapBuffer, BG_SCREEN_SIZE); + CpuCopy16(gFrontierFactoryMenu_Gfx, sSwapMenuTilesetBuffer, sizeof(gFrontierFactoryMenu_Gfx)); + CpuCopy16(sMonPicBg_Gfx, sSwapMonPicBgTilesetBuffer, sizeof(sMonPicBg_Gfx)); + LoadBgTiles(1, sSwapMenuTilesetBuffer, sizeof(gFrontierFactoryMenu_Gfx), 0); + LoadBgTiles(3, sSwapMonPicBgTilesetBuffer, sizeof(sMonPicBg_Gfx), 0); + CpuCopy16(gFrontierFactoryMenu_Tilemap, sSwapMenuTilemapBuffer, BG_SCREEN_SIZE); LoadBgTilemap(1, sSwapMenuTilemapBuffer, BG_SCREEN_SIZE, 0); - LoadPalette(gFrontierFactorySelectMenu_Pal, 0, 2 * PLTT_SIZE_4BPP); - LoadPalette(sSwapText_Pal, BG_PLTT_ID(15), sizeof(sSwapText_Pal)); - LoadPalette(sSwapText_Pal, BG_PLTT_ID(14), sizeof(sSwapText_Pal)); + LoadPalette(gFrontierFactoryMenu_Pal, 0, 2 * PLTT_SIZE_4BPP); + LoadPalette(sSwapText_Pal, BG_PLTT_ID(PALNUM_TEXT), sizeof(sSwapText_Pal)); + LoadPalette(sSwapText_Pal, BG_PLTT_ID(PALNUM_FADE_TEXT), sizeof(sSwapText_Pal)); LoadPalette(sMonPicBg_Pal, BG_PLTT_ID(2), PLTT_SIZEOF(2)); gMain.state++; break; @@ -3808,7 +3824,7 @@ static void Swap_PrintYesNoOptions(void) static void Swap_PrintActionString(const u8 *str, u32 y, u32 windowId) { - s32 x = GetStringRightAlignXOffset(FONT_SMALL, str, 0x46); + s32 x = GetStringRightAlignXOffset(FONT_SMALL, str, 70); AddTextPrinterParameterized3(windowId, FONT_SMALL, x, y, sSwapMenuOptionsTextColors, 0, str); } @@ -3864,10 +3880,10 @@ static void Swap_PrintMonSpeciesAtFade(void) CpuCopy16(sSwapText_Pal, pal, 8); if (!sFactorySwapScreen->fromSummaryScreen) - pal[4] = gPlttBufferFaded[BG_PLTT_ID(14) + 4]; + pal[4] = gPlttBufferFaded[BG_PLTT_ID(PALNUM_FADE_TEXT) + 4]; else pal[4] = sFactorySwapScreen->speciesNameColorBackup; - LoadPalette(pal, BG_PLTT_ID(15), sizeof(sSwapText_Pal)); + LoadPalette(pal, BG_PLTT_ID(PALNUM_TEXT), sizeof(sSwapText_Pal)); PutWindowTilemap(SWAP_WIN_SPECIES_AT_FADE); FillWindowPixelBuffer(SWAP_WIN_SPECIES_AT_FADE, PIXEL_FILL(0)); @@ -3895,8 +3911,8 @@ static void Swap_PrintMonSpeciesForTransition(void) u16 species; u8 x; - LoadPalette(sSwapText_Pal, BG_PLTT_ID(14), sizeof(sSwapText_Pal)); - CpuCopy16(&gPlttBufferUnfaded[BG_PLTT_ID(15)], &gPlttBufferFaded[BG_PLTT_ID(14)], PLTT_SIZEOF(5)); + LoadPalette(sSwapText_Pal, BG_PLTT_ID(PALNUM_FADE_TEXT), sizeof(sSwapText_Pal)); + CpuCopy16(&gPlttBufferUnfaded[BG_PLTT_ID(PALNUM_TEXT)], &gPlttBufferFaded[BG_PLTT_ID(PALNUM_FADE_TEXT)], PLTT_SIZEOF(5)); if (sFactorySwapScreen->cursorPos >= FRONTIER_PARTY_SIZE) { @@ -3936,7 +3952,7 @@ static void Swap_PrintMonCategory(void) else species = GetMonData(&gEnemyParty[monId], MON_DATA_SPECIES, NULL); CopyMonCategoryText(SpeciesToNationalPokedexNum(species), text); - x = GetStringRightAlignXOffset(FONT_NORMAL, text, 0x76); + x = GetStringRightAlignXOffset(FONT_NORMAL, text, 118); AddTextPrinterParameterized(SWAP_WIN_MON_CATEGORY, FONT_NORMAL, text, x, 1, 0, NULL); CopyWindowToVram(SWAP_WIN_MON_CATEGORY, COPYWIN_GFX); } diff --git a/src/battle_pike.c b/src/battle_pike.c index 462ae4f383fa..d45a358d17d8 100644 --- a/src/battle_pike.c +++ b/src/battle_pike.c @@ -1267,6 +1267,10 @@ static void TryHealMons(u8 healCount) for (i = 0; i < FRONTIER_PARTY_SIZE; i++) indices[i] = i; + + // Only 'healCount' number of pokemon will be healed. + // The order in which they're (attempted to be) healed is random, + // and determined by performing 10 random swaps to this index array. for (k = 0; k < 10; k++) { u8 temp; @@ -1423,6 +1427,7 @@ static void PrepareTwoTrainers(void) gFacilityTrainers = gBattleFrontierTrainers; do { + // Pick the 1st trainer, making sure it's not one that's been encountered yet in this challenge. trainerId = GetRandomScaledFrontierTrainerId(challengeNum, 1); for (i = 0; i < gSaveBlock2Ptr->frontier.curChallengeBattleNum - 1; i++) { @@ -1438,6 +1443,7 @@ static void PrepareTwoTrainers(void) do { + // Pick the 2nd trainer, making sure it's not one that's been encountered yet in this challenge. trainerId = GetRandomScaledFrontierTrainerId(challengeNum, 1); for (i = 0; i < gSaveBlock2Ptr->frontier.curChallengeBattleNum; i++) { diff --git a/src/battle_pyramid.c b/src/battle_pyramid.c index 07d7772f42d8..a692a4db88c0 100644 --- a/src/battle_pyramid.c +++ b/src/battle_pyramid.c @@ -38,6 +38,8 @@ #include "constants/moves.h" #include "constants/trainers.h" +#define NUM_LAYOUT_OFFSETS 8 // Assumed to be a power of 2 + extern const struct MapLayout *const gMapLayouts[]; struct PyramidWildMon @@ -55,7 +57,7 @@ struct PyramidFloorTemplate u8 itemPositions; u8 trainerPositions; u8 runMultiplier; - u8 layoutOffsets[8]; + u8 layoutOffsets[NUM_LAYOUT_OFFSETS]; }; struct PyramidTrainerEncounterMusic @@ -1902,7 +1904,7 @@ static void GetPyramidFloorLayoutOffsets(u8 *layoutOffsets) for (i = 0; i < NUM_PYRAMID_FLOOR_SQUARES; i++) { - layoutOffsets[i] = sPyramidFloorTemplates[id].layoutOffsets[rand & 0x7]; + layoutOffsets[i] = sPyramidFloorTemplates[id].layoutOffsets[rand & (NUM_LAYOUT_OFFSETS - 1)]; rand >>= 3; if (i == 7) { diff --git a/src/battle_tower.c b/src/battle_tower.c index 8838b5f2d274..4e99ec9add49 100644 --- a/src/battle_tower.c +++ b/src/battle_tower.c @@ -3175,7 +3175,7 @@ void CalcApprenticeChecksum(struct Apprentice *apprentice) s32 i; apprentice->checksum = 0; - for (i = 0; i < (sizeof(struct Apprentice) - 4) / 4; i++) + for (i = 0; i < offsetof(struct Apprentice, checksum) / sizeof(u32); i++) apprentice->checksum += ((u32 *)apprentice)[i]; } @@ -3183,7 +3183,7 @@ static void ClearApprentice(struct Apprentice *apprentice) { s32 i; - for (i = 0; i < (sizeof(struct Apprentice)) / 4; i++) + for (i = 0; i < sizeof(struct Apprentice) / sizeof(u32); i++) ((u32 *)apprentice)[i] = 0; ResetApprenticeStruct(apprentice); } @@ -3196,7 +3196,7 @@ static void ValidateApprenticesChecksums(void) { u32 *data = (u32 *) &gSaveBlock2Ptr->apprentices[i]; u32 checksum = 0; - for (j = 0; j < (sizeof(struct Apprentice) - 4) / 4; j++) + for (j = 0; j < offsetof(struct Apprentice, checksum) / sizeof(u32); j++) checksum += data[j]; if (gSaveBlock2Ptr->apprentices[i].checksum != checksum) ClearApprentice(&gSaveBlock2Ptr->apprentices[i]); @@ -3506,7 +3506,7 @@ bool32 ValidateBattleTowerRecord(u8 recordId) // unused u32 *record = (u32 *)(&gSaveBlock2Ptr->frontier.towerRecords[recordId]); u32 checksum = 0; u32 hasData = 0; - for (i = 0; i < (sizeof(struct EmeraldBattleTowerRecord) - 4) / 4; i++) // - 4, because of the last fjeld bejng the checksum jtself. + for (i = 0; i < offsetof(struct EmeraldBattleTowerRecord, checksum) / sizeof(u32); i++) { checksum += record[i]; hasData |= record[i]; diff --git a/src/field_specials.c b/src/field_specials.c index 38746c97a48a..51c905513d59 100644 --- a/src/field_specials.c +++ b/src/field_specials.c @@ -57,7 +57,6 @@ #include "constants/heal_locations.h" #include "constants/map_types.h" #include "constants/mystery_gift.h" -#include "constants/script_menu.h" #include "constants/slot_machine.h" #include "constants/songs.h" #include "constants/moves.h" diff --git a/src/frontier_util.c b/src/frontier_util.c index 8cd385e65397..528d83a65990 100644 --- a/src/frontier_util.c +++ b/src/frontier_util.c @@ -698,8 +698,8 @@ static const u8 *const sRecordsWindowChallengeTexts[][2] = static const u8 *const sLevelModeText[] = { - gText_RecordsLv50, - gText_RecordsOpenLevel, + [FRONTIER_LVL_50] = gText_RecordsLv50, + [FRONTIER_LVL_OPEN] = gText_RecordsOpenLevel, }; static const u8 *const sHallFacilityToRecordsText[] = diff --git a/src/graphics.c b/src/graphics.c index 3cfd47ea76a0..220f5d44d95a 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -955,7 +955,7 @@ const u32 gDomeTourneyInfoCard_Gfx[] = INCBIN_U32("graphics/battle_frontier/tour const u32 gDomeTourneyInfoCard_Tilemap[] = INCBIN_U32("graphics/battle_frontier/tourney_info_card_tilemap.bin.lz"); const u32 gDomeTourneyInfoCardBg_Tilemap[] = INCBIN_U32("graphics/battle_frontier/tourney_info_card_bg.bin.lz"); const u32 gDomeTourneyTreeButtons_Gfx[] = INCBIN_U32("graphics/battle_frontier/tourney_buttons.4bpp.lz"); // exit/cancel and pokeball buttons -const u32 gDomeTourneyTree_Pal[] = INCBIN_U32("graphics/battle_frontier/tourney.gbapal.lz"); +const u32 gDomeTourneyTree_Pal[] = INCBIN_U32("graphics/battle_frontier/tourney_tree.gbapal.lz"); const u32 gDomeTourneyTreeButtons_Pal[] = INCBIN_U32("graphics/battle_frontier/tourney_buttons.gbapal.lz"); const u32 gDomeTourneyMatchCardBg_Pal[] = INCBIN_U32("graphics/battle_frontier/tourney_match_card_bg.gbapal.lz"); @@ -1216,13 +1216,9 @@ const u32 gRouletteMultiplier_Gfx[] = INCBIN_U32("graphics/roulette/multiplier.4 #include "data/graphics/mail.h" -const u16 gFrontierFactorySelectMenu_Pal[] = INCBIN_U16("graphics/battle_frontier/factory_menu1.gbapal"); -const u16 gFrontierFactorySelectMenu_Pal2[] = INCBIN_U16("graphics/battle_frontier/factory_menu2.gbapal"); - -const u16 gFrontierFactorySelectMenu_Gfx[] = INCBIN_U16("graphics/battle_frontier/factory_menu1.4bpp"); -const u16 gFrontierFactorySelectMenu_Gfx2[] = INCBIN_U16("graphics/battle_frontier/factory_menu2.4bpp"); - -const u16 gFrontierFactorySelectMenu_Tilemap[] = INCBIN_U16("graphics/battle_frontier/factory_menu.bin"); +const u16 gFrontierFactoryMenu_Pal[] = INCBIN_U16("graphics/battle_frontier/factory_screen/menu.gbapal"); +const u16 gFrontierFactoryMenu_Gfx[] = INCBIN_U16("graphics/battle_frontier/factory_screen/menu.4bpp"); +const u16 gFrontierFactoryMenu_Tilemap[] = INCBIN_U16("graphics/battle_frontier/factory_screen/menu.bin"); const u32 gFrontierPassMedals_Gfx[] = INCBIN_U32("graphics/frontier_pass/medals.4bpp.lz"); diff --git a/src/start_menu.c b/src/start_menu.c index f19af9c09d7e..e39a5438ee00 100644 --- a/src/start_menu.c +++ b/src/start_menu.c @@ -137,7 +137,15 @@ static void Task_SaveAfterLinkBattle(u8 taskId); static void Task_WaitForBattleTowerLinkSave(u8 taskId); static bool8 FieldCB_ReturnToFieldStartMenu(void); -static const struct WindowTemplate sSafariBallsWindowTemplate = {0, 1, 1, 9, 4, 0xF, 8}; +static const struct WindowTemplate sWindowTemplate_SafariBalls = { + .bg = 0, + .tilemapLeft = 1, + .tilemapTop = 1, + .width = 9, + .height = 4, + .paletteNum = 15, + .baseBlock = 0x8 +}; static const u8 *const sPyramidFloorNames[FRONTIER_STAGES_PER_CHALLENGE + 1] = { @@ -151,8 +159,25 @@ static const u8 *const sPyramidFloorNames[FRONTIER_STAGES_PER_CHALLENGE + 1] = gText_Peak }; -static const struct WindowTemplate sPyramidFloorWindowTemplate_2 = {0, 1, 1, 0xA, 4, 0xF, 8}; -static const struct WindowTemplate sPyramidFloorWindowTemplate_1 = {0, 1, 1, 0xC, 4, 0xF, 8}; +static const struct WindowTemplate sWindowTemplate_PyramidFloor = { + .bg = 0, + .tilemapLeft = 1, + .tilemapTop = 1, + .width = 10, + .height = 4, + .paletteNum = 15, + .baseBlock = 0x8 +}; + +static const struct WindowTemplate sWindowTemplate_PyramidPeak = { + .bg = 0, + .tilemapLeft = 1, + .tilemapTop = 1, + .width = 12, + .height = 4, + .paletteNum = 15, + .baseBlock = 0x8 +}; static const struct MenuAction sStartMenuItems[] = { @@ -382,7 +407,7 @@ static void BuildMultiPartnerRoomStartMenu(void) static void ShowSafariBallsWindow(void) { - sSafariBallsWindowId = AddWindow(&sSafariBallsWindowTemplate); + sSafariBallsWindowId = AddWindow(&sWindowTemplate_SafariBalls); PutWindowTilemap(sSafariBallsWindowId); DrawStdWindowFrame(sSafariBallsWindowId, FALSE); ConvertIntToDecimalStringN(gStringVar1, gNumSafariBalls, STR_CONV_MODE_RIGHT_ALIGN, 2); @@ -394,9 +419,9 @@ static void ShowSafariBallsWindow(void) static void ShowPyramidFloorWindow(void) { if (gSaveBlock2Ptr->frontier.curChallengeBattleNum == FRONTIER_STAGES_PER_CHALLENGE) - sBattlePyramidFloorWindowId = AddWindow(&sPyramidFloorWindowTemplate_1); + sBattlePyramidFloorWindowId = AddWindow(&sWindowTemplate_PyramidPeak); else - sBattlePyramidFloorWindowId = AddWindow(&sPyramidFloorWindowTemplate_2); + sBattlePyramidFloorWindowId = AddWindow(&sWindowTemplate_PyramidFloor); PutWindowTilemap(sBattlePyramidFloorWindowId); DrawStdWindowFrame(sBattlePyramidFloorWindowId, FALSE); diff --git a/src/tv.c b/src/tv.c index db00cf31f10f..8af80a9ef09b 100644 --- a/src/tv.c +++ b/src/tv.c @@ -45,7 +45,6 @@ #include "constants/metatile_labels.h" #include "constants/moves.h" #include "constants/region_map_sections.h" -#include "constants/script_menu.h" #define LAST_TVSHOW_IDX (TV_SHOWS_COUNT - 1)