From 81a7f491b7053281ad63f6a13067bd1a36249a73 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 19 Feb 2021 18:36:48 -0500 Subject: [PATCH 1/9] Use WINDOW_NONE constant --- src/battle_pyramid_bag.c | 6 +++--- src/item_menu.c | 12 ++++++------ src/match_call.c | 2 +- src/menu.c | 28 ++++++++++++++-------------- src/menu_specialized.c | 6 +++--- src/party_menu.c | 8 ++++---- src/player_pc.c | 6 +++--- src/pokemon_summary_screen.c | 10 +++++----- src/pokenav_match_call_ui.c | 2 +- src/starter_choose.c | 2 +- src/union_room_chat.c | 4 ++-- 11 files changed, 43 insertions(+), 43 deletions(-) diff --git a/src/battle_pyramid_bag.c b/src/battle_pyramid_bag.c index 8fee57855..5537b302e 100644 --- a/src/battle_pyramid_bag.c +++ b/src/battle_pyramid_bag.c @@ -1428,7 +1428,7 @@ static u8 sub_81C6D08(u8 windowArrayId) static u8 sub_81C6D24(u8 windowArrayId) { u8 *windowId = &gPyramidBagResources->windowIds[windowArrayId]; - if (*windowId == 0xFF) + if (*windowId == WINDOW_NONE) { *windowId = AddWindow(&gUnknown_0861F350[windowArrayId]); DrawStdFrameWithCustomTileAndPalette(*windowId, FALSE, 1, 0xE); @@ -1440,13 +1440,13 @@ static u8 sub_81C6D24(u8 windowArrayId) static void sub_81C6D6C(u8 windowArrayId) { u8 *windowId = &gPyramidBagResources->windowIds[windowArrayId]; - if (*windowId != 0xFF) + if (*windowId != WINDOW_NONE) { ClearStdWindowAndFrameToTransparent(*windowId, FALSE); ClearWindowTilemap(*windowId); RemoveWindow(*windowId); ScheduleBgCopyTilemapToVram(1); - *windowId = 0xFF; + *windowId = WINDOW_NONE; } } diff --git a/src/item_menu.c b/src/item_menu.c index 375e15cab..89374c5d2 100755 --- a/src/item_menu.c +++ b/src/item_menu.c @@ -2390,7 +2390,7 @@ u8 sub_81AE124(u8 which) u8 BagMenu_AddWindow(u8 which) { u8 *ptr = &gBagMenu->windowPointers[which]; - if (*ptr == 0xFF) + if (*ptr == WINDOW_NONE) { *ptr = AddWindow(&sContextMenuWindowTemplates[which]); DrawStdFrameWithCustomTileAndPalette(*ptr, 0, 1, 14); @@ -2402,20 +2402,20 @@ u8 BagMenu_AddWindow(u8 which) void BagMenu_RemoveWindow(u8 which) { u8 *ptr = &gBagMenu->windowPointers[which]; - if (*ptr != 0xFF) + if (*ptr != WINDOW_NONE) { ClearStdWindowAndFrameToTransparent(*ptr, FALSE); ClearWindowTilemap(*ptr); RemoveWindow(*ptr); ScheduleBgCopyTilemapToVram(1); - *ptr = 0xFF; + *ptr = WINDOW_NONE; } } u8 AddItemMessageWindow(u8 which) { u8 *ptr = &gBagMenu->windowPointers[which]; - if (*ptr == 0xFF) + if (*ptr == WINDOW_NONE) *ptr = AddWindow(&sContextMenuWindowTemplates[which]); return *ptr; } @@ -2423,14 +2423,14 @@ u8 AddItemMessageWindow(u8 which) void BagMenu_RemoveBagItemMessageWindow(u8 which) { u8 *ptr = &gBagMenu->windowPointers[which]; - if (*ptr != 0xFF) + if (*ptr != WINDOW_NONE) { ClearDialogWindowAndFrameToTransparent(*ptr, FALSE); // This ClearWindowTilemap call is redundant, since ClearDialogWindowAndFrameToTransparent already calls it. ClearWindowTilemap(*ptr); RemoveWindow(*ptr); ScheduleBgCopyTilemapToVram(1); - *ptr = 0xFF; + *ptr = WINDOW_NONE; } } diff --git a/src/match_call.c b/src/match_call.c index 68b630d6b..fb8ebc98c 100644 --- a/src/match_call.c +++ b/src/match_call.c @@ -1168,7 +1168,7 @@ static bool32 LoadMatchCallWindowGfx(u8 taskId) { s16 *taskData = gTasks[taskId].data; taskData[2] = AddWindow(&sMatchCallTextWindow); - if (taskData[2] == 0xFF) + if (taskData[2] == WINDOW_NONE) { DestroyTask(taskId); return FALSE; diff --git a/src/menu.c b/src/menu.c index 4813f7b02..86e5caac2 100644 --- a/src/menu.c +++ b/src/menu.c @@ -144,8 +144,8 @@ void task_free_buf_after_copying_tile_data_to_vram(u8 taskId); void InitStandardTextBoxWindows(void) { InitWindows(sStandardTextBox_WindowTemplates); - sStartMenuWindowId = 0xFF; - sMapNamePopupWindowId = 0xFF; + sStartMenuWindowId = WINDOW_NONE; + sMapNamePopupWindowId = WINDOW_NONE; } void FreeAllOverworldWindowBuffers(void) @@ -490,7 +490,7 @@ u8 GetPlayerTextSpeedDelay(void) u8 sub_81979C4(u8 a1) { - if (sStartMenuWindowId == 0xFF) + if (sStartMenuWindowId == WINDOW_NONE) sStartMenuWindowId = sub_8198AA4(0, 0x16, 1, 7, (a1 * 2) + 2, 0xF, 0x139); return sStartMenuWindowId; } @@ -502,10 +502,10 @@ u8 GetStartMenuWindowId(void) void RemoveStartMenuWindow(void) { - if (sStartMenuWindowId != 0xFF) + if (sStartMenuWindowId != WINDOW_NONE) { RemoveWindow(sStartMenuWindowId); - sStartMenuWindowId = 0xFF; + sStartMenuWindowId = WINDOW_NONE; } } @@ -521,7 +521,7 @@ u16 sub_8197A38(void) u8 AddMapNamePopUpWindow(void) { - if (sMapNamePopupWindowId == 0xFF) + if (sMapNamePopupWindowId == WINDOW_NONE) sMapNamePopupWindowId = sub_8198AA4(0, 1, 1, 10, 3, 14, 0x107); return sMapNamePopupWindowId; } @@ -533,10 +533,10 @@ u8 GetMapNamePopUpWindowId(void) void RemoveMapNamePopUpWindow(void) { - if (sMapNamePopupWindowId != 0xFF) + if (sMapNamePopupWindowId != WINDOW_NONE) { RemoveWindow(sMapNamePopupWindowId); - sMapNamePopupWindowId = 0xFF; + sMapNamePopupWindowId = WINDOW_NONE; } } @@ -815,7 +815,7 @@ void sub_8198180(const u8 *string, u8 a2, bool8 copyToVram) { u16 width = 0; - if (sWindowId != 0xFF) + if (sWindowId != WINDOW_NONE) { PutWindowTilemap(sWindowId); FillWindowPixelBuffer(sWindowId, PIXEL_FILL(15)); @@ -837,7 +837,7 @@ void sub_8198204(const u8 *string, const u8 *string2, u8 a3, u8 a4, bool8 copyTo u8 color[3]; u16 width = 0; - if (sWindowId != 0xFF) + if (sWindowId != WINDOW_NONE) { if (a3 != 0) { @@ -872,13 +872,13 @@ void sub_8198204(const u8 *string, const u8 *string2, u8 a3, u8 a4, bool8 copyTo void sub_81982D8(void) { - if (sWindowId != 0xFF) + if (sWindowId != WINDOW_NONE) CopyWindowToVram(sWindowId, 3); } void sub_81982F0(void) { - if (sWindowId != 0xFF) + if (sWindowId != WINDOW_NONE) { FillWindowPixelBuffer(sWindowId, PIXEL_FILL(15)); CopyWindowToVram(sWindowId, 3); @@ -887,13 +887,13 @@ void sub_81982F0(void) void sub_8198314(void) { - if (sWindowId != 0xFF) + if (sWindowId != WINDOW_NONE) { FillWindowPixelBuffer(sWindowId, PIXEL_FILL(0)); ClearWindowTilemap(sWindowId); CopyWindowToVram(sWindowId, 3); RemoveWindow(sWindowId); - sWindowId = 0xFF; + sWindowId = WINDOW_NONE; } } diff --git a/src/menu_specialized.c b/src/menu_specialized.c index 74e3455c3..cdf0137cd 100644 --- a/src/menu_specialized.c +++ b/src/menu_specialized.c @@ -216,14 +216,14 @@ bool8 sub_81D1C44(u8 count) return FALSE; for (i = 0; i < ARRAY_COUNT(sUnknown_0203CF48); i++) - sUnknown_0203CF48[i] = 0xFF; + sUnknown_0203CF48[i] = WINDOW_NONE; return TRUE; } u8 sub_81D1C84(u8 a0) { - if (sUnknown_0203CF48[a0] == 0xFF) + if (sUnknown_0203CF48[a0] == WINDOW_NONE) { if (a0 == 2) { @@ -245,7 +245,7 @@ void sub_81D1D04(u8 a0) ClearStdWindowAndFrameToTransparent(sUnknown_0203CF48[a0], 0); ClearWindowTilemap(sUnknown_0203CF48[a0]); RemoveWindow(sUnknown_0203CF48[a0]); - sUnknown_0203CF48[a0] = 0xFF; + sUnknown_0203CF48[a0] = WINDOW_NONE; } static u8 sub_81D1D34(u8 a0) diff --git a/src/party_menu.c b/src/party_menu.c index 95c41ac05..dbb5cf0e6 100755 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -443,7 +443,7 @@ static void InitPartyMenu(u8 menuType, u8 layout, u8 partyAction, bool8 keepCurs for (i = 0; i < ARRAY_COUNT(sPartyMenuInternal->data); i++) sPartyMenuInternal->data[i] = 0; for (i = 0; i < ARRAY_COUNT(sPartyMenuInternal->windowId); i++) - sPartyMenuInternal->windowId[i] = 0xFF; + sPartyMenuInternal->windowId[i] = WINDOW_NONE; if (!keepCursorPos) gPartyMenu.slotId = 0; @@ -2371,11 +2371,11 @@ static void DisplayPartyPokemonDescriptionText(u8 stringID, struct PartyMenuBox static void PartyMenuRemoveWindow(u8 *ptr) { - if (*ptr != 0xFF) + if (*ptr != WINDOW_NONE) { ClearStdWindowAndFrameToTransparent(*ptr, 0); RemoveWindow(*ptr); - *ptr = 0xFF; + *ptr = WINDOW_NONE; ScheduleBgCopyTilemapToVram(2); } } @@ -2384,7 +2384,7 @@ void DisplayPartyMenuStdMessage(u32 stringId) { u8 *windowPtr = &sPartyMenuInternal->windowId[1]; - if (*windowPtr != 0xFF) + if (*windowPtr != WINDOW_NONE) PartyMenuRemoveWindow(windowPtr); if (stringId != PARTY_MSG_NONE) diff --git a/src/player_pc.c b/src/player_pc.c index 1f293a195..447fa82c1 100644 --- a/src/player_pc.c +++ b/src/player_pc.c @@ -889,7 +889,7 @@ static void sub_816BC58(void) static u8 sub_816BC7C(u8 a) { u8 *windowIdLoc = &(gUnknown_0203BCC4->windowIds[a]); - if (*windowIdLoc == 0xFF) + if (*windowIdLoc == WINDOW_NONE) { *windowIdLoc = AddWindow(&gUnknown_085DFF5C[a]); DrawStdFrameWithCustomTileAndPalette(*windowIdLoc, FALSE, 0x214, 0xE); @@ -901,13 +901,13 @@ static u8 sub_816BC7C(u8 a) static void sub_816BCC4(u8 a) { u8 *windowIdLoc = &(gUnknown_0203BCC4->windowIds[a]); - if (*windowIdLoc != 0xFF) + if (*windowIdLoc != WINDOW_NONE) { ClearStdWindowAndFrameToTransparent(*windowIdLoc, FALSE); ClearWindowTilemap(*windowIdLoc); ScheduleBgCopyTilemapToVram(0); RemoveWindow(*windowIdLoc); - *windowIdLoc = 0xFF; + *windowIdLoc = WINDOW_NONE; } } diff --git a/src/pokemon_summary_screen.c b/src/pokemon_summary_screen.c index b3cc1e516..53ec7c1d1 100644 --- a/src/pokemon_summary_screen.c +++ b/src/pokemon_summary_screen.c @@ -2680,7 +2680,7 @@ static void ResetWindows(void) for (i = 0; i < PSS_LABEL_WINDOW_END; i++) FillWindowPixelBuffer(i, PIXEL_FILL(0)); for (i = 0; i < ARRAY_COUNT(sMonSummaryScreen->windowIds); i++) - sMonSummaryScreen->windowIds[i] = 0xFF; + sMonSummaryScreen->windowIds[i] = WINDOW_NONE; } static void PrintTextOnWindow(u8 windowId, const u8 *string, u8 x, u8 y, u8 lineSpacing, u8 colorId) @@ -2938,7 +2938,7 @@ static void ClearPageWindowTilemaps(u8 page) static u8 AddWindowFromTemplateList(const struct WindowTemplate *template, u8 templateId) { u8 *windowIdPtr = &sMonSummaryScreen->windowIds[templateId]; - if (*windowIdPtr == 0xFF) + if (*windowIdPtr == WINDOW_NONE) { *windowIdPtr = AddWindow(&template[templateId]); FillWindowPixelBuffer(*windowIdPtr, PIXEL_FILL(0)); @@ -2949,11 +2949,11 @@ static u8 AddWindowFromTemplateList(const struct WindowTemplate *template, u8 te static void RemoveWindowByIndex(u8 windowIndex) { u8 *windowIdPtr = &sMonSummaryScreen->windowIds[windowIndex]; - if (*windowIdPtr != 0xFF) + if (*windowIdPtr != WINDOW_NONE) { ClearWindowTilemap(*windowIdPtr); RemoveWindow(*windowIdPtr); - *windowIdPtr = 0xFF; + *windowIdPtr = WINDOW_NONE; } } @@ -2962,7 +2962,7 @@ static void PrintPageSpecificText(u8 pageIndex) u16 i; for (i = 0; i < ARRAY_COUNT(sMonSummaryScreen->windowIds); i++) { - if (sMonSummaryScreen->windowIds[i] != 0xFF) + if (sMonSummaryScreen->windowIds[i] != WINDOW_NONE) FillWindowPixelBuffer(sMonSummaryScreen->windowIds[i], PIXEL_FILL(0)); } sTextPrinterFunctions[pageIndex](); diff --git a/src/pokenav_match_call_ui.c b/src/pokenav_match_call_ui.c index 2d89f9c39..11bb30162 100644 --- a/src/pokenav_match_call_ui.c +++ b/src/pokenav_match_call_ui.c @@ -987,7 +987,7 @@ bool32 CopyPokenavListMenuTemplate(struct PokenavSub17Substruct *dest, const str window.baseBlock = a3 + 2; dest->listWindow.windowId = AddWindow(&window); - if (dest->listWindow.windowId == 0xFF) + if (dest->listWindow.windowId == WINDOW_NONE) return FALSE; dest->listWindow.unkA = 0; diff --git a/src/starter_choose.c b/src/starter_choose.c index f7ffcfc2c..587169841 100644 --- a/src/starter_choose.c +++ b/src/starter_choose.c @@ -613,7 +613,7 @@ static void ClearStarterLabel(void) FillWindowPixelBuffer(sStarterLabelWindowId, PIXEL_FILL(0)); ClearWindowTilemap(sStarterLabelWindowId); RemoveWindow(sStarterLabelWindowId); - sStarterLabelWindowId = 0xFF; + sStarterLabelWindowId = WINDOW_NONE; SetGpuReg(REG_OFFSET_WIN0H, 0); SetGpuReg(REG_OFFSET_WIN0V, 0); ScheduleBgCopyTilemapToVram(0); diff --git a/src/union_room_chat.c b/src/union_room_chat.c index 75464529f..131c57bbb 100755 --- a/src/union_room_chat.c +++ b/src/union_room_chat.c @@ -2724,7 +2724,7 @@ static void AddYesNoMenuAt(u8 left, u8 top, u8 initialCursorPos) template.paletteNum = 14; template.baseBlock = 0x52; sDisplay->yesNoMenuWindowId = AddWindow(&template); - if (sDisplay->yesNoMenuWindowId != 0xFF) + if (sDisplay->yesNoMenuWindowId != WINDOW_NONE) { FillWindowPixelBuffer(sDisplay->yesNoMenuWindowId, PIXEL_FILL(1)); PutWindowTilemap(sDisplay->yesNoMenuWindowId); @@ -2778,7 +2778,7 @@ static void AddStdMessageWindow(int msgId, u16 bg0vofs) sDisplay->messageWindowId = AddWindow(&template); windowId = sDisplay->messageWindowId; - if (sDisplay->messageWindowId == 0xFF) + if (sDisplay->messageWindowId == WINDOW_NONE) return; if (sDisplayStdMessages[msgId].hasPlaceholders) From e52b46ab43d50b02734d1b1b9eeeccdc8daf9789 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 19 Feb 2021 18:52:24 -0500 Subject: [PATCH 2/9] Clean up script.c --- include/script.h | 2 -- src/script.c | 84 ++++++++++++++++++++++++++++-------------------- 2 files changed, 49 insertions(+), 37 deletions(-) diff --git a/include/script.h b/include/script.h index f9fb09b5d..63f6f5aef 100644 --- a/include/script.h +++ b/include/script.h @@ -26,8 +26,6 @@ u8 SetupBytecodeScript(struct ScriptContext *ctx, const u8 *ptr); void SetupNativeScript(struct ScriptContext *ctx, bool8 (*ptr)(void)); void StopScript(struct ScriptContext *ctx); bool8 RunScriptCommand(struct ScriptContext *ctx); -u8 ScriptPush(struct ScriptContext *ctx, const u8 *ptr); -const u8 *ScriptPop(struct ScriptContext *ctx); void ScriptJump(struct ScriptContext *ctx, const u8 *ptr); void ScriptCall(struct ScriptContext *ctx, const u8 *ptr); void ScriptReturn(struct ScriptContext *ctx); diff --git a/src/script.c b/src/script.c index 69899fdb3..701042da2 100644 --- a/src/script.c +++ b/src/script.c @@ -7,9 +7,14 @@ #define RAM_SCRIPT_MAGIC 51 +enum { + SCRIPT_MODE_STOPPED, + SCRIPT_MODE_BYTECODE, + SCRIPT_MODE_NATIVE, +}; + extern const u8* gRamScriptRetAddr; -// ewram bss static u8 sScriptContext1Status; static struct ScriptContext sScriptContext1; static struct ScriptContext sScriptContext2; @@ -23,57 +28,60 @@ void InitScriptContext(struct ScriptContext *ctx, void *cmdTable, void *cmdTable { s32 i; - ctx->mode = 0; - ctx->scriptPtr = 0; + ctx->mode = SCRIPT_MODE_STOPPED; + ctx->scriptPtr = NULL; ctx->stackDepth = 0; - ctx->nativePtr = 0; + ctx->nativePtr = NULL; ctx->cmdTable = cmdTable; ctx->cmdTableEnd = cmdTableEnd; - for (i = 0; i < 4; i++) + for (i = 0; i < (int)ARRAY_COUNT(ctx->data); i++) ctx->data[i] = 0; - for (i = 0; i < 20; i++) - ctx->stack[i] = 0; + for (i = 0; i < (int)ARRAY_COUNT(ctx->stack); i++) + ctx->stack[i] = NULL; } u8 SetupBytecodeScript(struct ScriptContext *ctx, const u8 *ptr) { ctx->scriptPtr = ptr; - ctx->mode = 1; + ctx->mode = SCRIPT_MODE_BYTECODE; return 1; } void SetupNativeScript(struct ScriptContext *ctx, bool8 (*ptr)(void)) { - ctx->mode = 2; + ctx->mode = SCRIPT_MODE_NATIVE; ctx->nativePtr = ptr; } void StopScript(struct ScriptContext *ctx) { - ctx->mode = 0; - ctx->scriptPtr = 0; + ctx->mode = SCRIPT_MODE_STOPPED; + ctx->scriptPtr = NULL; } bool8 RunScriptCommand(struct ScriptContext *ctx) { - if (ctx->mode == 0) + if (ctx->mode == SCRIPT_MODE_STOPPED) return FALSE; switch (ctx->mode) { - case 0: + case SCRIPT_MODE_STOPPED: return FALSE; - case 2: + case SCRIPT_MODE_NATIVE: + // Try to call a function in C + // Continue to bytecode if no function it returns TRUE if (ctx->nativePtr) { if (ctx->nativePtr() == TRUE) - ctx->mode = 1; + ctx->mode = SCRIPT_MODE_BYTECODE; return TRUE; } - ctx->mode = 1; - case 1: + ctx->mode = SCRIPT_MODE_BYTECODE; + // fallthrough + case SCRIPT_MODE_BYTECODE: while (1) { u8 cmdCode; @@ -81,7 +89,7 @@ bool8 RunScriptCommand(struct ScriptContext *ctx) if (!ctx->scriptPtr) { - ctx->mode = 0; + ctx->mode = SCRIPT_MODE_STOPPED; return FALSE; } @@ -97,11 +105,11 @@ bool8 RunScriptCommand(struct ScriptContext *ctx) if (func >= ctx->cmdTableEnd) { - ctx->mode = 0; + ctx->mode = SCRIPT_MODE_STOPPED; return FALSE; } - if ((*func)(ctx) == 1) + if ((*func)(ctx) == TRUE) return TRUE; } } @@ -109,21 +117,21 @@ bool8 RunScriptCommand(struct ScriptContext *ctx) return TRUE; } -u8 ScriptPush(struct ScriptContext *ctx, const u8 *ptr) +static bool8 ScriptPush(struct ScriptContext *ctx, const u8 *ptr) { - if (ctx->stackDepth + 1 >= 20) + if (ctx->stackDepth + 1 >= (int)ARRAY_COUNT(ctx->stack)) { - return 1; + return TRUE; } else { ctx->stack[ctx->stackDepth] = ptr; ctx->stackDepth++; - return 0; + return FALSE; } } -const u8 *ScriptPop(struct ScriptContext *ctx) +static const u8 *ScriptPop(struct ScriptContext *ctx) { if (ctx->stackDepth == 0) return NULL; @@ -196,10 +204,10 @@ void ScriptContext1_Init(void) bool8 ScriptContext2_RunScript(void) { if (sScriptContext1Status == 2) - return 0; + return FALSE; if (sScriptContext1Status == 1) - return 0; + return FALSE; ScriptContext2_Enable(); @@ -207,10 +215,10 @@ bool8 ScriptContext2_RunScript(void) { sScriptContext1Status = 2; ScriptContext2_Disable(); - return 0; + return FALSE; } - return 1; + return TRUE; } void ScriptContext1_SetupScript(const u8 *ptr) @@ -234,7 +242,7 @@ void EnableBothScriptContexts(void) void ScriptContext2_RunNewScript(const u8 *ptr) { - InitScriptContext(&sScriptContext2, &gScriptCmdTable, &gScriptCmdTableEnd); + InitScriptContext(&sScriptContext2, gScriptCmdTable, gScriptCmdTableEnd); SetupBytecodeScript(&sScriptContext2, ptr); while (RunScriptCommand(&sScriptContext2) == TRUE); } @@ -253,7 +261,7 @@ u8 *MapHeaderGetScriptTable(u8 tag) if (*mapScripts == tag) { mapScripts++; - return (u8 *)(mapScripts[0] + (mapScripts[1] << 8) + (mapScripts[2] << 16) + (mapScripts[3] << 24)); + return T2_READ_PTR(mapScripts); } mapScripts += 5; } @@ -277,14 +285,20 @@ u8 *MapHeaderCheckScriptTable(u8 tag) { u16 varIndex1; u16 varIndex2; - varIndex1 = ptr[0] | (ptr[1] << 8); + + // Read first var (or .2byte terminal value) + varIndex1 = T1_READ_16(ptr); if (!varIndex1) - return NULL; + return NULL; // Reached end of table ptr += 2; - varIndex2 = ptr[0] | (ptr[1] << 8); + + // Read second var + varIndex2 = T1_READ_16(ptr); ptr += 2; + + // Run map script if vars are equal if (VarGet(varIndex1) == VarGet(varIndex2)) - return (u8 *)(ptr[0] + (ptr[1] << 8) + (ptr[2] << 16) + (ptr[3] << 24)); + return T2_READ_PTR(ptr); ptr += 4; } } From a5852d57d124c49fd1b80510e968c18404a436a3 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 19 Feb 2021 23:22:26 -0500 Subject: [PATCH 3/9] Use TASK_NONE constant --- include/player_pc.h | 2 +- include/task.h | 1 + src/battle_anim.c | 20 ++++++++++---------- src/battle_anim_rock.c | 2 +- src/battle_anim_water.c | 4 ++-- src/battle_pike.c | 2 +- src/battle_pyramid_bag.c | 10 +++++----- src/battle_transition.c | 6 +++--- src/cable_club.c | 4 ++-- src/contest_util.c | 4 ++-- src/decoration.c | 8 ++++---- src/evolution_scene.c | 6 +++--- src/field_message_box.c | 2 +- src/field_specials.c | 8 ++++---- src/field_tasks.c | 6 +++--- src/hall_of_fame.c | 4 ++-- src/item_menu.c | 16 ++++++++-------- src/link_rfu_2.c | 6 +++--- src/list_menu.c | 2 -- src/menu_specialized.c | 2 +- src/minigame_countdown.c | 2 +- src/mirage_tower.c | 4 ++-- src/move_relearner.c | 16 ++++++++-------- src/naming_screen.c | 2 +- src/palette.c | 2 +- src/player_pc.c | 18 +++++++++--------- src/pokeblock.c | 8 ++++---- src/pokemon.c | 2 +- src/pokemon_summary_screen.c | 8 ++++---- src/pokenav_match_call_2.c | 2 +- src/scanline_effect.c | 8 ++++---- src/script_menu.c | 6 +++--- src/script_movement.c | 2 +- src/shop.c | 8 ++++---- src/slot_machine.c | 2 +- src/starter_choose.c | 2 +- src/task.c | 2 +- src/tileset_anims.c | 4 ++-- src/trainer_card.c | 2 +- src/union_room_chat.c | 16 ++++++++-------- 40 files changed, 115 insertions(+), 116 deletions(-) diff --git a/include/player_pc.h b/include/player_pc.h index 219c11440..bdf4a4e0e 100644 --- a/include/player_pc.h +++ b/include/player_pc.h @@ -73,7 +73,7 @@ struct PlayerPCItemPageStruct u8 pageItems; u8 count; u8 filler[3]; - u8 scrollIndicatorId; + u8 scrollIndicatorTaskId; }; // Exported type declarations diff --git a/include/task.h b/include/task.h index d0ca34f7f..9d1ee42c4 100644 --- a/include/task.h +++ b/include/task.h @@ -3,6 +3,7 @@ #define HEAD_SENTINEL 0xFE #define TAIL_SENTINEL 0xFF +#define TASK_NONE TAIL_SENTINEL #define NUM_TASKS 16 #define NUM_TASK_DATA 16 diff --git a/src/battle_anim.c b/src/battle_anim.c index 874ac935b..46df413ed 100644 --- a/src/battle_anim.c +++ b/src/battle_anim.c @@ -1814,8 +1814,8 @@ void ClearBattleAnimationVars(void) for (i = 0; i < ANIM_ARGS_COUNT; i++) gBattleAnimArgs[i] = 0; - sMonAnimTaskIdArray[0] = 0xFF; - sMonAnimTaskIdArray[1] = 0xFF; + sMonAnimTaskIdArray[0] = TASK_NONE; + sMonAnimTaskIdArray[1] = TASK_NONE; gAnimMoveTurn = 0; sAnimBackgroundFadeState = 0; sAnimMoveIndex = 0; @@ -1861,8 +1861,8 @@ void LaunchBattleAnimation(const u8 *const animsTable[], u16 tableId, bool8 isMo for (i = 0; i < ANIM_ARGS_COUNT; i++) gBattleAnimArgs[i] = 0; - sMonAnimTaskIdArray[0] = 0xFF; - sMonAnimTaskIdArray[1] = 0xFF; + sMonAnimTaskIdArray[0] = TASK_NONE; + sMonAnimTaskIdArray[1] = TASK_NONE; sBattleAnimScriptPtr = animsTable[tableId]; gAnimScriptActive = TRUE; gAnimFramesToWait = 0; @@ -2106,7 +2106,7 @@ static void ScriptCmd_end(void) // Keep waiting as long as there are animations to be done. if (gAnimVisualTaskCount != 0 || gAnimSoundTaskCount != 0 - || sMonAnimTaskIdArray[0] != 0xFF || sMonAnimTaskIdArray[1] != 0xFF) + || sMonAnimTaskIdArray[0] != TASK_NONE || sMonAnimTaskIdArray[1] != TASK_NONE) { sSoundAnimFramesToWait = 0; gAnimFramesToWait = 1; @@ -2482,9 +2482,9 @@ static void ScriptCmd_clearmonbg(void) else battlerId = gBattleAnimTarget; - if (sMonAnimTaskIdArray[0] != 0xFF) + if (sMonAnimTaskIdArray[0] != TASK_NONE) gSprites[gBattlerSpriteIds[battlerId]].invisible = FALSE; - if (animBattlerId > 1 && sMonAnimTaskIdArray[1] != 0xFF) + if (animBattlerId > 1 && sMonAnimTaskIdArray[1] != TASK_NONE) gSprites[gBattlerSpriteIds[battlerId ^ BIT_FLANK]].invisible = FALSE; else animBattlerId = 0; @@ -2508,17 +2508,17 @@ static void sub_80A4980(u8 taskId) else to_BG2 = TRUE; - if (sMonAnimTaskIdArray[0] != 0xFF) + if (sMonAnimTaskIdArray[0] != TASK_NONE) { sub_80A477C(to_BG2); DestroyTask(sMonAnimTaskIdArray[0]); - sMonAnimTaskIdArray[0] = 0xFF; + sMonAnimTaskIdArray[0] = TASK_NONE; } if (gTasks[taskId].data[0] > 1) { sub_80A477C(to_BG2 ^ 1); DestroyTask(sMonAnimTaskIdArray[1]); - sMonAnimTaskIdArray[1] = 0xFF; + sMonAnimTaskIdArray[1] = TASK_NONE; } DestroyTask(taskId); } diff --git a/src/battle_anim_rock.c b/src/battle_anim_rock.c index 29ba49346..548ebb96e 100644 --- a/src/battle_anim_rock.c +++ b/src/battle_anim_rock.c @@ -731,7 +731,7 @@ static void AnimRolloutParticle(struct Sprite *sprite) if (TranslateAnimHorizontalArc(sprite)) { u8 taskId = FindTaskIdByFunc(AnimTask_Rollout_Step); - if (taskId != 0xFF) + if (taskId != TASK_NONE) gTasks[taskId].data[11]--; DestroySprite(sprite); diff --git a/src/battle_anim_water.c b/src/battle_anim_water.c index f157102b0..ce69596f3 100644 --- a/src/battle_anim_water.c +++ b/src/battle_anim_water.c @@ -1260,14 +1260,14 @@ static void AnimTask_WaterSpoutRain_Step(u8 taskId) gBattleAnimArgs[1] = 0; gBattleAnimArgs[2] = 12; taskId2 = CreateTask(AnimTask_HorizontalShake, 80); - if (taskId2 != 0xFF) + if (taskId2 != TASK_NONE) { gTasks[taskId2].func(taskId2); gAnimVisualTaskCount++; } gBattleAnimArgs[0] = ANIM_DEF_PARTNER; taskId2 = CreateTask(AnimTask_HorizontalShake, 80); - if (taskId2 != 0xFF) + if (taskId2 != TASK_NONE) { gTasks[taskId2].func(taskId2); gAnimVisualTaskCount++; diff --git a/src/battle_pike.c b/src/battle_pike.c index ed18b2f71..aa0761965 100644 --- a/src/battle_pike.c +++ b/src/battle_pike.c @@ -1235,7 +1235,7 @@ static void StartStatusInflictionScreenFlash(s16 fadeOutDelay, s16 fadeInDelay, static bool8 IsStatusInflictionScreenFlashTaskFinished(void) { - if (FindTaskIdByFunc(DoStatusInflictionScreenFlash) == 0xFF) + if (FindTaskIdByFunc(DoStatusInflictionScreenFlash) == TASK_NONE) return TRUE; else return FALSE; diff --git a/src/battle_pyramid_bag.c b/src/battle_pyramid_bag.c index 5537b302e..5e3b94e94 100644 --- a/src/battle_pyramid_bag.c +++ b/src/battle_pyramid_bag.c @@ -389,10 +389,10 @@ void GoToBattlePyramidBagMenu(u8 a0, void (*callback)(void)) gPyramidBagResources->callback2 = NULL; gPyramidBagResources->unk814 = 0xFF; - gPyramidBagResources->scrollIndicatorsTaskId = 0xFF; + gPyramidBagResources->scrollIndicatorsTaskId = TASK_NONE; memset(gPyramidBagResources->itemsSpriteIds, 0xFF, sizeof(gPyramidBagResources->itemsSpriteIds)); - memset(gPyramidBagResources->windowIds, 0xFF, sizeof(gPyramidBagResources->windowIds)); + memset(gPyramidBagResources->windowIds, WINDOW_NONE, sizeof(gPyramidBagResources->windowIds)); SetMainCallback2(sub_81C504C); } @@ -657,16 +657,16 @@ static void PrintItemDescription(s32 listMenuId) static void AddScrollArrow(void) { - if (gPyramidBagResources->scrollIndicatorsTaskId == 0xFF) + if (gPyramidBagResources->scrollIndicatorsTaskId == TASK_NONE) gPyramidBagResources->scrollIndicatorsTaskId = AddScrollIndicatorArrowPairParameterized(2, 172, 12, 148, gPyramidBagResources->listMenuCount - gPyramidBagResources->listMenuMaxShown, 0xB5E, 0xB5E, &gPyramidBagCursorData.scrollPosition); } static void RemoveScrollArrow(void) { - if (gPyramidBagResources->scrollIndicatorsTaskId != 0xFF) + if (gPyramidBagResources->scrollIndicatorsTaskId != TASK_NONE) { RemoveScrollIndicatorArrowPair(gPyramidBagResources->scrollIndicatorsTaskId); - gPyramidBagResources->scrollIndicatorsTaskId = 0xFF; + gPyramidBagResources->scrollIndicatorsTaskId = TASK_NONE; } } diff --git a/src/battle_transition.c b/src/battle_transition.c index 74e1548e7..d9436edf0 100644 --- a/src/battle_transition.c +++ b/src/battle_transition.c @@ -991,7 +991,7 @@ static bool8 Transition_Phase1(struct Task *task) static bool8 Transition_WaitForPhase1(struct Task *task) { - if (FindTaskIdByFunc(sPhase1_Tasks[task->tTransitionId]) == 0xFF) + if (FindTaskIdByFunc(sPhase1_Tasks[task->tTransitionId]) == TASK_NONE) { task->tState++; return TRUE; @@ -1012,7 +1012,7 @@ static bool8 Transition_Phase2(struct Task *task) static bool8 Transition_WaitForPhase2(struct Task *task) { task->tTransitionDone = FALSE; - if (FindTaskIdByFunc(sPhase2_Tasks[task->tTransitionId]) == 0xFF) + if (FindTaskIdByFunc(sPhase2_Tasks[task->tTransitionId]) == TASK_NONE) task->tTransitionDone = TRUE; return FALSE; } @@ -3612,7 +3612,7 @@ static void CreatePhase1Task(s16 a0, s16 a1, s16 a2, s16 a3, s16 a4) static bool8 IsPhase1Done(void) { - if (FindTaskIdByFunc(TransitionPhase1_Task_RunFuncs) == 0xFF) + if (FindTaskIdByFunc(TransitionPhase1_Task_RunFuncs) == TASK_NONE) return TRUE; else return FALSE; diff --git a/src/cable_club.c b/src/cable_club.c index cd0baefcd..77cb0465c 100644 --- a/src/cable_club.c +++ b/src/cable_club.c @@ -82,7 +82,7 @@ static void Task_ReestablishLinkAwaitConfirmation(u8 taskId); static void CreateLinkupTask(u8 minPlayers, u8 maxPlayers) { - if (FindTaskIdByFunc(Task_LinkupStart) == 0xFF) + if (FindTaskIdByFunc(Task_LinkupStart) == TASK_NONE) { u8 taskId1; @@ -627,7 +627,7 @@ void ValidateMixingGameLanguage(void) { u32 taskId = FindTaskIdByFunc(Task_ValidateMixingGameLanguage); - if (taskId == 0xFF) + if (taskId == TASK_NONE) { taskId = CreateTask(Task_ValidateMixingGameLanguage, 80); gTasks[taskId].tState = 0; diff --git a/src/contest_util.c b/src/contest_util.c index e690a3bbe..176360bc3 100644 --- a/src/contest_util.c +++ b/src/contest_util.c @@ -2535,7 +2535,7 @@ void ShowContestEntryMonPic(void) u8 taskId; u8 left, top; - if (FindTaskIdByFunc(Task_ShowContestEntryMonPic) == 0xFF) + if (FindTaskIdByFunc(Task_ShowContestEntryMonPic) == TASK_NONE) { AllocateMonSpritesGfx(); left = 10; @@ -2578,7 +2578,7 @@ void ShowContestEntryMonPic(void) void HideContestEntryMonPic(void) { u8 taskId = FindTaskIdByFunc(Task_ShowContestEntryMonPic); - if (taskId != 0xFF) + if (taskId != TASK_NONE) { gTasks[taskId].data[0]++; FreeMonSpritesGfx(); diff --git a/src/decoration.c b/src/decoration.c index 484398aba..b9a243708 100644 --- a/src/decoration.c +++ b/src/decoration.c @@ -925,7 +925,7 @@ static void DecorationItemsMenu_PrintDecorationInUse(u8 windowId, s32 itemIndex, static void AddDecorationItemsScrollIndicators(void) { - if (sDecorationItemsMenu->scrollIndicatorsTaskId == 0xFF) + if (sDecorationItemsMenu->scrollIndicatorsTaskId == TASK_NONE) { sDecorationItemsMenu->scrollIndicatorsTaskId = AddScrollIndicatorArrowPairParameterized( SCROLL_ARROW_UP, @@ -941,10 +941,10 @@ static void AddDecorationItemsScrollIndicators(void) static void RemoveDecorationItemsScrollIndicators(void) { - if (sDecorationItemsMenu->scrollIndicatorsTaskId != 0xFF) + if (sDecorationItemsMenu->scrollIndicatorsTaskId != TASK_NONE) { RemoveScrollIndicatorArrowPair(sDecorationItemsMenu->scrollIndicatorsTaskId); - sDecorationItemsMenu->scrollIndicatorsTaskId = 0xFF; + sDecorationItemsMenu->scrollIndicatorsTaskId = TASK_NONE; } } @@ -960,7 +960,7 @@ static void InitDecorationItemsWindow(u8 taskId) AddDecorationWindow(WINDOW_DECORATION_CATEGORY_ITEMS); ShowDecorationCategorySummaryWindow(sCurDecorationCategory); sDecorationItemsMenu = AllocZeroed(sizeof(*sDecorationItemsMenu)); - sDecorationItemsMenu->scrollIndicatorsTaskId = 0xFF; + sDecorationItemsMenu->scrollIndicatorsTaskId = TASK_NONE; InitDecorationItemsMenuLimits(); InitDecorationItemsMenuScrollAndCursor(); InitDecorationItemsMenuScrollAndCursor2(); diff --git a/src/evolution_scene.c b/src/evolution_scene.c index 7b25754db..f77c3d760 100644 --- a/src/evolution_scene.c +++ b/src/evolution_scene.c @@ -1646,7 +1646,7 @@ static void PauseBgPaletteAnim(void) { u8 taskId = FindTaskIdByFunc(Task_UpdateBgPalette); - if (taskId != 0xFF) + if (taskId != TASK_NONE) gTasks[taskId].tPaused = TRUE; FillPalette(0, 0xA0, 0x20); @@ -1658,9 +1658,9 @@ static void StopBgAnimation(void) { u8 taskId; - if ((taskId = FindTaskIdByFunc(Task_UpdateBgPalette)) != 0xFF) + if ((taskId = FindTaskIdByFunc(Task_UpdateBgPalette)) != TASK_NONE) DestroyTask(taskId); - if ((taskId = FindTaskIdByFunc(Task_AnimateBg)) != 0xFF) + if ((taskId = FindTaskIdByFunc(Task_AnimateBg)) != TASK_NONE) DestroyTask(taskId); FillPalette(0, 0xA0, 0x20); diff --git a/src/field_message_box.c b/src/field_message_box.c index b98425b66..69d470b84 100755 --- a/src/field_message_box.c +++ b/src/field_message_box.c @@ -55,7 +55,7 @@ static void CreateTask_DrawFieldMessage(void) static void DestroyTask_DrawFieldMessage(void) { u8 taskId = FindTaskIdByFunc(Task_DrawFieldMessage); - if (taskId != 0xFF) + if (taskId != TASK_NONE) DestroyTask(taskId); } diff --git a/src/field_specials.c b/src/field_specials.c index b40889773..9e944a384 100644 --- a/src/field_specials.c +++ b/src/field_specials.c @@ -2667,7 +2667,7 @@ static void ScrollableMultichoice_MoveCursor(s32 itemIndex, bool8 onInit, struct u8 taskId; PlaySE(SE_SELECT); taskId = FindTaskIdByFunc(ScrollableMultichoice_ProcessInput); - if (taskId != 0xFF) + if (taskId != TASK_NONE) { u16 selection; struct Task *task = &gTasks[taskId]; @@ -2753,7 +2753,7 @@ static void sub_813A600(u8 taskId) void sub_813A630(void) { u8 taskId = FindTaskIdByFunc(sub_813A600); - if (taskId == 0xFF) + if (taskId == TASK_NONE) { EnableBothScriptContexts(); } @@ -3262,7 +3262,7 @@ void sub_813ADD4(void) u16 scrollOffset, selectedRow; u8 i; u8 taskId = FindTaskIdByFunc(sub_813A600); - if (taskId != 0xFF) + if (taskId != TASK_NONE) { struct Task *task = &gTasks[taskId]; ListMenuGetScrollAndRow(task->tListTaskId, &scrollOffset, &selectedRow); @@ -3321,7 +3321,7 @@ void GetBattleFrontierTutorMoveIndex(void) void sub_813AF48(void) { u8 taskId = FindTaskIdByFunc(sub_813A600); - if (taskId != 0xFF) + if (taskId != TASK_NONE) { struct Task *task = &gTasks[taskId]; DestroyListMenuTask(task->tListTaskId, NULL, NULL); diff --git a/src/field_tasks.c b/src/field_tasks.c index a68b10966..676a9cfc7 100644 --- a/src/field_tasks.c +++ b/src/field_tasks.c @@ -174,7 +174,7 @@ void SetUpFieldTasks(void) void ActivatePerStepCallback(u8 callbackId) { u8 taskId = FindTaskIdByFunc(Task_RunPerStepCallback); - if (taskId != 0xff) + if (taskId != TASK_NONE) { s32 i; s16 *data = gTasks[taskId].data; @@ -199,12 +199,12 @@ void ResetFieldTasksArgs(void) s16 *data; taskId = FindTaskIdByFunc(Task_RunPerStepCallback); - if (taskId != 0xff) + if (taskId != TASK_NONE) { data = gTasks[taskId].data; } taskId = FindTaskIdByFunc(Task_RunTimeBasedEvents); - if (taskId != 0xff) + if (taskId != TASK_NONE) { data = gTasks[taskId].data; data[1] = 0; diff --git a/src/hall_of_fame.c b/src/hall_of_fame.c index 7b63950d1..fbebc1a3b 100644 --- a/src/hall_of_fame.c +++ b/src/hall_of_fame.c @@ -1433,7 +1433,7 @@ void DoDomeConfetti(void) gSpecialVar_0x8004 = 180; taskId = CreateTask(Task_DoDomeConfetti, 0); - if (taskId != 0xFF) + if (taskId != TASK_NONE) { gTasks[taskId].tTimer = gSpecialVar_0x8004; gSpecialVar_0x8005 = taskId; @@ -1444,7 +1444,7 @@ static void StopDomeConfetti(void) { u8 taskId; - if ((taskId = FindTaskIdByFunc(Task_DoDomeConfetti)) != 0xFF) + if ((taskId = FindTaskIdByFunc(Task_DoDomeConfetti)) != TASK_NONE) DestroyTask(taskId); ConfettiUtil_Free(); diff --git a/src/item_menu.c b/src/item_menu.c index 89374c5d2..a3cb7cfa3 100755 --- a/src/item_menu.c +++ b/src/item_menu.c @@ -594,8 +594,8 @@ void GoToBagMenu(u8 location, u8 pocket, void ( *postExitMenuMainCallback2)()) gBagMenu->pocketSwitchDisabled = TRUE; gBagMenu->exitCallback = NULL; gBagMenu->itemOriginalLocation = 0xFF; - gBagMenu->pocketScrollArrowsTask = 0xFF; - gBagMenu->pocketSwitchArrowsTask = 0xFF; + gBagMenu->pocketScrollArrowsTask = TASK_NONE; + gBagMenu->pocketSwitchArrowsTask = TASK_NONE; memset(gBagMenu->spriteId, 0xFF, sizeof(gBagMenu->spriteId)); memset(gBagMenu->windowPointers, 0xFF, 10); SetMainCallback2(CB2_Bag); @@ -971,7 +971,7 @@ void BagMenu_PrintCursor(u8 y, u8 colorIndex) void CreatePocketScrollArrowPair(void) { - if (gBagMenu->pocketScrollArrowsTask == 0xFF) + if (gBagMenu->pocketScrollArrowsTask == TASK_NONE) gBagMenu->pocketScrollArrowsTask = AddScrollIndicatorArrowPairParameterized( SCROLL_ARROW_UP, 172, @@ -985,26 +985,26 @@ void CreatePocketScrollArrowPair(void) void BagDestroyPocketScrollArrowPair(void) { - if (gBagMenu->pocketScrollArrowsTask != 0xFF) + if (gBagMenu->pocketScrollArrowsTask != TASK_NONE) { RemoveScrollIndicatorArrowPair(gBagMenu->pocketScrollArrowsTask); - gBagMenu->pocketScrollArrowsTask = 0xFF; + gBagMenu->pocketScrollArrowsTask = TASK_NONE; } BagDestroyPocketSwitchArrowPair(); } void CreatePocketSwitchArrowPair(void) { - if (gBagMenu->pocketSwitchDisabled != TRUE && gBagMenu->pocketSwitchArrowsTask == 0xFF) + if (gBagMenu->pocketSwitchDisabled != TRUE && gBagMenu->pocketSwitchArrowsTask == TASK_NONE) gBagMenu->pocketSwitchArrowsTask = AddScrollIndicatorArrowPair(&sBagScrollArrowsTemplate, &gBagPositionStruct.unk6); } void BagDestroyPocketSwitchArrowPair(void) { - if (gBagMenu->pocketSwitchArrowsTask != 0xFF) + if (gBagMenu->pocketSwitchArrowsTask != TASK_NONE) { RemoveScrollIndicatorArrowPair(gBagMenu->pocketSwitchArrowsTask); - gBagMenu->pocketSwitchArrowsTask = 0xFF; + gBagMenu->pocketSwitchArrowsTask = TASK_NONE; } } diff --git a/src/link_rfu_2.c b/src/link_rfu_2.c index b7713fa3f..3b49ae4b1 100644 --- a/src/link_rfu_2.c +++ b/src/link_rfu_2.c @@ -2643,7 +2643,7 @@ static void sub_8011E2C(u8 taskId) static void sub_8011E94(u32 a0, u32 a1) { u8 taskId = FindTaskIdByFunc(sub_8011E2C); - if (taskId == 0xFF) + if (taskId == TASK_NONE) { taskId = CreateTask(sub_8011E2C, 5); gTasks[taskId].data[0] = a0; @@ -2792,12 +2792,12 @@ void sub_8012188(const u8 *name, struct GFtgtGname *structPtr, u8 activity) taskId2 = FindTaskIdByFunc(Task_LinkRfu_UnionRoomListen); if (activity == (ACTIVITY_CHAT | IN_UNION_ROOM)) { - if (taskId2 != 0xFF) + if (taskId2 != TASK_NONE) gTasks[taskId2].data[7] = 1; } else { - if (taskId2 != 0xFF) + if (taskId2 != TASK_NONE) gTasks[taskId2].data[7] = 0; } } diff --git a/src/list_menu.c b/src/list_menu.c index 3e5642e4c..79ea1fde0 100644 --- a/src/list_menu.c +++ b/src/list_menu.c @@ -467,8 +467,6 @@ s32 ListMenu_ProcessInput(u8 listTaskId) } } -#define TASK_NONE 0xFF - void DestroyListMenuTask(u8 listTaskId, u16 *scrollOffset, u16 *selectedRow) { struct ListMenu *list = (void*) gTasks[listTaskId].data; diff --git a/src/menu_specialized.c b/src/menu_specialized.c index cdf0137cd..1fbeb59b4 100644 --- a/src/menu_specialized.c +++ b/src/menu_specialized.c @@ -310,7 +310,7 @@ static void sub_81D1E7C(s32 itemIndex, bool8 onInit, struct ListMenu *list) void sub_81D1E90(struct PlayerPCItemPageStruct *page) { - page->scrollIndicatorId = AddScrollIndicatorArrowPairParameterized(2, 0xC8, 12, 0x94, page->count - page->pageItems + 1, 0x6E, 0x6E, &page->itemsAbove); + page->scrollIndicatorTaskId = AddScrollIndicatorArrowPairParameterized(2, 0xC8, 12, 0x94, page->count - page->pageItems + 1, 0x6E, 0x6E, &page->itemsAbove); } void sub_81D1EC0(void) diff --git a/src/minigame_countdown.c b/src/minigame_countdown.c index d2f7d3ea8..01fb05fd8 100644 --- a/src/minigame_countdown.c +++ b/src/minigame_countdown.c @@ -125,7 +125,7 @@ static u32 sub_802E63C(u8 funcSetId, u8 taskPriority) static bool32 sub_802E688(void) { u8 taskId = FindTaskIdByFunc(sub_802E6D0); - if (taskId == 0xFF) + if (taskId == TASK_NONE) return FALSE; gTasks[taskId].data[0] = 2; diff --git a/src/mirage_tower.c b/src/mirage_tower.c index ef7bf7228..d18ddcc0f 100644 --- a/src/mirage_tower.c +++ b/src/mirage_tower.c @@ -398,7 +398,7 @@ static void DoScreenShake(u8 taskId) static void IncrementCeilingCrumbleFinishedCount(void) { u8 taskId = FindTaskIdByFunc(WaitCeilingCrumble); - if (taskId != 0xFF) + if (taskId != TASK_NONE) gTasks[taskId].data[0]++; } @@ -610,7 +610,7 @@ static void DoMirageTowerDisintegration(u8 taskId) case 4: UnsetBgTilemapBuffer(0); bgShakeTaskId = FindTaskIdByFunc(UpdateBgShake); - if (bgShakeTaskId != 0xFF) + if (bgShakeTaskId != TASK_NONE) DestroyTask(bgShakeTaskId); sBgShakeOffsets->bgVOFS = sBgShakeOffsets->bgHOFS = 0; SetBgShakeOffsets(); diff --git a/src/move_relearner.c b/src/move_relearner.c index cd4da5835..f010fcc04 100644 --- a/src/move_relearner.c +++ b/src/move_relearner.c @@ -844,8 +844,8 @@ static void CreateUISprites(void) { int i; - sMoveRelearnerStruct->moveDisplayArrowTask = 0xFF; - sMoveRelearnerStruct->moveListScrollArrowTask = 0xFF; + sMoveRelearnerStruct->moveDisplayArrowTask = TASK_NONE; + sMoveRelearnerStruct->moveListScrollArrowTask = TASK_NONE; AddScrollArrows(); // These are the appeal hearts. @@ -870,12 +870,12 @@ static void CreateUISprites(void) static void AddScrollArrows(void) { - if (sMoveRelearnerStruct->moveDisplayArrowTask == 0xFF) + if (sMoveRelearnerStruct->moveDisplayArrowTask == TASK_NONE) { sMoveRelearnerStruct->moveDisplayArrowTask = AddScrollIndicatorArrowPair(&sDisplayModeArrowsTemplate, &sMoveRelearnerStruct->scrollOffset); } - if (sMoveRelearnerStruct->moveListScrollArrowTask == 0xFF) + if (sMoveRelearnerStruct->moveListScrollArrowTask == TASK_NONE) { gTempScrollArrowTemplate = sMoveListScrollArrowsTemplate; gTempScrollArrowTemplate.fullyDownThreshold = sMoveRelearnerStruct->numMenuChoices - sMoveRelearnerStruct->numToShowAtOnce; @@ -885,16 +885,16 @@ static void AddScrollArrows(void) static void RemoveScrollArrows(void) { - if (sMoveRelearnerStruct->moveDisplayArrowTask != 0xFF) + if (sMoveRelearnerStruct->moveDisplayArrowTask != TASK_NONE) { RemoveScrollIndicatorArrowPair(sMoveRelearnerStruct->moveDisplayArrowTask); - sMoveRelearnerStruct->moveDisplayArrowTask = 0xFF; + sMoveRelearnerStruct->moveDisplayArrowTask = TASK_NONE; } - if (sMoveRelearnerStruct->moveListScrollArrowTask != 0xFF) + if (sMoveRelearnerStruct->moveListScrollArrowTask != TASK_NONE) { RemoveScrollIndicatorArrowPair(sMoveRelearnerStruct->moveListScrollArrowTask); - sMoveRelearnerStruct->moveListScrollArrowTask = 0xFF; + sMoveRelearnerStruct->moveListScrollArrowTask = TASK_NONE; } } diff --git a/src/naming_screen.c b/src/naming_screen.c index be921078e..b679ec5f7 100644 --- a/src/naming_screen.c +++ b/src/naming_screen.c @@ -826,7 +826,7 @@ static void Task_HandlePageSwapAnim(u8 taskId) static bool8 IsPageSwapAnimNotInProgress(void) { - if (FindTaskIdByFunc(Task_HandlePageSwapAnim) == 0xFF) + if (FindTaskIdByFunc(Task_HandlePageSwapAnim) == TASK_NONE) return TRUE; else return FALSE; diff --git a/src/palette.c b/src/palette.c index ece753d21..cbaae8da2 100644 --- a/src/palette.c +++ b/src/palette.c @@ -1002,7 +1002,7 @@ static void DestroyBlendPalettesGraduallyTask(void) while (1) { taskId = FindTaskIdByFunc(Task_BlendPalettesGradually); - if (taskId == 0xFF) + if (taskId == TASK_NONE) break; DestroyTask(taskId); } diff --git a/src/player_pc.c b/src/player_pc.c index 447fa82c1..1a9c10459 100644 --- a/src/player_pc.c +++ b/src/player_pc.c @@ -398,7 +398,7 @@ static void PlayerPC_Mailbox(u8 taskId) { playerPCItemPageInfo.cursorPos = 0; playerPCItemPageInfo.itemsAbove = 0; - playerPCItemPageInfo.scrollIndicatorId = 0xFF; + playerPCItemPageInfo.scrollIndicatorTaskId = TASK_NONE; Mailbox_UpdateMailList(); ItemStorage_SetItemAndMailCount(taskId); if (sub_81D1C44(playerPCItemPageInfo.count) == TRUE) @@ -554,7 +554,7 @@ static void ItemStorage_WithdrawToss_Helper(u8 taskId, bool8 toss) sub_816B4DC(taskId); playerPCItemPageInfo.cursorPos = 0; playerPCItemPageInfo.itemsAbove = 0; - playerPCItemPageInfo.scrollIndicatorId = 0xFF; + playerPCItemPageInfo.scrollIndicatorTaskId = TASK_NONE; ItemStorage_SetItemAndMailCount(taskId); sub_816BC14(); FreeAndReserveObjectSpritePalettes(); @@ -647,7 +647,7 @@ static void Mailbox_ProcessInput(u8 taskId) break; case LIST_CANCEL: PlaySE(SE_SELECT); - RemoveScrollIndicatorArrowPair(playerPCItemPageInfo.scrollIndicatorId); + RemoveScrollIndicatorArrowPair(playerPCItemPageInfo.scrollIndicatorTaskId); Mailbox_ReturnToPlayerPC(taskId); break; default: @@ -656,7 +656,7 @@ static void Mailbox_ProcessInput(u8 taskId) sub_81D1D04(1); DestroyListMenuTask(data[5], &(playerPCItemPageInfo.itemsAbove), &(playerPCItemPageInfo.cursorPos)); ScheduleBgCopyTilemapToVram(0); - RemoveScrollIndicatorArrowPair(playerPCItemPageInfo.scrollIndicatorId); + RemoveScrollIndicatorArrowPair(playerPCItemPageInfo.scrollIndicatorTaskId); gTasks[taskId].func = Mailbox_PrintWhatToDoWithPlayerMailText; break; } @@ -983,16 +983,16 @@ static void sub_816BEF0(s32 id) static void ItemStorage_StartScrollIndicator(void) { - if (playerPCItemPageInfo.scrollIndicatorId == 0xFF) - playerPCItemPageInfo.scrollIndicatorId = AddScrollIndicatorArrowPairParameterized(SCROLL_ARROW_UP, 0xB0, 0xC, 0x94, playerPCItemPageInfo.count - playerPCItemPageInfo.pageItems, 0x13F8, 0x13F8, &(playerPCItemPageInfo.itemsAbove)); + if (playerPCItemPageInfo.scrollIndicatorTaskId == TASK_NONE) + playerPCItemPageInfo.scrollIndicatorTaskId = AddScrollIndicatorArrowPairParameterized(SCROLL_ARROW_UP, 0xB0, 0xC, 0x94, playerPCItemPageInfo.count - playerPCItemPageInfo.pageItems, 0x13F8, 0x13F8, &(playerPCItemPageInfo.itemsAbove)); } static void ItemStorage_RemoveScrollIndicator(void) { - if (playerPCItemPageInfo.scrollIndicatorId != 0xFF) + if (playerPCItemPageInfo.scrollIndicatorTaskId != TASK_NONE) { - RemoveScrollIndicatorArrowPair(playerPCItemPageInfo.scrollIndicatorId); - playerPCItemPageInfo.scrollIndicatorId = 0xFF; + RemoveScrollIndicatorArrowPair(playerPCItemPageInfo.scrollIndicatorTaskId); + playerPCItemPageInfo.scrollIndicatorTaskId = TASK_NONE; } } diff --git a/src/pokeblock.c b/src/pokeblock.c index 4485fe1ef..8c73213fc 100644 --- a/src/pokeblock.c +++ b/src/pokeblock.c @@ -432,7 +432,7 @@ void OpenPokeblockCase(u8 caseId, void (*callback)(void)) sPokeblockMenu = Alloc(sizeof(*sPokeblockMenu)); sPokeblockMenu->caseId = caseId; sPokeblockMenu->callbackOnUse = NULL; - sPokeblockMenu->unkTaskId = 0xFF; + sPokeblockMenu->unkTaskId = TASK_NONE; sPokeblockMenu->isSwapping = FALSE; sSavedPokeblockData.callback = callback; @@ -898,7 +898,7 @@ static void sub_8136344(void) static void sub_81363BC(void) { - if (sPokeblockMenu->unkTaskId == 0xFF) + if (sPokeblockMenu->unkTaskId == TASK_NONE) { sPokeblockMenu->unkTaskId = AddScrollIndicatorArrowPairParameterized(SCROLL_ARROW_UP, 0xB0, 8, 0x98, sPokeblockMenu->itemsNo - sPokeblockMenu->maxShowed, 0x456, 0x456, &sSavedPokeblockData.lastItemPage); @@ -907,10 +907,10 @@ static void sub_81363BC(void) static void sub_8136418(void) { - if (sPokeblockMenu->unkTaskId != 0xFF) + if (sPokeblockMenu->unkTaskId != TASK_NONE) { RemoveScrollIndicatorArrowPair(sPokeblockMenu->unkTaskId); - sPokeblockMenu->unkTaskId = 0xFF; + sPokeblockMenu->unkTaskId = TASK_NONE; } } diff --git a/src/pokemon.c b/src/pokemon.c index f0d50ba0e..2abf9cb56 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -6706,7 +6706,7 @@ void PokemonSummaryDoMonAnimation(struct Sprite* sprite, u16 species, bool8 oneF void StopPokemonAnimationDelayTask(void) { u8 delayTaskId = FindTaskIdByFunc(Task_PokemonSummaryAnimateAfterDelay); - if (delayTaskId != 0xFF) + if (delayTaskId != TASK_NONE) DestroyTask(delayTaskId); } diff --git a/src/pokemon_summary_screen.c b/src/pokemon_summary_screen.c index 53ec7c1d1..a48d967ab 100644 --- a/src/pokemon_summary_screen.c +++ b/src/pokemon_summary_screen.c @@ -2401,7 +2401,7 @@ static void HandlePowerAccTilemap(u16 a, s16 b) else { u8 taskId = FindTaskIdByFunc(Task_ShowPowerAccWindow); - if (taskId == 0xFF) + if (taskId == TASK_NONE) taskId = CreateTask(Task_ShowPowerAccWindow, 8); gTasks[taskId].data[0] = b; gTasks[taskId].data[1] = a; @@ -2453,7 +2453,7 @@ static void HandleAppealJamTilemap(u16 a, s16 b, u16 move) else { u8 taskId = FindTaskIdByFunc(Task_ShowAppealJamWindow); - if (taskId == 0xFF) + if (taskId == TASK_NONE) taskId = CreateTask(Task_ShowAppealJamWindow, 8); gTasks[taskId].data[0] = b; gTasks[taskId].data[1] = a; @@ -3940,10 +3940,10 @@ void SummaryScreen_SetUnknownTaskId(u8 taskId) void SummaryScreen_DestroyUnknownTask(void) { - if (sUnknownTaskId != 0xFF) + if (sUnknownTaskId != TASK_NONE) { DestroyTask(sUnknownTaskId); - sUnknownTaskId = 0xFF; + sUnknownTaskId = TASK_NONE; } } diff --git a/src/pokenav_match_call_2.c b/src/pokenav_match_call_2.c index adcd889d3..593581d0e 100755 --- a/src/pokenav_match_call_2.c +++ b/src/pokenav_match_call_2.c @@ -890,7 +890,7 @@ static void sub_81CBC1C(void) static void sub_81CBC38(int arg0) { u8 taskId = FindTaskIdByFunc(sub_81CBC64); - if (taskId != 0xFF) + if (taskId != TASK_NONE) gTasks[taskId].data[15] = arg0; } diff --git a/src/scanline_effect.c b/src/scanline_effect.c index 1d5814429..dc3ca03f4 100644 --- a/src/scanline_effect.c +++ b/src/scanline_effect.c @@ -22,10 +22,10 @@ void ScanlineEffect_Stop(void) { gScanlineEffect.state = 0; DmaStop(0); - if (gScanlineEffect.waveTaskId != 0xFF) + if (gScanlineEffect.waveTaskId != TASK_NONE) { DestroyTask(gScanlineEffect.waveTaskId); - gScanlineEffect.waveTaskId = 0xFF; + gScanlineEffect.waveTaskId = TASK_NONE; } } @@ -40,7 +40,7 @@ void ScanlineEffect_Clear(void) gScanlineEffect.state = 0; gScanlineEffect.unused16 = 0; gScanlineEffect.unused17 = 0; - gScanlineEffect.waveTaskId = 0xFF; + gScanlineEffect.waveTaskId = TASK_NONE; } void ScanlineEffect_SetParams(struct ScanlineEffectParams params) @@ -132,7 +132,7 @@ static void TaskFunc_UpdateWavePerFrame(u8 taskId) if (sShouldStopWaveTask) { DestroyTask(taskId); - gScanlineEffect.waveTaskId = 0xFF; + gScanlineEffect.waveTaskId = TASK_NONE; } else { diff --git a/src/script_menu.c b/src/script_menu.c index 425cdc251..51c37b5b6 100644 --- a/src/script_menu.c +++ b/src/script_menu.c @@ -580,7 +580,7 @@ bool8 ScriptMenu_ShowPokemonPic(u16 species, u8 x, u8 y) u8 taskId; u8 spriteId; - if (FindTaskIdByFunc(Task_PokemonPicWindow) != 0xFF) + if (FindTaskIdByFunc(Task_PokemonPicWindow) != TASK_NONE) { return FALSE; } @@ -604,7 +604,7 @@ bool8 (*ScriptMenu_GetPicboxWaitFunc(void))(void) { u8 taskId = FindTaskIdByFunc(Task_PokemonPicWindow); - if (taskId == 0xFF) + if (taskId == TASK_NONE) return NULL; gTasks[taskId].tState++; return IsPicboxClosed; @@ -612,7 +612,7 @@ bool8 (*ScriptMenu_GetPicboxWaitFunc(void))(void) static bool8 IsPicboxClosed(void) { - if (FindTaskIdByFunc(Task_PokemonPicWindow) == 0xFF) + if (FindTaskIdByFunc(Task_PokemonPicWindow) == TASK_NONE) return TRUE; else return FALSE; diff --git a/src/script_movement.c b/src/script_movement.c index 4eb305980..013270697 100644 --- a/src/script_movement.c +++ b/src/script_movement.c @@ -52,7 +52,7 @@ void ScriptMovement_UnfreezeObjectEvents(void) u8 taskId; taskId = GetMoveObjectsTaskId(); - if (taskId != 0xFF) + if (taskId != TASK_NONE) { ScriptMovement_UnfreezeActiveObjects(taskId); DestroyTask(taskId); diff --git a/src/shop.c b/src/shop.c index 04afc7d0b..5b44b5872 100755 --- a/src/shop.c +++ b/src/shop.c @@ -448,7 +448,7 @@ static void CB2_InitBuyMenu(void) ResetTasks(); ClearScheduledBgCopiesToVram(); gShopDataPtr = AllocZeroed(sizeof(struct ShopData)); - gShopDataPtr->scrollIndicatorsTaskId = 0xFF; + gShopDataPtr->scrollIndicatorsTaskId = TASK_NONE; gShopDataPtr->itemSpriteIds[0] = 0xFF; gShopDataPtr->itemSpriteIds[1] = 0xFF; BuyMenuBuildListMenuTemplate(); @@ -581,7 +581,7 @@ static void BuyMenuPrintPriceInList(u8 windowId, s32 item, u8 y) static void BuyMenuAddScrollIndicatorArrows(void) { - if (gShopDataPtr->scrollIndicatorsTaskId == 0xFF && gMartInfo.itemCount + 1 > 8) + if (gShopDataPtr->scrollIndicatorsTaskId == TASK_NONE && gMartInfo.itemCount + 1 > 8) { gShopDataPtr->scrollIndicatorsTaskId = AddScrollIndicatorArrowPairParameterized( SCROLL_ARROW_UP, @@ -597,10 +597,10 @@ static void BuyMenuAddScrollIndicatorArrows(void) static void BuyMenuRemoveScrollIndicatorArrows(void) { - if (gShopDataPtr->scrollIndicatorsTaskId != 0xFF) + if (gShopDataPtr->scrollIndicatorsTaskId != TASK_NONE) { RemoveScrollIndicatorArrowPair(gShopDataPtr->scrollIndicatorsTaskId); - gShopDataPtr->scrollIndicatorsTaskId = 0xFF; + gShopDataPtr->scrollIndicatorsTaskId = TASK_NONE; } } diff --git a/src/slot_machine.c b/src/slot_machine.c index 7cfd7d22e..806bf750d 100644 --- a/src/slot_machine.c +++ b/src/slot_machine.c @@ -3409,7 +3409,7 @@ static void OpenInfoBox(u8 digDisplayId) static bool8 IsInfoBoxClosed(void) { - if (FindTaskIdByFunc(RunInfoBoxActions) == 0xFF) + if (FindTaskIdByFunc(RunInfoBoxActions) == TASK_NONE) return TRUE; else return FALSE; diff --git a/src/starter_choose.c b/src/starter_choose.c index 587169841..aa8b87237 100644 --- a/src/starter_choose.c +++ b/src/starter_choose.c @@ -464,7 +464,7 @@ void CB2_ChooseStarter(void) gSprites[spriteId].sTaskId = taskId; gSprites[spriteId].sBallId = 2; - sStarterLabelWindowId = 0xFF; + sStarterLabelWindowId = WINDOW_NONE; } static void CB2_StarterChoose(void) diff --git a/src/task.c b/src/task.c index 3a3ddadfd..68fb679b3 100644 --- a/src/task.c +++ b/src/task.c @@ -171,7 +171,7 @@ u8 FindTaskIdByFunc(TaskFunc func) if (gTasks[i].isActive == TRUE && gTasks[i].func == func) return (u8)i; - return TAIL_SENTINEL; // No task was found. + return TASK_NONE; // No task was found. } u8 GetTaskCount(void) diff --git a/src/tileset_anims.c b/src/tileset_anims.c index 087b75b7c..f566fe3e0 100644 --- a/src/tileset_anims.c +++ b/src/tileset_anims.c @@ -1169,7 +1169,7 @@ static void BlendAnimPalette_BattleDome_FloorLights(u16 timer) { CpuCopy16(gTilesetAnims_BattleDomeFloorLightPals[timer % 4], gPlttBufferUnfaded + 0x80, 32); BlendPalette(0x80, 16, gPaletteFade.y, gPaletteFade.blendColor & 0x7FFF); - if ((u8)FindTaskIdByFunc(TransitionPhase1_Task_RunFuncs) != 0xFF ) + if ((u8)FindTaskIdByFunc(TransitionPhase1_Task_RunFuncs) != TASK_NONE) { sSecondaryTilesetAnimCallback = TilesetAnim_BattleDome2; sSecondaryTilesetAnimCounterMax = 32; @@ -1179,7 +1179,7 @@ static void BlendAnimPalette_BattleDome_FloorLights(u16 timer) static void BlendAnimPalette_BattleDome_FloorLightsNoBlend(u16 timer) { CpuCopy16(gTilesetAnims_BattleDomeFloorLightPals[timer % 4], gPlttBufferUnfaded + 0x80, 32); - if ((u8)FindTaskIdByFunc(TransitionPhase1_Task_RunFuncs) == 0xFF ) + if ((u8)FindTaskIdByFunc(TransitionPhase1_Task_RunFuncs) == TASK_NONE) { BlendPalette(0x80, 16, gPaletteFade.y, gPaletteFade.blendColor & 0x7FFF); if (!--sSecondaryTilesetAnimCounterMax) diff --git a/src/trainer_card.c b/src/trainer_card.c index 2d9ec2b09..791f1c290 100755 --- a/src/trainer_card.c +++ b/src/trainer_card.c @@ -1588,7 +1588,7 @@ static void FlipTrainerCard(void) static bool8 IsCardFlipTaskActive(void) { - if (FindTaskIdByFunc(Task_DoCardFlipTask) == 0xFF) + if (FindTaskIdByFunc(Task_DoCardFlipTask) == TASK_NONE) return TRUE; else return FALSE; diff --git a/src/union_room_chat.c b/src/union_room_chat.c index 131c57bbb..7b54dc751 100755 --- a/src/union_room_chat.c +++ b/src/union_room_chat.c @@ -2157,8 +2157,8 @@ static void FreeDisplay(void) static void InitDisplay(struct UnionRoomChatDisplay *display) { - display->yesNoMenuWindowId = 0xFF; - display->messageWindowId = 0xFF; + display->yesNoMenuWindowId = WINDOW_NONE; + display->messageWindowId = WINDOW_NONE; display->currLine = 0; } @@ -2737,7 +2737,7 @@ static void AddYesNoMenuAt(u8 left, u8 top, u8 initialCursorPos) static void HideYesNoMenuWindow(void) { - if (sDisplay->yesNoMenuWindowId != 0xFF) + if (sDisplay->yesNoMenuWindowId != WINDOW_NONE) { ClearStdWindowAndFrameToTransparent(sDisplay->yesNoMenuWindowId, FALSE); ClearWindowTilemap(sDisplay->yesNoMenuWindowId); @@ -2746,10 +2746,10 @@ static void HideYesNoMenuWindow(void) static void DestroyYesNoMenuWindow(void) { - if (sDisplay->yesNoMenuWindowId != 0xFF) + if (sDisplay->yesNoMenuWindowId != WINDOW_NONE) { RemoveWindow(sDisplay->yesNoMenuWindowId); - sDisplay->yesNoMenuWindowId = 0xFF; + sDisplay->yesNoMenuWindowId = WINDOW_NONE; } } @@ -2828,7 +2828,7 @@ static void AddStdMessageWindow(int msgId, u16 bg0vofs) static void HideStdMessageWindow(void) { - if (sDisplay->messageWindowId != 0xFF) + if (sDisplay->messageWindowId != WINDOW_NONE) { ClearStdWindowAndFrameToTransparent(sDisplay->messageWindowId, FALSE); ClearWindowTilemap(sDisplay->messageWindowId); @@ -2839,10 +2839,10 @@ static void HideStdMessageWindow(void) static void DestroyStdMessageWindow(void) { - if (sDisplay->messageWindowId != 0xFF) + if (sDisplay->messageWindowId != WINDOW_NONE) { RemoveWindow(sDisplay->messageWindowId); - sDisplay->messageWindowId = 0xFF; + sDisplay->messageWindowId = WINDOW_NONE; } } From b04f0aaa2beb4dad08f78716ce1865b797fc34bd Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sat, 20 Feb 2021 00:30:37 -0500 Subject: [PATCH 4/9] Use SPRITE_NONE constant --- gflib/sprite.c | 39 +++++++++++------- gflib/sprite.h | 1 + src/battle_anim.c | 8 ++-- src/battle_anim_dark.c | 8 ++-- src/battle_anim_ground.c | 2 +- src/battle_anim_mon_movement.c | 6 +-- src/battle_anim_mons.c | 4 +- src/battle_dome.c | 74 +++++++++++++++++----------------- src/battle_pyramid_bag.c | 6 +-- src/hall_of_fame.c | 24 +++++------ src/item_menu_icons.c | 6 +-- src/link_rfu_3.c | 4 +- src/main_menu.c | 2 +- src/party_menu.c | 8 ++-- src/player_pc.c | 8 ++-- src/pokemon_summary_screen.c | 16 ++++---- src/pokenav_conditions_2.c | 14 +++---- src/shop.c | 10 ++--- src/use_pokeblock.c | 8 ++-- 19 files changed, 129 insertions(+), 119 deletions(-) diff --git a/gflib/sprite.c b/gflib/sprite.c index 2616aeaed..764ead3d3 100644 --- a/gflib/sprite.c +++ b/gflib/sprite.c @@ -33,6 +33,12 @@ struct SpriteCopyRequest u16 size; }; +struct OamDimensions32 +{ + s32 width; + s32 height; +}; + struct OamDimensions { s8 width; @@ -240,25 +246,28 @@ static const AffineAnimCmdFunc sAffineAnimCmdFuncs[] = AffineAnimCmd_frame, }; -static const s32 sUnknown_082EC6F4[3][4][2] = +static const struct OamDimensions32 sOamDimensions32[3][4] = { + [ST_OAM_SQUARE] = { - {8, 8}, - {0x10, 0x10}, - {0x20, 0x20}, - {0x40, 0x40}, + [SPRITE_SIZE(8x8)] = { 8, 8 }, + [SPRITE_SIZE(16x16)] = { 16, 16 }, + [SPRITE_SIZE(32x32)] = { 32, 32 }, + [SPRITE_SIZE(64x64)] = { 64, 64 }, }, + [ST_OAM_H_RECTANGLE] = { - {0x10, 8}, - {0x20, 8}, - {0x20, 0x10}, - {0x40, 0x20}, + [SPRITE_SIZE(16x8)] = { 16, 8 }, + [SPRITE_SIZE(32x8)] = { 32, 8 }, + [SPRITE_SIZE(32x16)] = { 32, 16 }, + [SPRITE_SIZE(64x32)] = { 64, 32 }, }, + [ST_OAM_V_RECTANGLE] = { - {8, 0x10}, - {8, 0x20}, - {0x10, 0x20}, - {0x20, 0x40}, + [SPRITE_SIZE(8x16)] = { 8, 16 }, + [SPRITE_SIZE(8x32)] = { 8, 32 }, + [SPRITE_SIZE(16x32)] = { 16, 32 }, + [SPRITE_SIZE(32x64)] = { 32, 64 }, }, }; @@ -1233,14 +1242,14 @@ void obj_update_pos2(struct Sprite *sprite, s32 a1, s32 a2) u32 matrixNum = sprite->oam.matrixNum; if (a1 != 0x800) { - var0 = sUnknown_082EC6F4[sprite->oam.shape][sprite->oam.size][0]; + var0 = sOamDimensions32[sprite->oam.shape][sprite->oam.size].width; var1 = var0 << 8; var2 = (var0 << 16) / gOamMatrices[matrixNum].a; sprite->pos2.x = sub_8007E28(var1, var2, a1); } if (a2 != 0x800) { - var0 = sUnknown_082EC6F4[sprite->oam.shape][sprite->oam.size][1]; + var0 = sOamDimensions32[sprite->oam.shape][sprite->oam.size].height; var1 = var0 << 8; var2 = (var0 << 16) / gOamMatrices[matrixNum].d; sprite->pos2.y = sub_8007E28(var1, var2, a2); diff --git a/gflib/sprite.h b/gflib/sprite.h index c9ba9585d..4a3b48225 100644 --- a/gflib/sprite.h +++ b/gflib/sprite.h @@ -2,6 +2,7 @@ #define GUARD_SPRITE_H #define MAX_SPRITES 64 +#define SPRITE_NONE 0xFF #define SPRITE_INVALID_TAG 0xFFFF struct SpriteSheet diff --git a/src/battle_anim.c b/src/battle_anim.c index 46df413ed..50bf267b5 100644 --- a/src/battle_anim.c +++ b/src/battle_anim.c @@ -3362,7 +3362,7 @@ static void ScriptCmd_invisible(void) u8 spriteId; spriteId = GetAnimBattlerSpriteId(sBattleAnimScriptPtr[1]); - if (spriteId != 0xFF) + if (spriteId != SPRITE_NONE) gSprites[spriteId].invisible = TRUE; sBattleAnimScriptPtr += 2; @@ -3373,7 +3373,7 @@ static void ScriptCmd_visible(void) u8 spriteId; spriteId = GetAnimBattlerSpriteId(sBattleAnimScriptPtr[1]); - if (spriteId != 0xFF) + if (spriteId != SPRITE_NONE) gSprites[spriteId].invisible = FALSE; sBattleAnimScriptPtr += 2; @@ -3400,7 +3400,7 @@ static void ScriptCmd_doublebattle_2D(void) r4 = GetBattlerSpriteBGPriorityRank(gBattleAnimTarget); spriteId = GetAnimBattlerSpriteId(ANIM_TARGET); } - if (spriteId != 0xFF) + if (spriteId != SPRITE_NONE) { gSprites[spriteId].invisible = FALSE; if (r4 == 2) @@ -3436,7 +3436,7 @@ static void ScriptCmd_doublebattle_2E(void) spriteId = GetAnimBattlerSpriteId(ANIM_TARGET); } - if (spriteId != 0xFF && r4 == 2) + if (spriteId != SPRITE_NONE && r4 == 2) gSprites[spriteId].oam.priority = 2; } } diff --git a/src/battle_anim_dark.c b/src/battle_anim_dark.c index 7253b5247..88548b19e 100644 --- a/src/battle_anim_dark.c +++ b/src/battle_anim_dark.c @@ -764,7 +764,7 @@ static void sub_8114374(u8 priority) for (i = 0; i < MAX_BATTLERS_COUNT; i++) { u8 spriteId = GetAnimBattlerSpriteId(i); - if (spriteId != 0xFF) + if (spriteId != SPRITE_NONE) gSprites[spriteId].oam.priority = priority; } } @@ -960,7 +960,7 @@ void AnimTask_SetGreyscaleOrOriginalPal(u8 taskId) calcSpriteId = TRUE; break; default: - spriteId = 0xFF; + spriteId = SPRITE_NONE; break; } @@ -970,10 +970,10 @@ void AnimTask_SetGreyscaleOrOriginalPal(u8 taskId) if (IsBattlerSpriteVisible(battler)) spriteId = gBattlerSpriteIds[battler]; else - spriteId = 0xFF; + spriteId = SPRITE_NONE; } - if (spriteId != 0xFF) + if (spriteId != SPRITE_NONE) SetGreyscaleOrOriginalPalette(gSprites[spriteId].oam.paletteNum + 16, gBattleAnimArgs[1]); DestroyAnimVisualTask(taskId); diff --git a/src/battle_anim_ground.c b/src/battle_anim_ground.c index 875ecbd75..37caf81e7 100644 --- a/src/battle_anim_ground.c +++ b/src/battle_anim_ground.c @@ -603,7 +603,7 @@ void AnimTask_HorizontalShake(u8 taskId) break; default: // Shake specific battler task->tbattlerSpriteIds(0) = GetAnimBattlerSpriteId(gBattleAnimArgs[0]); - if (task->tbattlerSpriteIds(0) == 0xFF) + if (task->tbattlerSpriteIds(0) == SPRITE_NONE) { DestroyAnimVisualTask(taskId); } diff --git a/src/battle_anim_mon_movement.c b/src/battle_anim_mon_movement.c index e789e4680..b9c4c7b30 100644 --- a/src/battle_anim_mon_movement.c +++ b/src/battle_anim_mon_movement.c @@ -94,7 +94,7 @@ void AnimTask_ShakeMon(u8 taskId) { u8 spriteId; spriteId = GetAnimBattlerSpriteId(gBattleAnimArgs[0]); - if (spriteId == 0xff) + if (spriteId == SPRITE_NONE) { DestroyAnimVisualTask(taskId); return; @@ -162,7 +162,7 @@ void AnimTask_ShakeMon2(u8 taskId) if (gBattleAnimArgs[0] < MAX_BATTLERS_COUNT) { spriteId = GetAnimBattlerSpriteId(gBattleAnimArgs[0]); - if (spriteId == 0xff) + if (spriteId == SPRITE_NONE) { DestroyAnimVisualTask(taskId); return; @@ -255,7 +255,7 @@ static void AnimTask_ShakeMon2_Step(u8 taskId) void AnimTask_ShakeMonInPlace(u8 taskId) { u8 spriteId = GetAnimBattlerSpriteId(gBattleAnimArgs[0]); - if (spriteId == 0xff) + if (spriteId == SPRITE_NONE) { DestroyAnimVisualTask(taskId); return; diff --git a/src/battle_anim_mons.c b/src/battle_anim_mons.c index 3e86f31f7..0258357a6 100644 --- a/src/battle_anim_mons.c +++ b/src/battle_anim_mons.c @@ -1569,7 +1569,7 @@ s16 CloneBattlerSpriteWithBlend(u8 animBattler) u16 i; u8 spriteId = GetAnimBattlerSpriteId(animBattler); - if (spriteId != 0xFF) + if (spriteId != SPRITE_NONE) { for (i = 0; i < MAX_SPRITES; i++) { @@ -1655,7 +1655,7 @@ static void AnimTask_AlphaFadeIn_Step(u8 taskId) void AnimTask_BlendMonInAndOut(u8 task) { u8 spriteId = GetAnimBattlerSpriteId(gBattleAnimArgs[0]); - if (spriteId == 0xff) + if (spriteId == SPRITE_NONE) { DestroyAnimVisualTask(task); return; diff --git a/src/battle_dome.c b/src/battle_dome.c index cce3aaccd..0b6281a91 100644 --- a/src/battle_dome.c +++ b/src/battle_dome.c @@ -3040,7 +3040,7 @@ static void Task_ShowTourneyInfoCard(u8 taskId) SetVBlankCallback(VblankCb_TourneyInfoCard); sInfoCard = AllocZeroed(sizeof(*sInfoCard)); for (i = 0; i < NUM_INFOCARD_SPRITES; i++) - sInfoCard->spriteIds[i] = 0xFF; + sInfoCard->spriteIds[i] = SPRITE_NONE; LoadMonIconPalettes(); i = CreateTask(Task_HandleInfoCardInput, 0); gTasks[i].data[0] = 0; @@ -3105,7 +3105,7 @@ static void SpriteCb_TrainerIconCardScrollUp(struct Sprite *sprite) { if (sprite->pos1.y >= 192) { - sInfoCard->spriteIds[sprite->data[2]] = 0xFF; + sInfoCard->spriteIds[sprite->data[2]] = SPRITE_NONE; FreeAndDestroyTrainerPicSprite(sprite->data[3]); } } @@ -3125,7 +3125,7 @@ static void SpriteCb_TrainerIconCardScrollDown(struct Sprite *sprite) { if (sprite->pos1.y <= -32) { - sInfoCard->spriteIds[sprite->data[2]] = 0xFF; + sInfoCard->spriteIds[sprite->data[2]] = SPRITE_NONE; FreeAndDestroyTrainerPicSprite(sprite->data[3]); } } @@ -3145,7 +3145,7 @@ static void SpriteCb_TrainerIconCardScrollLeft(struct Sprite *sprite) { if (sprite->pos1.x >= 272) { - sInfoCard->spriteIds[sprite->data[2]] = 0xFF; + sInfoCard->spriteIds[sprite->data[2]] = SPRITE_NONE; FreeAndDestroyTrainerPicSprite(sprite->data[3]); } } @@ -3165,7 +3165,7 @@ static void SpriteCb_TrainerIconCardScrollRight(struct Sprite *sprite) { if (sprite->pos1.x <= -32) { - sInfoCard->spriteIds[sprite->data[2]] = 0xFF; + sInfoCard->spriteIds[sprite->data[2]] = SPRITE_NONE; FreeAndDestroyTrainerPicSprite(sprite->data[3]); } } @@ -3195,7 +3195,7 @@ static void SpriteCb_MonIconCardScrollUp(struct Sprite *sprite) { if (sprite->pos1.y >= 176) { - sInfoCard->spriteIds[sprite->data[2]] = 0xFF; + sInfoCard->spriteIds[sprite->data[2]] = SPRITE_NONE; FreeAndDestroyMonIconSprite(sprite); } } @@ -3217,7 +3217,7 @@ static void SpriteCb_MonIconCardScrollDown(struct Sprite *sprite) { if (sprite->pos1.y <= -16) { - sInfoCard->spriteIds[sprite->data[2]] = 0xFF; + sInfoCard->spriteIds[sprite->data[2]] = SPRITE_NONE; FreeAndDestroyMonIconSprite(sprite); } } @@ -3239,7 +3239,7 @@ static void SpriteCb_MonIconCardScrollLeft(struct Sprite *sprite) { if (sprite->pos1.x >= 256) { - sInfoCard->spriteIds[sprite->data[2]] = 0xFF; + sInfoCard->spriteIds[sprite->data[2]] = SPRITE_NONE; FreeAndDestroyMonIconSprite(sprite); } } @@ -3261,7 +3261,7 @@ static void SpriteCb_MonIconCardScrollRight(struct Sprite *sprite) { if (sprite->pos1.x <= -16) { - sInfoCard->spriteIds[sprite->data[2]] = 0xFF; + sInfoCard->spriteIds[sprite->data[2]] = SPRITE_NONE; FreeAndDestroyMonIconSprite(sprite); } } @@ -3500,7 +3500,7 @@ static void Task_HandleInfoCardInput(u8 taskId) { if (i < 2) { - if (sInfoCard->spriteIds[i] != 0xFF) + if (sInfoCard->spriteIds[i] != SPRITE_NONE) { gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollUp; gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1; @@ -3511,7 +3511,7 @@ static void Task_HandleInfoCardInput(u8 taskId) } else { - if (sInfoCard->spriteIds[i] != 0xFF) + if (sInfoCard->spriteIds[i] != SPRITE_NONE) { gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollUp; gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1; @@ -3524,7 +3524,7 @@ static void Task_HandleInfoCardInput(u8 taskId) { if (i < 10) { - if (sInfoCard->spriteIds[i] != 0xFF) + if (sInfoCard->spriteIds[i] != SPRITE_NONE) { gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollUp; gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot; @@ -3535,7 +3535,7 @@ static void Task_HandleInfoCardInput(u8 taskId) } else { - if (sInfoCard->spriteIds[i] != 0xFF) + if (sInfoCard->spriteIds[i] != SPRITE_NONE) { gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollUp; gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot; @@ -3616,7 +3616,7 @@ static void Task_HandleInfoCardInput(u8 taskId) { if (i < 2) { - if (sInfoCard->spriteIds[i] != 0xFF) + if (sInfoCard->spriteIds[i] != SPRITE_NONE) { gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollDown; gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1; @@ -3627,7 +3627,7 @@ static void Task_HandleInfoCardInput(u8 taskId) } else { - if (sInfoCard->spriteIds[i] != 0xFF) + if (sInfoCard->spriteIds[i] != SPRITE_NONE) { gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollDown; gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1; @@ -3640,7 +3640,7 @@ static void Task_HandleInfoCardInput(u8 taskId) { if (i < 10) { - if (sInfoCard->spriteIds[i] != 0xFF) + if (sInfoCard->spriteIds[i] != SPRITE_NONE) { gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollDown; gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot; @@ -3651,7 +3651,7 @@ static void Task_HandleInfoCardInput(u8 taskId) } else { - if (sInfoCard->spriteIds[i] != 0xFF) + if (sInfoCard->spriteIds[i] != SPRITE_NONE) { gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollDown; gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot; @@ -3699,7 +3699,7 @@ static void Task_HandleInfoCardInput(u8 taskId) { if (i < 2) { - if (sInfoCard->spriteIds[i] != 0xFF) + if (sInfoCard->spriteIds[i] != SPRITE_NONE) { gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollLeft; gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1; @@ -3710,7 +3710,7 @@ static void Task_HandleInfoCardInput(u8 taskId) } else { - if (sInfoCard->spriteIds[i] != 0xFF) + if (sInfoCard->spriteIds[i] != SPRITE_NONE) { gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollLeft; gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1; @@ -3723,7 +3723,7 @@ static void Task_HandleInfoCardInput(u8 taskId) { if (i < 10) { - if (sInfoCard->spriteIds[i] != 0xFF) + if (sInfoCard->spriteIds[i] != SPRITE_NONE) { gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollLeft; gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot; @@ -3734,7 +3734,7 @@ static void Task_HandleInfoCardInput(u8 taskId) } else { - if (sInfoCard->spriteIds[i] != 0xFF) + if (sInfoCard->spriteIds[i] != SPRITE_NONE) { gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollLeft; gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot; @@ -3782,7 +3782,7 @@ static void Task_HandleInfoCardInput(u8 taskId) { if (i < 2) { - if (sInfoCard->spriteIds[i] != 0xFF) + if (sInfoCard->spriteIds[i] != SPRITE_NONE) { gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollLeft; gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1; @@ -3793,7 +3793,7 @@ static void Task_HandleInfoCardInput(u8 taskId) } else { - if (sInfoCard->spriteIds[i] != 0xFF) + if (sInfoCard->spriteIds[i] != SPRITE_NONE) { gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollLeft; gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1; @@ -3806,7 +3806,7 @@ static void Task_HandleInfoCardInput(u8 taskId) { if (i < 10) { - if (sInfoCard->spriteIds[i] != 0xFF) + if (sInfoCard->spriteIds[i] != SPRITE_NONE) { gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollLeft; gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot; @@ -3817,7 +3817,7 @@ static void Task_HandleInfoCardInput(u8 taskId) } else { - if (sInfoCard->spriteIds[i] != 0xFF) + if (sInfoCard->spriteIds[i] != SPRITE_NONE) { gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollLeft; gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot; @@ -3863,7 +3863,7 @@ static void Task_HandleInfoCardInput(u8 taskId) { if (i < 2) { - if (sInfoCard->spriteIds[i] != 0xFF) + if (sInfoCard->spriteIds[i] != SPRITE_NONE) { gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollRight; gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1; @@ -3874,7 +3874,7 @@ static void Task_HandleInfoCardInput(u8 taskId) } else { - if (sInfoCard->spriteIds[i] != 0xFF) + if (sInfoCard->spriteIds[i] != SPRITE_NONE) { gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollRight; gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1; @@ -3887,7 +3887,7 @@ static void Task_HandleInfoCardInput(u8 taskId) { if (i < 10) { - if (sInfoCard->spriteIds[i] != 0xFF) + if (sInfoCard->spriteIds[i] != SPRITE_NONE) { gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollRight; gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot; @@ -3898,7 +3898,7 @@ static void Task_HandleInfoCardInput(u8 taskId) } else { - if (sInfoCard->spriteIds[i] != 0xFF) + if (sInfoCard->spriteIds[i] != SPRITE_NONE) { gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollRight; gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot; @@ -3946,7 +3946,7 @@ static void Task_HandleInfoCardInput(u8 taskId) { if (i < 2) { - if (sInfoCard->spriteIds[i] != 0xFF) + if (sInfoCard->spriteIds[i] != SPRITE_NONE) { gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollRight; gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1; @@ -3957,7 +3957,7 @@ static void Task_HandleInfoCardInput(u8 taskId) } else { - if (sInfoCard->spriteIds[i] != 0xFF) + if (sInfoCard->spriteIds[i] != SPRITE_NONE) { gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollRight; gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1; @@ -3970,7 +3970,7 @@ static void Task_HandleInfoCardInput(u8 taskId) { if (i < 10) { - if (sInfoCard->spriteIds[i] != 0xFF) + if (sInfoCard->spriteIds[i] != SPRITE_NONE) { gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollRight; gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot; @@ -3981,7 +3981,7 @@ static void Task_HandleInfoCardInput(u8 taskId) } else { - if (sInfoCard->spriteIds[i] != 0xFF) + if (sInfoCard->spriteIds[i] != SPRITE_NONE) { gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollRight; gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot; @@ -4051,12 +4051,12 @@ static void Task_HandleInfoCardInput(u8 taskId) { if (i < 2) { - if (sInfoCard->spriteIds[i] != 0xFF) + if (sInfoCard->spriteIds[i] != SPRITE_NONE) FreeAndDestroyTrainerPicSprite(sInfoCard->spriteIds[i]); } else { - if (sInfoCard->spriteIds[i] != 0xFF) + if (sInfoCard->spriteIds[i] != SPRITE_NONE) FreeAndDestroyMonIconSprite(&gSprites[sInfoCard->spriteIds[i]]); } } @@ -4064,12 +4064,12 @@ static void Task_HandleInfoCardInput(u8 taskId) { if (i < 10) { - if (sInfoCard->spriteIds[i] != 0xFF) + if (sInfoCard->spriteIds[i] != SPRITE_NONE) FreeAndDestroyTrainerPicSprite(sInfoCard->spriteIds[i]); } else { - if (sInfoCard->spriteIds[i] != 0xFF) + if (sInfoCard->spriteIds[i] != SPRITE_NONE) FreeAndDestroyMonIconSprite(&gSprites[sInfoCard->spriteIds[i]]); } } diff --git a/src/battle_pyramid_bag.c b/src/battle_pyramid_bag.c index 5e3b94e94..c112cfaad 100644 --- a/src/battle_pyramid_bag.c +++ b/src/battle_pyramid_bag.c @@ -1475,13 +1475,13 @@ static void CloseBattlePyramidBagTextWindow(void) static void sub_81C6E38(u8 itemSpriteArrayId) { u8 *spriteId = &gPyramidBagResources->itemsSpriteIds[itemSpriteArrayId]; - if (*spriteId != 0xFF) + if (*spriteId != SPRITE_NONE) { FreeSpriteTilesByTag(ITEM_IMAGE_TAG + itemSpriteArrayId); FreeSpritePaletteByTag(ITEM_IMAGE_TAG + itemSpriteArrayId); FreeSpriteOamMatrix(&gSprites[*spriteId]); DestroySprite(&gSprites[*spriteId]); - *spriteId = 0xFF; + *spriteId = SPRITE_NONE; } } @@ -1526,7 +1526,7 @@ static void ShowItemImage(u16 itemId, u8 itemSpriteArrayId) { u8 itemSpriteId; u8 *spriteId = &gPyramidBagResources->itemsSpriteIds[itemSpriteArrayId + 1]; - if (*spriteId == 0xFF) + if (*spriteId == SPRITE_NONE) { FreeSpriteTilesByTag(ITEM_IMAGE_TAG + 1 + itemSpriteArrayId); FreeSpritePaletteByTag(ITEM_IMAGE_TAG + 1 + itemSpriteArrayId); diff --git a/src/hall_of_fame.c b/src/hall_of_fame.c index fbebc1a3b..1fe055ba0 100644 --- a/src/hall_of_fame.c +++ b/src/hall_of_fame.c @@ -464,11 +464,11 @@ static void Task_Hof_InitMonData(u8 taskId) sHofFadePalettes = 0; gTasks[taskId].tDisplayedMonId = 0; - gTasks[taskId].tPlayerSpriteID = 0xFF; + gTasks[taskId].tPlayerSpriteID = SPRITE_NONE; for (i = 0; i < PARTY_SIZE; i++) { - gTasks[taskId].tMonSpriteId(i) = 0xFF; + gTasks[taskId].tMonSpriteId(i) = SPRITE_NONE; } if (gTasks[taskId].tDontSaveData) @@ -642,7 +642,7 @@ static void Task_Hof_PaletteFadeAndPrintWelcomeText(u8 taskId) BeginNormalPaletteFade(0xFFFF0000, 0, 0, 0, RGB_BLACK); for (i = 0; i < PARTY_SIZE; i++) { - if (gTasks[taskId].tMonSpriteId(i) != 0xFF) + if (gTasks[taskId].tMonSpriteId(i) != SPRITE_NONE) gSprites[gTasks[taskId].tMonSpriteId(i)].oam.priority = 0; } @@ -668,7 +668,7 @@ static void Task_Hof_DoConfetti(u8 taskId) u16 i; for (i = 0; i < PARTY_SIZE; i++) { - if (gTasks[taskId].tMonSpriteId(i) != 0xFF) + if (gTasks[taskId].tMonSpriteId(i) != SPRITE_NONE) gSprites[gTasks[taskId].tMonSpriteId(i)].oam.priority = 1; } BeginNormalPaletteFade(sHofFadePalettes, 0, 12, 12, RGB(16, 29, 24)); @@ -752,7 +752,7 @@ static void Task_Hof_HandleExit(u8 taskId) for (i = 0; i < PARTY_SIZE; i++) { u8 spriteId = gTasks[taskId].tMonSpriteId(i); - if (spriteId != 0xFF) + if (spriteId != SPRITE_NONE) { FreeOamMatrix(gSprites[spriteId].oam.matrixNum); FreeAndDestroyMonPicSprite(spriteId); @@ -847,7 +847,7 @@ void CB2_DoHallOfFamePC(void) for (i = 0; i < PARTY_SIZE; i++) { - gTasks[taskId].tMonSpriteId(i) = 0xFF; + gTasks[taskId].tMonSpriteId(i) = SPRITE_NONE; } sHofMonPtr = AllocZeroed(0x2000); @@ -937,7 +937,7 @@ static void Task_HofPC_DrawSpritesPrintText(u8 taskId) } else { - gTasks[taskId].tMonSpriteId(i) = 0xFF; + gTasks[taskId].tMonSpriteId(i) = SPRITE_NONE; } } @@ -967,7 +967,7 @@ static void Task_HofPC_PrintMonInfo(u8 taskId) for (i = 0; i < PARTY_SIZE; i++) { u16 spriteId = gTasks[taskId].tMonSpriteId(i); - if (spriteId != 0xFF) + if (spriteId != SPRITE_NONE) gSprites[spriteId].oam.priority = 1; } @@ -999,10 +999,10 @@ static void Task_HofPC_HandleInput(u8 taskId) for (i = 0; i < PARTY_SIZE; i++) { u8 spriteId = gTasks[taskId].tMonSpriteId(i); - if (spriteId != 0xFF) + if (spriteId != SPRITE_NONE) { FreeAndDestroyMonPicSprite(spriteId); - gTasks[taskId].tMonSpriteId(i) = 0xFF; + gTasks[taskId].tMonSpriteId(i) = SPRITE_NONE; } } if (gTasks[taskId].tCurrPageNo != 0) @@ -1060,10 +1060,10 @@ static void Task_HofPC_HandleExit(u8 taskId) for (i = 0; i < PARTY_SIZE; i++) { u16 spriteId = gTasks[taskId].tMonSpriteId(i); - if (spriteId != 0xFF) + if (spriteId != SPRITE_NONE) { FreeAndDestroyMonPicSprite(spriteId); - gTasks[taskId].tMonSpriteId(i) = 0xFF; + gTasks[taskId].tMonSpriteId(i) = SPRITE_NONE; } } diff --git a/src/item_menu_icons.c b/src/item_menu_icons.c index cc51236c8..dd0081161 100644 --- a/src/item_menu_icons.c +++ b/src/item_menu_icons.c @@ -410,13 +410,13 @@ static const struct SpriteTemplate gBerryCheckCircleSpriteTemplate = void RemoveBagSprite(u8 id) { u8 *spriteId = &gBagMenu->spriteId[id]; - if (*spriteId != 0xFF) + if (*spriteId != SPRITE_NONE) { FreeSpriteTilesByTag(id + 100); FreeSpritePaletteByTag(id + 100); FreeSpriteOamMatrix(&gSprites[*spriteId]); DestroySprite(&gSprites[*spriteId]); - *spriteId = 0xFF; + *spriteId = SPRITE_NONE; } } @@ -516,7 +516,7 @@ static void SpriteCB_SwitchPocketRotatingBallContinue(struct Sprite *sprite) void AddBagItemIconSprite(u16 itemId, u8 id) { u8 *spriteId = &gBagMenu->spriteId[id + 2]; - if (*spriteId == 0xFF) + if (*spriteId == SPRITE_NONE) { u8 iconSpriteId; diff --git a/src/link_rfu_3.c b/src/link_rfu_3.c index c6344f503..f47167873 100644 --- a/src/link_rfu_3.c +++ b/src/link_rfu_3.c @@ -792,7 +792,7 @@ void LoadWirelessStatusIndicatorSpriteGfx(void) LoadCompressedSpriteSheet(&sWirelessStatusIndicatorSpriteSheet); } LoadSpritePalette(&sWirelessStatusIndicatorSpritePalette); - gWirelessStatusIndicatorSpriteId = 0xFF; + gWirelessStatusIndicatorSpriteId = SPRITE_NONE; } static u8 GetParentSignalStrength(void) @@ -822,7 +822,7 @@ static void SetWirelessStatusIndicatorAnim(struct Sprite *sprite, s32 animNum) void UpdateWirelessStatusIndicatorSprite(void) { - if (gWirelessStatusIndicatorSpriteId != 0xFF && gSprites[gWirelessStatusIndicatorSpriteId].sValidator == STATUS_INDICATOR_ACTIVE) + if (gWirelessStatusIndicatorSpriteId != SPRITE_NONE && gSprites[gWirelessStatusIndicatorSpriteId].sValidator == STATUS_INDICATOR_ACTIVE) { struct Sprite *sprite = &gSprites[gWirelessStatusIndicatorSpriteId]; u8 signalStrength = RFU_LINK_ICON_LEVEL4_MAX; diff --git a/src/main_menu.c b/src/main_menu.c index 74af96da8..5b4044ed2 100644 --- a/src/main_menu.c +++ b/src/main_menu.c @@ -1287,7 +1287,7 @@ static void Task_NewGameBirchSpeech_Init(u8 taskId) BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK); gTasks[taskId].tBG1HOFS = 0; gTasks[taskId].func = Task_NewGameBirchSpeech_WaitToShowBirch; - gTasks[taskId].tPlayerSpriteId = 0xFF; + gTasks[taskId].tPlayerSpriteId = SPRITE_NONE; gTasks[taskId].data[3] = 0xFF; gTasks[taskId].tTimer = 0xD8; PlayBGM(MUS_ROUTE122); diff --git a/src/party_menu.c b/src/party_menu.c index dbb5cf0e6..a648d6d04 100755 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -731,10 +731,10 @@ static void InitPartyMenuBoxes(u8 layout) sPartyMenuBoxes[i].infoRects = &sPartyBoxInfoRects[PARTY_BOX_RIGHT_COLUMN]; sPartyMenuBoxes[i].spriteCoords = sPartyMenuSpriteCoords[layout][i]; sPartyMenuBoxes[i].windowId = i; - sPartyMenuBoxes[i].monSpriteId = 0xFF; - sPartyMenuBoxes[i].itemSpriteId = 0xFF; - sPartyMenuBoxes[i].pokeballSpriteId = 0xFF; - sPartyMenuBoxes[i].statusSpriteId = 0xFF; + sPartyMenuBoxes[i].monSpriteId = SPRITE_NONE; + sPartyMenuBoxes[i].itemSpriteId = SPRITE_NONE; + sPartyMenuBoxes[i].pokeballSpriteId = SPRITE_NONE; + sPartyMenuBoxes[i].statusSpriteId = SPRITE_NONE; } // The first party mon goes in the left column sPartyMenuBoxes[0].infoRects = &sPartyBoxInfoRects[PARTY_BOX_LEFT_COLUMN]; diff --git a/src/player_pc.c b/src/player_pc.c index 1a9c10459..f272ad55d 100644 --- a/src/player_pc.c +++ b/src/player_pc.c @@ -874,7 +874,7 @@ static void sub_816BC14(void) gUnknown_0203BCC4 = AllocZeroed(sizeof(struct Struct203BCC4)); memset(gUnknown_0203BCC4->windowIds, 0xFF, 0x6); gUnknown_0203BCC4->unk666 = 0xFF; - gUnknown_0203BCC4->spriteId = 0xFF; + gUnknown_0203BCC4->spriteId = SPRITE_NONE; } static void sub_816BC58(void) @@ -1015,7 +1015,7 @@ static void sub_816C060(u16 itemId) u8 spriteId; u8* spriteIdLoc = &(gUnknown_0203BCC4->spriteId); - if (*spriteIdLoc == 0xFF) + if (*spriteIdLoc == SPRITE_NONE) { FreeSpriteTilesByTag(0x13F6); FreeSpritePaletteByTag(0x13F6); @@ -1033,12 +1033,12 @@ static void sub_816C060(u16 itemId) static void sub_816C0C8(void) { u8* spriteIdLoc = &(gUnknown_0203BCC4->spriteId); - if (*spriteIdLoc != 0xFF) + if (*spriteIdLoc != SPRITE_NONE) { FreeSpriteTilesByTag(0x13F6); FreeSpritePaletteByTag(0x13F6); DestroySprite(&(gSprites[*spriteIdLoc])); - *spriteIdLoc = 0xFF; + *spriteIdLoc = SPRITE_NONE; } } diff --git a/src/pokemon_summary_screen.c b/src/pokemon_summary_screen.c index a48d967ab..b05291cd1 100644 --- a/src/pokemon_summary_screen.c +++ b/src/pokemon_summary_screen.c @@ -1216,7 +1216,7 @@ static bool8 LoadGraphics(void) break; case 17: sMonSummaryScreen->spriteIds[SPRITE_ARR_ID_MON] = LoadMonGfxAndSprite(&sMonSummaryScreen->currentMon, &sMonSummaryScreen->switchCounter); - if (sMonSummaryScreen->spriteIds[SPRITE_ARR_ID_MON] != 0xFF) + if (sMonSummaryScreen->spriteIds[SPRITE_ARR_ID_MON] != SPRITE_NONE) { sMonSummaryScreen->switchCounter = 0; gMain.state++; @@ -1626,7 +1626,7 @@ static void Task_ChangeSummaryMon(u8 taskId) break; case 8: sMonSummaryScreen->spriteIds[SPRITE_ARR_ID_MON] = LoadMonGfxAndSprite(&sMonSummaryScreen->currentMon, &data[1]); - if (sMonSummaryScreen->spriteIds[SPRITE_ARR_ID_MON] == 0xFF) + if (sMonSummaryScreen->spriteIds[SPRITE_ARR_ID_MON] == SPRITE_NONE) return; gSprites[sMonSummaryScreen->spriteIds[SPRITE_ARR_ID_MON]].data[2] = 1; TryDrawExperienceProgressBar(); @@ -3692,15 +3692,15 @@ static void ResetSpriteIds(void) u8 i; for (i = 0; i < ARRAY_COUNT(sMonSummaryScreen->spriteIds); i++) - sMonSummaryScreen->spriteIds[i] = 0xFF; + sMonSummaryScreen->spriteIds[i] = SPRITE_NONE; } static void DestroySpriteInArray(u8 spriteArrayId) { - if (sMonSummaryScreen->spriteIds[spriteArrayId] != 0xFF) + if (sMonSummaryScreen->spriteIds[spriteArrayId] != SPRITE_NONE) { DestroySprite(&gSprites[sMonSummaryScreen->spriteIds[spriteArrayId]]); - sMonSummaryScreen->spriteIds[spriteArrayId] = 0xFF; + sMonSummaryScreen->spriteIds[spriteArrayId] = SPRITE_NONE; } } @@ -3716,7 +3716,7 @@ static void HidePageSpecificSprites(void) for (i = SPRITE_ARR_ID_TYPE; i < ARRAY_COUNT(sMonSummaryScreen->spriteIds); i++) { - if (sMonSummaryScreen->spriteIds[i] != 0xFF) + if (sMonSummaryScreen->spriteIds[i] != SPRITE_NONE) SetSpriteInvisibility(i, TRUE); } } @@ -3745,7 +3745,7 @@ static void CreateMoveTypeIcons(void) for (i = SPRITE_ARR_ID_TYPE; i < SPRITE_ARR_ID_TYPE + 5; i++) { - if (sMonSummaryScreen->spriteIds[i] == 0xFF) + if (sMonSummaryScreen->spriteIds[i] == SPRITE_NONE) sMonSummaryScreen->spriteIds[i] = CreateSprite(&sSpriteTemplate_MoveTypes, 0, 0, 2); SetSpriteInvisibility(i, TRUE); @@ -4010,7 +4010,7 @@ static void CreateSetStatusSprite(void) u8 *spriteId = &sMonSummaryScreen->spriteIds[SPRITE_ARR_ID_STATUS]; u8 statusAnim; - if (*spriteId == 0xFF) + if (*spriteId == SPRITE_NONE) *spriteId = CreateSprite(&sSpriteTemplate_StatusCondition, 64, 152, 0); statusAnim = GetMonAilment(&sMonSummaryScreen->currentMon); diff --git a/src/pokenav_conditions_2.c b/src/pokenav_conditions_2.c index c0e8c7d6d..039ce0c5f 100644 --- a/src/pokenav_conditions_2.c +++ b/src/pokenav_conditions_2.c @@ -161,7 +161,7 @@ bool32 OpenPartyConditionMenu(void) if (structPtr == NULL) return FALSE; - structPtr->monPicSpriteId = 0xFF; + structPtr->monPicSpriteId = SPRITE_NONE; structPtr->loopedTaskId = CreateLoopedTask(LoopedTask_OpenPartyConditionGraph, 1); structPtr->callback = GetPartyConditionLoopedTaskActive; structPtr->windowModeState = 0; @@ -694,7 +694,7 @@ void CreateMonMarkingsOrPokeballIndicators(void) } else { - structPtr->partyPokeballSpriteIds[i] = 0xFF; + structPtr->partyPokeballSpriteIds[i] = SPRITE_NONE; } } @@ -710,7 +710,7 @@ void CreateMonMarkingsOrPokeballIndicators(void) } else { - structPtr->partyPokeballSpriteIds[i] = 0xFF; + structPtr->partyPokeballSpriteIds[i] = SPRITE_NONE; } } @@ -725,7 +725,7 @@ void CreateMonMarkingsOrPokeballIndicators(void) } else { - structPtr->partyPokeballSpriteIds[i] = 0xFF; + structPtr->partyPokeballSpriteIds[i] = SPRITE_NONE; } } @@ -759,7 +759,7 @@ void sub_81CEBF4(struct Pokenav7Struct *structPtr) FreeSpritePaletteByTag(0x66); } - if (structPtr->monPicSpriteId != 0xFF) + if (structPtr->monPicSpriteId != SPRITE_NONE) { DestroySprite(&gSprites[structPtr->monPicSpriteId]); FreeSpriteTilesByTag(0x64); @@ -803,7 +803,7 @@ void CreateConditionMonPic(u8 id) u8 spriteId; struct Pokenav7Struct *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MON_MARK_MENU); - if (structPtr->monPicSpriteId == 0xFF) + if (structPtr->monPicSpriteId == SPRITE_NONE) { LoadConditionMonPicTemplate(&sprSheet, &sprTemplate, &sprPal); sprSheet.data = GetConditionMonPicGfx(id); @@ -816,7 +816,7 @@ void CreateConditionMonPic(u8 id) { FreeSpriteTilesByTag(0x64); FreeSpritePaletteByTag(0x64); - structPtr->monPicSpriteId = 0xFF; + structPtr->monPicSpriteId = SPRITE_NONE; } else { diff --git a/src/shop.c b/src/shop.c index 5b44b5872..53610723e 100755 --- a/src/shop.c +++ b/src/shop.c @@ -449,8 +449,8 @@ static void CB2_InitBuyMenu(void) ClearScheduledBgCopiesToVram(); gShopDataPtr = AllocZeroed(sizeof(struct ShopData)); gShopDataPtr->scrollIndicatorsTaskId = TASK_NONE; - gShopDataPtr->itemSpriteIds[0] = 0xFF; - gShopDataPtr->itemSpriteIds[1] = 0xFF; + gShopDataPtr->itemSpriteIds[0] = SPRITE_NONE; + gShopDataPtr->itemSpriteIds[1] = SPRITE_NONE; BuyMenuBuildListMenuTemplate(); BuyMenuInitBgs(); FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 0x20, 0x20); @@ -614,7 +614,7 @@ static void BuyMenuAddItemIcon(u16 item, u8 iconSlot) { u8 spriteId; u8 *spriteIdPtr = &gShopDataPtr->itemSpriteIds[iconSlot]; - if (*spriteIdPtr != 0xFF) + if (*spriteIdPtr != SPRITE_NONE) return; if (gMartInfo.martType == MART_TYPE_NORMAL || item == 0xFFFF) @@ -638,13 +638,13 @@ static void BuyMenuAddItemIcon(u16 item, u8 iconSlot) static void BuyMenuRemoveItemIcon(u16 item, u8 iconSlot) { u8 *spriteIdPtr = &gShopDataPtr->itemSpriteIds[iconSlot]; - if (*spriteIdPtr == 0xFF) + if (*spriteIdPtr == SPRITE_NONE) return; FreeSpriteTilesByTag(iconSlot + 2110); FreeSpritePaletteByTag(iconSlot + 2110); DestroySprite(&gSprites[*spriteIdPtr]); - *spriteIdPtr = 0xFF; + *spriteIdPtr = SPRITE_NONE; } static void BuyMenuInitBgs(void) diff --git a/src/use_pokeblock.c b/src/use_pokeblock.c index b4ccbfe06..7298ac9f1 100644 --- a/src/use_pokeblock.c +++ b/src/use_pokeblock.c @@ -486,7 +486,7 @@ static void LoadUsePokeblockMenu(void) switch (sInfo->mainState) { case 0: - sMenu->curMonSpriteId = 0xFF; + sMenu->curMonSpriteId = SPRITE_NONE; InitConditionGraphData(&sMenu->graph); sInfo->mainState++; break; @@ -853,7 +853,7 @@ static void CloseUsePokeblockMenu(void) for (i = 0; i < ARRAY_COUNT(sMenu->condition); i++) DestroySprite(sMenu->condition[i]); - if (sMenu->curMonSpriteId != 0xFF) + if (sMenu->curMonSpriteId != SPRITE_NONE) DestroySprite(&gSprites[sMenu->curMonSpriteId]); SetVBlankCallback(NULL); @@ -1215,7 +1215,7 @@ static void UpdateMonPic(u8 loadId) struct SpriteSheet spriteSheet; struct SpritePalette spritePal; - if (sMenu->curMonSpriteId == 0xFF) + if (sMenu->curMonSpriteId == SPRITE_NONE) { LoadConditionMonPicTemplate(&spriteSheet, &spriteTemplate, &spritePal); spriteSheet.data = sMenu->partySheets[loadId]; @@ -1228,7 +1228,7 @@ static void UpdateMonPic(u8 loadId) { FreeSpriteTilesByTag(TAG_CONDITION_MON); FreeSpritePaletteByTag(TAG_CONDITION_MON); - sMenu->curMonSpriteId = 0xFF; + sMenu->curMonSpriteId = SPRITE_NONE; } else { From 1cac608dbedeaaccd2446891c38a71f10230bfc0 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sat, 20 Feb 2021 15:15:38 -0500 Subject: [PATCH 5/9] Document mail --- include/constants/items.h | 4 +- include/constants/pokemon.h | 2 - include/graphics.h | 38 ++ include/international_string_util.h | 4 +- include/pokemon_icon.h | 6 +- src/data/items.h | 24 +- src/evolution_scene.c | 3 +- src/international_string_util.c | 8 +- src/mail.c | 639 ++++++++++++++++++---------- src/mail_data.c | 22 +- src/menu_specialized.c | 6 +- src/mevent_801BAAC.c | 4 +- src/mystery_event_script.c | 8 +- src/party_menu.c | 2 +- src/player_pc.c | 16 +- src/pokemon_icon.c | 6 +- src/trade.c | 4 +- 17 files changed, 521 insertions(+), 275 deletions(-) diff --git a/include/constants/items.h b/include/constants/items.h index 71338da8e..8f77e80de 100644 --- a/include/constants/items.h +++ b/include/constants/items.h @@ -495,7 +495,9 @@ #define NUM_ROUTE_114_MAN_BERRIES (LAST_ROUTE_114_MAN_BERRY - FIRST_ROUTE_114_MAN_BERRY + 1) #define NUM_ROUTE_114_MAN_BERRIES_SKIPPED (FIRST_ROUTE_114_MAN_BERRY - FIRST_BERRY_INDEX) -#define ITEM_TO_BERRY(itemId)(((itemId - FIRST_BERRY_INDEX) + 1)) +#define ITEM_TO_BERRY(itemId)(((itemId) - FIRST_BERRY_INDEX) + 1) +#define ITEM_TO_MAIL(itemId)((itemId) - FIRST_MAIL_INDEX) +#define MAIL_NONE 0xFF #define NUM_TECHNICAL_MACHINES 50 #define NUM_HIDDEN_MACHINES 8 diff --git a/include/constants/pokemon.h b/include/constants/pokemon.h index a0bb2c7ce..11a7c7fc5 100644 --- a/include/constants/pokemon.h +++ b/include/constants/pokemon.h @@ -288,8 +288,6 @@ #define MAX_TOTAL_EVS 510 #define EV_ITEM_RAISE_LIMIT 100 -#define UNOWN_FORM_COUNT 28 - // Battle move flags #define FLAG_MAKES_CONTACT (1 << 0) #define FLAG_PROTECT_AFFECTED (1 << 1) diff --git a/include/graphics.h b/include/graphics.h index bade0b0a7..a78498d16 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -5025,4 +5025,42 @@ extern const u16 gObjectEventPal_May[]; extern const u16 gObjectEventPal_RubySapphireBrendan[]; extern const u16 gObjectEventPal_RubySapphireMay[]; +// Mail +extern const u16 gMailPalette_Orange[]; +extern const u16 gMailPalette_Harbor[]; +extern const u16 gMailPalette_Glitter[]; +extern const u16 gMailPalette_Mech[]; +extern const u16 gMailPalette_Wood[]; +extern const u16 gMailPalette_Wave[]; +extern const u16 gMailPalette_Bead[]; +extern const u16 gMailPalette_Shadow[]; +extern const u16 gMailPalette_Tropic[]; +extern const u16 gMailPalette_Dream[]; +extern const u16 gMailPalette_Fab[]; +extern const u16 gMailPalette_Retro[]; +extern const u8 gMailTiles_Orange[]; +extern const u8 gMailTilemap_Orange[]; +extern const u8 gMailTiles_Harbor[]; +extern const u8 gMailTilemap_Harbor[]; +extern const u8 gMailTiles_Glitter[]; +extern const u8 gMailTilemap_Glitter[]; +extern const u8 gMailTiles_Mech[]; +extern const u8 gMailTilemap_Mech[]; +extern const u8 gMailTiles_Wood[]; +extern const u8 gMailTilemap_Wood[]; +extern const u8 gMailTiles_Wave[]; +extern const u8 gMailTilemap_Wave[]; +extern const u8 gMailTiles_Bead[]; +extern const u8 gMailTilemap_Bead[]; +extern const u8 gMailTiles_Shadow[]; +extern const u8 gMailTilemap_Shadow[]; +extern const u8 gMailTiles_Tropic[]; +extern const u8 gMailTilemap_Tropic[]; +extern const u8 gMailTiles_Dream[]; +extern const u8 gMailTilemap_Dream[]; +extern const u8 gMailTiles_Fab[]; +extern const u8 gMailTilemap_Fab[]; +extern const u8 gMailTiles_Retro[]; +extern const u8 gMailTilemap_Retro[]; + #endif //GUARD_GRAPHICS_H diff --git a/include/international_string_util.h b/include/international_string_util.h index cf3c5f723..f76fc5be1 100644 --- a/include/international_string_util.h +++ b/include/international_string_util.h @@ -4,7 +4,7 @@ #include "menu.h" #include "list_menu.h" -void sub_81DB52C(u8 *src); +void ConvertInternationalPlayerName(u8 *src); void TVShowConvertInternationalString(u8 *dest, const u8 *src, int language); int GetStringCenterAlignXOffset(int fontId, const u8 *str, int totalWidth); int GetStringRightAlignXOffset(int fontId, const u8 *str, int totalWidth); @@ -16,7 +16,7 @@ int Intl_GetListMenuWidth(const struct ListMenuTemplate *listMenu); void CopyMonCategoryText(int dexNum, u8 *dest); u8 *sub_81DB494(u8 *str, int fontId, const u8 *str2, int totalStringWidth); void PadNameString(u8 *dest, u8 padChar); -void sub_81DB554(u8 *, u8); +void ConvertInternationalPlayerNameStripChar(u8 *, u8); void sub_81DB5AC(u8 *); int sub_81DB604(u8 *); void sub_81DB620(int windowId, int columnStart, int rowStart, int numFillTiles, int numRows); diff --git a/include/pokemon_icon.h b/include/pokemon_icon.h index dbd7f2895..c0f823bb1 100644 --- a/include/pokemon_icon.h +++ b/include/pokemon_icon.h @@ -10,14 +10,14 @@ const u8 *GetMonIconPtr(u16 speciesId, u32 personality, u32 frameNo); const u16 *GetValidMonIconPalettePtr(u16 speciesId); u16 GetIconSpecies(u16 species, u32 personality); u16 GetUnownLetterByPersonality(u32 personality); -u16 sub_80D2E84(u16 speciesId); +u16 GetIconSpeciesNoPersonality(u16 speciesId); void LoadMonIconPalettes(void); void LoadMonIconPalette(u16 species); void FreeMonIconPalettes(void); -u8 sub_80D2D78(u16 species, void (*callback)(struct Sprite *), s16 x, s16 y, u8 subpriority, bool32 extra); +u8 CreateMonIconNoPersonality(u16 species, void (*callback)(struct Sprite *), s16 x, s16 y, u8 subpriority, bool32 handleDeoxys); void FreeMonIconPalette(u16 species); void FreeAndDestroyMonIconSprite(struct Sprite *sprite); -u8 CreateMonIcon(u16 species, void (*callback)(struct Sprite *), s16 x, s16 y, u8 subpriority, u32 personality, bool32 extra); +u8 CreateMonIcon(u16 species, void (*callback)(struct Sprite *), s16 x, s16 y, u8 subpriority, u32 personality, bool32 handleDeoxys); u8 UpdateMonIconFrame(struct Sprite *sprite); void LoadMonIconPalette(u16 species); void sub_80D328C(struct Sprite *sprite); diff --git a/src/data/items.h b/src/data/items.h index 443c45f1a..e4e7e0fbc 100644 --- a/src/data/items.h +++ b/src/data/items.h @@ -1479,7 +1479,7 @@ const struct Item gItems[] = .pocket = POCKET_ITEMS, .type = ITEM_USE_MAIL, .fieldUseFunc = ItemUseOutOfBattle_Mail, - .secondaryId = ITEM_ORANGE_MAIL - FIRST_MAIL_INDEX, + .secondaryId = ITEM_TO_MAIL(ITEM_ORANGE_MAIL), }, [ITEM_HARBOR_MAIL] = @@ -1491,7 +1491,7 @@ const struct Item gItems[] = .pocket = POCKET_ITEMS, .type = ITEM_USE_MAIL, .fieldUseFunc = ItemUseOutOfBattle_Mail, - .secondaryId = ITEM_HARBOR_MAIL - FIRST_MAIL_INDEX, + .secondaryId = ITEM_TO_MAIL(ITEM_HARBOR_MAIL), }, [ITEM_GLITTER_MAIL] = @@ -1503,7 +1503,7 @@ const struct Item gItems[] = .pocket = POCKET_ITEMS, .type = ITEM_USE_MAIL, .fieldUseFunc = ItemUseOutOfBattle_Mail, - .secondaryId = ITEM_GLITTER_MAIL - FIRST_MAIL_INDEX, + .secondaryId = ITEM_TO_MAIL(ITEM_GLITTER_MAIL), }, [ITEM_MECH_MAIL] = @@ -1515,7 +1515,7 @@ const struct Item gItems[] = .pocket = POCKET_ITEMS, .type = ITEM_USE_MAIL, .fieldUseFunc = ItemUseOutOfBattle_Mail, - .secondaryId = ITEM_MECH_MAIL - FIRST_MAIL_INDEX, + .secondaryId = ITEM_TO_MAIL(ITEM_MECH_MAIL), }, [ITEM_WOOD_MAIL] = @@ -1527,7 +1527,7 @@ const struct Item gItems[] = .pocket = POCKET_ITEMS, .type = ITEM_USE_MAIL, .fieldUseFunc = ItemUseOutOfBattle_Mail, - .secondaryId = ITEM_WOOD_MAIL - FIRST_MAIL_INDEX, + .secondaryId = ITEM_TO_MAIL(ITEM_WOOD_MAIL), }, [ITEM_WAVE_MAIL] = @@ -1539,7 +1539,7 @@ const struct Item gItems[] = .pocket = POCKET_ITEMS, .type = ITEM_USE_MAIL, .fieldUseFunc = ItemUseOutOfBattle_Mail, - .secondaryId = ITEM_WAVE_MAIL - FIRST_MAIL_INDEX, + .secondaryId = ITEM_TO_MAIL(ITEM_WAVE_MAIL), }, [ITEM_BEAD_MAIL] = @@ -1551,7 +1551,7 @@ const struct Item gItems[] = .pocket = POCKET_ITEMS, .type = ITEM_USE_MAIL, .fieldUseFunc = ItemUseOutOfBattle_Mail, - .secondaryId = ITEM_BEAD_MAIL - FIRST_MAIL_INDEX, + .secondaryId = ITEM_TO_MAIL(ITEM_BEAD_MAIL), }, [ITEM_SHADOW_MAIL] = @@ -1563,7 +1563,7 @@ const struct Item gItems[] = .pocket = POCKET_ITEMS, .type = ITEM_USE_MAIL, .fieldUseFunc = ItemUseOutOfBattle_Mail, - .secondaryId = ITEM_SHADOW_MAIL - FIRST_MAIL_INDEX, + .secondaryId = ITEM_TO_MAIL(ITEM_SHADOW_MAIL), }, [ITEM_TROPIC_MAIL] = @@ -1575,7 +1575,7 @@ const struct Item gItems[] = .pocket = POCKET_ITEMS, .type = ITEM_USE_MAIL, .fieldUseFunc = ItemUseOutOfBattle_Mail, - .secondaryId = ITEM_TROPIC_MAIL - FIRST_MAIL_INDEX, + .secondaryId = ITEM_TO_MAIL(ITEM_TROPIC_MAIL), }, [ITEM_DREAM_MAIL] = @@ -1587,7 +1587,7 @@ const struct Item gItems[] = .pocket = POCKET_ITEMS, .type = ITEM_USE_MAIL, .fieldUseFunc = ItemUseOutOfBattle_Mail, - .secondaryId = ITEM_DREAM_MAIL - FIRST_MAIL_INDEX, + .secondaryId = ITEM_TO_MAIL(ITEM_DREAM_MAIL), }, [ITEM_FAB_MAIL] = @@ -1599,7 +1599,7 @@ const struct Item gItems[] = .pocket = POCKET_ITEMS, .type = ITEM_USE_MAIL, .fieldUseFunc = ItemUseOutOfBattle_Mail, - .secondaryId = ITEM_FAB_MAIL - FIRST_MAIL_INDEX, + .secondaryId = ITEM_TO_MAIL(ITEM_FAB_MAIL), }, [ITEM_RETRO_MAIL] = @@ -1611,7 +1611,7 @@ const struct Item gItems[] = .pocket = POCKET_ITEMS, .type = ITEM_USE_MAIL, .fieldUseFunc = ItemUseOutOfBattle_Mail, - .secondaryId = ITEM_RETRO_MAIL - FIRST_MAIL_INDEX, + .secondaryId = ITEM_TO_MAIL(ITEM_RETRO_MAIL), }, // Berries diff --git a/src/evolution_scene.c b/src/evolution_scene.c index f77c3d760..88f46d295 100644 --- a/src/evolution_scene.c +++ b/src/evolution_scene.c @@ -32,6 +32,7 @@ #include "constants/battle_string_ids.h" #include "constants/songs.h" #include "constants/rgb.h" +#include "constants/items.h" struct EvoInfo { @@ -565,7 +566,7 @@ static void CreateShedinja(u16 preEvoSpecies, struct Pokemon* mon) SetMonData(&gPlayerParty[gPlayerPartyCount], i, &data); SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_STATUS, &data); - data = 0xFF; + data = MAIL_NONE; SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_MAIL, &data); CalculateMonStats(&gPlayerParty[gPlayerPartyCount]); diff --git a/src/international_string_util.c b/src/international_string_util.c index c2b4b43cf..ed1e17816 100644 --- a/src/international_string_util.c +++ b/src/international_string_util.c @@ -152,7 +152,7 @@ void PadNameString(u8 *dest, u8 padChar) dest[length] = EOS; } -void sub_81DB52C(u8 *str) +void ConvertInternationalPlayerName(u8 *str) { if (StringLength(str) < PLAYER_NAME_LENGTH - 1) ConvertInternationalString(str, LANGUAGE_JAPANESE); @@ -160,14 +160,14 @@ void sub_81DB52C(u8 *str) StripExtCtrlCodes(str); } -void sub_81DB554(u8 *str, u8 arg1) +void ConvertInternationalPlayerNameStripChar(u8 *str, u8 removeChar) { u8 *buffer; if (StringLength(str) < PLAYER_NAME_LENGTH - 1) { ConvertInternationalString(str, LANGUAGE_JAPANESE); } - else if (arg1 == EXT_CTRL_CODE_BEGIN) + else if (removeChar == EXT_CTRL_CODE_BEGIN) { StripExtCtrlCodes(str); } @@ -177,7 +177,7 @@ void sub_81DB554(u8 *str, u8 arg1) while (buffer[1] != EOS) buffer++; - while (buffer >= str && buffer[0] == arg1) + while (buffer >= str && buffer[0] == removeChar) { buffer[0] = EOS; buffer--; diff --git a/src/mail.c b/src/mail.c index 09d5bfc44..e2fe22f51 100644 --- a/src/mail.c +++ b/src/mail.c @@ -18,62 +18,31 @@ #include "pokemon_icon.h" #include "malloc.h" #include "easy_chat.h" +#include "graphics.h" #include "constants/rgb.h" -extern const u16 gMailPalette_Orange[]; -extern const u16 gMailPalette_Harbor[]; -extern const u16 gMailPalette_Glitter[]; -extern const u16 gMailPalette_Mech[]; -extern const u16 gMailPalette_Wood[]; -extern const u16 gMailPalette_Wave[]; -extern const u16 gMailPalette_Bead[]; -extern const u16 gMailPalette_Shadow[]; -extern const u16 gMailPalette_Tropic[]; -extern const u16 gMailPalette_Dream[]; -extern const u16 gMailPalette_Fab[]; -extern const u16 gMailPalette_Retro[]; -extern const u8 gMailTiles_Orange[]; -extern const u8 gMailTilemap_Orange[]; -extern const u8 gMailTiles_Harbor[]; -extern const u8 gMailTilemap_Harbor[]; -extern const u8 gMailTiles_Glitter[]; -extern const u8 gMailTilemap_Glitter[]; -extern const u8 gMailTiles_Mech[]; -extern const u8 gMailTilemap_Mech[]; -extern const u8 gMailTiles_Wood[]; -extern const u8 gMailTilemap_Wood[]; -extern const u8 gMailTiles_Wave[]; -extern const u8 gMailTilemap_Wave[]; -extern const u8 gMailTiles_Bead[]; -extern const u8 gMailTilemap_Bead[]; -extern const u8 gMailTiles_Shadow[]; -extern const u8 gMailTilemap_Shadow[]; -extern const u8 gMailTiles_Tropic[]; -extern const u8 gMailTilemap_Tropic[]; -extern const u8 gMailTiles_Dream[]; -extern const u8 gMailTilemap_Dream[]; -extern const u8 gMailTiles_Fab[]; -extern const u8 gMailTilemap_Fab[]; -extern const u8 gMailTiles_Retro[]; -extern const u8 gMailTilemap_Retro[]; +// Bead and Dream mail feature an icon of the Pokémon holding it. +enum { + ICON_TYPE_NONE, + ICON_TYPE_BEAD, + ICON_TYPE_DREAM, +}; -// Static type declarations - -struct UnkMailStruct +struct MailLineLayout { - u32 numEasyChatWords:2; - u32 xOffset:6; - u32 lineHeight:8; + u8 numEasyChatWords:2; + u8 xOffset:6; + u8 height; }; struct MailLayout { - u8 numSubStructs; + u8 numLines; u8 signatureYPos; u8 signatureWidth; - u8 wordsXPos; u8 wordsYPos; - const struct UnkMailStruct *var8; + u8 wordsXPos; + const struct MailLineLayout *lines; }; struct MailGraphics @@ -81,26 +50,25 @@ struct MailGraphics const u16 *palette; const u8 *tiles; const u8 *tileMap; - u16 var0C; - u16 var0E; - u16 color10; - u16 color12; + u32 unused; + u16 textColor; + u16 textShadow; }; struct MailRead { - /*0x0000*/ u8 strbuf[8][64]; + /*0x0000*/ u8 message[8][64]; /*0x0200*/ u8 playerName[12]; - /*0x020C*/ MainCallback callback; - /*0x0210*/ MainCallback callback2; + /*0x020C*/ MainCallback exitCallback; + /*0x0210*/ MainCallback callback; /*0x0214*/ struct MailStruct *mail; - /*0x0218*/ bool8 flag; + /*0x0218*/ bool8 hasText; /*0x0219*/ u8 signatureWidth; /*0x021a*/ u8 mailType; - /*0x021b*/ u8 animsActive; - /*0x021c*/ u8 monIconSprite; + /*0x021b*/ u8 iconType; + /*0x021c*/ u8 monIconSpriteId; /*0x021d*/ u8 language; - /*0x021e*/ bool8 playerIsSender; + /*0x021e*/ bool8 international; /*0x0220*/ u8 * (*parserSingle)(u8 *dest, u16 word); /*0x0224*/ u8 * (*parserMultiple)(u8 *dest, const u16 *src, u16 length1, u16 length2); /*0x0228*/ const struct MailLayout *layout; @@ -108,23 +76,17 @@ struct MailRead /*0x122c*/ u8 bg2TilemapBuffer[0x1000]; }; -// Static RAM declarations - static EWRAM_DATA struct MailRead *sMailRead = NULL; -// Static ROM declarations - static void CB2_InitMailRead(void); -static void sub_8121A1C(void); -static void sub_8121B1C(void); +static void BufferMailText(void); +static void PrintMailText(void); static void VBlankCB_MailRead(void); static void CB2_MailRead(void); static void CB2_WaitForPaletteExitOnKeyPress(void); static void CB2_ExitOnKeyPress(void); static void CB2_ExitMailReadFreeVars(void); -// .rodata - static const struct BgTemplate sBgTemplates[] = { { .bg = 0, @@ -144,7 +106,7 @@ static const struct BgTemplate sBgTemplates[] = { } }; -static const struct WindowTemplate sUnknown_0859F29C[] = { +static const struct WindowTemplate sWindowTemplates[] = { { .bg = 0, .tilemapLeft = 2, @@ -163,137 +125,377 @@ static const u8 sTextColors[] = { TEXT_DYNAMIC_COLOR_2 }; -static const u16 sUnknown_0859F2B0[][2] = { - { 0x6ACD, 0x51A5 }, - { 0x45FC, 0x38D4 } +// Background is alternating bars of a dark/light color. +// Either blue or red depending on player's gender +static const u16 sBgColors[GENDER_COUNT][2] = { + [MALE] = { RGB(13, 22, 26), RGB(5, 13, 20) }, + [FEMALE] = { RGB(28, 15, 17), RGB(20, 6, 14) } }; -static const struct MailGraphics sUnknown_0859F2B8[] = { - { - gMailPalette_Orange, gMailTiles_Orange, gMailTilemap_Orange, 0x02c0, 0, 0x294a, 0x6739 - }, { - gMailPalette_Harbor, gMailTiles_Harbor, gMailTilemap_Harbor, 0x02e0, 0, 0x7fff, 0x4631 - }, { - gMailPalette_Glitter, gMailTiles_Glitter, gMailTilemap_Glitter, 0x0400, 0, 0x294a, 0x6739 - }, { - gMailPalette_Mech, gMailTiles_Mech, gMailTilemap_Mech, 0x01e0, 0, 0x7fff, 0x4631 - }, { - gMailPalette_Wood, gMailTiles_Wood, gMailTilemap_Wood, 0x02e0, 0, 0x7fff, 0x4631 - }, { - gMailPalette_Wave, gMailTiles_Wave, gMailTilemap_Wave, 0x0300, 0, 0x294a, 0x6739 - }, { - gMailPalette_Bead, gMailTiles_Bead, gMailTilemap_Bead, 0x0140, 0, 0x7fff, 0x4631 - }, { - gMailPalette_Shadow, gMailTiles_Shadow, gMailTilemap_Shadow, 0x0300, 0, 0x7fff, 0x4631 - }, { - gMailPalette_Tropic, gMailTiles_Tropic, gMailTilemap_Tropic, 0x0220, 0, 0x294a, 0x6739 - }, { - gMailPalette_Dream, gMailTiles_Dream, gMailTilemap_Dream, 0x0340, 0, 0x294a, 0x6739 - }, { - gMailPalette_Fab, gMailTiles_Fab, gMailTilemap_Fab, 0x02a0, 0, 0x294a, 0x6739 - }, { - gMailPalette_Retro, gMailTiles_Retro, gMailTilemap_Retro, 0x0520, 0, 0x294a, 0x6739 +static const struct MailGraphics sMailGraphics[] = { + [ITEM_TO_MAIL(ITEM_ORANGE_MAIL)] = { + .palette = gMailPalette_Orange, + .tiles = gMailTiles_Orange, + .tileMap = gMailTilemap_Orange, + .unused = 0x2C0, + .textColor = RGB(10, 10, 10), + .textShadow = RGB(25, 25, 25), + }, + [ITEM_TO_MAIL(ITEM_HARBOR_MAIL)] = { + .palette = gMailPalette_Harbor, + .tiles = gMailTiles_Harbor, + .tileMap = gMailTilemap_Harbor, + .unused = 0x2E0, + .textColor = RGB_WHITE, + .textShadow = RGB(17, 17, 17), + }, + [ITEM_TO_MAIL(ITEM_GLITTER_MAIL)] = { + .palette = gMailPalette_Glitter, + .tiles = gMailTiles_Glitter, + .tileMap = gMailTilemap_Glitter, + .unused = 0x400, + .textColor = RGB(10, 10, 10), + .textShadow = RGB(25, 25, 25), + }, + [ITEM_TO_MAIL(ITEM_MECH_MAIL)] = { + .palette = gMailPalette_Mech, + .tiles = gMailTiles_Mech, + .tileMap = gMailTilemap_Mech, + .unused = 0x1E0, + .textColor = RGB_WHITE, + .textShadow = RGB(17, 17, 17), + }, + [ITEM_TO_MAIL(ITEM_WOOD_MAIL)] = { + .palette = gMailPalette_Wood, + .tiles = gMailTiles_Wood, + .tileMap = gMailTilemap_Wood, + .unused = 0x2E0, + .textColor = RGB_WHITE, + .textShadow = RGB(17, 17, 17), + }, + [ITEM_TO_MAIL(ITEM_WAVE_MAIL)] = { + .palette = gMailPalette_Wave, + .tiles = gMailTiles_Wave, + .tileMap = gMailTilemap_Wave, + .unused = 0x300, + .textColor = RGB(10, 10, 10), + .textShadow = RGB(25, 25, 25), + }, + [ITEM_TO_MAIL(ITEM_BEAD_MAIL)] = { + .palette = gMailPalette_Bead, + .tiles = gMailTiles_Bead, + .tileMap = gMailTilemap_Bead, + .unused = 0x140, + .textColor = RGB_WHITE, + .textShadow = RGB(17, 17, 17), + }, + [ITEM_TO_MAIL(ITEM_SHADOW_MAIL)] = { + .palette = gMailPalette_Shadow, + .tiles = gMailTiles_Shadow, + .tileMap = gMailTilemap_Shadow, + .unused = 0x300, + .textColor = RGB_WHITE, + .textShadow = RGB(17, 17, 17), + }, + [ITEM_TO_MAIL(ITEM_TROPIC_MAIL)] = { + .palette = gMailPalette_Tropic, + .tiles = gMailTiles_Tropic, + .tileMap = gMailTilemap_Tropic, + .unused = 0x220, + .textColor = RGB(10, 10, 10), + .textShadow = RGB(25, 25, 25), + }, + [ITEM_TO_MAIL(ITEM_DREAM_MAIL)] = { + .palette = gMailPalette_Dream, + .tiles = gMailTiles_Dream, + .tileMap = gMailTilemap_Dream, + .unused = 0x340, + .textColor = RGB(10, 10, 10), + .textShadow = RGB(25, 25, 25), + }, + [ITEM_TO_MAIL(ITEM_FAB_MAIL)] = { + .palette = gMailPalette_Fab, + .tiles = gMailTiles_Fab, + .tileMap = gMailTilemap_Fab, + .unused = 0x2a0, + .textColor = RGB(10, 10, 10), + .textShadow = RGB(25, 25, 25), + }, + [ITEM_TO_MAIL(ITEM_RETRO_MAIL)] = { + .palette = gMailPalette_Retro, + .tiles = gMailTiles_Retro, + .tileMap = gMailTilemap_Retro, + .unused = 0x520, + .textColor = RGB(10, 10, 10), + .textShadow = RGB(25, 25, 25), } }; -static const struct UnkMailStruct Unknown_0859F3A8[] = { - { .numEasyChatWords = 3, .lineHeight = 16 }, - { .numEasyChatWords = 3, .lineHeight = 16 }, - { .numEasyChatWords = 3, .lineHeight = 16 } +static const struct MailLineLayout sLineLayouts_Wide[] = { + { .numEasyChatWords = 3, .xOffset = 0, .height = 16 }, + { .numEasyChatWords = 3, .xOffset = 0, .height = 16 }, + { .numEasyChatWords = 3, .xOffset = 0, .height = 16 } }; -static const struct MailLayout sUnknown_0859F3B4[] = { - { 0x03, 0x00, 0x00, 0x02, 0x04, Unknown_0859F3A8 }, - { 0x03, 0x00, 0x00, 0x02, 0x04, Unknown_0859F3A8 }, - { 0x03, 0x00, 0x00, 0x02, 0x04, Unknown_0859F3A8 }, - { 0x03, 0x00, 0x00, 0x02, 0x04, Unknown_0859F3A8 }, - { 0x03, 0x00, 0x00, 0x02, 0x04, Unknown_0859F3A8 }, - { 0x03, 0x00, 0x00, 0x02, 0x04, Unknown_0859F3A8 }, - { 0x03, 0x00, 0x00, 0x02, 0x04, Unknown_0859F3A8 }, - { 0x03, 0x00, 0x00, 0x02, 0x04, Unknown_0859F3A8 }, - { 0x03, 0x00, 0x00, 0x02, 0x04, Unknown_0859F3A8 }, - { 0x03, 0x00, 0x00, 0x02, 0x04, Unknown_0859F3A8 }, - { 0x03, 0x08, 0x00, 0x02, 0x04, Unknown_0859F3A8 }, - { 0x03, 0x00, 0x00, 0x02, 0x00, Unknown_0859F3A8 } +static const struct MailLayout sMailLayouts_Wide[] = { + [ITEM_TO_MAIL(ITEM_ORANGE_MAIL)] = { + .numLines = ARRAY_COUNT(sLineLayouts_Wide), + .signatureYPos = 0, + .signatureWidth = 0, + .wordsYPos = 2, + .wordsXPos = 4, + .lines = sLineLayouts_Wide, + }, + [ITEM_TO_MAIL(ITEM_HARBOR_MAIL)] = { + .numLines = ARRAY_COUNT(sLineLayouts_Wide), + .signatureYPos = 0, + .signatureWidth = 0, + .wordsYPos = 2, + .wordsXPos = 4, + .lines = sLineLayouts_Wide, + }, + [ITEM_TO_MAIL(ITEM_GLITTER_MAIL)] = { + .numLines = ARRAY_COUNT(sLineLayouts_Wide), + .signatureYPos = 0, + .signatureWidth = 0, + .wordsYPos = 2, + .wordsXPos = 4, + .lines = sLineLayouts_Wide, + }, + [ITEM_TO_MAIL(ITEM_MECH_MAIL)] = { + .numLines = ARRAY_COUNT(sLineLayouts_Wide), + .signatureYPos = 0, + .signatureWidth = 0, + .wordsYPos = 2, + .wordsXPos = 4, + .lines = sLineLayouts_Wide, + }, + [ITEM_TO_MAIL(ITEM_WOOD_MAIL)] = { + .numLines = ARRAY_COUNT(sLineLayouts_Wide), + .signatureYPos = 0, + .signatureWidth = 0, + .wordsYPos = 2, + .wordsXPos = 4, + .lines = sLineLayouts_Wide, + }, + [ITEM_TO_MAIL(ITEM_WAVE_MAIL)] = { + .numLines = ARRAY_COUNT(sLineLayouts_Wide), + .signatureYPos = 0, + .signatureWidth = 0, + .wordsYPos = 2, + .wordsXPos = 4, + .lines = sLineLayouts_Wide, + }, + [ITEM_TO_MAIL(ITEM_BEAD_MAIL)] = { + .numLines = ARRAY_COUNT(sLineLayouts_Wide), + .signatureYPos = 0, + .signatureWidth = 0, + .wordsYPos = 2, + .wordsXPos = 4, + .lines = sLineLayouts_Wide, + }, + [ITEM_TO_MAIL(ITEM_SHADOW_MAIL)] = { + .numLines = ARRAY_COUNT(sLineLayouts_Wide), + .signatureYPos = 0, + .signatureWidth = 0, + .wordsYPos = 2, + .wordsXPos = 4, + .lines = sLineLayouts_Wide, + }, + [ITEM_TO_MAIL(ITEM_TROPIC_MAIL)] = { + .numLines = ARRAY_COUNT(sLineLayouts_Wide), + .signatureYPos = 0, + .signatureWidth = 0, + .wordsYPos = 2, + .wordsXPos = 4, + .lines = sLineLayouts_Wide, + }, + [ITEM_TO_MAIL(ITEM_DREAM_MAIL)] = { + .numLines = ARRAY_COUNT(sLineLayouts_Wide), + .signatureYPos = 0, + .signatureWidth = 0, + .wordsYPos = 2, + .wordsXPos = 4, + .lines = sLineLayouts_Wide, + }, + [ITEM_TO_MAIL(ITEM_FAB_MAIL)] = { + .numLines = ARRAY_COUNT(sLineLayouts_Wide), + .signatureYPos = 8, + .signatureWidth = 0, + .wordsYPos = 2, + .wordsXPos = 4, + .lines = sLineLayouts_Wide, + }, + [ITEM_TO_MAIL(ITEM_RETRO_MAIL)] = { + .numLines = ARRAY_COUNT(sLineLayouts_Wide), + .signatureYPos = 0, + .signatureWidth = 0, + .wordsYPos = 2, + .wordsXPos = 0, + .lines = sLineLayouts_Wide, + }, }; -static const struct UnkMailStruct Unknown_0859F444[] = { - { .numEasyChatWords = 2, .lineHeight = 16 }, - { .numEasyChatWords = 2, .lineHeight = 16 }, - { .numEasyChatWords = 2, .lineHeight = 16 }, - { .numEasyChatWords = 2, .lineHeight = 16 }, - { .numEasyChatWords = 1, .lineHeight = 16 } +static const struct MailLineLayout sLineLayouts_Tall[] = { + { .numEasyChatWords = 2, .xOffset = 0, .height = 16 }, + { .numEasyChatWords = 2, .xOffset = 0, .height = 16 }, + { .numEasyChatWords = 2, .xOffset = 0, .height = 16 }, + { .numEasyChatWords = 2, .xOffset = 0, .height = 16 }, + { .numEasyChatWords = 1, .xOffset = 0, .height = 16 } }; -static const struct MailLayout sUnknown_0859F458[] = { - { 0x05, 0x07, 0x58, 0x0b, 0x1e, Unknown_0859F444 }, - { 0x05, 0x0a, 0x60, 0x09, 0x1e, Unknown_0859F444 }, - { 0x05, 0x0c, 0x68, 0x05, 0x1e, Unknown_0859F444 }, - { 0x05, 0x05, 0x60, 0x08, 0x1e, Unknown_0859F444 }, - { 0x05, 0x0a, 0x60, 0x09, 0x1e, Unknown_0859F444 }, - { 0x05, 0x09, 0x70, 0x05, 0x1e, Unknown_0859F444 }, - { 0x05, 0x0c, 0x68, 0x09, 0x1e, Unknown_0859F444 }, - { 0x05, 0x0d, 0x68, 0x0d, 0x1e, Unknown_0859F444 }, - { 0x05, 0x09, 0x60, 0x09, 0x1e, Unknown_0859F444 }, - { 0x05, 0x09, 0x60, 0x09, 0x1e, Unknown_0859F444 }, - { 0x05, 0x11, 0x68, 0x0f, 0x1e, Unknown_0859F444 }, - { 0x05, 0x09, 0x60, 0x05, 0x1e, Unknown_0859F444 } +static const struct MailLayout sMailLayouts_Tall[] = { + [ITEM_TO_MAIL(ITEM_ORANGE_MAIL)] = { + .numLines = ARRAY_COUNT(sLineLayouts_Tall), + .signatureYPos = 7, + .signatureWidth = 88, + .wordsYPos = 11, + .wordsXPos = 30, + .lines = sLineLayouts_Tall, + }, + [ITEM_TO_MAIL(ITEM_HARBOR_MAIL)] = { + .numLines = ARRAY_COUNT(sLineLayouts_Tall), + .signatureYPos = 10, + .signatureWidth = 96, + .wordsYPos = 9, + .wordsXPos = 30, + .lines = sLineLayouts_Tall, + }, + [ITEM_TO_MAIL(ITEM_GLITTER_MAIL)] = { + .numLines = ARRAY_COUNT(sLineLayouts_Tall), + .signatureYPos = 12, + .signatureWidth = 104, + .wordsYPos = 5, + .wordsXPos = 30, + .lines = sLineLayouts_Tall, + }, + [ITEM_TO_MAIL(ITEM_MECH_MAIL)] = { + .numLines = ARRAY_COUNT(sLineLayouts_Tall), + .signatureYPos = 5, + .signatureWidth = 96, + .wordsYPos = 8, + .wordsXPos = 30, + .lines = sLineLayouts_Tall, + }, + [ITEM_TO_MAIL(ITEM_WOOD_MAIL)] = { + .numLines = ARRAY_COUNT(sLineLayouts_Tall), + .signatureYPos = 10, + .signatureWidth = 96, + .wordsYPos = 9, + .wordsXPos = 30, + .lines = sLineLayouts_Tall, + }, + [ITEM_TO_MAIL(ITEM_WAVE_MAIL)] = { + .numLines = ARRAY_COUNT(sLineLayouts_Tall), + .signatureYPos = 9, + .signatureWidth = 112, + .wordsYPos = 5, + .wordsXPos = 30, + .lines = sLineLayouts_Tall, + }, + [ITEM_TO_MAIL(ITEM_BEAD_MAIL)] = { + .numLines = ARRAY_COUNT(sLineLayouts_Tall), + .signatureYPos = 12, + .signatureWidth = 104, + .wordsYPos = 9, + .wordsXPos = 30, + .lines = sLineLayouts_Tall, + }, + [ITEM_TO_MAIL(ITEM_SHADOW_MAIL)] = { + .numLines = ARRAY_COUNT(sLineLayouts_Tall), + .signatureYPos = 13, + .signatureWidth = 104, + .wordsYPos = 13, + .wordsXPos = 30, + .lines = sLineLayouts_Tall, + }, + [ITEM_TO_MAIL(ITEM_TROPIC_MAIL)] = { + .numLines = ARRAY_COUNT(sLineLayouts_Tall), + .signatureYPos = 9, + .signatureWidth = 96, + .wordsYPos = 9, + .wordsXPos = 30, + .lines = sLineLayouts_Tall, + }, + [ITEM_TO_MAIL(ITEM_DREAM_MAIL)] = { + .numLines = ARRAY_COUNT(sLineLayouts_Tall), + .signatureYPos = 9, + .signatureWidth = 96, + .wordsYPos = 9, + .wordsXPos = 30, + .lines = sLineLayouts_Tall, + }, + [ITEM_TO_MAIL(ITEM_FAB_MAIL)] = { + .numLines = ARRAY_COUNT(sLineLayouts_Tall), + .signatureYPos = 17, + .signatureWidth = 104, + .wordsYPos = 15, + .wordsXPos = 30, + .lines = sLineLayouts_Tall, + }, + [ITEM_TO_MAIL(ITEM_RETRO_MAIL)] = { + .numLines = ARRAY_COUNT(sLineLayouts_Tall), + .signatureYPos = 9, + .signatureWidth = 96, + .wordsYPos = 5, + .wordsXPos = 30, + .lines = sLineLayouts_Tall, + }, }; -// .text - -void ReadMail(struct MailStruct *mail, void (*callback)(void), bool8 flag) +void ReadMail(struct MailStruct *mail, void (*exitCallback)(void), bool8 hasText) { u16 buffer[2]; u16 species; sMailRead = calloc(1, sizeof(*sMailRead)); sMailRead->language = GAME_LANGUAGE; - sMailRead->playerIsSender = TRUE; + sMailRead->international = TRUE; sMailRead->parserSingle = CopyEasyChatWord; sMailRead->parserMultiple = ConvertEasyChatWordsToString; if (IS_ITEM_MAIL(mail->itemId)) { - sMailRead->mailType = mail->itemId - FIRST_MAIL_INDEX; + sMailRead->mailType = ITEM_TO_MAIL(mail->itemId); } else { - sMailRead->mailType = 0; - flag = FALSE; + sMailRead->mailType = ITEM_TO_MAIL(FIRST_MAIL_INDEX); + hasText = FALSE; } - switch (sMailRead->playerIsSender) + switch (sMailRead->international) { - case FALSE: - default: - sMailRead->layout = &sUnknown_0859F3B4[sMailRead->mailType]; - break; - case TRUE: - sMailRead->layout = &sUnknown_0859F458[sMailRead->mailType]; - break; + case FALSE: + default: + // Never reached. JP only? + sMailRead->layout = &sMailLayouts_Wide[sMailRead->mailType]; + break; + case TRUE: + sMailRead->layout = &sMailLayouts_Tall[sMailRead->mailType]; + break; } species = MailSpeciesToSpecies(mail->species, buffer); - if (species >= SPECIES_BULBASAUR && species < NUM_SPECIES) + if (species > SPECIES_NONE && species < NUM_SPECIES) { switch (sMailRead->mailType) { - default: - sMailRead->animsActive = 0; - break; - case ITEM_BEAD_MAIL - FIRST_MAIL_INDEX: - sMailRead->animsActive = 1; - break; - case ITEM_DREAM_MAIL - FIRST_MAIL_INDEX: - sMailRead->animsActive = 2; - break; + default: + sMailRead->iconType = ICON_TYPE_NONE; + break; + case ITEM_TO_MAIL(ITEM_BEAD_MAIL): + sMailRead->iconType = ICON_TYPE_BEAD; + break; + case ITEM_TO_MAIL(ITEM_DREAM_MAIL): + sMailRead->iconType = ICON_TYPE_DREAM; + break; } } else { - sMailRead->animsActive = 0; + sMailRead->iconType = ICON_TYPE_NONE; } sMailRead->mail = mail; - sMailRead->callback = callback; - sMailRead->flag = flag; + sMailRead->exitCallback = exitCallback; + sMailRead->hasText = hasText; SetMainCallback2(CB2_InitMailRead); } @@ -341,11 +543,11 @@ static bool8 MailReadBuildGraphics(void) SetBgTilemapBuffer(2, sMailRead->bg2TilemapBuffer); break; case 7: - InitWindows(sUnknown_0859F29C); + InitWindows(sWindowTemplates); DeactivateAllTextPrinters(); break; case 8: - DecompressAndCopyTileDataToVram(1, sUnknown_0859F2B8[sMailRead->mailType].tiles, 0, 0, 0); + DecompressAndCopyTileDataToVram(1, sMailGraphics[sMailRead->mailType].tiles, 0, 0, 0); break; case 9: if (FreeTempTileDataBuffersIfPossible()) @@ -356,7 +558,7 @@ static bool8 MailReadBuildGraphics(void) case 10: FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 30, 20); FillBgTilemapBufferRect_Palette0(2, 1, 0, 0, 30, 20); - CopyToBgTilemapBuffer(1, sUnknown_0859F2B8[sMailRead->mailType].tileMap, 0, 0); + CopyToBgTilemapBuffer(1, sMailGraphics[sMailRead->mailType].tileMap, 0, 0); break; case 11: CopyBgTilemapBufferToVram(0); @@ -365,26 +567,28 @@ static bool8 MailReadBuildGraphics(void) break; case 12: LoadPalette(GetOverworldTextboxPalettePtr(), 240, 32); - gPlttBufferUnfaded[250] = sUnknown_0859F2B8[sMailRead->mailType].color10; - gPlttBufferFaded[250] = sUnknown_0859F2B8[sMailRead->mailType].color10; - gPlttBufferUnfaded[251] = sUnknown_0859F2B8[sMailRead->mailType].color12; - gPlttBufferFaded[251] = sUnknown_0859F2B8[sMailRead->mailType].color12; - LoadPalette(sUnknown_0859F2B8[sMailRead->mailType].palette, 0, 32); - gPlttBufferUnfaded[10] = sUnknown_0859F2B0[gSaveBlock2Ptr->playerGender][0]; - gPlttBufferFaded[10] = sUnknown_0859F2B0[gSaveBlock2Ptr->playerGender][0]; - gPlttBufferUnfaded[11] = sUnknown_0859F2B0[gSaveBlock2Ptr->playerGender][1]; - gPlttBufferFaded[11] = sUnknown_0859F2B0[gSaveBlock2Ptr->playerGender][1]; + + gPlttBufferUnfaded[250] = sMailGraphics[sMailRead->mailType].textColor; + gPlttBufferFaded[250] = sMailGraphics[sMailRead->mailType].textColor; + gPlttBufferUnfaded[251] = sMailGraphics[sMailRead->mailType].textShadow; + gPlttBufferFaded[251] = sMailGraphics[sMailRead->mailType].textShadow; + LoadPalette(sMailGraphics[sMailRead->mailType].palette, 0, 32); + + gPlttBufferUnfaded[10] = sBgColors[gSaveBlock2Ptr->playerGender][0]; + gPlttBufferFaded[10] = sBgColors[gSaveBlock2Ptr->playerGender][0]; + gPlttBufferUnfaded[11] = sBgColors[gSaveBlock2Ptr->playerGender][1]; + gPlttBufferFaded[11] = sBgColors[gSaveBlock2Ptr->playerGender][1]; break; case 13: - if (sMailRead->flag) + if (sMailRead->hasText) { - sub_8121A1C(); + BufferMailText(); } break; case 14: - if (sMailRead->flag) + if (sMailRead->hasText) { - sub_8121B1C(); + PrintMailText(); RunTextPrinters(); } break; @@ -399,17 +603,17 @@ static bool8 MailReadBuildGraphics(void) gPaletteFade.bufferTransferDisabled = TRUE; break; case 17: - icon = sub_80D2E84(sMailRead->mail->species); - switch (sMailRead->animsActive) + icon = GetIconSpeciesNoPersonality(sMailRead->mail->species); + switch (sMailRead->iconType) { - case 1: - LoadMonIconPalette(icon); - sMailRead->monIconSprite = sub_80D2D78(icon, SpriteCallbackDummy, 0x60, 0x80, 0, 0); - break; - case 2: - LoadMonIconPalette(icon); - sMailRead->monIconSprite = sub_80D2D78(icon, SpriteCallbackDummy, 0x28, 0x80, 0, 0); - break; + case ICON_TYPE_BEAD: + LoadMonIconPalette(icon); + sMailRead->monIconSpriteId = CreateMonIconNoPersonality(icon, SpriteCallbackDummy, 96, 128, 0, FALSE); + break; + case ICON_TYPE_DREAM: + LoadMonIconPalette(icon); + sMailRead->monIconSpriteId = CreateMonIconNoPersonality(icon, SpriteCallbackDummy, 40, 128, 0, FALSE); + break; } break; case 18: @@ -419,7 +623,7 @@ static bool8 MailReadBuildGraphics(void) ShowBg(2); BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK); gPaletteFade.bufferTransferDisabled = FALSE; - sMailRead->callback2 = CB2_WaitForPaletteExitOnKeyPress; + sMailRead->callback = CB2_WaitForPaletteExitOnKeyPress; return TRUE; default: return FALSE; @@ -440,35 +644,39 @@ static void CB2_InitMailRead(void) } while (MenuHelpers_LinkSomething() != TRUE); } -static void sub_8121A1C(void) +static void BufferMailText(void) { u16 i; - u8 total; + u8 numWords; u8 *ptr; - total = 0; - for (i = 0; i < sMailRead->layout->numSubStructs; i ++) + // Convert the easy chat words to strings line by line and buffer them to message + numWords = 0; + for (i = 0; i < sMailRead->layout->numLines; i ++) { - ConvertEasyChatWordsToString(sMailRead->strbuf[i], &sMailRead->mail->words[total], sMailRead->layout->var8[i].numEasyChatWords, 1); - total += sMailRead->layout->var8[i].numEasyChatWords; + ConvertEasyChatWordsToString(sMailRead->message[i], &sMailRead->mail->words[numWords], sMailRead->layout->lines[i].numEasyChatWords, 1); + numWords += sMailRead->layout->lines[i].numEasyChatWords; } + + // Buffer the signature ptr = StringCopy(sMailRead->playerName, sMailRead->mail->playerName); - if (!sMailRead->playerIsSender) + if (!sMailRead->international) { - StringCopy(ptr, gText_FromSpace); - sMailRead->signatureWidth = sMailRead->layout->signatureWidth - (StringLength(sMailRead->playerName) * 8 - 0x60); + // Never reached + StringCopy(ptr, gText_FromSpace); // Odd, "From" text is already printed in PrintMailText + sMailRead->signatureWidth = sMailRead->layout->signatureWidth - (StringLength(sMailRead->playerName) * 8 - 96); } else { - sub_81DB52C(sMailRead->playerName); + ConvertInternationalPlayerName(sMailRead->playerName); sMailRead->signatureWidth = sMailRead->layout->signatureWidth; } } -static void sub_8121B1C(void) +static void PrintMailText(void) { u16 i; - u8 strbuf[0x20]; + u8 signature[32]; u8 y; u8 *bufptr; s32 box_x; @@ -479,20 +687,19 @@ static void sub_8121B1C(void) PutWindowTilemap(1); FillWindowPixelBuffer(0, PIXEL_FILL(0)); FillWindowPixelBuffer(1, PIXEL_FILL(0)); - for (i = 0; i < sMailRead->layout->numSubStructs; i ++) + for (i = 0; i < sMailRead->layout->numLines; i ++) { - if (sMailRead->strbuf[i][0] == EOS || sMailRead->strbuf[i][0] == CHAR_SPACE) - { + if (sMailRead->message[i][0] == EOS || sMailRead->message[i][0] == CHAR_SPACE) continue; - } - AddTextPrinterParameterized3(0, 1, sMailRead->layout->var8[i].xOffset + sMailRead->layout->wordsYPos, y + sMailRead->layout->wordsXPos, sTextColors, 0, sMailRead->strbuf[i]); - y += sMailRead->layout->var8[i].lineHeight; + + AddTextPrinterParameterized3(0, 1, sMailRead->layout->lines[i].xOffset + sMailRead->layout->wordsXPos, y + sMailRead->layout->wordsYPos, sTextColors, 0, sMailRead->message[i]); + y += sMailRead->layout->lines[i].height; } - bufptr = StringCopy(strbuf, gText_FromSpace); + bufptr = StringCopy(signature, gText_FromSpace); StringCopy(bufptr, sMailRead->playerName); - box_x = GetStringCenterAlignXOffset(1, strbuf, sMailRead->signatureWidth) + 0x68; - box_y = sMailRead->layout->signatureYPos + 0x58; - AddTextPrinterParameterized3(0, 1, box_x, box_y, sTextColors, 0, strbuf); + box_x = GetStringCenterAlignXOffset(1, signature, sMailRead->signatureWidth) + 104; + box_y = sMailRead->layout->signatureYPos + 88; + AddTextPrinterParameterized3(0, 1, box_x, box_y, sTextColors, 0, signature); CopyWindowToVram(0, 3); CopyWindowToVram(1, 3); } @@ -506,19 +713,19 @@ static void VBlankCB_MailRead(void) static void CB2_MailRead(void) { - if (sMailRead->animsActive != 0) + if (sMailRead->iconType != ICON_TYPE_NONE) { AnimateSprites(); BuildOamBuffer(); } - sMailRead->callback2(); + sMailRead->callback(); } static void CB2_WaitForPaletteExitOnKeyPress(void) { if (!UpdatePaletteFade()) { - sMailRead->callback2 = CB2_ExitOnKeyPress; + sMailRead->callback = CB2_ExitOnKeyPress; } } @@ -527,7 +734,7 @@ static void CB2_ExitOnKeyPress(void) if (JOY_NEW(A_BUTTON | B_BUTTON)) { BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); - sMailRead->callback2 = CB2_ExitMailReadFreeVars; + sMailRead->callback = CB2_ExitMailReadFreeVars; } } @@ -535,13 +742,13 @@ static void CB2_ExitMailReadFreeVars(void) { if (!UpdatePaletteFade()) { - SetMainCallback2(sMailRead->callback); - switch (sMailRead->animsActive) + SetMainCallback2(sMailRead->exitCallback); + switch (sMailRead->iconType) { - case 1: - case 2: - FreeMonIconPalette(sub_80D2E84(sMailRead->mail->species)); - FreeAndDestroyMonIconSprite(&gSprites[sMailRead->monIconSprite]); + case ICON_TYPE_BEAD: + case ICON_TYPE_DREAM: + FreeMonIconPalette(GetIconSpeciesNoPersonality(sMailRead->mail->species)); + FreeAndDestroyMonIconSprite(&gSprites[sMailRead->monIconSpriteId]); } memset(sMailRead, 0, sizeof(*sMailRead)); ResetPaletteFade(); diff --git a/src/mail_data.c b/src/mail_data.c index e0553af99..350888d0b 100644 --- a/src/mail_data.c +++ b/src/mail_data.c @@ -24,7 +24,7 @@ void ClearMailStruct(struct MailStruct *mail) for (i = 0; i < PLAYER_NAME_LENGTH + 1; i++) mail->playerName[i] = EOS; - for (i = 0; i < 4; i++) + for (i = 0; i < TRAINER_ID_LENGTH; i++) mail->trainerId[i] = 0; mail->species = SPECIES_BULBASAUR; @@ -34,7 +34,7 @@ void ClearMailStruct(struct MailStruct *mail) bool8 MonHasMail(struct Pokemon *mon) { u16 heldItem = GetMonData(mon, MON_DATA_HELD_ITEM); - if (ItemIsMail(heldItem) && GetMonData(mon, MON_DATA_MAIL) != 0xFF) + if (ItemIsMail(heldItem) && GetMonData(mon, MON_DATA_MAIL) != MAIL_NONE) return TRUE; else return FALSE; @@ -52,12 +52,12 @@ u8 GiveMailToMon(struct Pokemon *mon, u16 itemId) for (id = 0; id < PARTY_SIZE; id++) { - if (gSaveBlock1Ptr->mail[id].itemId == 0) + if (gSaveBlock1Ptr->mail[id].itemId == ITEM_NONE) { for (i = 0; i < MAIL_WORDS_COUNT; i++) gSaveBlock1Ptr->mail[id].words[i] = 0xFFFF; - for (i = 0; i < PLAYER_NAME_LENGTH + 1 - 1; i++) + for (i = 0; i < PLAYER_NAME_LENGTH; i++) gSaveBlock1Ptr->mail[id].playerName[i] = gSaveBlock2Ptr->playerName[i]; gSaveBlock1Ptr->mail[id].playerName[i] = EOS; PadNameString(gSaveBlock1Ptr->mail[id].playerName, CHAR_SPACE); @@ -75,7 +75,7 @@ u8 GiveMailToMon(struct Pokemon *mon, u16 itemId) } } - return 0xFF; + return MAIL_NONE; } u16 SpeciesToMailSpecies(u16 species, u32 personality) @@ -93,7 +93,7 @@ u16 MailSpeciesToSpecies(u16 mailSpecies, u16 *buffer) { u16 result; - if (mailSpecies >= 30000 && mailSpecies < (30000 + UNOWN_FORM_COUNT)) + if (mailSpecies >= 30000 && mailSpecies < (30000 + NUM_UNOWN_FORMS)) { result = SPECIES_UNOWN; *buffer = mailSpecies - 30000; @@ -112,8 +112,8 @@ u8 GiveMailToMon2(struct Pokemon *mon, struct MailStruct *mail) u16 itemId = mail->itemId; u8 mailId = GiveMailToMon(mon, itemId); - if (mailId == 0xFF) - return 0xFF; + if (mailId == MAIL_NONE) + return MAIL_NONE; gSaveBlock1Ptr->mail[mailId] = *mail; @@ -141,7 +141,7 @@ void TakeMailFromMon(struct Pokemon *mon) { mailId = GetMonData(mon, MON_DATA_MAIL); gSaveBlock1Ptr->mail[mailId].itemId = ITEM_NONE; - mailId = 0xFF; + mailId = MAIL_NONE; heldItem[0] = ITEM_NONE; heldItem[1] = ITEM_NONE << 8; SetMonData(mon, MON_DATA_MAIL, &mailId); @@ -162,7 +162,7 @@ u8 TakeMailFromMon2(struct Pokemon *mon) newHeldItem[0] = ITEM_NONE; newHeldItem[1] = ITEM_NONE << 8; - newMailId = 0xFF; + newMailId = MAIL_NONE; for (i = PARTY_SIZE; i < MAIL_COUNT; i++) { @@ -176,7 +176,7 @@ u8 TakeMailFromMon2(struct Pokemon *mon) } } - return 0xFF; + return MAIL_NONE; } bool8 ItemIsMail(u16 itemId) diff --git a/src/menu_specialized.c b/src/menu_specialized.c index 1fbeb59b4..8eda1621e 100644 --- a/src/menu_specialized.c +++ b/src/menu_specialized.c @@ -261,10 +261,10 @@ static void sub_81D1D44(u8 windowId, s32 itemId, u8 y) if (itemId == LIST_CANCEL) return; - StringCopy(buffer, gSaveBlock1Ptr->mail[6 + itemId].playerName); - sub_81DB52C(buffer); + StringCopy(buffer, gSaveBlock1Ptr->mail[PARTY_SIZE + itemId].playerName); + ConvertInternationalPlayerName(buffer); length = StringLength(buffer); - if (length <= 5) + if (length < PLAYER_NAME_LENGTH - 1) ConvertInternationalString(buffer, LANGUAGE_JAPANESE); AddTextPrinterParameterized4(windowId, 1, 8, y, 0, 0, sPlayerNameTextColors, -1, buffer); } diff --git a/src/mevent_801BAAC.c b/src/mevent_801BAAC.c index d732e3045..2702b53f9 100644 --- a/src/mevent_801BAAC.c +++ b/src/mevent_801BAAC.c @@ -420,7 +420,7 @@ void sub_801C4C0(void) sWonderCardData->unk_017C = 0xFF; if (sWonderCardData->unk_014C.unk_06 != SPECIES_NONE) { - sWonderCardData->unk_017C = sub_80D2D78(sub_80D2E84(sWonderCardData->unk_014C.unk_06), SpriteCallbackDummy, 0xDC, 0x14, 0, FALSE); + sWonderCardData->unk_017C = CreateMonIconNoPersonality(GetIconSpeciesNoPersonality(sWonderCardData->unk_014C.unk_06), SpriteCallbackDummy, 0xDC, 0x14, 0, FALSE); gSprites[sWonderCardData->unk_017C].oam.priority = 2; } if (sWonderCardData->unk_0000.unk_09 != 0 && sWonderCardData->unk_0000.unk_08_0 == 1) @@ -434,7 +434,7 @@ void sub_801C4C0(void) sWonderCardData->unk_017D[r7][0] = CreateSprite(&gUnknown_082F1D48, 0xd8 - 32 * r7, 0x90, 8); if (sWonderCardData->unk_014C.unk_08[0][r7] != 0) { - sWonderCardData->unk_017D[r7][1] = sub_80D2D78(sub_80D2E84(sWonderCardData->unk_014C.unk_08[0][r7]), SpriteCallbackDummy, 0xd8 - 32 * r7, 0x88, 0, 0); + sWonderCardData->unk_017D[r7][1] = CreateMonIconNoPersonality(GetIconSpeciesNoPersonality(sWonderCardData->unk_014C.unk_08[0][r7]), SpriteCallbackDummy, 0xd8 - 32 * r7, 0x88, 0, 0); } } } diff --git a/src/mystery_event_script.c b/src/mystery_event_script.c index beb1bf45d..176eab7fc 100644 --- a/src/mystery_event_script.c +++ b/src/mystery_event_script.c @@ -325,7 +325,7 @@ bool8 MEScrCmd_givepokemon(struct ScriptContext *ctx) } else { - memcpy(&gPlayerParty[5], pokemonPtr, sizeof(struct Pokemon)); + memcpy(&gPlayerParty[PARTY_SIZE - 1], pokemonPtr, sizeof(struct Pokemon)); memcpy(&mail, mailPtr, sizeof(struct MailStruct)); if (species != SPECIES_EGG) @@ -335,9 +335,9 @@ bool8 MEScrCmd_givepokemon(struct ScriptContext *ctx) GetSetPokedexFlag(pokedexNum, FLAG_SET_CAUGHT); } - heldItem = GetMonData(&gPlayerParty[5], MON_DATA_HELD_ITEM); + heldItem = GetMonData(&gPlayerParty[PARTY_SIZE - 1], MON_DATA_HELD_ITEM); if (ItemIsMail(heldItem)) - GiveMailToMon2(&gPlayerParty[5], &mail); + GiveMailToMon2(&gPlayerParty[PARTY_SIZE - 1], &mail); CompactPartySlots(); CalculatePlayerPartyCount(); StringExpandPlaceholders(gStringVar4, gText_MysteryGiftSentOver); @@ -350,7 +350,7 @@ bool8 MEScrCmd_givepokemon(struct ScriptContext *ctx) bool8 MEScrCmd_addtrainer(struct ScriptContext *ctx) { u32 data = ScriptReadWord(ctx) - ctx->data[1] + ctx->data[0]; - memcpy((void*)(gSaveBlock2Ptr) + 0xBEC, (void *)data, 0xBC); + memcpy(&gSaveBlock2Ptr->frontier.ereaderTrainer, (void *)data, sizeof(gSaveBlock2Ptr->frontier.ereaderTrainer)); ValidateEReaderTrainer(); StringExpandPlaceholders(gStringVar4, gText_MysteryGiftNewTrainer); ctx->data[2] = 2; diff --git a/src/party_menu.c b/src/party_menu.c index a648d6d04..7d53a2c12 100755 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -955,7 +955,7 @@ static void DisplayPartyPokemonDataForMultiBattle(u8 slot) menuBox->infoRects->blitFunc(menuBox->windowId, 0, 0, 0, 0, FALSE); StringCopy(gStringVar1, gMultiPartnerParty[actualSlot].nickname); StringGetEnd10(gStringVar1); - sub_81DB52C(gStringVar1); + ConvertInternationalPlayerName(gStringVar1); DisplayPartyPokemonBarDetail(menuBox->windowId, gStringVar1, 0, menuBox->infoRects->dimensions); DisplayPartyPokemonLevel(gMultiPartnerParty[actualSlot].level, menuBox); DisplayPartyPokemonGender(gMultiPartnerParty[actualSlot].gender, gMultiPartnerParty[actualSlot].species, gMultiPartnerParty[actualSlot].nickname, menuBox); diff --git a/src/player_pc.c b/src/player_pc.c index f272ad55d..a06aad60e 100644 --- a/src/player_pc.c +++ b/src/player_pc.c @@ -593,8 +593,8 @@ static u8 GetMailboxMailCount(void) { u8 i, j; - for(i = 0, j = 6; j < 16; j++) - if (gSaveBlock1Ptr->mail[j].itemId != 0) + for(i = 0, j = PARTY_SIZE; j < MAIL_COUNT; j++) + if (gSaveBlock1Ptr->mail[j].itemId != ITEM_NONE) i++; return i; @@ -605,9 +605,9 @@ static void Mailbox_UpdateMailList(void) struct MailStruct mailBuffer; u8 i, j; - for (i=6; i<15; i++) + for (i = PARTY_SIZE; i < MAIL_COUNT - 1; i++) { - for (j=i+1; j<16; j++) + for (j = i + 1; j < MAIL_COUNT; j++) { if (gSaveBlock1Ptr->mail[i].itemId == 0) { @@ -665,8 +665,8 @@ static void Mailbox_ProcessInput(u8 taskId) static void Mailbox_PrintWhatToDoWithPlayerMailText(u8 taskId) { - StringCopy(gStringVar1, gSaveBlock1Ptr->mail[playerPCItemPageInfo.itemsAbove + 6 + playerPCItemPageInfo.cursorPos].playerName); - sub_81DB554(gStringVar1, 0); + StringCopy(gStringVar1, gSaveBlock1Ptr->mail[playerPCItemPageInfo.itemsAbove + PARTY_SIZE + playerPCItemPageInfo.cursorPos].playerName); + ConvertInternationalPlayerNameStripChar(gStringVar1, CHAR_SPACE); StringExpandPlaceholders(gStringVar4, gText_WhatToDoWithVar1sMail); DisplayItemMessageOnField(taskId, gStringVar4, Mailbox_PrintMailOptions); } @@ -724,7 +724,7 @@ static void Mailbox_FadeAndReadMail(u8 taskId) { sub_81D1EC0(); CleanupOverworldWindowsAndTilemaps(); - ReadMail(&(gSaveBlock1Ptr->mail[playerPCItemPageInfo.itemsAbove + 6 + playerPCItemPageInfo.cursorPos]), Mailbox_ReturnToFieldFromReadMail, TRUE); + ReadMail(&(gSaveBlock1Ptr->mail[playerPCItemPageInfo.itemsAbove + PARTY_SIZE + playerPCItemPageInfo.cursorPos]), Mailbox_ReturnToFieldFromReadMail, TRUE); DestroyTask(taskId); } } @@ -785,7 +785,7 @@ static void Mailbox_MoveToBagYesNoPrompt(u8 taskId) static void Mailbox_DoMailMoveToBag(u8 taskId) { - struct MailStruct *mailStruct = &(gSaveBlock1Ptr->mail[playerPCItemPageInfo.itemsAbove + 6 + playerPCItemPageInfo.cursorPos]); + struct MailStruct *mailStruct = &(gSaveBlock1Ptr->mail[playerPCItemPageInfo.itemsAbove + PARTY_SIZE + playerPCItemPageInfo.cursorPos]); if (!AddBagItem(mailStruct->itemId, 1)) { DisplayItemMessageOnField(taskId, gText_BagIsFull, Mailbox_Cancel); diff --git a/src/pokemon_icon.c b/src/pokemon_icon.c index 2a606f6fb..42330b6a5 100644 --- a/src/pokemon_icon.c +++ b/src/pokemon_icon.c @@ -1051,7 +1051,7 @@ u8 CreateMonIcon(u16 species, void (*callback)(struct Sprite *), s16 x, s16 y, u return spriteId; } -u8 sub_80D2D78(u16 species, void (*callback)(struct Sprite *), s16 x, s16 y, u8 subpriority, bool32 extra) +u8 CreateMonIconNoPersonality(u16 species, void (*callback)(struct Sprite *), s16 x, s16 y, u8 subpriority, bool32 handleDeoxys) { u8 spriteId; struct MonIconSpriteTemplate iconTemplate = @@ -1064,7 +1064,7 @@ u8 sub_80D2D78(u16 species, void (*callback)(struct Sprite *), s16 x, s16 y, u8 .paletteTag = POKE_ICON_BASE_PAL_TAG + gMonIconPaletteIndices[species], }; - iconTemplate.image = GetMonIconTiles(species, extra); + iconTemplate.image = GetMonIconTiles(species, handleDeoxys); spriteId = CreateMonIconSprite(&iconTemplate, x, y, subpriority); UpdateMonIconFrame(&gSprites[spriteId]); @@ -1104,7 +1104,7 @@ u16 GetUnownLetterByPersonality(u32 personality) return GET_UNOWN_LETTER(personality); } -u16 sub_80D2E84(u16 species) +u16 GetIconSpeciesNoPersonality(u16 species) { u16 value; diff --git a/src/trade.c b/src/trade.c index b8551845b..5db85ceb8 100644 --- a/src/trade.c +++ b/src/trade.c @@ -3024,7 +3024,7 @@ static void TradeMons(u8 playerPartyIdx, u8 partnerPartyIdx) struct Pokemon *partnerMon = &gEnemyParty[partnerPartyIdx]; u16 partnerMail = GetMonData(partnerMon, MON_DATA_MAIL); - if (playerMail != 0xFF) + if (playerMail != MAIL_NONE) ClearMailStruct(&gSaveBlock1Ptr->mail[playerMail]); sTradeData->mon = *playerMon; @@ -3035,7 +3035,7 @@ static void TradeMons(u8 playerPartyIdx, u8 partnerPartyIdx) if (!GetMonData(playerMon, MON_DATA_IS_EGG)) SetMonData(playerMon, MON_DATA_FRIENDSHIP, &friendship); - if (partnerMail != 0xFF) + if (partnerMail != MAIL_NONE) GiveMailToMon2(playerMon, &gTradeMail[partnerMail]); UpdatePokedexForReceivedMon(playerPartyIdx); From c6141fea831a30a0d2de24b3c02375a01014ec97 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Mon, 22 Feb 2021 12:12:35 -0500 Subject: [PATCH 6/9] Document easy chat --- asm/macros.inc | 1 - asm/macros/ec.inc | 19 - data/maps/DewfordTown/scripts.inc | 6 +- .../{rwindow.png => button_window.png} | Bin .../{cursor.png => rectangle_cursor.png} | Bin .../text_input_frame.png} | Bin .../text_input_frame_green.pal} | 0 .../text_input_frame_orange.pal} | 0 include/constants/easy_chat.h | 61 +- include/constants/global.h | 1 + include/dewford_trend.h | 2 +- include/easy_chat.h | 102 +- include/global.h | 2 +- include/graphics.h | 8 +- include/mevent.h | 4 +- src/apprentice.c | 4 +- src/bard_music.c | 2 +- src/battle_pike.c | 18 +- src/data/bard_music/bard_sounds.h | 44 +- src/data/battle_frontier/apprentice.h | 8 +- .../battle_frontier_trainers.h | 452 +- src/data/battle_frontier/battle_tent.h | 4 +- src/data/battle_frontier/trainer_hill.h | 56 +- .../easy_chat/easy_chat_words_by_letter.h | 970 ++-- src/data/lilycove_lady.h | 18 +- src/data/trade.h | 2 +- src/dewford_trend.c | 2 +- src/easy_chat.c | 3993 +++++++++-------- src/ereader_helpers.c | 12 +- src/graphics.c | 8 +- src/lilycove_lady.c | 4 +- src/mail_data.c | 5 +- src/mauville_old_man.c | 8 +- src/mevent2.c | 12 +- src/overworld.c | 4 +- src/tv.c | 11 +- 36 files changed, 3056 insertions(+), 2787 deletions(-) delete mode 100644 asm/macros/ec.inc rename graphics/easy_chat/{rwindow.png => button_window.png} (100%) rename graphics/easy_chat/{cursor.png => rectangle_cursor.png} (100%) rename graphics/{misc/interview_frame_2.png => easy_chat/text_input_frame.png} (100%) rename graphics/{misc/interview_frame_green.pal => easy_chat/text_input_frame_green.pal} (100%) rename graphics/{misc/interview_frame_orange.pal => easy_chat/text_input_frame_orange.pal} (100%) diff --git a/asm/macros.inc b/asm/macros.inc index 6782f4200..77f44a847 100644 --- a/asm/macros.inc +++ b/asm/macros.inc @@ -3,7 +3,6 @@ .include "asm/macros/movement.inc" .include "asm/macros/window.inc" .include "asm/macros/pokemon_data.inc" - .include "asm/macros/ec.inc" .include "asm/macros/map.inc" .include "asm/macros/field_effect_script.inc" .include "asm/macros/trainer_hill.inc" diff --git a/asm/macros/ec.inc b/asm/macros/ec.inc deleted file mode 100644 index a70b8e244..000000000 --- a/asm/macros/ec.inc +++ /dev/null @@ -1,19 +0,0 @@ - .macro ec_word word - .2byte EC_WORD_\word - .endm - - .macro ec_move1 name - .2byte (EC_GROUP_MOVE_1 << 9) | MOVE_\name - .endm - - .macro ec_move2 name - .2byte (EC_GROUP_MOVE_2 << 9) | MOVE_\name - .endm - - .macro ec_pokemon1 name - .2byte (EC_GROUP_POKEMON << 9) | SPECIES_\name - .endm - - .macro ec_pokemon2 name - .2byte (EC_GROUP_POKEMON2 << 9) | SPECIES_\name - .endm diff --git a/data/maps/DewfordTown/scripts.inc b/data/maps/DewfordTown/scripts.inc index f6d06bea7..27e82167c 100644 --- a/data/maps/DewfordTown/scripts.inc +++ b/data/maps/DewfordTown/scripts.inc @@ -624,15 +624,15 @@ DewfordTown_EventScript_RejectTrendyPhrase:: @ 81E9952 call Common_ShowEasyChatScreen lock faceplayer - compare VAR_RESULT, 1 + compare VAR_RESULT, TRUE goto_if_eq DewfordTown_EventScript_GiveNewTrendyPhrase - compare VAR_RESULT, 0 + compare VAR_RESULT, FALSE goto_if_eq DewfordTown_EventScript_CancelNewTrendyPhrase end DewfordTown_EventScript_GiveNewTrendyPhrase:: @ 81E997D incrementgamestat GAME_STAT_STARTED_TRENDS - compare VAR_0x8004, 0 + compare VAR_0x8004, FALSE goto_if_eq DewfordTown_EventScript_PhraseNotTrendyEnough msgbox DewfordTown_Text_OfCourseIKnowAboutThat, MSGBOX_DEFAULT release diff --git a/graphics/easy_chat/rwindow.png b/graphics/easy_chat/button_window.png similarity index 100% rename from graphics/easy_chat/rwindow.png rename to graphics/easy_chat/button_window.png diff --git a/graphics/easy_chat/cursor.png b/graphics/easy_chat/rectangle_cursor.png similarity index 100% rename from graphics/easy_chat/cursor.png rename to graphics/easy_chat/rectangle_cursor.png diff --git a/graphics/misc/interview_frame_2.png b/graphics/easy_chat/text_input_frame.png similarity index 100% rename from graphics/misc/interview_frame_2.png rename to graphics/easy_chat/text_input_frame.png diff --git a/graphics/misc/interview_frame_green.pal b/graphics/easy_chat/text_input_frame_green.pal similarity index 100% rename from graphics/misc/interview_frame_green.pal rename to graphics/easy_chat/text_input_frame_green.pal diff --git a/graphics/misc/interview_frame_orange.pal b/graphics/easy_chat/text_input_frame_orange.pal similarity index 100% rename from graphics/misc/interview_frame_orange.pal rename to graphics/easy_chat/text_input_frame_orange.pal diff --git a/include/constants/easy_chat.h b/include/constants/easy_chat.h index 8e82cfef0..069f17fcb 100644 --- a/include/constants/easy_chat.h +++ b/include/constants/easy_chat.h @@ -28,29 +28,29 @@ #define EASY_CHAT_PERSON_BOY 2 #define EASY_CHAT_PERSON_DISPLAY_NONE 3 -#define EC_GROUP_POKEMON 0x0 -#define EC_GROUP_TRAINER 0x1 -#define EC_GROUP_STATUS 0x2 -#define EC_GROUP_BATTLE 0x3 -#define EC_GROUP_GREETINGS 0x4 -#define EC_GROUP_PEOPLE 0x5 -#define EC_GROUP_VOICES 0x6 -#define EC_GROUP_SPEECH 0x7 -#define EC_GROUP_ENDINGS 0x8 -#define EC_GROUP_FEELINGS 0x9 -#define EC_GROUP_CONDITIONS 0xa -#define EC_GROUP_ACTIONS 0xb -#define EC_GROUP_LIFESTYLE 0xc -#define EC_GROUP_HOBBIES 0xd -#define EC_GROUP_TIME 0xe -#define EC_GROUP_MISC 0xf -#define EC_GROUP_ADJECTIVES 0x10 -#define EC_GROUP_EVENTS 0x11 -#define EC_GROUP_MOVE_1 0x12 -#define EC_GROUP_MOVE_2 0x13 -#define EC_GROUP_TRENDY_SAYING 0x14 -#define EC_GROUP_POKEMON_2 0x15 -#define EC_NUM_GROUPS 0x16 +#define EC_GROUP_POKEMON 0 +#define EC_GROUP_TRAINER 1 +#define EC_GROUP_STATUS 2 +#define EC_GROUP_BATTLE 3 +#define EC_GROUP_GREETINGS 4 +#define EC_GROUP_PEOPLE 5 +#define EC_GROUP_VOICES 6 +#define EC_GROUP_SPEECH 7 +#define EC_GROUP_ENDINGS 8 +#define EC_GROUP_FEELINGS 9 +#define EC_GROUP_CONDITIONS 10 +#define EC_GROUP_ACTIONS 11 +#define EC_GROUP_LIFESTYLE 12 +#define EC_GROUP_HOBBIES 13 +#define EC_GROUP_TIME 14 +#define EC_GROUP_MISC 15 +#define EC_GROUP_ADJECTIVES 16 +#define EC_GROUP_EVENTS 17 +#define EC_GROUP_MOVE_1 18 +#define EC_GROUP_MOVE_2 19 +#define EC_GROUP_TRENDY_SAYING 20 +#define EC_GROUP_POKEMON_NATIONAL 21 +#define EC_NUM_GROUPS 22 // TRAINER #define EC_WORD_I_CHOOSE_YOU (EC_GROUP_TRAINER << 9) | 0x0 @@ -1105,13 +1105,22 @@ #define PHRASE_COOL_LATIOS 4 #define PHRASE_SUPER_HUSTLE 5 +#define EC_NUM_ALPHABET_GROUPS 27 // 26 (1 for each letter) + 1 (Others) + +#define EC_MAX_WORDS_IN_GROUP 270 // The closest is words by letter S, at 262 + +#define EC_MASK_GROUP 0x7F +#define EC_MASK_INDEX 0x1FF + #define EC_POKEMON(mon) ((EC_GROUP_POKEMON << 9) | SPECIES_##mon) -#define EC_POKEMON2(mon) ((EC_GROUP_POKEMON_2 << 9) | SPECIES_##mon) +#define EC_POKEMON_NATIONAL(mon) ((EC_GROUP_POKEMON_NATIONAL << 9) | SPECIES_##mon) #define EC_MOVE(move) ((EC_GROUP_MOVE_1 << 9) | MOVE_##move) #define EC_MOVE2(move) ((EC_GROUP_MOVE_2 << 9) | MOVE_##move) #define EC_GROUP(word) ((word) >> 9) -#define EC_INDEX(word) ((word) & 0x1FF) -#define EC_WORD(group, index) ((((group) & 0x7F) << 9) | ((index) & 0x1FF)) +#define EC_INDEX(word) ((word) & EC_MASK_INDEX) +#define EC_WORD(group, index) ((((group) & EC_MASK_GROUP) << 9) | ((index) & EC_MASK_INDEX)) + +#define EC_EMPTY_WORD 0xFFFF #endif // GUARD_CONSTANTS_EASY_CHAT_H diff --git a/include/constants/global.h b/include/constants/global.h index d8dad0f45..213ccca5b 100644 --- a/include/constants/global.h +++ b/include/constants/global.h @@ -84,6 +84,7 @@ #define MAIL_WORDS_COUNT 9 #define EASY_CHAT_BATTLE_WORDS_COUNT 6 #define MOVE_NAME_LENGTH 12 +#define NUM_QUESTIONNAIRE_WORDS 4 #define MALE 0 #define FEMALE 1 diff --git a/include/dewford_trend.h b/include/dewford_trend.h index bdb0fc95c..a7ed006f0 100644 --- a/include/dewford_trend.h +++ b/include/dewford_trend.h @@ -4,7 +4,7 @@ void InitDewfordTrend(void); void UpdateDewfordTrendPerDay(u16); void UpdateDewfordTrendPerDay(u16 days); -bool8 sub_81226D8(u16 *a); +bool8 IsPhraseTrendy(u16 *a); void ReceiveEasyChatPairsData(struct EasyChatPair *a, size_t b, u8 unused); diff --git a/include/easy_chat.h b/include/easy_chat.h index 2fa7f7b3e..4d2bc7c98 100644 --- a/include/easy_chat.h +++ b/include/easy_chat.h @@ -24,55 +24,55 @@ struct EasyChatScreen /*0x01*/ u8 templateId; /*0x02*/ u8 numColumns; /*0x03*/ u8 numRows; - /*0x04*/ u8 state; + /*0x04*/ u8 inputState; /*0x05*/ s8 mainCursorColumn; /*0x06*/ s8 mainCursorRow; - /*0x07*/ u8 unk_07; - /*0x08*/ u8 stateBackup; - /*0x09*/ u8 unk_09; - /*0x0A*/ s8 unk_0a; - /*0x0B*/ s8 unk_0b; - /*0x0C*/ u8 unk_0c; - /*0x0D*/ u8 unk_0d; - /*0x0E*/ u8 unk_0e; - /*0x0F*/ u8 unk_0f; - /*0x10*/ s8 unk_10; - /*0x11*/ s8 unk_11; + /*0x07*/ u8 maxWords; + /*0x08*/ u8 inputStateBackup; + /*0x09*/ bool8 inAlphabetMode; + /*0x0A*/ s8 keyboardColumn; + /*0x0B*/ s8 keyboardRow; + /*0x0C*/ u8 keyboardScrollOffset; + /*0x0D*/ u8 keyboardLastRow; + /*0x0E*/ u8 wordSelectScrollOffset; + /*0x0F*/ u8 wordSelectLastRow; + /*0x10*/ s8 wordSelectColumn; + /*0x11*/ s8 wordSelectRow; /*0x12*/ u8 displayedPersonType; - /*0x13*/ u8 unk_13; - /*0x14*/ u8 unk_14[0x20]; + /*0x13*/ u8 unused; // Set to 0, never read + /*0x14*/ u8 quizTitle[32]; /*0x34*/ const u8 *titleText; - /*0x38*/ u16 *words; - /*0x3C*/ u16 ecWordBuffer[9]; + /*0x38*/ u16 *savedPhrase; + /*0x3C*/ u16 currentPhrase[9]; }; -struct Unk203A11C +struct EasyChatScreenControl { - u16 unk0; + u16 funcState; u16 windowId; - u16 unk4; - u8 unk6; - u8 unk7; - s8 unk8; - u8 unk9; - u8 unkA; - u8 unkB[0xC1]; - u8 unkCC[0x202]; - u16 unk2CE; - int unk2D0; - int unk2D4; - struct Sprite *unk2D8; - struct Sprite *unk2DC; - struct Sprite *unk2E0; - struct Sprite *unk2E4; - struct Sprite *unk2E8; - struct Sprite *unk2EC; - struct Sprite *unk2F0; - struct Sprite *unk2F4; - struct Sprite *unk2F8; - struct Sprite *unk2FC; - u16 unk300[BG_SCREEN_SIZE / 2]; - u16 unkB00[BG_SCREEN_SIZE / 2]; + u16 currentFuncId; + u8 curWindowAnimState; + u8 destWindowAnimState; + s8 windowAnimStateDir; + u8 modeWindowState; + bool8 fourFooterOptions; // Never read (template is used directly instead) + u8 phrasePrintBuffer[193]; + u8 wordSelectPrintBuffer[514]; + u16 scrollOffset; + int scrollDest; + int scrollSpeed; + struct Sprite *mainCursorSprite; + struct Sprite *rectangleCursorSpriteRight; + struct Sprite *rectangleCursorSpriteLeft; + struct Sprite *wordSelectCursorSprite; + struct Sprite *buttonWindowSprite; + struct Sprite *modeWindowSprite; + struct Sprite *scrollIndicatorUpSprite; + struct Sprite *scrollIndicatorDownSprite; + struct Sprite *startButtonSprite; + struct Sprite *selectButtonSprite; + u16 bg1TilemapBuffer[BG_SCREEN_SIZE / 2]; + u16 bg3TilemapBuffer[BG_SCREEN_SIZE / 2]; }; struct EasyChatPhraseFrameDimensions @@ -104,15 +104,15 @@ struct EasyChatGroup u16 numEnabledWords; }; -struct Unk203A120 +struct EasyChatScreenWordData { - u16 unk0; - u16 unk2[EC_NUM_GROUPS]; - u16 unk2E[27]; - u16 unk64[27][270]; - u8 filler3958[0x2C]; - u16 unk3984[0x10E]; - u16 unk3BA0; + u16 numUnlockedGroups; + u16 unlockedGroupIds[EC_NUM_GROUPS]; + u16 numUnlockedAlphabetWords[EC_NUM_ALPHABET_GROUPS]; + u16 unlockedAlphabetWords[EC_NUM_ALPHABET_GROUPS][EC_MAX_WORDS_IN_GROUP]; + u8 unused[44]; + u16 selectedGroupWords[EC_MAX_WORDS_IN_GROUP]; + u16 numSelectedGroupWords; }; /*size = 0x3BA4*/ struct EasyChatWordsByLetter @@ -124,7 +124,7 @@ struct EasyChatWordsByLetter void InitEasyChatPhrases(void); void ShowEasyChatScreen(void); u8 * CopyEasyChatWord(u8 *dest, u16 word); -bool32 sub_811F8D8(int word); +bool32 IsEasyChatAnswerUnlocked(int word); void InitializeEasyChatWordArray(u16 *words, u16 length); u8 *ConvertEasyChatWordsToString(u8 *dest, const u16 *src, u16 columns, u16 rows); bool8 IsBardWordInvalid(u16 word); @@ -133,7 +133,7 @@ u16 GetNewHipsterPhraseToTeach(void); u16 EasyChat_GetNumWordsInGroup(u8); u16 GetRandomEasyChatWordFromUnlockedGroup(u16); void DoEasyChatScreen(u8 type, u16 *words, MainCallback callback, u8 displayedPersonType); -void sub_811F8BC(void); +void InitQuestionnaireWords(void); void UnlockAdditionalPhrase(u8 additionalPhraseId); #endif // GUARD_EASYCHAT_H diff --git a/include/global.h b/include/global.h index 44df26a9b..3d3ea0229 100644 --- a/include/global.h +++ b/include/global.h @@ -893,7 +893,7 @@ struct MysteryEventStruct /*0x000 0x322C*/ struct WonderNewsSaveStruct wonderNews; /*0x1c0 0x33EC*/ struct WonderCardSaveStruct wonderCard; /*0x310 0x353C*/ struct MEventBuffer_3430 buffer_310; - /*0x338 0x3564*/ u16 unk_338[4]; + /*0x338 0x3564*/ u16 questionnaireWords[NUM_QUESTIONNAIRE_WORDS]; /*0x340 0x356C*/ struct MysteryEventStruct unk_340; /*0x344 0x3570*/ u32 unk_344[2][5]; }; // 0x36C 0x3598 diff --git a/include/graphics.h b/include/graphics.h index a78498d16..c0bd13e5b 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -4977,10 +4977,10 @@ extern const u32 gEasyChatWindow_Gfx[]; extern const u32 gEasyChatWindow_Tilemap[]; extern const u32 gEasyChatMode_Gfx[]; extern const u16 gEasyChatMode_Pal[]; -extern const u32 gEasyChatCursor_Gfx[]; -extern const u16 gEasyChatCursor_Pal[]; -extern const u32 gEasyChatRightWindow_Gfx[]; -extern const u16 gEasyChatRightWindow_Pal[]; +extern const u32 gEasyChatRectangleCursor_Gfx[]; +extern const u16 gEasyChatRectangleCursor_Pal[]; +extern const u32 gEasyChatButtonWindow_Gfx[]; +extern const u16 gEasyChatButtonWindow_Pal[]; // Use Pokeblock extern const u32 gUsePokeblockCondition_Gfx[]; diff --git a/include/mevent.h b/include/mevent.h index 8c0ebbad7..4b7d39b0c 100755 --- a/include/mevent.h +++ b/include/mevent.h @@ -21,7 +21,7 @@ struct MEventStruct_Unk1442CC u16 unk_0C; u32 unk_10; u16 unk_14; - u16 unk_16[4]; + u16 unk_16[NUM_QUESTIONNAIRE_WORDS]; struct MEventBuffer_3430_Sub unk_20; u8 unk_44; u8 unk_45[7]; @@ -36,7 +36,7 @@ struct WonderNews *GetSavedWonderNews(void); struct WonderCard *GetSavedWonderCard(void); struct MEventBuffer_3430_Sub *sav1_get_mevent_buffer_2(void); struct MysteryEventStruct *sub_801B044(void); -u16 *sub_801B058(void); +u16 *GetQuestionnaireWordsPtr(void); void DestroyWonderNews(void); bool32 sub_801B078(const struct WonderNews *src); bool32 ValidateReceivedWonderNews(void); diff --git a/src/apprentice.c b/src/apprentice.c index 8a8de009c..7053a8b63 100644 --- a/src/apprentice.c +++ b/src/apprentice.c @@ -144,7 +144,7 @@ void ResetApprenticeStruct(struct Apprentice *apprentice) u8 i; for (i = 0; i < ARRAY_COUNT(apprentice->speechWon); i++) - apprentice->speechWon[i] = 0xFFFF; + apprentice->speechWon[i] = EC_EMPTY_WORD; apprentice->playerName[0] = EOS; apprentice->id = NUM_APPRENTICES; @@ -158,7 +158,7 @@ void ResetAllApprenticeData(void) for (i = 0; i < APPRENTICE_COUNT; i++) { for (j = 0; j < ARRAY_COUNT(gSaveBlock2Ptr->apprentices[i].speechWon); j++) - gSaveBlock2Ptr->apprentices[i].speechWon[j] = 0xFFFF; + gSaveBlock2Ptr->apprentices[i].speechWon[j] = EC_EMPTY_WORD; gSaveBlock2Ptr->apprentices[i].id = NUM_APPRENTICES; gSaveBlock2Ptr->apprentices[i].playerName[0] = EOS; gSaveBlock2Ptr->apprentices[i].lvlMode = 0; diff --git a/src/bard_music.c b/src/bard_music.c index ad065249a..114f1cf42 100644 --- a/src/bard_music.c +++ b/src/bard_music.c @@ -28,7 +28,7 @@ const struct BardSound *GetWordSounds(u16 word) switch (category) { case EC_GROUP_POKEMON: - case EC_GROUP_POKEMON_2: + case EC_GROUP_POKEMON_NATIONAL: ptr = gBardSounds_Pokemon; break; case EC_GROUP_MOVE_1: diff --git a/src/battle_pike.c b/src/battle_pike.c index aa0761965..0a54cf226 100644 --- a/src/battle_pike.c +++ b/src/battle_pike.c @@ -428,32 +428,32 @@ static const u16 sNPCSpeeches[][EASY_CHAT_BATTLE_WORDS_COUNT] = {EC_WORD_DID, EC_WORD_YOU, EC_WORD_MAKE, EC_WORD_A, EC_WORD_MISTAKE, EC_WORD_QUES}, {EC_WORD_IT_S, EC_WORD_MEAN, EC_WORD_AND, EC_WORD_AWFUL, EC_WORD_IN, EC_WORD_HERE}, {EC_WORD_I_AM, EC_WORD_SO, EC_WORD_TIRED, EC_WORD_OF, EC_WORD_THIS, EC_WORD_PLACE}, - {EC_WORD_I, EC_WORD_QUITE, EC_WORD_ENJOY, EC_WORD_THIS, EC_WORD_CHALLENGE, 0xFFFF}, + {EC_WORD_I, EC_WORD_QUITE, EC_WORD_ENJOY, EC_WORD_THIS, EC_WORD_CHALLENGE, EC_EMPTY_WORD}, {EC_WORD_LOOK, EC_WORD_AT, EC_WORD_HOW, EC_WORD_I, EC_MOVE2(TACKLE), EC_WORD_THIS}, - {EC_WORD_READY, EC_WORD_TO, EC_WORD_GIVE_UP, EC_WORD_YET, EC_WORD_QUES, 0xFFFF}, + {EC_WORD_READY, EC_WORD_TO, EC_WORD_GIVE_UP, EC_WORD_YET, EC_WORD_QUES, EC_EMPTY_WORD}, {EC_WORD_OH, EC_WORD_NO, EC_WORD_WHO, EC_WORD_ARE, EC_WORD_YOU, EC_WORD_QUES}, {EC_WORD_I_VE, EC_WORD_BEEN, EC_WORD_WANDERING, EC_WORD_ABOUT, EC_WORD_FOREVER, EC_WORD_ELLIPSIS}, - {EC_WORD_I, EC_WORD_THINK, EC_WORD_I, EC_WORD_WILL, EC_WORD_GIVE_UP, 0xFFFF}, + {EC_WORD_I, EC_WORD_THINK, EC_WORD_I, EC_WORD_WILL, EC_WORD_GIVE_UP, EC_EMPTY_WORD}, {EC_WORD_WHAT, EC_WORD_SHOULD, EC_WORD_I, EC_WORD_DO, EC_WORD_NEXT, EC_WORD_QUES}, {EC_WORD_I, EC_WORD_CAN_WIN, EC_WORD_WITH, EC_WORD_MY, EC_MOVE(SHEER_COLD), EC_WORD_GENIUS}, {EC_WORD_WON_T, EC_WORD_SOMEONE, EC_WORD_COOL, EC_WORD_SHOW, EC_WORD_UP, EC_WORD_QUES}, - {EC_WORD_BATTLE, EC_WORD_GAME, EC_WORD_IS, EC_WORD_AWESOME, EC_WORD_EXCL, 0xFFFF}, + {EC_WORD_BATTLE, EC_WORD_GAME, EC_WORD_IS, EC_WORD_AWESOME, EC_WORD_EXCL, EC_EMPTY_WORD}, {EC_WORD_I, EC_WORD_CAN_T, EC_WORD_TAKE, EC_WORD_THIS, EC_WORD_ANY, EC_WORD_MORE}, {EC_WORD_I, EC_WORD_DON_T, EC_WORD_KNOW, EC_WORD_IF, EC_WORD_IT_S, EC_WORD_OKAY}, {EC_WORD_OH, EC_WORD_NO, EC_WORD_EXCL, EC_WORD_NOT, EC_WORD_ANOTHER, EC_WORD_TRAINER}, {EC_WORD_IT, EC_WORD_HAS, EC_WORD_TO, EC_WORD_BE, EC_WORD_LEFT, EC_WORD_NEXT}, {EC_WORD_IT, EC_WORD_MUST_BE, EC_WORD_OVER, EC_WORD_SOON, EC_WORD_RIGHT, EC_WORD_QUES}, - {EC_WORD_THIS, EC_WORD_IS, EC_WORD_TOTALLY, EC_WORD_EASY, EC_WORD_ISN_T_IT_QUES, 0xFFFF}, - {EC_WORD_I_AM, EC_WORD_GOING, EC_WORD_TO, EC_WORD_POWER, EC_WORD_ON, 0xFFFF}, + {EC_WORD_THIS, EC_WORD_IS, EC_WORD_TOTALLY, EC_WORD_EASY, EC_WORD_ISN_T_IT_QUES, EC_EMPTY_WORD}, + {EC_WORD_I_AM, EC_WORD_GOING, EC_WORD_TO, EC_WORD_POWER, EC_WORD_ON, EC_EMPTY_WORD}, {EC_WORD_THERE, EC_WORD_IS, EC_WORD_NO, EC_WORD_GIVE_UP, EC_WORD_IN, EC_WORD_ME}, {EC_WORD_I_AM, EC_WORD_NOT, EC_WORD_GOING, EC_WORD_TO, EC_WORD_MAKE, EC_WORD_IT}, {EC_WORD_GO, EC_WORD_ON, EC_WORD_I, EC_WORD_CAN_T, EC_WORD_ANY, EC_WORD_MORE}, - {EC_WORD_A, EC_WORD_TRAINER, EC_WORD_AFTER, EC_WORD_ANOTHER, EC_WORD_ELLIPSIS, 0xFFFF}, + {EC_WORD_A, EC_WORD_TRAINER, EC_WORD_AFTER, EC_WORD_ANOTHER, EC_WORD_ELLIPSIS, EC_EMPTY_WORD}, {EC_WORD_DO, EC_WORD_YOU, EC_WORD_LIKE, EC_WORD_STEEL, EC_WORD_POKEMON, EC_WORD_QUES}, - {EC_WORD_EVERY, EC_WORD_TRAINER, EC_WORD_HERE, EC_WORD_IS, EC_WORD_TOO_WEAK, 0xFFFF}, + {EC_WORD_EVERY, EC_WORD_TRAINER, EC_WORD_HERE, EC_WORD_IS, EC_WORD_TOO_WEAK, EC_EMPTY_WORD}, {EC_WORD_YOU, EC_WORD_THINK, EC_WORD_THIS, EC_WORD_IS, EC_WORD_EASY, EC_WORD_QUES}, {EC_WORD_WHAT, EC_WORD_WILL, EC_WORD_COME, EC_WORD_AFTER, EC_WORD_THIS, EC_WORD_QUES}, - {EC_WORD_I_AM, EC_WORD_JUST, EC_WORD_SO, EC_WORD_CONFUSED, EC_WORD_EXCL, 0xFFFF}, + {EC_WORD_I_AM, EC_WORD_JUST, EC_WORD_SO, EC_WORD_CONFUSED, EC_WORD_EXCL, EC_EMPTY_WORD}, {EC_WORD_I, EC_WORD_JUST, EC_WORD_WANT, EC_WORD_TO, EC_WORD_GO_HOME, EC_WORD_ELLIPSIS}, {EC_WORD_YEEHAW_EXCL, EC_WORD_THIS, EC_WORD_PLACE, EC_WORD_IS, EC_WORD_A, EC_WORD_PUSHOVER}, {EC_WORD_I, EC_WORD_HAVEN_T, EC_WORD_BEEN, EC_WORD_IN, EC_WORD_A, EC_WORD_BATTLE}, diff --git a/src/data/bard_music/bard_sounds.h b/src/data/bard_music/bard_sounds.h index 1ec1f0d97..1dd5c7f56 100644 --- a/src/data/bard_music/bard_sounds.h +++ b/src/data/bard_music/bard_sounds.h @@ -25,28 +25,28 @@ #include "trendysaying.h" const struct BardSound (*const gBardSoundsTable[EC_NUM_GROUPS])[6] = { - [EC_GROUP_POKEMON] = NULL, // Handled by gBardSounds_Pokemon - [EC_GROUP_TRAINER] = gBardSounds_Trainer, - [EC_GROUP_STATUS] = gBardSounds_Status, - [EC_GROUP_BATTLE] = gBardSounds_Battle, - [EC_GROUP_GREETINGS] = gBardSounds_Greetings, - [EC_GROUP_PEOPLE] = gBardSounds_People, - [EC_GROUP_VOICES] = gBardSounds_Voices, - [EC_GROUP_SPEECH] = gBardSounds_Speech, - [EC_GROUP_ENDINGS] = gBardSounds_Endings, - [EC_GROUP_FEELINGS] = gBardSounds_Feelings, - [EC_GROUP_CONDITIONS] = gBardSounds_Conditions, - [EC_GROUP_ACTIONS] = gBardSounds_Actions, - [EC_GROUP_LIFESTYLE] = gBardSounds_Lifestyle, - [EC_GROUP_HOBBIES] = gBardSounds_Hobbies, - [EC_GROUP_TIME] = gBardSounds_Time, - [EC_GROUP_MISC] = gBardSounds_Misc, - [EC_GROUP_ADJECTIVES] = gBardSounds_Adjectives, - [EC_GROUP_EVENTS] = gBardSounds_Events, - [EC_GROUP_MOVE_1] = NULL, // Handled by gBardSounds_Moves - [EC_GROUP_MOVE_2] = NULL, // Handled by gBardSounds_Moves - [EC_GROUP_TRENDY_SAYING] = gBardSounds_TrendySaying, - [EC_GROUP_POKEMON_2] = NULL // Handled by gBardSounds_Pokemon + [EC_GROUP_POKEMON] = NULL, // Handled by gBardSounds_Pokemon + [EC_GROUP_TRAINER] = gBardSounds_Trainer, + [EC_GROUP_STATUS] = gBardSounds_Status, + [EC_GROUP_BATTLE] = gBardSounds_Battle, + [EC_GROUP_GREETINGS] = gBardSounds_Greetings, + [EC_GROUP_PEOPLE] = gBardSounds_People, + [EC_GROUP_VOICES] = gBardSounds_Voices, + [EC_GROUP_SPEECH] = gBardSounds_Speech, + [EC_GROUP_ENDINGS] = gBardSounds_Endings, + [EC_GROUP_FEELINGS] = gBardSounds_Feelings, + [EC_GROUP_CONDITIONS] = gBardSounds_Conditions, + [EC_GROUP_ACTIONS] = gBardSounds_Actions, + [EC_GROUP_LIFESTYLE] = gBardSounds_Lifestyle, + [EC_GROUP_HOBBIES] = gBardSounds_Hobbies, + [EC_GROUP_TIME] = gBardSounds_Time, + [EC_GROUP_MISC] = gBardSounds_Misc, + [EC_GROUP_ADJECTIVES] = gBardSounds_Adjectives, + [EC_GROUP_EVENTS] = gBardSounds_Events, + [EC_GROUP_MOVE_1] = NULL, // Handled by gBardSounds_Moves + [EC_GROUP_MOVE_2] = NULL, // Handled by gBardSounds_Moves + [EC_GROUP_TRENDY_SAYING] = gBardSounds_TrendySaying, + [EC_GROUP_POKEMON_NATIONAL] = NULL // Handled by gBardSounds_Pokemon }; #endif //GUARD_BARD_SOUNDS_TABLE_H diff --git a/src/data/battle_frontier/apprentice.h b/src/data/battle_frontier/apprentice.h index 349dc9619..144129743 100644 --- a/src/data/battle_frontier/apprentice.h +++ b/src/data/battle_frontier/apprentice.h @@ -326,7 +326,7 @@ const struct ApprenticeTrainer gApprentices[NUM_APPRENTICES] = .facilityClass = FACILITY_CLASS_LASS, .species = {SPECIES_SWALOT, SPECIES_XATU, SPECIES_ALTARIA, SPECIES_GOLDUCK, SPECIES_FLYGON, SPECIES_ALAKAZAM, SPECIES_GARDEVOIR, SPECIES_WAILORD, SPECIES_GRUMPIG, SPECIES_MIGHTYENA}, .id = 3, - .speechLost = {EC_WORD_IS, EC_WORD_THIS, EC_WORD_TOO, EC_WORD_MUCH, EC_WORD_QUES, 0xFFFF}, + .speechLost = {EC_WORD_IS, EC_WORD_THIS, EC_WORD_TOO, EC_WORD_MUCH, EC_WORD_QUES, EC_EMPTY_WORD}, }, { .name = {_("ヨウカ"), _("MACY"), _("AMELIE"), _("CLEO"), _("MARIA"), _("ELISA")}, @@ -358,7 +358,7 @@ const struct ApprenticeTrainer gApprentices[NUM_APPRENTICES] = .facilityClass = FACILITY_CLASS_BEAUTY, .species = {SPECIES_NINETALES, SPECIES_ALAKAZAM, SPECIES_SCEPTILE, SPECIES_SALAMENCE, SPECIES_GOLDUCK, SPECIES_MAWILE, SPECIES_WEEZING, SPECIES_LANTURN, SPECIES_GARDEVOIR, SPECIES_MILOTIC}, .id = 7, - .speechLost = {EC_WORD_YOU_RE, EC_WORD_STRONG, EC_WORD_AREN_T, EC_WORD_YOU, EC_WORD_QUES, 0xFFFF}, + .speechLost = {EC_WORD_YOU_RE, EC_WORD_STRONG, EC_WORD_AREN_T, EC_WORD_YOU, EC_WORD_QUES, EC_EMPTY_WORD}, }, { .name = {_("スミレ"), _("ANNIE"), _("ANNIE"), _("IMELDA"), _("INES"), _("ROSA")}, @@ -374,7 +374,7 @@ const struct ApprenticeTrainer gApprentices[NUM_APPRENTICES] = .facilityClass = FACILITY_CLASS_HIKER, .species = {SPECIES_SKARMORY, SPECIES_GOLEM, SPECIES_BLAZIKEN, SPECIES_CAMERUPT, SPECIES_DONPHAN, SPECIES_MUK, SPECIES_SALAMENCE, SPECIES_TROPIUS, SPECIES_SOLROCK, SPECIES_RHYDON}, .id = 9, - .speechLost = {EC_WORD_WE, EC_WORD_WERE, EC_WORD_JUST, EC_WORD_SHREDDED, EC_WORD_ELLIPSIS, 0xFFFF}, + .speechLost = {EC_WORD_WE, EC_WORD_WERE, EC_WORD_JUST, EC_WORD_SHREDDED, EC_WORD_ELLIPSIS, EC_EMPTY_WORD}, }, { .name = {_("トウゾウ"), _("DALLAS"), _("BRUNO"), _("LEARCO"), _("ANSGAR"), _("MANOLO")}, @@ -382,7 +382,7 @@ const struct ApprenticeTrainer gApprentices[NUM_APPRENTICES] = .facilityClass = FACILITY_CLASS_FISHERMAN, .species = {SPECIES_SEAKING, SPECIES_STARMIE, SPECIES_GOLDUCK, SPECIES_TENTACRUEL, SPECIES_OCTILLERY, SPECIES_GOREBYSS, SPECIES_GLALIE, SPECIES_WAILORD, SPECIES_SHARPEDO, SPECIES_KINGDRA}, .id = 10, - .speechLost = {EC_WORD_YOUR, EC_WORD_WIN, EC_WORD_ANGERS, EC_WORD_ME, EC_WORD_EXCL, 0xFFFF}, + .speechLost = {EC_WORD_YOUR, EC_WORD_WIN, EC_WORD_ANGERS, EC_WORD_ME, EC_WORD_EXCL, EC_EMPTY_WORD}, }, { .name = {_("セイヤ"), _("FRANK"), _("FRANK"), _("OLINDO"), _("FRANK"), _("MAURO")}, diff --git a/src/data/battle_frontier/battle_frontier_trainers.h b/src/data/battle_frontier/battle_frontier_trainers.h index bbd88d76f..1cae890c2 100644 --- a/src/data/battle_frontier/battle_frontier_trainers.h +++ b/src/data/battle_frontier/battle_frontier_trainers.h @@ -4,15 +4,15 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .facilityClass = FACILITY_CLASS_YOUNGSTER, .trainerName = _("BRADY"), .speechBefore = {EC_WORD_I_AM, EC_WORD_NEVER, EC_WORD_GOING, EC_WORD_TO, EC_WORD_LOSE, EC_WORD_EXCL}, - .speechWin = {EC_WORD_I_AM, EC_WORD_STRONG, EC_WORD_AREN_T, EC_WORD_I, EC_WORD_QUES, 0xFFFF}, - .speechLose = {EC_WORD_WHAT, EC_WORD_QUES, 0xFFFF, EC_WORD_BUT, EC_WORD_HOW, EC_WORD_QUES}, + .speechWin = {EC_WORD_I_AM, EC_WORD_STRONG, EC_WORD_AREN_T, EC_WORD_I, EC_WORD_QUES, EC_EMPTY_WORD}, + .speechLose = {EC_WORD_WHAT, EC_WORD_QUES, EC_EMPTY_WORD, EC_WORD_BUT, EC_WORD_HOW, EC_WORD_QUES}, .monSet = gBattleFrontierTrainerMons_Brady }, [FRONTIER_TRAINER_CONNER] = { .facilityClass = FACILITY_CLASS_YOUNGSTER, .trainerName = _("CONNER"), - .speechBefore = {EC_WORD_LOSING, EC_WORD_DOESN_T, EC_WORD_BUG, EC_WORD_ME, 0xFFFF, 0xFFFF}, - .speechWin = {EC_WORD_A, EC_WORD_WIN, EC_WORD_IS, EC_WORD_JUST, EC_WORD_AWESOME, 0xFFFF}, + .speechBefore = {EC_WORD_LOSING, EC_WORD_DOESN_T, EC_WORD_BUG, EC_WORD_ME, EC_EMPTY_WORD, EC_EMPTY_WORD}, + .speechWin = {EC_WORD_A, EC_WORD_WIN, EC_WORD_IS, EC_WORD_JUST, EC_WORD_AWESOME, EC_EMPTY_WORD}, .speechLose = {EC_WORD_DARN, EC_WORD_ELLIPSIS, EC_WORD_LOSING, EC_WORD_DOES, EC_WORD_BUG, EC_WORD_ME}, .monSet = gBattleFrontierTrainerMons_Conner }, @@ -20,7 +20,7 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .facilityClass = FACILITY_CLASS_YOUNGSTER, .trainerName = _("BRADLEY"), .speechBefore = {EC_WORD_HEY_THERE, EC_WORD_EXCL, EC_WORD_YOU_RE, EC_WORD_MY, EC_WORD_OPPONENT, EC_WORD_TODAY}, - .speechWin = {EC_WORD_HAHAHA, EC_WORD_EXCL, 0xFFFF, EC_WORD_SEE_YA, EC_WORD_LATER, EC_WORD_EXCL}, + .speechWin = {EC_WORD_HAHAHA, EC_WORD_EXCL, EC_EMPTY_WORD, EC_WORD_SEE_YA, EC_WORD_LATER, EC_WORD_EXCL}, .speechLose = {EC_WORD_TOMORROW, EC_WORD_IS, EC_WORD_WHEN, EC_WORD_WE, EC_WORD_REALLY, EC_WORD_BATTLE}, .monSet = gBattleFrontierTrainerMons_Bradley }, @@ -44,7 +44,7 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .facilityClass = FACILITY_CLASS_LASS, .trainerName = _("PEGGY"), .speechBefore = {EC_WORD_GET, EC_WORD_READY, EC_WORD_TO, EC_WORD_BE, EC_WORD_DESTROYED, EC_WORD_EXCL}, - .speechWin = {EC_WORD_HAHAHA, EC_WORD_EXCL_EXCL, 0xFFFF, EC_WORD_I_AM, EC_WORD_LOLLING, EC_WORD_EXCL}, + .speechWin = {EC_WORD_HAHAHA, EC_WORD_EXCL_EXCL, EC_EMPTY_WORD, EC_WORD_I_AM, EC_WORD_LOLLING, EC_WORD_EXCL}, .speechLose = {EC_WORD_I_AM, EC_WORD_FEELING, EC_WORD_SAD, EC_WORD_THANKS, EC_WORD_TO, EC_WORD_YOU}, .monSet = gBattleFrontierTrainerMons_Peggy }, @@ -52,7 +52,7 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .facilityClass = FACILITY_CLASS_SCHOOL_KID_M, .trainerName = _("KEITH"), .speechBefore = {EC_WORD_I, EC_WORD_DON_T, EC_WORD_JUST, EC_WORD_STUDY, EC_WORD_YOU, EC_WORD_KNOW}, - .speechWin = {EC_WORD_YOU, EC_WORD_DON_T, EC_WORD_STUDY, EC_WORD_ENOUGH, EC_WORD_ELLIPSIS, 0xFFFF}, + .speechWin = {EC_WORD_YOU, EC_WORD_DON_T, EC_WORD_STUDY, EC_WORD_ENOUGH, EC_WORD_ELLIPSIS, EC_EMPTY_WORD}, .speechLose = {EC_WORD_I, EC_WORD_NEED, EC_WORD_TO, EC_WORD_STUDY, EC_WORD_MORE, EC_WORD_ELLIPSIS}, .monSet = gBattleFrontierTrainerMons_Keith }, @@ -60,15 +60,15 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .facilityClass = FACILITY_CLASS_SCHOOL_KID_M, .trainerName = _("GRAYSON"), .speechBefore = {EC_WORD_A, EC_WORD_POKEMON, EC_WORD_BATTLE, EC_WORD_ISN_T, EC_WORD_CHILD_S_PLAY, EC_WORD_EXCL}, - .speechWin = {EC_WORD_YOU_RE, EC_WORD_DONE, EC_WORD_AREN_T, EC_WORD_YOU, EC_WORD_QUES, 0xFFFF}, + .speechWin = {EC_WORD_YOU_RE, EC_WORD_DONE, EC_WORD_AREN_T, EC_WORD_YOU, EC_WORD_QUES, EC_EMPTY_WORD}, .speechLose = {EC_WORD_WE, EC_WORD_WERE, EC_WORD_LIKE, EC_WORD_TOYS, EC_WORD_TO, EC_WORD_YOU}, .monSet = gBattleFrontierTrainerMons_Grayson }, [FRONTIER_TRAINER_GLENN] = { .facilityClass = FACILITY_CLASS_SCHOOL_KID_M, .trainerName = _("GLENN"), - .speechBefore = {EC_WORD_I, EC_WORD_WOULD, EC_WORD_BE, EC_WORD_COOL, EC_WORD_IF_I_WIN, 0xFFFF}, - .speechWin = {EC_WORD_COOL, EC_WORD_EXCL, 0xFFFF, EC_WORD_THAT_S, EC_WORD_WHAT, EC_WORD_I_AM}, + .speechBefore = {EC_WORD_I, EC_WORD_WOULD, EC_WORD_BE, EC_WORD_COOL, EC_WORD_IF_I_WIN, EC_EMPTY_WORD}, + .speechWin = {EC_WORD_COOL, EC_WORD_EXCL, EC_EMPTY_WORD, EC_WORD_THAT_S, EC_WORD_WHAT, EC_WORD_I_AM}, .speechLose = {EC_WORD_I_AM, EC_WORD_NOT, EC_WORD_GOING, EC_WORD_TO, EC_WORD_BE, EC_WORD_COOL}, .monSet = gBattleFrontierTrainerMons_Glenn }, @@ -92,7 +92,7 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .facilityClass = FACILITY_CLASS_SCHOOL_KID_F, .trainerName = _("ZOEY"), .speechBefore = {EC_WORD_PLEASE, EC_WORD_BATTLE, EC_WORD_LIKE, EC_WORD_YOU, EC_WORD_MEAN, EC_WORD_IT}, - .speechWin = {EC_WORD_THANK_YOU, EC_WORD_EXCL_EXCL, 0xFFFF, EC_WORD_THANK_YOU, EC_WORD_SO, EC_WORD_MUCH}, + .speechWin = {EC_WORD_THANK_YOU, EC_WORD_EXCL_EXCL, EC_EMPTY_WORD, EC_WORD_THANK_YOU, EC_WORD_SO, EC_WORD_MUCH}, .speechLose = {EC_WORD_WERE, EC_WORD_YOU, EC_WORD_REALLY, EC_WORD_BEING, EC_WORD_SERIOUS, EC_WORD_QUES}, .monSet = gBattleFrontierTrainerMons_Zoey }, @@ -100,8 +100,8 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .facilityClass = FACILITY_CLASS_RICH_BOY, .trainerName = _("MANUEL"), .speechBefore = {EC_WORD_ME, EC_WORD_LOSE, EC_WORD_QUES, EC_WORD_THAT_S, EC_WORD_PREPOSTEROUS, EC_WORD_EXCL}, - .speechWin = {EC_WORD_NATURALLY, EC_WORD_I, EC_WORD_WIN, 0xFFFF, 0xFFFF, 0xFFFF}, - .speechLose = {EC_WORD_WAAAH, EC_WORD_EXCL, 0xFFFF, EC_WORD_I, EC_WORD_LOST, EC_WORD_MOTHER}, + .speechWin = {EC_WORD_NATURALLY, EC_WORD_I, EC_WORD_WIN, EC_EMPTY_WORD, EC_EMPTY_WORD, EC_EMPTY_WORD}, + .speechLose = {EC_WORD_WAAAH, EC_WORD_EXCL, EC_EMPTY_WORD, EC_WORD_I, EC_WORD_LOST, EC_WORD_MOTHER}, .monSet = gBattleFrontierTrainerMons_Manuel }, [FRONTIER_TRAINER_RUSS] = { @@ -115,16 +115,16 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU [FRONTIER_TRAINER_DUSTIN] = { .facilityClass = FACILITY_CLASS_RICH_BOY, .trainerName = _("DUSTIN"), - .speechBefore = {EC_WORD_I, EC_WORD_REALLY, EC_WORD_LIKE, EC_WORD_COOL, EC_WORD_POKEMON, 0xFFFF}, - .speechWin = {EC_WORD_I, EC_WORD_LIKE, EC_WORD_MYSELF, EC_WORD_WHEN_I_WIN, EC_WORD_EXCL, 0xFFFF}, - .speechLose = {EC_WORD_I, EC_WORD_LIKE, EC_WORD_MYSELF, EC_WORD_IF_I_LOSE, EC_WORD_TOO, 0xFFFF}, + .speechBefore = {EC_WORD_I, EC_WORD_REALLY, EC_WORD_LIKE, EC_WORD_COOL, EC_WORD_POKEMON, EC_EMPTY_WORD}, + .speechWin = {EC_WORD_I, EC_WORD_LIKE, EC_WORD_MYSELF, EC_WORD_WHEN_I_WIN, EC_WORD_EXCL, EC_EMPTY_WORD}, + .speechLose = {EC_WORD_I, EC_WORD_LIKE, EC_WORD_MYSELF, EC_WORD_IF_I_LOSE, EC_WORD_TOO, EC_EMPTY_WORD}, .monSet = gBattleFrontierTrainerMons_Dustin }, [FRONTIER_TRAINER_TINA] = { .facilityClass = FACILITY_CLASS_LADY, .trainerName = _("TINA"), .speechBefore = {EC_WORD_IF_I_WIN, EC_WORD_YOU, EC_WORD_CAN, EC_WORD_HAVE, EC_WORD_A, EC_MOVE2(SWEET_KISS)}, - .speechWin = {EC_WORD_HERE_IT_IS, EC_WORD_YOUR, EC_MOVE2(SWEET_KISS), EC_WORD_FROM, EC_WORD_MY, EC_POKEMON2(JYNX)}, + .speechWin = {EC_WORD_HERE_IT_IS, EC_WORD_YOUR, EC_MOVE2(SWEET_KISS), EC_WORD_FROM, EC_WORD_MY, EC_POKEMON_NATIONAL(JYNX)}, .speechLose = {EC_WORD_YOU, EC_WORD_WANT, EC_WORD_A, EC_MOVE(SWIFT), EC_MOVE2(MEGA_KICK), EC_WORD_INSTEAD}, .monSet = gBattleFrontierTrainerMons_Tina }, @@ -133,14 +133,14 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .trainerName = _("GILLIAN"), .speechBefore = {EC_WORD_THE, EC_WORD_GOURMET, EC_WORD_THING, EC_WORD_IS, EC_WORD_SO, EC_WORD_YESTERDAY}, .speechWin = {EC_WORD_POKEMON, EC_WORD_NEVER, EC_WORD_GO, EC_WORD_OUT, EC_WORD_OF, EC_WORD_FASHION}, - .speechLose = {EC_WORD_LOSING, EC_WORD_DOESN_T, EC_WORD_DISAPPOINT, EC_WORD_ME, 0xFFFF, 0xFFFF}, + .speechLose = {EC_WORD_LOSING, EC_WORD_DOESN_T, EC_WORD_DISAPPOINT, EC_WORD_ME, EC_EMPTY_WORD, EC_EMPTY_WORD}, .monSet = gBattleFrontierTrainerMons_Gillian }, [FRONTIER_TRAINER_ZOE] = { .facilityClass = FACILITY_CLASS_LADY, .trainerName = _("ZOE"), .speechBefore = {EC_WORD_I, EC_WORD_HAVEN_T, EC_WORD_A, EC_WORD_WORRY, EC_WORD_AT, EC_WORD_ALL}, - .speechWin = {EC_WORD_LIFE, EC_WORD_IS, EC_WORD_ALWAYS, EC_WORD_GOOD, EC_WORD_TO_ME, 0xFFFF}, + .speechWin = {EC_WORD_LIFE, EC_WORD_IS, EC_WORD_ALWAYS, EC_WORD_GOOD, EC_WORD_TO_ME, EC_EMPTY_WORD}, .speechLose = {EC_WORD_I, EC_WORD_WORRY, EC_WORD_ABOUT, EC_WORD_MY, EC_WORD_POKEMON, EC_WORD_SKILL}, .monSet = gBattleFrontierTrainerMons_Zoe }, @@ -156,7 +156,7 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .facilityClass = FACILITY_CLASS_CAMPER, .trainerName = _("AL"), .speechBefore = {EC_WORD_YOUR, EC_WORD_LOOK, EC_WORD_SAYS, EC_WORD_YOU_RE, EC_WORD_REALLY, EC_WORD_TOUGH}, - .speechWin = {EC_WORD_IT_S, EC_WORD_ME, EC_WORD_WHO_IS, EC_WORD_REALLY, EC_WORD_TOUGH, 0xFFFF}, + .speechWin = {EC_WORD_IT_S, EC_WORD_ME, EC_WORD_WHO_IS, EC_WORD_REALLY, EC_WORD_TOUGH, EC_EMPTY_WORD}, .speechLose = {EC_WORD_I_AM, EC_WORD_RIGHT, EC_WORD_EXCL, EC_WORD_YOU_RE, EC_WORD_REALLY, EC_WORD_TOUGH}, .monSet = gBattleFrontierTrainerMons_Al }, @@ -165,15 +165,15 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .trainerName = _("MITCH"), .speechBefore = {EC_WORD_MOTHER, EC_WORD_NATURE, EC_WORD_IS, EC_WORD_MY, EC_WORD_ALLY, EC_WORD_EXCL}, .speechWin = {EC_WORD_WAS, EC_WORD_THAT, EC_WORD_ENOUGH, EC_WORD_FOR, EC_WORD_YOU, EC_WORD_QUES}, - .speechLose = {EC_WORD_MOTHER, EC_WORD_NATURE, EC_WORD_DIDN_T, EC_WORD_LET_ME_WIN, EC_WORD_QUES, 0xFFFF}, + .speechLose = {EC_WORD_MOTHER, EC_WORD_NATURE, EC_WORD_DIDN_T, EC_WORD_LET_ME_WIN, EC_WORD_QUES, EC_EMPTY_WORD}, .monSet = gBattleFrontierTrainerMons_Mitch }, [FRONTIER_TRAINER_ANNE] = { .facilityClass = FACILITY_CLASS_PICNICKER, .trainerName = _("ANNE"), .speechBefore = {EC_WORD_I, EC_WORD_CAN_T, EC_WORD_WAIT, EC_WORD_LET_S, EC_WORD_BATTLE, EC_WORD_NOW}, - .speechWin = {EC_WORD_MY, EC_WORD_HAPPINESS, EC_WORD_IS, EC_WORD_OVERWHELMING, EC_WORD_EXCL, 0xFFFF}, - .speechLose = {EC_WORD_YOU_VE, EC_WORD_DESTROYED, EC_WORD_MY, EC_WORD_HAPPINESS, EC_WORD_ELLIPSIS, 0xFFFF}, + .speechWin = {EC_WORD_MY, EC_WORD_HAPPINESS, EC_WORD_IS, EC_WORD_OVERWHELMING, EC_WORD_EXCL, EC_EMPTY_WORD}, + .speechLose = {EC_WORD_YOU_VE, EC_WORD_DESTROYED, EC_WORD_MY, EC_WORD_HAPPINESS, EC_WORD_ELLIPSIS, EC_EMPTY_WORD}, .monSet = gBattleFrontierTrainerMons_Anne }, [FRONTIER_TRAINER_ALIZE] = { @@ -203,15 +203,15 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU [FRONTIER_TRAINER_JASON] = { .facilityClass = FACILITY_CLASS_TUBER_M, .trainerName = _("JASON"), - .speechBefore = {EC_WORD_TEACH, EC_WORD_ME, EC_WORD_A, EC_WORD_GOOD, EC_WORD_STRATEGY, 0xFFFF}, - .speechWin = {EC_WORD_THAT_WAS, EC_WORD_YOUR, EC_WORD_GOOD, EC_WORD_STRATEGY, EC_WORD_QUES_EXCL, 0xFFFF}, + .speechBefore = {EC_WORD_TEACH, EC_WORD_ME, EC_WORD_A, EC_WORD_GOOD, EC_WORD_STRATEGY, EC_EMPTY_WORD}, + .speechWin = {EC_WORD_THAT_WAS, EC_WORD_YOUR, EC_WORD_GOOD, EC_WORD_STRATEGY, EC_WORD_QUES_EXCL, EC_EMPTY_WORD}, .speechLose = {EC_WORD_WOW, EC_WORD_THAT, EC_WORD_IS, EC_WORD_AN, EC_WORD_AWESOME, EC_WORD_STRATEGY}, .monSet = gBattleFrontierTrainerMons_Jason }, [FRONTIER_TRAINER_JOHN] = { .facilityClass = FACILITY_CLASS_TUBER_M, .trainerName = _("JOHN"), - .speechBefore = {EC_WORD_I_AM, EC_WORD_A, EC_WORD_PRETTY, EC_WORD_NEW, EC_WORD_TRAINER, 0xFFFF}, + .speechBefore = {EC_WORD_I_AM, EC_WORD_A, EC_WORD_PRETTY, EC_WORD_NEW, EC_WORD_TRAINER, EC_EMPTY_WORD}, .speechWin = {EC_WORD_I_AM, EC_WORD_NEW, EC_WORD_BUT, EC_WORD_I, EC_WORD_WON, EC_WORD_EXCL}, .speechLose = {EC_WORD_I_AM, EC_WORD_NEW, EC_WORD_SO, EC_WORD_WHAT, EC_WORD_IF_I_LOSE, EC_WORD_QUES}, .monSet = gBattleFrontierTrainerMons_John @@ -237,14 +237,14 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .trainerName = _("CARLIE"), .speechBefore = {EC_WORD_MY, EC_WORD_SUMMER, EC_WORD_VACATION, EC_WORD_IS, EC_WORD_FOR, EC_WORD_POKEMON}, .speechWin = {EC_WORD_MY, EC_WORD_SUMMER, EC_WORD_VACATION, EC_WORD_WILL, EC_WORD_BE, EC_WORD_AWESOME}, - .speechLose = {EC_WORD_I, EC_WORD_CAN_T_WIN, EC_WORD_LIKE, EC_WORD_THIS, EC_WORD_ELLIPSIS, 0xFFFF}, + .speechLose = {EC_WORD_I, EC_WORD_CAN_T_WIN, EC_WORD_LIKE, EC_WORD_THIS, EC_WORD_ELLIPSIS, EC_EMPTY_WORD}, .monSet = gBattleFrontierTrainerMons_Carlie }, [FRONTIER_TRAINER_GORDON] = { .facilityClass = FACILITY_CLASS_SWIMMER_M, .trainerName = _("GORDON"), - .speechBefore = {EC_WORD_VICTORY, EC_WORD_WILL, EC_WORD_COME, EC_WORD_TO_ME, EC_WORD_EXCL, 0xFFFF}, - .speechWin = {EC_WORD_OH_YEAH, EC_WORD_EXCL, 0xFFFF, EC_WORD_I, EC_WORD_REALLY, EC_WORD_WON}, + .speechBefore = {EC_WORD_VICTORY, EC_WORD_WILL, EC_WORD_COME, EC_WORD_TO_ME, EC_WORD_EXCL, EC_EMPTY_WORD}, + .speechWin = {EC_WORD_OH_YEAH, EC_WORD_EXCL, EC_EMPTY_WORD, EC_WORD_I, EC_WORD_REALLY, EC_WORD_WON}, .speechLose = {EC_WORD_NOTHING, EC_WORD_IS, EC_WORD_WORKING, EC_WORD_OUT, EC_WORD_FOR, EC_WORD_ME}, .monSet = gBattleFrontierTrainerMons_Gordon }, @@ -268,7 +268,7 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .facilityClass = FACILITY_CLASS_SWIMMER_F, .trainerName = _("CIERRA"), .speechBefore = {EC_WORD_I, EC_WORD_LIKE, EC_WORD_TO, EC_WORD_SYNCHRONIZE, EC_WORD_MY, EC_WORD_SWIFT_SWIM}, - .speechWin = {EC_WORD_MY, EC_WORD_POKEMON, EC_WORD_SYNCHRONIZE, EC_WORD_WITH, EC_WORD_ME, 0xFFFF}, + .speechWin = {EC_WORD_MY, EC_WORD_POKEMON, EC_WORD_SYNCHRONIZE, EC_WORD_WITH, EC_WORD_ME, EC_EMPTY_WORD}, .speechLose = {EC_WORD_I, EC_WORD_NEED, EC_WORD_TO, EC_WORD_SYNCHRONIZE, EC_WORD_BETTER, EC_WORD_ELLIPSIS}, .monSet = gBattleFrontierTrainerMons_Cierra }, @@ -324,7 +324,7 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .facilityClass = FACILITY_CLASS_POKEFAN_F, .trainerName = _("AMANDA"), .speechBefore = {EC_WORD_I, EC_WORD_COME, EC_WORD_FROM, EC_WORD_A, EC_WORD_TRAINER, EC_WORD_FAMILY}, - .speechWin = {EC_WORD_I, EC_WORD_WILL, EC_WORD_TREASURE, EC_WORD_THIS, EC_WORD_WIN, 0xFFFF}, + .speechWin = {EC_WORD_I, EC_WORD_WILL, EC_WORD_TREASURE, EC_WORD_THIS, EC_WORD_WIN, EC_EMPTY_WORD}, .speechLose = {EC_WORD_I, EC_WORD_WANT, EC_WORD_TO, EC_WORD_GO_HOME, EC_WORD_RIGHT, EC_WORD_NOW}, .monSet = gBattleFrontierTrainerMons_Amanda }, @@ -340,7 +340,7 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .facilityClass = FACILITY_CLASS_PKMN_BREEDER_M, .trainerName = _("RAFAEL"), .speechBefore = {EC_WORD_COME_ON, EC_WORD_EXCL, EC_WORD_LET_S, EC_WORD_SEE, EC_WORD_SOME, EC_WORD_SPIRIT}, - .speechWin = {EC_WORD_THAT_S_IT_EXCL, EC_WORD_THAT_S, EC_WORD_THE, EC_WORD_SPIRIT, EC_WORD_EXCL, 0xFFFF}, + .speechWin = {EC_WORD_THAT_S_IT_EXCL, EC_WORD_THAT_S, EC_WORD_THE, EC_WORD_SPIRIT, EC_WORD_EXCL, EC_EMPTY_WORD}, .speechLose = {EC_WORD_WELL, EC_WORD_SO, EC_WORD_MUCH, EC_WORD_FOR, EC_WORD_OUR, EC_WORD_SPIRIT}, .monSet = gBattleFrontierTrainerMons_Rafael }, @@ -356,15 +356,15 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .facilityClass = FACILITY_CLASS_PKMN_BREEDER_M, .trainerName = _("PAYTON"), .speechBefore = {EC_WORD_I, EC_WORD_TRAIN, EC_WORD_FROM, EC_WORD_THE, EC_WORD_EGG, EC_WORD_UP}, - .speechWin = {EC_WORD_WELL, EC_WORD_DONE, EC_WORD_EXCL, 0xFFFF, 0xFFFF, 0xFFFF}, - .speechLose = {EC_WORD_THAT_WAS, EC_WORD_A, EC_MOVE2(SOFT_BOILED), EC_WORD_LOSS, EC_WORD_ELLIPSIS, 0xFFFF}, + .speechWin = {EC_WORD_WELL, EC_WORD_DONE, EC_WORD_EXCL, EC_EMPTY_WORD, EC_EMPTY_WORD, EC_EMPTY_WORD}, + .speechLose = {EC_WORD_THAT_WAS, EC_WORD_A, EC_MOVE2(SOFT_BOILED), EC_WORD_LOSS, EC_WORD_ELLIPSIS, EC_EMPTY_WORD}, .monSet = gBattleFrontierTrainerMons_Payton }, [FRONTIER_TRAINER_PAMELA] = { .facilityClass = FACILITY_CLASS_PKMN_BREEDER_F, .trainerName = _("PAMELA"), .speechBefore = {EC_WORD_ALL, EC_WORD_POKEMON, EC_WORD_ADORE, EC_WORD_A, EC_WORD_KIND, EC_WORD_TRAINER}, - .speechWin = {EC_WORD_IT_S, EC_WORD_TOO, EC_WORD_BAD, EC_WORD_YOU, EC_WORD_LOST, 0xFFFF}, + .speechWin = {EC_WORD_IT_S, EC_WORD_TOO, EC_WORD_BAD, EC_WORD_YOU, EC_WORD_LOST, EC_EMPTY_WORD}, .speechLose = {EC_WORD_YOU_RE, EC_WORD_KIND, EC_WORD_AND, EC_WORD_YOU_RE, EC_WORD_ALSO, EC_WORD_STRONG}, .monSet = gBattleFrontierTrainerMons_Pamela }, @@ -379,7 +379,7 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU [FRONTIER_TRAINER_MARISA] = { .facilityClass = FACILITY_CLASS_PKMN_BREEDER_F, .trainerName = _("MARISA"), - .speechBefore = {EC_WORD_I, EC_WORD_PROMISE, EC_WORD_TO, EC_WORD_BATTLE, EC_WORD_SERIOUSLY, 0xFFFF}, + .speechBefore = {EC_WORD_I, EC_WORD_PROMISE, EC_WORD_TO, EC_WORD_BATTLE, EC_WORD_SERIOUSLY, EC_EMPTY_WORD}, .speechWin = {EC_WORD_PROMISE, EC_WORD_ME, EC_WORD_YOU, EC_WORD_WILL, EC_WORD_DO, EC_WORD_BETTER}, .speechLose = {EC_WORD_PROMISE, EC_WORD_ME, EC_WORD_ANOTHER, EC_WORD_BATTLE, EC_WORD_PLEASE, EC_WORD_EXCL}, .monSet = gBattleFrontierTrainerMons_Marisa @@ -397,23 +397,23 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .trainerName = _("YOSHI"), .speechBefore = {EC_WORD_BUG, EC_WORD_POKEMON, EC_WORD_MAKE, EC_WORD_ME, EC_WORD_FEELING, EC_WORD_LOVEY_DOVEY}, .speechWin = {EC_WORD_BUG, EC_WORD_POKEMON, EC_WORD_ARE, EC_WORD_THE, EC_WORD_BEST, EC_WORD_EXCL}, - .speechLose = {EC_WORD_YOU_RE, EC_WORD_IGNORANT, EC_WORD_ABOUT, EC_WORD_BUG, EC_WORD_POKEMON, 0xFFFF}, + .speechLose = {EC_WORD_YOU_RE, EC_WORD_IGNORANT, EC_WORD_ABOUT, EC_WORD_BUG, EC_WORD_POKEMON, EC_EMPTY_WORD}, .monSet = gBattleFrontierTrainerMons_Yoshi }, [FRONTIER_TRAINER_DESTIN] = { .facilityClass = FACILITY_CLASS_BUG_CATCHER, .trainerName = _("DESTIN"), - .speechBefore = {EC_WORD_IT_S, EC_WORD_WAY, EC_WORD_TOO, EC_WORD_HOT, EC_WORD_HERE, 0xFFFF}, - .speechWin = {EC_WORD_I_AM, EC_WORD_ABOUT, EC_WORD_TO, EC_MOVE(OVERHEAT), 0xFFFF, 0xFFFF}, - .speechLose = {EC_WORD_PLEASE, EC_WORD_I, EC_WORD_NEED, EC_WORD_SOME, EC_WORD_WATER, 0xFFFF}, + .speechBefore = {EC_WORD_IT_S, EC_WORD_WAY, EC_WORD_TOO, EC_WORD_HOT, EC_WORD_HERE, EC_EMPTY_WORD}, + .speechWin = {EC_WORD_I_AM, EC_WORD_ABOUT, EC_WORD_TO, EC_MOVE(OVERHEAT), EC_EMPTY_WORD, EC_EMPTY_WORD}, + .speechLose = {EC_WORD_PLEASE, EC_WORD_I, EC_WORD_NEED, EC_WORD_SOME, EC_WORD_WATER, EC_EMPTY_WORD}, .monSet = gBattleFrontierTrainerMons_Destin }, [FRONTIER_TRAINER_KEON] = { .facilityClass = FACILITY_CLASS_NINJA_BOY, .trainerName = _("KEON"), - .speechBefore = {EC_WORD_FORGIVE, EC_WORD_ME, EC_WORD_BUT, EC_WORD_HERE_I_COME, EC_WORD_EXCL, 0xFFFF}, + .speechBefore = {EC_WORD_FORGIVE, EC_WORD_ME, EC_WORD_BUT, EC_WORD_HERE_I_COME, EC_WORD_EXCL, EC_EMPTY_WORD}, .speechWin = {EC_WORD_FORGIVE, EC_WORD_ME, EC_WORD_FOR, EC_WORD_MY, EC_WORD_OVERWHELMING, EC_WORD_POWER}, - .speechLose = {EC_WORD_I_AM, EC_WORD_SORRY, EC_WORD_ELLIPSIS, 0xFFFF, 0xFFFF, 0xFFFF}, + .speechLose = {EC_WORD_I_AM, EC_WORD_SORRY, EC_WORD_ELLIPSIS, EC_EMPTY_WORD, EC_EMPTY_WORD, EC_EMPTY_WORD}, .monSet = gBattleFrontierTrainerMons_Keon }, [FRONTIER_TRAINER_STUART] = { @@ -429,7 +429,7 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .trainerName = _("NESTOR"), .speechBefore = {EC_WORD_SHOW, EC_WORD_ME, EC_WORD_A, EC_WORD_REALLY, EC_WORD_SMOOTH, EC_WORD_MOVE}, .speechWin = {EC_WORD_THERE, EC_WORD_WAS, EC_WORD_NOTHING, EC_WORD_SMOOTH, EC_WORD_ABOUT, EC_WORD_THAT}, - .speechLose = {EC_WORD_YOU, EC_WORD_REALLY, EC_WORD_ARE, EC_WORD_SMOOTH, EC_WORD_EXCL, 0xFFFF}, + .speechLose = {EC_WORD_YOU, EC_WORD_REALLY, EC_WORD_ARE, EC_WORD_SMOOTH, EC_WORD_EXCL, EC_EMPTY_WORD}, .monSet = gBattleFrontierTrainerMons_Nestor }, [FRONTIER_TRAINER_DERRICK] = { @@ -445,13 +445,13 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .trainerName = _("BRYSON"), .speechBefore = {EC_MOVE2(POISON_POWDER), EC_WORD_IS, EC_WORD_IN, EC_WORD_OUR, EC_MOVE2(COTTON_SPORE), EC_WORD_MOVE}, .speechWin = {EC_WORD_HOW_DO, EC_WORD_YOU, EC_WORD_LIKE, EC_WORD_OUR, EC_MOVE2(POISON_POWDER), EC_WORD_QUES}, - .speechLose = {EC_WORD_MY, EC_MOVE2(COTTON_SPORE), EC_WORD_WAS, EC_WORD_USELESS, 0xFFFF, 0xFFFF}, + .speechLose = {EC_WORD_MY, EC_MOVE2(COTTON_SPORE), EC_WORD_WAS, EC_WORD_USELESS, EC_EMPTY_WORD, EC_EMPTY_WORD}, .monSet = gBattleFrontierTrainerMons_Bryson }, [FRONTIER_TRAINER_CLAYTON] = { .facilityClass = FACILITY_CLASS_BUG_MANIAC, .trainerName = _("CLAYTON"), - .speechBefore = {EC_WORD_HUH_QUES, 0xFFFF, 0xFFFF, EC_WORD_WHERE, EC_WORD_IS_IT_QUES, 0xFFFF}, + .speechBefore = {EC_WORD_HUH_QUES, EC_EMPTY_WORD, EC_EMPTY_WORD, EC_WORD_WHERE, EC_WORD_IS_IT_QUES, EC_EMPTY_WORD}, .speechWin = {EC_WORD_WHERE, EC_WORD_IS_IT_QUES, EC_WORD_I_VE, EC_WORD_LOST, EC_WORD_MY, EC_WORD_POKENAV}, .speechLose = {EC_WORD_WHERE, EC_WORD_IS_IT_QUES, EC_WORD_I_VE, EC_WORD_LOST, EC_WORD_MY, EC_WORD_SENSE}, .monSet = gBattleFrontierTrainerMons_Clayton @@ -459,7 +459,7 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU [FRONTIER_TRAINER_TRENTON] = { .facilityClass = FACILITY_CLASS_FISHERMAN, .trainerName = _("TRENTON"), - .speechBefore = {EC_WORD_COME_OVER, EC_WORD_FOR, EC_WORD_SOME, EC_WORD_TASTY, EC_WORD_WATER, 0xFFFF}, + .speechBefore = {EC_WORD_COME_OVER, EC_WORD_FOR, EC_WORD_SOME, EC_WORD_TASTY, EC_WORD_WATER, EC_EMPTY_WORD}, .speechWin = {EC_WORD_MMM, EC_WORD_DO, EC_WORD_YOU, EC_WORD_WANT, EC_WORD_SOME, EC_WORD_QUES}, .speechLose = {EC_WORD_I, EC_WORD_GOT, EC_WORD_THIS, EC_WORD_TASTY, EC_WORD_WATER, EC_WORD_SHOPPING}, .monSet = gBattleFrontierTrainerMons_Trenton @@ -475,9 +475,9 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU [FRONTIER_TRAINER_WESLEY] = { .facilityClass = FACILITY_CLASS_FISHERMAN, .trainerName = _("WESLEY"), - .speechBefore = {EC_POKEMON2(MEW), EC_POKEMON2(MEW), EC_WORD_IS, EC_WORD_HOW, EC_WORD_I, EC_WORD_CRY}, + .speechBefore = {EC_POKEMON_NATIONAL(MEW), EC_POKEMON_NATIONAL(MEW), EC_WORD_IS, EC_WORD_HOW, EC_WORD_I, EC_WORD_CRY}, .speechWin = {EC_WORD_YES, EC_WORD_I, EC_WORD_KNOW, EC_WORD_I_AM, EC_WORD_CUTE, EC_WORD_EXCL}, - .speechLose = {EC_POKEMON2(MEW), EC_POKEMON2(MEW), EC_WORD_EXCL, EC_POKEMON2(MEW), EC_WORD_EXCL_EXCL, 0xFFFF}, + .speechLose = {EC_POKEMON_NATIONAL(MEW), EC_POKEMON_NATIONAL(MEW), EC_WORD_EXCL, EC_POKEMON_NATIONAL(MEW), EC_WORD_EXCL_EXCL, EC_EMPTY_WORD}, .monSet = gBattleFrontierTrainerMons_Wesley }, [FRONTIER_TRAINER_ANTON] = { @@ -491,7 +491,7 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU [FRONTIER_TRAINER_LAWSON] = { .facilityClass = FACILITY_CLASS_RUIN_MANIAC, .trainerName = _("LAWSON"), - .speechBefore = {EC_WORD_I_AM, EC_WORD_YOUNG, EC_WORD_AT, EC_WORD_HEART, EC_WORD_EXCL, 0xFFFF}, + .speechBefore = {EC_WORD_I_AM, EC_WORD_YOUNG, EC_WORD_AT, EC_WORD_HEART, EC_WORD_EXCL, EC_EMPTY_WORD}, .speechWin = {EC_WORD_NOT, EC_WORD_COOL, EC_WORD_EXCL, EC_WORD_NOT, EC_WORD_AT, EC_WORD_ALL}, .speechLose = {EC_WORD_I_AM, EC_WORD_OLD, EC_WORD_AND, EC_WORD_FEELING, EC_WORD_SHAKY, EC_WORD_ELLIPSIS}, .monSet = gBattleFrontierTrainerMons_Lawson @@ -515,16 +515,16 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU [FRONTIER_TRAINER_ADRIAN] = { .facilityClass = FACILITY_CLASS_COLLECTOR, .trainerName = _("ADRIAN"), - .speechBefore = {EC_WORD_YAHOO, EC_WORD_EXCL, 0xFFFF, EC_WORD_YAHOO, EC_WORD_EXCL_EXCL, 0xFFFF}, - .speechWin = {EC_WORD_THANK_YOU, EC_WORD_EXCL, 0xFFFF, EC_WORD_THANK_YOU, EC_WORD_EXCL_EXCL, 0xFFFF}, - .speechLose = {EC_WORD_GOOD_BYE, EC_WORD_EXCL, 0xFFFF, EC_WORD_GOOD_BYE, EC_WORD_EXCL_EXCL, 0xFFFF}, + .speechBefore = {EC_WORD_YAHOO, EC_WORD_EXCL, EC_EMPTY_WORD, EC_WORD_YAHOO, EC_WORD_EXCL_EXCL, EC_EMPTY_WORD}, + .speechWin = {EC_WORD_THANK_YOU, EC_WORD_EXCL, EC_EMPTY_WORD, EC_WORD_THANK_YOU, EC_WORD_EXCL_EXCL, EC_EMPTY_WORD}, + .speechLose = {EC_WORD_GOOD_BYE, EC_WORD_EXCL, EC_EMPTY_WORD, EC_WORD_GOOD_BYE, EC_WORD_EXCL_EXCL, EC_EMPTY_WORD}, .monSet = gBattleFrontierTrainerMons_Adrian }, [FRONTIER_TRAINER_TRISTAN] = { .facilityClass = FACILITY_CLASS_COLLECTOR, .trainerName = _("TRISTAN"), - .speechBefore = {EC_WORD_CONFUSED, EC_WORD_QUES, 0xFFFF, EC_WORD_I_AM, EC_WORD_A, EC_WORD_GENIUS}, - .speechWin = {EC_WORD_SEE, EC_WORD_QUES, 0xFFFF, EC_WORD_I_AM, EC_WORD_A, EC_WORD_GENIUS}, + .speechBefore = {EC_WORD_CONFUSED, EC_WORD_QUES, EC_EMPTY_WORD, EC_WORD_I_AM, EC_WORD_A, EC_WORD_GENIUS}, + .speechWin = {EC_WORD_SEE, EC_WORD_QUES, EC_EMPTY_WORD, EC_WORD_I_AM, EC_WORD_A, EC_WORD_GENIUS}, .speechLose = {EC_WORD_I_AM, EC_WORD_NOT, EC_WORD_A, EC_WORD_GENIUS, EC_WORD_IN, EC_WORD_BATTLE}, .monSet = gBattleFrontierTrainerMons_Tristan }, @@ -548,8 +548,8 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .facilityClass = FACILITY_CLASS_PARASOL_LADY, .trainerName = _("CHELSEA"), .speechBefore = {EC_WORD_I, EC_WORD_SERIOUSLY, EC_WORD_MEAN, EC_WORD_TO, EC_WORD_WIN, EC_WORD_EXCL}, - .speechWin = {EC_WORD_THAT_WAS, EC_WORD_MY, EC_WORD_WILL, EC_WORD_TO, EC_WORD_WIN, 0xFFFF}, - .speechLose = {EC_WORD_YOU_RE, EC_WORD_FAR, EC_WORD_TOO_STRONG, EC_WORD_FOR, EC_WORD_ME, 0xFFFF}, + .speechWin = {EC_WORD_THAT_WAS, EC_WORD_MY, EC_WORD_WILL, EC_WORD_TO, EC_WORD_WIN, EC_EMPTY_WORD}, + .speechLose = {EC_WORD_YOU_RE, EC_WORD_FAR, EC_WORD_TOO_STRONG, EC_WORD_FOR, EC_WORD_ME, EC_EMPTY_WORD}, .monSet = gBattleFrontierTrainerMons_Chelsea }, [FRONTIER_TRAINER_DANELA] = { @@ -613,7 +613,7 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .trainerName = _("JADEN"), .speechBefore = {EC_WORD_HELLO, EC_WORD_I, EC_WORD_THINK, EC_WORD_I, EC_WORD_ADORE, EC_WORD_YOU}, .speechWin = {EC_WORD_YOU, EC_WORD_MAKE, EC_WORD_ME, EC_MOVE(THRASH), EC_WORD_IN, EC_MOVE2(FRUSTRATION)}, - .speechLose = {EC_WORD_THIS_IS_IT_EXCL, 0xFFFF, 0xFFFF, EC_WORD_GOOD_BYE, EC_WORD_FOREVER, EC_WORD_EXCL}, + .speechLose = {EC_WORD_THIS_IS_IT_EXCL, EC_EMPTY_WORD, EC_EMPTY_WORD, EC_WORD_GOOD_BYE, EC_WORD_FOREVER, EC_WORD_EXCL}, .monSet = gBattleFrontierTrainerMons_Jaden }, [FRONTIER_TRAINER_DAKOTA] = { @@ -621,7 +621,7 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .trainerName = _("DAKOTA"), .speechBefore = {EC_WORD_YOU, EC_WORD_HAVE, EC_WORD_TO, EC_WORD_DANCE, EC_WORD_WITH, EC_WORD_POWER}, .speechWin = {EC_WORD_GOT, EC_WORD_IT, EC_WORD_QUES, EC_WORD_DANCE, EC_WORD_WITH, EC_WORD_POWER}, - .speechLose = {EC_WORD_OKAY, EC_WORD_YOU, EC_WORD_UNDERSTAND, EC_WORD_ALL_RIGHT, EC_WORD_EXCL, 0xFFFF}, + .speechLose = {EC_WORD_OKAY, EC_WORD_YOU, EC_WORD_UNDERSTAND, EC_WORD_ALL_RIGHT, EC_WORD_EXCL, EC_EMPTY_WORD}, .monSet = gBattleFrontierTrainerMons_Dakota }, [FRONTIER_TRAINER_BRAYDEN] = { @@ -637,22 +637,22 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .trainerName = _("CORSON"), .speechBefore = {EC_WORD_I, EC_WORD_GET, EC_WORD_TO, EC_MOVE2(BEAT_UP), EC_WORD_ON, EC_WORD_YOU}, .speechWin = {EC_WORD_TOO, EC_WORD_EASY, EC_WORD_EXCL, EC_WORD_I_AM, EC_WORD_SO, EC_WORD_COOL}, - .speechLose = {EC_WORD_WHY, EC_WORD_QUES_EXCL, 0xFFFF, EC_WORD_I, EC_MOVE2(CURSE), EC_WORD_YOU}, + .speechLose = {EC_WORD_WHY, EC_WORD_QUES_EXCL, EC_EMPTY_WORD, EC_WORD_I, EC_MOVE2(CURSE), EC_WORD_YOU}, .monSet = gBattleFrontierTrainerMons_Corson }, [FRONTIER_TRAINER_TREVIN] = { .facilityClass = FACILITY_CLASS_BIRD_KEEPER, .trainerName = _("TREVIN"), .speechBefore = {EC_WORD_THERE, EC_WORD_IS, EC_WORD_NONE, EC_WORD_BETTER, EC_WORD_THAN, EC_WORD_ME}, - .speechWin = {EC_WORD_YES_SIR_EXCL, 0xFFFF, 0xFFFF, EC_WORD_I_AM, EC_WORD_THE, EC_WORD_BEST}, - .speechLose = {EC_WORD_SERIOUS, EC_WORD_QUES_EXCL, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF}, + .speechWin = {EC_WORD_YES_SIR_EXCL, EC_EMPTY_WORD, EC_EMPTY_WORD, EC_WORD_I_AM, EC_WORD_THE, EC_WORD_BEST}, + .speechLose = {EC_WORD_SERIOUS, EC_WORD_QUES_EXCL, EC_EMPTY_WORD, EC_EMPTY_WORD, EC_EMPTY_WORD, EC_EMPTY_WORD}, .monSet = gBattleFrontierTrainerMons_Trevin }, [FRONTIER_TRAINER_PATRICK] = { .facilityClass = FACILITY_CLASS_SAILOR, .trainerName = _("PATRICK"), - .speechBefore = {EC_WORD_I_AM, EC_WORD_PERFECT, EC_WORD_EXCL, EC_WORD_GIVE_UP, EC_WORD_NOW, 0xFFFF}, - .speechWin = {EC_WORD_DON_T, EC_WORD_BE, EC_WORD_DISAPPOINTED, EC_WORD_I_AM, EC_WORD_PERFECT, 0xFFFF}, + .speechBefore = {EC_WORD_I_AM, EC_WORD_PERFECT, EC_WORD_EXCL, EC_WORD_GIVE_UP, EC_WORD_NOW, EC_EMPTY_WORD}, + .speechWin = {EC_WORD_DON_T, EC_WORD_BE, EC_WORD_DISAPPOINTED, EC_WORD_I_AM, EC_WORD_PERFECT, EC_EMPTY_WORD}, .speechLose = {EC_WORD_BUT, EC_WORD_HOW, EC_WORD_QUES, EC_WORD_I_AM, EC_WORD_PERFECT, EC_WORD_ELLIPSIS}, .monSet = gBattleFrontierTrainerMons_Patrick }, @@ -667,9 +667,9 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU [FRONTIER_TRAINER_MAXWELL] = { .facilityClass = FACILITY_CLASS_SAILOR, .trainerName = _("MAXWELL"), - .speechBefore = {EC_WORD_HEY_THERE, EC_WORD_WHO_IS, EC_WORD_YOUR, EC_WORD_RIVAL, EC_WORD_QUES, 0xFFFF}, + .speechBefore = {EC_WORD_HEY_THERE, EC_WORD_WHO_IS, EC_WORD_YOUR, EC_WORD_RIVAL, EC_WORD_QUES, EC_EMPTY_WORD}, .speechWin = {EC_WORD_MY, EC_WORD_RIVAL, EC_WORD_IS, EC_WORD_MY, EC_WORD_GIRL, EC_WORD_FRIEND}, - .speechLose = {EC_WORD_I_AM, EC_WORD_MAKING, EC_WORD_YOU, EC_WORD_MY, EC_WORD_RIVAL, 0xFFFF}, + .speechLose = {EC_WORD_I_AM, EC_WORD_MAKING, EC_WORD_YOU, EC_WORD_MY, EC_WORD_RIVAL, EC_EMPTY_WORD}, .monSet = gBattleFrontierTrainerMons_Maxwell }, [FRONTIER_TRAINER_DARYL] = { @@ -685,22 +685,22 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .trainerName = _("KENNETH"), .speechBefore = {EC_WORD_YOU, EC_WORD_BETTER, EC_WORD_NOT, EC_MOVE2(SLACK_OFF), EC_WORD_WITH, EC_WORD_ME}, .speechWin = {EC_WORD_DID, EC_WORD_MY, EC_MOVE2(TAUNT), EC_WORD_INTIMIDATE, EC_WORD_YOU, EC_WORD_QUES}, - .speechLose = {EC_WORD_I_AM, EC_WORD_SORRY, EC_WORD_ELLIPSIS, 0xFFFF, 0xFFFF, 0xFFFF}, + .speechLose = {EC_WORD_I_AM, EC_WORD_SORRY, EC_WORD_ELLIPSIS, EC_EMPTY_WORD, EC_EMPTY_WORD, EC_EMPTY_WORD}, .monSet = gBattleFrontierTrainerMons_Kenneth }, [FRONTIER_TRAINER_RICH] = { .facilityClass = FACILITY_CLASS_HIKER, .trainerName = _("RICH"), - .speechBefore = {EC_WORD_YOUR, EC_MOVE(FACADE), EC_WORD_DOESN_T, EC_MOVE2(TRICK), EC_WORD_ME, 0xFFFF}, - .speechWin = {EC_WORD_SERIOUSLY, EC_WORD_ARE, EC_WORD_YOU, EC_WORD_REALLY, EC_WORD_OK_QUES, 0xFFFF}, - .speechLose = {EC_WORD_THAT_WAS, EC_WORD_REALLY, EC_WORD_TOUGH, EC_WORD_ON, EC_WORD_ME, 0xFFFF}, + .speechBefore = {EC_WORD_YOUR, EC_MOVE(FACADE), EC_WORD_DOESN_T, EC_MOVE2(TRICK), EC_WORD_ME, EC_EMPTY_WORD}, + .speechWin = {EC_WORD_SERIOUSLY, EC_WORD_ARE, EC_WORD_YOU, EC_WORD_REALLY, EC_WORD_OK_QUES, EC_EMPTY_WORD}, + .speechLose = {EC_WORD_THAT_WAS, EC_WORD_REALLY, EC_WORD_TOUGH, EC_WORD_ON, EC_WORD_ME, EC_EMPTY_WORD}, .monSet = gBattleFrontierTrainerMons_Rich }, [FRONTIER_TRAINER_CADEN] = { .facilityClass = FACILITY_CLASS_KINDLER, .trainerName = _("CADEN"), - .speechBefore = {EC_WORD_I, EC_WORD_CAN_T, EC_WORD_BE, EC_WORD_DEFEATED, EC_WORD_EXCL, 0xFFFF}, - .speechWin = {EC_WORD_FIRE, EC_WORD_EXCL, 0xFFFF, EC_WORD_FIRE, EC_WORD_EXCL_EXCL, 0xFFFF}, + .speechBefore = {EC_WORD_I, EC_WORD_CAN_T, EC_WORD_BE, EC_WORD_DEFEATED, EC_WORD_EXCL, EC_EMPTY_WORD}, + .speechWin = {EC_WORD_FIRE, EC_WORD_EXCL, EC_EMPTY_WORD, EC_WORD_FIRE, EC_WORD_EXCL_EXCL, EC_EMPTY_WORD}, .speechLose = {EC_WORD_I_AM, EC_WORD_TIRED, EC_WORD_ELLIPSIS, EC_WORD_IT_S, EC_WORD_SO, EC_WORD_HOT}, .monSet = gBattleFrontierTrainerMons_Caden }, @@ -715,9 +715,9 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU [FRONTIER_TRAINER_NASH] = { .facilityClass = FACILITY_CLASS_KINDLER, .trainerName = _("NASH"), - .speechBefore = {EC_WORD_I_AM, EC_WORD_ON, EC_WORD_FIRE, EC_WORD_BABY, EC_WORD_EXCL, 0xFFFF}, + .speechBefore = {EC_WORD_I_AM, EC_WORD_ON, EC_WORD_FIRE, EC_WORD_BABY, EC_WORD_EXCL, EC_EMPTY_WORD}, .speechWin = {EC_WORD_I, EC_WORD_LEFT, EC_WORD_YOU, EC_WORD_JUST, EC_WORD_AN, EC_MOVE2(EMBER)}, - .speechLose = {EC_WORD_AIYEEH, EC_WORD_EXCL_EXCL, 0xFFFF, EC_WORD_NO, EC_WORD_WATER, EC_WORD_PLEASE}, + .speechLose = {EC_WORD_AIYEEH, EC_WORD_EXCL_EXCL, EC_EMPTY_WORD, EC_WORD_NO, EC_WORD_WATER, EC_WORD_PLEASE}, .monSet = gBattleFrontierTrainerMons_Nash }, [FRONTIER_TRAINER_ROBBY] = { @@ -749,13 +749,13 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .trainerName = _("ELLEN"), .speechBefore = {EC_WORD_CRUSH, EC_WORD_YOU, EC_WORD_LIKE, EC_WORD_AN, EC_WORD_EGG, EC_WORD_EXCL}, .speechWin = {EC_WORD_THAT_WAS, EC_WORD_A, EC_WORD_TASTY, EC_WORD_VICTORY, EC_WORD_FOR, EC_WORD_ME}, - .speechLose = {EC_WORD_TOO, EC_WORD_TOUGH, EC_WORD_TO, EC_WORD_CRUSH, EC_WORD_EXCL, 0xFFFF}, + .speechLose = {EC_WORD_TOO, EC_WORD_TOUGH, EC_WORD_TO, EC_WORD_CRUSH, EC_WORD_EXCL, EC_EMPTY_WORD}, .monSet = gBattleFrontierTrainerMons_Ellen }, [FRONTIER_TRAINER_RAMON] = { .facilityClass = FACILITY_CLASS_SWIMMING_TRIATHLETE_M, .trainerName = _("RAMON"), - .speechBefore = {EC_WORD_OKAY, EC_WORD_EXCL, 0xFFFF, EC_WORD_THIS, EC_WORD_IS, EC_WORD_PERFECTION}, + .speechBefore = {EC_WORD_OKAY, EC_WORD_EXCL, EC_EMPTY_WORD, EC_WORD_THIS, EC_WORD_IS, EC_WORD_PERFECTION}, .speechWin = {EC_WORD_I_AM, EC_WORD_HAPPY, EC_WORD_THAT, EC_WORD_I, EC_WORD_WON, EC_WORD_EXCL}, .speechLose = {EC_WORD_IT_S, EC_WORD_A, EC_WORD_SECRET, EC_WORD_WHY, EC_WORD_I_AM, EC_WORD_HAPPY}, .monSet = gBattleFrontierTrainerMons_Ramon @@ -764,8 +764,8 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .facilityClass = FACILITY_CLASS_SWIMMING_TRIATHLETE_M, .trainerName = _("ARTHUR"), .speechBefore = {EC_WORD_HERE_I_COME, EC_WORD_FEELING, EC_WORD_READY, EC_WORD_FOR, EC_WORD_IT, EC_WORD_ALL}, - .speechWin = {EC_WORD_THAT_S_IT_EXCL, 0xFFFF, 0xFFFF, EC_WORD_THAT_WAS, EC_WORD_FABULOUS, EC_WORD_EXCL}, - .speechLose = {EC_WORD_THAT_WAS, EC_WORD_NOT, EC_WORD_WHAT, EC_WORD_I, EC_WORD_NEED, 0xFFFF}, + .speechWin = {EC_WORD_THAT_S_IT_EXCL, EC_EMPTY_WORD, EC_EMPTY_WORD, EC_WORD_THAT_WAS, EC_WORD_FABULOUS, EC_WORD_EXCL}, + .speechLose = {EC_WORD_THAT_WAS, EC_WORD_NOT, EC_WORD_WHAT, EC_WORD_I, EC_WORD_NEED, EC_EMPTY_WORD}, .monSet = gBattleFrontierTrainerMons_Arthur }, [FRONTIER_TRAINER_ALONDRA] = { @@ -781,7 +781,7 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .trainerName = _("ADRIANA"), .speechBefore = {EC_WORD_COME, EC_WORD_SEE, EC_WORD_AN, EC_WORD_INCREDIBLE, EC_WORD_SWIFT_SWIM, EC_WORD_EXCL}, .speechWin = {EC_WORD_I, EC_WORD_MAKE, EC_WORD_IT, EC_WORD_LOOK, EC_WORD_SO, EC_WORD_EASY}, - .speechLose = {EC_WORD_I_AM, EC_WORD_FEELING, EC_MOVE2(BEAT_UP), EC_WORD_AND, EC_WORD_TIRED, 0xFFFF}, + .speechLose = {EC_WORD_I_AM, EC_WORD_FEELING, EC_MOVE2(BEAT_UP), EC_WORD_AND, EC_WORD_TIRED, EC_EMPTY_WORD}, .monSet = gBattleFrontierTrainerMons_Adriana }, [FRONTIER_TRAINER_MALIK] = { @@ -795,17 +795,17 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU [FRONTIER_TRAINER_JILL] = { .facilityClass = FACILITY_CLASS_CYCLING_TRIATHLETE_F, .trainerName = _("JILL"), - .speechBefore = {EC_WORD_I_AM, EC_WORD_THE, EC_MOVE2(QUICK_ATTACK), EC_WORD_TRAINER, EC_WORD_EXCL, 0xFFFF}, - .speechWin = {EC_WORD_THE, EC_MOVE2(QUICK_ATTACK), EC_WORD_TRAINER, EC_WORD_WINS, EC_WORD_EXCL, 0xFFFF}, + .speechBefore = {EC_WORD_I_AM, EC_WORD_THE, EC_MOVE2(QUICK_ATTACK), EC_WORD_TRAINER, EC_WORD_EXCL, EC_EMPTY_WORD}, + .speechWin = {EC_WORD_THE, EC_MOVE2(QUICK_ATTACK), EC_WORD_TRAINER, EC_WORD_WINS, EC_WORD_EXCL, EC_EMPTY_WORD}, .speechLose = {EC_WORD_THE, EC_MOVE2(QUICK_ATTACK), EC_WORD_TRAINER, EC_WORD_GIVES, EC_WORD_UP, EC_WORD_EXCL}, .monSet = gBattleFrontierTrainerMons_Jill }, [FRONTIER_TRAINER_ERIK] = { .facilityClass = FACILITY_CLASS_RUNNING_TRIATHLETE_M, .trainerName = _("ERIK"), - .speechBefore = {EC_WORD_I_AM, EC_WORD_THE, EC_WORD_SPEED_BOOST, EC_WORD_HERO, EC_WORD_EXCL, 0xFFFF}, + .speechBefore = {EC_WORD_I_AM, EC_WORD_THE, EC_WORD_SPEED_BOOST, EC_WORD_HERO, EC_WORD_EXCL, EC_EMPTY_WORD}, .speechWin = {EC_WORD_THANK_YOU, EC_WORD_FROM, EC_WORD_THE, EC_WORD_SPEED_BOOST, EC_WORD_HERO, EC_WORD_EXCL}, - .speechLose = {EC_WORD_WAAAH, EC_WORD_EXCL_EXCL, 0xFFFF, EC_WORD_NO, EC_WORD_NO, EC_WORD_EXCL_EXCL}, + .speechLose = {EC_WORD_WAAAH, EC_WORD_EXCL_EXCL, EC_EMPTY_WORD, EC_WORD_NO, EC_WORD_NO, EC_WORD_EXCL_EXCL}, .monSet = gBattleFrontierTrainerMons_Erik }, [FRONTIER_TRAINER_YAZMIN] = { @@ -843,9 +843,9 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU [FRONTIER_TRAINER_CARLO] = { .facilityClass = FACILITY_CLASS_CYCLING_TRIATHLETE_M, .trainerName = _("CARLO"), - .speechBefore = {EC_WORD_HAH, EC_WORD_EXCL_EXCL, 0xFFFF, EC_WORD_YEAH, EC_WORD_EXCL_EXCL, 0xFFFF}, + .speechBefore = {EC_WORD_HAH, EC_WORD_EXCL_EXCL, EC_EMPTY_WORD, EC_WORD_YEAH, EC_WORD_EXCL_EXCL, EC_EMPTY_WORD}, .speechWin = {EC_WORD_I, EC_WORD_DO, EC_WORD_THINGS, EC_WORD_AT, EC_MOVE(EXTREME_SPEED), EC_WORD_EXCL}, - .speechLose = {EC_WORD_I, EC_WORD_LOST, EC_WORD_AT, EC_MOVE(EXTREME_SPEED), EC_WORD_ELLIPSIS, 0xFFFF}, + .speechLose = {EC_WORD_I, EC_WORD_LOST, EC_WORD_AT, EC_MOVE(EXTREME_SPEED), EC_WORD_ELLIPSIS, EC_EMPTY_WORD}, .monSet = gBattleFrontierTrainerMons_Carlo }, [FRONTIER_TRAINER_EMILIA] = { @@ -859,7 +859,7 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU [FRONTIER_TRAINER_DALIA] = { .facilityClass = FACILITY_CLASS_CYCLING_TRIATHLETE_F, .trainerName = _("DALIA"), - .speechBefore = {EC_WORD_MY, EC_WORD_BIKE, EC_WORD_IS, EC_WORD_VERY, EC_WORD_EXPENSIVE, 0xFFFF}, + .speechBefore = {EC_WORD_MY, EC_WORD_BIKE, EC_WORD_IS, EC_WORD_VERY, EC_WORD_EXPENSIVE, EC_EMPTY_WORD}, .speechWin = {EC_WORD_DON_T, EC_WORD_COME, EC_WORD_NEAR, EC_WORD_MY, EC_WORD_BIKE, EC_WORD_EXCL}, .speechLose = {EC_WORD_MY, EC_WORD_BIKE, EC_WORD_IS, EC_WORD_MY, EC_WORD_BEST, EC_WORD_FRIEND}, .monSet = gBattleFrontierTrainerMons_Dalia @@ -867,24 +867,24 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU [FRONTIER_TRAINER_HITOMI] = { .facilityClass = FACILITY_CLASS_BLACK_BELT, .trainerName = _("HITOMI"), - .speechBefore = {EC_WORD_YEAH, EC_WORD_EXCL_EXCL, 0xFFFF, EC_WORD_HAH, EC_WORD_EXCL_EXCL, 0xFFFF}, - .speechWin = {EC_WORD_WHAT, EC_WORD_QUES_EXCL, 0xFFFF, EC_WORD_I, EC_WORD_WON, EC_WORD_QUES_EXCL}, - .speechLose = {EC_WORD_AIYEEH, EC_WORD_EXCL_EXCL, 0xFFFF, EC_WORD_I_AM, EC_WORD_SORRY, EC_WORD_EXCL_EXCL}, + .speechBefore = {EC_WORD_YEAH, EC_WORD_EXCL_EXCL, EC_EMPTY_WORD, EC_WORD_HAH, EC_WORD_EXCL_EXCL, EC_EMPTY_WORD}, + .speechWin = {EC_WORD_WHAT, EC_WORD_QUES_EXCL, EC_EMPTY_WORD, EC_WORD_I, EC_WORD_WON, EC_WORD_QUES_EXCL}, + .speechLose = {EC_WORD_AIYEEH, EC_WORD_EXCL_EXCL, EC_EMPTY_WORD, EC_WORD_I_AM, EC_WORD_SORRY, EC_WORD_EXCL_EXCL}, .monSet = gBattleFrontierTrainerMons_Hitomi }, [FRONTIER_TRAINER_RICARDO] = { .facilityClass = FACILITY_CLASS_BLACK_BELT, .trainerName = _("RICARDO"), .speechBefore = {EC_WORD_COME_ON, EC_WORD_EXCL, EC_WORD_PLAY, EC_WORD_TIME, EC_WORD_IS, EC_WORD_OVER}, - .speechWin = {EC_WORD_YOU_RE, EC_WORD_OUT, EC_WORD_OF, EC_WORD_HERE, EC_WORD_EXCL, 0xFFFF}, - .speechLose = {EC_WORD_PLEASE, EC_WORD_DON_T, EC_WORD_HIT, EC_WORD_ME, EC_WORD_EXCL, 0xFFFF}, + .speechWin = {EC_WORD_YOU_RE, EC_WORD_OUT, EC_WORD_OF, EC_WORD_HERE, EC_WORD_EXCL, EC_EMPTY_WORD}, + .speechLose = {EC_WORD_PLEASE, EC_WORD_DON_T, EC_WORD_HIT, EC_WORD_ME, EC_WORD_EXCL, EC_EMPTY_WORD}, .monSet = gBattleFrontierTrainerMons_Ricardo }, [FRONTIER_TRAINER_SHIZUKA] = { .facilityClass = FACILITY_CLASS_BLACK_BELT, .trainerName = _("SHIZUKA"), .speechBefore = {EC_WORD_SHOW, EC_WORD_ME, EC_WORD_THAT, EC_WORD_YOU_RE, EC_WORD_SERIOUS, EC_WORD_EXCL}, - .speechWin = {EC_WORD_I, EC_WORD_WON_T, EC_WORD_FORGET, EC_WORD_ABOUT, EC_WORD_YOU, 0xFFFF}, + .speechWin = {EC_WORD_I, EC_WORD_WON_T, EC_WORD_FORGET, EC_WORD_ABOUT, EC_WORD_YOU, EC_EMPTY_WORD}, .speechLose = {EC_WORD_YOU_RE, EC_WORD_PERFECT, EC_WORD_IN, EC_WORD_EVERY, EC_WORD_WAY, EC_WORD_EXCL}, .monSet = gBattleFrontierTrainerMons_Shizuka }, @@ -900,7 +900,7 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .facilityClass = FACILITY_CLASS_BATTLE_GIRL, .trainerName = _("KELLY"), .speechBefore = {EC_WORD_MY, EC_WORD_NIGHT, EC_WORD_SCHOOL, EC_WORD_IS, EC_WORD_REALLY, EC_WORD_SCARY}, - .speechWin = {EC_WORD_A, EC_WORD_LADY, EC_WORD_GHOST, EC_WORD_APPEARS, EC_WORD_THERE, 0xFFFF}, + .speechWin = {EC_WORD_A, EC_WORD_LADY, EC_WORD_GHOST, EC_WORD_APPEARS, EC_WORD_THERE, EC_EMPTY_WORD}, .speechLose = {EC_WORD_THE, EC_WORD_HOME, EC_WORD_WORK, EC_WORD_IS, EC_WORD_AWFULLY, EC_WORD_SCARY}, .monSet = gBattleFrontierTrainerMons_Kelly }, @@ -908,14 +908,14 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .facilityClass = FACILITY_CLASS_BATTLE_GIRL, .trainerName = _("RAYNA"), .speechBefore = {EC_WORD_I_AM, EC_WORD_NO_1, EC_WORD_WHEN, EC_WORD_IT_S, EC_WORD_ABOUT, EC_WORD_POWER}, - .speechWin = {EC_WORD_UNDERSTAND, EC_WORD_MY, EC_WORD_POWER, EC_WORD_NOW, EC_WORD_QUES, 0xFFFF}, - .speechLose = {EC_WORD_TERRIBLE, EC_WORD_ELLIPSIS, 0xFFFF, EC_WORD_I_AM, EC_WORD_TERRIBLE, EC_WORD_ELLIPSIS}, + .speechWin = {EC_WORD_UNDERSTAND, EC_WORD_MY, EC_WORD_POWER, EC_WORD_NOW, EC_WORD_QUES, EC_EMPTY_WORD}, + .speechLose = {EC_WORD_TERRIBLE, EC_WORD_ELLIPSIS, EC_EMPTY_WORD, EC_WORD_I_AM, EC_WORD_TERRIBLE, EC_WORD_ELLIPSIS}, .monSet = gBattleFrontierTrainerMons_Rayna }, [FRONTIER_TRAINER_EVAN] = { .facilityClass = FACILITY_CLASS_EXPERT_M, .trainerName = _("EVAN"), - .speechBefore = {EC_WORD_EVERY, EC_WORD_BATTLE, EC_WORD_HAS, EC_WORD_A, EC_WORD_SMELL, 0xFFFF}, + .speechBefore = {EC_WORD_EVERY, EC_WORD_BATTLE, EC_WORD_HAS, EC_WORD_A, EC_WORD_SMELL, EC_EMPTY_WORD}, .speechWin = {EC_WORD_OH, EC_WORD_EXCL, EC_WORD_THE, EC_MOVE(SWEET_SCENT), EC_WORD_OF, EC_WORD_VICTORY}, .speechLose = {EC_WORD_THE, EC_WORD_AWFUL, EC_WORD_STENCH, EC_WORD_OF, EC_WORD_A, EC_WORD_LOSS}, .monSet = gBattleFrontierTrainerMons_Evan @@ -923,23 +923,23 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU [FRONTIER_TRAINER_JORDAN] = { .facilityClass = FACILITY_CLASS_EXPERT_M, .trainerName = _("JORDAN"), - .speechBefore = {EC_WORD_GOOD, EC_WORD_EXCL, 0xFFFF, EC_WORD_COME_ON, EC_WORD_EXCL_EXCL, 0xFFFF}, - .speechWin = {EC_WORD_YOU, EC_WORD_CAN_T, EC_WORD_BEAT, EC_WORD_ME, EC_WORD_EXCL, 0xFFFF}, - .speechLose = {EC_WORD_WHAT, EC_WORD_QUES_EXCL, 0xFFFF, EC_WORD_BUT, EC_WORD_HOW, EC_WORD_QUES}, + .speechBefore = {EC_WORD_GOOD, EC_WORD_EXCL, EC_EMPTY_WORD, EC_WORD_COME_ON, EC_WORD_EXCL_EXCL, EC_EMPTY_WORD}, + .speechWin = {EC_WORD_YOU, EC_WORD_CAN_T, EC_WORD_BEAT, EC_WORD_ME, EC_WORD_EXCL, EC_EMPTY_WORD}, + .speechLose = {EC_WORD_WHAT, EC_WORD_QUES_EXCL, EC_EMPTY_WORD, EC_WORD_BUT, EC_WORD_HOW, EC_WORD_QUES}, .monSet = gBattleFrontierTrainerMons_Jordan }, [FRONTIER_TRAINER_JOEL] = { .facilityClass = FACILITY_CLASS_EXPERT_M, .trainerName = _("JOEL"), - .speechBefore = {EC_WORD_FUFUFU, EC_WORD_ELLIPSIS, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF}, - .speechWin = {EC_WORD_GIGGLE, EC_WORD_ELLIPSIS, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF}, - .speechLose = {EC_WORD_HAHAHA, EC_WORD_ELLIPSIS, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF}, + .speechBefore = {EC_WORD_FUFUFU, EC_WORD_ELLIPSIS, EC_EMPTY_WORD, EC_EMPTY_WORD, EC_EMPTY_WORD, EC_EMPTY_WORD}, + .speechWin = {EC_WORD_GIGGLE, EC_WORD_ELLIPSIS, EC_EMPTY_WORD, EC_EMPTY_WORD, EC_EMPTY_WORD, EC_EMPTY_WORD}, + .speechLose = {EC_WORD_HAHAHA, EC_WORD_ELLIPSIS, EC_EMPTY_WORD, EC_EMPTY_WORD, EC_EMPTY_WORD, EC_EMPTY_WORD}, .monSet = gBattleFrontierTrainerMons_Joel }, [FRONTIER_TRAINER_KRISTEN] = { .facilityClass = FACILITY_CLASS_EXPERT_F, .trainerName = _("KRISTEN"), - .speechBefore = {EC_WORD_HAHAHA, EC_WORD_ELLIPSIS, 0xFFFF, EC_WORD_A, EC_WORD_KID, EC_WORD_ELLIPSIS}, + .speechBefore = {EC_WORD_HAHAHA, EC_WORD_ELLIPSIS, EC_EMPTY_WORD, EC_WORD_A, EC_WORD_KID, EC_WORD_ELLIPSIS}, .speechWin = {EC_WORD_JUST, EC_WORD_A_LITTLE, EC_WORD_KID, EC_WORD_AFTER, EC_WORD_ALL, EC_WORD_EXCL}, .speechLose = {EC_WORD_A, EC_WORD_TOUGH, EC_WORD_KID, EC_WORD_HUH_QUES, EC_WORD_HUMPH, EC_WORD_EXCL}, .monSet = gBattleFrontierTrainerMons_Kristen @@ -947,7 +947,7 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU [FRONTIER_TRAINER_SELPHY] = { .facilityClass = FACILITY_CLASS_EXPERT_F, .trainerName = _("SELPHY"), - .speechBefore = {EC_WORD_HUH_QUES, EC_WORD_WHAT, EC_WORD_IS_IT_QUES, 0xFFFF, 0xFFFF, 0xFFFF}, + .speechBefore = {EC_WORD_HUH_QUES, EC_WORD_WHAT, EC_WORD_IS_IT_QUES, EC_EMPTY_WORD, EC_EMPTY_WORD, EC_EMPTY_WORD}, .speechWin = {EC_WORD_OH, EC_WORD_YES, EC_WORD_EXCL, EC_WORD_WHY, EC_WORD_NOT, EC_WORD_QUES}, .speechLose = {EC_WORD_OH, EC_WORD_NO, EC_WORD_EXCL, EC_WORD_WHY, EC_WORD_NOT, EC_WORD_QUES}, .monSet = gBattleFrontierTrainerMons_Selphy @@ -956,14 +956,14 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .facilityClass = FACILITY_CLASS_EXPERT_F, .trainerName = _("CHLOE"), .speechBefore = {EC_WORD_COME, EC_WORD_WE, EC_WORD_WILL, EC_WORD_DO, EC_WORD_BATTLE, EC_WORD_NOW}, - .speechWin = {EC_WORD_MORE, EC_WORD_EXCL, 0xFFFF, EC_WORD_ANOTHER, EC_WORD_BATTLE, EC_WORD_EXCL}, - .speechLose = {EC_WORD_OH, EC_WORD_EXCL, 0xFFFF, EC_WORD_STRONG, EC_WORD_YOU, EC_WORD_ARE}, + .speechWin = {EC_WORD_MORE, EC_WORD_EXCL, EC_EMPTY_WORD, EC_WORD_ANOTHER, EC_WORD_BATTLE, EC_WORD_EXCL}, + .speechLose = {EC_WORD_OH, EC_WORD_EXCL, EC_EMPTY_WORD, EC_WORD_STRONG, EC_WORD_YOU, EC_WORD_ARE}, .monSet = gBattleFrontierTrainerMons_Chloe }, [FRONTIER_TRAINER_NORTON] = { .facilityClass = FACILITY_CLASS_PSYCHIC_M, .trainerName = _("NORTON"), - .speechBefore = {EC_WORD_I, EC_WORD_KNOW, EC_WORD_ONLY, EC_WORD_YOU, 0xFFFF, 0xFFFF}, + .speechBefore = {EC_WORD_I, EC_WORD_KNOW, EC_WORD_ONLY, EC_WORD_YOU, EC_EMPTY_WORD, EC_EMPTY_WORD}, .speechWin = {EC_WORD_EXCUSE_ME, EC_WORD_BUT, EC_WORD_YOU_RE, EC_WORD_A, EC_WORD_PUSHOVER, EC_WORD_EXCL}, .speechLose = {EC_WORD_YOU_RE, EC_WORD_SOME, EC_WORD_KIND, EC_WORD_OF, EC_WORD_AWESOME, EC_WORD_EXCL}, .monSet = gBattleFrontierTrainerMons_Norton @@ -973,15 +973,15 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .trainerName = _("LUKAS"), .speechBefore = {EC_WORD_MY, EC_WORD_JOKING, EC_WORD_IS, EC_WORD_PRETTY, EC_WORD_TERRIBLE, EC_WORD_ELLIPSIS}, .speechWin = {EC_WORD_YOUR, EC_WORD_ROCK_HEAD, EC_WORD_EXISTS, EC_WORD_TO, EC_WORD_SHINE, EC_WORD_EXCL}, - .speechLose = {EC_WORD_YOUR, EC_WORD_ROCK_HEAD, EC_WORD_COME, EC_WORD_TO, EC_WORD_SHINE, 0xFFFF}, + .speechLose = {EC_WORD_YOUR, EC_WORD_ROCK_HEAD, EC_WORD_COME, EC_WORD_TO, EC_WORD_SHINE, EC_EMPTY_WORD}, .monSet = gBattleFrontierTrainerMons_Lukas }, [FRONTIER_TRAINER_ZACH] = { .facilityClass = FACILITY_CLASS_PSYCHIC_M, .trainerName = _("ZACH"), .speechBefore = {EC_WORD_I_AM, EC_WORD_AN, EC_WORD_EXCELLENT, EC_MOVE2(MIMIC), EC_WORD_OF, EC_WORD_POKEMON}, - .speechWin = {EC_WORD_I_AM, EC_WORD_HAPPY, EC_WORD_LIKE, EC_WORD_A_LITTLE, EC_POKEMON2(TOGEPI), EC_WORD_EXCL}, - .speechLose = {EC_WORD_I_AM, EC_WORD_ANGRY, EC_WORD_LIKE, EC_WORD_A, EC_POKEMON2(MANKEY), EC_WORD_EXCL}, + .speechWin = {EC_WORD_I_AM, EC_WORD_HAPPY, EC_WORD_LIKE, EC_WORD_A_LITTLE, EC_POKEMON_NATIONAL(TOGEPI), EC_WORD_EXCL}, + .speechLose = {EC_WORD_I_AM, EC_WORD_ANGRY, EC_WORD_LIKE, EC_WORD_A, EC_POKEMON_NATIONAL(MANKEY), EC_WORD_EXCL}, .monSet = gBattleFrontierTrainerMons_Zach }, [FRONTIER_TRAINER_KAITLYN] = { @@ -997,7 +997,7 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .trainerName = _("BREANNA"), .speechBefore = {EC_WORD_MY, EC_WORD_POKEMON, EC_WORD_WILL, EC_WORD_CRUSH, EC_WORD_YOU, EC_WORD_EXCL}, .speechWin = {EC_WORD_HAVE, EC_WORD_SOME, EC_WORD_MORE, EC_WORD_OF, EC_WORD_THIS, EC_WORD_EXCL}, - .speechLose = {EC_WORD_YOU, EC_WORD_HAVE, EC_WORD_GUTS, EC_WORD_AND, EC_WORD_SKILL, 0xFFFF}, + .speechLose = {EC_WORD_YOU, EC_WORD_HAVE, EC_WORD_GUTS, EC_WORD_AND, EC_WORD_SKILL, EC_EMPTY_WORD}, .monSet = gBattleFrontierTrainerMons_Breanna }, [FRONTIER_TRAINER_KENDRA] = { @@ -1005,7 +1005,7 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .trainerName = _("KENDRA"), .speechBefore = {EC_WORD_IF, EC_WORD_YOU_RE, EC_WORD_SMART, EC_WORD_STOP, EC_WORD_RIGHT, EC_WORD_NOW}, .speechWin = {EC_WORD_I, EC_WORD_SAID, EC_WORD_THAT, EC_WORD_YOU, EC_WORD_SHOULD, EC_WORD_STOP}, - .speechLose = {EC_WORD_WHY, EC_WORD_DIDN_T, EC_WORD_YOU, EC_WORD_STOP, EC_WORD_QUES, 0xFFFF}, + .speechLose = {EC_WORD_WHY, EC_WORD_DIDN_T, EC_WORD_YOU, EC_WORD_STOP, EC_WORD_QUES, EC_EMPTY_WORD}, .monSet = gBattleFrontierTrainerMons_Kendra }, [FRONTIER_TRAINER_MOLLY] = { @@ -1013,7 +1013,7 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .trainerName = _("MOLLY"), .speechBefore = {EC_WORD_WILL, EC_WORD_MY, EC_WORD_CUTE_CHARM, EC_MOVE2(ATTRACT), EC_WORD_YOU, EC_WORD_QUES}, .speechWin = {EC_WORD_YOUR, EC_WORD_POKEMON, EC_WORD_ARE, EC_WORD_MY, EC_WORD_TOYS, EC_WORD_NOW}, - .speechLose = {EC_WORD_OH, EC_WORD_HOW, EC_WORD_COULD, EC_WORD_YOU, EC_WORD_QUES, 0xFFFF}, + .speechLose = {EC_WORD_OH, EC_WORD_HOW, EC_WORD_COULD, EC_WORD_YOU, EC_WORD_QUES, EC_EMPTY_WORD}, .monSet = gBattleFrontierTrainerMons_Molly }, [FRONTIER_TRAINER_JAZMIN] = { @@ -1077,7 +1077,7 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .trainerName = _("BALEY"), .speechBefore = {EC_MOVE(SCREECH), EC_WORD_IS, EC_WORD_LIKE, EC_WORD_MUSIC, EC_WORD_TO_ME, EC_WORD_EXCL}, .speechWin = {EC_WORD_MY, EC_MOVE(SCREECH), EC_WORD_STRATEGY, EC_WORD_IS, EC_WORD_THE, EC_WORD_BEST}, - .speechLose = {EC_WORD_YOU_RE, EC_WORD_SOUNDPROOF, EC_WORD_QUES, 0xFFFF, 0xFFFF, 0xFFFF}, + .speechLose = {EC_WORD_YOU_RE, EC_WORD_SOUNDPROOF, EC_WORD_QUES, EC_EMPTY_WORD, EC_EMPTY_WORD, EC_EMPTY_WORD}, .monSet = gBattleFrontierTrainerMons_Baley }, [FRONTIER_TRAINER_ZACKARY] = { @@ -1093,7 +1093,7 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .trainerName = _("GABRIEL"), .speechBefore = {EC_MOVE2(POUND), EC_WORD_THE, EC_WORD_THICK_FAT, EC_WORD_ON, EC_WORD_MY, EC_MOVE2(BELLY_DRUM)}, .speechWin = {EC_MOVE2(POUND), EC_WORD_MY, EC_MOVE2(BELLY_DRUM), EC_MOVE2(POUND), EC_WORD_MY, EC_MOVE2(BELLY_DRUM)}, - .speechLose = {EC_WORD_MY, EC_MOVE2(BELLY_DRUM), EC_WORD_WAS, EC_WORD_TOO_WEAK, EC_WORD_ELLIPSIS, 0xFFFF}, + .speechLose = {EC_WORD_MY, EC_MOVE2(BELLY_DRUM), EC_WORD_WAS, EC_WORD_TOO_WEAK, EC_WORD_ELLIPSIS, EC_EMPTY_WORD}, .monSet = gBattleFrontierTrainerMons_Gabriel }, [FRONTIER_TRAINER_EMILY] = { @@ -1115,17 +1115,17 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU [FRONTIER_TRAINER_SOFIA] = { .facilityClass = FACILITY_CLASS_AROMA_LADY, .trainerName = _("SOFIA"), - .speechBefore = {EC_POKEMON(LOUDRED), EC_WORD_PROBABLY, EC_WORD_HAS, EC_WORD_A, EC_MOVE(SWEET_SCENT), 0xFFFF}, + .speechBefore = {EC_POKEMON(LOUDRED), EC_WORD_PROBABLY, EC_WORD_HAS, EC_WORD_A, EC_MOVE(SWEET_SCENT), EC_EMPTY_WORD}, .speechWin = {EC_WORD_THAT_S, EC_WORD_THE, EC_WORD_FEELING, EC_WORD_THAT, EC_WORD_I, EC_WORD_GET}, - .speechLose = {EC_WORD_I, EC_WORD_WORK, EC_WORD_AT, EC_WORD_THE, EC_WORD_DEPT_STORE, 0xFFFF}, + .speechLose = {EC_WORD_I, EC_WORD_WORK, EC_WORD_AT, EC_WORD_THE, EC_WORD_DEPT_STORE, EC_EMPTY_WORD}, .monSet = gBattleFrontierTrainerMons_Sofia }, [FRONTIER_TRAINER_BRADEN] = { .facilityClass = FACILITY_CLASS_COOLTRAINER_M, .trainerName = _("BRADEN"), - .speechBefore = {EC_WORD_I_CHOOSE_YOU, EC_WORD_EXCL, 0xFFFF, EC_WORD_THIS_IS_IT_EXCL, 0xFFFF, 0xFFFF}, + .speechBefore = {EC_WORD_I_CHOOSE_YOU, EC_WORD_EXCL, EC_EMPTY_WORD, EC_WORD_THIS_IS_IT_EXCL, EC_EMPTY_WORD, EC_EMPTY_WORD}, .speechWin = {EC_WORD_I_AM, EC_WORD_FEELING, EC_WORD_PRETTY, EC_WORD_AWESOME, EC_WORD_ABOUT, EC_WORD_MYSELF}, - .speechLose = {EC_WORD_ALL_RIGHT, EC_WORD_EXCL, 0xFFFF, EC_WORD_I, EC_WORD_SURRENDER, EC_WORD_EXCL}, + .speechLose = {EC_WORD_ALL_RIGHT, EC_WORD_EXCL, EC_EMPTY_WORD, EC_WORD_I, EC_WORD_SURRENDER, EC_WORD_EXCL}, .monSet = gBattleFrontierTrainerMons_Braden }, [FRONTIER_TRAINER_KAYDEN] = { @@ -1133,7 +1133,7 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .trainerName = _("KAYDEN"), .speechBefore = {EC_WORD_THEY, EC_WORD_OVERDO, EC_WORD_THAT, EC_WORD_GOURMET, EC_WORD_THING, EC_WORD_ELLIPSIS}, .speechWin = {EC_WORD_THAT, EC_WORD_GOURMET, EC_WORD_THING, EC_WORD_ISN_T, EC_WORD_FOR, EC_WORD_ME}, - .speechLose = {EC_WORD_HEY, EC_WORD_THIS, EC_WORD_IS, EC_WORD_PRETTY, EC_WORD_TASTY, 0xFFFF}, + .speechLose = {EC_WORD_HEY, EC_WORD_THIS, EC_WORD_IS, EC_WORD_PRETTY, EC_WORD_TASTY, EC_EMPTY_WORD}, .monSet = gBattleFrontierTrainerMons_Kayden }, [FRONTIER_TRAINER_COOPER] = { @@ -1141,7 +1141,7 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .trainerName = _("COOPER"), .speechBefore = {EC_WORD_THIS, EC_WORD_SHOULD, EC_WORD_ABSOLUTELY, EC_WORD_BE, EC_WORD_A, EC_WORD_PUSHOVER}, .speechWin = {EC_WORD_THAT_WAS, EC_WORD_TOO, EC_WORD_EXCITING, EC_WORD_FOR, EC_WORD_ME, EC_WORD_ELLIPSIS}, - .speechLose = {EC_WORD_PLEASE, EC_WORD_EXCL, 0xFFFF, EC_WORD_SORRY, EC_WORD_I_AM, EC_WORD_SORRY}, + .speechLose = {EC_WORD_PLEASE, EC_WORD_EXCL, EC_EMPTY_WORD, EC_WORD_SORRY, EC_WORD_I_AM, EC_WORD_SORRY}, .monSet = gBattleFrontierTrainerMons_Cooper }, [FRONTIER_TRAINER_JULIA] = { @@ -1179,8 +1179,8 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU [FRONTIER_TRAINER_DOMINIC] = { .facilityClass = FACILITY_CLASS_PKMN_RANGER_M, .trainerName = _("DOMINIC"), - .speechBefore = {EC_WORD_I, EC_WORD_HAVE, EC_WORD_THIS, EC_WORD_EXCELLENT, EC_WORD_CAMERA, 0xFFFF}, - .speechWin = {EC_WORD_MY, EC_WORD_CAMERA, EC_WORD_WAS, EC_WORD_AWFULLY, EC_WORD_EXPENSIVE, 0xFFFF}, + .speechBefore = {EC_WORD_I, EC_WORD_HAVE, EC_WORD_THIS, EC_WORD_EXCELLENT, EC_WORD_CAMERA, EC_EMPTY_WORD}, + .speechWin = {EC_WORD_MY, EC_WORD_CAMERA, EC_WORD_WAS, EC_WORD_AWFULLY, EC_WORD_EXPENSIVE, EC_EMPTY_WORD}, .speechLose = {EC_WORD_MY, EC_WORD_CAMERA, EC_WORD_DOESN_T, EC_WORD_MISS, EC_WORD_A, EC_WORD_THING}, .monSet = gBattleFrontierTrainerMons_Dominic }, @@ -1188,8 +1188,8 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .facilityClass = FACILITY_CLASS_PKMN_RANGER_M, .trainerName = _("NIKOLAS"), .speechBefore = {EC_WORD_I, EC_MOVE2(MIMIC), EC_WORD_POKEMON, EC_WORD_AFTER, EC_WORD_EVERY, EC_WORD_BATTLE}, - .speechWin = {EC_WORD_IF_I_WIN, EC_WORD_I, EC_WORD_PRETEND, EC_WORD_I_AM, EC_WORD_A, EC_POKEMON2(TAUROS)}, - .speechLose = {EC_WORD_IF_I_LOSE, EC_WORD_I, EC_WORD_PRETEND, EC_WORD_I_AM, EC_WORD_A, EC_POKEMON2(MILTANK)}, + .speechWin = {EC_WORD_IF_I_WIN, EC_WORD_I, EC_WORD_PRETEND, EC_WORD_I_AM, EC_WORD_A, EC_POKEMON_NATIONAL(TAUROS)}, + .speechLose = {EC_WORD_IF_I_LOSE, EC_WORD_I, EC_WORD_PRETEND, EC_WORD_I_AM, EC_WORD_A, EC_POKEMON_NATIONAL(MILTANK)}, .monSet = gBattleFrontierTrainerMons_Nikolas }, [FRONTIER_TRAINER_VALERIA] = { @@ -1212,16 +1212,16 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .facilityClass = FACILITY_CLASS_PKMN_RANGER_F, .trainerName = _("MEGHAN"), .speechBefore = {EC_WORD_SCHOOL, EC_WORD_IS, EC_WORD_OUT, EC_WORD_TIME, EC_WORD_TO, EC_WORD_PLAY}, - .speechWin = {EC_WORD_MY, EC_WORD_BOY, EC_WORD_FRIEND, EC_WORD_LIKES, EC_WORD_COMICS, 0xFFFF}, - .speechLose = {EC_WORD_IT_S, EC_WORD_BACK, EC_WORD_TO, EC_WORD_SCHOOL, EC_WORD_SOON, 0xFFFF}, + .speechWin = {EC_WORD_MY, EC_WORD_BOY, EC_WORD_FRIEND, EC_WORD_LIKES, EC_WORD_COMICS, EC_EMPTY_WORD}, + .speechLose = {EC_WORD_IT_S, EC_WORD_BACK, EC_WORD_TO, EC_WORD_SCHOOL, EC_WORD_SOON, EC_EMPTY_WORD}, .monSet = gBattleFrontierTrainerMons_Meghan }, [FRONTIER_TRAINER_ROBERTO] = { .facilityClass = FACILITY_CLASS_DRAGON_TAMER, .trainerName = _("ROBERTO"), - .speechBefore = {EC_WORD_DRAGON, EC_WORD_POKEMON, EC_WORD_ARE, EC_WORD_INVINCIBLE, EC_WORD_EXCL, 0xFFFF}, + .speechBefore = {EC_WORD_DRAGON, EC_WORD_POKEMON, EC_WORD_ARE, EC_WORD_INVINCIBLE, EC_WORD_EXCL, EC_EMPTY_WORD}, .speechWin = {EC_WORD_YOU, EC_WORD_WEREN_T, EC_WORD_BAD, EC_WORD_I_WAS, EC_WORD_JUST, EC_WORD_BETTER}, - .speechLose = {EC_WORD_AREN_T, EC_WORD_YOU, EC_WORD_SATISFIED, EC_WORD_YET, EC_WORD_QUES, 0xFFFF}, + .speechLose = {EC_WORD_AREN_T, EC_WORD_YOU, EC_WORD_SATISFIED, EC_WORD_YET, EC_WORD_QUES, EC_EMPTY_WORD}, .monSet = gBattleFrontierTrainerMons_Roberto }, [FRONTIER_TRAINER_DAMIAN] = { @@ -1229,7 +1229,7 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .trainerName = _("DAMIAN"), .speechBefore = {EC_WORD_MY, EC_WORD_PURE_POWER, EC_WORD_IS, EC_WORD_MACHINE, EC_WORD_LIKE, EC_WORD_EXCL}, .speechWin = {EC_WORD_MY, EC_MOVE2(MACH_PUNCH), EC_WORD_WILL, EC_WORD_MAKE, EC_WORD_A, EC_MOVE(BRICK_BREAK)}, - .speechLose = {EC_WORD_ARRGH, EC_WORD_EXCL, 0xFFFF, EC_WORD_NO, EC_WORD_EXCL_EXCL, 0xFFFF}, + .speechLose = {EC_WORD_ARRGH, EC_WORD_EXCL, EC_EMPTY_WORD, EC_WORD_NO, EC_WORD_EXCL_EXCL, EC_EMPTY_WORD}, .monSet = gBattleFrontierTrainerMons_Damian }, [FRONTIER_TRAINER_BRODY] = { @@ -1243,7 +1243,7 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU [FRONTIER_TRAINER_GRAHAM] = { .facilityClass = FACILITY_CLASS_DRAGON_TAMER, .trainerName = _("GRAHAM"), - .speechBefore = {EC_WORD_YEAH, EC_WORD_EXCL, 0xFFFF, EC_WORD_YEAH_YEAH, EC_WORD_EXCL_EXCL, 0xFFFF}, + .speechBefore = {EC_WORD_YEAH, EC_WORD_EXCL, EC_EMPTY_WORD, EC_WORD_YEAH_YEAH, EC_WORD_EXCL_EXCL, EC_EMPTY_WORD}, .speechWin = {EC_WORD_WAHAHAHA, EC_WORD_WAHAHAHA, EC_WORD_EXCL, EC_WORD_WAHAHAHA, EC_WORD_WAHAHAHA, EC_WORD_EXCL_EXCL}, .speechLose = {EC_WORD_I_AM, EC_WORD_SORRY, EC_WORD_ELLIPSIS, EC_WORD_IT_S, EC_WORD_MY, EC_WORD_BAD}, .monSet = gBattleFrontierTrainerMons_Graham @@ -1252,23 +1252,23 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .facilityClass = FACILITY_CLASS_POKEFAN_M, .trainerName = _("TYLOR"), .speechBefore = {EC_WORD_ARE, EC_WORD_YOU, EC_WORD_FEELING, EC_WORD_MY, EC_MOVE2(HEAT_WAVE), EC_WORD_QUES}, - .speechWin = {EC_WORD_YES, EC_WORD_I_AM, EC_WORD_ON, EC_WORD_FIRE, EC_WORD_EXCL, 0xFFFF}, + .speechWin = {EC_WORD_YES, EC_WORD_I_AM, EC_WORD_ON, EC_WORD_FIRE, EC_WORD_EXCL, EC_EMPTY_WORD}, .speechLose = {EC_WORD_BUT, EC_WORD_I_WAS, EC_WORD_ON, EC_WORD_FIRE, EC_WORD_FOR, EC_WORD_YOU}, .monSet = gBattleFrontierTrainerMons_Tylor }, [FRONTIER_TRAINER_JAREN] = { .facilityClass = FACILITY_CLASS_POKEFAN_F, .trainerName = _("JAREN"), - .speechBefore = {EC_WORD_FIGHTING, EC_WORD_SPIRIT, EC_WORD_QUES, EC_WORD_ME, EC_WORD_QUES, 0xFFFF}, - .speechWin = {EC_WORD_I, EC_WORD_WANT, EC_WORD_MORE, EC_WORD_CUTE, EC_WORD_POKEMON, 0xFFFF}, - .speechLose = {EC_WORD_YOUR, EC_WORD_POKEMON, EC_WORD_LOOK, EC_WORD_QUITE, EC_WORD_CUTE, 0xFFFF}, + .speechBefore = {EC_WORD_FIGHTING, EC_WORD_SPIRIT, EC_WORD_QUES, EC_WORD_ME, EC_WORD_QUES, EC_EMPTY_WORD}, + .speechWin = {EC_WORD_I, EC_WORD_WANT, EC_WORD_MORE, EC_WORD_CUTE, EC_WORD_POKEMON, EC_EMPTY_WORD}, + .speechLose = {EC_WORD_YOUR, EC_WORD_POKEMON, EC_WORD_LOOK, EC_WORD_QUITE, EC_WORD_CUTE, EC_EMPTY_WORD}, .monSet = gBattleFrontierTrainerMons_Jaren }, [FRONTIER_TRAINER_CORDELL] = { .facilityClass = FACILITY_CLASS_PKMN_BREEDER_M, .trainerName = _("CORDELL"), .speechBefore = {EC_WORD_A, EC_WORD_BATTLE, EC_WORD_IS, EC_WORD_DECIDED, EC_WORD_ON, EC_WORD_SPIRIT}, - .speechWin = {EC_WORD_CAN_T, EC_WORD_YOU, EC_WORD_ACCEPT, EC_WORD_THAT, EC_WORD_QUES, 0xFFFF}, + .speechWin = {EC_WORD_CAN_T, EC_WORD_YOU, EC_WORD_ACCEPT, EC_WORD_THAT, EC_WORD_QUES, EC_EMPTY_WORD}, .speechLose = {EC_WORD_I, EC_WORD_WILL, EC_WORD_BE, EC_WORD_ON, EC_WORD_MY, EC_WORD_WAY}, .monSet = gBattleFrontierTrainerMons_Cordell }, @@ -1291,7 +1291,7 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU [FRONTIER_TRAINER_JOHAN] = { .facilityClass = FACILITY_CLASS_YOUNGSTER, .trainerName = _("JOHAN"), - .speechBefore = {EC_WORD_WINTER, EC_WORD_WILL, EC_WORD_SOON, EC_WORD_BE, EC_WORD_HERE, 0xFFFF}, + .speechBefore = {EC_WORD_WINTER, EC_WORD_WILL, EC_WORD_SOON, EC_WORD_BE, EC_WORD_HERE, EC_EMPTY_WORD}, .speechWin = {EC_WORD_MY, EC_WORD_ALLOWANCE, EC_WORD_COULD, EC_WORD_USE, EC_WORD_A, EC_MOVE2(HELPING_HAND)}, .speechLose = {EC_WORD_I, EC_WORD_ALWAYS, EC_WORD_USE, EC_WORD_MY, EC_WORD_ALLOWANCE, EC_WORD_UP}, .monSet = gBattleFrontierTrainerMons_Johan @@ -1315,7 +1315,7 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU [FRONTIER_TRAINER_ISIAH] = { .facilityClass = FACILITY_CLASS_SCHOOL_KID_M, .trainerName = _("ISIAH"), - .speechBefore = {EC_WORD_I, EC_WORD_PRETEND, EC_WORD_TO, EC_WORD_STUDY, EC_WORD_A_LOT, 0xFFFF}, + .speechBefore = {EC_WORD_I, EC_WORD_PRETEND, EC_WORD_TO, EC_WORD_STUDY, EC_WORD_A_LOT, EC_EMPTY_WORD}, .speechWin = {EC_WORD_I, EC_MOVE2(TRICK), EC_WORD_MOTHER, EC_WORD_FOR, EC_WORD_MY, EC_WORD_ALLOWANCE}, .speechLose = {EC_WORD_I, EC_WORD_DON_T, EC_WORD_WANT, EC_WORD_TO, EC_WORD_STUDY, EC_WORD_MORE}, .monSet = gBattleFrontierTrainerMons_Isiah @@ -1340,14 +1340,14 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .facilityClass = FACILITY_CLASS_SCHOOL_KID_F, .trainerName = _("MEGAN"), .speechBefore = {EC_WORD_I, EC_WORD_BELIEVE, EC_WORD_IN, EC_WORD_AN, EC_MOVE(AROMATHERAPY), EC_WORD_BATH}, - .speechWin = {EC_WORD_I, EC_WORD_WANT, EC_WORD_A, EC_WORD_HEALTHY, EC_WORD_CLEAR_BODY, 0xFFFF}, + .speechWin = {EC_WORD_I, EC_WORD_WANT, EC_WORD_A, EC_WORD_HEALTHY, EC_WORD_CLEAR_BODY, EC_EMPTY_WORD}, .speechLose = {EC_WORD_IF, EC_WORD_ONLY, EC_MOVE(AROMATHERAPY), EC_WORD_WERE, EC_WORD_LESS, EC_WORD_EXPENSIVE}, .monSet = gBattleFrontierTrainerMons_Megan }, [FRONTIER_TRAINER_ISSAC] = { .facilityClass = FACILITY_CLASS_RICH_BOY, .trainerName = _("ISSAC"), - .speechBefore = {EC_WORD_MY, EC_WORD_HOBBY, EC_WORD_QUES, 0xFFFF, 0xFFFF, 0xFFFF}, + .speechBefore = {EC_WORD_MY, EC_WORD_HOBBY, EC_WORD_QUES, EC_EMPTY_WORD, EC_EMPTY_WORD, EC_EMPTY_WORD}, .speechWin = {EC_WORD_I, EC_WORD_LIKE, EC_WORD_ANY, EC_WORD_KIND, EC_WORD_OF, EC_MOVE2(WATER_SPORT)}, .speechLose = {EC_WORD_I, EC_WORD_DISLIKE, EC_WORD_ANY, EC_WORD_KIND, EC_WORD_OF, EC_MOVE2(MUD_SPORT)}, .monSet = gBattleFrontierTrainerMons_Issac @@ -1355,8 +1355,8 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU [FRONTIER_TRAINER_QUINTON] = { .facilityClass = FACILITY_CLASS_RICH_BOY, .trainerName = _("QUINTON"), - .speechBefore = {EC_WORD_I_AM, EC_WORD_SAD, EC_WORD_CAUSE, EC_WORD_I_AM, EC_WORD_TOO_WEAK, 0xFFFF}, - .speechWin = {EC_WORD_YOU, EC_WORD_AREN_T, EC_WORD_TOO_STRONG, EC_WORD_FOR, EC_WORD_ME, 0xFFFF}, + .speechBefore = {EC_WORD_I_AM, EC_WORD_SAD, EC_WORD_CAUSE, EC_WORD_I_AM, EC_WORD_TOO_WEAK, EC_EMPTY_WORD}, + .speechWin = {EC_WORD_YOU, EC_WORD_AREN_T, EC_WORD_TOO_STRONG, EC_WORD_FOR, EC_WORD_ME, EC_EMPTY_WORD}, .speechLose = {EC_WORD_HEY, EC_WORD_WHAT, EC_WORD_DID, EC_WORD_I, EC_WORD_DO, EC_WORD_QUES}, .monSet = gBattleFrontierTrainerMons_Quinton }, @@ -1372,7 +1372,7 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .facilityClass = FACILITY_CLASS_LADY, .trainerName = _("ANSLEY"), .speechBefore = {EC_WORD_I_AM, EC_WORD_BORED, EC_WORD_ELLIPSIS, EC_WORD_DANCE, EC_WORD_FOR, EC_WORD_ME}, - .speechWin = {EC_WORD_YOU_VE, EC_WORD_BORED, EC_WORD_ME, EC_WORD_SOME, EC_WORD_MORE, 0xFFFF}, + .speechWin = {EC_WORD_YOU_VE, EC_WORD_BORED, EC_WORD_ME, EC_WORD_SOME, EC_WORD_MORE, EC_EMPTY_WORD}, .speechLose = {EC_WORD_TAKE, EC_WORD_YOUR, EC_MOVE2(FRUSTRATION), EC_WORD_SOME, EC_WORD_OTHER, EC_WORD_PLACE}, .monSet = gBattleFrontierTrainerMons_Ansley }, @@ -1380,8 +1380,8 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .facilityClass = FACILITY_CLASS_BUG_CATCHER, .trainerName = _("HOLDEN"), .speechBefore = {EC_WORD_LET_S, EC_WORD_COMMEMORATE, EC_WORD_MY, EC_WORD_COOLNESS, EC_WORD_IN, EC_WORD_BATTLE}, - .speechWin = {EC_WORD_YOU_RE, EC_WORD_TOO_WEAK, EC_WORD_FOR, EC_WORD_ANY, EC_WORD_PRAISE, 0xFFFF}, - .speechLose = {EC_WORD_YOUR, EC_WORD_BATTLE, EC_WORD_SENSE, EC_WORD_IS, EC_WORD_AMUSING, 0xFFFF}, + .speechWin = {EC_WORD_YOU_RE, EC_WORD_TOO_WEAK, EC_WORD_FOR, EC_WORD_ANY, EC_WORD_PRAISE, EC_EMPTY_WORD}, + .speechLose = {EC_WORD_YOUR, EC_WORD_BATTLE, EC_WORD_SENSE, EC_WORD_IS, EC_WORD_AMUSING, EC_EMPTY_WORD}, .monSet = gBattleFrontierTrainerMons_Holden }, [FRONTIER_TRAINER_LUCA] = { @@ -1396,14 +1396,14 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .facilityClass = FACILITY_CLASS_NINJA_BOY, .trainerName = _("JAMISON"), .speechBefore = {EC_WORD_MY, EC_MOVE2(SECRET_POWER), EC_WORD_IS, EC_WORD_OVERWHELMING, EC_WORD_TO, EC_WORD_POKEMON}, - .speechWin = {EC_WORD_DID, EC_WORD_YOU, EC_WORD_SEE, EC_WORD_THAT, EC_WORD_QUES, 0xFFFF}, + .speechWin = {EC_WORD_DID, EC_WORD_YOU, EC_WORD_SEE, EC_WORD_THAT, EC_WORD_QUES, EC_EMPTY_WORD}, .speechLose = {EC_WORD_I, EC_WORD_WILL, EC_WORD_USE, EC_MOVE(SMOKESCREEN), EC_WORD_TO, EC_WORD_ESCAPE}, .monSet = gBattleFrontierTrainerMons_Jamison }, [FRONTIER_TRAINER_GUNNAR] = { .facilityClass = FACILITY_CLASS_NINJA_BOY, .trainerName = _("GUNNAR"), - .speechBefore = {EC_WORD_I, EC_MOVE(CUT), EC_WORD_DOWN, EC_WORD_EVERY, EC_WORD_OPPONENT, 0xFFFF}, + .speechBefore = {EC_WORD_I, EC_MOVE(CUT), EC_WORD_DOWN, EC_WORD_EVERY, EC_WORD_OPPONENT, EC_EMPTY_WORD}, .speechWin = {EC_WORD_DON_T, EC_MOVE(GRUDGE), EC_WORD_ME, EC_WORD_FOR, EC_WORD_YOUR, EC_WORD_LOSS}, .speechLose = {EC_WORD_PLEASE, EC_WORD_LOSE, EC_WORD_THAT, EC_MOVE(SCARY_FACE), EC_WORD_OF, EC_WORD_YOURS}, .monSet = gBattleFrontierTrainerMons_Gunnar @@ -1413,22 +1413,22 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .trainerName = _("CRAIG"), .speechBefore = {EC_WORD_I, EC_WORD_CAN_T, EC_WORD_WAIT, EC_WORD_FOR, EC_WORD_MY, EC_WORD_TRAIN}, .speechWin = {EC_WORD_MY, EC_WORD_TRAIN, EC_WORD_ISN_T, EC_WORD_HERE, EC_WORD_YET, EC_WORD_ELLIPSIS}, - .speechLose = {EC_WORD_HERE_IT_IS, EC_WORD_MY, EC_WORD_TRAIN, EC_WORD_SEE_YA, EC_WORD_EXCL, 0xFFFF}, + .speechLose = {EC_WORD_HERE_IT_IS, EC_WORD_MY, EC_WORD_TRAIN, EC_WORD_SEE_YA, EC_WORD_EXCL, EC_EMPTY_WORD}, .monSet = gBattleFrontierTrainerMons_Craig }, [FRONTIER_TRAINER_PIERCE] = { .facilityClass = FACILITY_CLASS_TUBER_M, .trainerName = _("PIERCE"), .speechBefore = {EC_WORD_THERE, EC_WORD_WAS, EC_WORD_A, EC_MOVE2(HEAT_WAVE), EC_WORD_LAST, EC_WORD_WEEK}, - .speechWin = {EC_WORD_I, EC_WORD_CAN_T, EC_WORD_TAKE, EC_WORD_A, EC_MOVE2(HEAT_WAVE), 0xFFFF}, - .speechLose = {EC_WORD_DIDN_T, EC_WORD_IT, EC_MOVE(HAIL), EC_WORD_TOO, EC_WORD_QUES, 0xFFFF}, + .speechWin = {EC_WORD_I, EC_WORD_CAN_T, EC_WORD_TAKE, EC_WORD_A, EC_MOVE2(HEAT_WAVE), EC_EMPTY_WORD}, + .speechLose = {EC_WORD_DIDN_T, EC_WORD_IT, EC_MOVE(HAIL), EC_WORD_TOO, EC_WORD_QUES, EC_EMPTY_WORD}, .monSet = gBattleFrontierTrainerMons_Pierce }, [FRONTIER_TRAINER_REGINA] = { .facilityClass = FACILITY_CLASS_TUBER_F, .trainerName = _("REGINA"), .speechBefore = {EC_WORD_I, EC_WORD_LIKE, EC_WORD_TO, EC_WORD_PLAY, EC_WORD_IN, EC_WORD_WATER}, - .speechWin = {EC_WORD_I, EC_WORD_REFUSE, EC_WORD_TO, EC_WORD_COME, EC_WORD_OUT, 0xFFFF}, + .speechWin = {EC_WORD_I, EC_WORD_REFUSE, EC_WORD_TO, EC_WORD_COME, EC_WORD_OUT, EC_EMPTY_WORD}, .speechLose = {EC_WORD_YOU_RE, EC_WORD_NOT, EC_WORD_MUCH, EC_WORD_GOOD, EC_WORD_IN, EC_WORD_WATER}, .monSet = gBattleFrontierTrainerMons_Regina }, @@ -1469,7 +1469,7 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .trainerName = _("HUNTER"), .speechBefore = {EC_WORD_SHOW, EC_WORD_ME, EC_WORD_A, EC_WORD_TOTALLY, EC_WORD_COOL, EC_MOVE(CROSS_CHOP)}, .speechWin = {EC_WORD_YOU_RE, EC_WORD_TOO_WEAK, EC_WORD_TO, EC_WORD_DO, EC_WORD_A, EC_MOVE(CROSS_CHOP)}, - .speechLose = {EC_WORD_WAS, EC_WORD_IT, EC_WORD_A, EC_WORD_MISTAKE, EC_WORD_QUES, 0xFFFF}, + .speechLose = {EC_WORD_WAS, EC_WORD_IT, EC_WORD_A, EC_WORD_MISTAKE, EC_WORD_QUES, EC_EMPTY_WORD}, .monSet = gBattleFrontierTrainerMons_Hunter }, [FRONTIER_TRAINER_AIDEN] = { @@ -1483,9 +1483,9 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU [FRONTIER_TRAINER_XAVIER] = { .facilityClass = FACILITY_CLASS_RUIN_MANIAC, .trainerName = _("XAVIER"), - .speechBefore = {EC_WORD_HEY_THERE, EC_WORD_EXCL, 0xFFFF, EC_WORD_LOOK, EC_WORD_LOOK, EC_WORD_EXCL_EXCL}, - .speechWin = {EC_WORD_GOOD_BYE, EC_WORD_AND, EC_WORD_THANK_YOU, EC_WORD_THAT_WAS, EC_WORD_FUNNY, 0xFFFF}, - .speechLose = {EC_WORD_WOWEE, EC_WORD_EXCL, 0xFFFF, EC_WORD_NO, EC_WORD_NO, EC_WORD_EXCL_EXCL}, + .speechBefore = {EC_WORD_HEY_THERE, EC_WORD_EXCL, EC_EMPTY_WORD, EC_WORD_LOOK, EC_WORD_LOOK, EC_WORD_EXCL_EXCL}, + .speechWin = {EC_WORD_GOOD_BYE, EC_WORD_AND, EC_WORD_THANK_YOU, EC_WORD_THAT_WAS, EC_WORD_FUNNY, EC_EMPTY_WORD}, + .speechLose = {EC_WORD_WOWEE, EC_WORD_EXCL, EC_EMPTY_WORD, EC_WORD_NO, EC_WORD_NO, EC_WORD_EXCL_EXCL}, .monSet = gBattleFrontierTrainerMons_Xavier }, [FRONTIER_TRAINER_CLINTON] = { @@ -1493,7 +1493,7 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .trainerName = _("CLINTON"), .speechBefore = {EC_WORD_WANT, EC_WORD_TO, EC_WORD_SEE, EC_WORD_MY, EC_MOVE(HYPNOSIS), EC_WORD_QUES}, .speechWin = {EC_WORD_YOUR, EC_MOVE2(FURY_SWIPES), EC_WORD_YOUR, EC_MOVE(STRENGTH), EC_WORD_YOUNG, EC_WORD_TRAINER}, - .speechLose = {EC_WORD_TCH, EC_WORD_ELLIPSIS, 0xFFFF, EC_WORD_I_AM, EC_WORD_TOO_WEAK, EC_WORD_ELLIPSIS}, + .speechLose = {EC_WORD_TCH, EC_WORD_ELLIPSIS, EC_EMPTY_WORD, EC_WORD_I_AM, EC_WORD_TOO_WEAK, EC_WORD_ELLIPSIS}, .monSet = gBattleFrontierTrainerMons_Clinton }, [FRONTIER_TRAINER_JESSE] = { @@ -1501,7 +1501,7 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .trainerName = _("JESSE"), .speechBefore = {EC_WORD_THIS, EC_WORD_BATTLE, EC_WORD_IS, EC_WORD_FOR, EC_WORD_MY, EC_WORD_MOTHER}, .speechWin = {EC_WORD_MOTHER, EC_WORD_WILL, EC_WORD_BE, EC_WORD_HAPPY, EC_WORD_FOR, EC_WORD_ME}, - .speechLose = {EC_WORD_I, EC_WORD_WANT, EC_WORD_MY, EC_WORD_MOTHER, EC_WORD_EXCL, 0xFFFF}, + .speechLose = {EC_WORD_I, EC_WORD_WANT, EC_WORD_MY, EC_WORD_MOTHER, EC_WORD_EXCL, EC_EMPTY_WORD}, .monSet = gBattleFrontierTrainerMons_Jesse }, [FRONTIER_TRAINER_EDUARDO] = { @@ -1515,7 +1515,7 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU [FRONTIER_TRAINER_HAL] = { .facilityClass = FACILITY_CLASS_GUITARIST, .trainerName = _("HAL"), - .speechBefore = {EC_WORD_I_AM, EC_WORD_TRENDY, EC_WORD_AREN_T, EC_WORD_I, EC_WORD_QUES, 0xFFFF}, + .speechBefore = {EC_WORD_I_AM, EC_WORD_TRENDY, EC_WORD_AREN_T, EC_WORD_I, EC_WORD_QUES, EC_EMPTY_WORD}, .speechWin = {EC_WORD_I_AM, EC_WORD_FEELING, EC_WORD_HIP_AND, EC_WORD_HAPPENING, EC_WORD_OH_YEAH, EC_WORD_EXCL}, .speechLose = {EC_WORD_I_AM, EC_WORD_ALWAYS, EC_WORD_TRENDY, EC_WORD_THANK_YOU, EC_WORD_VERY, EC_WORD_MUCH}, .monSet = gBattleFrontierTrainerMons_Hal @@ -1525,7 +1525,7 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .trainerName = _("GAGE"), .speechBefore = {EC_WORD_HERE_IT_IS, EC_WORD_A, EC_WORD_FLYING, EC_WORD_TYPE, EC_WORD_HIDDEN, EC_WORD_MOVE}, .speechWin = {EC_WORD_IT_S, EC_WORD_A, EC_WORD_FLYING, EC_WORD_TYPE, EC_WORD_VICTORY, EC_WORD_EXCL}, - .speechLose = {EC_WORD_IF_I_LOSE, EC_WORD_I, EC_WORD_JUST, EC_MOVE(FLY), EC_WORD_AWAY, 0xFFFF}, + .speechLose = {EC_WORD_IF_I_LOSE, EC_WORD_I, EC_WORD_JUST, EC_MOVE(FLY), EC_WORD_AWAY, EC_EMPTY_WORD}, .monSet = gBattleFrontierTrainerMons_Gage }, [FRONTIER_TRAINER_ARNOLD] = { @@ -1563,8 +1563,8 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU [FRONTIER_TRAINER_GUSTAVO] = { .facilityClass = FACILITY_CLASS_HIKER, .trainerName = _("GUSTAVO"), - .speechBefore = {EC_MOVE(CHARGE), EC_WORD_EXCL, 0xFFFF, EC_MOVE(CHARGE), EC_WORD_EXCL_EXCL, 0xFFFF}, - .speechWin = {EC_WORD_SURRENDER, EC_WORD_QUES, 0xFFFF, EC_WORD_SO, EC_WORD_SOON, EC_WORD_QUES}, + .speechBefore = {EC_MOVE(CHARGE), EC_WORD_EXCL, EC_EMPTY_WORD, EC_MOVE(CHARGE), EC_WORD_EXCL_EXCL, EC_EMPTY_WORD}, + .speechWin = {EC_WORD_SURRENDER, EC_WORD_QUES, EC_EMPTY_WORD, EC_WORD_SO, EC_WORD_SOON, EC_WORD_QUES}, .speechLose = {EC_WORD_YOU, EC_WORD_CAN_T, EC_WORD_MAKE, EC_WORD_ME, EC_WORD_SURRENDER, EC_WORD_YET}, .monSet = gBattleFrontierTrainerMons_Gustavo }, @@ -1581,7 +1581,7 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .trainerName = _("ALFREDO"), .speechBefore = {EC_WORD_A, EC_WORD_FIERY, EC_WORD_GOURMET, EC_WORD_AM, EC_WORD_I, EC_WORD_EXCL}, .speechWin = {EC_WORD_IT_S, EC_WORD_A, EC_WORD_TASTY, EC_WORD_GOURMET, EC_WORD_VICTORY, EC_WORD_EXCL}, - .speechLose = {EC_WORD_WHAT, EC_WORD_A, EC_WORD_DISASTER, EC_WORD_THAT_WAS, EC_WORD_EXCL, 0xFFFF}, + .speechLose = {EC_WORD_WHAT, EC_WORD_A, EC_WORD_DISASTER, EC_WORD_THAT_WAS, EC_WORD_EXCL, EC_EMPTY_WORD}, .monSet = gBattleFrontierTrainerMons_Alfredo }, [FRONTIER_TRAINER_RUBEN] = { @@ -1589,15 +1589,15 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .trainerName = _("RUBEN"), .speechBefore = {EC_WORD_I, EC_WORD_CAN_T, EC_WORD_WAIT, EC_WORD_TO, EC_WORD_GET, EC_WORD_GOING}, .speechWin = {EC_WORD_GET, EC_WORD_GOING, EC_WORD_EXCL, EC_WORD_THIS, EC_WORD_IS, EC_WORD_GOOD_BYE}, - .speechLose = {EC_WORD_I_VE, EC_WORD_GOT, EC_WORD_TO, EC_WORD_GET, EC_WORD_GOING, 0xFFFF}, + .speechLose = {EC_WORD_I_VE, EC_WORD_GOT, EC_WORD_TO, EC_WORD_GET, EC_WORD_GOING, EC_EMPTY_WORD}, .monSet = gBattleFrontierTrainerMons_Ruben }, [FRONTIER_TRAINER_LAMAR] = { .facilityClass = FACILITY_CLASS_GENTLEMAN, .trainerName = _("LAMAR"), - .speechBefore = {EC_WORD_A, EC_MOVE2(PRESENT), EC_WORD_FOR, EC_WORD_ME, EC_WORD_QUES, 0xFFFF}, + .speechBefore = {EC_WORD_A, EC_MOVE2(PRESENT), EC_WORD_FOR, EC_WORD_ME, EC_WORD_QUES, EC_EMPTY_WORD}, .speechWin = {EC_WORD_MMM, EC_WORD_THIS, EC_WORD_IS, EC_WORD_QUITE, EC_WORD_TASTY, EC_WORD_ELLIPSIS}, - .speechLose = {EC_WORD_OH, EC_WORD_IT_S, EC_WORD_A, EC_WORD_GAME, EC_WORD_IS_IT_QUES, 0xFFFF}, + .speechLose = {EC_WORD_OH, EC_WORD_IT_S, EC_WORD_A, EC_WORD_GAME, EC_WORD_IS_IT_QUES, EC_EMPTY_WORD}, .monSet = gBattleFrontierTrainerMons_Lamar }, [FRONTIER_TRAINER_JAXON] = { @@ -1645,14 +1645,14 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .trainerName = _("SKYLER"), .speechBefore = {EC_MOVE2(INGRAIN), EC_WORD_IS, EC_WORD_MY, EC_WORD_CHOICE, EC_WORD_BATTLE, EC_WORD_MOVE}, .speechWin = {EC_WORD_YOU, EC_WORD_CAN_T, EC_WORD_MOVE, EC_WORD_ME, EC_WORD_NOW, EC_WORD_EXCL}, - .speechLose = {EC_WORD_YOU, EC_MOVE(CUT), EC_WORD_ME, EC_WORD_DOWN, EC_WORD_ELLIPSIS, 0xFFFF}, + .speechLose = {EC_WORD_YOU, EC_MOVE(CUT), EC_WORD_ME, EC_WORD_DOWN, EC_WORD_ELLIPSIS, EC_EMPTY_WORD}, .monSet = gBattleFrontierTrainerMons_Skyler }, [FRONTIER_TRAINER_RUTH] = { .facilityClass = FACILITY_CLASS_PICNICKER, .trainerName = _("RUTH"), .speechBefore = {EC_WORD_I, EC_WORD_WANT, EC_WORD_TO, EC_WORD_ENJOY, EC_WORD_THIS, EC_WORD_BATTLE}, - .speechWin = {EC_WORD_THAT_WAS, EC_WORD_MUCH, EC_WORD_TOO, EC_WORD_EASY, EC_WORD_EXCL, 0xFFFF}, + .speechWin = {EC_WORD_THAT_WAS, EC_WORD_MUCH, EC_WORD_TOO, EC_WORD_EASY, EC_WORD_EXCL, EC_EMPTY_WORD}, .speechLose = {EC_WORD_PLEASE, EC_WORD_STOP, EC_WORD_I, EC_WORD_DON_T, EC_WORD_ENJOY, EC_WORD_THIS}, .monSet = gBattleFrontierTrainerMons_Ruth }, @@ -1669,7 +1669,7 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .trainerName = _("PEDRO"), .speechBefore = {EC_WORD_A, EC_WORD_SWIFT_SWIM, EC_WORD_WILL, EC_WORD_DO, EC_WORD_YOU, EC_WORD_GOOD}, .speechWin = {EC_WORD_THAT_S, EC_WORD_HOW, EC_WORD_I, EC_WORD_SINK, EC_WORD_AN, EC_WORD_OPPONENT}, - .speechLose = {EC_WORD_UH_OH, EC_WORD_EXCL, 0xFFFF, EC_WORD_A, EC_MOVE(WHIRLPOOL), EC_WORD_EXCL}, + .speechLose = {EC_WORD_UH_OH, EC_WORD_EXCL, EC_EMPTY_WORD, EC_WORD_A, EC_MOVE(WHIRLPOOL), EC_WORD_EXCL}, .monSet = gBattleFrontierTrainerMons_Pedro }, [FRONTIER_TRAINER_ERICK] = { @@ -1693,7 +1693,7 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .trainerName = _("JOYCE"), .speechBefore = {EC_WORD_YOU, EC_WORD_MAKE, EC_WORD_ME, EC_WORD_GO, EC_WORD_AHAHA, EC_WORD_EXCL}, .speechWin = {EC_WORD_LALALA, EC_WORD_NO, EC_WORD_LOSING, EC_WORD_FOR, EC_WORD_ME, EC_WORD_EXCL}, - .speechLose = {EC_WORD_LALALA, EC_WORD_ELLIPSIS, 0xFFFF, EC_WORD_HUH_QUES, 0xFFFF, 0xFFFF}, + .speechLose = {EC_WORD_LALALA, EC_WORD_ELLIPSIS, EC_EMPTY_WORD, EC_WORD_HUH_QUES, EC_EMPTY_WORD, EC_EMPTY_WORD}, .monSet = gBattleFrontierTrainerMons_Joyce }, [FRONTIER_TRAINER_TODD] = { @@ -1707,8 +1707,8 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU [FRONTIER_TRAINER_GAVIN] = { .facilityClass = FACILITY_CLASS_POKEFAN_M, .trainerName = _("GAVIN"), - .speechBefore = {EC_WORD_I, EC_WORD_WILL, EC_MOVE(BIDE), EC_WORD_MY, EC_WORD_TIME, 0xFFFF}, - .speechWin = {EC_WORD_IT_S, EC_WORD_OVER, EC_WORD_SO, EC_WORD_SOON, EC_WORD_QUES, 0xFFFF}, + .speechBefore = {EC_WORD_I, EC_WORD_WILL, EC_MOVE(BIDE), EC_WORD_MY, EC_WORD_TIME, EC_EMPTY_WORD}, + .speechWin = {EC_WORD_IT_S, EC_WORD_OVER, EC_WORD_SO, EC_WORD_SOON, EC_WORD_QUES, EC_EMPTY_WORD}, .speechLose = {EC_WORD_MY, EC_WORD_MISTAKE, EC_WORD_WAS, EC_WORD_TOO, EC_WORD_EXPENSIVE, EC_WORD_ELLIPSIS}, .monSet = gBattleFrontierTrainerMons_Gavin }, @@ -1716,7 +1716,7 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .facilityClass = FACILITY_CLASS_POKEFAN_F, .trainerName = _("MALORY"), .speechBefore = {EC_WORD_PROMISE, EC_WORD_TO, EC_WORD_SHOW, EC_WORD_ME, EC_WORD_CUTE, EC_WORD_POKEMON}, - .speechWin = {EC_WORD_GIGGLE, EC_WORD_ELLIPSIS, 0xFFFF, EC_WORD_THANK_YOU, EC_WORD_SO, EC_WORD_MUCH}, + .speechWin = {EC_WORD_GIGGLE, EC_WORD_ELLIPSIS, EC_EMPTY_WORD, EC_WORD_THANK_YOU, EC_WORD_SO, EC_WORD_MUCH}, .speechLose = {EC_WORD_TCH, EC_WORD_YOUR, EC_WORD_POKEMON, EC_WORD_AREN_T, EC_WORD_VERY, EC_WORD_NICE}, .monSet = gBattleFrontierTrainerMons_Malory }, @@ -1733,7 +1733,7 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .trainerName = _("OSCAR"), .speechBefore = {EC_WORD_LET_S, EC_WORD_SEE, EC_WORD_YOUR, EC_WORD_POWER, EC_WORD_IN, EC_WORD_FULL}, .speechWin = {EC_WORD_THAT_WAS, EC_WORD_NOT, EC_WORD_YOUR, EC_WORD_FULL, EC_WORD_POWER, EC_WORD_EXCL}, - .speechLose = {EC_WORD_NOT, EC_WORD_FUNNY, EC_WORD_ELLIPSIS, EC_WORD_YOU_RE, EC_WORD_TOO_STRONG, 0xFFFF}, + .speechLose = {EC_WORD_NOT, EC_WORD_FUNNY, EC_WORD_ELLIPSIS, EC_WORD_YOU_RE, EC_WORD_TOO_STRONG, EC_EMPTY_WORD}, .monSet = gBattleFrontierTrainerMons_Oscar }, [FRONTIER_TRAINER_WILSON] = { @@ -1772,8 +1772,8 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .facilityClass = FACILITY_CLASS_COOLTRAINER_M, .trainerName = _("ALONZO"), .speechBefore = {EC_WORD_I_VE, EC_WORD_NOT, EC_WORD_LOST, EC_WORD_ONCE, EC_WORD_YET, EC_WORD_EXCL}, - .speechWin = {EC_WORD_YOUR, EC_WORD_SAD, EC_WORD_LOOK, EC_WORD_BECOMES, EC_WORD_YOU, 0xFFFF}, - .speechLose = {EC_WORD_I, EC_WORD_DON_T, EC_WORD_BELIEVE, EC_WORD_THIS, EC_WORD_ELLIPSIS, 0xFFFF}, + .speechWin = {EC_WORD_YOUR, EC_WORD_SAD, EC_WORD_LOOK, EC_WORD_BECOMES, EC_WORD_YOU, EC_EMPTY_WORD}, + .speechLose = {EC_WORD_I, EC_WORD_DON_T, EC_WORD_BELIEVE, EC_WORD_THIS, EC_WORD_ELLIPSIS, EC_EMPTY_WORD}, .monSet = gBattleFrontierTrainerMons_Alonzo }, [FRONTIER_TRAINER_VINCE] = { @@ -1812,7 +1812,7 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .facilityClass = FACILITY_CLASS_COOLTRAINER_F, .trainerName = _("CARRIE"), .speechBefore = {EC_WORD_I, EC_WORD_WILL, EC_WORD_SHOW, EC_WORD_YOU, EC_WORD_GUTSY, EC_WORD_EXCL}, - .speechWin = {EC_WORD_IT_S, EC_WORD_ALL, EC_WORD_ABOUT, EC_WORD_GUTS, EC_WORD_EXCL, 0xFFFF}, + .speechWin = {EC_WORD_IT_S, EC_WORD_ALL, EC_WORD_ABOUT, EC_WORD_GUTS, EC_WORD_EXCL, EC_EMPTY_WORD}, .speechLose = {EC_WORD_OH, EC_WORD_NO, EC_WORD_ELLIPSIS, EC_MOVE(SELF_DESTRUCT), EC_WORD_MODE, EC_WORD_EXCL}, .monSet = gBattleFrontierTrainerMons_Carrie }, @@ -1827,9 +1827,9 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU [FRONTIER_TRAINER_TYLER] = { .facilityClass = FACILITY_CLASS_PKMN_RANGER_M, .trainerName = _("TYLER"), - .speechBefore = {EC_WORD_YO, EC_WORD_EXCL, 0xFFFF, EC_WORD_LET_S, EC_WORD_GO, EC_WORD_EXCL_EXCL}, - .speechWin = {EC_WORD_YO, EC_WORD_EXCL, 0xFFFF, EC_WORD_I, EC_WORD_WON, EC_WORD_YO}, - .speechLose = {EC_WORD_YO, EC_WORD_EXCL, 0xFFFF, EC_WORD_I, EC_WORD_LOST, EC_WORD_YO}, + .speechBefore = {EC_WORD_YO, EC_WORD_EXCL, EC_EMPTY_WORD, EC_WORD_LET_S, EC_WORD_GO, EC_WORD_EXCL_EXCL}, + .speechWin = {EC_WORD_YO, EC_WORD_EXCL, EC_EMPTY_WORD, EC_WORD_I, EC_WORD_WON, EC_WORD_YO}, + .speechLose = {EC_WORD_YO, EC_WORD_EXCL, EC_EMPTY_WORD, EC_WORD_I, EC_WORD_LOST, EC_WORD_YO}, .monSet = gBattleFrontierTrainerMons_Tyler }, [FRONTIER_TRAINER_CHAZ] = { @@ -1867,7 +1867,7 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU [FRONTIER_TRAINER_DORINE] = { .facilityClass = FACILITY_CLASS_PKMN_RANGER_F, .trainerName = _("DORINE"), - .speechBefore = {EC_WORD_I_AM, EC_WORD_YOUNG, EC_WORD_AND, EC_WORD_STRONG, EC_WORD_EXCL, 0xFFFF}, + .speechBefore = {EC_WORD_I_AM, EC_WORD_YOUNG, EC_WORD_AND, EC_WORD_STRONG, EC_WORD_EXCL, EC_EMPTY_WORD}, .speechWin = {EC_WORD_SEE, EC_WORD_QUES, EC_WORD_AREN_T, EC_WORD_I, EC_WORD_GOOD, EC_WORD_QUES}, .speechLose = {EC_WORD_THIS, EC_WORD_ISN_T, EC_WORD_WORKING, EC_WORD_OUT, EC_WORD_AT, EC_WORD_ALL}, .monSet = gBattleFrontierTrainerMons_Dorine @@ -1883,9 +1883,9 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU [FRONTIER_TRAINER_DAVIN] = { .facilityClass = FACILITY_CLASS_DRAGON_TAMER, .trainerName = _("DAVIN"), - .speechBefore = {EC_WORD_LET_S, EC_WORD_HEAR, EC_WORD_YOU, EC_MOVE2(ROAR), EC_WORD_EXCL, 0xFFFF}, - .speechWin = {EC_WORD_WROOOAAR_EXCL, 0xFFFF, 0xFFFF, EC_WORD_VICTORY, EC_WORD_EXCL_EXCL, 0xFFFF}, - .speechLose = {EC_WORD_WROOOAAR_EXCL, 0xFFFF, 0xFFFF, EC_WORD_WHY, EC_WORD_QUES_EXCL, 0xFFFF}, + .speechBefore = {EC_WORD_LET_S, EC_WORD_HEAR, EC_WORD_YOU, EC_MOVE2(ROAR), EC_WORD_EXCL, EC_EMPTY_WORD}, + .speechWin = {EC_WORD_WROOOAAR_EXCL, EC_EMPTY_WORD, EC_EMPTY_WORD, EC_WORD_VICTORY, EC_WORD_EXCL_EXCL, EC_EMPTY_WORD}, + .speechLose = {EC_WORD_WROOOAAR_EXCL, EC_EMPTY_WORD, EC_EMPTY_WORD, EC_WORD_WHY, EC_WORD_QUES_EXCL, EC_EMPTY_WORD}, .monSet = gBattleFrontierTrainerMons_Davin }, [FRONTIER_TRAINER_TREVON] = { @@ -1915,7 +1915,7 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU [FRONTIER_TRAINER_RAUL] = { .facilityClass = FACILITY_CLASS_BLACK_BELT, .trainerName = _("RAUL"), - .speechBefore = {EC_WORD_I, EC_WORD_REJECT, EC_WORD_EVERY, EC_WORD_WEAK, EC_WORD_TRAINER, 0xFFFF}, + .speechBefore = {EC_WORD_I, EC_WORD_REJECT, EC_WORD_EVERY, EC_WORD_WEAK, EC_WORD_TRAINER, EC_EMPTY_WORD}, .speechWin = {EC_WORD_HUMPH, EC_WORD_EXCL, EC_WORD_ANOTHER, EC_WORD_WEAK, EC_WORD_TRAINER, EC_WORD_ELLIPSIS}, .speechLose = {EC_WORD_THERE, EC_WORD_IS, EC_WORD_NOTHING, EC_WORD_WEAK, EC_WORD_ABOUT, EC_WORD_YOU}, .monSet = gBattleFrontierTrainerMons_Raul @@ -1923,7 +1923,7 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU [FRONTIER_TRAINER_KAY] = { .facilityClass = FACILITY_CLASS_BATTLE_GIRL, .trainerName = _("KAY"), - .speechBefore = {EC_WORD_AND, EC_WORD_YET, EC_WORD_ANOTHER, EC_WORD_BATTLE, EC_WORD_QUES, 0xFFFF}, + .speechBefore = {EC_WORD_AND, EC_WORD_YET, EC_WORD_ANOTHER, EC_WORD_BATTLE, EC_WORD_QUES, EC_EMPTY_WORD}, .speechWin = {EC_WORD_I, EC_WORD_WON, EC_WORD_BUT, EC_WORD_I_AM, EC_WORD_TIRED, EC_WORD_ELLIPSIS}, .speechLose = {EC_WORD_GOOD, EC_WORD_IT_S, EC_WORD_OVER, EC_WORD_AT, EC_WORD_LAST, EC_WORD_ELLIPSIS}, .monSet = gBattleFrontierTrainerMons_Kay @@ -1940,7 +1940,7 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .facilityClass = FACILITY_CLASS_BATTLE_GIRL, .trainerName = _("ALANA"), .speechBefore = {EC_WORD_EAT, EC_WORD_MY, EC_WORD_INVINCIBLE, EC_WORD_ATTACK, EC_WORD_YOU, EC_WORD_EXCL}, - .speechWin = {EC_WORD_YOU, EC_WORD_HAVE, EC_WORD_MUCH, EC_WORD_TO, EC_WORD_LEARN, 0xFFFF}, + .speechWin = {EC_WORD_YOU, EC_WORD_HAVE, EC_WORD_MUCH, EC_WORD_TO, EC_WORD_LEARN, EC_EMPTY_WORD}, .speechLose = {EC_WORD_SO, EC_WORD_MUCH, EC_WORD_FOR, EC_WORD_MY, EC_WORD_INVINCIBLE, EC_WORD_ATTACK}, .monSet = gBattleFrontierTrainerMons_Alana }, @@ -1948,7 +1948,7 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .facilityClass = FACILITY_CLASS_EXPERT_M, .trainerName = _("ALEXAS"), .speechBefore = {EC_WORD_GOOD, EC_WORD_TO, EC_WORD_MEET_YOU, EC_WORD_YOUNG, EC_WORD_TRAINER, EC_WORD_EXCL}, - .speechWin = {EC_WORD_WAHAHAHA, EC_WORD_EXCL, 0xFFFF, EC_WORD_GIVE, EC_WORD_IT, EC_WORD_UP}, + .speechWin = {EC_WORD_WAHAHAHA, EC_WORD_EXCL, EC_EMPTY_WORD, EC_WORD_GIVE, EC_WORD_IT, EC_WORD_UP}, .speechLose = {EC_WORD_YOU, EC_WORD_ARE, EC_WORD_A, EC_WORD_STRONG, EC_WORD_TRAINER, EC_WORD_KID}, .monSet = gBattleFrontierTrainerMons_Alexas }, @@ -1964,7 +1964,7 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .facilityClass = FACILITY_CLASS_EXPERT_M, .trainerName = _("JASPER"), .speechBefore = {EC_WORD_I_AM, EC_WORD_NOT, EC_WORD_OLD, EC_WORD_I_AM, EC_WORD_SKILLED, EC_WORD_EXCL}, - .speechWin = {EC_WORD_SKILLED, EC_WORD_THAT_S, EC_WORD_WHAT, EC_WORD_I_AM, EC_WORD_EXCL, 0xFFFF}, + .speechWin = {EC_WORD_SKILLED, EC_WORD_THAT_S, EC_WORD_WHAT, EC_WORD_I_AM, EC_WORD_EXCL, EC_EMPTY_WORD}, .speechLose = {EC_WORD_I_AM, EC_WORD_SHOCKED, EC_WORD_EXCL, EC_WORD_DOWN, EC_WORD_I, EC_WORD_GO}, .monSet = gBattleFrontierTrainerMons_Jasper }, @@ -1972,14 +1972,14 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .facilityClass = FACILITY_CLASS_EXPERT_F, .trainerName = _("NADIA"), .speechBefore = {EC_WORD_YOU, EC_WORD_CAN_T, EC_WORD_BEAT, EC_WORD_ME, EC_WORD_DOWN, EC_WORD_EXCL}, - .speechWin = {EC_WORD_HAH, EC_WORD_EXCL, 0xFFFF, EC_WORD_I, EC_WORD_BEAT, EC_WORD_YOU}, - .speechLose = {EC_WORD_I_AM, EC_MOVE2(BEAT_UP), EC_WORD_AND, EC_WORD_DOWNCAST, EC_WORD_ELLIPSIS, 0xFFFF}, + .speechWin = {EC_WORD_HAH, EC_WORD_EXCL, EC_EMPTY_WORD, EC_WORD_I, EC_WORD_BEAT, EC_WORD_YOU}, + .speechLose = {EC_WORD_I_AM, EC_MOVE2(BEAT_UP), EC_WORD_AND, EC_WORD_DOWNCAST, EC_WORD_ELLIPSIS, EC_EMPTY_WORD}, .monSet = gBattleFrontierTrainerMons_Nadia }, [FRONTIER_TRAINER_MIRANDA] = { .facilityClass = FACILITY_CLASS_EXPERT_F, .trainerName = _("MIRANDA"), - .speechBefore = {EC_WORD_WELL, EC_WORD_WELL, 0xFFFF, EC_WORD_LET_S, EC_WORD_START, 0xFFFF}, + .speechBefore = {EC_WORD_WELL, EC_WORD_WELL, EC_EMPTY_WORD, EC_WORD_LET_S, EC_WORD_START, EC_EMPTY_WORD}, .speechWin = {EC_WORD_WHAT, EC_WORD_QUES, EC_WORD_DONE, EC_WORD_SO, EC_WORD_SOON, EC_WORD_QUES}, .speechLose = {EC_WORD_WELL, EC_WORD_I, EC_WORD_SEE, EC_WORD_THAT, EC_WORD_I_AM, EC_WORD_TOO_WEAK}, .monSet = gBattleFrontierTrainerMons_Miranda @@ -1987,8 +1987,8 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU [FRONTIER_TRAINER_EMMA] = { .facilityClass = FACILITY_CLASS_EXPERT_F, .trainerName = _("EMMA"), - .speechBefore = {EC_WORD_I_VE, EC_WORD_BEEN, EC_WORD_HEARING, EC_WORD_ABOUT, EC_WORD_YOU, 0xFFFF}, - .speechWin = {EC_WORD_I, EC_WORD_THINK, EC_WORD_I_VE, EC_WORD_MISHEARD, EC_WORD_THINGS, 0xFFFF}, + .speechBefore = {EC_WORD_I_VE, EC_WORD_BEEN, EC_WORD_HEARING, EC_WORD_ABOUT, EC_WORD_YOU, EC_EMPTY_WORD}, + .speechWin = {EC_WORD_I, EC_WORD_THINK, EC_WORD_I_VE, EC_WORD_MISHEARD, EC_WORD_THINGS, EC_EMPTY_WORD}, .speechLose = {EC_WORD_WHAT, EC_WORD_I_VE, EC_WORD_BEEN, EC_WORD_HEARING, EC_WORD_IS, EC_WORD_RIGHT}, .monSet = gBattleFrontierTrainerMons_Emma }, @@ -2004,15 +2004,15 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .facilityClass = FACILITY_CLASS_PSYCHIC_M, .trainerName = _("STANLY"), .speechBefore = {EC_WORD_THIS, EC_WORD_SHOULD, EC_WORD_BE, EC_WORD_AN, EC_WORD_EASY, EC_WORD_MATCH}, - .speechWin = {EC_WORD_IT, EC_WORD_REALLY, EC_WORD_WAS, EC_WORD_EASY, 0xFFFF, 0xFFFF}, - .speechLose = {EC_WORD_ARE, EC_WORD_YOU, EC_WORD_HAPPY, EC_WORD_NOW, EC_WORD_QUES, 0xFFFF}, + .speechWin = {EC_WORD_IT, EC_WORD_REALLY, EC_WORD_WAS, EC_WORD_EASY, EC_EMPTY_WORD, EC_EMPTY_WORD}, + .speechLose = {EC_WORD_ARE, EC_WORD_YOU, EC_WORD_HAPPY, EC_WORD_NOW, EC_WORD_QUES, EC_EMPTY_WORD}, .monSet = gBattleFrontierTrainerMons_Stanly }, [FRONTIER_TRAINER_DARIO] = { .facilityClass = FACILITY_CLASS_PSYCHIC_M, .trainerName = _("DARIO"), .speechBefore = {EC_WORD_MY, EC_MOVE2(FORESIGHT), EC_WORD_SAYS, EC_WORD_I, EC_WORD_WILL, EC_WORD_WIN}, - .speechWin = {EC_WORD_MY, EC_MOVE2(FORESIGHT), EC_WORD_HAS, EC_WORD_BEEN, EC_WORD_PERFECT, 0xFFFF}, + .speechWin = {EC_WORD_MY, EC_MOVE2(FORESIGHT), EC_WORD_HAS, EC_WORD_BEEN, EC_WORD_PERFECT, EC_EMPTY_WORD}, .speechLose = {EC_WORD_I, EC_WORD_DIDN_T, EC_WORD_SEE, EC_WORD_THIS, EC_MOVE(REVERSAL), EC_WORD_ELLIPSIS}, .monSet = gBattleFrontierTrainerMons_Dario }, @@ -2020,7 +2020,7 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .facilityClass = FACILITY_CLASS_PSYCHIC_F, .trainerName = _("KARLEE"), .speechBefore = {EC_WORD_SOMETHING, EC_WORD_GOOD, EC_WORD_WILL, EC_WORD_COME, EC_WORD_OF, EC_WORD_THIS}, - .speechWin = {EC_WORD_YOU, EC_WORD_SEE, EC_WORD_QUES, EC_WORD_FANTASTIC, EC_WORD_EXCL, 0xFFFF}, + .speechWin = {EC_WORD_YOU, EC_WORD_SEE, EC_WORD_QUES, EC_WORD_FANTASTIC, EC_WORD_EXCL, EC_EMPTY_WORD}, .speechLose = {EC_WORD_THAT, EC_WORD_SOMETHING, EC_WORD_GOOD, EC_WORD_WENT, EC_WORD_TO, EC_WORD_YOU}, .monSet = gBattleFrontierTrainerMons_Karlee }, @@ -2043,7 +2043,7 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU [FRONTIER_TRAINER_DELILAH] = { .facilityClass = FACILITY_CLASS_HEX_MANIAC, .trainerName = _("DELILAH"), - .speechBefore = {EC_WORD_DON_T, EC_MOVE(GRUDGE), EC_WORD_ME, EC_WORD_IF_I_WIN, EC_WORD_OK_QUES, 0xFFFF}, + .speechBefore = {EC_WORD_DON_T, EC_MOVE(GRUDGE), EC_WORD_ME, EC_WORD_IF_I_WIN, EC_WORD_OK_QUES, EC_EMPTY_WORD}, .speechWin = {EC_WORD_I_AM, EC_WORD_SORRY, EC_WORD_TO, EC_WORD_SEE, EC_WORD_YOU, EC_WORD_ANGRY}, .speechLose = {EC_WORD_I, EC_WORD_HAVE, EC_WORD_A, EC_MOVE(GRUDGE), EC_WORD_WITH, EC_WORD_YOU}, .monSet = gBattleFrontierTrainerMons_Delilah @@ -2060,16 +2060,16 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .facilityClass = FACILITY_CLASS_HEX_MANIAC, .trainerName = _("LEXIE"), .speechBefore = {EC_WORD_WANT, EC_WORD_TO, EC_WORD_SEE, EC_WORD_SCARY, EC_WORD_POKEMON, EC_WORD_QUES}, - .speechWin = {EC_WORD_WASN_T, EC_WORD_THAT, EC_WORD_SCARY, EC_WORD_EH_QUES, 0xFFFF, 0xFFFF}, + .speechWin = {EC_WORD_WASN_T, EC_WORD_THAT, EC_WORD_SCARY, EC_WORD_EH_QUES, EC_EMPTY_WORD, EC_EMPTY_WORD}, .speechLose = {EC_WORD_YOU_RE, EC_WORD_MORE, EC_WORD_SCARY, EC_WORD_THAN, EC_WORD_MY, EC_WORD_POKEMON}, .monSet = gBattleFrontierTrainerMons_Lexie }, [FRONTIER_TRAINER_MILLER] = { .facilityClass = FACILITY_CLASS_POKEMANIAC, .trainerName = _("MILLER"), - .speechBefore = {EC_WORD_HELLO, EC_WORD_QUES, 0xFFFF, EC_WORD_HELLO, EC_WORD_QUES_EXCL, 0xFFFF}, + .speechBefore = {EC_WORD_HELLO, EC_WORD_QUES, EC_EMPTY_WORD, EC_WORD_HELLO, EC_WORD_QUES_EXCL, EC_EMPTY_WORD}, .speechWin = {EC_WORD_HELLO, EC_WORD_MOTHER, EC_WORD_EXCL, EC_WORD_I, EC_WORD_WON, EC_WORD_EXCL}, - .speechLose = {EC_WORD_MY, EC_WORD_PHONE, EC_WORD_ISN_T, EC_WORD_WORKING, EC_WORD_ELLIPSIS, 0xFFFF}, + .speechLose = {EC_WORD_MY, EC_WORD_PHONE, EC_WORD_ISN_T, EC_WORD_WORKING, EC_WORD_ELLIPSIS, EC_EMPTY_WORD}, .monSet = gBattleFrontierTrainerMons_Miller }, [FRONTIER_TRAINER_MARV] = { @@ -2099,7 +2099,7 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU [FRONTIER_TRAINER_GREGORY] = { .facilityClass = FACILITY_CLASS_GENTLEMAN, .trainerName = _("GREGORY"), - .speechBefore = {EC_WORD_I_AM, EC_WORD_NOT, EC_WORD_THAT, EC_WORD_OLD, EC_WORD_YET, 0xFFFF}, + .speechBefore = {EC_WORD_I_AM, EC_WORD_NOT, EC_WORD_THAT, EC_WORD_OLD, EC_WORD_YET, EC_EMPTY_WORD}, .speechWin = {EC_WORD_WHO, EC_WORD_SAYS, EC_WORD_I_AM, EC_WORD_TOO, EC_WORD_OLD, EC_WORD_QUES}, .speechLose = {EC_WORD_PLEASE, EC_WORD_I_AM, EC_WORD_REALLY, EC_WORD_NOT, EC_WORD_THAT, EC_WORD_OLD}, .monSet = gBattleFrontierTrainerMons_Gregory @@ -2107,23 +2107,23 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU [FRONTIER_TRAINER_REESE] = { .facilityClass = FACILITY_CLASS_GENTLEMAN, .trainerName = _("REESE"), - .speechBefore = {EC_WORD_I_VE, EC_WORD_A, EC_WORD_COUPLE, EC_WORD_THINGS, 0xFFFF, 0xFFFF}, - .speechWin = {EC_WORD_DON_T, EC_WORD_DIET, EC_WORD_PLAY, EC_WORD_SPORTS, EC_WORD_INSTEAD, 0xFFFF}, + .speechBefore = {EC_WORD_I_VE, EC_WORD_A, EC_WORD_COUPLE, EC_WORD_THINGS, EC_EMPTY_WORD, EC_EMPTY_WORD}, + .speechWin = {EC_WORD_DON_T, EC_WORD_DIET, EC_WORD_PLAY, EC_WORD_SPORTS, EC_WORD_INSTEAD, EC_EMPTY_WORD}, .speechLose = {EC_WORD_INSTEAD, EC_WORD_OF, EC_WORD_TELEVISION, EC_WORD_GET, EC_WORD_A, EC_WORD_BOOK}, .monSet = gBattleFrontierTrainerMons_Reese }, [FRONTIER_TRAINER_MASON] = { .facilityClass = FACILITY_CLASS_RUNNING_TRIATHLETE_M, .trainerName = _("MASON"), - .speechBefore = {EC_WORD_PLEASE, EC_WORD_DON_T, EC_WORD_MAKE, EC_WORD_THIS, EC_WORD_SCARY, 0xFFFF}, - .speechWin = {EC_WORD_THANK_YOU, EC_WORD_ELLIPSIS, 0xFFFF, EC_WORD_I_AM, EC_WORD_HAPPY, EC_WORD_NOW}, - .speechLose = {EC_WORD_I_AM, EC_WORD_DISAPPOINTED, EC_WORD_ELLIPSIS, 0xFFFF, 0xFFFF, 0xFFFF}, + .speechBefore = {EC_WORD_PLEASE, EC_WORD_DON_T, EC_WORD_MAKE, EC_WORD_THIS, EC_WORD_SCARY, EC_EMPTY_WORD}, + .speechWin = {EC_WORD_THANK_YOU, EC_WORD_ELLIPSIS, EC_EMPTY_WORD, EC_WORD_I_AM, EC_WORD_HAPPY, EC_WORD_NOW}, + .speechLose = {EC_WORD_I_AM, EC_WORD_DISAPPOINTED, EC_WORD_ELLIPSIS, EC_EMPTY_WORD, EC_EMPTY_WORD, EC_EMPTY_WORD}, .monSet = gBattleFrontierTrainerMons_Mason }, [FRONTIER_TRAINER_TOBY] = { .facilityClass = FACILITY_CLASS_RUNNING_TRIATHLETE_M, .trainerName = _("TOBY"), - .speechBefore = {EC_WORD_LISTEN, EC_WORD_UP, 0xFFFF, EC_WORD_I, EC_WORD_ALWAYS, EC_WORD_WIN}, + .speechBefore = {EC_WORD_LISTEN, EC_WORD_UP, EC_EMPTY_WORD, EC_WORD_I, EC_WORD_ALWAYS, EC_WORD_WIN}, .speechWin = {EC_WORD_I_AM, EC_WORD_A, EC_WORD_GENIUS, EC_WORD_OR, EC_WORD_WHAT, EC_WORD_QUES}, .speechLose = {EC_WORD_I, EC_WORD_CAN, EC_WORD_BEAT, EC_WORD_YOU, EC_WORD_AT, EC_WORD_SMARTNESS}, .monSet = gBattleFrontierTrainerMons_Toby @@ -2141,14 +2141,14 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .trainerName = _("PIPER"), .speechBefore = {EC_WORD_COME_ON, EC_WORD_YOU, EC_WORD_NEED, EC_WORD_A, EC_WORD_SPEED_BOOST, EC_WORD_QUES}, .speechWin = {EC_WORD_YOU, EC_WORD_NEED, EC_WORD_TO, EC_WORD_SHOW, EC_WORD_MORE, EC_WORD_GUTS}, - .speechLose = {EC_WORD_OH, EC_WORD_YOU, EC_WORD_EXCL, 0xFFFF, 0xFFFF, 0xFFFF}, + .speechLose = {EC_WORD_OH, EC_WORD_YOU, EC_WORD_EXCL, EC_EMPTY_WORD, EC_EMPTY_WORD, EC_EMPTY_WORD}, .monSet = gBattleFrontierTrainerMons_Piper }, [FRONTIER_TRAINER_FINN] = { .facilityClass = FACILITY_CLASS_SWIMMING_TRIATHLETE_M, .trainerName = _("FINN"), - .speechBefore = {EC_WORD_NOT, EC_WORD_ANOTHER, EC_WORD_TRAINER, EC_WORD_BATTLE, EC_WORD_ELLIPSIS, 0xFFFF}, - .speechWin = {EC_WORD_WON_T, EC_WORD_THIS, EC_WORD_EVER, EC_WORD_END, EC_WORD_QUES, 0xFFFF}, + .speechBefore = {EC_WORD_NOT, EC_WORD_ANOTHER, EC_WORD_TRAINER, EC_WORD_BATTLE, EC_WORD_ELLIPSIS, EC_EMPTY_WORD}, + .speechWin = {EC_WORD_WON_T, EC_WORD_THIS, EC_WORD_EVER, EC_WORD_END, EC_WORD_QUES, EC_EMPTY_WORD}, .speechLose = {EC_WORD_I, EC_WORD_FINALLY, EC_WORD_GET, EC_WORD_TO, EC_MOVE2(REST), EC_WORD_A_LITTLE}, .monSet = gBattleFrontierTrainerMons_Finn }, @@ -2157,7 +2157,7 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .trainerName = _("SAMIR"), .speechBefore = {EC_WORD_I, EC_MOVE2(DIVE), EC_WORD_BELOW, EC_WORD_THE, EC_MOVE2(SURF), EC_WORD_EXCL}, .speechWin = {EC_WORD_YAHOO, EC_WORD_TAKE, EC_WORD_A, EC_MOVE2(DIVE), EC_WORD_YOU, EC_WORD_EXCL}, - .speechLose = {EC_WORD_I_AM, EC_WORD_GOING, EC_WORD_TO, EC_WORD_SINK, EC_WORD_ELLIPSIS, 0xFFFF}, + .speechLose = {EC_WORD_I_AM, EC_WORD_GOING, EC_WORD_TO, EC_WORD_SINK, EC_WORD_ELLIPSIS, EC_EMPTY_WORD}, .monSet = gBattleFrontierTrainerMons_Samir }, [FRONTIER_TRAINER_FIONA] = { @@ -2179,7 +2179,7 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU [FRONTIER_TRAINER_NICO] = { .facilityClass = FACILITY_CLASS_CYCLING_TRIATHLETE_M, .trainerName = _("NICO"), - .speechBefore = {EC_WORD_LIKE, EC_WORD_A, EC_MOVE(SONIC_BOOM), EC_WORD_I_VE_ARRIVED, 0xFFFF, 0xFFFF}, + .speechBefore = {EC_WORD_LIKE, EC_WORD_A, EC_MOVE(SONIC_BOOM), EC_WORD_I_VE_ARRIVED, EC_EMPTY_WORD, EC_EMPTY_WORD}, .speechWin = {EC_WORD_SORRY, EC_WORD_TO, EC_WORD_MAKE, EC_WORD_YOU, EC_WORD_SO, EC_WORD_DOWNCAST}, .speechLose = {EC_WORD_I_AM, EC_WORD_GOING, EC_WORD_WITH, EC_WORD_A, EC_MOVE2(SUPERSONIC), EC_WORD_SPEED_BOOST}, .monSet = gBattleFrontierTrainerMons_Nico @@ -2220,7 +2220,7 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .facilityClass = FACILITY_CLASS_BUG_MANIAC, .trainerName = _("LIAM"), .speechBefore = {EC_WORD_WE, EC_WORD_REALLY, EC_WORD_DISLIKE, EC_WORD_FIRE, EC_WORD_AND, EC_WORD_FLYING}, - .speechWin = {EC_WORD_BUG, EC_WORD_POKEMON, EC_WORD_AREN_T, EC_WORD_BAD, EC_WORD_HEY_QUES, 0xFFFF}, + .speechWin = {EC_WORD_BUG, EC_WORD_POKEMON, EC_WORD_AREN_T, EC_WORD_BAD, EC_WORD_HEY_QUES, EC_EMPTY_WORD}, .speechLose = {EC_WORD_YOU, EC_WORD_KNOW, EC_WORD_WHAT, EC_WORD_WE, EC_WORD_DISLIKE, EC_WORD_HEY_QUES}, .monSet = gBattleFrontierTrainerMons_Liam }, @@ -2269,14 +2269,14 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .trainerName = _("TRISTON"), .speechBefore = {EC_WORD_I, EC_WORD_WOULD, EC_WORD_RATHER, EC_WORD_LOOK, EC_WORD_AT, EC_WORD_POKEMON}, .speechWin = {EC_WORD_HUH_QUES, EC_WORD_YOU, EC_WORD_MEAN, EC_WORD_I, EC_WORD_WON, EC_WORD_QUES_EXCL}, - .speechLose = {EC_WORD_SEE, EC_WORD_QUES, 0xFFFF, EC_WORD_I, EC_WORD_ALWAYS, EC_WORD_LOSE}, + .speechLose = {EC_WORD_SEE, EC_WORD_QUES, EC_EMPTY_WORD, EC_WORD_I, EC_WORD_ALWAYS, EC_WORD_LOSE}, .monSet = gBattleFrontierTrainerMons_Triston }, [FRONTIER_TRAINER_CHARLES] = { .facilityClass = FACILITY_CLASS_GUITARIST, .trainerName = _("CHARLES"), .speechBefore = {EC_WORD_IT_S, EC_WORD_HOPELESS, EC_WORD_TO, EC_MOVE2(STRUGGLE), EC_WORD_WITH, EC_WORD_ME}, - .speechWin = {EC_MOVE(SUBMISSION), EC_WORD_WAS, EC_WORD_YOUR, EC_WORD_ONLY, EC_WORD_CHOICE, 0xFFFF}, + .speechWin = {EC_MOVE(SUBMISSION), EC_WORD_WAS, EC_WORD_YOUR, EC_WORD_ONLY, EC_WORD_CHOICE, EC_EMPTY_WORD}, .speechLose = {EC_WORD_I_AM, EC_WORD_GOING, EC_WORD_DOWN, EC_WORD_DOWN, EC_WORD_DOWN, EC_WORD_EXCL}, .monSet = gBattleFrontierTrainerMons_Charles }, @@ -2284,7 +2284,7 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .facilityClass = FACILITY_CLASS_GUITARIST, .trainerName = _("RAYMOND"), .speechBefore = {EC_WORD_WANT, EC_WORD_TO, EC_WORD_HEAR, EC_WORD_MY, EC_WORD_SONG, EC_WORD_QUES}, - .speechWin = {EC_WORD_SATISFIED, EC_WORD_THAT_S, EC_WORD_WHAT, EC_WORD_I_AM, EC_WORD_EXCL, 0xFFFF}, + .speechWin = {EC_WORD_SATISFIED, EC_WORD_THAT_S, EC_WORD_WHAT, EC_WORD_I_AM, EC_WORD_EXCL, EC_EMPTY_WORD}, .speechLose = {EC_WORD_SATISFIED, EC_WORD_IS, EC_WORD_WHAT, EC_WORD_I, EC_WORD_CAN_T, EC_WORD_BE}, .monSet = gBattleFrontierTrainerMons_Raymond }, @@ -2348,7 +2348,7 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .facilityClass = FACILITY_CLASS_KINDLER, .trainerName = _("FERRIS"), .speechBefore = {EC_WORD_I_AM, EC_WORD_NO_1, EC_WORD_IN, EC_WORD_THE, EC_WORD_OLD, EC_WORD_CLASS}, - .speechWin = {EC_WORD_NO_1, EC_WORD_THAT_S, EC_WORD_WHAT, EC_WORD_I_AM, EC_WORD_EXCL, 0xFFFF}, + .speechWin = {EC_WORD_NO_1, EC_WORD_THAT_S, EC_WORD_WHAT, EC_WORD_I_AM, EC_WORD_EXCL, EC_EMPTY_WORD}, .speechLose = {EC_WORD_I_AM, EC_WORD_NOT, EC_WORD_NO_1, EC_WORD_ANY, EC_WORD_MORE, EC_WORD_ELLIPSIS}, .monSet = gBattleFrontierTrainerMons_Ferris }, @@ -2363,24 +2363,24 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU [FRONTIER_TRAINER_PAIGE] = { .facilityClass = FACILITY_CLASS_PARASOL_LADY, .trainerName = _("PAIGE"), - .speechBefore = {EC_WORD_LET_S, EC_WORD_ENJOY, EC_WORD_OUR, EC_WORD_BATTLE, EC_WORD_TOGETHER, 0xFFFF}, - .speechWin = {EC_WORD_THAT_S_IT_EXCL, 0xFFFF, 0xFFFF, EC_WORD_THANK_YOU, EC_WORD_VERY, EC_WORD_MUCH}, - .speechLose = {EC_WORD_THAT_S_IT_EXCL, 0xFFFF, 0xFFFF, EC_WORD_DO, EC_WORD_GO, EC_WORD_ON}, + .speechBefore = {EC_WORD_LET_S, EC_WORD_ENJOY, EC_WORD_OUR, EC_WORD_BATTLE, EC_WORD_TOGETHER, EC_EMPTY_WORD}, + .speechWin = {EC_WORD_THAT_S_IT_EXCL, EC_EMPTY_WORD, EC_EMPTY_WORD, EC_WORD_THANK_YOU, EC_WORD_VERY, EC_WORD_MUCH}, + .speechLose = {EC_WORD_THAT_S_IT_EXCL, EC_EMPTY_WORD, EC_EMPTY_WORD, EC_WORD_DO, EC_WORD_GO, EC_WORD_ON}, .monSet = gBattleFrontierTrainerMons_Paige }, [FRONTIER_TRAINER_ANYA] = { .facilityClass = FACILITY_CLASS_BEAUTY, .trainerName = _("ANYA"), .speechBefore = {EC_WORD_I, EC_WORD_DISLIKE, EC_WORD_OH, EC_WORD_SO, EC_WORD_PRETTY, EC_WORD_FASHION}, - .speechWin = {EC_WORD_FASHION, EC_WORD_SHOULD, EC_WORD_MATCH, EC_WORD_THE, EC_WORD_PERSON, 0xFFFF}, - .speechLose = {EC_WORD_PRETTY, EC_WORD_COULD, EC_WORD_BE, EC_WORD_GOOD, 0xFFFF, 0xFFFF}, + .speechWin = {EC_WORD_FASHION, EC_WORD_SHOULD, EC_WORD_MATCH, EC_WORD_THE, EC_WORD_PERSON, EC_EMPTY_WORD}, + .speechLose = {EC_WORD_PRETTY, EC_WORD_COULD, EC_WORD_BE, EC_WORD_GOOD, EC_EMPTY_WORD, EC_EMPTY_WORD}, .monSet = gBattleFrontierTrainerMons_Anya }, [FRONTIER_TRAINER_DAWN] = { .facilityClass = FACILITY_CLASS_BEAUTY, .trainerName = _("DAWN"), - .speechBefore = {EC_WORD_I, EC_WORD_GO, EC_WORD_ALL, EC_WORD_OUT, EC_WORD_EXCL, 0xFFFF}, - .speechWin = {EC_WORD_DON_T, EC_WORD_BE, EC_WORD_A, EC_WORD_BABY, EC_WORD_EXCL, 0xFFFF}, + .speechBefore = {EC_WORD_I, EC_WORD_GO, EC_WORD_ALL, EC_WORD_OUT, EC_WORD_EXCL, EC_EMPTY_WORD}, + .speechWin = {EC_WORD_DON_T, EC_WORD_BE, EC_WORD_A, EC_WORD_BABY, EC_WORD_EXCL, EC_EMPTY_WORD}, .speechLose = {EC_WORD_YOU, EC_WORD_WON, EC_WORD_EXCL, EC_WORD_MOVE, EC_WORD_ON, EC_WORD_EXCL}, .monSet = gBattleFrontierTrainerMons_Dawn }, @@ -2388,8 +2388,8 @@ const struct BattleFrontierTrainer gBattleFrontierTrainers[FRONTIER_TRAINERS_COU .facilityClass = FACILITY_CLASS_AROMA_LADY, .trainerName = _("ABBY"), .speechBefore = {EC_WORD_I, EC_WORD_LIKE, EC_WORD_A, EC_WORD_TRAINER, EC_WORD_THAT_S, EC_WORD_REFRESHING}, - .speechWin = {EC_WORD_VICTORY, EC_WORD_HAS, EC_WORD_A, EC_MOVE(SWEET_SCENT), EC_WORD_EXCL, 0xFFFF}, - .speechLose = {EC_WORD_WHAT, EC_WORD_AN, EC_WORD_AWFUL, EC_WORD_STENCH, EC_WORD_EXCL, 0xFFFF}, + .speechWin = {EC_WORD_VICTORY, EC_WORD_HAS, EC_WORD_A, EC_MOVE(SWEET_SCENT), EC_WORD_EXCL, EC_EMPTY_WORD}, + .speechLose = {EC_WORD_WHAT, EC_WORD_AN, EC_WORD_AWFUL, EC_WORD_STENCH, EC_WORD_EXCL, EC_EMPTY_WORD}, .monSet = gBattleFrontierTrainerMons_Abby }, [FRONTIER_TRAINER_GRETEL] = { diff --git a/src/data/battle_frontier/battle_tent.h b/src/data/battle_frontier/battle_tent.h index bf89c5bc3..e1c3750bf 100644 --- a/src/data/battle_frontier/battle_tent.h +++ b/src/data/battle_frontier/battle_tent.h @@ -616,9 +616,9 @@ const struct BattleFrontierTrainer gSlateportBattleTentTrainers[NUM_BATTLE_TENT_ [SLATEPORT_TENT_TRAINER_MAGGIE] = { .facilityClass = FACILITY_CLASS_SCHOOL_KID_F, .trainerName = _("MAGGIE"), - .speechBefore = {EC_POKEMON(VULPIX), EC_POKEMON(XATU), EC_POKEMON2(UMBREON), EC_WORD_ELLIPSIS, EC_WORD_UM, EC_WORD_ELLIPSIS}, + .speechBefore = {EC_POKEMON(VULPIX), EC_POKEMON(XATU), EC_POKEMON_NATIONAL(UMBREON), EC_WORD_ELLIPSIS, EC_WORD_UM, EC_WORD_ELLIPSIS}, .speechWin = {EC_POKEMON(NOSEPASS), EC_WORD_ELLIPSIS, EC_WORD_UM, EC_POKEMON(SEVIPER), EC_WORD_EXCL, -1}, - .speechLose = {EC_POKEMON(NOSEPASS), EC_WORD_ELLIPSIS, EC_WORD_UM, EC_POKEMON2(SNORLAX), EC_WORD_ELLIPSIS, EC_WORD_UH_OH}, + .speechLose = {EC_POKEMON(NOSEPASS), EC_WORD_ELLIPSIS, EC_WORD_UM, EC_POKEMON_NATIONAL(SNORLAX), EC_WORD_ELLIPSIS, EC_WORD_UH_OH}, .monSet = gSlateportBattleTentTrainerMons_Maggie }, [SLATEPORT_TENT_TRAINER_STEPHON] = { diff --git a/src/data/battle_frontier/trainer_hill.h b/src/data/battle_frontier/trainer_hill.h index d8bd57576..127eb8ed4 100644 --- a/src/data/battle_frontier/trainer_hill.h +++ b/src/data/battle_frontier/trainer_hill.h @@ -314,7 +314,7 @@ static const struct TrHillFloor sDataTagJPDefault_Floors[] = { .speechBefore = { EC_WORD_SISTER, EC_WORD_ALTHOUGH, EC_WORD_KIND, EC_WORD_MATCH, EC_WORD_PLEASE, EC_WORD_WITHOUT }, .speechWin = { EC_WORD_KIND, EC_WORD_ELLIPSIS, EC_WORD_INSTEAD, EC_WORD_DEEP, EC_WORD_WEAK, EC_WORD_QUES }, .speechLose = { EC_WORD_AWFUL, EC_WORD_GWAH, EC_WORD_HOPELESS, EC_WORD_CAN_T_WIN, EC_WORD_IS, EC_WORD_NONE }, - .speechAfter = { EC_WORD_AWW, 0xFFFF, 0xFFFF, EC_WORD_ALMOST, EC_WORD_GOOD, EC_WORD_ANYWHERE }, + .speechAfter = { EC_WORD_AWW, EC_EMPTY_WORD, EC_EMPTY_WORD, EC_WORD_ALMOST, EC_WORD_GOOD, EC_WORD_ANYWHERE }, .mons = { [0] = NULL_BATTLE_TOWER_POKEMON, [1] = NULL_BATTLE_TOWER_POKEMON, @@ -444,7 +444,7 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .unused = 0, .speechBefore = {EC_WORD_YOU, EC_WORD_CAN, EC_WORD_CHOOSE, EC_WORD_NOT, EC_WORD_TO, EC_WORD_BELIEVE}, .speechWin = {EC_WORD_A, EC_WORD_SUPER, EC_WORD_NATURAL, EC_WORD_POWER, EC_WORD_HAS, EC_WORD_COME}, - .speechLose = {EC_WORD_THIS, EC_WORD_MUST_BE, EC_WORD_A, EC_MOVE(NIGHTMARE), EC_WORD_EXCL, 0xFFFF}, + .speechLose = {EC_WORD_THIS, EC_WORD_MUST_BE, EC_WORD_A, EC_MOVE(NIGHTMARE), EC_WORD_EXCL, EC_EMPTY_WORD}, .speechAfter = {EC_WORD_I, EC_WORD_WILL, EC_WORD_DISAPPEAR, EC_WORD_IN, EC_WORD_THE, EC_WORD_DARK}, .mons = { @@ -589,7 +589,7 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .name = _("ALFONSO"), .facilityClass = FACILITY_CLASS_CYCLING_TRIATHLETE_M, .unused = 0, - .speechBefore = {EC_WORD_I, EC_WORD_NEVER, EC_WORD_TAKE, EC_WORD_A, EC_WORD_TRAIN, 0xFFFF}, + .speechBefore = {EC_WORD_I, EC_WORD_NEVER, EC_WORD_TAKE, EC_WORD_A, EC_WORD_TRAIN, EC_EMPTY_WORD}, .speechWin = {EC_WORD_I_AM, EC_WORD_FEELING, EC_MOVE2(SUPERSONIC), EC_WORD_ON, EC_WORD_MY, EC_WORD_BIKE}, .speechLose = {EC_WORD_MY, EC_WORD_BIKE, EC_WORD_EXCL, EC_WORD_YOU_VE, EC_WORD_DESTROYED, EC_WORD_IT}, .speechAfter = {EC_WORD_A, EC_WORD_BIKE, EC_WORD_OVER, EC_WORD_ANY, EC_WORD_TRAIN, EC_WORD_EXCL}, @@ -907,8 +907,8 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .facilityClass = FACILITY_CLASS_PKMN_BREEDER_F, .unused = 0, .speechBefore = {EC_WORD_SOME, EC_WORD_THINGS, EC_WORD_YOU, EC_WORD_CAN_T, EC_WORD_DO, EC_WORD_ALONE}, - .speechWin = {EC_WORD_YOU, EC_WORD_WIN, EC_WORD_AS, EC_WORD_A, EC_WORD_GROUP, 0xFFFF}, - .speechLose = {EC_WORD_WE, EC_WORD_COULDN_T, EC_WORD_WIN, EC_WORD_TOGETHER, EC_WORD_QUES, 0xFFFF}, + .speechWin = {EC_WORD_YOU, EC_WORD_WIN, EC_WORD_AS, EC_WORD_A, EC_WORD_GROUP, EC_EMPTY_WORD}, + .speechLose = {EC_WORD_WE, EC_WORD_COULDN_T, EC_WORD_WIN, EC_WORD_TOGETHER, EC_WORD_QUES, EC_EMPTY_WORD}, .speechAfter = {EC_WORD_MAYBE, EC_WORD_I, EC_WORD_NEED, EC_WORD_A, EC_WORD_BOY, EC_WORD_FRIEND}, .mons = { @@ -1086,7 +1086,7 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .speechBefore = {EC_WORD_LET_S, EC_MOVE2(WRAP), EC_WORD_THINGS, EC_WORD_UP, EC_WORD_HERE, EC_WORD_HEY_QUES}, .speechWin = {EC_WORD_WOULD, EC_WORD_YOU, EC_WORD_LIKE, EC_WORD_TO, EC_WORD_GO_HOME, EC_WORD_QUES}, .speechLose = {EC_WORD_I, EC_WORD_WILL, EC_WORD_MAKE, EC_WORD_YOU, EC_WORD_SORRY, EC_WORD_FRIEND}, - .speechAfter = {EC_WORD_HAVEN_T, EC_WORD_YOU, EC_WORD_DONE, EC_WORD_ENOUGH, EC_WORD_QUES, 0xFFFF}, + .speechAfter = {EC_WORD_HAVEN_T, EC_WORD_YOU, EC_WORD_DONE, EC_WORD_ENOUGH, EC_WORD_QUES, EC_EMPTY_WORD}, .mons = { [0] = @@ -1229,7 +1229,7 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .facilityClass = FACILITY_CLASS_PKMN_BREEDER_F, .unused = 0, .speechBefore = {EC_WORD_I_AM, EC_WORD_THE, EC_WORD_STRONG, EC_WORD_BEAUTY, EC_WORD_AROUND, EC_WORD_HERE}, - .speechWin = {EC_WORD_I_AM, EC_WORD_STRONG, EC_WORD_THAT_S, EC_WORD_WHY, EC_WORD_EXCL, 0xFFFF}, + .speechWin = {EC_WORD_I_AM, EC_WORD_STRONG, EC_WORD_THAT_S, EC_WORD_WHY, EC_WORD_EXCL, EC_EMPTY_WORD}, .speechLose = {EC_WORD_I_AM, EC_WORD_TIRED, EC_WORD_TODAY, EC_WORD_THAT_S, EC_WORD_WHY, EC_WORD_EXCL}, .speechAfter = {EC_WORD_WHY, EC_WORD_YES, EC_WORD_I_AM, EC_WORD_ANGRY, EC_WORD_THANK_YOU, EC_WORD_EXCL}, .mons = @@ -1404,8 +1404,8 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .name = _("KEENAN"), .facilityClass = FACILITY_CLASS_PSYCHIC_M, .unused = 0, - .speechBefore = {EC_WORD_YOU, EC_WORD_LOOK, EC_WORD_SO, EC_WORD_HURRIED, 0xFFFF, 0xFFFF}, - .speechWin = {EC_WORD_TOO, EC_WORD_BAD, 0xFFFF, EC_WORD_TIME, EC_WORD_IS, EC_WORD_UP}, + .speechBefore = {EC_WORD_YOU, EC_WORD_LOOK, EC_WORD_SO, EC_WORD_HURRIED, EC_EMPTY_WORD, EC_EMPTY_WORD}, + .speechWin = {EC_WORD_TOO, EC_WORD_BAD, EC_EMPTY_WORD, EC_WORD_TIME, EC_WORD_IS, EC_WORD_UP}, .speechLose = {EC_WORD_DOES, EC_WORD_THE, EC_WORD_TIME, EC_WORD_WORRY, EC_WORD_YOU, EC_WORD_QUES}, .speechAfter = {EC_WORD_YOU, EC_WORD_DON_T, EC_WORD_HAVE, EC_WORD_TIME, EC_WORD_TO, EC_WORD_CHAT}, .mons = @@ -1547,7 +1547,7 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .unused = 0, .speechBefore = {EC_WORD_IT_S, EC_WORD_HOT, EC_WORD_ELLIPSIS, EC_WORD_WHAT, EC_WORD_A, EC_WORD_STENCH}, .speechWin = {EC_WORD_I, EC_WORD_REALLY, EC_WORD_LIKE, EC_WORD_AN, EC_WORD_OFFENSIVE, EC_WORD_STENCH}, - .speechLose = {EC_WORD_I, EC_MOVE2(COVET), EC_WORD_ANY, EC_WORD_STRONG, EC_WORD_STENCH, 0xFFFF}, + .speechLose = {EC_WORD_I, EC_MOVE2(COVET), EC_WORD_ANY, EC_WORD_STRONG, EC_WORD_STENCH, EC_EMPTY_WORD}, .speechAfter = {EC_WORD_MY, EC_WORD_SENSE, EC_WORD_OF, EC_WORD_SMELL, EC_WORD_ISN_T, EC_WORD_NORMAL}, .mons = { @@ -1731,8 +1731,8 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .unused = 0, .speechBefore = {EC_WORD_GOOD, EC_WORD_CHILDREN, EC_WORD_WILL, EC_WORD_GET, EC_WORD_A, EC_MOVE2(PRESENT)}, .speechWin = {EC_WORD_THANK_YOU, EC_WORD_MY, EC_WORD_VICTORY, EC_WORD_IS, EC_WORD_YOUR, EC_MOVE2(PRESENT)}, - .speechLose = {EC_WORD_THAT_WAS, EC_WORD_MY, EC_MOVE2(PRESENT), EC_WORD_TO, EC_WORD_YOU, 0xFFFF}, - .speechAfter = {EC_WORD_WELL_THEN, EC_WORD_CONGRATS, EC_WORD_MY, EC_WORD_FRIEND, 0xFFFF, 0xFFFF}, + .speechLose = {EC_WORD_THAT_WAS, EC_WORD_MY, EC_MOVE2(PRESENT), EC_WORD_TO, EC_WORD_YOU, EC_EMPTY_WORD}, + .speechAfter = {EC_WORD_WELL_THEN, EC_WORD_CONGRATS, EC_WORD_MY, EC_WORD_FRIEND, EC_EMPTY_WORD, EC_EMPTY_WORD}, .mons = { [0] = @@ -1870,7 +1870,7 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .unused = 0, .speechBefore = {EC_WORD_CAN, EC_WORD_YOU, EC_WORD_SENSE, EC_WORD_ME, EC_MOVE(FOCUS_ENERGY), EC_WORD_QUES}, .speechWin = {EC_WORD_THAT_S, EC_WORD_ABOUT, EC_WORD_RIGHT, EC_WORD_I, EC_WORD_WOULD, EC_WORD_THINK}, - .speechLose = {EC_WORD_THINGS, EC_WORD_DON_T, EC_WORD_ALWAYS, EC_WORD_WORK, EC_WORD_OUT, 0xFFFF}, + .speechLose = {EC_WORD_THINGS, EC_WORD_DON_T, EC_WORD_ALWAYS, EC_WORD_WORK, EC_WORD_OUT, EC_EMPTY_WORD}, .speechAfter = {EC_WORD_I_AM, EC_WORD_FEELING, EC_WORD_LONESOME, EC_WORD_AND, EC_WORD_SAD, EC_WORD_NOW}, .mons = { @@ -2040,7 +2040,7 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .facilityClass = FACILITY_CLASS_PARASOL_LADY, .unused = 0, .speechBefore = {EC_WORD_HI, EC_WORD_ARE, EC_WORD_YOU, EC_WORD_FEELING, EC_WORD_UPBEAT, EC_WORD_QUES}, - .speechWin = {EC_WORD_AREN_T, EC_WORD_YOU, EC_WORD_FEELING, EC_WORD_WELL, EC_WORD_QUES, 0xFFFF}, + .speechWin = {EC_WORD_AREN_T, EC_WORD_YOU, EC_WORD_FEELING, EC_WORD_WELL, EC_WORD_QUES, EC_EMPTY_WORD}, .speechLose = {EC_WORD_I, EC_WORD_CAN, EC_WORD_SEE, EC_WORD_YOU_RE, EC_WORD_FEELING, EC_WORD_GREAT}, .speechAfter = {EC_WORD_YOUR, EC_WORD_POKEMON, EC_WORD_LOOK, EC_WORD_READY, EC_WORD_TO, EC_WORD_HUSTLE}, .mons = @@ -2380,8 +2380,8 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .facilityClass = FACILITY_CLASS_RICH_BOY, .unused = 0, .speechBefore = {EC_WORD_GET, EC_WORD_READY, EC_WORD_FOR, EC_WORD_AN, EC_WORD_AWESOME, EC_WORD_TIME}, - .speechWin = {EC_WORD_HEY, EC_WORD_HEY, EC_WORD_EXCL, EC_WORD_WHAT_S_UP_QUES, 0xFFFF, 0xFFFF}, - .speechLose = {EC_WORD_AWW, EC_WORD_COULDN_T, EC_WORD_YOU, EC_WORD_LET_ME_WIN, EC_WORD_QUES, 0xFFFF}, + .speechWin = {EC_WORD_HEY, EC_WORD_HEY, EC_WORD_EXCL, EC_WORD_WHAT_S_UP_QUES, EC_EMPTY_WORD, EC_EMPTY_WORD}, + .speechLose = {EC_WORD_AWW, EC_WORD_COULDN_T, EC_WORD_YOU, EC_WORD_LET_ME_WIN, EC_WORD_QUES, EC_EMPTY_WORD}, .speechAfter = {EC_WORD_DID, EC_WORD_YOU, EC_WORD_SEE, EC_WORD_MY, EC_WORD_SKILL, EC_WORD_QUES}, .mons = { @@ -2840,10 +2840,10 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .name = _("FRANCISCO"), .facilityClass = FACILITY_CLASS_POKEFAN_M, .unused = 0, - .speechBefore = {EC_WORD_I, EC_WORD_STUDY, EC_WORD_EVERY, EC_WORD_DAY, EC_WORD_TOO, 0xFFFF}, - .speechWin = {EC_WORD_SO, EC_WORD_THAT_S, EC_WORD_HOW, EC_WORD_YOU, EC_WORD_LOSE, 0xFFFF}, + .speechBefore = {EC_WORD_I, EC_WORD_STUDY, EC_WORD_EVERY, EC_WORD_DAY, EC_WORD_TOO, EC_EMPTY_WORD}, + .speechWin = {EC_WORD_SO, EC_WORD_THAT_S, EC_WORD_HOW, EC_WORD_YOU, EC_WORD_LOSE, EC_EMPTY_WORD}, .speechLose = {EC_WORD_NO, EC_WORD_WONDER, EC_WORD_I, EC_WORD_COULDN_T, EC_WORD_BEAT, EC_WORD_YOU}, - .speechAfter = {EC_WORD_YES, EC_WORD_ELLIPSIS, 0xFFFF, EC_WORD_THANK_YOU, 0xFFFF, 0xFFFF}, + .speechAfter = {EC_WORD_YES, EC_WORD_ELLIPSIS, EC_EMPTY_WORD, EC_WORD_THANK_YOU, EC_EMPTY_WORD, EC_EMPTY_WORD}, .mons = { [0] = @@ -3023,10 +3023,10 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .name = _("MEREDITH"), .facilityClass = FACILITY_CLASS_PKMN_RANGER_F, .unused = 0, - .speechBefore = {EC_WORD_UM, EC_WORD_ELLIPSIS, 0xFFFF, EC_WORD_I, EC_WORD_ELLIPSIS, 0xFFFF}, - .speechWin = {EC_WORD_OH, EC_WORD_EXCL, 0xFFFF, EC_WORD_UM, EC_WORD_ELLIPSIS, EC_WORD_YAY}, - .speechLose = {EC_WORD_UM, EC_WORD_ELLIPSIS, 0xFFFF, EC_WORD_WAAAH, EC_WORD_ELLIPSIS, 0xFFFF}, - .speechAfter = {EC_WORD_UM, EC_WORD_ELLIPSIS, 0xFFFF, EC_WORD_I_AM, EC_WORD_SAD, EC_WORD_ELLIPSIS}, + .speechBefore = {EC_WORD_UM, EC_WORD_ELLIPSIS, EC_EMPTY_WORD, EC_WORD_I, EC_WORD_ELLIPSIS, EC_EMPTY_WORD}, + .speechWin = {EC_WORD_OH, EC_WORD_EXCL, EC_EMPTY_WORD, EC_WORD_UM, EC_WORD_ELLIPSIS, EC_WORD_YAY}, + .speechLose = {EC_WORD_UM, EC_WORD_ELLIPSIS, EC_EMPTY_WORD, EC_WORD_WAAAH, EC_WORD_ELLIPSIS, EC_EMPTY_WORD}, + .speechAfter = {EC_WORD_UM, EC_WORD_ELLIPSIS, EC_EMPTY_WORD, EC_WORD_I_AM, EC_WORD_SAD, EC_WORD_ELLIPSIS}, .mons = { [0] = @@ -4948,8 +4948,8 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .unused = 0, .speechBefore = {EC_WORD_OH_DEAR, EC_WORD_THIS, EC_WORD_MATCH, EC_WORD_IS, EC_WORD_FOR, EC_WORD_YOU}, .speechWin = {EC_WORD_OH_DEAR, EC_WORD_DID, EC_WORD_YOU, EC_WORD_SEE, EC_WORD_THAT, EC_WORD_QUES}, - .speechLose = {EC_WORD_OH_DEAR, EC_WORD_I_AM, EC_WORD_SO, EC_WORD_SORRY, 0xFFFF, 0xFFFF}, - .speechAfter = {EC_WORD_IS, EC_WORD_YOUR, EC_WORD_GRANDMOTHER, EC_WORD_STRONG, EC_WORD_QUES, 0xFFFF}, + .speechLose = {EC_WORD_OH_DEAR, EC_WORD_I_AM, EC_WORD_SO, EC_WORD_SORRY, EC_EMPTY_WORD, EC_EMPTY_WORD}, + .speechAfter = {EC_WORD_IS, EC_WORD_YOUR, EC_WORD_GRANDMOTHER, EC_WORD_STRONG, EC_WORD_QUES, EC_EMPTY_WORD}, .mons = { [0] = @@ -5094,7 +5094,7 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .speechBefore = {EC_WORD_OH_DEAR, EC_WORD_I, EC_WORD_WILL, EC_WORD_WIN, EC_WORD_FOR, EC_WORD_YOU}, .speechWin = {EC_WORD_OH_DEAR, EC_WORD_WE, EC_WORD_HAVE, EC_WORD_A, EC_WORD_PARTY, EC_WORD_LATER}, .speechLose = {EC_WORD_OH_DEAR, EC_WORD_I_AM, EC_WORD_SORRY, EC_WORD_TO, EC_WORD_DISAPPOINT, EC_WORD_YOU}, - .speechAfter = {EC_WORD_IS, EC_WORD_YOUR, EC_WORD_GRANDFATHER, EC_WORD_COOL, EC_WORD_QUES, 0xFFFF}, + .speechAfter = {EC_WORD_IS, EC_WORD_YOUR, EC_WORD_GRANDFATHER, EC_WORD_COOL, EC_WORD_QUES, EC_EMPTY_WORD}, .mons = { [0] = @@ -5271,7 +5271,7 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .speechBefore = {EC_WORD_WAAAH, EC_WORD_THIS, EC_WORD_IS, EC_WORD_SO, EC_WORD_EXCITING, EC_WORD_EXCL}, .speechWin = {EC_WORD_WAAAH, EC_WORD_I_AM, EC_WORD_SO, EC_WORD_HAPPY, EC_WORD_I, EC_WORD_WON}, .speechLose = {EC_WORD_WAAAH, EC_WORD_I_AM, EC_WORD_SO, EC_WORD_SAD, EC_WORD_I, EC_WORD_LOST}, - .speechAfter = {EC_WORD_WAAAH, EC_WORD_EXCL, 0xFFFF, EC_WORD_GO, EC_WORD_AWAY, EC_WORD_EXCL}, + .speechAfter = {EC_WORD_WAAAH, EC_WORD_EXCL, EC_EMPTY_WORD, EC_WORD_GO, EC_WORD_AWAY, EC_WORD_EXCL}, .mons = { [0] = @@ -5410,7 +5410,7 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .facilityClass = FACILITY_CLASS_PKMN_RANGER_M, .unused = 0, .speechBefore = {EC_WORD_WAHAHAHA, EC_WORD_YOU, EC_WORD_CAN_T, EC_WORD_STOP, EC_WORD_ME, EC_WORD_EXCL}, - .speechWin = {EC_WORD_WOWEE, EC_WORD_EXCL, 0xFFFF, EC_WORD_I_AM, EC_WORD_AWESOME, EC_WORD_COOL}, + .speechWin = {EC_WORD_WOWEE, EC_WORD_EXCL, EC_EMPTY_WORD, EC_WORD_I_AM, EC_WORD_AWESOME, EC_WORD_COOL}, .speechLose = {EC_WORD_I_AM, EC_WORD_NOT, EC_WORD_COOL, EC_WORD_AT, EC_WORD_ALL, EC_WORD_EXCL}, .speechAfter = {EC_WORD_HEHEHE, EC_WORD_THAT_WAS, EC_WORD_AN, EC_WORD_AWESOME, EC_WORD_BATTLE, EC_WORD_EXCL}, .mons = diff --git a/src/data/easy_chat/easy_chat_words_by_letter.h b/src/data/easy_chat/easy_chat_words_by_letter.h index 927b9db2f..a56e3184f 100755 --- a/src/data/easy_chat/easy_chat_words_by_letter.h +++ b/src/data/easy_chat/easy_chat_words_by_letter.h @@ -1,6 +1,8 @@ #include "easy_chat.h" #include "constants/easy_chat.h" +#define DOUBLE_SPECIES_NAME EC_EMPTY_WORD, 2, + const u16 gEasyChatWordsByLetter_Others[] = { EC_WORD_EXCL, EC_WORD_EXCL_EXCL, @@ -21,9 +23,9 @@ const u16 gEasyChatWordsByLetter_A[] = { EC_WORD_A_TINY_BIT, EC_WORD_ABOUT, EC_WORD_ABOVE, - -1, 2, // Doubled pokemon species name + DOUBLE_SPECIES_NAME EC_POKEMON(ABRA), - EC_POKEMON2(ABRA), + EC_POKEMON_NATIONAL(ABRA), EC_WORD_ABSENT, EC_POKEMON(ABSOL), EC_WORD_ABSOLUTELY, @@ -36,7 +38,7 @@ const u16 gEasyChatWordsByLetter_A[] = { EC_WORD_ADVENTURE, EC_MOVE2(AERIAL_ACE), EC_MOVE(AEROBLAST), - EC_POKEMON2(AERODACTYL), + EC_POKEMON_NATIONAL(AERODACTYL), EC_WORD_AFTER, EC_WORD_AGE, EC_POKEMON(AGGRON), @@ -44,13 +46,13 @@ const u16 gEasyChatWordsByLetter_A[] = { EC_WORD_AGREE, EC_WORD_AHAHA, EC_WORD_AIM, - EC_POKEMON2(AIPOM), + EC_POKEMON_NATIONAL(AIPOM), EC_MOVE(AIR_CUTTER), EC_WORD_AIR_LOCK, EC_WORD_AIYEEH, - -1, 2, // Doubled pokemon species name + DOUBLE_SPECIES_NAME EC_POKEMON(ALAKAZAM), - EC_POKEMON2(ALAKAZAM), + EC_POKEMON_NATIONAL(ALAKAZAM), EC_WORD_ALL, EC_WORD_ALL_RIGHT, EC_WORD_ALLOW, @@ -65,7 +67,7 @@ const u16 gEasyChatWordsByLetter_A[] = { EC_WORD_ALWAYS, EC_WORD_AM, EC_MOVE2(AMNESIA), - EC_POKEMON2(AMPHAROS), + EC_POKEMON_NATIONAL(AMPHAROS), EC_WORD_AMUSING, EC_WORD_AN, EC_MOVE(ANCIENT_POWER), @@ -85,19 +87,19 @@ const u16 gEasyChatWordsByLetter_A[] = { EC_WORD_APPEARS, EC_WORD_APPRECIATE, EC_WORD_APPROVED, - EC_POKEMON2(ARBOK), - EC_POKEMON2(ARCANINE), + EC_POKEMON_NATIONAL(ARBOK), + EC_POKEMON_NATIONAL(ARCANINE), EC_WORD_ARE, EC_WORD_AREN_T, EC_WORD_ARENA_TRAP, - EC_POKEMON2(ARIADOS), + EC_POKEMON_NATIONAL(ARIADOS), EC_MOVE2(ARM_THRUST), EC_POKEMON(ARMALDO), EC_MOVE(AROMATHERAPY), EC_POKEMON(ARON), EC_WORD_AROUND, EC_WORD_ARRGH, - EC_POKEMON2(ARTICUNO), + EC_POKEMON_NATIONAL(ARTICUNO), EC_WORD_AS, EC_WORD_AS_IF, EC_WORD_AS_MUCH_AS, @@ -114,9 +116,9 @@ const u16 gEasyChatWordsByLetter_A[] = { EC_WORD_AWFUL, EC_WORD_AWFULLY, EC_WORD_AWW, - -1, 2, // Doubled pokemon species name + DOUBLE_SPECIES_NAME EC_POKEMON(AZUMARILL), - EC_POKEMON2(AZUMARILL), + EC_POKEMON_NATIONAL(AZUMARILL), EC_POKEMON(AZURILL), }; @@ -141,7 +143,7 @@ const u16 gEasyChatWordsByLetter_B[] = { EC_WORD_BATTLE_ARMOR, EC_WORD_BATTLE_ROOM, EC_WORD_BATTLE_TOWER, - EC_POKEMON2(BAYLEEF), + EC_POKEMON_NATIONAL(BAYLEEF), EC_WORD_BE, EC_WORD_BEAT, EC_MOVE2(BEAT_UP), @@ -149,17 +151,17 @@ const u16 gEasyChatWordsByLetter_B[] = { EC_WORD_BEAUTIFUL, EC_WORD_BEAUTY, EC_WORD_BECOMES, - EC_POKEMON2(BEEDRILL), + EC_POKEMON_NATIONAL(BEEDRILL), EC_WORD_BEEN, EC_WORD_BEFORE, EC_WORD_BEGINNING, EC_WORD_BEING, EC_POKEMON(BELDUM), EC_WORD_BELIEVE, - -1, 2, // Doubled pokemon species name + DOUBLE_SPECIES_NAME EC_POKEMON(BELLOSSOM), - EC_POKEMON2(BELLOSSOM), - EC_POKEMON2(BELLSPROUT), + EC_POKEMON_NATIONAL(BELLOSSOM), + EC_POKEMON_NATIONAL(BELLSPROUT), EC_MOVE2(BELLY_DRUM), EC_WORD_BELONGS_TO, EC_WORD_BELOW, @@ -173,12 +175,12 @@ const u16 gEasyChatWordsByLetter_B[] = { EC_MOVE(BIND), EC_MOVE(BITE), EC_MOVE2(BLAST_BURN), - EC_POKEMON2(BLASTOISE), + EC_POKEMON_NATIONAL(BLASTOISE), EC_WORD_BLAZE, EC_MOVE2(BLAZE_KICK), EC_POKEMON(BLAZIKEN), EC_WORD_BLEND, - EC_POKEMON2(BLISSEY), + EC_POKEMON_NATIONAL(BLISSEY), EC_MOVE2(BLIZZARD), EC_MOVE2(BLOCK), EC_WORD_BOARD, @@ -199,12 +201,12 @@ const u16 gEasyChatWordsByLetter_B[] = { EC_MOVE(BUBBLE), EC_MOVE2(BUBBLE_BEAM), EC_WORD_BUG, - EC_POKEMON2(BULBASAUR), + EC_POKEMON_NATIONAL(BULBASAUR), EC_MOVE2(BULK_UP), EC_MOVE2(BULLET_SEED), EC_WORD_BUSY, EC_WORD_BUT, - EC_POKEMON2(BUTTERFREE), + EC_POKEMON_NATIONAL(BUTTERFREE), EC_WORD_BYE_BYE, }; @@ -229,27 +231,27 @@ const u16 gEasyChatWordsByLetter_C[] = { EC_POKEMON(CASCOON), EC_WORD_CASE, EC_POKEMON(CASTFORM), - EC_POKEMON2(CATERPIE), + EC_POKEMON_NATIONAL(CATERPIE), EC_WORD_CAUSE, - EC_POKEMON2(CELEBI), + EC_POKEMON_NATIONAL(CELEBI), EC_WORD_CENTER, EC_WORD_CHALLENGE, EC_WORD_CHANGE, EC_WORD_CHANNEL, - EC_POKEMON2(CHANSEY), + EC_POKEMON_NATIONAL(CHANSEY), EC_MOVE(CHARGE), - EC_POKEMON2(CHARIZARD), + EC_POKEMON_NATIONAL(CHARIZARD), EC_MOVE(CHARM), - EC_POKEMON2(CHARMANDER), - EC_POKEMON2(CHARMELEON), + EC_POKEMON_NATIONAL(CHARMANDER), + EC_POKEMON_NATIONAL(CHARMELEON), EC_WORD_CHAT, - EC_POKEMON2(CHIKORITA), + EC_POKEMON_NATIONAL(CHIKORITA), EC_WORD_CHILD_S_PLAY, EC_WORD_CHILDREN, EC_POKEMON(CHIMECHO), - -1, 2, // Doubled pokemon species name + DOUBLE_SPECIES_NAME EC_POKEMON(CHINCHOU), - EC_POKEMON2(CHINCHOU), + EC_POKEMON_NATIONAL(CHINCHOU), EC_WORD_CHLOROPHYLL, EC_WORD_CHOICE, EC_WORD_CHOOSE, @@ -259,12 +261,12 @@ const u16 gEasyChatWordsByLetter_C[] = { EC_WORD_CLASS, EC_POKEMON(CLAYDOL), EC_WORD_CLEAR_BODY, - EC_POKEMON2(CLEFABLE), - EC_POKEMON2(CLEFAIRY), - EC_POKEMON2(CLEFFA), + EC_POKEMON_NATIONAL(CLEFABLE), + EC_POKEMON_NATIONAL(CLEFAIRY), + EC_POKEMON_NATIONAL(CLEFFA), EC_WORD_CLOSE, EC_WORD_CLOUD_NINE, - EC_POKEMON2(CLOYSTER), + EC_POKEMON_NATIONAL(CLOYSTER), EC_WORD_COLD, EC_WORD_COLLECT, EC_WORD_COLLECTION, @@ -293,9 +295,9 @@ const u16 gEasyChatWordsByLetter_C[] = { EC_WORD_COOLNESS, EC_POKEMON(CORPHISH), EC_WORD_CORRECT, - -1, 2, // Doubled pokemon species name + DOUBLE_SPECIES_NAME EC_POKEMON(CORSOLA), - EC_POKEMON2(CORSOLA), + EC_POKEMON_NATIONAL(CORSOLA), EC_MOVE(COSMIC_POWER), EC_MOVE2(COTTON_SPORE), EC_WORD_COULD, @@ -308,23 +310,23 @@ const u16 gEasyChatWordsByLetter_C[] = { EC_POKEMON(CRADILY), EC_POKEMON(CRAWDAUNT), EC_WORD_CRIES, - -1, 2, // Doubled pokemon species name + DOUBLE_SPECIES_NAME EC_POKEMON(CROBAT), - EC_POKEMON2(CROBAT), - EC_POKEMON2(CROCONAW), + EC_POKEMON_NATIONAL(CROBAT), + EC_POKEMON_NATIONAL(CROCONAW), EC_MOVE(CROSS_CHOP), EC_MOVE(CRUNCH), EC_WORD_CRUSH, EC_MOVE2(CRUSH_CLAW), EC_WORD_CRY, - EC_POKEMON2(CUBONE), + EC_POKEMON_NATIONAL(CUBONE), EC_WORD_CURRENT, EC_MOVE2(CURSE), EC_MOVE(CUT), EC_WORD_CUTE, EC_WORD_CUTE_CHARM, EC_WORD_CUTENESS, - EC_POKEMON2(CYNDAQUIL), + EC_POKEMON_NATIONAL(CYNDAQUIL), }; const u16 gEasyChatWordsByLetter_D[] = { @@ -345,7 +347,7 @@ const u16 gEasyChatWordsByLetter_D[] = { EC_WORD_DEFEATED, EC_MOVE2(DEFENSE_CURL), EC_POKEMON(DELCATTY), - EC_POKEMON2(DELIBIRD), + EC_POKEMON_NATIONAL(DELIBIRD), EC_POKEMON(DEOXYS), EC_WORD_DEPT_STORE, EC_WORD_DESIGN, @@ -353,14 +355,14 @@ const u16 gEasyChatWordsByLetter_D[] = { EC_MOVE2(DESTINY_BOND), EC_WORD_DESTROYED, EC_MOVE2(DETECT), - EC_POKEMON2(DEWGONG), + EC_POKEMON_NATIONAL(DEWGONG), EC_WORD_DID, EC_WORD_DIDN_T, EC_WORD_DIET, EC_WORD_DIFFERENT, EC_MOVE(DIG), EC_WORD_DIGITAL, - EC_POKEMON2(DIGLETT), + EC_POKEMON_NATIONAL(DIGLETT), EC_WORD_DIRECT, EC_MOVE(DISABLE), EC_WORD_DISAPPEAR, @@ -370,24 +372,24 @@ const u16 gEasyChatWordsByLetter_D[] = { EC_WORD_DISASTER, EC_WORD_DISLIKE, EC_WORD_DISLIKES, - EC_POKEMON2(DITTO), + EC_POKEMON_NATIONAL(DITTO), EC_MOVE2(DIVE), EC_MOVE2(DIZZY_PUNCH), EC_WORD_DO, EC_WORD_DOCILE, - -1, 2, // Doubled pokemon species name + DOUBLE_SPECIES_NAME EC_POKEMON(DODRIO), - EC_POKEMON2(DODRIO), - -1, 2, // Doubled pokemon species name + EC_POKEMON_NATIONAL(DODRIO), + DOUBLE_SPECIES_NAME EC_POKEMON(DODUO), - EC_POKEMON2(DODUO), + EC_POKEMON_NATIONAL(DODUO), EC_WORD_DOES, EC_WORD_DOESN_T, EC_WORD_DON_T, EC_WORD_DONE, - -1, 2, // Doubled pokemon species name + DOUBLE_SPECIES_NAME EC_POKEMON(DONPHAN), - EC_POKEMON2(DONPHAN), + EC_POKEMON_NATIONAL(DONPHAN), EC_MOVE2(DOOM_DESIRE), EC_MOVE2(DOUBLE_KICK), EC_MOVE(DOUBLE_TEAM), @@ -399,10 +401,10 @@ const u16 gEasyChatWordsByLetter_D[] = { EC_MOVE2(DRAGON_CLAW), EC_MOVE2(DRAGON_DANCE), EC_MOVE2(DRAGON_RAGE), - EC_POKEMON2(DRAGONAIR), + EC_POKEMON_NATIONAL(DRAGONAIR), EC_MOVE2(DRAGON_BREATH), - EC_POKEMON2(DRAGONITE), - EC_POKEMON2(DRATINI), + EC_POKEMON_NATIONAL(DRAGONITE), + EC_POKEMON_NATIONAL(DRATINI), EC_WORD_DREAM, EC_MOVE2(DREAM_EATER), EC_MOVE2(DRILL_PECK), @@ -411,10 +413,10 @@ const u16 gEasyChatWordsByLetter_D[] = { EC_WORD_DRIZZLE, EC_WORD_DROOLING, EC_WORD_DROUGHT, - EC_POKEMON2(DROWZEE), + EC_POKEMON_NATIONAL(DROWZEE), EC_WORD_DUDE, - EC_POKEMON2(DUGTRIO), - EC_POKEMON2(DUNSPARCE), + EC_POKEMON_NATIONAL(DUGTRIO), + EC_POKEMON_NATIONAL(DUNSPARCE), EC_POKEMON(DUSCLOPS), EC_POKEMON(DUSKULL), EC_POKEMON(DUSTOX), @@ -429,20 +431,20 @@ const u16 gEasyChatWordsByLetter_E[] = { EC_WORD_EAT, EC_WORD_EATS, EC_WORD_EEK, - EC_POKEMON2(EEVEE), + EC_POKEMON_NATIONAL(EEVEE), EC_WORD_EFFECT_SPORE, EC_WORD_EGG, EC_MOVE2(EGG_BOMB), EC_WORD_EH_QUES, EC_WORD_EHEHE, - EC_POKEMON2(EKANS), - EC_POKEMON2(ELECTABUZZ), + EC_POKEMON_NATIONAL(EKANS), + EC_POKEMON_NATIONAL(ELECTABUZZ), EC_WORD_ELECTRIC, EC_POKEMON(ELECTRIKE), - -1, 2, // Doubled pokemon species name + DOUBLE_SPECIES_NAME EC_POKEMON(ELECTRODE), - EC_POKEMON2(ELECTRODE), - EC_POKEMON2(ELEKID), + EC_POKEMON_NATIONAL(ELECTRODE), + EC_POKEMON_NATIONAL(ELEKID), EC_WORD_ELSE, EC_MOVE2(EMBER), EC_WORD_EMERALD, @@ -454,11 +456,11 @@ const u16 gEasyChatWordsByLetter_E[] = { EC_WORD_ENJOY, EC_WORD_ENJOYS, EC_WORD_ENOUGH, - EC_POKEMON2(ENTEI), + EC_POKEMON_NATIONAL(ENTEI), EC_WORD_ENTERTAINING, EC_MOVE2(ERUPTION), EC_WORD_ESCAPE, - EC_POKEMON2(ESPEON), + EC_POKEMON_NATIONAL(ESPEON), EC_WORD_EVEN_SO, EC_WORD_EVENT, EC_WORD_EVENTS, @@ -472,8 +474,8 @@ const u16 gEasyChatWordsByLetter_E[] = { EC_WORD_EXCITING, EC_WORD_EXCUSE, EC_WORD_EXCUSE_ME, - EC_POKEMON2(EXEGGCUTE), - EC_POKEMON2(EXEGGUTOR), + EC_POKEMON_NATIONAL(EXEGGCUTE), + EC_POKEMON_NATIONAL(EXEGGUTOR), EC_WORD_EXISTS, EC_WORD_EXPENSIVE, EC_MOVE2(EXPLOSION), @@ -495,16 +497,16 @@ const u16 gEasyChatWordsByLetter_F[] = { EC_WORD_FAMILY, EC_WORD_FANTASTIC, EC_WORD_FAR, - EC_POKEMON2(FARFETCHD), + EC_POKEMON_NATIONAL(FARFETCHD), EC_WORD_FASHION, EC_WORD_FAST, EC_WORD_FATHER, EC_WORD_FEAR, - EC_POKEMON2(FEAROW), + EC_POKEMON_NATIONAL(FEAROW), EC_MOVE2(FEATHER_DANCE), EC_POKEMON(FEEBAS), EC_WORD_FEELING, - EC_POKEMON2(FERALIGATR), + EC_POKEMON_NATIONAL(FERALIGATR), EC_WORD_FESTIVAL, EC_WORD_FEVER, EC_WORD_FIERY, @@ -520,13 +522,13 @@ const u16 gEasyChatWordsByLetter_F[] = { EC_MOVE2(FIRE_SPIN), EC_WORD_FISHING, EC_MOVE(FISSURE), - EC_POKEMON2(FLAAFFY), + EC_POKEMON_NATIONAL(FLAAFFY), EC_MOVE(FLAIL), EC_WORD_FLAME, EC_WORD_FLAME_BODY, EC_MOVE(FLAME_WHEEL), EC_MOVE(FLAMETHROWER), - EC_POKEMON2(FLAREON), + EC_POKEMON_NATIONAL(FLAREON), EC_MOVE2(FLASH), EC_WORD_FLASH_FIRE, EC_WORD_FLATTEN, @@ -547,7 +549,7 @@ const u16 gEasyChatWordsByLetter_F[] = { EC_WORD_FORGET, EC_WORD_FORGETS, EC_WORD_FORGIVE, - EC_POKEMON2(FORRETRESS), + EC_POKEMON_NATIONAL(FORRETRESS), EC_MOVE2(FRENZY_PLANT), EC_WORD_FRIDAY, EC_WORD_FRIEND, @@ -558,7 +560,7 @@ const u16 gEasyChatWordsByLetter_F[] = { EC_WORD_FUFUFU, EC_WORD_FULL, EC_WORD_FUNNY, - EC_POKEMON2(FURRET), + EC_POKEMON_NATIONAL(FURRET), EC_MOVE2(FURY_ATTACK), EC_MOVE2(FURY_CUTTER), EC_MOVE2(FURY_SWIPES), @@ -568,12 +570,12 @@ const u16 gEasyChatWordsByLetter_F[] = { const u16 gEasyChatWordsByLetter_G[] = { EC_WORD_GAME, EC_POKEMON(GARDEVOIR), - EC_POKEMON2(GASTLY), - EC_POKEMON2(GENGAR), + EC_POKEMON_NATIONAL(GASTLY), + EC_POKEMON_NATIONAL(GENGAR), EC_WORD_GENIUS, - -1, 2, // Doubled pokemon species name + DOUBLE_SPECIES_NAME EC_POKEMON(GEODUDE), - EC_POKEMON2(GEODUDE), + EC_POKEMON_NATIONAL(GEODUDE), EC_WORD_GET, EC_WORD_GETS, EC_WORD_GHOST, @@ -581,9 +583,9 @@ const u16 gEasyChatWordsByLetter_G[] = { EC_MOVE(GIGA_DRAIN), EC_WORD_GIGGLE, EC_WORD_GIMME, - -1, 2, // Doubled pokemon species name + DOUBLE_SPECIES_NAME EC_POKEMON(GIRAFARIG), - EC_POKEMON2(GIRAFARIG), + EC_POKEMON_NATIONAL(GIRAFARIG), EC_WORD_GIRL, EC_WORD_GIVE, EC_WORD_GIVE_ME, @@ -591,29 +593,29 @@ const u16 gEasyChatWordsByLetter_G[] = { EC_WORD_GIVES, EC_POKEMON(GLALIE), EC_MOVE2(GLARE), - EC_POKEMON2(GLIGAR), - -1, 2, // Doubled pokemon species name + EC_POKEMON_NATIONAL(GLIGAR), + DOUBLE_SPECIES_NAME EC_POKEMON(GLOOM), - EC_POKEMON2(GLOOM), + EC_POKEMON_NATIONAL(GLOOM), EC_WORD_GO, EC_WORD_GO_AHEAD, EC_WORD_GO_EASY, EC_WORD_GO_HOME, EC_WORD_GOES, EC_WORD_GOING, - -1, 2, // Doubled pokemon species name + DOUBLE_SPECIES_NAME EC_POKEMON(GOLBAT), - EC_POKEMON2(GOLBAT), + EC_POKEMON_NATIONAL(GOLBAT), EC_WORD_GOLD, - -1, 2, // Doubled pokemon species name + DOUBLE_SPECIES_NAME EC_POKEMON(GOLDEEN), - EC_POKEMON2(GOLDEEN), - -1, 2, // Doubled pokemon species name + EC_POKEMON_NATIONAL(GOLDEEN), + DOUBLE_SPECIES_NAME EC_POKEMON(GOLDUCK), - EC_POKEMON2(GOLDUCK), - -1, 2, // Doubled pokemon species name + EC_POKEMON_NATIONAL(GOLDUCK), + DOUBLE_SPECIES_NAME EC_POKEMON(GOLEM), - EC_POKEMON2(GOLEM), + EC_POKEMON_NATIONAL(GOLEM), EC_WORD_GOOD, EC_WORD_GOOD_BYE, EC_POKEMON(GOREBYSS), @@ -621,25 +623,25 @@ const u16 gEasyChatWordsByLetter_G[] = { EC_WORD_GOTCHA, EC_WORD_GOURMET, EC_WORD_GRAAAH, - EC_POKEMON2(GRANBULL), + EC_POKEMON_NATIONAL(GRANBULL), EC_WORD_GRANDFATHER, EC_WORD_GRANDMOTHER, EC_WORD_GRASS, EC_MOVE(GRASS_WHISTLE), - -1, 2, // Doubled pokemon species name + DOUBLE_SPECIES_NAME EC_POKEMON(GRAVELER), - EC_POKEMON2(GRAVELER), + EC_POKEMON_NATIONAL(GRAVELER), EC_WORD_GREAT, EC_WORD_GREEN, - -1, 2, // Doubled pokemon species name + DOUBLE_SPECIES_NAME EC_POKEMON(GRIMER), - EC_POKEMON2(GRIMER), + EC_POKEMON_NATIONAL(GRIMER), EC_POKEMON(GROUDON), EC_WORD_GROUND, EC_WORD_GROUP, EC_POKEMON(GROVYLE), EC_MOVE2(GROWL), - EC_POKEMON2(GROWLITHE), + EC_POKEMON_NATIONAL(GROWLITHE), EC_MOVE(GROWTH), EC_MOVE(GRUDGE), EC_POKEMON(GRUMPIG), @@ -651,9 +653,9 @@ const u16 gEasyChatWordsByLetter_G[] = { EC_WORD_GUTSY, EC_WORD_GWAH, EC_WORD_GWAHAHAHA, - -1, 2, // Doubled pokemon species name + DOUBLE_SPECIES_NAME EC_POKEMON(GYARADOS), - EC_POKEMON2(GYARADOS), + EC_POKEMON_NATIONAL(GYARADOS), }; const u16 gEasyChatWordsByLetter_H[] = { @@ -671,7 +673,7 @@ const u16 gEasyChatWordsByLetter_H[] = { EC_POKEMON(HARIYAMA), EC_WORD_HAS, EC_WORD_HASSLE, - EC_POKEMON2(HAUNTER), + EC_POKEMON_NATIONAL(HAUNTER), EC_WORD_HAVE, EC_WORD_HAVEN_T, EC_MOVE(HAZE), @@ -691,9 +693,9 @@ const u16 gEasyChatWordsByLetter_H[] = { EC_WORD_HELLO, EC_MOVE2(HELPING_HAND), EC_WORD_HER, - -1, 2, // Doubled pokemon species name + DOUBLE_SPECIES_NAME EC_POKEMON(HERACROSS), - EC_POKEMON2(HERACROSS), + EC_POKEMON_NATIONAL(HERACROSS), EC_WORD_HERE, EC_WORD_HERE_GOES, EC_WORD_HERE_I_COME, @@ -714,28 +716,28 @@ const u16 gEasyChatWordsByLetter_H[] = { EC_WORD_HIP_AND, EC_WORD_HIS, EC_WORD_HIT, - EC_POKEMON2(HITMONCHAN), - EC_POKEMON2(HITMONLEE), - EC_POKEMON2(HITMONTOP), + EC_POKEMON_NATIONAL(HITMONCHAN), + EC_POKEMON_NATIONAL(HITMONLEE), + EC_POKEMON_NATIONAL(HITMONTOP), EC_WORD_HIYAH, EC_WORD_HMM, - EC_POKEMON2(HO_OH), + EC_POKEMON_NATIONAL(HO_OH), EC_WORD_HOBBY, EC_WORD_HOHOHO, EC_WORD_HOLIDAY, EC_WORD_HOME, EC_WORD_HOO_HAH, - EC_POKEMON2(HOOTHOOT), + EC_POKEMON_NATIONAL(HOOTHOOT), EC_WORD_HOPELESS, - EC_POKEMON2(HOPPIP), + EC_POKEMON_NATIONAL(HOPPIP), EC_MOVE2(HORN_ATTACK), EC_MOVE2(HORN_DRILL), - -1, 2, // Doubled pokemon species name + DOUBLE_SPECIES_NAME EC_POKEMON(HORSEA), - EC_POKEMON2(HORSEA), + EC_POKEMON_NATIONAL(HORSEA), EC_WORD_HOT, - EC_POKEMON2(HOUNDOOM), - EC_POKEMON2(HOUNDOUR), + EC_POKEMON_NATIONAL(HOUNDOOM), + EC_POKEMON_NATIONAL(HOUNDOUR), EC_WORD_HOW, EC_WORD_HOW_DO, EC_WORD_HOWEVER, @@ -754,7 +756,7 @@ const u16 gEasyChatWordsByLetter_H[] = { EC_WORD_HYPER_CUTTER, EC_MOVE2(HYPER_FANG), EC_MOVE2(HYPER_VOICE), - EC_POKEMON2(HYPNO), + EC_POKEMON_NATIONAL(HYPNO), EC_MOVE(HYPNOSIS), }; @@ -775,9 +777,9 @@ const u16 gEasyChatWordsByLetter_I[] = { EC_WORD_IF, EC_WORD_IF_I_LOSE, EC_WORD_IF_I_WIN, - -1, 2, // Doubled pokemon species name + DOUBLE_SPECIES_NAME EC_POKEMON(IGGLYBUFF), - EC_POKEMON2(IGGLYBUFF), + EC_POKEMON_NATIONAL(IGGLYBUFF), EC_WORD_IGNORANT, EC_WORD_ILLUMINATE, EC_POKEMON(ILLUMISE), @@ -805,32 +807,32 @@ const u16 gEasyChatWordsByLetter_I[] = { EC_WORD_IT, EC_WORD_IT_S, EC_WORD_ITEM, - EC_POKEMON2(IVYSAUR), + EC_POKEMON_NATIONAL(IVYSAUR), }; const u16 gEasyChatWordsByLetter_J[] = { - -1, 2, // Doubled pokemon species name + DOUBLE_SPECIES_NAME EC_POKEMON(JIGGLYPUFF), - EC_POKEMON2(JIGGLYPUFF), + EC_POKEMON_NATIONAL(JIGGLYPUFF), EC_POKEMON(JIRACHI), EC_WORD_JOKING, - EC_POKEMON2(JOLTEON), + EC_POKEMON_NATIONAL(JOLTEON), EC_WORD_JOY, EC_WORD_JUDGE, EC_MOVE2(JUMP_KICK), - EC_POKEMON2(JUMPLUFF), + EC_POKEMON_NATIONAL(JUMPLUFF), EC_WORD_JUST, - EC_POKEMON2(JYNX), + EC_POKEMON_NATIONAL(JYNX), }; const u16 gEasyChatWordsByLetter_K[] = { - EC_POKEMON2(KABUTO), - EC_POKEMON2(KABUTOPS), - -1, 2, // Doubled pokemon species name + EC_POKEMON_NATIONAL(KABUTO), + EC_POKEMON_NATIONAL(KABUTOPS), + DOUBLE_SPECIES_NAME EC_POKEMON(KADABRA), - EC_POKEMON2(KADABRA), - EC_POKEMON2(KAKUNA), - EC_POKEMON2(KANGASKHAN), + EC_POKEMON_NATIONAL(KADABRA), + EC_POKEMON_NATIONAL(KAKUNA), + EC_POKEMON_NATIONAL(KANGASKHAN), EC_MOVE(KARATE_CHOP), EC_POKEMON(KECLEON), EC_WORD_KEEN_EYE, @@ -839,19 +841,19 @@ const u16 gEasyChatWordsByLetter_K[] = { EC_WORD_KIND, EC_WORD_KINDERGARTEN, EC_MOVE(KINESIS), - -1, 2, // Doubled pokemon species name + DOUBLE_SPECIES_NAME EC_POKEMON(KINGDRA), - EC_POKEMON2(KINGDRA), - EC_POKEMON2(KINGLER), + EC_POKEMON_NATIONAL(KINGDRA), + EC_POKEMON_NATIONAL(KINGLER), EC_POKEMON(KIRLIA), EC_MOVE2(KNOCK_OFF), EC_WORD_KNOCKOUT, EC_WORD_KNOW, EC_WORD_KNOWS, - -1, 2, // Doubled pokemon species name + DOUBLE_SPECIES_NAME EC_POKEMON(KOFFING), - EC_POKEMON2(KOFFING), - EC_POKEMON2(KRABBY), + EC_POKEMON_NATIONAL(KOFFING), + EC_POKEMON_NATIONAL(KRABBY), EC_WORD_KTHX_BYE, EC_POKEMON(KYOGRE), }; @@ -862,11 +864,11 @@ const u16 gEasyChatWordsByLetter_L[] = { EC_WORD_LADY, EC_POKEMON(LAIRON), EC_WORD_LALALA, - -1, 2, // Doubled pokemon species name + DOUBLE_SPECIES_NAME EC_POKEMON(LANTURN), - EC_POKEMON2(LANTURN), - EC_POKEMON2(LAPRAS), - EC_POKEMON2(LARVITAR), + EC_POKEMON_NATIONAL(LANTURN), + EC_POKEMON_NATIONAL(LAPRAS), + EC_POKEMON_NATIONAL(LARVITAR), EC_WORD_LAST, EC_WORD_LATE, EC_WORD_LATER, @@ -879,8 +881,8 @@ const u16 gEasyChatWordsByLetter_L[] = { EC_WORD_LEAF, EC_MOVE2(LEAF_BLADE), EC_WORD_LEARN, - EC_POKEMON2(LEDIAN), - EC_POKEMON2(LEDYBA), + EC_POKEMON_NATIONAL(LEDIAN), + EC_POKEMON_NATIONAL(LEDYBA), EC_MOVE(LEECH_LIFE), EC_MOVE2(LEECH_SEED), EC_MOVE2(LEER), @@ -894,7 +896,7 @@ const u16 gEasyChatWordsByLetter_L[] = { EC_WORD_LEVEL, EC_WORD_LEVITATE, EC_MOVE(LICK), - EC_POKEMON2(LICKITUNG), + EC_POKEMON_NATIONAL(LICKITUNG), EC_WORD_LIE, EC_WORD_LIFE, EC_MOVE2(LIGHT_SCREEN), @@ -933,7 +935,7 @@ const u16 gEasyChatWordsByLetter_L[] = { EC_MOVE(LOW_KICK), EC_WORD_LOWS, EC_POKEMON(LUDICOLO), - EC_POKEMON2(LUGIA), + EC_POKEMON_NATIONAL(LUGIA), EC_WORD_LUKEWARM, EC_POKEMON(LUNATONE), EC_MOVE2(LUSTER_PURGE), @@ -942,35 +944,35 @@ const u16 gEasyChatWordsByLetter_L[] = { const u16 gEasyChatWordsByLetter_M[] = { EC_MOVE2(MACH_PUNCH), - -1, 2, // Doubled pokemon species name + DOUBLE_SPECIES_NAME EC_POKEMON(MACHAMP), - EC_POKEMON2(MACHAMP), + EC_POKEMON_NATIONAL(MACHAMP), EC_WORD_MACHINE, - -1, 2, // Doubled pokemon species name + DOUBLE_SPECIES_NAME EC_POKEMON(MACHOKE), - EC_POKEMON2(MACHOKE), - -1, 2, // Doubled pokemon species name + EC_POKEMON_NATIONAL(MACHOKE), + DOUBLE_SPECIES_NAME EC_POKEMON(MACHOP), - EC_POKEMON2(MACHOP), + EC_POKEMON_NATIONAL(MACHOP), EC_WORD_MAGAZINE, - EC_POKEMON2(MAGBY), - -1, 2, // Doubled pokemon species name + EC_POKEMON_NATIONAL(MAGBY), + DOUBLE_SPECIES_NAME EC_POKEMON(MAGCARGO), - EC_POKEMON2(MAGCARGO), + EC_POKEMON_NATIONAL(MAGCARGO), EC_MOVE2(MAGIC_COAT), EC_MOVE2(MAGICAL_LEAF), - -1, 2, // Doubled pokemon species name + DOUBLE_SPECIES_NAME EC_POKEMON(MAGIKARP), - EC_POKEMON2(MAGIKARP), + EC_POKEMON_NATIONAL(MAGIKARP), EC_WORD_MAGMA_ARMOR, - EC_POKEMON2(MAGMAR), - -1, 2, // Doubled pokemon species name + EC_POKEMON_NATIONAL(MAGMAR), + DOUBLE_SPECIES_NAME EC_POKEMON(MAGNEMITE), - EC_POKEMON2(MAGNEMITE), + EC_POKEMON_NATIONAL(MAGNEMITE), EC_WORD_MAGNET_PULL, - -1, 2, // Doubled pokemon species name + DOUBLE_SPECIES_NAME EC_POKEMON(MAGNETON), - EC_POKEMON2(MAGNETON), + EC_POKEMON_NATIONAL(MAGNETON), EC_MOVE2(MAGNITUDE), EC_WORD_MAIL, EC_WORD_MAKE, @@ -978,13 +980,13 @@ const u16 gEasyChatWordsByLetter_M[] = { EC_POKEMON(MAKUHITA), EC_WORD_MAN, EC_POKEMON(MANECTRIC), - EC_POKEMON2(MANKEY), - EC_POKEMON2(MANTINE), - EC_POKEMON2(MAREEP), - -1, 2, // Doubled pokemon species name + EC_POKEMON_NATIONAL(MANKEY), + EC_POKEMON_NATIONAL(MANTINE), + EC_POKEMON_NATIONAL(MAREEP), + DOUBLE_SPECIES_NAME EC_POKEMON(MARILL), - EC_POKEMON2(MARILL), - EC_POKEMON2(MAROWAK), + EC_POKEMON_NATIONAL(MARILL), + EC_POKEMON_NATIONAL(MAROWAK), EC_POKEMON(MARSHTOMP), EC_WORD_MARVEL_SCALE, EC_POKEMON(MASQUERAIN), @@ -1008,23 +1010,23 @@ const u16 gEasyChatWordsByLetter_M[] = { EC_MOVE2(MEGA_KICK), EC_MOVE2(MEGA_PUNCH), EC_MOVE2(MEGAHORN), - EC_POKEMON2(MEGANIUM), + EC_POKEMON_NATIONAL(MEGANIUM), EC_MOVE(MEMENTO), - EC_POKEMON2(MEOWTH), + EC_POKEMON_NATIONAL(MEOWTH), EC_WORD_MESSAGE, EC_POKEMON(METAGROSS), EC_MOVE2(METAL_CLAW), EC_MOVE(METAL_SOUND), EC_POKEMON(METANG), - EC_POKEMON2(METAPOD), + EC_POKEMON_NATIONAL(METAPOD), EC_MOVE(METEOR_MASH), EC_MOVE2(METRONOME), - EC_POKEMON2(MEW), - EC_POKEMON2(MEWTWO), + EC_POKEMON_NATIONAL(MEW), + EC_POKEMON_NATIONAL(MEWTWO), EC_POKEMON(MIGHTYENA), EC_MOVE2(MILK_DRINK), EC_POKEMON(MILOTIC), - EC_POKEMON2(MILTANK), + EC_POKEMON_NATIONAL(MILTANK), EC_MOVE2(MIMIC), EC_MOVE(MIND_READER), EC_MOVE2(MINIMIZE), @@ -1032,7 +1034,7 @@ const u16 gEasyChatWordsByLetter_M[] = { EC_WORD_MINUS, EC_MOVE2(MIRROR_COAT), EC_MOVE(MIRROR_MOVE), - EC_POKEMON2(MISDREAVUS), + EC_POKEMON_NATIONAL(MISDREAVUS), EC_WORD_MISHEARD, EC_WORD_MISS, EC_MOVE(MIST), @@ -1041,7 +1043,7 @@ const u16 gEasyChatWordsByLetter_M[] = { EC_WORD_MMM, EC_WORD_MODE, EC_WORD_MODERN, - EC_POKEMON2(MOLTRES), + EC_POKEMON_NATIONAL(MOLTRES), EC_WORD_MOMENTUM, EC_WORD_MONDAY, EC_WORD_MONEY, @@ -1055,7 +1057,7 @@ const u16 gEasyChatWordsByLetter_M[] = { EC_WORD_MOVE, EC_WORD_MOVIE, EC_WORD_MR, - EC_POKEMON2(MR_MIME), + EC_POKEMON_NATIONAL(MR_MIME), EC_WORD_MRS, EC_WORD_MUCH, EC_WORD_MUCH_OBLIGED, @@ -1065,10 +1067,10 @@ const u16 gEasyChatWordsByLetter_M[] = { EC_MOVE2(MUDDY_WATER), EC_POKEMON(MUDKIP), EC_WORD_MUFUFU, - -1, 2, // Doubled pokemon species name + DOUBLE_SPECIES_NAME EC_POKEMON(MUK), - EC_POKEMON2(MUK), - EC_POKEMON2(MURKROW), + EC_POKEMON_NATIONAL(MUK), + EC_POKEMON_NATIONAL(MURKROW), EC_WORD_MUSIC, EC_WORD_MUST_BE, EC_WORD_MY, @@ -1079,9 +1081,9 @@ const u16 gEasyChatWordsByLetter_M[] = { const u16 gEasyChatWordsByLetter_N[] = { EC_WORD_NAME, EC_WORD_NAP, - -1, 2, // Doubled pokemon species name + DOUBLE_SPECIES_NAME EC_POKEMON(NATU), - EC_POKEMON2(NATU), + EC_POKEMON_NATIONAL(NATU), EC_WORD_NATURAL, EC_WORD_NATURAL_CURE, EC_WORD_NATURALLY, @@ -1097,26 +1099,26 @@ const u16 gEasyChatWordsByLetter_N[] = { EC_WORD_NEWS, EC_WORD_NEXT, EC_WORD_NICE, - EC_POKEMON2(NIDOKING), - EC_POKEMON2(NIDOQUEEN), - EC_POKEMON2(NIDORAN_F), - EC_POKEMON2(NIDORAN_M), - EC_POKEMON2(NIDORINA), - EC_POKEMON2(NIDORINO), + EC_POKEMON_NATIONAL(NIDOKING), + EC_POKEMON_NATIONAL(NIDOQUEEN), + EC_POKEMON_NATIONAL(NIDORAN_F), + EC_POKEMON_NATIONAL(NIDORAN_M), + EC_POKEMON_NATIONAL(NIDORINA), + EC_POKEMON_NATIONAL(NIDORINO), EC_WORD_NIGHT, EC_MOVE2(NIGHT_SHADE), EC_MOVE(NIGHTMARE), EC_WORD_NIGHTTIME, EC_POKEMON(NINCADA), - -1, 2, // Doubled pokemon species name + DOUBLE_SPECIES_NAME EC_POKEMON(NINETALES), - EC_POKEMON2(NINETALES), + EC_POKEMON_NATIONAL(NINETALES), EC_POKEMON(NINJASK), EC_WORD_NITWIT, EC_WORD_NO, EC_WORD_NO_MATCH, EC_WORD_NO_1, - EC_POKEMON2(NOCTOWL), + EC_POKEMON_NATIONAL(NOCTOWL), EC_WORD_NOISY, EC_WORD_NON_STOP, EC_WORD_NONE, @@ -1134,10 +1136,10 @@ const u16 gEasyChatWordsByLetter_N[] = { const u16 gEasyChatWordsByLetter_O[] = { EC_WORD_OBLIVIOUS, EC_MOVE(OCTAZOOKA), - EC_POKEMON2(OCTILLERY), - -1, 2, // Doubled pokemon species name + EC_POKEMON_NATIONAL(OCTILLERY), + DOUBLE_SPECIES_NAME EC_POKEMON(ODDISH), - EC_POKEMON2(ODDISH), + EC_POKEMON_NATIONAL(ODDISH), EC_MOVE(ODOR_SLEUTH), EC_WORD_OF, EC_WORD_OFF, @@ -1153,11 +1155,11 @@ const u16 gEasyChatWordsByLetter_O[] = { EC_WORD_OKAY, EC_WORD_OLD, EC_WORD_OLDEN, - EC_POKEMON2(OMANYTE), - EC_POKEMON2(OMASTAR), + EC_POKEMON_NATIONAL(OMANYTE), + EC_POKEMON_NATIONAL(OMASTAR), EC_WORD_ON, EC_WORD_ONCE, - EC_POKEMON2(ONIX), + EC_POKEMON_NATIONAL(ONIX), EC_WORD_ONLY, EC_WORD_OOPS, EC_WORD_OPPONENT, @@ -1179,8 +1181,8 @@ const u16 gEasyChatWordsByLetter_O[] = { const u16 gEasyChatWordsByLetter_P[] = { EC_MOVE(PAIN_SPLIT), - EC_POKEMON2(PARAS), - EC_POKEMON2(PARASECT), + EC_POKEMON_NATIONAL(PARAS), + EC_POKEMON_NATIONAL(PARASECT), EC_WORD_PARDON, EC_WORD_PARENT, EC_WORD_PARTNER, @@ -1193,29 +1195,29 @@ const u16 gEasyChatWordsByLetter_P[] = { EC_WORD_PERFECT, EC_WORD_PERFECTION, EC_MOVE2(PERISH_SONG), - EC_POKEMON2(PERSIAN), + EC_POKEMON_NATIONAL(PERSIAN), EC_WORD_PERSON, EC_MOVE2(PETAL_DANCE), - -1, 2, // Doubled pokemon species name + DOUBLE_SPECIES_NAME EC_POKEMON(PHANPY), - EC_POKEMON2(PHANPY), + EC_POKEMON_NATIONAL(PHANPY), EC_WORD_PHONE, - -1, 2, // Doubled pokemon species name + DOUBLE_SPECIES_NAME EC_POKEMON(PICHU), - EC_POKEMON2(PICHU), + EC_POKEMON_NATIONAL(PICHU), EC_WORD_PICKUP, - EC_POKEMON2(PIDGEOT), - EC_POKEMON2(PIDGEOTTO), - EC_POKEMON2(PIDGEY), - -1, 2, // Doubled pokemon species name + EC_POKEMON_NATIONAL(PIDGEOT), + EC_POKEMON_NATIONAL(PIDGEOTTO), + EC_POKEMON_NATIONAL(PIDGEY), + DOUBLE_SPECIES_NAME EC_POKEMON(PIKACHU), - EC_POKEMON2(PIKACHU), - EC_POKEMON2(PILOSWINE), + EC_POKEMON_NATIONAL(PIKACHU), + EC_POKEMON_NATIONAL(PILOSWINE), EC_MOVE2(PIN_MISSILE), - EC_POKEMON2(PINECO), - -1, 2, // Doubled pokemon species name + EC_POKEMON_NATIONAL(PINECO), + DOUBLE_SPECIES_NAME EC_POKEMON(PINSIR), - EC_POKEMON2(PINSIR), + EC_POKEMON_NATIONAL(PINSIR), EC_WORD_PKRS, EC_WORD_PLACE, EC_WORD_PLANS, @@ -1238,15 +1240,15 @@ const u16 gEasyChatWordsByLetter_P[] = { EC_WORD_POKEDEX, EC_WORD_POKEMON, EC_WORD_POKENAV, - EC_POKEMON2(POLITOED), - EC_POKEMON2(POLIWAG), - EC_POKEMON2(POLIWHIRL), - EC_POKEMON2(POLIWRATH), - EC_POKEMON2(PONYTA), + EC_POKEMON_NATIONAL(POLITOED), + EC_POKEMON_NATIONAL(POLIWAG), + EC_POKEMON_NATIONAL(POLIWHIRL), + EC_POKEMON_NATIONAL(POLIWRATH), + EC_POKEMON_NATIONAL(PONYTA), EC_POKEMON(POOCHYENA), EC_WORD_POPULAR, - EC_POKEMON2(PORYGON), - EC_POKEMON2(PORYGON2), + EC_POKEMON_NATIONAL(PORYGON), + EC_POKEMON_NATIONAL(PORYGON2), EC_MOVE2(POUND), EC_MOVE(POWDER_SNOW), EC_WORD_POWER, @@ -1256,52 +1258,52 @@ const u16 gEasyChatWordsByLetter_P[] = { EC_WORD_PRESSURE, EC_WORD_PRETEND, EC_WORD_PRETTY, - EC_POKEMON2(PRIMEAPE), + EC_POKEMON_NATIONAL(PRIMEAPE), EC_WORD_PROBABLY, EC_WORD_PROMISE, EC_MOVE2(PROTECT), EC_MOVE(PSYBEAM), EC_MOVE(PSYCH_UP), - -1, 2, // Doubled pokemon species name + DOUBLE_SPECIES_NAME EC_WORD_PSYCHIC, EC_MOVE(PSYCHIC), EC_MOVE(PSYCHO_BOOST), - -1, 2, // Doubled pokemon species name + DOUBLE_SPECIES_NAME EC_POKEMON(PSYDUCK), - EC_POKEMON2(PSYDUCK), + EC_POKEMON_NATIONAL(PSYDUCK), EC_MOVE(PSYWAVE), - EC_POKEMON2(PUPITAR), + EC_POKEMON_NATIONAL(PUPITAR), EC_WORD_PURE_POWER, EC_MOVE(PURSUIT), EC_WORD_PUSHOVER, }; const u16 gEasyChatWordsByLetter_Q[] = { - EC_POKEMON2(QUAGSIRE), + EC_POKEMON_NATIONAL(QUAGSIRE), EC_WORD_QUESTION, EC_MOVE2(QUICK_ATTACK), - EC_POKEMON2(QUILAVA), + EC_POKEMON_NATIONAL(QUILAVA), EC_WORD_QUITE, - EC_POKEMON2(QWILFISH), + EC_POKEMON_NATIONAL(QWILFISH), }; const u16 gEasyChatWordsByLetter_R[] = { EC_WORD_RADIO, EC_MOVE(RAGE), - -1, 2, // Doubled pokemon species name + DOUBLE_SPECIES_NAME EC_POKEMON(RAICHU), - EC_POKEMON2(RAICHU), - EC_POKEMON2(RAIKOU), + EC_POKEMON_NATIONAL(RAICHU), + EC_POKEMON_NATIONAL(RAIKOU), EC_MOVE(RAIN_DANCE), EC_WORD_RAIN_DISH, EC_POKEMON(RALTS), EC_WORD_RANK, EC_MOVE(RAPID_SPIN), - EC_POKEMON2(RAPIDASH), + EC_POKEMON_NATIONAL(RAPIDASH), EC_WORD_RARE, EC_WORD_RATHER, - EC_POKEMON2(RATICATE), - EC_POKEMON2(RATTATA), + EC_POKEMON_NATIONAL(RATICATE), + EC_POKEMON_NATIONAL(RATTATA), EC_POKEMON(RAYQUAZA), EC_MOVE2(RAZOR_LEAF), EC_MOVE(RAZOR_WIND), @@ -1323,19 +1325,19 @@ const u16 gEasyChatWordsByLetter_R[] = { EC_WORD_REJECT, EC_WORD_RELEASE, EC_POKEMON(RELICANTH), - EC_POKEMON2(REMORAID), + EC_POKEMON_NATIONAL(REMORAID), EC_WORD_RENTAL, EC_MOVE2(REST), EC_WORD_RESUSCITATE, EC_MOVE(RETURN), EC_MOVE2(REVENGE), EC_MOVE(REVERSAL), - -1, 2, // Doubled pokemon species name + DOUBLE_SPECIES_NAME EC_POKEMON(RHYDON), - EC_POKEMON2(RHYDON), - -1, 2, // Doubled pokemon species name + EC_POKEMON_NATIONAL(RHYDON), + DOUBLE_SPECIES_NAME EC_POKEMON(RHYHORN), - EC_POKEMON2(RHYHORN), + EC_POKEMON_NATIONAL(RHYHORN), EC_WORD_RIBBON, EC_WORD_RICKETY, EC_WORD_RIGHT, @@ -1377,12 +1379,12 @@ const u16 gEasyChatWordsByLetter_S[] = { EC_MOVE(SAND_TOMB), EC_WORD_SAND_VEIL, EC_MOVE(SAND_ATTACK), - -1, 2, // Doubled pokemon species name + DOUBLE_SPECIES_NAME EC_POKEMON(SANDSHREW), - EC_POKEMON2(SANDSHREW), - -1, 2, // Doubled pokemon species name + EC_POKEMON_NATIONAL(SANDSHREW), + DOUBLE_SPECIES_NAME EC_POKEMON(SANDSLASH), - EC_POKEMON2(SANDSLASH), + EC_POKEMON_NATIONAL(SANDSLASH), EC_MOVE(SANDSTORM), EC_WORD_SAPPHIRE, EC_WORD_SATISFIED, @@ -1393,16 +1395,16 @@ const u16 gEasyChatWordsByLetter_S[] = { EC_WORD_SCATTER, EC_POKEMON(SCEPTILE), EC_WORD_SCHOOL, - EC_POKEMON2(SCIZOR), + EC_POKEMON_NATIONAL(SCIZOR), EC_MOVE2(SCRATCH), EC_MOVE(SCREECH), - EC_POKEMON2(SCYTHER), - -1, 2, // Doubled pokemon species name + EC_POKEMON_NATIONAL(SCYTHER), + DOUBLE_SPECIES_NAME EC_POKEMON(SEADRA), - EC_POKEMON2(SEADRA), - -1, 2, // Doubled pokemon species name + EC_POKEMON_NATIONAL(SEADRA), + DOUBLE_SPECIES_NAME EC_POKEMON(SEAKING), - EC_POKEMON2(SEAKING), + EC_POKEMON_NATIONAL(SEAKING), EC_POKEMON(SEALEO), EC_WORD_SEARCH, EC_WORD_SECRET, @@ -1412,13 +1414,13 @@ const u16 gEasyChatWordsByLetter_S[] = { EC_WORD_SEE_YA, EC_POKEMON(SEEDOT), EC_WORD_SEEK, - EC_POKEMON2(SEEL), + EC_POKEMON_NATIONAL(SEEL), EC_WORD_SEEMS, EC_WORD_SEES, EC_MOVE2(SEISMIC_TOSS), EC_MOVE(SELF_DESTRUCT), EC_WORD_SENSE, - EC_POKEMON2(SENTRET), + EC_POKEMON_NATIONAL(SENTRET), EC_WORD_SERENE_GRACE, EC_WORD_SERIOUS, EC_WORD_SERIOUSLY, @@ -1441,7 +1443,7 @@ const u16 gEasyChatWordsByLetter_S[] = { EC_MOVE(SHEER_COLD), EC_POKEMON(SHELGON), EC_WORD_SHELL_ARMOR, - EC_POKEMON2(SHELLDER), + EC_POKEMON_NATIONAL(SHELLDER), EC_WORD_SHIELD_DUST, EC_POKEMON(SHIFTRY), EC_WORD_SHINE, @@ -1452,7 +1454,7 @@ const u16 gEasyChatWordsByLetter_S[] = { EC_WORD_SHOW, EC_WORD_SHREDDED, EC_POKEMON(SHROOMISH), - EC_POKEMON2(SHUCKLE), + EC_POKEMON_NATIONAL(SHUCKLE), EC_POKEMON(SHUPPET), EC_WORD_SIBLINGS, EC_WORD_SIGH, @@ -1466,14 +1468,14 @@ const u16 gEasyChatWordsByLetter_S[] = { EC_MOVE(SING), EC_WORD_SINK, EC_WORD_SISTER, - -1, 2, // Doubled pokemon species name + DOUBLE_SPECIES_NAME EC_POKEMON(SKARMORY), - EC_POKEMON2(SKARMORY), + EC_POKEMON_NATIONAL(SKARMORY), EC_MOVE(SKETCH), EC_WORD_SKILL, EC_MOVE(SKILL_SWAP), EC_WORD_SKILLED, - EC_POKEMON2(SKIPLOOM), + EC_POKEMON_NATIONAL(SKIPLOOM), EC_POKEMON(SKITTY), EC_MOVE2(SKULL_BASH), EC_MOVE(SKY_ATTACK), @@ -1489,34 +1491,34 @@ const u16 gEasyChatWordsByLetter_S[] = { EC_WORD_SLEPT, EC_WORD_SLIDE, EC_WORD_SLIMY, - EC_POKEMON2(SLOWBRO), - EC_POKEMON2(SLOWKING), - EC_POKEMON2(SLOWPOKE), + EC_POKEMON_NATIONAL(SLOWBRO), + EC_POKEMON_NATIONAL(SLOWKING), + EC_POKEMON_NATIONAL(SLOWPOKE), EC_MOVE2(SLUDGE), EC_MOVE2(SLUDGE_BOMB), - -1, 2, // Doubled pokemon species name + DOUBLE_SPECIES_NAME EC_POKEMON(SLUGMA), - EC_POKEMON2(SLUGMA), + EC_POKEMON_NATIONAL(SLUGMA), EC_WORD_SMACK, EC_WORD_SMALL, EC_WORD_SMART, EC_WORD_SMARTNESS, - EC_POKEMON2(SMEARGLE), + EC_POKEMON_NATIONAL(SMEARGLE), EC_WORD_SMELL, EC_WORD_SMELL_YA, EC_MOVE(SMELLING_SALT), EC_WORD_SMITE, EC_MOVE(SMOG), EC_MOVE(SMOKESCREEN), - EC_POKEMON2(SMOOCHUM), + EC_POKEMON_NATIONAL(SMOOCHUM), EC_WORD_SMOOTH, EC_MOVE2(SNATCH), - EC_POKEMON2(SNEASEL), + EC_POKEMON_NATIONAL(SNEASEL), EC_MOVE(SNORE), - EC_POKEMON2(SNORLAX), + EC_POKEMON_NATIONAL(SNORLAX), EC_WORD_SNORT, EC_POKEMON(SNORUNT), - EC_POKEMON2(SNUBBULL), + EC_POKEMON_NATIONAL(SNUBBULL), EC_WORD_SO, EC_MOVE2(SOFT_BOILED), EC_WORD_SOFTWARE, @@ -1536,14 +1538,14 @@ const u16 gEasyChatWordsByLetter_S[] = { EC_WORD_SOUNDPROOF, EC_WORD_SP_ABILITY, EC_MOVE(SPARK), - EC_POKEMON2(SPEAROW), + EC_POKEMON_NATIONAL(SPEAROW), EC_WORD_SPECTATOR, EC_WORD_SPEED_BOOST, EC_POKEMON(SPHEAL), EC_MOVE(SPIDER_WEB), EC_MOVE2(SPIKE_CANNON), EC_MOVE2(SPIKES), - EC_POKEMON2(SPINARAK), + EC_POKEMON_NATIONAL(SPINARAK), EC_POKEMON(SPINDA), EC_WORD_SPIRALING, EC_WORD_SPIRIT, @@ -1554,21 +1556,21 @@ const u16 gEasyChatWordsByLetter_S[] = { EC_MOVE(SPORE), EC_WORD_SPORTS, EC_WORD_SPRING, - EC_POKEMON2(SQUIRTLE), + EC_POKEMON_NATIONAL(SQUIRTLE), EC_WORD_STAGE, - EC_POKEMON2(STANTLER), - -1, 2, // Doubled pokemon species name + EC_POKEMON_NATIONAL(STANTLER), + DOUBLE_SPECIES_NAME EC_POKEMON(STARMIE), - EC_POKEMON2(STARMIE), + EC_POKEMON_NATIONAL(STARMIE), EC_WORD_START, - -1, 2, // Doubled pokemon species name + DOUBLE_SPECIES_NAME EC_POKEMON(STARYU), - EC_POKEMON2(STARYU), + EC_POKEMON_NATIONAL(STARYU), EC_WORD_STATIC, EC_WORD_STAY_AT_HOME, EC_WORD_STEEL, EC_MOVE2(STEEL_WING), - EC_POKEMON2(STEELIX), + EC_POKEMON_NATIONAL(STEELIX), EC_WORD_STENCH, EC_WORD_STICKY_HOLD, EC_MOVE2(STOCKPILE), @@ -1588,12 +1590,12 @@ const u16 gEasyChatWordsByLetter_S[] = { EC_MOVE(SUBMISSION), EC_MOVE2(SUBSTITUTE), EC_WORD_SUCTION_CUPS, - EC_POKEMON2(SUDOWOODO), - EC_POKEMON2(SUICUNE), + EC_POKEMON_NATIONAL(SUDOWOODO), + EC_POKEMON_NATIONAL(SUICUNE), EC_WORD_SUMMER, EC_WORD_SUNDAY, - EC_POKEMON2(SUNFLORA), - EC_POKEMON2(SUNKERN), + EC_POKEMON_NATIONAL(SUNFLORA), + EC_POKEMON_NATIONAL(SUNKERN), EC_MOVE2(SUNNY_DAY), EC_WORD_SUPER, EC_MOVE(SUPER_FANG), @@ -1615,7 +1617,7 @@ const u16 gEasyChatWordsByLetter_S[] = { EC_POKEMON(SWELLOW), EC_MOVE(SWIFT), EC_WORD_SWIFT_SWIM, - EC_POKEMON2(SWINUB), + EC_POKEMON_NATIONAL(SWINUB), EC_MOVE2(SWORDS_DANCE), EC_WORD_SYNCHRONIZE, EC_MOVE(SYNTHESIS), @@ -1633,24 +1635,24 @@ const u16 gEasyChatWordsByLetter_T[] = { EC_WORD_TALENT, EC_WORD_TALK, EC_WORD_TALKING, - EC_POKEMON2(TANGELA), + EC_POKEMON_NATIONAL(TANGELA), EC_WORD_TASTY, EC_MOVE2(TAUNT), - EC_POKEMON2(TAUROS), + EC_POKEMON_NATIONAL(TAUROS), EC_WORD_TCH, EC_WORD_TEACH, EC_WORD_TEACHER, EC_WORD_TEACHES, - EC_POKEMON2(TEDDIURSA), + EC_POKEMON_NATIONAL(TEDDIURSA), EC_MOVE2(TEETER_DANCE), EC_MOVE2(TELEPORT), EC_WORD_TELEVISION, - -1, 2, // Doubled pokemon species name + DOUBLE_SPECIES_NAME EC_POKEMON(TENTACOOL), - EC_POKEMON2(TENTACOOL), - -1, 2, // Doubled pokemon species name + EC_POKEMON_NATIONAL(TENTACOOL), + DOUBLE_SPECIES_NAME EC_POKEMON(TENTACRUEL), - EC_POKEMON2(TENTACRUEL), + EC_POKEMON_NATIONAL(TENTACRUEL), EC_WORD_TERRIBLE, EC_WORD_TEST, EC_WORD_THAN, @@ -1704,9 +1706,9 @@ const u16 gEasyChatWordsByLetter_T[] = { EC_WORD_TO_US, EC_WORD_TO_WHOM, EC_WORD_TODAY, - EC_POKEMON2(TOGEPI), + EC_POKEMON_NATIONAL(TOGEPI), EC_WORD_TOGETHER, - EC_POKEMON2(TOGETIC), + EC_POKEMON_NATIONAL(TOGETIC), EC_WORD_TOMORROW, EC_WORD_TOO, EC_WORD_TOO_LATE, @@ -1718,7 +1720,7 @@ const u16 gEasyChatWordsByLetter_T[] = { EC_MOVE(TORMENT), EC_WORD_TORRENT, EC_WORD_TOTALLY, - EC_POKEMON2(TOTODILE), + EC_POKEMON_NATIONAL(TOTODILE), EC_WORD_TOUGH, EC_WORD_TOUGHNESS, EC_WORD_TOURNAMENT, @@ -1751,9 +1753,9 @@ const u16 gEasyChatWordsByLetter_T[] = { EC_WORD_TWIRLING, EC_MOVE2(TWISTER), EC_WORD_TYPE, - EC_POKEMON2(TYPHLOSION), - EC_POKEMON2(TYRANITAR), - EC_POKEMON2(TYROGUE), + EC_POKEMON_NATIONAL(TYPHLOSION), + EC_POKEMON_NATIONAL(TYRANITAR), + EC_POKEMON_NATIONAL(TYROGUE), }; const u16 gEasyChatWordsByLetter_U[] = { @@ -1761,7 +1763,7 @@ const u16 gEasyChatWordsByLetter_U[] = { EC_WORD_UH_HUH, EC_WORD_UH_OH, EC_WORD_UM, - EC_POKEMON2(UMBREON), + EC_POKEMON_NATIONAL(UMBREON), EC_WORD_UNAVOIDABLE, EC_WORD_UNBELIEVABLE, EC_WORD_UNCLE, @@ -1769,14 +1771,14 @@ const u16 gEasyChatWordsByLetter_U[] = { EC_WORD_UNDERSTANDS, EC_WORD_UNDERSTOOD, EC_WORD_UNION, - EC_POKEMON2(UNOWN), + EC_POKEMON_NATIONAL(UNOWN), EC_WORD_UNTIL, EC_WORD_UP, EC_WORD_UPBEAT, EC_MOVE(UPROAR), EC_WORD_UPSIDE_DOWN, EC_WORD_URGH, - EC_POKEMON2(URSARING), + EC_POKEMON_NATIONAL(URSARING), EC_WORD_USE, EC_WORD_USELESS, EC_WORD_USES, @@ -1785,35 +1787,35 @@ const u16 gEasyChatWordsByLetter_U[] = { const u16 gEasyChatWordsByLetter_V[] = { EC_WORD_VACATION, - EC_POKEMON2(VAPOREON), - EC_POKEMON2(VENOMOTH), - EC_POKEMON2(VENONAT), - EC_POKEMON2(VENUSAUR), + EC_POKEMON_NATIONAL(VAPOREON), + EC_POKEMON_NATIONAL(VENOMOTH), + EC_POKEMON_NATIONAL(VENONAT), + EC_POKEMON_NATIONAL(VENUSAUR), EC_WORD_VERSION, EC_WORD_VERSUS, EC_WORD_VERY, EC_POKEMON(VIBRAVA), EC_MOVE2(VICE_GRIP), EC_WORD_VICTORY, - EC_POKEMON2(VICTREEBEL), + EC_POKEMON_NATIONAL(VICTREEBEL), EC_WORD_VIEWING, EC_POKEMON(VIGOROTH), - -1, 2, // Doubled pokemon species name + DOUBLE_SPECIES_NAME EC_POKEMON(VILEPLUME), - EC_POKEMON2(VILEPLUME), + EC_POKEMON_NATIONAL(VILEPLUME), EC_MOVE2(VINE_WHIP), EC_WORD_VITAL_SPIRIT, EC_MOVE(VITAL_THROW), EC_POKEMON(VOLBEAT), EC_WORD_VOLT_ABSORB, EC_MOVE2(VOLT_TACKLE), - -1, 2, // Doubled pokemon species name + DOUBLE_SPECIES_NAME EC_POKEMON(VOLTORB), - EC_POKEMON2(VOLTORB), + EC_POKEMON_NATIONAL(VOLTORB), EC_WORD_VORACIOUS, - -1, 2, // Doubled pokemon species name + DOUBLE_SPECIES_NAME EC_POKEMON(VULPIX), - EC_POKEMON2(VULPIX), + EC_POKEMON_NATIONAL(VULPIX), }; const u16 gEasyChatWordsByLetter_W[] = { @@ -1832,7 +1834,7 @@ const u16 gEasyChatWordsByLetter_W[] = { EC_WORD_WANNABE, EC_WORD_WANT, EC_WORD_WANTS, - EC_POKEMON2(WARTORTLE), + EC_POKEMON_NATIONAL(WARTORTLE), EC_WORD_WAS, EC_WORD_WASN_T, EC_WORD_WATER, @@ -1851,12 +1853,12 @@ const u16 gEasyChatWordsByLetter_W[] = { EC_WORD_WEAKENED, EC_MOVE(WEATHER_BALL), EC_WORD_WEDNESDAY, - EC_POKEMON2(WEEDLE), + EC_POKEMON_NATIONAL(WEEDLE), EC_WORD_WEEK, - EC_POKEMON2(WEEPINBELL), - -1, 2, // Doubled pokemon species name + EC_POKEMON_NATIONAL(WEEPINBELL), + DOUBLE_SPECIES_NAME EC_POKEMON(WEEZING), - EC_POKEMON2(WEEZING), + EC_POKEMON_NATIONAL(WEEZING), EC_WORD_WEIRD, EC_WORD_WELCOME, EC_WORD_WELL, @@ -1883,9 +1885,9 @@ const u16 gEasyChatWordsByLetter_W[] = { EC_WORD_WHOM, EC_WORD_WHOSE, EC_WORD_WHY, - -1, 2, // Doubled pokemon species name + DOUBLE_SPECIES_NAME EC_POKEMON(WIGGLYTUFF), - EC_POKEMON2(WIGGLYTUFF), + EC_POKEMON_NATIONAL(WIGGLYTUFF), EC_WORD_WILD, EC_WORD_WILL, EC_WORD_WILL_BE_HERE, @@ -1903,15 +1905,15 @@ const u16 gEasyChatWordsByLetter_W[] = { EC_MOVE(WITHDRAW), EC_WORD_WITHOUT, EC_WORD_WOBBLY, - -1, 2, // Doubled pokemon species name + DOUBLE_SPECIES_NAME EC_POKEMON(WOBBUFFET), - EC_POKEMON2(WOBBUFFET), + EC_POKEMON_NATIONAL(WOBBUFFET), EC_WORD_WOMAN, EC_WORD_WON, EC_WORD_WON_T, EC_WORD_WONDER, EC_WORD_WONDER_GUARD, - EC_POKEMON2(WOOPER), + EC_POKEMON_NATIONAL(WOOPER), EC_WORD_WORD, EC_WORD_WORK, EC_WORD_WORKING, @@ -1928,14 +1930,14 @@ const u16 gEasyChatWordsByLetter_W[] = { }; const u16 gEasyChatWordsByLetter_X[] = { - -1, 2, // Doubled pokemon species name + DOUBLE_SPECIES_NAME EC_POKEMON(XATU), - EC_POKEMON2(XATU), + EC_POKEMON_NATIONAL(XATU), }; const u16 gEasyChatWordsByLetter_Y[] = { EC_WORD_YAHOO, - EC_POKEMON2(YANMA), + EC_POKEMON_NATIONAL(YANMA), EC_MOVE(YAWN), EC_WORD_YAY, EC_WORD_YEAH, @@ -1958,59 +1960,59 @@ const u16 gEasyChatWordsByLetter_Y[] = { const u16 gEasyChatWordsByLetter_Z[] = { EC_POKEMON(ZANGOOSE), EC_MOVE2(ZAP_CANNON), - EC_POKEMON2(ZAPDOS), + EC_POKEMON_NATIONAL(ZAPDOS), EC_POKEMON(ZIGZAGOON), - -1, 2, // Doubled pokemon species name + DOUBLE_SPECIES_NAME EC_POKEMON(ZUBAT), - EC_POKEMON2(ZUBAT), + EC_POKEMON_NATIONAL(ZUBAT), }; const u16 gEasyChatWordsByLetter_UnusedJapaneseHi[] = { - EC_POKEMON2(CLEFFA), + EC_POKEMON_NATIONAL(CLEFFA), EC_WORD_AIYEEH, - EC_POKEMON2(WEEDLE), + EC_POKEMON_NATIONAL(WEEDLE), EC_WORD_HERO, - -1, 2, // Doubled pokemon species name - EC_POKEMON2(PIKACHU), + DOUBLE_SPECIES_NAME + EC_POKEMON_NATIONAL(PIKACHU), EC_POKEMON(PIKACHU), EC_MOVE2(LIGHT_SCREEN), EC_WORD_SHINE, EC_WORD_LOW, - EC_POKEMON2(CLEFABLE), + EC_POKEMON_NATIONAL(CLEFABLE), EC_WORD_FLYING, - EC_POKEMON2(PIDGEOT), - EC_POKEMON2(PIDGEOTTO), + EC_POKEMON_NATIONAL(PIDGEOT), + EC_POKEMON_NATIONAL(PIDGEOTTO), EC_WORD_LEFT, - -1, 2, // Doubled pokemon species name - EC_POKEMON2(PICHU), + DOUBLE_SPECIES_NAME + EC_POKEMON_NATIONAL(PICHU), EC_POKEMON(PICHU), EC_MOVE2(SCRATCH), EC_WORD_SURPRISE, EC_MOVE2(HYPER_FANG), - EC_POKEMON2(CLEFAIRY), + EC_POKEMON_NATIONAL(CLEFAIRY), EC_WORD_DROUGHT, EC_WORD_HIDDEN, EC_WORD_PERSON, EC_WORD_AWFUL, - EC_POKEMON2(CHARMANDER), - -1, 2, // Doubled pokemon species name - EC_POKEMON2(STARYU), + EC_POKEMON_NATIONAL(CHARMANDER), + DOUBLE_SPECIES_NAME + EC_POKEMON_NATIONAL(STARYU), EC_POKEMON(STARYU), EC_WORD_ALONE, - EC_POKEMON2(CYNDAQUIL), + EC_POKEMON_NATIONAL(CYNDAQUIL), EC_MOVE2(EMBER), EC_POKEMON(VIBRAVA), EC_WORD_BORED, - EC_POKEMON2(SUNKERN), + EC_POKEMON_NATIONAL(SUNKERN), EC_WORD_SECRET, EC_WORD_SECRET_BASE, EC_MOVE2(SECRET_POWER), - EC_POKEMON2(TEDDIURSA), + EC_POKEMON_NATIONAL(TEDDIURSA), EC_WORD_HIYAH, EC_MOVE2(DIZZY_PUNCH), EC_WORD_LIGHTNINGROD, - -1, 2, // Doubled pokemon species name - EC_POKEMON2(VOLTORB), + DOUBLE_SPECIES_NAME + EC_POKEMON_NATIONAL(VOLTORB), EC_POKEMON(VOLTORB), EC_WORD_DAYTIME, EC_MOVE2(BULK_UP), @@ -2021,42 +2023,42 @@ const u16 gEasyChatWordsByLetter_UnusedJapaneseHi[] = { const u16 gEasyChatWordsByLetter_UnusedJapaneseFu[] = { EC_WORD_FIGHT, - EC_POKEMON2(MOLTRES), + EC_POKEMON_NATIONAL(MOLTRES), EC_WORD_FASHION, EC_WORD_FEAR, EC_WORD_FEVER, EC_MOVE2(IMPRISON), - EC_POKEMON2(FLAREON), - -1, 2, // Doubled pokemon species name - EC_POKEMON2(ALAKAZAM), + EC_POKEMON_NATIONAL(FLAREON), + DOUBLE_SPECIES_NAME + EC_POKEMON_NATIONAL(ALAKAZAM), EC_POKEMON(ALAKAZAM), - EC_POKEMON2(MAGMAR), + EC_POKEMON_NATIONAL(MAGMAR), EC_POKEMON(GRUMPIG), EC_MOVE2(FEATHER_DANCE), - EC_POKEMON2(FORRETRESS), + EC_POKEMON_NATIONAL(FORRETRESS), EC_MOVE2(WHIRLWIND), EC_WORD_COMPOUNDEYES, - -1, 2, // Doubled pokemon species name - EC_POKEMON2(WIGGLYTUFF), + DOUBLE_SPECIES_NAME + EC_POKEMON_NATIONAL(WIGGLYTUFF), EC_POKEMON(WIGGLYTUFF), EC_MOVE2(BEAT_UP), EC_WORD_MYSTERY, - EC_POKEMON2(IVYSAUR), - EC_POKEMON2(BULBASAUR), + EC_POKEMON_NATIONAL(IVYSAUR), + EC_POKEMON_NATIONAL(BULBASAUR), EC_WORD_MARVEL_SCALE, EC_WORD_WONDER_GUARD, - EC_POKEMON2(VENUSAUR), + EC_POKEMON_NATIONAL(VENUSAUR), EC_WORD_LACKS, EC_WORD_RESUSCITATE, EC_WORD_SMACK, EC_WORD_FUFUFU, - EC_POKEMON2(AERODACTYL), + EC_POKEMON_NATIONAL(AERODACTYL), EC_WORD_WIMPY, - EC_POKEMON2(MAGBY), + EC_POKEMON_NATIONAL(MAGBY), EC_WORD_LOL, EC_MOVE2(BLIZZARD), - -1, 2, // Doubled pokemon species name - EC_POKEMON2(IGGLYBUFF), + DOUBLE_SPECIES_NAME + EC_POKEMON_NATIONAL(IGGLYBUFF), EC_POKEMON(IGGLYBUFF), EC_WORD_SNORT, EC_MOVE2(STOMP), @@ -2067,17 +2069,17 @@ const u16 gEasyChatWordsByLetter_UnusedJapaneseFu[] = { EC_WORD_PLUS, EC_MOVE2(BLAST_BURN), EC_POKEMON(PLUSLE), - EC_POKEMON2(UMBREON), + EC_POKEMON_NATIONAL(UMBREON), EC_MOVE2(FLASH), EC_WORD_WOBBLY, EC_MOVE2(TEETER_DANCE), EC_WORD_PRETEND, - EC_POKEMON2(ARTICUNO), + EC_POKEMON_NATIONAL(ARTICUNO), EC_WORD_WANNABE, - -1, 2, // Doubled pokemon species name - EC_POKEMON2(JIGGLYPUFF), + DOUBLE_SPECIES_NAME + EC_POKEMON_NATIONAL(JIGGLYPUFF), EC_POKEMON(JIGGLYPUFF), - EC_POKEMON2(SNUBBULL), + EC_POKEMON_NATIONAL(SNUBBULL), EC_WORD_SHAKY, EC_MOVE2(CRUSH_CLAW), EC_MOVE2(BLAZE_KICK), @@ -2093,29 +2095,29 @@ const u16 gEasyChatWordsByLetter_UnusedJapaneseHe[] = { EC_WORD_HEY, EC_POKEMON(CORPHISH), EC_WORD_BABY, - EC_POKEMON2(BAYLEEF), + EC_POKEMON_NATIONAL(BAYLEEF), EC_WORD_BEST, EC_WORD_LOUSY, EC_WORD_HEHEHE, - -1, 2, // Doubled pokemon species name - EC_POKEMON2(GRIMER), + DOUBLE_SPECIES_NAME + EC_POKEMON_NATIONAL(GRIMER), EC_POKEMON(GRIMER), - -1, 2, // Doubled pokemon species name - EC_POKEMON2(MUK), + DOUBLE_SPECIES_NAME + EC_POKEMON_NATIONAL(MUK), EC_POKEMON(MUK), EC_WORD_LIQUID_OOZE, EC_MOVE2(SLUDGE), EC_MOVE2(SLUDGE_BOMB), EC_MOVE2(GLARE), EC_WORD_HEH, - -1, 2, // Doubled pokemon species name - EC_POKEMON2(HERACROSS), + DOUBLE_SPECIES_NAME + EC_POKEMON_NATIONAL(HERACROSS), EC_POKEMON(HERACROSS), EC_POKEMON(PELIPPER), - EC_POKEMON2(HOUNDOOM), - EC_POKEMON2(PERSIAN), + EC_POKEMON_NATIONAL(HOUNDOOM), + EC_POKEMON_NATIONAL(PERSIAN), EC_WORD_RIPPED, - EC_POKEMON2(LICKITUNG), + EC_POKEMON_NATIONAL(LICKITUNG), EC_WORD_STUDY, EC_WORD_COLOR_CHANGE, EC_MOVE2(TRANSFORM), @@ -2124,7 +2126,7 @@ const u16 gEasyChatWordsByLetter_UnusedJapaneseHe[] = { const u16 gEasyChatWordsByLetter_UnusedJapaneseHo[] = { EC_MOVE2(POISON_TAIL), EC_WORD_POINTS, - EC_POKEMON2(HO_OH), + EC_POKEMON_NATIONAL(HO_OH), EC_WORD_SOUNDPROOF, EC_WORD_ADVENTURE, EC_WORD_EFFECT_SPORE, @@ -2133,7 +2135,7 @@ const u16 gEasyChatWordsByLetter_UnusedJapaneseHo[] = { EC_POKEMON(WAILMER), EC_WORD_DUDE, EC_WORD_BOARD, - EC_POKEMON2(HOOTHOOT), + EC_POKEMON_NATIONAL(HOOTHOOT), EC_POKEMON(SALAMENCE), EC_WORD_BALL, EC_MOVE2(BONE_RUSH), @@ -2154,21 +2156,21 @@ const u16 gEasyChatWordsByLetter_UnusedJapaneseHo[] = { EC_POKEMON(AGGRON), EC_MOVE2(TAIL_GLOW), EC_POKEMON(POOCHYENA), - EC_POKEMON2(PIDGEY), + EC_POKEMON_NATIONAL(PIDGEY), EC_WORD_AS_MUCH_AS, - EC_POKEMON2(PONYTA), + EC_POKEMON_NATIONAL(PONYTA), EC_MOVE2(BONE_CLUB), EC_MOVE2(BONEMERANG), EC_WORD_FIRE, EC_MOVE2(FIRE_SPIN), EC_WORD_FLAME_BODY, EC_MOVE2(FIRE_PUNCH), - EC_POKEMON2(SKIPLOOM), + EC_POKEMON_NATIONAL(SKIPLOOM), EC_WORD_HOHOHO, EC_WORD_PRAISE, EC_WORD_UH_HUH, - EC_POKEMON2(PORYGON), - EC_POKEMON2(PORYGON2), + EC_POKEMON_NATIONAL(PORYGON), + EC_POKEMON_NATIONAL(PORYGON2), EC_MOVE2(VOLT_TACKLE), EC_WORD_POKEBLOCK, EC_MOVE2(PERISH_SONG), @@ -2189,16 +2191,16 @@ const u16 gEasyChatWordsByLetter_UnusedJapaneseMa[] = { EC_WORD_OWN_TEMPO, EC_MOVE2(WRAP), EC_MOVE2(SPIKES), - -1, 2, // Doubled pokemon species name - EC_POKEMON2(MAGCARGO), + DOUBLE_SPECIES_NAME + EC_POKEMON_NATIONAL(MAGCARGO), EC_POKEMON(MAGCARGO), EC_MOVE2(MAGNITUDE), EC_POKEMON(MAKUHITA), - -1, 2, // Doubled pokemon species name - EC_POKEMON2(SLUGMA), + DOUBLE_SPECIES_NAME + EC_POKEMON_NATIONAL(SLUGMA), EC_POKEMON(SLUGMA), EC_WORD_MAGMA_ARMOR, - EC_POKEMON2(QUILAVA), + EC_POKEMON_NATIONAL(QUILAVA), EC_WORD_OVERDO, EC_WORD_LOSS, EC_WORD_IF_I_LOSE, @@ -2214,9 +2216,9 @@ const u16 gEasyChatWordsByLetter_UnusedJapaneseMa[] = { EC_WORD_INCREASING, EC_WORD_TOO, EC_WORD_LIKE, - EC_POKEMON2(BELLSPROUT), - -1, 2, // Doubled pokemon species name - EC_POKEMON2(WEEZING), + EC_POKEMON_NATIONAL(BELLSPROUT), + DOUBLE_SPECIES_NAME + EC_POKEMON_NATIONAL(WEEZING), EC_POKEMON(WEEZING), EC_WORD_SMELL, EC_WORD_YET, @@ -2231,23 +2233,23 @@ const u16 gEasyChatWordsByLetter_UnusedJapaneseMa[] = { EC_WORD_GUARD, EC_MOVE2(PROTECT), EC_POKEMON(CASCOON), - -1, 2, // Doubled pokemon species name - EC_POKEMON2(MARILL), + DOUBLE_SPECIES_NAME + EC_POKEMON_NATIONAL(MARILL), EC_POKEMON(MARILL), - -1, 2, // Doubled pokemon species name - EC_POKEMON2(AZUMARILL), + DOUBLE_SPECIES_NAME + EC_POKEMON_NATIONAL(AZUMARILL), EC_POKEMON(AZUMARILL), EC_MOVE2(DEFENSE_CURL), EC_WORD_AS_IF, EC_POKEMON(SWALOT), - -1, 2, // Doubled pokemon species name - EC_POKEMON2(ELECTRODE), + DOUBLE_SPECIES_NAME + EC_POKEMON_NATIONAL(ELECTRODE), EC_POKEMON(ELECTRODE), EC_MOVE2(ROLLING_KICK), EC_WORD_COMICS, - EC_POKEMON2(MANKEY), + EC_POKEMON_NATIONAL(MANKEY), EC_WORD_SATISFIED, - EC_POKEMON2(MANTINE), + EC_POKEMON_NATIONAL(MANTINE), }; const u16 gEasyChatWordsByLetter_UnusedJapaneseMi[] = { @@ -2272,16 +2274,16 @@ const u16 gEasyChatWordsByLetter_UnusedJapaneseMi[] = { EC_WORD_LOOKS, EC_WORD_REJECT, EC_WORD_ACCEPT, - EC_POKEMON2(DRATINI), + EC_POKEMON_NATIONAL(DRATINI), EC_MOVE2(FALSE_SWIPE), EC_MOVE2(FORESIGHT), - EC_POKEMON2(MEW), - EC_POKEMON2(MEWTWO), + EC_POKEMON_NATIONAL(MEW), + EC_POKEMON_NATIONAL(MEWTWO), EC_MOVE2(MIRROR_COAT), EC_MOVE2(FUTURE_SIGHT), EC_WORD_SEES, EC_MOVE2(MILK_DRINK), - EC_POKEMON2(MILTANK), + EC_POKEMON_NATIONAL(MILTANK), EC_POKEMON(MILOTIC), EC_WORD_WE, EC_WORD_BEEN, @@ -2292,13 +2294,13 @@ const u16 gEasyChatWordsByLetter_UnusedJapaneseMi[] = { const u16 gEasyChatWordsByLetter_UnusedJapaneseMu[] = { EC_WORD_MOOD, - EC_POKEMON2(MISDREAVUS), + EC_POKEMON_NATIONAL(MISDREAVUS), EC_WORD_OLDEN, EC_WORD_ARRGH, EC_WORD_BUG, EC_WORD_SWARM, EC_WORD_RATHER, - EC_POKEMON2(SMOOCHUM), + EC_POKEMON_NATIONAL(SMOOCHUM), EC_WORD_INVINCIBLE, EC_WORD_HEART, EC_WORD_MUFUFU, @@ -2311,23 +2313,23 @@ const u16 gEasyChatWordsByLetter_UnusedJapaneseMe[] = { EC_MOVE2(MEGA_DRAIN), EC_MOVE2(MEGA_KICK), EC_MOVE2(MEGA_PUNCH), - EC_POKEMON2(MEGANIUM), + EC_POKEMON_NATIONAL(MEGANIUM), EC_MOVE2(MEGAHORN), EC_WORD_SEEK, EC_MOVE2(HIDDEN_POWER), EC_WORD_RARE, EC_POKEMON(METAGROSS), - EC_POKEMON2(DITTO), + EC_POKEMON_NATIONAL(DITTO), EC_MOVE2(METAL_CLAW), EC_POKEMON(METANG), EC_WORD_DESTROYED, EC_WORD_MESSAGE, EC_WORD_AWFULLY, - -1, 2, // Doubled pokemon species name - EC_POKEMON2(TENTACOOL), + DOUBLE_SPECIES_NAME + EC_POKEMON_NATIONAL(TENTACOOL), EC_POKEMON(TENTACOOL), EC_WORD_FIERY, - EC_POKEMON2(MAREEP), + EC_POKEMON_NATIONAL(MAREEP), EC_MOVE2(ATTRACT), EC_WORD_CUTE_CHARM, EC_WORD_IMMUNITY, @@ -2340,7 +2342,7 @@ const u16 gEasyChatWordsByLetter_UnusedJapaneseMo[] = { EC_WORD_MODE, EC_WORD_OLD, EC_WORD_THURSDAY, - EC_POKEMON2(FLAAFFY), + EC_POKEMON_NATIONAL(FLAAFFY), EC_WORD_LISTENING, EC_WORD_OWN, EC_WORD_MORE, @@ -2351,9 +2353,9 @@ const u16 gEasyChatWordsByLetter_UnusedJapaneseMo[] = { EC_WORD_PATTERN, EC_WORD_FLASH_FIRE, EC_WORD_RECEIVED, - EC_POKEMON2(VENOMOTH), + EC_POKEMON_NATIONAL(VENOMOTH), EC_WORD_DOESN_T, - EC_POKEMON2(TANGELA), + EC_POKEMON_NATIONAL(TANGELA), }; const u16 gEasyChatWordsByLetter_UnusedJapaneseYa[] = { @@ -2368,19 +2370,19 @@ const u16 gEasyChatWordsByLetter_UnusedJapaneseYa[] = { EC_WORD_FINALLY, EC_WORD_ANY, EC_WORD_YAHOO, - EC_POKEMON2(SLOWKING), - EC_POKEMON2(SLOWBRO), + EC_POKEMON_NATIONAL(SLOWKING), + EC_POKEMON_NATIONAL(SLOWBRO), EC_MOVE2(LEECH_SEED), - EC_POKEMON2(SLOWPOKE), + EC_POKEMON_NATIONAL(SLOWPOKE), EC_WORD_DANGER, - EC_POKEMON2(MURKROW), + EC_POKEMON_NATIONAL(MURKROW), EC_POKEMON(SABLEYE), EC_WORD_DEFEATED, EC_WORD_BEAT, EC_WORD_VITAL_SPIRIT, EC_POKEMON(VIGOROTH), EC_WORD_YOUNG, - EC_POKEMON2(YANMA), + EC_POKEMON_NATIONAL(YANMA), }; const u16 gEasyChatWordsByLetter_UnusedJapaneseYu[] = { @@ -2393,8 +2395,8 @@ const u16 gEasyChatWordsByLetter_UnusedJapaneseYu[] = { EC_WORD_ALLOW, EC_WORD_FORGET, EC_POKEMON(CRADILY), - -1, 2, // Doubled pokemon species name - EC_POKEMON2(KADABRA), + DOUBLE_SPECIES_NAME + EC_POKEMON_NATIONAL(KADABRA), EC_POKEMON(KADABRA), }; @@ -2406,7 +2408,7 @@ const u16 gEasyChatWordsByLetter_UnusedJapaneseYo[] = { EC_WORD_KINDERGARTEN, EC_WORD_CHLOROPHYLL, EC_WORD_AFTER, - EC_POKEMON2(LARVITAR), + EC_POKEMON_NATIONAL(LARVITAR), EC_WORD_OH_KAY, EC_WORD_BEFORE, EC_WORD_GREAT, @@ -2422,7 +2424,7 @@ const u16 gEasyChatWordsByLetter_UnusedJapaneseYo[] = { EC_WORD_EASY, EC_WORD_INSTEAD, EC_WORD_NIGHT, - EC_POKEMON2(NOCTOWL), + EC_POKEMON_NATIONAL(NOCTOWL), EC_WORD_COUNT_ON, EC_WORD_WEAK, EC_WORD_TOO_WEAK, @@ -2430,10 +2432,10 @@ const u16 gEasyChatWordsByLetter_UnusedJapaneseYo[] = { }; const u16 gEasyChatWordsByLetter_UnusedJapaneseRa[] = { - EC_POKEMON2(RAIKOU), + EC_POKEMON_NATIONAL(RAIKOU), EC_WORD_WEEK, - -1, 2, // Doubled pokemon species name - EC_POKEMON2(RAICHU), + DOUBLE_SPECIES_NAME + EC_POKEMON_NATIONAL(RAICHU), EC_POKEMON(RAICHU), EC_WORD_RIVAL, EC_WORD_LIFE, @@ -2445,31 +2447,31 @@ const u16 gEasyChatWordsByLetter_UnusedJapaneseRa[] = { EC_WORD_SEEMS, EC_WORD_RADIO, EC_MOVE2(LUSTER_PURGE), - EC_POKEMON2(CHANSEY), - EC_POKEMON2(RATICATE), + EC_POKEMON_NATIONAL(CHANSEY), + EC_POKEMON_NATIONAL(RATICATE), EC_POKEMON(LATIAS), EC_POKEMON(LATIOS), EC_POKEMON(LUVDISC), - EC_POKEMON2(LAPRAS), + EC_POKEMON_NATIONAL(LAPRAS), EC_WORD_LOVEY_DOVEY, - -1, 2, // Doubled pokemon species name - EC_POKEMON2(VILEPLUME), + DOUBLE_SPECIES_NAME + EC_POKEMON_NATIONAL(VILEPLUME), EC_POKEMON(VILEPLUME), EC_WORD_LALALA, EC_POKEMON(RALTS), EC_WORD_FORGETS, EC_WORD_APPEARS, EC_WORD_RANK, - -1, 2, // Doubled pokemon species name - EC_POKEMON2(LANTURN), + DOUBLE_SPECIES_NAME + EC_POKEMON_NATIONAL(LANTURN), EC_POKEMON(LANTURN), }; const u16 gEasyChatWordsByLetter_UnusedJapaneseRi[] = { EC_WORD_LEADER, EC_MOVE2(LEAF_BLADE), - EC_POKEMON2(CHARMELEON), - EC_POKEMON2(CHARIZARD), + EC_POKEMON_NATIONAL(CHARMELEON), + EC_POKEMON_NATIONAL(CHARIZARD), EC_MOVE2(RECYCLE), EC_MOVE2(REFLECT), EC_MOVE2(REFRESH), @@ -2481,15 +2483,15 @@ const u16 gEasyChatWordsByLetter_UnusedJapaneseRi[] = { EC_MOVE2(DRAGON_DANCE), EC_WORD_VACATION, EC_POKEMON(LILEEP), - EC_POKEMON2(URSARING), + EC_POKEMON_NATIONAL(URSARING), EC_WORD_SHIELD_DUST, }; const u16 gEasyChatWordsByLetter_UnusedJapaneseRu[] = { - EC_POKEMON2(JYNX), + EC_POKEMON_NATIONAL(JYNX), EC_WORD_ROOM, EC_WORD_RULE, - EC_POKEMON2(LUGIA), + EC_POKEMON_NATIONAL(LUGIA), EC_WORD_LOOK, EC_POKEMON(LUNATONE), EC_WORD_RUBY, @@ -2500,8 +2502,8 @@ const u16 gEasyChatWordsByLetter_UnusedJapaneseRu[] = { }; const u16 gEasyChatWordsByLetter_UnusedJapaneseRe[] = { - -1, 2, // Doubled pokemon species name - EC_POKEMON2(MAGNETON), + DOUBLE_SPECIES_NAME + EC_POKEMON_NATIONAL(MAGNETON), EC_POKEMON(MAGNETON), EC_MOVE2(ICE_PUNCH), EC_MOVE2(ICE_BEAM), @@ -2510,8 +2512,8 @@ const u16 gEasyChatWordsByLetter_UnusedJapaneseRe[] = { EC_POKEMON(REGIROCK), EC_POKEMON(RAYQUAZA), EC_WORD_UGLY, - EC_POKEMON2(LEDIAN), - EC_POKEMON2(LEDYBA), + EC_POKEMON_NATIONAL(LEDIAN), + EC_POKEMON_NATIONAL(LEDYBA), EC_WORD_FANTASTIC, EC_WORD_LEVEL, EC_MOVE2(FURY_CUTTER), @@ -2521,8 +2523,8 @@ const u16 gEasyChatWordsByLetter_UnusedJapaneseRe[] = { const u16 gEasyChatWordsByLetter_UnusedJapaneseRo[] = { EC_MOVE2(SKULL_BASH), - -1, 2, // Doubled pokemon species name - EC_POKEMON2(VULPIX), + DOUBLE_SPECIES_NAME + EC_POKEMON_NATIONAL(VULPIX), EC_POKEMON(VULPIX), EC_POKEMON(ROSELIA), EC_MOVE2(LOCK_ON), @@ -2553,198 +2555,198 @@ const u16 gEasyChatWordsByLetter_UnusedJapaneseWa[] = { EC_WORD_HERS, EC_WORD_SHE_IS, EC_WORD_SOME, - EC_POKEMON2(JUMPLUFF), + EC_POKEMON_NATIONAL(JUMPLUFF), EC_MOVE2(COTTON_SPORE), EC_WORD_GWAH, - EC_POKEMON2(TOTODILE), + EC_POKEMON_NATIONAL(TOTODILE), EC_WORD_WAHAHAHA, EC_WORD_ANYWHERE, EC_MOVE2(STRUGGLE), EC_WORD_BADLY, - -1, 2, // Doubled pokemon species name - EC_POKEMON2(MACHOP), + DOUBLE_SPECIES_NAME + EC_POKEMON_NATIONAL(MACHOP), EC_POKEMON(MACHOP), }; -const struct EasyChatWordsByLetter gEasyChatWordsByLetterPointers[] = { +const struct EasyChatWordsByLetter gEasyChatWordsByLetterPointers[EC_NUM_ALPHABET_GROUPS + 18] = { // 18 unused JP groups { .words = gEasyChatWordsByLetter_Others, - .numWords = 10, + .numWords = ARRAY_COUNT(gEasyChatWordsByLetter_Others), }, { .words = gEasyChatWordsByLetter_A, - .numWords = 106, + .numWords = ARRAY_COUNT(gEasyChatWordsByLetter_A), }, { .words = gEasyChatWordsByLetter_B, - .numWords = 86, + .numWords = ARRAY_COUNT(gEasyChatWordsByLetter_B), }, { .words = gEasyChatWordsByLetter_C, - .numWords = 119, + .numWords = ARRAY_COUNT(gEasyChatWordsByLetter_C), }, { .words = gEasyChatWordsByLetter_D, - .numWords = 94, + .numWords = ARRAY_COUNT(gEasyChatWordsByLetter_D), }, { .words = gEasyChatWordsByLetter_E, - .numWords = 59, + .numWords = ARRAY_COUNT(gEasyChatWordsByLetter_E), }, { .words = gEasyChatWordsByLetter_F, - .numWords = 80, + .numWords = ARRAY_COUNT(gEasyChatWordsByLetter_F), }, { .words = gEasyChatWordsByLetter_G, - .numWords = 98, + .numWords = ARRAY_COUNT(gEasyChatWordsByLetter_G), }, { .words = gEasyChatWordsByLetter_H, - .numWords = 101, + .numWords = ARRAY_COUNT(gEasyChatWordsByLetter_H), }, { .words = gEasyChatWordsByLetter_I, - .numWords = 48, + .numWords = ARRAY_COUNT(gEasyChatWordsByLetter_I), }, { .words = gEasyChatWordsByLetter_J, - .numWords = 13, + .numWords = ARRAY_COUNT(gEasyChatWordsByLetter_J), }, { .words = gEasyChatWordsByLetter_K, - .numWords = 33, + .numWords = ARRAY_COUNT(gEasyChatWordsByLetter_K), }, { .words = gEasyChatWordsByLetter_L, - .numWords = 82, + .numWords = ARRAY_COUNT(gEasyChatWordsByLetter_L), }, { .words = gEasyChatWordsByLetter_M, - .numWords = 142, + .numWords = ARRAY_COUNT(gEasyChatWordsByLetter_M), }, { .words = gEasyChatWordsByLetter_N, - .numWords = 54, + .numWords = ARRAY_COUNT(gEasyChatWordsByLetter_N), }, { .words = gEasyChatWordsByLetter_O, - .numWords = 44, + .numWords = ARRAY_COUNT(gEasyChatWordsByLetter_O), }, { .words = gEasyChatWordsByLetter_P, - .numWords = 102, + .numWords = ARRAY_COUNT(gEasyChatWordsByLetter_P), }, { .words = gEasyChatWordsByLetter_Q, - .numWords = 6, + .numWords = ARRAY_COUNT(gEasyChatWordsByLetter_Q), }, { .words = gEasyChatWordsByLetter_R, - .numWords = 80, + .numWords = ARRAY_COUNT(gEasyChatWordsByLetter_R), }, { .words = gEasyChatWordsByLetter_S, - .numWords = 262, + .numWords = ARRAY_COUNT(gEasyChatWordsByLetter_S), }, { .words = gEasyChatWordsByLetter_T, - .numWords = 133, + .numWords = ARRAY_COUNT(gEasyChatWordsByLetter_T), }, { .words = gEasyChatWordsByLetter_U, - .numWords = 24, + .numWords = ARRAY_COUNT(gEasyChatWordsByLetter_U), }, { .words = gEasyChatWordsByLetter_V, - .numWords = 33, + .numWords = ARRAY_COUNT(gEasyChatWordsByLetter_V), }, { .words = gEasyChatWordsByLetter_W, - .numWords = 111, + .numWords = ARRAY_COUNT(gEasyChatWordsByLetter_W), }, { .words = gEasyChatWordsByLetter_X, - .numWords = 4, + .numWords = ARRAY_COUNT(gEasyChatWordsByLetter_X), }, { .words = gEasyChatWordsByLetter_Y, - .numWords = 19, + .numWords = ARRAY_COUNT(gEasyChatWordsByLetter_Y), }, { .words = gEasyChatWordsByLetter_Z, - .numWords = 8, + .numWords = ARRAY_COUNT(gEasyChatWordsByLetter_Z), }, { .words = gEasyChatWordsByLetter_UnusedJapaneseHi, - .numWords = 55, + .numWords = ARRAY_COUNT(gEasyChatWordsByLetter_UnusedJapaneseHi), }, { .words = gEasyChatWordsByLetter_UnusedJapaneseFu, - .numWords = 71, + .numWords = ARRAY_COUNT(gEasyChatWordsByLetter_UnusedJapaneseFu), }, { .words = gEasyChatWordsByLetter_UnusedJapaneseHe, - .numWords = 32, + .numWords = ARRAY_COUNT(gEasyChatWordsByLetter_UnusedJapaneseHe), }, { .words = gEasyChatWordsByLetter_UnusedJapaneseHo, - .numWords = 55, + .numWords = ARRAY_COUNT(gEasyChatWordsByLetter_UnusedJapaneseHo), }, { .words = gEasyChatWordsByLetter_UnusedJapaneseMa, - .numWords = 74, + .numWords = ARRAY_COUNT(gEasyChatWordsByLetter_UnusedJapaneseMa), }, { .words = gEasyChatWordsByLetter_UnusedJapaneseMi, - .numWords = 37, + .numWords = ARRAY_COUNT(gEasyChatWordsByLetter_UnusedJapaneseMi), }, { .words = gEasyChatWordsByLetter_UnusedJapaneseMu, - .numWords = 12, + .numWords = ARRAY_COUNT(gEasyChatWordsByLetter_UnusedJapaneseMu), }, { .words = gEasyChatWordsByLetter_UnusedJapaneseMe, - .numWords = 26, + .numWords = ARRAY_COUNT(gEasyChatWordsByLetter_UnusedJapaneseMe), }, { .words = gEasyChatWordsByLetter_UnusedJapaneseMo, - .numWords = 20, + .numWords = ARRAY_COUNT(gEasyChatWordsByLetter_UnusedJapaneseMo), }, { .words = gEasyChatWordsByLetter_UnusedJapaneseYa, - .numWords = 24, + .numWords = ARRAY_COUNT(gEasyChatWordsByLetter_UnusedJapaneseYa), }, { .words = gEasyChatWordsByLetter_UnusedJapaneseYu, - .numWords = 13, + .numWords = ARRAY_COUNT(gEasyChatWordsByLetter_UnusedJapaneseYu), }, { .words = gEasyChatWordsByLetter_UnusedJapaneseYo, - .numWords = 28, + .numWords = ARRAY_COUNT(gEasyChatWordsByLetter_UnusedJapaneseYo), }, { .words = gEasyChatWordsByLetter_UnusedJapaneseRa, - .numWords = 36, + .numWords = ARRAY_COUNT(gEasyChatWordsByLetter_UnusedJapaneseRa), }, { .words = gEasyChatWordsByLetter_UnusedJapaneseRi, - .numWords = 17, + .numWords = ARRAY_COUNT(gEasyChatWordsByLetter_UnusedJapaneseRi), }, { .words = gEasyChatWordsByLetter_UnusedJapaneseRu, - .numWords = 11, + .numWords = ARRAY_COUNT(gEasyChatWordsByLetter_UnusedJapaneseRu), }, { .words = gEasyChatWordsByLetter_UnusedJapaneseRe, - .numWords = 18, + .numWords = ARRAY_COUNT(gEasyChatWordsByLetter_UnusedJapaneseRe), }, { .words = gEasyChatWordsByLetter_UnusedJapaneseRo, - .numWords = 10, + .numWords = ARRAY_COUNT(gEasyChatWordsByLetter_UnusedJapaneseRo), }, { .words = gEasyChatWordsByLetter_UnusedJapaneseWa, - .numWords = 33, + .numWords = ARRAY_COUNT(gEasyChatWordsByLetter_UnusedJapaneseWa), }, }; diff --git a/src/data/lilycove_lady.h b/src/data/lilycove_lady.h index 37bae7e95..818a5fd5f 100644 --- a/src/data/lilycove_lady.h +++ b/src/data/lilycove_lady.h @@ -53,7 +53,7 @@ static const u16 sQuizLadyQuestion3[] = EC_WORD_POKEMON, EC_WORD_EVOLVE, EC_WORD_QUES, - 0xFFFF, + EC_EMPTY_WORD, EC_WORD_LEVEL, EC_WORD_INSOMNIA, EC_WORD_CUTE_CHARM @@ -92,7 +92,7 @@ static const u16 sQuizLadyQuestion6[] = EC_WORD_STOP, EC_MOVE2(CONFUSION), EC_WORD_QUES, - 0xFFFF, + EC_EMPTY_WORD, EC_WORD_ILLUMINATE, EC_WORD_OWN_TEMPO, EC_WORD_SWIFT_SWIM @@ -118,7 +118,7 @@ static const u16 sQuizLadyQuestion8[] = EC_MOVE2(BLOCK), EC_WORD_ESCAPE, EC_WORD_QUES, - 0xFFFF, + EC_EMPTY_WORD, EC_WORD_RUN_AWAY, EC_WORD_SHADOW_TAG, EC_WORD_WONDER_GUARD @@ -131,7 +131,7 @@ static const u16 sQuizLadyQuestion9[] = EC_WORD_STOP, EC_WORD_POISON, EC_WORD_QUES, - 0xFFFF, + EC_EMPTY_WORD, EC_WORD_GUTS, EC_WORD_IMMUNITY, EC_WORD_SHED_SKIN @@ -144,7 +144,7 @@ static const u16 sQuizLadyQuestion10[] = EC_WORD_WITH, EC_WORD_CENTER, EC_WORD_QUES, - 0xFFFF, + EC_EMPTY_WORD, EC_WORD_POKEDEX, EC_WORD_POKEMON, EC_WORD_POKENAV @@ -157,7 +157,7 @@ static const u16 sQuizLadyQuestion11[] = EC_WORD_YOUR, EC_WORD_POKEMON, EC_WORD_QUES, - 0xFFFF, + EC_EMPTY_WORD, EC_WORD_PC, EC_WORD_DEPT_STORE, EC_WORD_TELEVISION @@ -199,7 +199,7 @@ static const u16 sQuizLadyQuestion14[] = EC_WORD_QUES, EC_WORD_ICE, EC_WORD_GROUND, - 0xFFFF + EC_EMPTY_WORD }; static const u16 sQuizLadyQuestion15[] = @@ -212,7 +212,7 @@ static const u16 sQuizLadyQuestion15[] = EC_WORD_QUES, EC_WORD_PSYCHIC, EC_WORD_FIGHTING, - 0xFFFF + EC_EMPTY_WORD }; static const u16 sQuizLadyQuestion16[] = @@ -225,7 +225,7 @@ static const u16 sQuizLadyQuestion16[] = EC_WORD_QUES, EC_WORD_NORMAL, EC_WORD_DARK, - 0xFFFF + EC_EMPTY_WORD }; static const u16 *const sQuizLadyQuizQuestions[] = diff --git a/src/data/trade.h b/src/data/trade.h index b9350863b..7001b6ce5 100644 --- a/src/data/trade.h +++ b/src/data/trade.h @@ -1070,7 +1070,7 @@ static const u16 sIngameTradeMail[][MAIL_WORDS_COUNT + 1] = EC_WORD_THANK_YOU, EC_WORD_FOR, EC_POKEMON(SKITTY), - EC_POKEMON2(MEOWTH), + EC_POKEMON_NATIONAL(MEOWTH), EC_WORD_CRIES, EC_WORD_IN, EC_WORD_A, diff --git a/src/dewford_trend.c b/src/dewford_trend.c index 5c7e50f16..c60797f86 100644 --- a/src/dewford_trend.c +++ b/src/dewford_trend.c @@ -90,7 +90,7 @@ void UpdateDewfordTrendPerDay(u16 a) } -bool8 sub_81226D8(u16 *a) +bool8 IsPhraseTrendy(u16 *a) { struct EasyChatPair s = {0}; u16 i; diff --git a/src/easy_chat.c b/src/easy_chat.c index fa3d4472a..16b302bb8 100644 --- a/src/easy_chat.c +++ b/src/easy_chat.c @@ -34,228 +34,382 @@ #include "constants/songs.h" #include "constants/rgb.h" -#define EZCHAT_TASK_STATE 0 -#define EZCHAT_TASK_TYPE 1 -#define EZCHAT_TASK_WORDS 2 -#define EZCHAT_TASK_MAINCALLBACK 4 -#define EZCHAT_TASK_UNK06 6 -#define EZCHAT_TASK_SIZE 7 - static EWRAM_DATA struct EasyChatScreen *sEasyChatScreen = NULL; -static EWRAM_DATA struct Unk203A11C *sUnknown_0203A11C = NULL; -static EWRAM_DATA struct Unk203A120 *sUnknown_0203A120 = NULL; +static EWRAM_DATA struct EasyChatScreenControl *sScreenControl = NULL; +static EWRAM_DATA struct EasyChatScreenWordData *sWordData = NULL; -static void sub_811A2C0(u8); -static void MainCallback_EasyChatScreen(void); -static bool8 sub_811A428(u8); -static void sub_811A2FC(u8); -static void sub_811A4D0(MainCallback); -static bool32 sub_811A88C(u16); -static void sub_811A8A4(u16); -static bool8 EasyChat_AllocateResources(u8, u16 *, u8); -static void EasyChat_FreeResources(void); -static u16 sub_811AAAC(void); -static u16 sub_811AB68(void); -static u16 sub_811ACDC(void); -static u16 sub_811AE44(void); -static u16 sub_811AF00(void); -static u16 sub_811AF8C(void); -static u16 sub_811AFEC(void); -static u16 sub_811B040(void); -static u16 sub_811B08C(void); -static u16 sub_811B0BC(void); -static u16 sub_811B0E8(void); -static u16 sub_811B0F8(void); -static u16 sub_811B150(void); -static u16 sub_811B1B4(void); +static void Task_InitEasyChatScreen(u8); +static void CB2_EasyChatScreen(void); +static bool8 InitEasyChatScreen(u8); +static void Task_EasyChatScreen(u8); +static void ExitEasyChatScreen(MainCallback); +static bool32 IsFuncIdForQuizLadyScreen(u16); +static void EnterQuizLadyScreen(u16); +static bool8 InitEasyChatScreenStruct(u8, u16 *, u8); +static void FreeEasyChatScreenStruct(void); +static u16 HandleEasyChatInput(void); +static u16 HandleEasyChatInput_Phrase(void); +static u16 HandleEasyChatInput_MainScreenButtons(void); +static u16 HandleEasyChatInput_Keyboard(void); +static u16 HandleEasyChatInput_WordSelect(void); +static u16 HandleEasyChatInput_ExitPrompt(void); +static u16 HandleEasyChatInput_ConfirmWordsYesNo(void); +static u16 HandleEasyChatInput_DeleteAllYesNo(void); +static u16 HandleEasyChatInput_QuizQuestion(void); +static u16 HandleEasyChatInput_WaitForMsg(void); +static u16 HandleEasyChatInput_StartConfirmLyrics(void); +static u16 HandleEasyChatInput_ConfirmLyricsYesNo(void); +static u16 StartConfirmExitPrompt(void); +static u16 TryConfirmWords(void); static u8 GetEasyChatScreenFrameId(void); static u8 GetEachChatScreenTemplateId(u8); -static void sub_811BDF0(u8 *); -static void sub_811BF78(void); -static bool8 sub_811BF8C(void); -static bool8 sub_811BFA4(void); -static void sub_811C13C(void); -static void sub_811C158(u16); -static bool8 sub_811C170(void); -static bool8 sub_811F28C(void); -static void sub_811F2B8(void); -static u8 sub_811F3AC(void); +static void GetQuizTitle(u8 *); +static void ClearUnusedField(void); +static bool8 InitEasyChatScreenControl(void); +static bool8 LoadEasyChatScreen(void); +static void FreeEasyChatScreenControl(void); +static void StartEasyChatFunction(u16); +static bool8 RunEasyChatFunction(void); +static bool8 InitEasyChatScreenWordData(void); +static void FreeEasyChatScreenWordData(void); +static u8 GetNumUnlockedEasyChatGroups(void); static int FooterHasFourOptions(void); -static int sub_811B184(void); -static int sub_811B264(void); -static int sub_811B32C(void); -static int sub_811B2B0(void); -static int sub_811B33C(void); -static int sub_811B368(void); -static u16 sub_811B528(int); -static u16 sub_811B794(u32); -static int sub_811B394(void); -static u8 sub_811B2A4(void); -static void sub_811B3E4(void); -static void sub_811BE9C(void); -static int sub_811B4EC(void); -static void sub_811B418(void); -static void sub_811B454(void); -static int sub_811BD64(void); -static int sub_811BDB0(void); -static int sub_811BD2C(void); -static int sub_811BCF4(void); -static u16 sub_811B8E8(void); -static u8 sub_811F3B8(u8); -static void sub_811F548(int, u16); -static int sub_811B908(void); -static u16 sub_811F5B0(void); -static void sub_811B488(u16); -static u16 sub_811B940(void); -static u16 sub_811F578(u16); -static int sub_811BF88(int); -static u16 sub_811B8C8(void); -static int sub_811B568(u32); -static int sub_811B634(u32); -static int sub_811B6C4(u32); -static void sub_811B978(void); -static void sub_811B744(void); -static u8 sub_811B9C8(void); -static void sub_811B768(void); -static u8 sub_811B960(u8); -static void sub_811B9A0(void); -static u8 sub_811BA1C(void); +static int DoDeleteAllButton(void); +static int DoQuizButton(void); +static int ExitKeyboardToMainScreen(void); +static int SelectKeyboardGroup(void); +static int StartSwitchKeyboardMode(void); +static int DeleteSelectedWord(void); +static u16 MoveKeyboardCursor(int); +static u16 MoveWordSelectCursor(u32); +static int SelectNewWord(void); +static u8 GetEasyChatBackupState(void); +static void SaveCurrentPhrase(void); +static void SetSpecialEasyChatResult(void); +static bool32 GetEasyChatCompleted(void); +static void ResetCurrentPhrase(void); +static void ResetCurrentPhraseToSaved(void); +static int IsQuizQuestionEmpty(void); +static int IsQuizAnswerEmpty(void); +static bool32 IsCurrentPhraseFull(void); +static bool32 IsCurrentPhraseEmpty(void); +static u16 GetSelectedGroupIndex(void); +static u8 GetUnlockedEasyChatGroupId(u8); +static void SetSelectedWordGroup(bool32, u16); +static int GetSelectedAlphabetGroupId(void); +static u16 GetNumWordsInSelectedGroup(void); +static void SetSelectedWord(u16); +static u16 GetSelectedWordIndex(void); +static u16 GetWordFromSelectedGroup(u16); +static bool32 DummyWordCheck(int); +static u16 GetWordIndexToReplace(void); +static int MoveKeyboardCursor_GroupNames(u32); +static int MoveKeyboardCursor_Alphabet(u32); +static int MoveKeyboardCursor_ButtonWindow(u32); +static void ReduceToValidKeyboardColumn(void); +static void SetKeyboardCursorInButtonWindow(void); +static bool8 IsSelectedKeyboardIndexInvalid(void); +static void SetKeyboardCursorToLastColumn(void); +static u8 GetLastAlphabetColumn(u8); +static void ReduceToValidWordSelectColumn(void); +static bool8 IsSelectedWordIndexInvalid(void); static int DidPlayerInputMysteryGiftPhrase(void); static u16 DidPlayerInputABerryMasterWifePhrase(void); -static bool8 sub_811CE94(void); -static void sub_811CF64(void); -static void sub_811CF04(void); -static void sub_811D60C(void); -static void sub_811D424(u16 *); -static void sub_811D230(void); -static void sub_811E948(void); -static void sub_811CFCC(void); -static void sub_811D0BC(void); -static void sub_811D2C8(void); -static void sub_811D684(void); -static void sub_811DE90(void); -static void sub_811DEC4(void); -static void sub_811DF28(struct Sprite *); -static void sub_811DE5C(u8, u8, u8, u8); -static void sub_811E5D4(void); -static void sub_811E720(void); -static void sub_811E828(void); -static bool8 sub_811C2D4(void); -static bool8 sub_811C30C(void); -static bool8 sub_811C3E4(void); -static bool8 sub_811C48C(void); -static bool8 sub_811C404(void); -static bool8 sub_811C448(void); -static bool8 sub_811C4D0(void); -static bool8 sub_811C518(void); -static bool8 sub_811C554(void); -static bool8 sub_811C620(void); -static bool8 sub_811C830(void); -static bool8 sub_811C8F0(void); -static bool8 sub_811C99C(void); -static bool8 sub_811CA5C(void); -static bool8 sub_811C780(void); -static bool8 sub_811C78C(void); -static bool8 sub_811C7D4(void); -static bool8 sub_811CB18(void); -static bool8 sub_811CB98(void); -static bool8 sub_811CB24(void); -static bool8 sub_811CC90(void); -static bool8 sub_811CC08(void); -static bool8 sub_811C6C0(void); -static bool8 sub_811CD14(void); -static bool8 sub_811CD54(void); -static bool8 sub_811CD94(void); -static bool8 sub_811CDD4(void); -static bool8 sub_811CE14(void); -static bool8 sub_811CE54(void); -static void sub_811DF60(u8, u8); +static bool8 InitEasyChatScreenControl_(void); +static void LoadEasyChatPalettes(void); +static void InitEasyChatBgs(void); +static void AdjustBgTilemapForFooter(void); +static void BufferFrameTilemap(u16 *); +static void AddPhraseWindow(void); +static void AddMainScreenButtonWindow(void); +static void PrintTitle(void); +static void PrintInitialInstructions(void); +static void PrintCurrentPhrase(void); +static void DrawLowerWindow(void); +static void LoadEasyChatGfx(void); +static void CreateMainCursorSprite(void); +static void SpriteCB_Cursor(struct Sprite *); +static void SetWindowDimensions(u8, u8, u8, u8); +static void CreateScrollIndicatorSprites(void); +static void CreateStartSelectButtonSprites(void); +static void TryAddInterviewObjectEvents(void); +static bool8 ReprintPhrase(void); +static bool8 UpdateMainCursor(void); +static bool8 UpdateMainCursorOnButtons(void); +static bool8 ShowConfirmDeleteAllPrompt(void); +static bool8 ShowConfirmExitPrompt(void); +static bool8 ShowConfirmPrompt(void); +static bool8 ClosePrompt(void); +static bool8 ClosePromptAfterDeleteAll(void); +static bool8 OpenKeyboard(void); +static bool8 CloseKeyboard(void); +static bool8 OpenWordSelect(void); +static bool8 CloseWordSelect(void); +static bool8 ShowConfirmLyricsPrompt(void); +static bool8 ReturnToKeyboard(void); +static bool8 UpdateKeyboardCursor(void); +static bool8 GroupNamesScrollDown(void); +static bool8 GroupNamesScrollUp(void); +static bool8 UpdateWordSelectCursor(void); +static bool8 WordSelectScrollUp(void); +static bool8 WordSelectScrollDown(void); +static bool8 WordSelectPageScrollUp(void); +static bool8 WordSelectPageScrollDown(void); +static bool8 SwitchKeyboardMode(void); +static bool8 ShowCreateQuizMsg(void); +static bool8 ShowSelectAnswerMsg(void); +static bool8 ShowSongTooShortMsg(void); +static bool8 ShowCantDeleteLyricsMsg(void); +static bool8 ShowCombineTwoWordsMsg(void); +static bool8 ShowCantExitMsg(void); +static void SetMainCursorPos(u8, u8); static int GetFooterOptionXOffset(int); -static void sub_811DF90(void); -static void sub_811D104(u8); -static void sub_811D214(u8); -static void sub_811DFB0(void); -static void sub_811D6D4(void); -static void sub_811D9CC(int); -static void sub_811E3AC(void); -static bool8 sub_811E418(void); -static void sub_811DFC8(void); -static void sub_811E6E0(int); -static bool8 sub_811DAA4(void); -static void sub_811E64C(void); -static void sub_811E050(void); -static void sub_811E4AC(void); -static void sub_811E6B0(void); -static void sub_811E55C(void); -static bool8 sub_811E4D0(void); -static bool8 sub_811E5B8(void); -static void sub_811E578(void); -static void sub_811E088(void); -static void sub_811DDAC(s16, u8); -static bool8 sub_811DE10(void); -static void sub_811D9B4(void); -static void sub_811D698(u32); -static void sub_811E288(void); -static void sub_811E794(void); -static void sub_811E380(void); -static void sub_811E7F8(void); -static void sub_811E30C(void); -static void sub_811D7A4(void); -static void sub_811D7C8(void); -static int sub_811DE48(void); -static void sub_811D7EC(void); -static void sub_811D830(void); -static void sub_811D058(u8, u8, const u8 *, u8, u8, u8, u8, u8, u8); -static void sub_811DD84(void); -static void sub_811D6F4(void); -static void PrintEasyChatKeyboardText(void); -static void sub_811D794(void); +static void StopMainCursorAnim(void); +static void PrintEasyChatStdMessage(u8); +static void CreateEasyChatYesNoMenu(u8); +static void StartMainCursorAnim(void); +static void PrintKeyboardText(void); +static void InitLowerWindowAnim(int); +static void CreateSideWindowSprites(void); +static bool8 ShowSideWindow(void); +static void CreateRectangleCursorSprites(void); +static void SetScrollIndicatorXPos(bool32); +static bool8 UpdateLowerWindowAnim(void); +static void UpdateScrollIndicatorsVisibility(void); +static void DestroyRectangleCursorSprites(void); +static void HideModeWindow(void); +static void HideScrollIndicators(void); +static void SetModeWindowToTransition(void); +static bool8 DestroySideWindowSprites(void); +static bool8 IsModeWindowAnimActive(void); +static void UpdateModeWindowAnim(void); +static void UpdateRectangleCursorPos(void); +static void InitLowerWindowScroll(s16, u8); +static bool8 UpdateLowerWindowScroll(void); +static void ClearWordSelectWindow(void); +static void InitLowerWindowText(u32); +static void CreateWordSelectCursorSprite(void); +static void UpdateStartSelectButtonsVisibility(void); +static void DestroyWordSelectCursorSprite(void); +static void HideStartSelectButtons(void); +static void UpdateWordSelectCursorPos(void); +static void PrintWordSelectNextRowDown(void); +static void PrintWordSelectNextRowUp(void); +static int GetLowerWindowScrollOffset(void); +static void PrintWordSelectRowsPageDown(void); +static void PrintWordSelectRowsPageUp(void); +static void PrintEasyChatTextWithColors(u8, u8, const u8 *, u8, u8, u8, u8, u8, u8); +static void ResetLowerWindowScroll(void); +static void PrintKeyboardGroupNames(void); +static void PrintKeyboardAlphabet(void); +static void PrintInitialWordSelectText(void); static const u8 *GetEasyChatWordGroupName(u8); -static void sub_811D864(u8, u8); -static void sub_811D950(u8, u8); -static void sub_811DADC(u8); -static void sub_811DC28(int, int, int, int); -static void sub_811E0EC(s8, s8); -static void sub_811E1A4(s8, s8); -static void sub_811E2DC(struct Sprite *); -static void sub_811E34C(u8, u8); +static void PrintWordSelectText(u8, u8); +static void EraseWordSelectRows(u8, u8); +static void DrawLowerWindowFrame(u8); +static void BufferLowerWindowFrame(int, int, int, int); +static void SetRectangleCursorPos_GroupMode(s8, s8); +static void SetRectangleCursorPos_AlphabetMode(s8, s8); +static void SpriteCB_WordSelectCursor(struct Sprite *); +static void SetWordSelectCursorPos(u8, u8); static bool8 EasyChatIsNationalPokedexEnabled(void); static u16 GetRandomUnlockedEasyChatPokemon(void); -static void sub_811F2D4(void); -static void sub_811F46C(void); +static void SetUnlockedEasyChatGroups(void); +static void SetUnlockedWordsByAlphabet(void); static u8 *CopyEasyChatWordPadded(u8 *, u16, u16); -static u8 sub_811F860(u16); -static u16 sub_811F5C4(u16); -static u16 sub_811F6B8(u16); -static bool8 sub_811F764(u16, u8); -static int sub_811F838(u16); +static u8 IsEasyChatWordUnlocked(u16); +static u16 SetSelectedWordGroup_GroupMode(u16); +static u16 SetSelectedWordGroup_AlphabetMode(u16); +static bool8 IsEasyChatIndexAndGroupUnlocked(u16, u8); +static int IsRestrictedWordSpecies(u16); static void DoQuizAnswerEasyChatScreen(void); static void DoQuizQuestionEasyChatScreen(void); static void DoQuizSetAnswerEasyChatScreen(void); static void DoQuizSetQuestionEasyChatScreen(void); -struct Unk8597530 -{ - u16 word; - MainCallback callback; +#define PALTAG_TRIANGLE_CURSOR 0 +#define PALTAG_RECTANGLE_CURSOR 1 +#define PALTAG_MISC_UI 2 +#define PALTAG_3 3 + +#define GFXTAG_TRIANGLE_CURSOR 0 +#define GFXTAG_RECTANGLE_CURSOR 1 +#define GFXTAG_SCROLL_INDICATOR 2 +#define GFXTAG_START_SELECT_BUTTONS 3 +#define GFXTAG_MODE_WINDOW 4 +#define GFXTAG_5 5 +#define GFXTAG_BUTTON_WINDOW 6 + +// State values for sEasyChatScreen->inputState +// Control which input handler to use in HandleEasyChatInput +enum { + INPUTSTATE_PHRASE, + INPUTSTATE_MAIN_SCREEN_BUTTONS, + INPUTSTATE_KEYBOARD, + INPUTSTATE_WORD_SELECT, + INPUTSTATE_EXIT_PROMPT, + INPUTSTATE_DELETE_ALL_YES_NO, + INPUTSTATE_CONFIRM_WORDS_YES_NO, + INPUTSTATE_QUIZ_QUESTION, + INPUTSTATE_WAIT_FOR_MSG, + INPUTSTATE_START_CONFIRM_LYRICS, + INPUTSTATE_CONFIRM_LYRICS_YES_NO, }; -// Lilycove Quiz Lady -static const struct Unk8597530 sUnknown_08597530[] = { +// Task states for the 'main' task, Task_EasyChatScreen +enum { + MAINSTATE_FADE_IN, + MAINSTATE_HANDLE_INPUT, + MAINSTATE_RUN_FUNC, + MAINSTATE_TO_QUIZ_LADY, + MAINSTATE_EXIT, + MAINSTATE_WAIT_FADE_IN, +}; + +// IDs provided to PrintEasyChatStdMessage to print a standard message +enum { + MSG_INSTRUCTIONS, + MSG_CONFIRM_DELETE, + MSG_CONFIRM_EXIT, + MSG_CONFIRM, + MSG_CREATE_QUIZ, + MSG_SELECT_ANSWER, + MSG_SONG_TOO_SHORT, + MSG_CANT_DELETE_LYRICS, + MSG_COMBINE_TWO_WORDS, + MSG_CANT_QUIT, +}; + +// IDs for supplementary Easy Chat functions +// Returned by the input handler functions, and run +// in the main task (MAINSTATE_RUN_FUNC) +enum { + ECFUNC_NONE, + ECFUNC_REPRINT_PHRASE, + ECFUNC_UPDATE_MAIN_CURSOR, + ECFUNC_UPDATE_MAIN_CURSOR_ON_BUTTONS, + ECFUNC_PROMPT_DELETE_ALL, + ECFUNC_PROMPT_EXIT, + ECFUNC_PROMPT_CONFIRM, + ECFUNC_CLOSE_PROMPT, + ECFUNC_CLOSE_PROMPT_AFTER_DELETE, + ECFUNC_OPEN_KEYBOARD, + ECFUNC_CLOSE_KEYBOARD, + ECFUNC_OPEN_WORD_SELECT, + ECFUNC_CLOSE_WORD_SELECT, + ECFUNC_PROMPT_CONFIRM_LYRICS, + ECFUNC_RETURN_TO_KEYBOARD, + ECFUNC_UPDATE_KEYBOARD_CURSOR, + ECFUNC_GROUP_NAMES_SCROLL_DOWN, + ECFUNC_GROUP_NAMES_SCROLL_UP, + ECFUNC_UPDATE_WORD_SELECT_CURSOR, + ECFUNC_WORD_SELECT_SCROLL_UP, + ECFUNC_WORD_SELECT_SCROLL_DOWN, + ECFUNC_WORD_SELECT_PAGE_UP, + ECFUNC_WORD_SELECT_PAGE_DOWN, + ECFUNC_SWITCH_KEYBOARD_MODE, + ECFUNC_EXIT, + ECFUNC_QUIZ_QUESTION, + ECFUNC_QUIZ_ANSWER, + ECFUNC_SET_QUIZ_QUESTION, + ECFUNC_SET_QUIZ_ANSWER, + ECFUNC_MSG_CREATE_QUIZ, + ECFUNC_MSG_SELECT_ANSWER, + ECFUNC_MSG_SONG_TOO_SHORT, + ECFUNC_MSG_CANT_DELETE_LYRICS, + ECFUNC_MSG_COMBINE_TWO_WORDS, + ECFUNC_MSG_CANT_EXIT, +}; + +// IDs for InitLowerWindowText +enum { + TEXT_GROUPS, + TEXT_ALPHABET, + TEXT_WORD_SELECT, +}; + +#define NUM_ALPHABET_ROWS 4 +#define NUM_GROUP_NAME_ROWS 4 +#define NUM_WORD_SELECT_ROWS 4 +#define NUM_BUTTON_ROWS 3 + +#define NUM_ALPHABET_COLUMNS 7 +#define NUM_GROUP_NAME_COLUMNS 2 +#define NUM_WORD_SELECT_COLUMNS 2 + +enum { + FRAMEID_GENERAL_2x2, + FRAMEID_GENERAL_2x3, + FRAMEID_MAIL, + FRAMEID_COMBINE_TWO_WORDS, + FRAMEID_INTERVIEW_SHOW_PERSON, + FRAMEID_INTERVIEW, + FRAMEID_QUIZ_ANSWER, + FRAMEID_QUIZ_QUESTION, + FRAMEID_QUIZ_SET_QUESTION, +}; + +// IDs for the footer row of buttons on the main screen +enum { + FOOTER_NORMAL, + FOOTER_QUIZ, + FOOTER_ANSWER, + NUM_FOOTER_TYPES +}; + +enum { + INPUT_RIGHT, + INPUT_LEFT, + INPUT_UP, + INPUT_DOWN, + INPUT_START, + INPUT_SELECT, +}; + +// Types of animations for the lower window (keyboard/word select), given to InitLowerWindowAnim +enum { + WINANIM_OPEN_KEYBOARD, + WINANIM_CLOSE_KEYBOARD, + WINANIM_OPEN_WORD_SELECT, + WINANIM_CLOSE_WORD_SELECT, + WINANIM_RETURN_TO_KEYBOARD, + WINANIM_KEYBOARD_SWITCH_OUT, + WINANIM_KEYBOARD_SWITCH_IN, +}; + +// Values for text frame tilemap +#define FRAME_OFFSET_ORANGE 0x1000 // Orange frame, for phrase text +#define FRAME_OFFSET_GREEN 0x4000 // Green frame, for keyboard/word select + +#define FRAME_TILE_TRANSPARENT 0x0 +#define FRAME_TILE_TOP_L_CORNER 0x1 +#define FRAME_TILE_TOP_EDGE 0x2 +#define FRAME_TILE_TOP_R_CORNER 0x3 +#define FRAME_TILE_L_EDGE 0x5 +#define FRAME_TILE_R_EDGE 0x7 +#define FRAME_TILE_BOTTOM_L_CORNER 0x9 +#define FRAME_TILE_BOTTOM_EDGE 0xA +#define FRAME_TILE_BOTTOM_R_CORNER 0xB + +struct +{ + u16 funcId; + MainCallback callback; +} static const sQuizLadyEasyChatScreens[] = { { - .word = 26, + .funcId = ECFUNC_QUIZ_ANSWER, .callback = DoQuizAnswerEasyChatScreen, }, { - .word = 25, + .funcId = ECFUNC_QUIZ_QUESTION, .callback = DoQuizQuestionEasyChatScreen, }, { - .word = 28, + .funcId = ECFUNC_SET_QUIZ_ANSWER, .callback = DoQuizSetAnswerEasyChatScreen, }, { - .word = 27, + .funcId = ECFUNC_SET_QUIZ_QUESTION, .callback = DoQuizSetQuestionEasyChatScreen, }, }; @@ -265,7 +419,7 @@ static const struct EasyChatScreenTemplate sEasyChatScreenTemplates[] = { .type = EASY_CHAT_TYPE_PROFILE, .numColumns = 2, .numRows = 2, - .frameId = 0, + .frameId = FRAMEID_GENERAL_2x2, .fourFooterOptions = FALSE, .titleText = gText_Profile, .instructionsText1 = gText_CombineFourWordsOrPhrases, @@ -277,7 +431,7 @@ static const struct EasyChatScreenTemplate sEasyChatScreenTemplates[] = { .type = EASY_CHAT_TYPE_BATTLE_START, .numColumns = 2, .numRows = 3, - .frameId = 1, + .frameId = FRAMEID_GENERAL_2x3, .fourFooterOptions = FALSE, .titleText = gText_AtTheBattlesStart, .instructionsText1 = gText_CombineSixWordsOrPhrases, @@ -289,7 +443,7 @@ static const struct EasyChatScreenTemplate sEasyChatScreenTemplates[] = { .type = EASY_CHAT_TYPE_BATTLE_WON, .numColumns = 2, .numRows = 3, - .frameId = 1, + .frameId = FRAMEID_GENERAL_2x3, .fourFooterOptions = FALSE, .titleText = gText_UponWinningABattle, .instructionsText1 = gText_CombineSixWordsOrPhrases, @@ -301,7 +455,7 @@ static const struct EasyChatScreenTemplate sEasyChatScreenTemplates[] = { .type = EASY_CHAT_TYPE_BATTLE_LOST, .numColumns = 2, .numRows = 3, - .frameId = 1, + .frameId = FRAMEID_GENERAL_2x3, .fourFooterOptions = FALSE, .titleText = gText_UponLosingABattle, .instructionsText1 = gText_CombineSixWordsOrPhrases, @@ -313,7 +467,7 @@ static const struct EasyChatScreenTemplate sEasyChatScreenTemplates[] = { .type = EASY_CHAT_TYPE_MAIL, .numColumns = 2, .numRows = 5, - .frameId = 2, + .frameId = FRAMEID_MAIL, .fourFooterOptions = FALSE, .titleText = NULL, .instructionsText1 = gText_CombineNineWordsOrPhrases, @@ -325,7 +479,7 @@ static const struct EasyChatScreenTemplate sEasyChatScreenTemplates[] = { .type = EASY_CHAT_TYPE_INTERVIEW, .numColumns = 2, .numRows = 2, - .frameId = 5, + .frameId = FRAMEID_INTERVIEW, .fourFooterOptions = FALSE, .titleText = gText_Interview, .instructionsText1 = gText_CombineFourWordsOrPhrases, @@ -337,7 +491,7 @@ static const struct EasyChatScreenTemplate sEasyChatScreenTemplates[] = { .type = EASY_CHAT_TYPE_BARD_SONG, .numColumns = 2, .numRows = 3, - .frameId = 1, + .frameId = FRAMEID_GENERAL_2x3, .fourFooterOptions = FALSE, .titleText = gText_TheBardsSong, .instructionsText1 = gText_ChangeJustOneWordOrPhrase, @@ -349,7 +503,7 @@ static const struct EasyChatScreenTemplate sEasyChatScreenTemplates[] = { .type = EASY_CHAT_TYPE_FAN_CLUB, .numColumns = 1, .numRows = 1, - .frameId = 4, + .frameId = FRAMEID_INTERVIEW_SHOW_PERSON, .fourFooterOptions = FALSE, .titleText = gText_Interview, .instructionsText1 = gText_FindWordsThatDescribeYour, @@ -361,7 +515,7 @@ static const struct EasyChatScreenTemplate sEasyChatScreenTemplates[] = { .type = EASY_CHAT_TYPE_TRENDY_PHRASE, .numColumns = 2, .numRows = 1, - .frameId = 3, + .frameId = FRAMEID_COMBINE_TWO_WORDS, .fourFooterOptions = FALSE, .titleText = gText_WhatsHipAndHappening, .instructionsText1 = gText_CombineTwoWordsOrPhrases, @@ -373,7 +527,7 @@ static const struct EasyChatScreenTemplate sEasyChatScreenTemplates[] = { .type = EASY_CHAT_TYPE_QUIZ_QUESTION, .numColumns = 2, .numRows = 5, - .frameId = 7, + .frameId = FRAMEID_QUIZ_QUESTION, .fourFooterOptions = TRUE, .titleText = NULL, .instructionsText1 = gText_AfterYouHaveReadTheQuiz, @@ -385,7 +539,7 @@ static const struct EasyChatScreenTemplate sEasyChatScreenTemplates[] = { .type = EASY_CHAT_TYPE_QUIZ_ANSWER, .numColumns = 1, .numRows = 1, - .frameId = 6, + .frameId = FRAMEID_QUIZ_ANSWER, .fourFooterOptions = TRUE, .titleText = gText_TheQuizAnswerIs, .instructionsText1 = gText_OutOfTheListedChoices, @@ -397,7 +551,7 @@ static const struct EasyChatScreenTemplate sEasyChatScreenTemplates[] = { .type = EASY_CHAT_TYPE_QUIZ_SET_QUESTION, .numColumns = 2, .numRows = 5, - .frameId = 8, + .frameId = FRAMEID_QUIZ_SET_QUESTION, .fourFooterOptions = TRUE, .titleText = NULL, .instructionsText1 = gText_CombineNineWordsOrPhrases, @@ -409,7 +563,7 @@ static const struct EasyChatScreenTemplate sEasyChatScreenTemplates[] = { .type = EASY_CHAT_TYPE_QUIZ_SET_ANSWER, .numColumns = 1, .numRows = 1, - .frameId = 6, + .frameId = FRAMEID_QUIZ_ANSWER, .fourFooterOptions = TRUE, .titleText = gText_TheQuizAnswerIs, .instructionsText1 = gText_PickAWordOrPhraseAnd, @@ -421,7 +575,7 @@ static const struct EasyChatScreenTemplate sEasyChatScreenTemplates[] = { .type = EASY_CHAT_TYPE_BARD_SONG, .numColumns = 2, .numRows = 3, - .frameId = 1, + .frameId = FRAMEID_GENERAL_2x3, .fourFooterOptions = FALSE, .titleText = gText_TheBardsSong, .instructionsText1 = gText_ChangeJustOneWordOrPhrase, @@ -433,7 +587,7 @@ static const struct EasyChatScreenTemplate sEasyChatScreenTemplates[] = { .type = EASY_CHAT_TYPE_APPRENTICE, .numColumns = 2, .numRows = 3, - .frameId = 1, + .frameId = FRAMEID_GENERAL_2x3, .fourFooterOptions = FALSE, .titleText = gText_ApprenticesPhrase, .instructionsText1 = gText_FindWordsWhichFit, @@ -445,7 +599,7 @@ static const struct EasyChatScreenTemplate sEasyChatScreenTemplates[] = { .type = EASY_CHAT_TYPE_GOOD_SAYING, .numColumns = 2, .numRows = 1, - .frameId = 3, + .frameId = FRAMEID_COMBINE_TWO_WORDS, .fourFooterOptions = FALSE, .titleText = gText_GoodSaying, .instructionsText1 = gText_CombineTwoWordsOrPhrases2, @@ -457,7 +611,7 @@ static const struct EasyChatScreenTemplate sEasyChatScreenTemplates[] = { .type = EASY_CHAT_TYPE_GABBY_AND_TY, .numColumns = 1, .numRows = 1, - .frameId = 4, + .frameId = FRAMEID_INTERVIEW_SHOW_PERSON, .fourFooterOptions = FALSE, .titleText = gText_Interview, .instructionsText1 = gText_FindWordsThatDescribeYour, @@ -469,7 +623,7 @@ static const struct EasyChatScreenTemplate sEasyChatScreenTemplates[] = { .type = EASY_CHAT_TYPE_BATTLE_TOWER_INTERVIEW, .numColumns = 1, .numRows = 1, - .frameId = 4, + .frameId = FRAMEID_INTERVIEW_SHOW_PERSON, .fourFooterOptions = FALSE, .titleText = gText_Interview, .instructionsText1 = gText_FindWordsThatDescribeYour, @@ -481,7 +635,7 @@ static const struct EasyChatScreenTemplate sEasyChatScreenTemplates[] = { .type = EASY_CHAT_TYPE_CONTEST_INTERVIEW, .numColumns = 1, .numRows = 1, - .frameId = 4, + .frameId = FRAMEID_INTERVIEW_SHOW_PERSON, .fourFooterOptions = FALSE, .titleText = gText_Interview, .instructionsText1 = gText_FindWordsThatDescribeYour, @@ -493,7 +647,7 @@ static const struct EasyChatScreenTemplate sEasyChatScreenTemplates[] = { .type = EASY_CHAT_TYPE_FAN_QUESTION, .numColumns = 1, .numRows = 1, - .frameId = 4, + .frameId = FRAMEID_INTERVIEW_SHOW_PERSON, .fourFooterOptions = FALSE, .titleText = gText_FansQuestion, .instructionsText1 = gText_FindWordsWhichFit, @@ -505,7 +659,7 @@ static const struct EasyChatScreenTemplate sEasyChatScreenTemplates[] = { .type = EASY_CHAT_TYPE_QUESTIONNAIRE, .numColumns = 2, .numRows = 2, - .frameId = 0, + .frameId = FRAMEID_GENERAL_2x2, .fourFooterOptions = FALSE, .titleText = gText_Questionnaire, .instructionsText1 = gText_CombineFourWordsOrPhrases, @@ -515,14 +669,17 @@ static const struct EasyChatScreenTemplate sEasyChatScreenTemplates[] = { }, }; -static const u8 sUnknown_08597748[][7] = { +// IDs are used indirectly as indexes into gEasyChatWordsByLetterPointers +// 0 is 'Others', 1-26 are the letters A-Z +// This array maps the group IDs to the alphabet keyboard +static const u8 sAlphabetGroupIdMap[NUM_ALPHABET_ROWS][NUM_ALPHABET_COLUMNS] = { { 1, 2, 3, 4, 5, 6, 0}, { 7, 8, 9, 10, 11, 12, 0}, {13, 14, 15, 16, 17, 18, 19}, {20, 21, 22, 23, 24, 25, 26}, }; -static const u16 sMysteryGiftPhrase[] = { +static const u16 sMysteryGiftPhrase[NUM_QUESTIONNAIRE_WORDS] = { EC_WORD_LINK, EC_WORD_TOGETHER, EC_WORD_WITH, @@ -537,81 +694,81 @@ static const u16 sBerryMasterWifePhrases[][2] = { [PHRASE_SUPER_HUSTLE - 1] = {EC_WORD_SUPER, EC_WORD_HUSTLE}, }; -static const u16 sEasyChatTriangleCursorPalette[] = INCBIN_U16("graphics/easy_chat/triangle_cursor.gbapal"); -static const u32 sEasyChatTriangleCursorGfx[] = INCBIN_U32("graphics/easy_chat/triangle_cursor.4bpp"); -static const u32 sEasyChatScrollIndicatorGfx[] = INCBIN_U32("graphics/easy_chat/scroll_indicator.4bpp"); -static const u32 sEasyChatStartSelectButtonsGfx[] = INCBIN_U32("graphics/easy_chat/start_select_buttons.4bpp"); +static const u16 sTriangleCursor_Pal[] = INCBIN_U16("graphics/easy_chat/triangle_cursor.gbapal"); +static const u32 sTriangleCursor_Gfx[] = INCBIN_U32("graphics/easy_chat/triangle_cursor.4bpp"); +static const u32 sScrollIndicator_Gfx[] = INCBIN_U32("graphics/easy_chat/scroll_indicator.4bpp"); +static const u32 sStartSelectButtons_Gfx[] = INCBIN_U32("graphics/easy_chat/start_select_buttons.4bpp"); static const u16 sUnknown_085979C0[] = INCBIN_U16("graphics/misc/interview_frame.gbapal"); static const u32 sUnknown_085979E0[] = INCBIN_U32("graphics/misc/interview_frame.4bpp.lz"); -static const u16 sUnknown_08597B14[] = INCBIN_U16("graphics/misc/interview_frame_orange.gbapal"); -static const u16 sUnknown_08597B34[] = INCBIN_U16("graphics/misc/interview_frame_green.gbapal"); -static const u32 sUnknown_08597B54[] = INCBIN_U32("graphics/misc/interview_frame_2.4bpp.lz"); +static const u16 sTextInputFrameOrange_Pal[] = INCBIN_U16("graphics/easy_chat/text_input_frame_orange.gbapal"); +static const u16 sTextInputFrameGreen_Pal[] = INCBIN_U16("graphics/easy_chat/text_input_frame_green.gbapal"); +static const u32 sTextInputFrame_Gfx[] = INCBIN_U32("graphics/easy_chat/text_input_frame.4bpp.lz"); static const u16 sUnknown_08597C1C[] = INCBIN_U16("graphics/misc/8597C1C.gbapal"); static const u16 sUnknown_08597C24[] = INCBIN_U16("graphics/misc/8597C24.gbapal"); static const struct EasyChatPhraseFrameDimensions sPhraseFrameDimensions[] = { - { + [FRAMEID_GENERAL_2x2] = { .left = 3, .top = 4, .width = 24, .height = 4, - .footerId = 0, + .footerId = FOOTER_NORMAL, }, - { + [FRAMEID_GENERAL_2x3] = { .left = 3, .top = 3, .width = 24, .height = 6, - .footerId = 0, + .footerId = FOOTER_NORMAL, }, - { + [FRAMEID_MAIL] = { .left = 3, .top = 0, .width = 24, .height = 10, - .footerId = 0, + .footerId = FOOTER_NORMAL, }, - { + [FRAMEID_COMBINE_TWO_WORDS] = { .left = 3, .top = 5, .width = 24, .height = 2, - .footerId = 0, + .footerId = FOOTER_NORMAL, }, - { + [FRAMEID_INTERVIEW_SHOW_PERSON] = { .left = 16, .top = 5, .width = 12, .height = 2, - .footerId = 0, + .footerId = FOOTER_NORMAL, }, - { + [FRAMEID_INTERVIEW] = { .left = 3, .top = 4, .width = 24, .height = 4, - .footerId = 0, + .footerId = FOOTER_NORMAL, }, - { + [FRAMEID_QUIZ_ANSWER] = { .left = 9, .top = 4, .width = 12, .height = 2, - .footerId = 1, + .footerId = FOOTER_QUIZ, }, - { + [FRAMEID_QUIZ_QUESTION] = { .left = 5, .top = 3, - .width = 0x14, + .width = 20, .height = 10, - .footerId = 3, + .footerId = NUM_FOOTER_TYPES, }, - { + [FRAMEID_QUIZ_SET_QUESTION] = { .left = 3, .top = 0, .width = 24, .height = 10, - .footerId = 2, + .footerId = FOOTER_ANSWER, }, }; @@ -685,7 +842,7 @@ static const struct WindowTemplate sEasyChatWindowTemplates[] = { DUMMY_WIN_TEMPLATE, }; -static const struct WindowTemplate sEasyChatYesNoWindowTemplate = { +static const struct WindowTemplate sEasyChatYesNoWindowTemplate = { .bg = 0, .tilemapLeft = 22, .tilemapTop = 9, @@ -697,7 +854,7 @@ static const struct WindowTemplate sEasyChatYesNoWindowTemplate = { static const u8 sText_Clear17[] = _("{CLEAR 17}"); -static const u8 *const sEasyChatKeyboardText[] = +static const u8 *const sEasyChatKeyboardAlphabet[NUM_ALPHABET_ROWS] = { gText_EasyChatKeyboard_ABCDEFothers, gText_EasyChatKeyboard_GHIJKL, @@ -705,71 +862,71 @@ static const u8 *const sEasyChatKeyboardText[] = gText_EasyChatKeyboard_TUVWXYZ, }; -static const struct SpriteSheet sEasyChatSpriteSheets[] = { +static const struct SpriteSheet sSpriteSheets[] = { { - .data = sEasyChatTriangleCursorGfx, - .size = 0x0020, - .tag = 0 + .data = sTriangleCursor_Gfx, + .size = 0x20, + .tag = GFXTAG_TRIANGLE_CURSOR }, { - .data = sEasyChatScrollIndicatorGfx, - .size = 0x0100, - .tag = 2 + .data = sScrollIndicator_Gfx, + .size = 0x100, + .tag = GFXTAG_SCROLL_INDICATOR }, { - .data = sEasyChatStartSelectButtonsGfx, - .size = 0x0100, - .tag = 3 + .data = sStartSelectButtons_Gfx, + .size = 0x100, + .tag = GFXTAG_START_SELECT_BUTTONS }, {0} }; -static const struct SpritePalette sEasyChatSpritePalettes[] = { +static const struct SpritePalette sSpritePalettes[] = { { - .data = sEasyChatTriangleCursorPalette, - .tag = 0, + .data = sTriangleCursor_Pal, + .tag = PALTAG_TRIANGLE_CURSOR, }, { - .data = gEasyChatCursor_Pal, - .tag = 1, + .data = gEasyChatRectangleCursor_Pal, + .tag = PALTAG_RECTANGLE_CURSOR, }, { - .data = gEasyChatRightWindow_Pal, - .tag = 2, + .data = gEasyChatButtonWindow_Pal, + .tag = PALTAG_MISC_UI, // The palette is generated from the button window but used for various parts of the UI }, { .data = sUnknown_085979C0, - .tag = 3, + .tag = PALTAG_3, }, {0} }; -static const struct CompressedSpriteSheet sUnknown_08597CE8[] = { +static const struct CompressedSpriteSheet sCompressedSpriteSheets[] = { { .data = sUnknown_085979E0, - .size = 0x0800, - .tag = 5, + .size = 0x800, + .tag = GFXTAG_5, }, { - .data = gEasyChatCursor_Gfx, + .data = gEasyChatRectangleCursor_Gfx, .size = 0x1000, - .tag = 1, + .tag = GFXTAG_RECTANGLE_CURSOR, }, { - .data = gEasyChatRightWindow_Gfx, - .size = 0x0800, - .tag = 6, + .data = gEasyChatButtonWindow_Gfx, + .size = 0x800, + .tag = GFXTAG_BUTTON_WINDOW, }, { .data = gEasyChatMode_Gfx, .size = 0x1000, - .tag = 4, + .tag = GFXTAG_MODE_WINDOW, }, }; -static const u8 sUnknown_08597D08[] = {0, 12, 24, 56, 68, 80, 92}; +static const u8 sAlphabetKeyboardColumnOffsets[NUM_ALPHABET_COLUMNS] = {0, 12, 24, 56, 68, 80, 92}; -static const struct OamData sOamData_8597D10 = { +static const struct OamData sOamData_TriangleCursor = { .y = 0, .affineMode = ST_OAM_AFFINE_OFF, .objMode = ST_OAM_OBJ_NORMAL, @@ -785,17 +942,17 @@ static const struct OamData sOamData_8597D10 = { .affineParam = 0, }; -static const struct SpriteTemplate sUnknown_08597D18 = { - .tileTag = 0, - .paletteTag = 0, - .oam = &sOamData_8597D10, +static const struct SpriteTemplate sSpriteTemplate_TriangleCursor = { + .tileTag = PALTAG_TRIANGLE_CURSOR, + .paletteTag = GFXTAG_TRIANGLE_CURSOR, + .oam = &sOamData_TriangleCursor, .anims = gDummySpriteAnimTable, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_811DF28, + .callback = SpriteCB_Cursor, }; -static const struct OamData sUnknown_08597D30 = { +static const struct OamData sOamData_RectangleCursor = { .y = 0, .affineMode = ST_OAM_AFFINE_OFF, .objMode = ST_OAM_OBJ_NORMAL, @@ -811,44 +968,52 @@ static const struct OamData sUnknown_08597D30 = { .affineParam = 0, }; -static const union AnimCmd sUnknown_08597D38[] = { +static const union AnimCmd sAnim_RectangleCursor_OnGroup[] = { ANIMCMD_FRAME(0, 0), ANIMCMD_END, }; -static const union AnimCmd sUnknown_08597D40[] = { +static const union AnimCmd sAnim_RectangleCursor_OnButton[] = { ANIMCMD_FRAME(32, 0), ANIMCMD_END, }; -static const union AnimCmd sUnknown_08597D48[] = { +static const union AnimCmd sAnim_RectangleCursor_OnOthers[] = { ANIMCMD_FRAME(64, 0), ANIMCMD_END, }; -static const union AnimCmd sUnknown_08597D50[] = { +static const union AnimCmd sAnim_RectangleCursor_OnLetter[] = { ANIMCMD_FRAME(96, 0), ANIMCMD_END, }; -static const union AnimCmd *const sUnknown_08597D58[] = { - sUnknown_08597D38, - sUnknown_08597D40, - sUnknown_08597D48, - sUnknown_08597D50, +// Each anim changes the width of the rectangle cursor to fit what it should be selecting +enum { + RECTCURSOR_ANIM_ON_GROUP, + RECTCURSOR_ANIM_ON_BUTTON, + RECTCURSOR_ANIM_ON_OTHERS, + RECTCURSOR_ANIM_ON_LETTER, }; -static const struct SpriteTemplate sUnknown_08597D68 = { - .tileTag = 1, - .paletteTag = 1, - .oam = &sUnknown_08597D30, - .anims = sUnknown_08597D58, +static const union AnimCmd *const sAnims_RectangleCursor[] = { + [RECTCURSOR_ANIM_ON_GROUP] = sAnim_RectangleCursor_OnGroup, + [RECTCURSOR_ANIM_ON_BUTTON] = sAnim_RectangleCursor_OnButton, + [RECTCURSOR_ANIM_ON_OTHERS] = sAnim_RectangleCursor_OnOthers, + [RECTCURSOR_ANIM_ON_LETTER] = sAnim_RectangleCursor_OnLetter, +}; + +static const struct SpriteTemplate sSpriteTemplate_RectangleCursor = { + .tileTag = GFXTAG_RECTANGLE_CURSOR, + .paletteTag = PALTAG_RECTANGLE_CURSOR, + .oam = &sOamData_RectangleCursor, + .anims = sAnims_RectangleCursor, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_811DF28, + .callback = SpriteCB_Cursor, }; -static const struct OamData sUnknown_08597D80 = { +static const struct OamData sOamData_ModeWindow = { .y = 0, .affineMode = ST_OAM_AFFINE_OFF, .objMode = ST_OAM_OBJ_NORMAL, @@ -864,53 +1029,61 @@ static const struct OamData sUnknown_08597D80 = { .affineParam = 0, }; -static const union AnimCmd sUnknown_08597D88[] = { +static const union AnimCmd sAnim_ModeWindow_Hidden[] = { ANIMCMD_FRAME(96, 0), ANIMCMD_END, }; -static const union AnimCmd sUnknown_08597D90[] = { - ANIMCMD_FRAME(64, 4), - ANIMCMD_FRAME(32, 4), +static const union AnimCmd sAnim_ModeWindow_ToGroup[] = { + ANIMCMD_FRAME(64, 4), // Transition frame + ANIMCMD_FRAME(32, 4), // 'Group' frame ANIMCMD_END, }; -static const union AnimCmd sUnknown_08597D9C[] = { - ANIMCMD_FRAME(64, 4), - ANIMCMD_FRAME(0, 4), +static const union AnimCmd sAnim_ModeWindow_ToAlphabet[] = { + ANIMCMD_FRAME(64, 4), // Transition frame + ANIMCMD_FRAME(0, 4), // 'A-Z' frame ANIMCMD_END, }; -static const union AnimCmd sUnknown_08597DA8[] = { - ANIMCMD_FRAME(64, 4), - ANIMCMD_FRAME(96, 0), +static const union AnimCmd sAnim_ModeWindow_ToHidden[] = { + ANIMCMD_FRAME(64, 4), // Transition frame + ANIMCMD_FRAME(96, 0), // Hidden frame ANIMCMD_END, }; -static const union AnimCmd sUnknown_08597DB4[] = { +static const union AnimCmd sAnim_ModeWindow_Transition[] = { ANIMCMD_FRAME(64, 4), ANIMCMD_END, }; -static const union AnimCmd *const sUnknown_08597DBC[] = { - sUnknown_08597D88, - sUnknown_08597D90, - sUnknown_08597D9C, - sUnknown_08597DA8, - sUnknown_08597DB4, +enum { + MODEWINDOW_ANIM_HIDDEN, + MODEWINDOW_ANIM_TO_GROUP, + MODEWINDOW_ANIM_TO_ALPHABET, + MODEWINDOW_ANIM_TO_HIDDEN, + MODEWINDOW_ANIM_TRANSITION, }; -static const struct SpriteTemplate sUnknown_08597DD0 = { - .tileTag = 4, - .paletteTag = 2, - .oam = &sUnknown_08597D80, - .anims = sUnknown_08597DBC, +static const union AnimCmd *const sAnims_ModeWindow[] = { + [MODEWINDOW_ANIM_HIDDEN] = sAnim_ModeWindow_Hidden, + [MODEWINDOW_ANIM_TO_GROUP] = sAnim_ModeWindow_ToGroup, + [MODEWINDOW_ANIM_TO_ALPHABET] = sAnim_ModeWindow_ToAlphabet, + [MODEWINDOW_ANIM_TO_HIDDEN] = sAnim_ModeWindow_ToHidden, + [MODEWINDOW_ANIM_TRANSITION] = sAnim_ModeWindow_Transition, +}; + +static const struct SpriteTemplate sSpriteTemplate_ModeWindow = { + .tileTag = GFXTAG_MODE_WINDOW, + .paletteTag = PALTAG_MISC_UI, + .oam = &sOamData_ModeWindow, + .anims = sAnims_ModeWindow, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, .callback = SpriteCallbackDummy, }; -static const struct OamData sUnknown_08597DE8 = { +static const struct OamData sOamData_ButtonWindow = { .y = 0, .affineMode = ST_OAM_AFFINE_OFF, .objMode = ST_OAM_OBJ_NORMAL, @@ -926,17 +1099,17 @@ static const struct OamData sUnknown_08597DE8 = { .affineParam = 0, }; -static const struct SpriteTemplate sUnknown_08597DF0 = { - .tileTag = 6, - .paletteTag = 2, - .oam = &sUnknown_08597DE8, +static const struct SpriteTemplate sSpriteTemplate_ButtonWindow = { + .tileTag = GFXTAG_BUTTON_WINDOW, + .paletteTag = PALTAG_MISC_UI, + .oam = &sOamData_ButtonWindow, .anims = gDummySpriteAnimTable, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, .callback = SpriteCallbackDummy, }; -static const struct OamData sUnknown_08597E08 = { +static const struct OamData sOamData_StartSelectButton = { .y = 0, .affineMode = ST_OAM_AFFINE_OFF, .objMode = ST_OAM_OBJ_NORMAL, @@ -952,7 +1125,7 @@ static const struct OamData sUnknown_08597E08 = { .affineParam = 0, }; -static const struct OamData gUnknown_08597E10 = { +static const struct OamData sOamData_ScrollIndicator = { .y = 0, .affineMode = ST_OAM_AFFINE_OFF, .objMode = ST_OAM_OBJ_NORMAL, @@ -968,89 +1141,90 @@ static const struct OamData gUnknown_08597E10 = { .affineParam = 0, }; -static const union AnimCmd sUnknown_08597E18[] = { +static const union AnimCmd sAnim_Frame0[] = { ANIMCMD_FRAME(0, 0), ANIMCMD_END, }; -static const union AnimCmd sUnknown_08597E20[] = { +static const union AnimCmd sAnim_Frame1[] = { ANIMCMD_FRAME(4, 0), ANIMCMD_END, }; -static const union AnimCmd *const sUnknown_08597E28[] = { - sUnknown_08597E18, - sUnknown_08597E20, +// Frame0 is Start button, Frame1 is Select button, both are identical for the scroll indicators +static const union AnimCmd *const sAnims_TwoFrame[] = { + sAnim_Frame0, + sAnim_Frame1, }; -static const struct SpriteTemplate sUnknown_08597E30 = { - .tileTag = 3, - .paletteTag = 2, - .oam = &sUnknown_08597E08, - .anims = sUnknown_08597E28, +static const struct SpriteTemplate sSpriteTemplate_StartSelectButton = { + .tileTag = GFXTAG_START_SELECT_BUTTONS, + .paletteTag = PALTAG_MISC_UI, + .oam = &sOamData_StartSelectButton, + .anims = sAnims_TwoFrame, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, .callback = SpriteCallbackDummy, }; -static const struct SpriteTemplate sUnknown_08597E48 = { - .tileTag = 2, - .paletteTag = 2, - .oam = &gUnknown_08597E10, - .anims = sUnknown_08597E28, +static const struct SpriteTemplate sSpriteTemplate_ScrollIndicator = { + .tileTag = GFXTAG_SCROLL_INDICATOR, + .paletteTag = PALTAG_MISC_UI, + .oam = &sOamData_ScrollIndicator, + .anims = sAnims_TwoFrame, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, .callback = SpriteCallbackDummy, }; -static const u8 sFooterOptionXOffsets[][4] = { - {16, 111, 196, 0}, - {16, 78, 130, 160}, - {16, 80, 134, 170}, +static const u8 sFooterOptionXOffsets[NUM_FOOTER_TYPES][4] = { + [FOOTER_NORMAL] = {16, 111, 196, 0}, + [FOOTER_QUIZ] = {16, 78, 130, 160}, + [FOOTER_ANSWER] = {16, 80, 134, 170}, }; -static const u8 *const sFooterTextOptions[][4] = { - {gText_DelAll, gText_Cancel5, gText_Ok2, NULL}, - {gText_DelAll, gText_Cancel5, gText_Ok2, gText_Quiz}, - {gText_DelAll, gText_Cancel5, gText_Ok2, gText_Answer}, +static const u8 *const sFooterTextOptions[NUM_FOOTER_TYPES][4] = { + [FOOTER_NORMAL] = {gText_DelAll, gText_Cancel5, gText_Ok2, NULL}, + [FOOTER_QUIZ] = {gText_DelAll, gText_Cancel5, gText_Ok2, gText_Quiz}, + [FOOTER_ANSWER] = {gText_DelAll, gText_Cancel5, gText_Ok2, gText_Answer}, }; #include "data/easy_chat/easy_chat_groups.h" #include "data/easy_chat/easy_chat_words_by_letter.h" -const u8 *const gEasyChatGroupNamePointers[] = { - [EC_GROUP_POKEMON] = gEasyChatGroupName_Pokemon, - [EC_GROUP_TRAINER] = gEasyChatGroupName_Trainer, - [EC_GROUP_STATUS] = gEasyChatGroupName_Status, - [EC_GROUP_BATTLE] = gEasyChatGroupName_Battle, - [EC_GROUP_GREETINGS] = gEasyChatGroupName_Greetings, - [EC_GROUP_PEOPLE] = gEasyChatGroupName_People, - [EC_GROUP_VOICES] = gEasyChatGroupName_Voices, - [EC_GROUP_SPEECH] = gEasyChatGroupName_Speech, - [EC_GROUP_ENDINGS] = gEasyChatGroupName_Endings, - [EC_GROUP_FEELINGS] = gEasyChatGroupName_Feelings, - [EC_GROUP_CONDITIONS] = gEasyChatGroupName_Conditions, - [EC_GROUP_ACTIONS] = gEasyChatGroupName_Actions, - [EC_GROUP_LIFESTYLE] = gEasyChatGroupName_Lifestyle, - [EC_GROUP_HOBBIES] = gEasyChatGroupName_Hobbies, - [EC_GROUP_TIME] = gEasyChatGroupName_Time, - [EC_GROUP_MISC] = gEasyChatGroupName_Misc, - [EC_GROUP_ADJECTIVES] = gEasyChatGroupName_Adjectives, - [EC_GROUP_EVENTS] = gEasyChatGroupName_Events, - [EC_GROUP_MOVE_1] = gEasyChatGroupName_Move1, - [EC_GROUP_MOVE_2] = gEasyChatGroupName_Move2, - [EC_GROUP_TRENDY_SAYING] = gEasyChatGroupName_TrendySaying, - [EC_GROUP_POKEMON_2] = gEasyChatGroupName_Pokemon2, +static const u8 *const sEasyChatGroupNamePointers[EC_NUM_GROUPS] = { + [EC_GROUP_POKEMON] = gEasyChatGroupName_Pokemon, + [EC_GROUP_TRAINER] = gEasyChatGroupName_Trainer, + [EC_GROUP_STATUS] = gEasyChatGroupName_Status, + [EC_GROUP_BATTLE] = gEasyChatGroupName_Battle, + [EC_GROUP_GREETINGS] = gEasyChatGroupName_Greetings, + [EC_GROUP_PEOPLE] = gEasyChatGroupName_People, + [EC_GROUP_VOICES] = gEasyChatGroupName_Voices, + [EC_GROUP_SPEECH] = gEasyChatGroupName_Speech, + [EC_GROUP_ENDINGS] = gEasyChatGroupName_Endings, + [EC_GROUP_FEELINGS] = gEasyChatGroupName_Feelings, + [EC_GROUP_CONDITIONS] = gEasyChatGroupName_Conditions, + [EC_GROUP_ACTIONS] = gEasyChatGroupName_Actions, + [EC_GROUP_LIFESTYLE] = gEasyChatGroupName_Lifestyle, + [EC_GROUP_HOBBIES] = gEasyChatGroupName_Hobbies, + [EC_GROUP_TIME] = gEasyChatGroupName_Time, + [EC_GROUP_MISC] = gEasyChatGroupName_Misc, + [EC_GROUP_ADJECTIVES] = gEasyChatGroupName_Adjectives, + [EC_GROUP_EVENTS] = gEasyChatGroupName_Events, + [EC_GROUP_MOVE_1] = gEasyChatGroupName_Move1, + [EC_GROUP_MOVE_2] = gEasyChatGroupName_Move2, + [EC_GROUP_TRENDY_SAYING] = gEasyChatGroupName_TrendySaying, + [EC_GROUP_POKEMON_NATIONAL] = gEasyChatGroupName_Pokemon2, }; -static const u16 sDefaultProfileWords[] = { +static const u16 sDefaultProfileWords[EASY_CHAT_BATTLE_WORDS_COUNT - 2] = { EC_WORD_I_AM, EC_WORD_A, EC_WORD_POKEMON, EC_WORD_FRIEND, }; -static const u16 sDefaultBattleStartWords[] = { +static const u16 sDefaultBattleStartWords[EASY_CHAT_BATTLE_WORDS_COUNT] = { EC_WORD_ARE, EC_WORD_YOU, EC_WORD_READY, @@ -1059,7 +1233,7 @@ static const u16 sDefaultBattleStartWords[] = { EC_WORD_EXCL, }; -static const u16 sUnknown_0859E640[] = { +static const u16 sDefaultBattleWonWords[EASY_CHAT_BATTLE_WORDS_COUNT] = { EC_WORD_YAY, EC_WORD_YAY, EC_WORD_EXCL_EXCL, @@ -1068,7 +1242,7 @@ static const u16 sUnknown_0859E640[] = { EC_WORD_EXCL_EXCL, }; -static const u16 sUnknown_0859E64C[] = { +static const u16 sDefaultBattleLostWords[EASY_CHAT_BATTLE_WORDS_COUNT] = { EC_WORD_TOO, EC_WORD_BAD, EC_WORD_ELLIPSIS, @@ -1077,24 +1251,40 @@ static const u16 sUnknown_0859E64C[] = { EC_WORD_ELLIPSIS, }; -static const u16 sUnknown_0859E658[] = { +static const u16 sRestrictedWordSpecies[] = { SPECIES_DEOXYS, }; -void DoEasyChatScreen(u8 type, u16 *words, MainCallback callback, u8 displayedPersonType) + +// In addition to the task defines below, these two elements +// have their indexes used explicitly because they are 4-byte +// pointers, and occupy the next data element as well. +// SetWordTaskArg/GetWordTaskArg use these defines to +// read the pointer from the two elements +#define TASKIDX_WORDS 2 +#define TASKIDX_EXIT_CALLBACK 4 + +#define tState data[0] +#define tType data[1] +#define tWords data[TASKIDX_WORDS] // Occupies 2 and 3 +#define tExitCallback data[TASKIDX_EXIT_CALLBACK] // Occupies 4 and 5 +#define tFuncId data[6] +#define tPersonType data[7] + +void DoEasyChatScreen(u8 type, u16 *words, MainCallback exitCallback, u8 displayedPersonType) { u8 taskId; ResetTasks(); - taskId = CreateTask(sub_811A2C0, 0); - gTasks[taskId].data[EZCHAT_TASK_TYPE] = type; - gTasks[taskId].data[EZCHAT_TASK_SIZE] = displayedPersonType; - SetWordTaskArg(taskId, EZCHAT_TASK_WORDS, (u32)words); - SetWordTaskArg(taskId, EZCHAT_TASK_MAINCALLBACK, (u32)callback); - SetMainCallback2(MainCallback_EasyChatScreen); + taskId = CreateTask(Task_InitEasyChatScreen, 0); + gTasks[taskId].tType = type; + gTasks[taskId].tPersonType = displayedPersonType; + SetWordTaskArg(taskId, TASKIDX_WORDS, (u32)words); + SetWordTaskArg(taskId, TASKIDX_EXIT_CALLBACK, (u32)exitCallback); + SetMainCallback2(CB2_EasyChatScreen); } -static void MainCallback_EasyChatScreen(void) +static void CB2_EasyChatScreen(void) { RunTasks(); AnimateSprites(); @@ -1102,94 +1292,97 @@ static void MainCallback_EasyChatScreen(void) UpdatePaletteFade(); } -static void VBlankCallback_EasyChatScreen(void) +static void VBlankCB_EasyChatScreen(void) { TransferPlttBuffer(); LoadOam(); ProcessSpriteCopyRequests(); } -static void sub_811A2A4(u8 taskId, TaskFunc taskFunc) +static void StartEasyChatScreen(u8 taskId, TaskFunc taskFunc) { gTasks[taskId].func = taskFunc; - gTasks[taskId].data[EZCHAT_TASK_STATE] = 0; + gTasks[taskId].tState = MAINSTATE_FADE_IN; } -static void sub_811A2C0(u8 taskId) +static void Task_InitEasyChatScreen(u8 taskId) { if (!IsUpdateLinkStateCBActive()) { - while (sub_811A428(taskId)); + while (InitEasyChatScreen(taskId)); } else { - if (sub_811A428(taskId) == TRUE) - { + if (InitEasyChatScreen(taskId) == TRUE) return; - } } - sub_811A2A4(taskId, sub_811A2FC); + StartEasyChatScreen(taskId, Task_EasyChatScreen); } -static void sub_811A2FC(u8 taskId) +// After loading, this is the 'main' Easy Chat task +static void Task_EasyChatScreen(u8 taskId) { - u16 v0; + u16 funcId; s16 *data; data = gTasks[taskId].data; - switch (data[EZCHAT_TASK_STATE]) + switch (tState) { - case 0: - SetVBlankCallback(VBlankCallback_EasyChatScreen); + case MAINSTATE_FADE_IN: + SetVBlankCallback(VBlankCB_EasyChatScreen); BlendPalettes(0xFFFFFFFF, 16, 0); BeginNormalPaletteFade(0xFFFFFFFF, -1, 16, 0, RGB_BLACK); - data[EZCHAT_TASK_STATE] = 5; + tState = MAINSTATE_WAIT_FADE_IN; break; - case 1: - v0 = sub_811AAAC(); - if (sub_811A88C(v0)) + case MAINSTATE_HANDLE_INPUT: + funcId = HandleEasyChatInput(); + if (IsFuncIdForQuizLadyScreen(funcId)) { + // Fade to Quiz Lady screen BeginNormalPaletteFade(0xFFFFFFFF, -2, 0, 16, RGB_BLACK); - data[EZCHAT_TASK_STATE] = 3; - data[EZCHAT_TASK_UNK06] = v0; + tState = MAINSTATE_TO_QUIZ_LADY; + tFuncId = funcId; } - else if (v0 == 0x18) + else if (funcId == ECFUNC_EXIT) { + // Fade and exit Easy Chat BeginNormalPaletteFade(0xFFFFFFFF, -1, 0, 16, RGB_BLACK); - data[EZCHAT_TASK_STATE] = 4; + tState = MAINSTATE_EXIT; } - else if (v0 != 0) + else if (funcId != ECFUNC_NONE) { PlaySE(SE_SELECT); - sub_811C158(v0); - data[EZCHAT_TASK_STATE] ++; + StartEasyChatFunction(funcId); + tState++; // MAINSTATE_RUN_FUNC } break; - case 2: - if (!sub_811C170()) - data[EZCHAT_TASK_STATE] = 1; + case MAINSTATE_RUN_FUNC: + if (!RunEasyChatFunction()) + tState = MAINSTATE_HANDLE_INPUT; break; - case 3: + case MAINSTATE_TO_QUIZ_LADY: if (!gPaletteFade.active) - sub_811A8A4(data[EZCHAT_TASK_UNK06]); + EnterQuizLadyScreen(tFuncId); break; - case 4: + case MAINSTATE_EXIT: if (!gPaletteFade.active) - sub_811A4D0((MainCallback)GetWordTaskArg(taskId, EZCHAT_TASK_MAINCALLBACK)); + ExitEasyChatScreen((MainCallback)GetWordTaskArg(taskId, TASKIDX_EXIT_CALLBACK)); break; - case 5: + case MAINSTATE_WAIT_FADE_IN: if (!gPaletteFade.active) - data[EZCHAT_TASK_STATE] = 1; + tState = MAINSTATE_HANDLE_INPUT; break; } } -static bool8 sub_811A428(u8 taskId) +// Returns TRUE if still initializing, FALSE when finished +// If an allocation fails it will switch to the exit callback +static bool8 InitEasyChatScreen(u8 taskId) { s16 *data; data = gTasks[taskId].data; - switch (data[EZCHAT_TASK_STATE]) + switch (tState) { case 0: SetVBlankCallback(NULL); @@ -1198,25 +1391,28 @@ static bool8 sub_811A428(u8 taskId) ResetPaletteFade(); break; case 1: - if (!sub_811F28C()) + if (!InitEasyChatScreenWordData()) { - sub_811A4D0((MainCallback)GetWordTaskArg(taskId, EZCHAT_TASK_MAINCALLBACK)); + // Alloc failed, exit + ExitEasyChatScreen((MainCallback)GetWordTaskArg(taskId, TASKIDX_EXIT_CALLBACK)); } break; case 2: - if (!EasyChat_AllocateResources(data[EZCHAT_TASK_TYPE], (u16 *)GetWordTaskArg(taskId, EZCHAT_TASK_WORDS), data[EZCHAT_TASK_SIZE])) + if (!InitEasyChatScreenStruct(tType, (u16 *)GetWordTaskArg(taskId, TASKIDX_WORDS), tPersonType)) { - sub_811A4D0((MainCallback)GetWordTaskArg(taskId, EZCHAT_TASK_MAINCALLBACK)); + // Alloc failed, exit + ExitEasyChatScreen((MainCallback)GetWordTaskArg(taskId, TASKIDX_EXIT_CALLBACK)); } break; case 3: - if (!sub_811BF8C()) + if (!InitEasyChatScreenControl()) { - sub_811A4D0((MainCallback)GetWordTaskArg(taskId, EZCHAT_TASK_MAINCALLBACK)); + // Alloc failed, exit + ExitEasyChatScreen((MainCallback)GetWordTaskArg(taskId, TASKIDX_EXIT_CALLBACK)); } break; case 4: - if (sub_811BFA4()) + if (LoadEasyChatScreen()) { return TRUE; } @@ -1224,15 +1420,15 @@ static bool8 sub_811A428(u8 taskId) default: return FALSE; } - data[EZCHAT_TASK_STATE] ++; + tState++; return TRUE; } -static void sub_811A4D0(MainCallback callback) +static void ExitEasyChatScreen(MainCallback callback) { - sub_811C13C(); - EasyChat_FreeResources(); - sub_811F2B8(); + FreeEasyChatScreenControl(); + FreeEasyChatScreenStruct(); + FreeEasyChatScreenWordData(); FreeAllWindowBuffers(); SetMainCallback2(callback); } @@ -1286,7 +1482,7 @@ void ShowEasyChatScreen(void) break; case EASY_CHAT_TYPE_GABBY_AND_TY: words = gSaveBlock1Ptr->gabbyAndTyData.quote; - *words = -1; + *words = EC_EMPTY_WORD; displayedPersonType = EASY_CHAT_PERSON_REPORTER_FEMALE; break; case EASY_CHAT_TYPE_CONTEST_INTERVIEW: @@ -1303,7 +1499,7 @@ void ShowEasyChatScreen(void) break; case EASY_CHAT_TYPE_FAN_QUESTION: words = gSaveBlock1Ptr->tvShows[gSpecialVar_0x8005].fanClubSpecial.words; - words[0] = -1; + words[0] = EC_EMPTY_WORD; displayedPersonType = EASY_CHAT_PERSON_BOY; break; case EASY_CHAT_TYPE_QUIZ_ANSWER: @@ -1321,7 +1517,7 @@ void ShowEasyChatScreen(void) words = gSaveBlock2Ptr->apprentices[0].speechWon; break; case EASY_CHAT_TYPE_QUESTIONNAIRE: - words = sub_801B058(); + words = GetQuestionnaireWordsPtr(); break; default: return; @@ -1345,7 +1541,7 @@ static void CB2_QuizLadyQuestion(void) if (!gPaletteFade.active) { lilycoveLady = &gSaveBlock1Ptr->lilycoveLady; - lilycoveLady->quiz.playerAnswer = -1; + lilycoveLady->quiz.playerAnswer = EC_EMPTY_WORD; CleanupOverworldWindowsAndTilemaps(); DoQuizQuestionEasyChatScreen(); } @@ -1359,30 +1555,30 @@ void QuizLadyShowQuizQuestion(void) SetMainCallback2(CB2_QuizLadyQuestion); } -static int sub_811A868(u16 word) +static int GetQuizLadyScreenByFuncId(u16 funcId) { int i; - for (i = 0; i < ARRAY_COUNT(sUnknown_08597530); i ++) + for (i = 0; i < ARRAY_COUNT(sQuizLadyEasyChatScreens); i ++) { - if (word == sUnknown_08597530[i].word) + if (funcId == sQuizLadyEasyChatScreens[i].funcId) return i; } return -1; } -static bool32 sub_811A88C(u16 word) +static bool32 IsFuncIdForQuizLadyScreen(u16 funcId) { - return sub_811A868(word) == -1 ? FALSE : TRUE; + return GetQuizLadyScreenByFuncId(funcId) == -1 ? FALSE : TRUE; } -static void sub_811A8A4(u16 word) +static void EnterQuizLadyScreen(u16 funcId) { int i; - i = sub_811A868(word); + i = GetQuizLadyScreenByFuncId(funcId); ResetTasks(); - sub_811A4D0(sUnknown_08597530[i].callback); + ExitEasyChatScreen(sQuizLadyEasyChatScreens[i].callback); } static void DoQuizAnswerEasyChatScreen(void) @@ -1418,7 +1614,7 @@ static void DoQuizSetQuestionEasyChatScreen(void) EASY_CHAT_PERSON_DISPLAY_NONE); } -static bool8 EasyChat_AllocateResources(u8 type, u16 *words, u8 displayedPersonType) +static bool8 InitEasyChatScreenStruct(u8 type, u16 *words, u8 displayedPersonType) { u8 templateId; int i; @@ -1428,116 +1624,121 @@ static bool8 EasyChat_AllocateResources(u8 type, u16 *words, u8 displayedPersonT return FALSE; sEasyChatScreen->type = type; - sEasyChatScreen->words = words; + sEasyChatScreen->savedPhrase = words; sEasyChatScreen->mainCursorColumn = 0; sEasyChatScreen->mainCursorRow = 0; - sEasyChatScreen->unk_09 = 0; + sEasyChatScreen->inAlphabetMode = FALSE; sEasyChatScreen->displayedPersonType = displayedPersonType; - sEasyChatScreen->unk_13 = 0; + sEasyChatScreen->unused = 0; templateId = GetEachChatScreenTemplateId(type); if (type == EASY_CHAT_TYPE_QUIZ_QUESTION) { - sub_811BDF0(sEasyChatScreen->unk_14); - sEasyChatScreen->titleText = sEasyChatScreen->unk_14; - sEasyChatScreen->state = 7; + GetQuizTitle(sEasyChatScreen->quizTitle); + sEasyChatScreen->titleText = sEasyChatScreen->quizTitle; + sEasyChatScreen->inputState = INPUTSTATE_QUIZ_QUESTION; } else { - sEasyChatScreen->state = 0; + sEasyChatScreen->inputState = INPUTSTATE_PHRASE; sEasyChatScreen->titleText = sEasyChatScreenTemplates[templateId].titleText; } sEasyChatScreen->numColumns = sEasyChatScreenTemplates[templateId].numColumns; sEasyChatScreen->numRows = sEasyChatScreenTemplates[templateId].numRows; - sEasyChatScreen->unk_07 = sEasyChatScreen->numColumns * sEasyChatScreen->numRows; + sEasyChatScreen->maxWords = sEasyChatScreen->numColumns * sEasyChatScreen->numRows; sEasyChatScreen->templateId = templateId; - if (sEasyChatScreen->unk_07 > 9) - sEasyChatScreen->unk_07 = 9; + if (sEasyChatScreen->maxWords > ARRAY_COUNT(sEasyChatScreen->currentPhrase)) + sEasyChatScreen->maxWords = ARRAY_COUNT(sEasyChatScreen->currentPhrase); if (words != NULL) { - CpuCopy16(words, sEasyChatScreen->ecWordBuffer, sEasyChatScreen->unk_07 * sizeof(u16)); + // Phrase starts with words filled in, copy to current phrase + CpuCopy16(words, sEasyChatScreen->currentPhrase, sEasyChatScreen->maxWords * sizeof(u16)); } else { - for (i = 0; i < sEasyChatScreen->unk_07; i ++) - sEasyChatScreen->ecWordBuffer[i] = -1; + // Phrase starts with no words, fill with empty words and save + for (i = 0; i < sEasyChatScreen->maxWords; i ++) + sEasyChatScreen->currentPhrase[i] = EC_EMPTY_WORD; - sEasyChatScreen->words = sEasyChatScreen->ecWordBuffer; + sEasyChatScreen->savedPhrase = sEasyChatScreen->currentPhrase; } - sEasyChatScreen->unk_0d = (sub_811F3AC() - 1) / 2 + 1; + sEasyChatScreen->keyboardLastRow = (GetNumUnlockedEasyChatGroups() - 1) / 2 + 1; return TRUE; } -static void EasyChat_FreeResources(void) +static void FreeEasyChatScreenStruct(void) { if (sEasyChatScreen != NULL) FREE_AND_SET_NULL(sEasyChatScreen); } -static u16 sub_811AAAC(void) +// Returns the function ID of the action to take as a result of player's input. +// If no action is needed, returns ECFUNC_NONE +static u16 HandleEasyChatInput(void) { - switch (sEasyChatScreen->state) + switch (sEasyChatScreen->inputState) { - case 0: - return sub_811AB68(); - case 1: - return sub_811ACDC(); - case 2: - return sub_811AE44(); - case 3: - return sub_811AF00(); - case 4: - return sub_811AF8C(); - case 5: - return sub_811B040(); - case 6: - return sub_811AFEC(); - case 7: - return sub_811B08C(); - case 8: - return sub_811B0BC(); - case 9: - return sub_811B0E8(); - case 10: - return sub_811B0F8(); + case INPUTSTATE_PHRASE: + return HandleEasyChatInput_Phrase(); + case INPUTSTATE_MAIN_SCREEN_BUTTONS: + return HandleEasyChatInput_MainScreenButtons(); + case INPUTSTATE_KEYBOARD: + return HandleEasyChatInput_Keyboard(); + case INPUTSTATE_WORD_SELECT: + return HandleEasyChatInput_WordSelect(); + case INPUTSTATE_EXIT_PROMPT: + return HandleEasyChatInput_ExitPrompt(); + case INPUTSTATE_DELETE_ALL_YES_NO: + return HandleEasyChatInput_DeleteAllYesNo(); + case INPUTSTATE_CONFIRM_WORDS_YES_NO: + return HandleEasyChatInput_ConfirmWordsYesNo(); + case INPUTSTATE_QUIZ_QUESTION: + return HandleEasyChatInput_QuizQuestion(); + case INPUTSTATE_WAIT_FOR_MSG: + return HandleEasyChatInput_WaitForMsg(); + case INPUTSTATE_START_CONFIRM_LYRICS: + return HandleEasyChatInput_StartConfirmLyrics(); + case INPUTSTATE_CONFIRM_LYRICS_YES_NO: + return HandleEasyChatInput_ConfirmLyricsYesNo(); } - return 0; + return ECFUNC_NONE; } -bool32 sub_811AB44(void) +static bool32 IsCurrentFrame2x5(void) { switch (GetEasyChatScreenFrameId()) { - case 2: - case 7: - case 8: + case FRAMEID_MAIL: + case FRAMEID_QUIZ_QUESTION: + case FRAMEID_QUIZ_SET_QUESTION: return TRUE; } return FALSE; } -static u16 sub_811AB68(void) +// Handles main screen input while cursor is on a word in the phrase +static u16 HandleEasyChatInput_Phrase(void) { do { if (JOY_NEW(A_BUTTON)) { - sub_811BF78(); - sEasyChatScreen->state = 2; - sEasyChatScreen->unk_0a = 0; - sEasyChatScreen->unk_0b = 0; - sEasyChatScreen->unk_0c = 0; - return 9; + ClearUnusedField(); + sEasyChatScreen->inputState = INPUTSTATE_KEYBOARD; + sEasyChatScreen->keyboardColumn = 0; + sEasyChatScreen->keyboardRow = 0; + sEasyChatScreen->keyboardScrollOffset = 0; + return ECFUNC_OPEN_KEYBOARD; } else if (JOY_NEW(B_BUTTON)) { - return sub_811B150(); + return StartConfirmExitPrompt(); } else if (JOY_NEW(START_BUTTON)) { - return sub_811B1B4(); + return TryConfirmWords(); } else if (JOY_NEW(DPAD_UP)) { @@ -1560,37 +1761,42 @@ static u16 sub_811AB68(void) break; } - return 0; + return ECFUNC_NONE; } while (0); + // Handle D-Pad input + + // Wrap row if (sEasyChatScreen->mainCursorRow < 0) sEasyChatScreen->mainCursorRow = sEasyChatScreenTemplates[sEasyChatScreen->templateId].numRows; - if (sEasyChatScreen->mainCursorRow > sEasyChatScreenTemplates[sEasyChatScreen->templateId].numRows) sEasyChatScreen->mainCursorRow = 0; if (sEasyChatScreen->mainCursorRow == sEasyChatScreenTemplates[sEasyChatScreen->templateId].numRows) { + // Moved onto bottom row (buttons) if (sEasyChatScreen->mainCursorColumn > 2) sEasyChatScreen->mainCursorColumn = 2; - sEasyChatScreen->state = 1; - return 3; + sEasyChatScreen->inputState = INPUTSTATE_MAIN_SCREEN_BUTTONS; + return ECFUNC_UPDATE_MAIN_CURSOR_ON_BUTTONS; } + // Wrap column if (sEasyChatScreen->mainCursorColumn < 0) sEasyChatScreen->mainCursorColumn = sEasyChatScreenTemplates[sEasyChatScreen->templateId].numColumns - 1; - if (sEasyChatScreen->mainCursorColumn >= sEasyChatScreenTemplates[sEasyChatScreen->templateId].numColumns) sEasyChatScreen->mainCursorColumn = 0; - if (sub_811AB44() && sEasyChatScreen->mainCursorColumn == 1 && sEasyChatScreen->mainCursorRow == 4) + // All 2x5 phrases are only 9 words long, exclude the bottom right (10th) position + if (IsCurrentFrame2x5() && sEasyChatScreen->mainCursorColumn == 1 && sEasyChatScreen->mainCursorRow == 4) sEasyChatScreen->mainCursorColumn = 0; - return 2; + return ECFUNC_UPDATE_MAIN_CURSOR; } -static u16 sub_811ACDC(void) +// Handles main screen input while cursor is below the phrase on one of the buttons, e.g. Del. All or Cancel +static u16 HandleEasyChatInput_MainScreenButtons(void) { do { @@ -1598,24 +1804,24 @@ static u16 sub_811ACDC(void) { switch (sEasyChatScreen->mainCursorColumn) { - case 0: - return sub_811B184(); - case 1: - return sub_811B150(); - case 2: - return sub_811B1B4(); - case 3: - return sub_811B264(); + case 0: // Del. All button + return DoDeleteAllButton(); + case 1: // Cancel button + return StartConfirmExitPrompt(); + case 2: // OK button + return TryConfirmWords(); + case 3: // Quiz/Answer button + return DoQuizButton(); } } if (JOY_NEW(B_BUTTON)) { - return sub_811B150(); + return StartConfirmExitPrompt(); } else if (JOY_NEW(START_BUTTON)) { - return sub_811B1B4(); + return TryConfirmWords(); } else if (JOY_NEW(DPAD_UP)) { @@ -1638,7 +1844,7 @@ static u16 sub_811ACDC(void) break; } - return 0; + return ECFUNC_NONE; } while (0); if (sEasyChatScreen->mainCursorRow == sEasyChatScreenTemplates[sEasyChatScreen->templateId].numRows) @@ -1650,790 +1856,803 @@ static u16 sub_811ACDC(void) if (sEasyChatScreen->mainCursorColumn >= numFooterColumns) sEasyChatScreen->mainCursorColumn = 0; - return 3; + return ECFUNC_UPDATE_MAIN_CURSOR_ON_BUTTONS; } if (sEasyChatScreen->mainCursorColumn >= sEasyChatScreenTemplates[sEasyChatScreen->templateId].numColumns) sEasyChatScreen->mainCursorColumn = sEasyChatScreenTemplates[sEasyChatScreen->templateId].numColumns - 1; - if (sub_811AB44() && sEasyChatScreen->mainCursorColumn == 1 && sEasyChatScreen->mainCursorRow == 4) + // All 2x5 phrases are only 9 words long, exclude the bottom right (10th) position + if (IsCurrentFrame2x5() && sEasyChatScreen->mainCursorColumn == 1 && sEasyChatScreen->mainCursorRow == 4) sEasyChatScreen->mainCursorColumn = 0; - sEasyChatScreen->state = 0; - return 2; + sEasyChatScreen->inputState = INPUTSTATE_PHRASE; + return ECFUNC_UPDATE_MAIN_CURSOR; } -static u16 sub_811AE44(void) +static u16 HandleEasyChatInput_Keyboard(void) { if (JOY_NEW(B_BUTTON)) - return sub_811B32C(); + return ExitKeyboardToMainScreen(); if (JOY_NEW(A_BUTTON)) { - if (sEasyChatScreen->unk_0a != -1) - return sub_811B2B0(); + if (sEasyChatScreen->keyboardColumn != -1) + return SelectKeyboardGroup(); - switch (sEasyChatScreen->unk_0b) + // Cursor is in button window + switch (sEasyChatScreen->keyboardRow) { - case 0: - return sub_811B33C(); - case 1: - return sub_811B368(); - case 2: - return sub_811B32C(); + case 0: // Mode button + return StartSwitchKeyboardMode(); + case 1: // Delete button + return DeleteSelectedWord(); + case 2: // Cancel button + return ExitKeyboardToMainScreen(); } } if (JOY_NEW(SELECT_BUTTON)) - return sub_811B33C(); + return StartSwitchKeyboardMode(); if (JOY_REPEAT(DPAD_UP)) - return sub_811B528(2); + return MoveKeyboardCursor(INPUT_UP); if (JOY_REPEAT(DPAD_DOWN)) - return sub_811B528(3); + return MoveKeyboardCursor(INPUT_DOWN); if (JOY_REPEAT(DPAD_LEFT)) - return sub_811B528(1); + return MoveKeyboardCursor(INPUT_LEFT); if (JOY_REPEAT(DPAD_RIGHT)) - return sub_811B528(0); + return MoveKeyboardCursor(INPUT_RIGHT); - return 0; + return ECFUNC_NONE; } -static u16 sub_811AF00(void) +// Input handling for the lower window after a word group has been selected +static u16 HandleEasyChatInput_WordSelect(void) { if (JOY_NEW(B_BUTTON)) { - sEasyChatScreen->state = 2; - return 14; + sEasyChatScreen->inputState = INPUTSTATE_KEYBOARD; + return ECFUNC_RETURN_TO_KEYBOARD; } if (JOY_NEW(A_BUTTON)) - return sub_811B394(); + return SelectNewWord(); if (JOY_NEW(START_BUTTON)) - return sub_811B794(4); + return MoveWordSelectCursor(INPUT_START); if (JOY_NEW(SELECT_BUTTON)) - return sub_811B794(5); + return MoveWordSelectCursor(INPUT_SELECT); if (JOY_REPEAT(DPAD_UP)) - return sub_811B794(2); + return MoveWordSelectCursor(INPUT_UP); if (JOY_REPEAT(DPAD_DOWN)) - return sub_811B794(3); + return MoveWordSelectCursor(INPUT_DOWN); if (JOY_REPEAT(DPAD_LEFT)) - return sub_811B794(1); + return MoveWordSelectCursor(INPUT_LEFT); if (JOY_REPEAT(DPAD_RIGHT)) - return sub_811B794(0); + return MoveWordSelectCursor(INPUT_RIGHT); - return 0; + return ECFUNC_NONE; } -static u16 sub_811AF8C(void) +static u16 HandleEasyChatInput_ExitPrompt(void) { - u8 var0; - switch (Menu_ProcessInputNoWrapClearOnChoose()) { - case MENU_B_PRESSED: // B Button - case 1: // No - sEasyChatScreen->state = sub_811B2A4(); - return 7; - case 0: // Yes + case MENU_B_PRESSED: + case 1: // No (Continue) + sEasyChatScreen->inputState = GetEasyChatBackupState(); + return ECFUNC_CLOSE_PROMPT; + case 0: // Yes (Exit) gSpecialVar_Result = 0; - var0 = sEasyChatScreen->type - EASY_CHAT_TYPE_QUIZ_SET_QUESTION; - if (var0 < 2) - sub_811B3E4(); + if (sEasyChatScreen->type == EASY_CHAT_TYPE_QUIZ_SET_QUESTION + || sEasyChatScreen->type == EASY_CHAT_TYPE_QUIZ_SET_ANSWER) + SaveCurrentPhrase(); - return 24; + return ECFUNC_EXIT; default: - return 0; + return ECFUNC_NONE; } } -static u16 sub_811AFEC(void) +static u16 HandleEasyChatInput_ConfirmWordsYesNo(void) { switch (Menu_ProcessInputNoWrapClearOnChoose()) { - case MENU_B_PRESSED: // B Button + case MENU_B_PRESSED: case 1: // No - sEasyChatScreen->state = sub_811B2A4(); - return 7; + sEasyChatScreen->inputState = GetEasyChatBackupState(); + return ECFUNC_CLOSE_PROMPT; case 0: // Yes - sub_811BE9C(); - gSpecialVar_Result = sub_811B4EC(); - sub_811B3E4(); - return 24; + SetSpecialEasyChatResult(); + gSpecialVar_Result = GetEasyChatCompleted(); + SaveCurrentPhrase(); + return ECFUNC_EXIT; default: - return 0; + return ECFUNC_NONE; } } -static u16 sub_811B040(void) +static u16 HandleEasyChatInput_DeleteAllYesNo(void) { switch (Menu_ProcessInputNoWrapClearOnChoose()) { - case MENU_B_PRESSED: // B Button + case MENU_B_PRESSED: case 1: // No - sEasyChatScreen->state = 1; - return 7; + sEasyChatScreen->inputState = INPUTSTATE_MAIN_SCREEN_BUTTONS; + return ECFUNC_CLOSE_PROMPT; case 0: // Yes - sub_811B418(); - sEasyChatScreen->state = 1; - return 8; + ResetCurrentPhrase(); + sEasyChatScreen->inputState = INPUTSTATE_MAIN_SCREEN_BUTTONS; + return ECFUNC_CLOSE_PROMPT_AFTER_DELETE; default: - return 0; + return ECFUNC_NONE; } } -static u16 sub_811B08C(void) +static u16 HandleEasyChatInput_QuizQuestion(void) { if (JOY_NEW(A_BUTTON)) - return 26; + return ECFUNC_QUIZ_ANSWER; if (JOY_NEW(B_BUTTON)) - return sub_811B150(); + return StartConfirmExitPrompt(); - return 0; + return ECFUNC_NONE; } -static u16 sub_811B0BC(void) +// A message has been printed. Wait for player to +// press A or B, then return to previous state +static u16 HandleEasyChatInput_WaitForMsg(void) { if (JOY_NEW(A_BUTTON | B_BUTTON)) { - sEasyChatScreen->state = sub_811B2A4(); - return 7; + sEasyChatScreen->inputState = GetEasyChatBackupState(); + return ECFUNC_CLOSE_PROMPT; } - return 0; + return ECFUNC_NONE; } -static u16 sub_811B0E8(void) +// Odd, could have been skipped. Just passes to HandleEasyChatInput_ConfirmLyricsYesNo +static u16 HandleEasyChatInput_StartConfirmLyrics(void) { - sEasyChatScreen->state = 10; - return 6; + sEasyChatScreen->inputState = INPUTSTATE_CONFIRM_LYRICS_YES_NO; + return ECFUNC_PROMPT_CONFIRM; } -static u16 sub_811B0F8(void) +static u16 HandleEasyChatInput_ConfirmLyricsYesNo(void) { switch (Menu_ProcessInputNoWrapClearOnChoose()) { - case MENU_B_PRESSED: // B Button + case MENU_B_PRESSED: case 1: // No - sub_811B454(); - sEasyChatScreen->stateBackup = 0; - sEasyChatScreen->state = 8; - return 31; + ResetCurrentPhraseToSaved(); + sEasyChatScreen->inputStateBackup = INPUTSTATE_PHRASE; + sEasyChatScreen->inputState = INPUTSTATE_WAIT_FOR_MSG; + return ECFUNC_MSG_SONG_TOO_SHORT; case 0: // Yes - gSpecialVar_Result = sub_811B4EC(); - sub_811B3E4(); - return 24; + gSpecialVar_Result = GetEasyChatCompleted(); + SaveCurrentPhrase(); + return ECFUNC_EXIT; default: - return 0; + return ECFUNC_NONE; } } -static u16 sub_811B150(void) +static u16 StartConfirmExitPrompt(void) { if (sEasyChatScreen->type == EASY_CHAT_TYPE_APPRENTICE || sEasyChatScreen->type == EASY_CHAT_TYPE_CONTEST_INTERVIEW) { - sEasyChatScreen->stateBackup = sEasyChatScreen->state; - sEasyChatScreen->state = 8; - return 34; + sEasyChatScreen->inputStateBackup = sEasyChatScreen->inputState; + sEasyChatScreen->inputState = INPUTSTATE_WAIT_FOR_MSG; + return ECFUNC_MSG_CANT_EXIT; } else { - sEasyChatScreen->stateBackup = sEasyChatScreen->state; - sEasyChatScreen->state = 4; - return 5; + sEasyChatScreen->inputStateBackup = sEasyChatScreen->inputState; + sEasyChatScreen->inputState = INPUTSTATE_EXIT_PROMPT; + return ECFUNC_PROMPT_EXIT; } } -static int sub_811B184(void) +static int DoDeleteAllButton(void) { - sEasyChatScreen->stateBackup = sEasyChatScreen->state; + sEasyChatScreen->inputStateBackup = sEasyChatScreen->inputState; if (sEasyChatScreen->type != EASY_CHAT_TYPE_BARD_SONG) { - sEasyChatScreen->state = 5; - return 4; + // Show Delete yes/no + sEasyChatScreen->inputState = INPUTSTATE_DELETE_ALL_YES_NO; + return ECFUNC_PROMPT_DELETE_ALL; } else { - sEasyChatScreen->stateBackup = sEasyChatScreen->state; - sEasyChatScreen->state = 8; - return 32; + // Cannot delete lyrics when setting Bard's song + sEasyChatScreen->inputStateBackup = sEasyChatScreen->inputState; + sEasyChatScreen->inputState = INPUTSTATE_WAIT_FOR_MSG; + return ECFUNC_MSG_CANT_DELETE_LYRICS; } } -static u16 sub_811B1B4(void) +static u16 TryConfirmWords(void) { - sEasyChatScreen->stateBackup = sEasyChatScreen->state; + sEasyChatScreen->inputStateBackup = sEasyChatScreen->inputState; if (sEasyChatScreen->type == EASY_CHAT_TYPE_QUIZ_SET_QUESTION) { - if (sub_811BD64()) + if (IsQuizQuestionEmpty()) { - sEasyChatScreen->state = 8; - return 29; + sEasyChatScreen->inputState = INPUTSTATE_WAIT_FOR_MSG; + return ECFUNC_MSG_CREATE_QUIZ; } - if (sub_811BDB0()) + if (IsQuizAnswerEmpty()) { - sEasyChatScreen->state = 8; - return 30; + sEasyChatScreen->inputState = INPUTSTATE_WAIT_FOR_MSG; + return ECFUNC_MSG_SELECT_ANSWER; } - sEasyChatScreen->state = 6; - return 6; + sEasyChatScreen->inputState = INPUTSTATE_CONFIRM_WORDS_YES_NO; + return ECFUNC_PROMPT_CONFIRM; } else if (sEasyChatScreen->type == EASY_CHAT_TYPE_QUIZ_SET_ANSWER) { - if (sub_811BDB0()) + if (IsQuizAnswerEmpty()) { - sEasyChatScreen->state = 8; - return 30; + sEasyChatScreen->inputState = INPUTSTATE_WAIT_FOR_MSG; + return ECFUNC_MSG_SELECT_ANSWER; } - if (sub_811BD64()) + if (IsQuizQuestionEmpty()) { - sEasyChatScreen->state = 8; - return 29; + sEasyChatScreen->inputState = INPUTSTATE_WAIT_FOR_MSG; + return ECFUNC_MSG_CREATE_QUIZ; } - sEasyChatScreen->state = 6; - return 6; + sEasyChatScreen->inputState = INPUTSTATE_CONFIRM_WORDS_YES_NO; + return ECFUNC_PROMPT_CONFIRM; } else if (sEasyChatScreen->type == EASY_CHAT_TYPE_TRENDY_PHRASE || sEasyChatScreen->type == EASY_CHAT_TYPE_GOOD_SAYING) { - if (!sub_811BD2C()) + if (!IsCurrentPhraseFull()) { - sEasyChatScreen->state = 8; - return 33; + sEasyChatScreen->inputState = INPUTSTATE_WAIT_FOR_MSG; + return ECFUNC_MSG_COMBINE_TWO_WORDS; } - sEasyChatScreen->state = 6; - return 6; + sEasyChatScreen->inputState = INPUTSTATE_CONFIRM_WORDS_YES_NO; + return ECFUNC_PROMPT_CONFIRM; } else if (sEasyChatScreen->type == EASY_CHAT_TYPE_APPRENTICE || sEasyChatScreen->type == EASY_CHAT_TYPE_CONTEST_INTERVIEW) { - if (sub_811BCF4()) + if (IsCurrentPhraseEmpty()) { - sEasyChatScreen->state = 8; - return 34; + sEasyChatScreen->inputState = INPUTSTATE_WAIT_FOR_MSG; + return ECFUNC_MSG_CANT_EXIT; } - sEasyChatScreen->state = 6; - return 6; + sEasyChatScreen->inputState = INPUTSTATE_CONFIRM_WORDS_YES_NO; + return ECFUNC_PROMPT_CONFIRM; } else if (sEasyChatScreen->type == EASY_CHAT_TYPE_QUESTIONNAIRE) { - sEasyChatScreen->state = 6; - return 6; + sEasyChatScreen->inputState = INPUTSTATE_CONFIRM_WORDS_YES_NO; + return ECFUNC_PROMPT_CONFIRM; } else { - if (sub_811BCF4() == 1 || !sub_811B4EC()) + if (IsCurrentPhraseEmpty() == TRUE || !GetEasyChatCompleted()) { - sEasyChatScreen->state = 4; - return 5; + sEasyChatScreen->inputState = INPUTSTATE_EXIT_PROMPT; + return ECFUNC_PROMPT_EXIT; } - sEasyChatScreen->state = 6; - return 6; + sEasyChatScreen->inputState = INPUTSTATE_CONFIRM_WORDS_YES_NO; + return ECFUNC_PROMPT_CONFIRM; } } -static int sub_811B264(void) +static int DoQuizButton(void) { - sEasyChatScreen->stateBackup = sEasyChatScreen->state; + sEasyChatScreen->inputStateBackup = sEasyChatScreen->inputState; switch (sEasyChatScreen->type) { case EASY_CHAT_TYPE_QUIZ_ANSWER: - return 25; + return ECFUNC_QUIZ_QUESTION; case EASY_CHAT_TYPE_QUIZ_SET_QUESTION: - sub_811B3E4(); - return 28; + SaveCurrentPhrase(); + return ECFUNC_SET_QUIZ_ANSWER; case EASY_CHAT_TYPE_QUIZ_SET_ANSWER: - sub_811B3E4(); - return 27; + SaveCurrentPhrase(); + return ECFUNC_SET_QUIZ_QUESTION; default: - return 0; + return ECFUNC_NONE; } } -static u8 sub_811B2A4(void) +static u8 GetEasyChatBackupState(void) { - return sEasyChatScreen->stateBackup; + return sEasyChatScreen->inputStateBackup; } -static int sub_811B2B0(void) +static int SelectKeyboardGroup(void) { - u16 var1; + u16 numWords; - if (sEasyChatScreen->unk_09 == 0) + if (!sEasyChatScreen->inAlphabetMode) { - u8 groupId = sub_811F3B8(sub_811B8E8()); - sub_811F548(0, groupId); + u8 groupId = GetUnlockedEasyChatGroupId(GetSelectedGroupIndex()); + SetSelectedWordGroup(FALSE, groupId); } else { - sub_811F548(1, sub_811B908()); + SetSelectedWordGroup(TRUE, GetSelectedAlphabetGroupId()); } - var1 = sub_811F5B0(); - if (var1 == 0) - return 0; + numWords = GetNumWordsInSelectedGroup(); + if (numWords == 0) + return ECFUNC_NONE; - sEasyChatScreen->unk_0f = (var1 - 1) / 2; - sEasyChatScreen->unk_0e = 0; - sEasyChatScreen->unk_10 = 0; - sEasyChatScreen->unk_11 = 0; - sEasyChatScreen->state = 3; - return 11; + sEasyChatScreen->wordSelectLastRow = (numWords - 1) / 2; + sEasyChatScreen->wordSelectScrollOffset = 0; + sEasyChatScreen->wordSelectColumn = 0; + sEasyChatScreen->wordSelectRow = 0; + sEasyChatScreen->inputState = INPUTSTATE_WORD_SELECT; + return ECFUNC_OPEN_WORD_SELECT; } -static int sub_811B32C(void) +static int ExitKeyboardToMainScreen(void) { - sEasyChatScreen->state = 0; - return 10; + sEasyChatScreen->inputState = INPUTSTATE_PHRASE; + return ECFUNC_CLOSE_KEYBOARD; } -static int sub_811B33C(void) +static int StartSwitchKeyboardMode(void) { - sEasyChatScreen->unk_0a = 0; - sEasyChatScreen->unk_0b = 0; - sEasyChatScreen->unk_0c = 0; - if (!sEasyChatScreen->unk_09) - sEasyChatScreen->unk_09 = 1; + sEasyChatScreen->keyboardColumn = 0; + sEasyChatScreen->keyboardRow = 0; + sEasyChatScreen->keyboardScrollOffset = 0; + if (!sEasyChatScreen->inAlphabetMode) + sEasyChatScreen->inAlphabetMode = TRUE; else - sEasyChatScreen->unk_09 = 0; + sEasyChatScreen->inAlphabetMode = FALSE; - return 23; + return ECFUNC_SWITCH_KEYBOARD_MODE; } -static int sub_811B368(void) +static int DeleteSelectedWord(void) { if (sEasyChatScreen->type == EASY_CHAT_TYPE_BARD_SONG) { PlaySE(SE_FAILURE); - return 0; + return ECFUNC_NONE; } else { - sub_811B488(0xFFFF); - return 1; + SetSelectedWord(EC_EMPTY_WORD); + return ECFUNC_REPRINT_PHRASE; } } -static int sub_811B394(void) +static int SelectNewWord(void) { - u16 easyChatWord = sub_811F578(sub_811B940()); - if (sub_811BF88(easyChatWord)) + u16 easyChatWord = GetWordFromSelectedGroup(GetSelectedWordIndex()); + if (DummyWordCheck(easyChatWord)) { + // Never reached. Would disallow selecting certain words PlaySE(SE_FAILURE); - return 0; + return ECFUNC_NONE; } else { - sub_811B488(easyChatWord); + SetSelectedWord(easyChatWord); if (sEasyChatScreen->type != EASY_CHAT_TYPE_BARD_SONG) { - sEasyChatScreen->state = 0; - return 12; + sEasyChatScreen->inputState = INPUTSTATE_PHRASE; + return ECFUNC_CLOSE_WORD_SELECT; } else { - sEasyChatScreen->state = 9; - return 13; + sEasyChatScreen->inputState = INPUTSTATE_START_CONFIRM_LYRICS; + return ECFUNC_PROMPT_CONFIRM_LYRICS; } } } -static void sub_811B3E4(void) +static void SaveCurrentPhrase(void) { int i; - for (i = 0; i < sEasyChatScreen->unk_07; i++) - sEasyChatScreen->words[i] = sEasyChatScreen->ecWordBuffer[i]; + for (i = 0; i < sEasyChatScreen->maxWords; i++) + sEasyChatScreen->savedPhrase[i] = sEasyChatScreen->currentPhrase[i]; } -static void sub_811B418(void) +static void ResetCurrentPhrase(void) { int i; - for (i = 0; i < sEasyChatScreen->unk_07; i++) - sEasyChatScreen->ecWordBuffer[i] = 0xFFFF; + for (i = 0; i < sEasyChatScreen->maxWords; i++) + sEasyChatScreen->currentPhrase[i] = EC_EMPTY_WORD; } -static void sub_811B454(void) +static void ResetCurrentPhraseToSaved(void) { int i; - for (i = 0; i < sEasyChatScreen->unk_07; i++) - sEasyChatScreen->ecWordBuffer[i] = sEasyChatScreen->words[i]; + for (i = 0; i < sEasyChatScreen->maxWords; i++) + sEasyChatScreen->currentPhrase[i] = sEasyChatScreen->savedPhrase[i]; } -static void sub_811B488(u16 easyChatWord) +static void SetSelectedWord(u16 easyChatWord) { - u16 index = sub_811B8C8(); - sEasyChatScreen->ecWordBuffer[index] = easyChatWord; + u16 index = GetWordIndexToReplace(); + sEasyChatScreen->currentPhrase[index] = easyChatWord; } -static u8 sub_811B4AC(void) +// Compare current phrase to the original saved phrase +static bool8 DidPhraseChange(void) { u16 i; - for (i = 0; i < sEasyChatScreen->unk_07; i++) + for (i = 0; i < sEasyChatScreen->maxWords; i++) { - if (sEasyChatScreen->ecWordBuffer[i] != sEasyChatScreen->words[i]) - return 1; + if (sEasyChatScreen->currentPhrase[i] != sEasyChatScreen->savedPhrase[i]) + return TRUE; } - return 0; + return FALSE; } -static int sub_811B4EC(void) +// 'Completed' if the phrase was changed, or in the case of making a quiz, the question and answer were filled out +static bool32 GetEasyChatCompleted(void) { - u8 var0 = sEasyChatScreen->type - EASY_CHAT_TYPE_QUIZ_SET_QUESTION; - if (var0 < 2) + if (sEasyChatScreen->type == EASY_CHAT_TYPE_QUIZ_SET_QUESTION + || sEasyChatScreen->type == EASY_CHAT_TYPE_QUIZ_SET_ANSWER) { - if (sub_811BD64()) - return 0; + if (IsQuizQuestionEmpty()) + return FALSE; - if (sub_811BDB0()) - return 0; + if (IsQuizAnswerEmpty()) + return FALSE; - return 1; + return TRUE; } else { - return sub_811B4AC(); + return DidPhraseChange(); } } -static u16 sub_811B528(int arg0) +static u16 MoveKeyboardCursor(int input) { - if (sEasyChatScreen->unk_0a != -1) + if (sEasyChatScreen->keyboardColumn != -1) { - if (sEasyChatScreen->unk_09 == 0) - return sub_811B568(arg0); + if (!sEasyChatScreen->inAlphabetMode) + return MoveKeyboardCursor_GroupNames(input); else - return sub_811B634(arg0); + return MoveKeyboardCursor_Alphabet(input); } else { - return sub_811B6C4(arg0); + return MoveKeyboardCursor_ButtonWindow(input); } } -static int sub_811B568(u32 arg0) +static int MoveKeyboardCursor_GroupNames(u32 input) { - switch (arg0) + switch (input) { - case 2: - if (sEasyChatScreen->unk_0b != -sEasyChatScreen->unk_0c) + case INPUT_UP: + if (sEasyChatScreen->keyboardRow != -sEasyChatScreen->keyboardScrollOffset) { - if (sEasyChatScreen->unk_0b) + if (sEasyChatScreen->keyboardRow) { - sEasyChatScreen->unk_0b--; - return 15; + sEasyChatScreen->keyboardRow--; + return ECFUNC_UPDATE_KEYBOARD_CURSOR; } else { - sEasyChatScreen->unk_0c--; - return 17; + sEasyChatScreen->keyboardScrollOffset--; + return ECFUNC_GROUP_NAMES_SCROLL_UP; } } break; - case 3: - if (sEasyChatScreen->unk_0b + sEasyChatScreen->unk_0c < sEasyChatScreen->unk_0d - 1) + case INPUT_DOWN: + if (sEasyChatScreen->keyboardRow + sEasyChatScreen->keyboardScrollOffset < sEasyChatScreen->keyboardLastRow - 1) { - int var0; - if (sEasyChatScreen->unk_0b < 3) + int funcId; + if (sEasyChatScreen->keyboardRow < NUM_GROUP_NAME_ROWS - 1) { - sEasyChatScreen->unk_0b++; - var0 = 15; + sEasyChatScreen->keyboardRow++; + funcId = ECFUNC_UPDATE_KEYBOARD_CURSOR; } else { - sEasyChatScreen->unk_0c++; - var0 = 16; + sEasyChatScreen->keyboardScrollOffset++; + funcId = ECFUNC_GROUP_NAMES_SCROLL_DOWN; } - sub_811B978(); - return var0; + ReduceToValidKeyboardColumn(); + return funcId; } break; - case 1: - if (sEasyChatScreen->unk_0a) - sEasyChatScreen->unk_0a--; + case INPUT_LEFT: + if (sEasyChatScreen->keyboardColumn) + sEasyChatScreen->keyboardColumn--; else - sub_811B744(); + SetKeyboardCursorInButtonWindow(); - return 15; - case 0: - if (sEasyChatScreen->unk_0a < 1) + return ECFUNC_UPDATE_KEYBOARD_CURSOR; + case INPUT_RIGHT: + if (sEasyChatScreen->keyboardColumn < 1) { - sEasyChatScreen->unk_0a++; - if (sub_811B9C8()) - sub_811B744(); + sEasyChatScreen->keyboardColumn++; + if (IsSelectedKeyboardIndexInvalid()) + SetKeyboardCursorInButtonWindow(); } else { - sub_811B744(); + SetKeyboardCursorInButtonWindow(); } - return 15; + return ECFUNC_UPDATE_KEYBOARD_CURSOR; } - return 0; + return ECFUNC_NONE; } -static int sub_811B634(u32 arg0) +static int MoveKeyboardCursor_Alphabet(u32 input) { - switch (arg0) + switch (input) { - case 2: - if (sEasyChatScreen->unk_0b > 0) - sEasyChatScreen->unk_0b--; + case INPUT_UP: + if (sEasyChatScreen->keyboardRow > 0) + sEasyChatScreen->keyboardRow--; else - sEasyChatScreen->unk_0b = 3; + sEasyChatScreen->keyboardRow = NUM_ALPHABET_ROWS - 1; - sub_811B978(); - return 15; - case 3: - if (sEasyChatScreen->unk_0b < 3) - sEasyChatScreen->unk_0b++; + ReduceToValidKeyboardColumn(); + return ECFUNC_UPDATE_KEYBOARD_CURSOR; + case INPUT_DOWN: + if (sEasyChatScreen->keyboardRow < NUM_ALPHABET_ROWS - 1) + sEasyChatScreen->keyboardRow++; else - sEasyChatScreen->unk_0b = 0; + sEasyChatScreen->keyboardRow = 0; - sub_811B978(); - return 15; - case 0: - sEasyChatScreen->unk_0a++; - if (sub_811B9C8()) - sub_811B744(); + ReduceToValidKeyboardColumn(); + return ECFUNC_UPDATE_KEYBOARD_CURSOR; + case INPUT_RIGHT: + sEasyChatScreen->keyboardColumn++; + if (IsSelectedKeyboardIndexInvalid()) + SetKeyboardCursorInButtonWindow(); - return 15; - case 1: - sEasyChatScreen->unk_0a--; - if (sEasyChatScreen->unk_0a < 0) - sub_811B744(); + return ECFUNC_UPDATE_KEYBOARD_CURSOR; + case INPUT_LEFT: + sEasyChatScreen->keyboardColumn--; + if (sEasyChatScreen->keyboardColumn < 0) + SetKeyboardCursorInButtonWindow(); - return 15; + return ECFUNC_UPDATE_KEYBOARD_CURSOR; } - return 0; + return ECFUNC_NONE; } -static int sub_811B6C4(u32 arg0) +static int MoveKeyboardCursor_ButtonWindow(u32 input) { - switch (arg0) + switch (input) { - case 2: - if (sEasyChatScreen->unk_0b) - sEasyChatScreen->unk_0b--; + case INPUT_UP: + if (sEasyChatScreen->keyboardRow) + sEasyChatScreen->keyboardRow--; else - sEasyChatScreen->unk_0b = 2; + sEasyChatScreen->keyboardRow = NUM_BUTTON_ROWS - 1; - return 15; - case 3: - if (sEasyChatScreen->unk_0b < 2) - sEasyChatScreen->unk_0b++; + return ECFUNC_UPDATE_KEYBOARD_CURSOR; + case INPUT_DOWN: + if (sEasyChatScreen->keyboardRow < NUM_BUTTON_ROWS - 1) + sEasyChatScreen->keyboardRow++; else - sEasyChatScreen->unk_0b = 0; + sEasyChatScreen->keyboardRow = 0; - return 15; - case 1: - sEasyChatScreen->unk_0b++; - sub_811B768(); - return 15; - case 0: - sEasyChatScreen->unk_0a = 0; - sEasyChatScreen->unk_0b++; - return 15; + return ECFUNC_UPDATE_KEYBOARD_CURSOR; + case INPUT_LEFT: + sEasyChatScreen->keyboardRow++; + SetKeyboardCursorToLastColumn(); + return ECFUNC_UPDATE_KEYBOARD_CURSOR; + case INPUT_RIGHT: + sEasyChatScreen->keyboardColumn = 0; + sEasyChatScreen->keyboardRow++; + return ECFUNC_UPDATE_KEYBOARD_CURSOR; } - return 0; + return ECFUNC_NONE; } -static void sub_811B744(void) +static void SetKeyboardCursorInButtonWindow(void) { - sEasyChatScreen->unk_0a = 0xFF; - if (sEasyChatScreen->unk_0b) - sEasyChatScreen->unk_0b--; + sEasyChatScreen->keyboardColumn = -1; + if (sEasyChatScreen->keyboardRow) + sEasyChatScreen->keyboardRow--; } -static void sub_811B768(void) +static void SetKeyboardCursorToLastColumn(void) { - if (sEasyChatScreen->unk_09 == 0) + if (!sEasyChatScreen->inAlphabetMode) { - sEasyChatScreen->unk_0a = 1; - sub_811B978(); + sEasyChatScreen->keyboardColumn = 1; + ReduceToValidKeyboardColumn(); } else { - sEasyChatScreen->unk_0a = sub_811B960(sEasyChatScreen->unk_0b); + sEasyChatScreen->keyboardColumn = GetLastAlphabetColumn(sEasyChatScreen->keyboardRow); } } -static u16 sub_811B794(u32 arg0) +static u16 MoveWordSelectCursor(u32 input) { - u16 result; - switch (arg0) + u16 funcId; + switch (input) { - case 2: - if (sEasyChatScreen->unk_11 + sEasyChatScreen->unk_0e > 0) + case INPUT_UP: + if (sEasyChatScreen->wordSelectRow + sEasyChatScreen->wordSelectScrollOffset > 0) { - if (sEasyChatScreen->unk_11 > 0) + if (sEasyChatScreen->wordSelectRow > 0) { - sEasyChatScreen->unk_11--; - result = 18; + sEasyChatScreen->wordSelectRow--; + funcId = ECFUNC_UPDATE_WORD_SELECT_CURSOR; } else { - sEasyChatScreen->unk_0e--; - result = 19; + sEasyChatScreen->wordSelectScrollOffset--; + funcId = ECFUNC_WORD_SELECT_SCROLL_UP; } - sub_811B9A0(); - return result; + ReduceToValidWordSelectColumn(); + return funcId; } break; - case 3: - if (sEasyChatScreen->unk_11 + sEasyChatScreen->unk_0e < sEasyChatScreen->unk_0f) + case INPUT_DOWN: + if (sEasyChatScreen->wordSelectRow + sEasyChatScreen->wordSelectScrollOffset < sEasyChatScreen->wordSelectLastRow) { - if (sEasyChatScreen->unk_11 < 3) + if (sEasyChatScreen->wordSelectRow < NUM_WORD_SELECT_ROWS - 1) { - sEasyChatScreen->unk_11++; - result = 18; + sEasyChatScreen->wordSelectRow++; + funcId = ECFUNC_UPDATE_WORD_SELECT_CURSOR; } else { - sEasyChatScreen->unk_0e++; - result = 20; + sEasyChatScreen->wordSelectScrollOffset++; + funcId = ECFUNC_WORD_SELECT_SCROLL_DOWN; } - sub_811B9A0(); - return result; + ReduceToValidWordSelectColumn(); + return funcId; } break; - case 1: - if (sEasyChatScreen->unk_10 > 0) - sEasyChatScreen->unk_10--; + case INPUT_LEFT: + if (sEasyChatScreen->wordSelectColumn > 0) + sEasyChatScreen->wordSelectColumn--; else - sEasyChatScreen->unk_10 = 1; + sEasyChatScreen->wordSelectColumn = 1; - sub_811B9A0(); - return 18; - case 0: - if (sEasyChatScreen->unk_10 < 1) + ReduceToValidWordSelectColumn(); + return ECFUNC_UPDATE_WORD_SELECT_CURSOR; + case INPUT_RIGHT: + if (sEasyChatScreen->wordSelectColumn < 1) { - sEasyChatScreen->unk_10++; - if (sub_811BA1C()) - sEasyChatScreen->unk_10 = 0; + sEasyChatScreen->wordSelectColumn++; + if (IsSelectedWordIndexInvalid()) + sEasyChatScreen->wordSelectColumn = 0; } else { - sEasyChatScreen->unk_10 = 0; + sEasyChatScreen->wordSelectColumn = 0; } - return 18; - case 4: - if (sEasyChatScreen->unk_0e) + return ECFUNC_UPDATE_WORD_SELECT_CURSOR; + case INPUT_START: + // Page scroll up + if (sEasyChatScreen->wordSelectScrollOffset) { - if (sEasyChatScreen->unk_0e > 3) - sEasyChatScreen->unk_0e -= 4; + if (sEasyChatScreen->wordSelectScrollOffset >= NUM_WORD_SELECT_ROWS) + sEasyChatScreen->wordSelectScrollOffset -= NUM_WORD_SELECT_ROWS; else - sEasyChatScreen->unk_0e = 0; + sEasyChatScreen->wordSelectScrollOffset = 0; - return 21; + return ECFUNC_WORD_SELECT_PAGE_UP; } break; - case 5: - if (sEasyChatScreen->unk_0e <= sEasyChatScreen->unk_0f - 4) + case INPUT_SELECT: + // Page scroll down + if (sEasyChatScreen->wordSelectScrollOffset <= sEasyChatScreen->wordSelectLastRow - NUM_WORD_SELECT_ROWS) { - sEasyChatScreen->unk_0e += 4; - if (sEasyChatScreen->unk_0e > sEasyChatScreen->unk_0f - 3) - sEasyChatScreen->unk_0e = sEasyChatScreen->unk_0f + 0xFD; + sEasyChatScreen->wordSelectScrollOffset += NUM_WORD_SELECT_ROWS; + if (sEasyChatScreen->wordSelectScrollOffset > sEasyChatScreen->wordSelectLastRow - NUM_WORD_SELECT_ROWS + 1) + sEasyChatScreen->wordSelectScrollOffset = sEasyChatScreen->wordSelectLastRow - NUM_WORD_SELECT_ROWS + 1; - sub_811B9A0(); - return 22; + ReduceToValidWordSelectColumn(); + return ECFUNC_WORD_SELECT_PAGE_DOWN; } break; } - return 0; + return ECFUNC_NONE; } -static u16 sub_811B8C8(void) +static u16 GetWordIndexToReplace(void) { return (sEasyChatScreen->mainCursorRow * sEasyChatScreen->numColumns) + sEasyChatScreen->mainCursorColumn; } -static u16 sub_811B8E8(void) +static u16 GetSelectedGroupIndex(void) { - return 2 * (sEasyChatScreen->unk_0b + sEasyChatScreen->unk_0c) + sEasyChatScreen->unk_0a; + return NUM_GROUP_NAME_COLUMNS * (sEasyChatScreen->keyboardRow + sEasyChatScreen->keyboardScrollOffset) + sEasyChatScreen->keyboardColumn; } -static int sub_811B908(void) +static int GetSelectedAlphabetGroupId(void) { - int var0 = (u8)sEasyChatScreen->unk_0a < 7 ? sEasyChatScreen->unk_0a : 0; - int var1 = (u8)sEasyChatScreen->unk_0b < 4 ? sEasyChatScreen->unk_0b : 0; - return sUnknown_08597748[var1][var0]; + int column = (u8)sEasyChatScreen->keyboardColumn < NUM_ALPHABET_COLUMNS ? sEasyChatScreen->keyboardColumn : 0; + int row = (u8)sEasyChatScreen->keyboardRow < NUM_ALPHABET_ROWS ? sEasyChatScreen->keyboardRow : 0; + return sAlphabetGroupIdMap[row][column]; } -static u16 sub_811B940(void) +static u16 GetSelectedWordIndex(void) { - return 2 * (sEasyChatScreen->unk_11 + sEasyChatScreen->unk_0e) + sEasyChatScreen->unk_10; + return NUM_WORD_SELECT_COLUMNS * (sEasyChatScreen->wordSelectRow + sEasyChatScreen->wordSelectScrollOffset) + sEasyChatScreen->wordSelectColumn; } -static u8 sub_811B960(u8 arg0) +// Get the index of the last column in the alphabet keyboard, depending on current row +static u8 GetLastAlphabetColumn(u8 row) { - switch (arg0) + switch (row) { case 0: default: - return 6; + return NUM_ALPHABET_COLUMNS - 1; case 1: - return 5; + return NUM_ALPHABET_COLUMNS - 2; // At 6 letters, only the 2nd row (index 1) has less than the max columns + // The 3rd and 4th row have 7 letters, the 1st row has 6 letters and 'Others' } } -static void sub_811B978(void) +static void ReduceToValidKeyboardColumn(void) { - while (sub_811B9C8()) + while (IsSelectedKeyboardIndexInvalid()) { - if (sEasyChatScreen->unk_0a) - sEasyChatScreen->unk_0a--; + if (sEasyChatScreen->keyboardColumn) + sEasyChatScreen->keyboardColumn--; else break; } } -static void sub_811B9A0(void) +static void ReduceToValidWordSelectColumn(void) { - while (sub_811BA1C()) + while (IsSelectedWordIndexInvalid()) { - if (sEasyChatScreen->unk_10) - sEasyChatScreen->unk_10--; + if (sEasyChatScreen->wordSelectColumn) + sEasyChatScreen->wordSelectColumn--; else break; } } -static u8 sub_811B9C8(void) +static bool8 IsSelectedKeyboardIndexInvalid(void) { - if (sEasyChatScreen->unk_09 == 0) - return sub_811B8E8() >= sub_811F3AC() ? 1 : 0; + if (!sEasyChatScreen->inAlphabetMode) + return GetSelectedGroupIndex() >= GetNumUnlockedEasyChatGroups() ? TRUE : FALSE; else - return sEasyChatScreen->unk_0a > sub_811B960(sEasyChatScreen->unk_0b) ? 1 : 0; + return sEasyChatScreen->keyboardColumn > GetLastAlphabetColumn(sEasyChatScreen->keyboardRow) ? TRUE : FALSE; } -static u8 sub_811BA1C(void) +static bool8 IsSelectedWordIndexInvalid(void) { - return sub_811B940() >= sub_811F5B0() ? 1 : 0; + return GetSelectedWordIndex() >= GetNumWordsInSelectedGroup() ? TRUE : FALSE; } static int FooterHasFourOptions(void) @@ -2456,9 +2675,9 @@ const u8 *GetTitleText(void) return sEasyChatScreen->titleText; } -static u16 *GetEasyChatWordBuffer(void) +static u16 *GetCurrentPhrase(void) { - return sEasyChatScreen->ecWordBuffer; + return sEasyChatScreen->currentPhrase; } static u8 GetNumRows(void) @@ -2493,7 +2712,7 @@ static void GetEasyChatConfirmText(const u8 **str1, const u8 **str2) *str2 = sEasyChatScreenTemplates[sEasyChatScreen->templateId].confirmText2; } -static void sub_811BB40(const u8 **str1, const u8 **str2) +static void GetEasyChatConfirmExitText(const u8 **str1, const u8 **str2) { switch (sEasyChatScreen->type) { @@ -2520,75 +2739,75 @@ static void GetEasyChatConfirmDeletionText(const u8 **str1, const u8 **str2) *str2 = gText_BeDeletedThatOkay; } -void sub_811BB9C(u8 *arg0, u8 *arg1) +static void GetKeyboardCursorColAndRow(u8 *column, u8 *row) { - *arg0 = sEasyChatScreen->unk_0a; - *arg1 = sEasyChatScreen->unk_0b; + *column = sEasyChatScreen->keyboardColumn; + *row = sEasyChatScreen->keyboardRow; } -u8 sub_811BBB0(void) +static bool8 GetInAlphabetMode(void) { - return sEasyChatScreen->unk_09; + return sEasyChatScreen->inAlphabetMode; } -u8 sub_811BBBC(void) +static u8 GetKeyboardScrollOffset(void) { - return sEasyChatScreen->unk_0c; + return sEasyChatScreen->keyboardScrollOffset; } -void sub_811BBC8(u8 *arg0, u8 *arg1) +static void GetWordSelectColAndRow(u8 *column, u8 *row) { - *arg0 = sEasyChatScreen->unk_10; - *arg1 = sEasyChatScreen->unk_11; + *column = sEasyChatScreen->wordSelectColumn; + *row = sEasyChatScreen->wordSelectRow; } -u8 sub_811BBDC(void) +static u8 GetWordSelectScrollOffset(void) { - return sEasyChatScreen->unk_0e; + return sEasyChatScreen->wordSelectScrollOffset; } -u8 sub_811BBE8(void) +static u8 GetWordSelectLastRow(void) { - return sEasyChatScreen->unk_0f; + return sEasyChatScreen->wordSelectLastRow; } -static u8 unref_sub_811BBF4(void) +static u8 UnusedDummy(void) { - return 0; + return FALSE; } -int sub_811BBF8(void) +static bool32 CanScrollUp(void) { - switch (sEasyChatScreen->state) + switch (sEasyChatScreen->inputState) { - case 2: - if (sEasyChatScreen->unk_09 == 0 && sEasyChatScreen->unk_0c) - return 1; + case INPUTSTATE_KEYBOARD: + if (!sEasyChatScreen->inAlphabetMode && sEasyChatScreen->keyboardScrollOffset) + return TRUE; break; - case 3: - if (sEasyChatScreen->unk_0e) - return 1; + case INPUTSTATE_WORD_SELECT: + if (sEasyChatScreen->wordSelectScrollOffset) + return TRUE; break; } - return 0; + return FALSE; } -int sub_811BC2C(void) +static bool32 CanScrollDown(void) { - switch (sEasyChatScreen->state) + switch (sEasyChatScreen->inputState) { - case 2: - if (sEasyChatScreen->unk_09 == 0 && sEasyChatScreen->unk_0c + 4 <= sEasyChatScreen->unk_0d - 1) - return 1; + case INPUTSTATE_KEYBOARD: + if (!sEasyChatScreen->inAlphabetMode && sEasyChatScreen->keyboardScrollOffset + NUM_GROUP_NAME_ROWS <= sEasyChatScreen->keyboardLastRow - 1) + return TRUE; break; - case 3: - if (sEasyChatScreen->unk_0e + 4 <= sEasyChatScreen->unk_0f) - return 1; + case INPUTSTATE_WORD_SELECT: + if (sEasyChatScreen->wordSelectScrollOffset + NUM_WORD_SELECT_ROWS <= sEasyChatScreen->wordSelectLastRow) + return TRUE; break; } - return 0; + return FALSE; } static int FooterHasFourOptions_(void) @@ -2602,7 +2821,7 @@ static bool8 IsPhraseDifferentThanPlayerInput(const u16 *phrase, u8 phraseLength for (i = 0; i < phraseLength; i++) { - if (phrase[i] != sEasyChatScreen->ecWordBuffer[i]) + if (phrase[i] != sEasyChatScreen->currentPhrase[i]) return TRUE; } @@ -2627,65 +2846,67 @@ static u8 GetEachChatScreenTemplateId(u8 type) return 0; } -static int sub_811BCF4(void) +static bool32 IsCurrentPhraseEmpty(void) { int i; - for (i = 0; i < sEasyChatScreen->unk_07; i++) + for (i = 0; i < sEasyChatScreen->maxWords; i++) { - if (sEasyChatScreen->ecWordBuffer[i] != 0xFFFF) - return 0; + if (sEasyChatScreen->currentPhrase[i] != EC_EMPTY_WORD) + return FALSE; } - return 1; + return TRUE; } -static int sub_811BD2C(void) +static bool32 IsCurrentPhraseFull(void) { int i; - for (i = 0; i < sEasyChatScreen->unk_07; i++) + for (i = 0; i < sEasyChatScreen->maxWords; i++) { - if (sEasyChatScreen->ecWordBuffer[i] == 0xFFFF) - return 0; + if (sEasyChatScreen->currentPhrase[i] == EC_EMPTY_WORD) + return FALSE; } - return 1; + return TRUE; } -static int sub_811BD64(void) +static int IsQuizQuestionEmpty(void) { int i; struct SaveBlock1 *saveBlock1; if (sEasyChatScreen->type == EASY_CHAT_TYPE_QUIZ_SET_QUESTION) - return sub_811BCF4(); + return IsCurrentPhraseEmpty(); saveBlock1 = gSaveBlock1Ptr; for (i = 0; i < QUIZ_QUESTION_LEN; i++) { - if (saveBlock1->lilycoveLady.quiz.question[i] != 0xFFFF) - return 0; + if (saveBlock1->lilycoveLady.quiz.question[i] != EC_EMPTY_WORD) + return FALSE; } - return 1; + return TRUE; } -static int sub_811BDB0(void) +static int IsQuizAnswerEmpty(void) { struct LilycoveLadyQuiz *quiz; if (sEasyChatScreen->type == EASY_CHAT_TYPE_QUIZ_SET_ANSWER) - return sub_811BCF4(); + return IsCurrentPhraseEmpty(); quiz = &gSaveBlock1Ptr->lilycoveLady.quiz; - return quiz->correctAnswer == 0xFFFF ? 1 : 0; + return quiz->correctAnswer == EC_EMPTY_WORD ? TRUE : FALSE; } -static void sub_811BDF0(u8 *arg0) +static void GetQuizTitle(u8 *dst) { u8 name[32]; struct SaveBlock1 *saveBlock1 = gSaveBlock1Ptr; DynamicPlaceholderTextUtil_Reset(); + + // Buffer author's name if (StringLength(saveBlock1->lilycoveLady.quiz.playerName) != 0) { TVShowConvertInternationalString(name, saveBlock1->lilycoveLady.quiz.playerName, saveBlock1->lilycoveLady.quiz.language); @@ -2696,32 +2917,33 @@ static void sub_811BDF0(u8 *arg0) DynamicPlaceholderTextUtil_SetPlaceholderPtr(0, gText_Lady); } - DynamicPlaceholderTextUtil_ExpandPlaceholders(arg0, gText_F700sQuiz); + // "'s Quiz" + DynamicPlaceholderTextUtil_ExpandPlaceholders(dst, gText_F700sQuiz); } -static void sub_811BE54(void) +static void BufferCurrentPhraseToStringVar2(void) { int i; - u16 *ecWord; + u16 *phrase; u8 *str; - ecWord = sEasyChatScreen->ecWordBuffer; + phrase = sEasyChatScreen->currentPhrase; str = gStringVar2; i = 0; - while (i < sEasyChatScreen->unk_07) + while (i < sEasyChatScreen->maxWords) { - str = CopyEasyChatWordPadded(str, *ecWord, 0); + str = CopyEasyChatWordPadded(str, *phrase, 0); *str = 0; str++; - ecWord++; + phrase++; i++; } str--; - str[0] = 0xFF; + str[0] = EOS; } -static void sub_811BE9C(void) +static void SetSpecialEasyChatResult(void) { switch (sEasyChatScreen->type) { @@ -2735,8 +2957,8 @@ static void sub_811BE9C(void) gSpecialVar_0x8004 = 0; break; case EASY_CHAT_TYPE_TRENDY_PHRASE: - sub_811BE54(); - gSpecialVar_0x8004 = sub_81226D8(sEasyChatScreen->ecWordBuffer); + BufferCurrentPhraseToStringVar2(); + gSpecialVar_0x8004 = IsPhraseTrendy(sEasyChatScreen->currentPhrase); break; case EASY_CHAT_TYPE_GOOD_SAYING: gSpecialVar_0x8004 = DidPlayerInputABerryMasterWifePhrase(); @@ -2761,62 +2983,62 @@ static u16 DidPlayerInputABerryMasterWifePhrase(void) return 0; } -static void sub_811BF78(void) +static void ClearUnusedField(void) { - sEasyChatScreen->unk_13 = 0; + sEasyChatScreen->unused = 0; } -static int sub_811BF88(int easyChatWord) +static bool32 DummyWordCheck(int easyChatWord) { - return 0; + return FALSE; } -static bool8 sub_811BF8C(void) +static bool8 InitEasyChatScreenControl(void) { - if (!sub_811CE94()) - return 0; + if (!InitEasyChatScreenControl_()) + return FALSE; else - return 1; + return TRUE; } -static bool8 sub_811BFA4(void) +static bool8 LoadEasyChatScreen(void) { - switch (sUnknown_0203A11C->unk0) + switch (sScreenControl->funcState) { case 0: ResetBgsAndClearDma3BusyFlags(0); InitBgsFromTemplates(0, sEasyChatBgTemplates, ARRAY_COUNT(sEasyChatBgTemplates)); - SetBgTilemapBuffer(3, sUnknown_0203A11C->unkB00); - SetBgTilemapBuffer(1, sUnknown_0203A11C->unk300); + SetBgTilemapBuffer(3, sScreenControl->bg3TilemapBuffer); + SetBgTilemapBuffer(1, sScreenControl->bg1TilemapBuffer); InitWindows(sEasyChatWindowTemplates); DeactivateAllTextPrinters(); - sub_811CF64(); - sub_811CF04(); + LoadEasyChatPalettes(); + InitEasyChatBgs(); CpuFastFill(0, (void *)OAM, OAM_SIZE); break; case 1: DecompressAndLoadBgGfxUsingHeap(3, gEasyChatWindow_Gfx, 0, 0, 0); CopyToBgTilemapBuffer(3, gEasyChatWindow_Tilemap, 0, 0); - sub_811D60C(); - sub_811D424(sUnknown_0203A11C->unk300); - sub_811D230(); - sub_811E948(); + AdjustBgTilemapForFooter(); + BufferFrameTilemap(sScreenControl->bg1TilemapBuffer); + AddPhraseWindow(); + AddMainScreenButtonWindow(); CopyBgTilemapBufferToVram(3); break; case 2: - DecompressAndLoadBgGfxUsingHeap(1, sUnknown_08597B54, 0, 0, 0); + DecompressAndLoadBgGfxUsingHeap(1, sTextInputFrame_Gfx, 0, 0, 0); CopyBgTilemapBufferToVram(1); break; case 3: - sub_811CFCC(); - sub_811D0BC(); - sub_811D2C8(); - sub_811D684(); + PrintTitle(); + PrintInitialInstructions(); + PrintCurrentPhrase(); + DrawLowerWindow(); break; case 4: - sub_811DE90(); + LoadEasyChatGfx(); if (GetEasyChatScreenType() != EASY_CHAT_TYPE_QUIZ_QUESTION) - sub_811DEC4(); + CreateMainCursorSprite(); break; case 5: if (IsDma3ManagerBusyWithBgCopy()) @@ -2825,7 +3047,7 @@ static bool8 sub_811BFA4(void) } else { - sub_811DE5C(0, 0, 0, 0); + SetWindowDimensions(0, 0, 0, 0); SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG_ALL | WININ_WIN0_OBJ | WININ_WIN0_CLR); SetGpuReg(REG_OFFSET_WINOUT, WINOUT_WIN01_BG0 | WINOUT_WIN01_BG1 @@ -2836,82 +3058,84 @@ static bool8 sub_811BFA4(void) ShowBg(1); ShowBg(2); ShowBg(0); - sub_811E5D4(); - sub_811E720(); - sub_811E828(); + CreateScrollIndicatorSprites(); + CreateStartSelectButtonSprites(); + TryAddInterviewObjectEvents(); } break; default: return FALSE; } - sUnknown_0203A11C->unk0++; + sScreenControl->funcState++; return TRUE; } -static void sub_811C13C(void) +static void FreeEasyChatScreenControl(void) { - if (sUnknown_0203A11C) - FREE_AND_SET_NULL(sUnknown_0203A11C); + if (sScreenControl) + FREE_AND_SET_NULL(sScreenControl); } -static void sub_811C158(u16 arg0) +static void StartEasyChatFunction(u16 funcId) { - sUnknown_0203A11C->unk4 = arg0; - sUnknown_0203A11C->unk0 = 0; - sub_811C170(); + sScreenControl->currentFuncId = funcId; + sScreenControl->funcState = 0; + RunEasyChatFunction(); } -static bool8 sub_811C170(void) +// Returns FALSE when called function has finished +static bool8 RunEasyChatFunction(void) { - switch (sUnknown_0203A11C->unk4) + switch (sScreenControl->currentFuncId) { - case 0: return FALSE; - case 1: return sub_811C2D4(); - case 2: return sub_811C30C(); - case 3: return sub_811C3E4(); - case 4: return sub_811C48C(); - case 5: return sub_811C404(); - case 6: return sub_811C448(); - case 7: return sub_811C4D0(); - case 8: return sub_811C518(); - case 9: return sub_811C554(); - case 10: return sub_811C620(); - case 11: return sub_811C830(); - case 12: return sub_811C8F0(); - case 13: return sub_811C99C(); - case 14: return sub_811CA5C(); - case 15: return sub_811C780(); - case 16: return sub_811C78C(); - case 17: return sub_811C7D4(); - case 18: return sub_811CB18(); - case 19: return sub_811CB98(); - case 20: return sub_811CB24(); - case 21: return sub_811CC90(); - case 22: return sub_811CC08(); - case 23: return sub_811C6C0(); - case 24: return FALSE; - case 25: return FALSE; - case 26: return FALSE; - case 27: return FALSE; - case 28: return FALSE; - case 29: return sub_811CD14(); - case 30: return sub_811CD54(); - case 31: return sub_811CD94(); - case 32: return sub_811CDD4(); - case 33: return sub_811CE14(); - case 34: return sub_811CE54(); - default: return FALSE; + case ECFUNC_NONE: return FALSE; + case ECFUNC_REPRINT_PHRASE: return ReprintPhrase(); + case ECFUNC_UPDATE_MAIN_CURSOR: return UpdateMainCursor(); + case ECFUNC_UPDATE_MAIN_CURSOR_ON_BUTTONS: return UpdateMainCursorOnButtons(); + case ECFUNC_PROMPT_DELETE_ALL: return ShowConfirmDeleteAllPrompt(); + case ECFUNC_PROMPT_EXIT: return ShowConfirmExitPrompt(); + case ECFUNC_PROMPT_CONFIRM: return ShowConfirmPrompt(); + case ECFUNC_CLOSE_PROMPT: return ClosePrompt(); + case ECFUNC_CLOSE_PROMPT_AFTER_DELETE: return ClosePromptAfterDeleteAll(); + case ECFUNC_OPEN_KEYBOARD: return OpenKeyboard(); + case ECFUNC_CLOSE_KEYBOARD: return CloseKeyboard(); + case ECFUNC_OPEN_WORD_SELECT: return OpenWordSelect(); + case ECFUNC_CLOSE_WORD_SELECT: return CloseWordSelect(); + case ECFUNC_PROMPT_CONFIRM_LYRICS: return ShowConfirmLyricsPrompt(); + case ECFUNC_RETURN_TO_KEYBOARD: return ReturnToKeyboard(); + case ECFUNC_UPDATE_KEYBOARD_CURSOR: return UpdateKeyboardCursor(); + case ECFUNC_GROUP_NAMES_SCROLL_DOWN: return GroupNamesScrollDown(); + case ECFUNC_GROUP_NAMES_SCROLL_UP: return GroupNamesScrollUp(); + case ECFUNC_UPDATE_WORD_SELECT_CURSOR: return UpdateWordSelectCursor(); + case ECFUNC_WORD_SELECT_SCROLL_UP: return WordSelectScrollUp(); + case ECFUNC_WORD_SELECT_SCROLL_DOWN: return WordSelectScrollDown(); + case ECFUNC_WORD_SELECT_PAGE_UP: return WordSelectPageScrollUp(); + case ECFUNC_WORD_SELECT_PAGE_DOWN: return WordSelectPageScrollDown(); + case ECFUNC_SWITCH_KEYBOARD_MODE: return SwitchKeyboardMode(); + case ECFUNC_EXIT: return FALSE; + case ECFUNC_QUIZ_QUESTION: return FALSE; // The 4 quiz functions + case ECFUNC_QUIZ_ANSWER: return FALSE; // 'finish' automatically + case ECFUNC_SET_QUIZ_QUESTION: return FALSE; // because they switch to a + case ECFUNC_SET_QUIZ_ANSWER: return FALSE; // callback in sQuizLadyEasyChatScreens + case ECFUNC_MSG_CREATE_QUIZ: return ShowCreateQuizMsg(); + case ECFUNC_MSG_SELECT_ANSWER: return ShowSelectAnswerMsg(); + case ECFUNC_MSG_SONG_TOO_SHORT: return ShowSongTooShortMsg(); + case ECFUNC_MSG_CANT_DELETE_LYRICS: return ShowCantDeleteLyricsMsg(); + case ECFUNC_MSG_COMBINE_TWO_WORDS: return ShowCombineTwoWordsMsg(); + case ECFUNC_MSG_CANT_EXIT: return ShowCantExitMsg(); + default: return FALSE; } } -static bool8 sub_811C2D4(void) +// Only used to update the current phrase after a word deletion +static bool8 ReprintPhrase(void) { - switch (sUnknown_0203A11C->unk0) + switch (sScreenControl->funcState) { case 0: - sub_811D2C8(); - sUnknown_0203A11C->unk0++; + PrintCurrentPhrase(); + sScreenControl->funcState++; break; case 1: return IsDma3ManagerBusyWithBgCopy(); @@ -2920,29 +3144,29 @@ static bool8 sub_811C2D4(void) return TRUE; } -static bool8 sub_811C30C(void) +static bool8 UpdateMainCursor(void) { u8 i; - u16 *ecWordBuffer; + u16 *currentPhrase; u16 *ecWord; u8 frameId; u8 cursorColumn, cursorRow, numColumns; - s16 var1; + s16 x; int stringWidth; int trueStringWidth; - u8 var2; + u8 y; u8 str[64]; - ecWordBuffer = GetEasyChatWordBuffer(); + currentPhrase = GetCurrentPhrase(); frameId = GetEasyChatScreenFrameId(); cursorColumn = GetMainCursorColumn(); cursorRow = GetMainCursorRow(); numColumns = GetNumColumns(); - ecWord = &ecWordBuffer[cursorRow * numColumns]; - var1 = 8 * sPhraseFrameDimensions[frameId].left + 13; + ecWord = ¤tPhrase[cursorRow * numColumns]; + x = 8 * sPhraseFrameDimensions[frameId].left + 13; for (i = 0; i < cursorColumn; i++) { - if (*ecWord == 0xFFFF) + if (*ecWord == EC_EMPTY_WORD) { stringWidth = 72; } @@ -2953,31 +3177,31 @@ static bool8 sub_811C30C(void) } trueStringWidth = stringWidth + 17; - var1 += trueStringWidth; + x += trueStringWidth; ecWord++; } - var2 = 8 * (sPhraseFrameDimensions[frameId].top + cursorRow * 2); - sub_811DF60(var1, var2 + 8); + y = 8 * (sPhraseFrameDimensions[frameId].top + cursorRow * 2); + SetMainCursorPos(x, y + 8); return FALSE; } -static bool8 sub_811C3E4(void) +static bool8 UpdateMainCursorOnButtons(void) { u8 xOffset = GetFooterOptionXOffset(GetMainCursorColumn()); - sub_811DF60(xOffset, 96); + SetMainCursorPos(xOffset, 96); return FALSE; } -static bool8 sub_811C404(void) +static bool8 ShowConfirmExitPrompt(void) { - switch (sUnknown_0203A11C->unk0) + switch (sScreenControl->funcState) { case 0: - sub_811DF90(); - sub_811D104(2); - sub_811D214(1); - sUnknown_0203A11C->unk0++; + StopMainCursorAnim(); + PrintEasyChatStdMessage(MSG_CONFIRM_EXIT); + CreateEasyChatYesNoMenu(1); + sScreenControl->funcState++; break; case 1: return IsDma3ManagerBusyWithBgCopy(); @@ -2986,15 +3210,15 @@ static bool8 sub_811C404(void) return TRUE; } -static bool8 sub_811C448(void) +static bool8 ShowConfirmPrompt(void) { - switch (sUnknown_0203A11C->unk0) + switch (sScreenControl->funcState) { case 0: - sub_811DF90(); - sub_811D104(3); - sub_811D214(0); - sUnknown_0203A11C->unk0++; + StopMainCursorAnim(); + PrintEasyChatStdMessage(MSG_CONFIRM); + CreateEasyChatYesNoMenu(0); + sScreenControl->funcState++; break; case 1: return IsDma3ManagerBusyWithBgCopy(); @@ -3003,15 +3227,15 @@ static bool8 sub_811C448(void) return TRUE; } -static bool8 sub_811C48C(void) +static bool8 ShowConfirmDeleteAllPrompt(void) { - switch (sUnknown_0203A11C->unk0) + switch (sScreenControl->funcState) { case 0: - sub_811DF90(); - sub_811D104(1); - sub_811D214(1); - sUnknown_0203A11C->unk0++; + StopMainCursorAnim(); + PrintEasyChatStdMessage(MSG_CONFIRM_DELETE); + CreateEasyChatYesNoMenu(1); + sScreenControl->funcState++; break; case 1: return IsDma3ManagerBusyWithBgCopy(); @@ -3020,16 +3244,16 @@ static bool8 sub_811C48C(void) return TRUE; } -static bool8 sub_811C4D0(void) +static bool8 ClosePrompt(void) { - switch (sUnknown_0203A11C->unk0) + switch (sScreenControl->funcState) { case 0: - sub_811DFB0(); - sub_811D104(0); - sub_811D2C8(); + StartMainCursorAnim(); + PrintEasyChatStdMessage(MSG_INSTRUCTIONS); + PrintCurrentPhrase(); ShowBg(0); - sUnknown_0203A11C->unk0++; + sScreenControl->funcState++; break; case 1: return IsDma3ManagerBusyWithBgCopy(); @@ -3038,15 +3262,15 @@ static bool8 sub_811C4D0(void) return TRUE; } -static bool8 sub_811C518(void) +static bool8 ClosePromptAfterDeleteAll(void) { - switch (sUnknown_0203A11C->unk0) + switch (sScreenControl->funcState) { case 0: - sub_811DFB0(); - sub_811D104(0); - sub_811D2C8(); - sUnknown_0203A11C->unk0++; + StartMainCursorAnim(); + PrintEasyChatStdMessage(MSG_INSTRUCTIONS); + PrintCurrentPhrase(); + sScreenControl->funcState++; // Fall through case 1: return IsDma3ManagerBusyWithBgCopy(); @@ -3055,42 +3279,42 @@ static bool8 sub_811C518(void) return TRUE; } -static bool8 sub_811C554(void) +static bool8 OpenKeyboard(void) { - switch (sUnknown_0203A11C->unk0) + switch (sScreenControl->funcState) { case 0: - sub_811DF90(); + StopMainCursorAnim(); HideBg(0); - sub_811DE5C(0, 0, 0, 0); - sub_811D6D4(); - sUnknown_0203A11C->unk0++; + SetWindowDimensions(0, 0, 0, 0); + PrintKeyboardText(); + sScreenControl->funcState++; break; case 1: if (!IsDma3ManagerBusyWithBgCopy()) { - sub_811D9CC(0); - sUnknown_0203A11C->unk0++; + InitLowerWindowAnim(WINANIM_OPEN_KEYBOARD); + sScreenControl->funcState++; } break; case 2: - if (!IsDma3ManagerBusyWithBgCopy() && !sub_811DAA4()) - sUnknown_0203A11C->unk0++; + if (!IsDma3ManagerBusyWithBgCopy() && !UpdateLowerWindowAnim()) + sScreenControl->funcState++; break; case 3: if (!IsDma3ManagerBusyWithBgCopy()) { - sub_811E3AC(); - sUnknown_0203A11C->unk0++; + CreateSideWindowSprites(); + sScreenControl->funcState++; } break; case 4: - if (!sub_811E418()) + if (!ShowSideWindow()) { - sub_811DFC8(); - sub_811E6E0(0); - sub_811E64C(); - sUnknown_0203A11C->unk0++; + CreateRectangleCursorSprites(); + SetScrollIndicatorXPos(FALSE); + UpdateScrollIndicatorsVisibility(); + sScreenControl->funcState++; return FALSE; } break; @@ -3101,33 +3325,33 @@ static bool8 sub_811C554(void) return TRUE; } -static bool8 sub_811C620(void) +static bool8 CloseKeyboard(void) { - switch (sUnknown_0203A11C->unk0) + switch (sScreenControl->funcState) { case 0: - sub_811E050(); - sub_811E4AC(); - sub_811E6B0(); - sUnknown_0203A11C->unk0++; + DestroyRectangleCursorSprites(); + HideModeWindow(); + HideScrollIndicators(); + sScreenControl->funcState++; break; case 1: - if (sub_811E4D0() == TRUE) + if (DestroySideWindowSprites() == TRUE) break; - sub_811D9CC(1); - sUnknown_0203A11C->unk0++; + InitLowerWindowAnim(WINANIM_CLOSE_KEYBOARD); + sScreenControl->funcState++; // Fall through case 2: - if (!sub_811DAA4()) - sUnknown_0203A11C->unk0++; + if (!UpdateLowerWindowAnim()) + sScreenControl->funcState++; break; case 3: if (!IsDma3ManagerBusyWithBgCopy()) { - sub_811DFB0(); + StartMainCursorAnim(); ShowBg(0); - sUnknown_0203A11C->unk0++; + sScreenControl->funcState++; } break; case 4: @@ -3137,38 +3361,38 @@ static bool8 sub_811C620(void) return TRUE; } -static bool8 sub_811C6C0(void) +static bool8 SwitchKeyboardMode(void) { - switch (sUnknown_0203A11C->unk0) + switch (sScreenControl->funcState) { case 0: - sub_811E050(); - sub_811E6B0(); - sub_811E55C(); - sub_811D9CC(5); - sUnknown_0203A11C->unk0++; + DestroyRectangleCursorSprites(); + HideScrollIndicators(); + SetModeWindowToTransition(); + InitLowerWindowAnim(WINANIM_KEYBOARD_SWITCH_OUT); + sScreenControl->funcState++; break; case 1: - if (!sub_811DAA4() && !sub_811E5B8()) + if (!UpdateLowerWindowAnim() && !IsModeWindowAnimActive()) { - sub_811D6D4(); - sUnknown_0203A11C->unk0++; + PrintKeyboardText(); + sScreenControl->funcState++; } break; case 2: if (!IsDma3ManagerBusyWithBgCopy()) { - sub_811D9CC(6); - sub_811E578(); - sUnknown_0203A11C->unk0++; + InitLowerWindowAnim(WINANIM_KEYBOARD_SWITCH_IN); + UpdateModeWindowAnim(); + sScreenControl->funcState++; } break; case 3: - if (!sub_811DAA4() && !sub_811E5B8()) + if (!UpdateLowerWindowAnim() && !IsModeWindowAnimActive()) { - sub_811E64C(); - sub_811DFC8(); - sUnknown_0203A11C->unk0++; + UpdateScrollIndicatorsVisibility(); + CreateRectangleCursorSprites(); + sScreenControl->funcState++; return FALSE; } break; @@ -3179,25 +3403,25 @@ static bool8 sub_811C6C0(void) return TRUE; } -static bool8 sub_811C780(void) +static bool8 UpdateKeyboardCursor(void) { - sub_811E088(); + UpdateRectangleCursorPos(); return FALSE; } -static bool8 sub_811C78C(void) +static bool8 GroupNamesScrollDown(void) { - switch (sUnknown_0203A11C->unk0) + switch (sScreenControl->funcState) { case 0: - sub_811DDAC(1, 4); - sUnknown_0203A11C->unk0++; + InitLowerWindowScroll(1, 4); + sScreenControl->funcState++; // Fall through case 1: - if (!sub_811DE10()) + if (!UpdateLowerWindowScroll()) { - sub_811E088(); - sub_811E64C(); + UpdateRectangleCursorPos(); + UpdateScrollIndicatorsVisibility(); return FALSE; } break; @@ -3206,19 +3430,19 @@ static bool8 sub_811C78C(void) return TRUE; } -static bool8 sub_811C7D4(void) +static bool8 GroupNamesScrollUp(void) { - switch (sUnknown_0203A11C->unk0) + switch (sScreenControl->funcState) { case 0: - sub_811DDAC(-1, 4); - sUnknown_0203A11C->unk0++; + InitLowerWindowScroll(-1, 4); + sScreenControl->funcState++; // Fall through case 1: - if (!sub_811DE10()) + if (!UpdateLowerWindowScroll()) { - sub_811E64C(); - sUnknown_0203A11C->unk0++; + UpdateScrollIndicatorsVisibility(); + sScreenControl->funcState++; return FALSE; } break; @@ -3229,45 +3453,45 @@ static bool8 sub_811C7D4(void) return TRUE; } -static bool8 sub_811C830(void) +static bool8 OpenWordSelect(void) { - switch (sUnknown_0203A11C->unk0) + switch (sScreenControl->funcState) { case 0: - sub_811E050(); - sub_811E4AC(); - sub_811E6B0(); - sUnknown_0203A11C->unk0++; + DestroyRectangleCursorSprites(); + HideModeWindow(); + HideScrollIndicators(); + sScreenControl->funcState++; break; case 1: - if (!sub_811E4D0()) + if (!DestroySideWindowSprites()) { - sub_811D9B4(); - sUnknown_0203A11C->unk0++; + ClearWordSelectWindow(); + sScreenControl->funcState++; } break; case 2: if (!IsDma3ManagerBusyWithBgCopy()) { - sub_811D9CC(2); - sUnknown_0203A11C->unk0++; + InitLowerWindowAnim(WINANIM_OPEN_WORD_SELECT); + sScreenControl->funcState++; } break; case 3: - if (!sub_811DAA4()) + if (!UpdateLowerWindowAnim()) { - sub_811D698(2); - sUnknown_0203A11C->unk0++; + InitLowerWindowText(TEXT_WORD_SELECT); + sScreenControl->funcState++; } break; case 4: if (!IsDma3ManagerBusyWithBgCopy()) { - sub_811E288(); - sub_811E6E0(1); - sub_811E64C(); - sub_811E794(); - sUnknown_0203A11C->unk0++; + CreateWordSelectCursorSprite(); + SetScrollIndicatorXPos(TRUE); + UpdateScrollIndicatorsVisibility(); + UpdateStartSelectButtonsVisibility(); + sScreenControl->funcState++; return FALSE; } break; @@ -3278,40 +3502,40 @@ static bool8 sub_811C830(void) return TRUE; } -static bool8 sub_811C8F0(void) +static bool8 CloseWordSelect(void) { - switch (sUnknown_0203A11C->unk0) + switch (sScreenControl->funcState) { case 0: - sub_811D2C8(); - sUnknown_0203A11C->unk0++; + PrintCurrentPhrase(); + sScreenControl->funcState++; break; case 1: - sub_811E380(); - sub_811E6B0(); - sub_811E7F8(); - sub_811D9B4(); - sUnknown_0203A11C->unk0++; + DestroyWordSelectCursorSprite(); + HideScrollIndicators(); + HideStartSelectButtons(); + ClearWordSelectWindow(); + sScreenControl->funcState++; break; case 2: if (!IsDma3ManagerBusyWithBgCopy()) { - sub_811D9CC(3); - sUnknown_0203A11C->unk0++; + InitLowerWindowAnim(WINANIM_CLOSE_WORD_SELECT); + sScreenControl->funcState++; } break; case 3: - if (!sub_811DAA4()) + if (!UpdateLowerWindowAnim()) { ShowBg(0); - sUnknown_0203A11C->unk0++; + sScreenControl->funcState++; } break; case 4: if (!IsDma3ManagerBusyWithBgCopy()) { - sub_811DFB0(); - sUnknown_0203A11C->unk0++; + StartMainCursorAnim(); + sScreenControl->funcState++; return FALSE; } break; @@ -3322,47 +3546,47 @@ static bool8 sub_811C8F0(void) return TRUE; } -static bool8 sub_811C99C(void) +static bool8 ShowConfirmLyricsPrompt(void) { - switch (sUnknown_0203A11C->unk0) + switch (sScreenControl->funcState) { case 0: - sub_811D2C8(); - sUnknown_0203A11C->unk0++; + PrintCurrentPhrase(); + sScreenControl->funcState++; break; case 1: - sub_811E380(); - sub_811E6B0(); - sub_811E7F8(); - sub_811D9B4(); - sUnknown_0203A11C->unk0++; + DestroyWordSelectCursorSprite(); + HideScrollIndicators(); + HideStartSelectButtons(); + ClearWordSelectWindow(); + sScreenControl->funcState++; break; case 2: if (!IsDma3ManagerBusyWithBgCopy()) { - sub_811D9CC(3); - sUnknown_0203A11C->unk0++; + InitLowerWindowAnim(WINANIM_CLOSE_WORD_SELECT); + sScreenControl->funcState++; } break; case 3: - if (!sub_811DAA4()) + if (!UpdateLowerWindowAnim()) { - sub_811D104(3); - sUnknown_0203A11C->unk0++; + PrintEasyChatStdMessage(MSG_CONFIRM); + sScreenControl->funcState++; } break; case 4: if (!IsDma3ManagerBusyWithBgCopy()) { ShowBg(0); - sUnknown_0203A11C->unk0++; + sScreenControl->funcState++; } break; case 5: if (!IsDma3ManagerBusyWithBgCopy()) { - sub_811DFB0(); - sUnknown_0203A11C->unk0++; + StartMainCursorAnim(); + sScreenControl->funcState++; return FALSE; } break; @@ -3373,45 +3597,45 @@ static bool8 sub_811C99C(void) return TRUE; } -static bool8 sub_811CA5C(void) +static bool8 ReturnToKeyboard(void) { - switch (sUnknown_0203A11C->unk0) + switch (sScreenControl->funcState) { case 0: - sub_811E380(); - sub_811E6B0(); - sub_811E7F8(); - sub_811D9B4(); - sUnknown_0203A11C->unk0++; + DestroyWordSelectCursorSprite(); + HideScrollIndicators(); + HideStartSelectButtons(); + ClearWordSelectWindow(); + sScreenControl->funcState++; break; case 1: if (!IsDma3ManagerBusyWithBgCopy()) { - sub_811D9CC(4); - sUnknown_0203A11C->unk0++; + InitLowerWindowAnim(WINANIM_RETURN_TO_KEYBOARD); + sScreenControl->funcState++; } break; case 2: - if (!sub_811DAA4()) + if (!UpdateLowerWindowAnim()) { - sub_811D6D4(); - sUnknown_0203A11C->unk0++; + PrintKeyboardText(); + sScreenControl->funcState++; } break; case 3: if (!IsDma3ManagerBusyWithBgCopy()) { - sub_811E3AC(); - sUnknown_0203A11C->unk0++; + CreateSideWindowSprites(); + sScreenControl->funcState++; } break; case 4: - if (!sub_811E418()) + if (!ShowSideWindow()) { - sub_811DFC8(); - sub_811E6E0(0); - sub_811E64C(); - sUnknown_0203A11C->unk0++; + CreateRectangleCursorSprites(); + SetScrollIndicatorXPos(FALSE); + UpdateScrollIndicatorsVisibility(); + sScreenControl->funcState++; return FALSE; } break; @@ -3420,34 +3644,34 @@ static bool8 sub_811CA5C(void) return TRUE; } -static bool8 sub_811CB18(void) +static bool8 UpdateWordSelectCursor(void) { - sub_811E30C(); + UpdateWordSelectCursorPos(); return FALSE; } -static bool8 sub_811CB24(void) +static bool8 WordSelectScrollDown(void) { - switch (sUnknown_0203A11C->unk0) + switch (sScreenControl->funcState) { case 0: - sub_811D7A4(); - sUnknown_0203A11C->unk0++; + PrintWordSelectNextRowDown(); + sScreenControl->funcState++; break; case 1: if (!IsDma3ManagerBusyWithBgCopy()) { - sub_811DDAC(1, 4); - sUnknown_0203A11C->unk0++; + InitLowerWindowScroll(1, 4); + sScreenControl->funcState++; } break; case 2: - if (!sub_811DE10()) + if (!UpdateLowerWindowScroll()) { - sub_811E30C(); - sub_811E64C(); - sub_811E794(); - sUnknown_0203A11C->unk0++; + UpdateWordSelectCursorPos(); + UpdateScrollIndicatorsVisibility(); + UpdateStartSelectButtonsVisibility(); + sScreenControl->funcState++; return FALSE; } break; @@ -3458,27 +3682,27 @@ static bool8 sub_811CB24(void) return TRUE; } -static bool8 sub_811CB98(void) +static bool8 WordSelectScrollUp(void) { - switch (sUnknown_0203A11C->unk0) + switch (sScreenControl->funcState) { case 0: - sub_811D7C8(); - sUnknown_0203A11C->unk0++; + PrintWordSelectNextRowUp(); + sScreenControl->funcState++; break; case 1: if (!IsDma3ManagerBusyWithBgCopy()) { - sub_811DDAC(-1, 4); - sUnknown_0203A11C->unk0++; + InitLowerWindowScroll(-1, 4); + sScreenControl->funcState++; } break; case 2: - if (!sub_811DE10()) + if (!UpdateLowerWindowScroll()) { - sub_811E64C(); - sub_811E794(); - sUnknown_0203A11C->unk0++; + UpdateScrollIndicatorsVisibility(); + UpdateStartSelectButtonsVisibility(); + sScreenControl->funcState++; return FALSE; } break; @@ -3489,29 +3713,29 @@ static bool8 sub_811CB98(void) return TRUE; } -static bool8 sub_811CC08(void) +static bool8 WordSelectPageScrollDown(void) { - switch (sUnknown_0203A11C->unk0) + switch (sScreenControl->funcState) { case 0: - sub_811D7EC(); - sUnknown_0203A11C->unk0++; + PrintWordSelectRowsPageDown(); + sScreenControl->funcState++; break; case 1: if (!IsDma3ManagerBusyWithBgCopy()) { - s16 var0 = sub_811BBDC() - sub_811DE48(); - sub_811DDAC(var0, 8); - sUnknown_0203A11C->unk0++; + s16 scrollChange = GetWordSelectScrollOffset() - GetLowerWindowScrollOffset(); + InitLowerWindowScroll(scrollChange, 8); + sScreenControl->funcState++; } break; case 2: - if (!sub_811DE10()) + if (!UpdateLowerWindowScroll()) { - sub_811E30C(); - sub_811E64C(); - sub_811E794(); - sUnknown_0203A11C->unk0++; + UpdateWordSelectCursorPos(); + UpdateScrollIndicatorsVisibility(); + UpdateStartSelectButtonsVisibility(); + sScreenControl->funcState++; return FALSE; } break; @@ -3522,28 +3746,28 @@ static bool8 sub_811CC08(void) return TRUE; } -static bool8 sub_811CC90(void) +static bool8 WordSelectPageScrollUp(void) { - switch (sUnknown_0203A11C->unk0) + switch (sScreenControl->funcState) { case 0: - sub_811D830(); - sUnknown_0203A11C->unk0++; + PrintWordSelectRowsPageUp(); + sScreenControl->funcState++; break; case 1: if (!IsDma3ManagerBusyWithBgCopy()) { - s16 var0 = sub_811BBDC() - sub_811DE48(); - sub_811DDAC(var0, 8); - sUnknown_0203A11C->unk0++; + s16 scrollChange = GetWordSelectScrollOffset() - GetLowerWindowScrollOffset(); + InitLowerWindowScroll(scrollChange, 8); + sScreenControl->funcState++; } break; case 2: - if (!sub_811DE10()) + if (!UpdateLowerWindowScroll()) { - sub_811E64C(); - sub_811E794(); - sUnknown_0203A11C->unk0++; + UpdateScrollIndicatorsVisibility(); + UpdateStartSelectButtonsVisibility(); + sScreenControl->funcState++; return FALSE; } break; @@ -3554,14 +3778,14 @@ static bool8 sub_811CC90(void) return TRUE; } -static bool8 sub_811CD14(void) +static bool8 ShowCreateQuizMsg(void) { - switch (sUnknown_0203A11C->unk0) + switch (sScreenControl->funcState) { case 0: - sub_811DF90(); - sub_811D104(4); - sUnknown_0203A11C->unk0++; + StopMainCursorAnim(); + PrintEasyChatStdMessage(MSG_CREATE_QUIZ); + sScreenControl->funcState++; break; case 1: return IsDma3ManagerBusyWithBgCopy(); @@ -3570,14 +3794,14 @@ static bool8 sub_811CD14(void) return TRUE; } -static bool8 sub_811CD54(void) +static bool8 ShowSelectAnswerMsg(void) { - switch (sUnknown_0203A11C->unk0) + switch (sScreenControl->funcState) { case 0: - sub_811DF90(); - sub_811D104(5); - sUnknown_0203A11C->unk0++; + StopMainCursorAnim(); + PrintEasyChatStdMessage(MSG_SELECT_ANSWER); + sScreenControl->funcState++; break; case 1: return IsDma3ManagerBusyWithBgCopy(); @@ -3586,14 +3810,14 @@ static bool8 sub_811CD54(void) return TRUE; } -static bool8 sub_811CD94(void) +static bool8 ShowSongTooShortMsg(void) { - switch (sUnknown_0203A11C->unk0) + switch (sScreenControl->funcState) { case 0: - sub_811DF90(); - sub_811D104(6); - sUnknown_0203A11C->unk0++; + StopMainCursorAnim(); + PrintEasyChatStdMessage(MSG_SONG_TOO_SHORT); + sScreenControl->funcState++; break; case 1: return IsDma3ManagerBusyWithBgCopy(); @@ -3602,14 +3826,14 @@ static bool8 sub_811CD94(void) return TRUE; } -static bool8 sub_811CDD4(void) +static bool8 ShowCantDeleteLyricsMsg(void) { - switch (sUnknown_0203A11C->unk0) + switch (sScreenControl->funcState) { case 0: - sub_811DF90(); - sub_811D104(7); - sUnknown_0203A11C->unk0++; + StopMainCursorAnim(); + PrintEasyChatStdMessage(MSG_CANT_DELETE_LYRICS); + sScreenControl->funcState++; break; case 1: return IsDma3ManagerBusyWithBgCopy(); @@ -3618,14 +3842,14 @@ static bool8 sub_811CDD4(void) return TRUE; } -static bool8 sub_811CE14(void) +static bool8 ShowCombineTwoWordsMsg(void) { - switch (sUnknown_0203A11C->unk0) + switch (sScreenControl->funcState) { case 0: - sub_811DF90(); - sub_811D104(8); - sUnknown_0203A11C->unk0++; + StopMainCursorAnim(); + PrintEasyChatStdMessage(MSG_COMBINE_TWO_WORDS); + sScreenControl->funcState++; break; case 1: return IsDma3ManagerBusyWithBgCopy(); @@ -3634,14 +3858,14 @@ static bool8 sub_811CE14(void) return TRUE; } -static bool8 sub_811CE54(void) +static bool8 ShowCantExitMsg(void) { - switch (sUnknown_0203A11C->unk0) + switch (sScreenControl->funcState) { case 0: - sub_811DF90(); - sub_811D104(9); - sUnknown_0203A11C->unk0++; + StopMainCursorAnim(); + PrintEasyChatStdMessage(MSG_CANT_QUIT); + sScreenControl->funcState++; break; case 1: return IsDma3ManagerBusyWithBgCopy(); @@ -3650,28 +3874,28 @@ static bool8 sub_811CE54(void) return TRUE; } -static bool8 sub_811CE94(void) +static bool8 InitEasyChatScreenControl_(void) { - sUnknown_0203A11C = Alloc(sizeof(*sUnknown_0203A11C)); - if (!sUnknown_0203A11C) + sScreenControl = Alloc(sizeof(*sScreenControl)); + if (!sScreenControl) return FALSE; - sUnknown_0203A11C->unk0 = 0; - sUnknown_0203A11C->unk2D8 = NULL; - sUnknown_0203A11C->unk2DC = NULL; - sUnknown_0203A11C->unk2E0 = NULL; - sUnknown_0203A11C->unk2E4 = NULL; - sUnknown_0203A11C->unk2E8 = NULL; - sUnknown_0203A11C->unk2EC = NULL; - sUnknown_0203A11C->unk2F0 = NULL; - sUnknown_0203A11C->unk2F4 = NULL; - sUnknown_0203A11C->unk2F8 = NULL; - sUnknown_0203A11C->unk2FC = NULL; - sUnknown_0203A11C->unkA = FooterHasFourOptions_(); + sScreenControl->funcState = 0; + sScreenControl->mainCursorSprite = NULL; + sScreenControl->rectangleCursorSpriteRight = NULL; + sScreenControl->rectangleCursorSpriteLeft = NULL; + sScreenControl->wordSelectCursorSprite = NULL; + sScreenControl->buttonWindowSprite = NULL; + sScreenControl->modeWindowSprite = NULL; + sScreenControl->scrollIndicatorUpSprite = NULL; + sScreenControl->scrollIndicatorDownSprite = NULL; + sScreenControl->startButtonSprite = NULL; + sScreenControl->selectButtonSprite = NULL; + sScreenControl->fourFooterOptions = FooterHasFourOptions_(); return TRUE; } -static void sub_811CF04(void) +static void InitEasyChatBgs(void) { ChangeBgX(3, 0, 0); ChangeBgY(3, 0, 0); @@ -3684,19 +3908,19 @@ static void sub_811CF04(void) SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_MODE_0 | DISPCNT_OBJ_1D_MAP | DISPCNT_OBJ_ON | DISPCNT_WIN0_ON); } -static void sub_811CF64(void) +static void LoadEasyChatPalettes(void) { ResetPaletteFade(); LoadPalette(gEasyChatMode_Pal, 0, 32); - LoadPalette(sUnknown_08597B14, 1 * 16, 32); - LoadPalette(sUnknown_08597B34, 4 * 16, 32); + LoadPalette(sTextInputFrameOrange_Pal, 1 * 16, 32); + LoadPalette(sTextInputFrameGreen_Pal, 4 * 16, 32); LoadPalette(sUnknown_08597C1C, 10 * 16, 8); LoadPalette(sUnknown_08597C24, 11 * 16, 12); LoadPalette(sUnknown_08597C24, 15 * 16, 12); LoadPalette(sUnknown_08597C24, 3 * 16, 12); } -static void sub_811CFCC(void) +static void PrintTitle(void) { int xOffset; const u8 *titleText = GetTitleText(); @@ -3705,17 +3929,17 @@ static void sub_811CFCC(void) xOffset = GetStringCenterAlignXOffset(1, titleText, 144); FillWindowPixelBuffer(0, PIXEL_FILL(0)); - sub_811D058(0, 1, titleText, xOffset, 1, 0xFF, TEXT_COLOR_TRANSPARENT, TEXT_COLOR_DARK_GREY, TEXT_COLOR_LIGHT_GREY); + PrintEasyChatTextWithColors(0, 1, titleText, xOffset, 1, TEXT_SPEED_FF, TEXT_COLOR_TRANSPARENT, TEXT_COLOR_DARK_GREY, TEXT_COLOR_LIGHT_GREY); PutWindowTilemap(0); CopyWindowToVram(0, 3); } -void sub_811D028(u8 windowId, u8 fontId, const u8 *str, u8 x, u8 y, u8 speed, void (*callback)(struct TextPrinterTemplate *, u16)) +static void PrintEasyChatText(u8 windowId, u8 fontId, const u8 *str, u8 x, u8 y, u8 speed, void (*callback)(struct TextPrinterTemplate *, u16)) { AddTextPrinterParameterized(windowId, fontId, str, x, y, speed, callback); } -static void sub_811D058(u8 windowId, u8 fontId, const u8 *str, u8 left, u8 top, u8 speed, u8 bg, u8 fg, u8 shadow) +static void PrintEasyChatTextWithColors(u8 windowId, u8 fontId, const u8 *str, u8 left, u8 top, u8 speed, u8 bg, u8 fg, u8 shadow) { u8 color[3]; color[0] = bg; @@ -3724,51 +3948,51 @@ static void sub_811D058(u8 windowId, u8 fontId, const u8 *str, u8 left, u8 top, AddTextPrinterParameterized3(windowId, fontId, left, top, color, speed, str); } -static void sub_811D0BC(void) +static void PrintInitialInstructions(void) { FillBgTilemapBufferRect(0, 0, 0, 0, 32, 20, 17); LoadUserWindowBorderGfx(1, 1, 0xE0); DrawTextBorderOuter(1, 1, 14); - sub_811D104(0); + PrintEasyChatStdMessage(MSG_INSTRUCTIONS); PutWindowTilemap(1); CopyBgTilemapBufferToVram(0); } -static void sub_811D104(u8 arg0) +static void PrintEasyChatStdMessage(u8 msgId) { const u8 *text2 = NULL; const u8 *text1 = NULL; - switch (arg0) + switch (msgId) { - case 0: + case MSG_INSTRUCTIONS: GetEasyChatInstructionsText(&text1, &text2); break; - case 2: - sub_811BB40(&text1, &text2); + case MSG_CONFIRM_EXIT: + GetEasyChatConfirmExitText(&text1, &text2); break; - case 3: + case MSG_CONFIRM: GetEasyChatConfirmText(&text1, &text2); break; - case 1: + case MSG_CONFIRM_DELETE: GetEasyChatConfirmDeletionText(&text1, &text2); break; - case 4: + case MSG_CREATE_QUIZ: text1 = gText_CreateAQuiz; break; - case 5: + case MSG_SELECT_ANSWER: text1 = gText_SelectTheAnswer; break; - case 6: + case MSG_SONG_TOO_SHORT: text1 = gText_OnlyOnePhrase; text2 = gText_OriginalSongWillBeUsed; break; - case 7: + case MSG_CANT_DELETE_LYRICS: text1 = gText_LyricsCantBeDeleted; break; - case 8: + case MSG_COMBINE_TWO_WORDS: text1 = gText_CombineTwoWordsOrPhrases3; break; - case 9: + case MSG_CANT_QUIT: text1 = gText_YouCannotQuitHere; text2 = gText_SectionMustBeCompleted; break; @@ -3776,20 +4000,20 @@ static void sub_811D104(u8 arg0) FillWindowPixelBuffer(1, PIXEL_FILL(1)); if (text1) - sub_811D028(1, 1, text1, 0, 1, 0xFF, 0); + PrintEasyChatText(1, 1, text1, 0, 1, TEXT_SPEED_FF, 0); if (text2) - sub_811D028(1, 1, text2, 0, 17, 0xFF, 0); + PrintEasyChatText(1, 1, text2, 0, 17, TEXT_SPEED_FF, 0); CopyWindowToVram(1, 3); } -static void sub_811D214(u8 initialCursorPos) +static void CreateEasyChatYesNoMenu(u8 initialCursorPos) { CreateYesNoMenu(&sEasyChatYesNoWindowTemplate, 1, 14, initialCursorPos); } -static void sub_811D230(void) +static void AddPhraseWindow(void) { u8 frameId; struct WindowTemplate template; @@ -3802,49 +4026,50 @@ static void sub_811D230(void) template.height = sPhraseFrameDimensions[frameId].height; template.paletteNum = 11; template.baseBlock = 0x6C; - sUnknown_0203A11C->windowId = AddWindow(&template); - PutWindowTilemap(sUnknown_0203A11C->windowId); + sScreenControl->windowId = AddWindow(&template); + PutWindowTilemap(sScreenControl->windowId); } -static void sub_811D2C8(void) +static void PrintCurrentPhrase(void) { - u8 spC[4]; - u16 *ecWord; + u8 strClear[4]; + u16 *currentPhrase; u8 numColumns, numRows; u8 *str; int frameId; - int var1; + bool32 isQuizQuestion; int i, j, k; - ecWord = GetEasyChatWordBuffer(); + currentPhrase = GetCurrentPhrase(); numColumns = GetNumColumns(); numRows = GetNumRows(); frameId = GetEasyChatScreenFrameId(); - var1 = 0; - if (frameId == 7) - var1 = 1; - FillWindowPixelBuffer(sUnknown_0203A11C->windowId, PIXEL_FILL(1)); + isQuizQuestion = FALSE; + if (frameId == FRAMEID_QUIZ_QUESTION) + isQuizQuestion = TRUE; + + FillWindowPixelBuffer(sScreenControl->windowId, PIXEL_FILL(1)); for (i = 0; i < numRows; i++) { - memcpy(spC, sText_Clear17, sizeof(sText_Clear17)); - if (var1) - spC[2] = 6; + memcpy(strClear, sText_Clear17, sizeof(sText_Clear17)); + if (isQuizQuestion) + strClear[2] = 6; - str = sUnknown_0203A11C->unkB; - sUnknown_0203A11C->unkB[0] = EOS; - str = StringAppend(str, spC); + str = sScreenControl->phrasePrintBuffer; + sScreenControl->phrasePrintBuffer[0] = EOS; + str = StringAppend(str, strClear); for (j = 0; j < numColumns; j++) { - if (*ecWord != 0xFFFF) + if (*currentPhrase != EC_EMPTY_WORD) { - str = CopyEasyChatWord(str, *ecWord); - ecWord++; + str = CopyEasyChatWord(str, *currentPhrase); + currentPhrase++; } else { - ecWord++; - if (!var1) + currentPhrase++; + if (!isQuizQuestion) { str = WriteColorChangeControlCode(str, 0, 4); for (k = 0; k < 12; k++) @@ -3857,25 +4082,27 @@ static void sub_811D2C8(void) } } - if (var1) - spC[2] = 3; + if (isQuizQuestion) + strClear[2] = 3; - str = StringAppend(str, spC); - if (frameId == 2 || frameId == 7 || frameId == 8) + str = StringAppend(str, strClear); + + if (frameId == FRAMEID_MAIL || frameId == FRAMEID_QUIZ_QUESTION || frameId == FRAMEID_QUIZ_SET_QUESTION) { + // Is 2x5 frame, end on 9th word if (j == 0 && i == 4) break; } } *str = EOS; - sub_811D028(sUnknown_0203A11C->windowId, 1, sUnknown_0203A11C->unkB, 0, i * 16 + 1, 0xFF, 0); + PrintEasyChatText(sScreenControl->windowId, 1, sScreenControl->phrasePrintBuffer, 0, i * 16 + 1, TEXT_SPEED_FF, 0); } - CopyWindowToVram(sUnknown_0203A11C->windowId, 3); + CopyWindowToVram(sScreenControl->windowId, 3); } -static void sub_811D424(u16 *tilemap) +static void BufferFrameTilemap(u16 *tilemap) { u8 frameId; int right, bottom; @@ -3883,19 +4110,22 @@ static void sub_811D424(u16 *tilemap) frameId = GetEasyChatScreenFrameId(); CpuFastFill(0, tilemap, BG_SCREEN_SIZE); - if (frameId == 2 || frameId == 8) + if (frameId == FRAMEID_MAIL || frameId == FRAMEID_QUIZ_SET_QUESTION) { + // These frames fill the screen, no need to draw top/bottom edges right = sPhraseFrameDimensions[frameId].left + sPhraseFrameDimensions[frameId].width; bottom = sPhraseFrameDimensions[frameId].top + sPhraseFrameDimensions[frameId].height; + + // Draw middle section for (y = sPhraseFrameDimensions[frameId].top; y < bottom; y++) { x = sPhraseFrameDimensions[frameId].left - 1; - tilemap[y * 32 + x] = 0x1005; + tilemap[y * 32 + x] = FRAME_OFFSET_ORANGE + FRAME_TILE_L_EDGE; x++; for (; x < right; x++) - tilemap[y * 32 + x] = 0x1000; + tilemap[y * 32 + x] = FRAME_OFFSET_ORANGE + FRAME_TILE_TRANSPARENT; - tilemap[y* 32 + x] = 0x1007; + tilemap[y* 32 + x] = FRAME_OFFSET_ORANGE + FRAME_TILE_R_EDGE; } } else @@ -3904,35 +4134,40 @@ static void sub_811D424(u16 *tilemap) x = sPhraseFrameDimensions[frameId].left - 1; right = sPhraseFrameDimensions[frameId].left + sPhraseFrameDimensions[frameId].width; bottom = sPhraseFrameDimensions[frameId].top + sPhraseFrameDimensions[frameId].height; - tilemap[y * 32 + x] = 0x1001; + + // Draw top edge + tilemap[y * 32 + x] = FRAME_OFFSET_ORANGE + FRAME_TILE_TOP_L_CORNER; x++; for (; x < right; x++) - tilemap[y * 32 + x] = 0x1002; + tilemap[y * 32 + x] = FRAME_OFFSET_ORANGE + FRAME_TILE_TOP_EDGE; - tilemap[y * 32 + x] = 0x1003; + tilemap[y * 32 + x] = FRAME_OFFSET_ORANGE + FRAME_TILE_TOP_R_CORNER; y++; + + // Draw middle section for (; y < bottom; y++) { x = sPhraseFrameDimensions[frameId].left - 1; - tilemap[y * 32 + x] = 0x1005; + tilemap[y * 32 + x] = FRAME_OFFSET_ORANGE + FRAME_TILE_L_EDGE; x++; for (; x < right; x++) - tilemap[y * 32 + x] = 0x1000; + tilemap[y * 32 + x] = FRAME_OFFSET_ORANGE + FRAME_TILE_TRANSPARENT; - tilemap[y* 32 + x] = 0x1007; + tilemap[y* 32 + x] = FRAME_OFFSET_ORANGE + FRAME_TILE_R_EDGE; } + // Draw bottom edge x = sPhraseFrameDimensions[frameId].left - 1; - tilemap[y * 32 + x] = 0x1009; + tilemap[y * 32 + x] = FRAME_OFFSET_ORANGE + FRAME_TILE_BOTTOM_L_CORNER; x++; for (; x < right; x++) - tilemap[y * 32 + x] = 0x100A; + tilemap[y * 32 + x] = FRAME_OFFSET_ORANGE + FRAME_TILE_BOTTOM_EDGE; - tilemap[y * 32 + x] = 0x100B; + tilemap[y * 32 + x] = FRAME_OFFSET_ORANGE + FRAME_TILE_BOTTOM_R_CORNER; } } -static void sub_811D60C(void) +static void AdjustBgTilemapForFooter(void) { u8 frameId; u16 *tilemap; @@ -3941,55 +4176,55 @@ static void sub_811D60C(void) frameId = GetEasyChatScreenFrameId(); switch (sPhraseFrameDimensions[frameId].footerId) { - case 2: + case FOOTER_ANSWER: tilemap += 0x2A0; CopyToBgTilemapBufferRect(3, tilemap, 0, 11, 32, 2); break; - case 1: + case FOOTER_QUIZ: tilemap += 0x300; CopyToBgTilemapBufferRect(3, tilemap, 0, 11, 32, 2); break; - case 3: + case NUM_FOOTER_TYPES: CopyToBgTilemapBufferRect(3, tilemap, 0, 10, 32, 4); break; } } -static void sub_811D684(void) +static void DrawLowerWindow(void) { PutWindowTilemap(2); CopyBgTilemapBufferToVram(2); } -static void sub_811D698(u32 arg0) +static void InitLowerWindowText(u32 whichText) { - sub_811DD84(); + ResetLowerWindowScroll(); FillWindowPixelBuffer(2, PIXEL_FILL(1)); - switch (arg0) + switch (whichText) { - case 0: - sub_811D6F4(); + case TEXT_GROUPS: + PrintKeyboardGroupNames(); break; - case 1: - PrintEasyChatKeyboardText(); + case TEXT_ALPHABET: + PrintKeyboardAlphabet(); break; - case 2: - sub_811D794(); + case TEXT_WORD_SELECT: + PrintInitialWordSelectText(); break; } CopyWindowToVram(2, 2); } -static void sub_811D6D4(void) +static void PrintKeyboardText(void) { - if (!sub_811BBB0()) - sub_811D698(0); + if (!GetInAlphabetMode()) + InitLowerWindowText(TEXT_GROUPS); else - sub_811D698(1); + InitLowerWindowText(TEXT_ALPHABET); } -static void sub_811D6F4(void) +static void PrintKeyboardGroupNames(void) { int i; int x, y; @@ -4000,97 +4235,99 @@ static void sub_811D6F4(void) { for (x = 0; x < 2; x++) { - u8 groupId = sub_811F3B8(i++); + u8 groupId = GetUnlockedEasyChatGroupId(i++); if (groupId == EC_NUM_GROUPS) { - sub_811DDAC(sub_811BBBC(), 0); + InitLowerWindowScroll(GetKeyboardScrollOffset(), 0); return; } - sub_811D028(2, 1, GetEasyChatWordGroupName(groupId), x * 84 + 10, y, 0xFF, NULL); + PrintEasyChatText(2, 1, GetEasyChatWordGroupName(groupId), x * 84 + 10, y, TEXT_SPEED_FF, NULL); } y += 16; } } -static void PrintEasyChatKeyboardText(void) +static void PrintKeyboardAlphabet(void) { u32 i; - for (i = 0; i < ARRAY_COUNT(sEasyChatKeyboardText); i++) - sub_811D028(2, 1, sEasyChatKeyboardText[i], 10, 97 + i * 16, 0xFF, NULL); + for (i = 0; i < ARRAY_COUNT(sEasyChatKeyboardAlphabet); i++) + PrintEasyChatText(2, 1, sEasyChatKeyboardAlphabet[i], 10, 97 + i * 16, TEXT_SPEED_FF, NULL); } -static void sub_811D794(void) +static void PrintInitialWordSelectText(void) { - sub_811D864(0, 4); + PrintWordSelectText(0, NUM_WORD_SELECT_ROWS); } -static void sub_811D7A4(void) +static void PrintWordSelectNextRowDown(void) { - u8 var0 = sub_811BBDC() + 3; - sub_811D950(var0, 1); - sub_811D864(var0, 1); + u8 wordScroll = GetWordSelectScrollOffset() + NUM_WORD_SELECT_ROWS - 1; + EraseWordSelectRows(wordScroll, 1); + PrintWordSelectText(wordScroll, 1); } -static void sub_811D7C8(void) +static void PrintWordSelectNextRowUp(void) { - u8 var0 = sub_811BBDC(); - sub_811D950(var0, 1); - sub_811D864(var0, 1); + u8 wordScroll = GetWordSelectScrollOffset(); + EraseWordSelectRows(wordScroll, 1); + PrintWordSelectText(wordScroll, 1); } -static void sub_811D7EC(void) +static void PrintWordSelectRowsPageDown(void) { - u8 var0 = sub_811BBDC(); - u8 var1 = var0 + 4; - u8 var2 = sub_811BBE8() + 1; - if (var1 > var2) - var1 = var2; + u8 wordScroll = GetWordSelectScrollOffset(); + u8 maxScroll = wordScroll + NUM_WORD_SELECT_ROWS; + u8 maxRows = GetWordSelectLastRow() + 1; + if (maxScroll > maxRows) + maxScroll = maxRows; - if (var0 < var1) + if (wordScroll < maxScroll) { - u8 var3 = var1 - var0; - sub_811D950(var0, var3); - sub_811D864(var0, var3); + u8 numRows = maxScroll - wordScroll; + EraseWordSelectRows(wordScroll, numRows); + PrintWordSelectText(wordScroll, numRows); } } -static void sub_811D830(void) +static void PrintWordSelectRowsPageUp(void) { - u8 var0 = sub_811BBDC(); - u8 var1 = sub_811DE48(); - if (var0 < var1) + u8 wordScroll = GetWordSelectScrollOffset(); + u8 windowScroll = GetLowerWindowScrollOffset(); + if (wordScroll < windowScroll) { - u8 var2 = var1 - var0; - sub_811D950(var0, var2); - sub_811D864(var0, var2); + u8 numRows = windowScroll - wordScroll; + EraseWordSelectRows(wordScroll, numRows); + PrintWordSelectText(wordScroll, numRows); } } -static void sub_811D864(u8 arg0, u8 arg1) +// Print the easy chat words available for selection in +// the currently selected group and at the given offset and row +static void PrintWordSelectText(u8 scrollOffset, u8 numRows) { int i, j; u16 easyChatWord; int y; - int var0; + int wordIndex; - var0 = arg0 * 2; - y = (arg0 * 16 + 96) & 0xFF; + wordIndex = scrollOffset * NUM_WORD_SELECT_COLUMNS; + y = (scrollOffset * 16 + 96) & 0xFF; y++; - for (i = 0; i < arg1; i++) + for (i = 0; i < numRows; i++) { for (j = 0; j < 2; j++) { - easyChatWord = sub_811F578(var0++); - if (easyChatWord != 0xFFFF) + easyChatWord = GetWordFromSelectedGroup(wordIndex++); + if (easyChatWord != EC_EMPTY_WORD) { - CopyEasyChatWordPadded(sUnknown_0203A11C->unkCC, easyChatWord, 0); - if (!sub_811BF88(easyChatWord)) - sub_811D028(2, 1, sUnknown_0203A11C->unkCC, (j * 13 + 3) * 8, y, 0xFF, NULL); - else - sub_811D058(2, 1, sUnknown_0203A11C->unkCC, (j * 13 + 3) * 8, y, 0xFF, TEXT_COLOR_WHITE, TEXT_COLOR_LIGHT_RED, TEXT_COLOR_LIGHT_GREY); + CopyEasyChatWordPadded(sScreenControl->wordSelectPrintBuffer, easyChatWord, 0); + if (!DummyWordCheck(easyChatWord)) + PrintEasyChatText(2, 1, sScreenControl->wordSelectPrintBuffer, (j * 13 + 3) * 8, y, TEXT_SPEED_FF, NULL); + else // Never reached + PrintEasyChatTextWithColors(2, 1, sScreenControl->wordSelectPrintBuffer, (j * 13 + 3) * 8, y, TEXT_SPEED_FF, TEXT_COLOR_WHITE, TEXT_COLOR_LIGHT_RED, TEXT_COLOR_LIGHT_GREY); } } @@ -4100,16 +4337,17 @@ static void sub_811D864(u8 arg0, u8 arg1) CopyWindowToVram(2, 2); } -static void sub_811D950(u8 arg0, u8 arg1) +static void EraseWordSelectRows(u8 scrollOffset, u8 numRows) { int y; int var0; int var1; int var2; - y = (arg0 * 16 + 96) & 0xFF; - var2 = arg1 * 16; + y = (scrollOffset * 16 + 96) & 0xFF; + var2 = numRows * 16; var0 = y + var2; + if (var0 > 255) { var1 = var0 - 256; @@ -4125,191 +4363,209 @@ static void sub_811D950(u8 arg0, u8 arg1) FillWindowPixelRect(2, PIXEL_FILL(1), 0, 0, 224, var1); } -static void sub_811D9B4(void) +static void ClearWordSelectWindow(void) { FillWindowPixelBuffer(2, PIXEL_FILL(1)); CopyWindowToVram(2, 2); } -static void sub_811D9CC(int arg0) +static void InitLowerWindowAnim(int winAnimType) { - switch (arg0) + switch (winAnimType) { - case 0: - sUnknown_0203A11C->unk6 = 0; - sUnknown_0203A11C->unk7 = 10; + case WINANIM_OPEN_KEYBOARD: + sScreenControl->curWindowAnimState = 0; + sScreenControl->destWindowAnimState = 10; break; - case 1: - sUnknown_0203A11C->unk6 = 9; - sUnknown_0203A11C->unk7 = 0; + case WINANIM_CLOSE_KEYBOARD: + sScreenControl->curWindowAnimState = 9; + sScreenControl->destWindowAnimState = 0; break; - case 2: - sUnknown_0203A11C->unk6 = 11; - sUnknown_0203A11C->unk7 = 17; + case WINANIM_OPEN_WORD_SELECT: + sScreenControl->curWindowAnimState = 11; + sScreenControl->destWindowAnimState = 17; break; - case 3: - sUnknown_0203A11C->unk6 = 17; - sUnknown_0203A11C->unk7 = 0; + case WINANIM_CLOSE_WORD_SELECT: + sScreenControl->curWindowAnimState = 17; + sScreenControl->destWindowAnimState = 0; break; - case 4: - sUnknown_0203A11C->unk6 = 17; - sUnknown_0203A11C->unk7 = 10; + case WINANIM_RETURN_TO_KEYBOARD: + sScreenControl->curWindowAnimState = 17; + sScreenControl->destWindowAnimState = 10; break; - case 5: - sUnknown_0203A11C->unk6 = 18; - sUnknown_0203A11C->unk7 = 22; + case WINANIM_KEYBOARD_SWITCH_OUT: + sScreenControl->curWindowAnimState = 18; + sScreenControl->destWindowAnimState = 22; break; - case 6: - sUnknown_0203A11C->unk6 = 22; - sUnknown_0203A11C->unk7 = 18; + case WINANIM_KEYBOARD_SWITCH_IN: + sScreenControl->curWindowAnimState = 22; + sScreenControl->destWindowAnimState = 18; break; } - sUnknown_0203A11C->unk8 = sUnknown_0203A11C->unk6 < sUnknown_0203A11C->unk7 ? 1 : -1; + sScreenControl->windowAnimStateDir = sScreenControl->curWindowAnimState < sScreenControl->destWindowAnimState ? 1 : -1; } -static bool8 sub_811DAA4(void) +// Returns FALSE if the anim is finished +static bool8 UpdateLowerWindowAnim(void) { - u8 var0, var1; - if (sUnknown_0203A11C->unk6 == sUnknown_0203A11C->unk7) + u8 curState, destState; + if (sScreenControl->curWindowAnimState == sScreenControl->destWindowAnimState) return FALSE; - sUnknown_0203A11C->unk6 += sUnknown_0203A11C->unk8; - sub_811DADC(sUnknown_0203A11C->unk6); - var0 = sUnknown_0203A11C->unk6; - var1 = sUnknown_0203A11C->unk7; - return (var0 ^ var1) > 0; + sScreenControl->curWindowAnimState += sScreenControl->windowAnimStateDir; + DrawLowerWindowFrame(sScreenControl->curWindowAnimState); + curState = sScreenControl->curWindowAnimState; + destState = sScreenControl->destWindowAnimState; + return (curState ^ destState) > 0; } -static void sub_811DADC(u8 arg0) +// States in this function are used incrementally with differing start/end cases +// to draw the lower window and create the appearance that it's opening/closing/animating. +// See InitLowerWindowAnim +static void DrawLowerWindowFrame(u8 type) { FillBgTilemapBufferRect_Palette0(1, 0, 0, 10, 30, 10); - switch (arg0) + switch (type) { - case 0: + case 0: // Closed break; case 1: - sub_811DC28(11, 14, 3, 2); + BufferLowerWindowFrame(11, 14, 3, 2); break; case 2: - sub_811DC28(9, 14, 7, 2); + BufferLowerWindowFrame(9, 14, 7, 2); break; case 3: - sub_811DC28(7, 14, 11, 2); + BufferLowerWindowFrame(7, 14, 11, 2); break; case 4: - sub_811DC28(5, 14, 15, 2); + BufferLowerWindowFrame(5, 14, 15, 2); break; case 5: - sub_811DC28(3, 14, 19, 2); + BufferLowerWindowFrame(3, 14, 19, 2); break; case 6: - sub_811DC28(1, 14, 23, 2); - break; - case 11: - sub_811DC28(1, 10, 24, 10); - break; - case 12: - sub_811DC28(1, 10, 25, 10); - break; - case 13: - sub_811DC28(1, 10, 26, 10); - break; - case 14: - sub_811DC28(1, 10, 27, 10); - break; - case 15: - sub_811DC28(1, 10, 28, 10); - break; - case 16: - sub_811DC28(1, 10, 29, 10); - break; - case 17: - sub_811DC28(0, 10, 30, 10); - break; - case 10: - case 18: - sub_811DC28(1, 10, 23, 10); - break; - case 9: - case 19: - sub_811DC28(1, 11, 23, 8); - break; - case 8: - case 20: - sub_811DC28(1, 12, 23, 6); + BufferLowerWindowFrame(1, 14, 23, 2); break; case 7: + BufferLowerWindowFrame(1, 13, 23, 4); + break; + case 8: + BufferLowerWindowFrame(1, 12, 23, 6); + break; + case 9: + BufferLowerWindowFrame(1, 11, 23, 8); + break; + case 10: + BufferLowerWindowFrame(1, 10, 23, 10); + break; + case 11: + BufferLowerWindowFrame(1, 10, 24, 10); + break; + case 12: + BufferLowerWindowFrame(1, 10, 25, 10); + break; + case 13: + BufferLowerWindowFrame(1, 10, 26, 10); + break; + case 14: + BufferLowerWindowFrame(1, 10, 27, 10); + break; + case 15: + BufferLowerWindowFrame(1, 10, 28, 10); + break; + case 16: + BufferLowerWindowFrame(1, 10, 29, 10); + break; + case 17: + BufferLowerWindowFrame(0, 10, 30, 10); + break; + case 18: + BufferLowerWindowFrame(1, 10, 23, 10); + break; + case 19: + BufferLowerWindowFrame(1, 11, 23, 8); + break; + case 20: + BufferLowerWindowFrame(1, 12, 23, 6); + break; case 21: - sub_811DC28(1, 13, 23, 4); + BufferLowerWindowFrame(1, 13, 23, 4); break; case 22: - sub_811DC28(1, 14, 23, 2); + BufferLowerWindowFrame(1, 14, 23, 2); break; } CopyBgTilemapBufferToVram(1); } -static void sub_811DC28(int left, int top, int width, int height) +static void BufferLowerWindowFrame(int left, int top, int width, int height) { u16 *tilemap; int right; int bottom; int x, y; - tilemap = sUnknown_0203A11C->unk300; + tilemap = sScreenControl->bg1TilemapBuffer; right = left + width - 1; bottom = top + height - 1; x = left; y = top; - tilemap[y * 32 + x] = 0x4001; + + // Draw top edge + tilemap[y * 32 + x] = FRAME_OFFSET_GREEN + FRAME_TILE_TOP_L_CORNER; x++; for (; x < right; x++) - tilemap[y * 32 + x] = 0x4002; + tilemap[y * 32 + x] = FRAME_OFFSET_GREEN + FRAME_TILE_TOP_EDGE; - tilemap[y * 32 + x] = 0x4003; + tilemap[y * 32 + x] = FRAME_OFFSET_GREEN + FRAME_TILE_TOP_R_CORNER; y++; + + // Draw middle section for (; y < bottom; y++) { - tilemap[y * 32 + left] = 0x4005; + tilemap[y * 32 + left] = FRAME_OFFSET_GREEN + FRAME_TILE_L_EDGE; x = left + 1; for (; x < right; x++) - tilemap[y * 32 + x] = 0x4000; + tilemap[y * 32 + x] = FRAME_OFFSET_GREEN + FRAME_TILE_TRANSPARENT; - tilemap[y * 32 + x] = 0x4007; + tilemap[y * 32 + x] = FRAME_OFFSET_GREEN + FRAME_TILE_R_EDGE; } - tilemap[y * 32 + left] = 0x4009; + // Draw bottom edge + tilemap[y * 32 + left] = FRAME_OFFSET_GREEN + FRAME_TILE_BOTTOM_L_CORNER; x = left + 1; for (; x < right; x++) - tilemap[y * 32 + x] = 0x400A; + tilemap[y * 32 + x] = FRAME_OFFSET_GREEN + FRAME_TILE_BOTTOM_EDGE; - tilemap[y * 32 + x] = 0x400B; - sub_811DE5C((left + 1) * 8, (top + 1) * 8, (width - 2) * 8, (height - 2) * 8); + tilemap[y * 32 + x] = FRAME_OFFSET_GREEN + FRAME_TILE_BOTTOM_R_CORNER; + + SetWindowDimensions((left + 1) * 8, (top + 1) * 8, (width - 2) * 8, (height - 2) * 8); } -static void sub_811DD84(void) +static void ResetLowerWindowScroll(void) { ChangeBgY(2, 0x800, 0); - sUnknown_0203A11C->unk2CE = 0; + sScreenControl->scrollOffset = 0; } -static void sub_811DDAC(s16 arg0, u8 arg1) +static void InitLowerWindowScroll(s16 scrollChange, u8 speed) { int bgY; - s16 var0; + s16 yChange; bgY = GetBgY(2); - sUnknown_0203A11C->unk2CE += arg0; - var0 = arg0 * 16; - bgY += var0 << 8; - if (arg1) + sScreenControl->scrollOffset += scrollChange; + yChange = scrollChange * 16; + bgY += yChange * 256; + if (speed) { - sUnknown_0203A11C->unk2D0 = bgY; - sUnknown_0203A11C->unk2D4 = arg1 * 256; - if (var0 < 0) - sUnknown_0203A11C->unk2D4 = -sUnknown_0203A11C->unk2D4; + sScreenControl->scrollDest = bgY; + sScreenControl->scrollSpeed = speed * 256; + if (yChange < 0) + sScreenControl->scrollSpeed = -sScreenControl->scrollSpeed; } else { @@ -4317,28 +4573,28 @@ static void sub_811DDAC(s16 arg0, u8 arg1) } } -static bool8 sub_811DE10(void) +static bool8 UpdateLowerWindowScroll(void) { int bgY; bgY = GetBgY(2); - if (bgY == sUnknown_0203A11C->unk2D0) + if (bgY == sScreenControl->scrollDest) { return FALSE; } else { - ChangeBgY(2, sUnknown_0203A11C->unk2D4, 1); + ChangeBgY(2, sScreenControl->scrollSpeed, 1); return TRUE; } } -static int sub_811DE48(void) +static int GetLowerWindowScrollOffset(void) { - return sUnknown_0203A11C->unk2CE; + return sScreenControl->scrollOffset; } -static void sub_811DE5C(u8 left, u8 top, u8 width, u8 height) +static void SetWindowDimensions(u8 left, u8 top, u8 width, u8 height) { u16 horizontalDimensions = WIN_RANGE(left, left + width); u16 verticalDimensions = WIN_RANGE(top, top + height); @@ -4346,244 +4602,258 @@ static void sub_811DE5C(u8 left, u8 top, u8 width, u8 height) SetGpuReg(REG_OFFSET_WIN0V, verticalDimensions); } -static void sub_811DE90(void) +static void LoadEasyChatGfx(void) { u32 i; - LoadSpriteSheets(sEasyChatSpriteSheets); - LoadSpritePalettes(sEasyChatSpritePalettes); - for (i = 0; i < ARRAY_COUNT(sUnknown_08597CE8); i++) - LoadCompressedSpriteSheet(&sUnknown_08597CE8[i]); + LoadSpriteSheets(sSpriteSheets); + LoadSpritePalettes(sSpritePalettes); + for (i = 0; i < ARRAY_COUNT(sCompressedSpriteSheets); i++) + LoadCompressedSpriteSheet(&sCompressedSpriteSheets[i]); } -static void sub_811DEC4(void) +#define sDelayTimer data[0] +#define sAnimateCursor data[1] + +static void CreateMainCursorSprite(void) { u8 frameId = GetEasyChatScreenFrameId(); int x = sPhraseFrameDimensions[frameId].left * 8 + 13; int y = sPhraseFrameDimensions[frameId].top * 8 + 8; - u8 spriteId = CreateSprite(&sUnknown_08597D18, x, y, 2); - sUnknown_0203A11C->unk2D8 = &gSprites[spriteId]; - gSprites[spriteId].data[1] = 1; + u8 spriteId = CreateSprite(&sSpriteTemplate_TriangleCursor, x, y, 2); + sScreenControl->mainCursorSprite = &gSprites[spriteId]; + gSprites[spriteId].sAnimateCursor = TRUE; } -static void sub_811DF28(struct Sprite *sprite) +static void SpriteCB_Cursor(struct Sprite *sprite) { - if (sprite->data[1]) + if (sprite->sAnimateCursor) { - if (++sprite->data[0] > 2) + if (++sprite->sDelayTimer > 2) { - sprite->data[0] = 0; + sprite->sDelayTimer = 0; if (++sprite->pos2.x > 0) sprite->pos2.x = -6; } } } -static void sub_811DF60(u8 x, u8 y) +static void SetMainCursorPos(u8 x, u8 y) { - sUnknown_0203A11C->unk2D8->pos1.x = x; - sUnknown_0203A11C->unk2D8->pos1.y = y; - sUnknown_0203A11C->unk2D8->pos2.x = 0; - sUnknown_0203A11C->unk2D8->data[0] = 0; + sScreenControl->mainCursorSprite->pos1.x = x; + sScreenControl->mainCursorSprite->pos1.y = y; + sScreenControl->mainCursorSprite->pos2.x = 0; + sScreenControl->mainCursorSprite->sDelayTimer = 0; } -static void sub_811DF90(void) +static void StopMainCursorAnim(void) { - sUnknown_0203A11C->unk2D8->data[0] = 0; - sUnknown_0203A11C->unk2D8->data[1] = 0; - sUnknown_0203A11C->unk2D8->pos2.x = 0; + sScreenControl->mainCursorSprite->sDelayTimer = 0; + sScreenControl->mainCursorSprite->sAnimateCursor = FALSE; + sScreenControl->mainCursorSprite->pos2.x = 0; } -static void sub_811DFB0(void) +static void StartMainCursorAnim(void) { - sUnknown_0203A11C->unk2D8->data[1] = 1; + sScreenControl->mainCursorSprite->sAnimateCursor = TRUE; } -static void sub_811DFC8(void) +static void CreateRectangleCursorSprites(void) { - u8 spriteId = CreateSprite(&sUnknown_08597D68, 0, 0, 3); - sUnknown_0203A11C->unk2DC = &gSprites[spriteId]; - sUnknown_0203A11C->unk2DC->pos2.x = 32; + u8 spriteId = CreateSprite(&sSpriteTemplate_RectangleCursor, 0, 0, 3); + sScreenControl->rectangleCursorSpriteRight = &gSprites[spriteId]; + sScreenControl->rectangleCursorSpriteRight->pos2.x = 32; - spriteId = CreateSprite(&sUnknown_08597D68, 0, 0, 3); - sUnknown_0203A11C->unk2E0 = &gSprites[spriteId]; - sUnknown_0203A11C->unk2E0->pos2.x = -32; + spriteId = CreateSprite(&sSpriteTemplate_RectangleCursor, 0, 0, 3); + sScreenControl->rectangleCursorSpriteLeft = &gSprites[spriteId]; + sScreenControl->rectangleCursorSpriteLeft->pos2.x = -32; - sUnknown_0203A11C->unk2DC->hFlip = 1; - sub_811E088(); + sScreenControl->rectangleCursorSpriteRight->hFlip = TRUE; + UpdateRectangleCursorPos(); } -static void sub_811E050(void) +static void DestroyRectangleCursorSprites(void) { - DestroySprite(sUnknown_0203A11C->unk2DC); - sUnknown_0203A11C->unk2DC = NULL; - DestroySprite(sUnknown_0203A11C->unk2E0); - sUnknown_0203A11C->unk2E0 = NULL; + DestroySprite(sScreenControl->rectangleCursorSpriteRight); + sScreenControl->rectangleCursorSpriteRight = NULL; + DestroySprite(sScreenControl->rectangleCursorSpriteLeft); + sScreenControl->rectangleCursorSpriteLeft = NULL; } -static void sub_811E088(void) +static void UpdateRectangleCursorPos(void) { - u8 var0; - u8 var1; + s8 column; + s8 row; - if (sUnknown_0203A11C->unk2DC && sUnknown_0203A11C->unk2E0) + if (sScreenControl->rectangleCursorSpriteRight + && sScreenControl->rectangleCursorSpriteLeft) { - sub_811BB9C(&var0, &var1); - if (!sub_811BBB0()) - sub_811E0EC(var0, var1); + GetKeyboardCursorColAndRow(&column, &row); + if (!GetInAlphabetMode()) + SetRectangleCursorPos_GroupMode(column, row); else - sub_811E1A4(var0, var1); + SetRectangleCursorPos_AlphabetMode(column, row); } } -static void sub_811E0EC(s8 arg0, s8 arg1) +static void SetRectangleCursorPos_GroupMode(s8 column, s8 row) { - if (arg0 != -1) + if (column != -1) { - StartSpriteAnim(sUnknown_0203A11C->unk2DC, 0); - sUnknown_0203A11C->unk2DC->pos1.x = arg0 * 84 + 58; - sUnknown_0203A11C->unk2DC->pos1.y = arg1 * 16 + 96; + // In group name window + StartSpriteAnim(sScreenControl->rectangleCursorSpriteRight, RECTCURSOR_ANIM_ON_GROUP); + sScreenControl->rectangleCursorSpriteRight->pos1.x = column * 84 + 58; + sScreenControl->rectangleCursorSpriteRight->pos1.y = row * 16 + 96; - StartSpriteAnim(sUnknown_0203A11C->unk2E0, 0); - sUnknown_0203A11C->unk2E0->pos1.x = arg0 * 84 + 58; - sUnknown_0203A11C->unk2E0->pos1.y = arg1 * 16 + 96; + StartSpriteAnim(sScreenControl->rectangleCursorSpriteLeft, RECTCURSOR_ANIM_ON_GROUP); + sScreenControl->rectangleCursorSpriteLeft->pos1.x = column * 84 + 58; + sScreenControl->rectangleCursorSpriteLeft->pos1.y = row * 16 + 96; } else { - StartSpriteAnim(sUnknown_0203A11C->unk2DC, 1); - sUnknown_0203A11C->unk2DC->pos1.x = 216; - sUnknown_0203A11C->unk2DC->pos1.y = arg1 * 16 + 112; + // In button window + StartSpriteAnim(sScreenControl->rectangleCursorSpriteRight, RECTCURSOR_ANIM_ON_BUTTON); + sScreenControl->rectangleCursorSpriteRight->pos1.x = 216; + sScreenControl->rectangleCursorSpriteRight->pos1.y = row * 16 + 112; - StartSpriteAnim(sUnknown_0203A11C->unk2E0, 1); - sUnknown_0203A11C->unk2E0->pos1.x = 216; - sUnknown_0203A11C->unk2E0->pos1.y = arg1 * 16 + 112; + StartSpriteAnim(sScreenControl->rectangleCursorSpriteLeft, RECTCURSOR_ANIM_ON_BUTTON); + sScreenControl->rectangleCursorSpriteLeft->pos1.x = 216; + sScreenControl->rectangleCursorSpriteLeft->pos1.y = row * 16 + 112; } } -static void sub_811E1A4(s8 arg0, s8 arg1) +static void SetRectangleCursorPos_AlphabetMode(s8 column, s8 row) { int anim; int x, y; - if (arg0 != -1) + if (column != -1) { - y = arg1 * 16 + 96; + y = row * 16 + 96; x = 32; - if (arg0 == 6 && arg1 == 0) + if (column == NUM_ALPHABET_COLUMNS - 1 && row == 0) { + // Cursor is on 'Others' x = 158; - anim = 2; + anim = RECTCURSOR_ANIM_ON_OTHERS; } else { - x += sUnknown_08597D08[arg0 < ARRAY_COUNT(sUnknown_08597D08) ? arg0 : 0]; - anim = 3; + // Cursor is on a letter + x += sAlphabetKeyboardColumnOffsets[(u8)column < NUM_ALPHABET_COLUMNS ? column : 0]; + anim = RECTCURSOR_ANIM_ON_LETTER; } - StartSpriteAnim(sUnknown_0203A11C->unk2DC, anim); - sUnknown_0203A11C->unk2DC->pos1.x = x; - sUnknown_0203A11C->unk2DC->pos1.y = y; + StartSpriteAnim(sScreenControl->rectangleCursorSpriteRight, anim); + sScreenControl->rectangleCursorSpriteRight->pos1.x = x; + sScreenControl->rectangleCursorSpriteRight->pos1.y = y; - StartSpriteAnim(sUnknown_0203A11C->unk2E0, anim); - sUnknown_0203A11C->unk2E0->pos1.x = x; - sUnknown_0203A11C->unk2E0->pos1.y = y; + StartSpriteAnim(sScreenControl->rectangleCursorSpriteLeft, anim); + sScreenControl->rectangleCursorSpriteLeft->pos1.x = x; + sScreenControl->rectangleCursorSpriteLeft->pos1.y = y; } else { - StartSpriteAnim(sUnknown_0203A11C->unk2DC, 1); - sUnknown_0203A11C->unk2DC->pos1.x = 216; - sUnknown_0203A11C->unk2DC->pos1.y = arg1 * 16 + 112; + // In button window + StartSpriteAnim(sScreenControl->rectangleCursorSpriteRight, RECTCURSOR_ANIM_ON_BUTTON); + sScreenControl->rectangleCursorSpriteRight->pos1.x = 216; + sScreenControl->rectangleCursorSpriteRight->pos1.y = row * 16 + 112; - StartSpriteAnim(sUnknown_0203A11C->unk2E0, 1); - sUnknown_0203A11C->unk2E0->pos1.x = 216; - sUnknown_0203A11C->unk2E0->pos1.y = arg1 * 16 + 112; + StartSpriteAnim(sScreenControl->rectangleCursorSpriteLeft, RECTCURSOR_ANIM_ON_BUTTON); + sScreenControl->rectangleCursorSpriteLeft->pos1.x = 216; + sScreenControl->rectangleCursorSpriteLeft->pos1.y = row * 16 + 112; } } -static void sub_811E288(void) +// Cursor for selecting a new word +// Identical in appearance to the 'main' cursor +static void CreateWordSelectCursorSprite(void) { - u8 spriteId = CreateSprite(&sUnknown_08597D18, 0, 0, 4); - sUnknown_0203A11C->unk2E4 = &gSprites[spriteId]; - sUnknown_0203A11C->unk2E4->callback = sub_811E2DC; - sUnknown_0203A11C->unk2E4->oam.priority = 2; - sub_811E30C(); + u8 spriteId = CreateSprite(&sSpriteTemplate_TriangleCursor, 0, 0, 4); + sScreenControl->wordSelectCursorSprite = &gSprites[spriteId]; + sScreenControl->wordSelectCursorSprite->callback = SpriteCB_WordSelectCursor; + sScreenControl->wordSelectCursorSprite->oam.priority = 2; + UpdateWordSelectCursorPos(); } -static void sub_811E2DC(struct Sprite *sprite) +static void SpriteCB_WordSelectCursor(struct Sprite *sprite) { - if (++sprite->data[0] > 2) + if (++sprite->sDelayTimer > 2) { - sprite->data[0] = 0; + sprite->sDelayTimer = 0; if (++sprite->pos2.x > 0) sprite->pos2.x = -6; } } -static void sub_811E30C(void) +static void UpdateWordSelectCursorPos(void) { - s8 var0, var1, x, y; + s8 column, row, x, y; - sub_811BBC8(&var0, &var1); - x = var0 * 13; + GetWordSelectColAndRow(&column, &row); + x = column * 13; x = x * 8 + 28; - y = var1 * 16 + 96; - sub_811E34C(x, y); + y = row * 16 + 96; + SetWordSelectCursorPos(x, y); } -static void sub_811E34C(u8 x, u8 y) +static void SetWordSelectCursorPos(u8 x, u8 y) { - if (sUnknown_0203A11C->unk2E4) + if (sScreenControl->wordSelectCursorSprite) { - sUnknown_0203A11C->unk2E4->pos1.x = x; - sUnknown_0203A11C->unk2E4->pos1.y = y; - sUnknown_0203A11C->unk2E4->pos2.x = 0; - sUnknown_0203A11C->unk2E4->data[0] = 0; + sScreenControl->wordSelectCursorSprite->pos1.x = x; + sScreenControl->wordSelectCursorSprite->pos1.y = y; + sScreenControl->wordSelectCursorSprite->pos2.x = 0; + sScreenControl->wordSelectCursorSprite->sDelayTimer = 0; } } -static void sub_811E380(void) +static void DestroyWordSelectCursorSprite(void) { - if (sUnknown_0203A11C->unk2E4) + if (sScreenControl->wordSelectCursorSprite) { - DestroySprite(sUnknown_0203A11C->unk2E4); - sUnknown_0203A11C->unk2E4 = NULL; + DestroySprite(sScreenControl->wordSelectCursorSprite); + sScreenControl->wordSelectCursorSprite = NULL; } } -static void sub_811E3AC(void) +static void CreateSideWindowSprites(void) { - u8 spriteId = CreateSprite(&sUnknown_08597DF0, 208, 128, 6); - sUnknown_0203A11C->unk2E8 = &gSprites[spriteId]; - sUnknown_0203A11C->unk2E8->pos2.x = -64; + u8 spriteId = CreateSprite(&sSpriteTemplate_ButtonWindow, 208, 128, 6); + sScreenControl->buttonWindowSprite = &gSprites[spriteId]; + sScreenControl->buttonWindowSprite->pos2.x = -64; - spriteId = CreateSprite(&sUnknown_08597DD0, 208, 80, 5); - sUnknown_0203A11C->unk2EC = &gSprites[spriteId]; - sUnknown_0203A11C->unk9 = 0; + spriteId = CreateSprite(&sSpriteTemplate_ModeWindow, 208, 80, 5); + sScreenControl->modeWindowSprite = &gSprites[spriteId]; + sScreenControl->modeWindowState = 0; } -static bool8 sub_811E418(void) +static bool8 ShowSideWindow(void) { - switch (sUnknown_0203A11C->unk9) + switch (sScreenControl->modeWindowState) { default: return FALSE; case 0: - sUnknown_0203A11C->unk2E8->pos2.x += 8; - if (sUnknown_0203A11C->unk2E8->pos2.x >= 0) + // Slide button window on + sScreenControl->buttonWindowSprite->pos2.x += 8; + if (sScreenControl->buttonWindowSprite->pos2.x >= 0) { - sUnknown_0203A11C->unk2E8->pos2.x = 0; - if (!sub_811BBB0()) - StartSpriteAnim(sUnknown_0203A11C->unk2EC, 1); + sScreenControl->buttonWindowSprite->pos2.x = 0; + + // Set mode window anim + if (!GetInAlphabetMode()) + StartSpriteAnim(sScreenControl->modeWindowSprite, MODEWINDOW_ANIM_TO_GROUP); else - StartSpriteAnim(sUnknown_0203A11C->unk2EC, 2); + StartSpriteAnim(sScreenControl->modeWindowSprite, MODEWINDOW_ANIM_TO_ALPHABET); - sUnknown_0203A11C->unk9++; + sScreenControl->modeWindowState++; } break; case 1: - if (sUnknown_0203A11C->unk2EC->animEnded) + if (sScreenControl->modeWindowSprite->animEnded) { - sUnknown_0203A11C->unk9 = 2; + sScreenControl->modeWindowState = 2; return FALSE; } } @@ -4591,31 +4861,31 @@ static bool8 sub_811E418(void) return TRUE; } -static void sub_811E4AC(void) +static void HideModeWindow(void) { - sUnknown_0203A11C->unk9 = 0; - StartSpriteAnim(sUnknown_0203A11C->unk2EC, 3); + sScreenControl->modeWindowState = 0; + StartSpriteAnim(sScreenControl->modeWindowSprite, MODEWINDOW_ANIM_TO_HIDDEN); } -static bool8 sub_811E4D0(void) +static bool8 DestroySideWindowSprites(void) { - switch (sUnknown_0203A11C->unk9) + switch (sScreenControl->modeWindowState) { default: return FALSE; case 0: - if (sUnknown_0203A11C->unk2EC->animEnded) - sUnknown_0203A11C->unk9 = 1; + if (sScreenControl->modeWindowSprite->animEnded) + sScreenControl->modeWindowState = 1; break; case 1: - sUnknown_0203A11C->unk2E8->pos2.x -= 8; - if (sUnknown_0203A11C->unk2E8->pos2.x <= -64) + sScreenControl->buttonWindowSprite->pos2.x -= 8; + if (sScreenControl->buttonWindowSprite->pos2.x <= -64) { - DestroySprite(sUnknown_0203A11C->unk2EC); - DestroySprite(sUnknown_0203A11C->unk2E8); - sUnknown_0203A11C->unk2EC = NULL; - sUnknown_0203A11C->unk2E8 = NULL; - sUnknown_0203A11C->unk9++; + DestroySprite(sScreenControl->modeWindowSprite); + DestroySprite(sScreenControl->buttonWindowSprite); + sScreenControl->modeWindowSprite = NULL; + sScreenControl->buttonWindowSprite = NULL; + sScreenControl->modeWindowState++; return FALSE; } } @@ -4623,95 +4893,98 @@ static bool8 sub_811E4D0(void) return TRUE; } -static void sub_811E55C(void) +static void SetModeWindowToTransition(void) { - StartSpriteAnim(sUnknown_0203A11C->unk2EC, 4); + StartSpriteAnim(sScreenControl->modeWindowSprite, MODEWINDOW_ANIM_TRANSITION); } -static void sub_811E578(void) +static void UpdateModeWindowAnim(void) { - if (!sub_811BBB0()) - StartSpriteAnim(sUnknown_0203A11C->unk2EC, 1); + if (!GetInAlphabetMode()) + StartSpriteAnim(sScreenControl->modeWindowSprite, MODEWINDOW_ANIM_TO_GROUP); else - StartSpriteAnim(sUnknown_0203A11C->unk2EC, 2); + StartSpriteAnim(sScreenControl->modeWindowSprite, MODEWINDOW_ANIM_TO_ALPHABET); } -static bool8 sub_811E5B8(void) +static bool8 IsModeWindowAnimActive(void) { - return !sUnknown_0203A11C->unk2EC->animEnded; + return !sScreenControl->modeWindowSprite->animEnded; } -static void sub_811E5D4(void) +static void CreateScrollIndicatorSprites(void) { - u8 spriteId = CreateSprite(&sUnknown_08597E48, 96, 80, 0); + u8 spriteId = CreateSprite(&sSpriteTemplate_ScrollIndicator, 96, 80, 0); if (spriteId != MAX_SPRITES) - sUnknown_0203A11C->unk2F0 = &gSprites[spriteId]; + sScreenControl->scrollIndicatorUpSprite = &gSprites[spriteId]; - spriteId = CreateSprite(&sUnknown_08597E48, 96, 156, 0); + spriteId = CreateSprite(&sSpriteTemplate_ScrollIndicator, 96, 156, 0); if (spriteId != MAX_SPRITES) { - sUnknown_0203A11C->unk2F4 = &gSprites[spriteId]; - sUnknown_0203A11C->unk2F4->vFlip = 1; + sScreenControl->scrollIndicatorDownSprite = &gSprites[spriteId]; + sScreenControl->scrollIndicatorDownSprite->vFlip = TRUE; } - sub_811E6B0(); + HideScrollIndicators(); } -static void sub_811E64C(void) +static void UpdateScrollIndicatorsVisibility(void) { - sUnknown_0203A11C->unk2F0->invisible = !sub_811BBF8(); - sUnknown_0203A11C->unk2F4->invisible = !sub_811BC2C(); + sScreenControl->scrollIndicatorUpSprite->invisible = !CanScrollUp(); + sScreenControl->scrollIndicatorDownSprite->invisible = !CanScrollDown(); } -static void sub_811E6B0(void) +static void HideScrollIndicators(void) { - sUnknown_0203A11C->unk2F0->invisible = 1; - sUnknown_0203A11C->unk2F4->invisible = 1; + sScreenControl->scrollIndicatorUpSprite->invisible = TRUE; + sScreenControl->scrollIndicatorDownSprite->invisible = TRUE; } -static void sub_811E6E0(int arg0) +static void SetScrollIndicatorXPos(bool32 inWordSelect) { - if (!arg0) + if (!inWordSelect) { - sUnknown_0203A11C->unk2F0->pos1.x = 96; - sUnknown_0203A11C->unk2F4->pos1.x = 96; + // Keyboard (only relevant for group mode, can't scroll in alphabet mode) + sScreenControl->scrollIndicatorUpSprite->pos1.x = 96; + sScreenControl->scrollIndicatorDownSprite->pos1.x = 96; } else { - sUnknown_0203A11C->unk2F0->pos1.x = 120; - sUnknown_0203A11C->unk2F4->pos1.x = 120; + // Word select + sScreenControl->scrollIndicatorUpSprite->pos1.x = 120; + sScreenControl->scrollIndicatorDownSprite->pos1.x = 120; } } -static void sub_811E720(void) +// The Start/Select buttons are used as page scroll indicators +static void CreateStartSelectButtonSprites(void) { - u8 spriteId = CreateSprite(&sUnknown_08597E30, 220, 84, 1); + u8 spriteId = CreateSprite(&sSpriteTemplate_StartSelectButton, 220, 84, 1); if (spriteId != MAX_SPRITES) - sUnknown_0203A11C->unk2F8 = &gSprites[spriteId]; + sScreenControl->startButtonSprite = &gSprites[spriteId]; - spriteId = CreateSprite(&sUnknown_08597E30, 220, 156, 1); + spriteId = CreateSprite(&sSpriteTemplate_StartSelectButton, 220, 156, 1); if (spriteId != MAX_SPRITES) { - sUnknown_0203A11C->unk2FC = &gSprites[spriteId]; - StartSpriteAnim(sUnknown_0203A11C->unk2FC, 1); + sScreenControl->selectButtonSprite = &gSprites[spriteId]; + StartSpriteAnim(sScreenControl->selectButtonSprite, 1); } - sub_811E7F8(); + HideStartSelectButtons(); } -static void sub_811E794(void) +static void UpdateStartSelectButtonsVisibility(void) { - sUnknown_0203A11C->unk2F8->invisible = !sub_811BBF8(); - sUnknown_0203A11C->unk2FC->invisible = !sub_811BC2C(); + sScreenControl->startButtonSprite->invisible = !CanScrollUp(); + sScreenControl->selectButtonSprite->invisible = !CanScrollDown(); } -static void sub_811E7F8(void) +static void HideStartSelectButtons(void) { - sUnknown_0203A11C->unk2F8->invisible = 1; - sUnknown_0203A11C->unk2FC->invisible = 1; + sScreenControl->startButtonSprite->invisible = TRUE; + sScreenControl->selectButtonSprite->invisible = TRUE; } -static void sub_811E828(void) +static void TryAddInterviewObjectEvents(void) { int graphicsId; u8 spriteId; @@ -4731,9 +5004,10 @@ static void sub_811E828(void) return; } - if (GetEasyChatScreenFrameId() != 4) + if (GetEasyChatScreenFrameId() != FRAMEID_INTERVIEW_SHOW_PERSON) return; + // Add object for reporter/interviewing fan (facing left) spriteId = AddPseudoObjectEvent(graphicsId, SpriteCallbackDummy, 76, 40, 0); if (spriteId != MAX_SPRITES) { @@ -4741,6 +5015,7 @@ static void sub_811E828(void) StartSpriteAnim(&gSprites[spriteId], 2); } + // Add object for player (facing right) spriteId = AddPseudoObjectEvent( gSaveBlock2Ptr->playerGender == MALE ? OBJ_EVENT_GFX_RIVAL_BRENDAN_NORMAL : OBJ_EVENT_GFX_RIVAL_MAY_NORMAL, SpriteCallbackDummy, @@ -4760,33 +5035,33 @@ int GetFooterIndex(void) u8 frameId = GetEasyChatScreenFrameId(); switch (sPhraseFrameDimensions[frameId].footerId) { - case 1: - return 1; - case 2: - return 2; - case 0: - return 0; + case FOOTER_QUIZ: + return FOOTER_QUIZ; + case FOOTER_ANSWER: + return FOOTER_ANSWER; + case FOOTER_NORMAL: + return FOOTER_NORMAL; default: - return 3; + return NUM_FOOTER_TYPES; } } static int GetFooterOptionXOffset(int option) { int footerIndex = GetFooterIndex(); - if (footerIndex < 3) + if (footerIndex < NUM_FOOTER_TYPES) return sFooterOptionXOffsets[footerIndex][option] + 4; else return 0; } -static void sub_811E948(void) +static void AddMainScreenButtonWindow(void) { int i; u16 windowId; struct WindowTemplate template; - int footerId = GetFooterIndex(); - if (footerId == 3) + int footerIndex = GetFooterIndex(); + if (footerIndex == NUM_FOOTER_TYPES) return; template.bg = 3; @@ -4798,13 +5073,13 @@ static void sub_811E948(void) template.baseBlock = 0x34; windowId = AddWindow(&template); FillWindowPixelBuffer(windowId, PIXEL_FILL(1)); - for (i = 0; i < 4; i++) + for (i = 0; i < (int)ARRAY_COUNT(sFooterTextOptions[0]); i++) { - const u8 *str = sFooterTextOptions[footerId][i]; + const u8 *str = sFooterTextOptions[footerIndex][i]; if (str) { - int x = sFooterOptionXOffsets[footerId][i]; - sub_811D028(windowId, 1, str, x, 1, 0, NULL); + int x = sFooterOptionXOffsets[footerIndex][i]; + PrintEasyChatText(windowId, 1, str, x, 1, 0, NULL); } } @@ -4821,7 +5096,7 @@ static bool8 IsEasyChatGroupUnlocked(u8 groupId) case EC_GROUP_MOVE_1: case EC_GROUP_MOVE_2: return FlagGet(FLAG_SYS_GAME_CLEAR); - case EC_GROUP_POKEMON_2: + case EC_GROUP_POKEMON_NATIONAL: return EasyChatIsNationalPokedexEnabled(); default: return TRUE; @@ -4839,14 +5114,14 @@ u16 EasyChat_GetNumWordsInGroup(u8 groupId) return 0; } -bool8 sub_811EAA4(u16 easyChatWord) +static bool8 IsEasyChatWordInvalid(u16 easyChatWord) { u16 i; u8 groupId; u32 index; u16 numWords; const u16 *list; - if (easyChatWord == 0xFFFF) + if (easyChatWord == EC_EMPTY_WORD) return FALSE; groupId = EC_GROUP(easyChatWord); @@ -4858,7 +5133,7 @@ bool8 sub_811EAA4(u16 easyChatWord) switch (groupId) { case EC_GROUP_POKEMON: - case EC_GROUP_POKEMON_2: + case EC_GROUP_POKEMON_NATIONAL: case EC_GROUP_MOVE_1: case EC_GROUP_MOVE_2: list = gEasyChatGroups[groupId].wordData.valueList; @@ -4868,12 +5143,12 @@ bool8 sub_811EAA4(u16 easyChatWord) return FALSE; } return TRUE; - default: - if (index >= numWords) - return TRUE; - else - return FALSE; } + + if (index >= numWords) + return TRUE; + else + return FALSE; } bool8 IsBardWordInvalid(u16 easyChatWord) @@ -4887,7 +5162,7 @@ bool8 IsBardWordInvalid(u16 easyChatWord) switch (groupId) { case EC_GROUP_POKEMON: - case EC_GROUP_POKEMON_2: + case EC_GROUP_POKEMON_NATIONAL: numWordsInGroup = gNumBardWords_Species; break; case EC_GROUP_MOVE_1: @@ -4905,12 +5180,12 @@ bool8 IsBardWordInvalid(u16 easyChatWord) return FALSE; } -const u8 *GetEasyChatWord(u8 groupId, u16 index) +static const u8 *GetEasyChatWord(u8 groupId, u16 index) { switch (groupId) { case EC_GROUP_POKEMON: - case EC_GROUP_POKEMON_2: + case EC_GROUP_POKEMON_NATIONAL: return gSpeciesNames[index]; case EC_GROUP_MOVE_1: case EC_GROUP_MOVE_2: @@ -4923,11 +5198,11 @@ const u8 *GetEasyChatWord(u8 groupId, u16 index) u8 *CopyEasyChatWord(u8 *dest, u16 easyChatWord) { u8 *resultStr; - if (sub_811EAA4(easyChatWord)) + if (IsEasyChatWordInvalid(easyChatWord)) { resultStr = StringCopy(dest, gText_ThreeQuestionMarks); } - else if (easyChatWord != 0xFFFF) + else if (easyChatWord != EC_EMPTY_WORD) { u16 index = EC_INDEX(easyChatWord); u8 groupId = EC_GROUP(easyChatWord); @@ -4952,7 +5227,7 @@ u8 *ConvertEasyChatWordsToString(u8 *dest, const u16 *src, u16 columns, u16 rows for (j = 0; j < numColumns; j++) { dest = CopyEasyChatWord(dest, *src); - if (*src != 0xFFFF) + if (*src != EC_EMPTY_WORD) { *dest = CHAR_SPACE; dest++; @@ -4971,26 +5246,26 @@ u8 *ConvertEasyChatWordsToString(u8 *dest, const u16 *src, u16 columns, u16 rows return dest; } -u8 *unref_sub_811EC98(u8 *dest, const u16 *src, u16 columns, u16 rows) +static u8 *UnusedConvertEasyChatWordsToString(u8 *dest, const u16 *src, u16 columns, u16 rows) { u16 i, j, k; u16 numColumns; - int var0, var1; + int notEmpty, lineNumber; numColumns = columns; - var1 = 0; + lineNumber = 0; columns--; for (i = 0; i < rows; i++) { - const u16 *var2 = src; - var0 = 0; + const u16 *str = src; + notEmpty = FALSE; for (j = 0; j < numColumns; j++) { - if (var2[j] != 0xFFFF) - var0 = 1; + if (str[j] != EC_EMPTY_WORD) + notEmpty = TRUE; } - if (!var0) + if (!notEmpty) { src += numColumns; continue; @@ -4999,7 +5274,7 @@ u8 *unref_sub_811EC98(u8 *dest, const u16 *src, u16 columns, u16 rows) for (k = 0; k < columns; k++) { dest = CopyEasyChatWord(dest, *src); - if (*src != 0xFFFF) + if (*src != EC_EMPTY_WORD) { *dest = CHAR_SPACE; dest++; @@ -5009,13 +5284,13 @@ u8 *unref_sub_811EC98(u8 *dest, const u16 *src, u16 columns, u16 rows) } dest = CopyEasyChatWord(dest, *(src++)); - if (var1 == 0) + if (lineNumber == 0) *dest = CHAR_NEWLINE; else *dest = CHAR_PROMPT_SCROLL; dest++; - var1++; + lineNumber++; } dest--; @@ -5025,10 +5300,10 @@ u8 *unref_sub_811EC98(u8 *dest, const u16 *src, u16 columns, u16 rows) static u16 GetEasyChatWordStringLength(u16 easyChatWord) { - if (easyChatWord == 0xFFFF) + if (easyChatWord == EC_EMPTY_WORD) return 0; - if (sub_811EAA4(easyChatWord)) + if (IsEasyChatWordInvalid(easyChatWord)) { return StringLength(gText_ThreeQuestionMarks); } @@ -5061,7 +5336,7 @@ u16 GetRandomEasyChatWordFromGroup(u16 groupId) { u16 index = Random() % gEasyChatGroups[groupId].numWords; if (groupId == EC_GROUP_POKEMON - || groupId == EC_GROUP_POKEMON_2 + || groupId == EC_GROUP_POKEMON_NATIONAL || groupId == EC_GROUP_MOVE_1 || groupId == EC_GROUP_MOVE_2) { @@ -5074,7 +5349,7 @@ u16 GetRandomEasyChatWordFromGroup(u16 groupId) u16 GetRandomEasyChatWordFromUnlockedGroup(u16 groupId) { if (!IsEasyChatGroupUnlocked(groupId)) - return 0xFFFF; + return EC_EMPTY_WORD; if (groupId == EC_GROUP_POKEMON) return GetRandomUnlockedEasyChatPokemon(); @@ -5169,7 +5444,7 @@ u16 GetNewHipsterPhraseToTeach(void) u16 additionalPhraseId; u8 numAdditionalPhrasesUnlocked = GetNumAdditionalPhrasesUnlocked(); if (numAdditionalPhrasesUnlocked == NUM_ADDITIONAL_PHRASES) - return 0xFFFF; + return EC_EMPTY_WORD; additionalPhraseId = Random() % (NUM_ADDITIONAL_PHRASES - numAdditionalPhrasesUnlocked); for (i = 0; i < NUM_ADDITIONAL_PHRASES; i++) @@ -5188,7 +5463,7 @@ u16 GetNewHipsterPhraseToTeach(void) } } - return 0xFFFF; + return EC_EMPTY_WORD; } // Unused @@ -5197,7 +5472,7 @@ u16 GetRandomTaughtHipsterPhrase(void) u16 i; u16 additionalPhraseId = GetNumAdditionalPhrasesUnlocked(); if (additionalPhraseId == 0) - return 0xFFFF; + return EC_EMPTY_WORD; additionalPhraseId = Random() % additionalPhraseId; for (i = 0; i < NUM_ADDITIONAL_PHRASES; i++) @@ -5211,7 +5486,7 @@ u16 GetRandomTaughtHipsterPhrase(void) } } - return 0xFFFF; + return EC_EMPTY_WORD; } static bool8 EasyChatIsNationalPokedexEnabled(void) @@ -5226,7 +5501,7 @@ static u16 GetRandomUnlockedEasyChatPokemon(void) const u16 *species; u16 index = EasyChat_GetNumWordsInGroup(EC_GROUP_POKEMON); if (index == 0) - return 0xFFFF; + return EC_EMPTY_WORD; index = Random() % index; species = gEasyChatGroups[EC_GROUP_POKEMON].wordData.valueList; @@ -5245,29 +5520,29 @@ static u16 GetRandomUnlockedEasyChatPokemon(void) species++; } - return 0xFFFF; + return EC_EMPTY_WORD; } void InitEasyChatPhrases(void) { u16 i, j; - for (i = 0; i < 4; i++) + for (i = 0; i < ARRAY_COUNT(sDefaultProfileWords); i++) gSaveBlock1Ptr->easyChatProfile[i] = sDefaultProfileWords[i]; - for (i = 0; i < 6; i++) + for (i = 0; i < EASY_CHAT_BATTLE_WORDS_COUNT; i++) gSaveBlock1Ptr->easyChatBattleStart[i] = sDefaultBattleStartWords[i]; - for (i = 0; i < 6; i++) - gSaveBlock1Ptr->easyChatBattleWon[i] = sUnknown_0859E640[i]; + for (i = 0; i < EASY_CHAT_BATTLE_WORDS_COUNT; i++) + gSaveBlock1Ptr->easyChatBattleWon[i] = sDefaultBattleWonWords[i]; - for (i = 0; i < 6; i++) - gSaveBlock1Ptr->easyChatBattleLost[i] = sUnknown_0859E64C[i]; + for (i = 0; i < EASY_CHAT_BATTLE_WORDS_COUNT; i++) + gSaveBlock1Ptr->easyChatBattleLost[i] = sDefaultBattleLostWords[i]; for (i = 0; i < MAIL_COUNT; i++) { for (j = 0; j < MAIL_WORDS_COUNT; j++) - gSaveBlock1Ptr->mail[i].words[j] = 0xFFFF; + gSaveBlock1Ptr->mail[i].words[j] = EC_EMPTY_WORD; } #ifndef UBFIX @@ -5283,65 +5558,67 @@ void InitEasyChatPhrases(void) #endif } -static bool8 sub_811F28C(void) +static bool8 InitEasyChatScreenWordData(void) { - sUnknown_0203A120 = Alloc(sizeof(*sUnknown_0203A120)); - if (!sUnknown_0203A120) + sWordData = Alloc(sizeof(*sWordData)); + if (!sWordData) return FALSE; - sub_811F2D4(); - sub_811F46C(); + SetUnlockedEasyChatGroups(); + SetUnlockedWordsByAlphabet(); return TRUE; } -static void sub_811F2B8(void) +static void FreeEasyChatScreenWordData(void) { - if (sUnknown_0203A120) - FREE_AND_SET_NULL(sUnknown_0203A120); + if (sWordData) + FREE_AND_SET_NULL(sWordData); } -static void sub_811F2D4(void) +static void SetUnlockedEasyChatGroups(void) { int i; - sUnknown_0203A120->unk0 = 0; + sWordData->numUnlockedGroups = 0; if (GetNationalPokedexCount(FLAG_GET_SEEN)) - sUnknown_0203A120->unk2[sUnknown_0203A120->unk0++] = EC_GROUP_POKEMON; + sWordData->unlockedGroupIds[sWordData->numUnlockedGroups++] = EC_GROUP_POKEMON; + // These groups are unlocked automatically for (i = EC_GROUP_TRAINER; i <= EC_GROUP_ADJECTIVES; i++) - sUnknown_0203A120->unk2[sUnknown_0203A120->unk0++] = i; + sWordData->unlockedGroupIds[sWordData->numUnlockedGroups++] = i; if (FlagGet(FLAG_SYS_GAME_CLEAR)) { - sUnknown_0203A120->unk2[sUnknown_0203A120->unk0++] = EC_GROUP_EVENTS; - sUnknown_0203A120->unk2[sUnknown_0203A120->unk0++] = EC_GROUP_MOVE_1; - sUnknown_0203A120->unk2[sUnknown_0203A120->unk0++] = EC_GROUP_MOVE_2; + sWordData->unlockedGroupIds[sWordData->numUnlockedGroups++] = EC_GROUP_EVENTS; + sWordData->unlockedGroupIds[sWordData->numUnlockedGroups++] = EC_GROUP_MOVE_1; + sWordData->unlockedGroupIds[sWordData->numUnlockedGroups++] = EC_GROUP_MOVE_2; } if (FlagGet(FLAG_SYS_HIPSTER_MEET)) - sUnknown_0203A120->unk2[sUnknown_0203A120->unk0++] = EC_GROUP_TRENDY_SAYING; + sWordData->unlockedGroupIds[sWordData->numUnlockedGroups++] = EC_GROUP_TRENDY_SAYING; if (IsNationalPokedexEnabled()) - sUnknown_0203A120->unk2[sUnknown_0203A120->unk0++] = EC_GROUP_POKEMON_2; + sWordData->unlockedGroupIds[sWordData->numUnlockedGroups++] = EC_GROUP_POKEMON_NATIONAL; } -static u8 sub_811F3AC(void) +static u8 GetNumUnlockedEasyChatGroups(void) { - return sUnknown_0203A120->unk0; + return sWordData->numUnlockedGroups; } -static u8 sub_811F3B8(u8 index) +static u8 GetUnlockedEasyChatGroupId(u8 index) { - if (index >= sUnknown_0203A120->unk0) + if (index >= sWordData->numUnlockedGroups) return EC_NUM_GROUPS; else - return sUnknown_0203A120->unk2[index]; + return sWordData->unlockedGroupIds[index]; } -u8 *unref_sub_811F3E0(u8 *dest, u8 groupId, u16 totalChars) +// Unused +static u8 *BufferEasyChatWordGroupName(u8 *dest, u8 groupId, u16 totalChars) { u16 i; - u8 *str = StringCopy(dest, gEasyChatGroupNamePointers[groupId]); + u8 *str = StringCopy(dest, sEasyChatGroupNamePointers[groupId]); for (i = str - dest; i < totalChars; i++) { *str = CHAR_SPACE; @@ -5354,7 +5631,7 @@ u8 *unref_sub_811F3E0(u8 *dest, u8 groupId, u16 totalChars) static const u8 *GetEasyChatWordGroupName(u8 groupId) { - return gEasyChatGroupNamePointers[groupId]; + return sEasyChatGroupNamePointers[groupId]; } static u8 *CopyEasyChatWordPadded(u8 *dest, u16 easyChatWord, u16 totalChars) @@ -5371,7 +5648,7 @@ static u8 *CopyEasyChatWordPadded(u8 *dest, u16 easyChatWord, u16 totalChars) return str; } -static void sub_811F46C(void) +static void SetUnlockedWordsByAlphabet(void) { int i, j, k; int numWords; @@ -5379,15 +5656,15 @@ static void sub_811F46C(void) u16 numToProcess; int index; - for (i = 0; i < 27; i++) + for (i = 0; i < EC_NUM_ALPHABET_GROUPS; i++) { numWords = gEasyChatWordsByLetterPointers[i].numWords; words = gEasyChatWordsByLetterPointers[i].words; - sUnknown_0203A120->unk2E[i] = 0; + sWordData->numUnlockedAlphabetWords[i] = 0; index = 0; for (j = 0; j < numWords; j++) { - if (*words == 0xFFFF) + if (*words == EC_EMPTY_WORD) { words++; numToProcess = *words; @@ -5401,10 +5678,10 @@ static void sub_811F46C(void) for (k = 0; k < numToProcess; k++) { - if (sub_811F860(words[k])) + if (IsEasyChatWordUnlocked(words[k])) { - sUnknown_0203A120->unk64[i][index++] = words[k]; - sUnknown_0203A120->unk2E[i]++; + sWordData->unlockedAlphabetWords[i][index++] = words[k]; + sWordData->numUnlockedAlphabetWords[i]++; break; } } @@ -5414,28 +5691,28 @@ static void sub_811F46C(void) } } -static void sub_811F548(int arg0, u16 groupId) +static void SetSelectedWordGroup(bool32 inAlphabetMode, u16 groupId) { - if (!arg0) - sUnknown_0203A120->unk3BA0 = sub_811F5C4(groupId); + if (!inAlphabetMode) + sWordData->numSelectedGroupWords = SetSelectedWordGroup_GroupMode(groupId); else - sUnknown_0203A120->unk3BA0 = sub_811F6B8(groupId); + sWordData->numSelectedGroupWords = SetSelectedWordGroup_AlphabetMode(groupId); } -static u16 sub_811F578(u16 arg0) +static u16 GetWordFromSelectedGroup(u16 index) { - if (arg0 >= sUnknown_0203A120->unk3BA0) - return 0xFFFF; + if (index >= sWordData->numSelectedGroupWords) + return EC_EMPTY_WORD; else - return sUnknown_0203A120->unk3984[arg0]; + return sWordData->selectedGroupWords[index]; } -static u16 sub_811F5B0(void) +static u16 GetNumWordsInSelectedGroup(void) { - return sUnknown_0203A120->unk3BA0; + return sWordData->numSelectedGroupWords; } -static u16 sub_811F5C4(u16 groupId) +static u16 SetSelectedWordGroup_GroupMode(u16 groupId) { u32 i; int totalWords; @@ -5443,14 +5720,14 @@ static u16 sub_811F5C4(u16 groupId) const struct EasyChatWordInfo *wordInfo; u16 numWords = gEasyChatGroups[groupId].numWords; - if (groupId == EC_GROUP_POKEMON || groupId == EC_GROUP_POKEMON_2 + if (groupId == EC_GROUP_POKEMON || groupId == EC_GROUP_POKEMON_NATIONAL || groupId == EC_GROUP_MOVE_1 || groupId == EC_GROUP_MOVE_2) { list = gEasyChatGroups[groupId].wordData.valueList; for (i = 0, totalWords = 0; i < numWords; i++) { - if (sub_811F764(list[i], groupId)) - sUnknown_0203A120->unk3984[totalWords++] = EC_WORD(groupId, list[i]); + if (IsEasyChatIndexAndGroupUnlocked(list[i], groupId)) + sWordData->selectedGroupWords[totalWords++] = EC_WORD(groupId, list[i]); } return totalWords; @@ -5461,45 +5738,45 @@ static u16 sub_811F5C4(u16 groupId) for (i = 0, totalWords = 0; i < numWords; i++) { u16 alphabeticalOrder = wordInfo[i].alphabeticalOrder; - if (sub_811F764(alphabeticalOrder, groupId)) - sUnknown_0203A120->unk3984[totalWords++] = EC_WORD(groupId, alphabeticalOrder); + if (IsEasyChatIndexAndGroupUnlocked(alphabeticalOrder, groupId)) + sWordData->selectedGroupWords[totalWords++] = EC_WORD(groupId, alphabeticalOrder); } return totalWords; } } -static u16 sub_811F6B8(u16 alphabeticalGroup) +static u16 SetSelectedWordGroup_AlphabetMode(u16 groupId) { u16 i; u16 totalWords; - for (i = 0, totalWords = 0; i < sUnknown_0203A120->unk2E[alphabeticalGroup]; i++) - sUnknown_0203A120->unk3984[totalWords++] = sUnknown_0203A120->unk64[alphabeticalGroup][i]; + for (i = 0, totalWords = 0; i < sWordData->numUnlockedAlphabetWords[groupId]; i++) + sWordData->selectedGroupWords[totalWords++] = sWordData->unlockedAlphabetWords[groupId][i]; return totalWords; } -static bool8 sub_811F72C(u8 arg0) +static bool8 IsEasyChatGroupUnlocked2(u8 groupId) { int i; - for (i = 0; i < sUnknown_0203A120->unk0; i++) + for (i = 0; i < sWordData->numUnlockedGroups; i++) { - if (sUnknown_0203A120->unk2[i] == arg0) + if (sWordData->unlockedGroupIds[i] == groupId) return TRUE; } return FALSE; } -static bool8 sub_811F764(u16 wordIndex, u8 groupId) +static bool8 IsEasyChatIndexAndGroupUnlocked(u16 wordIndex, u8 groupId) { switch (groupId) { case EC_GROUP_POKEMON: return GetSetPokedexFlag(SpeciesToNationalPokedexNum(wordIndex), FLAG_GET_SEEN); - case EC_GROUP_POKEMON_2: - if (sub_811F838(wordIndex)) + case EC_GROUP_POKEMON_NATIONAL: + if (IsRestrictedWordSpecies(wordIndex)) GetSetPokedexFlag(SpeciesToNationalPokedexNum(wordIndex), FLAG_GET_SEEN); return TRUE; case EC_GROUP_MOVE_1: @@ -5512,50 +5789,52 @@ static bool8 sub_811F764(u16 wordIndex, u8 groupId) } } -static int sub_811F838(u16 species) +// Pokémon words in EC_GROUP_POKEMON_NATIONAL are always allowed (assuming the group is unlocked) +// unless they are in this group. If they are in this group (just Deoxys), they must also have been seen. +static int IsRestrictedWordSpecies(u16 species) { u32 i; - for (i = 0; i < ARRAY_COUNT(sUnknown_0859E658); i++) + for (i = 0; i < ARRAY_COUNT(sRestrictedWordSpecies); i++) { - if (sUnknown_0859E658[i] == species) + if (sRestrictedWordSpecies[i] == species) return TRUE; } return FALSE; } -static u8 sub_811F860(u16 easyChatWord) +static u8 IsEasyChatWordUnlocked(u16 easyChatWord) { u8 groupId = EC_GROUP(easyChatWord); u32 index = EC_INDEX(easyChatWord); - if (!sub_811F72C(groupId)) + if (!IsEasyChatGroupUnlocked2(groupId)) return FALSE; else - return sub_811F764(index, groupId); + return IsEasyChatIndexAndGroupUnlocked(index, groupId); } void InitializeEasyChatWordArray(u16 *words, u16 length) { u16 i; - for (i = length - 1; i != 0xFFFF; i--) - *(words++) = 0xFFFF; + for (i = length - 1; i != EC_EMPTY_WORD; i--) + *(words++) = EC_EMPTY_WORD; } -void sub_811F8BC(void) +void InitQuestionnaireWords(void) { int i; - u16 *words = sub_801B058(); - for (i = 0; i < 4; i++) - words[i] = 0xFFFF; + u16 *words = GetQuestionnaireWordsPtr(); + for (i = 0; i < NUM_QUESTIONNAIRE_WORDS; i++) + words[i] = EC_EMPTY_WORD; } -bool32 sub_811F8D8(int easyChatWord) +bool32 IsEasyChatAnswerUnlocked(int easyChatWord) { int groupId = EC_GROUP(easyChatWord); - int mask = 0x7F; + int mask = EC_MASK_GROUP; int index = EC_INDEX(easyChatWord); if (!IsEasyChatGroupUnlocked(groupId & mask)) return FALSE; else - return sub_811F764(index, groupId & mask); + return IsEasyChatIndexAndGroupUnlocked(index, groupId & mask); } diff --git a/src/ereader_helpers.c b/src/ereader_helpers.c index 944d1d728..5edfc120c 100755 --- a/src/ereader_helpers.c +++ b/src/ereader_helpers.c @@ -134,10 +134,10 @@ static const struct TrainerHillTrainer sTrainerHillTrainerTemplates_JP[] = { .name = __("ハルヒト$$$$ "), .facilityClass = FACILITY_CLASS_CAMPER, .unused = 0x1, - .speechBefore = { EC_MOVE2(BOUNCE), EC_WORD_AS_MUCH_AS, 0xFFFF, EC_WORD_THEY_RE, EC_WORD_STRONG, EC_WORD_EXCL }, - .speechWin = { EC_MOVE(FLY), EC_WORD_AS_MUCH_AS, 0xFFFF, EC_WORD_THEY_RE, EC_WORD_HAPPY, EC_WORD_EXCL }, - .speechLose = { EC_MOVE2(MINIMIZE), EC_WORD_AS_MUCH_AS, 0xFFFF, EC_WORD_THEY_RE, EC_WORD_SAD, EC_WORD_EXCL }, - .speechAfter = { EC_MOVE(BITE), EC_WORD_AS_MUCH_AS, 0xFFFF, EC_WORD_THEY_RE, EC_WORD_ANGRY, EC_WORD_EXCL }, + .speechBefore = { EC_MOVE2(BOUNCE), EC_WORD_AS_MUCH_AS, EC_EMPTY_WORD, EC_WORD_THEY_RE, EC_WORD_STRONG, EC_WORD_EXCL }, + .speechWin = { EC_MOVE(FLY), EC_WORD_AS_MUCH_AS, EC_EMPTY_WORD, EC_WORD_THEY_RE, EC_WORD_HAPPY, EC_WORD_EXCL }, + .speechLose = { EC_MOVE2(MINIMIZE), EC_WORD_AS_MUCH_AS, EC_EMPTY_WORD, EC_WORD_THEY_RE, EC_WORD_SAD, EC_WORD_EXCL }, + .speechAfter = { EC_MOVE(BITE), EC_WORD_AS_MUCH_AS, EC_EMPTY_WORD, EC_WORD_THEY_RE, EC_WORD_ANGRY, EC_WORD_EXCL }, .mons = { [0] = NULL_BATTLE_TOWER_POKEMON, [1] = NULL_BATTLE_TOWER_POKEMON, @@ -223,7 +223,7 @@ static const struct TrainerHillTrainer sTrainerHillTrainerTemplates_JP[] = { .speechBefore = { EC_WORD_SHINE, EC_WORD_POKEMON, EC_WORD_RELEASE, EC_WORD_WAS, EC_MOVE2(FRUSTRATION), EC_WORD_WITHOUT }, .speechWin = { EC_WORD_SHINE, EC_WORD_POKEMON, EC_WORD_TO_HER, EC_MOVE2(PRESENT), EC_WORD_KNOWS, EC_WORD_WITHOUT }, .speechLose = { EC_WORD_THAT, EC_WORD_ABOVE, EC_WORD_LOST, EC_WORD_STORES, EC_WORD_JOKING, EC_WORD_ELLIPSIS_ELLIPSIS_ELLIPSIS }, - .speechAfter = { EC_WORD_ENTERTAINING, EC_WORD_NONE, EC_WORD_HEY_QUES, EC_WORD_ALMOST, EC_WORD_EXCL, 0xFFFF }, + .speechAfter = { EC_WORD_ENTERTAINING, EC_WORD_NONE, EC_WORD_HEY_QUES, EC_WORD_ALMOST, EC_WORD_EXCL, EC_EMPTY_WORD }, .mons = { [0] = NULL_BATTLE_TOWER_POKEMON, [1] = NULL_BATTLE_TOWER_POKEMON, @@ -307,7 +307,7 @@ static const struct TrainerHillTrainer sTrainerHillTrainerTemplates_JP[] = { .facilityClass = FACILITY_CLASS_GENTLEMAN, .unused = 0x1, .speechBefore = { EC_WORD_SHE_WAS, EC_WORD_NO_1, EC_WORD_STRONG, EC_WORD_UNCLE, EC_WORD_THERE, EC_WORD_EXCL }, - .speechWin = { EC_WORD_HAHAHA, EC_WORD_TEACHER, EC_WORD_BECOMES, EC_WORD_GIVE, EC_WORD_IS_IT_QUES, 0xFFFF }, + .speechWin = { EC_WORD_HAHAHA, EC_WORD_TEACHER, EC_WORD_BECOMES, EC_WORD_GIVE, EC_WORD_IS_IT_QUES, EC_EMPTY_WORD }, .speechLose = { EC_WORD_OUTSIDE, EC_WORD_UNCLE, EC_WORD_SURPRISE, EC_WORD_THESE, EC_WORD_HEY_QUES, EC_WORD_ELLIPSIS_EXCL }, .speechAfter = { EC_WORD_HE_S, EC_WORD_NO_1, EC_WORD_STRONG, EC_WORD_CHILDREN, EC_WORD_CAN_T, EC_WORD_EXCL_EXCL }, .mons = { diff --git a/src/graphics.c b/src/graphics.c index 3f49cd2e7..5710d171b 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -1361,11 +1361,11 @@ static const u8 sEmpty1[0x200] = {0}; const u8 gBerryBlenderPlayerArrow_Gfx[] = INCBIN_U8("graphics/berry_blender/arrow.4bpp"); static const u8 sEmpty2[0x2C0] = {0}; -const u16 gEasyChatCursor_Pal[] = INCBIN_U16("graphics/easy_chat/cursor.gbapal"); -const u32 gEasyChatCursor_Gfx[] = INCBIN_U32("graphics/easy_chat/cursor.4bpp.lz"); +const u16 gEasyChatRectangleCursor_Pal[] = INCBIN_U16("graphics/easy_chat/rectangle_cursor.gbapal"); +const u32 gEasyChatRectangleCursor_Gfx[] = INCBIN_U32("graphics/easy_chat/rectangle_cursor.4bpp.lz"); -const u16 gEasyChatRightWindow_Pal[] = INCBIN_U16("graphics/easy_chat/rwindow.gbapal"); -const u32 gEasyChatRightWindow_Gfx[] = INCBIN_U32("graphics/easy_chat/rwindow.4bpp.lz"); +const u16 gEasyChatButtonWindow_Pal[] = INCBIN_U16("graphics/easy_chat/button_window.gbapal"); +const u32 gEasyChatButtonWindow_Gfx[] = INCBIN_U32("graphics/easy_chat/button_window.4bpp.lz"); const u32 gEasyChatMode_Gfx[] = INCBIN_U32("graphics/easy_chat/mode.4bpp.lz"); const u16 gEasyChatMode_Pal[] = INCBIN_U16("graphics/easy_chat/mode.gbapal"); diff --git a/src/lilycove_lady.c b/src/lilycove_lady.c index 011d9fdfd..5bad07420 100644 --- a/src/lilycove_lady.c +++ b/src/lilycove_lady.c @@ -379,7 +379,7 @@ u8 GetQuizAuthor(void) struct LilycoveLadyQuiz *quiz; quiz = &gSaveBlock1Ptr->lilycoveLady.quiz; - if (sub_811F8D8(quiz->correctAnswer) == 0) + if (IsEasyChatAnswerUnlocked(quiz->correctAnswer) == FALSE) { i = quiz->questionId; do @@ -388,7 +388,7 @@ u8 GetQuizAuthor(void) { i = 0; } - } while (sub_811F8D8(sQuizLadyQuizAnswers[i]) == 0); + } while (IsEasyChatAnswerUnlocked(sQuizLadyQuizAnswers[i]) == FALSE); for (j = 0; j < QUIZ_QUESTION_LEN; j ++) { quiz->question[j] = sQuizLadyQuizQuestions[i][j]; diff --git a/src/mail_data.c b/src/mail_data.c index 350888d0b..2ae9bedab 100644 --- a/src/mail_data.c +++ b/src/mail_data.c @@ -5,6 +5,7 @@ #include "pokemon_icon.h" #include "text.h" #include "international_string_util.h" +#include "constants/easy_chat.h" void ClearMailData(void) { @@ -19,7 +20,7 @@ void ClearMailStruct(struct MailStruct *mail) s32 i; for (i = 0; i < MAIL_WORDS_COUNT; i++) - mail->words[i] = 0xFFFF; + mail->words[i] = EC_EMPTY_WORD; for (i = 0; i < PLAYER_NAME_LENGTH + 1; i++) mail->playerName[i] = EOS; @@ -55,7 +56,7 @@ u8 GiveMailToMon(struct Pokemon *mon, u16 itemId) if (gSaveBlock1Ptr->mail[id].itemId == ITEM_NONE) { for (i = 0; i < MAIL_WORDS_COUNT; i++) - gSaveBlock1Ptr->mail[id].words[i] = 0xFFFF; + gSaveBlock1Ptr->mail[id].words[i] = EC_EMPTY_WORD; for (i = 0; i < PLAYER_NAME_LENGTH; i++) gSaveBlock1Ptr->mail[id].playerName[i] = gSaveBlock2Ptr->playerName[i]; diff --git a/src/mauville_old_man.c b/src/mauville_old_man.c index c97ee94f3..cdcde9b06 100644 --- a/src/mauville_old_man.c +++ b/src/mauville_old_man.c @@ -250,7 +250,7 @@ void ScrSpecial_HipsterTeachWord(void) { u16 phrase = GetNewHipsterPhraseToTeach(); - if (phrase == 0xFFFF) + if (phrase == EC_EMPTY_WORD) { gSpecialVar_Result = FALSE; } @@ -283,7 +283,7 @@ void ScrSpecial_GenerateGiddyLine(void) if (giddy->taleCounter == 0) InitGiddyTaleList(); - if (giddy->randomWords[giddy->taleCounter] != 0xFFFF) // is not the last element of the array? + if (giddy->randomWords[giddy->taleCounter] != EC_EMPTY_WORD) { u8 *stringPtr; u32 adjective = Random(); @@ -316,7 +316,7 @@ static void InitGiddyTaleList(void) {EC_GROUP_HOBBIES, 0}, {EC_GROUP_MOVE_1, 0}, {EC_GROUP_MOVE_2, 0}, - {EC_GROUP_POKEMON_2, 0} + {EC_GROUP_POKEMON_NATIONAL, 0} }; u16 i; u16 r10; @@ -348,7 +348,7 @@ static void InitGiddyTaleList(void) r1 = Random() % 10; if (r1 < 3 && r7 < 8) { - giddy->randomWords[i] = 0xFFFF; + giddy->randomWords[i] = EC_EMPTY_WORD; r7++; } else diff --git a/src/mevent2.c b/src/mevent2.c index 3209c585a..d2c020858 100755 --- a/src/mevent2.c +++ b/src/mevent2.c @@ -26,7 +26,7 @@ void sub_801AFD8(void) { CpuFill32(0, &gSaveBlock1Ptr->unk_322C, sizeof(gSaveBlock1Ptr->unk_322C)); sub_801B180(); - sub_811F8BC(); + InitQuestionnaireWords(); } struct WonderNews *GetSavedWonderNews(void) @@ -49,9 +49,9 @@ struct MysteryEventStruct *sub_801B044(void) return &gSaveBlock1Ptr->unk_322C.unk_340; } -u16 *sub_801B058(void) +u16 *GetQuestionnaireWordsPtr(void) { - return gSaveBlock1Ptr->unk_322C.unk_338; + return gSaveBlock1Ptr->unk_322C.questionnaireWords; } void DestroyWonderNews(void) @@ -364,8 +364,8 @@ void sub_801B580(struct MEventStruct_Unk1442CC *data, bool32 a1) data->unk_14 = 0; } - for (i = 0; i < 4; i++) - data->unk_16[i] = gSaveBlock1Ptr->unk_322C.unk_338[i]; + for (i = 0; i < NUM_QUESTIONNAIRE_WORDS; i++) + data->unk_16[i] = gSaveBlock1Ptr->unk_322C.questionnaireWords[i]; CopyTrainerId(data->unk_4C, gSaveBlock2Ptr->playerTrainerId); StringCopy(data->unk_45, gSaveBlock2Ptr->playerName); @@ -425,7 +425,7 @@ u32 sub_801B708(const u16 *a0, const struct MEventStruct_Unk1442CC *a1, const vo bool32 MEventStruct_Unk1442CC_CompareField_unk_16(const struct MEventStruct_Unk1442CC *a0, const u16 *a1) { int i; - for (i = 0; i < 4; i++) + for (i = 0; i < NUM_QUESTIONNAIRE_WORDS; i++) { if (a0->unk_16[i] != a1[i]) return FALSE; diff --git a/src/overworld.c b/src/overworld.c index cbfc70898..5aa5bb73d 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -1133,7 +1133,7 @@ void Overworld_PlaySpecialMapMusic(void) { u16 music = GetCurrLocationDefaultMusic(); - if (music != MUS_ABNORMAL_WEATHER && music != 0xFFFF) + if (music != MUS_ABNORMAL_WEATHER && music != MUS_NONE) { if (gSaveBlock1Ptr->savedMusic) music = gSaveBlock1Ptr->savedMusic; @@ -1163,7 +1163,7 @@ static void TransitionMapMusic(void) { u16 newMusic = GetWarpDestinationMusic(); u16 currentMusic = GetCurrentMapMusic(); - if (newMusic != MUS_ABNORMAL_WEATHER && newMusic != 0xFFFF) + if (newMusic != MUS_ABNORMAL_WEATHER && newMusic != MUS_NONE) { if (currentMusic == MUS_UNDERWATER || currentMusic == MUS_SURF) return; diff --git a/src/tv.c b/src/tv.c index a1743fd2d..82624977e 100644 --- a/src/tv.c +++ b/src/tv.c @@ -1016,7 +1016,7 @@ bool8 IsTVShowInSearchOfTrainersAiring(void) bool8 GabbyAndTyGetLastQuote(void) { - if (gSaveBlock1Ptr->gabbyAndTyData.quote[0] == 0xFFFF) + if (gSaveBlock1Ptr->gabbyAndTyData.quote[0] == EC_EMPTY_WORD) { return FALSE; } @@ -3299,14 +3299,11 @@ void TV_FanClubLetter_RandomWordToStringVar3(TVShow *show) while (TRUE) { if (i == 6) - { i = 0; - } - if (show->fanclubLetter.words[i] != 0xFFFF) - { + + if (show->fanclubLetter.words[i] != EC_EMPTY_WORD) break; - } - i ++; + i++; } CopyEasyChatWord(gStringVar3, show->fanclubLetter.words[i]); } From b71b10623b31065a9a29b43938cf602087bcfc73 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Wed, 24 Feb 2021 11:01:02 -0500 Subject: [PATCH 7/9] Add palette selection constants --- include/palette.h | 4 ++ src/battle_controller_player.c | 8 +-- src/battle_controller_safari.c | 2 +- src/battle_controller_wally.c | 2 +- src/battle_dome.c | 16 +++--- src/battle_factory_screen.c | 12 ++--- src/battle_main.c | 12 ++--- src/battle_pike.c | 4 +- src/battle_pyramid_bag.c | 6 +-- src/battle_records.c | 4 +- src/battle_script_commands.c | 6 +-- src/battle_transition.c | 40 +++++++------- src/battle_transition_frontier.c | 2 +- src/berry_blender.c | 10 ++-- src/berry_crush.c | 16 +++--- src/berry_tag_screen.c | 6 +-- src/cable_car.c | 6 +-- src/clear_save_data_screen.c | 4 +- src/contest.c | 4 +- src/contest_painting.c | 2 +- src/contest_util.c | 10 ++-- src/credits.c | 20 +++---- src/diploma.c | 4 +- src/dodrio_berry_picking.c | 12 ++--- src/easy_chat.c | 8 +-- src/egg_hatch.c | 8 +-- src/evolution_scene.c | 16 +++--- src/field_effect.c | 4 +- src/field_region_map.c | 4 +- src/field_weather.c | 4 +- src/fldeff_misc.c | 4 +- src/frontier_pass.c | 18 +++---- src/hall_of_fame.c | 8 +-- src/hof_pc.c | 2 +- src/intro.c | 32 +++++------ src/item_menu.c | 6 +-- src/link.c | 2 +- src/mail.c | 4 +- src/main_menu.c | 26 ++++----- src/mevent_801BAAC.c | 16 +++--- src/move_relearner.c | 12 ++--- src/mystery_event_menu.c | 4 +- src/naming_screen.c | 6 +-- src/option_menu.c | 4 +- src/party_menu.c | 8 +-- src/pokeblock.c | 6 +-- src/pokeblock_feed.c | 6 +-- src/pokedex.c | 50 ++++++++--------- src/pokedex_area_screen.c | 4 +- src/pokemon_jump.c | 6 +-- src/pokemon_storage_system.c | 12 ++--- src/pokemon_summary_screen.c | 6 +-- src/pokenav_main_menu.c | 8 +-- src/rayquaza_scene.c | 46 ++++++++-------- src/recorded_battle.c | 2 +- src/region_map.c | 6 +-- src/reset_rtc_screen.c | 4 +- src/roulette.c | 2 +- src/save_failed_screen.c | 4 +- src/shop.c | 6 +-- src/slot_machine.c | 14 ++--- src/start_menu.c | 4 +- src/starter_choose.c | 2 +- src/title_screen.c | 10 ++-- src/trade.c | 62 +++++++++++----------- src/trainer_card.c | 12 ++--- src/union_room.c | 4 +- src/union_room_battle.c | 4 +- src/union_room_chat.c | 6 +-- src/use_pokeblock.c | 10 ++-- src/wallclock.c | 6 +-- src/wireless_communication_status_screen.c | 4 +- 72 files changed, 359 insertions(+), 355 deletions(-) diff --git a/include/palette.h b/include/palette.h index f874bcd74..072edef56 100644 --- a/include/palette.h +++ b/include/palette.h @@ -14,6 +14,10 @@ #define PALETTE_FADE_STATUS_DONE 0 #define PALETTE_FADE_STATUS_LOADING 0xFF +#define PALETTES_BG 0x0000FFFF +#define PALETTES_OBJECTS 0xFFFF0000 +#define PALETTES_ALL (PALETTES_BG | PALETTES_OBJECTS) + enum { FAST_FADE_IN_FROM_WHITE, diff --git a/src/battle_controller_player.c b/src/battle_controller_player.c index 2717e4a28..7b5e55adb 100644 --- a/src/battle_controller_player.c +++ b/src/battle_controller_player.c @@ -2434,7 +2434,7 @@ static void PlayerHandleFaintAnimation(void) static void PlayerHandlePaletteFade(void) { - BeginNormalPaletteFade(0xFFFFFFFF, 2, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 2, 0, 16, RGB_BLACK); PlayerBufferExecCompleted(); } @@ -2655,7 +2655,7 @@ static void PlayerHandleChooseItem(void) { s32 i; - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK); gBattlerControllerFuncs[gActiveBattler] = OpenBagAndChooseItem; gBattlerInMenuId = gActiveBattler; @@ -2682,7 +2682,7 @@ static void PlayerHandleChoosePokemon(void) *(&gBattleStruct->battlerPreventingSwitchout) = gBattleBufferA[gActiveBattler][1] >> 4; *(&gBattleStruct->prevSelectedPartySlot) = gBattleBufferA[gActiveBattler][2]; *(&gBattleStruct->abilityPreventingSwitchout) = gBattleBufferA[gActiveBattler][3]; - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK); gBattlerControllerFuncs[gActiveBattler] = OpenPartyMenuToChooseMon; gBattlerInMenuId = gActiveBattler; } @@ -2691,7 +2691,7 @@ static void PlayerHandleChoosePokemon(void) static void PlayerHandleCmd23(void) { BattleStopLowHpSound(); - BeginNormalPaletteFade(0xFFFFFFFF, 2, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 2, 0, 16, RGB_BLACK); PlayerBufferExecCompleted(); } diff --git a/src/battle_controller_safari.c b/src/battle_controller_safari.c index 1c82cfbe3..22c01586d 100644 --- a/src/battle_controller_safari.c +++ b/src/battle_controller_safari.c @@ -474,7 +474,7 @@ static void SafariHandleChooseMove(void) static void SafariHandleChooseItem(void) { - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK); gBattlerControllerFuncs[gActiveBattler] = SafariOpenPokeblockCase; gBattlerInMenuId = gActiveBattler; } diff --git a/src/battle_controller_wally.c b/src/battle_controller_wally.c index ade2bc32c..8b3863c85 100644 --- a/src/battle_controller_wally.c +++ b/src/battle_controller_wally.c @@ -1250,7 +1250,7 @@ static void WallyHandleChooseMove(void) static void WallyHandleChooseItem(void) { - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK); gBattlerControllerFuncs[gActiveBattler] = OpenBagAfterPaletteFade; gBattlerInMenuId = gActiveBattler; } diff --git a/src/battle_dome.c b/src/battle_dome.c index 0b6281a91..3b22e2926 100644 --- a/src/battle_dome.c +++ b/src/battle_dome.c @@ -3393,7 +3393,7 @@ static void Task_HandleInfoCardInput(u8 taskId) case STATE_FADE_IN: if (!gPaletteFade.active) { - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK); gTasks[taskId].tState = STATE_WAIT_FADE; } break; @@ -3406,7 +3406,7 @@ static void Task_HandleInfoCardInput(u8 taskId) switch (i) { case INFOCARD_INPUT_AB: - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK); gTasks[taskId].tState = STATE_CLOSE_CARD; break; case TRAINERCARD_INPUT_UP ... TRAINERCARD_INPUT_RIGHT: @@ -4946,7 +4946,7 @@ static void Task_HandleTourneyTreeInput(u8 taskId) case STATE_FADE_IN: if (!gPaletteFade.active) { - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK); gTasks[taskId].tState = STATE_WAIT_FADE; StartSpriteAnim(&gSprites[spriteId], 1); } @@ -4960,17 +4960,17 @@ static void Task_HandleTourneyTreeInput(u8 taskId) { case TOURNEY_TREE_SELECTED_CLOSE: default: - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK); gTasks[taskId].tState = STATE_CLOSE_TOURNEY_TREE; break; case TOURNEY_TREE_NO_SELECTION: break; case TOURNEY_TREE_SELECTED_TRAINER: - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK); gTasks[taskId].tState = STATE_SHOW_INFOCARD_TRAINER; break; case TOURNEY_TREE_SELECTED_MATCH: - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK); gTasks[taskId].tState = STATE_SHOW_INFOCARD_MATCH; break; } @@ -5509,7 +5509,7 @@ static void Task_HandleStaticTourneyTreeInput(u8 taskId) switch (gTasks[taskId].tState) { case STATE_FADE_IN: - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK); gTasks[taskId].tState = STATE_SHOW_RESULTS; break; case STATE_SHOW_RESULTS: @@ -5559,7 +5559,7 @@ static void Task_HandleStaticTourneyTreeInput(u8 taskId) case STATE_WAIT_FOR_INPUT: if (JOY_NEW(A_BUTTON | B_BUTTON)) { - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK); gTasks[taskId].tState = STATE_CLOSE_TOURNEY_TREE; } break; diff --git a/src/battle_factory_screen.c b/src/battle_factory_screen.c index 86e3b0233..8c056da1b 100644 --- a/src/battle_factory_screen.c +++ b/src/battle_factory_screen.c @@ -1203,7 +1203,7 @@ static void CB2_InitSelectScreen(void) ShowBg(0); ShowBg(1); SetVBlankCallback(VBlankCB_SelectScreen); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK); SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_OBJ_ON | DISPCNT_BG0_ON | DISPCNT_BG1_ON | DISPCNT_OBJ_1D_MAP); #ifdef UBFIX if (sFactorySelectScreen && sFactorySelectScreen->fromSummaryScreen) @@ -1451,7 +1451,7 @@ static void Select_Task_OpenSummaryScreen(u8 taskId) { case STATE_SUMMARY_FADE: gPlttBufferUnfaded[228] = gPlttBufferFaded[228]; - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); gTasks[taskId].tState = STATE_SUMMARY_CLEAN; break; case STATE_SUMMARY_CLEAN: @@ -1489,7 +1489,7 @@ static void Select_Task_Exit(u8 taskId) switch (gTasks[taskId].tState) { case 0: - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); gTasks[taskId].tState++; break; case 1: @@ -2369,7 +2369,7 @@ static void Swap_Task_OpenSummaryScreen(u8 taskId) switch (gTasks[taskId].tState) { case STATE_SUMMARY_FADE: - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); gTasks[taskId].tState = STATE_SUMMARY_CLEAN; break; case STATE_SUMMARY_CLEAN: @@ -2425,7 +2425,7 @@ static void Swap_Task_Exit(u8 taskId) gTasks[taskId].tState++; break; case 2: - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); gTasks[taskId].tState++; break; case 3: @@ -3381,7 +3381,7 @@ static void CB2_InitSwapScreen(void) gMain.state++; break; case 14: - BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK); SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_OBJ_ON | DISPCNT_OBJ_1D_MAP); ShowBg(0); ShowBg(1); diff --git a/src/battle_main.c b/src/battle_main.c index dd056243b..75e74fe54 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -1841,7 +1841,7 @@ void BattleMainCB2(void) { gSpecialVar_Result = gBattleOutcome = B_OUTCOME_PLAYER_TELEPORTED; ResetPaletteFadeControl(); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK); SetMainCallback2(CB2_QuitRecordedBattle); } } @@ -2242,7 +2242,7 @@ static void EndLinkBattleInSteps(void) case 1: if (--gBattleCommunication[1] == 0) { - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK); gBattleCommunication[MULTIUSE_STATE]++; } break; @@ -2299,7 +2299,7 @@ static void EndLinkBattleInSteps(void) for (i = 0; i < 2; i++) LoadChosenBattleElement(i); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK); gBattleCommunication[MULTIUSE_STATE]++; break; case 4: @@ -2404,7 +2404,7 @@ static void sub_80392A8(void) gReservedSpritePaletteCount = 4; SetVBlankCallback(VBlankCB_Battle); SetMainCallback2(sub_803937C); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK); gBattleCommunication[MULTIUSE_STATE] = 0; } @@ -2564,7 +2564,7 @@ static void sub_803939C(void) { if (IsLinkTaskFinished() == TRUE) { - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK); gBattleCommunication[1] = 0x20; gBattleCommunication[MULTIUSE_STATE] = 8; } @@ -2572,7 +2572,7 @@ static void sub_803939C(void) } else { - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK); gBattleCommunication[1] = 0x20; gBattleCommunication[MULTIUSE_STATE] = 8; } diff --git a/src/battle_pike.c b/src/battle_pike.c index 0a54cf226..ccb52fda2 100644 --- a/src/battle_pike.c +++ b/src/battle_pike.c @@ -1184,7 +1184,7 @@ static bool8 StatusInflictionFadeOut(struct Task *task) task->data[7] += task->data[4]; if (task->data[7] > 16) task->data[7] = 16; - BlendPalettes(0xFFFFFFFF, task->data[7], RGB(11, 11, 11)); + BlendPalettes(PALETTES_ALL, task->data[7], RGB(11, 11, 11)); } if (task->data[7] >= 16) @@ -1203,7 +1203,7 @@ static bool8 StatusInflictionFadeIn(struct Task *task) task->data[7] -= task->data[5]; if (task->data[7] < 0) task->data[7] = 0; - BlendPalettes(0xFFFFFFFF, task->data[7], RGB(11, 11, 11)); + BlendPalettes(PALETTES_ALL, task->data[7], RGB(11, 11, 11)); } if (task->data[7] == 0) diff --git a/src/battle_pyramid_bag.c b/src/battle_pyramid_bag.c index c112cfaad..f39bbf522 100644 --- a/src/battle_pyramid_bag.c +++ b/src/battle_pyramid_bag.c @@ -493,11 +493,11 @@ static bool8 sub_81C5078(void) gMain.state++; break; case 15: - BlendPalettes(0xFFFFFFFF, 0x10, 0); + BlendPalettes(PALETTES_ALL, 0x10, 0); gMain.state++; break; case 16: - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK); gPaletteFade.bufferTransferDisabled = FALSE; gMain.state++; break; @@ -811,7 +811,7 @@ static void sub_81C5AB8(u8 y, u8 arg1) void CloseBattlePyramidBagAndSetCallback(u8 taskId) { - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK); gTasks[taskId].func = sub_81C5B4C; } diff --git a/src/battle_records.c b/src/battle_records.c index a8b9ead14..5dff8e6d3 100644 --- a/src/battle_records.c +++ b/src/battle_records.c @@ -365,7 +365,7 @@ static void Task_CloseTrainerHillRecordsOnButton(u8 taskId) static void Task_BeginPaletteFade(u8 taskId) { - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK); gTasks[taskId].func = Task_ExitTrainerHillRecords; } @@ -512,7 +512,7 @@ static void CB2_ShowTrainerHillRecords(void) gMain.state++; break; case 6: - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK); gMain.state++; break; case 7: diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 6df240d65..43c554e88 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -5374,7 +5374,7 @@ static void Cmd_yesnoboxlearnmove(void) if (gBattleCommunication[1] == 0) { HandleBattleWindow(0x18, 0x8, 0x1D, 0xD, WINDOW_CLEAR); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK); gBattleScripting.learnMoveState++; } else @@ -9942,7 +9942,7 @@ static void Cmd_displaydexinfo(void) switch (gBattleCommunication[0]) { case 0: - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK); gBattleCommunication[0]++; break; case 1: @@ -9973,7 +9973,7 @@ static void Cmd_displaydexinfo(void) case 4: if (!IsDma3ManagerBusyWithBgCopy()) { - BeginNormalPaletteFade(0xFFFF, 0, 0x10, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_BG, 0, 0x10, 0, RGB_BLACK); ShowBg(0); ShowBg(3); gBattleCommunication[0]++; diff --git a/src/battle_transition.c b/src/battle_transition.c index d9436edf0..66a4395b9 100644 --- a/src/battle_transition.c +++ b/src/battle_transition.c @@ -1071,7 +1071,7 @@ static bool8 Phase2_Blur_Func2(struct Task *task) { task->tData1 = 4; if (++task->tData2 == 10) - BeginNormalPaletteFade(0xFFFFFFFF, -1, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, -1, 0, 0x10, RGB_BLACK); SetGpuReg(REG_OFFSET_MOSAIC, (task->tData2 & 15) * 17); if (task->tData2 > 14) task->tState++; @@ -1098,7 +1098,7 @@ static bool8 Phase2_Swirl_Func1(struct Task *task) { InitTransitionStructVars(); ScanlineEffect_Clear(); - BeginNormalPaletteFade(0xFFFFFFFF, 4, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 4, 0, 0x10, RGB_BLACK); sub_8149F98(gScanlineEffectRegBuffers[1], sTransitionStructPtr->field_14, 0, 2, 0, 160); SetVBlankCallback(VBlankCB_Phase2_Swirl); @@ -1153,7 +1153,7 @@ static bool8 Phase2_Shuffle_Func1(struct Task *task) InitTransitionStructVars(); ScanlineEffect_Clear(); - BeginNormalPaletteFade(0xFFFFFFFF, 4, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 4, 0, 0x10, RGB_BLACK); memset(gScanlineEffectRegBuffers[1], sTransitionStructPtr->field_16, 0x140); SetVBlankCallback(VBlankCB_Phase2_Shuffle); @@ -1456,7 +1456,7 @@ static bool8 Phase2_Kyogre_Func5(struct Task *task) static bool8 Phase2_WeatherDuo_Func6(struct Task *task) { - BeginNormalPaletteFade(0xFFFF8000, 1, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_OBJECTS | 0x8000, 1, 0, 0x10, RGB_BLACK); task->tState++; return FALSE; } @@ -1541,7 +1541,7 @@ static bool8 Phase2_FramesCountdown(struct Task *task) static bool8 Phase2_WeatherTrio_Func1(struct Task *task) { - BeginNormalPaletteFade(0x0000FFFF, 1, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_BG, 1, 0, 0x10, RGB_BLACK); task->tState++; return FALSE; } @@ -1962,7 +1962,7 @@ static bool8 Phase2_Ripple_Func2(struct Task *task) if (++task->tData3 == 81) { task->tData4++; - BeginNormalPaletteFade(0xFFFFFFFF, -2, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, -2, 0, 0x10, RGB_BLACK); } if (task->tData4 != 0 && !gPaletteFade.active) @@ -2308,7 +2308,7 @@ static bool8 Phase2_Mugshot_Func7(struct Task *task) static bool8 Phase2_Mugshot_Func8(struct Task *task) { sTransitionStructPtr->VBlank_DMA = FALSE; - BlendPalettes(0xFFFFFFFF, 0x10, RGB_WHITE); + BlendPalettes(PALETTES_ALL, 0x10, RGB_WHITE); sTransitionStructPtr->BLDCNT = 0xFF; task->tData3 = 0; @@ -3168,7 +3168,7 @@ static bool8 Phase2_Rayquaza_Func6(struct Task *task) { task->tState++; task->tData1 = 0; - BeginNormalPaletteFade(0xFFFF8000, 2, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_OBJECTS | 0x8000, 2, 0, 0x10, RGB_BLACK); } return FALSE; @@ -3187,8 +3187,8 @@ static bool8 Phase2_Rayquaza_Func7(struct Task *task) static bool8 Phase2_Rayquaza_Func8(struct Task *task) { - BlendPalettes(0x00007FFF, 8, 0); - BlendPalettes(0xFFFF8000, 0, 0); + BlendPalettes(PALETTES_BG & ~(0x8000), 8, 0); + BlendPalettes(PALETTES_OBJECTS | 0x8000, 0, 0); task->tState++; return FALSE; @@ -3300,7 +3300,7 @@ static bool8 Phase2_WhiteFade_Func3(struct Task *task) sTransitionStructPtr->VBlank_DMA = 0; if (sTransitionStructPtr->field_20 > 7) { - BlendPalettes(-1, 0x10, 0x7FFF); + BlendPalettes(PALETTES_ALL, 0x10, 0x7FFF); task->tState++; } return FALSE; @@ -3631,7 +3631,7 @@ static bool8 Phase1_TransitionAll_Func1(struct Task *task) task->tData7 += task->tData4; if (task->tData7 > 16) task->tData7 = 16; - BlendPalettes(-1, task->tData7, 0x2D6B); + BlendPalettes(PALETTES_ALL, task->tData7, 0x2D6B); } if (task->tData7 > 15) { @@ -3649,7 +3649,7 @@ static bool8 Phase1_TransitionAll_Func2(struct Task *task) task->tData7 -= task->tData5; if (task->tData7 < 0) task->tData7 = 0; - BlendPalettes(-1, task->tData7, 0x2D6B); + BlendPalettes(PALETTES_ALL, task->tData7, 0x2D6B); } if (task->tData7 == 0) { @@ -3706,7 +3706,7 @@ void GetBg0TilesDst(u16 **tilemap, u16 **tileset) static void FadeScreenBlack(void) { - BlendPalettes(0xFFFFFFFF, 16, RGB_BLACK); + BlendPalettes(PALETTES_ALL, 16, RGB_BLACK); } static void sub_8149F98(s16 *array, s16 sinAdd, s16 index, s16 indexIncrementer, s16 amplitude, s16 arrSize) @@ -3977,7 +3977,7 @@ static bool8 Phase2_FrontierLogoWave_Func4(struct Task *task) if (++task->tData3 == 101) { task->tData4++; - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK); } if (task->tData4 != 0 && !gPaletteFade.active) @@ -4077,7 +4077,7 @@ static bool8 Phase2_FrontierSquares_Func3(struct Task *task) } break; case 1: - BlendPalettes(0xFFFF7FFF, 0x10, 0); + BlendPalettes(PALETTES_ALL & ~(0x8000), 0x10, 0); LZ77UnCompVram(sFrontierSquares_EmptyBg_Tileset, tileset); break; case 2: @@ -4138,7 +4138,7 @@ static bool8 Phase2_FrontierSquaresSpiral_Func2(struct Task *task) static bool8 Phase2_FrontierSquaresSpiral_Func3(struct Task *task) { BlendPalette(0xE0, 0x10, 3, 0); - BlendPalettes(0xFFFF3FFF, 0x10, 0); + BlendPalettes(PALETTES_ALL & ~(0x8000 | 0x4000), 0x10, 0); task->tData2 = 0; task->tData3 = 0; @@ -4194,7 +4194,7 @@ static bool8 Phase2_FrontierSquares_End(struct Task *task) { FillBgTilemapBufferRect_Palette0(0, 1, 0, 0, 0x20, 0x20); CopyBgTilemapBufferToVram(0); - BlendPalettes(0xFFFFFFFF, 0x10, 0); + BlendPalettes(PALETTES_ALL, 0x10, 0); DestroyTask(FindTaskIdByFunc(task->func)); return FALSE; } @@ -4286,7 +4286,7 @@ static bool8 Phase2_FrontierSquaresScroll_Func2(struct Task *task) static bool8 Phase2_FrontierSquaresScroll_Func3(struct Task *task) { - BlendPalettes(0xFFFF7FFF, 0x10, 0); + BlendPalettes(PALETTES_ALL & ~(0x8000), 0x10, 0); task->tData2 = 0; @@ -4325,7 +4325,7 @@ static bool8 Phase2_FrontierSquaresScroll_Func5(struct Task *task) FillBgTilemapBufferRect_Palette0(0, 1, 0, 0, 0x20, 0x20); CopyBgTilemapBufferToVram(0); - BlendPalettes(0xFFFFFFFF, 0x10, 0); + BlendPalettes(PALETTES_ALL, 0x10, 0); DestroyTask(FindTaskIdByFunc(task->func)); task->tState++; // UB: changing value of a destroyed task diff --git a/src/battle_transition_frontier.c b/src/battle_transition_frontier.c index 931de5e44..cb3519c4e 100644 --- a/src/battle_transition_frontier.c +++ b/src/battle_transition_frontier.c @@ -373,7 +373,7 @@ static bool8 FadeInCenterLogoCircle(struct Task *task) { if (task->data[3] == 31) { - BeginNormalPaletteFade(0xFFFFFFFF, -1, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, -1, 0, 0x10, RGB_BLACK); task->tState++; } else diff --git a/src/berry_blender.c b/src/berry_blender.c index 252407562..ede1f6e99 100644 --- a/src/berry_blender.c +++ b/src/berry_blender.c @@ -1097,7 +1097,7 @@ static void CB2_LoadBerryBlender(void) } break; case 2: - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK); UpdateBlenderCenter(); sBerryBlender->mainState++; break; @@ -1111,7 +1111,7 @@ static void CB2_LoadBerryBlender(void) sBerryBlender->mainState++; break; case 5: - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK); sBerryBlender->mainState++; break; case 6: @@ -1326,7 +1326,7 @@ static void CB2_StartBlenderLink(void) sBerryBlender->mainState++; break; case 3: - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK); sBerryBlender->mainState++; break; case 4: @@ -1664,7 +1664,7 @@ static void CB2_StartBlenderLocal(void) sBerryBlender->mainState++; break; case 3: - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK); sBerryBlender->mainState++; sBerryBlender->framesToWait = 0; break; @@ -2895,7 +2895,7 @@ static void CB2_CheckPlayAgainLink(void) case 9: if (IsLinkTaskFinished()) { - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK); sBerryBlender->gameEndState++; } break; diff --git a/src/berry_crush.c b/src/berry_crush.c index 84e2e2eba..b11af5529 100755 --- a/src/berry_crush.c +++ b/src/berry_crush.c @@ -1089,7 +1089,7 @@ s32 InitBerryCrushDisplay(void) break; case 9: gPaletteFade.bufferTransferDisabled = FALSE; - BlendPalettes(0xFFFFFFFF, 16, RGB_BLACK); + BlendPalettes(PALETTES_ALL, 16, RGB_BLACK); ShowBg(0); ShowBg(1); ShowBg(2); @@ -1121,7 +1121,7 @@ int sub_802130C(void) // fall through. The original author forgot to use "break" here // because this will call BeginNormalPaletteFade() twice. case 2: - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); UpdatePaletteFade(); break; case 3: @@ -2635,13 +2635,13 @@ static u32 sub_8023A30(struct BerryCrushGame *r4, __attribute__((unused)) u8 *r1 case 0: r4->unk12 = 8; PlaySE(SE_M_STRENGTH); - BlendPalettes(0xFFFFFFFF, 8, RGB(31, 31, 0)); + BlendPalettes(PALETTES_ALL, 8, RGB(31, 31, 0)); r4->unk138.unk0 = 2; break; case 1: if (--r4->unk138.unk0 != 255) return 0; - BlendPalettes(0xFFFFFFFF, 0, RGB(31, 31, 0)); + BlendPalettes(PALETTES_ALL, 0, RGB(31, 31, 0)); r4->unk138.unk1 = 4; r4->unk138.unk0 = 0; r4->unk138.unk2 = gUnknown_082F326C[r4->unk138.unk1][0]; @@ -2692,13 +2692,13 @@ static u32 sub_8023BC0(struct BerryCrushGame *r5, u8 *r6) case 0: r5->unk12 = 9; PlaySE(SE_FAILURE); - BlendPalettes(0xFFFFFFFF, 8, RGB(31, 0, 0)); + BlendPalettes(PALETTES_ALL, 8, RGB(31, 0, 0)); r5->unk138.unk0 = 4; break; case 1: if (--r5->unk138.unk0 != 255) return 0; - BlendPalettes(0xFFFFFFFF, 0, RGB(31, 0, 0)); + BlendPalettes(PALETTES_ALL, 0, RGB(31, 0, 0)); r5->unk138.unk0 = 0; break; case 2: @@ -3057,7 +3057,7 @@ static u32 sub_80243BC(struct BerryCrushGame *r5, __attribute__((unused)) u8 *r1 switch (r5->unkC) { case 0: - BeginNormalPaletteFade(0xFFFFFFFF, 1, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 1, 0, 0x10, RGB_BLACK); UpdatePaletteFade(); break; case 1: @@ -3067,7 +3067,7 @@ static u32 sub_80243BC(struct BerryCrushGame *r5, __attribute__((unused)) u8 *r1 case 2: ClearDialogWindowAndFrame(0, 1); sub_8021488(r5); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK); UpdatePaletteFade(); break; case 3: diff --git a/src/berry_tag_screen.c b/src/berry_tag_screen.c index 5be149b0f..27efb7e7a 100644 --- a/src/berry_tag_screen.c +++ b/src/berry_tag_screen.c @@ -276,11 +276,11 @@ static bool8 InitBerryTagScreen(void) gMain.state++; break; case 14: - BlendPalettes(-1, 0x10, 0); + BlendPalettes(PALETTES_ALL, 0x10, 0); gMain.state++; break; case 15: - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK); gPaletteFade.bufferTransferDisabled = 0; gMain.state++; break; @@ -514,7 +514,7 @@ static void DestroyFlavorCircleSprites(void) static void PrepareToCloseBerryTagScreen(u8 taskId) { PlaySE(SE_SELECT); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK); gTasks[taskId].func = Task_CloseBerryTagScreen; } diff --git a/src/cable_car.c b/src/cable_car.c index acd0bc7a5..56118161b 100644 --- a/src/cable_car.c +++ b/src/cable_car.c @@ -246,7 +246,7 @@ void CableCar(void) { ScriptContext2_Enable(); CreateTask(Task_LoadCableCar, 1); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB(0, 0, 0)); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB(0, 0, 0)); } static void CB2_LoadCableCar(void) @@ -350,7 +350,7 @@ static void CB2_LoadCableCar(void) gMain.state++; break; case 8: - BeginNormalPaletteFade(0xFFFFFFFF, 3, 16, 0, RGB(0, 0, 0)); + BeginNormalPaletteFade(PALETTES_ALL, 3, 16, 0, RGB(0, 0, 0)); FadeInNewBGM(MUS_CABLE_CAR, 1); SetBgRegs(TRUE); gMain.state++; @@ -468,7 +468,7 @@ static void Task_CableCar(u8 taskId) if (sCableCar->timer == 570) { sCableCar->state = 3; - BeginNormalPaletteFade(0xFFFFFFFF, 3, 0, 16, RGB(0, 0, 0)); + BeginNormalPaletteFade(PALETTES_ALL, 3, 0, 16, RGB(0, 0, 0)); FadeOutBGM(4); } break; diff --git a/src/clear_save_data_screen.c b/src/clear_save_data_screen.c index b91506352..0d69eb0fa 100644 --- a/src/clear_save_data_screen.c +++ b/src/clear_save_data_screen.c @@ -163,7 +163,7 @@ static bool8 SetupClearSaveDataScreen(void) ShowBg(3); SetGpuReg(REG_OFFSET_BLDCNT, 0); InitClearSaveDataScreenWindows(); - BeginNormalPaletteFade(0x0000FFFF, 0, 0x10, 0, RGB_WHITEALPHA); + BeginNormalPaletteFade(PALETTES_BG, 0, 0x10, 0, RGB_WHITEALPHA); EnableInterrupts(INTR_FLAG_VBLANK); SetVBlankCallback(VBlankCB); gMain.state = 1; @@ -185,7 +185,7 @@ static void CB2_FadeAndDoReset(void) { case 0: default: - BeginNormalPaletteFade(0x0000FFFF, 0, 0, 0x10, RGB_WHITEALPHA); + BeginNormalPaletteFade(PALETTES_BG, 0, 0, 0x10, RGB_WHITEALPHA); gMain.state = 1; break; case 1: diff --git a/src/contest.c b/src/contest.c index 8d8bd666c..f5326663f 100644 --- a/src/contest.c +++ b/src/contest.c @@ -2711,7 +2711,7 @@ static void Task_TryCommunicateFinalStandings(u8 taskId) } else { - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); gTasks[taskId].func = Task_ContestReturnToField; } } @@ -2730,7 +2730,7 @@ static void Task_CommunicateFinalStandings(u8 taskId) static void Task_EndCommunicateFinalStandings(u8 taskId) { DestroyTask(taskId); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); gTasks[eContest.mainTaskId].func = Task_ContestReturnToField; } diff --git a/src/contest_painting.c b/src/contest_painting.c index fecca1226..12e08a4cc 100644 --- a/src/contest_painting.c +++ b/src/contest_painting.c @@ -250,7 +250,7 @@ static void HoldContestPainting(void) if ((JOY_NEW(A_BUTTON)) || (JOY_NEW(B_BUTTON))) { gContestPaintingState++; - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB(0, 0, 0)); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB(0, 0, 0)); } if (gUnknown_030011F6) diff --git a/src/contest_util.c b/src/contest_util.c index 176360bc3..e5fd51db1 100644 --- a/src/contest_util.c +++ b/src/contest_util.c @@ -517,7 +517,7 @@ static void CB2_StartShowContestResults(void) memset(sContestResults->monResults, 0, sizeof(*sContestResults->monResults)); LoadContestResultSprites(); TryCreateWirelessSprites(); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK); gPaletteFade.bufferTransferDisabled = FALSE; sContestResults->data->showResultsTaskId = CreateTask(Task_ShowContestResults, 5); SetMainCallback2(CB2_ShowContestResults); @@ -1018,12 +1018,12 @@ static void Task_EndShowContestResults(u8 taskId) if (gTasks[taskId].tTimer == 0) { DestroyTask(sContestResults->data->highlightWinnerTaskId); - BlendPalettes(0x0000FFFF, 16, RGB_BLACK); + BlendPalettes(PALETTES_BG, 16, RGB_BLACK); gTasks[taskId].tTimer++; } else if (gTasks[taskId].tTimer == 1) { - BlendPalettes(0xFFFF0000, 16, RGB_BLACK); + BlendPalettes(PALETTES_OBJECTS, 16, RGB_BLACK); gTasks[taskId].tTimer++; } else @@ -2102,7 +2102,7 @@ void StartContest(void) { ScriptContext2_Enable(); CreateTask(Task_StartContest, 10); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); } void BufferContestantMonSpecies(void) @@ -2123,7 +2123,7 @@ void ShowContestResults(void) { ScriptContext2_Enable(); CreateTask(Task_StartShowContestResults, 10); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); } void GetContestPlayerId(void) diff --git a/src/credits.c b/src/credits.c index a9beb319c..84b802005 100644 --- a/src/credits.c +++ b/src/credits.c @@ -1235,7 +1235,7 @@ void CB2_StartCreditsSequence(void) gTasks[taskIdB].data[TDB_TASK_A_ID] = taskIdA; gTasks[taskIdA].data[TDA_TASK_B_ID] = taskIdB; - BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK); EnableInterrupts(INTR_FLAG_VBLANK); SetVBlankCallback(CreditsVBlankCallback); m4aSongNumStart(MUS_CREDITS); @@ -1281,14 +1281,14 @@ static void Task_ProgressCreditTasks(u8 taskIdA) { gTasks[taskIdA].data[TDA_13] = data1; gTasks[taskIdA].data[TDA_11] = 0; - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); gTasks[taskIdA].func = sub_8175808; } else if (gTasks[taskIdA].data[TDA_11] == 2) { gTasks[taskIdA].data[TDA_13] = data1; gTasks[taskIdA].data[TDA_11] = 0; - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); gTasks[taskIdA].func = sub_81758A4; } } @@ -1309,7 +1309,7 @@ static void c2_080C9BFC(u8 taskIdA) if (sub_8176AB0(gTasks[taskIdA].data[TDA_7], taskIdA)) { - BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK); EnableInterrupts(INTR_FLAG_VBLANK); SetVBlankCallback(CreditsVBlankCallback); gTasks[taskIdA].func = Task_WaitPaletteFade; @@ -1369,7 +1369,7 @@ static void Task_CreditsLoadGrassScene(u8 taskIdA) gTasks[gTasks[taskIdA].data[TDA_TASK_D_ID]].data[TDD_TASK_A_ID] = taskIdA; gTasks[gTasks[taskIdA].data[TDA_TASK_D_ID]].data[TDD_2] = gTasks[taskIdA].data[TDA_7]; - BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK); SetGpuReg(REG_OFFSET_BG3HOFS, 0); SetGpuReg(REG_OFFSET_BG3VOFS, 32); SetGpuReg(REG_OFFSET_BG3CNT, BGCNT_PRIORITY(3) @@ -1398,7 +1398,7 @@ static void Task_CreditsTheEnd1(u8 taskIdA) return; } - BeginNormalPaletteFade(0xFFFFFFFF, 12, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 12, 0, 16, RGB_BLACK); gTasks[taskIdA].func = Task_CreditsTheEnd2; } @@ -1418,7 +1418,7 @@ static void Task_CreditsTheEnd3(u8 taskIdA) LoadTheEndScreen(0, 0x3800, 0); ResetSpriteData(); FreeAllSpritePalettes(); - BeginNormalPaletteFade(0xFFFFFFFF, 8, 16, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 8, 16, 0, RGB_BLACK); SetGpuReg(REG_OFFSET_BG0CNT, BGCNT_PRIORITY(0) | BGCNT_CHARBASE(0) @@ -1442,7 +1442,7 @@ static void Task_CreditsTheEnd4(u8 taskIdA) return; } - BeginNormalPaletteFade(0xFFFFFFFF, 6, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 6, 0, 16, RGB_BLACK); gTasks[taskIdA].func = Task_CreditsTheEnd5; } @@ -1452,7 +1452,7 @@ static void Task_CreditsTheEnd5(u8 taskIdA) { sub_8176E40(0x3800, 0); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0, RGB_BLACK); gTasks[taskIdA].data[TDA_0] = 7200; gTasks[taskIdA].func = Task_CreditsTheEnd6; } @@ -1465,7 +1465,7 @@ static void Task_CreditsTheEnd6(u8 taskIdA) if (gTasks[taskIdA].data[TDA_0] == 0 || gMain.newKeys) { FadeOutBGM(4); - BeginNormalPaletteFade(0xFFFFFFFF, 8, 0, 16, RGB_WHITEALPHA); + BeginNormalPaletteFade(PALETTES_ALL, 8, 0, 16, RGB_WHITEALPHA); gTasks[taskIdA].func = Task_CreditsSoftReset; return; } diff --git a/src/diploma.c b/src/diploma.c index 8f04bb9ad..bf0d5b057 100644 --- a/src/diploma.c +++ b/src/diploma.c @@ -84,7 +84,7 @@ void CB2_ShowDiploma(void) CopyBgTilemapBufferToVram(1); DisplayDiplomaText(); BlendPalettes(-1, 16, 0); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK); EnableInterrupts(1); SetVBlankCallback(VBlankCB); SetMainCallback2(MainCB2); @@ -109,7 +109,7 @@ static void Task_DiplomaWaitForKeyPress(u8 taskId) { if (JOY_NEW(A_BUTTON | B_BUTTON)) { - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); gTasks[taskId].func = Task_DiplomaFadeOut; } } diff --git a/src/dodrio_berry_picking.c b/src/dodrio_berry_picking.c index 66eacc5f9..47839a79a 100644 --- a/src/dodrio_berry_picking.c +++ b/src/dodrio_berry_picking.c @@ -590,8 +590,8 @@ static void sub_8024BC8(u8 taskId) gUnknown_02022C98->unk0C++; break; case 6: - BlendPalettes(0xFFFFFFFF, 0x10, 0x00); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, 0); + BlendPalettes(PALETTES_ALL, 0x10, 0x00); + BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, 0); SetVBlankCallback(sub_80261E4); gUnknown_02022C98->unk0C++; break; @@ -1110,7 +1110,7 @@ static void sub_80256AC(void) switch (gUnknown_02022C98->unk10) { case 0: - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, 0); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, 0); gUnknown_02022C98->unk10++; break; case 1: @@ -1147,7 +1147,7 @@ static void sub_8025758(void) { case 0: sub_80292E0(9); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, 0); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, 0); gUnknown_02022C98->unk10++; break; case 1: @@ -1178,8 +1178,8 @@ static void sub_8025758(void) gUnknown_02022C98->unk10++; break; case 5: - BlendPalettes(0xFFFFFFFF, 16, 0); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, 0); + BlendPalettes(PALETTES_ALL, 16, 0); + BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, 0); gUnknown_02022C98->unk10++; break; case 6: diff --git a/src/easy_chat.c b/src/easy_chat.c index 16b302bb8..a27e1780e 100644 --- a/src/easy_chat.c +++ b/src/easy_chat.c @@ -1330,8 +1330,8 @@ static void Task_EasyChatScreen(u8 taskId) { case MAINSTATE_FADE_IN: SetVBlankCallback(VBlankCB_EasyChatScreen); - BlendPalettes(0xFFFFFFFF, 16, 0); - BeginNormalPaletteFade(0xFFFFFFFF, -1, 16, 0, RGB_BLACK); + BlendPalettes(PALETTES_ALL, 16, 0); + BeginNormalPaletteFade(PALETTES_ALL, -1, 16, 0, RGB_BLACK); tState = MAINSTATE_WAIT_FADE_IN; break; case MAINSTATE_HANDLE_INPUT: @@ -1339,14 +1339,14 @@ static void Task_EasyChatScreen(u8 taskId) if (IsFuncIdForQuizLadyScreen(funcId)) { // Fade to Quiz Lady screen - BeginNormalPaletteFade(0xFFFFFFFF, -2, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, -2, 0, 16, RGB_BLACK); tState = MAINSTATE_TO_QUIZ_LADY; tFuncId = funcId; } else if (funcId == ECFUNC_EXIT) { // Fade and exit Easy Chat - BeginNormalPaletteFade(0xFFFFFFFF, -1, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, -1, 0, 16, RGB_BLACK); tState = MAINSTATE_EXIT; } else if (funcId != ECFUNC_NONE) diff --git a/src/egg_hatch.c b/src/egg_hatch.c index 5b80bfb6c..0ae0e1323 100644 --- a/src/egg_hatch.c +++ b/src/egg_hatch.c @@ -597,7 +597,7 @@ static void CB2_EggHatch_1(void) switch (sEggHatchData->CB2_state) { case 0: - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK); sEggHatchData->eggSpriteID = CreateSprite(&sSpriteTemplate_EggHatch, 120, 75, 5); ShowBg(0); ShowBg(1); @@ -680,7 +680,7 @@ static void CB2_EggHatch_1(void) } break; case 11: - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK); sEggHatchData->CB2_state++; break; case 12: @@ -790,7 +790,7 @@ static void SpriteCB_Egg_4(struct Sprite* sprite) { s16 i; if (sprite->data[0] == 0) - BeginNormalPaletteFade(0xFFFFFFFF, -1, 0, 0x10, RGB_WHITEALPHA); + BeginNormalPaletteFade(PALETTES_ALL, -1, 0, 0x10, RGB_WHITEALPHA); if (sprite->data[0] < 4u) { for (i = 0; i <= 3; i++) @@ -814,7 +814,7 @@ static void SpriteCB_Egg_5(struct Sprite* sprite) StartSpriteAffineAnim(&gSprites[sEggHatchData->pokeSpriteID], 1); } if (sprite->data[0] == 8) - BeginNormalPaletteFade(0xFFFFFFFF, -1, 0x10, 0, RGB_WHITEALPHA); + BeginNormalPaletteFade(PALETTES_ALL, -1, 0x10, 0, RGB_WHITEALPHA); if (sprite->data[0] <= 9) gSprites[sEggHatchData->pokeSpriteID].pos1.y -= 1; if (sprite->data[0] > 40) diff --git a/src/evolution_scene.c b/src/evolution_scene.c index 88f46d295..59316835f 100644 --- a/src/evolution_scene.c +++ b/src/evolution_scene.c @@ -172,7 +172,7 @@ static void Task_BeginEvolutionScene(u8 taskId) switch (gTasks[taskId].tState) { case 0: - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK); gTasks[taskId].tState++; break; case 1: @@ -369,7 +369,7 @@ static void CB2_EvolutionSceneLoadGraphics(void) SetVBlankCallback(VBlankCB_EvolutionScene); SetMainCallback2(CB2_EvolutionSceneUpdate); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK); ShowBg(0); ShowBg(1); @@ -449,11 +449,11 @@ static void CB2_TradeEvolutionSceneLoadGraphics(void) LoadWirelessStatusIndicatorSpriteGfx(); CreateWirelessStatusIndicatorSprite(0, 0); } - BlendPalettes(-1,0x10, 0); + BlendPalettes(PALETTES_ALL, 0x10, 0); gMain.state++; break; case 7: - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK); InitTradeSequenceBgGpuRegs(); ShowBg(0); ShowBg(1); @@ -653,7 +653,7 @@ static void Task_EvolutionScene(u8 taskId) switch (gTasks[taskId].tState) { case EVOSTATE_FADE_IN: - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK); gSprites[sEvoStructPtr->preEvoSpriteId].invisible = FALSE; gTasks[taskId].tState++; ShowBg(0); @@ -802,7 +802,7 @@ static void Task_EvolutionScene(u8 taskId) } else // no move to learn, or evolution was canceled { - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK); gTasks[taskId].tState++; } } @@ -946,7 +946,7 @@ static void Task_EvolutionScene(u8 taskId) // YES gTasks[taskId].tLearnMoveState = gTasks[taskId].tLearnMoveYesState; if (gTasks[taskId].tLearnMoveState == MVSTATE_SHOW_MOVE_SELECT) - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK); } } if (JOY_NEW(B_BUTTON)) @@ -1323,7 +1323,7 @@ static void Task_TradeEvolutionScene(u8 taskId) DrawTextOnTradeWindow(0, gDisplayedStringBattle, 1); gTasks[taskId].tLearnMoveState = gTasks[taskId].tLearnMoveYesState; if (gTasks[taskId].tLearnMoveState == T_MVSTATE_SHOW_MOVE_SELECT) - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK); break; case 1: // NO case MENU_B_PRESSED: diff --git a/src/field_effect.c b/src/field_effect.c index 467a0f656..162a530ca 100644 --- a/src/field_effect.c +++ b/src/field_effect.c @@ -3703,8 +3703,8 @@ static void DestroyDeoxysRockEffect_RockFragments(s16* data, u8 taskId) { struct Sprite *sprite = &gSprites[gObjectEvents[tObjectEventId].spriteId]; gObjectEvents[tObjectEventId].invisible = TRUE; - BlendPalettes(0x0000FFFF, 0x10, RGB_WHITE); - BeginNormalPaletteFade(0x0000FFFF, 0, 0x10, 0, RGB_WHITE); + BlendPalettes(PALETTES_BG, 0x10, RGB_WHITE); + BeginNormalPaletteFade(PALETTES_BG, 0, 0x10, 0, RGB_WHITE); CreateDeoxysRockFragments(sprite); PlaySE(SE_THUNDER); StartEndingDeoxysRockCameraShake(tCameraTaskId); diff --git a/src/field_region_map.c b/src/field_region_map.c index fc6f0fa76..99def4901 100644 --- a/src/field_region_map.c +++ b/src/field_region_map.c @@ -156,7 +156,7 @@ static void FieldUpdateRegionMap(void) ScheduleBgCopyTilemapToVram(0); DrawStdFrameWithCustomTileAndPalette(0, 0, 0x27, 0xd); PrintRegionMapSecName(); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK); sFieldRegionMapHandler->state++; break; case 2: @@ -184,7 +184,7 @@ static void FieldUpdateRegionMap(void) } break; case 5: - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); sFieldRegionMapHandler->state++; break; case 6: diff --git a/src/field_weather.c b/src/field_weather.c index 02e3a0cb0..f60c04e34 100644 --- a/src/field_weather.c +++ b/src/field_weather.c @@ -782,7 +782,7 @@ void FadeScreen(u8 mode, s8 delay) if (useWeatherPal) CpuFastCopy(gPlttBufferFaded, gPlttBufferUnfaded, 0x400); - BeginNormalPaletteFade(0xFFFFFFFF, delay, 0, 16, fadeColor); + BeginNormalPaletteFade(PALETTES_ALL, delay, 0, 16, fadeColor); gWeatherPtr->palProcessingState = WEATHER_PAL_STATE_SCREEN_FADING_OUT; } else @@ -791,7 +791,7 @@ void FadeScreen(u8 mode, s8 delay) if (useWeatherPal) gWeatherPtr->fadeScreenCounter = 0; else - BeginNormalPaletteFade(0xFFFFFFFF, delay, 16, 0, fadeColor); + BeginNormalPaletteFade(PALETTES_ALL, delay, 16, 0, fadeColor); gWeatherPtr->palProcessingState = WEATHER_PAL_STATE_SCREEN_FADING_IN; gWeatherPtr->unknown_6CA = 1; diff --git a/src/fldeff_misc.c b/src/fldeff_misc.c index 7eae8cfd1..b320f3eb0 100644 --- a/src/fldeff_misc.c +++ b/src/fldeff_misc.c @@ -387,7 +387,7 @@ static void Task_ComputerScreenOpenEffect(u8 taskId) task->tWinRight = DISPLAY_WIDTH; SetGpuReg(REG_OFFSET_BLDY, 0); SetGpuReg(REG_OFFSET_BLDCNT, task->tBlendCnt); - BlendPalettes(0xFFFFFFFF, 0, 0); + BlendPalettes(PALETTES_ALL, 0, 0); gPlttBufferFaded[0] = 0; } SetGpuReg(REG_OFFSET_WIN0H, WIN_RANGE(task->tWinLeft, task->tWinRight)); @@ -463,7 +463,7 @@ static void Task_ComputerScreenCloseEffect(u8 taskId) { task->tWinLeft = DISPLAY_WIDTH / 2; task->tWinRight = DISPLAY_WIDTH / 2; - BlendPalettes(-1, 16, 0); + BlendPalettes(PALETTES_ALL, 16, 0); gPlttBufferFaded[0] = 0; } SetGpuReg(REG_OFFSET_WIN0H, WIN_RANGE(task->tWinLeft, task->tWinRight)); diff --git a/src/frontier_pass.c b/src/frontier_pass.c index cf170b350..2de27c36b 100644 --- a/src/frontier_pass.c +++ b/src/frontier_pass.c @@ -751,8 +751,8 @@ static bool32 InitFrontierPass(void) ShowBg(2); LoadCursorAndSymbolSprites(); SetVBlankCallback(VblankCb_FrontierPass); - BlendPalettes(0xFFFFFFFF, 0x10, RGB_BLACK); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK); + BlendPalettes(PALETTES_ALL, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK); break; case 10: AnimateSprites(); @@ -775,7 +775,7 @@ static bool32 HideFrontierPass(void) case 0: if (sPassData->unkE != 1 && sPassData->unkE != 2) { - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK); } else { @@ -1023,7 +1023,7 @@ static void Task_DoFadeEffect(u8 taskId) data[2] = Q_8_8(1); data[3] = 0x15; data[4] = 0x15; - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_WHITE); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_WHITE); } else { @@ -1037,8 +1037,8 @@ static void Task_DoFadeEffect(u8 taskId) ShowBg(2); LoadCursorAndSymbolSprites(); SetVBlankCallback(VblankCb_FrontierPass); - BlendPalettes(0xFFFFFFFF, 0x10, RGB_WHITE); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_WHITE); + BlendPalettes(PALETTES_ALL, 0x10, RGB_WHITE); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_WHITE); } sPassGfx->setAffine = TRUE; sPassGfx->unk2E = MathUtil_Inv16(data[1]); @@ -1366,8 +1366,8 @@ static bool32 InitFrontierMap(void) ShowBg(2); InitFrontierMapSprites(); SetVBlankCallback(VblankCb_FrontierPass); - BlendPalettes(0xFFFFFFFF, 0x10, RGB_WHITE); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_WHITE); + BlendPalettes(PALETTES_ALL, 0x10, RGB_WHITE); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_WHITE); break; case 7: if (UpdatePaletteFade()) @@ -1385,7 +1385,7 @@ static bool32 ExitFrontierMap(void) switch (sPassData->state) { case 0: - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_WHITE); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_WHITE); break; case 1: if (UpdatePaletteFade()) diff --git a/src/hall_of_fame.c b/src/hall_of_fame.c index 1fe055ba0..7d3a7f28b 100644 --- a/src/hall_of_fame.c +++ b/src/hall_of_fame.c @@ -386,7 +386,7 @@ static bool8 InitHallOfFameScreen(void) if (!sub_8175024()) { SetVBlankCallback(VBlankCB_HallOfFame); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK); gMain.state++; } break; @@ -639,7 +639,7 @@ static void Task_Hof_PaletteFadeAndPrintWelcomeText(u8 taskId) { u16 i; - BeginNormalPaletteFade(0xFFFF0000, 0, 0, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_OBJECTS, 0, 0, 0, RGB_BLACK); for (i = 0; i < PARTY_SIZE; i++) { if (gTasks[taskId].tMonSpriteId(i) != SPRITE_NONE) @@ -739,7 +739,7 @@ static void Task_Hof_ExitOnKeyPressed(u8 taskId) static void Task_Hof_HandlePaletteOnExit(u8 taskId) { CpuCopy16(gPlttBufferFaded, gPlttBufferUnfaded, 0x400); - BeginNormalPaletteFade(0xFFFFFFFF, 8, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 8, 0, 0x10, RGB_BLACK); gTasks[taskId].func = Task_Hof_HandleExit; } @@ -941,7 +941,7 @@ static void Task_HofPC_DrawSpritesPrintText(u8 taskId) } } - BlendPalettes(0xFFFF0000, 0xC, RGB(16, 29, 24)); + BlendPalettes(PALETTES_OBJECTS, 0xC, RGB(16, 29, 24)); ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].tCurrPageNo, STR_CONV_MODE_RIGHT_ALIGN, 3); StringExpandPlaceholders(gStringVar4, gText_HOFNumber); diff --git a/src/hof_pc.c b/src/hof_pc.c index 327749179..f74448cca 100644 --- a/src/hof_pc.c +++ b/src/hof_pc.c @@ -29,7 +29,7 @@ static void ReshowPCMenuAfterHallOfFamePC(void) Overworld_PlaySpecialMapMusic(); ScriptMenu_CreatePCMultichoice(); ScriptMenu_DisplayPCStartupPrompt(); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK); CreateTask(Task_WaitForPaletteFade, 10); } diff --git a/src/intro.c b/src/intro.c index 7c92913b6..376176fe4 100644 --- a/src/intro.c +++ b/src/intro.c @@ -1006,7 +1006,7 @@ static u8 SetUpCopyrightScreen(void) ResetTasks(); ResetSpriteData(); FreeAllSpritePalettes(); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_WHITEALPHA); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_WHITEALPHA); SetGpuReg(REG_OFFSET_BG0CNT, BGCNT_PRIORITY(0) | BGCNT_CHARBASE(0) | BGCNT_SCREENBASE(7) @@ -1026,7 +1026,7 @@ static u8 SetUpCopyrightScreen(void) GameCubeMultiBoot_Main(&gMultibootProgramStruct); if (gMultibootProgramStruct.gcmb_field_2 != 1) { - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK); gMain.state++; } break; @@ -1121,7 +1121,7 @@ static void Task_IntroLoadPart1Graphics(u8 taskId) static void Task_IntroFadeIn(u8 taskId) { - BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK); SetVBlankCallback(VBlankCB_Intro); SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_MODE_0 | DISPCNT_OBJ_1D_MAP | DISPCNT_BG_ALL_ON | DISPCNT_OBJ_ON); gTasks[taskId].func = Task_IntroWaterDrops; @@ -1232,7 +1232,7 @@ static void Task_IntroScrollDownAndShowFlygon(u8 taskId) //fade to white if (gIntroFrameCounter > 1007) { - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_WHITEALPHA); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_WHITEALPHA); gTasks[taskId].func = Task_IntroWaitToSetupPart2; } } @@ -1291,7 +1291,7 @@ static void Task_IntroStartBikeRide(u8 taskId) spriteId = intro_create_flygon_sprite(-0x40, 0x3C); gSprites[spriteId].callback = SpriteCB_IntroGraphicsFlygon; gTasks[taskId].data[2] = spriteId; - BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_WHITEALPHA); + BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_WHITEALPHA); SetVBlankCallback(VBlankCB_Intro); gTasks[taskId].data[0] = CreateBicycleAnimationTask(1, 0x4000, 0x400, 0x10); sub_817B150(1); @@ -1310,7 +1310,7 @@ static void Task_IntroHandleBikeAndFlygonMovement(u8 taskId) } if (gIntroFrameCounter > 1946) { - BeginNormalPaletteFade(0xFFFFFFFF, 8, 0, 16, RGB_WHITEALPHA); + BeginNormalPaletteFade(PALETTES_ALL, 8, 0, 16, RGB_WHITEALPHA); gTasks[taskId].func = Task_IntroWaitToSetupPart3; } if (gIntroFrameCounter == 1109) @@ -1554,7 +1554,7 @@ static void Task_IntroLoadPart3Graphics(u8 taskId) PanFadeAndZoomScreen(0x78, 0x50, 0, 0); ResetSpriteData(); FreeAllSpritePalettes(); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_WHITEALPHA); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_WHITEALPHA); SetGpuReg(REG_OFFSET_BG2CNT, BGCNT_PRIORITY(3) | BGCNT_CHARBASE(0) | BGCNT_SCREENBASE(8) | BGCNT_256COLOR | BGCNT_AFF256x256); SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_MODE_1 | DISPCNT_OBJ_1D_MAP | DISPCNT_BG2_ON | DISPCNT_OBJ_ON); gTasks[taskId].func = Task_IntroSpinAndZoomPokeball; @@ -1579,7 +1579,7 @@ static void Task_IntroSpinAndZoomPokeball(u8 taskId) PanFadeAndZoomScreen(0x78, 0x50, 0x10000 / gTasks[taskId].data[1], gTasks[taskId].data[0]); if (gIntroFrameCounter == 28) - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_WHITEALPHA); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_WHITEALPHA); } static void Task_IntroWaitToSetupPart3LegendsFight(u8 taskId) @@ -1630,7 +1630,7 @@ static void Task_IntroLoadPart3Graphics1(u8 taskId) | DISPCNT_BG2_ON | DISPCNT_OBJ_ON | DISPCNT_WIN0_ON); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_WHITEALPHA); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_WHITEALPHA); gTasks[taskId].data[0] = 0; gTasks[taskId].data[1] = 0xFFA0; gTasks[taskId].data[2] = 0xFF51; @@ -1749,7 +1749,7 @@ static void Task_IntroGroudonScene(u8 taskId) data[3] = Sin((data[6] & 0xFF00) >> 8, 0x40) + 0x100; if (data[1] == 0x78) { - BeginNormalPaletteFade(0xFFFFFFFE, 3, 0, 16, RGB_WHITE); + BeginNormalPaletteFade(PALETTES_ALL & ~1, 3, 0, 16, RGB_WHITE); data[3] = 0x100; data[4] = 0; data[0]++; @@ -1824,7 +1824,7 @@ static void Task_IntroLoadKyogreScene(u8 taskId) LZDecompressVram(gIntro3KyogreBgTilemap, (void *)(BG_SCREEN_ADDR(28))); LoadCompressedSpriteSheet(gUnknown_085E4C88); LoadSpritePalette(gUnknown_085E4C98); - BeginNormalPaletteFade(0xFFFFFFFE, 0, 0x10, 0, RGB_WHITEALPHA); + BeginNormalPaletteFade(PALETTES_ALL & ~1, 0, 0x10, 0, RGB_WHITEALPHA); gTasks[taskId].func = Task_IntroKyogreScene; gTasks[taskId].data[0] = 0; gTasks[taskId].data[1] = 0x150; @@ -1958,7 +1958,7 @@ static void Task_IntroKyogreScene(u8 taskId) gTasks[taskId].data[1] = Sin(data[6], 0x3C) + 0x58; if (data[6] == 0x40) { - BeginNormalPaletteFade(0xFFFFFFFE, 3, 0, 16, RGB_WHITE); + BeginNormalPaletteFade(PALETTES_ALL & ~1, 3, 0, 16, RGB_WHITE); data[0]++; } break; @@ -2117,14 +2117,14 @@ static void Task_IntroCloudScene(u8 taskId) case 0: if (--data[6] == 0) { - BeginNormalPaletteFade(0xFFFFFFFE, 0, 16, 0, RGB_WHITEALPHA); + BeginNormalPaletteFade(PALETTES_ALL & ~1, 0, 16, 0, RGB_WHITEALPHA); data[6] = 0x5000; data[0]++; } break; case 1: if (data[6] == 0x2800) - BeginNormalPaletteFade(0x0000FFFE, 3, 0, 16, RGB(9, 10, 10)); + BeginNormalPaletteFade(PALETTES_BG & ~1, 3, 0, 16, RGB(9, 10, 10)); if (data[6] != 0) data[6] -= 0x80; @@ -2236,7 +2236,7 @@ static void Task_IntroLoadRayquazaGlowScene(u8 taskId) | DISPCNT_OBJ_ON | DISPCNT_WIN0_ON); gTasks[taskId].func = Task_IntroRayquazaGlowScene_0; - BeginNormalPaletteFade(0x0000FFDE, 0, 16, 0, RGB(9, 10, 10)); + BeginNormalPaletteFade(PALETTES_BG & ~(0x21), 0, 16, 0, RGB(9, 10, 10)); gTasks[taskId].data[0] = 0; gTasks[taskId].data[1] = 0xA8; gTasks[taskId].data[2] = -0x10; @@ -2383,7 +2383,7 @@ static void Task_IntroRayquazaGlowScene_1(u8 taskId) case 4: if (--data[3] == 0) { - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_WHITE); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_WHITE); data[0]++; } break; diff --git a/src/item_menu.c b/src/item_menu.c index a3cb7cfa3..8836c0c63 100755 --- a/src/item_menu.c +++ b/src/item_menu.c @@ -720,11 +720,11 @@ bool8 SetupBagMenu(void) gMain.state++; break; case 19: - BlendPalettes(0xFFFFFFFF, 16, 0); + BlendPalettes(PALETTES_ALL, 16, 0); gMain.state++; break; case 20: - BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK); gPaletteFade.bufferTransferDisabled = FALSE; gMain.state++; break; @@ -1018,7 +1018,7 @@ void FreeBagItemListBuffers(void) void Task_FadeAndCloseBagMenu(u8 taskId) { - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); gTasks[taskId].func = TaskCloseBagMenu_2; } diff --git a/src/link.c b/src/link.c index dffb5b4cd..e151bfa28 100644 --- a/src/link.c +++ b/src/link.c @@ -455,7 +455,7 @@ static void LinkTestProcessKeyInput(void) } if (JOY_NEW(L_BUTTON)) { - BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB(2, 0, 0)); + BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB(2, 0, 0)); } if (JOY_NEW(START_BUTTON)) { diff --git a/src/mail.c b/src/mail.c index e2fe22f51..db8451395 100644 --- a/src/mail.c +++ b/src/mail.c @@ -621,7 +621,7 @@ static bool8 MailReadBuildGraphics(void) ShowBg(0); ShowBg(1); ShowBg(2); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK); gPaletteFade.bufferTransferDisabled = FALSE; sMailRead->callback = CB2_WaitForPaletteExitOnKeyPress; return TRUE; @@ -733,7 +733,7 @@ static void CB2_ExitOnKeyPress(void) { if (JOY_NEW(A_BUTTON | B_BUTTON)) { - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); sMailRead->callback = CB2_ExitMailReadFreeVars; } } diff --git a/src/main_menu.c b/src/main_menu.c index 5b4044ed2..d2ec55d3e 100644 --- a/src/main_menu.c +++ b/src/main_menu.c @@ -581,9 +581,9 @@ static u32 InitMainMenu(bool8 returningFromOptionsMenu) ResetSpriteData(); FreeAllSpritePalettes(); if (returningFromOptionsMenu) - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK); // fade to black + BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK); // fade to black else - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_WHITEALPHA); // fade to white + BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_WHITEALPHA); // fade to white ResetBgsAndClearDma3BusyFlags(0); InitBgsFromTemplates(0, sMainMenuBgTemplates, ARRAY_COUNT(sMainMenuBgTemplates)); ChangeBgX(0, 0, 0); @@ -889,13 +889,13 @@ static bool8 HandleMainMenuInput(u8 taskId) { PlaySE(SE_SELECT); IsWirelessAdapterConnected(); // why bother calling this here? debug? Task_HandleMainMenuAPressed will check too - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK); gTasks[taskId].func = Task_HandleMainMenuAPressed; } else if (JOY_NEW(B_BUTTON)) { PlaySE(SE_SELECT); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_WHITEALPHA); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_WHITEALPHA); SetGpuReg(REG_OFFSET_WIN0H, WIN_RANGE(0, 240)); SetGpuReg(REG_OFFSET_WIN0V, WIN_RANGE(0, 160)); gTasks[taskId].func = Task_HandleMainMenuBPressed; @@ -1095,7 +1095,7 @@ static void Task_HandleMainMenuAPressed(u8 taskId) SetGpuReg(REG_OFFSET_BG1VOFS, 0); SetGpuReg(REG_OFFSET_BG0HOFS, 0); SetGpuReg(REG_OFFSET_BG0VOFS, 0); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK); return; } FreeAllWindowBuffers(); @@ -1152,7 +1152,7 @@ static void Task_DisplayMainMenuInvalidActionError(u8 taskId) if (JOY_NEW(A_BUTTON | B_BUTTON)) { PlaySE(SE_SELECT); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); gTasks[taskId].func = Task_HandleMainMenuBPressed; } } @@ -1284,7 +1284,7 @@ static void Task_NewGameBirchSpeech_Init(u8 taskId) FreeAllSpritePalettes(); ResetAllPicSprites(); AddBirchSpeechObjects(taskId); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK); gTasks[taskId].tBG1HOFS = 0; gTasks[taskId].func = Task_NewGameBirchSpeech_WaitToShowBirch; gTasks[taskId].tPlayerSpriteId = SPRITE_NONE; @@ -1594,7 +1594,7 @@ static void Task_NewGameBirchSpeech_WaitPressBeforeNameChoice(u8 taskId) { if ((JOY_NEW(A_BUTTON)) || (JOY_NEW(B_BUTTON))) { - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); gTasks[taskId].func = Task_NewGameBirchSpeech_StartNamingScreen; } } @@ -1749,7 +1749,7 @@ static void Task_NewGameBirchSpeech_ShrinkPlayer(u8 taskId) InitSpriteAffineAnim(&gSprites[spriteId]); StartSpriteAffineAnim(&gSprites[spriteId], 0); gSprites[spriteId].callback = SpriteCB_MovePlayerDownWhileShrinking; - BeginNormalPaletteFade(0x0000FFFF, 0, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_BG, 0, 0, 16, RGB_BLACK); FadeOutBGM(4); gTasks[taskId].func = Task_NewGameBirchSpeech_WaitForPlayerShrink; } @@ -1773,7 +1773,7 @@ static void Task_NewGameBirchSpeech_FadePlayerToWhite(u8 taskId) spriteId = gTasks[taskId].tPlayerSpriteId; gSprites[spriteId].callback = SpriteCB_Null; SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_OBJ_ON | DISPCNT_OBJ_1D_MAP); - BeginNormalPaletteFade(0xFFFF0000, 0, 0, 16, RGB_WHITEALPHA); + BeginNormalPaletteFade(PALETTES_OBJECTS, 0, 0, 16, RGB_WHITEALPHA); gTasks[taskId].func = Task_NewGameBirchSpeech_Cleanup; } } @@ -1843,7 +1843,7 @@ static void CB2_NewGameBirchSpeech_ReturnFromNamingScreen(void) gSprites[spriteId].invisible = FALSE; gTasks[taskId].tPlayerSpriteId = spriteId; SetGpuReg(REG_OFFSET_BG1HOFS, -60); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK); SetGpuReg(REG_OFFSET_WIN0H, 0); SetGpuReg(REG_OFFSET_WIN0V, 0); SetGpuReg(REG_OFFSET_WININ, 0); @@ -2117,9 +2117,9 @@ static void NewGameBirchSpeech_SetDefaultPlayerName(u8 nameId) name = gMalePresetNames[nameId]; else name = gFemalePresetNames[nameId]; - for (i = 0; i < 7; i++) + for (i = 0; i < PLAYER_NAME_LENGTH; i++) gSaveBlock2Ptr->playerName[i] = name[i]; - gSaveBlock2Ptr->playerName[7] = 0xFF; + gSaveBlock2Ptr->playerName[PLAYER_NAME_LENGTH] = EOS; } static void CreateMainMenuErrorWindow(const u8* str) diff --git a/src/mevent_801BAAC.c b/src/mevent_801BAAC.c index 2702b53f9..fa0153e62 100644 --- a/src/mevent_801BAAC.c +++ b/src/mevent_801BAAC.c @@ -186,7 +186,7 @@ s32 FadeToWonderCardMenu(void) switch(sWonderCardData->unk_0174) { case 0: - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); break; case 1: if (UpdatePaletteFade()) @@ -231,7 +231,7 @@ s32 FadeToWonderCardMenu(void) ShowBg(2); gPaletteFade.bufferTransferDisabled = FALSE; sub_801C4C0(); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK); UpdatePaletteFade(); break; default: @@ -251,7 +251,7 @@ s32 FadeOutFromWonderCard(bool32 flag) switch (sWonderCardData->unk_0174) { case 0: - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); break; case 1: if (UpdatePaletteFade()) @@ -279,7 +279,7 @@ s32 FadeOutFromWonderCard(bool32 flag) case 5: PrintMysteryGiftOrEReaderTopMenu(gGiftIsFromEReader, flag); CopyBgTilemapBufferToVram(0); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK); break; default: if (UpdatePaletteFade()) @@ -575,7 +575,7 @@ s32 FadeToWonderNewsMenu(void) switch (sWonderNewsData->unk_01C0_1) { case 0: - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); break; case 1: if (UpdatePaletteFade()) @@ -629,7 +629,7 @@ s32 FadeToWonderNewsMenu(void) ShowBg(3); gPaletteFade.bufferTransferDisabled = FALSE; sWonderNewsData->unk_01C1 = AddScrollIndicatorArrowPair(&sWonderNewsData->unk_0394, &sWonderNewsData->unk_01C6); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK); UpdatePaletteFade(); break; default: @@ -650,7 +650,7 @@ s32 FadeOutFromWonderNews(bool32 flag) switch (sWonderNewsData->unk_01C0_1) { case 0: - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); break; case 1: if (UpdatePaletteFade()) @@ -692,7 +692,7 @@ s32 FadeOutFromWonderNews(bool32 flag) MG_DrawCheckerboardPattern(3); CopyBgTilemapBufferToVram(0); CopyBgTilemapBufferToVram(3); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK); break; default: if (UpdatePaletteFade()) diff --git a/src/move_relearner.c b/src/move_relearner.c index f010fcc04..9fa7bf11c 100644 --- a/src/move_relearner.c +++ b/src/move_relearner.c @@ -368,7 +368,7 @@ void TeachMoveRelearnerMove(void) ScriptContext2_Enable(); CreateTask(Task_WaitForFadeOut, 10); // Fade to black - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK); } static void Task_WaitForFadeOut(u8 taskId) @@ -472,7 +472,7 @@ static void DoMoveRelearnerMain(void) case MENU_STATE_FADE_TO_BLACK: sMoveRelearnerStruct->state++; HideHeartSpritesAndShowTeachMoveText(FALSE); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK); break; case MENU_STATE_WAIT_FOR_FADE: if (!gPaletteFade.active) @@ -645,7 +645,7 @@ static void DoMoveRelearnerMain(void) if (!MoveRelearnerRunTextPrinters()) { sMoveRelearnerStruct->state = MENU_STATE_SHOW_MOVE_SUMMARY_SCREEN; - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); } break; case MENU_STATE_SHOW_MOVE_SUMMARY_SCREEN: @@ -662,10 +662,10 @@ static void DoMoveRelearnerMain(void) } break; case 22: - BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK); break; case MENU_STATE_FADE_AND_RETURN: - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); sMoveRelearnerStruct->state++; break; case MENU_STATE_RETURN_TO_FIELD: @@ -676,7 +676,7 @@ static void DoMoveRelearnerMain(void) } break; case MENU_STATE_FADE_FROM_SUMMARY_SCREEN: - BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK); sMoveRelearnerStruct->state++; if (sMoveRelearnerMenuSate.showContestInfo == FALSE) { diff --git a/src/mystery_event_menu.c b/src/mystery_event_menu.c index 00dcbf0e3..297883e9c 100644 --- a/src/mystery_event_menu.c +++ b/src/mystery_event_menu.c @@ -138,7 +138,7 @@ static void CB2_MysteryEventMenu(void) PutWindowTilemap(0); CopyWindowToVram(0, 3); ShowBg(0); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK); gMain.state++; break; case 1: @@ -281,7 +281,7 @@ static void CB2_MysteryEventMenu(void) } break; case 15: - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK); gMain.state++; break; case 16: diff --git a/src/naming_screen.c b/src/naming_screen.c index b679ec5f7..a1dfac88e 100644 --- a/src/naming_screen.c +++ b/src/naming_screen.c @@ -635,8 +635,8 @@ static bool8 MainState_FadeIn(void) CopyBgTilemapBufferToVram(1); CopyBgTilemapBufferToVram(2); CopyBgTilemapBufferToVram(3); - BlendPalettes(-1, 16, 0); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK); + BlendPalettes(PALETTES_ALL, 16, 0); + BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK); sNamingScreen->state++; return FALSE; } @@ -690,7 +690,7 @@ static bool8 MainState_PressedOKButton(void) static bool8 MainState_FadeOut(void) { - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); sNamingScreen->state++; return FALSE; } diff --git a/src/option_menu.c b/src/option_menu.c index b6440a89c..64e9b6576 100644 --- a/src/option_menu.c +++ b/src/option_menu.c @@ -256,7 +256,7 @@ void CB2_InitOptionMenu(void) break; } case 11: - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK); SetVBlankCallback(VBlankCB); SetMainCallback2(MainCB2); return; @@ -365,7 +365,7 @@ static void Task_OptionMenuSave(u8 taskId) gSaveBlock2Ptr->optionsButtonMode = gTasks[taskId].data[TD_BUTTONMODE]; gSaveBlock2Ptr->optionsWindowFrameType = gTasks[taskId].data[TD_FRAMETYPE]; - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK); gTasks[taskId].func = Task_OptionMenuFadeOut; } diff --git a/src/party_menu.c b/src/party_menu.c index 7d53a2c12..fc547e96d 100755 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -589,12 +589,12 @@ static bool8 ShowPartyMenu(void) gMain.state++; break; case 21: - BlendPalettes(0xFFFFFFFF, 16, 0); + BlendPalettes(PALETTES_ALL, 16, 0); gPaletteFade.bufferTransferDisabled = FALSE; gMain.state++; break; case 22: - BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK); gMain.state++; break; default: @@ -607,7 +607,7 @@ static bool8 ShowPartyMenu(void) static void ExitPartyMenu(void) { - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); CreateTask(Task_ExitPartyMenu, 0); SetVBlankCallback(VBlankCB_PartyMenu); SetMainCallback2(CB2_UpdatePartyMenu); @@ -1148,7 +1148,7 @@ static void SwapPartyPokemon(struct Pokemon *mon1, struct Pokemon *mon2) static void Task_ClosePartyMenu(u8 taskId) { - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); gTasks[taskId].func = Task_ClosePartyMenuAndSetCB2; } diff --git a/src/pokeblock.c b/src/pokeblock.c index 8c73213fc..ee546deda 100644 --- a/src/pokeblock.c +++ b/src/pokeblock.c @@ -581,11 +581,11 @@ static bool8 InitPokeblockMenu(void) gMain.state++; break; case 17: - BlendPalettes(-1, 0x10, 0); + BlendPalettes(PALETTES_ALL, 0x10, 0); gMain.state++; break; case 18: - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK); gPaletteFade.bufferTransferDisabled = 0; gMain.state++; break; @@ -948,7 +948,7 @@ static void sub_8136470(struct Sprite *sprite) static void FadePaletteAndSetTaskToClosePokeblockCase(u8 taskId) { - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK); gTasks[taskId].func = Task_FreeDataAndExitPokeblockCase; } diff --git a/src/pokeblock_feed.c b/src/pokeblock_feed.c index a930523ce..e5b13e2f6 100644 --- a/src/pokeblock_feed.c +++ b/src/pokeblock_feed.c @@ -587,11 +587,11 @@ static bool8 TransitionToPokeblockFeedScene(void) gMain.state++; break; case 12: - BlendPalettes(-1, 0x10, 0); + BlendPalettes(PALETTES_ALL, 0x10, 0); gMain.state++; break; case 13: - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK); gPaletteFade.bufferTransferDisabled = 0; gMain.state++; break; @@ -805,7 +805,7 @@ static void Task_ReturnAfterPaletteFade(u8 taskId) static void Task_PaletteFadeToReturn(u8 taskId) { - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK); gTasks[taskId].func = Task_ReturnAfterPaletteFade; } diff --git a/src/pokedex.c b/src/pokedex.c index c0236020e..645d8e6c8 100644 --- a/src/pokedex.c +++ b/src/pokedex.c @@ -1689,7 +1689,7 @@ static void Task_HandlePokedexInput(u8 taskId) else if (JOY_NEW(SELECT_BUTTON)) { PlaySE(SE_SELECT); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK); gTasks[taskId].tTaskId = LoadSearchMenu(); sPokedexView->screenSwitchState = 0; sPokedexView->pokeBallRotationBackup = sPokedexView->pokeBallRotation; @@ -1702,7 +1702,7 @@ static void Task_HandlePokedexInput(u8 taskId) } else if (JOY_NEW(B_BUTTON)) { - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK); gTasks[taskId].func = Task_ClosePokedex; PlaySE(SE_PC_OFF); } @@ -1756,7 +1756,7 @@ static void Task_HandlePokedexStartMenuInput(u8 taskId) gMain.newKeys |= START_BUTTON; //Exit menu break; case 3: //CLOSE POKEDEX - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK); gTasks[taskId].func = Task_ClosePokedex; PlaySE(SE_PC_OFF); break; @@ -1891,7 +1891,7 @@ static void Task_HandleSearchResultsInput(u8 taskId) } else if (JOY_NEW(SELECT_BUTTON)) { - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK); gTasks[taskId].tTaskId = LoadSearchMenu(); sPokedexView->screenSwitchState = 0; gTasks[taskId].func = Task_WaitForExitSearch; @@ -1900,7 +1900,7 @@ static void Task_HandleSearchResultsInput(u8 taskId) } else if (JOY_NEW(B_BUTTON)) { - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK); gTasks[taskId].func = Task_ReturnToPokedexFromSearchResults; PlaySE(SE_PC_OFF); } @@ -1953,12 +1953,12 @@ static void Task_HandleSearchResultsStartMenuInput(u8 taskId) gMain.newKeys |= START_BUTTON; break; case 3: //BACK TO POKEDEX - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK); gTasks[taskId].func = Task_ReturnToPokedexFromSearchResults; PlaySE(SE_TRUCK_DOOR); break; case 4: //CLOSE POKEDEX - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK); gTasks[taskId].func = Task_ClosePokedexFromSearchResultsStartMenu; PlaySE(SE_PC_OFF); break; @@ -2104,7 +2104,7 @@ static bool8 LoadPokedexListPage(u8 page) gMain.state++; break; case 4: - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK); SetVBlankCallback(VBlankCB_Pokedex); gMain.state++; break; @@ -3355,14 +3355,14 @@ static void Task_HandleInfoScreenInput(u8 taskId) if (gTasks[taskId].data[0] != 0) { // Scroll up/down - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); gTasks[taskId].func = Task_LoadInfoScreenWaitForFade; PlaySE(SE_DEX_SCROLL); return; } if (JOY_NEW(B_BUTTON)) { - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); gTasks[taskId].func = Task_ExitInfoScreen; PlaySE(SE_PC_OFF); return; @@ -3372,13 +3372,13 @@ static void Task_HandleInfoScreenInput(u8 taskId) switch (sPokedexView->selectedScreen) { case AREA_SCREEN: - BeginNormalPaletteFade(0xFFFFFFEB, 0, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL & ~(0x14), 0, 0, 16, RGB_BLACK); sPokedexView->screenSwitchState = 1; gTasks[taskId].func = Task_SwitchScreensFromInfoScreen; PlaySE(SE_PIN); break; case CRY_SCREEN: - BeginNormalPaletteFade(0xFFFFFFEB, 0, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL & ~(0x14), 0, 0, 0x10, RGB_BLACK); sPokedexView->screenSwitchState = 2; gTasks[taskId].func = Task_SwitchScreensFromInfoScreen; PlaySE(SE_PIN); @@ -3390,14 +3390,14 @@ static void Task_HandleInfoScreenInput(u8 taskId) } else { - BeginNormalPaletteFade(0xFFFFFFEB, 0, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL & ~(0x14), 0, 0, 0x10, RGB_BLACK); sPokedexView->screenSwitchState = 3; gTasks[taskId].func = Task_SwitchScreensFromInfoScreen; PlaySE(SE_PIN); } break; case CANCEL_SCREEN: - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK); gTasks[taskId].func = Task_ExitInfoScreen; PlaySE(SE_PC_OFF); break; @@ -3602,7 +3602,7 @@ static void Task_LoadCryScreen(u8 taskId) } break; case 8: - BeginNormalPaletteFade(0xFFFFFFEB, 0, 0x10, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL & ~(0x14), 0, 0x10, 0, RGB_BLACK); SetVBlankCallback(gPokedexVBlankCB); gMain.state++; break; @@ -3644,7 +3644,7 @@ static void Task_HandleCryScreenInput(u8 taskId) { if (JOY_NEW(B_BUTTON)) { - BeginNormalPaletteFade(0xFFFFFFEB, 0, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL & ~(0x14), 0, 0, 0x10, RGB_BLACK); m4aMPlayContinue(&gMPlayInfo_BGM); sPokedexView->screenSwitchState = 1; gTasks[taskId].func = Task_SwitchScreensFromCryScreen; @@ -3654,7 +3654,7 @@ static void Task_HandleCryScreenInput(u8 taskId) if ((JOY_NEW(DPAD_LEFT)) || ((JOY_NEW(L_BUTTON)) && gSaveBlock2Ptr->optionsButtonMode == OPTIONS_BUTTON_MODE_LR)) { - BeginNormalPaletteFade(0xFFFFFFEB, 0, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL & ~(0x14), 0, 0, 0x10, RGB_BLACK); m4aMPlayContinue(&gMPlayInfo_BGM); sPokedexView->screenSwitchState = 2; gTasks[taskId].func = Task_SwitchScreensFromCryScreen; @@ -3670,7 +3670,7 @@ static void Task_HandleCryScreenInput(u8 taskId) } else { - BeginNormalPaletteFade(0xFFFFFFEB, 0, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL & ~(0x14), 0, 0, 0x10, RGB_BLACK); m4aMPlayContinue(&gMPlayInfo_BGM); sPokedexView->screenSwitchState = 3; gTasks[taskId].func = Task_SwitchScreensFromCryScreen; @@ -3786,7 +3786,7 @@ static void Task_LoadSizeScreen(u8 taskId) gMain.state++; break; case 7: - BeginNormalPaletteFade(0xFFFFFFEB, 0, 0x10, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL & ~(0x14), 0, 0x10, 0, RGB_BLACK); SetVBlankCallback(gPokedexVBlankCB); gMain.state++; break; @@ -3816,7 +3816,7 @@ static void Task_HandleSizeScreenInput(u8 taskId) { if (JOY_NEW(B_BUTTON)) { - BeginNormalPaletteFade(0xFFFFFFEB, 0, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL & ~(0x14), 0, 0, 0x10, RGB_BLACK); sPokedexView->screenSwitchState = 1; gTasks[taskId].func = Task_SwitchScreensFromSizeScreen; PlaySE(SE_PC_OFF); @@ -3824,7 +3824,7 @@ static void Task_HandleSizeScreenInput(u8 taskId) else if ((JOY_NEW(DPAD_LEFT)) || ((JOY_NEW(L_BUTTON)) && gSaveBlock2Ptr->optionsButtonMode == OPTIONS_BUTTON_MODE_LR)) { - BeginNormalPaletteFade(0xFFFFFFEB, 0, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL & ~(0x14), 0, 0, 0x10, RGB_BLACK); sPokedexView->screenSwitchState = 2; gTasks[taskId].func = Task_SwitchScreensFromSizeScreen; PlaySE(SE_DEX_PAGE); @@ -3987,7 +3987,7 @@ static void Task_DisplayCaughtMonDexPage(u8 taskId) case 4: spriteId = CreateMonSpriteFromNationalDexNumber(dexNum, 48, 56, 0); gSprites[spriteId].oam.priority = 0; - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK); SetVBlankCallback(gPokedexVBlankCB); gTasks[taskId].tMonSpriteId = spriteId; gTasks[taskId].tState++; @@ -4016,7 +4016,7 @@ static void Task_HandleCaughtMonPageInput(u8 taskId) { if (JOY_NEW(A_BUTTON | B_BUTTON)) { - BeginNormalPaletteFade(0x0000FFFF, 0, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_BG, 0, 0, 16, RGB_BLACK); gSprites[gTasks[taskId].tMonSpriteId].callback = SpriteCB_SlideCaughtMonToCenter; gTasks[taskId].func = Task_ExitCaughtMonPage; } @@ -4849,7 +4849,7 @@ static void Task_LoadSearchMenu(u8 taskId) gMain.state++; break; case 2: - BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK); gMain.state++; break; case 3: @@ -5219,7 +5219,7 @@ static void Task_HandleSearchParameterInput(u8 taskId) static void Task_ExitSearch(u8 taskId) { - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); gTasks[taskId].func = Task_ExitSearchWaitForFade; } diff --git a/src/pokedex_area_screen.c b/src/pokedex_area_screen.c index b63b00290..f9cf42309 100755 --- a/src/pokedex_area_screen.c +++ b/src/pokedex_area_screen.c @@ -691,7 +691,7 @@ static void Task_ShowPokedexAreaScreen(u8 taskId) CreateAreaUnknownSprites(); break; case 9: - BeginNormalPaletteFade(0xFFFFFFEB, 0, 16, 0, RGB(0, 0, 0)); + BeginNormalPaletteFade(PALETTES_ALL & ~(0x14), 0, 16, 0, RGB(0, 0, 0)); break; case 10: SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG0 | BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_BG0 | BLDCNT_TGT2_ALL); @@ -736,7 +736,7 @@ static void Task_HandlePokedexAreaScreenInput(u8 taskId) return; break; case 2: - BeginNormalPaletteFade(0xFFFFFFEB, 0, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL & ~(0x14), 0, 0, 16, RGB_BLACK); break; case 3: if (gPaletteFade.active) diff --git a/src/pokemon_jump.c b/src/pokemon_jump.c index af40c2c18..e2d97a395 100755 --- a/src/pokemon_jump.c +++ b/src/pokemon_jump.c @@ -582,8 +582,8 @@ static void sub_802ACA0(u8 taskId) case 3: if (IsLinkTaskFinished()) { - BlendPalettes(0xFFFFFFFF, 16, RGB_BLACK); - BeginNormalPaletteFade(0xFFFFFFFF, -1, 16, 0, RGB_BLACK); + BlendPalettes(PALETTES_ALL, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, -1, 16, 0, RGB_BLACK); SetVBlankCallback(sub_802AC58); gUnknown_02022CFC->unk8++; } @@ -1455,7 +1455,7 @@ static bool32 sub_802BC60(void) case 3: if (++gUnknown_02022CFC->unk3C > 120) { - BeginNormalPaletteFade(0xFFFFFFFF, -1, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, -1, 0, 16, RGB_BLACK); gUnknown_02022CFC->unkA++; } break; diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index eaa9416cf..a542d222c 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -2336,12 +2336,12 @@ static void Cb_InitPSS(u8 taskId) SetMonIconTransparency(); if (!sPSSData->isReshowingPSS) { - BlendPalettes(0xFFFFFFFF, 0x10, RGB_BLACK); + BlendPalettes(PALETTES_ALL, 0x10, RGB_BLACK); SetPSSCallback(Cb_ShowPSS); } else { - BlendPalettes(0xFFFFFFFF, 0x10, RGB_BLACK); + BlendPalettes(PALETTES_ALL, 0x10, RGB_BLACK); SetPSSCallback(Cb_ReshowPSS); } SetVBlankCallback(VblankCb_PSS); @@ -2374,7 +2374,7 @@ static void Cb_ReshowPSS(u8 taskId) switch (sPSSData->state) { case 0: - BeginNormalPaletteFade(0xFFFFFFFF, -1, 0x10, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, -1, 0x10, 0, RGB_BLACK); sPSSData->state++; break; case 1: @@ -3681,7 +3681,7 @@ static void Cb_NameBox(u8 taskId) { case 0: sub_80CE760(); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); sPSSData->state++; break; case 1: @@ -3701,7 +3701,7 @@ static void Cb_ShowMonSummary(u8 taskId) { case 0: sub_80CE7E8(); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); sPSSData->state++; break; case 1: @@ -3720,7 +3720,7 @@ static void Cb_GiveItemFromBag(u8 taskId) switch (sPSSData->state) { case 0: - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); sPSSData->state++; break; case 1: diff --git a/src/pokemon_summary_screen.c b/src/pokemon_summary_screen.c index b05291cd1..6e27ae5f4 100644 --- a/src/pokemon_summary_screen.c +++ b/src/pokemon_summary_screen.c @@ -1246,11 +1246,11 @@ static bool8 LoadGraphics(void) gMain.state++; break; case 23: - BlendPalettes(0xFFFFFFFF, 16, 0); + BlendPalettes(PALETTES_ALL, 16, 0); gMain.state++; break; case 24: - BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK); gPaletteFade.bufferTransferDisabled = 0; gMain.state++; break; @@ -1470,7 +1470,7 @@ static void FreeSummaryScreen(void) static void BeginCloseSummaryScreen(u8 taskId) { - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); gTasks[taskId].func = CloseSummaryScreen; } diff --git a/src/pokenav_main_menu.c b/src/pokenav_main_menu.c index 21bddf1cd..e8262ad9a 100644 --- a/src/pokenav_main_menu.c +++ b/src/pokenav_main_menu.c @@ -314,7 +314,7 @@ void ShutdownPokenav(void) { PlaySE(SE_POKENAV_OFF); ResetBldCnt_(); - BeginNormalPaletteFade(0xFFFFFFFF, -1, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, -1, 0, 16, RGB_BLACK); } bool32 WaitForPokenavShutdownFade(void) @@ -521,10 +521,10 @@ void PokenavFadeScreen(s32 fadeType) BeginNormalPaletteFade(structPtr->palettes, -2, 16, 0, RGB_BLACK); break; case 2: - BeginNormalPaletteFade(0xFFFFFFFF, -2, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, -2, 0, 16, RGB_BLACK); break; case 3: - BeginNormalPaletteFade(0xFFFFFFFF, -2, 16, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, -2, 16, 0, RGB_BLACK); break; } } @@ -536,7 +536,7 @@ bool32 IsPaletteFadeActive(void) void sub_81C7B40(void) { - BlendPalettes(0xFFFEFFFE, 16, RGB_BLACK); + BlendPalettes(PALETTES_ALL & ~(0x10000 | 0x1), 16, RGB_BLACK); } void InitBgTemplates(const struct BgTemplate *templates, int count) diff --git a/src/rayquaza_scene.c b/src/rayquaza_scene.c index bc6758cae..101916f13 100644 --- a/src/rayquaza_scene.c +++ b/src/rayquaza_scene.c @@ -1627,8 +1627,8 @@ static void Task_DuoFightAnim(u8 taskId) StopMapMusic(); } - BlendPalettes(-1, 0x10, 0); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK); + BlendPalettes(PALETTES_ALL, 0x10, 0); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK); SetVBlankCallback(VBlankCB_DuoFight); PlaySE(SE_DOWNPOUR); } @@ -1738,21 +1738,21 @@ static void Task_HandleDuoFight(u8 taskId) static void DuoFight_Lightning1(void) { PlaySE(SE_THUNDER); - BlendPalettesGradually(0x00007FFF, 0, 16, 0, RGB_WHITEALPHA, 0, 0); - BlendPalettesGradually(0xFFFF0000, 0, 16, 0, RGB_BLACK, 0, 1); + BlendPalettesGradually(PALETTES_BG & ~(0x8000), 0, 16, 0, RGB_WHITEALPHA, 0, 0); + BlendPalettesGradually(PALETTES_OBJECTS, 0, 16, 0, RGB_BLACK, 0, 1); } static void DuoFight_Lightning2(void) { PlaySE(SE_THUNDER); - BlendPalettesGradually(0x00007FFF, 0, 16, 16, RGB_WHITEALPHA, 0, 0); - BlendPalettesGradually(0xFFFF0000, 0, 16, 16, RGB_BLACK, 0, 1); + BlendPalettesGradually(PALETTES_BG & ~(0x8000), 0, 16, 16, RGB_WHITEALPHA, 0, 0); + BlendPalettesGradually(PALETTES_OBJECTS, 0, 16, 16, RGB_BLACK, 0, 1); } static void DuoFight_LightningLong(void) { - BlendPalettesGradually(0x00007FFF, 4, 16, 0, RGB_WHITEALPHA, 0, 0); - BlendPalettesGradually(0xFFFF0000, 4, 16, 0, RGB_BLACK, 0, 1); + BlendPalettesGradually(PALETTES_BG & ~(0x8000), 4, 16, 0, RGB_WHITEALPHA, 0, 0); + BlendPalettesGradually(PALETTES_OBJECTS, 4, 16, 0, RGB_BLACK, 0, 1); } static void DuoFight_AnimateRain(void) @@ -1784,7 +1784,7 @@ static void DuoFight_PanOffScene(u8 taskId) static void DuoFightEnd(u8 taskId, s8 palDelay) { PlaySE(SE_DOWNPOUR_STOP); - BeginNormalPaletteFade(0xFFFFFFFF, palDelay, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, palDelay, 0, 0x10, RGB_BLACK); gTasks[taskId].func = Task_DuoFightEnd; } @@ -2045,7 +2045,7 @@ static void Task_RayTakesFlightAnim(u8 taskId) LoadTakesFlightSceneGfx(); SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_OBJ | BLDCNT_TGT2_BG1 | BLDCNT_EFFECT_BLEND); SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(8, 8)); - BlendPalettes(-1, 16, 0); + BlendPalettes(PALETTES_ALL, 16, 0); SetVBlankCallback(VBlankCB_RayquazaScene); CreateTask(Task_TakesFlight_CreateSmoke, 0); tState = 0; @@ -2064,7 +2064,7 @@ static void Task_HandleRayTakesFlight(u8 taskId) // Delay, then fade in if (tTimer == 8) { - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK); tScale = 0; tScaleSpeed = 30; tYCoord = 0; @@ -2110,7 +2110,7 @@ static void Task_HandleRayTakesFlight(u8 taskId) if (tTimer > 295) { tState++; - BeginNormalPaletteFade(0xFFFFFFFF, 6, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 6, 0, 0x10, RGB_BLACK); } } break; @@ -2284,7 +2284,7 @@ static void Task_RayDescendsAnim(u8 taskId) LoadDescendsSceneGfx(); SetGpuRegBits(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG0 | BLDCNT_TGT2_BG1 | BLDCNT_TGT2_BG2 | BLDCNT_TGT2_BG3 | BLDCNT_TGT2_OBJ | BLDCNT_EFFECT_BLEND); SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(0, 16)); - BlendPalettes(-1, 0x10, 0); + BlendPalettes(PALETTES_ALL, 0x10, 0); SetVBlankCallback(VBlankCB_RayquazaScene); sRayScene->revealedLightLine = 0; sRayScene->revealedLightTimer = 0; @@ -2305,7 +2305,7 @@ static void Task_HandleRayDescends(u8 taskId) // Delay, then fade in if (tTimer == 8) { - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK); tTimer = 0; tState++; } @@ -2354,7 +2354,7 @@ static void Task_HandleRayDescends(u8 taskId) break; case 4: // Fade out - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK); gTasks[taskId].func = Task_RayDescendsEnd; break; } @@ -2501,7 +2501,7 @@ static void Task_RayChargesAnim(u8 taskId) InitChargesSceneBgs(); LoadChargesSceneGfx(); SetWindowsHideVertBorders(); - BlendPalettes(-1, 0x10, 0); + BlendPalettes(PALETTES_ALL, 0x10, 0); SetVBlankCallback(VBlankCB_RayquazaScene); tState = 0; tTimer = 0; @@ -2523,7 +2523,7 @@ static void Task_HandleRayCharges(u8 taskId) // Delay, then fade in if (tTimer == 8) { - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK); tTimer = 0; tState++; } @@ -2559,7 +2559,7 @@ static void Task_HandleRayCharges(u8 taskId) break; case 3: // Fade out - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK); gTasks[taskId].func = Task_RayChargesEnd; break; } @@ -2697,7 +2697,7 @@ static void Task_RayChasesAwayAnim(u8 taskId) ClearGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_BG2_ON); SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG0 | BLDCNT_TGT2_BG1 | BLDCNT_EFFECT_BLEND); SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(9, 14)); - BlendPalettes(-1, 0x10, 0); + BlendPalettes(PALETTES_ALL, 0x10, 0); SetVBlankCallback(VBlankCB_RayquazaScene); tState = 0; tTimer = 0; @@ -2720,7 +2720,7 @@ static void Task_HandleRayChasesAway(u8 taskId) if (tTimer == 8) { ChasesAway_CreateTrioSprites(taskId); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK); tTimer = 0; tState++; } @@ -2760,14 +2760,14 @@ static void Task_HandleRayChasesAway(u8 taskId) tTimer++; if (tTimer % 144 == 0) { - BlendPalettesGradually(0x0000FFFE, 0, 16, 0, RGB_WHITEALPHA, 0, 0); - BlendPalettesGradually(0xFFFF0000, 0, 16, 0, RGB_BLACK, 0, 1); + BlendPalettesGradually(PALETTES_BG & ~1, 0, 16, 0, RGB_WHITEALPHA, 0, 0); + BlendPalettesGradually(PALETTES_OBJECTS, 0, 16, 0, RGB_BLACK, 0, 1); } } break; case 3: // Fade out - BeginNormalPaletteFade(0xFFFFFFFF, 4, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 4, 0, 0x10, RGB_BLACK); gTasks[taskId].func = Task_RayChasesAwayEnd; break; } diff --git a/src/recorded_battle.c b/src/recorded_battle.c index fa30c9863..5db4f82c5 100644 --- a/src/recorded_battle.c +++ b/src/recorded_battle.c @@ -220,7 +220,7 @@ u8 RecordedBattle_GetBattlerAction(u8 battlerId) { gSpecialVar_Result = gBattleOutcome = B_OUTCOME_PLAYER_TELEPORTED; // hah ResetPaletteFadeControl(); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK); SetMainCallback2(CB2_QuitRecordedBattle); return 0xFF; } diff --git a/src/region_map.c b/src/region_map.c index 22b925a6f..bec51ebf0 100644 --- a/src/region_map.c +++ b/src/region_map.c @@ -1721,7 +1721,7 @@ void CB2_OpenFlyMap(void) gMain.state++; break; case 9: - BlendPalettes(-1, 16, 0); + BlendPalettes(PALETTES_ALL, 16, 0); SetVBlankCallback(VBlankCB_FlyMap); gMain.state++; break; @@ -1936,7 +1936,7 @@ static void CB_FadeInFlyMap(void) switch (sFlyMap->state) { case 0: - BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK); sFlyMap->state++; break; case 1: @@ -1983,7 +1983,7 @@ static void CB_ExitFlyMap(void) switch (sFlyMap->state) { case 0: - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); sFlyMap->state++; break; case 1: diff --git a/src/reset_rtc_screen.c b/src/reset_rtc_screen.c index d0e815816..052ca820a 100644 --- a/src/reset_rtc_screen.c +++ b/src/reset_rtc_screen.c @@ -553,7 +553,7 @@ static void Task_ResetRtcScreen(u8 taskId) switch (data[0]) { case 0: - BeginNormalPaletteFade(0xFFFFFFFF, 1, 0x10, 0, RGB_WHITEALPHA); + BeginNormalPaletteFade(PALETTES_ALL, 1, 0x10, 0, RGB_WHITEALPHA); data[0] = 1; break; case 1: @@ -622,7 +622,7 @@ static void Task_ResetRtcScreen(u8 taskId) case 5: if (JOY_NEW(A_BUTTON)) { - BeginNormalPaletteFade(0xFFFFFFFF, 1, 0, 0x10, RGB_WHITEALPHA); + BeginNormalPaletteFade(PALETTES_ALL, 1, 0, 0x10, RGB_WHITEALPHA); data[0] = 6; } else diff --git a/src/roulette.c b/src/roulette.c index 4173edcdb..f0b484fe8 100644 --- a/src/roulette.c +++ b/src/roulette.c @@ -3389,7 +3389,7 @@ static void Task_AcceptMinBet(u8 taskId) ClearStdWindowAndFrame(0, TRUE); HideCoinsWindow(); FreeAllWindowBuffers(); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); gPaletteFade.delayCounter = gPaletteFade.multipurpose2; UpdatePaletteFade(); gTasks[taskId].func = Task_FadeToRouletteGame; diff --git a/src/save_failed_screen.c b/src/save_failed_screen.c index 50ceeb74e..bf6e4d6fb 100644 --- a/src/save_failed_screen.c +++ b/src/save_failed_screen.c @@ -236,7 +236,7 @@ static void CB2_SaveFailedScreen(void) CopyWindowToVram(gSaveFailedWindowIds[CLOCK_WIN_ID], 2); // again? CopyWindowToVram(gSaveFailedWindowIds[TEXT_WIN_ID], 1); SaveFailedScreenTextPrint(gText_SaveFailedCheckingBackup, 1, 0); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK); EnableInterrupts(1); SetVBlankCallback(VBlankCB); SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_OBJ_ON | DISPCNT_OBJ_1D_MAP); @@ -321,7 +321,7 @@ static void CB2_FadeAndReturnToTitleScreen(void) if (JOY_NEW(A_BUTTON)) { - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); SetVBlankCallback(VBlankCB); SetMainCallback2(CB2_ReturnToTitleScreen); } diff --git a/src/shop.c b/src/shop.c index 53610723e..26bd964c5 100755 --- a/src/shop.c +++ b/src/shop.c @@ -470,8 +470,8 @@ static void CB2_InitBuyMenu(void) BuyMenuAddScrollIndicatorArrows(); taskId = CreateTask(Task_BuyMenu, 8); gTasks[taskId].tListTaskId = ListMenuInit(&gMultiuseListMenuTemplate, 0, 0); - BlendPalettes(0xFFFFFFFF, 0x10, RGB_BLACK); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK); + BlendPalettes(PALETTES_ALL, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK); SetVBlankCallback(VBlankCB_BuyMenu); SetMainCallback2(CB2_BuyMenu); break; @@ -1152,7 +1152,7 @@ static void BuyMenuPrintItemQuantityAndPrice(u8 taskId) static void ExitBuyMenu(u8 taskId) { gFieldCallback = MapPostLoadHook_ReturnToShopMenu; - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); gTasks[taskId].func = Task_ExitBuyMenu; } diff --git a/src/slot_machine.c b/src/slot_machine.c index 806bf750d..199e01bdd 100644 --- a/src/slot_machine.c +++ b/src/slot_machine.c @@ -876,7 +876,7 @@ static void Task_FadeToSlotMachine(u8 taskId) switch (gTasks[taskId].tState) { case 0: - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK); gTasks[taskId].tState++; break; case 1: @@ -1149,7 +1149,7 @@ static void Task_SlotMachine(u8 taskId) // SLOT_ACTION_UNFADE static bool8 SlotAction_UnfadeScreen(struct Task *task) { - BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB(0, 0, 0)); + BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB(0, 0, 0)); LoadPikaPowerMeter(sSlotMachine->pikaPower); sSlotMachine->state++; // SLOT_ACTION_WAIT_FADE return FALSE; @@ -1593,7 +1593,7 @@ static bool8 SlotAction_EndGame(struct Task *task) { SetCoins(sSlotMachine->coins); AlertTVOfNewCoinTotal(GetCoins()); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB(0, 0, 0)); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB(0, 0, 0)); sSlotMachine->state++; // SLOT_ACTION_FREE return FALSE; } @@ -3422,7 +3422,7 @@ static void RunInfoBoxActions(u8 taskId) static void InfoBox_FadeIn(struct Task *task) { - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB(0, 0, 0)); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB(0, 0, 0)); task->tState++; } @@ -3446,7 +3446,7 @@ static void InfoBox_AddText(struct Task *task) { AddTextPrinterParameterized3(1, 1, 2, 5, sColors_ReeltimeHelp, 0, gText_ReelTimeHelp); CopyWindowToVram(1, 3); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB(0, 0, 0)); + BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB(0, 0, 0)); task->tState++; } @@ -3458,7 +3458,7 @@ static void InfoBox_AwaitPlayerInput(struct Task *task) ClearWindowTilemap(1); CopyWindowToVram(1, 1); RemoveWindow(1); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB(0, 0, 0)); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB(0, 0, 0)); task->tState++; } } @@ -3479,7 +3479,7 @@ static void InfoBox_CreateDigitalDisplay(struct Task *task) static void InfoBox_LoadPikaPowerMeter(struct Task *task) { LoadPikaPowerMeter(sSlotMachine->pikaPower); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB(0, 0, 0)); + BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB(0, 0, 0)); task->tState++; } diff --git a/src/start_menu.c b/src/start_menu.c index 8e165b3be..26a5097a6 100644 --- a/src/start_menu.c +++ b/src/start_menu.c @@ -1232,7 +1232,7 @@ static void Task_SaveAfterLinkBattle(u8 taskId) DrawTextBorderOuter(0, 8, 14); PutWindowTilemap(0); CopyWindowToVram(0, 3); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK); if (gWirelessCommType != 0 && InUnionRoom()) { @@ -1265,7 +1265,7 @@ static void Task_SaveAfterLinkBattle(u8 taskId) } break; case 3: - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); *state = 4; break; case 4: diff --git a/src/starter_choose.c b/src/starter_choose.c index aa8b87237..f29023d96 100644 --- a/src/starter_choose.c +++ b/src/starter_choose.c @@ -425,7 +425,7 @@ void CB2_ChooseStarter(void) LoadCompressedSpriteSheet(&sSpriteSheet_PokeballSelect[0]); LoadCompressedSpriteSheet(&sSpriteSheet_StarterCircle[0]); LoadSpritePalettes(sSpritePalettes_StarterChoose); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK); EnableInterrupts(DISPSTAT_VBLANK); SetVBlankCallback(VblankCB_StarterChoose); diff --git a/src/title_screen.c b/src/title_screen.c index 1d6f90d74..f86a0b0b3 100644 --- a/src/title_screen.c +++ b/src/title_screen.c @@ -580,7 +580,7 @@ void CB2_InitTitleScreen(void) break; } case 3: - BeginNormalPaletteFade(0xFFFFFFFF, 1, 0x10, 0, RGB_WHITEALPHA); + BeginNormalPaletteFade(PALETTES_ALL, 1, 0x10, 0, RGB_WHITEALPHA); SetVBlankCallback(VBlankCB); gMain.state = 4; break; @@ -730,7 +730,7 @@ static void Task_TitleScreenPhase3(u8 taskId) if ((JOY_NEW(A_BUTTON)) || (JOY_NEW(START_BUTTON))) { FadeOutBGM(4); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_WHITEALPHA); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_WHITEALPHA); SetMainCallback2(CB2_GoToMainMenu); } else if (JOY_HELD(CLEAR_SAVE_BUTTON_COMBO) == CLEAR_SAVE_BUTTON_COMBO) @@ -741,13 +741,13 @@ static void Task_TitleScreenPhase3(u8 taskId) && CanResetRTC() == TRUE) { FadeOutBGM(4); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK); SetMainCallback2(CB2_GoToResetRtcScreen); } else if (JOY_HELD(BERRY_UPDATE_BUTTON_COMBO) == BERRY_UPDATE_BUTTON_COMBO) { FadeOutBGM(4); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK); SetMainCallback2(CB2_GoToBerryFixScreen); } else @@ -764,7 +764,7 @@ static void Task_TitleScreenPhase3(u8 taskId) UpdateLegendaryMarkingColor(gTasks[taskId].tCounter); if ((gMPlayInfo_BGM.status & 0xFFFF) == 0) { - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_WHITEALPHA); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_WHITEALPHA); SetMainCallback2(CB2_GoToCopyrightScreen); } } diff --git a/src/trade.c b/src/trade.c index 5db85ceb8..436da66b0 100644 --- a/src/trade.c +++ b/src/trade.c @@ -584,7 +584,7 @@ static void CB2_CreateTradeMenu(void) gMain.state++; break; case 18: - BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK); gMain.state++; break; case 19: @@ -764,8 +764,8 @@ static void CB2_ReturnToTradeMenu(void) break; case 18: gPaletteFade.bufferTransferDisabled = FALSE; - BlendPalettes(0xFFFFFFFF, 16, RGB_BLACK); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK); + BlendPalettes(PALETTES_ALL, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK); gMain.state++; break; case 19: @@ -805,7 +805,7 @@ static void LinkTradeFadeOut(void) { if (++sTradeMenuData->timer > 15) { - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); sTradeMenuData->tradeMenuFunc = TRADEMENUFUNC_LINK_TRADE_WAIT_FADE; } } @@ -1164,7 +1164,7 @@ static void ReactToLinkTradeData(u8 mpId, u8 status) switch (gBlockRecvBuffer[0][0]) { case LINKCMD_CANCEL_TRADE: - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); PrintTradeMessage(TRADE_MSG_WAITING_FOR_FRIEND); sTradeMenuData->tradeMenuFunc = TRADEMENUFUNC_CANCEL_TRADE_1; break; @@ -1180,7 +1180,7 @@ static void ReactToLinkTradeData(u8 mpId, u8 status) sTradeMenuData->tradeMenuFunc = TRADEMENUFUNC_CONFIRM_TRADE_PROMPT; break; case LINKCMD_START_TRADE: - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); sTradeMenuData->tradeMenuFunc = TRADEMENUFUNC_LINK_TRADE_WAIT_FADE; break; case LINKCMD_0xDDEE: @@ -1235,7 +1235,7 @@ static void QueueLinkTradeData(void) sTradeMenuData->linkData[0] = LINKCMD_CANCEL_TRADE; sTradeMenuData->linkData[1] = 0; QueueAction(QUEUE_DELAY_DATA, QUEUE_SEND_DATA); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); sTradeMenuData->playerLinkFlagChoseAction = sTradeMenuData->partnerLinkFlagChoseAction = 0; sTradeMenuData->tradeMenuFunc = TRADEMENUFUNC_CANCEL_TRADE_1; } @@ -1387,7 +1387,7 @@ static void TradeMenuProcessInput(void) // Cursor is in partner's party else if (sTradeMenuData->cursorPosition < PARTY_SIZE * 2) { - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); sTradeMenuData->tradeMenuFunc = TRADEMENUFUNC_SHOW_MON_SUMMARY; } // Cursor is on Cancel @@ -1419,7 +1419,7 @@ static void TradeMenuProcessInput_SelectedMon(void) case MENU_NOTHING_CHOSEN: break; case 0: // Summary - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); sTradeMenuData->tradeMenuFunc = TRADEMENUFUNC_SHOW_MON_SUMMARY; break; case 1: // Trade @@ -2845,7 +2845,7 @@ void CB2_LinkTrade(void) gMain.state++; break; case 10: - BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK); ShowBg(0); gMain.state++; break; @@ -3336,7 +3336,7 @@ static bool8 AnimateTradeSequenceCable(void) // The game waits here for the sprite to finish its animation sequence. break; case 14: - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); sTradeData->state = 20; break; case 20: @@ -3349,7 +3349,7 @@ static bool8 AnimateTradeSequenceCable(void) } break; case 21: - BeginNormalPaletteFade(0xFFFFFFFF, -1, 16, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, -1, 16, 0, RGB_BLACK); sTradeData->state++; break; case 22: @@ -3426,7 +3426,7 @@ static bool8 AnimateTradeSequenceCable(void) } break; case 29: - BeginNormalPaletteFade(0xFFFFFFFF, -1, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, -1, 0, 16, RGB_BLACK); sTradeData->state = 30; break; case 30: @@ -3439,7 +3439,7 @@ static bool8 AnimateTradeSequenceCable(void) } break; case 31: - BeginNormalPaletteFade(0xFFFFFFFF, -1, 16, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, -1, 16, 0, RGB_BLACK); sTradeData->unk_90 = CreateSprite(&sGlowBallSpriteTemplate, 111, 170, 0); sTradeData->unk_91 = CreateSprite(&sGlowBallSpriteTemplate, 129, -10, 0); sTradeData->state++; @@ -3518,7 +3518,7 @@ static bool8 AnimateTradeSequenceCable(void) gSprites[sTradeData->unk_91].pos2.y += 3; if (gSprites[sTradeData->unk_90].pos2.y <= -222) { - BeginNormalPaletteFade(0xFFFFFFFF, -1, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, -1, 0, 16, RGB_BLACK); sTradeData->state++; DestroySprite(&gSprites[sTradeData->unk_90]); DestroySprite(&gSprites[sTradeData->unk_91]); @@ -3536,7 +3536,7 @@ static bool8 AnimateTradeSequenceCable(void) } break; case 41: - BeginNormalPaletteFade(0xFFFFFFFF, -1, 16, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, -1, 16, 0, RGB_BLACK); sTradeData->state++; break; case 42: @@ -3614,7 +3614,7 @@ static bool8 AnimateTradeSequenceCable(void) sTradeData->sXY = 0x8000 / sTradeData->unk_EA; break; case 52: - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); sTradeData->state = 60; break; @@ -3629,7 +3629,7 @@ static bool8 AnimateTradeSequenceCable(void) break; case 61: gPaletteFade.bufferTransferDisabled = FALSE; - BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK); sTradeData->state++; break; case 62: @@ -3743,7 +3743,7 @@ static bool8 AnimateTradeSequenceCable(void) sTradeData->state++; break; case 73: - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); sTradeData->state++; break; case 74: @@ -3828,7 +3828,7 @@ static bool8 AnimateTradeSequenceWireless(void) // The game waits here for the sprite to finish its animation sequence. break; case 14: - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); sTradeData->state = 20; break; case 20: @@ -3841,7 +3841,7 @@ static bool8 AnimateTradeSequenceWireless(void) } break; case 21: - BeginNormalPaletteFade(0xFFFFFFFF, -1, 16, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, -1, 16, 0, RGB_BLACK); sTradeData->state++; break; case 22: @@ -3923,7 +3923,7 @@ static bool8 AnimateTradeSequenceWireless(void) } break; case 29: - BeginNormalPaletteFade(0xFFFFFFFF, -1, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, -1, 0, 16, RGB_BLACK); sTradeData->state = 30; break; case 30: @@ -3936,7 +3936,7 @@ static bool8 AnimateTradeSequenceWireless(void) } break; case 31: - BeginNormalPaletteFade(0xFFFFFFFF, -1, 16, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, -1, 16, 0, RGB_BLACK); sTradeData->unk_90 = CreateSprite(&sGlowBallSpriteTemplate, 111, 170, 0); sTradeData->unk_91 = CreateSprite(&sGlowBallSpriteTemplate, 129, -10, 0); sTradeData->state++; @@ -4016,7 +4016,7 @@ static bool8 AnimateTradeSequenceWireless(void) gSprites[sTradeData->unk_91].pos2.y += 3; if (gSprites[sTradeData->unk_90].pos2.y <= -222) { - BeginNormalPaletteFade(0xFFFFFFFF, -1, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, -1, 0, 16, RGB_BLACK); sTradeData->state++; DestroySprite(&gSprites[sTradeData->unk_90]); DestroySprite(&gSprites[sTradeData->unk_91]); @@ -4037,7 +4037,7 @@ static bool8 AnimateTradeSequenceWireless(void) } break; case 41: - BeginNormalPaletteFade(0xFFFFFFFF, -1, 16, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, -1, 16, 0, RGB_BLACK); sTradeData->state++; break; case 42: @@ -4130,7 +4130,7 @@ static bool8 AnimateTradeSequenceWireless(void) sTradeData->sXY = 0x8000 / sTradeData->unk_EA; break; case 52: - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); sTradeData->state = 60; break; case 60: @@ -4144,7 +4144,7 @@ static bool8 AnimateTradeSequenceWireless(void) break; case 61: gPaletteFade.bufferTransferDisabled = FALSE; - BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK); sTradeData->state++; break; case 62: @@ -4258,7 +4258,7 @@ static bool8 AnimateTradeSequenceWireless(void) sTradeData->state++; break; case 73: - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); sTradeData->state++; break; case 74: @@ -4667,7 +4667,7 @@ static void CB2_SaveAndEndTrade(void) case 6: if (_IsLinkTaskFinished()) { - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); gMain.state ++; } break; @@ -4741,7 +4741,7 @@ void DoInGameTradeScene(void) { ScriptContext2_Enable(); CreateTask(Task_InGameTrade, 10); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); } static void Task_InGameTrade(u8 taskId) @@ -4974,7 +4974,7 @@ static void CB2_SaveAndEndWirelessTrade(void) if (_IsLinkTaskFinished()) { FadeOutBGM(3); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); gMain.state = 11; } break; diff --git a/src/trainer_card.c b/src/trainer_card.c index 791f1c290..c42c16845 100755 --- a/src/trainer_card.c +++ b/src/trainer_card.c @@ -414,8 +414,8 @@ static void Task_TrainerCard(u8 taskId) LoadWirelessStatusIndicatorSpriteGfx(); CreateWirelessStatusIndicatorSprite(230, 150); } - BlendPalettes(0xFFFFFFFF, 16, sData->blendColor); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, sData->blendColor); + BlendPalettes(PALETTES_ALL, 16, sData->blendColor); + BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, sData->blendColor); SetVBlankCallback(VblankCb_TrainerCard); sData->mainState++; break; @@ -452,7 +452,7 @@ static void Task_TrainerCard(u8 taskId) } else { - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, sData->blendColor); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, sData->blendColor); sData->mainState = STATE_CLOSE_CARD; } } @@ -473,7 +473,7 @@ static void Task_TrainerCard(u8 taskId) } else if (gReceivedRemoteLinkPlayers) { - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, sData->blendColor); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, sData->blendColor); sData->mainState = STATE_CLOSE_CARD; } else @@ -491,7 +491,7 @@ static void Task_TrainerCard(u8 taskId) } else { - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, sData->blendColor); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, sData->blendColor); sData->mainState = STATE_CLOSE_CARD; } } @@ -506,7 +506,7 @@ static void Task_TrainerCard(u8 taskId) case STATE_CLOSE_CARD_LINK: if (!gReceivedRemoteLinkPlayers) { - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, sData->blendColor); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, sData->blendColor); sData->mainState = STATE_CLOSE_CARD; } break; diff --git a/src/union_room.c b/src/union_room.c index 479792a7c..a12b385f5 100644 --- a/src/union_room.c +++ b/src/union_room.c @@ -2986,7 +2986,7 @@ static void Task_RunUnionRoom(u8 taskId) uroom->state = UR_STATE_START_ACTIVITY_FADE; break; case UR_STATE_START_ACTIVITY_FADE: - BeginNormalPaletteFade(-1, 0, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK); uroom->state = UR_STATE_START_ACTIVITY; break; case UR_STATE_START_ACTIVITY: @@ -3050,7 +3050,7 @@ static void Task_RunUnionRoom(u8 taskId) } break; case UR_STATE_REGISTER_SELECT_MON_FADE: - BeginNormalPaletteFade(-1, 0, 0, 0x10, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK); uroom->state = UR_STATE_REGISTER_SELECT_MON; break; case UR_STATE_REGISTER_SELECT_MON: diff --git a/src/union_room_battle.c b/src/union_room_battle.c index b9ddd74a7..c212e4706 100644 --- a/src/union_room_battle.c +++ b/src/union_room_battle.c @@ -143,7 +143,7 @@ void CB2_UnionRoomBattle(void) } break; case 2: - BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK); ShowBg(0); gMain.state++; break; @@ -169,7 +169,7 @@ void CB2_UnionRoomBattle(void) if (gBlockRecvBuffer[0][0] == (ACTIVITY_ACCEPT | IN_UNION_ROOM) && gBlockRecvBuffer[1][0] == (ACTIVITY_ACCEPT | IN_UNION_ROOM)) { - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); gMain.state = 50; } else diff --git a/src/union_room_chat.c b/src/union_room_chat.c index 7b54dc751..3733abe1e 100755 --- a/src/union_room_chat.c +++ b/src/union_room_chat.c @@ -930,8 +930,8 @@ static void CB2_LoadInterface(void) RunDisplaySubtasks(); if (!IsDisplaySubtask0Active()) { - BlendPalettes(0xFFFFFFFF, 16, RGB_BLACK); - BeginNormalPaletteFade(0xFFFFFFFF, -1, 16, 0, RGB_BLACK); + BlendPalettes(PALETTES_ALL, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, -1, 16, 0, RGB_BLACK); SetVBlankCallback(VBlankCB_UnionRoomChatMain); gMain.state++; } @@ -1567,7 +1567,7 @@ static void Chat_SaveAndExit(void) sChat->funcState = 12; break; case 12: - BeginNormalPaletteFade(0xFFFFFFFF, -1, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, -1, 0, 16, RGB_BLACK); sChat->funcState = 13; break; case 13: diff --git a/src/use_pokeblock.c b/src/use_pokeblock.c index 7298ac9f1..5d8f5ce24 100644 --- a/src/use_pokeblock.c +++ b/src/use_pokeblock.c @@ -569,7 +569,7 @@ static void ShowUsePokeblockMenu(void) switch (sInfo->mainState) { case 0: - BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK); SetVBlankCallback(VBlankCB_UsePokeblockMenu); ShowBg(0); ShowBg(1); @@ -695,7 +695,7 @@ static void FeedPokeblockToMon(void) gPokeblockMonId = GetPartyIdFromSelectionId(sMenu->info.curSelection); sExitCallback = sInfo->exitCallback; sPokeblock = sInfo->pokeblock; - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); sInfo->mainState++; break; case 1: @@ -739,7 +739,7 @@ static void ShowUsePokeblockMenuForResults(void) case 2: break; case 3: - BlendPalettes(0xFFFFFFFF, 16, RGB_BLACK); + BlendPalettes(PALETTES_ALL, 16, RGB_BLACK); sInfo->mainState++; break; case 4: @@ -751,7 +751,7 @@ static void ShowUsePokeblockMenuForResults(void) break; case 5: SetVBlankCallback(VBlankCB_UsePokeblockMenu); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK); sInfo->mainState++; break; case 6: @@ -827,7 +827,7 @@ static void CloseUsePokeblockMenu(void) switch (sInfo->mainState) { case 0: - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); sInfo->mainState++; break; case 1: diff --git a/src/wallclock.c b/src/wallclock.c index c38dd99e3..4d1c1fd8f 100644 --- a/src/wallclock.c +++ b/src/wallclock.c @@ -665,7 +665,7 @@ static void LoadWallClockGraphics(void) static void WallClockInit(void) { - BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK); EnableInterrupts(INTR_FLAG_VBLANK); SetVBlankCallback(VBlankCB_WallClock); SetMainCallback2(CB2_WallClock); @@ -856,7 +856,7 @@ static void Task_SetClock_HandleConfirmInput(u8 taskId) static void Task_SetClock_Confirmed(u8 taskId) { RtcInitLocalTimeOffset(gTasks[taskId].tHours, gTasks[taskId].tMinutes); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); gTasks[taskId].func = Task_SetClock_Exit; } @@ -884,7 +884,7 @@ static void Task_ViewClock_HandleInput(u8 taskId) static void Task_ViewClock_FadeOut(u8 taskId) { - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK); gTasks[taskId].func = Task_ViewClock_Exit; } diff --git a/src/wireless_communication_status_screen.c b/src/wireless_communication_status_screen.c index 87b200f14..23d63832f 100644 --- a/src/wireless_communication_status_screen.c +++ b/src/wireless_communication_status_screen.c @@ -260,7 +260,7 @@ static void Task_WirelessCommunicationScreen(u8 taskId) gTasks[taskId].tState++; break; case 1: - BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, 0); + BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, 0); ShowBg(1); CopyBgTilemapBufferToVram(0); ShowBg(0); @@ -296,7 +296,7 @@ static void Task_WirelessCommunicationScreen(u8 taskId) WCSS_CyclePalette(&gTasks[taskId].data[7], &gTasks[taskId].data[8]); break; case 4: - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, 0); + BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, 0); gTasks[taskId].tState++; break; case 5: From 293df1887f4b849e96d06530c722bd39afb7b72b Mon Sep 17 00:00:00 2001 From: GriffinR Date: Wed, 24 Feb 2021 11:26:26 -0500 Subject: [PATCH 8/9] Fix comment typo --- src/script.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/script.c b/src/script.c index 701042da2..726c06543 100644 --- a/src/script.c +++ b/src/script.c @@ -72,7 +72,7 @@ bool8 RunScriptCommand(struct ScriptContext *ctx) return FALSE; case SCRIPT_MODE_NATIVE: // Try to call a function in C - // Continue to bytecode if no function it returns TRUE + // Continue to bytecode if no function or it returns TRUE if (ctx->nativePtr) { if (ctx->nativePtr() == TRUE) From c323e7f061152a732fba39cb4a7c05ffb121d63b Mon Sep 17 00:00:00 2001 From: Marcus Huderle Date: Sat, 27 Feb 2021 11:04:45 -0600 Subject: [PATCH 9/9] Document some battle anim funcs and data --- data/battle_anim_scripts.s | 2 +- include/battle_anim.h | 10 ++-- src/battle_anim.c | 8 +-- src/battle_anim_dark.c | 8 +-- src/battle_anim_dragon.c | 60 +++++++++++----------- src/battle_anim_effects_2.c | 8 +-- src/battle_anim_effects_3.c | 10 ++-- src/battle_anim_electric.c | 62 +++++++++++------------ src/battle_anim_fight.c | 12 ++--- src/battle_anim_fire.c | 90 +++++++++++++++------------------ src/battle_anim_flying.c | 62 ++++++++++++----------- src/battle_anim_ice.c | 8 +-- src/battle_anim_mons.c | 54 ++++++++++---------- src/battle_anim_rock.c | 12 ++--- src/battle_anim_sound_tasks.c | 33 +++++------- src/battle_anim_throw.c | 2 +- src/battle_anim_utility_funcs.c | 12 ++--- src/battle_anim_water.c | 16 +++--- 18 files changed, 228 insertions(+), 241 deletions(-) diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index 2344007a5..2e42848ab 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -854,7 +854,7 @@ Move_TWINEEDLE: Move_FIRE_BLAST: loadspritegfx ANIM_TAG_SMALL_EMBER - createsoundtask sub_8158B30, SE_M_FLAME_WHEEL, SE_M_FLAME_WHEEL2 + createsoundtask SoundTask_FireBlast, SE_M_FLAME_WHEEL, SE_M_FLAME_WHEEL2 call FireBlastRing call FireBlastRing call FireBlastRing diff --git a/include/battle_anim.h b/include/battle_anim.h index 046ddb08c..c1231c2de 100644 --- a/include/battle_anim.h +++ b/include/battle_anim.h @@ -108,7 +108,7 @@ u8 GetBattlerSpriteBGPriority(u8 battlerId); void *LoadPointerFromVars(s16 bottom, s16 top); void StorePointerInVars(s16 *bottom, s16 *top, const void *ptr); void sub_80A8278(void); -void sub_80A6B30(struct BattleAnimBgData*); +void GetDefaultBattleAnimBgData(struct BattleAnimBgData*); void sub_80A6B90(struct BattleAnimBgData*, u32 arg1); u8 GetBattlerSpriteSubpriority(u8 battlerId); bool8 TranslateAnimHorizontalArc(struct Sprite *sprite); @@ -127,12 +127,12 @@ void obj_delete_but_dont_free_vram(struct Sprite*); u8 sub_80A89C8(int, u8, int); void AnimLoadCompressedBgTilemapHandleContest(struct BattleAnimBgData*, const void*, u32); void AnimLoadCompressedBgGfx(u32, const u32*, u32); -void sub_80A6DAC(bool8); +void UpdateAnimBg3ScreenSize(bool8); void TranslateSpriteInGrowingCircleOverDuration(struct Sprite *); void sub_80A653C(struct Sprite *); void SetBattlerSpriteYOffsetFromYScale(u8 spriteId); -void sub_80A805C(struct Task *task, u8 a2, s16 a3, s16 a4, s16 a5, s16 a6, u16 a7); -u8 sub_80A80C8(struct Task *task); +void PrepareEruptAnimTaskData(struct Task *task, u8 a2, s16 a3, s16 a4, s16 a5, s16 a6, u16 a7); +u8 UpdateEruptAnimTask(struct Task *task); void DestroyAnimSpriteAndDisableBlend(struct Sprite *); void AnimLoadCompressedBgTilemap(u32 bgId, const void *src); void InitAnimFastLinearTranslationWithSpeed(struct Sprite *sprite); @@ -149,7 +149,7 @@ bool8 RunAffineAnimFromTaskData(struct Task *task); void AnimThrowProjectile(struct Sprite *sprite); void sub_80A6BFC(struct BattleAnimBgData *unk, u8 unused); u8 CreateAdditionalMonSpriteForMoveAnim(u16 species, bool8 isBackpic, u8 a3, s16 x, s16 y, u8 subpriority, u32 personality, u32 trainerId, u32 battlerId, bool32 ignoreDeoxysForm); -void sub_80A749C(struct Sprite *sprite); +void ResetSpriteRotScale_PreserveAffine(struct Sprite *sprite); void TradeMenuBouncePartySprites(struct Sprite *sprite); void DestroyAnimVisualTaskAndDisableBlend(u8 taskId); void DestroySpriteAndFreeResources_(struct Sprite *sprite); diff --git a/src/battle_anim.c b/src/battle_anim.c index 874ac935b..d242ee94a 100644 --- a/src/battle_anim.c +++ b/src/battle_anim.c @@ -2300,7 +2300,7 @@ void MoveBattlerSpriteToBG(u8 battlerId, bool8 toBG_2, bool8 setSpriteInvisible) RequestDma3Fill(0xFF, (void*)(BG_SCREEN_ADDR(28)), 0x1000, 0); } - sub_80A6B30(&animBg); + GetDefaultBattleAnimBgData(&animBg); CpuFill16(0, animBg.bgTiles, 0x1000); CpuFill16(0xFF, animBg.bgTilemap, 0x800); @@ -2371,7 +2371,7 @@ static void sub_80A46A0(void) if (IsSpeciesNotUnown(gContestResources->moveAnim->species)) { - sub_80A6B30(&animBg); + GetDefaultBattleAnimBgData(&animBg); ptr = animBg.bgTilemap; for (i = 0; i < 8; i++) { @@ -2411,7 +2411,7 @@ void sub_80A4720(u16 a, u16 *b, u32 c, u8 d) void sub_80A477C(bool8 to_BG2) { struct BattleAnimBgData animBg; - sub_80A6B30(&animBg); + GetDefaultBattleAnimBgData(&animBg); if (!to_BG2 || IsContest()) { @@ -2435,7 +2435,7 @@ static void task_pA_ma0A_obj_to_bg_pal(u8 taskId) spriteId = gTasks[taskId].data[0]; palIndex = gTasks[taskId].data[6]; - sub_80A6B30(&animBg); + GetDefaultBattleAnimBgData(&animBg); x = gTasks[taskId].data[1] - (gSprites[spriteId].pos1.x + gSprites[spriteId].pos2.x); y = gTasks[taskId].data[2] - (gSprites[spriteId].pos1.y + gSprites[spriteId].pos2.y); diff --git a/src/battle_anim_dark.c b/src/battle_anim_dark.c index 7253b5247..d70d70d44 100644 --- a/src/battle_anim_dark.c +++ b/src/battle_anim_dark.c @@ -423,7 +423,7 @@ void AnimTask_MoveAttackerMementoShadow(u8 taskId) task->data[3] = GetBattlerSpriteBGPriorityRank(gBattleAnimAttacker); if (task->data[3] == 1) { - sub_80A6B30(&animBg); + GetDefaultBattleAnimBgData(&animBg); task->data[10] = gBattle_BG1_Y; SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT2_ALL | BLDCNT_EFFECT_BLEND | BLDCNT_TGT1_BG1); FillPalette(0, animBg.paletteId * 16, 32); @@ -564,7 +564,7 @@ void AnimTask_MoveTargetMementoShadow(u8 taskId) case 1: if (task->data[3] == 1) { - sub_80A6B30(&animBg); + GetDefaultBattleAnimBgData(&animBg); task->data[10] = gBattle_BG1_Y; FillPalette(0, animBg.paletteId * 16, 32); } @@ -860,7 +860,7 @@ void AnimTask_MetallicShine(u8 taskId) spriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER); newSpriteId = sub_80A89C8(gBattleAnimAttacker, spriteId, species); - sub_80A6B30(&animBg); + GetDefaultBattleAnimBgData(&animBg); AnimLoadCompressedBgTilemap(animBg.bgId, gMetalShineTilemap); AnimLoadCompressedBgGfx(animBg.bgId, gMetalShineGfx, animBg.tilesOffset); LoadCompressedPalette(gMetalShinePalette, animBg.paletteId * 16, 32); @@ -903,7 +903,7 @@ static void AnimTask_MetallicShine_Step(u8 taskId) SetGreyscaleOrOriginalPalette(paletteNum, TRUE); DestroySprite(&gSprites[gTasks[taskId].data[0]]); - sub_80A6B30(&animBg); + GetDefaultBattleAnimBgData(&animBg); sub_80A6C68(animBg.bgId); if (gTasks[taskId].data[6] == 1) gSprites[gBattlerSpriteIds[BATTLE_PARTNER(gBattleAnimAttacker)]].oam.priority++; diff --git a/src/battle_anim_dragon.c b/src/battle_anim_dragon.c index 1d426cac7..caafdf3b8 100644 --- a/src/battle_anim_dragon.c +++ b/src/battle_anim_dragon.c @@ -13,11 +13,11 @@ static void AnimDragonDanceOrb_Step(struct Sprite *); static void AnimOverheatFlame(struct Sprite *); static void AnimOverheatFlame_Step(struct Sprite *); static void AnimTask_DragonDanceWaver_Step(u8); -static void sub_8113574(struct Task *); +static void UpdateDragonDanceScanlineEffect(struct Task *); -EWRAM_DATA static u16 gUnknown_0203A100[7] = {0}; +EWRAM_DATA static u16 gUnusedOverheatData[7] = {0}; -static const union AnimCmd gUnknown_08596E60[] = +static const union AnimCmd sAnim_OutrageOverheatFire_0[] = { ANIMCMD_FRAME(0, 4), ANIMCMD_FRAME(16, 4), @@ -27,9 +27,9 @@ static const union AnimCmd gUnknown_08596E60[] = ANIMCMD_JUMP(0), }; -static const union AnimCmd *const gUnknown_08596E78[] = +static const union AnimCmd *const sAnims_OutrageOverheatFire[] = { - gUnknown_08596E60, + sAnim_OutrageOverheatFire_0, }; const struct SpriteTemplate gOutrageFlameSpriteTemplate = @@ -37,7 +37,7 @@ const struct SpriteTemplate gOutrageFlameSpriteTemplate = .tileTag = ANIM_TAG_SMALL_EMBER, .paletteTag = ANIM_TAG_SMALL_EMBER, .oam = &gOamData_AffineOff_ObjNormal_32x32, - .anims = gUnknown_08596E78, + .anims = sAnims_OutrageOverheatFire, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimOutrageFlame, @@ -181,7 +181,7 @@ const struct SpriteTemplate gOverheatFlameSpriteTemplate = .tileTag = ANIM_TAG_SMALL_EMBER, .paletteTag = ANIM_TAG_SMALL_EMBER, .oam = &gOamData_AffineOff_ObjNormal_32x32, - .anims = gUnknown_08596E78, + .anims = sAnims_OutrageOverheatFire, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimOverheatFlame, @@ -212,7 +212,7 @@ static void AnimOutrageFlame(struct Sprite *sprite) sprite->callback = TranslateSpriteLinearAndFlicker; } -static void sub_8113100(struct Sprite *sprite) +static void StartDragonFireTranslation(struct Sprite *sprite) { SetSpriteCoordsToAnimAttackerCoords(sprite); sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2); @@ -263,7 +263,7 @@ static void AnimDragonFireToTarget(struct Sprite *sprite) if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) StartSpriteAffineAnim(sprite, 1); - sub_8113100(sprite); + StartDragonFireTranslation(sprite); } static void AnimDragonDanceOrb(struct Sprite *sprite) @@ -328,27 +328,27 @@ static void AnimDragonDanceOrb_Step(struct Sprite *sprite) // Used by Dragon Dance void AnimTask_DragonDanceWaver(u8 taskId) { - struct ScanlineEffectParams sp; + struct ScanlineEffectParams scanlineParams; struct Task *task = &gTasks[taskId]; u16 i; - u8 r1; + u8 y; if (GetBattlerSpriteBGPriorityRank(gBattleAnimAttacker) == 1) { - sp.dmaDest = ®_BG1HOFS; + scanlineParams.dmaDest = ®_BG1HOFS; task->data[2] = gBattle_BG1_X; } else { - sp.dmaDest = ®_BG2HOFS; + scanlineParams.dmaDest = ®_BG2HOFS; task->data[2] = gBattle_BG2_X; } - sp.dmaControl = 0xA2600001; - sp.initState = 1; - sp.unused9 = 0; - r1 = GetBattlerYCoordWithElevation(gBattleAnimAttacker); - task->data[3] = r1 - 32; - task->data[4] = r1 + 32; + scanlineParams.dmaControl = SCANLINE_EFFECT_DMACNT_16BIT; + scanlineParams.initState = 1; + scanlineParams.unused9 = 0; + y = GetBattlerYCoordWithElevation(gBattleAnimAttacker); + task->data[3] = y - 32; + task->data[4] = y + 32; if (task->data[3] < 0) task->data[3] = 0; @@ -358,7 +358,7 @@ void AnimTask_DragonDanceWaver(u8 taskId) gScanlineEffectRegBuffers[1][i] = task->data[2]; } - ScanlineEffect_SetParams(sp); + ScanlineEffect_SetParams(scanlineParams); task->func = AnimTask_DragonDanceWaver_Step; } @@ -374,12 +374,12 @@ static void AnimTask_DragonDanceWaver_Step(u8 taskId) if (++task->data[6] == 3) task->data[0]++; } - sub_8113574(task); + UpdateDragonDanceScanlineEffect(task); break; case 1: if (++task->data[1] > 0x3C) task->data[0]++; - sub_8113574(task); + UpdateDragonDanceScanlineEffect(task); break; case 2: if (++task->data[7] > 1) @@ -388,7 +388,7 @@ static void AnimTask_DragonDanceWaver_Step(u8 taskId) if (--task->data[6] == 0) task->data[0]++; } - sub_8113574(task); + UpdateDragonDanceScanlineEffect(task); break; case 3: gScanlineEffect.state = 3; @@ -400,14 +400,14 @@ static void AnimTask_DragonDanceWaver_Step(u8 taskId) } } -static void sub_8113574(struct Task *task) +static void UpdateDragonDanceScanlineEffect(struct Task *task) { - u16 r3 = task->data[5]; + u16 sineIndex = task->data[5]; u16 i; for (i = task->data[3]; i <= task->data[4]; i++) { - gScanlineEffectRegBuffers[gScanlineEffect.srcBuffer][i] = ((gSineTable[r3] * task->data[6]) >> 7) + task->data[2]; - r3 = (r3 + 8) & 0xFF; + gScanlineEffectRegBuffers[gScanlineEffect.srcBuffer][i] = ((gSineTable[sineIndex] * task->data[6]) >> 7) + task->data[2]; + sineIndex = (sineIndex + 8) & 0xFF; } task->data[5] = (task->data[5] + 9) & 0xFF; @@ -415,18 +415,18 @@ static void sub_8113574(struct Task *task) static void AnimOverheatFlame(struct Sprite *sprite) { - int r6 = (gBattleAnimArgs[2] * 3) / 5; int i; + int yAmplitude = (gBattleAnimArgs[2] * 3) / 5; sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3) + gBattleAnimArgs[4]; sprite->data[1] = Cos(gBattleAnimArgs[1], gBattleAnimArgs[2]); - sprite->data[2] = Sin(gBattleAnimArgs[1], r6); + sprite->data[2] = Sin(gBattleAnimArgs[1], yAmplitude); sprite->pos1.x += sprite->data[1] * gBattleAnimArgs[0]; sprite->pos1.y += sprite->data[2] * gBattleAnimArgs[0]; sprite->data[3] = gBattleAnimArgs[3]; sprite->callback = AnimOverheatFlame_Step; for (i = 0; i < 7; i++) - gUnknown_0203A100[i] = sprite->data[i]; + gUnusedOverheatData[i] = sprite->data[i]; } static void AnimOverheatFlame_Step(struct Sprite *sprite) diff --git a/src/battle_anim_effects_2.c b/src/battle_anim_effects_2.c index f8d46af3f..154c8629b 100755 --- a/src/battle_anim_effects_2.c +++ b/src/battle_anim_effects_2.c @@ -3248,7 +3248,7 @@ void AnimTask_HeartsBackground(u8 taskId) gBattle_BG1_Y = 0; SetGpuReg(REG_OFFSET_BG1HOFS, gBattle_BG1_X); SetGpuReg(REG_OFFSET_BG1VOFS, gBattle_BG1_Y); - sub_80A6B30(&animBg); + GetDefaultBattleAnimBgData(&animBg); AnimLoadCompressedBgGfx(animBg.bgId, &gBattleAnimBgImage_Attract, animBg.tilesOffset); AnimLoadCompressedBgTilemapHandleContest(&animBg, &gBattleAnimBgTilemap_Attract, 0); LoadCompressedPalette(&gBattleAnimBgPalette_Attract, animBg.paletteId * 16, 32); @@ -3295,7 +3295,7 @@ static void AnimTask_HeartsBackground_Step(u8 taskId) } break; case 3: - sub_80A6B30(&animBg); + GetDefaultBattleAnimBgData(&animBg); sub_80A6C68(animBg.bgId); gTasks[taskId].data[12]++; break; @@ -3326,7 +3326,7 @@ void AnimTask_ScaryFace(u8 taskId) gBattle_BG1_Y = 0; SetGpuReg(REG_OFFSET_BG1HOFS, gBattle_BG1_X); SetGpuReg(REG_OFFSET_BG1VOFS, gBattle_BG1_Y); - sub_80A6B30(&animBg); + GetDefaultBattleAnimBgData(&animBg); if (IsContest()) AnimLoadCompressedBgTilemapHandleContest(&animBg, &gBattleAnimBgTilemap_ScaryFaceContest, 0); else if (GetBattlerSide(gBattleAnimTarget) == B_SIDE_OPPONENT) @@ -3379,7 +3379,7 @@ static void AnimTask_ScaryFace_Step(u8 taskId) } break; case 3: - sub_80A6B30(&animBg); + GetDefaultBattleAnimBgData(&animBg); sub_80A6C68(1); sub_80A6C68(2); gTasks[taskId].data[12]++; diff --git a/src/battle_anim_effects_3.c b/src/battle_anim_effects_3.c index 7be5fa31c..eee2354b3 100755 --- a/src/battle_anim_effects_3.c +++ b/src/battle_anim_effects_3.c @@ -2387,7 +2387,7 @@ void AnimTask_MorningSunLightBeam(u8 taskId) if (!IsContest()) SetAnimBgAttribute(1, BG_ANIM_CHAR_BASE_BLOCK, 1); - sub_80A6B30(&animBg); + GetDefaultBattleAnimBgData(&animBg); AnimLoadCompressedBgTilemapHandleContest(&animBg, &gBattleAnimMaskTilemap_LightBeam, 0); if (IsContest()) { @@ -2450,7 +2450,7 @@ void AnimTask_MorningSunLightBeam(u8 taskId) } break; case 4: - sub_80A6B30(&animBg); + GetDefaultBattleAnimBgData(&animBg); sub_80A6C68(animBg.bgId); if (!IsContest()) SetAnimBgAttribute(1, BG_ANIM_CHAR_BASE_BLOCK, 0); @@ -2568,7 +2568,7 @@ void AnimTask_DoomDesireLightBeam(u8 taskId) if (!IsContest()) SetAnimBgAttribute(1, BG_ANIM_CHAR_BASE_BLOCK, 1); - sub_80A6B30(&animBg); + GetDefaultBattleAnimBgData(&animBg); AnimLoadCompressedBgTilemapHandleContest(&animBg, &gBattleAnimMaskTilemap_LightBeam, 0); if (IsContest()) { @@ -2639,7 +2639,7 @@ void AnimTask_DoomDesireLightBeam(u8 taskId) gTasks[taskId].data[0] = 1; break; case 5: - sub_80A6B30(&animBg); + GetDefaultBattleAnimBgData(&animBg); sub_80A6C68(animBg.bgId); if (!IsContest()) SetAnimBgAttribute(1, BG_ANIM_CHAR_BASE_BLOCK, 0); @@ -3286,7 +3286,7 @@ static void AnimTask_RolePlaySilhouette_Step2(u8 taskId) TrySetSpriteRotScale(&gSprites[spriteId], TRUE, gTasks[taskId].data[10], gTasks[taskId].data[11], 0); if (++gTasks[taskId].data[12] == 9) { - sub_80A749C(&gSprites[spriteId]); + ResetSpriteRotScale_PreserveAffine(&gSprites[spriteId]); DestroySpriteAndFreeResources_(&gSprites[spriteId]); gTasks[taskId].func = DestroyAnimVisualTaskAndDisableBlend; } diff --git a/src/battle_anim_electric.c b/src/battle_anim_electric.c index a57e88b03..1e24f8a16 100644 --- a/src/battle_anim_electric.c +++ b/src/battle_anim_electric.c @@ -7,9 +7,9 @@ static void AnimLightning(struct Sprite *); static void AnimLightning_Step(struct Sprite *); -static void sub_810A214(struct Sprite *); -static void sub_810A258(struct Sprite *); -static void sub_810A274(struct Sprite *); +static void AnimUnused_0810A214(struct Sprite *); +static void AnimUnused_0810A214_Step(struct Sprite *); +static void AnimUnused_0810A274(struct Sprite *); static void AnimSparkElectricity(struct Sprite *); static void AnimZapCannonSpark(struct Sprite *); static void AnimZapCannonSpark_Step(struct Sprite *); @@ -29,13 +29,13 @@ static void AnimGrowingChargeOrb(struct Sprite *); static void AnimElectricPuff(struct Sprite *); static void AnimVoltTackleOrbSlide(struct Sprite *); static void AnimVoltTackleOrbSlide_Step(struct Sprite *); -static bool8 sub_810B154(struct Task *task, u8 taskId); +static bool8 CreateVoltTackleBolt(struct Task *task, u8 taskId); static void AnimVoltTackleBolt(struct Sprite *); static void AnimGrowingShockWaveOrb(struct Sprite *); -static bool8 sub_810B430(struct Task *task, u8 taskId); +static bool8 CreateShockWaveBoltSprite(struct Task *task, u8 taskId); static void AnimShockWaveProgressingBolt(struct Sprite *); -static bool8 sub_810B614(struct Task *task, u8 taskId); -static void sub_810B684(struct Sprite *sprite); +static bool8 CreateShockWaveLightningSprite(struct Task *task, u8 taskId); +static void AnimShockWaveLightning(struct Sprite *sprite); static const union AnimCmd sAnim_Lightning[] = { @@ -63,7 +63,7 @@ const struct SpriteTemplate gLightningSpriteTemplate = .callback = AnimLightning, }; -static const union AffineAnimCmd gUnknown_085956D8[] = +static const union AffineAnimCmd sAnim_Unused_085956D8[] = { AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0), AFFINEANIMCMD_FRAME(0x0, 0x0, 0, 20), @@ -71,24 +71,24 @@ static const union AffineAnimCmd gUnknown_085956D8[] = AFFINEANIMCMD_END, }; -static const union AffineAnimCmd *const gUnknown_085956F8[] = +static const union AffineAnimCmd *const sAnims_Unused_085956F8[] = { - gUnknown_085956D8, + sAnim_Unused_085956D8, }; // Unused -const struct SpriteTemplate gUnknown_085956FC = +const struct SpriteTemplate gUnusedSpriteTemplate_085956FC = { .tileTag = ANIM_TAG_HANDS_AND_FEET, .paletteTag = ANIM_TAG_HANDS_AND_FEET, .oam = &gOamData_AffineNormal_ObjNormal_32x32, .anims = gDummySpriteAnimTable, .images = NULL, - .affineAnims = gUnknown_085956F8, - .callback = sub_810A214, + .affineAnims = sAnims_Unused_085956F8, + .callback = AnimUnused_0810A214, }; -static const union AnimCmd gUnknown_08595714[] = +static const union AnimCmd sAnim_Unused_08595714[] = { ANIMCMD_FRAME(0, 5), ANIMCMD_FRAME(16, 5), @@ -99,21 +99,21 @@ static const union AnimCmd gUnknown_08595714[] = ANIMCMD_JUMP(0), }; -static const union AnimCmd *const gUnknown_08595730[] = +static const union AnimCmd *const sAnims_Unused_08595730[] = { - gUnknown_08595714, + sAnim_Unused_08595714, }; // Unused -const struct SpriteTemplate gUnknown_08595734 = +const struct SpriteTemplate gUnusedSpriteTemplate_08595734 = { .tileTag = ANIM_TAG_SHOCK, .paletteTag = ANIM_TAG_SHOCK, .oam = &gOamData_AffineOff_ObjNormal_32x32, - .anims = gUnknown_08595730, + .anims = sAnims_Unused_08595730, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_810A274, + .callback = AnimUnused_0810A274, }; const struct SpriteTemplate gSparkElectricitySpriteTemplate = @@ -473,23 +473,23 @@ static void AnimLightning_Step(struct Sprite *sprite) DestroyAnimSprite(sprite); } -static void sub_810A214(struct Sprite *sprite) +static void AnimUnused_0810A214(struct Sprite *sprite) { if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) sprite->pos1.x -= gBattleAnimArgs[0]; else sprite->pos1.x += gBattleAnimArgs[0]; - sprite->callback = sub_810A258; + sprite->callback = AnimUnused_0810A214_Step; } -static void sub_810A258(struct Sprite *sprite) +static void AnimUnused_0810A214_Step(struct Sprite *sprite) { if (sprite->affineAnimEnded) DestroySpriteAndMatrix(sprite); } -static void sub_810A274(struct Sprite *sprite) +static void AnimUnused_0810A274(struct Sprite *sprite) { sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET); @@ -1076,7 +1076,7 @@ void AnimTask_VoltTackleBolt(u8 taskId) if (++task->data[2] > 0) { task->data[2] = 0; - if (sub_810B154(task, taskId) || sub_810B154(task, taskId)) + if (CreateVoltTackleBolt(task, taskId) || CreateVoltTackleBolt(task, taskId)) task->data[0]++; } break; @@ -1086,7 +1086,7 @@ void AnimTask_VoltTackleBolt(u8 taskId) } } -static bool8 sub_810B154(struct Task *task, u8 taskId) +static bool8 CreateVoltTackleBolt(struct Task *task, u8 taskId) { u8 spriteId = CreateSprite(&gVoltTackleBoltSpriteTemplate, task->data[3], task->data[5], 35); if (spriteId != MAX_SPRITES) @@ -1169,7 +1169,7 @@ void AnimTask_ShockWaveProgressingBolt(u8 taskId) if (++task->data[1] > 0) { task->data[1] = 0; - if (sub_810B430(task, taskId)) + if (CreateShockWaveBoltSprite(task, taskId)) { if (task->data[2] == 5) task->data[0] = 3; @@ -1222,7 +1222,7 @@ void AnimTask_ShockWaveProgressingBolt(u8 taskId) } } -static bool8 sub_810B430(struct Task *task, u8 taskId) +static bool8 CreateShockWaveBoltSprite(struct Task *task, u8 taskId) { u8 spriteId = CreateSprite(&gShockWaveProgressingBoltSpriteTemplate, task->data[6], task->data[7], 35); if (spriteId != MAX_SPRITES) @@ -1291,7 +1291,7 @@ void AnimTask_ShockWaveLightning(u8 taskId) if (++task->data[1] > 1) { task->data[1] = 0; - if (sub_810B614(task, taskId)) + if (CreateShockWaveLightningSprite(task, taskId)) task->data[0]++; } break; @@ -1302,13 +1302,13 @@ void AnimTask_ShockWaveLightning(u8 taskId) } } -bool8 sub_810B614(struct Task *task, u8 taskId) +static bool8 CreateShockWaveLightningSprite(struct Task *task, u8 taskId) { u8 spriteId = CreateSprite(&gLightningSpriteTemplate, task->data[13], task->data[14], task->data[12]); if (spriteId != MAX_SPRITES) { - gSprites[spriteId].callback = sub_810B684; + gSprites[spriteId].callback = AnimShockWaveLightning; gSprites[spriteId].data[6] = taskId; gSprites[spriteId].data[7] = 10; task->data[10]++; @@ -1319,7 +1319,7 @@ bool8 sub_810B614(struct Task *task, u8 taskId) return FALSE; } -static void sub_810B684(struct Sprite *sprite) +static void AnimShockWaveLightning(struct Sprite *sprite) { if (sprite->animEnded) { diff --git a/src/battle_anim_fight.c b/src/battle_anim_fight.c index 344ea7c1f..05138111b 100644 --- a/src/battle_anim_fight.c +++ b/src/battle_anim_fight.c @@ -6,7 +6,7 @@ #include "trig.h" #include "constants/rgb.h" -static void unc_080B08A0(struct Sprite *); +static void AnimUnused_080B08A0(struct Sprite *); static void AnimSlideHandOrFootToTarget(struct Sprite *); static void AnimJumpKick(struct Sprite *); static void AnimBasicFistOrFoot(struct Sprite *); @@ -40,7 +40,7 @@ static void AnimSpinningKickOrPunchFinish(struct Sprite *); extern struct SpriteTemplate gBasicHitSplatSpriteTemplate; // Unused -const struct SpriteTemplate gUnknown_08595E14 = +const struct SpriteTemplate gUnusedSpriteTemplate_08595E14 = { .tileTag = ANIM_TAG_HUMANOID_FOOT, .paletteTag = ANIM_TAG_HUMANOID_FOOT, @@ -48,7 +48,7 @@ const struct SpriteTemplate gUnknown_08595E14 = .anims = gDummySpriteAnimTable, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = unc_080B08A0, + .callback = AnimUnused_080B08A0, }; static const union AnimCmd sAnim_HandOrFoot[] = @@ -417,7 +417,7 @@ const struct SpriteTemplate gFocusPunchFistSpriteTemplate = .callback = AnimFocusPunchFist, }; -static void unc_080B08A0(struct Sprite *sprite) +static void AnimUnused_080B08A0(struct Sprite *sprite) { SetAnimSpriteInitialXOffset(sprite, gBattleAnimArgs[0]); sprite->pos1.y += gBattleAnimArgs[1]; @@ -1008,7 +1008,7 @@ void AnimTask_MoveSkyUppercutBg(u8 taskId) switch (task->data[0]) { case 0: - sub_80A6DAC(0); + UpdateAnimBg3ScreenSize(FALSE); task->data[8] = gBattleAnimArgs[0]; task->data[0]++; break; @@ -1037,7 +1037,7 @@ void AnimTask_MoveSkyUppercutBg(u8 taskId) { gBattle_BG3_X = 0; gBattle_BG3_Y = 0; - sub_80A6DAC(1); + UpdateAnimBg3ScreenSize(TRUE); DestroyAnimVisualTask(taskId); } } diff --git a/src/battle_anim_fire.c b/src/battle_anim_fire.c index 1073f10fa..c90d7f4f1 100644 --- a/src/battle_anim_fire.c +++ b/src/battle_anim_fire.c @@ -11,9 +11,9 @@ static void AnimFireSpiralInward(struct Sprite *); static void AnimFireSpread(struct Sprite *); static void AnimFirePlume(struct Sprite *); static void AnimLargeFlame(struct Sprite *); -static void sub_8109028(struct Sprite *); -static void sub_8109064(struct Sprite *); -static void sub_81090D8(struct Sprite *); +static void AnimLargeFlame_Step(struct Sprite *); +static void AnimUnused_8109064(struct Sprite *); +static void AnimUnused_8109064_Step(struct Sprite *); static void AnimSunlight(struct Sprite *); static void AnimEmberFlare(struct Sprite *); static void AnimBurnFlame(struct Sprite *); @@ -162,7 +162,7 @@ const struct SpriteTemplate gFirePlumeSpriteTemplate = }; // Unused -const struct SpriteTemplate gUnknown_08595440 = +const struct SpriteTemplate gUnusedSpriteTemplate_08595440 = { .tileTag = ANIM_TAG_SMALL_EMBER, .paletteTag = ANIM_TAG_SMALL_EMBER, @@ -173,7 +173,7 @@ const struct SpriteTemplate gUnknown_08595440 = .callback = AnimFirePlume, }; -static const union AnimCmd gUnknown_08595458[] = +static const union AnimCmd sAnim_Unused_08595458[] = { ANIMCMD_FRAME(16, 6), ANIMCMD_FRAME(32, 6), @@ -181,21 +181,21 @@ static const union AnimCmd gUnknown_08595458[] = ANIMCMD_JUMP(0), }; -static const union AnimCmd *const gUnknown_08595468[] = +static const union AnimCmd *const sAnims_Unused_08595468[] = { - gUnknown_08595458, + sAnim_Unused_08595458, }; // Unused -const struct SpriteTemplate gUnknown_0859546C = +const struct SpriteTemplate gUnusedSpriteTemplate_0859546C = { .tileTag = ANIM_TAG_SMALL_EMBER, .paletteTag = ANIM_TAG_SMALL_EMBER, .oam = &gOamData_AffineOff_ObjNormal_32x32, - .anims = gUnknown_08595468, + .anims = sAnims_Unused_08595468, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_8109064, + .callback = AnimUnused_8109064, }; static const union AffineAnimCmd sAffineAnim_SunlightRay[] = @@ -292,23 +292,23 @@ static const union AnimCmd *const sAnims_FireBlastCross[] = sAnim_FireBlastCross, }; -static const union AffineAnimCmd gUnknown_08595544[] = +static const union AffineAnimCmd sAnim_Unused_08595544[] = { AFFINEANIMCMD_FRAME(0x0, 0x0, 0, 1), AFFINEANIMCMD_END, }; -static const union AffineAnimCmd gUnknown_08595554[] = +static const union AffineAnimCmd sAnim_Unused_08595554[] = { AFFINEANIMCMD_FRAME(0xA0, 0xA0, 0, 0), AFFINEANIMCMD_END, }; // Unused -static const union AffineAnimCmd *const gUnknown_08595564[] = +static const union AffineAnimCmd *const sAnims_Unused_08595564[] = { - gUnknown_08595544, - gUnknown_08595554, + sAnim_Unused_08595544, + sAnim_Unused_08595554, }; const struct SpriteTemplate gFireBlastCrossSpriteTemplate = @@ -511,7 +511,7 @@ static void AnimFirePlume(struct Sprite *sprite) sprite->data[4] = gBattleAnimArgs[3]; sprite->data[3] = gBattleAnimArgs[5]; - sprite->callback = sub_8109028; + sprite->callback = AnimLargeFlame_Step; } static void AnimLargeFlame(struct Sprite *sprite) @@ -533,10 +533,10 @@ static void AnimLargeFlame(struct Sprite *sprite) sprite->data[4] = gBattleAnimArgs[3]; sprite->data[3] = gBattleAnimArgs[5]; - sprite->callback = sub_8109028; + sprite->callback = AnimLargeFlame_Step; } -static void sub_8109028(struct Sprite *sprite) +static void AnimLargeFlame_Step(struct Sprite *sprite) { if (++sprite->data[0] < sprite->data[4]) { @@ -548,7 +548,7 @@ static void sub_8109028(struct Sprite *sprite) DestroySpriteAndMatrix(sprite); } -static void sub_8109064(struct Sprite *sprite) +static void AnimUnused_8109064(struct Sprite *sprite) { SetSpriteCoordsToAnimAttackerCoords(sprite); @@ -570,10 +570,10 @@ static void sub_8109064(struct Sprite *sprite) sprite->data[4] = gBattleAnimArgs[6]; sprite->data[5] = 0; - sprite->callback = sub_81090D8; + sprite->callback = AnimUnused_8109064_Step; } -static void sub_81090D8(struct Sprite *sprite) +static void AnimUnused_8109064_Step(struct Sprite *sprite) { if (sprite->data[3]) { @@ -611,8 +611,6 @@ static void AnimSunlight(struct Sprite *sprite) StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); } -//fire 2 - // Animates the secondary effect of MOVE_EMBER, where the flames grow and slide // horizontally a bit. // arg 0: initial x pixel offset @@ -792,15 +790,14 @@ void AnimTask_EruptionLaunchRocks(u8 taskId) task->func = AnimTask_EruptionLaunchRocks_Step; } -static void AnimTask_EruptionLaunchRocks_Step(u8 taskId) // animate Move_ERUPTION? +static void AnimTask_EruptionLaunchRocks_Step(u8 taskId) { struct Task *task = &gTasks[taskId]; switch (task->data[0]) { case 0: - sub_80A805C(task, task->data[15], 0x100, 0x100, 0xE0, 0x200, 0x20); - + PrepareEruptAnimTaskData(task, task->data[15], 0x100, 0x100, 0xE0, 0x200, 32); task->data[0]++; case 1: if (++task->data[1] > 1) @@ -813,7 +810,7 @@ static void AnimTask_EruptionLaunchRocks_Step(u8 taskId) // animate Move_ERUPTIO gSprites[task->data[15]].pos2.x = -3; } - if (task->data[5]) + if (task->data[5] != B_SIDE_PLAYER) { if (++task->data[3] > 4) { @@ -822,7 +819,7 @@ static void AnimTask_EruptionLaunchRocks_Step(u8 taskId) // animate Move_ERUPTIO } } - if(!sub_80A80C8(task)) + if(!UpdateEruptAnimTask(task)) { SetBattlerSpriteYOffsetFromYScale(task->data[15]); gSprites[task->data[15]].pos2.x = 0; @@ -836,20 +833,19 @@ static void AnimTask_EruptionLaunchRocks_Step(u8 taskId) // animate Move_ERUPTIO case 2: if (++task->data[1] > 4) { - if (task->data[5]) - sub_80A805C(task, task->data[15], 0xE0, 0x200, 0x180, 0xF0, 0x6); + if (task->data[5] != B_SIDE_PLAYER) + PrepareEruptAnimTaskData(task, task->data[15], 0xE0, 0x200, 0x180, 0xF0, 6); else - sub_80A805C(task, task->data[15], 0xE0, 0x200, 0x180, 0xC0, 0x6); + PrepareEruptAnimTaskData(task, task->data[15], 0xE0, 0x200, 0x180, 0xC0, 6); task->data[1] = 0; task->data[0]++; } break; case 3: - if (!sub_80A80C8(task)) + if (!UpdateEruptAnimTask(task)) { CreateEruptionLaunchRocks(task->data[15], taskId, 6); - task->data[0]++; } break; @@ -866,10 +862,10 @@ static void AnimTask_EruptionLaunchRocks_Step(u8 taskId) // animate Move_ERUPTIO if (++task->data[3] > 0x18) { - if (task->data[5]) - sub_80A805C(task, task->data[15], 0x180, 0xF0, 0x100, 0x100, 0x8); + if (task->data[5] != B_SIDE_PLAYER) + PrepareEruptAnimTaskData(task, task->data[15], 0x180, 0xF0, 0x100, 0x100, 8); else - sub_80A805C(task, task->data[15], 0x180, 0xC0, 0x100, 0x100, 0x8); + PrepareEruptAnimTaskData(task, task->data[15], 0x180, 0xC0, 0x100, 0x100, 8); if (task->data[2] & 1) gSprites[task->data[15]].pos2.y -= 3; @@ -881,14 +877,13 @@ static void AnimTask_EruptionLaunchRocks_Step(u8 taskId) // animate Move_ERUPTIO } break; case 5: - if (task->data[5]) + if (task->data[5] != B_SIDE_PLAYER) gSprites[task->data[15]].pos1.y--; - if (!sub_80A80C8(task)) + if (!UpdateEruptAnimTask(task)) { gSprites[task->data[15]].pos1.y = task->data[4]; ResetSpriteRotScale(task->data[15]); - task->data[2] = 0; task->data[0]++; } @@ -896,7 +891,6 @@ static void AnimTask_EruptionLaunchRocks_Step(u8 taskId) // animate Move_ERUPTIO case 6: if (!task->data[6]) DestroyAnimVisualTask(taskId); - break; default: break; @@ -955,16 +949,12 @@ static void AnimEruptionLaunchRock(struct Sprite *sprite) static u16 GetEruptionLaunchRockInitialYPos(u8 spriteId) { - u16 y = gSprites[spriteId].pos1.y + gSprites[spriteId].pos2.y + gSprites[spriteId].centerToCornerVecY; + s16 y = gSprites[spriteId].pos1.y + gSprites[spriteId].pos2.y + gSprites[spriteId].centerToCornerVecY; if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER) - { - y = ((y << 16) + 0x4A0000) >> 16; - } + y += 74; else - { - y = ((y << 16) + 0x2C0000) >> 16; - } + y += 44; return y; } @@ -1282,14 +1272,14 @@ static void AnimTask_MoveHeatWaveTargets_Step(u8 taskId) } } -// Used to add a color mask to the battle interface / HUD in Heat Wave. +// Used to add a color mask to the battle background. // arg 0: opacity // arg 1: color code void AnimTask_BlendBackground(u8 taskId) { struct BattleAnimBgData animBg; - sub_80A6B30(&animBg); - BlendPalette(animBg.paletteId * 16, 16, gBattleAnimArgs[0], gBattleAnimArgs[1]); // u16 palOffset, u16 numEntries, u8 coeff, u16 blendColor + GetDefaultBattleAnimBgData(&animBg); + BlendPalette(animBg.paletteId * 16, 16, gBattleAnimArgs[0], gBattleAnimArgs[1]); DestroyAnimVisualTask(taskId); } diff --git a/src/battle_anim_flying.c b/src/battle_anim_flying.c index 7d96fed8c..060149a9e 100644 --- a/src/battle_anim_flying.c +++ b/src/battle_anim_flying.c @@ -18,9 +18,9 @@ static void AnimFlyBallUp_Step(struct Sprite *); static void AnimFlyBallAttack(struct Sprite *); static void AnimFlyBallAttack_Step(struct Sprite *); static void AnimFallingFeather(struct Sprite *); -static void sub_810E520(struct Sprite *); -static void sub_810EB40(struct Sprite *); -static void sub_810EA4C(struct Sprite *); +static void AnimFallingFeather_Step(struct Sprite *); +static void AnimWhirlwindLine_Step(struct Sprite *); +static void AnimUnused_810EA4C(struct Sprite *); static void AnimWhirlwindLine(struct Sprite *); static void AnimBounceBallShrink(struct Sprite *); static void AnimBounceBallLand(struct Sprite *); @@ -30,8 +30,8 @@ static void AnimDiveBall_Step2(struct Sprite *); static void AnimDiveWaterSplash(struct Sprite *); static void AnimSprayWaterDroplet(struct Sprite *); static void AnimSprayWaterDroplet_Step(struct Sprite *); -static void sub_810F004(struct Sprite *); -static void sub_810F018(struct Sprite *); +static void AnimUnused_810F004(struct Sprite *); +static void AnimUnused_810F004_Step(struct Sprite *); static void AnimSkyAttackBird(struct Sprite *); static void AnimSkyAttackBird_Step(struct Sprite *); static void AnimTask_AnimateGustTornadoPalette_Step(u8); @@ -179,7 +179,8 @@ const struct SpriteTemplate gFallingFeatherSpriteTemplate = .callback = AnimFallingFeather, }; -const struct SpriteTemplate gUnknown_085963A0 = +// Unused +const struct SpriteTemplate gUnusedSpriteTemplate_085963A0 = { .tileTag = ANIM_TAG_SMALL_BUBBLES, .paletteTag = ANIM_TAG_SMALL_BUBBLES, @@ -187,7 +188,7 @@ const struct SpriteTemplate gUnknown_085963A0 = .anims = gDummySpriteAnimTable, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_810EA4C, + .callback = AnimUnused_810EA4C, }; static const union AnimCmd sAnim_WhirlwindLines[] = @@ -289,7 +290,7 @@ const struct SpriteTemplate gDiveBallSpriteTemplate = .callback = AnimDiveBall, }; -static const union AffineAnimCmd gUnknown_085964A8[] = +static const union AffineAnimCmd sAnim_Unused_085964A8[] = { AFFINEANIMCMD_FRAME(0x100, 0x0, 0, 0), AFFINEANIMCMD_FRAME(0x0, 0x20, 0, 12), @@ -298,9 +299,9 @@ static const union AffineAnimCmd gUnknown_085964A8[] = }; // Unused -static const union AffineAnimCmd *const gUnknown_085964C8[] = +static const union AffineAnimCmd *const sAnims_Unused_085964C8[] = { - gUnknown_085964A8, + sAnim_Unused_085964A8, }; const struct SpriteTemplate gDiveWaterSplashSpriteTemplate = @@ -325,7 +326,8 @@ const struct SpriteTemplate gSprayWaterDropletSpriteTemplate = .callback = AnimSprayWaterDroplet, }; -const struct SpriteTemplate gUnknown_085964FC = +// Unused +const struct SpriteTemplate gUnusedSpriteTemplate_085964FC = { .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, .paletteTag = ANIM_TAG_CIRCLE_OF_LIGHT, @@ -333,7 +335,7 @@ const struct SpriteTemplate gUnknown_085964FC = .anims = gDummySpriteAnimTable, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_810F004, + .callback = AnimUnused_810F004, }; const struct SpriteTemplate gSkyAttackBirdSpriteTemplate = @@ -639,10 +641,10 @@ static void AnimFallingFeather(struct Sprite *sprite) gOamMatrices[matrixNum].b = spriteCoord; gOamMatrices[matrixNum].c = -spriteCoord; - sprite->callback = sub_810E520; + sprite->callback = AnimFallingFeather_Step; } -static void sub_810E520(struct Sprite *sprite) +static void AnimFallingFeather_Step(struct Sprite *sprite) { u8 matrixNum, sinIndex; s16 sinVal = 0; @@ -890,7 +892,7 @@ static void sub_810E520(struct Sprite *sprite) } } -static void sub_810EA4C(struct Sprite *sprite) +static void AnimUnused_810EA4C(struct Sprite *sprite) { sprite->oam.priority = GetBattlerSpriteBGPriority(gBattleAnimTarget); sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); @@ -900,7 +902,7 @@ static void sub_810EA4C(struct Sprite *sprite) static void AnimWhirlwindLine(struct Sprite * sprite) { - u16 arg; + u16 offset; u8 mult; if (gBattleAnimArgs[2] == ANIM_ATTACKER) @@ -918,15 +920,15 @@ static void AnimWhirlwindLine(struct Sprite * sprite) sprite->pos1.x -= 32; sprite->data[1] = 0x0ccc; - arg = gBattleAnimArgs[4]; + offset = gBattleAnimArgs[4]; mult = 12; - sprite->pos2.x += mult * arg; - sprite->data[0] = arg; + sprite->pos2.x += mult * offset; + sprite->data[0] = offset; sprite->data[7] = gBattleAnimArgs[3]; - sprite->callback = sub_810EB40; + sprite->callback = AnimWhirlwindLine_Step; } -static void sub_810EB40(struct Sprite *sprite) +static void AnimWhirlwindLine_Step(struct Sprite *sprite) { sprite->pos2.x += sprite->data[1] >> 8; @@ -1063,9 +1065,9 @@ static void AnimDiveWaterSplash(struct Sprite *sprite) sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimTarget, 1); } - sprite->data[1] = 512; + sprite->data[1] = 0x200; - TrySetSpriteRotScale(sprite, 0, 256, sprite->data[1], 0); + TrySetSpriteRotScale(sprite, 0, 0x100, sprite->data[1], 0); sprite->data[0]++; break; case 1: @@ -1076,11 +1078,11 @@ static void AnimDiveWaterSplash(struct Sprite *sprite) sprite->data[2]++; - TrySetSpriteRotScale(sprite, 0, 256, sprite->data[1], 0); + TrySetSpriteRotScale(sprite, 0, 0x100, sprite->data[1], 0); matrixNum = sprite->oam.matrixNum; - t1 = 15616; + t1 = 0x3D00; t2 = t1 / gOamMatrices[matrixNum].d + 1; if (t2 > 128) @@ -1091,7 +1093,7 @@ static void AnimDiveWaterSplash(struct Sprite *sprite) if (sprite->data[2] == 24) { - sub_80A749C(sprite); + ResetSpriteRotScale_PreserveAffine(sprite); DestroyAnimSprite(sprite); } break; @@ -1156,14 +1158,14 @@ static void AnimSprayWaterDroplet_Step(struct Sprite *sprite) DestroyAnimSprite(sprite); } -static void sub_810F004(struct Sprite *sprite) +static void AnimUnused_810F004(struct Sprite *sprite) { sprite->data[6] = 0; sprite->data[7] = 64; - sprite->callback = sub_810F018; + sprite->callback = AnimUnused_810F004_Step; } -static void sub_810F018(struct Sprite *sprite) +static void AnimUnused_810F004_Step(struct Sprite *sprite) { switch (sprite->data[0]) { @@ -1218,7 +1220,7 @@ void AnimSkyAttackBird_Step(struct Sprite *sprite) DestroySpriteAndMatrix(sprite); } -void unref_sub_810F184(u8 taskId) +void AnimTask_Unused_810F184(u8 taskId) { if (gBattleAnimArgs[0] == 0) { diff --git a/src/battle_anim_ice.c b/src/battle_anim_ice.c index 9ce9a249c..4babe577a 100644 --- a/src/battle_anim_ice.c +++ b/src/battle_anim_ice.c @@ -998,7 +998,7 @@ void AnimTask_HazeScrollingFog(u8 taskId) SetGpuReg(REG_OFFSET_BG1HOFS, gBattle_BG1_X); SetGpuReg(REG_OFFSET_BG1VOFS, gBattle_BG1_Y); - sub_80A6B30(&animBg); + GetDefaultBattleAnimBgData(&animBg); LoadBgTiles(animBg.bgId, gWeatherFogHorizontalTiles, 0x800, animBg.tilesOffset); AnimLoadCompressedBgTilemapHandleContest(&animBg, gBattleAnimFogTilemap, 0); LoadPalette(&gUnknown_083970E8, animBg.paletteId * 16, 32); @@ -1052,7 +1052,7 @@ static void AnimTask_Haze2(u8 taskId) } break; case 3: - sub_80A6B30(&animBg); + GetDefaultBattleAnimBgData(&animBg); sub_80A6C68(1); sub_80A6C68(2); @@ -1105,7 +1105,7 @@ void AnimTask_LoadMistTiles(u8 taskId) SetGpuReg(REG_OFFSET_BG1HOFS, gBattle_BG1_X); SetGpuReg(REG_OFFSET_BG1VOFS, gBattle_BG1_Y); - sub_80A6B30(&animBg); + GetDefaultBattleAnimBgData(&animBg); LoadBgTiles(animBg.bgId, gWeatherFogHorizontalTiles, 0x800, animBg.tilesOffset); AnimLoadCompressedBgTilemapHandleContest(&animBg, gBattleAnimFogTilemap, 0); LoadPalette(&gUnknown_083970E8, animBg.paletteId * 16, 32); @@ -1154,7 +1154,7 @@ static void AnimTask_OverlayFogTiles(u8 taskId) } break; case 3: - sub_80A6B30(&animBg); + GetDefaultBattleAnimBgData(&animBg); sub_80A6C68(1); sub_80A6C68(2); diff --git a/src/battle_anim_mons.c b/src/battle_anim_mons.c index 3e86f31f7..e412ca5de 100644 --- a/src/battle_anim_mons.c +++ b/src/battle_anim_mons.c @@ -849,25 +849,25 @@ bool8 IsDoubleBattle(void) return IS_DOUBLE_BATTLE(); } -void sub_80A6B30(struct BattleAnimBgData *unk) +void GetDefaultBattleAnimBgData(struct BattleAnimBgData *out) { if (IsContest()) { - unk->bgTiles = gUnknown_0202305C; - unk->bgTilemap = (u16 *)gUnknown_02023060; - unk->paletteId = 14; - unk->bgId = 1; - unk->tilesOffset = 0; - unk->unused = 0; + out->bgTiles = gUnknown_0202305C; + out->bgTilemap = (u16 *)gUnknown_02023060; + out->paletteId = 14; + out->bgId = 1; + out->tilesOffset = 0; + out->unused = 0; } else { - unk->bgTiles = gUnknown_0202305C; - unk->bgTilemap = (u16 *)gUnknown_02023060; - unk->paletteId = 8; - unk->bgId = 1; - unk->tilesOffset = 0x200; - unk->unused = 0; + out->bgTiles = gUnknown_0202305C; + out->bgTilemap = (u16 *)gUnknown_02023060; + out->paletteId = 8; + out->bgId = 1; + out->tilesOffset = 0x200; + out->unused = 0; } } @@ -884,7 +884,7 @@ void sub_80A6B90(struct BattleAnimBgData *unk, u32 arg1) } else if (arg1 == 1) { - sub_80A6B30(unk); + GetDefaultBattleAnimBgData(unk); } else { @@ -970,9 +970,9 @@ u8 GetBattleBgPaletteNum(void) return 2; } -void sub_80A6DAC(bool8 arg0) +void UpdateAnimBg3ScreenSize(bool8 largeScreenSize) { - if (!arg0 || IsContest()) + if (!largeScreenSize || IsContest()) { SetAnimBgAttribute(3, BG_ANIM_SCREEN_SIZE, 0); SetAnimBgAttribute(3, BG_ANIM_AREA_OVERFLOW_MODE, 1); @@ -1292,7 +1292,7 @@ void TrySetSpriteRotScale(struct Sprite *sprite, bool8 recalcCenterVector, s16 x } } -void sub_80A749C(struct Sprite *sprite) +void ResetSpriteRotScale_PreserveAffine(struct Sprite *sprite) { TrySetSpriteRotScale(sprite, TRUE, 0x100, 0x100, 0); sprite->affineAnimPaused = FALSE; @@ -1896,19 +1896,19 @@ void *LoadPointerFromVars(s16 lo, s16 hi) return (void *)((u16)lo | ((u16)hi << 16)); } -void sub_80A805C(struct Task *task, u8 a2, s16 a3, s16 a4, s16 a5, s16 a6, u16 a7) +void PrepareEruptAnimTaskData(struct Task *task, u8 spriteId, s16 xScaleStart, s16 yScaleStart, s16 xScaleEnd, s16 yScaleEnd, u16 duration) { - task->data[8] = a7; - task->data[15] = a2; // spriteId - task->data[9] = a3; - task->data[10] = a4; - task->data[13] = a5; - task->data[14] = a6; - task->data[11] = (a5 - a3) / a7; - task->data[12] = (a6 - a4) / a7; + task->data[8] = duration; + task->data[15] = spriteId; + task->data[9] = xScaleStart; + task->data[10] = yScaleStart; + task->data[13] = xScaleEnd; + task->data[14] = yScaleEnd; + task->data[11] = (xScaleEnd - xScaleStart) / duration; + task->data[12] = (yScaleEnd - yScaleStart) / duration; } -u8 sub_80A80C8(struct Task *task) +u8 UpdateEruptAnimTask(struct Task *task) { if (!task->data[8]) return 0; diff --git a/src/battle_anim_rock.c b/src/battle_anim_rock.c index 29ba49346..3fa721a6c 100644 --- a/src/battle_anim_rock.c +++ b/src/battle_anim_rock.c @@ -411,7 +411,7 @@ void AnimTask_LoadSandstormBackground(u8 taskId) SetGpuReg(REG_OFFSET_BG1HOFS, gBattle_BG1_X); SetGpuReg(REG_OFFSET_BG1VOFS, gBattle_BG1_Y); - sub_80A6B30(&animBg); + GetDefaultBattleAnimBgData(&animBg); AnimLoadCompressedBgGfx(animBg.bgId, gBattleAnimBgImage_Sandstorm, animBg.tilesOffset); AnimLoadCompressedBgTilemapHandleContest(&animBg, gBattleAnimBgTilemap_Sandstorm, 0); LoadCompressedPalette(gBattleAnimSpritePal_FlyingDirt, animBg.paletteId * 16, 32); @@ -470,7 +470,7 @@ static void AnimTask_LoadSandstormBackground_Step(u8 taskId) } break; case 3: - sub_80A6B30(&animBg); + GetDefaultBattleAnimBgData(&animBg); sub_80A6C68(animBg.bgId); gTasks[taskId].data[12]++; break; @@ -833,7 +833,7 @@ void AnimTask_MoveSeismicTossBg(u8 taskId) { if (gTasks[taskId].data[0] == 0) { - sub_80A6DAC(FALSE); + UpdateAnimBg3ScreenSize(FALSE); gTasks[taskId].data[1] = 200; } @@ -842,7 +842,7 @@ void AnimTask_MoveSeismicTossBg(u8 taskId) if (gTasks[taskId].data[0] == 120) { - sub_80A6DAC(TRUE); + UpdateAnimBg3ScreenSize(TRUE); DestroyAnimVisualTask(taskId); } @@ -853,7 +853,7 @@ void AnimTask_SeismicTossBgAccelerateDownAtEnd(u8 taskId) { if (gTasks[taskId].data[0] == 0) { - sub_80A6DAC(FALSE); + UpdateAnimBg3ScreenSize(FALSE); gTasks[taskId].data[0]++; gTasks[taskId].data[2] = gBattle_BG3_Y; } @@ -865,7 +865,7 @@ void AnimTask_SeismicTossBgAccelerateDownAtEnd(u8 taskId) if (gBattleAnimArgs[7] == 0xFFF) { gBattle_BG3_Y = 0; - sub_80A6DAC(TRUE); + UpdateAnimBg3ScreenSize(TRUE); DestroyAnimVisualTask(taskId); } } diff --git a/src/battle_anim_sound_tasks.c b/src/battle_anim_sound_tasks.c index eed163816..8fc93c3aa 100644 --- a/src/battle_anim_sound_tasks.c +++ b/src/battle_anim_sound_tasks.c @@ -6,16 +6,21 @@ #include "task.h" #include "constants/battle_anim.h" -// this file's functions -static void sub_8158B98(u8 taskId); -static void sub_8158C04(u8 taskId); +static void SoundTask_FireBlast_Step1(u8 taskId); +static void SoundTask_FireBlast_Step2(u8 taskId); static void SoundTask_LoopSEAdjustPanning_Step(u8 taskId); static void SoundTask_PlayDoubleCry_Step(u8 taskId); static void SoundTask_PlayCryWithEcho_Step(u8 taskId); static void SoundTask_AdjustPanningVar_Step(u8 taskId); -// task start -void sub_8158B30(u8 taskId) +// Loops the specified sound effect and pans from the +// attacker to the target. The second specified sound effect +// is played at the very end. This task is effectively +// hardcoded to the move FIRE_BLAST due to the baked-in +// durations. +// arg 0: looped sound effect +// arg 1: ending sound effect +void SoundTask_FireBlast(u8 taskId) { s8 pan1, pan2, panIncrement; @@ -31,10 +36,10 @@ void sub_8158B30(u8 taskId) gTasks[taskId].data[4] = panIncrement; gTasks[taskId].data[10] = 10; - gTasks[taskId].func = sub_8158B98; + gTasks[taskId].func = SoundTask_FireBlast_Step1; } -static void sub_8158B98(u8 taskId) +static void SoundTask_FireBlast_Step1(u8 taskId) { s16 pan = gTasks[taskId].data[2]; s8 panIncrement = gTasks[taskId].data[4]; @@ -42,7 +47,7 @@ static void sub_8158B98(u8 taskId) { gTasks[taskId].data[10] = 5; gTasks[taskId].data[11] = 0; - gTasks[taskId].func = sub_8158C04; + gTasks[taskId].func = SoundTask_FireBlast_Step2; } else { @@ -56,7 +61,7 @@ static void sub_8158B98(u8 taskId) } } -static void sub_8158C04(u8 taskId) +static void SoundTask_FireBlast_Step2(u8 taskId) { if (++gTasks[taskId].data[10] == 6) { @@ -69,9 +74,7 @@ static void sub_8158C04(u8 taskId) DestroyAnimSoundTask(taskId); } } -// task end -// task start void SoundTask_LoopSEAdjustPanning(u8 taskId) { u16 songId = gBattleAnimArgs[0]; @@ -123,9 +126,7 @@ static void SoundTask_LoopSEAdjustPanning_Step(u8 taskId) gTasks[taskId].data[11] = KeepPanInRange(gTasks[taskId].data[11], oldPan); } } -// task end -// task start void SoundTask_PlayCryHighPitch(u8 taskId) { u16 species = 0; @@ -169,9 +170,7 @@ void SoundTask_PlayCryHighPitch(u8 taskId) DestroyAnimVisualTask(taskId); } -// task end -// task start void SoundTask_PlayDoubleCry(u8 taskId) { u16 species = 0; @@ -258,7 +257,6 @@ static void SoundTask_PlayDoubleCry_Step(u8 taskId) } } } -// task end void SoundTask_WaitForCry(u8 taskId) { @@ -273,7 +271,6 @@ void SoundTask_WaitForCry(u8 taskId) } } -// task start void SoundTask_PlayCryWithEcho(u8 taskId) { u16 species; @@ -329,7 +326,6 @@ static void SoundTask_PlayCryWithEcho_Step(u8 taskId) break; } } -// task end void SoundTask_PlaySE1WithPanning(u8 taskId) { @@ -389,4 +385,3 @@ static void SoundTask_AdjustPanningVar_Step(u8 taskId) if (gTasks[taskId].data[11] == gTasks[taskId].data[2]) DestroyAnimVisualTask(taskId); } - diff --git a/src/battle_anim_throw.c b/src/battle_anim_throw.c index 0da766036..cc8c3354e 100755 --- a/src/battle_anim_throw.c +++ b/src/battle_anim_throw.c @@ -464,7 +464,7 @@ void unref_sub_8170478(u8 taskId) gSprites[spriteId3].callback = SpriteCallbackDummy; gSprites[spriteId4].callback = SpriteCallbackDummy; - sub_80A6B30(&unknownStruct); + GetDefaultBattleAnimBgData(&unknownStruct); AnimLoadCompressedBgTilemap(unknownStruct.bgId, gUnknown_08C2EA9C); AnimLoadCompressedBgGfx(unknownStruct.bgId, gUnknown_08C2EA50, unknownStruct.tilesOffset); LoadCompressedPalette(gCureBubblesPal, unknownStruct.paletteId << 4, 32); diff --git a/src/battle_anim_utility_funcs.c b/src/battle_anim_utility_funcs.c index 598d27f09..53ed5698a 100644 --- a/src/battle_anim_utility_funcs.c +++ b/src/battle_anim_utility_funcs.c @@ -330,7 +330,7 @@ void AnimTask_DrawFallingWhiteLinesOnAttacker(u8 taskId) spriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER); newSpriteId = sub_80A89C8(gBattleAnimAttacker, spriteId, species); - sub_80A6B30(&unknownStruct); + GetDefaultBattleAnimBgData(&unknownStruct); AnimLoadCompressedBgTilemapHandleContest(&unknownStruct, gUnknown_08C20684, 0); AnimLoadCompressedBgGfx(unknownStruct.bgId, gUnknown_08C20668, unknownStruct.tilesOffset); LoadPalette(&gUnknown_08597418, unknownStruct.paletteId * 16 + 1, 2); @@ -377,7 +377,7 @@ static void AnimTask_DrawFallingWhiteLinesOnAttacker_Step(u8 taskId) sprite = &gSprites[gTasks[taskId].data[0]]; DestroySprite(sprite); - sub_80A6B30(&unknownStruct); + GetDefaultBattleAnimBgData(&unknownStruct); sub_80A6C68(unknownStruct.bgId); if (gTasks[taskId].data[6] == 1) gSprites[gBattlerSpriteIds[BATTLE_PARTNER(gBattleAnimAttacker)]].oam.priority++; @@ -468,7 +468,7 @@ static void sub_81170EC(u8 taskId) spriteId2 = sub_80A89C8(sAnimStatsChangeData->battler2, battlerSpriteId, sAnimStatsChangeData->species); } - sub_80A6B30(&unknownStruct); + GetDefaultBattleAnimBgData(&unknownStruct); if (sAnimStatsChangeData->data[0] == 0) AnimLoadCompressedBgTilemapHandleContest(&unknownStruct, gBattleStatMask1_Tilemap, 0); else @@ -705,7 +705,7 @@ void AnimTask_StartSlidingBg(u8 taskId) { u8 newTaskId; - sub_80A6DAC(0); + UpdateAnimBg3ScreenSize(FALSE); newTaskId = CreateTask(AnimTask_UpdateSlidingBg, 5); if (gBattleAnimArgs[2] && GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) { @@ -733,7 +733,7 @@ static void AnimTask_UpdateSlidingBg(u8 taskId) { gBattle_BG3_X = 0; gBattle_BG3_Y = 0; - sub_80A6DAC(1); + UpdateAnimBg3ScreenSize(TRUE); DestroyTask(taskId); } } @@ -824,7 +824,7 @@ void sub_8117854(u8 taskId, int unused, u16 arg2, u8 battler1, u8 arg4, u8 arg5, if (arg4) spriteId2 = sub_80A89C8(battler2, gBattlerSpriteIds[battler2], species); - sub_80A6B30(&unknownStruct); + GetDefaultBattleAnimBgData(&unknownStruct); AnimLoadCompressedBgTilemapHandleContest(&unknownStruct, tilemap, 0); AnimLoadCompressedBgGfx(unknownStruct.bgId, gfx, unknownStruct.tilesOffset); LoadCompressedPalette(palette, unknownStruct.paletteId * 16, 32); diff --git a/src/battle_anim_water.c b/src/battle_anim_water.c index f157102b0..e9bf2466f 100644 --- a/src/battle_anim_water.c +++ b/src/battle_anim_water.c @@ -811,7 +811,7 @@ void AnimTask_CreateSurfWave(u8 taskId) SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(0, 16)); SetAnimBgAttribute(1, BG_ANIM_PRIORITY, 1); SetAnimBgAttribute(1, BG_ANIM_SCREEN_SIZE, 1); - sub_80A6B30(&animBg); + GetDefaultBattleAnimBgData(&animBg); if (!IsContest()) { SetAnimBgAttribute(1, BG_ANIM_CHAR_BASE_BLOCK, 1); @@ -884,7 +884,7 @@ static void AnimTask_CreateSurfWave_Step1(u8 taskId) *BGptrX += gTasks[taskId].data[0]; *BGptrY += gTasks[taskId].data[1]; - sub_80A6B30(&animBg); + GetDefaultBattleAnimBgData(&animBg); gTasks[taskId].data[2] += gTasks[taskId].data[1]; if (++gTasks[taskId].data[5] == 4) { @@ -1053,7 +1053,7 @@ static void AnimTask_WaterSpoutLaunch_Step(u8 taskId) switch (task->data[0]) { case 0: - sub_80A805C(task, task->data[15], 0x100, 0x100, 224, 0x200, 32); + PrepareEruptAnimTaskData(task, task->data[15], 0x100, 0x100, 0xE0, 0x200, 32); task->data[0]++; case 1: if (++task->data[3] > 1) @@ -1069,7 +1069,7 @@ static void AnimTask_WaterSpoutLaunch_Step(u8 taskId) gSprites[task->data[15]].pos2.x = -3; } } - if (sub_80A80C8(task) == 0) + if (UpdateEruptAnimTask(task) == 0) { SetBattlerSpriteYOffsetFromYScale(task->data[15]); gSprites[task->data[15]].pos2.x = 0; @@ -1081,13 +1081,13 @@ static void AnimTask_WaterSpoutLaunch_Step(u8 taskId) case 2: if (++task->data[3] > 4) { - sub_80A805C(task, task->data[15], 224, 0x200, 384, 224, 8); + PrepareEruptAnimTaskData(task, task->data[15], 0xE0, 0x200, 0x180, 0xE0, 8); task->data[3] = 0; task->data[0]++; } break; case 3: - if (sub_80A80C8(task) == 0) + if (UpdateEruptAnimTask(task) == 0) { task->data[3] = 0; task->data[4] = 0; @@ -1107,7 +1107,7 @@ static void AnimTask_WaterSpoutLaunch_Step(u8 taskId) gSprites[task->data[15]].pos2.y -= 2; if (task->data[4] == 10) { - sub_80A805C(task, task->data[15], 384, 224, 0x100, 0x100, 8); + PrepareEruptAnimTaskData(task, task->data[15], 0x180, 0xE0, 0x100, 0x100, 8); task->data[3] = 0; task->data[4] = 0; task->data[0]++; @@ -1116,7 +1116,7 @@ static void AnimTask_WaterSpoutLaunch_Step(u8 taskId) break; case 6: gSprites[task->data[15]].pos1.y--; - if (sub_80A80C8(task) == 0) + if (UpdateEruptAnimTask(task) == 0) { ResetSpriteRotScale(task->data[15]); gSprites[task->data[15]].pos1.y = task->data[5];