From 16c0be7ed26528b6bc485a0085c7bb97add15a1b Mon Sep 17 00:00:00 2001 From: GriffinR Date: Mon, 31 Jul 2023 20:00:34 -0400 Subject: [PATCH 1/2] Fix some frontier gfx, adjacent cleanup --- graphics/battle_frontier/factory_menu1.png | Bin 309 -> 0 bytes graphics/battle_frontier/factory_menu2.png | Bin 234 -> 0 bytes .../menu.bin} | Bin .../battle_frontier/factory_screen/menu.png | Bin 0 -> 3876 bytes graphics/battle_frontier/tourney.pal | 259 --------- graphics/battle_frontier/tourney_tree.png | Bin 983 -> 7347 bytes include/constants/trainer_hill.h | 2 +- include/graphics.h | 6 +- src/battle_dome.c | 550 +++++++++--------- src/battle_factory.c | 12 +- src/battle_factory_screen.c | 138 +++-- src/battle_pike.c | 6 + src/battle_pyramid.c | 6 +- src/battle_tower.c | 8 +- src/frontier_util.c | 4 +- src/graphics.c | 12 +- src/start_menu.c | 37 +- 17 files changed, 428 insertions(+), 612 deletions(-) delete mode 100644 graphics/battle_frontier/factory_menu1.png delete mode 100644 graphics/battle_frontier/factory_menu2.png rename graphics/battle_frontier/{factory_menu.bin => factory_screen/menu.bin} (100%) create mode 100644 graphics/battle_frontier/factory_screen/menu.png delete mode 100644 graphics/battle_frontier/tourney.pal diff --git a/graphics/battle_frontier/factory_menu1.png b/graphics/battle_frontier/factory_menu1.png deleted file mode 100644 index 52f073ff3081c164655a460c9fdc5b9b13800c8b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 309 zcmeAS@N?(olHy`uVBq!ia0vp^JAjyjg&D-UuF(jj3<7*YT!AzY{J+PbscGrx7!(zi z1QEd`*Ia$pyk@VEhuRXL+yPG)#}JK)t&=YDHXHD;Zf@G^sB6fO)MCV#_3b`GC+Cae z9QJUor?o6eZyq~nvMMf7I-*qdbX(H<(*5qG!e_g#hY(&Sq&{-^ot+PB^w7na%?wC}P_u52m) z=JV*)m8+Erd|xX*E60c@oA0RTUwQgO4Zp?l`{$Yqo2J}8x_0Nv;1!#Fm_IL>=hwr} j_i(eRIWt#jj>tdOyzJ@QX4aQ|1o_j`)z4*}Q$iB}f>3vE diff --git a/graphics/battle_frontier/factory_menu2.png b/graphics/battle_frontier/factory_menu2.png deleted file mode 100644 index 0d103927e439ad225fe8028b15a5a095cedfccca..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 234 zcmeAS@N?(olHy`uVBq!ia0vp^5kSnr!VDz)O;tYtDT4r?5LX}#2TRthdH3zzy=Tw% z9zELJ+zb@o`|R7AtIwwFJ=?ry@Bjb*fg-;a&+q|KrJgR1ArezdCv4fSnm)b$^qH7L zQ+7<;`snoTj>QgBZf|Oi}@n#9S*29kF-wJ3-9F`v>A|7j%ssf{DnXzM3t X!}{xT85zR*AQyYO`njxgN@xNAEY@4# 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 0000000000000000000000000000000000000000..5271973b31090763aa5dc7bc467549e706fde5a3 GIT binary patch literal 3876 zcmV+<58LpGP) zaB^>EX>4U6ba`-PAZ2)IW&i+q+O3&ck|eneME`jT9f9Bm@;KaJrW@$^dWgubUT4fk zrpoEcC}so~INn~c07Ruk6lg}CfK^H*f3$RRXx3aysI|7LwbxN+%dNE9TGQqnH8pF| zs!dh94xK&s(ra&Bd+(#qkw%8X>S#m5=wpmIS#&b>EuKCpLR5ye#V(sE~#|Ot+!ph{f;}0T(fM&sx?#VHf(;O_CfV$)Z`cB z{vI{?pyr5`=RW<88pEpJrVyu->X?C8Dgxr_2$0apF^gSFNsgRj7Kam9O`s;#!8ziH zfnd3ks>v62-;w)U+(Iq?2)FcC$OVV)|AAa^=sw8(j@utlJM&SL`~c)t=rN7iAU1Be zeI9OdvB{w0R|XfgXUsZ^pne4fsX-%l-@m75uFut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L{uHOJl-5x|XXW+-0x0DPLjX6G zmoY#PK#m0@F;FUSVF+MCdzAtNWnQ`%0+=xWNCDP&O&9~3J|8 zkemlI0rzEk9_*b91_5vmNY8_#&jn`kBY^g0T>{|v_U-@z0Wtjsx9Ekt{h1yCN~ z1c0M2n9~7>LjXA*aN7r5j0B(%AY*%ffq+rQZw62?K>cgLeMz~I?SaBk$OA+!sCuMXT)U52O#kh!h9 z4AG{W+3y9P*00000NkvWtM6N<$ Ef>CXTjQ{`u diff --git a/include/constants/trainer_hill.h b/include/constants/trainer_hill.h index e0f660b6f..610cb81c6 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 04ad64606..e2d0060f5 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/src/battle_dome.c b/src/battle_dome.c index 32a43c3d9..ffb7fa5bb 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_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(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_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(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_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(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_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(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_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(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_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(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_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(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_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(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_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(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_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(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_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(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_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(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_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(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_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(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_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(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_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(lastSrc) \ - {.src = 0x6027, .y = 0x06, .x = 0x0b}, \ - {.src = 0x6047, .y = 0x07, .x = 0x0b}, \ - {.src = lastSrc, .y = 0x07, .x = 0x0c}, +#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(lastSrc) \ - {.src = 0x6027, .y = 0x08, .x = 0x0b}, \ - {.src = 0x6027, .y = 0x07, .x = 0x0b}, \ - {.src = lastSrc, .y = 0x07, .x = 0x0c}, +#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(lastSrc) \ - {.src = 0x6027, .y = 0x0e, .x = 0x0b}, \ - {.src = 0x6047, .y = 0x0f, .x = 0x0b}, \ - {.src = lastSrc, .y = 0x0f, .x = 0x0c}, +#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(lastSrc) \ - {.src = 0x6027, .y = 0x10, .x = 0x0b}, \ - {.src = 0x6027, .y = 0x0f, .x = 0x0b}, \ - {.src = lastSrc, .y = 0x0f, .x = 0x0c}, +#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(lastSrc) \ - {.src = 0x6029, .y = 0x06, .x = 0x12}, \ - {.src = 0x6049, .y = 0x07, .x = 0x12}, \ - {.src = lastSrc, .y = 0x07, .x = 0x11}, +#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(lastSrc) \ - {.src = 0x6029, .y = 0x08, .x = 0x12}, \ - {.src = 0x6029, .y = 0x07, .x = 0x12}, \ - {.src = lastSrc, .y = 0x07, .x = 0x11}, +#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(lastSrc) \ - {.src = 0x6029, .y = 0x0e, .x = 0x12}, \ - {.src = 0x6049, .y = 0x0f, .x = 0x12}, \ - {.src = lastSrc, .y = 0x0f, .x = 0x11}, +#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(lastSrc) \ - {.src = 0x6029, .y = 0x10, .x = 0x12}, \ - {.src = 0x6029, .y = 0x0f, .x = 0x12}, \ - {.src = lastSrc, .y = 0x0f, .x = 0x11}, +#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 \ - {.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_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 \ - {.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_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}, + {.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_LEFT \ - {.src = 0x602c, .y = 0x0b, .x = 0x0d}, \ - {.src = 0x602d, .y = 0x0b, .x = 0x0e}, - -#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 eac9f0403..4cb1c8676 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 c5633ce28..a543e64c9 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 462ae4f38..d45a358d1 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 07d7772f4..a692a4db8 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 8838b5f2d..4e99ec9ad 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/frontier_util.c b/src/frontier_util.c index 8cd385e65..528d83a65 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 3cfd47ea7..220f5d44d 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 f19af9c09..e39a5438e 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); From 079f2da0f6d0b6b87a143e57e04cfbdfce3f29ab Mon Sep 17 00:00:00 2001 From: GriffinR Date: Thu, 10 Aug 2023 00:38:23 -0400 Subject: [PATCH 2/2] Fix some missing constant use in Apprentice --- include/script_menu.h | 2 ++ src/apprentice.c | 10 +++++----- src/field_specials.c | 1 - src/tv.c | 1 - 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/script_menu.h b/include/script_menu.h index 36b66bf98..734c717cf 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 89017de33..9ce5ec0dc 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/field_specials.c b/src/field_specials.c index 38746c97a..51c905513 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/tv.c b/src/tv.c index 85819a7a1..bbd6a60c5 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)