From b7cfa9d36537b8ae53012eb88d59f8b842fb35c4 Mon Sep 17 00:00:00 2001 From: Phlosioneer Date: Fri, 8 Mar 2019 21:39:51 -0500 Subject: Move more contest constants into C --- src/contest.c | 337 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 322 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/contest.c b/src/contest.c index 114a1fb69..241d38e48 100644 --- a/src/contest.c +++ b/src/contest.c @@ -218,7 +218,6 @@ EWRAM_DATA u8 gUnknown_02039F5D = 0; // IWRAM common vars. u32 gContestRngValue; -extern const u16 gUnknown_08587C30[]; extern const struct BgTemplate gUnknown_08587F34[4]; extern const struct WindowTemplate gUnknown_08587F44[]; extern const u8 *const gUnknown_08587D90[]; @@ -250,25 +249,11 @@ extern const u8 gText_CDot[]; extern const u8 *const gUnknown_08587E10[]; extern const struct ContestPokemon gContestOpponents[96]; extern const u8 gUnknown_085898A4[96]; -extern const struct CompressedSpriteSheet gUnknown_08587C00; -extern const struct SpriteTemplate gSpriteTemplate_8587BE8; -extern const struct CompressedSpriteSheet gUnknown_08587C08; -extern const struct CompressedSpritePalette gUnknown_08587C10; -extern const struct SpriteTemplate gSpriteTemplate_8587C18; extern const union AffineAnimCmd *const gUnknown_082FF6C0[]; extern const union AffineAnimCmd *const gUnknown_082FF694[]; extern const u8 *const gContestEffectDescriptionPointers[]; -extern const struct SpriteSheet gUnknown_08587A74; -extern const u8 gUnknown_08587A6C[]; extern const struct SpriteTemplate gSpriteTemplate_8587AD0; -extern const struct SpritePalette gUnknown_08587B08; -extern const struct CompressedSpriteSheet gUnknown_08587AE8[]; extern const struct SpriteTemplate gSpriteTemplate_8587B18[]; -extern const u8 gUnknown_08587A70[]; -extern const struct SubspriteTable gSubspriteTables_8587B80[]; -extern const struct CompressedSpriteSheet gUnknown_08587BB0; -extern const struct SpritePalette gUnknown_08587BB8; -extern const struct SpriteTemplate gSpriteTemplate_8587BC8; extern void (*const gContestEffectFuncs[])(void); extern const s8 gContestExcitementTable[][5]; extern const struct ContestWinner gUnknown_08587FA4[]; @@ -276,6 +261,328 @@ extern const struct CompressedSpriteSheet gUnknown_08589904[]; extern const struct SpritePalette gUnknown_08589924[]; extern const struct SpriteTemplate gSpriteTemplate_858998C[]; +static const u8 gUnknown_08587A6C[] = +{ + 0x24, 0x4C, 0x74, 0x9C +}; + +static const u8 gUnknown_08587A70[] = +{ + 0x24, 0x4C, 0x74, 0x9C +}; + +static const struct SpriteSheet gUnknown_08587A74 = +{ + .data = gTiles_8C19450, + .size = 0x20, + .tag = 0x4E20 +}; + +static const struct OamData gOamData_8587A7C = +{ + .y = 0, + .affineMode = 0, + .objMode = 0, + .mosaic = 0, + .bpp = 0, + .shape = 0, + .x = 0, + .matrixNum = 0, + .size = 0, + .tileNum = 0, + .priority = 0, + .paletteNum = 0, + .affineParam = 0 +}; + +static const union AffineAnimCmd gSpriteAffineAnim_8587A84[] = +{ + AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0), + AFFINEANIMCMD_END, +}; + +static const union AffineAnimCmd gSpriteAffineAnim_8587A94[] = +{ + AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0), + AFFINEANIMCMD_FRAME(0xFFF6, 0xFFF6, -20, 20), + AFFINEANIMCMD_END +}; + +static const union AffineAnimCmd gSpriteAffineAnim_8587AAC[] = +{ + AFFINEANIMCMD_FRAME(0x38, 0x38, 0, 0), + AFFINEANIMCMD_FRAME(10, 10, 20, 20), + AFFINEANIMCMD_END +}; + +static const union AffineAnimCmd* const gSpriteAffineAnimTable_8587AC4[] = +{ + gSpriteAffineAnim_8587A84, + gSpriteAffineAnim_8587A94, + gSpriteAffineAnim_8587AAC +}; + +static const struct SpriteTemplate gSpriteTemplate_8587AD0 = +{ + .tileTag = 0x4E20, + .paletteTag = 0xABE0, + .oam = &gOamData_8587A7C, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gSpriteAffineAnimTable_8587AC4, + .callback = SpriteCallbackDummy +}; + +static const struct CompressedSpriteSheet gUnknown_08587AE8[] = +{ + { + .data = gContestNextTurnGfx, + .size = 0x100, + .tag = 0x4E22 + }, + { + .data = gContestNextTurnGfx, + .size = 0x100, + .tag = 0x4E23 + }, + { + .data = gContestNextTurnGfx, + .size = 0x100, + .tag = 0x4E24 + }, + { + .data = gContestNextTurnGfx, + .size = 0x100, + .tag = 0x4E25 + } +}; + +static const struct SpritePalette gUnknown_08587B08 = +{ + .data = gContestPal, + .tag = 0x4E22 +}; + +static const struct OamData gOamData_8587B10 = +{ + .y = 0, + .affineMode = 0, + .objMode = 0, + .mosaic = 0, + .bpp = 0, + .shape = 1, + .x = 0, + .matrixNum = 0, + .size = 1, + .tileNum = 0, + .priority = 0, + .paletteNum = 0, + .affineParam = 0 +}; + +static const struct SpriteTemplate gSpriteTemplate_8587B18[] = +{ + { + .tileTag = 0x4E22, + .paletteTag = 0x4E22, + .oam = &gOamData_8587B10, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCallbackDummy, + }, + { + .tileTag = 0x4E23, + .paletteTag = 0x4E22, + .oam = &gOamData_8587B10, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCallbackDummy, + }, + { + .tileTag = 0x4E24, + .paletteTag = 0x4E22, + .oam = &gOamData_8587B10, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCallbackDummy, + }, + { + .tileTag = 0x4E25, + .paletteTag = 0x4E22, + .oam = &gOamData_8587B10, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCallbackDummy, + } +}; + +const struct Subsprite gSubspriteTable_8587B78[] = +{ + { + .x = -28, + .y = -4, + SPRITE_SIZE_32x8, + .tileOffset = 0, + .priority = 0 + }, + { + .x = 4, + .y = -4, + SPRITE_SIZE_32x8, + .tileOffset = 4, + .priority = 0 + } +}; + +const struct SubspriteTable gSubspriteTables_8587B80[] = +{ + { + .subspriteCount = 2, + .subsprites = gSubspriteTable_8587B78 + } +}; + +const struct CompressedSpriteSheet gUnknown_08587B88 = +{ + .data = gUnknown_08C19168, + .size = 0x180, + .tag = 0xABE1 +}; + +const struct OamData gOamData_8587B90 = +{ + .y = 0, + .affineMode = 0, + .objMode = 0, + .mosaic = 0, + .bpp = 0, + .shape = 0, + .x = 0, + .matrixNum = 0, + .size = 1, + .tileNum = 0, + .priority = 0, + .paletteNum = 0, + .affineParam = 0 +}; + +const struct SpriteTemplate gSpriteTemplate_8587B98 = +{ + .tileTag = 0xABE1, + .paletteTag = 0xABE0, + .oam = &gOamData_8587B90, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCallbackDummy +}; + +const struct CompressedSpriteSheet gUnknown_08587BB0 = +{ + .data = gContestApplauseGfx, + .size = 0x400, + .tag = 0xABE2 +}; + +const struct SpritePalette gUnknown_08587BB8 = +{ + .data = gContestPal, + .tag = 0xABE2 +}; + +const struct OamData gOamData_8587BC0 = +{ + .y = 0, + .affineMode = 0, + .objMode = 0, + .mosaic = 0, + .bpp = 0, + .shape = 1, + .x = 0, + .matrixNum = 0, + .size = 3, + .tileNum = 0, + .priority = 0, + .paletteNum = 0, + .affineParam = 0 +}; + +const struct SpriteTemplate gSpriteTemplate_8587BC8 = +{ + .tileTag = 0xABE2, + .paletteTag = 0xABE2, + .oam = &gOamData_8587BC0, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCallbackDummy +}; + +const struct OamData gOamData_8587BE0 = +{ + .y = 0, + .affineMode = 0, + .objMode = 0, + .mosaic = 0, + .bpp = 0, + .shape = 0, + .x = 0, + .matrixNum = 0, + .size = 3, + .tileNum = 0, + .priority = 3, + .paletteNum = 2, + .affineParam = 0 +}; + +const struct SpriteTemplate gSpriteTemplate_8587BE8 = +{ + .tileTag = 0x4E21, + .paletteTag = 0x4E21, + .oam = &gOamData_8587BE0, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCallbackDummy +}; + +const struct CompressedSpriteSheet gUnknown_08587C00 = +{ + .data = gContestJudgeGfx, + .size = 0x800, + .tag = 0x4E21 +}; + +const struct CompressedSpriteSheet gUnknown_08587C08 = +{ + .data = gContestJudgeSymbolsGfx, + .size = 0x380, + .tag = 0xABE0 +}; + +const struct CompressedSpritePalette gUnknown_08587C10 = +{ + .data = gContest3Pal, + .tag = 0xABE0 +}; + +const struct SpriteTemplate gSpriteTemplate_8587C18 = +{ + .tileTag = 0xABE0, + .paletteTag = 0xABE0, + .oam = &gUnknown_0852490C, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCallbackDummy +}; + +const u16 gUnknown_08587C30[] = INCBIN_U16("graphics/unknown/unknown_587C30.gbapal"); + static void TaskDummy1(u8 taskId) { } -- cgit v1.2.3 From 88c37818800e1216dc7d40cfefa0a9ab5f249671 Mon Sep 17 00:00:00 2001 From: Phlosioneer Date: Fri, 8 Mar 2019 22:33:40 -0500 Subject: Move text pointer tables into C --- src/contest.c | 6 +- src/data/contest_text_tables.h | 414 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 416 insertions(+), 4 deletions(-) create mode 100644 src/data/contest_text_tables.h (limited to 'src') diff --git a/src/contest.c b/src/contest.c index 241d38e48..afb1c94d7 100644 --- a/src/contest.c +++ b/src/contest.c @@ -220,9 +220,6 @@ u32 gContestRngValue; extern const struct BgTemplate gUnknown_08587F34[4]; extern const struct WindowTemplate gUnknown_08587F44[]; -extern const u8 *const gUnknown_08587D90[]; -extern const u8 *const gUnknown_08587F08[]; -extern const u8 *const gUnknown_08587F1C[]; extern const u8 *const gUnknown_0827E8DA[]; extern const u8 gText_0827D55A[]; extern const u8 gText_0827E793[]; @@ -251,7 +248,6 @@ extern const struct ContestPokemon gContestOpponents[96]; extern const u8 gUnknown_085898A4[96]; extern const union AffineAnimCmd *const gUnknown_082FF6C0[]; extern const union AffineAnimCmd *const gUnknown_082FF694[]; -extern const u8 *const gContestEffectDescriptionPointers[]; extern const struct SpriteTemplate gSpriteTemplate_8587AD0; extern const struct SpriteTemplate gSpriteTemplate_8587B18[]; extern void (*const gContestEffectFuncs[])(void); @@ -583,6 +579,8 @@ const struct SpriteTemplate gSpriteTemplate_8587C18 = const u16 gUnknown_08587C30[] = INCBIN_U16("graphics/unknown/unknown_587C30.gbapal"); +#include "data/contest_text_tables.h" + static void TaskDummy1(u8 taskId) { } diff --git a/src/data/contest_text_tables.h b/src/data/contest_text_tables.h new file mode 100644 index 000000000..fa32f33b5 --- /dev/null +++ b/src/data/contest_text_tables.h @@ -0,0 +1,414 @@ + +#include "global.h" + +extern const u8 gContestEffect00hDescription[]; +extern const u8 gContestEffect01hDescription[]; +extern const u8 gContestEffect02hDescription[]; +extern const u8 gContestEffect03hDescription[]; +extern const u8 gContestEffect04hDescription[]; +extern const u8 gContestEffect05hDescription[]; +extern const u8 gContestEffect06hDescription[]; +extern const u8 gContestEffect07hDescription[]; +extern const u8 gContestEffect08hDescription[]; +extern const u8 gContestEffect09hDescription[]; +extern const u8 gContestEffect0AhDescription[]; +extern const u8 gContestEffect0BhDescription[]; +extern const u8 gContestEffect0ChDescription[]; +extern const u8 gContestEffect0DhDescription[]; +extern const u8 gContestEffect0EhDescription[]; +extern const u8 gContestEffect0FhDescription[]; +extern const u8 gContestEffect10hDescription[]; +extern const u8 gContestEffect11hDescription[]; +extern const u8 gContestEffect12hDescription[]; +extern const u8 gContestEffect13hDescription[]; +extern const u8 gContestEffect14hDescription[]; +extern const u8 gContestEffect15hDescription[]; +extern const u8 gContestEffect16hDescription[]; +extern const u8 gContestEffect17hDescription[]; +extern const u8 gContestEffect18hDescription[]; +extern const u8 gContestEffect19hDescription[]; +extern const u8 gContestEffect1AhDescription[]; +extern const u8 gContestEffect1BhDescription[]; +extern const u8 gContestEffect1ChDescription[]; +extern const u8 gContestEffect1DhDescription[]; +extern const u8 gContestEffect1EhDescription[]; +extern const u8 gContestEffect1FhDescription[]; +extern const u8 gContestEffect20hDescription[]; +extern const u8 gContestEffect21hDescription[]; +extern const u8 gContestEffect22hDescription[]; +extern const u8 gContestEffect23hDescription[]; +extern const u8 gContestEffect24hDescription[]; +extern const u8 gContestEffect25hDescription[]; +extern const u8 gContestEffect26hDescription[]; +extern const u8 gContestEffect27hDescription[]; +extern const u8 gContestEffect28hDescription[]; +extern const u8 gContestEffect29hDescription[]; +extern const u8 gContestEffect2AhDescription[]; +extern const u8 gContestEffect2BhDescription[]; +extern const u8 gContestEffect2ChDescription[]; +extern const u8 gContestEffect2DhDescription[]; +extern const u8 gContestEffect2EhDescription[]; +extern const u8 gContestEffect2FhDescription[]; + +extern const u8 gUnusedContestMoveName0[]; +extern const u8 gUnusedContestMoveName1[]; +extern const u8 gUnusedContestMoveName2[]; +extern const u8 gUnusedContestMoveName3[]; +extern const u8 gUnusedContestMoveName4[]; +extern const u8 gUnusedContestMoveName5[]; +extern const u8 gUnusedContestMoveName6[]; +extern const u8 gUnusedContestMoveName7[]; +extern const u8 gUnusedContestMoveName8[]; +extern const u8 gUnusedContestMoveName9[]; +extern const u8 gUnusedContestMoveName10[]; +extern const u8 gUnusedContestMoveName11[]; +extern const u8 gUnusedContestMoveName12[]; + +extern const u8 gContestMoveTypeCoolText[]; +extern const u8 gContestMoveTypeBeautyText[]; +extern const u8 gContestMoveTypeCuteText[]; +extern const u8 gContestMoveTypeSmartText[]; +extern const u8 gContestMoveTypeToughText[]; + +extern const u8 gText_0827D5C1[]; +extern const u8 gText_0827D5DC[]; +extern const u8 gText_0827D600[]; +extern const u8 gText_0827D612[]; +extern const u8 gText_0827D612[]; +extern const u8 gText_0827D62D[]; +extern const u8 gText_0827D654[]; +extern const u8 gText_0827D67E[]; +extern const u8 gText_0827D69C[]; +extern const u8 gText_0827D6BA[]; +extern const u8 gText_0827D6E5[]; +extern const u8 gText_0827D706[]; +extern const u8 gText_0827D71D[]; + +extern const u8 gText_0827D743[]; +extern const u8 gText_0827D764[]; +extern const u8 gText_0827D785[]; +extern const u8 gText_0827D7A5[]; +extern const u8 gText_0827D7C8[]; +extern const u8 gText_0827D7E8[]; +extern const u8 gText_0827D831[]; +extern const u8 gText_0827D855[]; +extern const u8 gText_0827D830[]; +extern const u8 gText_0827D872[]; +extern const u8 gText_0827D88F[]; +extern const u8 gText_0827D8B5[]; +extern const u8 gText_0827D8E4[]; +extern const u8 gText_0827D8FE[]; +extern const u8 gText_0827D926[]; +extern const u8 gText_0827D947[]; +extern const u8 gText_0827D961[]; +extern const u8 gText_0827D986[]; +extern const u8 gText_0827D9B1[]; +extern const u8 gText_0827D9D9[]; +extern const u8 gText_0827DA03[]; +extern const u8 gText_0827DA31[]; +extern const u8 gText_0827DA5B[]; +extern const u8 gText_0827DA85[]; +extern const u8 gText_0827DAB2[]; +extern const u8 gText_0827DADA[]; +extern const u8 gText_0827DB03[]; +extern const u8 gText_0827D830[]; +extern const u8 gText_0827D830[]; +extern const u8 gText_0827D830[]; +extern const u8 gText_0827DB1F[]; +extern const u8 gText_0827DB4E[]; + +extern const u8 gText_827DB75[]; +extern const u8 gText_827DBB0[]; +extern const u8 gText_827DBE0[]; +extern const u8 gText_827DC0F[]; +extern const u8 gText_827DC45[]; +extern const u8 gText_827DC7C[]; +extern const u8 gText_827DCB4[]; +extern const u8 gText_827DCE7[]; +extern const u8 gText_827DD12[]; +extern const u8 gText_827DD3D[]; +extern const u8 gText_827DD6F[]; +extern const u8 gText_827DD8E[]; +extern const u8 gText_827DDC7[]; +extern const u8 gText_827DDF2[]; +extern const u8 gText_827DE14[]; +extern const u8 gText_827DE44[]; +extern const u8 gText_827DE73[]; +extern const u8 gText_827DEA5[]; +extern const u8 gText_827DED9[]; +extern const u8 gText_827DF02[]; +extern const u8 gText_827DF3A[]; +extern const u8 gText_827DF63[]; +extern const u8 gText_827DF8C[]; +extern const u8 gText_827DFB8[]; +extern const u8 gText_827DFE2[]; +extern const u8 gText_827E00C[]; +extern const u8 gText_827E02F[]; +extern const u8 gText_827E05F[]; +extern const u8 gText_827E08B[]; +extern const u8 gText_827E0B5[]; +extern const u8 gText_827E0DD[]; +extern const u8 gText_827E107[]; +extern const u8 gText_827E143[]; +extern const u8 gText_827E17F[]; +extern const u8 gText_827E1BB[]; +extern const u8 gText_827E1F3[]; +extern const u8 gText_827E220[]; +extern const u8 gText_827E254[]; +extern const u8 gText_827E289[]; +extern const u8 gText_827E2C5[]; +extern const u8 gText_0827E2FE[]; +extern const u8 gText_0827E32E[]; +extern const u8 gText_0827E35B[]; +extern const u8 gText_0827E38D[]; +extern const u8 gText_0827E3C1[]; +extern const u8 gText_0827E3EB[]; +extern const u8 gText_0827E416[]; +extern const u8 gText_0827E448[]; +extern const u8 gText_0827E473[]; +extern const u8 gText_0827E4A6[]; +extern const u8 gText_0827E4D5[]; +extern const u8 gText_0827E504[]; +extern const u8 gText_0827E531[]; +extern const u8 gText_0827E55A[]; +extern const u8 gText_0827E5B2[]; +extern const u8 gText_0827E5D0[]; +extern const u8 gText_0827E606[]; +extern const u8 gText_0827E638[]; +extern const u8 gText_0827E658[]; +extern const u8 gText_0827E68B[]; +extern const u8 gText_0827E6C4[]; +extern const u8 gText_0827E7BA[]; + +extern const u8 gText_0827E85F[]; +extern const u8 gText_0827E868[]; +extern const u8 gText_0827E86F[]; +extern const u8 gText_0827E878[]; +extern const u8 gText_0827E882[]; + +extern const u8 gText_0827E894[]; +extern const u8 gText_0827E89E[]; +extern const u8 gText_0827E8AA[]; +extern const u8 gText_0827E8B4[]; +extern const u8 gText_0827E8BF[]; +extern const u8 gText_0827E8CA[]; + +const u8 *const gContestEffectDescriptionPointers[] = +{ + gContestEffect00hDescription, + gContestEffect01hDescription, + gContestEffect02hDescription, + gContestEffect03hDescription, + gContestEffect04hDescription, + gContestEffect05hDescription, + gContestEffect06hDescription, + gContestEffect07hDescription, + gContestEffect08hDescription, + gContestEffect09hDescription, + gContestEffect0AhDescription, + gContestEffect0BhDescription, + gContestEffect0ChDescription, + gContestEffect0DhDescription, + gContestEffect0EhDescription, + gContestEffect0FhDescription, + gContestEffect10hDescription, + gContestEffect11hDescription, + gContestEffect12hDescription, + gContestEffect13hDescription, + gContestEffect14hDescription, + gContestEffect15hDescription, + gContestEffect16hDescription, + gContestEffect17hDescription, + gContestEffect18hDescription, + gContestEffect19hDescription, + gContestEffect1AhDescription, + gContestEffect1BhDescription, + gContestEffect1ChDescription, + gContestEffect1DhDescription, + gContestEffect1EhDescription, + gContestEffect1FhDescription, + gContestEffect20hDescription, + gContestEffect21hDescription, + gContestEffect22hDescription, + gContestEffect23hDescription, + gContestEffect24hDescription, + gContestEffect25hDescription, + gContestEffect26hDescription, + gContestEffect27hDescription, + gContestEffect28hDescription, + gContestEffect29hDescription, + gContestEffect2AhDescription, + gContestEffect2BhDescription, + gContestEffect2ChDescription, + gContestEffect2DhDescription, + gContestEffect2EhDescription, + gContestEffect2FhDescription +}; + +// Unreferenced array of pointers to move names. +// All of the moves except Conversion are combo starters, so this may have +// been an early list of combo starters. +const u8 *const gUnknown_8587D10[] = +{ + gUnusedContestMoveName0, + gUnusedContestMoveName0, + gUnusedContestMoveName1, + gUnusedContestMoveName2, + gUnusedContestMoveName3, + gUnusedContestMoveName4, + gUnusedContestMoveName5, + gUnusedContestMoveName6, + gUnusedContestMoveName7, + gUnusedContestMoveName8, + gUnusedContestMoveName9, + gUnusedContestMoveName10, + gUnusedContestMoveName11, + gUnusedContestMoveName12 +}; + +const u8 *const gContestMoveTypeTextPointers[] = +{ + gContestMoveTypeCoolText, + gContestMoveTypeBeautyText, + gContestMoveTypeCuteText, + gContestMoveTypeSmartText, + gContestMoveTypeToughText +}; + +const u8 *const gUnknown_08587D5C[] = +{ + gText_0827D5C1, + gText_0827D5DC, + gText_0827D600, + gText_0827D612, + gText_0827D612, + gText_0827D62D, + gText_0827D654, + gText_0827D67E, + gText_0827D69C, + gText_0827D6BA, + gText_0827D6E5, + gText_0827D706, + gText_0827D71D +}; + +const u8 *const gUnknown_08587D90[] = +{ + gText_0827D743, + gText_0827D764, + gText_0827D785, + gText_0827D7A5, + gText_0827D7C8, + gText_0827D7E8, + gText_0827D831, + gText_0827D855, + gText_0827D830, + gText_0827D872, + gText_0827D88F, + gText_0827D8B5, + gText_0827D8E4, + gText_0827D8FE, + gText_0827D926, + gText_0827D947, + gText_0827D961, + gText_0827D986, + gText_0827D9B1, + gText_0827D9D9, + gText_0827DA03, + gText_0827DA31, + gText_0827DA5B, + gText_0827DA85, + gText_0827DAB2, + gText_0827DADA, + gText_0827DB03, + gText_0827D830, + gText_0827D830, + gText_0827D830, + gText_0827DB1F, + gText_0827DB4E +}; + +const u8 *const gUnknown_08587E10[] = +{ + gText_827DB75, + gText_827DBB0, + gText_827DBE0, + gText_827DC0F, + gText_827DC45, + gText_827DC7C, + gText_827DCB4, + gText_827DCE7, + gText_827DD12, + gText_827DD3D, + gText_827DD6F, + gText_827DD8E, + gText_827DDC7, + gText_827DDF2, + gText_827DE14, + gText_827DE44, + gText_827DE73, + gText_827DEA5, + gText_827DED9, + gText_827DF02, + gText_827DF3A, + gText_827DF63, + gText_827DF8C, + gText_827DFB8, + gText_827DFE2, + gText_827E00C, + gText_827E02F, + gText_827E05F, + gText_827E08B, + gText_827E0B5, + gText_827E0DD, + gText_827E107, + gText_827E143, + gText_827E17F, + gText_827E1BB, + gText_827E1F3, + gText_827E220, + gText_827E254, + gText_827E289, + gText_827E2C5, + gText_0827E2FE, + gText_0827E32E, + gText_0827E35B, + gText_0827E38D, + gText_0827E3C1, + gText_0827E3EB, + gText_0827E416, + gText_0827E448, + gText_0827E473, + gText_0827E4A6, + gText_0827E4D5, + gText_0827E504, + gText_0827E531, + gText_0827E55A, + gText_0827E5B2, + gText_0827E5D0, + gText_0827E606, + gText_0827E638, + gText_0827E658, + gText_0827E68B, + gText_0827E6C4, + gText_0827E7BA +}; + +const u8 *const gUnknown_08587F08[] = +{ + gText_0827E85F, + gText_0827E868, + gText_0827E86F, + gText_0827E878, + gText_0827E882 +}; + +const u8 *const gUnknown_08587F1C[] = +{ + gText_0827E894, + gText_0827E89E, + gText_0827E8AA, + gText_0827E8B4, + gText_0827E8BF, + gText_0827E8CA +}; \ No newline at end of file -- cgit v1.2.3 From 5b4b0a245be14b7485c3e2cc40e40c78eeaa7ce0 Mon Sep 17 00:00:00 2001 From: Phlosioneer Date: Sat, 9 Mar 2019 00:00:10 -0500 Subject: Move contest winner list to C --- src/contest.c | 149 ++++++++++++++++++++++++++++++++++++++++++- src/data/contest_opponents.h | 80 +++++++++++++++++++++++ 2 files changed, 226 insertions(+), 3 deletions(-) create mode 100644 src/data/contest_opponents.h (limited to 'src') diff --git a/src/contest.c b/src/contest.c index afb1c94d7..09847f6b6 100644 --- a/src/contest.c +++ b/src/contest.c @@ -218,8 +218,6 @@ EWRAM_DATA u8 gUnknown_02039F5D = 0; // IWRAM common vars. u32 gContestRngValue; -extern const struct BgTemplate gUnknown_08587F34[4]; -extern const struct WindowTemplate gUnknown_08587F44[]; extern const u8 *const gUnknown_0827E8DA[]; extern const u8 gText_0827D55A[]; extern const u8 gText_0827E793[]; @@ -252,7 +250,6 @@ extern const struct SpriteTemplate gSpriteTemplate_8587AD0; extern const struct SpriteTemplate gSpriteTemplate_8587B18[]; extern void (*const gContestEffectFuncs[])(void); extern const s8 gContestExcitementTable[][5]; -extern const struct ContestWinner gUnknown_08587FA4[]; extern const struct CompressedSpriteSheet gUnknown_08589904[]; extern const struct SpritePalette gUnknown_08589924[]; extern const struct SpriteTemplate gSpriteTemplate_858998C[]; @@ -581,6 +578,152 @@ const u16 gUnknown_08587C30[] = INCBIN_U16("graphics/unknown/unknown_587C30.gbap #include "data/contest_text_tables.h" +const struct BgTemplate gUnknown_08587F34[] = +{ + { + .bg = 0, + .charBaseIndex = 0, + .mapBaseIndex = 0x18, + .screenSize = 2, + .paletteMode = 0, + .priority = 0, + .baseTile = 0 + }, + { + .bg = 1, + .charBaseIndex = 2, + .mapBaseIndex = 0x1E, + .screenSize = 2, + .paletteMode = 0, + .priority = 1, + .baseTile = 0 + }, + { + .bg = 2, + .charBaseIndex = 0, + .mapBaseIndex = 0x1C, + .screenSize = 2, + .paletteMode = 0, + .priority = 0, + .baseTile = 0 + }, + { + .bg = 3, + .charBaseIndex = 0, + .mapBaseIndex = 0x1A, + .screenSize = 0, + .paletteMode = 0, + .priority = 3, + .baseTile = 0 + } +}; + +const struct WindowTemplate gUnknown_08587F44[] = +{ + { + .bg = 0, + .tilemapLeft = 18, + .tilemapTop = 0, + .width = 12, + .height = 2, + .paletteNum = 0xF, + .baseBlock = 0x200 + }, + { + .bg = 0, + .tilemapLeft = 18, + .tilemapTop = 5, + .width = 12, + .height = 2, + .paletteNum = 0xF, + .baseBlock = 0x218 + }, + { + .bg = 0, + .tilemapLeft = 18, + .tilemapTop = 10, + .width = 12, + .height = 2, + .paletteNum = 0xF, + .baseBlock = 0x230 + }, + { + .bg = 0, + .tilemapLeft = 18, + .tilemapTop = 15, + .width = 12, + .height = 2, + .paletteNum = 0xF, + .baseBlock = 0x248 + }, + { + .bg = 0, + .tilemapLeft = 1, + .tilemapTop = 15, + .width = 17, + .height = 4, + .paletteNum = 0xF, + .baseBlock = 0x260 + }, + { + .bg = 0, + .tilemapLeft = 1, + .tilemapTop = 0x1F, + .width = 9, + .height = 2, + .paletteNum = 0xF, + .baseBlock = 0x2A4 + }, + { + .bg = 0, + .tilemapLeft = 1, + .tilemapTop = 0x21, + .width = 9, + .height = 2, + .paletteNum = 0xF, + .baseBlock = 0x2B6 + }, + { + .bg = 0, + .tilemapLeft = 1, + .tilemapTop = 0x23, + .width = 9, + .height = 2, + .paletteNum = 0xF, + .baseBlock = 0x2C8 + }, + { + .bg = 0, + .tilemapLeft = 1, + .tilemapTop = 0x25, + .width = 9, + .height = 2, + .paletteNum = 0xF, + .baseBlock = 0x2DA + }, + { + .bg = 0, + .tilemapLeft = 16, + .tilemapTop = 0x1F, + .width = 1, + .height = 2, + .paletteNum = 0xF, + .baseBlock = 0x2EC + }, + { + .bg = 0, + .tilemapLeft = 11, + .tilemapTop = 0x23, + .width = 18, + .height = 4, + .paletteNum = 0xF, + .baseBlock = 0x2EE + }, + DUMMY_WIN_TEMPLATE +}; + +#include "data/contest_opponents.h" + static void TaskDummy1(u8 taskId) { } diff --git a/src/data/contest_opponents.h b/src/data/contest_opponents.h new file mode 100644 index 000000000..580d7916e --- /dev/null +++ b/src/data/contest_opponents.h @@ -0,0 +1,80 @@ + +#include "global.h" +#include "contest.h" +#include "constants/species.h" + +const struct ContestWinner gUnknown_08587FA4[] = +{ + { + .personality = 0, + .trainerId = 0xFFFF, + .species = SPECIES_ELECTRIKE, + .contestCategory = CONTEST_CATEGORY_CUTE, + .monName = _("ELECTER"), + .trainerName = _("EZRA"), + .contestRank = CONTEST_RANK_NORMAL + }, + { + .personality = 0, + .trainerId = 0xFFFF, + .species = SPECIES_TROPIUS, + .contestCategory = CONTEST_CATEGORY_COOL, + .monName = _("TROPO"), + .trainerName = _("ALLAN"), + .contestRank = CONTEST_RANK_HYPER + }, + { + .personality = 0, + .trainerId = 0xFFFF, + .species = SPECIES_XATU, + .contestCategory = CONTEST_CATEGORY_BEAUTY, + .monName = _("TUXA"), + .trainerName = _("JULIET"), + .contestRank = CONTEST_RANK_NORMAL + }, + { + .personality = 0, + .trainerId = 0xFFFF, + .species = SPECIES_PLUSLE, + .contestCategory = CONTEST_CATEGORY_TOUGH, + .monName = _("PULSE"), + .trainerName = _("BAILY"), + .contestRank = CONTEST_RANK_MASTER + }, + { + .personality = 0, + .trainerId = 0xFFFF, + .species = SPECIES_SHUPPET, + .contestCategory = CONTEST_CATEGORY_SMART, + .monName = _("SHUPUP"), + .trainerName = _("MELANY"), + .contestRank = CONTEST_RANK_SUPER + }, + { + .personality = 0, + .trainerId = 0xFFFF, + .species = SPECIES_ZANGOOSE, + .contestCategory = CONTEST_CATEGORY_COOL, + .monName = _("GOOZAN"), + .trainerName = _("HANA"), + .contestRank = CONTEST_RANK_HYPER + }, + { + .personality = 0, + .trainerId = 0xFFFF, + .species = SPECIES_LOUDRED, + .contestCategory = CONTEST_CATEGORY_BEAUTY, + .monName = _("LOUDED"), + .trainerName = _("BRYANT"), + .contestRank = CONTEST_RANK_HYPER + }, + { + .personality = 0, + .trainerId = 0xFFFF, + .species = SPECIES_DELCATTY, + .contestCategory = CONTEST_CATEGORY_CUTE, + .monName = _("KITSY"), + .trainerName = _("OMAR"), + .contestRank = CONTEST_RANK_MASTER + } +}; \ No newline at end of file -- cgit v1.2.3 From 153499ed6f08b6546349ba1ec33ea9e18840f44b Mon Sep 17 00:00:00 2001 From: Phlosioneer Date: Sat, 9 Mar 2019 01:38:38 -0500 Subject: Clean up contest_opponents.inc --- src/data/contest_opponents.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/data/contest_opponents.h b/src/data/contest_opponents.h index 580d7916e..07d41d824 100644 --- a/src/data/contest_opponents.h +++ b/src/data/contest_opponents.h @@ -77,4 +77,10 @@ const struct ContestWinner gUnknown_08587FA4[] = .trainerName = _("OMAR"), .contestRank = CONTEST_RANK_MASTER } -}; \ No newline at end of file +}; +/* +const struct ContestPokemon gContestOpponents[] = +{ + +};*/ +extern const struct ContestPokemon gContestOpponents[96]; \ No newline at end of file -- cgit v1.2.3 From a32e8e7405dc66c29ae04bb85bf9b07cd3cb21a9 Mon Sep 17 00:00:00 2001 From: Phlosioneer Date: Sat, 9 Mar 2019 20:56:36 -0500 Subject: Move gContestOpponents into C 2,400 LOC by hand. --- src/contest.c | 1 - src/data/contest_opponents.h | 2790 +++++++++++++++++++++++++++++++++++++++++- 2 files changed, 2786 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/contest.c b/src/contest.c index 09847f6b6..3ef8d4b06 100644 --- a/src/contest.c +++ b/src/contest.c @@ -242,7 +242,6 @@ extern const u8 gText_Contest_Fear[]; extern const u8 gText_BDot[]; extern const u8 gText_CDot[]; extern const u8 *const gUnknown_08587E10[]; -extern const struct ContestPokemon gContestOpponents[96]; extern const u8 gUnknown_085898A4[96]; extern const union AffineAnimCmd *const gUnknown_082FF6C0[]; extern const union AffineAnimCmd *const gUnknown_082FF694[]; diff --git a/src/data/contest_opponents.h b/src/data/contest_opponents.h index 07d41d824..8937e9914 100644 --- a/src/data/contest_opponents.h +++ b/src/data/contest_opponents.h @@ -78,9 +78,2791 @@ const struct ContestWinner gUnknown_08587FA4[] = .contestRank = CONTEST_RANK_MASTER } }; -/* + const struct ContestPokemon gContestOpponents[] = { - -};*/ -extern const struct ContestPokemon gContestOpponents[96]; \ No newline at end of file + { + .species = SPECIES_POOCHYENA, + .nickname = _("POOCHY"), + .trainerName = _("JIMMY"), + .trainerGfxId = 7, + .flags = 0xC000FFF, + .whichRank = 0, + .aiPool_Cool = TRUE, + .aiPool_Beauty = FALSE, + .aiPool_Cute = FALSE, + .aiPool_Smart = FALSE, + .aiPool_Tough = TRUE, + .moves = + { + MOVE_ROAR, + MOVE_BITE, + MOVE_TAKE_DOWN, + MOVE_HOWL + }, + .cool = 10, + .beauty = 4, + .cute = 10, + .smart = 3, + .tough = 4, + .sheen = 50, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_ILLUMISE, + .nickname = _("MUSILLE"), + .trainerName = _("EDITH"), + .trainerGfxId = 8, + .flags = 0x82000FFF, + .whichRank = 0, + .aiPool_Cool = FALSE, + .aiPool_Beauty = FALSE, + .aiPool_Cute = TRUE, + .aiPool_Smart = FALSE, + .aiPool_Tough = FALSE, + .moves = + { + MOVE_REST, + MOVE_FACADE, + MOVE_TACKLE, + MOVE_COVET + }, + .cool = 10, + .beauty = 10, + .cute = 6, + .smart = 1, + .tough = 2, + .sheen = 60, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_DUSTOX, + .nickname = _("DUSTER"), + .trainerName = _("EVAN"), + .trainerGfxId = 11, + .flags = 0x21000FFF, + .whichRank = 0, + .aiPool_Cool = FALSE, + .aiPool_Beauty = TRUE, + .aiPool_Cute = FALSE, + .aiPool_Smart = FALSE, + .aiPool_Tough = FALSE, + .moves = + { + MOVE_SILVER_WIND, + MOVE_MOONLIGHT, + MOVE_LIGHT_SCREEN, + MOVE_GUST + }, + .cool = 2, + .beauty = 10, + .cute = 10, + .smart = 12, + .tough = 4, + .sheen = 70, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_SEEDOT, + .nickname = _("DOTS"), + .trainerName = _("KELSEY"), + .trainerGfxId = 16, + .flags = 0x20800FFF, + .whichRank = 0, + .aiPool_Cool = FALSE, + .aiPool_Beauty = FALSE, + .aiPool_Cute = FALSE, + .aiPool_Smart = TRUE, + .aiPool_Tough = TRUE, + .moves = + { + MOVE_BIDE, + MOVE_SYNTHESIS, + MOVE_BULLET_SEED, + MOVE_GROWTH + }, + .cool = 3, + .beauty = 3, + .cute = 5, + .smart = 2, + .tough = 7, + .sheen = 80, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_TAILLOW, + .nickname = _("TATAY"), + .trainerName = _("MADISON"), + .trainerGfxId = 18, + .flags = 0x80400FFF, + .whichRank = 0, + .aiPool_Cool = TRUE, + .aiPool_Beauty = FALSE, + .aiPool_Cute = FALSE, + .aiPool_Smart = FALSE, + .aiPool_Tough = FALSE, + .moves = + { + MOVE_WING_ATTACK, + MOVE_AGILITY, + MOVE_AERIAL_ACE, + MOVE_GROWL + }, + .cool = 1, + .beauty = 3, + .cute = 3, + .smart = 5, + .tough = 4, + .sheen = 90, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_NINCADA, + .nickname = _("NINDA"), + .trainerName = _("RAYMOND"), + .trainerGfxId = 44, + .flags = 0x10200FFF, + .whichRank = 0, + .aiPool_Cool = FALSE, + .aiPool_Beauty = FALSE, + .aiPool_Cute = FALSE, + .aiPool_Smart = TRUE, + .aiPool_Tough = FALSE, + .moves = + { + MOVE_LEECH_LIFE, + MOVE_FALSE_SWIPE, + MOVE_FURY_SWIPES, + MOVE_MIND_READER + }, + .cool = 5, + .beauty = 2, + .cute = 10, + .smart = 7, + .tough = 8, + .sheen = 100, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_SHROOMISH, + .nickname = _("SMISH"), + .trainerName = _("GRANT"), + .trainerGfxId = 35, + .flags = 0x20100FFF, + .whichRank = 0, + .aiPool_Cool = FALSE, + .aiPool_Beauty = FALSE, + .aiPool_Cute = FALSE, + .aiPool_Smart = TRUE, + .aiPool_Tough = FALSE, + .moves = + { + MOVE_STUN_SPORE, + MOVE_LEECH_SEED, + MOVE_MEGA_DRAIN, + MOVE_ATTRACT + }, + .cool = 3, + .beauty = 3, + .cute = 10, + .smart = 2, + .tough = 2, + .sheen = 50, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_SPHEAL, + .nickname = _("SLEAL"), + .trainerName = _("PAIGE"), + .trainerGfxId = 26, + .flags = 0x8080FFF, + .whichRank = 0, + .aiPool_Cool = FALSE, + .aiPool_Beauty = TRUE, + .aiPool_Cute = TRUE, + .aiPool_Smart = FALSE, + .aiPool_Tough = FALSE, + .moves = + { + MOVE_AURORA_BEAM, + MOVE_WATER_GUN, + MOVE_GROWL, + MOVE_ROCK_TOMB + }, + .cool = 3, + .beauty = 5, + .cute = 1, + .smart = 10, + .tough = 10, + .sheen = 60, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_SLAKOTH, + .nickname = _("SLOKTH"), + .trainerName = _("ALEC"), + .trainerGfxId = 31, + .flags = 0x40040FFF, + .whichRank = 0, + .aiPool_Cool = FALSE, + .aiPool_Beauty = TRUE, + .aiPool_Cute = TRUE, + .aiPool_Smart = FALSE, + .aiPool_Tough = TRUE, + .moves = + { + MOVE_STRENGTH, + MOVE_COUNTER, + MOVE_YAWN, + MOVE_ENCORE + }, + .cool = 10, + .beauty = 4, + .cute = 4, + .smart = 5, + .tough = 18, + .sheen = 70, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_WHISMUR, + .nickname = _("WHIRIS"), + .trainerName = _("SYDNEY"), + .trainerGfxId = 47, + .flags = 0x80020FFF, + .whichRank = 0, + .aiPool_Cool = TRUE, + .aiPool_Beauty = FALSE, + .aiPool_Cute = FALSE, + .aiPool_Smart = TRUE, + .aiPool_Tough = FALSE, + .moves = + { + MOVE_ASTONISH, + MOVE_SCREECH, + MOVE_UPROAR, + MOVE_HYPER_VOICE + }, + .cool = 2, + .beauty = 2, + .cute = 7, + .smart = 2, + .tough = 7, + .sheen = 80, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_MAKUHITA, + .nickname = _("MAHITA"), + .trainerName = _("MORRIS"), + .trainerGfxId = 38, + .flags = 0x8010FFF, + .whichRank = 0, + .aiPool_Cool = TRUE, + .aiPool_Beauty = FALSE, + .aiPool_Cute = FALSE, + .aiPool_Smart = FALSE, + .aiPool_Tough = TRUE, + .moves = + { + MOVE_SEISMIC_TOSS, + MOVE_VITAL_THROW, + MOVE_TACKLE, + MOVE_REVERSAL + }, + .cool = 9, + .beauty = 1, + .cute = 1, + .smart = 8, + .tough = 1, + .sheen = 90, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_ARON, + .nickname = _("RONAR"), + .trainerName = _("MARIAH"), + .trainerGfxId = 10, + .flags = 0x8008FFF, + .whichRank = 0, + .aiPool_Cool = TRUE, + .aiPool_Beauty = FALSE, + .aiPool_Cute = FALSE, + .aiPool_Smart = FALSE, + .aiPool_Tough = TRUE, + .moves = + { + MOVE_METAL_CLAW, + MOVE_IRON_DEFENSE, + MOVE_HEADBUTT, + MOVE_TAKE_DOWN + }, + .cool = 5, + .beauty = 10, + .cute = 2, + .smart = 10, + .tough = 2, + .sheen = 100, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_CROBAT, + .nickname = _("BATRO"), + .trainerName = _("RUSSELL"), + .trainerGfxId = 33, + .flags = 0x90004FFF, + .whichRank = 0, + .aiPool_Cool = FALSE, + .aiPool_Beauty = TRUE, + .aiPool_Cute = TRUE, + .aiPool_Smart = TRUE, + .aiPool_Tough = FALSE, + .moves = + { + MOVE_HAZE, + MOVE_MEAN_LOOK, + MOVE_CONFUSE_RAY, + MOVE_LEECH_LIFE + }, + .cool = 4, + .beauty = 2, + .cute = 2, + .smart = 2, + .tough = 10, + .sheen = 50, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_GULPIN, + .nickname = _("GULIN"), + .trainerName = _("MELANIE"), + .trainerGfxId = 6, + .flags = 0x40002FFF, + .whichRank = 0, + .aiPool_Cool = FALSE, + .aiPool_Beauty = FALSE, + .aiPool_Cute = TRUE, + .aiPool_Smart = FALSE, + .aiPool_Tough = FALSE, + .moves = + { + MOVE_SLUDGE, + MOVE_AMNESIA, + MOVE_TOXIC, + MOVE_YAWN + }, + .cool = 1, + .beauty = 10, + .cute = 1, + .smart = 10, + .tough = 5, + .sheen = 60, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_MANECTRIC, + .nickname = _("RIKELEC"), + .trainerName = _("CHANCE"), + .trainerGfxId = 15, + .flags = 0x80001FFF, + .whichRank = 0, + .aiPool_Cool = TRUE, + .aiPool_Beauty = TRUE, + .aiPool_Cute = FALSE, + .aiPool_Smart = FALSE, + .aiPool_Tough = FALSE, + .moves = + { + MOVE_SPARK, + MOVE_THUNDER_WAVE, + MOVE_THUNDER, + MOVE_ROAR + }, + .cool = 20, + .beauty = 10, + .cute = 1, + .smart = 1, + .tough = 1, + .sheen = 70, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_BULBASAUR, + .nickname = _("BULBY"), + .trainerName = _("AGATHA"), + .trainerGfxId = 20, + .flags = 0xC000FFF, + .whichRank = 0, + .aiPool_Cool = FALSE, + .aiPool_Beauty = FALSE, + .aiPool_Cute = TRUE, + .aiPool_Smart = TRUE, + .aiPool_Tough = FALSE, + .moves = + { + MOVE_GROWL, + MOVE_LEECH_SEED, + MOVE_TACKLE, + MOVE_SWEET_SCENT + }, + .cool = 5, + .beauty = 3, + .cute = 10, + .smart = 10, + .tough = 4, + .sheen = 50, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_BUTTERFREE, + .nickname = _("FUTTERBE"), + .trainerName = _("BEAU"), + .trainerGfxId = 40, + .flags = 0x82000FFF, + .whichRank = 0, + .aiPool_Cool = FALSE, + .aiPool_Beauty = TRUE, + .aiPool_Cute = FALSE, + .aiPool_Smart = TRUE, + .aiPool_Tough = FALSE, + .moves = + { + MOVE_SUPERSONIC, + MOVE_WHIRLWIND, + MOVE_SILVER_WIND, + MOVE_SAFEGUARD + }, + .cool = 3, + .beauty = 10, + .cute = 2, + .smart = 10, + .tough = 4, + .sheen = 60, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_PIDGEOTTO, + .nickname = _("PIDEOT"), + .trainerName = _("KAY"), + .trainerGfxId = 34, + .flags = 0x21000FFF, + .whichRank = 0, + .aiPool_Cool = TRUE, + .aiPool_Beauty = TRUE, + .aiPool_Cute = FALSE, + .aiPool_Smart = FALSE, + .aiPool_Tough = FALSE, + .moves = + { + MOVE_MIRROR_MOVE, + MOVE_QUICK_ATTACK, + MOVE_AERIAL_ACE, + MOVE_FEATHER_DANCE + }, + .cool = 10, + .beauty = 8, + .cute = 4, + .smart = 2, + .tough = 3, + .sheen = 70, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_DIGLETT, + .nickname = _("DIGLE"), + .trainerName = _("CALE"), + .trainerGfxId = 55, + .flags = 0x20800FFF, + .whichRank = 0, + .aiPool_Cool = FALSE, + .aiPool_Beauty = FALSE, + .aiPool_Cute = FALSE, + .aiPool_Smart = TRUE, + .aiPool_Tough = TRUE, + .moves = + { + MOVE_DIG, + MOVE_EARTHQUAKE, + MOVE_FISSURE, + MOVE_MAGNITUDE + }, + .cool = 4, + .beauty = 2, + .cute = 3, + .smart = 5, + .tough = 10, + .sheen = 80, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_POLIWAG, + .nickname = _("WAGIL"), + .trainerName = _("CAITLIN"), + .trainerGfxId = 53, + .flags = 0x80400FFF, + .whichRank = 0, + .aiPool_Cool = FALSE, + .aiPool_Beauty = TRUE, + .aiPool_Cute = FALSE, + .aiPool_Smart = FALSE, + .aiPool_Tough = TRUE, + .moves = + { + MOVE_HYDRO_PUMP, + MOVE_RAIN_DANCE, + MOVE_BODY_SLAM, + MOVE_ICE_BEAM + }, + .cool = 2, + .beauty = 10, + .cute = 5, + .smart = 3, + .tough = 10, + .sheen = 90, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_TOTODILE, + .nickname = _("TOTDIL"), + .trainerName = _("COLBY"), + .trainerGfxId = 5, + .flags = 0x10200FFF, + .whichRank = 0, + .aiPool_Cool = TRUE, + .aiPool_Beauty = TRUE, + .aiPool_Cute = FALSE, + .aiPool_Smart = FALSE, + .aiPool_Tough = FALSE, + .moves = + { + MOVE_RAGE, + MOVE_SCREECH, + MOVE_SURF, + MOVE_BLIZZARD + }, + .cool = 6, + .beauty = 10, + .cute = 2, + .smart = 1, + .tough = 5, + .sheen = 100, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_LEDYBA, + .nickname = _("BALEDY"), + .trainerName = _("KYLIE"), + .trainerGfxId = 45, + .flags = 0x20100FFF, + .whichRank = 0, + .aiPool_Cool = TRUE, + .aiPool_Beauty = FALSE, + .aiPool_Cute = TRUE, + .aiPool_Smart = FALSE, + .aiPool_Tough = FALSE, + .moves = + { + MOVE_BATON_PASS, + MOVE_AGILITY, + MOVE_SWIFT, + MOVE_ATTRACT + }, + .cool = 8, + .beauty = 6, + .cute = 8, + .smart = 6, + .tough = 2, + .sheen = 90, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_DELIBIRD, + .nickname = _("BIRDLY"), + .trainerName = _("LIAM"), + .trainerGfxId = 66, + .flags = 0x8080FFF, + .whichRank = 0, + .aiPool_Cool = FALSE, + .aiPool_Beauty = FALSE, + .aiPool_Cute = TRUE, + .aiPool_Smart = TRUE, + .aiPool_Tough = TRUE, + .moves = + { + MOVE_PRESENT, + MOVE_FACADE, + MOVE_FOCUS_PUNCH, + MOVE_RETURN + }, + .cool = 4, + .beauty = 3, + .cute = 10, + .smart = 5, + .tough = 3, + .sheen = 80, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_LARVITAR, + .nickname = _("TARVITAR"), + .trainerName = _("MILO"), + .trainerGfxId = 39, + .flags = 0x40040FFF, + .whichRank = 0, + .aiPool_Cool = FALSE, + .aiPool_Beauty = FALSE, + .aiPool_Cute = FALSE, + .aiPool_Smart = FALSE, + .aiPool_Tough = TRUE, + .moves = + { + MOVE_THRASH, + MOVE_TORMENT, + MOVE_CRUNCH, + MOVE_DIG + }, + .cool = 8, + .beauty = 5, + .cute = 5, + .smart = 8, + .tough = 10, + .sheen = 70, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_ROSELIA, + .nickname = _("RELIA"), + .trainerName = _("KARINA"), + .trainerGfxId = 32, + .flags = 0x24000FFF, + .whichRank = 1, + .aiPool_Cool = FALSE, + .aiPool_Beauty = TRUE, + .aiPool_Cute = FALSE, + .aiPool_Smart = TRUE, + .aiPool_Tough = FALSE, + .moves = + { + MOVE_PETAL_DANCE, + MOVE_MAGICAL_LEAF, + MOVE_GRASS_WHISTLE, + MOVE_INGRAIN + }, + .cool = 50, + .beauty = 15, + .cute = 75, + .smart = 10, + .tough = 20, + .sheen = 100, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_DODRIO, + .nickname = _("DUODO"), + .trainerName = _("BOBBY"), + .trainerGfxId = 51, + .flags = 0x82000FFF, + .whichRank = 1, + .aiPool_Cool = TRUE, + .aiPool_Beauty = TRUE, + .aiPool_Cute = TRUE, + .aiPool_Smart = TRUE, + .aiPool_Tough = TRUE, + .moves = + { + MOVE_PECK, + MOVE_FURY_ATTACK, + MOVE_RETURN, + MOVE_GROWL + }, + .cool = 15, + .beauty = 21, + .cute = 15, + .smart = 85, + .tough = 35, + .sheen = 110, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_TRAPINCH, + .nickname = _("PINCHIN"), + .trainerName = _("CLAIRE"), + .trainerGfxId = 8, + .flags = 0x81000FFF, + .whichRank = 1, + .aiPool_Cool = FALSE, + .aiPool_Beauty = FALSE, + .aiPool_Cute = TRUE, + .aiPool_Smart = TRUE, + .aiPool_Tough = TRUE, + .moves = + { + MOVE_BITE, + MOVE_SAND_ATTACK, + MOVE_DIG, + MOVE_FAINT_ATTACK + }, + .cool = 75, + .beauty = 25, + .cute = 25, + .smart = 10, + .tough = 25, + .sheen = 120, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_CACNEA, + .nickname = _("NACAC"), + .trainerName = _("WILLIE"), + .trainerGfxId = 11, + .flags = 0x80800FFF, + .whichRank = 1, + .aiPool_Cool = TRUE, + .aiPool_Beauty = FALSE, + .aiPool_Cute = FALSE, + .aiPool_Smart = TRUE, + .aiPool_Tough = FALSE, + .moves = + { + MOVE_SPIKES, + MOVE_LEER, + MOVE_POISON_STING, + MOVE_SAND_ATTACK + }, + .cool = 10, + .beauty = 30, + .cute = 25, + .smart = 65, + .tough = 25, + .sheen = 130, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_SANDSLASH, + .nickname = _("SHRAND"), + .trainerName = _("CASSIDY"), + .trainerGfxId = 18, + .flags = 0x10400FFF, + .whichRank = 1, + .aiPool_Cool = TRUE, + .aiPool_Beauty = FALSE, + .aiPool_Cute = FALSE, + .aiPool_Smart = FALSE, + .aiPool_Tough = TRUE, + .moves = + { + MOVE_SLASH, + MOVE_DEFENSE_CURL, + MOVE_SWIFT, + MOVE_FURY_SWIPES + }, + .cool = 30, + .beauty = 90, + .cute = 30, + .smart = 10, + .tough = 100, + .sheen = 140, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_BALTOY, + .nickname = _("TOYBAL"), + .trainerName = _("MORGAN"), + .trainerGfxId = 44, + .flags = 0x8200FFF, + .whichRank = 1, + .aiPool_Cool = FALSE, + .aiPool_Beauty = TRUE, + .aiPool_Cute = FALSE, + .aiPool_Smart = TRUE, + .aiPool_Tough = FALSE, + .moves = + { + MOVE_SELF_DESTRUCT, + MOVE_ROCK_TOMB, + MOVE_PSYBEAM, + MOVE_CONFUSION + }, + .cool = 50, + .beauty = 40, + .cute = 10, + .smart = 35, + .tough = 35, + .sheen = 150, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_MEDICHAM, + .nickname = _("CHAMCHAM"), + .trainerName = _("SUMMER"), + .trainerGfxId = 26, + .flags = 0x10100FFF, + .whichRank = 1, + .aiPool_Cool = TRUE, + .aiPool_Beauty = TRUE, + .aiPool_Cute = FALSE, + .aiPool_Smart = FALSE, + .aiPool_Tough = TRUE, + .moves = + { + MOVE_REVERSAL, + MOVE_THUNDER_PUNCH, + MOVE_FIRE_PUNCH, + MOVE_ICE_PUNCH + }, + .cool = 40, + .beauty = 20, + .cute = 40, + .smart = 40, + .tough = 40, + .sheen = 100, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_SPINDA, + .nickname = _("SPININ"), + .trainerName = _("MILES"), + .trainerGfxId = 31, + .flags = 0x80080FFF, + .whichRank = 1, + .aiPool_Cool = FALSE, + .aiPool_Beauty = FALSE, + .aiPool_Cute = TRUE, + .aiPool_Smart = TRUE, + .aiPool_Tough = FALSE, + .moves = + { + MOVE_TEETER_DANCE, + MOVE_PSYCH_UP, + MOVE_HYPNOSIS, + MOVE_UPROAR + }, + .cool = 25, + .beauty = 75, + .cute = 25, + .smart = 10, + .tough = 25, + .sheen = 110, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_SWABLU, + .nickname = _("SWABY"), + .trainerName = _("AUDREY"), + .trainerGfxId = 47, + .flags = 0xA0040FFF, + .whichRank = 1, + .aiPool_Cool = FALSE, + .aiPool_Beauty = TRUE, + .aiPool_Cute = FALSE, + .aiPool_Smart = TRUE, + .aiPool_Tough = FALSE, + .moves = + { + MOVE_MIRROR_MOVE, + MOVE_PERISH_SONG, + MOVE_SAFEGUARD, + MOVE_MIST + }, + .cool = 30, + .beauty = 30, + .cute = 40, + .smart = 30, + .tough = 25, + .sheen = 120, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_SPOINK, + .nickname = _("POINKER"), + .trainerName = _("AVERY"), + .trainerGfxId = 38, + .flags = 0x80020FFF, + .whichRank = 1, + .aiPool_Cool = FALSE, + .aiPool_Beauty = FALSE, + .aiPool_Cute = TRUE, + .aiPool_Smart = TRUE, + .aiPool_Tough = FALSE, + .moves = + { + MOVE_SPLASH, + MOVE_CONFUSE_RAY, + MOVE_SNORE, + MOVE_REST + }, + .cool = 40, + .beauty = 10, + .cute = 30, + .smart = 40, + .tough = 30, + .sheen = 130, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_KECLEON, + .nickname = _("KECON"), + .trainerName = _("ARIANA"), + .trainerGfxId = 10, + .flags = 0x80010FFF, + .whichRank = 1, + .aiPool_Cool = FALSE, + .aiPool_Beauty = FALSE, + .aiPool_Cute = FALSE, + .aiPool_Smart = TRUE, + .aiPool_Tough = TRUE, + .moves = + { + MOVE_THIEF, + MOVE_SCREECH, + MOVE_ANCIENT_POWER, + MOVE_BIND + }, + .cool = 10, + .beauty = 10, + .cute = 40, + .smart = 75, + .tough = 35, + .sheen = 140, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_GOLDEEN, + .nickname = _("GOLDEN"), + .trainerName = _("ASHTON"), + .trainerGfxId = 33, + .flags = 0x80008FFF, + .whichRank = 1, + .aiPool_Cool = TRUE, + .aiPool_Beauty = TRUE, + .aiPool_Cute = FALSE, + .aiPool_Smart = FALSE, + .aiPool_Tough = FALSE, + .moves = + { + MOVE_HORN_ATTACK, + MOVE_FURY_ATTACK, + MOVE_HORN_DRILL, + MOVE_TAIL_WHIP + }, + .cool = 70, + .beauty = 30, + .cute = 5, + .smart = 30, + .tough = 25, + .sheen = 150, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_BARBOACH, + .nickname = _("BOBOACH"), + .trainerName = _("SANDRA"), + .trainerGfxId = 6, + .flags = 0x80004FFF, + .whichRank = 1, + .aiPool_Cool = FALSE, + .aiPool_Beauty = FALSE, + .aiPool_Cute = TRUE, + .aiPool_Smart = TRUE, + .aiPool_Tough = TRUE, + .moves = + { + MOVE_MUD_SPORT, + MOVE_WATER_SPORT, + MOVE_EARTHQUAKE, + MOVE_FUTURE_SIGHT + }, + .cool = 45, + .beauty = 45, + .cute = 60, + .smart = 25, + .tough = 15, + .sheen = 100, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_SKARMORY, + .nickname = _("CORPY"), + .trainerName = _("CARSON"), + .trainerGfxId = 35, + .flags = 0x8002FFF, + .whichRank = 1, + .aiPool_Cool = TRUE, + .aiPool_Beauty = TRUE, + .aiPool_Cute = FALSE, + .aiPool_Smart = FALSE, + .aiPool_Tough = TRUE, + .moves = + { + MOVE_SWIFT, + MOVE_DOUBLE_TEAM, + MOVE_AGILITY, + MOVE_CUT + }, + .cool = 40, + .beauty = 30, + .cute = 25, + .smart = 60, + .tough = 20, + .sheen = 110, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_LOTAD, + .nickname = _("TADO"), + .trainerName = _("KATRINA"), + .trainerGfxId = 16, + .flags = 0x8001FFF, + .whichRank = 1, + .aiPool_Cool = FALSE, + .aiPool_Beauty = TRUE, + .aiPool_Cute = TRUE, + .aiPool_Smart = TRUE, + .aiPool_Tough = FALSE, + .moves = + { + MOVE_ASTONISH, + MOVE_GROWL, + MOVE_RAIN_DANCE, + MOVE_WATER_PULSE + }, + .cool = 15, + .beauty = 15, + .cute = 30, + .smart = 15, + .tough = 75, + .sheen = 120, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_SLOWBRO, + .nickname = _("BROWLO"), + .trainerName = _("LUKE"), + .trainerGfxId = 17, + .flags = 0xC000FFF, + .whichRank = 1, + .aiPool_Cool = FALSE, + .aiPool_Beauty = FALSE, + .aiPool_Cute = TRUE, + .aiPool_Smart = TRUE, + .aiPool_Tough = FALSE, + .moves = + { + MOVE_YAWN, + MOVE_DISABLE, + MOVE_GROWL, + MOVE_CONFUSION + }, + .cool = 20, + .beauty = 40, + .cute = 40, + .smart = 30, + .tough = 20, + .sheen = 100, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_FARFETCHD, + .nickname = _("FETCHIN"), + .trainerName = _("RAUL"), + .trainerGfxId = 66, + .flags = 0x82000FFF, + .whichRank = 1, + .aiPool_Cool = TRUE, + .aiPool_Beauty = FALSE, + .aiPool_Cute = TRUE, + .aiPool_Smart = FALSE, + .aiPool_Tough = FALSE, + .moves = + { + MOVE_FACADE, + MOVE_FURY_CUTTER, + MOVE_FLY, + MOVE_RETURN + }, + .cool = 40, + .beauty = 10, + .cute = 40, + .smart = 20, + .tough = 20, + .sheen = 110, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_SEEL, + .nickname = _("SEELEY"), + .trainerName = _("JADA"), + .trainerGfxId = 20, + .flags = 0x21000FFF, + .whichRank = 1, + .aiPool_Cool = FALSE, + .aiPool_Beauty = TRUE, + .aiPool_Cute = TRUE, + .aiPool_Smart = FALSE, + .aiPool_Tough = FALSE, + .moves = + { + MOVE_ATTRACT, + MOVE_ICE_BEAM, + MOVE_SAFEGUARD, + MOVE_GROWL + }, + .cool = 10, + .beauty = 30, + .cute = 40, + .smart = 20, + .tough = 20, + .sheen = 120, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_DROWZEE, + .nickname = _("DROWZIN"), + .trainerName = _("ZEEK"), + .trainerGfxId = 37, + .flags = 0x20800FFF, + .whichRank = 1, + .aiPool_Cool = FALSE, + .aiPool_Beauty = TRUE, + .aiPool_Cute = TRUE, + .aiPool_Smart = TRUE, + .aiPool_Tough = TRUE, + .moves = + { + MOVE_DISABLE, + MOVE_FUTURE_SIGHT, + MOVE_HIDDEN_POWER, + MOVE_RETURN + }, + .cool = 10, + .beauty = 40, + .cute = 50, + .smart = 30, + .tough = 45, + .sheen = 130, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_HITMONCHAN, + .nickname = _("HITEMON"), + .trainerName = _("DIEGO"), + .trainerGfxId = 21, + .flags = 0x80400FFF, + .whichRank = 1, + .aiPool_Cool = TRUE, + .aiPool_Beauty = FALSE, + .aiPool_Cute = FALSE, + .aiPool_Smart = FALSE, + .aiPool_Tough = TRUE, + .moves = + { + MOVE_SKY_UPPERCUT, + MOVE_DETECT, + MOVE_REVENGE, + MOVE_MEGA_PUNCH + }, + .cool = 45, + .beauty = 20, + .cute = 10, + .smart = 20, + .tough = 45, + .sheen = 140, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_BLISSEY, + .nickname = _("BLISS"), + .trainerName = _("ALIYAH"), + .trainerGfxId = 85, + .flags = 0x10200FFF, + .whichRank = 1, + .aiPool_Cool = FALSE, + .aiPool_Beauty = TRUE, + .aiPool_Cute = TRUE, + .aiPool_Smart = FALSE, + .aiPool_Tough = TRUE, + .moves = + { + MOVE_SING, + MOVE_SOFT_BOILED, + MOVE_EGG_BOMB, + MOVE_DOUBLE_EDGE + }, + .cool = 20, + .beauty = 35, + .cute = 40, + .smart = 20, + .tough = 20, + .sheen = 150, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_ELEKID, + .nickname = _("KIDLEK"), + .trainerName = _("NATALIA"), + .trainerGfxId = 18, + .flags = 0x20100FFF, + .whichRank = 1, + .aiPool_Cool = TRUE, + .aiPool_Beauty = FALSE, + .aiPool_Cute = TRUE, + .aiPool_Smart = FALSE, + .aiPool_Tough = FALSE, + .moves = + { + MOVE_SHOCK_WAVE, + MOVE_QUICK_ATTACK, + MOVE_SCREECH, + MOVE_ATTRACT + }, + .cool = 40, + .beauty = 10, + .cute = 40, + .smart = 25, + .tough = 25, + .sheen = 140, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_SNUBBULL, + .nickname = _("SNUBBINS"), + .trainerName = _("DEVIN"), + .trainerGfxId = 48, + .flags = 0x8080FFF, + .whichRank = 1, + .aiPool_Cool = FALSE, + .aiPool_Beauty = FALSE, + .aiPool_Cute = TRUE, + .aiPool_Smart = FALSE, + .aiPool_Tough = TRUE, + .moves = + { + MOVE_SCARY_FACE, + MOVE_TAUNT, + MOVE_TAIL_WHIP, + MOVE_BITE + }, + .cool = 20, + .beauty = 20, + .cute = 20, + .smart = 20, + .tough = 20, + .sheen = 130, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_MISDREAVUS, + .nickname = _("DREAVIS"), + .trainerName = _("TYLOR"), + .trainerGfxId = 40, + .flags = 0x40040FFF, + .whichRank = 1, + .aiPool_Cool = FALSE, + .aiPool_Beauty = TRUE, + .aiPool_Cute = FALSE, + .aiPool_Smart = TRUE, + .aiPool_Tough = FALSE, + .moves = + { + MOVE_PERISH_SONG, + MOVE_MEAN_LOOK, + MOVE_CONFUSE_RAY, + MOVE_PAIN_SPLIT + }, + .cool = 10, + .beauty = 35, + .cute = 10, + .smart = 45, + .tough = 20, + .sheen = 120, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_LAIRON, + .nickname = _("LAIRN"), + .trainerName = _("RONNIE"), + .trainerGfxId = 55, + .flags = 0x84000FFF, + .whichRank = 2, + .aiPool_Cool = FALSE, + .aiPool_Beauty = FALSE, + .aiPool_Cute = FALSE, + .aiPool_Smart = TRUE, + .aiPool_Tough = TRUE, + .moves = + { + MOVE_METAL_SOUND, + MOVE_METAL_CLAW, + MOVE_HARDEN, + MOVE_TAKE_DOWN + }, + .cool = 30, + .beauty = 50, + .cute = 35, + .smart = 100, + .tough = 90, + .sheen = 200, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_SHIFTRY, + .nickname = _("SHIFTY"), + .trainerName = _("CLAUDIA"), + .trainerGfxId = 8, + .flags = 0x82000FFF, + .whichRank = 2, + .aiPool_Cool = TRUE, + .aiPool_Beauty = TRUE, + .aiPool_Cute = FALSE, + .aiPool_Smart = FALSE, + .aiPool_Tough = FALSE, + .moves = + { + MOVE_GROWTH, + MOVE_RAZOR_WIND, + MOVE_EXPLOSION, + MOVE_EXTRASENSORY + }, + .cool = 75, + .beauty = 75, + .cute = 65, + .smart = 35, + .tough = 70, + .sheen = 210, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_NINJASK, + .nickname = _("NINAS"), + .trainerName = _("ELIAS"), + .trainerGfxId = 11, + .flags = 0x81000FFF, + .whichRank = 2, + .aiPool_Cool = FALSE, + .aiPool_Beauty = FALSE, + .aiPool_Cute = TRUE, + .aiPool_Smart = TRUE, + .aiPool_Tough = TRUE, + .moves = + { + MOVE_SCREECH, + MOVE_FURY_SWIPES, + MOVE_SAND_ATTACK, + MOVE_BATON_PASS + }, + .cool = 30, + .beauty = 50, + .cute = 95, + .smart = 70, + .tough = 70, + .sheen = 220, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_SWELLOW, + .nickname = _("WELOW"), + .trainerName = _("JADE"), + .trainerGfxId = 18, + .flags = 0x80800FFF, + .whichRank = 2, + .aiPool_Cool = TRUE, + .aiPool_Beauty = TRUE, + .aiPool_Cute = FALSE, + .aiPool_Smart = FALSE, + .aiPool_Tough = FALSE, + .moves = + { + MOVE_AGILITY, + MOVE_AERIAL_ACE, + MOVE_WING_ATTACK, + MOVE_FLY + }, + .cool = 65, + .beauty = 85, + .cute = 35, + .smart = 75, + .tough = 40, + .sheen = 230, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_MIGHTYENA, + .nickname = _("YENA"), + .trainerName = _("FRANCIS"), + .trainerGfxId = 44, + .flags = 0x80400FFF, + .whichRank = 2, + .aiPool_Cool = FALSE, + .aiPool_Beauty = FALSE, + .aiPool_Cute = FALSE, + .aiPool_Smart = TRUE, + .aiPool_Tough = TRUE, + .moves = + { + MOVE_TAUNT, + MOVE_THIEF, + MOVE_ODOR_SLEUTH, + MOVE_TAKE_DOWN + }, + .cool = 40, + .beauty = 80, + .cute = 35, + .smart = 70, + .tough = 70, + .sheen = 240, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_BEAUTIFLY, + .nickname = _("TIFLY"), + .trainerName = _("ALISHA"), + .trainerGfxId = 26, + .flags = 0x80200FFF, + .whichRank = 2, + .aiPool_Cool = FALSE, + .aiPool_Beauty = TRUE, + .aiPool_Cute = FALSE, + .aiPool_Smart = TRUE, + .aiPool_Tough = FALSE, + .moves = + { + MOVE_MORNING_SUN, + MOVE_SILVER_WIND, + MOVE_STUN_SPORE, + MOVE_SECRET_POWER + }, + .cool = 40, + .beauty = 70, + .cute = 25, + .smart = 80, + .tough = 100, + .sheen = 250, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_SEAKING, + .nickname = _("KINGSEA"), + .trainerName = _("SAUL"), + .trainerGfxId = 31, + .flags = 0x80100FFF, + .whichRank = 2, + .aiPool_Cool = TRUE, + .aiPool_Beauty = FALSE, + .aiPool_Cute = TRUE, + .aiPool_Smart = TRUE, + .aiPool_Tough = TRUE, + .moves = + { + MOVE_FLAIL, + MOVE_SUPERSONIC, + MOVE_HORN_ATTACK, + MOVE_FURY_ATTACK + }, + .cool = 80, + .beauty = 60, + .cute = 30, + .smart = 70, + .tough = 90, + .sheen = 200, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_CASTFORM, + .nickname = _("CASTER"), + .trainerName = _("FELICIA"), + .trainerGfxId = 47, + .flags = 0x80080FFF, + .whichRank = 2, + .aiPool_Cool = TRUE, + .aiPool_Beauty = TRUE, + .aiPool_Cute = TRUE, + .aiPool_Smart = TRUE, + .aiPool_Tough = TRUE, + .moves = + { + MOVE_SUNNY_DAY, + MOVE_WEATHER_BALL, + MOVE_SANDSTORM, + MOVE_RETURN + }, + .cool = 70, + .beauty = 80, + .cute = 80, + .smart = 50, + .tough = 65, + .sheen = 210, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_MACHOKE, + .nickname = _("CHOKEM"), + .trainerName = _("EMILIO"), + .trainerGfxId = 38, + .flags = 0x80040FFF, + .whichRank = 2, + .aiPool_Cool = TRUE, + .aiPool_Beauty = FALSE, + .aiPool_Cute = FALSE, + .aiPool_Smart = FALSE, + .aiPool_Tough = TRUE, + .moves = + { + MOVE_SEISMIC_TOSS, + MOVE_FOCUS_ENERGY, + MOVE_KARATE_CHOP, + MOVE_SCARY_FACE + }, + .cool = 70, + .beauty = 85, + .cute = 25, + .smart = 60, + .tough = 50, + .sheen = 220, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_LOMBRE, + .nickname = _("LOMBE"), + .trainerName = _("KARLA"), + .trainerGfxId = 10, + .flags = 0x80020FFF, + .whichRank = 2, + .aiPool_Cool = FALSE, + .aiPool_Beauty = TRUE, + .aiPool_Cute = TRUE, + .aiPool_Smart = TRUE, + .aiPool_Tough = FALSE, + .moves = + { + MOVE_ATTRACT, + MOVE_FLASH, + MOVE_UPROAR, + MOVE_GROWL + }, + .cool = 40, + .beauty = 60, + .cute = 90, + .smart = 45, + .tough = 70, + .sheen = 230, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_SEVIPER, + .nickname = _("VIPES"), + .trainerName = _("DARRYL"), + .trainerGfxId = 33, + .flags = 0x80010FFF, + .whichRank = 2, + .aiPool_Cool = FALSE, + .aiPool_Beauty = FALSE, + .aiPool_Cute = FALSE, + .aiPool_Smart = TRUE, + .aiPool_Tough = TRUE, + .moves = + { + MOVE_POISON_FANG, + MOVE_GLARE, + MOVE_WRAP, + MOVE_SCREECH + }, + .cool = 35, + .beauty = 50, + .cute = 90, + .smart = 40, + .tough = 100, + .sheen = 240, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_WAILMER, + .nickname = _("MERAIL"), + .trainerName = _("SELENA"), + .trainerGfxId = 22, + .flags = 0x80008FFF, + .whichRank = 2, + .aiPool_Cool = FALSE, + .aiPool_Beauty = TRUE, + .aiPool_Cute = TRUE, + .aiPool_Smart = FALSE, + .aiPool_Tough = FALSE, + .moves = + { + MOVE_WATER_PULSE, + MOVE_REST, + MOVE_WATER_SPOUT, + MOVE_SPLASH + }, + .cool = 30, + .beauty = 100, + .cute = 100, + .smart = 50, + .tough = 30, + .sheen = 250, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_MAGIKARP, + .nickname = _("KARPAG"), + .trainerName = _("NOEL"), + .trainerGfxId = 35, + .flags = 0x80004FFF, + .whichRank = 2, + .aiPool_Cool = FALSE, + .aiPool_Beauty = FALSE, + .aiPool_Cute = TRUE, + .aiPool_Smart = FALSE, + .aiPool_Tough = TRUE, + .moves = + { + MOVE_TACKLE, + MOVE_SPLASH, + MOVE_FLAIL, + MOVE_TACKLE + }, + .cool = 30, + .beauty = 30, + .cute = 160, + .smart = 50, + .tough = 160, + .sheen = 255, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_LUNATONE, + .nickname = _("LUNONE"), + .trainerName = _("LACEY"), + .trainerGfxId = 16, + .flags = 0x80002FFF, + .whichRank = 2, + .aiPool_Cool = FALSE, + .aiPool_Beauty = TRUE, + .aiPool_Cute = FALSE, + .aiPool_Smart = TRUE, + .aiPool_Tough = FALSE, + .moves = + { + MOVE_EXPLOSION, + MOVE_FUTURE_SIGHT, + MOVE_PSYCHIC, + MOVE_CONFUSION + }, + .cool = 50, + .beauty = 70, + .cute = 60, + .smart = 70, + .tough = 50, + .sheen = 210, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_ABSOL, + .nickname = _("ABSO"), + .trainerName = _("CORBIN"), + .trainerGfxId = 39, + .flags = 0x80001FFF, + .whichRank = 2, + .aiPool_Cool = TRUE, + .aiPool_Beauty = TRUE, + .aiPool_Cute = FALSE, + .aiPool_Smart = FALSE, + .aiPool_Tough = FALSE, + .moves = + { + MOVE_PERISH_SONG, + MOVE_HAIL, + MOVE_HYPER_BEAM, + MOVE_SLASH + }, + .cool = 95, + .beauty = 80, + .cute = 85, + .smart = 35, + .tough = 35, + .sheen = 220, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_EXEGGUTOR, + .nickname = _("EGGSOR"), + .trainerName = _("GRACIE"), + .trainerGfxId = 32, + .flags = 0xC000FFF, + .whichRank = 2, + .aiPool_Cool = FALSE, + .aiPool_Beauty = FALSE, + .aiPool_Cute = FALSE, + .aiPool_Smart = TRUE, + .aiPool_Tough = TRUE, + .moves = + { + MOVE_STOMP, + MOVE_HYPNOSIS, + MOVE_EGG_BOMB, + MOVE_SKILL_SWAP + }, + .cool = 40, + .beauty = 50, + .cute = 60, + .smart = 100, + .tough = 80, + .sheen = 200, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_CUBONE, + .nickname = _("CUBIN"), + .trainerName = _("COLTIN"), + .trainerGfxId = 65, + .flags = 0x82000FFF, + .whichRank = 2, + .aiPool_Cool = FALSE, + .aiPool_Beauty = FALSE, + .aiPool_Cute = TRUE, + .aiPool_Smart = FALSE, + .aiPool_Tough = TRUE, + .moves = + { + MOVE_BONE_CLUB, + MOVE_BONEMERANG, + MOVE_BONE_RUSH, + MOVE_GROWL + }, + .cool = 40, + .beauty = 35, + .cute = 85, + .smart = 35, + .tough = 100, + .sheen = 210, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_HITMONLEE, + .nickname = _("HITMON"), + .trainerName = _("ELLIE"), + .trainerGfxId = 22, + .flags = 0x21000FFF, + .whichRank = 2, + .aiPool_Cool = TRUE, + .aiPool_Beauty = FALSE, + .aiPool_Cute = FALSE, + .aiPool_Smart = FALSE, + .aiPool_Tough = TRUE, + .moves = + { + MOVE_REVERSAL, + MOVE_REVENGE, + MOVE_FOCUS_ENERGY, + MOVE_MEGA_KICK + }, + .cool = 85, + .beauty = 30, + .cute = 25, + .smart = 50, + .tough = 100, + .sheen = 220, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_SQUIRTLE, + .nickname = _("SURTLE"), + .trainerName = _("MARCUS"), + .trainerGfxId = 49, + .flags = 0x20800FFF, + .whichRank = 2, + .aiPool_Cool = FALSE, + .aiPool_Beauty = FALSE, + .aiPool_Cute = TRUE, + .aiPool_Smart = FALSE, + .aiPool_Tough = TRUE, + .moves = + { + MOVE_TAIL_WHIP, + MOVE_BUBBLE, + MOVE_FOCUS_PUNCH, + MOVE_WITHDRAW + }, + .cool = 30, + .beauty = 35, + .cute = 100, + .smart = 40, + .tough = 95, + .sheen = 230, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_KANGASKHAN, + .nickname = _("KHANKAN"), + .trainerName = _("KIARA"), + .trainerGfxId = 14, + .flags = 0x80400FFF, + .whichRank = 2, + .aiPool_Cool = TRUE, + .aiPool_Beauty = FALSE, + .aiPool_Cute = FALSE, + .aiPool_Smart = FALSE, + .aiPool_Tough = TRUE, + .moves = + { + MOVE_MEGA_PUNCH, + MOVE_RAGE, + MOVE_FOCUS_PUNCH, + MOVE_TAIL_WHIP + }, + .cool = 100, + .beauty = 50, + .cute = 30, + .smart = 50, + .tough = 100, + .sheen = 240, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_PINECO, + .nickname = _("PINOC"), + .trainerName = _("BRYCE"), + .trainerGfxId = 36, + .flags = 0x10200FFF, + .whichRank = 2, + .aiPool_Cool = FALSE, + .aiPool_Beauty = TRUE, + .aiPool_Cute = FALSE, + .aiPool_Smart = TRUE, + .aiPool_Tough = FALSE, + .moves = + { + MOVE_EXPLOSION, + MOVE_SPIKES, + MOVE_LIGHT_SCREEN, + MOVE_GIGA_DRAIN + }, + .cool = 80, + .beauty = 80, + .cute = 80, + .smart = 80, + .tough = 80, + .sheen = 250, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_DUNSPARCE, + .nickname = _("DILTOT"), + .trainerName = _("JAMIE"), + .trainerGfxId = 34, + .flags = 0x20100FFF, + .whichRank = 2, + .aiPool_Cool = FALSE, + .aiPool_Beauty = FALSE, + .aiPool_Cute = TRUE, + .aiPool_Smart = FALSE, + .aiPool_Tough = TRUE, + .moves = + { + MOVE_SPITE, + MOVE_YAWN, + MOVE_DEFENSE_CURL, + MOVE_TAKE_DOWN + }, + .cool = 40, + .beauty = 35, + .cute = 100, + .smart = 40, + .tough = 110, + .sheen = 240, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_HOUNDOOM, + .nickname = _("DOOMOND"), + .trainerName = _("JORGE"), + .trainerGfxId = 48, + .flags = 0x8080FFF, + .whichRank = 2, + .aiPool_Cool = TRUE, + .aiPool_Beauty = TRUE, + .aiPool_Cute = FALSE, + .aiPool_Smart = FALSE, + .aiPool_Tough = FALSE, + .moves = + { + MOVE_ROAR, + MOVE_FLAMETHROWER, + MOVE_FAINT_ATTACK, + MOVE_SUNNY_DAY + }, + .cool = 100, + .beauty = 100, + .cute = 30, + .smart = 25, + .tough = 80, + .sheen = 230, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_MILTANK, + .nickname = _("MILKAN"), + .trainerName = _("DEVON"), + .trainerGfxId = 25, + .flags = 0x40040FFF, + .whichRank = 2, + .aiPool_Cool = FALSE, + .aiPool_Beauty = TRUE, + .aiPool_Cute = TRUE, + .aiPool_Smart = FALSE, + .aiPool_Tough = FALSE, + .moves = + { + MOVE_MILK_DRINK, + MOVE_HEAL_BELL, + MOVE_DEFENSE_CURL, + MOVE_BLIZZARD + }, + .cool = 50, + .beauty = 110, + .cute = 100, + .smart = 35, + .tough = 40, + .sheen = 220, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_GYARADOS, + .nickname = _("RADOS"), + .trainerName = _("JUSTINA"), + .trainerGfxId = 32, + .flags = 0x84000FFF, + .whichRank = 3, + .aiPool_Cool = TRUE, + .aiPool_Beauty = TRUE, + .aiPool_Cute = FALSE, + .aiPool_Smart = FALSE, + .aiPool_Tough = TRUE, + .moves = + { + MOVE_HYPER_BEAM, + MOVE_HYDRO_PUMP, + MOVE_RAIN_DANCE, + MOVE_BITE + }, + .cool = 160, + .beauty = 200, + .cute = 20, + .smart = 40, + .tough = 160, + .sheen = 255, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_LOUDRED, + .nickname = _("LOUDERD"), + .trainerName = _("RALPH"), + .trainerGfxId = 21, + .flags = 0x82000FFF, + .whichRank = 3, + .aiPool_Cool = TRUE, + .aiPool_Beauty = FALSE, + .aiPool_Cute = FALSE, + .aiPool_Smart = FALSE, + .aiPool_Tough = TRUE, + .moves = + { + MOVE_HYPER_VOICE, + MOVE_STOMP, + MOVE_ROAR, + MOVE_HOWL + }, + .cool = 170, + .beauty = 50, + .cute = 55, + .smart = 150, + .tough = 160, + .sheen = 255, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_SKITTY, + .nickname = _("SITTY"), + .trainerName = _("ROSA"), + .trainerGfxId = 8, + .flags = 0x81000FFF, + .whichRank = 3, + .aiPool_Cool = FALSE, + .aiPool_Beauty = TRUE, + .aiPool_Cute = TRUE, + .aiPool_Smart = TRUE, + .aiPool_Tough = FALSE, + .moves = + { + MOVE_ATTRACT, + MOVE_ASSIST, + MOVE_FAINT_ATTACK, + MOVE_TAIL_WHIP + }, + .cool = 40, + .beauty = 200, + .cute = 150, + .smart = 185, + .tough = 60, + .sheen = 255, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_SLAKING, + .nickname = _("SLING"), + .trainerName = _("KEATON"), + .trainerGfxId = 11, + .flags = 0x80800FFF, + .whichRank = 3, + .aiPool_Cool = FALSE, + .aiPool_Beauty = FALSE, + .aiPool_Cute = TRUE, + .aiPool_Smart = TRUE, + .aiPool_Tough = TRUE, + .moves = + { + MOVE_COVET, + MOVE_COUNTER, + MOVE_ENCORE, + MOVE_SLACK_OFF + }, + .cool = 85, + .beauty = 85, + .cute = 170, + .smart = 110, + .tough = 150, + .sheen = 255, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_ALTARIA, + .nickname = _("TARIA"), + .trainerName = _("MAYRA"), + .trainerGfxId = 18, + .flags = 0x80400FFF, + .whichRank = 3, + .aiPool_Cool = TRUE, + .aiPool_Beauty = TRUE, + .aiPool_Cute = FALSE, + .aiPool_Smart = FALSE, + .aiPool_Tough = FALSE, + .moves = + { + MOVE_DRAGON_DANCE, + MOVE_HYPER_BEAM, + MOVE_PERISH_SONG, + MOVE_SAFEGUARD + }, + .cool = 170, + .beauty = 150, + .cute = 30, + .smart = 30, + .tough = 90, + .sheen = 255, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_KIRLIA, + .nickname = _("LIRKI"), + .trainerName = _("LAMAR"), + .trainerGfxId = 15, + .flags = 0x80200FFF, + .whichRank = 3, + .aiPool_Cool = TRUE, + .aiPool_Beauty = FALSE, + .aiPool_Cute = FALSE, + .aiPool_Smart = TRUE, + .aiPool_Tough = FALSE, + .moves = + { + MOVE_SHOCK_WAVE, + MOVE_SHADOW_BALL, + MOVE_SKILL_SWAP, + MOVE_RETURN + }, + .cool = 230, + .beauty = 60, + .cute = 60, + .smart = 230, + .tough = 80, + .sheen = 255, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_BELLOSSOM, + .nickname = _("BLOSSOM"), + .trainerName = _("AUBREY"), + .trainerGfxId = 26, + .flags = 0x80100FFF, + .whichRank = 3, + .aiPool_Cool = FALSE, + .aiPool_Beauty = TRUE, + .aiPool_Cute = TRUE, + .aiPool_Smart = TRUE, + .aiPool_Tough = FALSE, + .moves = + { + MOVE_PETAL_DANCE, + MOVE_SWEET_SCENT, + MOVE_STUN_SPORE, + MOVE_FLASH + }, + .cool = 35, + .beauty = 200, + .cute = 150, + .smart = 130, + .tough = 40, + .sheen = 255, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_SABLEYE, + .nickname = _("EYESAB"), + .trainerName = _("NIGEL"), + .trainerGfxId = 31, + .flags = 0x80080FFF, + .whichRank = 3, + .aiPool_Cool = FALSE, + .aiPool_Beauty = FALSE, + .aiPool_Cute = TRUE, + .aiPool_Smart = TRUE, + .aiPool_Tough = TRUE, + .moves = + { + MOVE_MEAN_LOOK, + MOVE_FAINT_ATTACK, + MOVE_KNOCK_OFF, + MOVE_CONFUSE_RAY + }, + .cool = 25, + .beauty = 35, + .cute = 230, + .smart = 150, + .tough = 160, + .sheen = 255, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_NATU, + .nickname = _("UTAN"), + .trainerName = _("CAMILLE"), + .trainerGfxId = 47, + .flags = 0x80040FFF, + .whichRank = 3, + .aiPool_Cool = FALSE, + .aiPool_Beauty = FALSE, + .aiPool_Cute = TRUE, + .aiPool_Smart = TRUE, + .aiPool_Tough = TRUE, + .moves = + { + MOVE_NIGHT_SHADE, + MOVE_FUTURE_SIGHT, + MOVE_CONFUSE_RAY, + MOVE_PSYCHIC + }, + .cool = 35, + .beauty = 35, + .cute = 150, + .smart = 130, + .tough = 170, + .sheen = 255, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_SHARPEDO, + .nickname = _("PEDOS"), + .trainerName = _("DEON"), + .trainerGfxId = 38, + .flags = 0x80020FFF, + .whichRank = 3, + .aiPool_Cool = TRUE, + .aiPool_Beauty = FALSE, + .aiPool_Cute = TRUE, + .aiPool_Smart = FALSE, + .aiPool_Tough = TRUE, + .moves = + { + MOVE_AGILITY, + MOVE_SWAGGER, + MOVE_TAUNT, + MOVE_TAKE_DOWN + }, + .cool = 140, + .beauty = 70, + .cute = 140, + .smart = 75, + .tough = 100, + .sheen = 255, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_LUVDISC, + .nickname = _("LUVIS"), + .trainerName = _("JANELLE"), + .trainerGfxId = 10, + .flags = 0x80010FFF, + .whichRank = 3, + .aiPool_Cool = FALSE, + .aiPool_Beauty = FALSE, + .aiPool_Cute = TRUE, + .aiPool_Smart = FALSE, + .aiPool_Tough = TRUE, + .moves = + { + MOVE_SWEET_KISS, + MOVE_ATTRACT, + MOVE_TAKE_DOWN, + MOVE_CHARM + }, + .cool = 50, + .beauty = 100, + .cute = 220, + .smart = 40, + .tough = 190, + .sheen = 255, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_HERACROSS, + .nickname = _("HEROSS"), + .trainerName = _("HEATH"), + .trainerGfxId = 33, + .flags = 0x80008FFF, + .whichRank = 3, + .aiPool_Cool = TRUE, + .aiPool_Beauty = FALSE, + .aiPool_Cute = FALSE, + .aiPool_Smart = FALSE, + .aiPool_Tough = TRUE, + .moves = + { + MOVE_STRENGTH, + MOVE_ENDURE, + MOVE_REVERSAL, + MOVE_ROCK_TOMB + }, + .cool = 170, + .beauty = 70, + .cute = 110, + .smart = 240, + .tough = 140, + .sheen = 255, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_ELECTRODE, + .nickname = _("RODLECT"), + .trainerName = _("SASHA"), + .trainerGfxId = 6, + .flags = 0x80004FFF, + .whichRank = 3, + .aiPool_Cool = TRUE, + .aiPool_Beauty = TRUE, + .aiPool_Cute = FALSE, + .aiPool_Smart = FALSE, + .aiPool_Tough = FALSE, + .moves = + { + MOVE_EXPLOSION, + MOVE_LIGHT_SCREEN, + MOVE_SWIFT, + MOVE_FLASH + }, + .cool = 200, + .beauty = 200, + .cute = 30, + .smart = 35, + .tough = 50, + .sheen = 255, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_PICHU, + .nickname = _("CHUPY"), + .trainerName = _("FRANKIE"), + .trainerGfxId = 35, + .flags = 0x80002FFF, + .whichRank = 3, + .aiPool_Cool = FALSE, + .aiPool_Beauty = TRUE, + .aiPool_Cute = TRUE, + .aiPool_Smart = TRUE, + .aiPool_Tough = FALSE, + .moves = + { + MOVE_SWEET_KISS, + MOVE_ATTRACT, + MOVE_REST, + MOVE_TAIL_WHIP + }, + .cool = 25, + .beauty = 150, + .cute = 180, + .smart = 115, + .tough = 120, + .sheen = 255, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_WOBBUFFET, + .nickname = _("WOBET"), + .trainerName = _("HELEN"), + .trainerGfxId = 16, + .flags = 0x80001FFF, + .whichRank = 3, + .aiPool_Cool = TRUE, + .aiPool_Beauty = TRUE, + .aiPool_Cute = FALSE, + .aiPool_Smart = TRUE, + .aiPool_Tough = TRUE, + .moves = + { + MOVE_COUNTER, + MOVE_MIRROR_COAT, + MOVE_SAFEGUARD, + MOVE_DESTINY_BOND + }, + .cool = 60, + .beauty = 230, + .cute = 50, + .smart = 220, + .tough = 210, + .sheen = 255, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_GENGAR, + .nickname = _("GAREN"), + .trainerName = _("CAMILE"), + .trainerGfxId = 40, + .flags = 0xC000FFF, + .whichRank = 3, + .aiPool_Cool = TRUE, + .aiPool_Beauty = FALSE, + .aiPool_Cute = FALSE, + .aiPool_Smart = FALSE, + .aiPool_Tough = TRUE, + .moves = + { + MOVE_DESTINY_BOND, + MOVE_CONFUSE_RAY, + MOVE_LICK, + MOVE_SLUDGE_BOMB + }, + .cool = 200, + .beauty = 100, + .cute = 50, + .smart = 80, + .tough = 180, + .sheen = 255, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_PORYGON, + .nickname = _("GONPOR"), + .trainerName = _("MARTIN"), + .trainerGfxId = 46, + .flags = 0x82000FFF, + .whichRank = 3, + .aiPool_Cool = TRUE, + .aiPool_Beauty = TRUE, + .aiPool_Cute = TRUE, + .aiPool_Smart = TRUE, + .aiPool_Tough = TRUE, + .moves = + { + MOVE_CONVERSION_2, + MOVE_CONVERSION, + MOVE_RETURN, + MOVE_RECYCLE + }, + .cool = 130, + .beauty = 130, + .cute = 130, + .smart = 130, + .tough = 130, + .sheen = 255, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_DRAGONITE, + .nickname = _("DRITE"), + .trainerName = _("SERGIO"), + .trainerGfxId = 7, + .flags = 0x21000FFF, + .whichRank = 3, + .aiPool_Cool = TRUE, + .aiPool_Beauty = FALSE, + .aiPool_Cute = FALSE, + .aiPool_Smart = FALSE, + .aiPool_Tough = TRUE, + .moves = + { + MOVE_OUTRAGE, + MOVE_SLAM, + MOVE_TWISTER, + MOVE_EARTHQUAKE + }, + .cool = 150, + .beauty = 140, + .cute = 50, + .smart = 120, + .tough = 150, + .sheen = 255, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_MEOWTH, + .nickname = _("MEOWY"), + .trainerName = _("KAILEY"), + .trainerGfxId = 6, + .flags = 0x20800FFF, + .whichRank = 3, + .aiPool_Cool = FALSE, + .aiPool_Beauty = FALSE, + .aiPool_Cute = TRUE, + .aiPool_Smart = TRUE, + .aiPool_Tough = FALSE, + .moves = + { + MOVE_GROWL, + MOVE_TAUNT, + MOVE_PAY_DAY, + MOVE_BITE + }, + .cool = 125, + .beauty = 110, + .cute = 180, + .smart = 170, + .tough = 80, + .sheen = 255, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_JYNX, + .nickname = _("NYX"), + .trainerName = _("PERLA"), + .trainerGfxId = 45, + .flags = 0x80400FFF, + .whichRank = 3, + .aiPool_Cool = FALSE, + .aiPool_Beauty = TRUE, + .aiPool_Cute = FALSE, + .aiPool_Smart = TRUE, + .aiPool_Tough = FALSE, + .moves = + { + MOVE_PERISH_SONG, + MOVE_MEAN_LOOK, + MOVE_LOVELY_KISS, + MOVE_FAKE_TEARS + }, + .cool = 100, + .beauty = 150, + .cute = 100, + .smart = 150, + .tough = 120, + .sheen = 255, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_TOGEPI, + .nickname = _("GEPITO"), + .trainerName = _("CLARA"), + .trainerGfxId = 20, + .flags = 0x10200FFF, + .whichRank = 3, + .aiPool_Cool = FALSE, + .aiPool_Beauty = FALSE, + .aiPool_Cute = TRUE, + .aiPool_Smart = FALSE, + .aiPool_Tough = FALSE, + .moves = + { + MOVE_GROWL, + MOVE_YAWN, + MOVE_ENCORE, + MOVE_FOLLOW_ME + }, + .cool = 80, + .beauty = 120, + .cute = 200, + .smart = 120, + .tough = 80, + .sheen = 255, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_ESPEON, + .nickname = _("SPEON"), + .trainerName = _("JAKOB"), + .trainerGfxId = 37, + .flags = 0x20100FFF, + .whichRank = 3, + .aiPool_Cool = TRUE, + .aiPool_Beauty = TRUE, + .aiPool_Cute = FALSE, + .aiPool_Smart = FALSE, + .aiPool_Tough = FALSE, + .moves = + { + MOVE_SWIFT, + MOVE_QUICK_ATTACK, + MOVE_MORNING_SUN, + MOVE_TAIL_WHIP + }, + .cool = 180, + .beauty = 150, + .cute = 100, + .smart = 80, + .tough = 150, + .sheen = 255, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_SLOWKING, + .nickname = _("SLOWGO"), + .trainerName = _("TREY"), + .trainerGfxId = 49, + .flags = 0x8080FFF, + .whichRank = 3, + .aiPool_Cool = FALSE, + .aiPool_Beauty = FALSE, + .aiPool_Cute = TRUE, + .aiPool_Smart = FALSE, + .aiPool_Tough = TRUE, + .moves = + { + MOVE_FACADE, + MOVE_CURSE, + MOVE_YAWN, + MOVE_FOCUS_PUNCH + }, + .cool = 100, + .beauty = 80, + .cute = 200, + .smart = 110, + .tough = 170, + .sheen = 255, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + }, + { + .species = SPECIES_URSARING, + .nickname = _("URSING"), + .trainerName = _("LANE"), + .trainerGfxId = 44, + .flags = 0x40040FFF, + .whichRank = 3, + .aiPool_Cool = TRUE, + .aiPool_Beauty = FALSE, + .aiPool_Cute = FALSE, + .aiPool_Smart = FALSE, + .aiPool_Tough = TRUE, + .moves = + { + MOVE_THRASH, + MOVE_AERIAL_ACE, + MOVE_FAKE_TEARS, + MOVE_LEER + }, + .cool = 180, + .beauty = 140, + .cute = 30, + .smart = 80, + .tough = 190, + .sheen = 255, + .unk2C = {0}, + .personality = 0, + .otId = 0xFFFF + } +}; \ No newline at end of file -- cgit v1.2.3 From 0c935a8bd500535ba67fad4f25ea50199cfc1871 Mon Sep 17 00:00:00 2001 From: Phlosioneer Date: Sat, 9 Mar 2019 22:54:17 -0500 Subject: Move the contest opponent filter to C --- src/contest.c | 7 +- src/data/contest_opponents.h | 390 ++++++++++++++++++++++++++++++++----------- 2 files changed, 297 insertions(+), 100 deletions(-) (limited to 'src') diff --git a/src/contest.c b/src/contest.c index 3ef8d4b06..bebe344b9 100644 --- a/src/contest.c +++ b/src/contest.c @@ -242,7 +242,6 @@ extern const u8 gText_Contest_Fear[]; extern const u8 gText_BDot[]; extern const u8 gText_CDot[]; extern const u8 *const gUnknown_08587E10[]; -extern const u8 gUnknown_085898A4[96]; extern const union AffineAnimCmd *const gUnknown_082FF6C0[]; extern const union AffineAnimCmd *const gUnknown_082FF694[]; extern const struct SpriteTemplate gSpriteTemplate_8587AD0; @@ -2565,7 +2564,7 @@ void sub_80DAB8C(u8 contestType, u8 rank) r7 = TRUE; // Find all suitable opponents - r3 = gUnknown_085898A4; + r3 = gPostgameContestOpponentFilter; for (i = 0; i < ARRAY_COUNT(gContestOpponents); i++) { if (rank == gContestOpponents[i].whichRank) @@ -2625,12 +2624,12 @@ void sub_80DACBC(u8 contestType, u8 rank, bool32 isPostgame) if (isPostgame == TRUE) { - if (gUnknown_085898A4[i] == 1) + if (gPostgameContestOpponentFilter[i] == CONTEST_FILTER_NO_POSTGAME) continue; } else { - if (gUnknown_085898A4[i] == 2) + if (gPostgameContestOpponentFilter[i] == CONTEST_FILTER_ONLY_POSTGAME) continue; } if ((contestType == CONTEST_CATEGORY_COOL && gContestOpponents[i].aiPool_Cool) diff --git a/src/data/contest_opponents.h b/src/data/contest_opponents.h index 8937e9914..2ebfd1dfd 100644 --- a/src/data/contest_opponents.h +++ b/src/data/contest_opponents.h @@ -3,6 +3,103 @@ #include "contest.h" #include "constants/species.h" +#define CONTEST_OPPONENT_JIMMY 0 +#define CONTEST_OPPONENT_EDITH 1 +#define CONTEST_OPPONENT_EVAN 2 +#define CONTEST_OPPONENT_KELSEY 3 +#define CONTEST_OPPONENT_MADISON 4 +#define CONTEST_OPPONENT_RAYMOND 5 +#define CONTEST_OPPONENT_GRANT 6 +#define CONTEST_OPPONENT_PAIGE 7 +#define CONTEST_OPPONENT_ALEC 8 +#define CONTEST_OPPONENT_SYDNEY 9 +#define CONTEST_OPPONENT_MORRIS 10 +#define CONTEST_OPPONENT_MARIAH 11 +#define CONTEST_OPPONENT_RUSSELL 12 +#define CONTEST_OPPONENT_MELANIE 13 +#define CONTEST_OPPONENT_CHANCE 14 +#define CONTEST_OPPONENT_AGATHA 15 +#define CONTEST_OPPONENT_BEAU 16 +#define CONTEST_OPPONENT_KAY 17 +#define CONTEST_OPPONENT_CALE 18 +#define CONTEST_OPPONENT_CAITLIN 19 +#define CONTEST_OPPONENT_COLBY 20 +#define CONTEST_OPPONENT_KYLIE 21 +#define CONTEST_OPPONENT_LIAM 22 +#define CONTEST_OPPONENT_MILO 23 +#define CONTEST_OPPONENT_KARINA 24 +#define CONTEST_OPPONENT_BOBBY 25 +#define CONTEST_OPPONENT_CLAIRE 26 +#define CONTEST_OPPONENT_WILLIE 27 +#define CONTEST_OPPONENT_CASSIDY 28 +#define CONTEST_OPPONENT_MORGAN 29 +#define CONTEST_OPPONENT_SUMMER 30 +#define CONTEST_OPPONENT_MILES 31 +#define CONTEST_OPPONENT_AUDREY 32 +#define CONTEST_OPPONENT_AVERY 33 +#define CONTEST_OPPONENT_ARIANA 34 +#define CONTEST_OPPONENT_ASHTON 35 +#define CONTEST_OPPONENT_SANDRA 36 +#define CONTEST_OPPONENT_CARSON 37 +#define CONTEST_OPPONENT_KATRINA 38 +#define CONTEST_OPPONENT_LUKE 39 +#define CONTEST_OPPONENT_RAUL 40 +#define CONTEST_OPPONENT_JADA 41 +#define CONTEST_OPPONENT_ZEEK 42 +#define CONTEST_OPPONENT_DIEGO 43 +#define CONTEST_OPPONENT_ALIYAH 44 +#define CONTEST_OPPONENT_NATALIA 45 +#define CONTEST_OPPONENT_DEVIN 46 +#define CONTEST_OPPONENT_TYLOR 47 +#define CONTEST_OPPONENT_RONNIE 48 +#define CONTEST_OPPONENT_CLAUDIA 49 +#define CONTEST_OPPONENT_ELIAS 50 +#define CONTEST_OPPONENT_JADE 51 +#define CONTEST_OPPONENT_FRANCIS 52 +#define CONTEST_OPPONENT_ALISHA 53 +#define CONTEST_OPPONENT_SAUL 54 +#define CONTEST_OPPONENT_FELICIA 55 +#define CONTEST_OPPONENT_EMILIO 56 +#define CONTEST_OPPONENT_KARLA 57 +#define CONTEST_OPPONENT_DARRYL 58 +#define CONTEST_OPPONENT_SELENA 59 +#define CONTEST_OPPONENT_NOEL 60 +#define CONTEST_OPPONENT_LACEY 61 +#define CONTEST_OPPONENT_CORBIN 62 +#define CONTEST_OPPONENT_GRACIE 63 +#define CONTEST_OPPONENT_COLTIN 64 +#define CONTEST_OPPONENT_ELLIE 65 +#define CONTEST_OPPONENT_MARCUS 66 +#define CONTEST_OPPONENT_KIARA 67 +#define CONTEST_OPPONENT_BRYCE 68 +#define CONTEST_OPPONENT_JAMIE 69 +#define CONTEST_OPPONENT_JORGE 70 +#define CONTEST_OPPONENT_DEVON 71 +#define CONTEST_OPPONENT_JUSTINA 72 +#define CONTEST_OPPONENT_RALPH 73 +#define CONTEST_OPPONENT_ROSA 74 +#define CONTEST_OPPONENT_KEATON 75 +#define CONTEST_OPPONENT_MAYRA 76 +#define CONTEST_OPPONENT_LAMAR 77 +#define CONTEST_OPPONENT_AUBREY 78 +#define CONTEST_OPPONENT_NIGEL 79 +#define CONTEST_OPPONENT_CAMILLE 80 +#define CONTEST_OPPONENT_DEON 81 +#define CONTEST_OPPONENT_JANELLE 82 +#define CONTEST_OPPONENT_HEATH 83 +#define CONTEST_OPPONENT_SASHA 84 +#define CONTEST_OPPONENT_FRANKIE 85 +#define CONTEST_OPPONENT_HELEN 86 +#define CONTEST_OPPONENT_CAMILE 87 +#define CONTEST_OPPONENT_MARTIN 88 +#define CONTEST_OPPONENT_SERGIO 89 +#define CONTEST_OPPONENT_KAILEY 90 +#define CONTEST_OPPONENT_PERLA 91 +#define CONTEST_OPPONENT_CLARA 92 +#define CONTEST_OPPONENT_JAKOB 93 +#define CONTEST_OPPONENT_TREY 94 +#define CONTEST_OPPONENT_LANE 95 + const struct ContestWinner gUnknown_08587FA4[] = { { @@ -81,7 +178,7 @@ const struct ContestWinner gUnknown_08587FA4[] = const struct ContestPokemon gContestOpponents[] = { - { + [CONTEST_OPPONENT_JIMMY] = { .species = SPECIES_POOCHYENA, .nickname = _("POOCHY"), .trainerName = _("JIMMY"), @@ -110,7 +207,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_EDITH] = { .species = SPECIES_ILLUMISE, .nickname = _("MUSILLE"), .trainerName = _("EDITH"), @@ -139,7 +236,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_EVAN] = { .species = SPECIES_DUSTOX, .nickname = _("DUSTER"), .trainerName = _("EVAN"), @@ -168,7 +265,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_KELSEY] = { .species = SPECIES_SEEDOT, .nickname = _("DOTS"), .trainerName = _("KELSEY"), @@ -197,7 +294,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_MADISON] = { .species = SPECIES_TAILLOW, .nickname = _("TATAY"), .trainerName = _("MADISON"), @@ -226,7 +323,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_RAYMOND] = { .species = SPECIES_NINCADA, .nickname = _("NINDA"), .trainerName = _("RAYMOND"), @@ -255,7 +352,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_GRANT] = { .species = SPECIES_SHROOMISH, .nickname = _("SMISH"), .trainerName = _("GRANT"), @@ -284,7 +381,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_PAIGE] = { .species = SPECIES_SPHEAL, .nickname = _("SLEAL"), .trainerName = _("PAIGE"), @@ -313,7 +410,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_ALEC] = { .species = SPECIES_SLAKOTH, .nickname = _("SLOKTH"), .trainerName = _("ALEC"), @@ -342,7 +439,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_SYDNEY] = { .species = SPECIES_WHISMUR, .nickname = _("WHIRIS"), .trainerName = _("SYDNEY"), @@ -371,7 +468,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_MORRIS] = { .species = SPECIES_MAKUHITA, .nickname = _("MAHITA"), .trainerName = _("MORRIS"), @@ -400,7 +497,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_MARIAH] = { .species = SPECIES_ARON, .nickname = _("RONAR"), .trainerName = _("MARIAH"), @@ -429,7 +526,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_RUSSELL] = { .species = SPECIES_CROBAT, .nickname = _("BATRO"), .trainerName = _("RUSSELL"), @@ -458,7 +555,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_MELANIE] = { .species = SPECIES_GULPIN, .nickname = _("GULIN"), .trainerName = _("MELANIE"), @@ -487,7 +584,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_CHANCE] = { .species = SPECIES_MANECTRIC, .nickname = _("RIKELEC"), .trainerName = _("CHANCE"), @@ -516,7 +613,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_AGATHA] = { .species = SPECIES_BULBASAUR, .nickname = _("BULBY"), .trainerName = _("AGATHA"), @@ -545,7 +642,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_BEAU] = { .species = SPECIES_BUTTERFREE, .nickname = _("FUTTERBE"), .trainerName = _("BEAU"), @@ -574,7 +671,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_KAY] = { .species = SPECIES_PIDGEOTTO, .nickname = _("PIDEOT"), .trainerName = _("KAY"), @@ -603,7 +700,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_CALE] = { .species = SPECIES_DIGLETT, .nickname = _("DIGLE"), .trainerName = _("CALE"), @@ -632,7 +729,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_CAITLIN] = { .species = SPECIES_POLIWAG, .nickname = _("WAGIL"), .trainerName = _("CAITLIN"), @@ -661,7 +758,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_COLBY] = { .species = SPECIES_TOTODILE, .nickname = _("TOTDIL"), .trainerName = _("COLBY"), @@ -690,7 +787,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_KYLIE] = { .species = SPECIES_LEDYBA, .nickname = _("BALEDY"), .trainerName = _("KYLIE"), @@ -719,7 +816,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_LIAM] = { .species = SPECIES_DELIBIRD, .nickname = _("BIRDLY"), .trainerName = _("LIAM"), @@ -748,7 +845,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_MILO] = { .species = SPECIES_LARVITAR, .nickname = _("TARVITAR"), .trainerName = _("MILO"), @@ -777,7 +874,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_KARINA] = { .species = SPECIES_ROSELIA, .nickname = _("RELIA"), .trainerName = _("KARINA"), @@ -806,7 +903,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_BOBBY] = { .species = SPECIES_DODRIO, .nickname = _("DUODO"), .trainerName = _("BOBBY"), @@ -835,7 +932,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_CLAIRE] = { .species = SPECIES_TRAPINCH, .nickname = _("PINCHIN"), .trainerName = _("CLAIRE"), @@ -864,7 +961,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_WILLIE] = { .species = SPECIES_CACNEA, .nickname = _("NACAC"), .trainerName = _("WILLIE"), @@ -893,7 +990,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_CASSIDY] = { .species = SPECIES_SANDSLASH, .nickname = _("SHRAND"), .trainerName = _("CASSIDY"), @@ -922,7 +1019,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_MORGAN] = { .species = SPECIES_BALTOY, .nickname = _("TOYBAL"), .trainerName = _("MORGAN"), @@ -951,7 +1048,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_SUMMER] = { .species = SPECIES_MEDICHAM, .nickname = _("CHAMCHAM"), .trainerName = _("SUMMER"), @@ -980,7 +1077,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_MILES] = { .species = SPECIES_SPINDA, .nickname = _("SPININ"), .trainerName = _("MILES"), @@ -1009,7 +1106,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_AUDREY] = { .species = SPECIES_SWABLU, .nickname = _("SWABY"), .trainerName = _("AUDREY"), @@ -1038,7 +1135,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_AVERY] = { .species = SPECIES_SPOINK, .nickname = _("POINKER"), .trainerName = _("AVERY"), @@ -1067,7 +1164,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_ARIANA] = { .species = SPECIES_KECLEON, .nickname = _("KECON"), .trainerName = _("ARIANA"), @@ -1096,7 +1193,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_ASHTON] = { .species = SPECIES_GOLDEEN, .nickname = _("GOLDEN"), .trainerName = _("ASHTON"), @@ -1125,7 +1222,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_SANDRA] = { .species = SPECIES_BARBOACH, .nickname = _("BOBOACH"), .trainerName = _("SANDRA"), @@ -1154,7 +1251,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_CARSON] = { .species = SPECIES_SKARMORY, .nickname = _("CORPY"), .trainerName = _("CARSON"), @@ -1183,7 +1280,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_KATRINA] = { .species = SPECIES_LOTAD, .nickname = _("TADO"), .trainerName = _("KATRINA"), @@ -1212,7 +1309,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_LUKE] = { .species = SPECIES_SLOWBRO, .nickname = _("BROWLO"), .trainerName = _("LUKE"), @@ -1241,7 +1338,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_RAUL] = { .species = SPECIES_FARFETCHD, .nickname = _("FETCHIN"), .trainerName = _("RAUL"), @@ -1270,7 +1367,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_JADA] = { .species = SPECIES_SEEL, .nickname = _("SEELEY"), .trainerName = _("JADA"), @@ -1299,7 +1396,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_ZEEK] = { .species = SPECIES_DROWZEE, .nickname = _("DROWZIN"), .trainerName = _("ZEEK"), @@ -1328,7 +1425,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_DIEGO] = { .species = SPECIES_HITMONCHAN, .nickname = _("HITEMON"), .trainerName = _("DIEGO"), @@ -1357,7 +1454,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_ALIYAH] = { .species = SPECIES_BLISSEY, .nickname = _("BLISS"), .trainerName = _("ALIYAH"), @@ -1386,7 +1483,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_NATALIA] = { .species = SPECIES_ELEKID, .nickname = _("KIDLEK"), .trainerName = _("NATALIA"), @@ -1415,7 +1512,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_DEVIN] = { .species = SPECIES_SNUBBULL, .nickname = _("SNUBBINS"), .trainerName = _("DEVIN"), @@ -1444,7 +1541,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_TYLOR] = { .species = SPECIES_MISDREAVUS, .nickname = _("DREAVIS"), .trainerName = _("TYLOR"), @@ -1473,7 +1570,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_RONNIE] = { .species = SPECIES_LAIRON, .nickname = _("LAIRN"), .trainerName = _("RONNIE"), @@ -1502,7 +1599,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_CLAUDIA] = { .species = SPECIES_SHIFTRY, .nickname = _("SHIFTY"), .trainerName = _("CLAUDIA"), @@ -1531,7 +1628,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_ELIAS] = { .species = SPECIES_NINJASK, .nickname = _("NINAS"), .trainerName = _("ELIAS"), @@ -1560,7 +1657,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_JADE] = { .species = SPECIES_SWELLOW, .nickname = _("WELOW"), .trainerName = _("JADE"), @@ -1589,7 +1686,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_FRANCIS] = { .species = SPECIES_MIGHTYENA, .nickname = _("YENA"), .trainerName = _("FRANCIS"), @@ -1618,7 +1715,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_ALISHA] = { .species = SPECIES_BEAUTIFLY, .nickname = _("TIFLY"), .trainerName = _("ALISHA"), @@ -1647,7 +1744,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_SAUL] = { .species = SPECIES_SEAKING, .nickname = _("KINGSEA"), .trainerName = _("SAUL"), @@ -1676,7 +1773,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_FELICIA] = { .species = SPECIES_CASTFORM, .nickname = _("CASTER"), .trainerName = _("FELICIA"), @@ -1705,7 +1802,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_EMILIO] = { .species = SPECIES_MACHOKE, .nickname = _("CHOKEM"), .trainerName = _("EMILIO"), @@ -1734,7 +1831,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_KARLA] = { .species = SPECIES_LOMBRE, .nickname = _("LOMBE"), .trainerName = _("KARLA"), @@ -1763,7 +1860,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_DARRYL] = { .species = SPECIES_SEVIPER, .nickname = _("VIPES"), .trainerName = _("DARRYL"), @@ -1792,7 +1889,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_SELENA] = { .species = SPECIES_WAILMER, .nickname = _("MERAIL"), .trainerName = _("SELENA"), @@ -1821,7 +1918,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_NOEL] = { .species = SPECIES_MAGIKARP, .nickname = _("KARPAG"), .trainerName = _("NOEL"), @@ -1850,7 +1947,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_LACEY] = { .species = SPECIES_LUNATONE, .nickname = _("LUNONE"), .trainerName = _("LACEY"), @@ -1879,7 +1976,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_CORBIN] = { .species = SPECIES_ABSOL, .nickname = _("ABSO"), .trainerName = _("CORBIN"), @@ -1908,7 +2005,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_GRACIE] = { .species = SPECIES_EXEGGUTOR, .nickname = _("EGGSOR"), .trainerName = _("GRACIE"), @@ -1937,7 +2034,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_COLTIN] = { .species = SPECIES_CUBONE, .nickname = _("CUBIN"), .trainerName = _("COLTIN"), @@ -1966,7 +2063,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_ELLIE] = { .species = SPECIES_HITMONLEE, .nickname = _("HITMON"), .trainerName = _("ELLIE"), @@ -1995,7 +2092,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_MARCUS] = { .species = SPECIES_SQUIRTLE, .nickname = _("SURTLE"), .trainerName = _("MARCUS"), @@ -2024,7 +2121,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_KIARA] = { .species = SPECIES_KANGASKHAN, .nickname = _("KHANKAN"), .trainerName = _("KIARA"), @@ -2053,7 +2150,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_BRYCE] = { .species = SPECIES_PINECO, .nickname = _("PINOC"), .trainerName = _("BRYCE"), @@ -2082,7 +2179,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_JAMIE] = { .species = SPECIES_DUNSPARCE, .nickname = _("DILTOT"), .trainerName = _("JAMIE"), @@ -2111,7 +2208,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_JORGE] = { .species = SPECIES_HOUNDOOM, .nickname = _("DOOMOND"), .trainerName = _("JORGE"), @@ -2140,7 +2237,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_DEVON] = { .species = SPECIES_MILTANK, .nickname = _("MILKAN"), .trainerName = _("DEVON"), @@ -2169,7 +2266,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_JUSTINA] = { .species = SPECIES_GYARADOS, .nickname = _("RADOS"), .trainerName = _("JUSTINA"), @@ -2198,7 +2295,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_RALPH] = { .species = SPECIES_LOUDRED, .nickname = _("LOUDERD"), .trainerName = _("RALPH"), @@ -2227,7 +2324,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_ROSA] = { .species = SPECIES_SKITTY, .nickname = _("SITTY"), .trainerName = _("ROSA"), @@ -2256,7 +2353,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_KEATON] = { .species = SPECIES_SLAKING, .nickname = _("SLING"), .trainerName = _("KEATON"), @@ -2285,7 +2382,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_MAYRA] = { .species = SPECIES_ALTARIA, .nickname = _("TARIA"), .trainerName = _("MAYRA"), @@ -2314,7 +2411,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_LAMAR] = { .species = SPECIES_KIRLIA, .nickname = _("LIRKI"), .trainerName = _("LAMAR"), @@ -2343,7 +2440,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_AUBREY] = { .species = SPECIES_BELLOSSOM, .nickname = _("BLOSSOM"), .trainerName = _("AUBREY"), @@ -2372,7 +2469,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_NIGEL] = { .species = SPECIES_SABLEYE, .nickname = _("EYESAB"), .trainerName = _("NIGEL"), @@ -2401,7 +2498,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_CAMILLE] = { .species = SPECIES_NATU, .nickname = _("UTAN"), .trainerName = _("CAMILLE"), @@ -2430,7 +2527,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_DEON] = { .species = SPECIES_SHARPEDO, .nickname = _("PEDOS"), .trainerName = _("DEON"), @@ -2459,7 +2556,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_JANELLE] = { .species = SPECIES_LUVDISC, .nickname = _("LUVIS"), .trainerName = _("JANELLE"), @@ -2488,7 +2585,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_HEATH] = { .species = SPECIES_HERACROSS, .nickname = _("HEROSS"), .trainerName = _("HEATH"), @@ -2517,7 +2614,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_SASHA] = { .species = SPECIES_ELECTRODE, .nickname = _("RODLECT"), .trainerName = _("SASHA"), @@ -2546,7 +2643,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_FRANKIE] = { .species = SPECIES_PICHU, .nickname = _("CHUPY"), .trainerName = _("FRANKIE"), @@ -2575,7 +2672,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_HELEN] = { .species = SPECIES_WOBBUFFET, .nickname = _("WOBET"), .trainerName = _("HELEN"), @@ -2604,7 +2701,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_CAMILE] = { .species = SPECIES_GENGAR, .nickname = _("GAREN"), .trainerName = _("CAMILE"), @@ -2633,7 +2730,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_MARTIN] = { .species = SPECIES_PORYGON, .nickname = _("GONPOR"), .trainerName = _("MARTIN"), @@ -2662,7 +2759,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_SERGIO] = { .species = SPECIES_DRAGONITE, .nickname = _("DRITE"), .trainerName = _("SERGIO"), @@ -2691,7 +2788,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_KAILEY] = { .species = SPECIES_MEOWTH, .nickname = _("MEOWY"), .trainerName = _("KAILEY"), @@ -2720,7 +2817,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_PERLA] = { .species = SPECIES_JYNX, .nickname = _("NYX"), .trainerName = _("PERLA"), @@ -2749,7 +2846,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_CLARA] = { .species = SPECIES_TOGEPI, .nickname = _("GEPITO"), .trainerName = _("CLARA"), @@ -2778,7 +2875,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_JAKOB] = { .species = SPECIES_ESPEON, .nickname = _("SPEON"), .trainerName = _("JAKOB"), @@ -2807,7 +2904,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_TREY] = { .species = SPECIES_SLOWKING, .nickname = _("SLOWGO"), .trainerName = _("TREY"), @@ -2836,7 +2933,7 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF }, - { + [CONTEST_OPPONENT_LANE] = { .species = SPECIES_URSARING, .nickname = _("URSING"), .trainerName = _("LANE"), @@ -2865,4 +2962,105 @@ const struct ContestPokemon gContestOpponents[] = .personality = 0, .otId = 0xFFFF } +}; + + +const u8 gPostgameContestOpponentFilter[] = +{ + [CONTEST_OPPONENT_JIMMY] = CONTEST_FILTER_NONE, + [CONTEST_OPPONENT_EDITH] = CONTEST_FILTER_NONE, + [CONTEST_OPPONENT_EVAN] = CONTEST_FILTER_NONE, + [CONTEST_OPPONENT_KELSEY] = CONTEST_FILTER_NONE, + [CONTEST_OPPONENT_MADISON] = CONTEST_FILTER_NONE, + [CONTEST_OPPONENT_RAYMOND] = CONTEST_FILTER_NONE, + [CONTEST_OPPONENT_GRANT] = CONTEST_FILTER_NONE, + [CONTEST_OPPONENT_PAIGE] = CONTEST_FILTER_NONE, + [CONTEST_OPPONENT_ALEC] = CONTEST_FILTER_NONE, + [CONTEST_OPPONENT_SYDNEY] = CONTEST_FILTER_NONE, + [CONTEST_OPPONENT_MORRIS] = CONTEST_FILTER_NONE, + [CONTEST_OPPONENT_MARIAH] = CONTEST_FILTER_NONE, + [CONTEST_OPPONENT_RUSSELL] = CONTEST_FILTER_NONE, + [CONTEST_OPPONENT_MELANIE] = CONTEST_FILTER_NONE, + [CONTEST_OPPONENT_CHANCE] = CONTEST_FILTER_NONE, + [CONTEST_OPPONENT_AGATHA] = CONTEST_FILTER_ONLY_POSTGAME, + [CONTEST_OPPONENT_BEAU] = CONTEST_FILTER_ONLY_POSTGAME, + [CONTEST_OPPONENT_KAY] = CONTEST_FILTER_ONLY_POSTGAME, + [CONTEST_OPPONENT_CALE] = CONTEST_FILTER_ONLY_POSTGAME, + [CONTEST_OPPONENT_CAITLIN] = CONTEST_FILTER_ONLY_POSTGAME, + [CONTEST_OPPONENT_COLBY] = CONTEST_FILTER_ONLY_POSTGAME, + [CONTEST_OPPONENT_KYLIE] = CONTEST_FILTER_ONLY_POSTGAME, + [CONTEST_OPPONENT_LIAM] = CONTEST_FILTER_ONLY_POSTGAME, + [CONTEST_OPPONENT_MILO] = CONTEST_FILTER_ONLY_POSTGAME, + [CONTEST_OPPONENT_KARINA] = CONTEST_FILTER_NONE, + [CONTEST_OPPONENT_BOBBY] = CONTEST_FILTER_NONE, + [CONTEST_OPPONENT_CLAIRE] = CONTEST_FILTER_NONE, + [CONTEST_OPPONENT_WILLIE] = CONTEST_FILTER_NONE, + [CONTEST_OPPONENT_CASSIDY] = CONTEST_FILTER_NONE, + [CONTEST_OPPONENT_MORGAN] = CONTEST_FILTER_NONE, + [CONTEST_OPPONENT_SUMMER] = CONTEST_FILTER_NONE, + [CONTEST_OPPONENT_MILES] = CONTEST_FILTER_NONE, + [CONTEST_OPPONENT_AUDREY] = CONTEST_FILTER_NONE, + [CONTEST_OPPONENT_AVERY] = CONTEST_FILTER_NONE, + [CONTEST_OPPONENT_ARIANA] = CONTEST_FILTER_NONE, + [CONTEST_OPPONENT_ASHTON] = CONTEST_FILTER_NONE, + [CONTEST_OPPONENT_SANDRA] = CONTEST_FILTER_NONE, + [CONTEST_OPPONENT_CARSON] = CONTEST_FILTER_NONE, + [CONTEST_OPPONENT_KATRINA] = CONTEST_FILTER_NONE, + [CONTEST_OPPONENT_LUKE] = CONTEST_FILTER_ONLY_POSTGAME, + [CONTEST_OPPONENT_RAUL] = CONTEST_FILTER_ONLY_POSTGAME, + [CONTEST_OPPONENT_JADA] = CONTEST_FILTER_ONLY_POSTGAME, + [CONTEST_OPPONENT_ZEEK] = CONTEST_FILTER_ONLY_POSTGAME, + [CONTEST_OPPONENT_DIEGO] = CONTEST_FILTER_ONLY_POSTGAME, + [CONTEST_OPPONENT_ALIYAH] = CONTEST_FILTER_ONLY_POSTGAME, + [CONTEST_OPPONENT_NATALIA] = CONTEST_FILTER_ONLY_POSTGAME, + [CONTEST_OPPONENT_DEVIN] = CONTEST_FILTER_ONLY_POSTGAME, + [CONTEST_OPPONENT_TYLOR] = CONTEST_FILTER_ONLY_POSTGAME, + [CONTEST_OPPONENT_RONNIE] = CONTEST_FILTER_NONE, + [CONTEST_OPPONENT_CLAUDIA] = CONTEST_FILTER_NONE, + [CONTEST_OPPONENT_ELIAS] = CONTEST_FILTER_NONE, + [CONTEST_OPPONENT_JADE] = CONTEST_FILTER_NONE, + [CONTEST_OPPONENT_FRANCIS] = CONTEST_FILTER_NONE, + [CONTEST_OPPONENT_ALISHA] = CONTEST_FILTER_NONE, + [CONTEST_OPPONENT_SAUL] = CONTEST_FILTER_NONE, + [CONTEST_OPPONENT_FELICIA] = CONTEST_FILTER_NONE, + [CONTEST_OPPONENT_EMILIO] = CONTEST_FILTER_NONE, + [CONTEST_OPPONENT_KARLA] = CONTEST_FILTER_NONE, + [CONTEST_OPPONENT_DARRYL] = CONTEST_FILTER_NONE, + [CONTEST_OPPONENT_SELENA] = CONTEST_FILTER_NONE, + [CONTEST_OPPONENT_NOEL] = CONTEST_FILTER_NONE, + [CONTEST_OPPONENT_LACEY] = CONTEST_FILTER_NONE, + [CONTEST_OPPONENT_CORBIN] = CONTEST_FILTER_NONE, + [CONTEST_OPPONENT_GRACIE] = CONTEST_FILTER_ONLY_POSTGAME, + [CONTEST_OPPONENT_COLTIN] = CONTEST_FILTER_ONLY_POSTGAME, + [CONTEST_OPPONENT_ELLIE] = CONTEST_FILTER_ONLY_POSTGAME, + [CONTEST_OPPONENT_MARCUS] = CONTEST_FILTER_ONLY_POSTGAME, + [CONTEST_OPPONENT_KIARA] = CONTEST_FILTER_ONLY_POSTGAME, + [CONTEST_OPPONENT_BRYCE] = CONTEST_FILTER_ONLY_POSTGAME, + [CONTEST_OPPONENT_JAMIE] = CONTEST_FILTER_ONLY_POSTGAME, + [CONTEST_OPPONENT_JORGE] = CONTEST_FILTER_ONLY_POSTGAME, + [CONTEST_OPPONENT_DEVON] = CONTEST_FILTER_ONLY_POSTGAME, + [CONTEST_OPPONENT_JUSTINA] = CONTEST_FILTER_NONE, + [CONTEST_OPPONENT_RALPH] = CONTEST_FILTER_NONE, + [CONTEST_OPPONENT_ROSA] = CONTEST_FILTER_NONE, + [CONTEST_OPPONENT_KEATON] = CONTEST_FILTER_NONE, + [CONTEST_OPPONENT_MAYRA] = CONTEST_FILTER_NONE, + [CONTEST_OPPONENT_LAMAR] = CONTEST_FILTER_NONE, + [CONTEST_OPPONENT_AUBREY] = CONTEST_FILTER_NONE, + [CONTEST_OPPONENT_NIGEL] = CONTEST_FILTER_NONE, + [CONTEST_OPPONENT_CAMILLE] = CONTEST_FILTER_NONE, + [CONTEST_OPPONENT_DEON] = CONTEST_FILTER_NONE, + [CONTEST_OPPONENT_JANELLE] = CONTEST_FILTER_NONE, + [CONTEST_OPPONENT_HEATH] = CONTEST_FILTER_NONE, + [CONTEST_OPPONENT_SASHA] = CONTEST_FILTER_NONE, + [CONTEST_OPPONENT_FRANKIE] = CONTEST_FILTER_NONE, + [CONTEST_OPPONENT_HELEN] = CONTEST_FILTER_NONE, + [CONTEST_OPPONENT_CAMILE] = CONTEST_FILTER_ONLY_POSTGAME, + [CONTEST_OPPONENT_MARTIN] = CONTEST_FILTER_ONLY_POSTGAME, + [CONTEST_OPPONENT_SERGIO] = CONTEST_FILTER_ONLY_POSTGAME, + [CONTEST_OPPONENT_KAILEY] = CONTEST_FILTER_ONLY_POSTGAME, + [CONTEST_OPPONENT_PERLA] = CONTEST_FILTER_ONLY_POSTGAME, + [CONTEST_OPPONENT_CLARA] = CONTEST_FILTER_ONLY_POSTGAME, + [CONTEST_OPPONENT_JAKOB] = CONTEST_FILTER_ONLY_POSTGAME, + [CONTEST_OPPONENT_TREY] = CONTEST_FILTER_ONLY_POSTGAME, + [CONTEST_OPPONENT_LANE] = CONTEST_FILTER_ONLY_POSTGAME }; \ No newline at end of file -- cgit v1.2.3 From 13c2f91b11a9ae773fd22b045f37b85c6e1ed984 Mon Sep 17 00:00:00 2001 From: Phlosioneer Date: Sat, 9 Mar 2019 23:51:39 -0500 Subject: Moved last contest data into C --- src/contest.c | 140 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 134 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/contest.c b/src/contest.c index bebe344b9..da3075e65 100644 --- a/src/contest.c +++ b/src/contest.c @@ -247,10 +247,6 @@ extern const union AffineAnimCmd *const gUnknown_082FF694[]; extern const struct SpriteTemplate gSpriteTemplate_8587AD0; extern const struct SpriteTemplate gSpriteTemplate_8587B18[]; extern void (*const gContestEffectFuncs[])(void); -extern const s8 gContestExcitementTable[][5]; -extern const struct CompressedSpriteSheet gUnknown_08589904[]; -extern const struct SpritePalette gUnknown_08589924[]; -extern const struct SpriteTemplate gSpriteTemplate_858998C[]; static const u8 gUnknown_08587A6C[] = { @@ -722,6 +718,138 @@ const struct WindowTemplate gUnknown_08587F44[] = #include "data/contest_opponents.h" +static const struct CompressedSpriteSheet sUnknown_08589904[] = +{ + { + .data = gBlankGfxCompressed, + .size = 0x1000, + .tag = 0x80E8 + }, + { + .data = gBlankGfxCompressed, + .size = 0x1000, + .tag = 0x80E9 + }, + { + .data = gBlankGfxCompressed, + .size = 0x1000, + .tag = 0x80EA + }, + { + .data = gBlankGfxCompressed, + .size = 0x1000, + .tag = 0x80EB + } +}; + +// Yup this is super dangerous but that's how it is here +static const struct SpritePalette sUnknown_08589924[] = +{ + { + .data = (u16*)(gHeap + 0x1A0A4), + .tag = 0x80E8 + }, + { + .data = (u16*)(gHeap + 0x1A0C4), + .tag = 0x80E9 + }, + { + .data = (u16*)(gHeap + 0x1A0E4), + .tag = 0x80EA + }, + { + .data = (u16*)(gHeap + 0x1A104), + .tag = 0x80EB + } +}; + +const struct OamData gOamData_8589944 = +{ + .y = 0, + .affineMode = 3, + .objMode = 1, + .mosaic = 0, + .bpp = 0, + .shape = 0, + .x = 0, + .matrixNum = 0, + .size = 3, + .tileNum = 0, + .priority = 0, + .paletteNum = 0, + .affineParam = 0 +}; + +const union AffineAnimCmd gSpriteAffineAnim_858994C[] = +{ + AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0), + AFFINEANIMCMD_END +}; + +const union AffineAnimCmd gSpriteAffineAnim_858995C[] = +{ + AFFINEANIMCMD_FRAME(3, 3, 0, 15), + AFFINEANIMCMD_FRAME(-3, -3, 0, 15), + AFFINEANIMCMD_FRAME(3, 3, 0, 15), + AFFINEANIMCMD_FRAME(-3, -3, 0, 15), + AFFINEANIMCMD_END +}; + +const union AffineAnimCmd *const gSpriteAffineAnimTable_8589984[] = +{ + gSpriteAffineAnim_858994C, + gSpriteAffineAnim_858995C +}; + +const struct SpriteTemplate gSpriteTemplate_858998C[] = +{ + { + .tileTag = 0x80E8, + .paletteTag = 0x80E8, + .oam = &gOamData_8589944, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gSpriteAffineAnimTable_8589984, + .callback = SpriteCallbackDummy + }, + { + .tileTag = 0x80E9, + .paletteTag = 0x80E9, + .oam = &gOamData_8589944, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gSpriteAffineAnimTable_8589984, + .callback = SpriteCallbackDummy + }, + { + .tileTag = 0x80EA, + .paletteTag = 0x80EA, + .oam = &gOamData_8589944, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gSpriteAffineAnimTable_8589984, + .callback = SpriteCallbackDummy + }, + { + .tileTag = 0x80EB, + .paletteTag = 0x80EB, + .oam = &gOamData_8589944, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gSpriteAffineAnimTable_8589984, + .callback = SpriteCallbackDummy + } +}; + +const s8 gContestExcitementTable[][5] = +{ + { 1, 0, -1, -1, 0}, + { 0, 1, 0, -1, -1}, + {-1, 0, 1, 0, -1}, + {-1, -1, 0, 1, 0}, + { 0, -1, -1, 0, 1} +}; + static void TaskDummy1(u8 taskId) { } @@ -3763,8 +3891,8 @@ static u8 sub_80DC9EC(u8 a) u8 spriteId1, spriteId2; u8 x = gUnknown_02039F26[a] * 40 + 32; - LoadCompressedSpriteSheet(&gUnknown_08589904[a]); - LoadSpritePalette(&gUnknown_08589924[a]); + LoadCompressedSpriteSheet(&sUnknown_08589904[a]); + LoadSpritePalette(&sUnknown_08589924[a]); spriteId1 = CreateSprite(&gSpriteTemplate_858998C[a], 184, x, 29); spriteId2 = CreateSprite(&gSpriteTemplate_858998C[a], 248, x, 29); gSprites[spriteId2].oam.tileNum += 64; -- cgit v1.2.3 From 7f70b629f569ce9a4c1b90cca3a3ce86ebd3e1c2 Mon Sep 17 00:00:00 2001 From: Phlosioneer Date: Tue, 12 Mar 2019 05:35:15 -0400 Subject: Document sAreaGlowTilemapMapping I used a script to generate the format for the array, so I can easily change its formatting if needed. --- src/pokedex_area_screen.c | 223 ++++++++++++++++++++++++++++++++++------------ 1 file changed, 167 insertions(+), 56 deletions(-) (limited to 'src') diff --git a/src/pokedex_area_screen.c b/src/pokedex_area_screen.c index eeea3c210..d43c556c8 100755 --- a/src/pokedex_area_screen.c +++ b/src/pokedex_area_screen.c @@ -23,6 +23,19 @@ #include "constants/species.h" #include "constants/vars.h" +#define AREA_SCREEN_WIDTH 32 +#define AREA_SCREEN_HEIGHT 20 + +#define GLOW_TILE_FULL 0xFFFF +#define GLOW_TILE_LEFT (1 << 0) +#define GLOW_TILE_RIGHT (1 << 1) +#define GLOW_TILE_TOP (1 << 2) +#define GLOW_TILE_BOTTOM (1 << 3) +#define GLOW_TILE_BOTTOM_RIGHT (1 << 4) +#define GLOW_TILE_TOP_RIGHT (1 << 5) +#define GLOW_TILE_BOTTOM_LEFT (1 << 6) +#define GLOW_TILE_TOP_LEFT (1 << 7) + struct PokeDexAreaScreenMapIdentity { u8 mapGroup; @@ -100,23 +113,114 @@ static const u16 sLandmarkData[][2] = { {MAPSEC_NONE} }; +// Only some parts of this array are acutally used, because corner flags that overlap +// with edge flags are cancelled out before lookup. For example, GLOW_TILE_BOTTOM_RIGHT | GLOW_TILE_RIGHT +// will never be read. +// +// The rest of the bytes seem to be old data from before the cancellation was implemented. +// Most of them line up as you would expect ([BOTTOM_RIGHT | RIGHT] has the same value as [RIGHT]). +// +// Any unreachable entries are simply listed in order, without the fancy "[FLAGS] = 0xXX" notation. static const u8 sAreaGlowTilemapMapping[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x11, 0x20, 0x02, 0x03, 0x27, 0x2d, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x12, 0x21, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x2a, 0x2e, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x13, 0x22, 0x02, 0x03, 0x27, 0x2d, 0x06, 0x07, 0x2a, 0x2e, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x14, 0x01, 0x23, 0x03, 0x26, 0x05, 0x2c, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x15, 0x20, 0x23, 0x03, 0x28, 0x2d, 0x2c, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x16, 0x21, 0x23, 0x03, 0x26, 0x05, 0x2c, 0x07, 0x2a, 0x2e, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x17, 0x22, 0x23, 0x03, 0x28, 0x2d, 0x2c, 0x07, 0x2a, 0x2e, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x18, 0x01, 0x24, 0x03, 0x04, 0x05, 0x06, 0x07, 0x29, 0x09, 0x2f, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x19, 0x20, 0x24, 0x03, 0x27, 0x2d, 0x06, 0x07, 0x29, 0x09, 0x2f, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x1a, 0x21, 0x24, 0x03, 0x04, 0x05, 0x06, 0x07, 0x2b, 0x2e, 0x2f, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x1b, 0x22, 0x24, 0x03, 0x27, 0x2d, 0x06, 0x07, 0x2b, 0x2e, 0x2f, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x1c, 0x01, 0x25, 0x03, 0x26, 0x05, 0x2c, 0x07, 0x29, 0x09, 0x2f, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x1d, 0x20, 0x25, 0x03, 0x28, 0x2d, 0x2c, 0x07, 0x29, 0x09, 0x2f, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x1e, 0x21, 0x25, 0x03, 0x26, 0x05, 0x2c, 0x07, 0x2b, 0x2e, 0x2f, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x1f, 0x22, 0x25, 0x03, 0x28, 0x2d, 0x2c, 0x07, 0x2b, 0x2e, 0x2f, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, + [0] = 0x00, + [GLOW_TILE_LEFT] = 0x01, + [GLOW_TILE_RIGHT] = 0x02, + [GLOW_TILE_RIGHT | GLOW_TILE_LEFT] = 0x03, + [GLOW_TILE_TOP] = 0x04, + [GLOW_TILE_TOP | GLOW_TILE_LEFT] = 0x05, + [GLOW_TILE_TOP | GLOW_TILE_RIGHT] = 0x06, + [GLOW_TILE_TOP | GLOW_TILE_RIGHT | GLOW_TILE_LEFT] = 0x07, + [GLOW_TILE_BOTTOM] = 0x08, + [GLOW_TILE_BOTTOM | GLOW_TILE_LEFT] = 0x09, + [GLOW_TILE_BOTTOM | GLOW_TILE_RIGHT] = 0x0a, + [GLOW_TILE_BOTTOM | GLOW_TILE_RIGHT | GLOW_TILE_LEFT] = 0x0b, + [GLOW_TILE_BOTTOM | GLOW_TILE_TOP] = 0x0c, + [GLOW_TILE_BOTTOM | GLOW_TILE_TOP | GLOW_TILE_LEFT] = 0x0d, + [GLOW_TILE_BOTTOM | GLOW_TILE_TOP | GLOW_TILE_RIGHT] = 0x0e, + [GLOW_TILE_BOTTOM | GLOW_TILE_TOP | GLOW_TILE_RIGHT | GLOW_TILE_LEFT] = 0x0f, + [GLOW_TILE_BOTTOM_RIGHT] = 0x11, + [GLOW_TILE_BOTTOM_RIGHT | GLOW_TILE_LEFT] = 0x20, + 0x02, 0x03, + [GLOW_TILE_BOTTOM_RIGHT | GLOW_TILE_TOP] = 0x27, + [GLOW_TILE_BOTTOM_RIGHT | GLOW_TILE_TOP | GLOW_TILE_LEFT] = 0x2d, + 0x06, 0x07, 0x08, 0x09, 0x0a, + 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, + [GLOW_TILE_TOP_RIGHT] = 0x12, + [GLOW_TILE_TOP_RIGHT | GLOW_TILE_LEFT] = 0x21, + 0x02, 0x03, 0x04, 0x05, 0x06, + 0x07, + [GLOW_TILE_TOP_RIGHT | GLOW_TILE_BOTTOM] = 0x2a, + [GLOW_TILE_TOP_RIGHT | GLOW_TILE_BOTTOM | GLOW_TILE_LEFT] = 0x2e, + 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, + 0x0f, + [GLOW_TILE_TOP_RIGHT | GLOW_TILE_BOTTOM_RIGHT] = 0x13, + [GLOW_TILE_TOP_RIGHT | GLOW_TILE_BOTTOM_RIGHT | GLOW_TILE_LEFT] = 0x22, + 0x02, 0x03, 0x27, 0x2d, 0x06, + 0x07, 0x2a, 0x2e, 0x0a, 0x0b, + 0x0c, 0x0d, 0x0e, 0x0f, + [GLOW_TILE_BOTTOM_LEFT] = 0x14, + 0x01, + [GLOW_TILE_BOTTOM_LEFT | GLOW_TILE_RIGHT] = 0x23, + 0x03, + [GLOW_TILE_BOTTOM_LEFT | GLOW_TILE_TOP] = 0x26, + 0x05, + [GLOW_TILE_BOTTOM_LEFT | GLOW_TILE_TOP | GLOW_TILE_RIGHT] = 0x2c, + 0x07, 0x08, 0x09, 0x0a, 0x0b, + 0x0c, 0x0d, 0x0e, 0x0f, + [GLOW_TILE_BOTTOM_LEFT | GLOW_TILE_BOTTOM_RIGHT] = 0x15, + 0x20, 0x23, 0x03, + [GLOW_TILE_BOTTOM_LEFT | GLOW_TILE_BOTTOM_RIGHT | GLOW_TILE_TOP] = 0x28, + 0x2d, 0x2c, 0x07, 0x08, 0x09, + 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, + 0x0f, + [GLOW_TILE_BOTTOM_LEFT | GLOW_TILE_TOP_RIGHT] = 0x16, + 0x21, 0x23, 0x03, 0x26, 0x05, + 0x2c, 0x07, 0x2a, 0x2e, 0x0a, + 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, + [GLOW_TILE_BOTTOM_LEFT | GLOW_TILE_TOP_RIGHT | GLOW_TILE_BOTTOM_RIGHT] = 0x17, + 0x22, 0x23, 0x03, 0x28, 0x2d, + 0x2c, 0x07, 0x2a, 0x2e, 0x0a, + 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, + [GLOW_TILE_TOP_LEFT] = 0x18, + 0x01, + [GLOW_TILE_TOP_LEFT | GLOW_TILE_RIGHT] = 0x24, + 0x03, 0x04, 0x05, 0x06, 0x07, + [GLOW_TILE_TOP_LEFT | GLOW_TILE_BOTTOM] = 0x29, + 0x09, + [GLOW_TILE_TOP_LEFT | GLOW_TILE_BOTTOM | GLOW_TILE_RIGHT] = 0x2f, + 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, + [GLOW_TILE_TOP_LEFT | GLOW_TILE_BOTTOM_RIGHT] = 0x19, + 0x20, 0x24, 0x03, 0x27, 0x2d, + 0x06, 0x07, 0x29, 0x09, 0x2f, + 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, + [GLOW_TILE_TOP_LEFT | GLOW_TILE_TOP_RIGHT] = 0x1a, + 0x21, 0x24, 0x03, 0x04, 0x05, + 0x06, 0x07, + [GLOW_TILE_TOP_LEFT | GLOW_TILE_TOP_RIGHT | GLOW_TILE_BOTTOM] = 0x2b, + 0x2e, 0x2f, 0x0b, 0x0c, 0x0d, + 0x0e, 0x0f, + [GLOW_TILE_TOP_LEFT | GLOW_TILE_TOP_RIGHT | GLOW_TILE_BOTTOM_RIGHT] = 0x1b, + 0x22, 0x24, 0x03, 0x27, 0x2d, + 0x06, 0x07, 0x2b, 0x2e, 0x2f, + 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, + [GLOW_TILE_TOP_LEFT | GLOW_TILE_BOTTOM_LEFT] = 0x1c, + 0x01, + [GLOW_TILE_TOP_LEFT | GLOW_TILE_BOTTOM_LEFT | GLOW_TILE_RIGHT] = 0x25, + 0x03, 0x26, 0x05, 0x2c, 0x07, + 0x29, 0x09, 0x2f, 0x0b, 0x0c, + 0x0d, 0x0e, 0x0f, + [GLOW_TILE_TOP_LEFT | GLOW_TILE_BOTTOM_LEFT | GLOW_TILE_BOTTOM_RIGHT] = 0x1d, + 0x20, 0x25, 0x03, 0x28, 0x2d, + 0x2c, 0x07, 0x29, 0x09, 0x2f, + 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, + [GLOW_TILE_TOP_LEFT | GLOW_TILE_BOTTOM_LEFT | GLOW_TILE_TOP_RIGHT] = 0x1e, + 0x21, 0x25, 0x03, 0x26, 0x05, + 0x2c, 0x07, 0x2b, 0x2e, 0x2f, + 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, + [GLOW_TILE_TOP_LEFT | GLOW_TILE_BOTTOM_LEFT | GLOW_TILE_TOP_RIGHT | GLOW_TILE_BOTTOM_RIGHT] = 0x1f, + 0x22, 0x25, 0x03, 0x28, 0x2d, + 0x2c, 0x07, 0x2b, 0x2e, 0x2f, + 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, }; static const struct UnkStruct_1C4D70 sUnknown_085B4018 = { @@ -237,11 +341,11 @@ static void FindMapsWithMon(u16 species) { switch (sFeebasData[i][1]) { - case MAP_GROUP(PETALBURG_CITY): + case MAP_AREA_OVERWORLD_MONS: SetAreaHasMon(sFeebasData[i][1], sFeebasData[i][2]); break; - case MAP_GROUP(METEOR_FALLS_1F_1R): - case MAP_GROUP(SAFARI_ZONE_NORTHWEST): + case MAP_AREA_SPECIAL_MONS_1: + case MAP_AREA_SPECIAL_MONS_2: SetSpecialMapHasMon(sFeebasData[i][1], sFeebasData[i][2]); break; } @@ -250,15 +354,15 @@ static void FindMapsWithMon(u16 species) for (i = 0; gWildMonHeaders[i].mapGroup != 0xFF; i++) { - if (MapHasMon(gWildMonHeaders + i, species)) + if (MapHasMon(&gWildMonHeaders[i], species)) { switch (gWildMonHeaders[i].mapGroup) { - case MAP_GROUP(PETALBURG_CITY): + case MAP_AREA_OVERWORLD_MONS: SetAreaHasMon(gWildMonHeaders[i].mapGroup, gWildMonHeaders[i].mapNum); break; - case MAP_GROUP(METEOR_FALLS_1F_1R): - case MAP_GROUP(SAFARI_ZONE_NORTHWEST): + case MAP_AREA_SPECIAL_MONS_1: + case MAP_AREA_SPECIAL_MONS_2: SetSpecialMapHasMon(gWildMonHeaders[i].mapGroup, gWildMonHeaders[i].mapNum); break; } @@ -372,18 +476,18 @@ static void BuildAreaGlowTilemap(void) u16 i, y, x, j; u16 val; - for (i = 0; i < 0x280; i++) + for (i = 0; i < ARRAY_COUNT(sPokedexAreaScreen->areaGlowTilemap); i++) sPokedexAreaScreen->areaGlowTilemap[i] = 0; for (i = 0; i < sPokedexAreaScreen->numOverworldAreas; i++) { j = 0; - for (y = 0; y < 20; y++) + for (y = 0; y < AREA_SCREEN_HEIGHT; y++) { - for (x = 0; x < 32; x++) + for (x = 0; x < AREA_SCREEN_WIDTH; x++) { if (GetRegionMapSectionIdAt(x, y) == sPokedexAreaScreen->overworldAreasWithMons[i].regionMapSectionId) - sPokedexAreaScreen->areaGlowTilemap[j] = 0xFFFF; + sPokedexAreaScreen->areaGlowTilemap[j] = GLOW_TILE_FULL; j++; } @@ -391,51 +495,58 @@ static void BuildAreaGlowTilemap(void) } j = 0; - for (y = 0; y < 20; y++) + for (y = 0; y < AREA_SCREEN_HEIGHT; y++) { - for (x = 0; x < 32; x++) + for (x = 0; x < AREA_SCREEN_WIDTH; x++) { - if (sPokedexAreaScreen->areaGlowTilemap[j] == 0xFFFF) + if (sPokedexAreaScreen->areaGlowTilemap[j] == GLOW_TILE_FULL) { - if (x != 0 && sPokedexAreaScreen->areaGlowTilemap[j - 1] != 0xFFFF) - sPokedexAreaScreen->areaGlowTilemap[j - 1] |= 0x02; - if (x != 31 && sPokedexAreaScreen->areaGlowTilemap[j + 1] != 0xFFFF) - sPokedexAreaScreen->areaGlowTilemap[j + 1] |= 0x01; - if (y != 0 && sPokedexAreaScreen->areaGlowTilemap[j - 32] != 0xFFFF) - sPokedexAreaScreen->areaGlowTilemap[j - 32] |= 0x08; - if (y != 19 && sPokedexAreaScreen->areaGlowTilemap[j + 32] != 0xFFFF) - sPokedexAreaScreen->areaGlowTilemap[j + 32] |= 0x04; - if (x != 0 && y != 0 && sPokedexAreaScreen->areaGlowTilemap[j - 33] != 0xFFFF) - sPokedexAreaScreen->areaGlowTilemap[j - 33] |= 0x10; - if (x != 31 && y != 0 && sPokedexAreaScreen->areaGlowTilemap[j - 31] != 0xFFFF) - sPokedexAreaScreen->areaGlowTilemap[j - 31] |= 0x40; - if (x != 0 && y != 19 && sPokedexAreaScreen->areaGlowTilemap[j + 31] != 0xFFFF) - sPokedexAreaScreen->areaGlowTilemap[j + 31] |= 0x20; - if (x != 31 && y != 19 && sPokedexAreaScreen->areaGlowTilemap[j + 33] != 0xFFFF) - sPokedexAreaScreen->areaGlowTilemap[j + 33] |= 0x80; + // The "tile != GLOW_TILE_FULL" check is pointless in all of these conditionals, + // since there's no harm in OR'ing 0xFFFF with anything else. + + // Edges + if (x != 0 && sPokedexAreaScreen->areaGlowTilemap[j - 1] != GLOW_TILE_FULL) + sPokedexAreaScreen->areaGlowTilemap[j - 1] |= GLOW_TILE_RIGHT; + if (x != AREA_SCREEN_WIDTH - 1 && sPokedexAreaScreen->areaGlowTilemap[j + 1] != GLOW_TILE_FULL) + sPokedexAreaScreen->areaGlowTilemap[j + 1] |= GLOW_TILE_LEFT; + if (y != 0 && sPokedexAreaScreen->areaGlowTilemap[j - AREA_SCREEN_WIDTH] != GLOW_TILE_FULL) + sPokedexAreaScreen->areaGlowTilemap[j - AREA_SCREEN_WIDTH] |= GLOW_TILE_BOTTOM; + if (y != AREA_SCREEN_HEIGHT - 1 && sPokedexAreaScreen->areaGlowTilemap[j + AREA_SCREEN_WIDTH] != GLOW_TILE_FULL) + sPokedexAreaScreen->areaGlowTilemap[j + AREA_SCREEN_WIDTH] |= GLOW_TILE_TOP; + + // Diagonals + if (x != 0 && y != 0 && sPokedexAreaScreen->areaGlowTilemap[j - AREA_SCREEN_WIDTH - 1] != GLOW_TILE_FULL) + sPokedexAreaScreen->areaGlowTilemap[j - AREA_SCREEN_WIDTH - 1] |= GLOW_TILE_BOTTOM_RIGHT; + if (x != AREA_SCREEN_WIDTH - 1 && y != 0 && sPokedexAreaScreen->areaGlowTilemap[j - AREA_SCREEN_WIDTH + 1] != GLOW_TILE_FULL) + sPokedexAreaScreen->areaGlowTilemap[j - AREA_SCREEN_WIDTH + 1] |= GLOW_TILE_BOTTOM_LEFT; + if (x != 0 && y != AREA_SCREEN_HEIGHT - 1 && sPokedexAreaScreen->areaGlowTilemap[j + AREA_SCREEN_WIDTH - 1] != GLOW_TILE_FULL) + sPokedexAreaScreen->areaGlowTilemap[j + AREA_SCREEN_WIDTH - 1] |= GLOW_TILE_TOP_RIGHT; + if (x != AREA_SCREEN_WIDTH - 1 && y != AREA_SCREEN_HEIGHT - 1 && sPokedexAreaScreen->areaGlowTilemap[j + AREA_SCREEN_WIDTH + 1] != GLOW_TILE_FULL) + sPokedexAreaScreen->areaGlowTilemap[j + AREA_SCREEN_WIDTH + 1] |= GLOW_TILE_TOP_LEFT; } j++; } } - for (i = 0; i < 0x280; i++) + for (i = 0; i < ARRAY_COUNT(sPokedexAreaScreen->areaGlowTilemap); i++) { - if (sPokedexAreaScreen->areaGlowTilemap[i] == 0xFFFF) + if (sPokedexAreaScreen->areaGlowTilemap[i] == GLOW_TILE_FULL) { sPokedexAreaScreen->areaGlowTilemap[i] = 0x10; sPokedexAreaScreen->areaGlowTilemap[i] |= 0xA000; } else if (sPokedexAreaScreen->areaGlowTilemap[i]) { - if (sPokedexAreaScreen->areaGlowTilemap[i] & 0x02) - sPokedexAreaScreen->areaGlowTilemap[i] &= 0xFFCF; - if (sPokedexAreaScreen->areaGlowTilemap[i] & 0x01) - sPokedexAreaScreen->areaGlowTilemap[i] &= 0xFF3F; - if (sPokedexAreaScreen->areaGlowTilemap[i] & 0x08) - sPokedexAreaScreen->areaGlowTilemap[i] &= 0xFFAF; - if (sPokedexAreaScreen->areaGlowTilemap[i] & 0x04) - sPokedexAreaScreen->areaGlowTilemap[i] &= 0xFF5F; + // Get rid of overlapping flags + if (sPokedexAreaScreen->areaGlowTilemap[i] & GLOW_TILE_RIGHT) + sPokedexAreaScreen->areaGlowTilemap[i] &= ~(GLOW_TILE_BOTTOM_RIGHT | GLOW_TILE_TOP_RIGHT); + if (sPokedexAreaScreen->areaGlowTilemap[i] & GLOW_TILE_LEFT) + sPokedexAreaScreen->areaGlowTilemap[i] &= ~(GLOW_TILE_BOTTOM_LEFT | GLOW_TILE_TOP_LEFT); + if (sPokedexAreaScreen->areaGlowTilemap[i] & GLOW_TILE_BOTTOM) + sPokedexAreaScreen->areaGlowTilemap[i] &= ~(GLOW_TILE_BOTTOM_LEFT | GLOW_TILE_BOTTOM_RIGHT); + if (sPokedexAreaScreen->areaGlowTilemap[i] & GLOW_TILE_TOP) + sPokedexAreaScreen->areaGlowTilemap[i] &= ~(GLOW_TILE_TOP_LEFT | GLOW_TILE_TOP_RIGHT); sPokedexAreaScreen->areaGlowTilemap[i] = sAreaGlowTilemapMapping[sPokedexAreaScreen->areaGlowTilemap[i]]; sPokedexAreaScreen->areaGlowTilemap[i] |= 0xA000; -- cgit v1.2.3 From f34cda3b5209735fbf276b0f23e29549b1a1a3d9 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 30 Mar 2019 13:14:00 -0400 Subject: Start decompiling mystery gift --- src/mystery_gift.c | 253 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 253 insertions(+) create mode 100644 src/mystery_gift.c (limited to 'src') diff --git a/src/mystery_gift.c b/src/mystery_gift.c new file mode 100644 index 000000000..b6c317281 --- /dev/null +++ b/src/mystery_gift.c @@ -0,0 +1,253 @@ +#include "global.h" +#include "main.h" +#include "text.h" +#include "task.h" +#include "alloc.h" +#include "gpu_regs.h" +#include "scanline_effect.h" +#include "text_window.h" +#include "bg.h" +#include "window.h" +#include "text_window.h" +#include "menu.h" +#include "palette.h" +#include "constants/songs.h" +#include "sound.h" +#include "mystery_gift.h" + +void bgid_upload_textbox_1(u8 bgId); +void sub_8018798(u8); +void sub_80186EC(u8, u8); + +const u16 gUnkTextboxBorderPal[] = INCBIN_U16("graphics/interface/unk_textbox_border.gbapal"); +const u32 gUnkTextboxBorderGfx[] = INCBIN_U32("graphics/interface/unk_textbox_border.4bpp.lz"); + +const struct BgTemplate gUnknown_082F0598[] = { + { + .bg = 0, + .charBaseIndex = 2, + .mapBaseIndex = 15, + .screenSize = 0, + .paletteMode = 0, + .priority = 0, + .baseTile = 0x000 + }, { + .bg = 1, + .charBaseIndex = 0, + .mapBaseIndex = 14, + .screenSize = 0, + .paletteMode = 0, + .priority = 1, + .baseTile = 0x000 + }, { + .bg = 2, + .charBaseIndex = 0, + .mapBaseIndex = 13, + .screenSize = 0, + .paletteMode = 0, + .priority = 2, + .baseTile = 0x000 + }, { + .bg = 3, + .charBaseIndex = 0, + .mapBaseIndex = 12, + .screenSize = 0, + .paletteMode = 0, + .priority = 3, + .baseTile = 0x000 + } +}; + +const struct WindowTemplate gUnknown_082F05A8[] = { + { + .bg = 0x00, + .tilemapLeft = 0x00, + .tilemapTop = 0x00, + .width = 0x1e, + .height = 0x02, + .paletteNum = 0x0c, + .baseBlock = 0x0013 + }, { + .bg = 0x00, + .tilemapLeft = 0x01, + .tilemapTop = 0x0f, + .width = 0x1c, + .height = 0x04, + .paletteNum = 0x0c, + .baseBlock = 0x004f + }, { + .bg = 0x00, + .tilemapLeft = 0x00, + .tilemapTop = 0x0f, + .width = 0x1e, + .height = 0x05, + .paletteNum = 0x0d, + .baseBlock = 0x004f + }, { + 0xFF + } +}; + +const struct WindowTemplate gUnknown_082F05C8 = { + .bg = 0x00, + .tilemapLeft = 0x01, + .tilemapTop = 0x0f, + .width = 0x1c, + .height = 0x04, + .paletteNum = 0x0c, + .baseBlock = 0x00e5 +}; + +const struct WindowTemplate gUnknown_082F05D0 = { + .bg = 0x00, + .tilemapLeft = 0x01, + .tilemapTop = 0x0f, + .width = 0x14, + .height = 0x04, + .paletteNum = 0x0c, + .baseBlock = 0x00e5 +}; + +const struct WindowTemplate gUnknown_082F05D8 = { + .bg = 0x00, + .tilemapLeft = 0x01, + .tilemapTop = 0x0f, + .width = 0x13, + .height = 0x04, + .paletteNum = 0x0c, + .baseBlock = 0x00e5 +}; + +const struct WindowTemplate gUnknown_082F05E0 = { + .bg = 0x00, + .tilemapLeft = 0x08, + .tilemapTop = 0x06, + .width = 0x0e, + .height = 0x06, + .paletteNum = 0x0c, + .baseBlock = 0x0155 +}; + +const struct WindowTemplate gUnknown_082F05E8 = { + .bg = 0x00, + .tilemapLeft = 0x17, + .tilemapTop = 0x0f, + .width = 0x06, + .height = 0x04, + .paletteNum = 0x0c, + .baseBlock = 0x0155 +}; + +const struct WindowTemplate gUnknown_082F05F0 = { + .bg = 0x00, + .tilemapLeft = 0x16, + .tilemapTop = 0x0b, + .width = 0x07, + .height = 0x08, + .paletteNum = 0x0c, + .baseBlock = 0x0155 +}; + +const struct WindowTemplate gUnknown_082F05F8 = { + .bg = 0x00, + .tilemapLeft = 0x16, + .tilemapTop = 0x0d, + .width = 0x07, + .height = 0x06, + .paletteNum = 0x0c, + .baseBlock = 0x0155 +}; + +const struct WindowTemplate gUnknown_082F0600 = { + .bg = 0x00, + .tilemapLeft = 0x16, + .tilemapTop = 0x0f, + .width = 0x07, + .height = 0x04, + .paletteNum = 0x0c, + .baseBlock = 0x0155 +}; + +void sub_8018424(void) +{ + ProcessSpriteCopyRequests(); + LoadOam(); + TransferPlttBuffer(); +} + +void sub_8018438(void) +{ + RunTasks(); + RunTextPrinters(); + AnimateSprites(); + BuildOamBuffer(); +} + +bool32 sub_8018450(s32 arg) +{ + switch (gMain.state) + { + case 0: + SetVBlankCallback(NULL); + ResetPaletteFade(); + ResetSpriteData(); + FreeAllSpritePalettes(); + ResetTasks(); + ScanlineEffect_Stop(); + ResetBgsAndClearDma3BusyFlags(0); + + InitBgsFromTemplates(0, gUnknown_082F0598, ARRAY_COUNT(gUnknown_082F0598)); + ChangeBgX(0, 0, 0); + ChangeBgY(0, 0, 0); + ChangeBgX(1, 0, 0); + ChangeBgY(1, 0, 0); + ChangeBgX(2, 0, 0); + ChangeBgY(2, 0, 0); + ChangeBgX(3, 0, 0); + ChangeBgY(3, 0, 0); + + SetBgTilemapBuffer(3, Alloc(0x800)); + SetBgTilemapBuffer(2, Alloc(0x800)); + SetBgTilemapBuffer(1, Alloc(0x800)); + SetBgTilemapBuffer(0, Alloc(0x800)); + + bgid_upload_textbox_1(3); + InitWindows(gUnknown_082F05A8); + DeactivateAllTextPrinters(); + ClearGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_WIN0_ON | DISPCNT_WIN1_ON); + SetGpuReg(REG_OFFSET_BLDCNT, 0); + SetGpuReg(REG_OFFSET_BLDALPHA, 0); + SetGpuReg(REG_OFFSET_BLDY, 0); + gMain.state++; + break; + case 1: + LoadPalette(gUnkTextboxBorderPal, 0, 0x20); + LoadPalette(stdpal_get(2), 0xd0, 0x20); + sub_81978B0(0xC0); + LoadUserWindowBorderGfx(0, 0xA, 0xE0); + LoadUserWindowBorderGfx_(0, 0x1, 0xF0); + FillBgTilemapBufferRect(0, 0x000, 0, 0, 32, 32, 0x11); + FillBgTilemapBufferRect(1, 0x000, 0, 0, 32, 32, 0x11); + FillBgTilemapBufferRect(2, 0x000, 0, 0, 32, 32, 0x11); + sub_8018798(3); + sub_80186EC(arg, 0); + gMain.state++; + break; + case 2: + CopyBgTilemapBufferToVram(3); + CopyBgTilemapBufferToVram(2); + CopyBgTilemapBufferToVram(1); + CopyBgTilemapBufferToVram(0); + gMain.state++; + break; + case 3: + ShowBg(0); + ShowBg(3); + PlayBGM(MUS_RG_OKURIMONO); + SetVBlankCallback(sub_8018424); + EnableInterrupts(INTR_FLAG_VBLANK | INTR_FLAG_VCOUNT | INTR_FLAG_TIMER3 | INTR_FLAG_SERIAL); + return TRUE; + } + + return FALSE; +} -- cgit v1.2.3 From aafe9df454f42c77146d76676cc477e876d6540b Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 30 Mar 2019 14:36:52 -0400 Subject: through sub_8018798 --- src/cable_club.c | 3 +- src/ereader_helpers.c | 2 +- src/ereader_screen.c | 2 +- src/link_rfu.c | 4 +- src/mevent_801BAAC.c | 1 + src/mystery_gift.c | 245 +++++++++++++++++++++++++++++++++++++++++++++++++- src/party_menu.c | 2 +- src/start_menu.c | 1 + src/trade.c | 3 + src/union_room.c | 4 +- 10 files changed, 256 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/cable_club.c b/src/cable_club.c index b80e76e99..fab187b07 100644 --- a/src/cable_club.c +++ b/src/cable_club.c @@ -17,7 +17,8 @@ #include "menu.h" #include "overworld.h" #include "palette.h" -#include "rom_8011DC0.h" +#include "union_room.h" +#include "mevent2.h" #include "script.h" #include "script_pokemon_util_80F87D8.h" #include "sound.h" diff --git a/src/ereader_helpers.c b/src/ereader_helpers.c index 6c92b676f..cdb829ac8 100755 --- a/src/ereader_helpers.c +++ b/src/ereader_helpers.c @@ -4,7 +4,7 @@ #include "ereader_helpers.h" #include "link.h" #include "main.h" -#include "rom_8011DC0.h" +#include "union_room.h" #include "save.h" #include "sprite.h" #include "task.h" diff --git a/src/ereader_screen.c b/src/ereader_screen.c index b15c1fd0c..10a23e251 100755 --- a/src/ereader_screen.c +++ b/src/ereader_screen.c @@ -4,7 +4,7 @@ #include "ereader_helpers.h" #include "link.h" #include "main.h" -#include "rom_8011DC0.h" +#include "union_room.h" #include "save.h" #include "sound.h" #include "sprite.h" diff --git a/src/link_rfu.c b/src/link_rfu.c index 945806459..43d19be03 100644 --- a/src/link_rfu.c +++ b/src/link_rfu.c @@ -11,13 +11,13 @@ #include "overworld.h" #include "random.h" #include "palette.h" -#include "rom_8011DC0.h" +#include "union_room.h" #include "string_util.h" #include "task.h" #include "text.h" #include "constants/species.h" #include "save.h" -#include "rom_8011DC0.h" +#include "mystery_gift.h" extern u16 gHeldKeyCodeToSend; diff --git a/src/mevent_801BAAC.c b/src/mevent_801BAAC.c index 857ca3fde..d69ab0495 100644 --- a/src/mevent_801BAAC.c +++ b/src/mevent_801BAAC.c @@ -13,6 +13,7 @@ #include "string_util.h" #include "link_rfu.h" #include "mevent.h" +#include "mystery_gift.h" struct UnkStruct_8467FB8 { diff --git a/src/mystery_gift.c b/src/mystery_gift.c index b6c317281..3fbe11378 100644 --- a/src/mystery_gift.c +++ b/src/mystery_gift.c @@ -8,16 +8,24 @@ #include "text_window.h" #include "bg.h" #include "window.h" +#include "strings.h" #include "text_window.h" #include "menu.h" #include "palette.h" #include "constants/songs.h" #include "sound.h" #include "mystery_gift.h" +#include "union_room.h" +#include "title_screen.h" +#include "ereader_screen.h" +#include "international_string_util.h" +#include "list_menu.h" void bgid_upload_textbox_1(u8 bgId); -void sub_8018798(u8); -void sub_80186EC(u8, u8); +void task_add_00_mystery_gift(void); + +EWRAM_DATA u8 gUnknown_02022C58 = 0; +EWRAM_DATA u8 gUnknown_02022C59 = 0; const u16 gUnkTextboxBorderPal[] = INCBIN_U16("graphics/interface/unk_textbox_border.gbapal"); const u32 gUnkTextboxBorderGfx[] = INCBIN_U32("graphics/interface/unk_textbox_border.4bpp.lz"); @@ -168,6 +176,158 @@ const struct WindowTemplate gUnknown_082F0600 = { .baseBlock = 0x0155 }; +const struct ListMenuItem gUnknown_082F0608[] = { + { gText_WonderCards, 0 }, + { gText_WonderNews, 1 }, + { gText_Exit3, -2 } +}; + +const struct ListMenuItem gUnknown_082F0620[] = { + { gText_WirelessCommunication, 0 }, + { gText_Friend2, 1 }, + { gText_Cancel2, -2 } +}; + +const struct ListMenuTemplate gUnknown_082F0638 = { + .items = NULL, + .moveCursorFunc = ListMenuDefaultCursorMoveFunc, + .itemPrintFunc = NULL, + .totalItems = 3, + .maxShowed = 3, + .windowId = 0, + .header_X = 0, + .item_X = 8, + .cursor_X = 0, + .upText_Y = 1, + .cursorPal = 2, + .fillValue = 1, + .cursorShadowPal = 3, + .lettersSpacing = 0, + .itemVerticalPadding = 0, + .scrollMultiple = 0, + .fontId = 1, + .cursorKind = 0 +}; + +const struct ListMenuItem gUnknown_082F0650[] = { + { gText_Receive, 0 }, + { gText_Send, 1 }, + { gText_Toss, 2 }, + { gText_Cancel2, -2 } +}; + +const struct ListMenuItem gUnknown_082F0670[] = { + { gText_Receive, 0 }, + { gText_Toss, 2 }, + { gText_Cancel2, -2 } +}; + +const struct ListMenuItem gUnknown_082F0688[] = { + { gText_Receive, 0 }, + { gText_Send, 1 }, + { gText_Cancel2, -2 } +}; + +const struct ListMenuItem gUnknown_082F06A0[] = { + { gText_Receive, 0 }, + { gText_Cancel2, -2 } +}; + +const struct ListMenuTemplate gUnknown_082F06B0 = { + .items = gUnknown_082F0650, + .moveCursorFunc = ListMenuDefaultCursorMoveFunc, + .itemPrintFunc = NULL, + .totalItems = 4, + .maxShowed = 4, + .windowId = 0, + .header_X = 0, + .item_X = 8, + .cursor_X = 0, + .upText_Y = 1, + .cursorPal = 2, + .fillValue = 1, + .cursorShadowPal = 3, + .lettersSpacing = 0, + .itemVerticalPadding = 0, + .scrollMultiple = 0, + .fontId = 1, + .cursorKind = 0 +}; + +const struct ListMenuTemplate gUnknown_082F06C8 = { + .items = gUnknown_082F0670, + .moveCursorFunc = ListMenuDefaultCursorMoveFunc, + .itemPrintFunc = NULL, + .totalItems = 3, + .maxShowed = 3, + .windowId = 0, + .header_X = 0, + .item_X = 8, + .cursor_X = 0, + .upText_Y = 1, + .cursorPal = 2, + .fillValue = 1, + .cursorShadowPal = 3, + .lettersSpacing = 0, + .itemVerticalPadding = 0, + .scrollMultiple = 0, + .fontId = 1, + .cursorKind = 0 +}; + +const struct ListMenuTemplate gUnknown_082F06E0 = { + .items = gUnknown_082F0688, + .moveCursorFunc = ListMenuDefaultCursorMoveFunc, + .itemPrintFunc = NULL, + .totalItems = 3, + .maxShowed = 3, + .windowId = 0, + .header_X = 0, + .item_X = 8, + .cursor_X = 0, + .upText_Y = 1, + .cursorPal = 2, + .fillValue = 1, + .cursorShadowPal = 3, + .lettersSpacing = 0, + .itemVerticalPadding = 0, + .scrollMultiple = 0, + .fontId = 1, + .cursorKind = 0 +}; + +const struct ListMenuTemplate gUnknown_082F06F8 = { + .items = gUnknown_082F06A0, + .moveCursorFunc = ListMenuDefaultCursorMoveFunc, + .itemPrintFunc = NULL, + .totalItems = 2, + .maxShowed = 2, + .windowId = 0, + .header_X = 0, + .item_X = 8, + .cursor_X = 0, + .upText_Y = 1, + .cursorPal = 2, + .fillValue = 1, + .cursorShadowPal = 3, + .lettersSpacing = 0, + .itemVerticalPadding = 0, + .scrollMultiple = 0, + .fontId = 1, + .cursorKind = 0 +}; + +const u8 *const Unref_082F0710[] = { + gText_VarietyOfEventsImportedWireless, + gText_WonderCardsInPossession, + gText_ReadNewsThatArrived, + gText_ReturnToTitle +}; + +ALIGNED(2) const u8 gUnknown_082F0720[] = { 0, 1, 2 }; +ALIGNED(2) const u8 gUnknown_082F0724[] = { 0, 1, 2 }; +ALIGNED(2) const u8 gUnknown_082F0728[] = { 1, 2, 3 }; + void sub_8018424(void) { ProcessSpriteCopyRequests(); @@ -251,3 +411,84 @@ bool32 sub_8018450(s32 arg) return FALSE; } + +void c2_mystery_gift(void) +{ + if (sub_8018450(0)) + { + SetMainCallback2(sub_8018438); + gUnknown_02022C60 = FALSE; + task_add_00_mystery_gift(); + } + RunTasks(); +} + +void sub_801867C(void) +{ + if (sub_8018450(1)) + { + SetMainCallback2(sub_8018438); + gUnknown_02022C60 = TRUE; + sub_81D5014(); + } +} + +void sub_80186A4(void) +{ + gUnknown_02022C60 = FALSE; + FreeAllWindowBuffers(); + Free(GetBgTilemapBuffer(0)); + Free(GetBgTilemapBuffer(1)); + Free(GetBgTilemapBuffer(2)); + Free(GetBgTilemapBuffer(3)); + SetMainCallback2(CB2_InitTitleScreen); +} + +void sub_80186EC(bool8 isJapanese, bool32 usePickOkCancel) +{ + const u8 * header; + const u8 * options; + FillWindowPixelBuffer(0, 0); + if (!isJapanese) + { + header = gText_MysteryGift; + options = !usePickOkCancel ? gText_PickOKExit : gText_PickOKCancel; + } + else + { + header = gJPText_MysteryGift; + options = gJPText_DecideStop; + } + + AddTextPrinterParameterized4(0, 1, 4, 1, 0, 0, gUnknown_082F0720, -1, header); + AddTextPrinterParameterized4(0, 0, GetStringRightAlignXOffset(0, options, 0xDE), 1, 0, 0, gUnknown_082F0720, -1, options); + CopyWindowToVram(0, 2); + PutWindowTilemap(0); +} + +void sub_8018784(u8 windowId) +{ + sub_8098858(windowId, 0x01, 0xF); +} + +void sub_8018798(u32 bg) +{ + s32 i = 0, j; + + FillBgTilemapBufferRect(bg, 0x003, 0, 0, 32, 2, 0x11); + + for (i = 0; i < 18; i++) + { + for (j = 0; j < 32; j++) + { + if ((i & 1) != (j & 1)) + { + FillBgTilemapBufferRect(bg, 1, j, i + 2, 1, 1, 0x11); + } + else + { + FillBgTilemapBufferRect(bg, 2, j, i + 2, 1, 1, 0x11); + } + } + } +} diff --git a/src/party_menu.c b/src/party_menu.c index 7db24b6ca..6233558ff 100755 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -49,7 +49,7 @@ #include "pokemon_summary_screen.h" #include "region_map.h" #include "reshow_battle_screen.h" -#include "rom_8011DC0.h" +#include "union_room.h" #include "scanline_effect.h" #include "script.h" #include "sound.h" diff --git a/src/start_menu.c b/src/start_menu.c index 4822c12e6..f573f9bdf 100644 --- a/src/start_menu.c +++ b/src/start_menu.c @@ -44,6 +44,7 @@ #include "window.h" #include "constants/songs.h" #include "rom_8011DC0.h" +#include "union_room.h" // Menu actions enum diff --git a/src/trade.c b/src/trade.c index df8f493f1..34f49060f 100644 --- a/src/trade.c +++ b/src/trade.c @@ -19,6 +19,8 @@ #include "load_save.h" #include "mail.h" #include "main.h" +#include "mevent2.h" +#include "mystery_gift.h" #include "overworld.h" #include "palette.h" #include "party_menu.h" @@ -39,6 +41,7 @@ #include "text_window.h" #include "trainer_card.h" #include "trade.h" +#include "union_room.h" #include "util.h" #include "window.h" #include "constants/easy_chat.h" diff --git a/src/union_room.c b/src/union_room.c index 5050b04f1..df0137379 100644 --- a/src/union_room.c +++ b/src/union_room.c @@ -40,7 +40,7 @@ #include "strings.h" #include "mevent.h" #include "dynamic_placeholder_text_util.h" -#include "rom_8011DC0.h" +#include "union_room.h" #include "easy_chat.h" #include "event_obj_lock.h" #include "union_room_chat.h" @@ -102,8 +102,6 @@ void sub_802493C(u8 monId, MainCallback callback); void sub_80149D8(void); u16 sub_8019930(void); void sub_8018784(u8 windowId); -void sub_8018884(const u8 *src); -bool32 mevent_0814257C(u8 *textState, const u8 *str); s8 sub_8018B08(u8 *textState, u8 *arg1, u8 arg2, const u8 *str); bool32 sub_8016F1C(struct UnkLinkRfuStruct_02022B14 *arg0, s16 arg1); u8 sub_8016DF0(struct UnkStruct_Main4 *arg0, struct UnkStruct_Main4 *arg1, u32 arg2); -- cgit v1.2.3 From 82a3f29b880037f1e06e26e10f53ecc0c045ec00 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 30 Mar 2019 20:04:30 -0400 Subject: through sub_8018A50 --- src/mystery_gift.c | 147 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 145 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/mystery_gift.c b/src/mystery_gift.c index 3fbe11378..7c686964d 100644 --- a/src/mystery_gift.c +++ b/src/mystery_gift.c @@ -20,12 +20,12 @@ #include "ereader_screen.h" #include "international_string_util.h" #include "list_menu.h" +#include "string_util.h" void bgid_upload_textbox_1(u8 bgId); void task_add_00_mystery_gift(void); -EWRAM_DATA u8 gUnknown_02022C58 = 0; -EWRAM_DATA u8 gUnknown_02022C59 = 0; +EWRAM_DATA u8 gUnknown_02022C58[2] = {}; const u16 gUnkTextboxBorderPal[] = INCBIN_U16("graphics/interface/unk_textbox_border.gbapal"); const u32 gUnkTextboxBorderGfx[] = INCBIN_U32("graphics/interface/unk_textbox_border.4bpp.lz"); @@ -492,3 +492,146 @@ void sub_8018798(u32 bg) } } } + +void sub_8018838(bool32 arg) +{ + switch (arg) + { + case 0: + FillBgTilemapBufferRect(0, 0, 0, 0, 32, 32, 0x11); + break; + case 1: + FillBgTilemapBufferRect(0, 0, 0, 2, 32, 30, 0x11); + break; + } + CopyBgTilemapBufferToVram(0); +} + +void sub_8018884(const u8 *str) +{ + StringExpandPlaceholders(gStringVar4, str); + FillWindowPixelBuffer(1, 0x11); + AddTextPrinterParameterized4(1, 1, 0, 1, 0, 0, gUnknown_082F0728, 0, gStringVar4); + sub_8098858(1, 0x001, 0xF); + PutWindowTilemap(1); + CopyWindowToVram(1, 3); +} + +void sub_80188DC(void) +{ + rbox_fill_rectangle(1); + ClearWindowTilemap(1); + CopyWindowToVram(1, 1); +} + +bool32 mevent_0814257C(u8 *textState, const u8 *str) +{ + switch (*textState) + { + case 0: + sub_8018884(str); + goto inc; + case 1: + DrawDownArrow(1, 0xD0, 0x14, 1, FALSE, &gUnknown_02022C58[0], &gUnknown_02022C58[1]); + if (({gMain.newKeys & (A_BUTTON | B_BUTTON);})) + { + inc: + (*textState)++; + } + break; + case 2: + DrawDownArrow(1, 0xD0, 0x14, 1, TRUE, &gUnknown_02022C58[0], &gUnknown_02022C58[1]); + *textState = 0; + sub_80188DC(); + return TRUE; + case 0xFF: + *textState = 2; + break; + } + return FALSE; +} + +void sub_801898C(void) +{ + DrawDownArrow(1, 0xD0, 0x14, 1, FALSE, &gUnknown_02022C58[0], &gUnknown_02022C58[1]); +} + +void sub_80189B4(void) +{ + DrawDownArrow(1, 0xD0, 0x14, 1, TRUE, &gUnknown_02022C58[0], &gUnknown_02022C58[1]); +} + +bool32 sub_80189DC(u8 * textState) +{ + switch (*textState) + { + case 0: + sub_801898C(); + if (({gMain.newKeys & (A_BUTTON | B_BUTTON);})) + { + (*textState)++; + } + break; + case 1: + sub_80189B4(); + *textState = 0; + return TRUE; + } + return FALSE; +} + +bool32 sub_8018A1C(u8 * counter, const u8 * str) +{ + if (*counter == 0) + { + sub_8018884(str); + } + if (++(*counter) > 120) + { + *counter = 0; + sub_80188DC(); + return TRUE; + } + else + { + return FALSE; + } +} + +s32 sub_8018A50(u32 unused0, u32 unused1, bool8 r2) +{ + struct ListMenuTemplate listMenuTemplate = gUnknown_082F0638; + struct WindowTemplate windowTemplate = gUnknown_082F05E0; + s32 r3; + s32 r4; + + if (r2 == FALSE) + { + listMenuTemplate.items = gUnknown_082F0608; + } + else + { + listMenuTemplate.items = gUnknown_082F0620; + } + r3 = sub_81DB41C(&listMenuTemplate); + if (r3 & 1) + { + r3++; + } + windowTemplate.width = r3; + if (r3 < 30) + { + windowTemplate.tilemapLeft = (30 - r3) / 2; + } + else + { + windowTemplate.tilemapLeft = 0; + } + r4 = DoMysteryGiftListMenu(&windowTemplate, &listMenuTemplate, 1, 0x00A, 0xE0); + if (r4 != -1) + { + ClearWindowTilemap(2); + CopyWindowToVram(2, 1); + } + return r4; +} -- cgit v1.2.3 From 608a2172403abdae4ceba7f56ab78120dd0b9f1f Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sun, 31 Mar 2019 10:33:27 -0400 Subject: sub_8018B08 --- src/mystery_gift.c | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 62 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/mystery_gift.c b/src/mystery_gift.c index 7c686964d..da2a3bcc0 100644 --- a/src/mystery_gift.c +++ b/src/mystery_gift.c @@ -598,7 +598,7 @@ bool32 sub_8018A1C(u8 * counter, const u8 * str) } } -s32 sub_8018A50(u32 unused0, u32 unused1, bool8 r2) +s32 sub_8018A50(u8 * unused0, u8 * unused1, bool8 r2) { struct ListMenuTemplate listMenuTemplate = gUnknown_082F0638; struct WindowTemplate windowTemplate = gUnknown_082F05E0; @@ -635,3 +635,64 @@ s32 sub_8018A50(u32 unused0, u32 unused1, bool8 r2) } return r4; } + +s32 sub_8018B08(u8 * textState, u16 * windowId, bool8 r6, const u8 * str) +{ + struct WindowTemplate windowTemplate; + s8 input; + + switch (*textState) + { + case 0: + StringExpandPlaceholders(gStringVar4, str); + if (r6 == 0) + { + *windowId = AddWindow(&gUnknown_082F05C8); + } + else + { + *windowId = AddWindow(&gUnknown_082F05D0); + } + FillWindowPixelBuffer(*windowId, 0x11); + AddTextPrinterParameterized4(*windowId, 1, 0, 1, 0, 0, gUnknown_082F0728, 0, gStringVar4); + sub_8098858(*windowId, 0x001, 0x0F); + CopyWindowToVram(*windowId, 2); + PutWindowTilemap(*windowId); + (*textState)++; + break; + case 1: + windowTemplate = gUnknown_082F05E8; + if (r6 == 0) + { + windowTemplate.tilemapTop = 9; + } + else + { + windowTemplate.tilemapTop = 15; + } + CreateYesNoMenu(&windowTemplate, 10, 14, 0); + (*textState)++; + break; + case 2: + input = Menu_ProcessInputNoWrapClearOnChoose(); + if (input == -1 || input == 0 || input == 1) + { + *textState = 0; + rbox_fill_rectangle(*windowId); + ClearWindowTilemap(*windowId); + CopyWindowToVram(*windowId, 1); + RemoveWindow(*windowId); + return input; + } + break; + case 0xFF: + *textState = 0; + rbox_fill_rectangle(*windowId); + ClearWindowTilemap(*windowId); + CopyWindowToVram(*windowId, 1); + RemoveWindow(*windowId); + return -1; + } + + return -2; +} -- cgit v1.2.3 From f88f815cff272f4cd19759f2df24f85bc5f02ae1 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sun, 31 Mar 2019 11:16:19 -0400 Subject: WIP sub_8018DAC --- src/list_menu.c | 2 +- src/mystery_gift.c | 120 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 121 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/list_menu.c b/src/list_menu.c index 57bcc5c4f..3bcd3073d 100644 --- a/src/list_menu.c +++ b/src/list_menu.c @@ -312,7 +312,7 @@ static void ListMenuDummyTask(u8 taskId) } -s32 DoMysteryGiftListMenu(struct WindowTemplate *windowTemplate, struct ListMenuTemplate *listMenuTemplate, u8 arg2, u16 tileNum, u16 palNum) +s32 DoMysteryGiftListMenu(const struct WindowTemplate *windowTemplate, const struct ListMenuTemplate *listMenuTemplate, u8 arg2, u16 tileNum, u16 palNum) { switch (sMysteryGiftLinkMenu.state) { diff --git a/src/mystery_gift.c b/src/mystery_gift.c index da2a3bcc0..9561fbbeb 100644 --- a/src/mystery_gift.c +++ b/src/mystery_gift.c @@ -21,6 +21,8 @@ #include "international_string_util.h" #include "list_menu.h" #include "string_util.h" +#include "mevent.h" +#include "mevent_801BAAC.h" void bgid_upload_textbox_1(u8 bgId); void task_add_00_mystery_gift(void); @@ -696,3 +698,121 @@ s32 sub_8018B08(u8 * textState, u16 * windowId, bool8 r6, const u8 * str) return -2; } + +s32 sub_8018C4C(u8 * textState, u16 * windowId, bool32 r2, bool32 r3) +{ + struct WindowTemplate windowTemplate; + s32 input; + + switch (*textState) + { + case 0: + if (r2 == 0) + { + StringExpandPlaceholders(gStringVar4, gText_WhatToDoWithCards); + } + else + { + StringExpandPlaceholders(gStringVar4, gText_WhatToDoWithNews); + } + *windowId = AddWindow(&gUnknown_082F05D8); + FillWindowPixelBuffer(*windowId, 0x11); + AddTextPrinterParameterized4(*windowId, 1, 0, 1, 0, 0, gUnknown_082F0728, 0, gStringVar4); + sub_8098858(*windowId, 0x001, 0x0F); + CopyWindowToVram(*windowId, 2); + PutWindowTilemap(*windowId); + (*textState)++; + break; + case 1: + windowTemplate = gUnknown_082F05E8; + if (r3) + { + if (r2 == 0) + { + input = DoMysteryGiftListMenu(&gUnknown_082F05F8, &gUnknown_082F06C8, 1, 0x00A, 0xE0); + } + else + { + input = DoMysteryGiftListMenu(&gUnknown_082F0600, &gUnknown_082F06F8, 1, 0x00A, 0xE0); + } + } + else + { + if (r2 == 0) + { + input = DoMysteryGiftListMenu(&gUnknown_082F05F0, &gUnknown_082F06B0, 1, 0x00A, 0xE0); + } + else + { + input = DoMysteryGiftListMenu(&gUnknown_082F05F8, &gUnknown_082F06E0, 1, 0x00A, 0xE0); + } + } + if (input != -1) + { + *textState = 0; + rbox_fill_rectangle(*windowId); + ClearWindowTilemap(*windowId); + CopyWindowToVram(*windowId, 1); + RemoveWindow(*windowId); + return input; + } + break; + case 0xFF: + *textState = 0; + rbox_fill_rectangle(*windowId); + ClearWindowTilemap(*windowId); + CopyWindowToVram(*windowId, 1); + RemoveWindow(*windowId); + return -2; + } + + return -1; +} + +s32 sub_8018D98(bool32 a0) +{ + if (a0 == 0) + { + return sub_801B27C(); + } + else + { + return sub_801B0CC(); + } +} + +/*bool32 sub_8018DAC(u8 * state, bool32 arg1) +{ + switch (*state) + { + case 0: + if (arg1 == 0) + { + sub_801BAAC(sav1_get_mevent_buffer_1(), sav1_get_mevent_buffer_2()); + } + else + { + sub_801C6C8(sub_801B00C()); + } + (*state)++; + case 1: + if (arg1 == 0) + { + if (sub_801BB74() == 0) + { + break; + } + } + else + { + if (sub_801C758() == 0) + { + break; + } + } + *state = 0; + return TRUE; + } + + return FALSE; +}*/ -- cgit v1.2.3 From 813de11154ac9ac6d561ef820d2a13995ce5bb35 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sun, 31 Mar 2019 12:27:36 -0400 Subject: Through mevent_save_game --- src/mystery_gift.c | 118 +++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 110 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/mystery_gift.c b/src/mystery_gift.c index 9561fbbeb..206a9e50b 100644 --- a/src/mystery_gift.c +++ b/src/mystery_gift.c @@ -23,6 +23,7 @@ #include "string_util.h" #include "mevent.h" #include "mevent_801BAAC.h" +#include "save.h" void bgid_upload_textbox_1(u8 bgId); void task_add_00_mystery_gift(void); @@ -781,8 +782,10 @@ s32 sub_8018D98(bool32 a0) } } -/*bool32 sub_8018DAC(u8 * state, bool32 arg1) +bool32 sub_8018DAC(u8 * state, bool32 arg1) { + s32 v0; + switch (*state) { case 0: @@ -795,24 +798,123 @@ s32 sub_8018D98(bool32 a0) sub_801C6C8(sub_801B00C()); } (*state)++; + break; case 1: if (arg1 == 0) { - if (sub_801BB74() == 0) + v0 = sub_801BB74(); + check: + if (v0 != 0) { - break; + goto done; } + break; } else { - if (sub_801C758() == 0) - { - break; - } + v0 = sub_801C758(); + goto check; + } + done: + *state = 0; + return TRUE; + } + + return FALSE; +} + +bool32 sub_8018E08(bool32 arg0) +{ + if (arg0 == 0) + { + sub_801B1E8(); + } + else + { + sub_801B06C(); + } + return TRUE; +} + +bool32 sub_8018E20(bool32 arg0, bool32 arg1) +{ + if (arg0 == 0) + { + if (sub_801BDA4(arg1) != 0) + { + sub_801BB48(); + return TRUE; + } + else + { + return FALSE; + } + } + else + { + if (sub_801CA50(arg1) != 0) + { + sub_801C72C(); + return TRUE; + } + else + { + return FALSE; + } + } +} + +s8 sub_8018E50(u8 * textState, u16 * windowId, bool32 r2) +{ + if (r2 == 0) + { + return sub_8018B08(textState, windowId, TRUE, gText_IfThrowAwayCardEventWontHappen); + } + else + { + return sub_8018B08(textState, windowId, TRUE, gText_OkayToDiscardNews); + } +} + +bool32 mevent_message_was_thrown_away(u8 * textState, bool32 r1) +{ + if (r1 == 0) + { + return mevent_0814257C(textState, gText_WonderCardThrownAway); + } + else + { + return mevent_0814257C(textState, gText_WonderNewsThrownAway); + } +} + +bool32 mevent_save_game(u8 * state) +{ + switch (*state) + { + case 0: + sub_8018884(gText_DataWillBeSaved); + (*state)++; + break; + case 1: + TrySavingData(0); + (*state)++; + break; + case 2: + sub_8018884(gText_SaveCompletedPressA); + (*state)++; + break; + case 3: + if (({gMain.newKeys & (A_BUTTON | B_BUTTON);})) + { + (*state)++; } + break; + case 4: *state = 0; + sub_80188DC(); return TRUE; } return FALSE; -}*/ +} -- cgit v1.2.3 From fb5c19a33bf314f4976ae56ce13f4dc9d9ed0fe0 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sun, 31 Mar 2019 12:36:48 -0400 Subject: through mevent_message --- src/mystery_gift.c | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) (limited to 'src') diff --git a/src/mystery_gift.c b/src/mystery_gift.c index 206a9e50b..c8a507355 100644 --- a/src/mystery_gift.c +++ b/src/mystery_gift.c @@ -918,3 +918,73 @@ bool32 mevent_save_game(u8 * state) return FALSE; } + +const u8 * mevent_message(u32 * a0, u8 a1, u8 a2, u32 a3) +{ + const u8 * msg = NULL; + *a0 = 0; + + switch (a3) + { + case 0: + *a0 = 0; + msg = gText_NothingSentOver; + break; + case 1: + *a0 = 0; + msg = gText_RecordUploadedViaWireless; + break; + case 2: + *a0 = 1; + msg = a2 == 0 ? gText_WonderCardReceived : gText_WonderCardReceivedFrom; + break; + case 3: + *a0 = 1; + msg = a2 == 0 ? gText_WonderNewsReceived : gText_WonderNewsReceivedFrom; + break; + case 4: + *a0 = 1; + msg = gText_NewStampReceived; + break; + case 5: + *a0 = 0; + msg = gText_AlreadyHadCard; + break; + case 6: + *a0 = 0; + msg = gText_AlreadyHadStamp; + break; + case 7: + *a0 = 0; + msg = gText_AlreadyHadNews; + break; + case 8: + *a0 = 0; + msg = gText_NoMoreRoomForStamps; + break; + case 9: + *a0 = 0; + msg = gText_CommunicationCanceled; + break; + case 10: + *a0 = 0; + msg = a1 == 0 ? gText_CantAcceptCardFromTrainer : gText_CantAcceptNewsFromTrainer; + break; + case 11: + *a0 = 0; + msg = gText_CommunicationError; + break; + case 12: + *a0 = 1; + msg = gText_NewTrainerReceived; + break; + case 13: + *a0 = 1; + break; + case 14: + *a0 = 0; + break; + } + + return msg; +} -- cgit v1.2.3 From 90fb329b70433e75cfd571d8b33df2593d2b7656 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sun, 31 Mar 2019 12:55:27 -0400 Subject: through task_add_00_mystery_gift --- src/mystery_gift.c | 142 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 142 insertions(+) (limited to 'src') diff --git a/src/mystery_gift.c b/src/mystery_gift.c index c8a507355..30aa6f323 100644 --- a/src/mystery_gift.c +++ b/src/mystery_gift.c @@ -27,12 +27,34 @@ void bgid_upload_textbox_1(u8 bgId); void task_add_00_mystery_gift(void); +void task00_mystery_gift(u8 taskId); EWRAM_DATA u8 gUnknown_02022C58[2] = {}; const u16 gUnkTextboxBorderPal[] = INCBIN_U16("graphics/interface/unk_textbox_border.gbapal"); const u32 gUnkTextboxBorderGfx[] = INCBIN_U32("graphics/interface/unk_textbox_border.4bpp.lz"); +struct MysteryGiftExtraData +{ + u8 filler_00[0x40]; +}; + +struct MysteryGiftTaskData +{ + u16 unk0; + u16 unk2; + u16 unk4; + u16 unk6; + u8 unk8; + u8 unk9; + u8 unkA; + u8 unkB; + u8 unkC; + u8 unkD; + u8 unkE; + struct MysteryGiftExtraData * unk10; +}; + const struct BgTemplate gUnknown_082F0598[] = { { .bg = 0, @@ -988,3 +1010,123 @@ const u8 * mevent_message(u32 * a0, u8 a1, u8 a2, u32 a3) return msg; } + +bool32 mevent_08142CE8(u8 * state, const u8 * arg1, u16 * arg2) +{ + switch (*state) + { + case 0: + if (arg1 != NULL) + { + sub_8018884(arg1); + } + PlayFanfare(MUS_FANFA4); + *arg2 = 0; + (*state)++; + break; + case 1: + if (++(*arg2) > 0xF0) + { + (*state)++; + } + break; + case 2: + if (IsFanfareTaskInactive()) + { + *state = 0; + sub_80188DC(); + return TRUE; + } + break; + } + return FALSE; +} + +const u8 * mevent_message_stamp_card_etc_send_status(u32 * a0, u8 unused, u32 state) +{ + const u8 * result = gText_CommunicationError; + *a0 = 0; + switch (state) + { + case 0: + result = gText_NothingSentOver; + break; + case 1: + result = gText_RecordUploadedViaWireless; + break; + case 2: + result = gText_WonderCardSentTo; + *a0 = 1; + break; + case 3: + result = gText_WonderNewsSentTo; + *a0 = 1; + break; + case 4: + result = gText_StampSentTo; + break; + case 5: + result = gText_OtherTrainerHasCard; + break; + case 6: + result = gText_OtherTrainerHasStamp; + break; + case 7: + result = gText_OtherTrainerHasNews; + break; + case 8: + result = gText_NoMoreRoomForStamps; + break; + case 9: + result = gText_OtherTrainerCanceled; + break; + case 10: + result = gText_CantSendGiftToTrainer; + break; + case 11: + result = gText_CommunicationError; + break; + case 12: + result = gText_GiftSentTo; + break; + case 13: + result = gText_GiftSentTo; + break; + case 14: + result = gText_CantSendGiftToTrainer; + break; + } + return result; +} + +bool32 sub_8019174(u8 * state_p, u16 * arg1, u8 arg2, u32 state) +{ + u32 flag; + const u8 * str = mevent_message_stamp_card_etc_send_status(&flag, arg2, state); + if (flag) + { + return mevent_08142CE8(state_p, str, arg1); + } + else + { + return mevent_0814257C(state_p, str); + } +} + +void task_add_00_mystery_gift(void) +{ + u8 taskId = CreateTask(task00_mystery_gift, 0); + struct MysteryGiftTaskData * data = (void *)gTasks[taskId].data; + data->unk8 = 0; + data->unk9 = 0; + data->unkA = 0; + data->unkB = 0; + data->unkC = 0; + data->unkD = 0; + data->unk0 = 0; + data->unk2 = 0; + data->unk4 = 0; + data->unk6 = 0; + data->unkE = 0; + data->unk10 = AllocZeroed(sizeof(*data->unk10)); +} -- cgit v1.2.3 From 0a8427c8effeefc58c542f249d7384648585ff4a Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sun, 31 Mar 2019 15:50:25 -0400 Subject: fakematching task00_mystery_gift --- src/mevent_801BAAC.c | 2 +- src/mystery_gift.c | 580 ++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 571 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/mevent_801BAAC.c b/src/mevent_801BAAC.c index d69ab0495..b9931a682 100644 --- a/src/mevent_801BAAC.c +++ b/src/mevent_801BAAC.c @@ -724,7 +724,7 @@ void sub_801CC80(void) } } -u8 sub_801CCD0(u16 input) +u32 sub_801CCD0(u16 input) { if (gUnknown_02022C78->unk_01C2_0) { diff --git a/src/mystery_gift.c b/src/mystery_gift.c index 30aa6f323..5e000a249 100644 --- a/src/mystery_gift.c +++ b/src/mystery_gift.c @@ -24,6 +24,12 @@ #include "mevent.h" #include "mevent_801BAAC.h" #include "save.h" +#include "link.h" +#include "mevent_server_ish.h" +#include "event_data.h" +#include "link_rfu.h" +#include "mevent_news.h" +#include "mevent_server.h" void bgid_upload_textbox_1(u8 bgId); void task_add_00_mystery_gift(void); @@ -34,11 +40,6 @@ EWRAM_DATA u8 gUnknown_02022C58[2] = {}; const u16 gUnkTextboxBorderPal[] = INCBIN_U16("graphics/interface/unk_textbox_border.gbapal"); const u32 gUnkTextboxBorderGfx[] = INCBIN_U32("graphics/interface/unk_textbox_border.4bpp.lz"); -struct MysteryGiftExtraData -{ - u8 filler_00[0x40]; -}; - struct MysteryGiftTaskData { u16 unk0; @@ -52,7 +53,7 @@ struct MysteryGiftTaskData u8 unkC; u8 unkD; u8 unkE; - struct MysteryGiftExtraData * unk10; + u8 * unk10; }; const struct BgTemplate gUnknown_082F0598[] = { @@ -623,7 +624,7 @@ bool32 sub_8018A1C(u8 * counter, const u8 * str) } } -s32 sub_8018A50(u8 * unused0, u8 * unused1, bool8 r2) +u32 sub_8018A50(u8 * unused0, u16 * unused1, bool8 r2) { struct ListMenuTemplate listMenuTemplate = gUnknown_082F0638; struct WindowTemplate windowTemplate = gUnknown_082F05E0; @@ -661,7 +662,7 @@ s32 sub_8018A50(u8 * unused0, u8 * unused1, bool8 r2) return r4; } -s32 sub_8018B08(u8 * textState, u16 * windowId, bool8 r6, const u8 * str) +s8 sub_8018B08(u8 * textState, u16 * windowId, bool8 r6, const u8 * str) { struct WindowTemplate windowTemplate; s8 input; @@ -886,7 +887,7 @@ bool32 sub_8018E20(bool32 arg0, bool32 arg1) } } -s8 sub_8018E50(u8 * textState, u16 * windowId, bool32 r2) +s32 sub_8018E50(u8 * textState, u16 * windowId, bool32 r2) { if (r2 == 0) { @@ -1128,5 +1129,564 @@ void task_add_00_mystery_gift(void) data->unk4 = 0; data->unk6 = 0; data->unkE = 0; - data->unk10 = AllocZeroed(sizeof(*data->unk10)); + data->unk10 = AllocZeroed(0x40); +} + +void task00_mystery_gift(u8 taskId) +{ + struct MysteryGiftTaskData * data = (void *)gTasks[taskId].data; + u32 sp0; + const u8 * r1; + + switch (data->unk8) + { + case 0: + data->unk8 = 1; + break; + case 1: + switch (sub_8018A50(&data->unk9, &data->unk0, FALSE)) + { + case 0: + data->unkC = 0; + if (sub_801B27C() == TRUE) + { + data->unk8 = 18; + } + else + { + data->unk8 = 2; + } + break; + case 1: + data->unkC = 1; + if (sub_801B0CC() == TRUE) + { + data->unk8 = 18; + } + else + { + data->unk8 = 2; + } + break; + case -2u: + data->unk8 = 37; + break; + } + break; + case 2: + { + if (data->unkC == 0) + { + if (mevent_0814257C(&data->unk9, gText_DontHaveCardNewOneInput)) + { + data->unk8 = 3; + sub_80186EC(0, 1); + } + } + else + { + if (mevent_0814257C(&data->unk9, gText_DontHaveNewsNewOneInput)) + { + data->unk8 = 3; + sub_80186EC(0, 1); + } + } + break; + } + case 3: + if (data->unkC == 0) + { + sub_8018884(gText_WhereShouldCardBeAccessed); + } + else + { + sub_8018884(gText_WhereShouldNewsBeAccessed); + } + data->unk8 = 4; + break; + case 4: + switch (sub_8018A50(&data->unk9, &data->unk0, TRUE)) + { + case 0: + sub_80188DC(); + data->unk8 = 5; + data->unkD = 0; + break; + case 1: + sub_80188DC(); + data->unk8 = 5; + data->unkD = 1; + break; + case -2u: + sub_80188DC(); + if (sub_8018D98(data->unkC)) + { + data->unk8 = 18; + } + else + { + data->unk8 = 0; + sub_80186EC(0, 0); + } + break; + } + break; + case 5: + { + register u8 eos asm("r1"); + gStringVar1[0] = (eos = EOS); + gStringVar2[0] = eos; + gStringVar3[0] = eos; + } + switch (data->unkC) + { + case 0: + if (data->unkD == 1) + { + sub_8014EFC(0x15); + } + else if (data->unkD == 0) + { + sub_80152A8(0x15); + } + break; + case 1: + if (data->unkD == 1) + { + sub_8014EFC(0x16); + } + else if (data->unkD == 0) + { + sub_80152A8(0x16); + } + break; + } + data->unk8 = 6; + break; + case 6: + if (gReceivedRemoteLinkPlayers != 0) + { + sub_8018838(TRUE); + data->unk8 = 7; + sub_801D484(data->unkC); + } + else if (gSpecialVar_Result == 5) + { + sub_8018838(TRUE); + data->unk8 = 3; + } + break; + case 7: + sub_8018884(gText_Communicating); + data->unk8 = 8; + break; + case 8: + switch (sub_801D4A8(&data->unk0)) + { + case 6: + task_add_05_task_del_08FA224_when_no_RfuFunc(); + data->unkE = data->unk0; + data->unk8 = 13; + break; + case 5: + memcpy(data->unk10, sub_801D4F4(), 0x40); + sub_801D4E4(); + break; + case 3: + data->unk8 = 10; + break; + case 2: + data->unk8 = 9; + break; + case 4: + data->unk8 = 11; + StringCopy(gStringVar1, gLinkPlayers[0].name); + break; + } + break; + case 9: + switch ((u32)sub_8018B08(&data->unk9, &data->unk0, FALSE, sub_801D4F4())) + { + case 0: + sub_801D500(0); + sub_801D4E4(); + data->unk8 = 7; + break; + case 1: + sub_801D500(1); + sub_801D4E4(); + data->unk8 = 7; + break; + case -1u: + sub_801D500(1); + sub_801D4E4(); + data->unk8 = 7; + break; + } + break; + case 10: + if (mevent_0814257C(&data->unk9, sub_801D4F4())) + { + sub_801D4E4(); + data->unk8 = 7; + } + break; + case 11: + switch ((u32)sub_8018B08(&data->unk9, &data->unk0, FALSE, gText_ThrowAwayWonderCard)) + { + case 0: + if (sub_801B3F8() == TRUE) + { + data->unk8 = 12; + } + else + { + sub_801D500(0); + sub_801D4E4(); + data->unk8 = 7; + } + break; + case 1: + sub_801D500(1); + sub_801D4E4(); + data->unk8 = 7; + break; + case -1u: + sub_801D500(1); + sub_801D4E4(); + data->unk8 = 7; + break; + } + break; + case 12: + switch ((u32)sub_8018B08(&data->unk9, &data->unk0, FALSE, gText_HaventReceivedCardsGift)) + { + case 0: + sub_801D500(0); + sub_801D4E4(); + data->unk8 = 7; + break; + case 1: + sub_801D500(1); + sub_801D4E4(); + data->unk8 = 7; + break; + case -1u: + sub_801D500(1); + sub_801D4E4(); + data->unk8 = 7; + break; + } + break; + case 13: + if (gReceivedRemoteLinkPlayers == 0) + { + sub_800E084(); + data->unk8 = 14; + } + break; + case 14: + if (sub_8018A1C(&data->unk9, gText_CommunicationCompleted)) + { + if (data->unkD == 1) + { + StringCopy(gStringVar1, gLinkPlayers[0].name); + } + data->unk8 = 15; + } + break; + case 15: + { + register bool32 flag asm("r1"); + r1 = mevent_message(&sp0, data->unkC, data->unkD, data->unkE); + if (r1 == NULL) + { + r1 = data->unk10; + } + if (sp0) + { + flag = mevent_08142CE8(&data->unk9, r1, &data->unk0); + } + else + { + flag = mevent_0814257C(&data->unk9, r1); + } + if (flag) + { + if (data->unkE == 3) + { + if (data->unkD == 1) + { + sub_801DB68(1); + } + else + { + sub_801DB68(2); + } + } + if (sp0 == 0) + { + data->unk8 = 0; + sub_80186EC(0, 0); + } + else + { + data->unk8 = 17; + } + } + break; + } + case 16: + if (mevent_0814257C(&data->unk9, gText_CommunicationError)) + { + data->unk8 = 0; + sub_80186EC(0, 0); + } + break; + case 17: + if (mevent_save_game(&data->unk9)) + { + data->unk8 = 18; + } + break; + case 18: + if (sub_8018DAC(&data->unk9, data->unkC)) + { + data->unk8 = 20; + } + break; + case 20: + if (data->unkC == 0) + { + if (({gMain.newKeys & A_BUTTON;})) + { + data->unk8 = 21; + } + if (({gMain.newKeys & B_BUTTON;})) + { + data->unk8 = 27; + } + } + else + { + switch (sub_801CCD0(gMain.newKeys)) + { + case 0: + sub_801CC38(); + data->unk8 = 21; + break; + case 1: + data->unk8 = 27; + break; + } + } + break; + case 21: + { + u32 result; + if (data->unkC == 0) + { + if (sub_801B308()) + { + result = sub_8018C4C(&data->unk9, &data->unk0, data->unkC, FALSE); + } + else + { + result = sub_8018C4C(&data->unk9, &data->unk0, data->unkC, TRUE); + } + } + else + { + if (sub_801B128()) + { + result = sub_8018C4C(&data->unk9, &data->unk0, data->unkC, FALSE); + } + else + { + result = sub_8018C4C(&data->unk9, &data->unk0, data->unkC, TRUE); + } + } + switch (result) + { + case 0: + data->unk8 = 28; + break; + case 1: + data->unk8 = 29; + break; + case 2: + data->unk8 = 22; + break; + case -2u: + if (data->unkC == 1) + { + sub_801CC80(); + } + data->unk8 = 20; + break; + } + break; + } + case 22: + switch (sub_8018E50(&data->unk9, &data->unk0, data->unkC)) + { + case 0: + if (data->unkC == 0 && sub_801B3F8() == TRUE) + { + data->unk8 = 23; + } + else + { + data->unk8 = 24; + } + break; + case 1: + data->unk8 = 21; + break; + case -1: + data->unk8 = 21; + break; + } + break; + case 23: + switch ((u32)sub_8018B08(&data->unk9, &data->unk0, TRUE, gText_HaventReceivedGiftOkayToDiscard)) + { + case 0: + data->unk8 = 24; + break; + case 1: + data->unk8 = 21; + break; + case -1u: + data->unk8 = 21; + break; + } + break; + case 24: + if (sub_8018E20(data->unkC, 1)) + { + sub_8018E08(data->unkC); + data->unk8 = 25; + } + break; + case 25: + if (mevent_save_game(&data->unk9)) + { + data->unk8 = 26; + } + break; + case 26: + if (mevent_message_was_thrown_away(&data->unk9, data->unkC)) + { + data->unk8 = 0; + sub_80186EC(0, 0); + } + break; + case 27: + if (sub_8018E20(data->unkC, 0)) + { + data->unk8 = 0; + } + break; + case 28: + if (sub_8018E20(data->unkC, 1)) + { + data->unk8 = 3; + } + break; + case 29: + if (sub_8018E20(data->unkC, 1)) + { + switch (data->unkC) + { + case 0: + sub_8014A00(21); + break; + case 1: + sub_8014A00(22); + break; + } + data->unkD = 1; + data->unk8 = 30; + } + break; + case 30: + if (gReceivedRemoteLinkPlayers != 0) + { + sub_8018838(1); + data->unk8 = 31; + } + else if (gSpecialVar_Result == 5) + { + sub_8018838(1); + data->unk8 = 18; + } + break; + case 31: + { + register u8 eos asm("r1"); + gStringVar1[0] = (eos = EOS); + gStringVar2[0] = eos; + gStringVar3[0] = eos; + } + if (data->unkC == 0) + { + sub_8018884(gText_SendingWonderCard); + mevent_srv_new_wcard(); + } + else + { + sub_8018884(gText_SendingWonderNews); + mevent_srv_init_wnews(); + } + data->unk8 = 32; + break; + case 32: + if (sub_801D0C4(&data->unk0) == 3) + { + data->unkE = data->unk0; + data->unk8 = 33; + } + break; + case 33: + task_add_05_task_del_08FA224_when_no_RfuFunc(); + StringCopy(gStringVar1, gLinkPlayers[1].name); + data->unk8 = 34; + break; + case 34: + if (gReceivedRemoteLinkPlayers == 0) + { + sub_800E084(); + data->unk8 = 35; + } + break; + case 35: + if (sub_8019174(&data->unk9, &data->unk0, data->unkD, data->unkE)) + { + if (data->unkD == 1 && data->unkE == 3) + { + sub_801DB68(3); + data->unk8 = 17; + } + else + { + data->unk8 = 0; + sub_80186EC(0, 0); + } + } + break; + case 36: + if (mevent_0814257C(&data->unk9, gText_CommunicationError)) + { + data->unk8 = 0; + sub_80186EC(0, 0); + } + break; + case 37: + CloseLink(); + Free(data->unk10); + DestroyTask(taskId); + SetMainCallback2(sub_80186A4); + break; + } } -- cgit v1.2.3 From ade01833781ee8a8057f2b2945095bababb2e639 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sun, 31 Mar 2019 18:59:52 -0400 Subject: Document mystery_gift --- src/battle_bg.c | 2 +- src/berry_blender.c | 2 +- src/berry_crush.c | 2 +- src/contest_link_80F57C4.c | 2 +- src/easy_chat.c | 2 +- src/ereader_screen.c | 34 +- src/evolution_scene.c | 2 +- src/international_string_util.c | 2 +- src/link_rfu.c | 6 +- src/list_menu.c | 2 +- src/main_menu.c | 3 +- src/menu.c | 2 +- src/mevent2.c | 46 +-- src/mevent_801BAAC.c | 380 +++++++++---------- src/mevent_news.c | 4 +- src/mystery_event_menu.c | 2 +- src/mystery_gift.c | 747 +++++++++++++++++++------------------- src/pokemon_storage_system.c | 2 +- src/script.c | 2 +- src/script_pokemon_util_80F87D8.c | 2 +- src/start_menu.c | 4 +- src/text_window.c | 4 +- src/trade.c | 10 +- src/union_room.c | 86 ++--- src/union_room_chat.c | 8 +- src/use_pokeblock.c | 6 +- 26 files changed, 688 insertions(+), 676 deletions(-) (limited to 'src') diff --git a/src/battle_bg.c b/src/battle_bg.c index 524f73abf..814e8dad9 100644 --- a/src/battle_bg.c +++ b/src/battle_bg.c @@ -709,7 +709,7 @@ void LoadBattleMenuWindowGfx(void) if (gBattleTypeFlags & BATTLE_TYPE_ARENA) { - sub_81978B0(0x70); + Menu_LoadStdPalAt(0x70); LoadMessageBoxGfx(0, 0x30, 0x70); gPlttBufferUnfaded[0x76] = 0; CpuCopy16(&gPlttBufferUnfaded[0x76], &gPlttBufferFaded[0x76], 2); diff --git a/src/berry_blender.c b/src/berry_blender.c index c792b9b40..26327a634 100644 --- a/src/berry_blender.c +++ b/src/berry_blender.c @@ -940,7 +940,7 @@ static void InitBerryBlenderWindows(void) FillWindowPixelBuffer(i, PIXEL_FILL(0)); FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 0x1E, 0x14); - sub_81978B0(0xE0); + Menu_LoadStdPalAt(0xE0); } } diff --git a/src/berry_crush.c b/src/berry_crush.c index dc4c546b0..51dbe8203 100755 --- a/src/berry_crush.c +++ b/src/berry_crush.c @@ -582,7 +582,7 @@ int sub_802130C(void) ClearGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_OBJ_ON | DISPCNT_OBJ_1D_MAP); break; case 6: - sub_800E084(); + DestroyWirelessStatusIndicatorSprite(); sub_8022960(var0); sub_8034CC8(); break; diff --git a/src/contest_link_80F57C4.c b/src/contest_link_80F57C4.c index a4b88c074..59f41d72a 100644 --- a/src/contest_link_80F57C4.c +++ b/src/contest_link_80F57C4.c @@ -778,7 +778,7 @@ static void sub_80F677C(u8 taskId) if (!gReceivedRemoteLinkPlayers) { if (gIsLinkContest & 0x2) - sub_800E084(); + DestroyWirelessStatusIndicatorSprite(); sub_80F7144(); gTasks[taskId].func = sub_80F67C4; diff --git a/src/easy_chat.c b/src/easy_chat.c index 2e384de6e..1cb7b0fe8 100644 --- a/src/easy_chat.c +++ b/src/easy_chat.c @@ -3721,7 +3721,7 @@ static void sub_811D0BC(void) { FillBgTilemapBufferRect(0, 0, 0, 0, 32, 20, 17); LoadUserWindowBorderGfx(1, 1, 0xE0); - sub_8098858(1, 1, 14); + DrawTextBorderOuter(1, 1, 14); sub_811D104(0); PutWindowTilemap(1); CopyBgTilemapBufferToVram(0); diff --git a/src/ereader_screen.c b/src/ereader_screen.c index 10a23e251..bac29cd42 100755 --- a/src/ereader_screen.c +++ b/src/ereader_screen.c @@ -4,7 +4,7 @@ #include "ereader_helpers.h" #include "link.h" #include "main.h" -#include "union_room.h" +#include "mystery_gift.h" #include "save.h" #include "sound.h" #include "sprite.h" @@ -209,7 +209,7 @@ static u32 sub_81D4EE4(u8 *arg0, u16 *arg1) return 0; } -void sub_81D5014(void) +void task_add_00_ereader(void) { int value; struct Unk81D5014 *data; @@ -251,7 +251,7 @@ static void sub_81D5084(u8 taskId) switch (data->unk8) { case 0: - if (mevent_0814257C(&data->unk9, gUnknown_085EDFD6)) + if (MG_PrintTextOnWindow1AndWaitButton(&data->unk9, gUnknown_085EDFD6)) data->unk8 = 1; break; case 1: @@ -275,9 +275,9 @@ static void sub_81D5084(u8 taskId) } break; case 4: - if (mevent_0814257C(&data->unk9, gUnknown_085EDFF5)) + if (MG_PrintTextOnWindow1AndWaitButton(&data->unk9, gUnknown_085EDFF5)) { - sub_8018884(gUnknown_085EE014); + AddTextPrinterToWindow1(gUnknown_085EE014); sub_81D505C(&data->unk0); data->unk8 = 5; } @@ -324,11 +324,11 @@ static void sub_81D5084(u8 taskId) } break; case 7: - if (mevent_0814257C(&data->unk9, gUnknown_085EE05C)) + if (MG_PrintTextOnWindow1AndWaitButton(&data->unk9, gUnknown_085EE05C)) data->unk8 = 4; break; case 8: - sub_8018884(gUnknown_085EE097); + AddTextPrinterToWindow1(gUnknown_085EE097); // XXX: This (u32*) cast is discarding the const qualifier from gUnknown_089A3470 sub_81D4D50(&gUnknown_03006370, gMultiBootProgram_BerryGlitchFix_Start - gUnknown_089A3470, (u32*)gUnknown_089A3470); data->unk8 = 9; @@ -347,7 +347,7 @@ static void sub_81D5084(u8 taskId) else if (data->unkE == 1) { sub_81D505C(&data->unk0); - sub_8018884(gUnknown_085EE120); + AddTextPrinterToWindow1(gUnknown_085EE120); data->unk8 = 11; } else @@ -361,7 +361,7 @@ static void sub_81D5084(u8 taskId) break; case 12: sub_81D4E30(); - sub_8018884(gUnknown_085EE0DC); + AddTextPrinterToWindow1(gUnknown_085EE0DC); data->unk8 = 13; break; case 13: @@ -370,7 +370,7 @@ static void sub_81D5084(u8 taskId) case 0: break; case 2: - sub_8018884(gUnknown_085EE097); + AddTextPrinterToWindow1(gUnknown_085EE097); data->unk8 = 14; break; case 1: @@ -418,7 +418,7 @@ static void sub_81D5084(u8 taskId) case 17: if (sub_81D3AB0((struct Unk81D38FC *)&gDecompressionBuffer)) { - sub_8018884(gUnknown_085EE0FA); + AddTextPrinterToWindow1(gUnknown_085EE0FA); sub_81D505C(&data->unk0); data->unk8 = 18; } @@ -430,7 +430,7 @@ static void sub_81D5084(u8 taskId) case 18: if (sub_81D5064(&data->unk0, 120)) { - sub_8018884(gUnknown_085EE107); + AddTextPrinterToWindow1(gUnknown_085EE107); PlayFanfare(MUS_FANFA4); data->unk8 = 19; } @@ -440,25 +440,25 @@ static void sub_81D5084(u8 taskId) data->unk8 = 26; break; case 23: - if (mevent_0814257C(&data->unk9,gUnknown_085EE06B)) + if (MG_PrintTextOnWindow1AndWaitButton(&data->unk9,gUnknown_085EE06B)) data->unk8 = 26; break; case 20: - if (mevent_0814257C(&data->unk9, gUnknown_085EE0A3)) + if (MG_PrintTextOnWindow1AndWaitButton(&data->unk9, gUnknown_085EE0A3)) data->unk8 = 0; break; case 21: - if (mevent_0814257C(&data->unk9, gUnknown_085EE0BF)) + if (MG_PrintTextOnWindow1AndWaitButton(&data->unk9, gUnknown_085EE0BF)) data->unk8 = 0; break; case 22: - if (mevent_0814257C(&data->unk9, gUnknown_085EE12D)) + if (MG_PrintTextOnWindow1AndWaitButton(&data->unk9, gUnknown_085EE12D)) data->unk8 = 0; break; case 26: Free(data->unk10); DestroyTask(taskId); - SetMainCallback2(sub_80186A4); + SetMainCallback2(MainCB_FreeAllBuffersAndReturnToInitTitleScreen); break; } } diff --git a/src/evolution_scene.c b/src/evolution_scene.c index 4bf7701be..8c4847b8d 100644 --- a/src/evolution_scene.c +++ b/src/evolution_scene.c @@ -1228,7 +1228,7 @@ static void Task_TradeEvolutionScene(u8 taskID) if (!gPaletteFade.active) { if (gWirelessCommType) - sub_800E084(); + DestroyWirelessStatusIndicatorSprite(); Free(GetBgTilemapBuffer(3)); Free(GetBgTilemapBuffer(1)); diff --git a/src/international_string_util.c b/src/international_string_util.c index a7c42c39e..dfeda49e3 100644 --- a/src/international_string_util.c +++ b/src/international_string_util.c @@ -62,7 +62,7 @@ int sub_81DB3D8(const struct MenuAction *str, const u8* arg1, int arg2) return convert_pixel_width_to_tile_width(var); } -int sub_81DB41C(const struct ListMenuTemplate *listMenu) +int Intl_GetListMenuWidth(const struct ListMenuTemplate *listMenu) { int i, maxWidth, finalWidth; const struct ListMenuItem *items = listMenu->items; diff --git a/src/link_rfu.c b/src/link_rfu.c index 43d19be03..a430f6e24 100644 --- a/src/link_rfu.c +++ b/src/link_rfu.c @@ -2243,7 +2243,7 @@ void CreateWirelessStatusIndicatorSprite(u8 x, u8 y) } } -void sub_800E084(void) +void DestroyWirelessStatusIndicatorSprite(void) { if (gSprites[gWirelessStatusIndicatorSpriteId].data[7] == 0x1234) { @@ -2356,7 +2356,7 @@ void sub_800E174(void) CpuCopy16(gMain.oamBuffer + 125, (struct OamData *)OAM + 125, sizeof(struct OamData)); if (sub_8011A74() == 1) { - sub_800E084(); + DestroyWirelessStatusIndicatorSprite(); } } } @@ -4209,7 +4209,7 @@ void sub_8010DB4(void) { if (gUnknown_03005000.unk_ee == 1 && gUnknown_03004140.unk_02 == 0) { - if (gMain.callback2 == sub_8018438 || gUnknown_03004140.unk_3c->unk_04) + if (gMain.callback2 == c2_mystery_gift_e_reader_run || gUnknown_03004140.unk_3c->unk_04) gWirelessCommType = 2; SetMainCallback2(CB2_LinkError); gMain.savedCallback = CB2_LinkError; diff --git a/src/list_menu.c b/src/list_menu.c index 3bcd3073d..6d51559f7 100644 --- a/src/list_menu.c +++ b/src/list_menu.c @@ -324,7 +324,7 @@ s32 DoMysteryGiftListMenu(const struct WindowTemplate *windowTemplate, const str case 2: LoadUserWindowBorderGfx(sMysteryGiftLinkMenu.windowId, tileNum, palNum); case 1: - sub_8098858(sMysteryGiftLinkMenu.windowId, tileNum, palNum / 16); + DrawTextBorderOuter(sMysteryGiftLinkMenu.windowId, tileNum, palNum / 16); break; } gMultiuseListMenuTemplate = *listMenuTemplate; diff --git a/src/main_menu.c b/src/main_menu.c index cbd257cb1..8c9612c24 100644 --- a/src/main_menu.c +++ b/src/main_menu.c @@ -38,6 +38,7 @@ #include "text_window.h" #include "title_screen.h" #include "window.h" +#include "mystery_gift.h" /* * Main menu state machine @@ -1083,7 +1084,7 @@ static void Task_HandleMainMenuAPressed(u8 taskId) DestroyTask(taskId); break; case ACTION_EREADER: - SetMainCallback2(sub_801867C); + SetMainCallback2(c2_ereader); DestroyTask(taskId); break; case ACTION_INVALID: diff --git a/src/menu.c b/src/menu.c index b04572b81..958788b25 100644 --- a/src/menu.c +++ b/src/menu.c @@ -432,7 +432,7 @@ void sub_819789C(void) LoadPalette(gUnknown_0860F074, STD_WINDOW_PALETTE_NUM * 0x10, 0x14); } -void sub_81978B0(u16 offset) +void Menu_LoadStdPalAt(u16 offset) { LoadPalette(gUnknown_0860F074, offset, 0x14); } diff --git a/src/mevent2.c b/src/mevent2.c index 8a6bd9faa..4174c4055 100755 --- a/src/mevent2.c +++ b/src/mevent2.c @@ -14,7 +14,7 @@ static EWRAM_DATA bool32 gUnknown_02022C70 = FALSE; static void sub_801B180(void); -static void sub_801B14C(void); +static void s_DestroyWonderNews(void); static bool32 sub_801B114(const struct MEventBuffer_3120_Sub *data); static bool32 sub_801B2CC(const struct MEventBuffer_32E0_Sub *data); static void sub_801B330(void); @@ -29,7 +29,7 @@ void sub_801AFD8(void) sub_811F8BC(); } -struct MEventBuffer_3120_Sub *sub_801B00C(void) +struct MEventBuffer_3120_Sub *sav1_get_mevent_buffer_0(void) { return &gSaveBlock1Ptr->unk_322C.buffer_000.data; } @@ -54,9 +54,9 @@ u16 *sub_801B058(void) return gSaveBlock1Ptr->unk_322C.unk_338; } -void sub_801B06C(void) +void DestroyWonderNews(void) { - sub_801B14C(); + s_DestroyWonderNews(); } bool32 sub_801B078(const struct MEventBuffer_3120_Sub *src) @@ -64,13 +64,13 @@ bool32 sub_801B078(const struct MEventBuffer_3120_Sub *src) if (!sub_801B114(src)) return FALSE; - sub_801B14C(); + s_DestroyWonderNews(); gSaveBlock1Ptr->unk_322C.buffer_000.data = *src; gSaveBlock1Ptr->unk_322C.buffer_000.crc = CalcCRC16WithTable((void *)&gSaveBlock1Ptr->unk_322C.buffer_000.data, sizeof(struct MEventBuffer_3120_Sub)); return TRUE; } -bool32 sub_801B0CC(void) +bool32 ValidateReceivedWonderNews(void) { if (CalcCRC16WithTable((void *)&gSaveBlock1Ptr->unk_322C.buffer_000.data, sizeof(struct MEventBuffer_3120_Sub)) != gSaveBlock1Ptr->unk_322C.buffer_000.crc) return FALSE; @@ -88,7 +88,7 @@ static bool32 sub_801B114(const struct MEventBuffer_3120_Sub *data) return TRUE; } -bool32 sub_801B128(void) +bool32 WonderNews_Test_Unk_02(void) { const struct MEventBuffer_3120_Sub *data = &gSaveBlock1Ptr->unk_322C.buffer_000.data; if (data->unk_02 == 0) @@ -97,9 +97,9 @@ bool32 sub_801B128(void) return TRUE; } -static void sub_801B14C(void) +static void s_DestroyWonderNews(void) { - CpuFill32(0, sub_801B00C(), sizeof(gSaveBlock1Ptr->unk_322C.buffer_000.data)); + CpuFill32(0, sav1_get_mevent_buffer_0(), sizeof(gSaveBlock1Ptr->unk_322C.buffer_000.data)); gSaveBlock1Ptr->unk_322C.buffer_000.crc = 0; } @@ -113,7 +113,7 @@ bool32 sub_801B1A4(const u8 *src) { const u8 *r5 = (const u8 *)&gSaveBlock1Ptr->unk_322C.buffer_000.data; u32 i; - if (!sub_801B0CC()) + if (!ValidateReceivedWonderNews()) return FALSE; for (i = 0; i < sizeof(struct MEventBuffer_3120_Sub); i++) @@ -125,7 +125,7 @@ bool32 sub_801B1A4(const u8 *src) return TRUE; } -void sub_801B1E8(void) +void DestroyWonderCard(void) { sub_801B330(); sub_801B368(); @@ -143,7 +143,7 @@ bool32 sub_801B21C(const struct MEventBuffer_32E0_Sub *data) if (!sub_801B2CC(data)) return FALSE; - sub_801B1E8(); + DestroyWonderCard(); memcpy(&gSaveBlock1Ptr->unk_322C.buffer_1c0.data, data, sizeof(struct MEventBuffer_32E0_Sub)); gSaveBlock1Ptr->unk_322C.buffer_1c0.crc = CalcCRC16WithTable((void *)&gSaveBlock1Ptr->unk_322C.buffer_1c0.data, sizeof(struct MEventBuffer_32E0_Sub)); r2 = &gSaveBlock1Ptr->unk_322C.buffer_310.data; @@ -152,7 +152,7 @@ bool32 sub_801B21C(const struct MEventBuffer_32E0_Sub *data) return TRUE; } -bool32 sub_801B27C(void) +bool32 ValidateReceivedWonderCard(void) { if (gSaveBlock1Ptr->unk_322C.buffer_1c0.crc != CalcCRC16WithTable((void *)&gSaveBlock1Ptr->unk_322C.buffer_1c0.data, sizeof(struct MEventBuffer_32E0_Sub))) return FALSE; @@ -180,7 +180,7 @@ static bool32 sub_801B2CC(const struct MEventBuffer_32E0_Sub *data) return TRUE; } -bool32 sub_801B308(void) +bool32 WonderCard_Test_Unk_08_6(void) { const struct MEventBuffer_32E0_Sub *data = &gSaveBlock1Ptr->unk_322C.buffer_1c0.data; if (data->unk_08_6 == 0) @@ -201,9 +201,9 @@ static void sub_801B368(void) gSaveBlock1Ptr->unk_322C.buffer_310.crc = 0; } -u16 sub_801B39C(void) +u16 GetWonderCardFlagID(void) { - if (sub_801B27C()) + if (ValidateReceivedWonderCard()) return gSaveBlock1Ptr->unk_322C.buffer_1c0.data.unk_00; return 0; @@ -215,7 +215,7 @@ void sub_801B3C0(struct MEventBuffer_32E0_Sub *buffer) buffer->unk_08_6 = 0; } -static bool32 sub_801B3D8(u16 a0) +static bool32 IsWonderCardFlagIDInValidRange(u16 a0) { if (a0 >= 1000 && a0 < 1020) return TRUE; @@ -247,10 +247,10 @@ static const u16 sMysteryGiftFlags[] = FLAG_UNUSED_MYSTERY_GIFT_0x14D, }; -bool32 sub_801B3F8(void) +bool32 CheckReceivedGiftFromWonderCard(void) { - u16 value = sub_801B39C(); - if (!sub_801B3D8(value)) + u16 value = GetWonderCardFlagID(); + if (!IsWonderCardFlagIDInValidRange(value)) return FALSE; if (FlagGet(sMysteryGiftFlags[value - 1000]) == TRUE) @@ -300,7 +300,7 @@ static bool32 sub_801B4A4(const u16 *data) static int sub_801B4CC(void) { struct MEventBuffer_32E0_Sub *data; - if (!sub_801B27C()) + if (!ValidateReceivedWonderCard()) return 0; data = &gSaveBlock1Ptr->unk_322C.buffer_1c0.data; @@ -353,7 +353,7 @@ void sub_801B580(struct MEventStruct_Unk1442CC *data, bool32 a1) data->unk_10 = 0x0200; } - if (sub_801B27C()) + if (ValidateReceivedWonderCard()) { data->unk_14 = sav1_get_mevent_buffer_1()->unk_00; data->unk_20 = *sav1_get_mevent_buffer_2(); @@ -554,7 +554,7 @@ bool32 sub_801B94C(u16 a0) if (a0 == 0) return FALSE; - if (!sub_801B27C()) + if (!ValidateReceivedWonderCard()) return FALSE; if (gSaveBlock1Ptr->unk_322C.buffer_1c0.data.unk_00 != a0) diff --git a/src/mevent_801BAAC.c b/src/mevent_801BAAC.c index b9931a682..24a999f69 100644 --- a/src/mevent_801BAAC.c +++ b/src/mevent_801BAAC.c @@ -53,7 +53,7 @@ struct UnkStruct_203F3C8 /*045C*/ u8 buffer_045C[0x1000]; }; -EWRAM_DATA struct UnkStruct_203F3C8 * gUnknown_02022C74 = NULL; +EWRAM_DATA struct UnkStruct_203F3C8 * sWonderCardData = NULL; void sub_801BEF8(void); void sub_801C178(u8 whichWindow); @@ -150,40 +150,40 @@ const struct UnkStruct_8467FB8 gUnknown_082F1D60[8] = { {1, 0, 0, 7, gWonderCardBgGfx8, gWonderCardBgTilemap8, gWonderCardBgPal8} }; -bool32 sub_801BAAC(struct MEventBuffer_32E0_Sub * r5, struct MEventBuffer_3430_Sub * r6) +bool32 InitWonderCardResources(struct MEventBuffer_32E0_Sub * r5, struct MEventBuffer_3430_Sub * r6) { if (r5 == NULL || r6 == NULL) return FALSE; - gUnknown_02022C74 = AllocZeroed(sizeof(struct UnkStruct_203F3C8)); - if (gUnknown_02022C74 == NULL) + sWonderCardData = AllocZeroed(sizeof(struct UnkStruct_203F3C8)); + if (sWonderCardData == NULL) return FALSE; - gUnknown_02022C74->unk_0000 = *r5; - gUnknown_02022C74->unk_014C = *r6; - if (gUnknown_02022C74->unk_0000.unk_08_2 >= ARRAY_COUNT(gUnknown_082F1D60)) - gUnknown_02022C74->unk_0000.unk_08_2 = 0; - if (gUnknown_02022C74->unk_0000.unk_08_0 >= ARRAY_COUNT(gUnknown_082F0E18)) - gUnknown_02022C74->unk_0000.unk_08_0 = 0; - if (gUnknown_02022C74->unk_0000.unk_09 > ARRAY_COUNT(gUnknown_02022C74->unk_017D)) - gUnknown_02022C74->unk_0000.unk_09 = 0; - gUnknown_02022C74->unk_0170 = &gUnknown_082F1D60[gUnknown_02022C74->unk_0000.unk_08_2]; + sWonderCardData->unk_0000 = *r5; + sWonderCardData->unk_014C = *r6; + if (sWonderCardData->unk_0000.unk_08_2 >= ARRAY_COUNT(gUnknown_082F1D60)) + sWonderCardData->unk_0000.unk_08_2 = 0; + if (sWonderCardData->unk_0000.unk_08_0 >= ARRAY_COUNT(gUnknown_082F0E18)) + sWonderCardData->unk_0000.unk_08_0 = 0; + if (sWonderCardData->unk_0000.unk_09 > ARRAY_COUNT(sWonderCardData->unk_017D)) + sWonderCardData->unk_0000.unk_09 = 0; + sWonderCardData->unk_0170 = &gUnknown_082F1D60[sWonderCardData->unk_0000.unk_08_2]; return TRUE; } -void sub_801BB48(void) +void DestroyWonderCardResources(void) { - if (gUnknown_02022C74 != NULL) + if (sWonderCardData != NULL) { - *gUnknown_02022C74 = (struct UnkStruct_203F3C8){}; - Free(gUnknown_02022C74); - gUnknown_02022C74 = NULL; + *sWonderCardData = (struct UnkStruct_203F3C8){}; + Free(sWonderCardData); + sWonderCardData = NULL; } } -s32 sub_801BB74(void) +s32 FadeToWonderCardMenu(void) { - if (gUnknown_02022C74 == NULL) + if (sWonderCardData == NULL) return -1; - switch(gUnknown_02022C74->unk_0174) + switch(sWonderCardData->unk_0174) { case 0: BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, 0); @@ -199,19 +199,19 @@ s32 sub_801BB74(void) CopyBgTilemapBufferToVram(0); CopyBgTilemapBufferToVram(1); CopyBgTilemapBufferToVram(2); - decompress_and_copy_tile_data_to_vram(2, gUnknown_02022C74->unk_0170->tiles, 0, 0x008, 0); - gUnknown_02022C74->unk_0176[0] = AddWindow(&gUnknown_082F0E1C[0]); - gUnknown_02022C74->unk_0176[1] = AddWindow(&gUnknown_082F0E1C[1]); - gUnknown_02022C74->unk_0176[2] = AddWindow(&gUnknown_082F0E1C[2]); + decompress_and_copy_tile_data_to_vram(2, sWonderCardData->unk_0170->tiles, 0, 0x008, 0); + sWonderCardData->unk_0176[0] = AddWindow(&gUnknown_082F0E1C[0]); + sWonderCardData->unk_0176[1] = AddWindow(&gUnknown_082F0E1C[1]); + sWonderCardData->unk_0176[2] = AddWindow(&gUnknown_082F0E1C[2]); break; case 3: if (free_temp_tile_data_buffers_if_possible()) return 0; LoadPalette(stdpal_get(1), 0x20, 0x20); gPaletteFade.bufferTransferDisabled = TRUE; - LoadPalette(gUnknown_02022C74->unk_0170->pal, 0x10, 0x20); - LZ77UnCompWram(gUnknown_02022C74->unk_0170->map, gUnknown_02022C74->buffer_045C); - CopyRectToBgTilemapBufferRect(2, gUnknown_02022C74->buffer_045C, 0, 0, 30, 20, 0, 0, 30, 20, 1, 0x008, 0); + LoadPalette(sWonderCardData->unk_0170->pal, 0x10, 0x20); + LZ77UnCompWram(sWonderCardData->unk_0170->map, sWonderCardData->buffer_045C); + CopyRectToBgTilemapBufferRect(2, sWonderCardData->buffer_045C, 0, 0, 30, 20, 0, 0, 30, 20, 1, 0x008, 0); CopyBgTilemapBufferToVram(2); break; case 4: @@ -237,18 +237,18 @@ s32 sub_801BB74(void) default: if (UpdatePaletteFade()) return 0; - gUnknown_02022C74->unk_0174 = 0; + sWonderCardData->unk_0174 = 0; return 1; } - ++gUnknown_02022C74->unk_0174; + ++sWonderCardData->unk_0174; return 0; } -s32 sub_801BDA4(bool32 flag) +s32 FadeOutFromWonderCard(bool32 flag) { - if (gUnknown_02022C74 == NULL) + if (sWonderCardData == NULL) return -1; - switch (gUnknown_02022C74->unk_0174) + switch (sWonderCardData->unk_0174) { case 0: BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, 0); @@ -268,26 +268,26 @@ s32 sub_801BDA4(bool32 flag) case 3: HideBg(1); HideBg(2); - RemoveWindow(gUnknown_02022C74->unk_0176[2]); - RemoveWindow(gUnknown_02022C74->unk_0176[1]); - RemoveWindow(gUnknown_02022C74->unk_0176[0]); + RemoveWindow(sWonderCardData->unk_0176[2]); + RemoveWindow(sWonderCardData->unk_0176[1]); + RemoveWindow(sWonderCardData->unk_0176[0]); break; case 4: sub_801C61C(); FreeMonIconPalettes(); break; case 5: - sub_80186EC(gUnknown_02022C60, flag); + PrintMysteryGiftOrEReaderTopMenu(gGiftIsFromEReader, flag); CopyBgTilemapBufferToVram(0); BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, 0); break; default: if (UpdatePaletteFade()) return 0; - gUnknown_02022C74->unk_0174 = 0; + sWonderCardData->unk_0174 = 0; return 1; } - ++gUnknown_02022C74->unk_0174; + ++sWonderCardData->unk_0174; return 0; } @@ -297,59 +297,59 @@ void sub_801BEF8(void) u16 r6; u16 sp0[3] = {0, 0, 0}; - memcpy(gUnknown_02022C74->unk_018B, gUnknown_02022C74->unk_0000.unk_0A, 40); - gUnknown_02022C74->unk_018B[40] = EOS; - memcpy(gUnknown_02022C74->unk_01B4, gUnknown_02022C74->unk_0000.unk_32, 40); - gUnknown_02022C74->unk_01B4[40] = EOS; - if (gUnknown_02022C74->unk_0000.unk_04 > 999999) - gUnknown_02022C74->unk_0000.unk_04 = 999999; - ConvertIntToDecimalStringN(gUnknown_02022C74->unk_01DD, gUnknown_02022C74->unk_0000.unk_04, STR_CONV_MODE_LEFT_ALIGN, 6); + memcpy(sWonderCardData->unk_018B, sWonderCardData->unk_0000.unk_0A, 40); + sWonderCardData->unk_018B[40] = EOS; + memcpy(sWonderCardData->unk_01B4, sWonderCardData->unk_0000.unk_32, 40); + sWonderCardData->unk_01B4[40] = EOS; + if (sWonderCardData->unk_0000.unk_04 > 999999) + sWonderCardData->unk_0000.unk_04 = 999999; + ConvertIntToDecimalStringN(sWonderCardData->unk_01DD, sWonderCardData->unk_0000.unk_04, STR_CONV_MODE_LEFT_ALIGN, 6); for (i = 0; i < 4; i++) { - memcpy(gUnknown_02022C74->unk_01E4[i], gUnknown_02022C74->unk_0000.unk_5A[i], 40); - gUnknown_02022C74->unk_01E4[i][40] = EOS; + memcpy(sWonderCardData->unk_01E4[i], sWonderCardData->unk_0000.unk_5A[i], 40); + sWonderCardData->unk_01E4[i][40] = EOS; } - memcpy(gUnknown_02022C74->unk_0288, gUnknown_02022C74->unk_0000.unk_FA, 40); - gUnknown_02022C74->unk_0288[40] = EOS; - switch (gUnknown_02022C74->unk_0000.unk_08_0) + memcpy(sWonderCardData->unk_0288, sWonderCardData->unk_0000.unk_FA, 40); + sWonderCardData->unk_0288[40] = EOS; + switch (sWonderCardData->unk_0000.unk_08_0) { case 0: - memcpy(gUnknown_02022C74->unk_02B1, gUnknown_02022C74->unk_0000.unk_122, 40); - gUnknown_02022C74->unk_02B1[40] = EOS; + memcpy(sWonderCardData->unk_02B1, sWonderCardData->unk_0000.unk_122, 40); + sWonderCardData->unk_02B1[40] = EOS; break; case 1: - gUnknown_02022C74->unk_02B1[00] = EOS; + sWonderCardData->unk_02B1[00] = EOS; break; case 2: - gUnknown_02022C74->unk_02B1[00] = EOS; - sp0[0] = gUnknown_02022C74->unk_014C.unk_00 < 999 ? gUnknown_02022C74->unk_014C.unk_00 : 999; - sp0[1] = gUnknown_02022C74->unk_014C.unk_02 < 999 ? gUnknown_02022C74->unk_014C.unk_02 : 999; - sp0[2] = gUnknown_02022C74->unk_014C.unk_04 < 999 ? gUnknown_02022C74->unk_014C.unk_04 : 999; + sWonderCardData->unk_02B1[00] = EOS; + sp0[0] = sWonderCardData->unk_014C.unk_00 < 999 ? sWonderCardData->unk_014C.unk_00 : 999; + sp0[1] = sWonderCardData->unk_014C.unk_02 < 999 ? sWonderCardData->unk_014C.unk_02 : 999; + sp0[2] = sWonderCardData->unk_014C.unk_04 < 999 ? sWonderCardData->unk_014C.unk_04 : 999; for (i = 0; i < 8; i++) { - memset(gUnknown_02022C74->unk_02DC[i].unk_42, EOS, 4); - memset(gUnknown_02022C74->unk_02DC[i].unk_01, EOS, 41); + memset(sWonderCardData->unk_02DC[i].unk_42, EOS, 4); + memset(sWonderCardData->unk_02DC[i].unk_01, EOS, 41); } for (i = 0, r6 = 0; i < 40; i++) { - if (gUnknown_02022C74->unk_0000.unk_122[i] != 0xF7) + if (sWonderCardData->unk_0000.unk_122[i] != 0xF7) { - gUnknown_02022C74->unk_02DC[gUnknown_02022C74->unk_0175].unk_01[r6] = gUnknown_02022C74->unk_0000.unk_122[i]; + sWonderCardData->unk_02DC[sWonderCardData->unk_0175].unk_01[r6] = sWonderCardData->unk_0000.unk_122[i]; r6++; } else { - u8 r3 = gUnknown_02022C74->unk_0000.unk_122[i + 1]; + u8 r3 = sWonderCardData->unk_0000.unk_122[i + 1]; if (r3 > 2) { i += 2; } else { - ConvertIntToDecimalStringN(gUnknown_02022C74->unk_02DC[gUnknown_02022C74->unk_0175].unk_42, sp0[r3], STR_CONV_MODE_LEADING_ZEROS, 3); - gUnknown_02022C74->unk_02DC[gUnknown_02022C74->unk_0175].unk_00 = gUnknown_02022C74->unk_0000.unk_122[i + 2]; - gUnknown_02022C74->unk_0175++; - if (gUnknown_02022C74->unk_0175 > 7) + ConvertIntToDecimalStringN(sWonderCardData->unk_02DC[sWonderCardData->unk_0175].unk_42, sp0[r3], STR_CONV_MODE_LEADING_ZEROS, 3); + sWonderCardData->unk_02DC[sWonderCardData->unk_0175].unk_00 = sWonderCardData->unk_0000.unk_122[i + 2]; + sWonderCardData->unk_0175++; + if (sWonderCardData->unk_0175 > 7) break; r6 = 0; i += 2; @@ -362,7 +362,7 @@ void sub_801BEF8(void) void sub_801C178(u8 whichWindow) { s8 sp0C = 0; - s32 windowId = gUnknown_02022C74->unk_0176[whichWindow]; + s32 windowId = sWonderCardData->unk_0176[whichWindow]; PutWindowTilemap(windowId); FillWindowPixelBuffer(windowId, 0); switch (whichWindow) @@ -370,42 +370,42 @@ void sub_801C178(u8 whichWindow) case 0: { s32 x; - AddTextPrinterParameterized3(windowId, 3, 0, 1, gUnknown_082F0E10[gUnknown_02022C74->unk_0170->textPal1], 0, gUnknown_02022C74->unk_018B); - x = 160 - GetStringWidth(3, gUnknown_02022C74->unk_01B4, GetFontAttribute(3, 2)); + AddTextPrinterParameterized3(windowId, 3, 0, 1, gUnknown_082F0E10[sWonderCardData->unk_0170->textPal1], 0, sWonderCardData->unk_018B); + x = 160 - GetStringWidth(3, sWonderCardData->unk_01B4, GetFontAttribute(3, 2)); if (x < 0) x = 0; - AddTextPrinterParameterized3(windowId, 3, x, 17, gUnknown_082F0E10[gUnknown_02022C74->unk_0170->textPal1], 0, gUnknown_02022C74->unk_01B4); - if (gUnknown_02022C74->unk_0000.unk_04 != 0) + AddTextPrinterParameterized3(windowId, 3, x, 17, gUnknown_082F0E10[sWonderCardData->unk_0170->textPal1], 0, sWonderCardData->unk_01B4); + if (sWonderCardData->unk_0000.unk_04 != 0) { - AddTextPrinterParameterized3(windowId, 1, 166, 17, gUnknown_082F0E10[gUnknown_02022C74->unk_0170->textPal1], 0, gUnknown_02022C74->unk_01DD); + AddTextPrinterParameterized3(windowId, 1, 166, 17, gUnknown_082F0E10[sWonderCardData->unk_0170->textPal1], 0, sWonderCardData->unk_01DD); } break; } case 1: for (; sp0C < 4; sp0C++) { - AddTextPrinterParameterized3(windowId, 3, 0, 16 * sp0C + 2, gUnknown_082F0E10[gUnknown_02022C74->unk_0170->textPal2], 0, gUnknown_02022C74->unk_01E4[sp0C]); + AddTextPrinterParameterized3(windowId, 3, 0, 16 * sp0C + 2, gUnknown_082F0E10[sWonderCardData->unk_0170->textPal2], 0, sWonderCardData->unk_01E4[sp0C]); } break; case 2: - AddTextPrinterParameterized3(windowId, 3, 0, gUnknown_082F0E18[gUnknown_02022C74->unk_0000.unk_08_0], gUnknown_082F0E10[gUnknown_02022C74->unk_0170->textPal3], 0, gUnknown_02022C74->unk_0288); - if (gUnknown_02022C74->unk_0000.unk_08_0 != 2) + AddTextPrinterParameterized3(windowId, 3, 0, gUnknown_082F0E18[sWonderCardData->unk_0000.unk_08_0], gUnknown_082F0E10[sWonderCardData->unk_0170->textPal3], 0, sWonderCardData->unk_0288); + if (sWonderCardData->unk_0000.unk_08_0 != 2) { - AddTextPrinterParameterized3(windowId, 3, 0, 16 + gUnknown_082F0E18[gUnknown_02022C74->unk_0000.unk_08_0], gUnknown_082F0E10[gUnknown_02022C74->unk_0170->textPal3], 0, gUnknown_02022C74->unk_02B1); + AddTextPrinterParameterized3(windowId, 3, 0, 16 + gUnknown_082F0E18[sWonderCardData->unk_0000.unk_08_0], gUnknown_082F0E10[sWonderCardData->unk_0170->textPal3], 0, sWonderCardData->unk_02B1); } else { s32 x = 0; - s32 y = gUnknown_082F0E18[gUnknown_02022C74->unk_0000.unk_08_0] + 16; + s32 y = gUnknown_082F0E18[sWonderCardData->unk_0000.unk_08_0] + 16; s32 spacing = GetFontAttribute(3, 2); - for (; sp0C < gUnknown_02022C74->unk_0175; sp0C++) + for (; sp0C < sWonderCardData->unk_0175; sp0C++) { - AddTextPrinterParameterized3(windowId, 3, x, y, gUnknown_082F0E10[gUnknown_02022C74->unk_0170->textPal3], 0, gUnknown_02022C74->unk_02DC[sp0C].unk_01); - if (gUnknown_02022C74->unk_02DC[sp0C].unk_42[0] != EOS) + AddTextPrinterParameterized3(windowId, 3, x, y, gUnknown_082F0E10[sWonderCardData->unk_0170->textPal3], 0, sWonderCardData->unk_02DC[sp0C].unk_01); + if (sWonderCardData->unk_02DC[sp0C].unk_42[0] != EOS) { - x += GetStringWidth(3, gUnknown_02022C74->unk_02DC[sp0C].unk_01, spacing); - AddTextPrinterParameterized3(windowId, 3, x, y, gUnknown_082F0E10[gUnknown_02022C74->unk_0170->textPal3], 0, gUnknown_02022C74->unk_02DC[sp0C].unk_42); - x += GetStringWidth(3, gUnknown_02022C74->unk_02DC[sp0C].unk_42, spacing) + gUnknown_02022C74->unk_02DC[sp0C].unk_00; + x += GetStringWidth(3, sWonderCardData->unk_02DC[sp0C].unk_01, spacing); + AddTextPrinterParameterized3(windowId, 3, x, y, gUnknown_082F0E10[sWonderCardData->unk_0170->textPal3], 0, sWonderCardData->unk_02DC[sp0C].unk_42); + x += GetStringWidth(3, sWonderCardData->unk_02DC[sp0C].unk_42, spacing) + sWonderCardData->unk_02DC[sp0C].unk_00; } } } @@ -417,24 +417,24 @@ void sub_801C178(u8 whichWindow) void sub_801C4C0(void) { u8 r7 = 0; - gUnknown_02022C74->unk_017C = 0xFF; - if (gUnknown_02022C74->unk_014C.unk_06 != SPECIES_NONE) + sWonderCardData->unk_017C = 0xFF; + if (sWonderCardData->unk_014C.unk_06 != SPECIES_NONE) { - gUnknown_02022C74->unk_017C = sub_80D2D78(sub_80D2E84(gUnknown_02022C74->unk_014C.unk_06), SpriteCallbackDummy, 0xDC, 0x14, 0, FALSE); - gSprites[gUnknown_02022C74->unk_017C].oam.priority = 2; + sWonderCardData->unk_017C = sub_80D2D78(sub_80D2E84(sWonderCardData->unk_014C.unk_06), SpriteCallbackDummy, 0xDC, 0x14, 0, FALSE); + gSprites[sWonderCardData->unk_017C].oam.priority = 2; } - if (gUnknown_02022C74->unk_0000.unk_09 != 0 && gUnknown_02022C74->unk_0000.unk_08_0 == 1) + if (sWonderCardData->unk_0000.unk_09 != 0 && sWonderCardData->unk_0000.unk_08_0 == 1) { LoadCompressedSpriteSheetUsingHeap(&gUnknown_082F1D00); - LoadSpritePalette(&gUnknown_082F1D08[gUnknown_02022C74->unk_0170->textPal4]); - for (; r7 < gUnknown_02022C74->unk_0000.unk_09; r7++) + LoadSpritePalette(&gUnknown_082F1D08[sWonderCardData->unk_0170->textPal4]); + for (; r7 < sWonderCardData->unk_0000.unk_09; r7++) { - gUnknown_02022C74->unk_017D[r7][0] = 0xFF; - gUnknown_02022C74->unk_017D[r7][1] = 0xFF; - gUnknown_02022C74->unk_017D[r7][0] = CreateSprite(&gUnknown_082F1D48, 0xd8 - 32 * r7, 0x90, 8); - if (gUnknown_02022C74->unk_014C.unk_08[0][r7] != 0) + sWonderCardData->unk_017D[r7][0] = 0xFF; + sWonderCardData->unk_017D[r7][1] = 0xFF; + sWonderCardData->unk_017D[r7][0] = CreateSprite(&gUnknown_082F1D48, 0xd8 - 32 * r7, 0x90, 8); + if (sWonderCardData->unk_014C.unk_08[0][r7] != 0) { - gUnknown_02022C74->unk_017D[r7][1] = sub_80D2D78(sub_80D2E84(gUnknown_02022C74->unk_014C.unk_08[0][r7]), SpriteCallbackDummy, 0xd8 - 32 * r7, 0x88, 0, 0); + sWonderCardData->unk_017D[r7][1] = sub_80D2D78(sub_80D2E84(sWonderCardData->unk_014C.unk_08[0][r7]), SpriteCallbackDummy, 0xd8 - 32 * r7, 0x88, 0, 0); } } } @@ -443,19 +443,19 @@ void sub_801C4C0(void) void sub_801C61C(void) { u8 r6 = 0; - if (gUnknown_02022C74->unk_017C != 0xFF) - sub_80D2EF8(&gSprites[gUnknown_02022C74->unk_017C]); - if (gUnknown_02022C74->unk_0000.unk_09 != 0 && gUnknown_02022C74->unk_0000.unk_08_0 == 1) + if (sWonderCardData->unk_017C != 0xFF) + sub_80D2EF8(&gSprites[sWonderCardData->unk_017C]); + if (sWonderCardData->unk_0000.unk_09 != 0 && sWonderCardData->unk_0000.unk_08_0 == 1) { - for (; r6 < gUnknown_02022C74->unk_0000.unk_09; r6++) + for (; r6 < sWonderCardData->unk_0000.unk_09; r6++) { - if (gUnknown_02022C74->unk_017D[r6][0] != 0xFF) + if (sWonderCardData->unk_017D[r6][0] != 0xFF) { - DestroySprite(&gSprites[gUnknown_02022C74->unk_017D[r6][0]]); + DestroySprite(&gSprites[sWonderCardData->unk_017D[r6][0]]); } - if (gUnknown_02022C74->unk_017D[r6][1] != 0xFF) + if (sWonderCardData->unk_017D[r6][1] != 0xFF) { - sub_80D2EF8(&gSprites[gUnknown_02022C74->unk_017D[r6][1]]); + sub_80D2EF8(&gSprites[sWonderCardData->unk_017D[r6][1]]); } } FreeSpriteTilesByTag(0x8000); @@ -484,7 +484,7 @@ struct UnkStruct_203F3CC /*03a4*/ u8 buffer_03A4[0x1000]; }; -EWRAM_DATA struct UnkStruct_203F3CC * gUnknown_02022C78 = NULL; +EWRAM_DATA struct UnkStruct_203F3CC * sWonderNewsData = NULL; void sub_801CDCC(void); void sub_801CE7C(void); @@ -542,37 +542,37 @@ const struct UnkStruct_8467FB8 gUnknown_082F24C8[] = { {1, 0, 0, 0, gWonderNewsGfx8, gWonderNewsTilemap8, gWonderNewsPal8} }; -bool32 sub_801C6C8(const struct MEventBuffer_3120_Sub * a0) +bool32 InitWonderNewsResources(const struct MEventBuffer_3120_Sub * a0) { if (a0 == NULL) return FALSE; - gUnknown_02022C78 = AllocZeroed(sizeof(struct UnkStruct_203F3CC)); - if (gUnknown_02022C78 == NULL) + sWonderNewsData = AllocZeroed(sizeof(struct UnkStruct_203F3CC)); + if (sWonderNewsData == NULL) return FALSE; - gUnknown_02022C78->unk_0000 = *a0; - if (gUnknown_02022C78->unk_0000.unk_03 >= ARRAY_COUNT(gUnknown_082F24C8)) - gUnknown_02022C78->unk_0000.unk_03 = 0; - gUnknown_02022C78->unk_01BC = &gUnknown_082F24C8[gUnknown_02022C78->unk_0000.unk_03]; - gUnknown_02022C78->unk_01C1 = 0xFF; + sWonderNewsData->unk_0000 = *a0; + if (sWonderNewsData->unk_0000.unk_03 >= ARRAY_COUNT(gUnknown_082F24C8)) + sWonderNewsData->unk_0000.unk_03 = 0; + sWonderNewsData->unk_01BC = &gUnknown_082F24C8[sWonderNewsData->unk_0000.unk_03]; + sWonderNewsData->unk_01C1 = 0xFF; return TRUE; } -void sub_801C72C(void) +void DestroyWonderNewsResources(void) { - if (gUnknown_02022C78 != NULL) + if (sWonderNewsData != NULL) { - *gUnknown_02022C78 = (struct UnkStruct_203F3CC){}; - Free(gUnknown_02022C78); - gUnknown_02022C78 = NULL; + *sWonderNewsData = (struct UnkStruct_203F3CC){}; + Free(sWonderNewsData); + sWonderNewsData = NULL; } } -s32 sub_801C758(void) +s32 FadeToWonderNewsMenu(void) { - if (gUnknown_02022C78 == NULL) + if (sWonderNewsData == NULL) return -1; - switch (gUnknown_02022C78->unk_01C0_1) + switch (sWonderNewsData->unk_01C0_1) { case 0: BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, 0); @@ -599,19 +599,19 @@ s32 sub_801C758(void) CopyBgTilemapBufferToVram(1); CopyBgTilemapBufferToVram(2); CopyBgTilemapBufferToVram(3); - decompress_and_copy_tile_data_to_vram(3, gUnknown_02022C78->unk_01BC->tiles, 0, 8, 0); - gUnknown_02022C78->unk_01C8[0] = AddWindow(&gUnknown_082F1DE8[0]); - gUnknown_02022C78->unk_01C8[1] = AddWindow(&gUnknown_082F1DE8[1]); + decompress_and_copy_tile_data_to_vram(3, sWonderNewsData->unk_01BC->tiles, 0, 8, 0); + sWonderNewsData->unk_01C8[0] = AddWindow(&gUnknown_082F1DE8[0]); + sWonderNewsData->unk_01C8[1] = AddWindow(&gUnknown_082F1DE8[1]); break; case 3: if (free_temp_tile_data_buffers_if_possible()) return 0; LoadPalette(stdpal_get(1), 0x20, 0x20); gPaletteFade.bufferTransferDisabled = TRUE; - LoadPalette(gUnknown_02022C78->unk_01BC->pal, 0x10, 0x20); - LZ77UnCompWram(gUnknown_02022C78->unk_01BC->map, gUnknown_02022C78->buffer_03A4); - CopyRectToBgTilemapBufferRect(1, gUnknown_02022C78->buffer_03A4, 0, 0, 30, 3, 0, 0, 30, 3, 1, 8, 0); - CopyRectToBgTilemapBufferRect(3, gUnknown_02022C78->buffer_03A4, 0, 3, 30, 23, 0, 3, 30, 23, 1, 8, 0); + LoadPalette(sWonderNewsData->unk_01BC->pal, 0x10, 0x20); + LZ77UnCompWram(sWonderNewsData->unk_01BC->map, sWonderNewsData->buffer_03A4); + CopyRectToBgTilemapBufferRect(1, sWonderNewsData->buffer_03A4, 0, 0, 30, 3, 0, 0, 30, 3, 1, 8, 0); + CopyRectToBgTilemapBufferRect(3, sWonderNewsData->buffer_03A4, 0, 3, 30, 23, 0, 3, 30, 23, 1, 8, 0); CopyBgTilemapBufferToVram(1); CopyBgTilemapBufferToVram(3); break; @@ -628,26 +628,26 @@ s32 sub_801C758(void) ShowBg(2); ShowBg(3); gPaletteFade.bufferTransferDisabled = FALSE; - gUnknown_02022C78->unk_01C1 = AddScrollIndicatorArrowPair(&gUnknown_02022C78->unk_0394, &gUnknown_02022C78->unk_01C6); + sWonderNewsData->unk_01C1 = AddScrollIndicatorArrowPair(&sWonderNewsData->unk_0394, &sWonderNewsData->unk_01C6); BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, 0); UpdatePaletteFade(); break; default: if (UpdatePaletteFade()) return 0; - gUnknown_02022C78->unk_01C0_1 = 0; + sWonderNewsData->unk_01C0_1 = 0; return 1; } - ++gUnknown_02022C78->unk_01C0_1; + ++sWonderNewsData->unk_01C0_1; return 0; } -s32 sub_801CA50(bool32 flag) +s32 FadeOutFromWonderNews(bool32 flag) { - if (gUnknown_02022C78 == NULL) + if (sWonderNewsData == NULL) return -1; - switch (gUnknown_02022C78->unk_01C0_1) + switch (sWonderNewsData->unk_01C0_1) { case 0: BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, 0); @@ -675,21 +675,21 @@ s32 sub_801CA50(bool32 flag) case 3: HideBg(1); HideBg(2); - RemoveWindow(gUnknown_02022C78->unk_01C8[1]); - RemoveWindow(gUnknown_02022C78->unk_01C8[0]); + RemoveWindow(sWonderNewsData->unk_01C8[1]); + RemoveWindow(sWonderNewsData->unk_01C8[0]); break; case 4: ChangeBgY(2, 0, 0); ChangeBgY(3, 0, 0); - if (gUnknown_02022C78->unk_01C1 != 0xFF) + if (sWonderNewsData->unk_01C1 != 0xFF) { - RemoveScrollIndicatorArrowPair(gUnknown_02022C78->unk_01C1); - gUnknown_02022C78->unk_01C1 = 0xFF; + RemoveScrollIndicatorArrowPair(sWonderNewsData->unk_01C1); + sWonderNewsData->unk_01C1 = 0xFF; } break; case 5: - sub_80186EC(gUnknown_02022C60, flag); - sub_8018798(3); + PrintMysteryGiftOrEReaderTopMenu(gGiftIsFromEReader, flag); + MG_DrawCheckerboardPattern(3); CopyBgTilemapBufferToVram(0); CopyBgTilemapBufferToVram(3); BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, 0); @@ -697,36 +697,36 @@ s32 sub_801CA50(bool32 flag) default: if (UpdatePaletteFade()) return 0; - gUnknown_02022C78->unk_01C0_1 = 0; + sWonderNewsData->unk_01C0_1 = 0; return 1; } - ++gUnknown_02022C78->unk_01C0_1; + ++sWonderNewsData->unk_01C0_1; return 0; } -void sub_801CC38(void) +void MENews_RemoveScrollIndicatorArrowPair(void) { - if (!gUnknown_02022C78->unk_01C0_0 && gUnknown_02022C78->unk_01C1 != 0xFF) + if (!sWonderNewsData->unk_01C0_0 && sWonderNewsData->unk_01C1 != 0xFF) { - RemoveScrollIndicatorArrowPair(gUnknown_02022C78->unk_01C1); - gUnknown_02022C78->unk_01C1 = 0xFF; - gUnknown_02022C78->unk_01C0_0 = TRUE; + RemoveScrollIndicatorArrowPair(sWonderNewsData->unk_01C1); + sWonderNewsData->unk_01C1 = 0xFF; + sWonderNewsData->unk_01C0_0 = TRUE; } } -void sub_801CC80(void) +void MENews_AddScrollIndicatorArrowPair(void) { - if (gUnknown_02022C78->unk_01C0_0) + if (sWonderNewsData->unk_01C0_0) { - gUnknown_02022C78->unk_01C1 = AddScrollIndicatorArrowPair(&gUnknown_02022C78->unk_0394, &gUnknown_02022C78->unk_01C6); - gUnknown_02022C78->unk_01C0_0 = FALSE; + sWonderNewsData->unk_01C1 = AddScrollIndicatorArrowPair(&sWonderNewsData->unk_0394, &sWonderNewsData->unk_01C6); + sWonderNewsData->unk_01C0_0 = FALSE; } } -u32 sub_801CCD0(u16 input) +u32 MENews_GetInput(u16 input) { - if (gUnknown_02022C78->unk_01C2_0) + if (sWonderNewsData->unk_01C2_0) { sub_801CFA4(); return 0xFF; @@ -738,26 +738,26 @@ u32 sub_801CCD0(u16 input) case B_BUTTON: return 1; case DPAD_UP: - if (gUnknown_02022C78->unk_01C6 == 0) + if (sWonderNewsData->unk_01C6 == 0) return 0xFF; - if (gUnknown_02022C78->unk_01C0_0) + if (sWonderNewsData->unk_01C0_0) return 0xFF; - gUnknown_02022C78->unk_01C3_0 = FALSE; + sWonderNewsData->unk_01C3_0 = FALSE; break; case DPAD_DOWN: - if (gUnknown_02022C78->unk_01C6 == gUnknown_02022C78->unk_01C4) + if (sWonderNewsData->unk_01C6 == sWonderNewsData->unk_01C4) return 0xFF; - if (gUnknown_02022C78->unk_01C0_0) + if (sWonderNewsData->unk_01C0_0) return 0xFF; - gUnknown_02022C78->unk_01C3_0 = TRUE; + sWonderNewsData->unk_01C3_0 = TRUE; break; default: return 0xFF; } - gUnknown_02022C78->unk_01C2_0 = TRUE; - gUnknown_02022C78->unk_01C2_1 = 2; - gUnknown_02022C78->unk_01C3_1 = 0; - if (gUnknown_02022C78->unk_01C3_0 == FALSE) + sWonderNewsData->unk_01C2_0 = TRUE; + sWonderNewsData->unk_01C2_1 = 2; + sWonderNewsData->unk_01C3_1 = 0; + if (sWonderNewsData->unk_01C3_0 == FALSE) return 2; else return 3; @@ -766,44 +766,44 @@ u32 sub_801CCD0(u16 input) void sub_801CDCC(void) { u8 i = 0; - memcpy(gUnknown_02022C78->unk_01CE, gUnknown_02022C78->unk_0000.unk_04, 40); - gUnknown_02022C78->unk_01CE[40] = EOS; + memcpy(sWonderNewsData->unk_01CE, sWonderNewsData->unk_0000.unk_04, 40); + sWonderNewsData->unk_01CE[40] = EOS; for (; i < 10; ++i) { - memcpy(gUnknown_02022C78->unk_01F7[i], gUnknown_02022C78->unk_0000.unk_2C[i], 40); - gUnknown_02022C78->unk_01F7[i][40] = EOS; - if (i > 7 && gUnknown_02022C78->unk_01F7[i][0] != EOS) - ++gUnknown_02022C78->unk_01C4; + memcpy(sWonderNewsData->unk_01F7[i], sWonderNewsData->unk_0000.unk_2C[i], 40); + sWonderNewsData->unk_01F7[i][40] = EOS; + if (i > 7 && sWonderNewsData->unk_01F7[i][0] != EOS) + ++sWonderNewsData->unk_01C4; } - gUnknown_02022C78->unk_0394 = gUnknown_082F1DF8; - gUnknown_02022C78->unk_0394.fullyDownThreshold = gUnknown_02022C78->unk_01C4; + sWonderNewsData->unk_0394 = gUnknown_082F1DF8; + sWonderNewsData->unk_0394.fullyDownThreshold = sWonderNewsData->unk_01C4; } void sub_801CE7C(void) { u8 i = 0; s32 x; - PutWindowTilemap(gUnknown_02022C78->unk_01C8[0]); - PutWindowTilemap(gUnknown_02022C78->unk_01C8[1]); - FillWindowPixelBuffer(gUnknown_02022C78->unk_01C8[0], 0); - FillWindowPixelBuffer(gUnknown_02022C78->unk_01C8[1], 0); - x = (0xe0 - GetStringWidth(3, gUnknown_02022C78->unk_01CE, GetFontAttribute(3, 2))) / 2; + PutWindowTilemap(sWonderNewsData->unk_01C8[0]); + PutWindowTilemap(sWonderNewsData->unk_01C8[1]); + FillWindowPixelBuffer(sWonderNewsData->unk_01C8[0], 0); + FillWindowPixelBuffer(sWonderNewsData->unk_01C8[1], 0); + x = (0xe0 - GetStringWidth(3, sWonderNewsData->unk_01CE, GetFontAttribute(3, 2))) / 2; if (x < 0) x = 0; - AddTextPrinterParameterized3(gUnknown_02022C78->unk_01C8[0], 3, x, 6, gUnknown_082F1DE0[gUnknown_02022C78->unk_01BC->textPal1], 0, gUnknown_02022C78->unk_01CE); + AddTextPrinterParameterized3(sWonderNewsData->unk_01C8[0], 3, x, 6, gUnknown_082F1DE0[sWonderNewsData->unk_01BC->textPal1], 0, sWonderNewsData->unk_01CE); for (; i < 10; ++i) { - AddTextPrinterParameterized3(gUnknown_02022C78->unk_01C8[1], 3, 0, 16 * i + 2, gUnknown_082F1DE0[gUnknown_02022C78->unk_01BC->textPal2], 0, gUnknown_02022C78->unk_01F7[i]); + AddTextPrinterParameterized3(sWonderNewsData->unk_01C8[1], 3, 0, 16 * i + 2, gUnknown_082F1DE0[sWonderNewsData->unk_01BC->textPal2], 0, sWonderNewsData->unk_01F7[i]); } - CopyWindowToVram(gUnknown_02022C78->unk_01C8[0], 3); - CopyWindowToVram(gUnknown_02022C78->unk_01C8[1], 3); + CopyWindowToVram(sWonderNewsData->unk_01C8[0], 3); + CopyWindowToVram(sWonderNewsData->unk_01C8[1], 3); } void sub_801CFA4(void) { - u16 r4 = gUnknown_02022C78->unk_01C2_1; + u16 r4 = sWonderNewsData->unk_01C2_1; r4 <<= 8; - if (gUnknown_02022C78->unk_01C3_0) + if (sWonderNewsData->unk_01C3_0) { ChangeBgY(2, r4, 1); ChangeBgY(3, r4, 1); @@ -813,14 +813,14 @@ void sub_801CFA4(void) ChangeBgY(2, r4, 2); ChangeBgY(3, r4, 2); } - gUnknown_02022C78->unk_01C3_1 += gUnknown_02022C78->unk_01C2_1; - if (gUnknown_02022C78->unk_01C3_1 > 15) + sWonderNewsData->unk_01C3_1 += sWonderNewsData->unk_01C2_1; + if (sWonderNewsData->unk_01C3_1 > 15) { - if (gUnknown_02022C78->unk_01C3_0) - ++gUnknown_02022C78->unk_01C6; + if (sWonderNewsData->unk_01C3_0) + ++sWonderNewsData->unk_01C6; else - --gUnknown_02022C78->unk_01C6; - gUnknown_02022C78->unk_01C2_0 = FALSE; - gUnknown_02022C78->unk_01C3_1 = 0; + --sWonderNewsData->unk_01C6; + sWonderNewsData->unk_01C2_0 = FALSE; + sWonderNewsData->unk_01C3_1 = 0; } } diff --git a/src/mevent_news.c b/src/mevent_news.c index f5a061c84..192bb0fc7 100644 --- a/src/mevent_news.c +++ b/src/mevent_news.c @@ -10,7 +10,7 @@ static u32 sub_801DD44(struct MysteryEventStruct *); static void sub_801DCD8(struct MysteryEventStruct *); static void sub_801DCCC(struct MysteryEventStruct *); -void sub_801DB68(u32 a0) +void GenerateRandomNews(u32 a0) { struct MysteryEventStruct *r5 = sub_801B044(); @@ -59,7 +59,7 @@ u16 sub_801DC20(void) struct MysteryEventStruct *r4 = sub_801B044(); u16 r5; - if (!IsMysteryEventEnabled() || !sub_801B0CC()) + if (!IsMysteryEventEnabled() || !ValidateReceivedWonderNews()) return 0; r5 = sub_801DD44(r4); diff --git a/src/mystery_event_menu.c b/src/mystery_event_menu.c index ad4a2e692..850b22d5b 100644 --- a/src/mystery_event_menu.c +++ b/src/mystery_event_menu.c @@ -94,7 +94,7 @@ void CB2_InitMysteryEventMenu(void) FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 0x1E, 0x14); LoadUserWindowBorderGfx(0, 1u, 0xD0u); - sub_81978B0(0xE0); + Menu_LoadStdPalAt(0xE0); SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_MODE_0 | DISPCNT_OBJ_1D_MAP | DISPCNT_BG0_ON); SetGpuReg(REG_OFFSET_BLDCNT, 0); CreateTask(Task_DestroySelf, 0); diff --git a/src/mystery_gift.c b/src/mystery_gift.c index 5e000a249..c8b3a9060 100644 --- a/src/mystery_gift.c +++ b/src/mystery_gift.c @@ -35,28 +35,29 @@ void bgid_upload_textbox_1(u8 bgId); void task_add_00_mystery_gift(void); void task00_mystery_gift(u8 taskId); -EWRAM_DATA u8 gUnknown_02022C58[2] = {}; +EWRAM_DATA u8 sDownArrowCounterAndYCoordIdx[8] = {}; +EWRAM_DATA bool8 gGiftIsFromEReader = FALSE; -const u16 gUnkTextboxBorderPal[] = INCBIN_U16("graphics/interface/unk_textbox_border.gbapal"); -const u32 gUnkTextboxBorderGfx[] = INCBIN_U32("graphics/interface/unk_textbox_border.4bpp.lz"); +static const u16 gUnkTextboxBorderPal[] = INCBIN_U16("graphics/interface/unk_textbox_border.gbapal"); +static const u32 gUnkTextboxBorderGfx[] = INCBIN_U32("graphics/interface/unk_textbox_border.4bpp.lz"); struct MysteryGiftTaskData { - u16 unk0; + u16 curPromptWindowId; u16 unk2; u16 unk4; u16 unk6; - u8 unk8; - u8 unk9; + u8 state; + u8 textState; u8 unkA; u8 unkB; - u8 unkC; - u8 unkD; - u8 unkE; - u8 * unk10; + u8 IsCardOrNews; + u8 source; + u8 prevPromptWindowId; + u8 * buffer; }; -const struct BgTemplate gUnknown_082F0598[] = { +static const struct BgTemplate sBGTemplates[] = { { .bg = 0, .charBaseIndex = 2, @@ -92,7 +93,7 @@ const struct BgTemplate gUnknown_082F0598[] = { } }; -const struct WindowTemplate gUnknown_082F05A8[] = { +static const struct WindowTemplate sMainWindows[] = { { .bg = 0x00, .tilemapLeft = 0x00, @@ -122,7 +123,7 @@ const struct WindowTemplate gUnknown_082F05A8[] = { } }; -const struct WindowTemplate gUnknown_082F05C8 = { +static const struct WindowTemplate sWindowTemplate_PromptYesOrNo_Width28 = { .bg = 0x00, .tilemapLeft = 0x01, .tilemapTop = 0x0f, @@ -132,7 +133,7 @@ const struct WindowTemplate gUnknown_082F05C8 = { .baseBlock = 0x00e5 }; -const struct WindowTemplate gUnknown_082F05D0 = { +static const struct WindowTemplate sWindowTemplate_PromptYesOrNo_Width20 = { .bg = 0x00, .tilemapLeft = 0x01, .tilemapTop = 0x0f, @@ -142,7 +143,7 @@ const struct WindowTemplate gUnknown_082F05D0 = { .baseBlock = 0x00e5 }; -const struct WindowTemplate gUnknown_082F05D8 = { +static const struct WindowTemplate sMysteryGiftMenuWindowTemplate = { .bg = 0x00, .tilemapLeft = 0x01, .tilemapTop = 0x0f, @@ -152,7 +153,7 @@ const struct WindowTemplate gUnknown_082F05D8 = { .baseBlock = 0x00e5 }; -const struct WindowTemplate gUnknown_082F05E0 = { +static const struct WindowTemplate sWindowTemplate_ThreeOptions = { .bg = 0x00, .tilemapLeft = 0x08, .tilemapTop = 0x06, @@ -162,7 +163,7 @@ const struct WindowTemplate gUnknown_082F05E0 = { .baseBlock = 0x0155 }; -const struct WindowTemplate gUnknown_082F05E8 = { +static const struct WindowTemplate sWindowTemplate_YesNoBox = { .bg = 0x00, .tilemapLeft = 0x17, .tilemapTop = 0x0f, @@ -172,7 +173,7 @@ const struct WindowTemplate gUnknown_082F05E8 = { .baseBlock = 0x0155 }; -const struct WindowTemplate gUnknown_082F05F0 = { +static const struct WindowTemplate sWindowTemplate_7by8 = { .bg = 0x00, .tilemapLeft = 0x16, .tilemapTop = 0x0b, @@ -182,7 +183,7 @@ const struct WindowTemplate gUnknown_082F05F0 = { .baseBlock = 0x0155 }; -const struct WindowTemplate gUnknown_082F05F8 = { +static const struct WindowTemplate sWindowTemplate_7by6 = { .bg = 0x00, .tilemapLeft = 0x16, .tilemapTop = 0x0d, @@ -192,7 +193,7 @@ const struct WindowTemplate gUnknown_082F05F8 = { .baseBlock = 0x0155 }; -const struct WindowTemplate gUnknown_082F0600 = { +static const struct WindowTemplate sWindowTemplate_7by4 = { .bg = 0x00, .tilemapLeft = 0x16, .tilemapTop = 0x0f, @@ -202,19 +203,19 @@ const struct WindowTemplate gUnknown_082F0600 = { .baseBlock = 0x0155 }; -const struct ListMenuItem gUnknown_082F0608[] = { +static const struct ListMenuItem sListMenuItems_CardsOrNews[] = { { gText_WonderCards, 0 }, { gText_WonderNews, 1 }, { gText_Exit3, -2 } }; -const struct ListMenuItem gUnknown_082F0620[] = { +static const struct ListMenuItem sListMenuItems_WirelessOrFriend[] = { { gText_WirelessCommunication, 0 }, { gText_Friend2, 1 }, { gText_Cancel2, -2 } }; -const struct ListMenuTemplate gUnknown_082F0638 = { +static const struct ListMenuTemplate sListMenuTemplate_ThreeOptions = { .items = NULL, .moveCursorFunc = ListMenuDefaultCursorMoveFunc, .itemPrintFunc = NULL, @@ -235,32 +236,32 @@ const struct ListMenuTemplate gUnknown_082F0638 = { .cursorKind = 0 }; -const struct ListMenuItem gUnknown_082F0650[] = { +static const struct ListMenuItem sListMenuItems_ReceiveSendToss[] = { { gText_Receive, 0 }, { gText_Send, 1 }, { gText_Toss, 2 }, { gText_Cancel2, -2 } }; -const struct ListMenuItem gUnknown_082F0670[] = { +static const struct ListMenuItem sListMenuItems_ReceiveToss[] = { { gText_Receive, 0 }, { gText_Toss, 2 }, { gText_Cancel2, -2 } }; -const struct ListMenuItem gUnknown_082F0688[] = { +static const struct ListMenuItem sListMenuItems_ReceiveSend[] = { { gText_Receive, 0 }, { gText_Send, 1 }, { gText_Cancel2, -2 } }; -const struct ListMenuItem gUnknown_082F06A0[] = { +static const struct ListMenuItem sListMenuItems_Receive[] = { { gText_Receive, 0 }, { gText_Cancel2, -2 } }; -const struct ListMenuTemplate gUnknown_082F06B0 = { - .items = gUnknown_082F0650, +static const struct ListMenuTemplate sListMenu_ReceiveSendToss = { + .items = sListMenuItems_ReceiveSendToss, .moveCursorFunc = ListMenuDefaultCursorMoveFunc, .itemPrintFunc = NULL, .totalItems = 4, @@ -280,8 +281,8 @@ const struct ListMenuTemplate gUnknown_082F06B0 = { .cursorKind = 0 }; -const struct ListMenuTemplate gUnknown_082F06C8 = { - .items = gUnknown_082F0670, +static const struct ListMenuTemplate sListMenu_ReceiveToss = { + .items = sListMenuItems_ReceiveToss, .moveCursorFunc = ListMenuDefaultCursorMoveFunc, .itemPrintFunc = NULL, .totalItems = 3, @@ -301,8 +302,8 @@ const struct ListMenuTemplate gUnknown_082F06C8 = { .cursorKind = 0 }; -const struct ListMenuTemplate gUnknown_082F06E0 = { - .items = gUnknown_082F0688, +static const struct ListMenuTemplate sListMenu_ReceiveSend = { + .items = sListMenuItems_ReceiveSend, .moveCursorFunc = ListMenuDefaultCursorMoveFunc, .itemPrintFunc = NULL, .totalItems = 3, @@ -322,8 +323,8 @@ const struct ListMenuTemplate gUnknown_082F06E0 = { .cursorKind = 0 }; -const struct ListMenuTemplate gUnknown_082F06F8 = { - .items = gUnknown_082F06A0, +static const struct ListMenuTemplate sListMenu_Receive = { + .items = sListMenuItems_Receive, .moveCursorFunc = ListMenuDefaultCursorMoveFunc, .itemPrintFunc = NULL, .totalItems = 2, @@ -343,25 +344,25 @@ const struct ListMenuTemplate gUnknown_082F06F8 = { .cursorKind = 0 }; -const u8 *const Unref_082F0710[] = { +static const u8 *const Unref_082F0710[] = { gText_VarietyOfEventsImportedWireless, gText_WonderCardsInPossession, gText_ReadNewsThatArrived, gText_ReturnToTitle }; -ALIGNED(2) const u8 gUnknown_082F0720[] = { 0, 1, 2 }; -ALIGNED(2) const u8 gUnknown_082F0724[] = { 0, 1, 2 }; -ALIGNED(2) const u8 gUnknown_082F0728[] = { 1, 2, 3 }; +ALIGNED(2) const u8 sMG_Ereader_TextColor_1[] = { 0, 1, 2 }; +ALIGNED(2) const u8 sMG_Ereader_TextColor_1_Copy[] = { 0, 1, 2 }; +ALIGNED(2) const u8 sMG_Ereader_TextColor_2[] = { 1, 2, 3 }; -void sub_8018424(void) +void vblankcb_mystery_gift_e_reader_run(void) { ProcessSpriteCopyRequests(); LoadOam(); TransferPlttBuffer(); } -void sub_8018438(void) +void c2_mystery_gift_e_reader_run(void) { RunTasks(); RunTextPrinters(); @@ -369,7 +370,7 @@ void sub_8018438(void) BuildOamBuffer(); } -bool32 sub_8018450(s32 arg) +bool32 HandleMysteryGiftOrEReaderSetup(s32 mg_or_ereader) { switch (gMain.state) { @@ -382,7 +383,7 @@ bool32 sub_8018450(s32 arg) ScanlineEffect_Stop(); ResetBgsAndClearDma3BusyFlags(0); - InitBgsFromTemplates(0, gUnknown_082F0598, ARRAY_COUNT(gUnknown_082F0598)); + InitBgsFromTemplates(0, sBGTemplates, ARRAY_COUNT(sBGTemplates)); ChangeBgX(0, 0, 0); ChangeBgY(0, 0, 0); ChangeBgX(1, 0, 0); @@ -398,7 +399,7 @@ bool32 sub_8018450(s32 arg) SetBgTilemapBuffer(0, Alloc(0x800)); bgid_upload_textbox_1(3); - InitWindows(gUnknown_082F05A8); + InitWindows(sMainWindows); DeactivateAllTextPrinters(); ClearGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_WIN0_ON | DISPCNT_WIN1_ON); SetGpuReg(REG_OFFSET_BLDCNT, 0); @@ -409,14 +410,14 @@ bool32 sub_8018450(s32 arg) case 1: LoadPalette(gUnkTextboxBorderPal, 0, 0x20); LoadPalette(stdpal_get(2), 0xd0, 0x20); - sub_81978B0(0xC0); + Menu_LoadStdPalAt(0xC0); LoadUserWindowBorderGfx(0, 0xA, 0xE0); LoadUserWindowBorderGfx_(0, 0x1, 0xF0); FillBgTilemapBufferRect(0, 0x000, 0, 0, 32, 32, 0x11); FillBgTilemapBufferRect(1, 0x000, 0, 0, 32, 32, 0x11); FillBgTilemapBufferRect(2, 0x000, 0, 0, 32, 32, 0x11); - sub_8018798(3); - sub_80186EC(arg, 0); + MG_DrawCheckerboardPattern(3); + PrintMysteryGiftOrEReaderTopMenu(mg_or_ereader, 0); gMain.state++; break; case 2: @@ -430,7 +431,7 @@ bool32 sub_8018450(s32 arg) ShowBg(0); ShowBg(3); PlayBGM(MUS_RG_OKURIMONO); - SetVBlankCallback(sub_8018424); + SetVBlankCallback(vblankcb_mystery_gift_e_reader_run); EnableInterrupts(INTR_FLAG_VBLANK | INTR_FLAG_VCOUNT | INTR_FLAG_TIMER3 | INTR_FLAG_SERIAL); return TRUE; } @@ -440,28 +441,28 @@ bool32 sub_8018450(s32 arg) void c2_mystery_gift(void) { - if (sub_8018450(0)) + if (HandleMysteryGiftOrEReaderSetup(0)) { - SetMainCallback2(sub_8018438); - gUnknown_02022C60 = FALSE; + SetMainCallback2(c2_mystery_gift_e_reader_run); + gGiftIsFromEReader = FALSE; task_add_00_mystery_gift(); } RunTasks(); } -void sub_801867C(void) +void c2_ereader(void) { - if (sub_8018450(1)) + if (HandleMysteryGiftOrEReaderSetup(1)) { - SetMainCallback2(sub_8018438); - gUnknown_02022C60 = TRUE; - sub_81D5014(); + SetMainCallback2(c2_mystery_gift_e_reader_run); + gGiftIsFromEReader = TRUE; + task_add_00_ereader(); } } -void sub_80186A4(void) +void MainCB_FreeAllBuffersAndReturnToInitTitleScreen(void) { - gUnknown_02022C60 = FALSE; + gGiftIsFromEReader = FALSE; FreeAllWindowBuffers(); Free(GetBgTilemapBuffer(0)); Free(GetBgTilemapBuffer(1)); @@ -470,12 +471,12 @@ void sub_80186A4(void) SetMainCallback2(CB2_InitTitleScreen); } -void sub_80186EC(bool8 isJapanese, bool32 usePickOkCancel) +void PrintMysteryGiftOrEReaderTopMenu(bool8 mg_or_ereader, bool32 usePickOkCancel) { const u8 * header; const u8 * options; FillWindowPixelBuffer(0, 0); - if (!isJapanese) + if (mg_or_ereader == 0) { header = gText_MysteryGift; options = !usePickOkCancel ? gText_PickOKExit : gText_PickOKCancel; @@ -486,18 +487,18 @@ void sub_80186EC(bool8 isJapanese, bool32 usePickOkCancel) options = gJPText_DecideStop; } - AddTextPrinterParameterized4(0, 1, 4, 1, 0, 0, gUnknown_082F0720, -1, header); - AddTextPrinterParameterized4(0, 0, GetStringRightAlignXOffset(0, options, 0xDE), 1, 0, 0, gUnknown_082F0720, -1, options); + AddTextPrinterParameterized4(0, 1, 4, 1, 0, 0, sMG_Ereader_TextColor_1, -1, header); + AddTextPrinterParameterized4(0, 0, GetStringRightAlignXOffset(0, options, 0xDE), 1, 0, 0, sMG_Ereader_TextColor_1, -1, options); CopyWindowToVram(0, 2); PutWindowTilemap(0); } -void sub_8018784(u8 windowId) +void MG_DrawTextBorder(u8 windowId) { - sub_8098858(windowId, 0x01, 0xF); + DrawTextBorderOuter(windowId, 0x01, 0xF); } -void sub_8018798(u32 bg) +void MG_DrawCheckerboardPattern(u32 bg) { s32 i = 0, j; @@ -519,9 +520,9 @@ void sub_8018798(u32 bg) } } -void sub_8018838(bool32 arg) +void ClearScreenInBg0(bool32 ignoreTopTwoRows) { - switch (arg) + switch (ignoreTopTwoRows) { case 0: FillBgTilemapBufferRect(0, 0, 0, 0, 32, 32, 0x11); @@ -533,32 +534,32 @@ void sub_8018838(bool32 arg) CopyBgTilemapBufferToVram(0); } -void sub_8018884(const u8 *str) +void AddTextPrinterToWindow1(const u8 *str) { StringExpandPlaceholders(gStringVar4, str); FillWindowPixelBuffer(1, 0x11); - AddTextPrinterParameterized4(1, 1, 0, 1, 0, 0, gUnknown_082F0728, 0, gStringVar4); - sub_8098858(1, 0x001, 0xF); + AddTextPrinterParameterized4(1, 1, 0, 1, 0, 0, sMG_Ereader_TextColor_2, 0, gStringVar4); + DrawTextBorderOuter(1, 0x001, 0xF); PutWindowTilemap(1); CopyWindowToVram(1, 3); } -void sub_80188DC(void) +static void ClearTextWindow(void) { rbox_fill_rectangle(1); ClearWindowTilemap(1); CopyWindowToVram(1, 1); } -bool32 mevent_0814257C(u8 *textState, const u8 *str) +bool32 MG_PrintTextOnWindow1AndWaitButton(u8 *textState, const u8 *str) { switch (*textState) { case 0: - sub_8018884(str); + AddTextPrinterToWindow1(str); goto inc; case 1: - DrawDownArrow(1, 0xD0, 0x14, 1, FALSE, &gUnknown_02022C58[0], &gUnknown_02022C58[1]); + DrawDownArrow(1, 0xD0, 0x14, 1, FALSE, &sDownArrowCounterAndYCoordIdx[0], &sDownArrowCounterAndYCoordIdx[1]); if (({gMain.newKeys & (A_BUTTON | B_BUTTON);})) { inc: @@ -566,9 +567,9 @@ bool32 mevent_0814257C(u8 *textState, const u8 *str) } break; case 2: - DrawDownArrow(1, 0xD0, 0x14, 1, TRUE, &gUnknown_02022C58[0], &gUnknown_02022C58[1]); + DrawDownArrow(1, 0xD0, 0x14, 1, TRUE, &sDownArrowCounterAndYCoordIdx[0], &sDownArrowCounterAndYCoordIdx[1]); *textState = 0; - sub_80188DC(); + ClearTextWindow(); return TRUE; case 0xFF: *textState = 2; @@ -577,45 +578,45 @@ bool32 mevent_0814257C(u8 *textState, const u8 *str) return FALSE; } -void sub_801898C(void) +static void HideDownArrow(void) { - DrawDownArrow(1, 0xD0, 0x14, 1, FALSE, &gUnknown_02022C58[0], &gUnknown_02022C58[1]); + DrawDownArrow(1, 0xD0, 0x14, 1, FALSE, &sDownArrowCounterAndYCoordIdx[0], &sDownArrowCounterAndYCoordIdx[1]); } -void sub_80189B4(void) +static void ShowDownArrow(void) { - DrawDownArrow(1, 0xD0, 0x14, 1, TRUE, &gUnknown_02022C58[0], &gUnknown_02022C58[1]); + DrawDownArrow(1, 0xD0, 0x14, 1, TRUE, &sDownArrowCounterAndYCoordIdx[0], &sDownArrowCounterAndYCoordIdx[1]); } -bool32 sub_80189DC(u8 * textState) +bool32 unref_HideDownArrowAndWaitButton(u8 * textState) { switch (*textState) { case 0: - sub_801898C(); + HideDownArrow(); if (({gMain.newKeys & (A_BUTTON | B_BUTTON);})) { (*textState)++; } break; case 1: - sub_80189B4(); + ShowDownArrow(); *textState = 0; return TRUE; } return FALSE; } -bool32 sub_8018A1C(u8 * counter, const u8 * str) +static bool32 PrintStringAndWait2Seconds(u8 * counter, const u8 * str) { if (*counter == 0) { - sub_8018884(str); + AddTextPrinterToWindow1(str); } if (++(*counter) > 120) { *counter = 0; - sub_80188DC(); + ClearTextWindow(); return TRUE; } else @@ -624,45 +625,45 @@ bool32 sub_8018A1C(u8 * counter, const u8 * str) } } -u32 sub_8018A50(u8 * unused0, u16 * unused1, bool8 r2) +static u32 MysteryGift_HandleThreeOptionMenu(u8 * unused0, u16 * unused1, u8 whichMenu) { - struct ListMenuTemplate listMenuTemplate = gUnknown_082F0638; - struct WindowTemplate windowTemplate = gUnknown_082F05E0; - s32 r3; - s32 r4; + struct ListMenuTemplate listMenuTemplate = sListMenuTemplate_ThreeOptions; + struct WindowTemplate windowTemplate = sWindowTemplate_ThreeOptions; + s32 width; + s32 response; - if (r2 == FALSE) + if (whichMenu == 0) { - listMenuTemplate.items = gUnknown_082F0608; + listMenuTemplate.items = sListMenuItems_CardsOrNews; } else { - listMenuTemplate.items = gUnknown_082F0620; + listMenuTemplate.items = sListMenuItems_WirelessOrFriend; } - r3 = sub_81DB41C(&listMenuTemplate); - if (r3 & 1) + width = Intl_GetListMenuWidth(&listMenuTemplate); + if (width & 1) { - r3++; + width++; } - windowTemplate.width = r3; - if (r3 < 30) + windowTemplate.width = width; + if (width < 30) { - windowTemplate.tilemapLeft = (30 - r3) / 2; + windowTemplate.tilemapLeft = (30 - width) / 2; } else { windowTemplate.tilemapLeft = 0; } - r4 = DoMysteryGiftListMenu(&windowTemplate, &listMenuTemplate, 1, 0x00A, 0xE0); - if (r4 != -1) + response = DoMysteryGiftListMenu(&windowTemplate, &listMenuTemplate, 1, 0x00A, 0xE0); + if (response != -1) { ClearWindowTilemap(2); CopyWindowToVram(2, 1); } - return r4; + return response; } -s8 sub_8018B08(u8 * textState, u16 * windowId, bool8 r6, const u8 * str) +s8 mevent_message_print_and_prompt_yes_no(u8 * textState, u16 * windowId, bool8 yesNoBoxPlacement, const u8 * str) { struct WindowTemplate windowTemplate; s8 input; @@ -671,24 +672,24 @@ s8 sub_8018B08(u8 * textState, u16 * windowId, bool8 r6, const u8 * str) { case 0: StringExpandPlaceholders(gStringVar4, str); - if (r6 == 0) + if (yesNoBoxPlacement == 0) { - *windowId = AddWindow(&gUnknown_082F05C8); + *windowId = AddWindow(&sWindowTemplate_PromptYesOrNo_Width28); } else { - *windowId = AddWindow(&gUnknown_082F05D0); + *windowId = AddWindow(&sWindowTemplate_PromptYesOrNo_Width20); } FillWindowPixelBuffer(*windowId, 0x11); - AddTextPrinterParameterized4(*windowId, 1, 0, 1, 0, 0, gUnknown_082F0728, 0, gStringVar4); - sub_8098858(*windowId, 0x001, 0x0F); + AddTextPrinterParameterized4(*windowId, 1, 0, 1, 0, 0, sMG_Ereader_TextColor_2, 0, gStringVar4); + DrawTextBorderOuter(*windowId, 0x001, 0x0F); CopyWindowToVram(*windowId, 2); PutWindowTilemap(*windowId); (*textState)++; break; case 1: - windowTemplate = gUnknown_082F05E8; - if (r6 == 0) + windowTemplate = sWindowTemplate_YesNoBox; + if (yesNoBoxPlacement == 0) { windowTemplate.tilemapTop = 9; } @@ -723,7 +724,7 @@ s8 sub_8018B08(u8 * textState, u16 * windowId, bool8 r6, const u8 * str) return -2; } -s32 sub_8018C4C(u8 * textState, u16 * windowId, bool32 r2, bool32 r3) +static s32 HandleMysteryGiftListMenu(u8 * textState, u16 * windowId, bool32 cannotToss, bool32 cannotSend) { struct WindowTemplate windowTemplate; s32 input; @@ -731,7 +732,7 @@ s32 sub_8018C4C(u8 * textState, u16 * windowId, bool32 r2, bool32 r3) switch (*textState) { case 0: - if (r2 == 0) + if (cannotToss == 0) { StringExpandPlaceholders(gStringVar4, gText_WhatToDoWithCards); } @@ -739,36 +740,36 @@ s32 sub_8018C4C(u8 * textState, u16 * windowId, bool32 r2, bool32 r3) { StringExpandPlaceholders(gStringVar4, gText_WhatToDoWithNews); } - *windowId = AddWindow(&gUnknown_082F05D8); + *windowId = AddWindow(&sMysteryGiftMenuWindowTemplate); FillWindowPixelBuffer(*windowId, 0x11); - AddTextPrinterParameterized4(*windowId, 1, 0, 1, 0, 0, gUnknown_082F0728, 0, gStringVar4); - sub_8098858(*windowId, 0x001, 0x0F); + AddTextPrinterParameterized4(*windowId, 1, 0, 1, 0, 0, sMG_Ereader_TextColor_2, 0, gStringVar4); + DrawTextBorderOuter(*windowId, 0x001, 0x0F); CopyWindowToVram(*windowId, 2); PutWindowTilemap(*windowId); (*textState)++; break; case 1: - windowTemplate = gUnknown_082F05E8; - if (r3) + windowTemplate = sWindowTemplate_YesNoBox; + if (cannotSend) { - if (r2 == 0) + if (cannotToss == 0) { - input = DoMysteryGiftListMenu(&gUnknown_082F05F8, &gUnknown_082F06C8, 1, 0x00A, 0xE0); + input = DoMysteryGiftListMenu(&sWindowTemplate_7by6, &sListMenu_ReceiveToss, 1, 0x00A, 0xE0); } else { - input = DoMysteryGiftListMenu(&gUnknown_082F0600, &gUnknown_082F06F8, 1, 0x00A, 0xE0); + input = DoMysteryGiftListMenu(&sWindowTemplate_7by4, &sListMenu_Receive, 1, 0x00A, 0xE0); } } else { - if (r2 == 0) + if (cannotToss == 0) { - input = DoMysteryGiftListMenu(&gUnknown_082F05F0, &gUnknown_082F06B0, 1, 0x00A, 0xE0); + input = DoMysteryGiftListMenu(&sWindowTemplate_7by8, &sListMenu_ReceiveSendToss, 1, 0x00A, 0xE0); } else { - input = DoMysteryGiftListMenu(&gUnknown_082F05F8, &gUnknown_082F06E0, 1, 0x00A, 0xE0); + input = DoMysteryGiftListMenu(&sWindowTemplate_7by6, &sListMenu_ReceiveSend, 1, 0x00A, 0xE0); } } if (input != -1) @@ -793,39 +794,39 @@ s32 sub_8018C4C(u8 * textState, u16 * windowId, bool32 r2, bool32 r3) return -1; } -s32 sub_8018D98(bool32 a0) +static bool32 ValidateCardOrNews(bool32 cardOrNews) { - if (a0 == 0) + if (cardOrNews == 0) { - return sub_801B27C(); + return ValidateReceivedWonderCard(); } else { - return sub_801B0CC(); + return ValidateReceivedWonderNews(); } } -bool32 sub_8018DAC(u8 * state, bool32 arg1) +static bool32 HandleLoadWonderCardOrNews(u8 * state, bool32 cardOrNews) { s32 v0; switch (*state) { case 0: - if (arg1 == 0) + if (cardOrNews == 0) { - sub_801BAAC(sav1_get_mevent_buffer_1(), sav1_get_mevent_buffer_2()); + InitWonderCardResources(sav1_get_mevent_buffer_1(), sav1_get_mevent_buffer_2()); } else { - sub_801C6C8(sub_801B00C()); + InitWonderNewsResources(sav1_get_mevent_buffer_0()); } (*state)++; break; case 1: - if (arg1 == 0) + if (cardOrNews == 0) { - v0 = sub_801BB74(); + v0 = FadeToWonderCardMenu(); check: if (v0 != 0) { @@ -835,7 +836,7 @@ bool32 sub_8018DAC(u8 * state, bool32 arg1) } else { - v0 = sub_801C758(); + v0 = FadeToWonderNewsMenu(); goto check; } done: @@ -846,26 +847,26 @@ bool32 sub_8018DAC(u8 * state, bool32 arg1) return FALSE; } -bool32 sub_8018E08(bool32 arg0) +static bool32 DestroyNewsOrCard(bool32 cardOrNews) { - if (arg0 == 0) + if (cardOrNews == 0) { - sub_801B1E8(); + DestroyWonderCard(); } else { - sub_801B06C(); + DestroyWonderNews(); } return TRUE; } -bool32 sub_8018E20(bool32 arg0, bool32 arg1) +static bool32 TearDownCardOrNews_ReturnToTopMenu(bool32 cardOrNews, bool32 arg1) { - if (arg0 == 0) + if (cardOrNews == 0) { - if (sub_801BDA4(arg1) != 0) + if (FadeOutFromWonderCard(arg1) != 0) { - sub_801BB48(); + DestroyWonderCardResources(); return TRUE; } else @@ -875,9 +876,9 @@ bool32 sub_8018E20(bool32 arg0, bool32 arg1) } else { - if (sub_801CA50(arg1) != 0) + if (FadeOutFromWonderNews(arg1) != 0) { - sub_801C72C(); + DestroyWonderNewsResources(); return TRUE; } else @@ -887,36 +888,36 @@ bool32 sub_8018E20(bool32 arg0, bool32 arg1) } } -s32 sub_8018E50(u8 * textState, u16 * windowId, bool32 r2) +static s32 mevent_message_prompt_discard(u8 * textState, u16 * windowId, bool32 cardOrNews) { - if (r2 == 0) + if (cardOrNews == 0) { - return sub_8018B08(textState, windowId, TRUE, gText_IfThrowAwayCardEventWontHappen); + return mevent_message_print_and_prompt_yes_no(textState, windowId, TRUE, gText_IfThrowAwayCardEventWontHappen); } else { - return sub_8018B08(textState, windowId, TRUE, gText_OkayToDiscardNews); + return mevent_message_print_and_prompt_yes_no(textState, windowId, TRUE, gText_OkayToDiscardNews); } } -bool32 mevent_message_was_thrown_away(u8 * textState, bool32 r1) +static bool32 mevent_message_was_thrown_away(u8 * textState, bool32 cardOrNews) { - if (r1 == 0) + if (cardOrNews == 0) { - return mevent_0814257C(textState, gText_WonderCardThrownAway); + return MG_PrintTextOnWindow1AndWaitButton(textState, gText_WonderCardThrownAway); } else { - return mevent_0814257C(textState, gText_WonderNewsThrownAway); + return MG_PrintTextOnWindow1AndWaitButton(textState, gText_WonderNewsThrownAway); } } -bool32 mevent_save_game(u8 * state) +static bool32 mevent_save_game(u8 * state) { switch (*state) { case 0: - sub_8018884(gText_DataWillBeSaved); + AddTextPrinterToWindow1(gText_DataWillBeSaved); (*state)++; break; case 1: @@ -924,7 +925,7 @@ bool32 mevent_save_game(u8 * state) (*state)++; break; case 2: - sub_8018884(gText_SaveCompletedPressA); + AddTextPrinterToWindow1(gText_SaveCompletedPressA); (*state)++; break; case 3: @@ -935,19 +936,19 @@ bool32 mevent_save_game(u8 * state) break; case 4: *state = 0; - sub_80188DC(); + ClearTextWindow(); return TRUE; } return FALSE; } -const u8 * mevent_message(u32 * a0, u8 a1, u8 a2, u32 a3) +static const u8 * mevent_message(u32 * a0, u8 a1, u8 cardOrNews, u32 msgId) { const u8 * msg = NULL; *a0 = 0; - switch (a3) + switch (msgId) { case 0: *a0 = 0; @@ -959,11 +960,11 @@ const u8 * mevent_message(u32 * a0, u8 a1, u8 a2, u32 a3) break; case 2: *a0 = 1; - msg = a2 == 0 ? gText_WonderCardReceived : gText_WonderCardReceivedFrom; + msg = cardOrNews == 0 ? gText_WonderCardReceived : gText_WonderCardReceivedFrom; break; case 3: *a0 = 1; - msg = a2 == 0 ? gText_WonderNewsReceived : gText_WonderNewsReceivedFrom; + msg = cardOrNews == 0 ? gText_WonderNewsReceived : gText_WonderNewsReceivedFrom; break; case 4: *a0 = 1; @@ -1012,14 +1013,14 @@ const u8 * mevent_message(u32 * a0, u8 a1, u8 a2, u32 a3) return msg; } -bool32 mevent_08142CE8(u8 * state, const u8 * arg1, u16 * arg2) +static bool32 PrintMGSuccessMessage(u8 * state, const u8 * arg1, u16 * arg2) { switch (*state) { case 0: if (arg1 != NULL) { - sub_8018884(arg1); + AddTextPrinterToWindow1(arg1); } PlayFanfare(MUS_FANFA4); *arg2 = 0; @@ -1035,7 +1036,7 @@ bool32 mevent_08142CE8(u8 * state, const u8 * arg1, u16 * arg2) if (IsFanfareTaskInactive()) { *state = 0; - sub_80188DC(); + ClearTextWindow(); return TRUE; } break; @@ -1043,11 +1044,11 @@ bool32 mevent_08142CE8(u8 * state, const u8 * arg1, u16 * arg2) return FALSE; } -const u8 * mevent_message_stamp_card_etc_send_status(u32 * a0, u8 unused, u32 state) +static const u8 * mevent_message_stamp_card_etc_send_status(u32 * a0, u8 unused, u32 msgId) { const u8 * result = gText_CommunicationError; *a0 = 0; - switch (state) + switch (msgId) { case 0: result = gText_NothingSentOver; @@ -1100,17 +1101,17 @@ const u8 * mevent_message_stamp_card_etc_send_status(u32 * a0, u8 unused, u32 st return result; } -bool32 sub_8019174(u8 * state_p, u16 * arg1, u8 arg2, u32 state) +static bool32 PrintMGSendStatus(u8 * state, u16 * arg1, u8 arg2, u32 msgId) { u32 flag; - const u8 * str = mevent_message_stamp_card_etc_send_status(&flag, arg2, state); + const u8 * str = mevent_message_stamp_card_etc_send_status(&flag, arg2, msgId); if (flag) { - return mevent_08142CE8(state_p, str, arg1); + return PrintMGSuccessMessage(state, str, arg1); } else { - return mevent_0814257C(state_p, str); + return MG_PrintTextOnWindow1AndWaitButton(state, str); } } @@ -1118,18 +1119,18 @@ void task_add_00_mystery_gift(void) { u8 taskId = CreateTask(task00_mystery_gift, 0); struct MysteryGiftTaskData * data = (void *)gTasks[taskId].data; - data->unk8 = 0; - data->unk9 = 0; + data->state = 0; + data->textState = 0; data->unkA = 0; data->unkB = 0; - data->unkC = 0; - data->unkD = 0; - data->unk0 = 0; + data->IsCardOrNews = 0; + data->source = 0; + data->curPromptWindowId = 0; data->unk2 = 0; data->unk4 = 0; data->unk6 = 0; - data->unkE = 0; - data->unk10 = AllocZeroed(0x40); + data->prevPromptWindowId = 0; + data->buffer = AllocZeroed(0x40); } void task00_mystery_gift(u8 taskId) @@ -1138,95 +1139,95 @@ void task00_mystery_gift(u8 taskId) u32 sp0; const u8 * r1; - switch (data->unk8) + switch (data->state) { case 0: - data->unk8 = 1; + data->state = 1; break; case 1: - switch (sub_8018A50(&data->unk9, &data->unk0, FALSE)) + switch (MysteryGift_HandleThreeOptionMenu(&data->textState, &data->curPromptWindowId, FALSE)) { case 0: - data->unkC = 0; - if (sub_801B27C() == TRUE) + data->IsCardOrNews = 0; + if (ValidateReceivedWonderCard() == TRUE) { - data->unk8 = 18; + data->state = 18; } else { - data->unk8 = 2; + data->state = 2; } break; case 1: - data->unkC = 1; - if (sub_801B0CC() == TRUE) + data->IsCardOrNews = 1; + if (ValidateReceivedWonderNews() == TRUE) { - data->unk8 = 18; + data->state = 18; } else { - data->unk8 = 2; + data->state = 2; } break; case -2u: - data->unk8 = 37; + data->state = 37; break; } break; case 2: { - if (data->unkC == 0) + if (data->IsCardOrNews == 0) { - if (mevent_0814257C(&data->unk9, gText_DontHaveCardNewOneInput)) + if (MG_PrintTextOnWindow1AndWaitButton(&data->textState, gText_DontHaveCardNewOneInput)) { - data->unk8 = 3; - sub_80186EC(0, 1); + data->state = 3; + PrintMysteryGiftOrEReaderTopMenu(0, 1); } } else { - if (mevent_0814257C(&data->unk9, gText_DontHaveNewsNewOneInput)) + if (MG_PrintTextOnWindow1AndWaitButton(&data->textState, gText_DontHaveNewsNewOneInput)) { - data->unk8 = 3; - sub_80186EC(0, 1); + data->state = 3; + PrintMysteryGiftOrEReaderTopMenu(0, 1); } } break; } case 3: - if (data->unkC == 0) + if (data->IsCardOrNews == 0) { - sub_8018884(gText_WhereShouldCardBeAccessed); + AddTextPrinterToWindow1(gText_WhereShouldCardBeAccessed); } else { - sub_8018884(gText_WhereShouldNewsBeAccessed); + AddTextPrinterToWindow1(gText_WhereShouldNewsBeAccessed); } - data->unk8 = 4; + data->state = 4; break; case 4: - switch (sub_8018A50(&data->unk9, &data->unk0, TRUE)) + switch (MysteryGift_HandleThreeOptionMenu(&data->textState, &data->curPromptWindowId, TRUE)) { case 0: - sub_80188DC(); - data->unk8 = 5; - data->unkD = 0; + ClearTextWindow(); + data->state = 5; + data->source = 0; break; case 1: - sub_80188DC(); - data->unk8 = 5; - data->unkD = 1; + ClearTextWindow(); + data->state = 5; + data->source = 1; break; case -2u: - sub_80188DC(); - if (sub_8018D98(data->unkC)) + ClearTextWindow(); + if (ValidateCardOrNews(data->IsCardOrNews)) { - data->unk8 = 18; + data->state = 18; } else { - data->unk8 = 0; - sub_80186EC(0, 0); + data->state = 0; + PrintMysteryGiftOrEReaderTopMenu(0, 0); } break; } @@ -1238,245 +1239,245 @@ void task00_mystery_gift(u8 taskId) gStringVar2[0] = eos; gStringVar3[0] = eos; } - switch (data->unkC) + switch (data->IsCardOrNews) { case 0: - if (data->unkD == 1) + if (data->source == 1) { - sub_8014EFC(0x15); + MEvent_CreateTask_CardOrNewsWithFriend(0x15); } - else if (data->unkD == 0) + else if (data->source == 0) { - sub_80152A8(0x15); + MEvent_CreateTask_CardOrNewsOverWireless(0x15); } break; case 1: - if (data->unkD == 1) + if (data->source == 1) { - sub_8014EFC(0x16); + MEvent_CreateTask_CardOrNewsWithFriend(0x16); } - else if (data->unkD == 0) + else if (data->source == 0) { - sub_80152A8(0x16); + MEvent_CreateTask_CardOrNewsOverWireless(0x16); } break; } - data->unk8 = 6; + data->state = 6; break; case 6: if (gReceivedRemoteLinkPlayers != 0) { - sub_8018838(TRUE); - data->unk8 = 7; - sub_801D484(data->unkC); + ClearScreenInBg0(TRUE); + data->state = 7; + mevent_srv_ish_do_init(data->IsCardOrNews); } else if (gSpecialVar_Result == 5) { - sub_8018838(TRUE); - data->unk8 = 3; + ClearScreenInBg0(TRUE); + data->state = 3; } break; case 7: - sub_8018884(gText_Communicating); - data->unk8 = 8; + AddTextPrinterToWindow1(gText_Communicating); + data->state = 8; break; case 8: - switch (sub_801D4A8(&data->unk0)) + switch (mevent_srv_ish_do_exec(&data->curPromptWindowId)) { case 6: task_add_05_task_del_08FA224_when_no_RfuFunc(); - data->unkE = data->unk0; - data->unk8 = 13; + data->prevPromptWindowId = data->curPromptWindowId; + data->state = 13; break; case 5: - memcpy(data->unk10, sub_801D4F4(), 0x40); - sub_801D4E4(); + memcpy(data->buffer, mevent_srv_ish_get_buffer(), 0x40); + mevent_srv_ish_inc_flag(); break; case 3: - data->unk8 = 10; + data->state = 10; break; case 2: - data->unk8 = 9; + data->state = 9; break; case 4: - data->unk8 = 11; + data->state = 11; StringCopy(gStringVar1, gLinkPlayers[0].name); break; } break; case 9: - switch ((u32)sub_8018B08(&data->unk9, &data->unk0, FALSE, sub_801D4F4())) + switch ((u32)mevent_message_print_and_prompt_yes_no(&data->textState, &data->curPromptWindowId, FALSE, mevent_srv_ish_get_buffer())) { case 0: - sub_801D500(0); - sub_801D4E4(); - data->unk8 = 7; + mevent_srv_ish_set_param(0); + mevent_srv_ish_inc_flag(); + data->state = 7; break; case 1: - sub_801D500(1); - sub_801D4E4(); - data->unk8 = 7; + mevent_srv_ish_set_param(1); + mevent_srv_ish_inc_flag(); + data->state = 7; break; case -1u: - sub_801D500(1); - sub_801D4E4(); - data->unk8 = 7; + mevent_srv_ish_set_param(1); + mevent_srv_ish_inc_flag(); + data->state = 7; break; } break; case 10: - if (mevent_0814257C(&data->unk9, sub_801D4F4())) + if (MG_PrintTextOnWindow1AndWaitButton(&data->textState, mevent_srv_ish_get_buffer())) { - sub_801D4E4(); - data->unk8 = 7; + mevent_srv_ish_inc_flag(); + data->state = 7; } break; case 11: - switch ((u32)sub_8018B08(&data->unk9, &data->unk0, FALSE, gText_ThrowAwayWonderCard)) + switch ((u32)mevent_message_print_and_prompt_yes_no(&data->textState, &data->curPromptWindowId, FALSE, gText_ThrowAwayWonderCard)) { case 0: - if (sub_801B3F8() == TRUE) + if (CheckReceivedGiftFromWonderCard() == TRUE) { - data->unk8 = 12; + data->state = 12; } else { - sub_801D500(0); - sub_801D4E4(); - data->unk8 = 7; + mevent_srv_ish_set_param(0); + mevent_srv_ish_inc_flag(); + data->state = 7; } break; case 1: - sub_801D500(1); - sub_801D4E4(); - data->unk8 = 7; + mevent_srv_ish_set_param(1); + mevent_srv_ish_inc_flag(); + data->state = 7; break; case -1u: - sub_801D500(1); - sub_801D4E4(); - data->unk8 = 7; + mevent_srv_ish_set_param(1); + mevent_srv_ish_inc_flag(); + data->state = 7; break; } break; case 12: - switch ((u32)sub_8018B08(&data->unk9, &data->unk0, FALSE, gText_HaventReceivedCardsGift)) + switch ((u32)mevent_message_print_and_prompt_yes_no(&data->textState, &data->curPromptWindowId, FALSE, gText_HaventReceivedCardsGift)) { case 0: - sub_801D500(0); - sub_801D4E4(); - data->unk8 = 7; + mevent_srv_ish_set_param(0); + mevent_srv_ish_inc_flag(); + data->state = 7; break; case 1: - sub_801D500(1); - sub_801D4E4(); - data->unk8 = 7; + mevent_srv_ish_set_param(1); + mevent_srv_ish_inc_flag(); + data->state = 7; break; case -1u: - sub_801D500(1); - sub_801D4E4(); - data->unk8 = 7; + mevent_srv_ish_set_param(1); + mevent_srv_ish_inc_flag(); + data->state = 7; break; } break; case 13: if (gReceivedRemoteLinkPlayers == 0) { - sub_800E084(); - data->unk8 = 14; + DestroyWirelessStatusIndicatorSprite(); + data->state = 14; } break; case 14: - if (sub_8018A1C(&data->unk9, gText_CommunicationCompleted)) + if (PrintStringAndWait2Seconds(&data->textState, gText_CommunicationCompleted)) { - if (data->unkD == 1) + if (data->source == 1) { StringCopy(gStringVar1, gLinkPlayers[0].name); } - data->unk8 = 15; + data->state = 15; } break; case 15: { register bool32 flag asm("r1"); - r1 = mevent_message(&sp0, data->unkC, data->unkD, data->unkE); + r1 = mevent_message(&sp0, data->IsCardOrNews, data->source, data->prevPromptWindowId); if (r1 == NULL) { - r1 = data->unk10; + r1 = data->buffer; } if (sp0) { - flag = mevent_08142CE8(&data->unk9, r1, &data->unk0); + flag = PrintMGSuccessMessage(&data->textState, r1, &data->curPromptWindowId); } else { - flag = mevent_0814257C(&data->unk9, r1); + flag = MG_PrintTextOnWindow1AndWaitButton(&data->textState, r1); } if (flag) { - if (data->unkE == 3) + if (data->prevPromptWindowId == 3) { - if (data->unkD == 1) + if (data->source == 1) { - sub_801DB68(1); + GenerateRandomNews(1); } else { - sub_801DB68(2); + GenerateRandomNews(2); } } if (sp0 == 0) { - data->unk8 = 0; - sub_80186EC(0, 0); + data->state = 0; + PrintMysteryGiftOrEReaderTopMenu(0, 0); } else { - data->unk8 = 17; + data->state = 17; } } break; } case 16: - if (mevent_0814257C(&data->unk9, gText_CommunicationError)) + if (MG_PrintTextOnWindow1AndWaitButton(&data->textState, gText_CommunicationError)) { - data->unk8 = 0; - sub_80186EC(0, 0); + data->state = 0; + PrintMysteryGiftOrEReaderTopMenu(0, 0); } break; case 17: - if (mevent_save_game(&data->unk9)) + if (mevent_save_game(&data->textState)) { - data->unk8 = 18; + data->state = 18; } break; case 18: - if (sub_8018DAC(&data->unk9, data->unkC)) + if (HandleLoadWonderCardOrNews(&data->textState, data->IsCardOrNews)) { - data->unk8 = 20; + data->state = 20; } break; case 20: - if (data->unkC == 0) + if (data->IsCardOrNews == 0) { if (({gMain.newKeys & A_BUTTON;})) { - data->unk8 = 21; + data->state = 21; } if (({gMain.newKeys & B_BUTTON;})) { - data->unk8 = 27; + data->state = 27; } } else { - switch (sub_801CCD0(gMain.newKeys)) + switch (MENews_GetInput(gMain.newKeys)) { case 0: - sub_801CC38(); - data->unk8 = 21; + MENews_RemoveScrollIndicatorArrowPair(); + data->state = 21; break; case 1: - data->unk8 = 27; + data->state = 27; break; } } @@ -1484,142 +1485,142 @@ void task00_mystery_gift(u8 taskId) case 21: { u32 result; - if (data->unkC == 0) + if (data->IsCardOrNews == 0) { - if (sub_801B308()) + if (WonderCard_Test_Unk_08_6()) { - result = sub_8018C4C(&data->unk9, &data->unk0, data->unkC, FALSE); + result = HandleMysteryGiftListMenu(&data->textState, &data->curPromptWindowId, data->IsCardOrNews, FALSE); } else { - result = sub_8018C4C(&data->unk9, &data->unk0, data->unkC, TRUE); + result = HandleMysteryGiftListMenu(&data->textState, &data->curPromptWindowId, data->IsCardOrNews, TRUE); } } else { - if (sub_801B128()) + if (WonderNews_Test_Unk_02()) { - result = sub_8018C4C(&data->unk9, &data->unk0, data->unkC, FALSE); + result = HandleMysteryGiftListMenu(&data->textState, &data->curPromptWindowId, data->IsCardOrNews, FALSE); } else { - result = sub_8018C4C(&data->unk9, &data->unk0, data->unkC, TRUE); + result = HandleMysteryGiftListMenu(&data->textState, &data->curPromptWindowId, data->IsCardOrNews, TRUE); } } switch (result) { case 0: - data->unk8 = 28; + data->state = 28; break; case 1: - data->unk8 = 29; + data->state = 29; break; case 2: - data->unk8 = 22; + data->state = 22; break; case -2u: - if (data->unkC == 1) + if (data->IsCardOrNews == 1) { - sub_801CC80(); + MENews_AddScrollIndicatorArrowPair(); } - data->unk8 = 20; + data->state = 20; break; } break; } case 22: - switch (sub_8018E50(&data->unk9, &data->unk0, data->unkC)) + switch (mevent_message_prompt_discard(&data->textState, &data->curPromptWindowId, data->IsCardOrNews)) { case 0: - if (data->unkC == 0 && sub_801B3F8() == TRUE) + if (data->IsCardOrNews == 0 && CheckReceivedGiftFromWonderCard() == TRUE) { - data->unk8 = 23; + data->state = 23; } else { - data->unk8 = 24; + data->state = 24; } break; case 1: - data->unk8 = 21; + data->state = 21; break; case -1: - data->unk8 = 21; + data->state = 21; break; } break; case 23: - switch ((u32)sub_8018B08(&data->unk9, &data->unk0, TRUE, gText_HaventReceivedGiftOkayToDiscard)) + switch ((u32)mevent_message_print_and_prompt_yes_no(&data->textState, &data->curPromptWindowId, TRUE, gText_HaventReceivedGiftOkayToDiscard)) { case 0: - data->unk8 = 24; + data->state = 24; break; case 1: - data->unk8 = 21; + data->state = 21; break; case -1u: - data->unk8 = 21; + data->state = 21; break; } break; case 24: - if (sub_8018E20(data->unkC, 1)) + if (TearDownCardOrNews_ReturnToTopMenu(data->IsCardOrNews, 1)) { - sub_8018E08(data->unkC); - data->unk8 = 25; + DestroyNewsOrCard(data->IsCardOrNews); + data->state = 25; } break; case 25: - if (mevent_save_game(&data->unk9)) + if (mevent_save_game(&data->textState)) { - data->unk8 = 26; + data->state = 26; } break; case 26: - if (mevent_message_was_thrown_away(&data->unk9, data->unkC)) + if (mevent_message_was_thrown_away(&data->textState, data->IsCardOrNews)) { - data->unk8 = 0; - sub_80186EC(0, 0); + data->state = 0; + PrintMysteryGiftOrEReaderTopMenu(0, 0); } break; case 27: - if (sub_8018E20(data->unkC, 0)) + if (TearDownCardOrNews_ReturnToTopMenu(data->IsCardOrNews, 0)) { - data->unk8 = 0; + data->state = 0; } break; case 28: - if (sub_8018E20(data->unkC, 1)) + if (TearDownCardOrNews_ReturnToTopMenu(data->IsCardOrNews, 1)) { - data->unk8 = 3; + data->state = 3; } break; case 29: - if (sub_8018E20(data->unkC, 1)) + if (TearDownCardOrNews_ReturnToTopMenu(data->IsCardOrNews, 1)) { - switch (data->unkC) + switch (data->IsCardOrNews) { case 0: - sub_8014A00(21); + MEvent_CreateTask_Leader(21); break; case 1: - sub_8014A00(22); + MEvent_CreateTask_Leader(22); break; } - data->unkD = 1; - data->unk8 = 30; + data->source = 1; + data->state = 30; } break; case 30: if (gReceivedRemoteLinkPlayers != 0) { - sub_8018838(1); - data->unk8 = 31; + ClearScreenInBg0(1); + data->state = 31; } else if (gSpecialVar_Result == 5) { - sub_8018838(1); - data->unk8 = 18; + ClearScreenInBg0(1); + data->state = 18; } break; case 31: @@ -1629,64 +1630,74 @@ void task00_mystery_gift(u8 taskId) gStringVar2[0] = eos; gStringVar3[0] = eos; } - if (data->unkC == 0) + if (data->IsCardOrNews == 0) { - sub_8018884(gText_SendingWonderCard); + AddTextPrinterToWindow1(gText_SendingWonderCard); mevent_srv_new_wcard(); } else { - sub_8018884(gText_SendingWonderNews); + AddTextPrinterToWindow1(gText_SendingWonderNews); mevent_srv_init_wnews(); } - data->unk8 = 32; + data->state = 32; break; case 32: - if (sub_801D0C4(&data->unk0) == 3) + if (mevent_srv_common_do_exec(&data->curPromptWindowId) == 3) { - data->unkE = data->unk0; - data->unk8 = 33; + data->prevPromptWindowId = data->curPromptWindowId; + data->state = 33; } break; case 33: task_add_05_task_del_08FA224_when_no_RfuFunc(); StringCopy(gStringVar1, gLinkPlayers[1].name); - data->unk8 = 34; + data->state = 34; break; case 34: if (gReceivedRemoteLinkPlayers == 0) { - sub_800E084(); - data->unk8 = 35; + DestroyWirelessStatusIndicatorSprite(); + data->state = 35; } break; case 35: - if (sub_8019174(&data->unk9, &data->unk0, data->unkD, data->unkE)) + if (PrintMGSendStatus(&data->textState, &data->curPromptWindowId, data->source, data->prevPromptWindowId)) { - if (data->unkD == 1 && data->unkE == 3) + if (data->source == 1 && data->prevPromptWindowId == 3) { - sub_801DB68(3); - data->unk8 = 17; + GenerateRandomNews(3); + data->state = 17; } else { - data->unk8 = 0; - sub_80186EC(0, 0); + data->state = 0; + PrintMysteryGiftOrEReaderTopMenu(0, 0); } } break; case 36: - if (mevent_0814257C(&data->unk9, gText_CommunicationError)) + if (MG_PrintTextOnWindow1AndWaitButton(&data->textState, gText_CommunicationError)) { - data->unk8 = 0; - sub_80186EC(0, 0); + data->state = 0; + PrintMysteryGiftOrEReaderTopMenu(0, 0); } break; case 37: CloseLink(); - Free(data->unk10); + Free(data->buffer); DestroyTask(taskId); - SetMainCallback2(sub_80186A4); + SetMainCallback2(MainCB_FreeAllBuffersAndReturnToInitTitleScreen); break; } } + +u16 GetMysteryGiftBaseBlock(void) +{ + return 0x1A9; +} + +void bgid_upload_textbox_1(u8 bgId) +{ + DecompressAndLoadBgGfxUsingHeap(bgId, gUnkTextboxBorderGfx, 0x100, 0, 0); +} diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index 30f5af14c..fb1be0698 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -4419,7 +4419,7 @@ static void PrintStorageActionText(u8 id) DynamicPlaceholderTextUtil_ExpandPlaceholders(sPSSData->field_2190, gPCStorageActionTexts[id].text); FillWindowPixelBuffer(1, PIXEL_FILL(1)); AddTextPrinterParameterized(1, 1, sPSSData->field_2190, 0, 1, TEXT_SPEED_FF, NULL); - sub_8098858(1, 2, 14); + DrawTextBorderOuter(1, 2, 14); PutWindowTilemap(1); CopyWindowToVram(1, 2); schedule_bg_copy_tilemap_to_vram(0); diff --git a/src/script.c b/src/script.c index 91690dd33..cb06300bf 100644 --- a/src/script.c +++ b/src/script.c @@ -405,7 +405,7 @@ bool32 sub_80991F8(void) u8 *sub_8099244(void) { struct RamScriptData *scriptData = &gSaveBlock1Ptr->ramScript.data; - if (!sub_801B27C()) + if (!ValidateReceivedWonderCard()) return NULL; if (scriptData->magic != RAM_SCRIPT_MAGIC) return NULL; diff --git a/src/script_pokemon_util_80F87D8.c b/src/script_pokemon_util_80F87D8.c index 7d6020c7a..7e4c14531 100755 --- a/src/script_pokemon_util_80F87D8.c +++ b/src/script_pokemon_util_80F87D8.c @@ -488,7 +488,7 @@ void sub_80F910C(void) if (gIsLinkContest & 2) { if (gReceivedRemoteLinkPlayers) - sub_800E084(); + DestroyWirelessStatusIndicatorSprite(); } } diff --git a/src/start_menu.c b/src/start_menu.c index f573f9bdf..5b527e15e 100644 --- a/src/start_menu.c +++ b/src/start_menu.c @@ -1185,7 +1185,7 @@ static bool32 sub_80A03E4(u8 *par1) InitBgsFromTemplates(0, sUnknown_085105A8, ARRAY_COUNT(sUnknown_085105A8)); InitWindows(sUnknown_085105AC); LoadUserWindowBorderGfx_(0, 8, 224); - sub_81978B0(240); + Menu_LoadStdPalAt(240); break; case 3: ShowBg(0); @@ -1234,7 +1234,7 @@ static void sub_80A0550(u8 taskId) 2, 1, 3); - sub_8098858(0, 8, 14); + DrawTextBorderOuter(0, 8, 14); PutWindowTilemap(0); CopyWindowToVram(0, 3); BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, 0); diff --git a/src/text_window.c b/src/text_window.c index 517f4bdb9..98fc09e87 100644 --- a/src/text_window.c +++ b/src/text_window.c @@ -113,7 +113,7 @@ void LoadUserWindowBorderGfx(u8 windowId, u16 destOffset, u8 palOffset) LoadWindowGfx(windowId, gSaveBlock2Ptr->optionsWindowFrameType, destOffset, palOffset); } -void sub_8098858(u8 windowId, u16 tileNum, u8 palNum) +void DrawTextBorderOuter(u8 windowId, u16 tileNum, u8 palNum) { u8 bgLayer = GetWindowAttribute(windowId, WINDOW_BG); u16 tilemapLeft = GetWindowAttribute(windowId, WINDOW_TILEMAP_LEFT); @@ -131,7 +131,7 @@ void sub_8098858(u8 windowId, u16 tileNum, u8 palNum) FillBgTilemapBufferRect(bgLayer, tileNum + 8, tilemapLeft + width, tilemapTop + height, 1, 1, palNum); } -void sub_80989E0(u8 windowId, u16 tileNum, u8 palNum) +void DrawTextBorderInner(u8 windowId, u16 tileNum, u8 palNum) { u8 bgLayer = GetWindowAttribute(windowId, WINDOW_BG); u16 tilemapLeft = GetWindowAttribute(windowId, WINDOW_TILEMAP_LEFT); diff --git a/src/trade.c b/src/trade.c index 34f49060f..80c74d2cd 100644 --- a/src/trade.c +++ b/src/trade.c @@ -2014,7 +2014,7 @@ static void sub_80781C8(void) FreeAllWindowBuffers(); Free(gUnknown_0203229C); gMain.callback1 = NULL; - sub_800E084(); + DestroyWirelessStatusIndicatorSprite(); SetMainCallback2(sub_807AE50); } } @@ -2543,7 +2543,7 @@ static void sub_8078DBC(void) if (gUnknown_0203229C->tradeMenuCursorPosition < 6) { - sub_8098858(1, 1, 14); + DrawTextBorderOuter(1, 1, 14); FillWindowPixelBuffer(1, PIXEL_FILL(1)); PrintMenuTable(1, 2, gUnknown_0832DEAC); InitMenuInUpperLeftCornerPlaySoundWhenAPressed(1, 2, 0); @@ -2844,7 +2844,7 @@ static void sub_80794CC(void) Free(gUnknown_02032184); Free(gUnknown_0203229C); FreeAllWindowBuffers(); - sub_800E084(); + DestroyWirelessStatusIndicatorSprite(); SetMainCallback2(CB2_ReturnToFieldFromMultiplayer); } } @@ -3341,7 +3341,7 @@ static void sub_807A19C(u8 a0) { FillWindowPixelBuffer(0, PIXEL_FILL(1)); AddTextPrinterParameterized(0, 1, gUnknown_0832DEBC[a0], 0, 1, TEXT_SPEED_FF, NULL); - sub_8098858(0, 20, 12); + DrawTextBorderOuter(0, 20, 12); PutWindowTilemap(0); CopyWindowToVram(0, 3); } @@ -6123,7 +6123,7 @@ static void c2_080543C4(void) FreeMonSpritesGfx(); FREE_AND_SET_NULL(gUnknown_020322A0); if (gWirelessCommType) - sub_800E084(); + DestroyWirelessStatusIndicatorSprite(); SetMainCallback2(gMain.savedCallback); } RunTasks(); diff --git a/src/union_room.c b/src/union_room.c index df0137379..8aeaaf6fb 100644 --- a/src/union_room.c +++ b/src/union_room.c @@ -45,6 +45,7 @@ #include "event_obj_lock.h" #include "union_room_chat.h" #include "berry_crush.h" +#include "mystery_gift.h" EWRAM_DATA u8 gUnknown_02022C20[12] = {}; EWRAM_DATA u8 gUnknown_02022C2C = 0; @@ -100,9 +101,8 @@ void sub_801AC54(void); void sub_802A9A8(u8 monId, MainCallback callback); void sub_802493C(u8 monId, MainCallback callback); void sub_80149D8(void); -u16 sub_8019930(void); -void sub_8018784(u8 windowId); -s8 sub_8018B08(u8 *textState, u8 *arg1, u8 arg2, const u8 *str); +void MG_DrawTextBorder(u8 windowId); +s8 mevent_message_print_and_prompt_yes_no(u8 *textState, u8 *arg1, u8 arg2, const u8 *str); bool32 sub_8016F1C(struct UnkLinkRfuStruct_02022B14 *arg0, s16 arg1); u8 sub_8016DF0(struct UnkStruct_Main4 *arg0, struct UnkStruct_Main4 *arg1, u32 arg2); void sub_8019F2C(void); @@ -1555,7 +1555,7 @@ void sub_8012780(u8 taskId) break; case 21: case 23: - sub_800E084(); + DestroyWirelessStatusIndicatorSprite(); sub_800EDD4(); sub_8012F64(data); data->state++; @@ -2076,7 +2076,7 @@ void sub_80134E8(u8 taskId) data->state++; break; case 13: - sub_800E084(); + DestroyWirelessStatusIndicatorSprite(); if (PrintOnTextbox(&data->textState, gUnknown_082EDE9C[sub_8011A74()])) { gSpecialVar_Result = 6; @@ -2084,12 +2084,12 @@ void sub_80134E8(u8 taskId) } break; case 11: - sub_800E084(); + DestroyWirelessStatusIndicatorSprite(); gSpecialVar_Result = 5; data->state = 23; break; case 15: - sub_800E084(); + DestroyWirelessStatusIndicatorSprite(); if (PrintOnTextbox(&data->textState, gUnknown_082EDE9C[sub_8011A74()])) { gSpecialVar_Result = 8; @@ -2481,7 +2481,7 @@ void sub_80143E4(void *arg0, bool32 arg1) TrainerCard_GenerateCardForPlayer((struct TrainerCard *)argAsU16Ptr); if (arg1) - argAsU16Ptr[48] = sub_801B39C(); + argAsU16Ptr[48] = GetWonderCardFlagID(); else argAsU16Ptr[48] = 0; } @@ -2680,7 +2680,7 @@ void sub_8014790(u8 taskId) case 8: if (gReceivedRemoteLinkPlayers == 0) { - sub_800E084(); + DestroyWirelessStatusIndicatorSprite(); EnableBothScriptContexts(); DestroyTask(taskId); } @@ -2699,7 +2699,7 @@ void sub_80149D8(void) gTasks[taskId].data[0] = 0; } -void sub_8014A00(u32 arg0) +void MEvent_CreateTask_Leader(u32 arg0) { u8 taskId; struct UnkStruct_Leader *dataPtr; @@ -2745,10 +2745,10 @@ void sub_8014A40(u8 taskId) data->field_17 = sub_8016FC0(data->field_4, 0xFF); winTemplate = gUnknown_082F011C; - winTemplate.baseBlock = sub_8019930(); + winTemplate.baseBlock = GetMysteryGiftBaseBlock(); winTemplate.paletteNum = 0xC; data->listWindowId = AddWindow(&winTemplate); - sub_8018784(data->listWindowId); + MG_DrawTextBorder(data->listWindowId); gMultiuseListMenuTemplate = gUnknown_082F015C; gMultiuseListMenuTemplate.windowId = data->listWindowId; data->listTaskId = ListMenuInit(&gMultiuseListMenuTemplate, 0, 0); @@ -2763,7 +2763,7 @@ void sub_8014A40(u8 taskId) data->state = 3; break; case 3: - sub_8018884(gStringVar4); + AddTextPrinterToWindow1(gStringVar4); data->state = 4; break; case 4: @@ -2771,11 +2771,11 @@ void sub_8014A40(u8 taskId) if (gMain.newKeys & B_BUTTON) { data->state = 13; - sub_800E084(); + DestroyWirelessStatusIndicatorSprite(); } break; case 6: - if (mevent_0814257C(&data->textState, gUnknown_082EDF40)) + if (MG_PrintTextOnWindow1AndWaitButton(&data->textState, gUnknown_082EDF40)) { data->field_13 = sub_8013398(data->field_0); RedrawListMenu(data->listTaskId); @@ -2786,7 +2786,7 @@ void sub_8014A40(u8 taskId) data->state = 7; break; case 7: - switch (sub_8018B08(&data->textState, &data->field_14, 0, gStringVar4)) + switch (mevent_message_print_and_prompt_yes_no(&data->textState, &data->field_14, 0, gStringVar4)) { case 0: sub_800E0E8(); @@ -2837,7 +2837,7 @@ void sub_8014A40(u8 taskId) } break; case 9: - sub_8018884(gStringVar4); + AddTextPrinterToWindow1(gStringVar4); data->state = 10; break; case 10: @@ -2860,7 +2860,7 @@ void sub_8014A40(u8 taskId) } break; case 13: - sub_800E084(); + DestroyWirelessStatusIndicatorSprite(); sub_800EDD4(); DestroyListMenuTask(data->listTaskId, 0, 0); CopyBgTilemapBufferToVram(0); @@ -2872,7 +2872,7 @@ void sub_8014A40(u8 taskId) data->state++; break; case 14: - if (mevent_0814257C(&data->textState, gText_PleaseStartOver)) + if (MG_PrintTextOnWindow1AndWaitButton(&data->textState, gText_PleaseStartOver)) { DestroyTask(taskId); gSpecialVar_Result = 5; @@ -2907,7 +2907,7 @@ void sub_8014A40(u8 taskId) } } -void sub_8014EFC(u32 arg0) +void MEvent_CreateTask_CardOrNewsWithFriend(u32 arg0) { u8 taskId; struct UnkStruct_Group *dataPtr; @@ -2940,7 +2940,7 @@ void sub_8014F48(u8 taskId) data->state = 1; break; case 1: - sub_8018884(gUnknown_082EF7F8); + AddTextPrinterToWindow1(gUnknown_082EF7F8); data->state = 2; break; case 2: @@ -2949,7 +2949,7 @@ void sub_8014F48(u8 taskId) data->field_11 = sub_8016FC0(data->field_4, data->field_12 + 7); winTemplate1 = gUnknown_082F0174; - winTemplate1.baseBlock = sub_8019930(); + winTemplate1.baseBlock = GetMysteryGiftBaseBlock(); winTemplate1.paletteNum = 0xC; data->listWindowId = AddWindow(&winTemplate1); @@ -2957,12 +2957,12 @@ void sub_8014F48(u8 taskId) winTemplate2.paletteNum = 0xC; data->field_D = AddWindow(&winTemplate2); - sub_8018784(data->listWindowId); + MG_DrawTextBorder(data->listWindowId); gMultiuseListMenuTemplate = gUnknown_082F0204; gMultiuseListMenuTemplate.windowId = data->listWindowId; data->listTaskId = ListMenuInit(&gMultiuseListMenuTemplate, 0, 0); - sub_8018784(data->field_D); + MG_DrawTextBorder(data->field_D); FillWindowPixelBuffer(data->field_D, PIXEL_FILL(1)); PutWindowTilemap(data->field_D); sub_80125BC(data->field_D); @@ -3013,7 +3013,7 @@ void sub_8014F48(u8 taskId) } break; case 4: - sub_8018884(gUnknown_082EFC3C); + AddTextPrinterToWindow1(gUnknown_082EFC3C); sub_8018404(gStringVar1, &data->field_0->arr[data->field_F]); data->state = 5; break; @@ -3032,7 +3032,7 @@ void sub_8014F48(u8 taskId) data->state = 8; break; case 5: - sub_8018884(gUnknown_082EDDF4); + AddTextPrinterToWindow1(gUnknown_082EDDF4); sub_8011A64(0, 0); break; } @@ -3050,17 +3050,17 @@ void sub_8014F48(u8 taskId) data->state++; break; case 9: - if (mevent_0814257C(&data->textState, gUnknown_082EDF80[sub_8011A74()])) + if (MG_PrintTextOnWindow1AndWaitButton(&data->textState, gUnknown_082EDF80[sub_8011A74()])) { - sub_800E084(); + DestroyWirelessStatusIndicatorSprite(); DestroyTask(taskId); sub_800EDD4(); gSpecialVar_Result = 5; } break; case 7: - sub_800E084(); - sub_8018884(gText_PleaseStartOver); + DestroyWirelessStatusIndicatorSprite(); + AddTextPrinterToWindow1(gText_PleaseStartOver); DestroyTask(taskId); sub_800EDD4(); gSpecialVar_Result = 5; @@ -3076,7 +3076,7 @@ void sub_8014F48(u8 taskId) } } -void sub_80152A8(u32 arg0) +void MEvent_CreateTask_CardOrNewsOverWireless(u32 arg0) { u8 taskId; struct UnkStruct_Group *dataPtr; @@ -3109,7 +3109,7 @@ void sub_80152F4(u8 taskId) data->state = 1; break; case 1: - sub_8018884(gUnknown_082EFBC8); + AddTextPrinterToWindow1(gUnknown_082EFBC8); data->state = 2; break; case 2: @@ -3120,10 +3120,10 @@ void sub_80152F4(u8 taskId) if (data->field_13 != 0) { winTemplate = gUnknown_082F0174; - winTemplate.baseBlock = sub_8019930(); + winTemplate.baseBlock = GetMysteryGiftBaseBlock(); data->listWindowId = AddWindow(&winTemplate); - sub_8018784(data->listWindowId); + MG_DrawTextBorder(data->listWindowId); gMultiuseListMenuTemplate = gUnknown_082F0204; gMultiuseListMenuTemplate.windowId = data->listWindowId; data->listTaskId = ListMenuInit(&gMultiuseListMenuTemplate, 0, 0); @@ -3178,7 +3178,7 @@ void sub_80152F4(u8 taskId) } break; case 4: - sub_8018884(gUnknown_082EFC90); + AddTextPrinterToWindow1(gUnknown_082EFC90); sub_8018404(gStringVar1, &data->field_0->arr[data->field_F]); data->state = 5; break; @@ -3197,7 +3197,7 @@ void sub_80152F4(u8 taskId) data->state = 8; break; case 5: - sub_8018884(gUnknown_082EDEC4); + AddTextPrinterToWindow1(gUnknown_082EDEC4); sub_8011A64(0, 0); break; } @@ -3218,27 +3218,27 @@ void sub_80152F4(u8 taskId) data->state++; break; case 9: - if (mevent_0814257C(&data->textState, gUnknown_082EDF04)) + if (MG_PrintTextOnWindow1AndWaitButton(&data->textState, gUnknown_082EDF04)) { - sub_800E084(); + DestroyWirelessStatusIndicatorSprite(); DestroyTask(taskId); sub_800EDD4(); gSpecialVar_Result = 5; } break; case 7: - if (mevent_0814257C(&data->textState, gText_WirelessSearchCanceled)) + if (MG_PrintTextOnWindow1AndWaitButton(&data->textState, gText_WirelessSearchCanceled)) { - sub_800E084(); + DestroyWirelessStatusIndicatorSprite(); DestroyTask(taskId); sub_800EDD4(); gSpecialVar_Result = 5; } break; case 11: - if (mevent_0814257C(&data->textState, gUnknown_082EFD58[data->field_12])) + if (MG_PrintTextOnWindow1AndWaitButton(&data->textState, gUnknown_082EFD58[data->field_12])) { - sub_800E084(); + DestroyWirelessStatusIndicatorSprite(); DestroyTask(taskId); sub_800EDD4(); gSpecialVar_Result = 5; @@ -4513,7 +4513,7 @@ s32 sub_8017178(u8 *arg0, u8 *arg1, u8 *arg2, const struct WindowTemplate *winTe { case 0: winTemplateCopy = *winTemplate; - r1 = sub_81DB41C(menuTemplate); + r1 = Intl_GetListMenuWidth(menuTemplate); if (winTemplateCopy.width > r1) { winTemplateCopy.width = r1; diff --git a/src/union_room_chat.c b/src/union_room_chat.c index 85cfa6e2e..120252d36 100755 --- a/src/union_room_chat.c +++ b/src/union_room_chat.c @@ -2074,7 +2074,7 @@ static void sub_801FDDC(u8 left, u8 top, u8 initialCursorPos) PutWindowTilemap(gUnknown_02022C88->unk18); AddTextPrinterParameterized(gUnknown_02022C88->unk18, 1, gText_Yes, 8, 1, TEXT_SPEED_FF, NULL); AddTextPrinterParameterized(gUnknown_02022C88->unk18, 1, gText_No, 8, 17, TEXT_SPEED_FF, NULL); - sub_8098858(gUnknown_02022C88->unk18, 1, 13); + DrawTextBorderOuter(gUnknown_02022C88->unk18, 1, 13); InitMenuInUpperLeftCornerPlaySoundWhenAPressed(gUnknown_02022C88->unk18, 2, initialCursorPos); } } @@ -2140,7 +2140,7 @@ static void sub_801FF18(int arg0, u16 arg1) PutWindowTilemap(windowId); if (gUnknown_082F2D40[arg0].unk4 == 1) { - sub_80989E0(windowId, 0xA, 2); + DrawTextBorderInner(windowId, 0xA, 2); AddTextPrinterParameterized5( windowId, 1, @@ -2154,7 +2154,7 @@ static void sub_801FF18(int arg0, u16 arg1) } else { - sub_8098858(windowId, 0xA, 2); + DrawTextBorderOuter(windowId, 0xA, 2); AddTextPrinterParameterized5( windowId, 1, @@ -2316,7 +2316,7 @@ static bool32 sub_8020368(void) static void sub_80203B0(void) { FillWindowPixelBuffer(3, PIXEL_FILL(1)); - sub_8098858(3, 1, 13); + DrawTextBorderOuter(3, 1, 13); PrintTextArray(3, 2, 8, 1, 14, 5, gUnknown_082F2DC8); sub_81983AC(3, 2, 0, 1, 14, 5, sub_801F0B0()); PutWindowTilemap(3); diff --git a/src/use_pokeblock.c b/src/use_pokeblock.c index 6df826214..4eaf60be4 100644 --- a/src/use_pokeblock.c +++ b/src/use_pokeblock.c @@ -617,7 +617,7 @@ void sub_8166D44(void) StringAppend(stringBuffer, gText_GetsAPokeBlockQuestion); StringCopy(gStringVar4, stringBuffer); FillWindowPixelBuffer(2, 17); - sub_8098858(2, 151, 14); + DrawTextBorderOuter(2, 151, 14); AddTextPrinterParameterized(2, 1, gStringVar4, 0, 1, 0, NULL); PutWindowTilemap(2); CopyWindowToVram(2, 3); @@ -645,7 +645,7 @@ s8 sub_8166DE4(void) void sub_8166E24(void) { - sub_8098858(2, 151, 14); + DrawTextBorderOuter(2, 151, 14); FillWindowPixelBuffer(2, 17); for (gUnknown_0203BC90->field_53 = 0; gUnknown_0203BC90->field_53 < 5; gUnknown_0203BC90->field_53++) @@ -693,7 +693,7 @@ bool8 sub_8166EDC(void) void sub_8166F50(void) { FillWindowPixelBuffer(2, 17); - sub_8098858(2, 151, 14); + DrawTextBorderOuter(2, 151, 14); AddTextPrinterParameterized(2, 1, gText_WontEatAnymore, 0, 1, 0, NULL); PutWindowTilemap(2); CopyWindowToVram(2, 3); -- cgit v1.2.3 From 207a54393c533e073e54365a8069753536fefa3c Mon Sep 17 00:00:00 2001 From: Phlosioneer Date: Sun, 31 Mar 2019 20:07:24 -0400 Subject: Fix mistakes and use EVENT_OBJ_GFX_* macros --- src/data/contest_opponents.h | 392 ++++++++++++++++++++--------------------- src/data/contest_text_tables.h | 118 ++++++------- 2 files changed, 255 insertions(+), 255 deletions(-) (limited to 'src') diff --git a/src/data/contest_opponents.h b/src/data/contest_opponents.h index 2ebfd1dfd..ef1fdba9f 100644 --- a/src/data/contest_opponents.h +++ b/src/data/contest_opponents.h @@ -182,9 +182,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_POOCHYENA, .nickname = _("POOCHY"), .trainerName = _("JIMMY"), - .trainerGfxId = 7, + .trainerGfxId = EVENT_OBJ_GFX_BOY_1, .flags = 0xC000FFF, - .whichRank = 0, + .whichRank = CONTEST_RANK_NORMAL, .aiPool_Cool = TRUE, .aiPool_Beauty = FALSE, .aiPool_Cute = FALSE, @@ -211,9 +211,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_ILLUMISE, .nickname = _("MUSILLE"), .trainerName = _("EDITH"), - .trainerGfxId = 8, + .trainerGfxId = EVENT_OBJ_GFX_GIRL_1, .flags = 0x82000FFF, - .whichRank = 0, + .whichRank = CONTEST_RANK_NORMAL, .aiPool_Cool = FALSE, .aiPool_Beauty = FALSE, .aiPool_Cute = TRUE, @@ -240,9 +240,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_DUSTOX, .nickname = _("DUSTER"), .trainerName = _("EVAN"), - .trainerGfxId = 11, + .trainerGfxId = EVENT_OBJ_GFX_LITTLE_BOY, .flags = 0x21000FFF, - .whichRank = 0, + .whichRank = CONTEST_RANK_NORMAL, .aiPool_Cool = FALSE, .aiPool_Beauty = TRUE, .aiPool_Cute = FALSE, @@ -269,9 +269,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_SEEDOT, .nickname = _("DOTS"), .trainerName = _("KELSEY"), - .trainerGfxId = 16, + .trainerGfxId = EVENT_OBJ_GFX_WOMAN_1, .flags = 0x20800FFF, - .whichRank = 0, + .whichRank = CONTEST_RANK_NORMAL, .aiPool_Cool = FALSE, .aiPool_Beauty = FALSE, .aiPool_Cute = FALSE, @@ -298,9 +298,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_TAILLOW, .nickname = _("TATAY"), .trainerName = _("MADISON"), - .trainerGfxId = 18, + .trainerGfxId = EVENT_OBJ_GFX_POKEFAN_F, .flags = 0x80400FFF, - .whichRank = 0, + .whichRank = CONTEST_RANK_NORMAL, .aiPool_Cool = TRUE, .aiPool_Beauty = FALSE, .aiPool_Cute = FALSE, @@ -327,9 +327,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_NINCADA, .nickname = _("NINDA"), .trainerName = _("RAYMOND"), - .trainerGfxId = 44, + .trainerGfxId = EVENT_OBJ_GFX_BLACK_BELT, .flags = 0x10200FFF, - .whichRank = 0, + .whichRank = CONTEST_RANK_NORMAL, .aiPool_Cool = FALSE, .aiPool_Beauty = FALSE, .aiPool_Cute = FALSE, @@ -356,9 +356,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_SHROOMISH, .nickname = _("SMISH"), .trainerName = _("GRANT"), - .trainerGfxId = 35, + .trainerGfxId = EVENT_OBJ_GFX_YOUNGSTER, .flags = 0x20100FFF, - .whichRank = 0, + .whichRank = CONTEST_RANK_NORMAL, .aiPool_Cool = FALSE, .aiPool_Beauty = FALSE, .aiPool_Cute = FALSE, @@ -385,9 +385,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_SPHEAL, .nickname = _("SLEAL"), .trainerName = _("PAIGE"), - .trainerGfxId = 26, + .trainerGfxId = EVENT_OBJ_GFX_WOMAN_4, .flags = 0x8080FFF, - .whichRank = 0, + .whichRank = CONTEST_RANK_NORMAL, .aiPool_Cool = FALSE, .aiPool_Beauty = TRUE, .aiPool_Cute = TRUE, @@ -414,9 +414,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_SLAKOTH, .nickname = _("SLOKTH"), .trainerName = _("ALEC"), - .trainerGfxId = 31, + .trainerGfxId = EVENT_OBJ_GFX_CAMPER, .flags = 0x40040FFF, - .whichRank = 0, + .whichRank = CONTEST_RANK_NORMAL, .aiPool_Cool = FALSE, .aiPool_Beauty = TRUE, .aiPool_Cute = TRUE, @@ -443,9 +443,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_WHISMUR, .nickname = _("WHIRIS"), .trainerName = _("SYDNEY"), - .trainerGfxId = 47, + .trainerGfxId = EVENT_OBJ_GFX_LASS, .flags = 0x80020FFF, - .whichRank = 0, + .whichRank = CONTEST_RANK_NORMAL, .aiPool_Cool = TRUE, .aiPool_Beauty = FALSE, .aiPool_Cute = FALSE, @@ -472,9 +472,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_MAKUHITA, .nickname = _("MAHITA"), .trainerName = _("MORRIS"), - .trainerGfxId = 38, + .trainerGfxId = EVENT_OBJ_GFX_SCHOOL_KID_M, .flags = 0x8010FFF, - .whichRank = 0, + .whichRank = CONTEST_RANK_NORMAL, .aiPool_Cool = TRUE, .aiPool_Beauty = FALSE, .aiPool_Cute = FALSE, @@ -501,9 +501,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_ARON, .nickname = _("RONAR"), .trainerName = _("MARIAH"), - .trainerGfxId = 10, + .trainerGfxId = EVENT_OBJ_GFX_GIRL_2, .flags = 0x8008FFF, - .whichRank = 0, + .whichRank = CONTEST_RANK_NORMAL, .aiPool_Cool = TRUE, .aiPool_Beauty = FALSE, .aiPool_Cute = FALSE, @@ -530,9 +530,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_CROBAT, .nickname = _("BATRO"), .trainerName = _("RUSSELL"), - .trainerGfxId = 33, + .trainerGfxId = EVENT_OBJ_GFX_MAN_3, .flags = 0x90004FFF, - .whichRank = 0, + .whichRank = CONTEST_RANK_NORMAL, .aiPool_Cool = FALSE, .aiPool_Beauty = TRUE, .aiPool_Cute = TRUE, @@ -559,9 +559,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_GULPIN, .nickname = _("GULIN"), .trainerName = _("MELANIE"), - .trainerGfxId = 6, + .trainerGfxId = EVENT_OBJ_GFX_TWIN, .flags = 0x40002FFF, - .whichRank = 0, + .whichRank = CONTEST_RANK_NORMAL, .aiPool_Cool = FALSE, .aiPool_Beauty = FALSE, .aiPool_Cute = TRUE, @@ -588,9 +588,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_MANECTRIC, .nickname = _("RIKELEC"), .trainerName = _("CHANCE"), - .trainerGfxId = 15, + .trainerGfxId = EVENT_OBJ_GFX_RICH_BOY, .flags = 0x80001FFF, - .whichRank = 0, + .whichRank = CONTEST_RANK_NORMAL, .aiPool_Cool = TRUE, .aiPool_Beauty = TRUE, .aiPool_Cute = FALSE, @@ -617,9 +617,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_BULBASAUR, .nickname = _("BULBY"), .trainerName = _("AGATHA"), - .trainerGfxId = 20, + .trainerGfxId = EVENT_OBJ_GFX_WOMAN_2, .flags = 0xC000FFF, - .whichRank = 0, + .whichRank = CONTEST_RANK_NORMAL, .aiPool_Cool = FALSE, .aiPool_Beauty = FALSE, .aiPool_Cute = TRUE, @@ -646,9 +646,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_BUTTERFREE, .nickname = _("FUTTERBE"), .trainerName = _("BEAU"), - .trainerGfxId = 40, + .trainerGfxId = EVENT_OBJ_GFX_HEX_MANIAC, .flags = 0x82000FFF, - .whichRank = 0, + .whichRank = CONTEST_RANK_NORMAL, .aiPool_Cool = FALSE, .aiPool_Beauty = TRUE, .aiPool_Cute = FALSE, @@ -675,9 +675,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_PIDGEOTTO, .nickname = _("PIDEOT"), .trainerName = _("KAY"), - .trainerGfxId = 34, + .trainerGfxId = EVENT_OBJ_GFX_WOMAN_5, .flags = 0x21000FFF, - .whichRank = 0, + .whichRank = CONTEST_RANK_NORMAL, .aiPool_Cool = TRUE, .aiPool_Beauty = TRUE, .aiPool_Cute = FALSE, @@ -704,9 +704,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_DIGLETT, .nickname = _("DIGLE"), .trainerName = _("CALE"), - .trainerGfxId = 55, + .trainerGfxId = EVENT_OBJ_GFX_HIKER, .flags = 0x20800FFF, - .whichRank = 0, + .whichRank = CONTEST_RANK_NORMAL, .aiPool_Cool = FALSE, .aiPool_Beauty = FALSE, .aiPool_Cute = FALSE, @@ -733,9 +733,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_POLIWAG, .nickname = _("WAGIL"), .trainerName = _("CAITLIN"), - .trainerGfxId = 53, + .trainerGfxId = EVENT_OBJ_GFX_TUBER_F, .flags = 0x80400FFF, - .whichRank = 0, + .whichRank = CONTEST_RANK_NORMAL, .aiPool_Cool = FALSE, .aiPool_Beauty = TRUE, .aiPool_Cute = FALSE, @@ -762,9 +762,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_TOTODILE, .nickname = _("TOTDIL"), .trainerName = _("COLBY"), - .trainerGfxId = 5, + .trainerGfxId = EVENT_OBJ_GFX_NINJA_BOY, .flags = 0x10200FFF, - .whichRank = 0, + .whichRank = CONTEST_RANK_NORMAL, .aiPool_Cool = TRUE, .aiPool_Beauty = TRUE, .aiPool_Cute = FALSE, @@ -791,9 +791,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_LEDYBA, .nickname = _("BALEDY"), .trainerName = _("KYLIE"), - .trainerGfxId = 45, + .trainerGfxId = EVENT_OBJ_GFX_BEAUTY, .flags = 0x20100FFF, - .whichRank = 0, + .whichRank = CONTEST_RANK_NORMAL, .aiPool_Cool = TRUE, .aiPool_Beauty = FALSE, .aiPool_Cute = TRUE, @@ -820,9 +820,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_DELIBIRD, .nickname = _("BIRDLY"), .trainerName = _("LIAM"), - .trainerGfxId = 66, + .trainerGfxId = EVENT_OBJ_GFX_MAN_5, .flags = 0x8080FFF, - .whichRank = 0, + .whichRank = CONTEST_RANK_NORMAL, .aiPool_Cool = FALSE, .aiPool_Beauty = FALSE, .aiPool_Cute = TRUE, @@ -849,9 +849,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_LARVITAR, .nickname = _("TARVITAR"), .trainerName = _("MILO"), - .trainerGfxId = 39, + .trainerGfxId = EVENT_OBJ_GFX_MANIAC, .flags = 0x40040FFF, - .whichRank = 0, + .whichRank = CONTEST_RANK_NORMAL, .aiPool_Cool = FALSE, .aiPool_Beauty = FALSE, .aiPool_Cute = FALSE, @@ -878,9 +878,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_ROSELIA, .nickname = _("RELIA"), .trainerName = _("KARINA"), - .trainerGfxId = 32, + .trainerGfxId = EVENT_OBJ_GFX_PICNICKER, .flags = 0x24000FFF, - .whichRank = 1, + .whichRank = CONTEST_RANK_SUPER, .aiPool_Cool = FALSE, .aiPool_Beauty = TRUE, .aiPool_Cute = FALSE, @@ -907,9 +907,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_DODRIO, .nickname = _("DUODO"), .trainerName = _("BOBBY"), - .trainerGfxId = 51, + .trainerGfxId = EVENT_OBJ_GFX_RUNNING_TRIATHLETE_M, .flags = 0x82000FFF, - .whichRank = 1, + .whichRank = CONTEST_RANK_SUPER, .aiPool_Cool = TRUE, .aiPool_Beauty = TRUE, .aiPool_Cute = TRUE, @@ -936,9 +936,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_TRAPINCH, .nickname = _("PINCHIN"), .trainerName = _("CLAIRE"), - .trainerGfxId = 8, + .trainerGfxId = EVENT_OBJ_GFX_GIRL_1, .flags = 0x81000FFF, - .whichRank = 1, + .whichRank = CONTEST_RANK_SUPER, .aiPool_Cool = FALSE, .aiPool_Beauty = FALSE, .aiPool_Cute = TRUE, @@ -965,9 +965,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_CACNEA, .nickname = _("NACAC"), .trainerName = _("WILLIE"), - .trainerGfxId = 11, + .trainerGfxId = EVENT_OBJ_GFX_LITTLE_BOY, .flags = 0x80800FFF, - .whichRank = 1, + .whichRank = CONTEST_RANK_SUPER, .aiPool_Cool = TRUE, .aiPool_Beauty = FALSE, .aiPool_Cute = FALSE, @@ -994,9 +994,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_SANDSLASH, .nickname = _("SHRAND"), .trainerName = _("CASSIDY"), - .trainerGfxId = 18, + .trainerGfxId = EVENT_OBJ_GFX_POKEFAN_F, .flags = 0x10400FFF, - .whichRank = 1, + .whichRank = CONTEST_RANK_SUPER, .aiPool_Cool = TRUE, .aiPool_Beauty = FALSE, .aiPool_Cute = FALSE, @@ -1023,9 +1023,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_BALTOY, .nickname = _("TOYBAL"), .trainerName = _("MORGAN"), - .trainerGfxId = 44, + .trainerGfxId = EVENT_OBJ_GFX_BLACK_BELT, .flags = 0x8200FFF, - .whichRank = 1, + .whichRank = CONTEST_RANK_SUPER, .aiPool_Cool = FALSE, .aiPool_Beauty = TRUE, .aiPool_Cute = FALSE, @@ -1052,9 +1052,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_MEDICHAM, .nickname = _("CHAMCHAM"), .trainerName = _("SUMMER"), - .trainerGfxId = 26, + .trainerGfxId = EVENT_OBJ_GFX_WOMAN_4, .flags = 0x10100FFF, - .whichRank = 1, + .whichRank = CONTEST_RANK_SUPER, .aiPool_Cool = TRUE, .aiPool_Beauty = TRUE, .aiPool_Cute = FALSE, @@ -1081,9 +1081,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_SPINDA, .nickname = _("SPININ"), .trainerName = _("MILES"), - .trainerGfxId = 31, + .trainerGfxId = EVENT_OBJ_GFX_CAMPER, .flags = 0x80080FFF, - .whichRank = 1, + .whichRank = CONTEST_RANK_SUPER, .aiPool_Cool = FALSE, .aiPool_Beauty = FALSE, .aiPool_Cute = TRUE, @@ -1110,9 +1110,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_SWABLU, .nickname = _("SWABY"), .trainerName = _("AUDREY"), - .trainerGfxId = 47, + .trainerGfxId = EVENT_OBJ_GFX_LASS, .flags = 0xA0040FFF, - .whichRank = 1, + .whichRank = CONTEST_RANK_SUPER, .aiPool_Cool = FALSE, .aiPool_Beauty = TRUE, .aiPool_Cute = FALSE, @@ -1139,9 +1139,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_SPOINK, .nickname = _("POINKER"), .trainerName = _("AVERY"), - .trainerGfxId = 38, + .trainerGfxId = EVENT_OBJ_GFX_SCHOOL_KID_M, .flags = 0x80020FFF, - .whichRank = 1, + .whichRank = CONTEST_RANK_SUPER, .aiPool_Cool = FALSE, .aiPool_Beauty = FALSE, .aiPool_Cute = TRUE, @@ -1168,9 +1168,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_KECLEON, .nickname = _("KECON"), .trainerName = _("ARIANA"), - .trainerGfxId = 10, + .trainerGfxId = EVENT_OBJ_GFX_GIRL_2, .flags = 0x80010FFF, - .whichRank = 1, + .whichRank = CONTEST_RANK_SUPER, .aiPool_Cool = FALSE, .aiPool_Beauty = FALSE, .aiPool_Cute = FALSE, @@ -1197,9 +1197,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_GOLDEEN, .nickname = _("GOLDEN"), .trainerName = _("ASHTON"), - .trainerGfxId = 33, + .trainerGfxId = EVENT_OBJ_GFX_MAN_3, .flags = 0x80008FFF, - .whichRank = 1, + .whichRank = CONTEST_RANK_SUPER, .aiPool_Cool = TRUE, .aiPool_Beauty = TRUE, .aiPool_Cute = FALSE, @@ -1226,9 +1226,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_BARBOACH, .nickname = _("BOBOACH"), .trainerName = _("SANDRA"), - .trainerGfxId = 6, + .trainerGfxId = EVENT_OBJ_GFX_TWIN, .flags = 0x80004FFF, - .whichRank = 1, + .whichRank = CONTEST_RANK_SUPER, .aiPool_Cool = FALSE, .aiPool_Beauty = FALSE, .aiPool_Cute = TRUE, @@ -1255,9 +1255,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_SKARMORY, .nickname = _("CORPY"), .trainerName = _("CARSON"), - .trainerGfxId = 35, + .trainerGfxId = EVENT_OBJ_GFX_YOUNGSTER, .flags = 0x8002FFF, - .whichRank = 1, + .whichRank = CONTEST_RANK_SUPER, .aiPool_Cool = TRUE, .aiPool_Beauty = TRUE, .aiPool_Cute = FALSE, @@ -1284,9 +1284,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_LOTAD, .nickname = _("TADO"), .trainerName = _("KATRINA"), - .trainerGfxId = 16, + .trainerGfxId = EVENT_OBJ_GFX_WOMAN_1, .flags = 0x8001FFF, - .whichRank = 1, + .whichRank = CONTEST_RANK_SUPER, .aiPool_Cool = FALSE, .aiPool_Beauty = TRUE, .aiPool_Cute = TRUE, @@ -1313,9 +1313,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_SLOWBRO, .nickname = _("BROWLO"), .trainerName = _("LUKE"), - .trainerGfxId = 17, + .trainerGfxId = EVENT_OBJ_GFX_FAT_MAN, .flags = 0xC000FFF, - .whichRank = 1, + .whichRank = CONTEST_RANK_SUPER, .aiPool_Cool = FALSE, .aiPool_Beauty = FALSE, .aiPool_Cute = TRUE, @@ -1342,9 +1342,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_FARFETCHD, .nickname = _("FETCHIN"), .trainerName = _("RAUL"), - .trainerGfxId = 66, + .trainerGfxId = EVENT_OBJ_GFX_MAN_5, .flags = 0x82000FFF, - .whichRank = 1, + .whichRank = CONTEST_RANK_SUPER, .aiPool_Cool = TRUE, .aiPool_Beauty = FALSE, .aiPool_Cute = TRUE, @@ -1371,9 +1371,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_SEEL, .nickname = _("SEELEY"), .trainerName = _("JADA"), - .trainerGfxId = 20, + .trainerGfxId = EVENT_OBJ_GFX_WOMAN_2, .flags = 0x21000FFF, - .whichRank = 1, + .whichRank = CONTEST_RANK_SUPER, .aiPool_Cool = FALSE, .aiPool_Beauty = TRUE, .aiPool_Cute = TRUE, @@ -1400,9 +1400,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_DROWZEE, .nickname = _("DROWZIN"), .trainerName = _("ZEEK"), - .trainerGfxId = 37, + .trainerGfxId = EVENT_OBJ_GFX_PSYCHIC_M, .flags = 0x20800FFF, - .whichRank = 1, + .whichRank = CONTEST_RANK_SUPER, .aiPool_Cool = FALSE, .aiPool_Beauty = TRUE, .aiPool_Cute = TRUE, @@ -1429,9 +1429,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_HITMONCHAN, .nickname = _("HITEMON"), .trainerName = _("DIEGO"), - .trainerGfxId = 21, + .trainerGfxId = EVENT_OBJ_GFX_EXPERT_M, .flags = 0x80400FFF, - .whichRank = 1, + .whichRank = CONTEST_RANK_SUPER, .aiPool_Cool = TRUE, .aiPool_Beauty = FALSE, .aiPool_Cute = FALSE, @@ -1458,9 +1458,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_BLISSEY, .nickname = _("BLISS"), .trainerName = _("ALIYAH"), - .trainerGfxId = 85, + .trainerGfxId = EVENT_OBJ_GFX_TEALA, .flags = 0x10200FFF, - .whichRank = 1, + .whichRank = CONTEST_RANK_SUPER, .aiPool_Cool = FALSE, .aiPool_Beauty = TRUE, .aiPool_Cute = TRUE, @@ -1487,9 +1487,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_ELEKID, .nickname = _("KIDLEK"), .trainerName = _("NATALIA"), - .trainerGfxId = 18, + .trainerGfxId = EVENT_OBJ_GFX_POKEFAN_F, .flags = 0x20100FFF, - .whichRank = 1, + .whichRank = CONTEST_RANK_SUPER, .aiPool_Cool = TRUE, .aiPool_Beauty = FALSE, .aiPool_Cute = TRUE, @@ -1516,9 +1516,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_SNUBBULL, .nickname = _("SNUBBINS"), .trainerName = _("DEVIN"), - .trainerGfxId = 48, + .trainerGfxId = EVENT_OBJ_GFX_GENTLEMAN, .flags = 0x8080FFF, - .whichRank = 1, + .whichRank = CONTEST_RANK_SUPER, .aiPool_Cool = FALSE, .aiPool_Beauty = FALSE, .aiPool_Cute = TRUE, @@ -1545,9 +1545,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_MISDREAVUS, .nickname = _("DREAVIS"), .trainerName = _("TYLOR"), - .trainerGfxId = 40, + .trainerGfxId = EVENT_OBJ_GFX_HEX_MANIAC, .flags = 0x40040FFF, - .whichRank = 1, + .whichRank = CONTEST_RANK_SUPER, .aiPool_Cool = FALSE, .aiPool_Beauty = TRUE, .aiPool_Cute = FALSE, @@ -1574,9 +1574,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_LAIRON, .nickname = _("LAIRN"), .trainerName = _("RONNIE"), - .trainerGfxId = 55, + .trainerGfxId = EVENT_OBJ_GFX_HIKER, .flags = 0x84000FFF, - .whichRank = 2, + .whichRank = CONTEST_RANK_HYPER, .aiPool_Cool = FALSE, .aiPool_Beauty = FALSE, .aiPool_Cute = FALSE, @@ -1603,9 +1603,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_SHIFTRY, .nickname = _("SHIFTY"), .trainerName = _("CLAUDIA"), - .trainerGfxId = 8, + .trainerGfxId = EVENT_OBJ_GFX_GIRL_1, .flags = 0x82000FFF, - .whichRank = 2, + .whichRank = CONTEST_RANK_HYPER, .aiPool_Cool = TRUE, .aiPool_Beauty = TRUE, .aiPool_Cute = FALSE, @@ -1632,9 +1632,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_NINJASK, .nickname = _("NINAS"), .trainerName = _("ELIAS"), - .trainerGfxId = 11, + .trainerGfxId = EVENT_OBJ_GFX_LITTLE_BOY, .flags = 0x81000FFF, - .whichRank = 2, + .whichRank = CONTEST_RANK_HYPER, .aiPool_Cool = FALSE, .aiPool_Beauty = FALSE, .aiPool_Cute = TRUE, @@ -1661,9 +1661,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_SWELLOW, .nickname = _("WELOW"), .trainerName = _("JADE"), - .trainerGfxId = 18, + .trainerGfxId = EVENT_OBJ_GFX_POKEFAN_F, .flags = 0x80800FFF, - .whichRank = 2, + .whichRank = CONTEST_RANK_HYPER, .aiPool_Cool = TRUE, .aiPool_Beauty = TRUE, .aiPool_Cute = FALSE, @@ -1690,9 +1690,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_MIGHTYENA, .nickname = _("YENA"), .trainerName = _("FRANCIS"), - .trainerGfxId = 44, + .trainerGfxId = EVENT_OBJ_GFX_BLACK_BELT, .flags = 0x80400FFF, - .whichRank = 2, + .whichRank = CONTEST_RANK_HYPER, .aiPool_Cool = FALSE, .aiPool_Beauty = FALSE, .aiPool_Cute = FALSE, @@ -1719,9 +1719,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_BEAUTIFLY, .nickname = _("TIFLY"), .trainerName = _("ALISHA"), - .trainerGfxId = 26, + .trainerGfxId = EVENT_OBJ_GFX_WOMAN_4, .flags = 0x80200FFF, - .whichRank = 2, + .whichRank = CONTEST_RANK_HYPER, .aiPool_Cool = FALSE, .aiPool_Beauty = TRUE, .aiPool_Cute = FALSE, @@ -1748,9 +1748,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_SEAKING, .nickname = _("KINGSEA"), .trainerName = _("SAUL"), - .trainerGfxId = 31, + .trainerGfxId = EVENT_OBJ_GFX_CAMPER, .flags = 0x80100FFF, - .whichRank = 2, + .whichRank = CONTEST_RANK_HYPER, .aiPool_Cool = TRUE, .aiPool_Beauty = FALSE, .aiPool_Cute = TRUE, @@ -1777,9 +1777,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_CASTFORM, .nickname = _("CASTER"), .trainerName = _("FELICIA"), - .trainerGfxId = 47, + .trainerGfxId = EVENT_OBJ_GFX_LASS, .flags = 0x80080FFF, - .whichRank = 2, + .whichRank = CONTEST_RANK_HYPER, .aiPool_Cool = TRUE, .aiPool_Beauty = TRUE, .aiPool_Cute = TRUE, @@ -1806,9 +1806,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_MACHOKE, .nickname = _("CHOKEM"), .trainerName = _("EMILIO"), - .trainerGfxId = 38, + .trainerGfxId = EVENT_OBJ_GFX_SCHOOL_KID_M, .flags = 0x80040FFF, - .whichRank = 2, + .whichRank = CONTEST_RANK_HYPER, .aiPool_Cool = TRUE, .aiPool_Beauty = FALSE, .aiPool_Cute = FALSE, @@ -1835,9 +1835,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_LOMBRE, .nickname = _("LOMBE"), .trainerName = _("KARLA"), - .trainerGfxId = 10, + .trainerGfxId = EVENT_OBJ_GFX_GIRL_2, .flags = 0x80020FFF, - .whichRank = 2, + .whichRank = CONTEST_RANK_HYPER, .aiPool_Cool = FALSE, .aiPool_Beauty = TRUE, .aiPool_Cute = TRUE, @@ -1864,9 +1864,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_SEVIPER, .nickname = _("VIPES"), .trainerName = _("DARRYL"), - .trainerGfxId = 33, + .trainerGfxId = EVENT_OBJ_GFX_MAN_3, .flags = 0x80010FFF, - .whichRank = 2, + .whichRank = CONTEST_RANK_HYPER, .aiPool_Cool = FALSE, .aiPool_Beauty = FALSE, .aiPool_Cute = FALSE, @@ -1893,9 +1893,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_WAILMER, .nickname = _("MERAIL"), .trainerName = _("SELENA"), - .trainerGfxId = 22, + .trainerGfxId = EVENT_OBJ_GFX_EXPERT_F, .flags = 0x80008FFF, - .whichRank = 2, + .whichRank = CONTEST_RANK_HYPER, .aiPool_Cool = FALSE, .aiPool_Beauty = TRUE, .aiPool_Cute = TRUE, @@ -1922,9 +1922,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_MAGIKARP, .nickname = _("KARPAG"), .trainerName = _("NOEL"), - .trainerGfxId = 35, + .trainerGfxId = EVENT_OBJ_GFX_YOUNGSTER, .flags = 0x80004FFF, - .whichRank = 2, + .whichRank = CONTEST_RANK_HYPER, .aiPool_Cool = FALSE, .aiPool_Beauty = FALSE, .aiPool_Cute = TRUE, @@ -1951,9 +1951,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_LUNATONE, .nickname = _("LUNONE"), .trainerName = _("LACEY"), - .trainerGfxId = 16, + .trainerGfxId = EVENT_OBJ_GFX_WOMAN_1, .flags = 0x80002FFF, - .whichRank = 2, + .whichRank = CONTEST_RANK_HYPER, .aiPool_Cool = FALSE, .aiPool_Beauty = TRUE, .aiPool_Cute = FALSE, @@ -1980,9 +1980,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_ABSOL, .nickname = _("ABSO"), .trainerName = _("CORBIN"), - .trainerGfxId = 39, + .trainerGfxId = EVENT_OBJ_GFX_MANIAC, .flags = 0x80001FFF, - .whichRank = 2, + .whichRank = CONTEST_RANK_HYPER, .aiPool_Cool = TRUE, .aiPool_Beauty = TRUE, .aiPool_Cute = FALSE, @@ -2009,9 +2009,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_EXEGGUTOR, .nickname = _("EGGSOR"), .trainerName = _("GRACIE"), - .trainerGfxId = 32, + .trainerGfxId = EVENT_OBJ_GFX_PICNICKER, .flags = 0xC000FFF, - .whichRank = 2, + .whichRank = CONTEST_RANK_HYPER, .aiPool_Cool = FALSE, .aiPool_Beauty = FALSE, .aiPool_Cute = FALSE, @@ -2038,9 +2038,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_CUBONE, .nickname = _("CUBIN"), .trainerName = _("COLTIN"), - .trainerGfxId = 65, + .trainerGfxId = EVENT_OBJ_GFX_MAN_4, .flags = 0x82000FFF, - .whichRank = 2, + .whichRank = CONTEST_RANK_HYPER, .aiPool_Cool = FALSE, .aiPool_Beauty = FALSE, .aiPool_Cute = TRUE, @@ -2067,9 +2067,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_HITMONLEE, .nickname = _("HITMON"), .trainerName = _("ELLIE"), - .trainerGfxId = 22, + .trainerGfxId = EVENT_OBJ_GFX_EXPERT_F, .flags = 0x21000FFF, - .whichRank = 2, + .whichRank = CONTEST_RANK_HYPER, .aiPool_Cool = TRUE, .aiPool_Beauty = FALSE, .aiPool_Cute = FALSE, @@ -2096,9 +2096,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_SQUIRTLE, .nickname = _("SURTLE"), .trainerName = _("MARCUS"), - .trainerGfxId = 49, + .trainerGfxId = EVENT_OBJ_GFX_SAILOR, .flags = 0x20800FFF, - .whichRank = 2, + .whichRank = CONTEST_RANK_HYPER, .aiPool_Cool = FALSE, .aiPool_Beauty = FALSE, .aiPool_Cute = TRUE, @@ -2125,9 +2125,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_KANGASKHAN, .nickname = _("KHANKAN"), .trainerName = _("KIARA"), - .trainerGfxId = 14, + .trainerGfxId = EVENT_OBJ_GFX_GIRL_3, .flags = 0x80400FFF, - .whichRank = 2, + .whichRank = CONTEST_RANK_HYPER, .aiPool_Cool = TRUE, .aiPool_Beauty = FALSE, .aiPool_Cute = FALSE, @@ -2154,9 +2154,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_PINECO, .nickname = _("PINOC"), .trainerName = _("BRYCE"), - .trainerGfxId = 36, + .trainerGfxId = EVENT_OBJ_GFX_BUG_CATCHER, .flags = 0x10200FFF, - .whichRank = 2, + .whichRank = CONTEST_RANK_HYPER, .aiPool_Cool = FALSE, .aiPool_Beauty = TRUE, .aiPool_Cute = FALSE, @@ -2183,9 +2183,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_DUNSPARCE, .nickname = _("DILTOT"), .trainerName = _("JAMIE"), - .trainerGfxId = 34, + .trainerGfxId = EVENT_OBJ_GFX_WOMAN_5, .flags = 0x20100FFF, - .whichRank = 2, + .whichRank = CONTEST_RANK_HYPER, .aiPool_Cool = FALSE, .aiPool_Beauty = FALSE, .aiPool_Cute = TRUE, @@ -2212,9 +2212,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_HOUNDOOM, .nickname = _("DOOMOND"), .trainerName = _("JORGE"), - .trainerGfxId = 48, + .trainerGfxId = EVENT_OBJ_GFX_GENTLEMAN, .flags = 0x8080FFF, - .whichRank = 2, + .whichRank = CONTEST_RANK_HYPER, .aiPool_Cool = TRUE, .aiPool_Beauty = TRUE, .aiPool_Cute = FALSE, @@ -2241,9 +2241,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_MILTANK, .nickname = _("MILKAN"), .trainerName = _("DEVON"), - .trainerGfxId = 25, + .trainerGfxId = EVENT_OBJ_GFX_POKEFAN_M, .flags = 0x40040FFF, - .whichRank = 2, + .whichRank = CONTEST_RANK_HYPER, .aiPool_Cool = FALSE, .aiPool_Beauty = TRUE, .aiPool_Cute = TRUE, @@ -2270,9 +2270,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_GYARADOS, .nickname = _("RADOS"), .trainerName = _("JUSTINA"), - .trainerGfxId = 32, + .trainerGfxId = EVENT_OBJ_GFX_PICNICKER, .flags = 0x84000FFF, - .whichRank = 3, + .whichRank = CONTEST_RANK_MASTER, .aiPool_Cool = TRUE, .aiPool_Beauty = TRUE, .aiPool_Cute = FALSE, @@ -2299,9 +2299,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_LOUDRED, .nickname = _("LOUDERD"), .trainerName = _("RALPH"), - .trainerGfxId = 21, + .trainerGfxId = EVENT_OBJ_GFX_EXPERT_M, .flags = 0x82000FFF, - .whichRank = 3, + .whichRank = CONTEST_RANK_MASTER, .aiPool_Cool = TRUE, .aiPool_Beauty = FALSE, .aiPool_Cute = FALSE, @@ -2328,9 +2328,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_SKITTY, .nickname = _("SITTY"), .trainerName = _("ROSA"), - .trainerGfxId = 8, + .trainerGfxId = EVENT_OBJ_GFX_GIRL_1, .flags = 0x81000FFF, - .whichRank = 3, + .whichRank = CONTEST_RANK_MASTER, .aiPool_Cool = FALSE, .aiPool_Beauty = TRUE, .aiPool_Cute = TRUE, @@ -2357,9 +2357,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_SLAKING, .nickname = _("SLING"), .trainerName = _("KEATON"), - .trainerGfxId = 11, + .trainerGfxId = EVENT_OBJ_GFX_LITTLE_BOY, .flags = 0x80800FFF, - .whichRank = 3, + .whichRank = CONTEST_RANK_MASTER, .aiPool_Cool = FALSE, .aiPool_Beauty = FALSE, .aiPool_Cute = TRUE, @@ -2386,9 +2386,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_ALTARIA, .nickname = _("TARIA"), .trainerName = _("MAYRA"), - .trainerGfxId = 18, + .trainerGfxId = EVENT_OBJ_GFX_POKEFAN_F, .flags = 0x80400FFF, - .whichRank = 3, + .whichRank = CONTEST_RANK_MASTER, .aiPool_Cool = TRUE, .aiPool_Beauty = TRUE, .aiPool_Cute = FALSE, @@ -2415,9 +2415,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_KIRLIA, .nickname = _("LIRKI"), .trainerName = _("LAMAR"), - .trainerGfxId = 15, + .trainerGfxId = EVENT_OBJ_GFX_RICH_BOY, .flags = 0x80200FFF, - .whichRank = 3, + .whichRank = CONTEST_RANK_MASTER, .aiPool_Cool = TRUE, .aiPool_Beauty = FALSE, .aiPool_Cute = FALSE, @@ -2444,9 +2444,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_BELLOSSOM, .nickname = _("BLOSSOM"), .trainerName = _("AUBREY"), - .trainerGfxId = 26, + .trainerGfxId = EVENT_OBJ_GFX_WOMAN_4, .flags = 0x80100FFF, - .whichRank = 3, + .whichRank = CONTEST_RANK_MASTER, .aiPool_Cool = FALSE, .aiPool_Beauty = TRUE, .aiPool_Cute = TRUE, @@ -2473,9 +2473,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_SABLEYE, .nickname = _("EYESAB"), .trainerName = _("NIGEL"), - .trainerGfxId = 31, + .trainerGfxId = EVENT_OBJ_GFX_CAMPER, .flags = 0x80080FFF, - .whichRank = 3, + .whichRank = CONTEST_RANK_MASTER, .aiPool_Cool = FALSE, .aiPool_Beauty = FALSE, .aiPool_Cute = TRUE, @@ -2502,9 +2502,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_NATU, .nickname = _("UTAN"), .trainerName = _("CAMILLE"), - .trainerGfxId = 47, + .trainerGfxId = EVENT_OBJ_GFX_LASS, .flags = 0x80040FFF, - .whichRank = 3, + .whichRank = CONTEST_RANK_MASTER, .aiPool_Cool = FALSE, .aiPool_Beauty = FALSE, .aiPool_Cute = TRUE, @@ -2531,9 +2531,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_SHARPEDO, .nickname = _("PEDOS"), .trainerName = _("DEON"), - .trainerGfxId = 38, + .trainerGfxId = EVENT_OBJ_GFX_SCHOOL_KID_M, .flags = 0x80020FFF, - .whichRank = 3, + .whichRank = CONTEST_RANK_MASTER, .aiPool_Cool = TRUE, .aiPool_Beauty = FALSE, .aiPool_Cute = TRUE, @@ -2560,9 +2560,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_LUVDISC, .nickname = _("LUVIS"), .trainerName = _("JANELLE"), - .trainerGfxId = 10, + .trainerGfxId = EVENT_OBJ_GFX_GIRL_2, .flags = 0x80010FFF, - .whichRank = 3, + .whichRank = CONTEST_RANK_MASTER, .aiPool_Cool = FALSE, .aiPool_Beauty = FALSE, .aiPool_Cute = TRUE, @@ -2589,9 +2589,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_HERACROSS, .nickname = _("HEROSS"), .trainerName = _("HEATH"), - .trainerGfxId = 33, + .trainerGfxId = EVENT_OBJ_GFX_MAN_3, .flags = 0x80008FFF, - .whichRank = 3, + .whichRank = CONTEST_RANK_MASTER, .aiPool_Cool = TRUE, .aiPool_Beauty = FALSE, .aiPool_Cute = FALSE, @@ -2618,9 +2618,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_ELECTRODE, .nickname = _("RODLECT"), .trainerName = _("SASHA"), - .trainerGfxId = 6, + .trainerGfxId = EVENT_OBJ_GFX_TWIN, .flags = 0x80004FFF, - .whichRank = 3, + .whichRank = CONTEST_RANK_MASTER, .aiPool_Cool = TRUE, .aiPool_Beauty = TRUE, .aiPool_Cute = FALSE, @@ -2647,9 +2647,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_PICHU, .nickname = _("CHUPY"), .trainerName = _("FRANKIE"), - .trainerGfxId = 35, + .trainerGfxId = EVENT_OBJ_GFX_YOUNGSTER, .flags = 0x80002FFF, - .whichRank = 3, + .whichRank = CONTEST_RANK_MASTER, .aiPool_Cool = FALSE, .aiPool_Beauty = TRUE, .aiPool_Cute = TRUE, @@ -2676,9 +2676,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_WOBBUFFET, .nickname = _("WOBET"), .trainerName = _("HELEN"), - .trainerGfxId = 16, + .trainerGfxId = EVENT_OBJ_GFX_WOMAN_1, .flags = 0x80001FFF, - .whichRank = 3, + .whichRank = CONTEST_RANK_MASTER, .aiPool_Cool = TRUE, .aiPool_Beauty = TRUE, .aiPool_Cute = FALSE, @@ -2705,9 +2705,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_GENGAR, .nickname = _("GAREN"), .trainerName = _("CAMILE"), - .trainerGfxId = 40, + .trainerGfxId = EVENT_OBJ_GFX_HEX_MANIAC, .flags = 0xC000FFF, - .whichRank = 3, + .whichRank = CONTEST_RANK_MASTER, .aiPool_Cool = TRUE, .aiPool_Beauty = FALSE, .aiPool_Cute = FALSE, @@ -2734,9 +2734,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_PORYGON, .nickname = _("GONPOR"), .trainerName = _("MARTIN"), - .trainerGfxId = 46, + .trainerGfxId = EVENT_OBJ_GFX_SCIENTIST_1, .flags = 0x82000FFF, - .whichRank = 3, + .whichRank = CONTEST_RANK_MASTER, .aiPool_Cool = TRUE, .aiPool_Beauty = TRUE, .aiPool_Cute = TRUE, @@ -2763,9 +2763,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_DRAGONITE, .nickname = _("DRITE"), .trainerName = _("SERGIO"), - .trainerGfxId = 7, + .trainerGfxId = EVENT_OBJ_GFX_BOY_1, .flags = 0x21000FFF, - .whichRank = 3, + .whichRank = CONTEST_RANK_MASTER, .aiPool_Cool = TRUE, .aiPool_Beauty = FALSE, .aiPool_Cute = FALSE, @@ -2792,9 +2792,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_MEOWTH, .nickname = _("MEOWY"), .trainerName = _("KAILEY"), - .trainerGfxId = 6, + .trainerGfxId = EVENT_OBJ_GFX_TWIN, .flags = 0x20800FFF, - .whichRank = 3, + .whichRank = CONTEST_RANK_MASTER, .aiPool_Cool = FALSE, .aiPool_Beauty = FALSE, .aiPool_Cute = TRUE, @@ -2821,9 +2821,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_JYNX, .nickname = _("NYX"), .trainerName = _("PERLA"), - .trainerGfxId = 45, + .trainerGfxId = EVENT_OBJ_GFX_BEAUTY, .flags = 0x80400FFF, - .whichRank = 3, + .whichRank = CONTEST_RANK_MASTER, .aiPool_Cool = FALSE, .aiPool_Beauty = TRUE, .aiPool_Cute = FALSE, @@ -2850,9 +2850,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_TOGEPI, .nickname = _("GEPITO"), .trainerName = _("CLARA"), - .trainerGfxId = 20, + .trainerGfxId = EVENT_OBJ_GFX_WOMAN_2, .flags = 0x10200FFF, - .whichRank = 3, + .whichRank = CONTEST_RANK_MASTER, .aiPool_Cool = FALSE, .aiPool_Beauty = FALSE, .aiPool_Cute = TRUE, @@ -2879,9 +2879,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_ESPEON, .nickname = _("SPEON"), .trainerName = _("JAKOB"), - .trainerGfxId = 37, + .trainerGfxId = EVENT_OBJ_GFX_PSYCHIC_M, .flags = 0x20100FFF, - .whichRank = 3, + .whichRank = CONTEST_RANK_MASTER, .aiPool_Cool = TRUE, .aiPool_Beauty = TRUE, .aiPool_Cute = FALSE, @@ -2908,9 +2908,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_SLOWKING, .nickname = _("SLOWGO"), .trainerName = _("TREY"), - .trainerGfxId = 49, + .trainerGfxId = EVENT_OBJ_GFX_SAILOR, .flags = 0x8080FFF, - .whichRank = 3, + .whichRank = CONTEST_RANK_MASTER, .aiPool_Cool = FALSE, .aiPool_Beauty = FALSE, .aiPool_Cute = TRUE, @@ -2937,9 +2937,9 @@ const struct ContestPokemon gContestOpponents[] = .species = SPECIES_URSARING, .nickname = _("URSING"), .trainerName = _("LANE"), - .trainerGfxId = 44, + .trainerGfxId = EVENT_OBJ_GFX_BLACK_BELT, .flags = 0x40040FFF, - .whichRank = 3, + .whichRank = CONTEST_RANK_MASTER, .aiPool_Cool = TRUE, .aiPool_Beauty = FALSE, .aiPool_Cute = FALSE, @@ -2967,7 +2967,7 @@ const struct ContestPokemon gContestOpponents[] = const u8 gPostgameContestOpponentFilter[] = { - [CONTEST_OPPONENT_JIMMY] = CONTEST_FILTER_NONE, + [CONTEST_OPPONENT_JIMMY] = CONTEST_FILTER_NONE, [CONTEST_OPPONENT_EDITH] = CONTEST_FILTER_NONE, [CONTEST_OPPONENT_EVAN] = CONTEST_FILTER_NONE, [CONTEST_OPPONENT_KELSEY] = CONTEST_FILTER_NONE, @@ -2999,7 +2999,7 @@ const u8 gPostgameContestOpponentFilter[] = [CONTEST_OPPONENT_MORGAN] = CONTEST_FILTER_NONE, [CONTEST_OPPONENT_SUMMER] = CONTEST_FILTER_NONE, [CONTEST_OPPONENT_MILES] = CONTEST_FILTER_NONE, - [CONTEST_OPPONENT_AUDREY] = CONTEST_FILTER_NONE, + [CONTEST_OPPONENT_AUDREY] = CONTEST_FILTER_NONE, [CONTEST_OPPONENT_AVERY] = CONTEST_FILTER_NONE, [CONTEST_OPPONENT_ARIANA] = CONTEST_FILTER_NONE, [CONTEST_OPPONENT_ASHTON] = CONTEST_FILTER_NONE, @@ -3031,7 +3031,7 @@ const u8 gPostgameContestOpponentFilter[] = [CONTEST_OPPONENT_LACEY] = CONTEST_FILTER_NONE, [CONTEST_OPPONENT_CORBIN] = CONTEST_FILTER_NONE, [CONTEST_OPPONENT_GRACIE] = CONTEST_FILTER_ONLY_POSTGAME, - [CONTEST_OPPONENT_COLTIN] = CONTEST_FILTER_ONLY_POSTGAME, + [CONTEST_OPPONENT_COLTIN] = CONTEST_FILTER_ONLY_POSTGAME, [CONTEST_OPPONENT_ELLIE] = CONTEST_FILTER_ONLY_POSTGAME, [CONTEST_OPPONENT_MARCUS] = CONTEST_FILTER_ONLY_POSTGAME, [CONTEST_OPPONENT_KIARA] = CONTEST_FILTER_ONLY_POSTGAME, @@ -3063,4 +3063,4 @@ const u8 gPostgameContestOpponentFilter[] = [CONTEST_OPPONENT_JAKOB] = CONTEST_FILTER_ONLY_POSTGAME, [CONTEST_OPPONENT_TREY] = CONTEST_FILTER_ONLY_POSTGAME, [CONTEST_OPPONENT_LANE] = CONTEST_FILTER_ONLY_POSTGAME -}; \ No newline at end of file +}; diff --git a/src/data/contest_text_tables.h b/src/data/contest_text_tables.h index fa32f33b5..8375520d1 100644 --- a/src/data/contest_text_tables.h +++ b/src/data/contest_text_tables.h @@ -196,53 +196,53 @@ extern const u8 gText_0827E8CA[]; const u8 *const gContestEffectDescriptionPointers[] = { gContestEffect00hDescription, - gContestEffect01hDescription, + gContestEffect01hDescription, gContestEffect02hDescription, - gContestEffect03hDescription, - gContestEffect04hDescription, - gContestEffect05hDescription, - gContestEffect06hDescription, - gContestEffect07hDescription, - gContestEffect08hDescription, - gContestEffect09hDescription, - gContestEffect0AhDescription, - gContestEffect0BhDescription, - gContestEffect0ChDescription, - gContestEffect0DhDescription, - gContestEffect0EhDescription, - gContestEffect0FhDescription, - gContestEffect10hDescription, - gContestEffect11hDescription, - gContestEffect12hDescription, - gContestEffect13hDescription, - gContestEffect14hDescription, - gContestEffect15hDescription, - gContestEffect16hDescription, - gContestEffect17hDescription, - gContestEffect18hDescription, - gContestEffect19hDescription, - gContestEffect1AhDescription, - gContestEffect1BhDescription, - gContestEffect1ChDescription, - gContestEffect1DhDescription, - gContestEffect1EhDescription, - gContestEffect1FhDescription, - gContestEffect20hDescription, - gContestEffect21hDescription, - gContestEffect22hDescription, - gContestEffect23hDescription, - gContestEffect24hDescription, - gContestEffect25hDescription, - gContestEffect26hDescription, - gContestEffect27hDescription, - gContestEffect28hDescription, - gContestEffect29hDescription, - gContestEffect2AhDescription, - gContestEffect2BhDescription, - gContestEffect2ChDescription, - gContestEffect2DhDescription, - gContestEffect2EhDescription, - gContestEffect2FhDescription + gContestEffect03hDescription, + gContestEffect04hDescription, + gContestEffect05hDescription, + gContestEffect06hDescription, + gContestEffect07hDescription, + gContestEffect08hDescription, + gContestEffect09hDescription, + gContestEffect0AhDescription, + gContestEffect0BhDescription, + gContestEffect0ChDescription, + gContestEffect0DhDescription, + gContestEffect0EhDescription, + gContestEffect0FhDescription, + gContestEffect10hDescription, + gContestEffect11hDescription, + gContestEffect12hDescription, + gContestEffect13hDescription, + gContestEffect14hDescription, + gContestEffect15hDescription, + gContestEffect16hDescription, + gContestEffect17hDescription, + gContestEffect18hDescription, + gContestEffect19hDescription, + gContestEffect1AhDescription, + gContestEffect1BhDescription, + gContestEffect1ChDescription, + gContestEffect1DhDescription, + gContestEffect1EhDescription, + gContestEffect1FhDescription, + gContestEffect20hDescription, + gContestEffect21hDescription, + gContestEffect22hDescription, + gContestEffect23hDescription, + gContestEffect24hDescription, + gContestEffect25hDescription, + gContestEffect26hDescription, + gContestEffect27hDescription, + gContestEffect28hDescription, + gContestEffect29hDescription, + gContestEffect2AhDescription, + gContestEffect2BhDescription, + gContestEffect2ChDescription, + gContestEffect2DhDescription, + gContestEffect2EhDescription, + gContestEffect2FhDescription }; // Unreferenced array of pointers to move names. @@ -278,18 +278,18 @@ const u8 *const gContestMoveTypeTextPointers[] = const u8 *const gUnknown_08587D5C[] = { gText_0827D5C1, - gText_0827D5DC, - gText_0827D600, - gText_0827D612, - gText_0827D612, - gText_0827D62D, - gText_0827D654, - gText_0827D67E, - gText_0827D69C, - gText_0827D6BA, - gText_0827D6E5, - gText_0827D706, - gText_0827D71D + gText_0827D5DC, + gText_0827D600, + gText_0827D612, + gText_0827D612, + gText_0827D62D, + gText_0827D654, + gText_0827D67E, + gText_0827D69C, + gText_0827D6BA, + gText_0827D6E5, + gText_0827D706, + gText_0827D71D }; const u8 *const gUnknown_08587D90[] = @@ -411,4 +411,4 @@ const u8 *const gUnknown_08587F1C[] = gText_0827E8B4, gText_0827E8BF, gText_0827E8CA -}; \ No newline at end of file +}; -- cgit v1.2.3 From 23ac2cc94e2914a427e97467103c0160af6f1be0 Mon Sep 17 00:00:00 2001 From: Phlosioneer Date: Sun, 31 Mar 2019 20:15:44 -0400 Subject: Prep for merge --- src/contest.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/contest.c b/src/contest.c index da3075e65..53d7e547d 100644 --- a/src/contest.c +++ b/src/contest.c @@ -412,14 +412,16 @@ const struct Subsprite gSubspriteTable_8587B78[] = { .x = -28, .y = -4, - SPRITE_SIZE_32x8, + .shape = ST_OAM_H_RECTANGLE, + .size = 1, .tileOffset = 0, .priority = 0 }, { .x = 4, .y = -4, - SPRITE_SIZE_32x8, + .shape = ST_OAM_H_RECTANGLE, + .size = 1, .tileOffset = 4, .priority = 0 } -- cgit v1.2.3 From b7057e8d923e78c6d29ab122b3e136ca93fdd7b4 Mon Sep 17 00:00:00 2001 From: Phlosioneer Date: Sun, 31 Mar 2019 20:33:25 -0400 Subject: Update OAMs to use new constants --- src/contest.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/contest.c b/src/contest.c index 53d7e547d..0591668ff 100644 --- a/src/contest.c +++ b/src/contest.c @@ -272,10 +272,10 @@ static const struct OamData gOamData_8587A7C = .objMode = 0, .mosaic = 0, .bpp = 0, - .shape = 0, + .shape = SPRITE_SHAPE(8x8), .x = 0, .matrixNum = 0, - .size = 0, + .size = SPRITE_SIZE(8x8), .tileNum = 0, .priority = 0, .paletteNum = 0, @@ -357,10 +357,10 @@ static const struct OamData gOamData_8587B10 = .objMode = 0, .mosaic = 0, .bpp = 0, - .shape = 1, + .shape = SPRITE_SHAPE(32x8), .x = 0, .matrixNum = 0, - .size = 1, + .size = SPRITE_SIZE(32x8), .tileNum = 0, .priority = 0, .paletteNum = 0, @@ -449,10 +449,10 @@ const struct OamData gOamData_8587B90 = .objMode = 0, .mosaic = 0, .bpp = 0, - .shape = 0, + .shape = SPRITE_SHAPE(16x16), .x = 0, .matrixNum = 0, - .size = 1, + .size = SPRITE_SIZE(16x16), .tileNum = 0, .priority = 0, .paletteNum = 0, @@ -490,10 +490,10 @@ const struct OamData gOamData_8587BC0 = .objMode = 0, .mosaic = 0, .bpp = 0, - .shape = 1, + .shape = SPRITE_SHAPE(64x32), .x = 0, .matrixNum = 0, - .size = 3, + .size = SPRITE_SIZE(64x32), .tileNum = 0, .priority = 0, .paletteNum = 0, @@ -518,10 +518,10 @@ const struct OamData gOamData_8587BE0 = .objMode = 0, .mosaic = 0, .bpp = 0, - .shape = 0, + .shape = SPRITE_SHAPE(64x64), .x = 0, .matrixNum = 0, - .size = 3, + .size = SPRITE_SIZE(64x64), .tileNum = 0, .priority = 3, .paletteNum = 2, @@ -772,10 +772,10 @@ const struct OamData gOamData_8589944 = .objMode = 1, .mosaic = 0, .bpp = 0, - .shape = 0, + .shape = SPRITE_SHAPE(64x64), .x = 0, .matrixNum = 0, - .size = 3, + .size = SPRITE_SIZE(64x64), .tileNum = 0, .priority = 0, .paletteNum = 0, -- cgit v1.2.3 From 3181c64c64afa47b3adc04f325ad3798c8c324ec Mon Sep 17 00:00:00 2001 From: Phlosioneer Date: Sun, 31 Mar 2019 20:40:14 -0400 Subject: Change names from MAP_AREA_ to MAP_GROUP_ --- src/pokedex_area_screen.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/pokedex_area_screen.c b/src/pokedex_area_screen.c index d43c556c8..7404e9d5a 100755 --- a/src/pokedex_area_screen.c +++ b/src/pokedex_area_screen.c @@ -341,11 +341,11 @@ static void FindMapsWithMon(u16 species) { switch (sFeebasData[i][1]) { - case MAP_AREA_OVERWORLD_MONS: + case MAP_GROUP_OVERWORLD_MONS: SetAreaHasMon(sFeebasData[i][1], sFeebasData[i][2]); break; - case MAP_AREA_SPECIAL_MONS_1: - case MAP_AREA_SPECIAL_MONS_2: + case MAP_GROUP_SPECIAL_MONS_1: + case MAP_GROUP_SPECIAL_MONS_2: SetSpecialMapHasMon(sFeebasData[i][1], sFeebasData[i][2]); break; } @@ -358,11 +358,11 @@ static void FindMapsWithMon(u16 species) { switch (gWildMonHeaders[i].mapGroup) { - case MAP_AREA_OVERWORLD_MONS: + case MAP_GROUP_OVERWORLD_MONS: SetAreaHasMon(gWildMonHeaders[i].mapGroup, gWildMonHeaders[i].mapNum); break; - case MAP_AREA_SPECIAL_MONS_1: - case MAP_AREA_SPECIAL_MONS_2: + case MAP_GROUP_SPECIAL_MONS_1: + case MAP_GROUP_SPECIAL_MONS_2: SetSpecialMapHasMon(gWildMonHeaders[i].mapGroup, gWildMonHeaders[i].mapNum); break; } -- cgit v1.2.3 From 1fe52085606ccd9258eea5a037c43b30fc04d7c5 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Mon, 1 Apr 2019 12:05:58 -0400 Subject: through sub_801A02C --- src/union_room_player_avatar.c | 462 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 462 insertions(+) create mode 100644 src/union_room_player_avatar.c (limited to 'src') diff --git a/src/union_room_player_avatar.c b/src/union_room_player_avatar.c new file mode 100644 index 000000000..298ad04c7 --- /dev/null +++ b/src/union_room_player_avatar.c @@ -0,0 +1,462 @@ +#include "global.h" +#include "constants/flags.h" +#include "constants/event_object_movement_constants.h" +#include "event_data.h" +#include "event_object_movement.h" +#include "script.h" +#include "field_player_avatar.h" +#include "fieldmap.h" +#include "union_room.h" +#include "task.h" + +EWRAM_DATA struct UnkStruct_8019BA8 * gUnknown_02022C64 = NULL; +EWRAM_DATA u32 gUnknown_02022C68 = 0; + +u8 sub_8019DF4(void); +bool32 sub_8019F8C(u32 playerIdx, u32 arg1); +void sub_801A3B0(u32 arg0, u32 arg1, u8 arg2); + +ALIGNED(4) const u8 gUnknown_082F072C[][10] = { + {0x21, 0x2c, 0x1f, 0x23, 0x25, 0x24, 0x41, 0x42}, + {0x22, 0x28, 0x20, 0x2f, 0x2f, 0x0e, 0x14, 0x2d} +}; + +const s16 gUnknown_082F0740[][2] = { + {0x4, 0x6}, + {0xd, 0x8}, + {0xa, 0x6}, + {0x1, 0x8}, + {0xd, 0x4}, + {0x7, 0x4}, + {0x1, 0x4}, + {0x7, 0x8} +}; + +const s8 gUnknown_082F0760[][2] = { + { 0, 0}, + { 1, 0}, + { 0, -1}, + {-1, 0}, + { 0, 1} +}; + +const u8 gUnknown_082F076A[] = { + 0x00, 0x02, 0x01, 0x04, 0x03 +}; + +const u8 gUnknown_082F076F[] = { + 0x01, 0x03, 0x01, 0x04, 0x02 +}; + +const u8 gUnknown_082F0774[] = { + 0x09, 0x08, 0x07, 0x02, 0x06, 0x05, 0x04, 0x03, + 0xbf, 0x02, 0xc0, 0x02, 0xc1, 0x02, 0xc2, 0x02, + 0xc3, 0x02, 0xc4, 0x02, 0xc5, 0x02, 0xc6, 0x02 +}; + +const u8 gUnknown_082F078C[2] = { + MOVEMENT_ACTION_FLY_UP, + MOVEMENT_ACTION_STEP_END +}; + +const u8 gUnknown_082F078E[2] = { + MOVEMENT_ACTION_FLY_DOWN, + MOVEMENT_ACTION_STEP_END +}; + +bool32 is_walking_or_running(void) +{ + if (gPlayerAvatar.tileTransitionState == 2 || gPlayerAvatar.tileTransitionState == 0) + { + return TRUE; + } + else + { + return FALSE; + } +} + +u8 sub_8019978(u32 a0, u32 a1) +{ + return gUnknown_082F072C[a0][a1 % 8]; +} + +void sub_8019990(u32 a0, u32 a1, s32 * a2, s32 * a3) +{ + *a2 = gUnknown_082F0740[a0][0] + gUnknown_082F0760[a1][0] + 7; + *a3 = gUnknown_082F0740[a0][1] + gUnknown_082F0760[a1][1] + 7; +} + +bool32 sub_80199E0(u32 a0, u32 a1, s32 a2, s32 a3) +{ + if (gUnknown_082F0740[a0][0] + gUnknown_082F0760[a1][0] + 7 != a2) + { + return FALSE; + } + else if (gUnknown_082F0740[a0][1] + gUnknown_082F0760[a1][1] + 7 != a3) + { + return FALSE; + } + else + { + return TRUE; + } +} + +bool32 IsUnionRoomPlayerHidden(u32 player_idx) +{ + return FlagGet(FLAG_HIDE_UNION_ROOM_PLAYER_1 + player_idx); +} + +void HideUnionRoomPlayer(u32 player_idx) +{ + FlagSet(FLAG_HIDE_UNION_ROOM_PLAYER_1 + player_idx); +} + +void ShowUnionRoomPlayer(u32 player_idx) +{ + FlagClear(FLAG_HIDE_UNION_ROOM_PLAYER_1 + player_idx); +} + +void SetUnionRoomPlayerGfx(u32 playerIdx, u32 gfxId) +{ + VarSet(VAR_OBJ_GFX_ID_0 + playerIdx, gfxId); +} + +void CreateUnionRoomPlayerEventObject(u32 playerIdx) +{ + show_sprite(gUnknown_082F0774[playerIdx], gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup); +} + +void RemoveUnionRoomPlayerEventObject(u32 playerIdx) +{ + RemoveEventObjectByLocalIdAndMap(gUnknown_082F0774[playerIdx], gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup); +} + +bool32 SetUnionRoomPlayerEnterExitMovement(u32 playerIdx, const u8 * movement) +{ + u8 objectId; + struct EventObject * object; + if (TryGetEventObjectIdByLocalIdAndMap(gUnknown_082F0774[playerIdx], gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, &objectId)) + { + return FALSE; + } + object = &gEventObjects[objectId]; + if (EventObjectIsMovementOverridden(object)) + { + return FALSE; + } + if (EventObjectSetHeldMovement(object, *movement)) + { + return FALSE; + } + return TRUE; +} + +bool32 sub_8019B3C(u32 playerIdx) +{ + u8 objectId; + struct EventObject * object; + if (TryGetEventObjectIdByLocalIdAndMap(gUnknown_082F0774[playerIdx], gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, &objectId)) + { + return TRUE; + } + object = &gEventObjects[objectId]; + if (!EventObjectClearHeldMovementIfFinished(object)) + { + return FALSE; + } + if (!ScriptContext2_IsEnabled()) + { + UnfreezeEventObject(object); + } + else + { + FreezeEventObject(object); + } + return TRUE; +} + +u8 sub_8019BA8(struct UnkStruct_8019BA8 * ptr) +{ + s32 i; + + gUnknown_02022C68 = 0; + gUnknown_02022C64 = ptr; + for (i = 0; i < 8; i++) + { + ptr[i].field_0 = 0; + ptr[i].field_1 = 0; + ptr[i].field_2 = 0; + ptr[i].field_3 = 0; + } + return sub_8019DF4(); +} + +bool32 sub_8019BDC(s8 * a0, u32 playerIdx, struct UnkStruct_8019BA8 * ptr) +{ + switch (*a0) + { + case 0: + if (SetUnionRoomPlayerEnterExitMovement(playerIdx, gUnknown_082F078C) == TRUE) + { + HideUnionRoomPlayer(playerIdx); + (*a0)++; + } + break; + case 1: + if (sub_8019B3C(playerIdx)) + { + RemoveUnionRoomPlayerEventObject(playerIdx); + HideUnionRoomPlayer(playerIdx); + *a0 = 0; + return TRUE; + } + break; + } + return FALSE; +} + +bool32 sub_8019C38(s8 * a0, u32 playerIdx, struct UnkStruct_8019BA8 * ptr) +{ + s16 x, y; + + switch (*a0) + { + case 0: + if (!is_walking_or_running()) + { + break; + } + PlayerGetDestCoords(&x, &y); + if (sub_80199E0(playerIdx, 0, x, y) == 1) + { + break; + } + player_get_pos_including_state_based_drift(&x, &y); + if (sub_80199E0(playerIdx, 0, x, y) == 1) + { + break; + } + SetUnionRoomPlayerGfx(playerIdx, ptr->field_1); + CreateUnionRoomPlayerEventObject(playerIdx); + ShowUnionRoomPlayer(playerIdx); + (*a0)++; + // fallthrough + case 3: // incorrect? + if (SetUnionRoomPlayerEnterExitMovement(playerIdx, gUnknown_082F078E) == 1) + { + (*a0)++; + } + break; + case 2: + if (sub_8019B3C(playerIdx)) + { + *a0 = 0; + return TRUE; + } + break; + } + return FALSE; +} + +bool32 sub_8019CF0(u32 playerIdx, u32 a1, u32 a2) +{ + struct UnkStruct_8019BA8 * ptr = &gUnknown_02022C64[playerIdx]; + ptr->field_3 = 1; + ptr->field_1 = sub_8019978(a1, a2); + if (ptr->field_0 == 0) + { + return TRUE; + } + else + { + return FALSE; + } +} + +bool32 sub_8019D20(u32 playerIdx) +{ + struct UnkStruct_8019BA8 * ptr = &gUnknown_02022C64[playerIdx]; + ptr->field_3 = 2; + if (ptr->field_0 == 1) + { + return TRUE; + } + else + { + return FALSE; + } +} + +void sub_8019D44(u32 playerIdx, struct UnkStruct_8019BA8 * ptr) +{ + switch (ptr->field_0) + { + case 0: + if (ptr->field_3 == 1) + { + ptr->field_0 = 2; + ptr->field_2 = 0; + } + else + { + break; + } + // fallthrough + case 2: + if (!sub_8019F8C(playerIdx, 0) && ptr->field_3 == 2) + { + ptr->field_0 = 0; + ptr->field_2 = 0; + RemoveUnionRoomPlayerEventObject(playerIdx); + HideUnionRoomPlayer(playerIdx); + } + else if (sub_8019C38(&ptr->field_2, playerIdx, ptr) == 1) + { + ptr->field_0 = 1; + } + break; + case 1: + if (ptr->field_3 == 2) + { + ptr->field_0 = 3; + ptr->field_2 = 0; + } + else + { + break; + } + // fallthrough + case 3: + if (sub_8019BDC(&ptr->field_2, playerIdx, ptr) == 1) + { + ptr->field_0 = 0; + } + break; + } + ptr->field_3 = 0; +} + +void sub_8019DD0(u8 taskId) +{ + s32 i; + for (i = 0; i < 8; i++) + { + sub_8019D44(i, &gUnknown_02022C64[i]); + } +} + +u8 sub_8019DF4(void) +{ + if (FuncIsActiveTask(sub_8019DD0) == 1) + { + return NUM_TASKS; + } + else + { + return CreateTask(sub_8019DD0, 5); + } +} + +void sub_8019E20(void) +{ + u8 taskId = FindTaskIdByFunc(sub_8019DD0); + if (taskId < NUM_TASKS) + { + DestroyTask(taskId); + } +} + +void sub_8019E3C(void) +{ + s32 i; + for (i = 0; i < 8; i++) + { + if (!IsUnionRoomPlayerHidden(i)) + { + RemoveUnionRoomPlayerEventObject(i); + HideUnionRoomPlayer(i); + } + } + gUnknown_02022C64 = NULL; + sub_8019E20(); +} + +void sub_8019E70(u8 * sp8, s32 r9) +{ + s32 r7; + + for (r7 = 0; r7 < 5; r7++) + { + s32 r5 = 5 * r9 + r7; + sp8[r5] = sprite_new(0x41, r5 - 0x38, gUnknown_082F0740[r9][0] + gUnknown_082F0760[r7][0], gUnknown_082F0740[r9][1] + gUnknown_082F0760[r7][1], 3, 1); + sub_8097C44(r5 - 0x38, TRUE); + } +} + +void sub_8019F04(u8 * r5) +{ + s32 i; + for (i = 0; i < 40; i++) + { + DestroySprite(&gSprites[r5[i]]); + } +} + +void sub_8019F2C(void) +{ + s32 i, j, x, y; + for (i = 0; i < 8; i++) + { + for (j = 0; j < 5; j++) + { + sub_8019990(i, j, &x, &y); + sub_8088B94(x, y, 0); + } + } +} + +u8 sub_8019F64(u32 r1, u32 unused, struct UnkLinkRfuStruct_02022B14 * r2) +{ + if (r1 != 0) + { + return gUnknown_082F076F[r1]; + } + else if (r2->unk_0a_0 == 0x45) + { + return 1; + } + else + { + return 4; + } +} + +u32 sub_8019F8C(u32 a0, u32 a1) +{ + return sub_8097C8C(5 * a0 + a1 - 0x38); +} + +void sub_8019FA4(u32 r5, u32 r6, u8 r8, struct UnkLinkRfuStruct_02022B14 * r9) +{ + s32 x, y; + s32 r7 = 5 * r5 + r6; + if (sub_8019F8C(r5, r6) == 1) + { + sub_8097C44(r7 - 0x38, FALSE); + sub_8097CC4(r7 - 0x38, 1); + } + sub_8097BB4(r7 - 0x38, r8); + sub_801A3B0(r6, r5, sub_8019F64(r6, r5, r9)); + sub_8019990(r5, r6, &x, &y); + sub_8088B94(x, y, 1); +} + +void sub_801A02C(u32 a0, u32 a1) +{ + s32 x, y; + sub_8097CC4(5 * a0 + a1 - 0x38, 2); + sub_8019990(a0, a1, &x, &y); + sub_8088B94(x, y, 0); +} -- cgit v1.2.3 From ce89cf6f75a94e08d02cc8c60147469c91ea99c9 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Mon, 1 Apr 2019 14:09:56 -0400 Subject: through sub_801A3D0 --- src/union_room_player_avatar.c | 151 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 150 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/union_room_player_avatar.c b/src/union_room_player_avatar.c index 298ad04c7..e7af24b38 100644 --- a/src/union_room_player_avatar.c +++ b/src/union_room_player_avatar.c @@ -14,7 +14,7 @@ EWRAM_DATA u32 gUnknown_02022C68 = 0; u8 sub_8019DF4(void); bool32 sub_8019F8C(u32 playerIdx, u32 arg1); -void sub_801A3B0(u32 arg0, u32 arg1, u8 arg2); +void sub_801A3B0(s32 arg0, s32 arg1, u8 arg2); ALIGNED(4) const u8 gUnknown_082F072C[][10] = { {0x21, 0x2c, 0x1f, 0x23, 0x25, 0x24, 0x41, 0x42}, @@ -460,3 +460,152 @@ void sub_801A02C(u32 a0, u32 a1) sub_8019990(a0, a1, &x, &y); sub_8088B94(x, y, 0); } + +void sub_801A064(u32 r7, struct UnkLinkRfuStruct_02022B14 * r8) +{ + s16 x, y, x2, y2; + s32 i; + + PlayerGetDestCoords(&x, &y); + player_get_pos_including_state_based_drift(&x2, &y2); + if (sub_8097C8C(5 * r7 - 0x38) == 1) + { + if (sub_80199E0(r7, 0, x, y) == 1 || sub_80199E0(r7, 0, x2, y2) == 1) + { + return; + } + sub_8019FA4(r7, 0, sub_8019978(r8->playerGender, r8->unk_00.playerTrainerId[0]), r8); + } + for (i = 1; i < 5; i++) + { + if (r8->unk_04[i - 1] == 0) + { + sub_801A02C(r7, i); + } + else if (sub_80199E0(r7, i, x, y) == 0 && sub_80199E0(r7, i, x2, y2) == 0) + { + sub_8019FA4(r7, i, sub_8019978((r8->unk_04[i - 1] >> 3) & 1, r8->unk_04[i - 1] & 7), r8); + } + } +} + +void sub_801A16C(u32 r5, struct UnkLinkRfuStruct_02022B14 * r4) +{ + u32 i; + switch (r4->unk_0a_0) + { + case 0x40: + case 0x54: + sub_8019CF0(r5, r4->playerGender, r4->unk_00.playerTrainerId[0]); + for (i = 0; i < 5; i++) + { + sub_801A02C(r5, i); + } + break; + case 0x41: + case 0x44: + case 0x45: + case 0x48: + case 0x51: + case 0x52: + case 0x53: + sub_8019D20(r5); + sub_801A064(r5, r4); + break; + } +} + +void sub_801A214(u32 r5, struct UnkLinkRfuStruct_02022B14 * unused) +{ + s32 i; + sub_8019D20(r5); + for (i = 0; i < 5; i++) + { + sub_801A02C(r5, i); + } +} + +void sub_801A234(struct UnkStruct_URoom *r0) +{ + s32 i; + struct UnkStruct_x20 * r4; + gUnknown_02022C68 = 0; + for (i = 0, r4 = r0->field_0->arr; i < 8; i++) + { + if (r4[i].field_1A_0 == 1) + { + sub_801A16C(i, &r4[i].unk.field_0); + } + else if (r4[i].field_1A_0 == 2) + { + sub_801A214(i, &r4[i].unk.field_0); + } + } +} + +void sub_801A274(void) +{ + gUnknown_02022C68 = 300; +} + +void sub_801A284(struct UnkStruct_URoom *r2) +{ + if (++gUnknown_02022C68 > 300) + { + sub_801A234(r2); + } +} + +bool32 sub_801A2A8(struct UnkStruct_Main0 *arg0, s16 *arg1, s16 *arg2, u8 *arg3) +{ + s16 x, y; + s32 i, j; + struct UnkStruct_x20 * r4; + if (!is_walking_or_running()) + { + return FALSE; + } + GetXYCoordsOneStepInFrontOfPlayer(&x, &y); + for (i = 0, r4 = arg0->arr; i < 8; i++) + { + for (j = 0; j < 5; j++) + { + s32 r3 = 5 * i + j; + if (x != gUnknown_082F0740[i][0] + gUnknown_082F0760[j][0] + 7) + { + continue; + } + if (y != gUnknown_082F0740[i][1] + gUnknown_082F0760[j][1] + 7) + { + continue; + } + if (sub_8097C8C(r3 - 0x38) != 0) + { + continue; + } + if (sub_8097D9C(r3 - 0x38) != 0) + { + continue; + } + if (r4[i].field_1A_0 != 1) + { + continue; + } + sub_801A3B0(j, i, gUnknown_082F076A[GetPlayerFacingDirection()]); + *arg1 = j; + *arg2 = i; + return TRUE; + } + } + return FALSE; +} + +void sub_801A3B0(s32 arg0, s32 arg1, u8 arg2) +{ + sub_8097B78(5 * arg1 - 0x38 + arg0, arg2); +} + +void sub_801A3D0(u32 arg0, u32 arg1, struct UnkStruct_Main0 *arg2) +{ + return sub_801A3B0(arg0, arg1, sub_8019F64(arg0, arg1, &arg2->arr[arg1].unk.field_0)); +} -- cgit v1.2.3 From 9f1d1219cec0643bb6e58cb2cdba07ca6f8587ed Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Mon, 1 Apr 2019 14:20:34 -0400 Subject: create header and fix prototypes --- src/union_room.c | 9 ++--- src/union_room_player_avatar.c | 80 +++++++++++++++++++++--------------------- 2 files changed, 42 insertions(+), 47 deletions(-) (limited to 'src') diff --git a/src/union_room.c b/src/union_room.c index 8aeaaf6fb..ad33112e4 100644 --- a/src/union_room.c +++ b/src/union_room.c @@ -46,6 +46,7 @@ #include "union_room_chat.h" #include "berry_crush.h" #include "mystery_gift.h" +#include "union_room_player_avatar.h" EWRAM_DATA u8 gUnknown_02022C20[12] = {}; EWRAM_DATA u8 gUnknown_02022C2C = 0; @@ -106,15 +107,12 @@ s8 mevent_message_print_and_prompt_yes_no(u8 *textState, u8 *arg1, u8 arg2, cons bool32 sub_8016F1C(struct UnkLinkRfuStruct_02022B14 *arg0, s16 arg1); u8 sub_8016DF0(struct UnkStruct_Main4 *arg0, struct UnkStruct_Main4 *arg1, u32 arg2); void sub_8019F2C(void); -void sub_8019E70(u8 *arg0, s32 arg1); bool32 sub_80180A0(u32 monId, struct TradeUnkStruct *arg1); void sub_80180E8(u32 monId, struct TradeUnkStruct *arg1); -bool32 sub_801A2A8(struct UnkStruct_Main0 *arg0, s16 *arg1, s16 *arg2, u8 *arg3); void sub_80181CC(void); bool32 sub_8017940(void); u8 sub_8016B00(void); void sub_801A274(struct UnkStruct_URoom *arg0); -void sub_801A284(struct UnkStruct_URoom *arg0); bool32 sub_8017FD8(struct UnkStruct_URoom *arg0); void sub_801689C(struct UnkStruct_URoom *arg0); u8 sub_80181DC(struct UnkStruct_URoom *arg0); @@ -123,7 +121,6 @@ bool32 sub_801704C(void); s32 sub_8017CF8(s32 arg1, struct UnkStruct_Main0 *arg0); s32 sub_80179D4(struct UnkStruct_Main0 *arg0, u8 arg1, u8 arg2, u32 playerGender); void sub_801818C(bool32 arg0); -void sub_801A3D0(u32 arg0, u32 arg1, struct UnkStruct_Main0 *arg2); s32 sub_8017178(u8 *arg0, u8 *arg1, u8 *arg2, const struct WindowTemplate *winTemplate, const struct ListMenuTemplate *menuTemplate); s32 sub_80172A0(u8 *arg0, u8 *arg1, u8 *arg2, u8 *arg3, const struct WindowTemplate *winTemplate, const struct ListMenuTemplate *menuTemplate, struct UnkStruct_Main0 *arg6); s32 sub_8017CB0(struct UnkStruct_x20 * arg, s32 arg1); @@ -133,12 +130,10 @@ void sub_8018220(u8 *unused, struct UnkStruct_URoom *arg1, bool8 arg2); void sub_8017D9C(u8 *dst, s32 arg1, u32 playerGender); u32 sub_80179AC(struct UnkStruct_x20 *arg0); void sub_8017E00(u8 *dst, u8 arg1); -void sub_8019F04(u8 *spriteIds); -void sub_8019E3C(void); void sub_80173B0(void); s32 sub_8017D04(u32 type, u32 species); bool32 sub_8017020(const u8 *src); -void sub_8019BA8(void *); +u8 sub_8019BA8(struct UnkStruct_8019BA8 * ); s32 sub_8017EA0(u8 *dst, u32 gender, u16 *arg2, struct UnkStruct_URoom *arg3); void sub_801697C(u8 taskId); bool8 sub_8017630(struct UnkStruct_Shared* arg0, const struct UnkStruct_Shared* arg1); diff --git a/src/union_room_player_avatar.c b/src/union_room_player_avatar.c index e7af24b38..61be86a37 100644 --- a/src/union_room_player_avatar.c +++ b/src/union_room_player_avatar.c @@ -12,16 +12,16 @@ EWRAM_DATA struct UnkStruct_8019BA8 * gUnknown_02022C64 = NULL; EWRAM_DATA u32 gUnknown_02022C68 = 0; -u8 sub_8019DF4(void); -bool32 sub_8019F8C(u32 playerIdx, u32 arg1); -void sub_801A3B0(s32 arg0, s32 arg1, u8 arg2); +static u8 sub_8019DF4(void); +static u32 sub_8019F8C(u32 playerIdx, u32 arg1); +static void sub_801A3B0(s32 arg0, s32 arg1, u8 arg2); ALIGNED(4) const u8 gUnknown_082F072C[][10] = { {0x21, 0x2c, 0x1f, 0x23, 0x25, 0x24, 0x41, 0x42}, {0x22, 0x28, 0x20, 0x2f, 0x2f, 0x0e, 0x14, 0x2d} }; -const s16 gUnknown_082F0740[][2] = { +static const s16 gUnknown_082F0740[][2] = { {0x4, 0x6}, {0xd, 0x8}, {0xa, 0x6}, @@ -32,7 +32,7 @@ const s16 gUnknown_082F0740[][2] = { {0x7, 0x8} }; -const s8 gUnknown_082F0760[][2] = { +static const s8 gUnknown_082F0760[][2] = { { 0, 0}, { 1, 0}, { 0, -1}, @@ -40,31 +40,31 @@ const s8 gUnknown_082F0760[][2] = { { 0, 1} }; -const u8 gUnknown_082F076A[] = { +static const u8 gUnknown_082F076A[] = { 0x00, 0x02, 0x01, 0x04, 0x03 }; -const u8 gUnknown_082F076F[] = { +static const u8 gUnknown_082F076F[] = { 0x01, 0x03, 0x01, 0x04, 0x02 }; -const u8 gUnknown_082F0774[] = { +static const u8 gUnknown_082F0774[] = { 0x09, 0x08, 0x07, 0x02, 0x06, 0x05, 0x04, 0x03, 0xbf, 0x02, 0xc0, 0x02, 0xc1, 0x02, 0xc2, 0x02, 0xc3, 0x02, 0xc4, 0x02, 0xc5, 0x02, 0xc6, 0x02 }; -const u8 gUnknown_082F078C[2] = { +static const u8 gUnknown_082F078C[2] = { MOVEMENT_ACTION_FLY_UP, MOVEMENT_ACTION_STEP_END }; -const u8 gUnknown_082F078E[2] = { +static const u8 gUnknown_082F078E[2] = { MOVEMENT_ACTION_FLY_DOWN, MOVEMENT_ACTION_STEP_END }; -bool32 is_walking_or_running(void) +static bool32 is_walking_or_running(void) { if (gPlayerAvatar.tileTransitionState == 2 || gPlayerAvatar.tileTransitionState == 0) { @@ -76,18 +76,18 @@ bool32 is_walking_or_running(void) } } -u8 sub_8019978(u32 a0, u32 a1) +static u8 sub_8019978(u32 a0, u32 a1) { return gUnknown_082F072C[a0][a1 % 8]; } -void sub_8019990(u32 a0, u32 a1, s32 * a2, s32 * a3) +static void sub_8019990(u32 a0, u32 a1, s32 * a2, s32 * a3) { *a2 = gUnknown_082F0740[a0][0] + gUnknown_082F0760[a1][0] + 7; *a3 = gUnknown_082F0740[a0][1] + gUnknown_082F0760[a1][1] + 7; } -bool32 sub_80199E0(u32 a0, u32 a1, s32 a2, s32 a3) +static bool32 sub_80199E0(u32 a0, u32 a1, s32 a2, s32 a3) { if (gUnknown_082F0740[a0][0] + gUnknown_082F0760[a1][0] + 7 != a2) { @@ -103,37 +103,37 @@ bool32 sub_80199E0(u32 a0, u32 a1, s32 a2, s32 a3) } } -bool32 IsUnionRoomPlayerHidden(u32 player_idx) +static bool32 IsUnionRoomPlayerHidden(u32 player_idx) { return FlagGet(FLAG_HIDE_UNION_ROOM_PLAYER_1 + player_idx); } -void HideUnionRoomPlayer(u32 player_idx) +static void HideUnionRoomPlayer(u32 player_idx) { FlagSet(FLAG_HIDE_UNION_ROOM_PLAYER_1 + player_idx); } -void ShowUnionRoomPlayer(u32 player_idx) +static void ShowUnionRoomPlayer(u32 player_idx) { FlagClear(FLAG_HIDE_UNION_ROOM_PLAYER_1 + player_idx); } -void SetUnionRoomPlayerGfx(u32 playerIdx, u32 gfxId) +static void SetUnionRoomPlayerGfx(u32 playerIdx, u32 gfxId) { VarSet(VAR_OBJ_GFX_ID_0 + playerIdx, gfxId); } -void CreateUnionRoomPlayerEventObject(u32 playerIdx) +static void CreateUnionRoomPlayerEventObject(u32 playerIdx) { show_sprite(gUnknown_082F0774[playerIdx], gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup); } -void RemoveUnionRoomPlayerEventObject(u32 playerIdx) +static void RemoveUnionRoomPlayerEventObject(u32 playerIdx) { RemoveEventObjectByLocalIdAndMap(gUnknown_082F0774[playerIdx], gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup); } -bool32 SetUnionRoomPlayerEnterExitMovement(u32 playerIdx, const u8 * movement) +static bool32 SetUnionRoomPlayerEnterExitMovement(u32 playerIdx, const u8 * movement) { u8 objectId; struct EventObject * object; @@ -153,7 +153,7 @@ bool32 SetUnionRoomPlayerEnterExitMovement(u32 playerIdx, const u8 * movement) return TRUE; } -bool32 sub_8019B3C(u32 playerIdx) +static bool32 sub_8019B3C(u32 playerIdx) { u8 objectId; struct EventObject * object; @@ -193,7 +193,7 @@ u8 sub_8019BA8(struct UnkStruct_8019BA8 * ptr) return sub_8019DF4(); } -bool32 sub_8019BDC(s8 * a0, u32 playerIdx, struct UnkStruct_8019BA8 * ptr) +static bool32 sub_8019BDC(s8 * a0, u32 playerIdx, struct UnkStruct_8019BA8 * ptr) { switch (*a0) { @@ -217,7 +217,7 @@ bool32 sub_8019BDC(s8 * a0, u32 playerIdx, struct UnkStruct_8019BA8 * ptr) return FALSE; } -bool32 sub_8019C38(s8 * a0, u32 playerIdx, struct UnkStruct_8019BA8 * ptr) +static bool32 sub_8019C38(s8 * a0, u32 playerIdx, struct UnkStruct_8019BA8 * ptr) { s16 x, y; @@ -260,7 +260,7 @@ bool32 sub_8019C38(s8 * a0, u32 playerIdx, struct UnkStruct_8019BA8 * ptr) return FALSE; } -bool32 sub_8019CF0(u32 playerIdx, u32 a1, u32 a2) +static bool32 sub_8019CF0(u32 playerIdx, u32 a1, u32 a2) { struct UnkStruct_8019BA8 * ptr = &gUnknown_02022C64[playerIdx]; ptr->field_3 = 1; @@ -275,7 +275,7 @@ bool32 sub_8019CF0(u32 playerIdx, u32 a1, u32 a2) } } -bool32 sub_8019D20(u32 playerIdx) +static bool32 sub_8019D20(u32 playerIdx) { struct UnkStruct_8019BA8 * ptr = &gUnknown_02022C64[playerIdx]; ptr->field_3 = 2; @@ -289,7 +289,7 @@ bool32 sub_8019D20(u32 playerIdx) } } -void sub_8019D44(u32 playerIdx, struct UnkStruct_8019BA8 * ptr) +static void sub_8019D44(u32 playerIdx, struct UnkStruct_8019BA8 * ptr) { switch (ptr->field_0) { @@ -338,7 +338,7 @@ void sub_8019D44(u32 playerIdx, struct UnkStruct_8019BA8 * ptr) ptr->field_3 = 0; } -void sub_8019DD0(u8 taskId) +static void sub_8019DD0(u8 taskId) { s32 i; for (i = 0; i < 8; i++) @@ -347,7 +347,7 @@ void sub_8019DD0(u8 taskId) } } -u8 sub_8019DF4(void) +static u8 sub_8019DF4(void) { if (FuncIsActiveTask(sub_8019DD0) == 1) { @@ -359,7 +359,7 @@ u8 sub_8019DF4(void) } } -void sub_8019E20(void) +static void sub_8019E20(void) { u8 taskId = FindTaskIdByFunc(sub_8019DD0); if (taskId < NUM_TASKS) @@ -417,7 +417,7 @@ void sub_8019F2C(void) } } -u8 sub_8019F64(u32 r1, u32 unused, struct UnkLinkRfuStruct_02022B14 * r2) +static u8 sub_8019F64(u32 r1, u32 unused, struct UnkLinkRfuStruct_02022B14 * r2) { if (r1 != 0) { @@ -433,12 +433,12 @@ u8 sub_8019F64(u32 r1, u32 unused, struct UnkLinkRfuStruct_02022B14 * r2) } } -u32 sub_8019F8C(u32 a0, u32 a1) +static u32 sub_8019F8C(u32 a0, u32 a1) { return sub_8097C8C(5 * a0 + a1 - 0x38); } -void sub_8019FA4(u32 r5, u32 r6, u8 r8, struct UnkLinkRfuStruct_02022B14 * r9) +static void sub_8019FA4(u32 r5, u32 r6, u8 r8, struct UnkLinkRfuStruct_02022B14 * r9) { s32 x, y; s32 r7 = 5 * r5 + r6; @@ -453,7 +453,7 @@ void sub_8019FA4(u32 r5, u32 r6, u8 r8, struct UnkLinkRfuStruct_02022B14 * r9) sub_8088B94(x, y, 1); } -void sub_801A02C(u32 a0, u32 a1) +static void sub_801A02C(u32 a0, u32 a1) { s32 x, y; sub_8097CC4(5 * a0 + a1 - 0x38, 2); @@ -461,7 +461,7 @@ void sub_801A02C(u32 a0, u32 a1) sub_8088B94(x, y, 0); } -void sub_801A064(u32 r7, struct UnkLinkRfuStruct_02022B14 * r8) +static void sub_801A064(u32 r7, struct UnkLinkRfuStruct_02022B14 * r8) { s16 x, y, x2, y2; s32 i; @@ -489,7 +489,7 @@ void sub_801A064(u32 r7, struct UnkLinkRfuStruct_02022B14 * r8) } } -void sub_801A16C(u32 r5, struct UnkLinkRfuStruct_02022B14 * r4) +static void sub_801A16C(u32 r5, struct UnkLinkRfuStruct_02022B14 * r4) { u32 i; switch (r4->unk_0a_0) @@ -515,7 +515,7 @@ void sub_801A16C(u32 r5, struct UnkLinkRfuStruct_02022B14 * r4) } } -void sub_801A214(u32 r5, struct UnkLinkRfuStruct_02022B14 * unused) +static void sub_801A214(u32 r5, struct UnkLinkRfuStruct_02022B14 * unused) { s32 i; sub_8019D20(r5); @@ -525,7 +525,7 @@ void sub_801A214(u32 r5, struct UnkLinkRfuStruct_02022B14 * unused) } } -void sub_801A234(struct UnkStruct_URoom *r0) +static void sub_801A234(struct UnkStruct_URoom *r0) { s32 i; struct UnkStruct_x20 * r4; @@ -543,7 +543,7 @@ void sub_801A234(struct UnkStruct_URoom *r0) } } -void sub_801A274(void) +void sub_801A274(struct UnkStruct_URoom *unused) { gUnknown_02022C68 = 300; } @@ -600,7 +600,7 @@ bool32 sub_801A2A8(struct UnkStruct_Main0 *arg0, s16 *arg1, s16 *arg2, u8 *arg3) return FALSE; } -void sub_801A3B0(s32 arg0, s32 arg1, u8 arg2) +static void sub_801A3B0(s32 arg0, s32 arg1, u8 arg2) { sub_8097B78(5 * arg1 - 0x38 + arg0, arg2); } -- cgit v1.2.3 From c429e6d69c3df23687e2336039b676b8927c238e Mon Sep 17 00:00:00 2001 From: Phlosioneer Date: Mon, 1 Apr 2019 20:30:41 -0400 Subject: Move gPlayerFacingPosition out of sym_ewram.txt (#617) * Move gPlayerFacingPosition out of sym_ewram.txt * Fix tabs in sym_ewram.txt * Remove redundant faraway island extern --- src/fldeff_misc.c | 2 +- src/fldeff_rocksmash.c | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) (limited to 'src') diff --git a/src/fldeff_misc.c b/src/fldeff_misc.c index 5d1920aac..efde43b76 100644 --- a/src/fldeff_misc.c +++ b/src/fldeff_misc.c @@ -23,7 +23,7 @@ #include "constants/songs.h" #include "constants/vars.h" -extern struct MapPosition gPlayerFacingPosition; +EWRAM_DATA struct MapPosition gPlayerFacingPosition = {0}; static void sub_80F9C90(u8); static void sub_80F9DFC(u8); diff --git a/src/fldeff_rocksmash.c b/src/fldeff_rocksmash.c index 86df8e943..a9077f2ff 100644 --- a/src/fldeff_rocksmash.c +++ b/src/fldeff_rocksmash.c @@ -27,9 +27,6 @@ static void sub_813561C(u8 taskId); static void sub_81356C4(void); static void sub_8135714(void); -// extern RAM loc -extern struct MapPosition gPlayerFacingPosition; - // text bool8 CheckObjectGraphicsInFrontOfPlayer(u8 graphicsId) { -- cgit v1.2.3 From 4be97b2dc691d5215ae402a345708b3e207ceb9f Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Mon, 1 Apr 2019 18:42:57 -0400 Subject: through sub_801A960 --- src/union_room.c | 2 - src/union_room_battle.c | 466 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 466 insertions(+), 2 deletions(-) create mode 100644 src/union_room_battle.c (limited to 'src') diff --git a/src/union_room.c b/src/union_room.c index ad33112e4..88ac65baa 100644 --- a/src/union_room.c +++ b/src/union_room.c @@ -62,8 +62,6 @@ EWRAM_DATA struct TradeUnkStruct gUnknown_02022C40 = {}; IWRAM_DATA struct UnkStruct_Leader *gUnknown_03000DA0; IWRAM_DATA struct UnkStruct_Group *gUnknown_03000DA4; IWRAM_DATA struct UnkStruct_URoom *gUnknown_03000DA8; -IWRAM_DATA void *gUnknown_03000DAC; -IWRAM_DATA bool32 gUnknown_03000DB0; // this file's functions void sub_80173E0(u8 windowId, u8 arg1, const u8 *str, u8 arg3, u8 arg4, u8 arg5); diff --git a/src/union_room_battle.c b/src/union_room_battle.c new file mode 100644 index 000000000..b571e803a --- /dev/null +++ b/src/union_room_battle.c @@ -0,0 +1,466 @@ +#include "global.h" +#include "battle.h" +#include "task.h" +#include "text.h" +#include "main.h" +#include "bg.h" +#include "palette.h" +#include "gpu_regs.h" +#include "alloc.h" +#include "menu.h" +#include "window.h" +#include "scanline_effect.h" +#include "m4a.h" +#include "dynamic_placeholder_text_util.h" +#include "overworld.h" +#include "strings.h" +#include "string_util.h" +#include "international_string_util.h" +#include "sound.h" +#include "constants/songs.h" +#include "union_room.h" +#include "union_room_battle.h" + +struct UnkStruct_3000DAC +{ + /*0x00*/ u32 unk00[4]; + /*0x10*/ u32 unk10[4]; + /*0x20*/ u32 unk20[16]; + /*0x60*/ u8 taskId; + /*0x61*/ u8 unk61; + /*0x62*/ u8 filler_62[10]; +}; + +IWRAM_DATA struct UnkStruct_3000DAC * gUnknown_03000DAC; +IWRAM_DATA bool32 gUnknown_03000DB0; + +void sub_801A43C(void); +void sub_801A6C0(u8 taskId); +static void sub_801A8B0(u8 windowId, u8 fontId, const u8 * str, u8 x, u8 y, u8 mode); +bool32 sub_801AA30(u32 * a0, u32 * a1, u32 * a2, u8 a3); + +const u16 gWirelessInfoScreenPal[] = INCBIN_U16("graphics/interface/wireless_info_screen.gbapal"); +const u32 gWirelessInfoScreenGfx[] = INCBIN_U32("graphics/interface/wireless_info_screen.4bpp.lz"); +const u32 gWirelessInfoScreenTilemap[] = INCBIN_U32("graphics/interface/wireless_info_screen.bin.lz"); + +const struct BgTemplate gUnknown_082F0D34[] = { + { + .bg = 0, + .charBaseIndex = 2, + .mapBaseIndex = 0x1F, + .priority = 0 + }, { + .bg = 1, + .charBaseIndex = 0, + .mapBaseIndex = 0x08, + .priority = 1 + } +}; + +const struct WindowTemplate gUnknown_082F0D3C[] = { + { + .bg = 0x00, + .tilemapLeft = 0x03, + .tilemapTop = 0x00, + .width = 0x18, + .height = 0x03, + .paletteNum = 0x0f, + .baseBlock = 0x0001 + }, { + .bg = 0x00, + .tilemapLeft = 0x03, + .tilemapTop = 0x04, + .width = 0x15, + .height = 0x0f, + .paletteNum = 0x0f, + .baseBlock = 0x0049 + }, { + .bg = 0x00, + .tilemapLeft = 0x18, + .tilemapTop = 0x04, + .width = 0x03, + .height = 0x0f, + .paletteNum = 0x0f, + .baseBlock = 0x0184 + }, + { 0xFF } +}; + +const u8 *const gUnknown_082F0D5C[] = { + gText_WirelessCommStatus, + gText_PeopleTrading, + gText_PeopleBattling, + gText_PeopleInUnionRoom, + gText_PeopleCommunicating +}; + +const u8 gUnknown_082F0D70[][3] = { + {0x01, 0x01, 0x02}, + {0x02, 0x01, 0x02}, + {0x03, 0x01, 0x04}, + {0x04, 0x00, 0x02}, + {0x06, 0x03, 0x02}, + {0x07, 0x03, 0x02}, + {0x09, 0x03, 0x00}, + {0x0a, 0x03, 0x00}, + {0x0b, 0x03, 0x00}, + {0x0c, 0xff, 0x00}, + {0x0d, 0x00, 0x00}, + {0x10, 0x03, 0x00}, + {0x0f, 0x03, 0x00}, + {0x40, 0x02, 0x01}, + {0x41, 0x02, 0x02}, + {0x44, 0x02, 0x02}, + {0x45, 0x02, 0x00}, + {0x48, 0x02, 0x02}, + {0x54, 0x02, 0x01}, + {0x53, 0x02, 0x02}, + {0x51, 0x02, 0x01}, + {0x52, 0x02, 0x01}, + {0x15, 0x03, 0x02}, + {0x16, 0x03, 0x02}, + {0x17, 0x03, 0x00}, + {0x18, 0x03, 0x00}, + {0x19, 0x03, 0x00}, + {0x1a, 0x03, 0x00}, + {0x1b, 0x03, 0x00}, + {0x1c, 0x01, 0x02}, + {0x0e, 0x01, 0x02} +}; + +void sub_801A3F4(void) +{ + if (!IsDma3ManagerBusyWithBgCopy()) + { + RunTasks(); + RunTextPrinters(); + AnimateSprites(); + BuildOamBuffer(); + UpdatePaletteFade(); + } +} + +void sub_801A418(void) +{ + LoadOam(); + ProcessSpriteCopyRequests(); + TransferPlttBuffer(); +} + +void sub_801A42C(void) +{ + SetMainCallback2(sub_801A43C); +} + +void sub_801A43C(void) +{ + SetGpuReg(REG_OFFSET_DISPCNT, 0x0000); + gUnknown_03000DAC = AllocZeroed(sizeof(struct UnkStruct_3000DAC)); + SetVBlankCallback(NULL); + ResetBgsAndClearDma3BusyFlags(0); + InitBgsFromTemplates(0, gUnknown_082F0D34, ARRAY_COUNT(gUnknown_082F0D34)); + SetBgTilemapBuffer(1, Alloc(0x800)); + SetBgTilemapBuffer(0, Alloc(0x800)); + DecompressAndLoadBgGfxUsingHeap(1, gWirelessInfoScreenGfx, 0, 0, 0); + CopyToBgTilemapBuffer(1, gWirelessInfoScreenTilemap, 0, 0); + InitWindows(gUnknown_082F0D3C); + DeactivateAllTextPrinters(); + ResetPaletteFade(); + ResetSpriteData(); + ResetTasks(); + ScanlineEffect_Stop(); + m4aSoundVSyncOn(); + SetVBlankCallback(sub_801A418); + gUnknown_03000DAC->taskId = CreateTask(sub_801A6C0, 0); + gUnknown_03000DAC->unk61 = sub_8013C40(); + gUnknown_03000DAC->unk10[3] = 1; + ChangeBgX(0, 0, 0); + ChangeBgY(0, 0, 0); + ChangeBgX(1, 0, 0); + ChangeBgY(1, 0, 0); + LoadPalette(gWirelessInfoScreenPal, 0x00, 0x20); + Menu_LoadStdPalAt(0xF0); + DynamicPlaceholderTextUtil_Reset(); + FillBgTilemapBufferRect(0, 0, 0, 0, 32, 32, 0x0F); + CopyBgTilemapBufferToVram(1); + SetMainCallback2(sub_801A3F4); + RunTasks(); + RunTextPrinters(); + AnimateSprites(); + BuildOamBuffer(); + UpdatePaletteFade(); +} + +void sub_801A584(void) +{ + s32 i; + FreeAllWindowBuffers(); + for (i = 0; i < 2; i++) + { + Free(GetBgTilemapBuffer(i)); + } + Free(gUnknown_03000DAC); + SetMainCallback2(CB2_ReturnToFieldContinueScriptPlayMapMusic); +} + +void sub_801A5BC(s16 * a0, s16 * a1) +{ + if (++(*a0) > 5) + { + if (++(*a1) == 14) + { + *a1 = 0; + } + *a0 = 0; + } + LoadPalette(gWirelessInfoScreenPal + 16 * (*a1 + 2), 0, 0x10); +} + +void sub_801A600(void) +{ + s32 i; + FillWindowPixelBuffer(0, 0); + FillWindowPixelBuffer(1, 0); + FillWindowPixelBuffer(2, 0); + sub_801A8B0(0, 1, gUnknown_082F0D5C[0], GetStringCenterAlignXOffset(1, gUnknown_082F0D5C[0], 0xC0), 6, 3); + for (i = 0; i < 3; i++) + { + sub_801A8B0(1, 1, gUnknown_082F0D5C[i + 1], 0, 30 * i + 8, 1); + } + sub_801A8B0(1, 1, gUnknown_082F0D5C[i + 1], 0, 30 * i + 8, 2); + PutWindowTilemap(0); + CopyWindowToVram(0, 2); + PutWindowTilemap(1); + CopyWindowToVram(1, 2); +} + +void sub_801A6C0(u8 taskId) +{ + s32 i; + switch (gTasks[taskId].data[0]) + { + case 0: + sub_801A600(); + gTasks[taskId].data[0]++; + break; + case 1: + BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, 0); + ShowBg(1); + CopyBgTilemapBufferToVram(0); + ShowBg(0); + gTasks[taskId].data[0]++; + break; + case 2: + if (!gPaletteFade.active) + { + gTasks[taskId].data[0]++; + } + break; + case 3: + if (sub_801AA30(gUnknown_03000DAC->unk00, gUnknown_03000DAC->unk10, gUnknown_03000DAC->unk20, gUnknown_03000DAC->unk61)) + { + FillWindowPixelBuffer(2, 0); + for (i = 0; i < 4; i++) + { + ConvertIntToDecimalStringN(gStringVar4, gUnknown_03000DAC->unk00[i], STR_CONV_MODE_RIGHT_ALIGN, 2); + if (i != 3) + { + sub_801A8B0(2, 1, gStringVar4, 12, 30 * i + 8, 1); + } + else + { + sub_801A8B0(2, 1, gStringVar4, 12, 98, 2); + } + } + PutWindowTilemap(2); + CopyWindowToVram(2, 3); + } + if (({gMain.newKeys & A_BUTTON;}) || ({gMain.newKeys & B_BUTTON;})) + { + PlaySE(SE_SELECT); + gTasks[gUnknown_03000DAC->unk61].data[15] = 0xFF; + gTasks[taskId].data[0]++; + } + sub_801A5BC(&gTasks[taskId].data[7], &gTasks[taskId].data[8]); + break; + case 4: + BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, 0); + gTasks[taskId].data[0]++; + break; + case 5: + if (!gPaletteFade.active) + { + SetMainCallback2(sub_801A584); + DestroyTask(taskId); + } + break; + } +} + +static void sub_801A8B0(u8 windowId, u8 fontId, const u8 * str, u8 x, u8 y, u8 mode) +{ + u8 color[3]; + + switch (mode) + { + case 0: + color[0] = 0; + color[1] = 2; + color[2] = 3; + break; + case 1: + color[0] = 0; + color[1] = 1; + color[2] = 3; + break; + case 2: + color[0] = 0; + color[1] = 4; + color[2] = 5; + break; + case 3: + color[0] = 0; + color[1] = 7; + color[2] = 6; + break; + case 4: + color[0] = 0; + color[1] = 1; + color[2] = 2; + break; + } + + AddTextPrinterParameterized4(windowId, fontId, x, y, 0, 0, color, -1, str); +} + +#ifdef NONMATCHING +// register swap r2, r3 +u8 sub_801A960(struct UnkStruct_x20 * a0, u32 * a1) +{ + s32 i, j, r2; + u8 result = a0->unk.field_0.unk_0a_0; + + for (i = 0; i < (unsigned)ARRAY_COUNT(gUnknown_082F0D70); i++) + { + if (result != gUnknown_082F0D70[i][0]) + { + continue; + } + if (a0->field_1A_0 != 1) + { + continue; + } + if (gUnknown_082F0D70[i][2] == 0) + { + r2 = 0; + for (j = 0; j < 4; j++) + { + if (a0->unk.field_0.unk_04[j] != 0) + { + r2++; + } + } + r2++; + a1[gUnknown_082F0D70[i][1]] += r2; + } + else + { + a1[gUnknown_082F0D70[i][1]] += gUnknown_082F0D70[i][2]; + } + } + return result; +} +#else +NAKED +u8 sub_801A960(struct UnkStruct_x20 * a0, u32 * a1) +{ + asm_unified("\tpush {r4-r7,lr}\n" + "\tmov r7, r10\n" + "\tmov r6, r9\n" + "\tmov r5, r8\n" + "\tpush {r5-r7}\n" + "\tsub sp, 0x4\n" + "\tmov r12, r0\n" + "\tadds r7, r1, 0\n" + "\tldrb r0, [r0, 0xA]\n" + "\tlsls r0, 25\n" + "\tlsrs r0, 25\n" + "\tmov r8, r0\n" + "\tmovs r4, 0\n" + "\tldr r0, =gUnknown_082F0D70\n" + "\tmov r9, r0\n" + "\tmovs r1, 0x1\n" + "\tadd r1, r9\n" + "\tmov r10, r1\n" + "\tmov r3, r12\n" + "\tadds r3, 0x4\n" + "\tstr r3, [sp]\n" + "_0801A98A:\n" + "\tlsls r0, r4, 1\n" + "\tadds r2, r0, r4\n" + "\tmov r3, r9\n" + "\tadds r1, r2, r3\n" + "\tadds r5, r0, 0\n" + "\tadds r6, r4, 0x1\n" + "\tldrb r1, [r1]\n" + "\tcmp r8, r1\n" + "\tbne _0801A9EE\n" + "\tmov r0, r12\n" + "\tldrb r1, [r0, 0x1A]\n" + "\tmovs r0, 0x3\n" + "\tands r0, r1\n" + "\tcmp r0, 0x1\n" + "\tbne _0801A9EE\n" + "\tmov r0, r9\n" + "\tadds r0, 0x2\n" + "\tadds r3, r2, r0\n" + "\tldrb r0, [r3]\n" + "\tcmp r0, 0\n" + "\tbne _0801A9DC\n" + "\tmovs r2, 0\n" + "\tmovs r1, 0\n" + "\tldr r3, [sp]\n" + "_0801A9BA:\n" + "\tadds r0, r3, r1\n" + "\tldrb r0, [r0]\n" + "\tcmp r0, 0\n" + "\tbeq _0801A9C4\n" + "\tadds r2, 0x1\n" + "_0801A9C4:\n" + "\tadds r1, 0x1\n" + "\tcmp r1, 0x3\n" + "\tble _0801A9BA\n" + "\tadds r2, 0x1\n" + "\tadds r0, r5, r4\n" + "\tadd r0, r10\n" + "\tldrb r1, [r0]\n" + "\tlsls r1, 2\n" + "\tadds r1, r7\n" + "\tb _0801A9E8\n" + "\t.pool\n" + "_0801A9DC:\n" + "\tmov r1, r10\n" + "\tadds r0, r2, r1\n" + "\tldrb r1, [r0]\n" + "\tlsls r1, 2\n" + "\tadds r1, r7\n" + "\tldrb r2, [r3]\n" + "_0801A9E8:\n" + "\tldr r0, [r1]\n" + "\tadds r0, r2\n" + "\tstr r0, [r1]\n" + "_0801A9EE:\n" + "\tadds r4, r6, 0\n" + "\tcmp r4, 0x1E\n" + "\tbls _0801A98A\n" + "\tmov r0, r8\n" + "\tadd sp, 0x4\n" + "\tpop {r3-r5}\n" + "\tmov r8, r3\n" + "\tmov r9, r4\n" + "\tmov r10, r5\n" + "\tpop {r4-r7}\n" + "\tpop {r1}\n" + "\tbx r1"); +} +#endif //NONMATCHING -- cgit v1.2.3 From 7571969a458fefcfa242acdd4a38dce134897977 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Mon, 1 Apr 2019 22:30:30 -0400 Subject: Finish union room battle --- src/mauville_old_man.c | 2 +- src/union_room.c | 2 +- src/union_room_battle.c | 359 +++++++++++++++++++++++++++++++++++------------- 3 files changed, 264 insertions(+), 99 deletions(-) (limited to 'src') diff --git a/src/mauville_old_man.c b/src/mauville_old_man.c index ec5cb238b..ddd3f931e 100644 --- a/src/mauville_old_man.c +++ b/src/mauville_old_man.c @@ -914,7 +914,7 @@ struct Story }; static const struct Story sStorytellerStories[] = { - {GAME_STAT_50, 1, MauvilleCity_PokemonCenter_1F_Text_28E930, MauvilleCity_PokemonCenter_1F_Text_28E947, MauvilleCity_PokemonCenter_1F_Text_28E956}, + {GAME_STAT_NUM_UNION_ROOM_BATTLES, 1, MauvilleCity_PokemonCenter_1F_Text_28E930, MauvilleCity_PokemonCenter_1F_Text_28E947, MauvilleCity_PokemonCenter_1F_Text_28E956}, {GAME_STAT_STARTED_TRENDS, 1, MauvilleCity_PokemonCenter_1F_Text_28E9D7, MauvilleCity_PokemonCenter_1F_Text_28E9EF, MauvilleCity_PokemonCenter_1F_Text_28E9FE}, {GAME_STAT_PLANTED_BERRIES, 1, MauvilleCity_PokemonCenter_1F_Text_28EA7D, MauvilleCity_PokemonCenter_1F_Text_28EA98, MauvilleCity_PokemonCenter_1F_Text_28EAA8}, {GAME_STAT_TRADED_BIKES, 1, MauvilleCity_PokemonCenter_1F_Text_28EB19, MauvilleCity_PokemonCenter_1F_Text_28EB31, MauvilleCity_PokemonCenter_1F_Text_28EB3E}, diff --git a/src/union_room.c b/src/union_room.c index 88ac65baa..ea3658903 100644 --- a/src/union_room.c +++ b/src/union_room.c @@ -2332,7 +2332,7 @@ void sub_8013F90(u8 taskId) if (GetBlockReceivedStatus() == 3) { gEnemyParty[0] = *(struct Pokemon*)(gBlockRecvBuffer[GetMultiplayerId() ^ 1]); - IncrementGameStat(GAME_STAT_50); + IncrementGameStat(GAME_STAT_NUM_UNION_ROOM_BATTLES); ResetBlockReceivedFlags(); gTasks[taskId].data[0]++; } diff --git a/src/union_room_battle.c b/src/union_room_battle.c index b571e803a..9d9f9dcf3 100644 --- a/src/union_room_battle.c +++ b/src/union_room_battle.c @@ -9,6 +9,7 @@ #include "alloc.h" #include "menu.h" #include "window.h" +#include "text_window.h" #include "scanline_effect.h" #include "m4a.h" #include "dynamic_placeholder_text_util.h" @@ -18,6 +19,9 @@ #include "international_string_util.h" #include "sound.h" #include "constants/songs.h" +#include "party_menu.h" +#include "battle_setup.h" +#include "link.h" #include "union_room.h" #include "union_room_battle.h" @@ -31,13 +35,20 @@ struct UnkStruct_3000DAC /*0x62*/ u8 filler_62[10]; }; +struct UnkStruct_2022C6C +{ + s16 a0; +}; + IWRAM_DATA struct UnkStruct_3000DAC * gUnknown_03000DAC; IWRAM_DATA bool32 gUnknown_03000DB0; +EWRAM_DATA struct UnkStruct_2022C6C * gUnknown_02022C6C = NULL; + void sub_801A43C(void); void sub_801A6C0(u8 taskId); static void sub_801A8B0(u8 windowId, u8 fontId, const u8 * str, u8 x, u8 y, u8 mode); -bool32 sub_801AA30(u32 * a0, u32 * a1, u32 * a2, u8 a3); +bool32 sub_801AA30(u32 * a0, u32 * a1, u32 * a2, u8 taskId); const u16 gWirelessInfoScreenPal[] = INCBIN_U16("graphics/interface/wireless_info_screen.gbapal"); const u32 gWirelessInfoScreenGfx[] = INCBIN_U32("graphics/interface/wireless_info_screen.4bpp.lz"); @@ -128,6 +139,29 @@ const u8 gUnknown_082F0D70[][3] = { {0x0e, 0x01, 0x02} }; +const struct BgTemplate gUnknown_082F0DD0[] = { + { + .bg = 0, + .charBaseIndex = 3, + .mapBaseIndex = 31 + } +}; + +const struct WindowTemplate gUnknown_082F0DD4[] = { + { + .bg = 0, + .tilemapLeft = 3, + .tilemapTop = 15, + .width = 24, + .height = 4, + .paletteNum = 0xE, + .baseBlock = 0x014 + }, + { 0xFF } +}; + +const u8 gUnknown_082F0DE4[] = { 1, 2, 3 }; + void sub_801A3F4(void) { if (!IsDma3ManagerBusyWithBgCopy()) @@ -333,12 +367,10 @@ static void sub_801A8B0(u8 windowId, u8 fontId, const u8 * str, u8 x, u8 y, u8 m AddTextPrinterParameterized4(windowId, fontId, x, y, 0, 0, color, -1, str); } -#ifdef NONMATCHING -// register swap r2, r3 -u8 sub_801A960(struct UnkStruct_x20 * a0, u32 * a1) +u32 sub_801A960(struct UnkStruct_x20 * a0, u32 * a1) { s32 i, j, r2; - u8 result = a0->unk.field_0.unk_0a_0; + u32 result = a0->unk.field_0.unk_0a_0; for (i = 0; i < (unsigned)ARRAY_COUNT(gUnknown_082F0D70); i++) { @@ -370,97 +402,230 @@ u8 sub_801A960(struct UnkStruct_x20 * a0, u32 * a1) } return result; } -#else -NAKED -u8 sub_801A960(struct UnkStruct_x20 * a0, u32 * a1) + +bool32 sub_801AA08(u32 * a0, u32 * a1) +{ + s32 i; + for (i = 0; i < 4; i++) + { + if (a0[i] != a1[i]) + { + return TRUE; + } + } + return FALSE; +} + +bool32 sub_801AA30(u32 * a0, u32 * a1, u32 * a2, u8 taskId) +{ + bool32 r8 = FALSE; + u32 sp0[4] = {0, 0, 0, 0}; + struct UnkStruct_x20 ** data = (void *)gTasks[taskId].data; + s32 i; + + for (i = 0; i < 16; i++) + { + u32 r1 = sub_801A960(&(*data)[i], sp0); + if (r1 != a2[i]) + { + a2[i] = r1; + r8 = TRUE; + } + } + if (sub_801AA08(sp0, a1) == 0) + { + if (r8 != TRUE) + { + return FALSE; + } + } + else + { + memcpy(a0, sp0, sizeof(sp0)); + memcpy(a1, sp0, sizeof(sp0)); + a0[3] = a0[0] + a0[1] + a0[2] + a0[3]; + } + return TRUE; +} + +void sub_801AAD4(void) +{ + s32 i; + sub_8014210(10); + for (i = 0; i < 2; i++) + { + gEnemyParty[i] = gPlayerParty[gSelectedOrderFromParty[i] - 1]; + } + for (i = 0; i < 6; i++) + { + ZeroMonData(&gPlayerParty[i]); + } + for (i = 0; i < 2; i++) + { + gPlayerParty[i] = gEnemyParty[i]; + } + IncrementGameStat(GAME_STAT_NUM_UNION_ROOM_BATTLES); + CalculatePlayerPartyCount(); + gTrainerBattleOpponent_A = 0xC00; + SetMainCallback2(CB2_InitBattle); +} + +void sub_801AB68(u8 windowId, const u8 * str, u8 x, u8 y, s32 speed) +{ + s32 letterSpacing = 0; + s32 lineSpacing = 1; + FillWindowPixelBuffer(windowId, (gUnknown_082F0DE4[0] << 4) | gUnknown_082F0DE4[0]); + AddTextPrinterParameterized4(windowId, 1, x, y, letterSpacing, lineSpacing, gUnknown_082F0DE4, speed, str); +} + +bool32 sub_801ABDC(s16 * state, const u8 * str, s32 speed) +{ + switch (*state) + { + case 0: + DrawTextBorderOuter(0, 0x001, 0xD); + sub_801AB68(0, str, 0, 1, speed); + PutWindowTilemap(0); + CopyWindowToVram(0, 3); + (*state)++; + break; + case 1: + if (!IsTextPrinterActive(0)) + { + *state = 0; + return TRUE; + } + break; + } + return FALSE; +} + +void sub_801AC40(void) { - asm_unified("\tpush {r4-r7,lr}\n" - "\tmov r7, r10\n" - "\tmov r6, r9\n" - "\tmov r5, r8\n" - "\tpush {r5-r7}\n" - "\tsub sp, 0x4\n" - "\tmov r12, r0\n" - "\tadds r7, r1, 0\n" - "\tldrb r0, [r0, 0xA]\n" - "\tlsls r0, 25\n" - "\tlsrs r0, 25\n" - "\tmov r8, r0\n" - "\tmovs r4, 0\n" - "\tldr r0, =gUnknown_082F0D70\n" - "\tmov r9, r0\n" - "\tmovs r1, 0x1\n" - "\tadd r1, r9\n" - "\tmov r10, r1\n" - "\tmov r3, r12\n" - "\tadds r3, 0x4\n" - "\tstr r3, [sp]\n" - "_0801A98A:\n" - "\tlsls r0, r4, 1\n" - "\tadds r2, r0, r4\n" - "\tmov r3, r9\n" - "\tadds r1, r2, r3\n" - "\tadds r5, r0, 0\n" - "\tadds r6, r4, 0x1\n" - "\tldrb r1, [r1]\n" - "\tcmp r8, r1\n" - "\tbne _0801A9EE\n" - "\tmov r0, r12\n" - "\tldrb r1, [r0, 0x1A]\n" - "\tmovs r0, 0x3\n" - "\tands r0, r1\n" - "\tcmp r0, 0x1\n" - "\tbne _0801A9EE\n" - "\tmov r0, r9\n" - "\tadds r0, 0x2\n" - "\tadds r3, r2, r0\n" - "\tldrb r0, [r3]\n" - "\tcmp r0, 0\n" - "\tbne _0801A9DC\n" - "\tmovs r2, 0\n" - "\tmovs r1, 0\n" - "\tldr r3, [sp]\n" - "_0801A9BA:\n" - "\tadds r0, r3, r1\n" - "\tldrb r0, [r0]\n" - "\tcmp r0, 0\n" - "\tbeq _0801A9C4\n" - "\tadds r2, 0x1\n" - "_0801A9C4:\n" - "\tadds r1, 0x1\n" - "\tcmp r1, 0x3\n" - "\tble _0801A9BA\n" - "\tadds r2, 0x1\n" - "\tadds r0, r5, r4\n" - "\tadd r0, r10\n" - "\tldrb r1, [r0]\n" - "\tlsls r1, 2\n" - "\tadds r1, r7\n" - "\tb _0801A9E8\n" - "\t.pool\n" - "_0801A9DC:\n" - "\tmov r1, r10\n" - "\tadds r0, r2, r1\n" - "\tldrb r1, [r0]\n" - "\tlsls r1, 2\n" - "\tadds r1, r7\n" - "\tldrb r2, [r3]\n" - "_0801A9E8:\n" - "\tldr r0, [r1]\n" - "\tadds r0, r2\n" - "\tstr r0, [r1]\n" - "_0801A9EE:\n" - "\tadds r4, r6, 0\n" - "\tcmp r4, 0x1E\n" - "\tbls _0801A98A\n" - "\tmov r0, r8\n" - "\tadd sp, 0x4\n" - "\tpop {r3-r5}\n" - "\tmov r8, r3\n" - "\tmov r9, r4\n" - "\tmov r10, r5\n" - "\tpop {r4-r7}\n" - "\tpop {r1}\n" - "\tbx r1"); + LoadOam(); + ProcessSpriteCopyRequests(); + TransferPlttBuffer(); +} + +void sub_801AC54(void) +{ + switch (gMain.state) + { + case 0: + SetGpuReg(REG_OFFSET_DISPCNT, 0x0000); + gUnknown_02022C6C = AllocZeroed(4); + ResetSpriteData(); + FreeAllSpritePalettes(); + ResetTasks(); + ResetBgsAndClearDma3BusyFlags(0); + InitBgsFromTemplates(0, gUnknown_082F0DD0, 1); + reset_temp_tile_data_buffers(); + if (!InitWindows(gUnknown_082F0DD4)) + { + return; + } + DeactivateAllTextPrinters(); + ClearWindowTilemap(0); + FillWindowPixelBuffer(0, 0x00); + FillWindowPixelBuffer(0, 0x11); + FillBgTilemapBufferRect(0, 0, 0, 0, 30, 20, 0xF); + LoadUserWindowBorderGfx(0, 1, 0xD0); + LoadUserWindowBorderGfx_(0, 1, 0xD0); + sub_819789C(); + SetVBlankCallback(sub_801AC40); + gMain.state++; + break; + case 1: + if (sub_801ABDC(&gUnknown_02022C6C->a0, gText_CommStandbyAwaitingOtherPlayer, 0)) + { + gMain.state++; + } + break; + case 2: + BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, 0); + ShowBg(0); + gMain.state++; + break; + case 3: + if (!UpdatePaletteFade()) + { + memset(gBlockSendBuffer, 0, 0x20); + if (gSelectedOrderFromParty[0] == -gSelectedOrderFromParty[1]) + { + gBlockSendBuffer[0] = 0x52; + } + else + { + gBlockSendBuffer[0] = 0x51; + } + SendBlock(0, gBlockSendBuffer, 0x20); + gMain.state++; + } + break; + case 4: + if (GetBlockReceivedStatus() == 3) + { + if (gBlockRecvBuffer[0][0] == 0x51 && gBlockRecvBuffer[1][0] == 0x51) + { + BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, 0); + gMain.state = 50; + } + else + { + sub_800AC34(); + if (gBlockRecvBuffer[GetMultiplayerId()][0] == 0x52) + { + gMain.state = 6; + } + else + { + gMain.state = 8; + } + } + ResetBlockReceivedFlags(); + } + break; + case 50: + if (!UpdatePaletteFade()) + { + sub_800ADF8(); + gMain.state++; + } + break; + case 51: + if (IsLinkTaskFinished()) + { + SetMainCallback2(sub_801AAD4); + } + break; + case 6: + if (gReceivedRemoteLinkPlayers == 0) + { + gMain.state++; + } + break; + case 7: + if (sub_801ABDC(&gUnknown_02022C6C->a0, gText_RefusedBattle, 1)) + { + SetMainCallback2(CB2_ReturnToField); + } + break; + case 8: + if (gReceivedRemoteLinkPlayers == 0) + { + gMain.state++; + } + break; + case 9: + if (sub_801ABDC(&gUnknown_02022C6C->a0, gText_BattleWasRefused, 1)) + { + SetMainCallback2(CB2_ReturnToField); + } + break; + } + RunTasks(); + RunTextPrinters(); + AnimateSprites(); + BuildOamBuffer(); + UpdatePaletteFade(); } -#endif //NONMATCHING -- cgit v1.2.3 From ca9f7fe3563b84504d499bdb291ca10d38cbf229 Mon Sep 17 00:00:00 2001 From: Phlosioneer Date: Tue, 2 Apr 2019 00:59:01 -0400 Subject: Fix hardcoded array sizes --- src/pokenav_match_call.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/pokenav_match_call.c b/src/pokenav_match_call.c index b775ed10e..0a21c4edc 100644 --- a/src/pokenav_match_call.c +++ b/src/pokenav_match_call.c @@ -680,7 +680,7 @@ bool32 MatchCallFlagGetByIndex(u32 idx) match_call_t matchCall; u32 i; - if (idx > 20) + if (idx > ARRAY_COUNT(sMatchCallHeaders) - 1) return FALSE; matchCall = sMatchCallHeaders[idx]; i = MatchCallGetFunctionIndex(matchCall); @@ -727,7 +727,7 @@ u8 sub_81D16DC(u32 idx) match_call_t matchCall; u32 i; - if (idx > 20) + if (idx > ARRAY_COUNT(sMatchCallHeaders) - 1) return 0; matchCall = sMatchCallHeaders[idx]; i = MatchCallGetFunctionIndex(matchCall); @@ -771,7 +771,7 @@ bool32 MatchCall_IsRematchable(u32 idx) match_call_t matchCall; u32 i; - if (idx > 20) + if (idx > ARRAY_COUNT(sMatchCallHeaders) - 1) return 0; matchCall = sMatchCallHeaders[idx]; i = MatchCallGetFunctionIndex(matchCall); @@ -810,13 +810,13 @@ bool32 sub_81D17E8(u32 idx) match_call_t matchCall; u32 i; - if (idx > 20) + if (idx > ARRAY_COUNT(sMatchCallHeaders) - 1) return FALSE; matchCall = sMatchCallHeaders[idx]; i = MatchCallGetFunctionIndex(matchCall); if (gUnknown_08625338[i](matchCall)) return TRUE; - for (i = 0; i < 4; i++) + for (i = 0; i < ARRAY_COUNT(sMatchCallCheckPageOverrides); i++) { if (sMatchCallCheckPageOverrides[i].idx == idx) return TRUE; @@ -854,7 +854,7 @@ u32 MatchCall_GetRematchTableIdx(u32 idx) match_call_t matchCall; u32 i; - if (idx > 20) + if (idx > ARRAY_COUNT(sMatchCallHeaders) - 1) return REMATCH_TABLE_ENTRIES; matchCall = sMatchCallHeaders[idx]; i = MatchCallGetFunctionIndex(matchCall); @@ -891,7 +891,7 @@ void MatchCall_GetMessage(u32 idx, u8 *dest) match_call_t matchCall; u32 i; - if (idx > 20) + if (idx > ARRAY_COUNT(sMatchCallHeaders) - 1) return; matchCall = sMatchCallHeaders[idx]; i = MatchCallGetFunctionIndex(matchCall); @@ -1093,7 +1093,7 @@ void sub_81D1A78(u32 idx, const u8 **desc, const u8 **name) match_call_t matchCall; u32 i; - if (idx > 20) + if (idx > ARRAY_COUNT(sMatchCallHeaders) - 1) return; matchCall = sMatchCallHeaders[idx]; i = MatchCallGetFunctionIndex(matchCall); @@ -1146,11 +1146,11 @@ const u8 *sub_81D1B40(u32 idx, u32 offset) { u32 i; - for (i = 0; i < 4; i++) + for (i = 0; i < ARRAY_COUNT(sMatchCallCheckPageOverrides); i++) { if (sMatchCallCheckPageOverrides[i].idx == idx) { - for (; i + 1 < 4 && sMatchCallCheckPageOverrides[i + 1].idx == idx; i++) + for (; i + 1 < ARRAY_COUNT(sMatchCallCheckPageOverrides) && sMatchCallCheckPageOverrides[i + 1].idx == idx; i++) { if (!FlagGet(sMatchCallCheckPageOverrides[i + 1].v4)) break; @@ -1244,7 +1244,7 @@ s32 sub_81D1BD0(u32 idx) { u32 i; - for (i = 0; i < 4; i++) + for (i = 0; i < ARRAY_COUNT(sMatchCallCheckPageOverrides); i++) { if (sMatchCallCheckPageOverrides[i].idx == idx) return sMatchCallCheckPageOverrides[i].v2; @@ -1256,7 +1256,7 @@ bool32 sub_81D1BF8(u32 idx) { s32 i; - for (i = 0; i < 21; i++) + for (i = 0; i < (s32)ARRAY_COUNT(sMatchCallHeaders); i++) { u32 r0 = MatchCall_GetRematchTableIdx(i); if (r0 != REMATCH_TABLE_ENTRIES && r0 == idx) -- cgit v1.2.3 From 65d8b68f9db02252ae5e4ba8ee779218eb67f135 Mon Sep 17 00:00:00 2001 From: Phlosioneer Date: Tue, 2 Apr 2019 01:10:20 -0400 Subject: Expicitly hardcode rematch indecies Inserting an entry without updating the indecies will now cause a compiler error. This will make it easier for modders to remember to update the constants. --- src/battle_setup.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/battle_setup.c b/src/battle_setup.c index 347486a0b..cb7b63ebe 100644 --- a/src/battle_setup.c +++ b/src/battle_setup.c @@ -296,7 +296,8 @@ const struct RematchTrainer gRematchTable[REMATCH_TABLE_ENTRIES] = {{TRAINER_TRENT_1, TRAINER_TRENT_2, TRAINER_TRENT_3, TRAINER_TRENT_4, TRAINER_TRENT_5}, 0x0, 0x1b}, {{TRAINER_SAWYER_1, TRAINER_SAWYER_2, TRAINER_SAWYER_3, TRAINER_SAWYER_4, TRAINER_SAWYER_5}, 0x18, 0xc}, {{TRAINER_KIRA_AND_DAN_1, TRAINER_KIRA_AND_DAN_2, TRAINER_KIRA_AND_DAN_3, TRAINER_KIRA_AND_DAN_4, TRAINER_KIRA_AND_DAN_5}, 0x18, 0x3e}, - {{TRAINER_WALLY_3, TRAINER_WALLY_4, TRAINER_WALLY_5, TRAINER_WALLY_6, TRAINER_WALLY_6}, 0x18, 0x2b}, + // Wally's entry index is hardcoded. + [REMATCH_WALLY_ENTRY] = {{TRAINER_WALLY_3, TRAINER_WALLY_4, TRAINER_WALLY_5, TRAINER_WALLY_6, TRAINER_WALLY_6}, 0x18, 0x2b}, {{TRAINER_ROXANNE_1, TRAINER_ROXANNE_2, TRAINER_ROXANNE_3, TRAINER_ROXANNE_4, TRAINER_ROXANNE_5}, 0x0, 0x3}, {{TRAINER_BRAWLY_1, TRAINER_BRAWLY_2, TRAINER_BRAWLY_3, TRAINER_BRAWLY_4, TRAINER_BRAWLY_5}, 0x0, 0xb}, {{TRAINER_WATTSON_1, TRAINER_WATTSON_2, TRAINER_WATTSON_3, TRAINER_WATTSON_4, TRAINER_WATTSON_5}, 0x0, 0x2}, @@ -305,7 +306,8 @@ const struct RematchTrainer gRematchTable[REMATCH_TABLE_ENTRIES] = {{TRAINER_WINONA_1, TRAINER_WINONA_2, TRAINER_WINONA_3, TRAINER_WINONA_4, TRAINER_WINONA_5}, 0x0, 0x4}, {{TRAINER_TATE_AND_LIZA_1, TRAINER_TATE_AND_LIZA_2, TRAINER_TATE_AND_LIZA_3, TRAINER_TATE_AND_LIZA_4, TRAINER_TATE_AND_LIZA_5}, 0x0, 0x6}, {{TRAINER_JUAN_1, TRAINER_JUAN_2, TRAINER_JUAN_3, TRAINER_JUAN_4, TRAINER_JUAN_5}, 0x0, 0x7}, - {{TRAINER_SIDNEY, TRAINER_SIDNEY, TRAINER_SIDNEY, TRAINER_SIDNEY, TRAINER_SIDNEY}, 0x0, 0x8}, + + [REMATCH_ELITE_FOUR_ENTRIES] = {{TRAINER_SIDNEY, TRAINER_SIDNEY, TRAINER_SIDNEY, TRAINER_SIDNEY, TRAINER_SIDNEY}, 0x0, 0x8}, {{TRAINER_PHOEBE, TRAINER_PHOEBE, TRAINER_PHOEBE, TRAINER_PHOEBE, TRAINER_PHOEBE}, 0x0, 0x8}, {{TRAINER_GLACIA, TRAINER_GLACIA, TRAINER_GLACIA, TRAINER_GLACIA, TRAINER_GLACIA}, 0x0, 0x8}, {{TRAINER_DRAKE, TRAINER_DRAKE, TRAINER_DRAKE, TRAINER_DRAKE, TRAINER_DRAKE}, 0x0, 0x8}, -- cgit v1.2.3 From 6916f09cd5cdb508e270bfba40f1bd165a16762f Mon Sep 17 00:00:00 2001 From: Phlosioneer Date: Tue, 2 Apr 2019 03:22:07 -0400 Subject: Expand MatchCallStruct defs, use REMATCH_* enum --- src/battle_setup.c | 162 ++++++++++++++++---------------- src/pokenav_match_call.c | 236 +++++++++++++++++++++++++++++++++++++++++------ 2 files changed, 286 insertions(+), 112 deletions(-) (limited to 'src') diff --git a/src/battle_setup.c b/src/battle_setup.c index cb7b63ebe..7395c175b 100644 --- a/src/battle_setup.c +++ b/src/battle_setup.c @@ -232,86 +232,84 @@ static const struct TrainerBattleParameter sTrainerBContinueScriptBattleParams[] const struct RematchTrainer gRematchTable[REMATCH_TABLE_ENTRIES] = { - {{TRAINER_ROSE_1, TRAINER_ROSE_2, TRAINER_ROSE_3, TRAINER_ROSE_4, TRAINER_ROSE_5}, 0x0, 0x21}, - {{TRAINER_ANDRES_1, TRAINER_ANDRES_2, TRAINER_ANDRES_3, TRAINER_ANDRES_4, TRAINER_ANDRES_5}, 0x0, 0x14}, - {{TRAINER_DUSTY_1, TRAINER_DUSTY_2, TRAINER_DUSTY_3, TRAINER_DUSTY_4, TRAINER_DUSTY_5}, 0x0, 0x1a}, - {{TRAINER_LOLA_1, TRAINER_LOLA_2, TRAINER_LOLA_3, TRAINER_LOLA_4, TRAINER_LOLA_5}, 0x0, 0x18}, - {{TRAINER_RICKY_1, TRAINER_RICKY_2, TRAINER_RICKY_3, TRAINER_RICKY_4, TRAINER_RICKY_5}, 0x0, 0x18}, - {{TRAINER_LILA_AND_ROY_1, TRAINER_LILA_AND_ROY_2, TRAINER_LILA_AND_ROY_3, TRAINER_LILA_AND_ROY_4, TRAINER_LILA_AND_ROY_5}, 0x0, 0x27}, - {{TRAINER_CRISTIN_1, TRAINER_CRISTIN_2, TRAINER_CRISTIN_3, TRAINER_CRISTIN_4, TRAINER_CRISTIN_5}, 0x0, 0x24}, - {{TRAINER_BROOKE_1, TRAINER_BROOKE_2, TRAINER_BROOKE_3, TRAINER_BROOKE_4, TRAINER_BROOKE_5}, 0x0, 0x1a}, - {{TRAINER_WILTON_1, TRAINER_WILTON_2, TRAINER_WILTON_3, TRAINER_WILTON_4, TRAINER_WILTON_5}, 0x0, 0x1a}, - {{TRAINER_VALERIE_1, TRAINER_VALERIE_2, TRAINER_VALERIE_3, TRAINER_VALERIE_4, TRAINER_VALERIE_5}, 0x18, 0x14}, - {{TRAINER_CINDY_1, TRAINER_CINDY_3, TRAINER_CINDY_4, TRAINER_CINDY_5, TRAINER_CINDY_6}, 0x0, 0x13}, - {{TRAINER_THALIA_1, TRAINER_THALIA_2, TRAINER_THALIA_3, TRAINER_THALIA_4, TRAINER_THALIA_5}, 0x18, 0x38}, - {{TRAINER_JESSICA_1, TRAINER_JESSICA_2, TRAINER_JESSICA_3, TRAINER_JESSICA_4, TRAINER_JESSICA_5}, 0x0, 0x24}, - {{TRAINER_WINSTON_1, TRAINER_WINSTON_2, TRAINER_WINSTON_3, TRAINER_WINSTON_4, TRAINER_WINSTON_5}, 0x0, 0x13}, - {{TRAINER_STEVE_1, TRAINER_STEVE_2, TRAINER_STEVE_3, TRAINER_STEVE_4, TRAINER_STEVE_5}, 0x0, 0x1d}, - {{TRAINER_TONY_1, TRAINER_TONY_2, TRAINER_TONY_3, TRAINER_TONY_4, TRAINER_TONY_5}, 0x0, 0x16}, - {{TRAINER_NOB_1, TRAINER_NOB_2, TRAINER_NOB_3, TRAINER_NOB_4, TRAINER_NOB_5}, 0x0, 0x1e}, - {{TRAINER_KOJI_1, TRAINER_KOJI_2, TRAINER_KOJI_3, TRAINER_KOJI_4, TRAINER_KOJI_5}, 0x0, 0x2a}, - {{TRAINER_FERNANDO_1, TRAINER_FERNANDO_2, TRAINER_FERNANDO_3, TRAINER_FERNANDO_4, TRAINER_FERNANDO_5}, 0x0, 0x26}, - {{TRAINER_DALTON_1, TRAINER_DALTON_2, TRAINER_DALTON_3, TRAINER_DALTON_4, TRAINER_DALTON_5}, 0x0, 0x21}, - {{TRAINER_BERNIE_1, TRAINER_BERNIE_2, TRAINER_BERNIE_3, TRAINER_BERNIE_4, TRAINER_BERNIE_5}, 0x0, 0x1d}, - {{TRAINER_ETHAN_1, TRAINER_ETHAN_2, TRAINER_ETHAN_3, TRAINER_ETHAN_4, TRAINER_ETHAN_5}, 0x18, 0xd}, - {{TRAINER_JOHN_AND_JAY_1, TRAINER_JOHN_AND_JAY_2, TRAINER_JOHN_AND_JAY_3, TRAINER_JOHN_AND_JAY_4, TRAINER_JOHN_AND_JAY_5}, 0x18, 0x1}, - {{TRAINER_JEFFREY_1, TRAINER_JEFFREY_2, TRAINER_JEFFREY_3, TRAINER_JEFFREY_4, TRAINER_JEFFREY_5}, 0x0, 0x23}, - {{TRAINER_CAMERON_1, TRAINER_CAMERON_2, TRAINER_CAMERON_3, TRAINER_CAMERON_4, TRAINER_CAMERON_5}, 0x0, 0x26}, - {{TRAINER_JACKI_1, TRAINER_JACKI_2, TRAINER_JACKI_3, TRAINER_JACKI_4, TRAINER_JACKI_5}, 0x0, 0x26}, - {{TRAINER_WALTER_1, TRAINER_WALTER_2, TRAINER_WALTER_3, TRAINER_WALTER_4, TRAINER_WALTER_5}, 0x0, 0x24}, - {{TRAINER_KAREN_1, TRAINER_KAREN_2, TRAINER_KAREN_3, TRAINER_KAREN_4, TRAINER_KAREN_5}, 0x0, 0x1f}, - {{TRAINER_JERRY_1, TRAINER_JERRY_2, TRAINER_JERRY_3, TRAINER_JERRY_4, TRAINER_JERRY_5}, 0x0, 0x1f}, - {{TRAINER_ANNA_AND_MEG_1, TRAINER_ANNA_AND_MEG_2, TRAINER_ANNA_AND_MEG_3, TRAINER_ANNA_AND_MEG_4, TRAINER_ANNA_AND_MEG_5}, 0x0, 0x20}, - {{TRAINER_ISABEL_1, TRAINER_ISABEL_2, TRAINER_ISABEL_3, TRAINER_ISABEL_4, TRAINER_ISABEL_5}, 0x0, 0x19}, - {{TRAINER_MIGUEL_1, TRAINER_MIGUEL_2, TRAINER_MIGUEL_3, TRAINER_MIGUEL_4, TRAINER_MIGUEL_5}, 0x0, 0x12}, - {{TRAINER_TIMOTHY_1, TRAINER_TIMOTHY_2, TRAINER_TIMOTHY_3, TRAINER_TIMOTHY_4, TRAINER_TIMOTHY_5}, 0x0, 0x1e}, - {{TRAINER_SHELBY_1, TRAINER_SHELBY_2, TRAINER_SHELBY_3, TRAINER_SHELBY_4, TRAINER_SHELBY_5}, 0x18, 0xc}, - {{TRAINER_CALVIN_1, TRAINER_CALVIN_2, TRAINER_CALVIN_3, TRAINER_CALVIN_4, TRAINER_CALVIN_5}, 0x0, 0x11}, - {{TRAINER_ELLIOT_1, TRAINER_ELLIOT_2, TRAINER_ELLIOT_3, TRAINER_ELLIOT_4, TRAINER_ELLIOT_5}, 0x0, 0x15}, - {{TRAINER_ISAIAH_1, TRAINER_ISAIAH_2, TRAINER_ISAIAH_3, TRAINER_ISAIAH_4, TRAINER_ISAIAH_5}, 0x0, 0x2b}, - {{TRAINER_MARIA_1, TRAINER_MARIA_2, TRAINER_MARIA_3, TRAINER_MARIA_4, TRAINER_MARIA_5}, 0x0, 0x20}, - {{TRAINER_ABIGAIL_1, TRAINER_ABIGAIL_2, TRAINER_ABIGAIL_3, TRAINER_ABIGAIL_4, TRAINER_ABIGAIL_5}, 0x0, 0x19}, - {{TRAINER_DYLAN_1, TRAINER_DYLAN_2, TRAINER_DYLAN_3, TRAINER_DYLAN_4, TRAINER_DYLAN_5}, 0x0, 0x20}, - {{TRAINER_KATELYN_1, TRAINER_KATELYN_2, TRAINER_KATELYN_3, TRAINER_KATELYN_4, TRAINER_KATELYN_5}, 0x0, 0x2b}, - {{TRAINER_BENJAMIN_1, TRAINER_BENJAMIN_2, TRAINER_BENJAMIN_3, TRAINER_BENJAMIN_4, TRAINER_BENJAMIN_5}, 0x0, 0x19}, - {{TRAINER_PABLO_1, TRAINER_PABLO_2, TRAINER_PABLO_3, TRAINER_PABLO_4, TRAINER_PABLO_5}, 0x0, 0x29}, - {{TRAINER_NICOLAS_1, TRAINER_NICOLAS_2, TRAINER_NICOLAS_3, TRAINER_NICOLAS_4, TRAINER_NICOLAS_5}, 0x18, 0x1}, - {{TRAINER_ROBERT_1, TRAINER_ROBERT_2, TRAINER_ROBERT_3, TRAINER_ROBERT_4, TRAINER_ROBERT_5}, 0x0, 0x23}, - {{TRAINER_LAO_1, TRAINER_LAO_2, TRAINER_LAO_3, TRAINER_LAO_4, TRAINER_LAO_5}, 0x0, 0x1c}, - {{TRAINER_CYNDY_1, TRAINER_CYNDY_2, TRAINER_CYNDY_3, TRAINER_CYNDY_4, TRAINER_CYNDY_5}, 0x0, 0x1e}, - {{TRAINER_MADELINE_1, TRAINER_MADELINE_2, TRAINER_MADELINE_3, TRAINER_MADELINE_4, TRAINER_MADELINE_5}, 0x0, 0x1c}, - {{TRAINER_JENNY_1, TRAINER_JENNY_2, TRAINER_JENNY_3, TRAINER_JENNY_4, TRAINER_JENNY_5}, 0x0, 0x27}, - {{TRAINER_DIANA_1, TRAINER_DIANA_2, TRAINER_DIANA_3, TRAINER_DIANA_4, TRAINER_DIANA_5}, 0x18, 0xd}, - {{TRAINER_AMY_AND_LIV_1, TRAINER_AMY_AND_LIV_2, TRAINER_AMY_AND_LIV_4, TRAINER_AMY_AND_LIV_5, TRAINER_AMY_AND_LIV_6}, 0x0, 0x12}, - {{TRAINER_ERNEST_1, TRAINER_ERNEST_2, TRAINER_ERNEST_3, TRAINER_ERNEST_4, TRAINER_ERNEST_5}, 0x0, 0x28}, - {{TRAINER_CORY_1, TRAINER_CORY_2, TRAINER_CORY_3, TRAINER_CORY_4, TRAINER_CORY_5}, 0x0, 0x17}, - {{TRAINER_EDWIN_1, TRAINER_EDWIN_2, TRAINER_EDWIN_3, TRAINER_EDWIN_4, TRAINER_EDWIN_5}, 0x0, 0x19}, - {{TRAINER_LYDIA_1, TRAINER_LYDIA_2, TRAINER_LYDIA_3, TRAINER_LYDIA_4, TRAINER_LYDIA_5}, 0x0, 0x20}, - {{TRAINER_ISAAC_1, TRAINER_ISAAC_2, TRAINER_ISAAC_3, TRAINER_ISAAC_4, TRAINER_ISAAC_5}, 0x0, 0x20}, - {{TRAINER_GABRIELLE_1, TRAINER_GABRIELLE_2, TRAINER_GABRIELLE_3, TRAINER_GABRIELLE_4, TRAINER_GABRIELLE_5}, 0x18, 0x11}, - {{TRAINER_CATHERINE_1, TRAINER_CATHERINE_2, TRAINER_CATHERINE_3, TRAINER_CATHERINE_4, TRAINER_CATHERINE_5}, 0x0, 0x22}, - {{TRAINER_JACKSON_1, TRAINER_JACKSON_2, TRAINER_JACKSON_3, TRAINER_JACKSON_4, TRAINER_JACKSON_5}, 0x0, 0x22}, - {{TRAINER_HALEY_1, TRAINER_HALEY_2, TRAINER_HALEY_3, TRAINER_HALEY_4, TRAINER_HALEY_5}, 0x0, 0x13}, - {{TRAINER_JAMES_1, TRAINER_JAMES_2, TRAINER_JAMES_3, TRAINER_JAMES_4, TRAINER_JAMES_5}, 0x18, 0xb}, - {{TRAINER_TRENT_1, TRAINER_TRENT_2, TRAINER_TRENT_3, TRAINER_TRENT_4, TRAINER_TRENT_5}, 0x0, 0x1b}, - {{TRAINER_SAWYER_1, TRAINER_SAWYER_2, TRAINER_SAWYER_3, TRAINER_SAWYER_4, TRAINER_SAWYER_5}, 0x18, 0xc}, - {{TRAINER_KIRA_AND_DAN_1, TRAINER_KIRA_AND_DAN_2, TRAINER_KIRA_AND_DAN_3, TRAINER_KIRA_AND_DAN_4, TRAINER_KIRA_AND_DAN_5}, 0x18, 0x3e}, - // Wally's entry index is hardcoded. - [REMATCH_WALLY_ENTRY] = {{TRAINER_WALLY_3, TRAINER_WALLY_4, TRAINER_WALLY_5, TRAINER_WALLY_6, TRAINER_WALLY_6}, 0x18, 0x2b}, - {{TRAINER_ROXANNE_1, TRAINER_ROXANNE_2, TRAINER_ROXANNE_3, TRAINER_ROXANNE_4, TRAINER_ROXANNE_5}, 0x0, 0x3}, - {{TRAINER_BRAWLY_1, TRAINER_BRAWLY_2, TRAINER_BRAWLY_3, TRAINER_BRAWLY_4, TRAINER_BRAWLY_5}, 0x0, 0xb}, - {{TRAINER_WATTSON_1, TRAINER_WATTSON_2, TRAINER_WATTSON_3, TRAINER_WATTSON_4, TRAINER_WATTSON_5}, 0x0, 0x2}, - {{TRAINER_FLANNERY_1, TRAINER_FLANNERY_2, TRAINER_FLANNERY_3, TRAINER_FLANNERY_4, TRAINER_FLANNERY_5}, 0x0, 0xc}, - {{TRAINER_NORMAN_1, TRAINER_NORMAN_2, TRAINER_NORMAN_3, TRAINER_NORMAN_4, TRAINER_NORMAN_5}, 0x0, 0x0}, - {{TRAINER_WINONA_1, TRAINER_WINONA_2, TRAINER_WINONA_3, TRAINER_WINONA_4, TRAINER_WINONA_5}, 0x0, 0x4}, - {{TRAINER_TATE_AND_LIZA_1, TRAINER_TATE_AND_LIZA_2, TRAINER_TATE_AND_LIZA_3, TRAINER_TATE_AND_LIZA_4, TRAINER_TATE_AND_LIZA_5}, 0x0, 0x6}, - {{TRAINER_JUAN_1, TRAINER_JUAN_2, TRAINER_JUAN_3, TRAINER_JUAN_4, TRAINER_JUAN_5}, 0x0, 0x7}, - - [REMATCH_ELITE_FOUR_ENTRIES] = {{TRAINER_SIDNEY, TRAINER_SIDNEY, TRAINER_SIDNEY, TRAINER_SIDNEY, TRAINER_SIDNEY}, 0x0, 0x8}, - {{TRAINER_PHOEBE, TRAINER_PHOEBE, TRAINER_PHOEBE, TRAINER_PHOEBE, TRAINER_PHOEBE}, 0x0, 0x8}, - {{TRAINER_GLACIA, TRAINER_GLACIA, TRAINER_GLACIA, TRAINER_GLACIA, TRAINER_GLACIA}, 0x0, 0x8}, - {{TRAINER_DRAKE, TRAINER_DRAKE, TRAINER_DRAKE, TRAINER_DRAKE, TRAINER_DRAKE}, 0x0, 0x8}, - {{TRAINER_WALLACE, TRAINER_WALLACE, TRAINER_WALLACE, TRAINER_WALLACE, TRAINER_WALLACE}, 0x0, 0x8}, + [REMATCH_ROSE] = {{TRAINER_ROSE_1, TRAINER_ROSE_2, TRAINER_ROSE_3, TRAINER_ROSE_4, TRAINER_ROSE_5}, 0x0, 0x21}, + [REMATCH_ANDRES] = {{TRAINER_ANDRES_1, TRAINER_ANDRES_2, TRAINER_ANDRES_3, TRAINER_ANDRES_4, TRAINER_ANDRES_5}, 0x0, 0x14}, + [REMATCH_DUSTY] = {{TRAINER_DUSTY_1, TRAINER_DUSTY_2, TRAINER_DUSTY_3, TRAINER_DUSTY_4, TRAINER_DUSTY_5}, 0x0, 0x1a}, + [REMATCH_LOLA] = {{TRAINER_LOLA_1, TRAINER_LOLA_2, TRAINER_LOLA_3, TRAINER_LOLA_4, TRAINER_LOLA_5}, 0x0, 0x18}, + [REMATCH_RICKY] = {{TRAINER_RICKY_1, TRAINER_RICKY_2, TRAINER_RICKY_3, TRAINER_RICKY_4, TRAINER_RICKY_5}, 0x0, 0x18}, + [REMATCH_LILA_AND_ROY] = {{TRAINER_LILA_AND_ROY_1, TRAINER_LILA_AND_ROY_2, TRAINER_LILA_AND_ROY_3, TRAINER_LILA_AND_ROY_4, TRAINER_LILA_AND_ROY_5}, 0x0, 0x27}, + [REMATCH_CRISTIN] = {{TRAINER_CRISTIN_1, TRAINER_CRISTIN_2, TRAINER_CRISTIN_3, TRAINER_CRISTIN_4, TRAINER_CRISTIN_5}, 0x0, 0x24}, + [REMATCH_BROOKE] = {{TRAINER_BROOKE_1, TRAINER_BROOKE_2, TRAINER_BROOKE_3, TRAINER_BROOKE_4, TRAINER_BROOKE_5}, 0x0, 0x1a}, + [REMATCH_WILTON] = {{TRAINER_WILTON_1, TRAINER_WILTON_2, TRAINER_WILTON_3, TRAINER_WILTON_4, TRAINER_WILTON_5}, 0x0, 0x1a}, + [REMATCH_VALERIE] = {{TRAINER_VALERIE_1, TRAINER_VALERIE_2, TRAINER_VALERIE_3, TRAINER_VALERIE_4, TRAINER_VALERIE_5}, 0x18, 0x14}, + [REMATCH_CINDY] = {{TRAINER_CINDY_1, TRAINER_CINDY_3, TRAINER_CINDY_4, TRAINER_CINDY_5, TRAINER_CINDY_6}, 0x0, 0x13}, + [REMATCH_THALIA] = {{TRAINER_THALIA_1, TRAINER_THALIA_2, TRAINER_THALIA_3, TRAINER_THALIA_4, TRAINER_THALIA_5}, 0x18, 0x38}, + [REMATCH_JESSICA] = {{TRAINER_JESSICA_1, TRAINER_JESSICA_2, TRAINER_JESSICA_3, TRAINER_JESSICA_4, TRAINER_JESSICA_5}, 0x0, 0x24}, + [REMATCH_WINSTON] = {{TRAINER_WINSTON_1, TRAINER_WINSTON_2, TRAINER_WINSTON_3, TRAINER_WINSTON_4, TRAINER_WINSTON_5}, 0x0, 0x13}, + [REMATCH_STEVE] = {{TRAINER_STEVE_1, TRAINER_STEVE_2, TRAINER_STEVE_3, TRAINER_STEVE_4, TRAINER_STEVE_5}, 0x0, 0x1d}, + [REMATCH_TONY] = {{TRAINER_TONY_1, TRAINER_TONY_2, TRAINER_TONY_3, TRAINER_TONY_4, TRAINER_TONY_5}, 0x0, 0x16}, + [REMATCH_NOB] = {{TRAINER_NOB_1, TRAINER_NOB_2, TRAINER_NOB_3, TRAINER_NOB_4, TRAINER_NOB_5}, 0x0, 0x1e}, + [REMATCH_KOJI] = {{TRAINER_KOJI_1, TRAINER_KOJI_2, TRAINER_KOJI_3, TRAINER_KOJI_4, TRAINER_KOJI_5}, 0x0, 0x2a}, + [REMATCH_FERNANDO] = {{TRAINER_FERNANDO_1, TRAINER_FERNANDO_2, TRAINER_FERNANDO_3, TRAINER_FERNANDO_4, TRAINER_FERNANDO_5}, 0x0, 0x26}, + [REMATCH_DALTON] = {{TRAINER_DALTON_1, TRAINER_DALTON_2, TRAINER_DALTON_3, TRAINER_DALTON_4, TRAINER_DALTON_5}, 0x0, 0x21}, + [REMATCH_BERNIE] = {{TRAINER_BERNIE_1, TRAINER_BERNIE_2, TRAINER_BERNIE_3, TRAINER_BERNIE_4, TRAINER_BERNIE_5}, 0x0, 0x1d}, + [REMATCH_ETHAN] = {{TRAINER_ETHAN_1, TRAINER_ETHAN_2, TRAINER_ETHAN_3, TRAINER_ETHAN_4, TRAINER_ETHAN_5}, 0x18, 0xd}, + [REMATCH_JOHN_AND_JAY] = {{TRAINER_JOHN_AND_JAY_1, TRAINER_JOHN_AND_JAY_2, TRAINER_JOHN_AND_JAY_3, TRAINER_JOHN_AND_JAY_4, TRAINER_JOHN_AND_JAY_5}, 0x18, 0x1}, + [REMATCH_JEFFREY] = {{TRAINER_JEFFREY_1, TRAINER_JEFFREY_2, TRAINER_JEFFREY_3, TRAINER_JEFFREY_4, TRAINER_JEFFREY_5}, 0x0, 0x23}, + [REMATCH_CAMERON] = {{TRAINER_CAMERON_1, TRAINER_CAMERON_2, TRAINER_CAMERON_3, TRAINER_CAMERON_4, TRAINER_CAMERON_5}, 0x0, 0x26}, + [REMATCH_JACKI] = {{TRAINER_JACKI_1, TRAINER_JACKI_2, TRAINER_JACKI_3, TRAINER_JACKI_4, TRAINER_JACKI_5}, 0x0, 0x26}, + [REMATCH_WALTER] = {{TRAINER_WALTER_1, TRAINER_WALTER_2, TRAINER_WALTER_3, TRAINER_WALTER_4, TRAINER_WALTER_5}, 0x0, 0x24}, + [REMATCH_KAREN] = {{TRAINER_KAREN_1, TRAINER_KAREN_2, TRAINER_KAREN_3, TRAINER_KAREN_4, TRAINER_KAREN_5}, 0x0, 0x1f}, + [REMATCH_JERRY] = {{TRAINER_JERRY_1, TRAINER_JERRY_2, TRAINER_JERRY_3, TRAINER_JERRY_4, TRAINER_JERRY_5}, 0x0, 0x1f}, + [REMATCH_ANNA_AND_MEG] = {{TRAINER_ANNA_AND_MEG_1, TRAINER_ANNA_AND_MEG_2, TRAINER_ANNA_AND_MEG_3, TRAINER_ANNA_AND_MEG_4, TRAINER_ANNA_AND_MEG_5}, 0x0, 0x20}, + [REMATCH_ISABEL] = {{TRAINER_ISABEL_1, TRAINER_ISABEL_2, TRAINER_ISABEL_3, TRAINER_ISABEL_4, TRAINER_ISABEL_5}, 0x0, 0x19}, + [REMATCH_MIGUEL] = {{TRAINER_MIGUEL_1, TRAINER_MIGUEL_2, TRAINER_MIGUEL_3, TRAINER_MIGUEL_4, TRAINER_MIGUEL_5}, 0x0, 0x12}, + [REMATCH_TIMOTHY] = {{TRAINER_TIMOTHY_1, TRAINER_TIMOTHY_2, TRAINER_TIMOTHY_3, TRAINER_TIMOTHY_4, TRAINER_TIMOTHY_5}, 0x0, 0x1e}, + [REMATCH_SHELBY] = {{TRAINER_SHELBY_1, TRAINER_SHELBY_2, TRAINER_SHELBY_3, TRAINER_SHELBY_4, TRAINER_SHELBY_5}, 0x18, 0xc}, + [REMATCH_CALVIN] = {{TRAINER_CALVIN_1, TRAINER_CALVIN_2, TRAINER_CALVIN_3, TRAINER_CALVIN_4, TRAINER_CALVIN_5}, 0x0, 0x11}, + [REMATCH_ELLIOT] = {{TRAINER_ELLIOT_1, TRAINER_ELLIOT_2, TRAINER_ELLIOT_3, TRAINER_ELLIOT_4, TRAINER_ELLIOT_5}, 0x0, 0x15}, + [REMATCH_ISAIAH] = {{TRAINER_ISAIAH_1, TRAINER_ISAIAH_2, TRAINER_ISAIAH_3, TRAINER_ISAIAH_4, TRAINER_ISAIAH_5}, 0x0, 0x2b}, + [REMATCH_MARIA] = {{TRAINER_MARIA_1, TRAINER_MARIA_2, TRAINER_MARIA_3, TRAINER_MARIA_4, TRAINER_MARIA_5}, 0x0, 0x20}, + [REMATCH_ABIGAIL] = {{TRAINER_ABIGAIL_1, TRAINER_ABIGAIL_2, TRAINER_ABIGAIL_3, TRAINER_ABIGAIL_4, TRAINER_ABIGAIL_5}, 0x0, 0x19}, + [REMATCH_DYLAN] = {{TRAINER_DYLAN_1, TRAINER_DYLAN_2, TRAINER_DYLAN_3, TRAINER_DYLAN_4, TRAINER_DYLAN_5}, 0x0, 0x20}, + [REMATCH_KATELYN] = {{TRAINER_KATELYN_1, TRAINER_KATELYN_2, TRAINER_KATELYN_3, TRAINER_KATELYN_4, TRAINER_KATELYN_5}, 0x0, 0x2b}, + [REMATCH_BENJAMIN] = {{TRAINER_BENJAMIN_1, TRAINER_BENJAMIN_2, TRAINER_BENJAMIN_3, TRAINER_BENJAMIN_4, TRAINER_BENJAMIN_5}, 0x0, 0x19}, + [REMATCH_PABLO] = {{TRAINER_PABLO_1, TRAINER_PABLO_2, TRAINER_PABLO_3, TRAINER_PABLO_4, TRAINER_PABLO_5}, 0x0, 0x29}, + [REMATCH_NICOLAS] = {{TRAINER_NICOLAS_1, TRAINER_NICOLAS_2, TRAINER_NICOLAS_3, TRAINER_NICOLAS_4, TRAINER_NICOLAS_5}, 0x18, 0x1}, + [REMATCH_ROBERT] = {{TRAINER_ROBERT_1, TRAINER_ROBERT_2, TRAINER_ROBERT_3, TRAINER_ROBERT_4, TRAINER_ROBERT_5}, 0x0, 0x23}, + [REMATCH_LAO] = {{TRAINER_LAO_1, TRAINER_LAO_2, TRAINER_LAO_3, TRAINER_LAO_4, TRAINER_LAO_5}, 0x0, 0x1c}, + [REMATCH_CYNDY] = {{TRAINER_CYNDY_1, TRAINER_CYNDY_2, TRAINER_CYNDY_3, TRAINER_CYNDY_4, TRAINER_CYNDY_5}, 0x0, 0x1e}, + [REMATCH_MADELINE] = {{TRAINER_MADELINE_1, TRAINER_MADELINE_2, TRAINER_MADELINE_3, TRAINER_MADELINE_4, TRAINER_MADELINE_5}, 0x0, 0x1c}, + [REMATCH_JENNY] = {{TRAINER_JENNY_1, TRAINER_JENNY_2, TRAINER_JENNY_3, TRAINER_JENNY_4, TRAINER_JENNY_5}, 0x0, 0x27}, + [REMATCH_DIANA] = {{TRAINER_DIANA_1, TRAINER_DIANA_2, TRAINER_DIANA_3, TRAINER_DIANA_4, TRAINER_DIANA_5}, 0x18, 0xd}, + [REMATCH_AMY_AND_LIV] = {{TRAINER_AMY_AND_LIV_1, TRAINER_AMY_AND_LIV_2, TRAINER_AMY_AND_LIV_4, TRAINER_AMY_AND_LIV_5, TRAINER_AMY_AND_LIV_6}, 0x0, 0x12}, + [REMATCH_ERNEST] = {{TRAINER_ERNEST_1, TRAINER_ERNEST_2, TRAINER_ERNEST_3, TRAINER_ERNEST_4, TRAINER_ERNEST_5}, 0x0, 0x28}, + [REMATCH_CORY] = {{TRAINER_CORY_1, TRAINER_CORY_2, TRAINER_CORY_3, TRAINER_CORY_4, TRAINER_CORY_5}, 0x0, 0x17}, + [REMATCH_EDWIN] = {{TRAINER_EDWIN_1, TRAINER_EDWIN_2, TRAINER_EDWIN_3, TRAINER_EDWIN_4, TRAINER_EDWIN_5}, 0x0, 0x19}, + [REMATCH_LYDIA] = {{TRAINER_LYDIA_1, TRAINER_LYDIA_2, TRAINER_LYDIA_3, TRAINER_LYDIA_4, TRAINER_LYDIA_5}, 0x0, 0x20}, + [REMATCH_ISAAC] = {{TRAINER_ISAAC_1, TRAINER_ISAAC_2, TRAINER_ISAAC_3, TRAINER_ISAAC_4, TRAINER_ISAAC_5}, 0x0, 0x20}, + [REMATCH_GABRIELLE] = {{TRAINER_GABRIELLE_1, TRAINER_GABRIELLE_2, TRAINER_GABRIELLE_3, TRAINER_GABRIELLE_4, TRAINER_GABRIELLE_5}, 0x18, 0x11}, + [REMATCH_CATHERINE] = {{TRAINER_CATHERINE_1, TRAINER_CATHERINE_2, TRAINER_CATHERINE_3, TRAINER_CATHERINE_4, TRAINER_CATHERINE_5}, 0x0, 0x22}, + [REMATCH_JACKSON] = {{TRAINER_JACKSON_1, TRAINER_JACKSON_2, TRAINER_JACKSON_3, TRAINER_JACKSON_4, TRAINER_JACKSON_5}, 0x0, 0x22}, + [REMATCH_HALEY] = {{TRAINER_HALEY_1, TRAINER_HALEY_2, TRAINER_HALEY_3, TRAINER_HALEY_4, TRAINER_HALEY_5}, 0x0, 0x13}, + [REMATCH_JAMES] = {{TRAINER_JAMES_1, TRAINER_JAMES_2, TRAINER_JAMES_3, TRAINER_JAMES_4, TRAINER_JAMES_5}, 0x18, 0xb}, + [REMATCH_TRENT] = {{TRAINER_TRENT_1, TRAINER_TRENT_2, TRAINER_TRENT_3, TRAINER_TRENT_4, TRAINER_TRENT_5}, 0x0, 0x1b}, + [REMATCH_SAWYER] = {{TRAINER_SAWYER_1, TRAINER_SAWYER_2, TRAINER_SAWYER_3, TRAINER_SAWYER_4, TRAINER_SAWYER_5}, 0x18, 0xc}, + [REMATCH_KIRA_AND_DAN] = {{TRAINER_KIRA_AND_DAN_1, TRAINER_KIRA_AND_DAN_2, TRAINER_KIRA_AND_DAN_3, TRAINER_KIRA_AND_DAN_4, TRAINER_KIRA_AND_DAN_5}, 0x18, 0x3e}, + [REMATCH_WALLY_3] = {{TRAINER_WALLY_3, TRAINER_WALLY_4, TRAINER_WALLY_5, TRAINER_WALLY_6, TRAINER_WALLY_6}, 0x18, 0x2b}, + [REMATCH_ROXANNE] = {{TRAINER_ROXANNE_1, TRAINER_ROXANNE_2, TRAINER_ROXANNE_3, TRAINER_ROXANNE_4, TRAINER_ROXANNE_5}, 0x0, 0x3}, + [REMATCH_BRAWLY] = {{TRAINER_BRAWLY_1, TRAINER_BRAWLY_2, TRAINER_BRAWLY_3, TRAINER_BRAWLY_4, TRAINER_BRAWLY_5}, 0x0, 0xb}, + [REMATCH_WATTSON] = {{TRAINER_WATTSON_1, TRAINER_WATTSON_2, TRAINER_WATTSON_3, TRAINER_WATTSON_4, TRAINER_WATTSON_5}, 0x0, 0x2}, + [REMATCH_FLANNERY] = {{TRAINER_FLANNERY_1, TRAINER_FLANNERY_2, TRAINER_FLANNERY_3, TRAINER_FLANNERY_4, TRAINER_FLANNERY_5}, 0x0, 0xc}, + [REMATCH_NORMAN] = {{TRAINER_NORMAN_1, TRAINER_NORMAN_2, TRAINER_NORMAN_3, TRAINER_NORMAN_4, TRAINER_NORMAN_5}, 0x0, 0x0}, + [REMATCH_WINONA] = {{TRAINER_WINONA_1, TRAINER_WINONA_2, TRAINER_WINONA_3, TRAINER_WINONA_4, TRAINER_WINONA_5}, 0x0, 0x4}, + [REMATCH_TATE_AND_LIZA] = {{TRAINER_TATE_AND_LIZA_1, TRAINER_TATE_AND_LIZA_2, TRAINER_TATE_AND_LIZA_3, TRAINER_TATE_AND_LIZA_4, TRAINER_TATE_AND_LIZA_5}, 0x0, 0x6}, + [REMATCH_JUAN] = {{TRAINER_JUAN_1, TRAINER_JUAN_2, TRAINER_JUAN_3, TRAINER_JUAN_4, TRAINER_JUAN_5}, 0x0, 0x7}, + [REMATCH_SIDNEY] = {{TRAINER_SIDNEY, TRAINER_SIDNEY, TRAINER_SIDNEY, TRAINER_SIDNEY, TRAINER_SIDNEY}, 0x0, 0x8}, + [REMATCH_PHOEBE] = {{TRAINER_PHOEBE, TRAINER_PHOEBE, TRAINER_PHOEBE, TRAINER_PHOEBE, TRAINER_PHOEBE}, 0x0, 0x8}, + [REMATCH_GLACIA] = {{TRAINER_GLACIA, TRAINER_GLACIA, TRAINER_GLACIA, TRAINER_GLACIA, TRAINER_GLACIA}, 0x0, 0x8}, + [REMATCH_DRAKE] = {{TRAINER_DRAKE, TRAINER_DRAKE, TRAINER_DRAKE, TRAINER_DRAKE, TRAINER_DRAKE}, 0x0, 0x8}, + [REMATCH_WALLACE] = {{TRAINER_WALLACE, TRAINER_WALLACE, TRAINER_WALLACE, TRAINER_WALLACE, TRAINER_WALLACE}, 0x0, 0x8}, }; static const u16 sBadgeFlags[8] = @@ -1547,7 +1545,7 @@ static bool32 sub_80B1D94(s32 rematchTableId) { if (rematchTableId >= REMATCH_ELITE_FOUR_ENTRIES) return TRUE; - else if (rematchTableId == REMATCH_WALLY_ENTRY) + else if (rematchTableId == REMATCH_WALLY_3) return (FlagGet(FLAG_DEFEATED_WALLY_VICTORY_ROAD) == FALSE); else return FALSE; @@ -1575,7 +1573,7 @@ static bool32 UpdateRandomTrainerRematches(const struct RematchTrainer *table, u s32 i; bool32 ret = FALSE; - for (i = 0; i <= REMATCH_WALLY_ENTRY; i++) + for (i = 0; i <= REMATCH_WALLY_3; i++) { if (table[i].mapGroup == mapGroup && table[i].mapNum == mapNum && !sub_80B1D94(i)) { diff --git a/src/pokenav_match_call.c b/src/pokenav_match_call.c index 0a21c4edc..ce00401a9 100644 --- a/src/pokenav_match_call.c +++ b/src/pokenav_match_call.c @@ -73,22 +73,17 @@ struct MatchCallStruct4 { const match_call_text_data_t *textData; }; +// Note: Type1 and Type5 have identical struct layouts. struct MatchCallStruct5 { u8 type; u8 v1; u16 flag; - u16 v4; + u16 rematchTableIdx; const u8 *desc; const u8 *name; const match_call_text_data_t *textData; }; -#define MATCHCALLDEF(name, type_, ...) \ -static const struct MatchCallStruct##type_ name = { \ - .type = type_, \ - __VA_ARGS__ \ -}; - typedef union { const struct MatchCallStructCommon *common; const struct MatchCallStruct0 *type0; @@ -328,7 +323,15 @@ static const match_call_text_data_t sMrStoneTextScripts[] = { { NULL, 0xFFFF, 0xFFFF } }; -MATCHCALLDEF(sMrStoneMatchCallHeader, 0, 10, 0xffff, gMrStoneMatchCallDesc, gMrStoneMatchCallName, sMrStoneTextScripts); +static const struct MatchCallStruct0 sMrStoneMatchCallHeader = +{ + .type = 0, + .v1 = 10, + .flag = 0xFFFF, + .desc = gMrStoneMatchCallDesc, + .name = gMrStoneMatchCallName, + .textData = sMrStoneTextScripts +}; static const match_call_text_data_t sNormanTextScripts[] = { { gText_Norman_Pokenav_2B5719, FLAG_ENABLE_NORMAN_MATCH_CALL, 0xFFFF }, @@ -343,9 +346,25 @@ static const match_call_text_data_t sNormanTextScripts[] = { { NULL, 0xFFFF, 0xFFFF } }; -MATCHCALLDEF(sNormanMatchCallHeader, 5, 7, FLAG_ENABLE_NORMAN_MATCH_CALL, 0x45, gNormanMatchCallDesc, gNormanMatchCallName, sNormanTextScripts); +static const struct MatchCallStruct5 sNormanMatchCallHeader = +{ + .type = 5, + .v1 = 7, + .flag = FLAG_ENABLE_NORMAN_MATCH_CALL, + .rematchTableIdx = REMATCH_NORMAN, + .desc = gNormanMatchCallDesc, + .name = gNormanMatchCallName, + .textData = sNormanTextScripts +}; -MATCHCALLDEF(sProfBirchMatchCallHeader, 3, 0, FLAG_ENABLE_PROF_BIRCH_MATCH_CALL, gProfBirchMatchCallDesc, gProfBirchMatchCallName) +static const struct MatchCallStruct3 sProfBirchMatchCallHeader = +{ + .type = 3, + .v1 = 0, + .flag = FLAG_ENABLE_PROF_BIRCH_MATCH_CALL, + .desc = gProfBirchMatchCallDesc, + .name = gProfBirchMatchCallName +}; static const match_call_text_data_t sMomTextScripts[] = { { gText_Mom_Pokenav_2B227B, 0xffff, 0xffff }, @@ -354,7 +373,15 @@ static const match_call_text_data_t sMomTextScripts[] = { { NULL, 0xffff, 0xffff } }; -MATCHCALLDEF(sMomMatchCallHeader, 0, 0, FLAG_ENABLE_MOM_MATCH_CALL, gMomMatchCallDesc, gMomMatchCallName, sMomTextScripts); +static const struct MatchCallStruct0 sMomMatchCallHeader = +{ + .type = 0, + .v1 = 0, + .flag = FLAG_ENABLE_MOM_MATCH_CALL, + .desc = gMomMatchCallDesc, + .name = gMomMatchCallName, + .textData = sMomTextScripts +}; static const match_call_text_data_t sStevenTextScripts[] = { { gText_Steven_Pokenav_2B5B95, 0xffff, 0xffff }, @@ -367,7 +394,15 @@ static const match_call_text_data_t sStevenTextScripts[] = { { NULL, 0xffff, 0xffff }, }; -MATCHCALLDEF(sStevenMatchCallHeader, 0, 0xd5, FLAG_REGISTERED_STEVEN_POKENAV, gStevenMatchCallDesc, gStevenMatchCallName, sStevenTextScripts); +static const struct MatchCallStruct0 sStevenMatchCallHeader = +{ + .type = 0, + .v1 = 0xD5, + .flag = FLAG_REGISTERED_STEVEN_POKENAV, + .desc = gStevenMatchCallDesc, + .name = gStevenMatchCallName, + .textData = sStevenTextScripts +}; static const match_call_text_data_t sMayTextScripts[] = { { gText_May_Pokenav_2B3AB3, 0xFFFF, 0xFFFF }, @@ -388,7 +423,15 @@ static const match_call_text_data_t sMayTextScripts[] = { { NULL, 0xFFFF, 0xFFFF } }; -MATCHCALLDEF(sMayMatchCallHeader, 4, MALE, FLAG_ENABLE_RIVAL_MATCH_CALL, gMayBrendanMatchCallDesc, gExpandedPlaceholder_May, sMayTextScripts); +static const struct MatchCallStruct4 sMayMatchCallHeader = +{ + .type = 4, + .gender = MALE, + .flag = FLAG_ENABLE_RIVAL_MATCH_CALL, + .desc = gMayBrendanMatchCallDesc, + .name = gExpandedPlaceholder_May, + .textData = sMayTextScripts +}; static const match_call_text_data_t sBrendanTextScripts[] = { { gText_Brendan_Pokenav_2B43EF, 0xFFFF, 0xFFFF }, @@ -409,7 +452,15 @@ static const match_call_text_data_t sBrendanTextScripts[] = { { NULL, 0xFFFF, 0xFFFF } }; -MATCHCALLDEF(sBrendanMatchCallHeader, 4, FEMALE, FLAG_ENABLE_RIVAL_MATCH_CALL, gMayBrendanMatchCallDesc, gExpandedPlaceholder_Brendan, sBrendanTextScripts); +static const struct MatchCallStruct4 sBrendanMatchCallHeader = +{ + .type = 4, + .gender = FEMALE, + .flag = FLAG_ENABLE_RIVAL_MATCH_CALL, + .desc = gMayBrendanMatchCallDesc, + .name = gExpandedPlaceholder_Brendan, + .textData = sBrendanTextScripts +}; static const match_call_text_data_t sWallyTextScripts[] = { { gText_Wally_Pokenav_2B4DE2, 0xFFFF, 0xFFFF }, @@ -429,7 +480,16 @@ const struct MatchCallSubstruct2 sWallyAdditionalData[] = { { 0xFFFF, 0xD5 } }; -MATCHCALLDEF(sWallyMatchCallHeader, 2, 0, FLAG_ENABLE_WALLY_MATCH_CALL, REMATCH_WALLY_3, gWallyMatchCallDesc, sWallyTextScripts, sWallyAdditionalData); +static const struct MatchCallStruct2 sWallyMatchCallHeader = +{ + .type = 2, + .v1 = 0, + .flag = FLAG_ENABLE_WALLY_MATCH_CALL, + .rematchTableIdx = REMATCH_WALLY_3, + .desc = gWallyMatchCallDesc, + .textData = sWallyTextScripts, + .v10 = sWallyAdditionalData +}; static const match_call_text_data_t sScottTextScripts[] = { { gText_Scott_Pokenav_2B5184, 0xFFFF, 0xFFFF }, @@ -443,7 +503,15 @@ static const match_call_text_data_t sScottTextScripts[] = { }; -MATCHCALLDEF(sScottMatchCallHeader, 0, 0xD5, FLAG_ENABLE_SCOTT_MATCH_CALL, gScottMatchCallDesc, gScottMatchCallName, sScottTextScripts); +static const struct MatchCallStruct0 sScottMatchCallHeader = +{ + .type = 0, + .v1 = 0xD5, + .flag = FLAG_ENABLE_SCOTT_MATCH_CALL, + .desc = gScottMatchCallDesc, + .name = gScottMatchCallName, + .textData = sScottTextScripts +}; static const match_call_text_data_t sRoxanneTextScripts[] = { { gText_Roxanne_Pokenav_2B2456, 0xFFFE, 0xFFFF }, @@ -453,7 +521,16 @@ static const match_call_text_data_t sRoxanneTextScripts[] = { { NULL, 0xFFFF, 0xFFFF } }; -MATCHCALLDEF(sRoxanneMatchCallHeader, 5, 10, FLAG_ENABLE_ROXANNE_MATCH_CALL, 0x41, gRoxanneMatchCallDesc, NULL, sRoxanneTextScripts); +static const struct MatchCallStruct5 sRoxanneMatchCallHeader = +{ + .type = 5, + .v1 = 10, + .flag = FLAG_ENABLE_ROXANNE_MATCH_CALL, + .rematchTableIdx = REMATCH_ROXANNE, + .desc = gRoxanneMatchCallDesc, + .name = NULL, + .textData = sRoxanneTextScripts +}; static const match_call_text_data_t sBrawlyTextScripts[] = { { gText_Brawly_Pokenav_2B2659, 0xFFFE, 0xFFFF }, @@ -463,7 +540,16 @@ static const match_call_text_data_t sBrawlyTextScripts[] = { { NULL, 0xFFFF, 0xFFFF } }; -MATCHCALLDEF(sBrawlyMatchCallHeader, 5, 2, FLAG_ENABLE_BRAWLY_MATCH_CALL, 0x42, gBrawlyMatchCallDesc, NULL, sBrawlyTextScripts); +static const struct MatchCallStruct5 sBrawlyMatchCallHeader = +{ + .type = 5, + .v1 = 2, + .flag = FLAG_ENABLE_BRAWLY_MATCH_CALL, + .rematchTableIdx = REMATCH_BRAWLY, + .desc = gBrawlyMatchCallDesc, + .name = NULL, + .textData = sBrawlyTextScripts +}; static const match_call_text_data_t sWattsonTextScripts[] = { { gText_Wattson_Pokenav_2B2912, 0xFFFE, 0xFFFF }, @@ -473,7 +559,16 @@ static const match_call_text_data_t sWattsonTextScripts[] = { { NULL, 0xFFFF, 0xFFFF } }; -MATCHCALLDEF(sWattsonMatchCallHeader, 5, 9, FLAG_ENABLE_WATTSON_MATCH_CALL, 0x43, gWattsonMatchCallDesc, NULL, sWattsonTextScripts); +static const struct MatchCallStruct5 sWattsonMatchCallHeader = +{ + .type = 5, + .v1 = 9, + .flag = FLAG_ENABLE_WATTSON_MATCH_CALL, + .rematchTableIdx = REMATCH_WATTSON, + .desc = gWattsonMatchCallDesc, + .name = NULL, + .textData = sWattsonTextScripts +}; static const match_call_text_data_t sFlanneryTextScripts[] = { { gText_Flannery_Pokenav_2B2B4D, 0xFFFE, 0xFFFF }, @@ -483,7 +578,16 @@ static const match_call_text_data_t sFlanneryTextScripts[] = { { NULL, 0xFFFF, 0xFFFF } }; -MATCHCALLDEF(sFlanneryMatchCallHeader, 5, 3, FLAG_ENABLE_FLANNERY_MATCH_CALL, 0x44, gFlanneryMatchCallDesc, NULL, sFlanneryTextScripts); +static const struct MatchCallStruct5 sFlanneryMatchCallHeader = +{ + .type = 5, + .v1 = 3, + .flag = FLAG_ENABLE_FLANNERY_MATCH_CALL, + .rematchTableIdx = REMATCH_FLANNERY, + .desc = gFlanneryMatchCallDesc, + .name = NULL, + .textData = sFlanneryTextScripts +}; static const match_call_text_data_t sWinonaTextScripts[] = { { gText_Winona_Pokenav_2B2DA4, 0xFFFE, 0xFFFF }, @@ -493,7 +597,16 @@ static const match_call_text_data_t sWinonaTextScripts[] = { { NULL, 0xFFFF, 0xFFFF } }; -MATCHCALLDEF(sWinonaMatchCallHeader, 5, 11, FLAG_ENABLE_WINONA_MATCH_CALL, 0x46, gWinonaMatchCallDesc, NULL, sWinonaTextScripts); +static const struct MatchCallStruct5 sWinonaMatchCallHeader = +{ + .type = 5, + .v1 = 11, + .flag = FLAG_ENABLE_WINONA_MATCH_CALL, + .rematchTableIdx = REMATCH_WINONA, + .desc = gWinonaMatchCallDesc, + .name = NULL, + .textData = sWinonaTextScripts +}; static const match_call_text_data_t sTateLizaTextScripts[] = { { gText_TateLiza_Pokenav_2B2F97, 0xFFFE, 0xFFFF }, @@ -503,7 +616,16 @@ static const match_call_text_data_t sTateLizaTextScripts[] = { { NULL, 0xFFFF, 0xFFFF } }; -MATCHCALLDEF(sTateLizaMatchCallHeader, 5, 13, FLAG_ENABLE_TATE_AND_LIZA_MATCH_CALL, 0x47, gTateLizaMatchCallDesc, NULL, sTateLizaTextScripts); +static const struct MatchCallStruct5 sTateLizaMatchCallHeader = +{ + .type = 5, + .v1 = 13, + .flag = FLAG_ENABLE_TATE_AND_LIZA_MATCH_CALL, + .rematchTableIdx = REMATCH_TATE_AND_LIZA, + .desc = gTateLizaMatchCallDesc, + .name = NULL, + .textData = sTateLizaTextScripts +}; static const match_call_text_data_t sJuanTextScripts[] = { { gText_Juan_Pokenav_2B3249, 0xFFFE, 0xFFFF }, @@ -513,42 +635,96 @@ static const match_call_text_data_t sJuanTextScripts[] = { { NULL, 0xFFFF, 0xFFFF } }; -MATCHCALLDEF(sJuanMatchCallHeader, 5, 14, FLAG_ENABLE_JUAN_MATCH_CALL, 0x48, gJuanMatchCallDesc, NULL, sJuanTextScripts); +static const struct MatchCallStruct5 sJuanMatchCallHeader = +{ + .type = 5, + .v1 = 14, + .flag = FLAG_ENABLE_JUAN_MATCH_CALL, + .rematchTableIdx = REMATCH_JUAN, + .desc = gJuanMatchCallDesc, + .name = NULL, + .textData = sJuanTextScripts +}; static const match_call_text_data_t sSidneyTextScripts[] = { { gText_Sidney_Pokenav_2B34CC, 0xFFFF, 0xFFFF }, { NULL, 0xFFFF, 0xFFFF } }; -MATCHCALLDEF(sSidneyMatchCallHeader, 5, 15, FLAG_REMATCH_JUAN, 0x49, gEliteFourMatchCallDesc, NULL, sSidneyTextScripts); +static const struct MatchCallStruct5 sSidneyMatchCallHeader = +{ + .type = 5, + .v1 = 15, + .flag = FLAG_REMATCH_SIDNEY, + .rematchTableIdx = REMATCH_SIDNEY, + .desc = gEliteFourMatchCallDesc, + .name = NULL, + .textData = sSidneyTextScripts +}; static const match_call_text_data_t sPhoebeTextScripts[] = { { gText_Phoebe_Pokenav_2B3561, 0xFFFF, 0xFFFF }, { NULL, 0xFFFF, 0xFFFF } }; -MATCHCALLDEF(sPhoebeMatchCallHeader, 5, 15, FLAG_REMATCH_SIDNEY, 0x4A, gEliteFourMatchCallDesc, NULL, sPhoebeTextScripts); +static const struct MatchCallStruct5 sPhoebeMatchCallHeader = +{ + .type = 5, + .v1 = 15, + .flag = FLAG_REMATCH_PHOEBE, + .rematchTableIdx = REMATCH_PHOEBE, + .desc = gEliteFourMatchCallDesc, + .name = NULL, + .textData = sPhoebeTextScripts +}; static const match_call_text_data_t sGlaciaTextScripts[] = { { gText_Glacia_Pokenav_2B35E4, 0xFFFF, 0xFFFF }, { NULL, 0xFFFF, 0xFFFF } }; -MATCHCALLDEF(sGlaciaMatchCallHeader, 5, 15, FLAG_REMATCH_PHOEBE, 0x4B, gEliteFourMatchCallDesc, NULL, sGlaciaTextScripts); +static const struct MatchCallStruct5 sGlaciaMatchCallHeader = +{ + .type = 5, + .v1 = 15, + .flag = FLAG_REMATCH_GLACIA, + .rematchTableIdx = REMATCH_GLACIA, + .desc = gEliteFourMatchCallDesc, + .name = NULL, + .textData = sGlaciaTextScripts +}; static const match_call_text_data_t sDrakeTextScripts[] = { { gText_Drake_Pokenav_2B368B, 0xFFFF, 0xFFFF }, { NULL, 0xFFFF, 0xFFFF } }; -MATCHCALLDEF(sDrakeMatchCallHeader, 5, 15, FLAG_REMATCH_GLACIA, 0x4C, gEliteFourMatchCallDesc, NULL, sDrakeTextScripts); +static const struct MatchCallStruct5 sDrakeMatchCallHeader = +{ + .type = 5, + .v1 = 15, + .flag = FLAG_REMATCH_DRAKE, + .rematchTableIdx = REMATCH_DRAKE, + .desc = gEliteFourMatchCallDesc, + .name = NULL, + .textData = sDrakeTextScripts +}; static const match_call_text_data_t sWallaceTextScripts[] = { { gText_Wallace_Pokenav_2B3790, 0xFFFF, 0xFFFF }, { NULL, 0xFFFF, 0xFFFF } }; -MATCHCALLDEF(sWallaceMatchCallHeader, 5, 15, FLAG_REMATCH_DRAKE, 0x4D, gChampionMatchCallDesc, NULL, sWallaceTextScripts); +static const struct MatchCallStruct5 sWallaceMatchCallHeader = +{ + .type = 5, + .v1 = 15, + .flag = FLAG_REMATCH_WALLACE, + .rematchTableIdx = REMATCH_WALLACE, + .desc = gChampionMatchCallDesc, + .name = NULL, + .textData = sWallaceTextScripts +}; static const match_call_t sMatchCallHeaders[] = { {.type0 = &sMrStoneMatchCallHeader}, @@ -906,9 +1082,9 @@ static void MatchCall_GetMessage_Type0(match_call_t matchCall, u8 *dest) static void MatchCall_GetMessage_Type1(match_call_t matchCall, u8 *dest) { if (matchCall.common->type != 5) - sub_81D1920(matchCall.type5->textData, dest); + sub_81D1920(matchCall.type1->textData, dest); else - sub_81D199C(matchCall.type1->textData, matchCall.type1->rematchTableIdx, dest); + sub_81D199C(matchCall.type5->textData, matchCall.type5->rematchTableIdx, dest); } static void MatchCall_GetMessage_Type2(match_call_t matchCall, u8 *dest) -- cgit v1.2.3 From 1aa95a1821cd4ebe552a39bbfed067a305071e31 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Tue, 2 Apr 2019 08:36:22 +0200 Subject: Document a bit of anims --- src/battle_anim_effects_1.c | 16 ++++++++-------- src/battle_anim_effects_2.c | 4 ++-- src/bug.c | 19 +++++++++++++------ src/dark.c | 44 ++++++++++++++++++++++++++------------------ 4 files changed, 49 insertions(+), 34 deletions(-) (limited to 'src') diff --git a/src/battle_anim_effects_1.c b/src/battle_anim_effects_1.c index f14e502f3..af4bc19ec 100644 --- a/src/battle_anim_effects_1.c +++ b/src/battle_anim_effects_1.c @@ -1093,7 +1093,7 @@ const struct SpriteTemplate gUnknown_085928D0 = .callback = sub_8100A50, }; -const struct SpriteTemplate gUnknown_085928E8 = +const struct SpriteTemplate gVineWhipSpriteTemplate = { .tileTag = ANIM_TAG_WHIP_HIT, .paletteTag = ANIM_TAG_WHIP_HIT, @@ -2336,7 +2336,7 @@ void AnimHyperBeamOrb(struct Sprite* sprite) { u16 speed; u16 animNum = Random2(); - + StartSpriteAnim(sprite, animNum % 8); sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2); sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET); @@ -2660,7 +2660,7 @@ static void AnimTranslateLinearSingleSineWaveStep(struct Sprite* sprite) s16 a = sprite->data[0]; s16 b = sprite->data[7]; s16 r0; - + sprite->data[0] = 1; TranslateAnimHorizontalArc(sprite); r0 = sprite->data[7]; @@ -2675,7 +2675,7 @@ static void AnimTranslateLinearSingleSineWaveStep(struct Sprite* sprite) if (sprite->oam.affineParam == 30) destroy = TRUE; } - + if (sprite->pos1.x + sprite->pos2.x > 256 || sprite->pos1.x + sprite->pos2.x < -16 || sprite->pos1.y + sprite->pos2.y > 160 @@ -3748,7 +3748,7 @@ void sub_81009F8(struct Sprite* sprite) void sub_8100A50(struct Sprite* sprite) { - if (GetBattlerSide(gBattleAnimAttacker) == 0) + if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER) StartSpriteAnim(sprite, 1); sprite->callback = sub_81009DC; @@ -3770,7 +3770,7 @@ void sub_8100A94(struct Sprite* sprite) } // Moves the sprite in a diagonally slashing motion across the target mon. -// Used by moves such as MOVE_CUT and MOVE_AERIAL_ACE. +// Used by moves such as MOVE_CUT and MOVE_AERIAL_ACE. // arg 0: initial x pixel offset // arg 1: initial y pixel offset // arg 2: slice direction; 0 = right-to-left, 1 = left-to-right @@ -5350,10 +5350,10 @@ static void sub_8102DE4(struct Sprite* sprite) void sub_8102EB0(struct Sprite* sprite) { - int a; + int a; if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_OPPONENT) { - a = gBattleAnimArgs[1]; + a = gBattleAnimArgs[1]; (u16)gBattleAnimArgs[1] = -a; } diff --git a/src/battle_anim_effects_2.c b/src/battle_anim_effects_2.c index 80b3258b4..e3295acb8 100755 --- a/src/battle_anim_effects_2.c +++ b/src/battle_anim_effects_2.c @@ -889,7 +889,7 @@ const struct SpriteTemplate gUnknown_08593958 = .callback = sub_8105DE8, }; -const struct SpriteTemplate gUnknown_08593970 = +const struct SpriteTemplate gMagentaHeartSpriteTemplate = { .tileTag = ANIM_TAG_MAGENTA_HEART, .paletteTag = ANIM_TAG_MAGENTA_HEART, @@ -3286,7 +3286,7 @@ static void sub_810627C(struct Sprite *sprite) } } -void sub_81062E8(u8 taskId) +void AnimTask_HeartsBackground(u8 taskId) { struct BattleAnimBgData animBg; diff --git a/src/bug.c b/src/bug.c index 88f93a3d5..4fa6a5bb6 100644 --- a/src/bug.c +++ b/src/bug.c @@ -6,7 +6,7 @@ void sub_8110368(struct Sprite *); void sub_8110438(struct Sprite *); -void sub_81104E4(struct Sprite *); +void AnimTranslateWebThread(struct Sprite *); void sub_81105B4(struct Sprite *); void sub_811067C(struct Sprite *); void AnimTranslateStinger(struct Sprite *); @@ -90,7 +90,7 @@ const struct SpriteTemplate gUnknown_085969C8 = .callback = sub_8110438, }; -const struct SpriteTemplate gUnknown_085969E0 = +const struct SpriteTemplate gWebThreadSpriteTemplate = { .tileTag = ANIM_TAG_WEB_THREAD, .paletteTag = ANIM_TAG_WEB_THREAD, @@ -98,7 +98,7 @@ const struct SpriteTemplate gUnknown_085969E0 = .anims = gDummySpriteAnimTable, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_81104E4, + .callback = AnimTranslateWebThread, }; const struct SpriteTemplate gUnknown_085969F8 = @@ -124,7 +124,7 @@ const union AffineAnimCmd *const gUnknown_08596A28[] = gUnknown_08596A10, }; -const struct SpriteTemplate gUnknown_08596A2C = +const struct SpriteTemplate gSpiderWebSpriteTemplate = { .tileTag = ANIM_TAG_SPIDER_WEB, .paletteTag = ANIM_TAG_SPIDER_WEB, @@ -247,12 +247,19 @@ void sub_8110438(struct Sprite *sprite) StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); } -void sub_81104E4(struct Sprite *sprite) +// Creates a single web thread that travels from attacker to target. +// Used by MOVE_STRING_SHOT and MOVE_SPIDER_WEB in their first move phase. +// arg 0: x +// arg 1: y +// arg 2: controls the left-to-right movement +// arg 3: amplitude +// arg 4: if targets both opponents +void AnimTranslateWebThread(struct Sprite *sprite) { if (IsContest()) gBattleAnimArgs[2] /= 2; - InitSpritePosToAnimAttacker(sprite, 1); + InitSpritePosToAnimAttacker(sprite, TRUE); sprite->data[0] = gBattleAnimArgs[2]; sprite->data[1] = sprite->pos1.x; sprite->data[3] = sprite->pos1.y; diff --git a/src/dark.c b/src/dark.c index 80ce61800..482c09c04 100644 --- a/src/dark.c +++ b/src/dark.c @@ -803,17 +803,23 @@ void sub_81144BC(struct Sprite *sprite) StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); } -void sub_81144F8(u8 taskId) +// Makes the attacker metallic and shining. +// Used by MOVE_HARDEN and MOVE_IRON_DEFENSE. +// arg0: if true won't change battler's palette back +// arg1: if true, use custom color +// arg2: custom color +// Custom color argument is used in MOVE_POISON_TAIL to make the mon turn purplish/pinkish as if became cloaked in poison. +void AnimTask_MetallicShine(u8 taskId) { u16 species; u8 spriteId; u8 newSpriteId; u16 paletteNum; struct BattleAnimBgData animBg; - int var0 = 0; + bool32 priorityChanged = FALSE; - gBattle_WIN0H = var0; - gBattle_WIN0V = var0; + gBattle_WIN0H = 0; + gBattle_WIN0V = 0; SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG_ALL | WININ_WIN0_OBJ | WININ_WIN0_CLR | WININ_WIN1_BG_ALL | WININ_WIN1_OBJ | WININ_WIN1_CLR); SetGpuReg(REG_OFFSET_WINOUT, WINOUT_WINOBJ_BG_ALL | WINOUT_WINOBJ_OBJ | WINOUT_WINOBJ_CLR | WINOUT_WIN01_BG0 | WINOUT_WIN01_BG2 | WINOUT_WIN01_BG3 | WINOUT_WIN01_OBJ | WINOUT_WIN01_CLR); SetGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_OBJWIN_ON); @@ -832,7 +838,7 @@ void sub_81144F8(u8 taskId) { gSprites[gBattlerSpriteIds[BATTLE_PARTNER(gBattleAnimAttacker)]].oam.priority--; SetAnimBgAttribute(1, BG_ANIM_PRIORITY, 1); - var0 = 1; + priorityChanged = TRUE; } } } @@ -861,7 +867,7 @@ void sub_81144F8(u8 taskId) gBattle_BG1_Y = -gSprites[spriteId].pos1.y + 32; paletteNum = 16 + gSprites[spriteId].oam.paletteNum; - if (gBattleAnimArgs[1] == 0) + if (gBattleAnimArgs[1] == 0) SetGreyscaleOrOriginalPalette(paletteNum, FALSE); else BlendPalette(paletteNum * 16, 16, 11, gBattleAnimArgs[2]); @@ -870,7 +876,7 @@ void sub_81144F8(u8 taskId) gTasks[taskId].data[1] = gBattleAnimArgs[0]; gTasks[taskId].data[2] = gBattleAnimArgs[1]; gTasks[taskId].data[3] = gBattleAnimArgs[2]; - gTasks[taskId].data[6] = var0; + gTasks[taskId].data[6] = priorityChanged; gTasks[taskId].func = sub_8114748; } @@ -879,29 +885,28 @@ static void sub_8114748(u8 taskId) struct BattleAnimBgData animBg; u16 paletteNum; u8 spriteId; - u8 taskIdCopy = taskId; - gTasks[taskIdCopy].data[10] += 4; + gTasks[taskId].data[10] += 4; gBattle_BG1_X -= 4; - if (gTasks[taskIdCopy].data[10] == 128) + if (gTasks[taskId].data[10] == 128) { - gTasks[taskIdCopy].data[10] = 0; + gTasks[taskId].data[10] = 0; gBattle_BG1_X += 128; - gTasks[taskIdCopy].data[11]++; - if (gTasks[taskIdCopy].data[11] == 2) + gTasks[taskId].data[11]++; + if (gTasks[taskId].data[11] == 2) { spriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER); paletteNum = 16 + gSprites[spriteId].oam.paletteNum; - if (gTasks[taskIdCopy].data[1] == 0) + if (gTasks[taskId].data[1] == 0) SetGreyscaleOrOriginalPalette(paletteNum, 1); - DestroySprite(&gSprites[gTasks[taskIdCopy].data[0]]); + DestroySprite(&gSprites[gTasks[taskId].data[0]]); sub_80A6B30(&animBg); sub_80A6C68(animBg.bgId); - if (gTasks[taskIdCopy].data[6] == 1) + if (gTasks[taskId].data[6] == 1) gSprites[gBattlerSpriteIds[BATTLE_PARTNER(gBattleAnimAttacker)]].oam.priority++; } - else if (gTasks[taskIdCopy].data[11] == 3) + else if (gTasks[taskId].data[11] == 3) { gBattle_WIN0H = 0; gBattle_WIN0V = 0; @@ -918,7 +923,10 @@ static void sub_8114748(u8 taskId) } } -void sub_811489C(u8 taskId) +// Changes battler's palette to either greyscale or original. +// arg0: which battler +// arg1: 0 grayscale, 1 original +void AnimTask_SetGreyscaleOrOriginalPal(u8 taskId) { u8 spriteId; u8 battler; -- cgit v1.2.3 From 201c0953ae4f6c6b65958065f009cbaee3c8f3ee Mon Sep 17 00:00:00 2001 From: Phlosioneer Date: Mon, 1 Apr 2019 18:31:10 -0400 Subject: Cleanup OamData entries --- src/battle_anim.c | 362 +++++++++++++++++++++++++++++++++++++++++++++ src/battle_main.c | 22 ++- src/cable_car.c | 34 ++++- src/contest.c | 39 ++--- src/contest_painting.c | 5 +- src/decoration.c | 13 +- src/field_effect.c | 41 ++++- src/field_weather_effect.c | 29 ++-- src/link_rfu.c | 14 +- src/naming_screen.c | 29 ++-- src/pokedex_cry_screen.c | 8 +- src/pokemon_icon.c | 11 +- 12 files changed, 511 insertions(+), 96 deletions(-) mode change 100755 => 100644 src/cable_car.c mode change 100755 => 100644 src/pokedex_cry_screen.c (limited to 'src') diff --git a/src/battle_anim.c b/src/battle_anim.c index 31ff11ee8..88de3ee88 100644 --- a/src/battle_anim.c +++ b/src/battle_anim.c @@ -117,651 +117,1011 @@ EWRAM_DATA u8 gUnknown_02038440 = 0; const struct OamData gUnknown_08524904 = { + .y = 0, .affineMode = ST_OAM_AFFINE_OFF, .objMode = ST_OAM_OBJ_NORMAL, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(8x8), + .x = 0, .size = SPRITE_SIZE(8x8), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_0852490C = { + .y = 0, .affineMode = ST_OAM_AFFINE_OFF, .objMode = ST_OAM_OBJ_NORMAL, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(16x16), + .x = 0, .size = SPRITE_SIZE(16x16), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_08524914 = { + .y = 0, .affineMode = ST_OAM_AFFINE_OFF, .objMode = ST_OAM_OBJ_NORMAL, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(32x32), + .x = 0, .size = SPRITE_SIZE(32x32), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_0852491C = { + .y = 0, .affineMode = ST_OAM_AFFINE_OFF, .objMode = ST_OAM_OBJ_NORMAL, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(64x64), + .x = 0, .size = SPRITE_SIZE(64x64), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_08524924 = { + .y = 0, .affineMode = ST_OAM_AFFINE_OFF, .objMode = ST_OAM_OBJ_NORMAL, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(16x8), + .x = 0, .size = SPRITE_SIZE(16x8), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_0852492C = { + .y = 0, .affineMode = ST_OAM_AFFINE_OFF, .objMode = ST_OAM_OBJ_NORMAL, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(32x8), + .x = 0, .size = SPRITE_SIZE(32x8), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_08524934 = { + .y = 0, .affineMode = ST_OAM_AFFINE_OFF, .objMode = ST_OAM_OBJ_NORMAL, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(32x16), + .x = 0, .size = SPRITE_SIZE(32x16), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_0852493C = { + .y = 0, .affineMode = ST_OAM_AFFINE_OFF, .objMode = ST_OAM_OBJ_NORMAL, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(64x32), + .x = 0, .size = SPRITE_SIZE(64x32), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_08524944 = { + .y = 0, .affineMode = ST_OAM_AFFINE_OFF, .objMode = ST_OAM_OBJ_NORMAL, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(8x16), + .x = 0, .size = SPRITE_SIZE(8x16), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_0852494C = { + .y = 0, .affineMode = ST_OAM_AFFINE_OFF, .objMode = ST_OAM_OBJ_NORMAL, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(8x32), + .x = 0, .size = SPRITE_SIZE(8x32), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_08524954 = { + .y = 0, .affineMode = ST_OAM_AFFINE_OFF, .objMode = ST_OAM_OBJ_NORMAL, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(16x32), + .x = 0, .size = SPRITE_SIZE(16x32), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_0852495C = { + .y = 0, .affineMode = ST_OAM_AFFINE_OFF, .objMode = ST_OAM_OBJ_NORMAL, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(32x64), + .x = 0, .size = SPRITE_SIZE(32x64), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_08524964 = { + .y = 0, .affineMode = ST_OAM_AFFINE_NORMAL, .objMode = ST_OAM_OBJ_NORMAL, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(8x8), + .x = 0, .size = SPRITE_SIZE(8x8), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_0852496C = { + .y = 0, .affineMode = ST_OAM_AFFINE_NORMAL, .objMode = ST_OAM_OBJ_NORMAL, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(16x16), + .x = 0, .size = SPRITE_SIZE(16x16), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_08524974 = { + .y = 0, .affineMode = ST_OAM_AFFINE_NORMAL, .objMode = ST_OAM_OBJ_NORMAL, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(32x32), + .x = 0, .size = SPRITE_SIZE(32x32), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_0852497C = { + .y = 0, .affineMode = ST_OAM_AFFINE_NORMAL, .objMode = ST_OAM_OBJ_NORMAL, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(64x64), + .x = 0, .size = SPRITE_SIZE(64x64), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_08524984 = { + .y = 0, .affineMode = ST_OAM_AFFINE_NORMAL, .objMode = ST_OAM_OBJ_NORMAL, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(16x8), + .x = 0, .size = SPRITE_SIZE(16x8), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_0852498C = { + .y = 0, .affineMode = ST_OAM_AFFINE_NORMAL, .objMode = ST_OAM_OBJ_NORMAL, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(32x8), + .x = 0, .size = SPRITE_SIZE(32x8), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_08524994 = { + .y = 0, .affineMode = ST_OAM_AFFINE_NORMAL, .objMode = ST_OAM_OBJ_NORMAL, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(32x16), + .x = 0, .size = SPRITE_SIZE(32x16), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_0852499C = { + .y = 0, .affineMode = ST_OAM_AFFINE_NORMAL, .objMode = ST_OAM_OBJ_NORMAL, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(64x32), + .x = 0, .size = SPRITE_SIZE(64x32), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_085249A4 = { + .y = 0, .affineMode = ST_OAM_AFFINE_NORMAL, .objMode = ST_OAM_OBJ_NORMAL, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(8x16), + .x = 0, .size = SPRITE_SIZE(8x16), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_085249AC = { + .y = 0, .affineMode = ST_OAM_AFFINE_NORMAL, .objMode = ST_OAM_OBJ_NORMAL, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(8x32), + .x = 0, .size = SPRITE_SIZE(8x32), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_085249B4 = { + .y = 0, .affineMode = ST_OAM_AFFINE_NORMAL, .objMode = ST_OAM_OBJ_NORMAL, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(16x32), + .x = 0, .size = SPRITE_SIZE(16x32), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_085249BC = { + .y = 0, .affineMode = ST_OAM_AFFINE_NORMAL, .objMode = ST_OAM_OBJ_NORMAL, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(32x64), + .x = 0, .size = SPRITE_SIZE(32x64), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_085249C4 = { + .y = 0, .affineMode = ST_OAM_AFFINE_DOUBLE, .objMode = ST_OAM_OBJ_NORMAL, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(8x8), + .x = 0, .size = SPRITE_SIZE(8x8), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_085249CC = { + .y = 0, .affineMode = ST_OAM_AFFINE_DOUBLE, .objMode = ST_OAM_OBJ_NORMAL, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(16x16), + .x = 0, .size = SPRITE_SIZE(16x16), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_085249D4 = { + .y = 0, .affineMode = ST_OAM_AFFINE_DOUBLE, .objMode = ST_OAM_OBJ_NORMAL, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(32x32), + .x = 0, .size = SPRITE_SIZE(32x32), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_085249DC = { + .y = 0, .affineMode = ST_OAM_AFFINE_DOUBLE, .objMode = ST_OAM_OBJ_NORMAL, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(64x64), + .x = 0, .size = SPRITE_SIZE(64x64), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_085249E4 = { + .y = 0, .affineMode = ST_OAM_AFFINE_DOUBLE, .objMode = ST_OAM_OBJ_NORMAL, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(16x8), + .x = 0, .size = SPRITE_SIZE(16x8), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_085249EC = { + .y = 0, .affineMode = ST_OAM_AFFINE_DOUBLE, .objMode = ST_OAM_OBJ_NORMAL, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(32x8), + .x = 0, .size = SPRITE_SIZE(32x8), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_085249F4 = { + .y = 0, .affineMode = ST_OAM_AFFINE_DOUBLE, .objMode = ST_OAM_OBJ_NORMAL, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(32x16), + .x = 0, .size = SPRITE_SIZE(32x16), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_085249FC = { + .y = 0, .affineMode = ST_OAM_AFFINE_DOUBLE, .objMode = ST_OAM_OBJ_NORMAL, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(64x32), + .x = 0, .size = SPRITE_SIZE(64x32), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_08524A04 = { + .y = 0, .affineMode = ST_OAM_AFFINE_DOUBLE, .objMode = ST_OAM_OBJ_NORMAL, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(8x16), + .x = 0, .size = SPRITE_SIZE(8x16), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_08524A0C = { + .y = 0, .affineMode = ST_OAM_AFFINE_DOUBLE, .objMode = ST_OAM_OBJ_NORMAL, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(8x32), + .x = 0, .size = SPRITE_SIZE(8x32), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_08524A14 = { + .y = 0, .affineMode = ST_OAM_AFFINE_DOUBLE, .objMode = ST_OAM_OBJ_NORMAL, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(16x32), + .x = 0, .size = SPRITE_SIZE(16x32), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_08524A1C = { + .y = 0, .affineMode = ST_OAM_AFFINE_DOUBLE, .objMode = ST_OAM_OBJ_NORMAL, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(32x64), + .x = 0, .size = SPRITE_SIZE(32x64), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_08524A24 = { + .y = 0, .affineMode = ST_OAM_AFFINE_OFF, .objMode = ST_OAM_OBJ_BLEND, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(8x8), + .x = 0, .size = SPRITE_SIZE(8x8), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_08524A2C = { + .y = 0, .affineMode = ST_OAM_AFFINE_OFF, .objMode = ST_OAM_OBJ_BLEND, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(16x16), + .x = 0, .size = SPRITE_SIZE(16x16), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_08524A34 = { + .y = 0, .affineMode = ST_OAM_AFFINE_OFF, .objMode = ST_OAM_OBJ_BLEND, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(32x32), + .x = 0, .size = SPRITE_SIZE(32x32), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_08524A3C = { + .y = 0, .affineMode = ST_OAM_AFFINE_OFF, .objMode = ST_OAM_OBJ_BLEND, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(64x64), + .x = 0, .size = SPRITE_SIZE(64x64), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_08524A44 = { + .y = 0, .affineMode = ST_OAM_AFFINE_OFF, .objMode = ST_OAM_OBJ_BLEND, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(16x8), + .x = 0, .size = SPRITE_SIZE(16x8), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_08524A4C = { + .y = 0, .affineMode = ST_OAM_AFFINE_OFF, .objMode = ST_OAM_OBJ_BLEND, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(32x8), + .x = 0, .size = SPRITE_SIZE(32x8), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_08524A54 = { + .y = 0, .affineMode = ST_OAM_AFFINE_OFF, .objMode = ST_OAM_OBJ_BLEND, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(32x16), + .x = 0, .size = SPRITE_SIZE(32x16), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_08524A5C = { + .y = 0, .affineMode = ST_OAM_AFFINE_OFF, .objMode = ST_OAM_OBJ_BLEND, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(64x32), + .x = 0, .size = SPRITE_SIZE(64x32), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_08524A64 = { + .y = 0, .affineMode = ST_OAM_AFFINE_OFF, .objMode = ST_OAM_OBJ_BLEND, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(8x16), + .x = 0, .size = SPRITE_SIZE(8x16), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_08524A6C = { + .y = 0, .affineMode = ST_OAM_AFFINE_OFF, .objMode = ST_OAM_OBJ_BLEND, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(8x32), + .x = 0, .size = SPRITE_SIZE(8x32), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_08524A74 = { + .y = 0, .affineMode = ST_OAM_AFFINE_OFF, .objMode = ST_OAM_OBJ_BLEND, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(16x32), + .x = 0, .size = SPRITE_SIZE(16x32), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_08524A7C = { + .y = 0, .affineMode = ST_OAM_AFFINE_OFF, .objMode = ST_OAM_OBJ_BLEND, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(32x64), + .x = 0, .size = SPRITE_SIZE(32x64), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_08524A84 = { + .y = 0, .affineMode = ST_OAM_AFFINE_NORMAL, .objMode = ST_OAM_OBJ_BLEND, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(8x8), + .x = 0, .size = SPRITE_SIZE(8x8), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_08524A8C = { + .y = 0, .affineMode = ST_OAM_AFFINE_NORMAL, .objMode = ST_OAM_OBJ_BLEND, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(16x16), + .x = 0, .size = SPRITE_SIZE(16x16), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_08524A94 = { + .y = 0, .affineMode = ST_OAM_AFFINE_NORMAL, .objMode = ST_OAM_OBJ_BLEND, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(32x32), + .x = 0, .size = SPRITE_SIZE(32x32), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_08524A9C = { + .y = 0, .affineMode = ST_OAM_AFFINE_NORMAL, .objMode = ST_OAM_OBJ_BLEND, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(64x64), + .x = 0, .size = SPRITE_SIZE(64x64), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_08524AA4 = { + .y = 0, .affineMode = ST_OAM_AFFINE_NORMAL, .objMode = ST_OAM_OBJ_BLEND, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(16x8), + .x = 0, .size = SPRITE_SIZE(16x8), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_08524AAC = { + .y = 0, .affineMode = ST_OAM_AFFINE_NORMAL, .objMode = ST_OAM_OBJ_BLEND, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(32x8), + .x = 0, .size = SPRITE_SIZE(32x8), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_08524AB4 = { + .y = 0, .affineMode = ST_OAM_AFFINE_NORMAL, .objMode = ST_OAM_OBJ_BLEND, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(32x16), + .x = 0, .size = SPRITE_SIZE(32x16), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_08524ABC = { + .y = 0, .affineMode = ST_OAM_AFFINE_NORMAL, .objMode = ST_OAM_OBJ_BLEND, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(64x32), + .x = 0, .size = SPRITE_SIZE(64x32), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_08524AC4 = { + .y = 0, .affineMode = ST_OAM_AFFINE_NORMAL, .objMode = ST_OAM_OBJ_BLEND, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(8x16), + .x = 0, .size = SPRITE_SIZE(8x16), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_08524ACC = { + .y = 0, .affineMode = ST_OAM_AFFINE_NORMAL, .objMode = ST_OAM_OBJ_BLEND, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(8x32), + .x = 0, .size = SPRITE_SIZE(8x32), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_08524AD4 = { + .y = 0, .affineMode = ST_OAM_AFFINE_NORMAL, .objMode = ST_OAM_OBJ_BLEND, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(16x32), + .x = 0, .size = SPRITE_SIZE(16x32), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_08524ADC = { + .y = 0, .affineMode = ST_OAM_AFFINE_NORMAL, .objMode = ST_OAM_OBJ_BLEND, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(32x64), + .x = 0, .size = SPRITE_SIZE(32x64), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_08524AE4 = { + .y = 0, .affineMode = ST_OAM_AFFINE_DOUBLE, .objMode = ST_OAM_OBJ_BLEND, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(8x8), + .x = 0, .size = SPRITE_SIZE(8x8), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_08524AEC = { + .y = 0, .affineMode = ST_OAM_AFFINE_DOUBLE, .objMode = ST_OAM_OBJ_BLEND, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(16x16), + .x = 0, .size = SPRITE_SIZE(16x16), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_08524AF4 = { + .y = 0, .affineMode = ST_OAM_AFFINE_DOUBLE, .objMode = ST_OAM_OBJ_BLEND, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(32x32), + .x = 0, .size = SPRITE_SIZE(32x32), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_08524AFC = { + .y = 0, .affineMode = ST_OAM_AFFINE_DOUBLE, .objMode = ST_OAM_OBJ_BLEND, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(64x64), + .x = 0, .size = SPRITE_SIZE(64x64), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_08524B04 = { + .y = 0, .affineMode = ST_OAM_AFFINE_DOUBLE, .objMode = ST_OAM_OBJ_BLEND, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(16x8), + .x = 0, .size = SPRITE_SIZE(16x8), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_08524B0C = { + .y = 0, .affineMode = ST_OAM_AFFINE_DOUBLE, .objMode = ST_OAM_OBJ_BLEND, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(32x8), + .x = 0, .size = SPRITE_SIZE(32x8), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_08524B14 = { + .y = 0, .affineMode = ST_OAM_AFFINE_DOUBLE, .objMode = ST_OAM_OBJ_BLEND, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(32x16), + .x = 0, .size = SPRITE_SIZE(32x16), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_08524B1C = { + .y = 0, .affineMode = ST_OAM_AFFINE_DOUBLE, .objMode = ST_OAM_OBJ_BLEND, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(64x32), + .x = 0, .size = SPRITE_SIZE(64x32), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_08524B24 = { + .y = 0, .affineMode = ST_OAM_AFFINE_DOUBLE, .objMode = ST_OAM_OBJ_BLEND, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(8x16), + .x = 0, .size = SPRITE_SIZE(8x16), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_08524B2C = { + .y = 0, .affineMode = ST_OAM_AFFINE_DOUBLE, .objMode = ST_OAM_OBJ_BLEND, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(8x32), + .x = 0, .size = SPRITE_SIZE(8x32), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_08524B34 = { + .y = 0, .affineMode = ST_OAM_AFFINE_DOUBLE, .objMode = ST_OAM_OBJ_BLEND, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(16x32), + .x = 0, .size = SPRITE_SIZE(16x32), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct OamData gUnknown_08524B3C = { + .y = 0, .affineMode = ST_OAM_AFFINE_DOUBLE, .objMode = ST_OAM_OBJ_BLEND, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(32x64), + .x = 0, .size = SPRITE_SIZE(32x64), + .tileNum = 0, .priority = 2, + .paletteNum = 0, }; const struct CompressedSpriteSheet gBattleAnimPicTable[] = @@ -3088,3 +3448,5 @@ static void ScriptCmd_stopsound(void) m4aMPlayStop(&gMPlayInfo_SE2); sBattleAnimScriptPtr++; } + + diff --git a/src/battle_main.c b/src/battle_main.c index 19fd01e3c..92f12636d 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -293,35 +293,31 @@ static const u8 sText_ShedinjaJpnName[] = _("ヌケニン"); // Nukenin const struct OamData gOamData_831ACA8 = { .y = 0, - .affineMode = 1, - .objMode = 0, - .mosaic = 0, - .bpp = 0, + .affineMode = ST_OAM_AFFINE_NORMAL, + .objMode = ST_OAM_OBJ_NORMAL, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(64x64), .x = 0, - .matrixNum = 0, .size = SPRITE_SIZE(64x64), .tileNum = 0, .priority = 2, .paletteNum = 0, - .affineParam = 0 + .affineParam = 0, }; const struct OamData gOamData_831ACB0 = { .y = 0, - .affineMode = 1, - .objMode = 0, - .mosaic = 0, - .bpp = 0, + .affineMode = ST_OAM_AFFINE_NORMAL, + .objMode = ST_OAM_OBJ_NORMAL, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(64x64), .x = 0, - .matrixNum = 0, .size = SPRITE_SIZE(64x64), .tileNum = 0, .priority = 2, .paletteNum = 2, - .affineParam = 0 + .affineParam = 0, }; // Unknown and unused data. Feel free to remove. @@ -5891,3 +5887,5 @@ static void HandleAction_ActionFinished(void) gBattleScripting.multihitMoveEffect = 0; gBattleResources->battleScriptsStack->size = 0; } + + diff --git a/src/cable_car.c b/src/cable_car.c old mode 100755 new mode 100644 index ab7b5726a..4e6980c4e --- a/src/cable_car.c +++ b/src/cable_car.c @@ -151,25 +151,46 @@ const struct SpritePalette gUnknown_085CDB74[] = { { } }; -const struct OamData gOamData_85CDB84 = { +const struct OamData gOamData_85CDB84 = +{ + .y = 0, .affineMode = ST_OAM_AFFINE_DOUBLE, + .objMode = ST_OAM_OBJ_NORMAL, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(64x64), + .x = 0, .size = SPRITE_SIZE(64x64), - .priority = 2 + .tileNum = 0, + .priority = 2, + .paletteNum = 0, }; -const struct OamData gOamData_85CDB8C = { +const struct OamData gOamData_85CDB8C = +{ + .y = 0, .affineMode = ST_OAM_AFFINE_DOUBLE, + .objMode = ST_OAM_OBJ_NORMAL, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(16x8), + .x = 0, .size = SPRITE_SIZE(16x8), - .priority = 2 + .tileNum = 0, + .priority = 2, + .paletteNum = 0, }; -const struct OamData gOamData_85CDB94 = { +const struct OamData gOamData_85CDB94 = +{ + .y = 0, .affineMode = ST_OAM_AFFINE_DOUBLE, + .objMode = ST_OAM_OBJ_NORMAL, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(16x16), + .x = 0, .size = SPRITE_SIZE(16x16), - .priority = 2 + .tileNum = 0, + .priority = 2, + .paletteNum = 0, }; const struct SpriteTemplate gSpriteTemplate_85CDB9C[] = @@ -1007,3 +1028,4 @@ static void sub_81514C8(u8 arg0) sCableCar->unk1C = 0; } + diff --git a/src/contest.c b/src/contest.c index 0591668ff..02d7038cf 100644 --- a/src/contest.c +++ b/src/contest.c @@ -445,18 +445,15 @@ const struct CompressedSpriteSheet gUnknown_08587B88 = const struct OamData gOamData_8587B90 = { .y = 0, - .affineMode = 0, - .objMode = 0, - .mosaic = 0, - .bpp = 0, + .affineMode = ST_OAM_AFFINE_OFF, + .objMode = ST_OAM_OBJ_NORMAL, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(16x16), .x = 0, - .matrixNum = 0, .size = SPRITE_SIZE(16x16), .tileNum = 0, .priority = 0, .paletteNum = 0, - .affineParam = 0 }; const struct SpriteTemplate gSpriteTemplate_8587B98 = @@ -486,18 +483,15 @@ const struct SpritePalette gUnknown_08587BB8 = const struct OamData gOamData_8587BC0 = { .y = 0, - .affineMode = 0, - .objMode = 0, - .mosaic = 0, - .bpp = 0, + .affineMode = ST_OAM_AFFINE_OFF, + .objMode = ST_OAM_OBJ_NORMAL, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(64x32), .x = 0, - .matrixNum = 0, .size = SPRITE_SIZE(64x32), .tileNum = 0, .priority = 0, .paletteNum = 0, - .affineParam = 0 }; const struct SpriteTemplate gSpriteTemplate_8587BC8 = @@ -514,18 +508,15 @@ const struct SpriteTemplate gSpriteTemplate_8587BC8 = const struct OamData gOamData_8587BE0 = { .y = 0, - .affineMode = 0, - .objMode = 0, - .mosaic = 0, - .bpp = 0, + .affineMode = ST_OAM_AFFINE_OFF, + .objMode = ST_OAM_OBJ_NORMAL, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(64x64), .x = 0, - .matrixNum = 0, .size = SPRITE_SIZE(64x64), .tileNum = 0, .priority = 3, .paletteNum = 2, - .affineParam = 0 }; const struct SpriteTemplate gSpriteTemplate_8587BE8 = @@ -768,18 +759,16 @@ static const struct SpritePalette sUnknown_08589924[] = const struct OamData gOamData_8589944 = { .y = 0, - .affineMode = 3, - .objMode = 1, - .mosaic = 0, - .bpp = 0, + .affineMode = ST_OAM_AFFINE_DOUBLE, + .objMode = ST_OAM_OBJ_BLEND, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(64x64), .x = 0, - .matrixNum = 0, .size = SPRITE_SIZE(64x64), .tileNum = 0, .priority = 0, .paletteNum = 0, - .affineParam = 0 + .affineParam = 0, }; const union AffineAnimCmd gSpriteAffineAnim_858994C[] = @@ -5762,3 +5751,5 @@ void sub_80DFA08(struct ContestPokemon *mon, s32 language) name[PLAYER_NAME_LENGTH] = EOS; } } + + diff --git a/src/contest_painting.c b/src/contest_painting.c index 29f3c871d..87598f2bd 100644 --- a/src/contest_painting.c +++ b/src/contest_painting.c @@ -152,16 +152,14 @@ const struct OamData gUnknown_085B0830 = .y = 0, .affineMode = ST_OAM_AFFINE_OFF, .objMode = ST_OAM_OBJ_NORMAL, - .mosaic = 1, + .mosaic = TRUE, .bpp = ST_OAM_8BPP, .shape = SPRITE_SHAPE(64x64), .x = 0, - .matrixNum = 0, .size = SPRITE_SIZE(64x64), .tileNum = 0, .priority = 0, .paletteNum = 0, - .affineParam = 0, }; const u16 gUnknown_085B0838[] = {RGB(0, 0, 0), RGB(0, 0, 0)}; @@ -705,3 +703,4 @@ static void sub_8130884(u8 arg0, u8 arg1) sub_8130688(arg0); sub_8130430(arg0, arg1); } + diff --git a/src/decoration.c b/src/decoration.c index 3c8809c6a..4baa6d4c8 100644 --- a/src/decoration.c +++ b/src/decoration.c @@ -391,10 +391,18 @@ const struct SpritePalette gUnknown_085A73E0 = { Unknown_085A7328, OVERWORLD_PLACE_DECOR_PLAYER_PAL_TAG }; -const struct OamData Unknown_085A73E8 = { +const struct OamData Unknown_085A73E8 = +{ + .y = 0, + .affineMode = ST_OAM_AFFINE_OFF, + .objMode = ST_OAM_OBJ_NORMAL, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(16x16), + .x = 0, .size = SPRITE_SIZE(16x16), - .priority = 1 + .tileNum = 0, + .priority = 1, + .paletteNum = 0, }; const union AnimCmd Unknown_085A73F0[] = { @@ -2740,3 +2748,4 @@ void sub_812A478(u8 taskId) StringExpandPlaceholders(gStringVar4, gText_DecorationThrownAway); DisplayItemMessageOnField(taskId, gStringVar4, sub_8127A5C); } + diff --git a/src/field_effect.c b/src/field_effect.c index 825efc380..93d7e5ef8 100644 --- a/src/field_effect.c +++ b/src/field_effect.c @@ -284,20 +284,44 @@ bool8 (*const gFieldEffectScriptFuncs[])(u8 **, u32 *) = const struct OamData gNewGameBirchOamAttributes = { + .y = 0, + .affineMode = ST_OAM_AFFINE_OFF, + .objMode = ST_OAM_OBJ_NORMAL, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(64x64), - .size = SPRITE_SIZE(64x64) + .x = 0, + .size = SPRITE_SIZE(64x64), + .tileNum = 0, + .priority = 0, + .paletteNum = 0, }; const struct OamData gOamData_855C218 = { + .y = 0, + .affineMode = ST_OAM_AFFINE_OFF, + .objMode = ST_OAM_OBJ_NORMAL, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(8x8), - .size = SPRITE_SIZE(8x8) + .x = 0, + .size = SPRITE_SIZE(8x8), + .tileNum = 0, + .priority = 0, + .paletteNum = 0, }; const struct OamData gOamData_855C220 = { + .y = 0, + .affineMode = ST_OAM_AFFINE_OFF, + .objMode = ST_OAM_OBJ_NORMAL, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(16x16), - .size = SPRITE_SIZE(16x16) + .x = 0, + .size = SPRITE_SIZE(16x16), + .tileNum = 0, + .priority = 0, + .paletteNum = 0, }; const struct SpriteFrameImage gNewGameBirchPicTable[] = @@ -347,8 +371,16 @@ const struct SpritePalette gFieldEffectObjectPaletteInfo5 = const struct OamData gOamData_855C26C = { + .y = 0, + .affineMode = ST_OAM_AFFINE_OFF, + .objMode = ST_OAM_OBJ_NORMAL, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(32x16), - .size = SPRITE_SIZE(32x16) + .x = 0, + .size = SPRITE_SIZE(32x16), + .tileNum = 0, + .priority = 0, + .paletteNum = 0, }; const struct SpriteFrameImage gSpriteImageTable_855C274[] = @@ -3759,3 +3791,4 @@ static void Fldeff_MoveDeoxysRock_Step(u8 taskId) break; } } + diff --git a/src/field_weather_effect.c b/src/field_weather_effect.c index 6ec83f1a0..1468f7ca0 100644 --- a/src/field_weather_effect.c +++ b/src/field_weather_effect.c @@ -1513,18 +1513,15 @@ void LoadAshSpriteSheet(void) const struct OamData gOamData_839ABB8 = { .y = 0, - .affineMode = 0, - .objMode = 1, - .mosaic = 0, - .bpp = 0, + .affineMode = ST_OAM_AFFINE_OFF, + .objMode = ST_OAM_OBJ_BLEND, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(64x64), .x = 0, - .matrixNum = 0, .size = SPRITE_SIZE(64x64), .tileNum = 0, .priority = 1, .paletteNum = 15, - .affineParam = 0, }; const union AnimCmd gSpriteAnim_839ABC0[] = @@ -1750,18 +1747,15 @@ void CreateFog2Sprites(void) const struct OamData gOamData_839ABF0 = { .y = 0, - .affineMode = 0, - .objMode = 1, - .mosaic = 0, - .bpp = 0, + .affineMode = ST_OAM_AFFINE_OFF, + .objMode = ST_OAM_OBJ_BLEND, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(64x64), .x = 0, - .matrixNum = 0, .size = SPRITE_SIZE(64x64), .tileNum = 0, .priority = 2, .paletteNum = 0, - .affineParam = 0, }; const union AnimCmd gSpriteAnim_839ABF8[] = @@ -1949,18 +1943,15 @@ void sub_80800E4(void) const struct OamData gOamData_839AC1C = { .y = 0, - .affineMode = 0, - .objMode = 1, - .mosaic = 0, - .bpp = 0, + .affineMode = ST_OAM_AFFINE_OFF, + .objMode = ST_OAM_OBJ_BLEND, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(64x64), .x = 0, - .matrixNum = 0, .size = SPRITE_SIZE(64x64), .tileNum = 0, .priority = 1, .paletteNum = 0, - .affineParam = 0, }; const union AnimCmd gSpriteAnim_839AC24[] = @@ -2470,3 +2461,5 @@ static void UpdateRainCounter(u8 newWeather, u8 oldWeather) && (newWeather == WEATHER_RAIN_LIGHT || newWeather == WEATHER_RAIN_MED)) IncrementGameStat(GAME_STAT_GOT_RAINED_ON); } + + diff --git a/src/link_rfu.c b/src/link_rfu.c index a430f6e24..1e4c9c7e6 100644 --- a/src/link_rfu.c +++ b/src/link_rfu.c @@ -154,9 +154,18 @@ const u8 sWireless_RSEtoASCIITable[] = { 0x20, 0x2b, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00 }; -const struct OamData sWirelessStatusIndicatorOamData = { +const struct OamData sWirelessStatusIndicatorOamData = +{ + .y = 0, + .affineMode = ST_OAM_AFFINE_OFF, + .objMode = ST_OAM_OBJ_NORMAL, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(16x16), - .size = SPRITE_SIZE(16x16) + .x = 0, + .size = SPRITE_SIZE(16x16), + .tileNum = 0, + .priority = 0, + .paletteNum = 0, }; static const union AnimCmd sWirelessStatusIndicatorAnim0[] = { // 3 bars @@ -5182,3 +5191,4 @@ u32 GetRfuRecvQueueLength(void) { return gUnknown_03005000.unk_124.unk_8c2; } + diff --git a/src/naming_screen.c b/src/naming_screen.c index 75b7c8566..3b8ba037c 100644 --- a/src/naming_screen.c +++ b/src/naming_screen.c @@ -1906,52 +1906,43 @@ static const struct NamingScreenTemplate *const sNamingScreenTemplates[] = const struct OamData gOamData_858BFEC = { .y = 0, - .affineMode = 0, - .objMode = 0, - .mosaic = 0, - .bpp = 0, + .affineMode = ST_OAM_AFFINE_OFF, + .objMode = ST_OAM_OBJ_NORMAL, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(8x8), .x = 0, - .matrixNum = 0, .size = SPRITE_SIZE(8x8), .tileNum = 0, .priority = 0, .paletteNum = 0, - .affineParam = 0, }; const struct OamData gOamData_858BFF4 = { .y = 0, - .affineMode = 0, - .objMode = 0, - .mosaic = 0, - .bpp = 0, + .affineMode = ST_OAM_AFFINE_OFF, + .objMode = ST_OAM_OBJ_NORMAL, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(16x16), .x = 0, - .matrixNum = 0, .size = SPRITE_SIZE(16x16), .tileNum = 0, .priority = 0, .paletteNum = 0, - .affineParam = 0, }; const struct OamData gOamData_858BFFC = { .y = 0, - .affineMode = 0, - .objMode = 0, - .mosaic = 0, - .bpp = 0, + .affineMode = ST_OAM_AFFINE_OFF, + .objMode = ST_OAM_OBJ_NORMAL, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(32x16), .x = 0, - .matrixNum = 0, .size = SPRITE_SIZE(32x16), .tileNum = 0, .priority = 0, .paletteNum = 0, - .affineParam = 0, }; static const struct Subsprite gUnknown_0858C004[] = @@ -2203,3 +2194,5 @@ static const struct SpritePalette gUnknown_0858C230[] = {gNamingScreenMenu_Pal + 0x40, 0x0007}, {NULL} }; + + diff --git a/src/pokedex_cry_screen.c b/src/pokedex_cry_screen.c old mode 100755 new mode 100644 index 8ca0c8d6e..487db6d58 --- a/src/pokedex_cry_screen.c +++ b/src/pokedex_cry_screen.c @@ -169,9 +169,14 @@ const struct OamData gOamData_85B8C60 = { .y = 160, .affineMode = ST_OAM_AFFINE_NORMAL, + .objMode = ST_OAM_OBJ_NORMAL, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(64x64), + .x = 0, .size = SPRITE_SIZE(64x64), - .priority = 1 + .tileNum = 0, + .priority = 1, + .paletteNum = 0, }; const struct SpriteTemplate gUnknown_085B8C68 = @@ -521,3 +526,4 @@ static void sub_8145B24(s8 a0) sCryVolumeMeter->unk1 = r2; sCryVolumeMeter->unk2 = 5; } + diff --git a/src/pokemon_icon.c b/src/pokemon_icon.c index 4ff182a0e..a5d3f8961 100644 --- a/src/pokemon_icon.c +++ b/src/pokemon_icon.c @@ -927,18 +927,15 @@ const struct SpritePalette gMonIconPaletteTable[] = const struct OamData sMonIconOamData = { .y = 0, - .affineMode = 0, - .objMode = 0, - .mosaic = 0, - .bpp = 0, + .affineMode = ST_OAM_AFFINE_OFF, + .objMode = ST_OAM_OBJ_NORMAL, + .bpp = ST_OAM_4BPP, .shape = SPRITE_SHAPE(32x32), .x = 0, - .matrixNum = 0, .size = SPRITE_SIZE(32x32), .tileNum = 0, .priority = 1, .paletteNum = 0, - .affineParam = 0 }; // fastest to slowest @@ -1311,3 +1308,5 @@ void sub_80D32C8(struct Sprite *sprite, u8 animNum) sprite->animDelayCounter = 0; sprite->animCmdIndex = 0; } + + -- cgit v1.2.3 From 02e2b1af97dc46824faa3b3b6a28dc2483c1b41d Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Tue, 2 Apr 2019 20:57:09 +0200 Subject: Use species defines in gMonIconTable --- src/pokemon_icon.c | 886 ++++++++++++++++++++++++++--------------------------- 1 file changed, 442 insertions(+), 444 deletions(-) (limited to 'src') diff --git a/src/pokemon_icon.c b/src/pokemon_icon.c index a5d3f8961..6a135875e 100644 --- a/src/pokemon_icon.c +++ b/src/pokemon_icon.c @@ -25,446 +25,446 @@ static u8 CreateMonIconSprite(struct MonIconSpriteTemplate *, s16, s16, u8); const u8 *const gMonIconTable[] = { - gMonIcon_Bulbasaur, - gMonIcon_Bulbasaur, - gMonIcon_Ivysaur, - gMonIcon_Venusaur, - gMonIcon_Charmander, - gMonIcon_Charmeleon, - gMonIcon_Charizard, - gMonIcon_Squirtle, - gMonIcon_Wartortle, - gMonIcon_Blastoise, - gMonIcon_Caterpie, - gMonIcon_Metapod, - gMonIcon_Butterfree, - gMonIcon_Weedle, - gMonIcon_Kakuna, - gMonIcon_Beedrill, - gMonIcon_Pidgey, - gMonIcon_Pidgeotto, - gMonIcon_Pidgeot, - gMonIcon_Rattata, - gMonIcon_Raticate, - gMonIcon_Spearow, - gMonIcon_Fearow, - gMonIcon_Ekans, - gMonIcon_Arbok, - gMonIcon_Pikachu, - gMonIcon_Raichu, - gMonIcon_Sandshrew, - gMonIcon_Sandslash, - gMonIcon_NidoranF, - gMonIcon_Nidorina, - gMonIcon_Nidoqueen, - gMonIcon_NidoranM, - gMonIcon_Nidorino, - gMonIcon_Nidoking, - gMonIcon_Clefairy, - gMonIcon_Clefable, - gMonIcon_Vulpix, - gMonIcon_Ninetales, - gMonIcon_Jigglypuff, - gMonIcon_Wigglytuff, - gMonIcon_Zubat, - gMonIcon_Golbat, - gMonIcon_Oddish, - gMonIcon_Gloom, - gMonIcon_Vileplume, - gMonIcon_Paras, - gMonIcon_Parasect, - gMonIcon_Venonat, - gMonIcon_Venomoth, - gMonIcon_Diglett, - gMonIcon_Dugtrio, - gMonIcon_Meowth, - gMonIcon_Persian, - gMonIcon_Psyduck, - gMonIcon_Golduck, - gMonIcon_Mankey, - gMonIcon_Primeape, - gMonIcon_Growlithe, - gMonIcon_Arcanine, - gMonIcon_Poliwag, - gMonIcon_Poliwhirl, - gMonIcon_Poliwrath, - gMonIcon_Abra, - gMonIcon_Kadabra, - gMonIcon_Alakazam, - gMonIcon_Machop, - gMonIcon_Machoke, - gMonIcon_Machamp, - gMonIcon_Bellsprout, - gMonIcon_Weepinbell, - gMonIcon_Victreebel, - gMonIcon_Tentacool, - gMonIcon_Tentacruel, - gMonIcon_Geodude, - gMonIcon_Graveler, - gMonIcon_Golem, - gMonIcon_Ponyta, - gMonIcon_Rapidash, - gMonIcon_Slowpoke, - gMonIcon_Slowbro, - gMonIcon_Magnemite, - gMonIcon_Magneton, - gMonIcon_Farfetchd, - gMonIcon_Doduo, - gMonIcon_Dodrio, - gMonIcon_Seel, - gMonIcon_Dewgong, - gMonIcon_Grimer, - gMonIcon_Muk, - gMonIcon_Shellder, - gMonIcon_Cloyster, - gMonIcon_Gastly, - gMonIcon_Haunter, - gMonIcon_Gengar, - gMonIcon_Onix, - gMonIcon_Drowzee, - gMonIcon_Hypno, - gMonIcon_Krabby, - gMonIcon_Kingler, - gMonIcon_Voltorb, - gMonIcon_Electrode, - gMonIcon_Exeggcute, - gMonIcon_Exeggutor, - gMonIcon_Cubone, - gMonIcon_Marowak, - gMonIcon_Hitmonlee, - gMonIcon_Hitmonchan, - gMonIcon_Lickitung, - gMonIcon_Koffing, - gMonIcon_Weezing, - gMonIcon_Rhyhorn, - gMonIcon_Rhydon, - gMonIcon_Chansey, - gMonIcon_Tangela, - gMonIcon_Kangaskhan, - gMonIcon_Horsea, - gMonIcon_Seadra, - gMonIcon_Goldeen, - gMonIcon_Seaking, - gMonIcon_Staryu, - gMonIcon_Starmie, - gMonIcon_Mrmime, - gMonIcon_Scyther, - gMonIcon_Jynx, - gMonIcon_Electabuzz, - gMonIcon_Magmar, - gMonIcon_Pinsir, - gMonIcon_Tauros, - gMonIcon_Magikarp, - gMonIcon_Gyarados, - gMonIcon_Lapras, - gMonIcon_Ditto, - gMonIcon_Eevee, - gMonIcon_Vaporeon, - gMonIcon_Jolteon, - gMonIcon_Flareon, - gMonIcon_Porygon, - gMonIcon_Omanyte, - gMonIcon_Omastar, - gMonIcon_Kabuto, - gMonIcon_Kabutops, - gMonIcon_Aerodactyl, - gMonIcon_Snorlax, - gMonIcon_Articuno, - gMonIcon_Zapdos, - gMonIcon_Moltres, - gMonIcon_Dratini, - gMonIcon_Dragonair, - gMonIcon_Dragonite, - gMonIcon_Mewtwo, - gMonIcon_Mew, - gMonIcon_Chikorita, - gMonIcon_Bayleef, - gMonIcon_Meganium, - gMonIcon_Cyndaquil, - gMonIcon_Quilava, - gMonIcon_Typhlosion, - gMonIcon_Totodile, - gMonIcon_Croconaw, - gMonIcon_Feraligatr, - gMonIcon_Sentret, - gMonIcon_Furret, - gMonIcon_Hoothoot, - gMonIcon_Noctowl, - gMonIcon_Ledyba, - gMonIcon_Ledian, - gMonIcon_Spinarak, - gMonIcon_Ariados, - gMonIcon_Crobat, - gMonIcon_Chinchou, - gMonIcon_Lanturn, - gMonIcon_Pichu, - gMonIcon_Cleffa, - gMonIcon_Igglybuff, - gMonIcon_Togepi, - gMonIcon_Togetic, - gMonIcon_Natu, - gMonIcon_Xatu, - gMonIcon_Mareep, - gMonIcon_Flaaffy, - gMonIcon_Ampharos, - gMonIcon_Bellossom, - gMonIcon_Marill, - gMonIcon_Azumarill, - gMonIcon_Sudowoodo, - gMonIcon_Politoed, - gMonIcon_Hoppip, - gMonIcon_Skiploom, - gMonIcon_Jumpluff, - gMonIcon_Aipom, - gMonIcon_Sunkern, - gMonIcon_Sunflora, - gMonIcon_Yanma, - gMonIcon_Wooper, - gMonIcon_Quagsire, - gMonIcon_Espeon, - gMonIcon_Umbreon, - gMonIcon_Murkrow, - gMonIcon_Slowking, - gMonIcon_Misdreavus, - gMonIcon_UnownA, - gMonIcon_Wobbuffet, - gMonIcon_Girafarig, - gMonIcon_Pineco, - gMonIcon_Forretress, - gMonIcon_Dunsparce, - gMonIcon_Gligar, - gMonIcon_Steelix, - gMonIcon_Snubbull, - gMonIcon_Granbull, - gMonIcon_Qwilfish, - gMonIcon_Scizor, - gMonIcon_Shuckle, - gMonIcon_Heracross, - gMonIcon_Sneasel, - gMonIcon_Teddiursa, - gMonIcon_Ursaring, - gMonIcon_Slugma, - gMonIcon_Magcargo, - gMonIcon_Swinub, - gMonIcon_Piloswine, - gMonIcon_Corsola, - gMonIcon_Remoraid, - gMonIcon_Octillery, - gMonIcon_Delibird, - gMonIcon_Mantine, - gMonIcon_Skarmory, - gMonIcon_Houndour, - gMonIcon_Houndoom, - gMonIcon_Kingdra, - gMonIcon_Phanpy, - gMonIcon_Donphan, - gMonIcon_Porygon2, - gMonIcon_Stantler, - gMonIcon_Smeargle, - gMonIcon_Tyrogue, - gMonIcon_Hitmontop, - gMonIcon_Smoochum, - gMonIcon_Elekid, - gMonIcon_Magby, - gMonIcon_Miltank, - gMonIcon_Blissey, - gMonIcon_Raikou, - gMonIcon_Entei, - gMonIcon_Suicune, - gMonIcon_Larvitar, - gMonIcon_Pupitar, - gMonIcon_Tyranitar, - gMonIcon_Lugia, - gMonIcon_HoOh, - gMonIcon_Celebi, - gMonIcon_QuestionMark, - gMonIcon_QuestionMark, - gMonIcon_QuestionMark, - gMonIcon_QuestionMark, - gMonIcon_QuestionMark, - gMonIcon_QuestionMark, - gMonIcon_QuestionMark, - gMonIcon_QuestionMark, - gMonIcon_QuestionMark, - gMonIcon_QuestionMark, - gMonIcon_QuestionMark, - gMonIcon_QuestionMark, - gMonIcon_QuestionMark, - gMonIcon_QuestionMark, - gMonIcon_QuestionMark, - gMonIcon_QuestionMark, - gMonIcon_QuestionMark, - gMonIcon_QuestionMark, - gMonIcon_QuestionMark, - gMonIcon_QuestionMark, - gMonIcon_QuestionMark, - gMonIcon_QuestionMark, - gMonIcon_QuestionMark, - gMonIcon_QuestionMark, - gMonIcon_QuestionMark, - gMonIcon_Treecko, - gMonIcon_Grovyle, - gMonIcon_Sceptile, - gMonIcon_Torchic, - gMonIcon_Combusken, - gMonIcon_Blaziken, - gMonIcon_Mudkip, - gMonIcon_Marshtomp, - gMonIcon_Swampert, - gMonIcon_Poochyena, - gMonIcon_Mightyena, - gMonIcon_Zigzagoon, - gMonIcon_Linoone, - gMonIcon_Wurmple, - gMonIcon_Silcoon, - gMonIcon_Beautifly, - gMonIcon_Cascoon, - gMonIcon_Dustox, - gMonIcon_Lotad, - gMonIcon_Lombre, - gMonIcon_Ludicolo, - gMonIcon_Seedot, - gMonIcon_Nuzleaf, - gMonIcon_Shiftry, - gMonIcon_Nincada, - gMonIcon_Ninjask, - gMonIcon_Shedinja, - gMonIcon_Taillow, - gMonIcon_Swellow, - gMonIcon_Shroomish, - gMonIcon_Breloom, - gMonIcon_Spinda, - gMonIcon_Wingull, - gMonIcon_Pelipper, - gMonIcon_Surskit, - gMonIcon_Masquerain, - gMonIcon_Wailmer, - gMonIcon_Wailord, - gMonIcon_Skitty, - gMonIcon_Delcatty, - gMonIcon_Kecleon, - gMonIcon_Baltoy, - gMonIcon_Claydol, - gMonIcon_Nosepass, - gMonIcon_Torkoal, - gMonIcon_Sableye, - gMonIcon_Barboach, - gMonIcon_Whiscash, - gMonIcon_Luvdisc, - gMonIcon_Corphish, - gMonIcon_Crawdaunt, - gMonIcon_Feebas, - gMonIcon_Milotic, - gMonIcon_Carvanha, - gMonIcon_Sharpedo, - gMonIcon_Trapinch, - gMonIcon_Vibrava, - gMonIcon_Flygon, - gMonIcon_Makuhita, - gMonIcon_Hariyama, - gMonIcon_Electrike, - gMonIcon_Manectric, - gMonIcon_Numel, - gMonIcon_Camerupt, - gMonIcon_Spheal, - gMonIcon_Sealeo, - gMonIcon_Walrein, - gMonIcon_Cacnea, - gMonIcon_Cacturne, - gMonIcon_Snorunt, - gMonIcon_Glalie, - gMonIcon_Lunatone, - gMonIcon_Solrock, - gMonIcon_Azurill, - gMonIcon_Spoink, - gMonIcon_Grumpig, - gMonIcon_Plusle, - gMonIcon_Minun, - gMonIcon_Mawile, - gMonIcon_Meditite, - gMonIcon_Medicham, - gMonIcon_Swablu, - gMonIcon_Altaria, - gMonIcon_Wynaut, - gMonIcon_Duskull, - gMonIcon_Dusclops, - gMonIcon_Roselia, - gMonIcon_Slakoth, - gMonIcon_Vigoroth, - gMonIcon_Slaking, - gMonIcon_Gulpin, - gMonIcon_Swalot, - gMonIcon_Tropius, - gMonIcon_Whismur, - gMonIcon_Loudred, - gMonIcon_Exploud, - gMonIcon_Clamperl, - gMonIcon_Huntail, - gMonIcon_Gorebyss, - gMonIcon_Absol, - gMonIcon_Shuppet, - gMonIcon_Banette, - gMonIcon_Seviper, - gMonIcon_Zangoose, - gMonIcon_Relicanth, - gMonIcon_Aron, - gMonIcon_Lairon, - gMonIcon_Aggron, - gMonIcon_Castform, - gMonIcon_Volbeat, - gMonIcon_Illumise, - gMonIcon_Lileep, - gMonIcon_Cradily, - gMonIcon_Anorith, - gMonIcon_Armaldo, - gMonIcon_Ralts, - gMonIcon_Kirlia, - gMonIcon_Gardevoir, - gMonIcon_Bagon, - gMonIcon_Shelgon, - gMonIcon_Salamence, - gMonIcon_Beldum, - gMonIcon_Metang, - gMonIcon_Metagross, - gMonIcon_Regirock, - gMonIcon_Regice, - gMonIcon_Registeel, - gMonIcon_Kyogre, - gMonIcon_Groudon, - gMonIcon_Rayquaza, - gMonIcon_Latias, - gMonIcon_Latios, - gMonIcon_Jirachi, - gMonIcon_Deoxys, - gMonIcon_Chimecho, - gMonIcon_Egg, - gMonIcon_UnownB, - gMonIcon_UnownC, - gMonIcon_UnownD, - gMonIcon_UnownE, - gMonIcon_UnownF, - gMonIcon_UnownG, - gMonIcon_UnownH, - gMonIcon_UnownI, - gMonIcon_UnownJ, - gMonIcon_UnownK, - gMonIcon_UnownL, - gMonIcon_UnownM, - gMonIcon_UnownN, - gMonIcon_UnownO, - gMonIcon_UnownP, - gMonIcon_UnownQ, - gMonIcon_UnownR, - gMonIcon_UnownS, - gMonIcon_UnownT, - gMonIcon_UnownU, - gMonIcon_UnownV, - gMonIcon_UnownW, - gMonIcon_UnownX, - gMonIcon_UnownY, - gMonIcon_UnownZ, - gMonIcon_UnownExclamationMark, - gMonIcon_UnownQuestionMark, + [SPECIES_NONE] = gMonIcon_Bulbasaur, + [SPECIES_BULBASAUR] = gMonIcon_Bulbasaur, + [SPECIES_IVYSAUR] = gMonIcon_Ivysaur, + [SPECIES_VENUSAUR] = gMonIcon_Venusaur, + [SPECIES_CHARMANDER] = gMonIcon_Charmander, + [SPECIES_CHARMELEON] = gMonIcon_Charmeleon, + [SPECIES_CHARIZARD] = gMonIcon_Charizard, + [SPECIES_SQUIRTLE] = gMonIcon_Squirtle, + [SPECIES_WARTORTLE] = gMonIcon_Wartortle, + [SPECIES_BLASTOISE] = gMonIcon_Blastoise, + [SPECIES_CATERPIE] = gMonIcon_Caterpie, + [SPECIES_METAPOD] = gMonIcon_Metapod, + [SPECIES_BUTTERFREE] = gMonIcon_Butterfree, + [SPECIES_WEEDLE] = gMonIcon_Weedle, + [SPECIES_KAKUNA] = gMonIcon_Kakuna, + [SPECIES_BEEDRILL] = gMonIcon_Beedrill, + [SPECIES_PIDGEY] = gMonIcon_Pidgey, + [SPECIES_PIDGEOTTO] = gMonIcon_Pidgeotto, + [SPECIES_PIDGEOT] = gMonIcon_Pidgeot, + [SPECIES_RATTATA] = gMonIcon_Rattata, + [SPECIES_RATICATE] = gMonIcon_Raticate, + [SPECIES_SPEAROW] = gMonIcon_Spearow, + [SPECIES_FEAROW] = gMonIcon_Fearow, + [SPECIES_EKANS] = gMonIcon_Ekans, + [SPECIES_ARBOK] = gMonIcon_Arbok, + [SPECIES_PIKACHU] = gMonIcon_Pikachu, + [SPECIES_RAICHU] = gMonIcon_Raichu, + [SPECIES_SANDSHREW] = gMonIcon_Sandshrew, + [SPECIES_SANDSLASH] = gMonIcon_Sandslash, + [SPECIES_NIDORAN_F] = gMonIcon_NidoranF, + [SPECIES_NIDORINA] = gMonIcon_Nidorina, + [SPECIES_NIDOQUEEN] = gMonIcon_Nidoqueen, + [SPECIES_NIDORAN_M] = gMonIcon_NidoranM, + [SPECIES_NIDORINO] = gMonIcon_Nidorino, + [SPECIES_NIDOKING] = gMonIcon_Nidoking, + [SPECIES_CLEFAIRY] = gMonIcon_Clefairy, + [SPECIES_CLEFABLE] = gMonIcon_Clefable, + [SPECIES_VULPIX] = gMonIcon_Vulpix, + [SPECIES_NINETALES] = gMonIcon_Ninetales, + [SPECIES_JIGGLYPUFF] = gMonIcon_Jigglypuff, + [SPECIES_WIGGLYTUFF] = gMonIcon_Wigglytuff, + [SPECIES_ZUBAT] = gMonIcon_Zubat, + [SPECIES_GOLBAT] = gMonIcon_Golbat, + [SPECIES_ODDISH] = gMonIcon_Oddish, + [SPECIES_GLOOM] = gMonIcon_Gloom, + [SPECIES_VILEPLUME] = gMonIcon_Vileplume, + [SPECIES_PARAS] = gMonIcon_Paras, + [SPECIES_PARASECT] = gMonIcon_Parasect, + [SPECIES_VENONAT] = gMonIcon_Venonat, + [SPECIES_VENOMOTH] = gMonIcon_Venomoth, + [SPECIES_DIGLETT] = gMonIcon_Diglett, + [SPECIES_DUGTRIO] = gMonIcon_Dugtrio, + [SPECIES_MEOWTH] = gMonIcon_Meowth, + [SPECIES_PERSIAN] = gMonIcon_Persian, + [SPECIES_PSYDUCK] = gMonIcon_Psyduck, + [SPECIES_GOLDUCK] = gMonIcon_Golduck, + [SPECIES_MANKEY] = gMonIcon_Mankey, + [SPECIES_PRIMEAPE] = gMonIcon_Primeape, + [SPECIES_GROWLITHE] = gMonIcon_Growlithe, + [SPECIES_ARCANINE] = gMonIcon_Arcanine, + [SPECIES_POLIWAG] = gMonIcon_Poliwag, + [SPECIES_POLIWHIRL] = gMonIcon_Poliwhirl, + [SPECIES_POLIWRATH] = gMonIcon_Poliwrath, + [SPECIES_ABRA] = gMonIcon_Abra, + [SPECIES_KADABRA] = gMonIcon_Kadabra, + [SPECIES_ALAKAZAM] = gMonIcon_Alakazam, + [SPECIES_MACHOP] = gMonIcon_Machop, + [SPECIES_MACHOKE] = gMonIcon_Machoke, + [SPECIES_MACHAMP] = gMonIcon_Machamp, + [SPECIES_BELLSPROUT] = gMonIcon_Bellsprout, + [SPECIES_WEEPINBELL] = gMonIcon_Weepinbell, + [SPECIES_VICTREEBEL] = gMonIcon_Victreebel, + [SPECIES_TENTACOOL] = gMonIcon_Tentacool, + [SPECIES_TENTACRUEL] = gMonIcon_Tentacruel, + [SPECIES_GEODUDE] = gMonIcon_Geodude, + [SPECIES_GRAVELER] = gMonIcon_Graveler, + [SPECIES_GOLEM] = gMonIcon_Golem, + [SPECIES_PONYTA] = gMonIcon_Ponyta, + [SPECIES_RAPIDASH] = gMonIcon_Rapidash, + [SPECIES_SLOWPOKE] = gMonIcon_Slowpoke, + [SPECIES_SLOWBRO] = gMonIcon_Slowbro, + [SPECIES_MAGNEMITE] = gMonIcon_Magnemite, + [SPECIES_MAGNETON] = gMonIcon_Magneton, + [SPECIES_FARFETCHD] = gMonIcon_Farfetchd, + [SPECIES_DODUO] = gMonIcon_Doduo, + [SPECIES_DODRIO] = gMonIcon_Dodrio, + [SPECIES_SEEL] = gMonIcon_Seel, + [SPECIES_DEWGONG] = gMonIcon_Dewgong, + [SPECIES_GRIMER] = gMonIcon_Grimer, + [SPECIES_MUK] = gMonIcon_Muk, + [SPECIES_SHELLDER] = gMonIcon_Shellder, + [SPECIES_CLOYSTER] = gMonIcon_Cloyster, + [SPECIES_GASTLY] = gMonIcon_Gastly, + [SPECIES_HAUNTER] = gMonIcon_Haunter, + [SPECIES_GENGAR] = gMonIcon_Gengar, + [SPECIES_ONIX] = gMonIcon_Onix, + [SPECIES_DROWZEE] = gMonIcon_Drowzee, + [SPECIES_HYPNO] = gMonIcon_Hypno, + [SPECIES_KRABBY] = gMonIcon_Krabby, + [SPECIES_KINGLER] = gMonIcon_Kingler, + [SPECIES_VOLTORB] = gMonIcon_Voltorb, + [SPECIES_ELECTRODE] = gMonIcon_Electrode, + [SPECIES_EXEGGCUTE] = gMonIcon_Exeggcute, + [SPECIES_EXEGGUTOR] = gMonIcon_Exeggutor, + [SPECIES_CUBONE] = gMonIcon_Cubone, + [SPECIES_MAROWAK] = gMonIcon_Marowak, + [SPECIES_HITMONLEE] = gMonIcon_Hitmonlee, + [SPECIES_HITMONCHAN] = gMonIcon_Hitmonchan, + [SPECIES_LICKITUNG] = gMonIcon_Lickitung, + [SPECIES_KOFFING] = gMonIcon_Koffing, + [SPECIES_WEEZING] = gMonIcon_Weezing, + [SPECIES_RHYHORN] = gMonIcon_Rhyhorn, + [SPECIES_RHYDON] = gMonIcon_Rhydon, + [SPECIES_CHANSEY] = gMonIcon_Chansey, + [SPECIES_TANGELA] = gMonIcon_Tangela, + [SPECIES_KANGASKHAN] = gMonIcon_Kangaskhan, + [SPECIES_HORSEA] = gMonIcon_Horsea, + [SPECIES_SEADRA] = gMonIcon_Seadra, + [SPECIES_GOLDEEN] = gMonIcon_Goldeen, + [SPECIES_SEAKING] = gMonIcon_Seaking, + [SPECIES_STARYU] = gMonIcon_Staryu, + [SPECIES_STARMIE] = gMonIcon_Starmie, + [SPECIES_MR_MIME] = gMonIcon_Mrmime, + [SPECIES_SCYTHER] = gMonIcon_Scyther, + [SPECIES_JYNX] = gMonIcon_Jynx, + [SPECIES_ELECTABUZZ] = gMonIcon_Electabuzz, + [SPECIES_MAGMAR] = gMonIcon_Magmar, + [SPECIES_PINSIR] = gMonIcon_Pinsir, + [SPECIES_TAUROS] = gMonIcon_Tauros, + [SPECIES_MAGIKARP] = gMonIcon_Magikarp, + [SPECIES_GYARADOS] = gMonIcon_Gyarados, + [SPECIES_LAPRAS] = gMonIcon_Lapras, + [SPECIES_DITTO] = gMonIcon_Ditto, + [SPECIES_EEVEE] = gMonIcon_Eevee, + [SPECIES_VAPOREON] = gMonIcon_Vaporeon, + [SPECIES_JOLTEON] = gMonIcon_Jolteon, + [SPECIES_FLAREON] = gMonIcon_Flareon, + [SPECIES_PORYGON] = gMonIcon_Porygon, + [SPECIES_OMANYTE] = gMonIcon_Omanyte, + [SPECIES_OMASTAR] = gMonIcon_Omastar, + [SPECIES_KABUTO] = gMonIcon_Kabuto, + [SPECIES_KABUTOPS] = gMonIcon_Kabutops, + [SPECIES_AERODACTYL] = gMonIcon_Aerodactyl, + [SPECIES_SNORLAX] = gMonIcon_Snorlax, + [SPECIES_ARTICUNO] = gMonIcon_Articuno, + [SPECIES_ZAPDOS] = gMonIcon_Zapdos, + [SPECIES_MOLTRES] = gMonIcon_Moltres, + [SPECIES_DRATINI] = gMonIcon_Dratini, + [SPECIES_DRAGONAIR] = gMonIcon_Dragonair, + [SPECIES_DRAGONITE] = gMonIcon_Dragonite, + [SPECIES_MEWTWO] = gMonIcon_Mewtwo, + [SPECIES_MEW] = gMonIcon_Mew, + [SPECIES_CHIKORITA] = gMonIcon_Chikorita, + [SPECIES_BAYLEEF] = gMonIcon_Bayleef, + [SPECIES_MEGANIUM] = gMonIcon_Meganium, + [SPECIES_CYNDAQUIL] = gMonIcon_Cyndaquil, + [SPECIES_QUILAVA] = gMonIcon_Quilava, + [SPECIES_TYPHLOSION] = gMonIcon_Typhlosion, + [SPECIES_TOTODILE] = gMonIcon_Totodile, + [SPECIES_CROCONAW] = gMonIcon_Croconaw, + [SPECIES_FERALIGATR] = gMonIcon_Feraligatr, + [SPECIES_SENTRET] = gMonIcon_Sentret, + [SPECIES_FURRET] = gMonIcon_Furret, + [SPECIES_HOOTHOOT] = gMonIcon_Hoothoot, + [SPECIES_NOCTOWL] = gMonIcon_Noctowl, + [SPECIES_LEDYBA] = gMonIcon_Ledyba, + [SPECIES_LEDIAN] = gMonIcon_Ledian, + [SPECIES_SPINARAK] = gMonIcon_Spinarak, + [SPECIES_ARIADOS] = gMonIcon_Ariados, + [SPECIES_CROBAT] = gMonIcon_Crobat, + [SPECIES_CHINCHOU] = gMonIcon_Chinchou, + [SPECIES_LANTURN] = gMonIcon_Lanturn, + [SPECIES_PICHU] = gMonIcon_Pichu, + [SPECIES_CLEFFA] = gMonIcon_Cleffa, + [SPECIES_IGGLYBUFF] = gMonIcon_Igglybuff, + [SPECIES_TOGEPI] = gMonIcon_Togepi, + [SPECIES_TOGETIC] = gMonIcon_Togetic, + [SPECIES_NATU] = gMonIcon_Natu, + [SPECIES_XATU] = gMonIcon_Xatu, + [SPECIES_MAREEP] = gMonIcon_Mareep, + [SPECIES_FLAAFFY] = gMonIcon_Flaaffy, + [SPECIES_AMPHAROS] = gMonIcon_Ampharos, + [SPECIES_BELLOSSOM] = gMonIcon_Bellossom, + [SPECIES_MARILL] = gMonIcon_Marill, + [SPECIES_AZUMARILL] = gMonIcon_Azumarill, + [SPECIES_SUDOWOODO] = gMonIcon_Sudowoodo, + [SPECIES_POLITOED] = gMonIcon_Politoed, + [SPECIES_HOPPIP] = gMonIcon_Hoppip, + [SPECIES_SKIPLOOM] = gMonIcon_Skiploom, + [SPECIES_JUMPLUFF] = gMonIcon_Jumpluff, + [SPECIES_AIPOM] = gMonIcon_Aipom, + [SPECIES_SUNKERN] = gMonIcon_Sunkern, + [SPECIES_SUNFLORA] = gMonIcon_Sunflora, + [SPECIES_YANMA] = gMonIcon_Yanma, + [SPECIES_WOOPER] = gMonIcon_Wooper, + [SPECIES_QUAGSIRE] = gMonIcon_Quagsire, + [SPECIES_ESPEON] = gMonIcon_Espeon, + [SPECIES_UMBREON] = gMonIcon_Umbreon, + [SPECIES_MURKROW] = gMonIcon_Murkrow, + [SPECIES_SLOWKING] = gMonIcon_Slowking, + [SPECIES_MISDREAVUS] = gMonIcon_Misdreavus, + [SPECIES_UNOWN] = gMonIcon_UnownA, + [SPECIES_WOBBUFFET] = gMonIcon_Wobbuffet, + [SPECIES_GIRAFARIG] = gMonIcon_Girafarig, + [SPECIES_PINECO] = gMonIcon_Pineco, + [SPECIES_FORRETRESS] = gMonIcon_Forretress, + [SPECIES_DUNSPARCE] = gMonIcon_Dunsparce, + [SPECIES_GLIGAR] = gMonIcon_Gligar, + [SPECIES_STEELIX] = gMonIcon_Steelix, + [SPECIES_SNUBBULL] = gMonIcon_Snubbull, + [SPECIES_GRANBULL] = gMonIcon_Granbull, + [SPECIES_QWILFISH] = gMonIcon_Qwilfish, + [SPECIES_SCIZOR] = gMonIcon_Scizor, + [SPECIES_SHUCKLE] = gMonIcon_Shuckle, + [SPECIES_HERACROSS] = gMonIcon_Heracross, + [SPECIES_SNEASEL] = gMonIcon_Sneasel, + [SPECIES_TEDDIURSA] = gMonIcon_Teddiursa, + [SPECIES_URSARING] = gMonIcon_Ursaring, + [SPECIES_SLUGMA] = gMonIcon_Slugma, + [SPECIES_MAGCARGO] = gMonIcon_Magcargo, + [SPECIES_SWINUB] = gMonIcon_Swinub, + [SPECIES_PILOSWINE] = gMonIcon_Piloswine, + [SPECIES_CORSOLA] = gMonIcon_Corsola, + [SPECIES_REMORAID] = gMonIcon_Remoraid, + [SPECIES_OCTILLERY] = gMonIcon_Octillery, + [SPECIES_DELIBIRD] = gMonIcon_Delibird, + [SPECIES_MANTINE] = gMonIcon_Mantine, + [SPECIES_SKARMORY] = gMonIcon_Skarmory, + [SPECIES_HOUNDOUR] = gMonIcon_Houndour, + [SPECIES_HOUNDOOM] = gMonIcon_Houndoom, + [SPECIES_KINGDRA] = gMonIcon_Kingdra, + [SPECIES_PHANPY] = gMonIcon_Phanpy, + [SPECIES_DONPHAN] = gMonIcon_Donphan, + [SPECIES_PORYGON2] = gMonIcon_Porygon2, + [SPECIES_STANTLER] = gMonIcon_Stantler, + [SPECIES_SMEARGLE] = gMonIcon_Smeargle, + [SPECIES_TYROGUE] = gMonIcon_Tyrogue, + [SPECIES_HITMONTOP] = gMonIcon_Hitmontop, + [SPECIES_SMOOCHUM] = gMonIcon_Smoochum, + [SPECIES_ELEKID] = gMonIcon_Elekid, + [SPECIES_MAGBY] = gMonIcon_Magby, + [SPECIES_MILTANK] = gMonIcon_Miltank, + [SPECIES_BLISSEY] = gMonIcon_Blissey, + [SPECIES_RAIKOU] = gMonIcon_Raikou, + [SPECIES_ENTEI] = gMonIcon_Entei, + [SPECIES_SUICUNE] = gMonIcon_Suicune, + [SPECIES_LARVITAR] = gMonIcon_Larvitar, + [SPECIES_PUPITAR] = gMonIcon_Pupitar, + [SPECIES_TYRANITAR] = gMonIcon_Tyranitar, + [SPECIES_LUGIA] = gMonIcon_Lugia, + [SPECIES_HO_OH] = gMonIcon_HoOh, + [SPECIES_CELEBI] = gMonIcon_Celebi, + [SPECIES_OLD_UNOWN_B] = gMonIcon_QuestionMark, + [SPECIES_OLD_UNOWN_C] = gMonIcon_QuestionMark, + [SPECIES_OLD_UNOWN_D] = gMonIcon_QuestionMark, + [SPECIES_OLD_UNOWN_E] = gMonIcon_QuestionMark, + [SPECIES_OLD_UNOWN_F] = gMonIcon_QuestionMark, + [SPECIES_OLD_UNOWN_G] = gMonIcon_QuestionMark, + [SPECIES_OLD_UNOWN_H] = gMonIcon_QuestionMark, + [SPECIES_OLD_UNOWN_I] = gMonIcon_QuestionMark, + [SPECIES_OLD_UNOWN_J] = gMonIcon_QuestionMark, + [SPECIES_OLD_UNOWN_K] = gMonIcon_QuestionMark, + [SPECIES_OLD_UNOWN_L] = gMonIcon_QuestionMark, + [SPECIES_OLD_UNOWN_M] = gMonIcon_QuestionMark, + [SPECIES_OLD_UNOWN_N] = gMonIcon_QuestionMark, + [SPECIES_OLD_UNOWN_O] = gMonIcon_QuestionMark, + [SPECIES_OLD_UNOWN_P] = gMonIcon_QuestionMark, + [SPECIES_OLD_UNOWN_Q] = gMonIcon_QuestionMark, + [SPECIES_OLD_UNOWN_R] = gMonIcon_QuestionMark, + [SPECIES_OLD_UNOWN_S] = gMonIcon_QuestionMark, + [SPECIES_OLD_UNOWN_T] = gMonIcon_QuestionMark, + [SPECIES_OLD_UNOWN_U] = gMonIcon_QuestionMark, + [SPECIES_OLD_UNOWN_V] = gMonIcon_QuestionMark, + [SPECIES_OLD_UNOWN_W] = gMonIcon_QuestionMark, + [SPECIES_OLD_UNOWN_X] = gMonIcon_QuestionMark, + [SPECIES_OLD_UNOWN_Y] = gMonIcon_QuestionMark, + [SPECIES_OLD_UNOWN_Z] = gMonIcon_QuestionMark, + [SPECIES_TREECKO] = gMonIcon_Treecko, + [SPECIES_GROVYLE] = gMonIcon_Grovyle, + [SPECIES_SCEPTILE] = gMonIcon_Sceptile, + [SPECIES_TORCHIC] = gMonIcon_Torchic, + [SPECIES_COMBUSKEN] = gMonIcon_Combusken, + [SPECIES_BLAZIKEN] = gMonIcon_Blaziken, + [SPECIES_MUDKIP] = gMonIcon_Mudkip, + [SPECIES_MARSHTOMP] = gMonIcon_Marshtomp, + [SPECIES_SWAMPERT] = gMonIcon_Swampert, + [SPECIES_POOCHYENA] = gMonIcon_Poochyena, + [SPECIES_MIGHTYENA] = gMonIcon_Mightyena, + [SPECIES_ZIGZAGOON] = gMonIcon_Zigzagoon, + [SPECIES_LINOONE] = gMonIcon_Linoone, + [SPECIES_WURMPLE] = gMonIcon_Wurmple, + [SPECIES_SILCOON] = gMonIcon_Silcoon, + [SPECIES_BEAUTIFLY] = gMonIcon_Beautifly, + [SPECIES_CASCOON] = gMonIcon_Cascoon, + [SPECIES_DUSTOX] = gMonIcon_Dustox, + [SPECIES_LOTAD] = gMonIcon_Lotad, + [SPECIES_LOMBRE] = gMonIcon_Lombre, + [SPECIES_LUDICOLO] = gMonIcon_Ludicolo, + [SPECIES_SEEDOT] = gMonIcon_Seedot, + [SPECIES_NUZLEAF] = gMonIcon_Nuzleaf, + [SPECIES_SHIFTRY] = gMonIcon_Shiftry, + [SPECIES_NINCADA] = gMonIcon_Nincada, + [SPECIES_NINJASK] = gMonIcon_Ninjask, + [SPECIES_SHEDINJA] = gMonIcon_Shedinja, + [SPECIES_TAILLOW] = gMonIcon_Taillow, + [SPECIES_SWELLOW] = gMonIcon_Swellow, + [SPECIES_SHROOMISH] = gMonIcon_Shroomish, + [SPECIES_BRELOOM] = gMonIcon_Breloom, + [SPECIES_SPINDA] = gMonIcon_Spinda, + [SPECIES_WINGULL] = gMonIcon_Wingull, + [SPECIES_PELIPPER] = gMonIcon_Pelipper, + [SPECIES_SURSKIT] = gMonIcon_Surskit, + [SPECIES_MASQUERAIN] = gMonIcon_Masquerain, + [SPECIES_WAILMER] = gMonIcon_Wailmer, + [SPECIES_WAILORD] = gMonIcon_Wailord, + [SPECIES_SKITTY] = gMonIcon_Skitty, + [SPECIES_DELCATTY] = gMonIcon_Delcatty, + [SPECIES_KECLEON] = gMonIcon_Kecleon, + [SPECIES_BALTOY] = gMonIcon_Baltoy, + [SPECIES_CLAYDOL] = gMonIcon_Claydol, + [SPECIES_NOSEPASS] = gMonIcon_Nosepass, + [SPECIES_TORKOAL] = gMonIcon_Torkoal, + [SPECIES_SABLEYE] = gMonIcon_Sableye, + [SPECIES_BARBOACH] = gMonIcon_Barboach, + [SPECIES_WHISCASH] = gMonIcon_Whiscash, + [SPECIES_LUVDISC] = gMonIcon_Luvdisc, + [SPECIES_CORPHISH] = gMonIcon_Corphish, + [SPECIES_CRAWDAUNT] = gMonIcon_Crawdaunt, + [SPECIES_FEEBAS] = gMonIcon_Feebas, + [SPECIES_MILOTIC] = gMonIcon_Milotic, + [SPECIES_CARVANHA] = gMonIcon_Carvanha, + [SPECIES_SHARPEDO] = gMonIcon_Sharpedo, + [SPECIES_TRAPINCH] = gMonIcon_Trapinch, + [SPECIES_VIBRAVA] = gMonIcon_Vibrava, + [SPECIES_FLYGON] = gMonIcon_Flygon, + [SPECIES_MAKUHITA] = gMonIcon_Makuhita, + [SPECIES_HARIYAMA] = gMonIcon_Hariyama, + [SPECIES_ELECTRIKE] = gMonIcon_Electrike, + [SPECIES_MANECTRIC] = gMonIcon_Manectric, + [SPECIES_NUMEL] = gMonIcon_Numel, + [SPECIES_CAMERUPT] = gMonIcon_Camerupt, + [SPECIES_SPHEAL] = gMonIcon_Spheal, + [SPECIES_SEALEO] = gMonIcon_Sealeo, + [SPECIES_WALREIN] = gMonIcon_Walrein, + [SPECIES_CACNEA] = gMonIcon_Cacnea, + [SPECIES_CACTURNE] = gMonIcon_Cacturne, + [SPECIES_SNORUNT] = gMonIcon_Snorunt, + [SPECIES_GLALIE] = gMonIcon_Glalie, + [SPECIES_LUNATONE] = gMonIcon_Lunatone, + [SPECIES_SOLROCK] = gMonIcon_Solrock, + [SPECIES_AZURILL] = gMonIcon_Azurill, + [SPECIES_SPOINK] = gMonIcon_Spoink, + [SPECIES_GRUMPIG] = gMonIcon_Grumpig, + [SPECIES_PLUSLE] = gMonIcon_Plusle, + [SPECIES_MINUN] = gMonIcon_Minun, + [SPECIES_MAWILE] = gMonIcon_Mawile, + [SPECIES_MEDITITE] = gMonIcon_Meditite, + [SPECIES_MEDICHAM] = gMonIcon_Medicham, + [SPECIES_SWABLU] = gMonIcon_Swablu, + [SPECIES_ALTARIA] = gMonIcon_Altaria, + [SPECIES_WYNAUT] = gMonIcon_Wynaut, + [SPECIES_DUSKULL] = gMonIcon_Duskull, + [SPECIES_DUSCLOPS] = gMonIcon_Dusclops, + [SPECIES_ROSELIA] = gMonIcon_Roselia, + [SPECIES_SLAKOTH] = gMonIcon_Slakoth, + [SPECIES_VIGOROTH] = gMonIcon_Vigoroth, + [SPECIES_SLAKING] = gMonIcon_Slaking, + [SPECIES_GULPIN] = gMonIcon_Gulpin, + [SPECIES_SWALOT] = gMonIcon_Swalot, + [SPECIES_TROPIUS] = gMonIcon_Tropius, + [SPECIES_WHISMUR] = gMonIcon_Whismur, + [SPECIES_LOUDRED] = gMonIcon_Loudred, + [SPECIES_EXPLOUD] = gMonIcon_Exploud, + [SPECIES_CLAMPERL] = gMonIcon_Clamperl, + [SPECIES_HUNTAIL] = gMonIcon_Huntail, + [SPECIES_GOREBYSS] = gMonIcon_Gorebyss, + [SPECIES_ABSOL] = gMonIcon_Absol, + [SPECIES_SHUPPET] = gMonIcon_Shuppet, + [SPECIES_BANETTE] = gMonIcon_Banette, + [SPECIES_SEVIPER] = gMonIcon_Seviper, + [SPECIES_ZANGOOSE] = gMonIcon_Zangoose, + [SPECIES_RELICANTH] = gMonIcon_Relicanth, + [SPECIES_ARON] = gMonIcon_Aron, + [SPECIES_LAIRON] = gMonIcon_Lairon, + [SPECIES_AGGRON] = gMonIcon_Aggron, + [SPECIES_CASTFORM] = gMonIcon_Castform, + [SPECIES_VOLBEAT] = gMonIcon_Volbeat, + [SPECIES_ILLUMISE] = gMonIcon_Illumise, + [SPECIES_LILEEP] = gMonIcon_Lileep, + [SPECIES_CRADILY] = gMonIcon_Cradily, + [SPECIES_ANORITH] = gMonIcon_Anorith, + [SPECIES_ARMALDO] = gMonIcon_Armaldo, + [SPECIES_RALTS] = gMonIcon_Ralts, + [SPECIES_KIRLIA] = gMonIcon_Kirlia, + [SPECIES_GARDEVOIR] = gMonIcon_Gardevoir, + [SPECIES_BAGON] = gMonIcon_Bagon, + [SPECIES_SHELGON] = gMonIcon_Shelgon, + [SPECIES_SALAMENCE] = gMonIcon_Salamence, + [SPECIES_BELDUM] = gMonIcon_Beldum, + [SPECIES_METANG] = gMonIcon_Metang, + [SPECIES_METAGROSS] = gMonIcon_Metagross, + [SPECIES_REGIROCK] = gMonIcon_Regirock, + [SPECIES_REGICE] = gMonIcon_Regice, + [SPECIES_REGISTEEL] = gMonIcon_Registeel, + [SPECIES_KYOGRE] = gMonIcon_Kyogre, + [SPECIES_GROUDON] = gMonIcon_Groudon, + [SPECIES_RAYQUAZA] = gMonIcon_Rayquaza, + [SPECIES_LATIAS] = gMonIcon_Latias, + [SPECIES_LATIOS] = gMonIcon_Latios, + [SPECIES_JIRACHI] = gMonIcon_Jirachi, + [SPECIES_DEOXYS] = gMonIcon_Deoxys, + [SPECIES_CHIMECHO] = gMonIcon_Chimecho, + [SPECIES_EGG] = gMonIcon_Egg, + [SPECIES_UNOWN_B] = gMonIcon_UnownB, + [SPECIES_UNOWN_C] = gMonIcon_UnownC, + [SPECIES_UNOWN_D] = gMonIcon_UnownD, + [SPECIES_UNOWN_E] = gMonIcon_UnownE, + [SPECIES_UNOWN_F] = gMonIcon_UnownF, + [SPECIES_UNOWN_G] = gMonIcon_UnownG, + [SPECIES_UNOWN_H] = gMonIcon_UnownH, + [SPECIES_UNOWN_I] = gMonIcon_UnownI, + [SPECIES_UNOWN_J] = gMonIcon_UnownJ, + [SPECIES_UNOWN_K] = gMonIcon_UnownK, + [SPECIES_UNOWN_L] = gMonIcon_UnownL, + [SPECIES_UNOWN_M] = gMonIcon_UnownM, + [SPECIES_UNOWN_N] = gMonIcon_UnownN, + [SPECIES_UNOWN_O] = gMonIcon_UnownO, + [SPECIES_UNOWN_P] = gMonIcon_UnownP, + [SPECIES_UNOWN_Q] = gMonIcon_UnownQ, + [SPECIES_UNOWN_R] = gMonIcon_UnownR, + [SPECIES_UNOWN_S] = gMonIcon_UnownS, + [SPECIES_UNOWN_T] = gMonIcon_UnownT, + [SPECIES_UNOWN_U] = gMonIcon_UnownU, + [SPECIES_UNOWN_V] = gMonIcon_UnownV, + [SPECIES_UNOWN_W] = gMonIcon_UnownW, + [SPECIES_UNOWN_X] = gMonIcon_UnownX, + [SPECIES_UNOWN_Y] = gMonIcon_UnownY, + [SPECIES_UNOWN_Z] = gMonIcon_UnownZ, + [SPECIES_UNOWN_EMARK] = gMonIcon_UnownExclamationMark, + [SPECIES_UNOWN_QMARK] = gMonIcon_UnownQuestionMark, }; const u8 gMonIconPaletteIndices[] = @@ -1138,7 +1138,7 @@ void sub_80D2EF8(struct Sprite *sprite) void LoadMonIconPalettes(void) { u8 i; - for (i = 0; i < 6; i++) + for (i = 0; i < ARRAY_COUNT(gMonIconPaletteTable); i++) LoadSpritePalette(&gMonIconPaletteTable[i]); } @@ -1192,7 +1192,7 @@ void sub_80D3014(struct Sprite *sprite) const u8* GetMonIconTiles(u16 species, bool32 extra) { const u8* iconSprite = gMonIconTable[species]; - if(species == SPECIES_DEOXYS && extra == TRUE) + if (species == SPECIES_DEOXYS && extra == TRUE) { iconSprite = (const u8*)(0x400 + (u32)iconSprite); //WTF? } @@ -1308,5 +1308,3 @@ void sub_80D32C8(struct Sprite *sprite, u8 animNum) sprite->animDelayCounter = 0; sprite->animCmdIndex = 0; } - - -- cgit v1.2.3 From 2745cdc7d26e84d7efc5349519a494610390e130 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Tue, 2 Apr 2019 18:02:43 +0200 Subject: Remove unneeded sMonAnimationDelayTable entries --- src/pokemon.c | 360 +--------------------------------------------------------- 1 file changed, 2 insertions(+), 358 deletions(-) (limited to 'src') diff --git a/src/pokemon.c b/src/pokemon.c index 7c26b4c22..984c484a2 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -1810,419 +1810,63 @@ static const u8 sMonFrontAnimIdsTable[] = [SPECIES_CHIMECHO - 1] = 0x1d, }; -static const u8 sMonAnimationDelayTable[] = -{ - [SPECIES_BULBASAUR - 1] = 0x00, - [SPECIES_IVYSAUR - 1] = 0x00, - [SPECIES_VENUSAUR - 1] = 0x00, - [SPECIES_CHARMANDER - 1] = 0x00, - [SPECIES_CHARMELEON - 1] = 0x00, - [SPECIES_CHARIZARD - 1] = 0x00, - [SPECIES_SQUIRTLE - 1] = 0x00, - [SPECIES_WARTORTLE - 1] = 0x00, +static const u8 sMonAnimationDelayTable[NUM_SPECIES - 1] = +{ [SPECIES_BLASTOISE - 1] = 0x32, - [SPECIES_CATERPIE - 1] = 0x00, - [SPECIES_METAPOD - 1] = 0x00, - [SPECIES_BUTTERFREE - 1] = 0x00, [SPECIES_WEEDLE - 1] = 0x0a, [SPECIES_KAKUNA - 1] = 0x14, [SPECIES_BEEDRILL - 1] = 0x23, - [SPECIES_PIDGEY - 1] = 0x00, [SPECIES_PIDGEOTTO - 1] = 0x19, - [SPECIES_PIDGEOT - 1] = 0x00, - [SPECIES_RATTATA - 1] = 0x00, - [SPECIES_RATICATE - 1] = 0x00, - [SPECIES_SPEAROW - 1] = 0x00, [SPECIES_FEAROW - 1] = 0x02, [SPECIES_EKANS - 1] = 0x1e, - [SPECIES_ARBOK - 1] = 0x00, - [SPECIES_PIKACHU - 1] = 0x00, - [SPECIES_RAICHU - 1] = 0x00, - [SPECIES_SANDSHREW - 1] = 0x00, - [SPECIES_SANDSLASH - 1] = 0x00, [SPECIES_NIDORAN_F - 1] = 0x1c, - [SPECIES_NIDORINA - 1] = 0x00, - [SPECIES_NIDOQUEEN - 1] = 0x00, - [SPECIES_NIDORAN_M - 1] = 0x00, - [SPECIES_NIDORINO - 1] = 0x00, [SPECIES_NIDOKING - 1] = 0x19, - [SPECIES_CLEFAIRY - 1] = 0x00, - [SPECIES_CLEFABLE - 1] = 0x00, - [SPECIES_VULPIX - 1] = 0x00, - [SPECIES_NINETALES - 1] = 0x00, - [SPECIES_JIGGLYPUFF - 1] = 0x00, - [SPECIES_WIGGLYTUFF - 1] = 0x00, - [SPECIES_ZUBAT - 1] = 0x00, - [SPECIES_GOLBAT - 1] = 0x00, - [SPECIES_ODDISH - 1] = 0x00, - [SPECIES_GLOOM - 1] = 0x00, - [SPECIES_VILEPLUME - 1] = 0x00, [SPECIES_PARAS - 1] = 0x0a, [SPECIES_PARASECT - 1] = 0x2d, [SPECIES_VENONAT - 1] = 0x14, - [SPECIES_VENOMOTH - 1] = 0x00, [SPECIES_DIGLETT - 1] = 0x19, [SPECIES_DUGTRIO - 1] = 0x23, [SPECIES_MEOWTH - 1] = 0x28, [SPECIES_PERSIAN - 1] = 0x14, - [SPECIES_PSYDUCK - 1] = 0x00, - [SPECIES_GOLDUCK - 1] = 0x00, [SPECIES_MANKEY - 1] = 0x14, - [SPECIES_PRIMEAPE - 1] = 0x00, [SPECIES_GROWLITHE - 1] = 0x1e, [SPECIES_ARCANINE - 1] = 0x28, - [SPECIES_POLIWAG - 1] = 0x00, [SPECIES_POLIWHIRL - 1] = 0x05, - [SPECIES_POLIWRATH - 1] = 0x00, - [SPECIES_ABRA - 1] = 0x00, - [SPECIES_KADABRA - 1] = 0x00, - [SPECIES_ALAKAZAM - 1] = 0x00, - [SPECIES_MACHOP - 1] = 0x00, - [SPECIES_MACHOKE - 1] = 0x00, - [SPECIES_MACHAMP - 1] = 0x00, - [SPECIES_BELLSPROUT - 1] = 0x00, [SPECIES_WEEPINBELL - 1] = 0x03, - [SPECIES_VICTREEBEL - 1] = 0x00, - [SPECIES_TENTACOOL - 1] = 0x00, - [SPECIES_TENTACRUEL - 1] = 0x00, - [SPECIES_GEODUDE - 1] = 0x00, - [SPECIES_GRAVELER - 1] = 0x00, - [SPECIES_GOLEM - 1] = 0x00, - [SPECIES_PONYTA - 1] = 0x00, - [SPECIES_RAPIDASH - 1] = 0x00, - [SPECIES_SLOWPOKE - 1] = 0x00, - [SPECIES_SLOWBRO - 1] = 0x00, - [SPECIES_MAGNEMITE - 1] = 0x00, - [SPECIES_MAGNETON - 1] = 0x00, - [SPECIES_FARFETCHD - 1] = 0x00, - [SPECIES_DODUO - 1] = 0x00, - [SPECIES_DODRIO - 1] = 0x00, - [SPECIES_SEEL - 1] = 0x00, - [SPECIES_DEWGONG - 1] = 0x00, - [SPECIES_GRIMER - 1] = 0x00, [SPECIES_MUK - 1] = 0x2d, [SPECIES_SHELLDER - 1] = 0x14, - [SPECIES_CLOYSTER - 1] = 0x00, - [SPECIES_GASTLY - 1] = 0x00, [SPECIES_HAUNTER - 1] = 0x17, - [SPECIES_GENGAR - 1] = 0x00, - [SPECIES_ONIX - 1] = 0x00, [SPECIES_DROWZEE - 1] = 0x30, [SPECIES_HYPNO - 1] = 0x28, - [SPECIES_KRABBY - 1] = 0x00, - [SPECIES_KINGLER - 1] = 0x00, - [SPECIES_VOLTORB - 1] = 0x00, - [SPECIES_ELECTRODE - 1] = 0x00, - [SPECIES_EXEGGCUTE - 1] = 0x00, - [SPECIES_EXEGGUTOR - 1] = 0x00, - [SPECIES_CUBONE - 1] = 0x00, - [SPECIES_MAROWAK - 1] = 0x00, - [SPECIES_HITMONLEE - 1] = 0x00, [SPECIES_HITMONCHAN - 1] = 0x19, - [SPECIES_LICKITUNG - 1] = 0x00, - [SPECIES_KOFFING - 1] = 0x00, - [SPECIES_WEEZING - 1] = 0x00, - [SPECIES_RHYHORN - 1] = 0x00, - [SPECIES_RHYDON - 1] = 0x00, - [SPECIES_CHANSEY - 1] = 0x00, - [SPECIES_TANGELA - 1] = 0x00, - [SPECIES_KANGASKHAN - 1] = 0x00, - [SPECIES_HORSEA - 1] = 0x00, - [SPECIES_SEADRA - 1] = 0x00, - [SPECIES_GOLDEEN - 1] = 0x00, - [SPECIES_SEAKING - 1] = 0x00, - [SPECIES_STARYU - 1] = 0x00, - [SPECIES_STARMIE - 1] = 0x00, - [SPECIES_MR_MIME - 1] = 0x00, [SPECIES_SCYTHER - 1] = 0x0a, - [SPECIES_JYNX - 1] = 0x00, - [SPECIES_ELECTABUZZ - 1] = 0x00, - [SPECIES_MAGMAR - 1] = 0x00, - [SPECIES_PINSIR - 1] = 0x00, [SPECIES_TAUROS - 1] = 0x0a, - [SPECIES_MAGIKARP - 1] = 0x00, - [SPECIES_GYARADOS - 1] = 0x00, - [SPECIES_LAPRAS - 1] = 0x00, - [SPECIES_DITTO - 1] = 0x00, - [SPECIES_EEVEE - 1] = 0x00, - [SPECIES_VAPOREON - 1] = 0x00, - [SPECIES_JOLTEON - 1] = 0x00, - [SPECIES_FLAREON - 1] = 0x00, - [SPECIES_PORYGON - 1] = 0x00, - [SPECIES_OMANYTE - 1] = 0x00, - [SPECIES_OMASTAR - 1] = 0x00, - [SPECIES_KABUTO - 1] = 0x00, - [SPECIES_KABUTOPS - 1] = 0x00, - [SPECIES_AERODACTYL - 1] = 0x00, - [SPECIES_SNORLAX - 1] = 0x00, - [SPECIES_ARTICUNO - 1] = 0x00, - [SPECIES_ZAPDOS - 1] = 0x00, - [SPECIES_MOLTRES - 1] = 0x00, - [SPECIES_DRATINI - 1] = 0x00, - [SPECIES_DRAGONAIR - 1] = 0x00, - [SPECIES_DRAGONITE - 1] = 0x00, - [SPECIES_MEWTWO - 1] = 0x00, - [SPECIES_MEW - 1] = 0x00, - [SPECIES_CHIKORITA - 1] = 0x00, - [SPECIES_BAYLEEF - 1] = 0x00, - [SPECIES_MEGANIUM - 1] = 0x00, - [SPECIES_CYNDAQUIL - 1] = 0x00, - [SPECIES_QUILAVA - 1] = 0x00, [SPECIES_TYPHLOSION - 1] = 0x14, - [SPECIES_TOTODILE - 1] = 0x00, - [SPECIES_CROCONAW - 1] = 0x00, [SPECIES_FERALIGATR - 1] = 0x05, - [SPECIES_SENTRET - 1] = 0x00, - [SPECIES_FURRET - 1] = 0x00, - [SPECIES_HOOTHOOT - 1] = 0x00, - [SPECIES_NOCTOWL - 1] = 0x00, - [SPECIES_LEDYBA - 1] = 0x00, - [SPECIES_LEDIAN - 1] = 0x00, - [SPECIES_SPINARAK - 1] = 0x00, - [SPECIES_ARIADOS - 1] = 0x00, - [SPECIES_CROBAT - 1] = 0x00, - [SPECIES_CHINCHOU - 1] = 0x00, - [SPECIES_LANTURN - 1] = 0x00, - [SPECIES_PICHU - 1] = 0x00, - [SPECIES_CLEFFA - 1] = 0x00, - [SPECIES_IGGLYBUFF - 1] = 0x00, - [SPECIES_TOGEPI - 1] = 0x00, - [SPECIES_TOGETIC - 1] = 0x00, [SPECIES_NATU - 1] = 0x1e, - [SPECIES_XATU - 1] = 0x00, [SPECIES_MAREEP - 1] = 0x32, - [SPECIES_FLAAFFY - 1] = 0x00, [SPECIES_AMPHAROS - 1] = 0x0a, - [SPECIES_BELLOSSOM - 1] = 0x00, - [SPECIES_MARILL - 1] = 0x00, - [SPECIES_AZUMARILL - 1] = 0x00, - [SPECIES_SUDOWOODO - 1] = 0x00, [SPECIES_POLITOED - 1] = 0x28, - [SPECIES_HOPPIP - 1] = 0x00, - [SPECIES_SKIPLOOM - 1] = 0x00, - [SPECIES_JUMPLUFF - 1] = 0x00, - [SPECIES_AIPOM - 1] = 0x00, - [SPECIES_SUNKERN - 1] = 0x00, - [SPECIES_SUNFLORA - 1] = 0x00, - [SPECIES_YANMA - 1] = 0x00, - [SPECIES_WOOPER - 1] = 0x00, - [SPECIES_QUAGSIRE - 1] = 0x00, - [SPECIES_ESPEON - 1] = 0x00, - [SPECIES_UMBREON - 1] = 0x00, - [SPECIES_MURKROW - 1] = 0x00, - [SPECIES_SLOWKING - 1] = 0x00, - [SPECIES_MISDREAVUS - 1] = 0x00, - [SPECIES_UNOWN - 1] = 0x00, - [SPECIES_WOBBUFFET - 1] = 0x00, - [SPECIES_GIRAFARIG - 1] = 0x00, - [SPECIES_PINECO - 1] = 0x00, - [SPECIES_FORRETRESS - 1] = 0x00, [SPECIES_DUNSPARCE - 1] = 0x0a, - [SPECIES_GLIGAR - 1] = 0x00, [SPECIES_STEELIX - 1] = 0x2d, - [SPECIES_SNUBBULL - 1] = 0x00, - [SPECIES_GRANBULL - 1] = 0x00, [SPECIES_QWILFISH - 1] = 0x27, [SPECIES_SCIZOR - 1] = 0x13, - [SPECIES_SHUCKLE - 1] = 0x00, - [SPECIES_HERACROSS - 1] = 0x00, - [SPECIES_SNEASEL - 1] = 0x00, - [SPECIES_TEDDIURSA - 1] = 0x00, - [SPECIES_URSARING - 1] = 0x00, - [SPECIES_SLUGMA - 1] = 0x00, - [SPECIES_MAGCARGO - 1] = 0x00, - [SPECIES_SWINUB - 1] = 0x00, - [SPECIES_PILOSWINE - 1] = 0x00, - [SPECIES_CORSOLA - 1] = 0x00, - [SPECIES_REMORAID - 1] = 0x00, [SPECIES_OCTILLERY - 1] = 0x14, - [SPECIES_DELIBIRD - 1] = 0x00, - [SPECIES_MANTINE - 1] = 0x00, - [SPECIES_SKARMORY - 1] = 0x00, - [SPECIES_HOUNDOUR - 1] = 0x00, - [SPECIES_HOUNDOOM - 1] = 0x00, - [SPECIES_KINGDRA - 1] = 0x00, - [SPECIES_PHANPY - 1] = 0x00, - [SPECIES_DONPHAN - 1] = 0x00, - [SPECIES_PORYGON2 - 1] = 0x00, - [SPECIES_STANTLER - 1] = 0x00, - [SPECIES_SMEARGLE - 1] = 0x00, - [SPECIES_TYROGUE - 1] = 0x00, - [SPECIES_HITMONTOP - 1] = 0x00, [SPECIES_SMOOCHUM - 1] = 0x28, - [SPECIES_ELEKID - 1] = 0x00, - [SPECIES_MAGBY - 1] = 0x00, - [SPECIES_MILTANK - 1] = 0x00, - [SPECIES_BLISSEY - 1] = 0x00, - [SPECIES_RAIKOU - 1] = 0x00, - [SPECIES_ENTEI - 1] = 0x00, - [SPECIES_SUICUNE - 1] = 0x00, - [SPECIES_LARVITAR - 1] = 0x00, - [SPECIES_PUPITAR - 1] = 0x00, [SPECIES_TYRANITAR - 1] = 0x0a, [SPECIES_LUGIA - 1] = 0x14, - [SPECIES_HO_OH - 1] = 0x00, - [SPECIES_CELEBI - 1] = 0x00, - [SPECIES_OLD_UNOWN_B - 1] = 0x00, - [SPECIES_OLD_UNOWN_C - 1] = 0x00, - [SPECIES_OLD_UNOWN_D - 1] = 0x00, - [SPECIES_OLD_UNOWN_E - 1] = 0x00, - [SPECIES_OLD_UNOWN_F - 1] = 0x00, - [SPECIES_OLD_UNOWN_G - 1] = 0x00, - [SPECIES_OLD_UNOWN_H - 1] = 0x00, - [SPECIES_OLD_UNOWN_I - 1] = 0x00, - [SPECIES_OLD_UNOWN_J - 1] = 0x00, - [SPECIES_OLD_UNOWN_K - 1] = 0x00, - [SPECIES_OLD_UNOWN_L - 1] = 0x00, - [SPECIES_OLD_UNOWN_M - 1] = 0x00, - [SPECIES_OLD_UNOWN_N - 1] = 0x00, - [SPECIES_OLD_UNOWN_O - 1] = 0x00, - [SPECIES_OLD_UNOWN_P - 1] = 0x00, - [SPECIES_OLD_UNOWN_Q - 1] = 0x00, - [SPECIES_OLD_UNOWN_R - 1] = 0x00, - [SPECIES_OLD_UNOWN_S - 1] = 0x00, - [SPECIES_OLD_UNOWN_T - 1] = 0x00, - [SPECIES_OLD_UNOWN_U - 1] = 0x00, - [SPECIES_OLD_UNOWN_V - 1] = 0x00, - [SPECIES_OLD_UNOWN_W - 1] = 0x00, - [SPECIES_OLD_UNOWN_X - 1] = 0x00, - [SPECIES_OLD_UNOWN_Y - 1] = 0x00, - [SPECIES_OLD_UNOWN_Z - 1] = 0x00, - [SPECIES_TREECKO - 1] = 0x00, - [SPECIES_GROVYLE - 1] = 0x00, - [SPECIES_SCEPTILE - 1] = 0x00, - [SPECIES_TORCHIC - 1] = 0x00, - [SPECIES_COMBUSKEN - 1] = 0x00, - [SPECIES_BLAZIKEN - 1] = 0x00, - [SPECIES_MUDKIP - 1] = 0x00, - [SPECIES_MARSHTOMP - 1] = 0x00, - [SPECIES_SWAMPERT - 1] = 0x00, - [SPECIES_POOCHYENA - 1] = 0x00, - [SPECIES_MIGHTYENA - 1] = 0x00, - [SPECIES_ZIGZAGOON - 1] = 0x00, - [SPECIES_LINOONE - 1] = 0x00, - [SPECIES_WURMPLE - 1] = 0x00, - [SPECIES_SILCOON - 1] = 0x00, - [SPECIES_BEAUTIFLY - 1] = 0x00, - [SPECIES_CASCOON - 1] = 0x00, - [SPECIES_DUSTOX - 1] = 0x00, - [SPECIES_LOTAD - 1] = 0x00, - [SPECIES_LOMBRE - 1] = 0x00, - [SPECIES_LUDICOLO - 1] = 0x00, - [SPECIES_SEEDOT - 1] = 0x00, - [SPECIES_NUZLEAF - 1] = 0x00, - [SPECIES_SHIFTRY - 1] = 0x00, - [SPECIES_NINCADA - 1] = 0x00, - [SPECIES_NINJASK - 1] = 0x00, - [SPECIES_SHEDINJA - 1] = 0x00, - [SPECIES_TAILLOW - 1] = 0x00, - [SPECIES_SWELLOW - 1] = 0x00, - [SPECIES_SHROOMISH - 1] = 0x00, - [SPECIES_BRELOOM - 1] = 0x00, - [SPECIES_SPINDA - 1] = 0x00, - [SPECIES_WINGULL - 1] = 0x00, - [SPECIES_PELIPPER - 1] = 0x00, - [SPECIES_SURSKIT - 1] = 0x00, - [SPECIES_MASQUERAIN - 1] = 0x00, - [SPECIES_WAILMER - 1] = 0x00, [SPECIES_WAILORD - 1] = 0x0a, - [SPECIES_SKITTY - 1] = 0x00, - [SPECIES_DELCATTY - 1] = 0x00, [SPECIES_KECLEON - 1] = 0x1e, - [SPECIES_BALTOY - 1] = 0x00, - [SPECIES_CLAYDOL - 1] = 0x00, - [SPECIES_NOSEPASS - 1] = 0x00, - [SPECIES_TORKOAL - 1] = 0x00, - [SPECIES_SABLEYE - 1] = 0x00, - [SPECIES_BARBOACH - 1] = 0x00, - [SPECIES_WHISCASH - 1] = 0x00, - [SPECIES_LUVDISC - 1] = 0x00, - [SPECIES_CORPHISH - 1] = 0x00, - [SPECIES_CRAWDAUNT - 1] = 0x00, - [SPECIES_FEEBAS - 1] = 0x00, [SPECIES_MILOTIC - 1] = 0x2d, - [SPECIES_CARVANHA - 1] = 0x00, - [SPECIES_SHARPEDO - 1] = 0x00, - [SPECIES_TRAPINCH - 1] = 0x00, - [SPECIES_VIBRAVA - 1] = 0x00, - [SPECIES_FLYGON - 1] = 0x00, - [SPECIES_MAKUHITA - 1] = 0x00, - [SPECIES_HARIYAMA - 1] = 0x00, - [SPECIES_ELECTRIKE - 1] = 0x00, - [SPECIES_MANECTRIC - 1] = 0x00, - [SPECIES_NUMEL - 1] = 0x00, - [SPECIES_CAMERUPT - 1] = 0x00, [SPECIES_SPHEAL - 1] = 0x0f, - [SPECIES_SEALEO - 1] = 0x00, - [SPECIES_WALREIN - 1] = 0x00, - [SPECIES_CACNEA - 1] = 0x00, - [SPECIES_CACTURNE - 1] = 0x00, [SPECIES_SNORUNT - 1] = 0x14, - [SPECIES_GLALIE - 1] = 0x00, - [SPECIES_LUNATONE - 1] = 0x00, - [SPECIES_SOLROCK - 1] = 0x00, - [SPECIES_AZURILL - 1] = 0x00, - [SPECIES_SPOINK - 1] = 0x00, [SPECIES_GRUMPIG - 1] = 0x0f, - [SPECIES_PLUSLE - 1] = 0x00, - [SPECIES_MINUN - 1] = 0x00, - [SPECIES_MAWILE - 1] = 0x00, - [SPECIES_MEDITITE - 1] = 0x00, - [SPECIES_MEDICHAM - 1] = 0x00, - [SPECIES_SWABLU - 1] = 0x00, - [SPECIES_ALTARIA - 1] = 0x00, [SPECIES_WYNAUT - 1] = 0x0f, - [SPECIES_DUSKULL - 1] = 0x00, [SPECIES_DUSCLOPS - 1] = 0x1e, - [SPECIES_ROSELIA - 1] = 0x00, - [SPECIES_SLAKOTH - 1] = 0x00, - [SPECIES_VIGOROTH - 1] = 0x00, - [SPECIES_SLAKING - 1] = 0x00, - [SPECIES_GULPIN - 1] = 0x00, - [SPECIES_SWALOT - 1] = 0x00, - [SPECIES_TROPIUS - 1] = 0x00, - [SPECIES_WHISMUR - 1] = 0x00, - [SPECIES_LOUDRED - 1] = 0x00, - [SPECIES_EXPLOUD - 1] = 0x00, - [SPECIES_CLAMPERL - 1] = 0x00, - [SPECIES_HUNTAIL - 1] = 0x00, - [SPECIES_GOREBYSS - 1] = 0x00, [SPECIES_ABSOL - 1] = 0x2d, - [SPECIES_SHUPPET - 1] = 0x00, - [SPECIES_BANETTE - 1] = 0x00, - [SPECIES_SEVIPER - 1] = 0x00, - [SPECIES_ZANGOOSE - 1] = 0x00, - [SPECIES_RELICANTH - 1] = 0x00, - [SPECIES_ARON - 1] = 0x00, - [SPECIES_LAIRON - 1] = 0x00, - [SPECIES_AGGRON - 1] = 0x00, - [SPECIES_CASTFORM - 1] = 0x00, - [SPECIES_VOLBEAT - 1] = 0x00, - [SPECIES_ILLUMISE - 1] = 0x00, - [SPECIES_LILEEP - 1] = 0x00, - [SPECIES_CRADILY - 1] = 0x00, - [SPECIES_ANORITH - 1] = 0x00, - [SPECIES_ARMALDO - 1] = 0x00, - [SPECIES_RALTS - 1] = 0x00, - [SPECIES_KIRLIA - 1] = 0x00, - [SPECIES_GARDEVOIR - 1] = 0x00, - [SPECIES_BAGON - 1] = 0x00, - [SPECIES_SHELGON - 1] = 0x00, [SPECIES_SALAMENCE - 1] = 0x46, - [SPECIES_BELDUM - 1] = 0x00, - [SPECIES_METANG - 1] = 0x00, - [SPECIES_METAGROSS - 1] = 0x00, - [SPECIES_REGIROCK - 1] = 0x00, - [SPECIES_REGICE - 1] = 0x00, - [SPECIES_REGISTEEL - 1] = 0x00, [SPECIES_KYOGRE - 1] = 0x3c, - [SPECIES_GROUDON - 1] = 0x00, [SPECIES_RAYQUAZA - 1] = 0x3c, - [SPECIES_LATIAS - 1] = 0x00, - [SPECIES_LATIOS - 1] = 0x00, - [SPECIES_JIRACHI - 1] = 0x00, - [SPECIES_DEOXYS - 1] = 0x00, - [SPECIES_CHIMECHO - 1] = 0x00, }; const u8 gPPUpGetMask[] = {0x03, 0x0c, 0x30, 0xc0}; // Masks for getting PP Up count, also PP Max values -- cgit v1.2.3 From baa187665b102b0210ecd7296aaaf0de512d3e87 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Tue, 2 Apr 2019 13:35:52 +0200 Subject: Document a bit of script menu and battle anims --- src/ghost.c | 106 ++++++++++++++++++++----------------- src/mauville_old_man.c | 2 +- src/menu.c | 14 +++-- src/script_menu.c | 107 ++++++++++++++++++-------------------- src/script_pokemon_util_80F87D8.c | 2 +- 5 files changed, 116 insertions(+), 115 deletions(-) (limited to 'src') diff --git a/src/ghost.c b/src/ghost.c index 998be0caa..97b86aa76 100644 --- a/src/ghost.c +++ b/src/ghost.c @@ -87,7 +87,7 @@ const union AffineAnimCmd *const gUnknown_08596D54[] = gUnknown_08596D44, }; -const struct SpriteTemplate gUnknown_08596D58 = +const struct SpriteTemplate gShadowBallSpriteTemplate = { .tileTag = ANIM_TAG_SHADOW_BALL, .paletteTag = ANIM_TAG_SHADOW_BALL, @@ -261,20 +261,20 @@ static void sub_81116E8(struct Sprite *sprite) AnimTranslateLinear(sprite); sprite->pos2.x += Sin(sprite->data[5], 10); sprite->pos2.y += Cos(sprite->data[5], 15); - + r2 = sprite->data[5]; sprite->data[5] = (sprite->data[5] + 5) & 0xFF; r0 = sprite->data[5]; - + if (r2 == 0 || r2 > 196) { if (r0 > 0) PlaySE(SE_W109); } - + if (sprite->data[6] == 0) { - sprite->invisible = TRUE; + sprite->invisible = TRUE; sprite->callback = DestroyAnimSpriteAndDisableBlend; } else @@ -283,18 +283,18 @@ static void sub_81116E8(struct Sprite *sprite) static void sub_8111764(struct Sprite *sprite) { - - s16 r0; + + s16 r0; if (sprite->data[6] > 0xFF) { if (++sprite->data[6] == 0x10d) sprite->data[6] = 0; return; } - + r0 = sprite->data[7]; sprite->data[7]++; - + if ((r0 & 0xFF) == 0) { sprite->data[7] &= 0xff00; @@ -392,16 +392,16 @@ static void sub_811196C(u8 taskId) } } -// Spins a sprite towards the target, pausing in the middle. -// Used in Shadow Ball. +// Spins a sprite towards the target, pausing in the middle. +// Used in Shadow Ball. // arg 0: duration step 1 (attacker -> center) // arg 1: duration step 2 (spin center) // arg 2: duration step 3 (center -> target) static void InitAnimShadowBall(struct Sprite *sprite) { - u16 r5, r6; - r5 = sprite->pos1.x; - r6 = sprite->pos1.y; + s16 oldPosX = sprite->pos1.x; + s16 oldPosY = sprite->pos1.y; + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); sprite->data[0] = 0; @@ -410,8 +410,8 @@ static void InitAnimShadowBall(struct Sprite *sprite) sprite->data[3] = gBattleAnimArgs[2]; sprite->data[4] = sprite->pos1.x << 4; sprite->data[5] = sprite->pos1.y << 4; - sprite->data[6] = (((s16)r5 - sprite->pos1.x) << 4) / (gBattleAnimArgs[0] << 1); - sprite->data[7] = (((s16)r6 - sprite->pos1.y) << 4) / (gBattleAnimArgs[0] << 1); + sprite->data[6] = ((oldPosX - sprite->pos1.x) << 4) / (gBattleAnimArgs[0] << 1); + sprite->data[7] = ((oldPosY - sprite->pos1.y) << 4) / (gBattleAnimArgs[0] << 1); sprite->callback = AnimShadowBallStep; } @@ -465,50 +465,57 @@ static void sub_8111B9C(struct Sprite *sprite) sprite->callback = sub_8111BB4; } -static void sub_8111BB4(struct Sprite *sprite) { - - s8 r5 = FALSE; +static void sub_8111BB4(struct Sprite *sprite) +{ + bool8 r5 = FALSE; bool8 r6 = FALSE; - if(sprite->animEnded) + + if (sprite->animEnded) { - if(!(sprite->invisible)) - sprite->invisible=TRUE; - switch(sprite->data[0]) + if (!sprite->invisible) + sprite->invisible = TRUE; + + switch (sprite->data[0]) { - case 0: - if((sprite->data[1]) != 2) - break; - goto loc_08111C06; - case 1: - if((sprite->data[1]) == 4) - r5 = TRUE; - break; - default: - r6 = TRUE; + default: + r6 = TRUE; + break; + case 0: + if (sprite->data[1] == 2) + r5 = TRUE; + break; + case 1: + if (sprite->data[1] == 4) + r5 = TRUE; + break; } - if(r5) + + if (r5) { - loc_08111C06: sprite->invisible ^= 1; sprite->data[2]++; sprite->data[1] = 0; - if(sprite->data[2] == 5) + if (sprite->data[2] == 5) { sprite->data[2] = 0; sprite->data[0]++; } } - else if(r6) + else if (r6) + { DestroyAnimSprite(sprite); + } else + { sprite->data[1]++; + } } } void sub_8111C50(u8 taskId) { struct Task *task; - + task = &gTasks[taskId]; task->data[0] = CloneBattlerSpriteWithBlend(1); if (task->data[0] < 0) @@ -523,7 +530,7 @@ void sub_8111C50(u8 taskId) SetGpuReg(REG_OFFSET_BLDCNT, (BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_ALL)); SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(task->data[2], task->data[3])); gSprites[task->data[0]].data[0] = 80; - if (GetBattlerSide(gBattleAnimTarget) == 0) + if (GetBattlerSide(gBattleAnimTarget) == B_SIDE_PLAYER) { gSprites[task->data[0]].data[1] = -144; gSprites[task->data[0]].data[2] = 112; @@ -573,6 +580,7 @@ static void sub_8111D78(u8 taskId) break; case 2: DestroyAnimVisualTask(taskId); + break; } } @@ -595,7 +603,7 @@ static void sub_8111E78(u8 taskId) switch (task->data[15]) { case 0: - task->data[14] = AllocSpritePalette(0x2771); + task->data[14] = AllocSpritePalette(ANIM_TAG_BENT_SPOON); if (task->data[14] == 0xFF || task->data[14] == 0xF) { DestroyAnimVisualTask(taskId); @@ -605,7 +613,7 @@ static void sub_8111E78(u8 taskId) task->data[0] = CloneBattlerSpriteWithBlend(1); if (task->data[0] < 0) { - FreeSpritePaletteByTag(0x2771); + FreeSpritePaletteByTag(ANIM_TAG_BENT_SPOON); DestroyAnimVisualTask(taskId); } else @@ -698,14 +706,14 @@ static void sub_81120DC(u8 taskId) static void sub_8112170(u8 taskId) { struct Task *task = &gTasks[taskId]; - u8 position = GetBattlerSpriteBGPriorityRank(gBattleAnimTarget); + u8 rank = GetBattlerSpriteBGPriorityRank(gBattleAnimTarget); switch (task->data[15]) { case 0: gScanlineEffect.state = 3; task->data[14] = GetAnimBattlerSpriteId(1); - if (position == 1) + if (rank == 1) ClearGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_BG1_ON); else ClearGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_BG2_ON); @@ -714,12 +722,12 @@ static void sub_8112170(u8 taskId) BlendPalette(task->data[4], 16, 0, RGB(13, 0, 15)); break; case 2: - gSprites[task->data[14]].invisible = 1; + gSprites[task->data[14]].invisible = TRUE; obj_delete_but_dont_free_vram(&gSprites[task->data[0]]); - FreeSpritePaletteByTag(0x2771); + FreeSpritePaletteByTag(ANIM_TAG_BENT_SPOON); SetGpuReg(REG_OFFSET_BLDCNT, 0); SetGpuReg(REG_OFFSET_BLDALPHA, 0); - if (position == 1) + if (rank == 1) SetGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_BG1_ON); else SetGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_BG2_ON); @@ -886,7 +894,7 @@ static void sub_81125E0(u8 taskId) } } } - + if (task->data[10]) task->data[10]--; else if (task->data[6]) @@ -1081,7 +1089,7 @@ static void sub_8112ACC(struct Sprite *sprite) if (sprite->data[0] == 0) { SetGpuReg(REG_OFFSET_BLDCNT, (BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_ALL)); - SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(0x10, 0)); + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(16, 0)); sprite->data[0]++; sprite->data[1] = 0; sprite->data[2] = 0; @@ -1120,7 +1128,7 @@ static void sub_8112B78(struct Sprite *sprite) sprite->pos2.x = Sin(sprite->data[0], 12); if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) sprite->pos2.x = -sprite->pos2.x; - + sprite->data[0] = (sprite->data[0] + 6) & 0xFF; sprite->data[1] += 0x100; sprite->pos2.y = -(sprite->data[1] >> 8); diff --git a/src/mauville_old_man.c b/src/mauville_old_man.c index ddd3f931e..8bb9cb6e4 100644 --- a/src/mauville_old_man.c +++ b/src/mauville_old_man.c @@ -1193,7 +1193,7 @@ static void Task_StoryListMenu(u8 taskId) // Task_StoryListMenu gSpecialVar_Result = 1; sSelectedStory = selection; } - sub_80E2A78(sStorytellerWindowId); + ClearToTransparentAndRemoveWindow(sStorytellerWindowId); DestroyTask(taskId); EnableBothScriptContexts(); break; diff --git a/src/menu.c b/src/menu.c index 958788b25..80d440771 100644 --- a/src/menu.c +++ b/src/menu.c @@ -1661,16 +1661,14 @@ void CreateYesNoMenu(const struct WindowTemplate *window, u16 baseTileNum, u8 pa InitMenuInUpperLeftCornerPlaySoundWhenAPressed(sYesNoWindowId, 2, initialCursorPos); } -void sub_81997AC(u8 windowId, u8 a4, u8 a6, u8 a7, const struct MenuAction *strs) +void PrintMenuGridTable(u8 windowId, u8 optionWidth, u8 horizontalCount, u8 verticalCount, const struct MenuAction *strs) { - u32 i; - u32 j; - for (i = 0; i < a7; i++) + u32 i, j; + + for (i = 0; i < verticalCount; i++) { - for (j = 0; j < a6; j++) - { - AddTextPrinterParameterized(windowId, 1, strs[(i * a6) + j].text, (a4 * j) + 8, (i * 16) + 1, 0xFF, NULL); - } + for (j = 0; j < horizontalCount; j++) + AddTextPrinterParameterized(windowId, 1, strs[(i * horizontalCount) + j].text, (optionWidth * j) + 8, (i * 16) + 1, 0xFF, NULL); } CopyWindowToVram(windowId, 2); } diff --git a/src/script_menu.c b/src/script_menu.c index c7523a370..082253e35 100644 --- a/src/script_menu.c +++ b/src/script_menu.c @@ -1183,7 +1183,7 @@ static void Task_HandleMultichoiceInput(u8 taskId) { gSpecialVar_Result = selection; } - sub_80E2A78(tWindowId); + ClearToTransparentAndRemoveWindow(tWindowId); DestroyTask(taskId); EnableBothScriptContexts(); } @@ -1219,8 +1219,6 @@ bool8 IsScriptActive(void) static void Task_HandleYesNoInput(u8 taskId) { - u8 left, top; - if (gTasks[taskId].tRight < 5) { gTasks[taskId].tRight++; @@ -1229,9 +1227,9 @@ static void Task_HandleYesNoInput(u8 taskId) switch (Menu_ProcessInputNoWrapClearOnChoose()) { - case -2: + case MENU_NOTHING_CHOSEN: return; - case -1: + case MENU_B_PRESSED: case 1: PlaySE(SE_SELECT); gSpecialVar_Result = 0; @@ -1247,8 +1245,6 @@ static void Task_HandleYesNoInput(u8 taskId) bool8 ScriptMenu_MultichoiceGrid(u8 left, u8 top, u8 multichoiceId, u8 ignoreBPress, u8 columnCount) { - u8 bottom = 0; - if (FuncIsActiveTask(Task_HandleMultichoiceGridInput) == TRUE) { return FALSE; @@ -1256,10 +1252,8 @@ bool8 ScriptMenu_MultichoiceGrid(u8 left, u8 top, u8 multichoiceId, u8 ignoreBPr else { u8 taskId; - u8 unk2; - int width; - int i; - u8 newWidth; + u8 rowCount, newWidth; + int i, width; gSpecialVar_Result = 0xFF; width = 0; @@ -1272,15 +1266,15 @@ bool8 ScriptMenu_MultichoiceGrid(u8 left, u8 top, u8 multichoiceId, u8 ignoreBPr newWidth = convert_pixel_width_to_tile_width(width); left = sub_80E2D5C(left, columnCount * newWidth); - unk2 = gMultichoiceLists[multichoiceId].count / columnCount; + rowCount = gMultichoiceLists[multichoiceId].count / columnCount; taskId = CreateTask(Task_HandleMultichoiceGridInput, 80); gTasks[taskId].tIgnoreBPress = ignoreBPress; - gTasks[taskId].tWindowId = CreateWindowFromRect(left, top, columnCount * newWidth, unk2 * 2); + gTasks[taskId].tWindowId = CreateWindowFromRect(left, top, columnCount * newWidth, rowCount * 2); SetStandardWindowBorderStyle(gTasks[taskId].tWindowId, 0); - sub_81997AC(gTasks[taskId].tWindowId, newWidth * 8, columnCount, unk2, gMultichoiceLists[multichoiceId].list); - sub_8199944(gTasks[taskId].tWindowId, newWidth * 8, columnCount, unk2, 0); + PrintMenuGridTable(gTasks[taskId].tWindowId, newWidth * 8, columnCount, rowCount, gMultichoiceLists[multichoiceId].list); + sub_8199944(gTasks[taskId].tWindowId, newWidth * 8, columnCount, rowCount, 0); CopyWindowToVram(gTasks[taskId].tWindowId, 3); return TRUE; } @@ -1291,23 +1285,24 @@ static void Task_HandleMultichoiceGridInput(u8 taskId) s16 *data = gTasks[taskId].data; s8 selection = Menu_ProcessInputGridLayout(); - if (selection != -2) + switch (selection) { - if (selection == -1) - { - if (tIgnoreBPress) - return; - PlaySE(SE_SELECT); - gSpecialVar_Result = 0x7F; - } - else - { - gSpecialVar_Result = selection; - } - sub_80E2A78(tWindowId); - DestroyTask(taskId); - EnableBothScriptContexts(); + case MENU_NOTHING_CHOSEN: + return; + case MENU_B_PRESSED: + if (tIgnoreBPress) + return; + PlaySE(SE_SELECT); + gSpecialVar_Result = 0x7F; + break; + default: + gSpecialVar_Result = selection; + break; } + + ClearToTransparentAndRemoveWindow(tWindowId); + DestroyTask(taskId); + EnableBothScriptContexts(); } #undef tWindowId @@ -1564,7 +1559,7 @@ static void Task_PokemonPicWindow(u8 taskId) task->tState++; break; case 3: - sub_80E2A78(task->tWindowId); + ClearToTransparentAndRemoveWindow(task->tWindowId); DestroyTask(taskId); break; } @@ -1628,7 +1623,7 @@ u8 CreateWindowFromRect(u8 x, u8 y, u8 width, u8 height) return windowId; } -void sub_80E2A78(u8 windowId) +void ClearToTransparentAndRemoveWindow(u8 windowId) { ClearStdWindowAndFrameToTransparent(windowId, TRUE); RemoveWindow(windowId); @@ -1638,30 +1633,30 @@ static void sub_80E2A94(u8 multichoiceId) { switch (multichoiceId) { - case 77: - FillWindowPixelBuffer(0, PIXEL_FILL(1)); - AddTextPrinterParameterized2(0, 1, gUnknown_0858BBAC[Menu_GetCursorPos()], 0, NULL, 2, 1, 3); - break; - case 76: - FillWindowPixelBuffer(0, PIXEL_FILL(1)); - AddTextPrinterParameterized2(0, 1, gUnknown_0858BB9C[Menu_GetCursorPos()], 0, NULL, 2, 1, 3); - break; - case 78: - FillWindowPixelBuffer(0, PIXEL_FILL(1)); - AddTextPrinterParameterized2(0, 1, gUnknown_0858BBBC[Menu_GetCursorPos()], 0, NULL, 2, 1, 3); - break; - case 79: - FillWindowPixelBuffer(0, PIXEL_FILL(1)); - AddTextPrinterParameterized2(0, 1, gUnknown_0858BBCC[Menu_GetCursorPos()], 0, NULL, 2, 1, 3); - break; - case 75: - FillWindowPixelBuffer(0, PIXEL_FILL(1)); - AddTextPrinterParameterized2(0, 1, gUnknown_0858BBEC[Menu_GetCursorPos()], 0, NULL, 2, 1, 3); - break; - case 74: - FillWindowPixelBuffer(0, PIXEL_FILL(1)); - AddTextPrinterParameterized2(0, 1, gUnknown_0858BBE0[Menu_GetCursorPos()], 0, NULL, 2, 1, 3); - break; + case 77: + FillWindowPixelBuffer(0, PIXEL_FILL(1)); + AddTextPrinterParameterized2(0, 1, gUnknown_0858BBAC[Menu_GetCursorPos()], 0, NULL, 2, 1, 3); + break; + case 76: + FillWindowPixelBuffer(0, PIXEL_FILL(1)); + AddTextPrinterParameterized2(0, 1, gUnknown_0858BB9C[Menu_GetCursorPos()], 0, NULL, 2, 1, 3); + break; + case 78: + FillWindowPixelBuffer(0, PIXEL_FILL(1)); + AddTextPrinterParameterized2(0, 1, gUnknown_0858BBBC[Menu_GetCursorPos()], 0, NULL, 2, 1, 3); + break; + case 79: + FillWindowPixelBuffer(0, PIXEL_FILL(1)); + AddTextPrinterParameterized2(0, 1, gUnknown_0858BBCC[Menu_GetCursorPos()], 0, NULL, 2, 1, 3); + break; + case 75: + FillWindowPixelBuffer(0, PIXEL_FILL(1)); + AddTextPrinterParameterized2(0, 1, gUnknown_0858BBEC[Menu_GetCursorPos()], 0, NULL, 2, 1, 3); + break; + case 74: + FillWindowPixelBuffer(0, PIXEL_FILL(1)); + AddTextPrinterParameterized2(0, 1, gUnknown_0858BBE0[Menu_GetCursorPos()], 0, NULL, 2, 1, 3); + break; } } diff --git a/src/script_pokemon_util_80F87D8.c b/src/script_pokemon_util_80F87D8.c index 7e4c14531..ece030395 100755 --- a/src/script_pokemon_util_80F87D8.c +++ b/src/script_pokemon_util_80F87D8.c @@ -395,7 +395,7 @@ static void sub_80F8EE8(u8 taskId) task->data[0]++; break; case 4: - sub_80E2A78(gTasks[taskId].data[5]); + ClearToTransparentAndRemoveWindow(gTasks[taskId].data[5]); DestroyTask(taskId); break; } -- cgit v1.2.3 From d8c9f1b30fb92289e7aa4d44dfcf1b2120bea8d6 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Tue, 2 Apr 2019 15:06:44 +0200 Subject: Rows and columns --- src/menu.c | 60 ++++++++++++++++++++++++++++++------------------------------ 1 file changed, 30 insertions(+), 30 deletions(-) (limited to 'src') diff --git a/src/menu.c b/src/menu.c index 80d440771..b766b1b86 100644 --- a/src/menu.c +++ b/src/menu.c @@ -43,8 +43,8 @@ struct Menu u8 fontId; u8 optionWidth; u8 optionHeight; - u8 horizontalCount; - u8 verticalCount; + u8 columns; + u8 rows; bool8 APressMuted; }; @@ -1283,8 +1283,8 @@ u8 sub_8198F58(u8 windowId, u8 fontId, u8 left, u8 top, u8 a4, u8 cursorHeight, sMenu.fontId = fontId; sMenu.optionWidth = a4; sMenu.optionHeight = cursorHeight; - sMenu.horizontalCount = a6; - sMenu.verticalCount = a7; + sMenu.columns = a6; + sMenu.rows = a7; pos = a9; @@ -1308,16 +1308,16 @@ void sub_8199060(u8 oldCursorPos, u8 newCursorPos) { u8 cursorWidth = GetMenuCursorDimensionByFont(sMenu.fontId, 0); u8 cursorHeight = GetMenuCursorDimensionByFont(sMenu.fontId, 1); - u8 xPos = (oldCursorPos % sMenu.horizontalCount) * sMenu.optionWidth + sMenu.left; - u8 yPos = (oldCursorPos / sMenu.horizontalCount) * sMenu.optionHeight + sMenu.top; + u8 xPos = (oldCursorPos % sMenu.columns) * sMenu.optionWidth + sMenu.left; + u8 yPos = (oldCursorPos / sMenu.columns) * sMenu.optionHeight + sMenu.top; FillWindowPixelRect(sMenu.windowId, PIXEL_FILL(1), xPos, yPos, cursorWidth, cursorHeight); - xPos = (newCursorPos % sMenu.horizontalCount) * sMenu.optionWidth + sMenu.left; - yPos = (newCursorPos / sMenu.horizontalCount) * sMenu.optionHeight + sMenu.top; + xPos = (newCursorPos % sMenu.columns) * sMenu.optionWidth + sMenu.left; + yPos = (newCursorPos / sMenu.columns) * sMenu.optionHeight + sMenu.top; AddTextPrinterParameterized(sMenu.windowId, sMenu.fontId, gText_SelectorArrow3, @@ -1333,13 +1333,13 @@ u8 sub_8199134(s8 deltaX, s8 deltaY) if (deltaX != 0) { - if ((sMenu.cursorPos % sMenu.horizontalCount) + deltaX < 0) + if ((sMenu.cursorPos % sMenu.columns) + deltaX < 0) { - sMenu.cursorPos += sMenu.horizontalCount - 1; + sMenu.cursorPos += sMenu.columns - 1; } - else if ((sMenu.cursorPos % sMenu.horizontalCount) + deltaX >= sMenu.horizontalCount) + else if ((sMenu.cursorPos % sMenu.columns) + deltaX >= sMenu.columns) { - sMenu.cursorPos = (sMenu.cursorPos / sMenu.horizontalCount) * sMenu.horizontalCount; + sMenu.cursorPos = (sMenu.cursorPos / sMenu.columns) * sMenu.columns; } else { @@ -1349,17 +1349,17 @@ u8 sub_8199134(s8 deltaX, s8 deltaY) if (deltaY != 0) { - if ((sMenu.cursorPos / sMenu.horizontalCount) + deltaY < 0) + if ((sMenu.cursorPos / sMenu.columns) + deltaY < 0) { - sMenu.cursorPos += sMenu.horizontalCount * (sMenu.verticalCount - 1); + sMenu.cursorPos += sMenu.columns * (sMenu.rows - 1); } - else if ((sMenu.cursorPos / sMenu.horizontalCount) + deltaY >= sMenu.verticalCount) + else if ((sMenu.cursorPos / sMenu.columns) + deltaY >= sMenu.rows) { - sMenu.cursorPos -= sMenu.horizontalCount * (sMenu.verticalCount - 1); + sMenu.cursorPos -= sMenu.columns * (sMenu.rows - 1); } else { - sMenu.cursorPos += (sMenu.horizontalCount * deltaY); + sMenu.cursorPos += (sMenu.columns * deltaY); } } @@ -1381,8 +1381,8 @@ u8 sub_81991F8(s8 deltaX, s8 deltaY) if (deltaX != 0) { - if (((sMenu.cursorPos % sMenu.horizontalCount) + deltaX >= 0) && - ((sMenu.cursorPos % sMenu.horizontalCount) + deltaX < sMenu.horizontalCount)) + if (((sMenu.cursorPos % sMenu.columns) + deltaX >= 0) && + ((sMenu.cursorPos % sMenu.columns) + deltaX < sMenu.columns)) { sMenu.cursorPos += deltaX; } @@ -1390,10 +1390,10 @@ u8 sub_81991F8(s8 deltaX, s8 deltaY) if (deltaY != 0) { - if (((sMenu.cursorPos / sMenu.horizontalCount) + deltaY >= 0) && - ((sMenu.cursorPos / sMenu.horizontalCount) + deltaY < sMenu.verticalCount)) + if (((sMenu.cursorPos / sMenu.columns) + deltaY >= 0) && + ((sMenu.cursorPos / sMenu.columns) + deltaY < sMenu.rows)) { - sMenu.cursorPos += (sMenu.horizontalCount * deltaY); + sMenu.cursorPos += (sMenu.columns * deltaY); } } @@ -1661,14 +1661,14 @@ void CreateYesNoMenu(const struct WindowTemplate *window, u16 baseTileNum, u8 pa InitMenuInUpperLeftCornerPlaySoundWhenAPressed(sYesNoWindowId, 2, initialCursorPos); } -void PrintMenuGridTable(u8 windowId, u8 optionWidth, u8 horizontalCount, u8 verticalCount, const struct MenuAction *strs) +void PrintMenuGridTable(u8 windowId, u8 optionWidth, u8 columns, u8 rows, const struct MenuAction *strs) { u32 i, j; - for (i = 0; i < verticalCount; i++) + for (i = 0; i < rows; i++) { - for (j = 0; j < horizontalCount; j++) - AddTextPrinterParameterized(windowId, 1, strs[(i * horizontalCount) + j].text, (optionWidth * j) + 8, (i * 16) + 1, 0xFF, NULL); + for (j = 0; j < columns; j++) + AddTextPrinterParameterized(windowId, 1, strs[(i * columns) + j].text, (optionWidth * j) + 8, (i * 16) + 1, 0xFF, NULL); } CopyWindowToVram(windowId, 2); } @@ -1704,20 +1704,20 @@ void sub_819983C(u8 windowId, u8 a4, u8 itemCount, u8 itemCount2, const struct M CopyWindowToVram(windowId, 2); } -u8 sub_8199944(u8 windowId, u8 optionWidth, u8 horizontalCount, u8 verticalCount, u8 initialCursorPos) +u8 sub_8199944(u8 windowId, u8 optionWidth, u8 columns, u8 rows, u8 initialCursorPos) { s32 pos; sMenu.left = 0; sMenu.top = 1; sMenu.minCursorPos = 0; - sMenu.maxCursorPos = (horizontalCount * verticalCount) - 1; + sMenu.maxCursorPos = (columns * rows) - 1; sMenu.windowId = windowId; sMenu.fontId = 1; sMenu.optionWidth = optionWidth; sMenu.optionHeight = 16; - sMenu.horizontalCount = horizontalCount; - sMenu.verticalCount = verticalCount; + sMenu.columns = columns; + sMenu.rows = rows; pos = initialCursorPos; -- cgit v1.2.3