diff --git a/data/event_scripts.s b/data/event_scripts.s index 55bbb7618..1453175b5 100644 --- a/data/event_scripts.s +++ b/data/event_scripts.s @@ -1,6 +1,7 @@ #include "constants/global.h" #include "constants/battle_frontier.h" #include "constants/battle_setup.h" +#include "constants/easy_chat.h" #include "constants/event_objects.h" #include "constants/event_object_movement_constants.h" #include "constants/field_effects.h" @@ -1683,18 +1684,9 @@ Common_EventScript_ShowPokemonCenterSign:: @ 8271E73 msgbox gText_PokemonCenterSign, MSGBOX_SIGN end -BattleFrontier_BattleTowerLobby_EventScript_271E7C:: @ 8271E7C -DewfordTown_EventScript_271E7C:: @ 8271E7C -LilycoveCity_ContestLobby_EventScript_271E7C:: @ 8271E7C -LilycoveCity_PokemonTrainerFanClub_EventScript_271E7C:: @ 8271E7C -MauvilleCity_PokemonCenter_1F_EventScript_271E7C:: @ 8271E7C -PetalburgCity_PokemonCenter_1F_EventScript_271E7C:: @ 8271E7C -Route111_EventScript_271E7C:: @ 8271E7C -Route123_BerryMastersHouse_EventScript_271E7C:: @ 8271E7C -SlateportCity_OceanicMuseum_1F_EventScript_271E7C:: @ 8271E7C -SlateportCity_PokemonFanClub_EventScript_271E7C:: @ 8271E7C +Common_ShowEasyChatScreen:: @ 8271E7C fadescreen 1 - special easy_chat_input_maybe + special ShowEasyChatScreen fadescreen 0 return @@ -2941,8 +2933,8 @@ EventScript_Questionnaire:: @ 827381B msgbox gUnknown_0827339F, MSGBOX_YESNO compare VAR_RESULT, 0 goto_if_eq EventScript_2738FD - setvar VAR_0x8004, 20 - call MauvilleCity_PokemonCenter_1F_EventScript_271E7C + setvar VAR_0x8004, EASY_CHAT_TYPE_QUESTIONNAIRE + call Common_ShowEasyChatScreen lock faceplayer specialvar VAR_0x8008, sub_813B490 @@ -3769,10 +3761,10 @@ SlateportCity_PokemonFanClub_EventScript_28C7F0:: @ 828C7F0 SlateportCity_PokemonFanClub_EventScript_28C827:: @ 828C827 msgbox SlateportCity_PokemonFanClub_Text_28073B, MSGBOX_DEFAULT - setvar VAR_0x8004, 5 + setvar VAR_0x8004, EASY_CHAT_TYPE_INTERVIEW copyvar VAR_0x8005, VAR_0x8009 - setvar VAR_0x8006, 1 - call SlateportCity_PokemonFanClub_EventScript_271E7C + setvar VAR_0x8006, EASY_CHAT_PERSON_REPORTER_FEMALE + call Common_ShowEasyChatScreen lock faceplayer compare VAR_RESULT, 1 @@ -3824,10 +3816,10 @@ SlateportCity_OceanicMuseum_1F_EventScript_28C8C8:: @ 828C8C8 SlateportCity_OceanicMuseum_1F_EventScript_28C8E7:: @ 828C8E7 msgbox SlateportCity_OceanicMuseum_1F_Text_2812F2, MSGBOX_DEFAULT - setvar VAR_0x8004, 5 + setvar VAR_0x8004, EASY_CHAT_TYPE_INTERVIEW copyvar VAR_0x8005, VAR_0x8009 - setvar VAR_0x8006, 0 - call SlateportCity_OceanicMuseum_1F_EventScript_271E7C + setvar VAR_0x8006, EASY_CHAT_PERSON_REPORTER_MALE + call Common_ShowEasyChatScreen lock faceplayer compare VAR_RESULT, 1 @@ -3896,17 +3888,17 @@ SlateportCity_PokemonFanClub_EventScript_28C9DF:: @ 828C9DF end SlateportCity_PokemonFanClub_EventScript_28C9ED:: @ 828C9ED - setvar VAR_0x8004, 7 + setvar VAR_0x8004, EASY_CHAT_TYPE_FAN_CLUB copyvar VAR_0x8005, VAR_0x8009 setvar VAR_0x8006, 0 - call SlateportCity_PokemonFanClub_EventScript_271E7C + call Common_ShowEasyChatScreen lock faceplayer compare VAR_RESULT, 0 goto_if_eq SlateportCity_PokemonFanClub_EventScript_28CA45 msgbox SlateportCity_PokemonFanClub_Text_2804AC, MSGBOX_DEFAULT setvar VAR_0x8006, 1 - call SlateportCity_PokemonFanClub_EventScript_271E7C + call Common_ShowEasyChatScreen lock faceplayer compare VAR_RESULT, 0 @@ -3945,10 +3937,10 @@ LilycoveCity_ContestLobby_EventScript_28CA59:: @ 828CA59 LilycoveCity_ContestLobby_EventScript_28CA9B:: @ 828CA9B msgbox LilycoveCity_ContestLobby_Text_27EFE7, MSGBOX_DEFAULT - setvar VAR_0x8004, 11 + setvar VAR_0x8004, EASY_CHAT_TYPE_CONTEST_INTERVIEW copyvar VAR_0x8005, VAR_0x8009 setvar VAR_0x8006, 0 - call LilycoveCity_ContestLobby_EventScript_271E7C + call Common_ShowEasyChatScreen lock faceplayer compare VAR_RESULT, 1 @@ -3966,10 +3958,10 @@ LilycoveCity_ContestLobby_EventScript_28CADA:: @ 828CADA setvar VAR_0x8004, 24 special SetContestCategoryStringVarForInterview msgbox LilycoveCity_ContestLobby_Text_27F03E, MSGBOX_DEFAULT - setvar VAR_0x8004, 11 + setvar VAR_0x8004, EASY_CHAT_TYPE_CONTEST_INTERVIEW copyvar VAR_0x8005, VAR_0x8009 setvar VAR_0x8006, 1 - call LilycoveCity_ContestLobby_EventScript_271E7C + call Common_ShowEasyChatScreen lock faceplayer compare VAR_RESULT, 0 @@ -4034,9 +4026,9 @@ BattleFrontier_BattleTowerLobby_EventScript_28CBD8:: @ 828CBD8 compare VAR_RESULT, 1 call_if_eq BattleFrontier_BattleTowerLobby_EventScript_28CC41 msgbox BattleFrontier_BattleTowerLobby_Text_27F97A, MSGBOX_DEFAULT - setvar VAR_0x8004, 12 + setvar VAR_0x8004, EASY_CHAT_TYPE_BATTLE_TOWER_INTERVIEW copyvar VAR_0x8005, VAR_0x8009 - call BattleFrontier_BattleTowerLobby_EventScript_271E7C + call Common_ShowEasyChatScreen lock faceplayer compare VAR_RESULT, 1 @@ -4506,7 +4498,7 @@ LilycoveCity_PokemonCenter_1F_EventScript_2A861C:: @ 82A861C special sub_818E3BC compare VAR_0x8004, 0 goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_2A864C - compare VAR_0x8004, 15 + compare VAR_0x8004, EASY_CHAT_TYPE_QUIZ_ANSWER goto_if_eq LilycoveCity_PokemonCenter_1F_EventScript_2A8656 LilycoveCity_PokemonCenter_1F_EventScript_2A8635:: @ 82A8635 diff --git a/data/maps/BattleFrontier_BattleTowerLobby/scripts.inc b/data/maps/BattleFrontier_BattleTowerLobby/scripts.inc index 8d407ac1d..6d53a33e1 100644 --- a/data/maps/BattleFrontier_BattleTowerLobby/scripts.inc +++ b/data/maps/BattleFrontier_BattleTowerLobby/scripts.inc @@ -572,8 +572,8 @@ BattleFrontier_BattleTowerLobby_EventScript_23EEE7:: @ 823EEE7 BattleFrontier_BattleTowerLobby_EventScript_23EF32:: @ 823EF32 msgbox BattleFrontier_BattleTowerLobby_Text_23F969, MSGBOX_DEFAULT - setvar VAR_0x8004, 1 - call BattleFrontier_BattleTowerLobby_EventScript_271E7C + setvar VAR_0x8004, EASY_CHAT_TYPE_BATTLE_START + call Common_ShowEasyChatScreen lock faceplayer goto BattleFrontier_BattleTowerLobby_EventScript_23EF8A @@ -581,8 +581,8 @@ BattleFrontier_BattleTowerLobby_EventScript_23EF32:: @ 823EF32 BattleFrontier_BattleTowerLobby_EventScript_23EF4C:: @ 823EF4C msgbox BattleFrontier_BattleTowerLobby_Text_23F9AA, MSGBOX_DEFAULT - setvar VAR_0x8004, 2 - call BattleFrontier_BattleTowerLobby_EventScript_271E7C + setvar VAR_0x8004, EASY_CHAT_TYPE_BATTLE_WON + call Common_ShowEasyChatScreen lock faceplayer goto BattleFrontier_BattleTowerLobby_EventScript_23EF8A @@ -590,8 +590,8 @@ BattleFrontier_BattleTowerLobby_EventScript_23EF4C:: @ 823EF4C BattleFrontier_BattleTowerLobby_EventScript_23EF66:: @ 823EF66 msgbox BattleFrontier_BattleTowerLobby_Text_23F9D4, MSGBOX_DEFAULT - setvar VAR_0x8004, 3 - call BattleFrontier_BattleTowerLobby_EventScript_271E7C + setvar VAR_0x8004, EASY_CHAT_TYPE_BATTLE_LOST + call Common_ShowEasyChatScreen lock faceplayer goto BattleFrontier_BattleTowerLobby_EventScript_23EF8A diff --git a/data/maps/DewfordTown/scripts.inc b/data/maps/DewfordTown/scripts.inc index d1f382e36..ed8acea17 100644 --- a/data/maps/DewfordTown/scripts.inc +++ b/data/maps/DewfordTown/scripts.inc @@ -608,8 +608,8 @@ DewfordTown_EventScript_1E9948:: @ 81E9948 DewfordTown_EventScript_1E9952:: @ 81E9952 msgbox DewfordTown_Text_1EA242, MSGBOX_DEFAULT - setvar VAR_0x8004, 9 - call DewfordTown_EventScript_271E7C + setvar VAR_0x8004, EASY_CHAT_TYPE_TRENDY_PHRASE + call Common_ShowEasyChatScreen lock faceplayer compare VAR_RESULT, 1 diff --git a/data/maps/LilycoveCity_PokemonTrainerFanClub/scripts.inc b/data/maps/LilycoveCity_PokemonTrainerFanClub/scripts.inc index f65d901bb..f83be42b9 100644 --- a/data/maps/LilycoveCity_PokemonTrainerFanClub/scripts.inc +++ b/data/maps/LilycoveCity_PokemonTrainerFanClub/scripts.inc @@ -512,9 +512,9 @@ LilycoveCity_PokemonTrainerFanClub_EventScript_21CD90:: @ 821CD90 setvar VAR_0x8004, 8 special BufferStreakTrainerText msgbox LilycoveCity_PokemonTrainerFanClub_Text_281BCB, MSGBOX_DEFAULT - setvar VAR_0x8004, 14 + setvar VAR_0x8004, EASY_CHAT_TYPE_FAN_QUESTION copyvar VAR_0x8005, VAR_0x800A - call LilycoveCity_PokemonTrainerFanClub_EventScript_271E7C + call Common_ShowEasyChatScreen lock faceplayer compare VAR_RESULT, 1 @@ -542,9 +542,9 @@ LilycoveCity_PokemonTrainerFanClub_EventScript_21CE15:: @ 821CE15 setvar VAR_0x8004, 8 special BufferStreakTrainerText msgbox LilycoveCity_PokemonTrainerFanClub_Text_281C65, MSGBOX_DEFAULT - setvar VAR_0x8004, 14 + setvar VAR_0x8004, EASY_CHAT_TYPE_FAN_QUESTION copyvar VAR_0x8005, VAR_0x800A - call LilycoveCity_PokemonTrainerFanClub_EventScript_271E7C + call Common_ShowEasyChatScreen lock faceplayer compare VAR_RESULT, 1 diff --git a/data/maps/Route123_BerryMastersHouse/scripts.inc b/data/maps/Route123_BerryMastersHouse/scripts.inc index 6d4afa30a..31158782d 100644 --- a/data/maps/Route123_BerryMastersHouse/scripts.inc +++ b/data/maps/Route123_BerryMastersHouse/scripts.inc @@ -41,8 +41,8 @@ Route123_BerryMastersHouse_EventScript_26F8C0:: @ 826F8C0 dotimebasedevents goto_if_set FLAG_DAILY_BERRY_MASTERS_WIFE, Route123_BerryMastersHouse_EventScript_26FA6F msgbox Route123_BerryMastersHouse_Text_2A74E6, MSGBOX_DEFAULT - setvar VAR_0x8004, 13 - call Route123_BerryMastersHouse_EventScript_271E7C + setvar VAR_0x8004, EASY_CHAT_TYPE_GOOD_SAYING + call Common_ShowEasyChatScreen lock faceplayer compare VAR_RESULT, 1 diff --git a/data/scripts/apprentice.inc b/data/scripts/apprentice.inc index ac4bd1979..d6713cde4 100644 --- a/data/scripts/apprentice.inc +++ b/data/scripts/apprentice.inc @@ -269,8 +269,8 @@ BattleFrontier_BattleTowerLobby_EventScript_2B6DD4: apprentice_msg TRUE, 11 setvar VAR_0x8004, 25 special CallApprenticeFunction - setvar VAR_0x8004, 19 - call BattleFrontier_BattleTowerLobby_EventScript_271E7C + setvar VAR_0x8004, EASY_CHAT_TYPE_APPRENTICE + call Common_ShowEasyChatScreen lock faceplayer setvar VAR_0x8004, 21 diff --git a/data/scripts/gabby_and_ty.inc b/data/scripts/gabby_and_ty.inc index ee0e533bc..31000539c 100644 --- a/data/scripts/gabby_and_ty.inc +++ b/data/scripts/gabby_and_ty.inc @@ -313,8 +313,8 @@ Route111_EventScript_28D0A7:: @ 828D0A7 compare VAR_RESULT, 0 goto_if_eq Route111_EventScript_28D0E1 msgbox Route111_Text_28B433, MSGBOX_DEFAULT - setvar VAR_0x8004, 10 - call Route111_EventScript_271E7C + setvar VAR_0x8004, EASY_CHAT_TYPE_GABBY_AND_TY + call Common_ShowEasyChatScreen lock faceplayer compare VAR_RESULT, 0 diff --git a/data/scripts/mauville_man.inc b/data/scripts/mauville_man.inc index 2791e5d9f..0ab47ea80 100644 --- a/data/scripts/mauville_man.inc +++ b/data/scripts/mauville_man.inc @@ -43,8 +43,8 @@ MauvilleCity_PokemonCenter_1F_EventScript_28E0F4:: @ 828E0F4 end MauvilleCity_PokemonCenter_1F_EventScript_28E113:: @ 828E113 - setvar VAR_0x8004, 6 - call MauvilleCity_PokemonCenter_1F_EventScript_271E7C + setvar VAR_0x8004, EASY_CHAT_TYPE_BARD_SONG + call Common_ShowEasyChatScreen lock faceplayer compare VAR_RESULT, 0 diff --git a/data/scripts/mystery_event_club.inc b/data/scripts/mystery_event_club.inc index ea805edc4..cc189a96b 100644 --- a/data/scripts/mystery_event_club.inc +++ b/data/scripts/mystery_event_club.inc @@ -24,8 +24,8 @@ PetalburgCity_PokemonCenter_1F_EventScript_291591:: @ 8291591 PetalburgCity_PokemonCenter_1F_EventScript_29159F:: @ 829159F msgbox PetalburgCity_PokemonCenter_1F_Text_291969, MSGBOX_DEFAULT closemessage - setvar VAR_0x8004, 0 - call PetalburgCity_PokemonCenter_1F_EventScript_271E7C + setvar VAR_0x8004, EASY_CHAT_TYPE_PROFILE + call Common_ShowEasyChatScreen lock faceplayer compare VAR_RESULT, 0 @@ -76,8 +76,8 @@ PetalburgCity_PokemonCenter_1F_EventScript_291642:: @ 8291642 PetalburgCity_PokemonCenter_1F_EventScript_291650:: @ 8291650 msgbox PetalburgCity_PokemonCenter_1F_Text_291A6B, MSGBOX_DEFAULT closemessage - setvar VAR_0x8004, 0 - call PetalburgCity_PokemonCenter_1F_EventScript_271E7C + setvar VAR_0x8004, EASY_CHAT_TYPE_PROFILE + call Common_ShowEasyChatScreen lock faceplayer compare VAR_RESULT, 0 diff --git a/data/specials.inc b/data/specials.inc index 965bef117..e7f5e6072 100644 --- a/data/specials.inc +++ b/data/specials.inc @@ -106,7 +106,7 @@ gSpecials:: @ 81DBA64 def_special sub_80B3000 def_special SaveGame def_special DoWateringBerryTreeAnim - def_special easy_chat_input_maybe + def_special ShowEasyChatScreen def_special sub_811EECC def_special ScrSpecial_GetCurrentMauvilleMan def_special ScrSpecial_HasBardSongBeenChanged diff --git a/graphics/misc/interview_arrow.png b/graphics/easy_chat/scroll_indicator.png similarity index 100% rename from graphics/misc/interview_arrow.png rename to graphics/easy_chat/scroll_indicator.png diff --git a/graphics/misc/interview_buttons.png b/graphics/easy_chat/start_select_buttons.png similarity index 100% rename from graphics/misc/interview_buttons.png rename to graphics/easy_chat/start_select_buttons.png diff --git a/graphics/misc/interview_triangle_cursor.png b/graphics/easy_chat/triangle_cursor.png similarity index 100% rename from graphics/misc/interview_triangle_cursor.png rename to graphics/easy_chat/triangle_cursor.png diff --git a/include/constants/easy_chat.h b/include/constants/easy_chat.h index 1c8866bc3..50f5994f4 100644 --- a/include/constants/easy_chat.h +++ b/include/constants/easy_chat.h @@ -1,6 +1,33 @@ #ifndef GUARD_CONSTANTS_EASY_CHAT_H #define GUARD_CONSTANTS_EASY_CHAT_H +#define EASY_CHAT_TYPE_PROFILE 0 +#define EASY_CHAT_TYPE_BATTLE_START 1 +#define EASY_CHAT_TYPE_BATTLE_WON 2 +#define EASY_CHAT_TYPE_BATTLE_LOST 3 +#define EASY_CHAT_TYPE_MAIL 4 +#define EASY_CHAT_TYPE_INTERVIEW 5 +#define EASY_CHAT_TYPE_BARD_SONG 6 +#define EASY_CHAT_TYPE_FAN_CLUB 7 +#define EASY_CHAT_TYPE_UNK_8 8 +#define EASY_CHAT_TYPE_TRENDY_PHRASE 9 +#define EASY_CHAT_TYPE_GABBY_AND_TY 10 +#define EASY_CHAT_TYPE_CONTEST_INTERVIEW 11 +#define EASY_CHAT_TYPE_BATTLE_TOWER_INTERVIEW 12 +#define EASY_CHAT_TYPE_GOOD_SAYING 13 +#define EASY_CHAT_TYPE_FAN_QUESTION 14 +#define EASY_CHAT_TYPE_QUIZ_ANSWER 15 +#define EASY_CHAT_TYPE_QUIZ_QUESTION 16 +#define EASY_CHAT_TYPE_QUIZ_SET_QUESTION 17 +#define EASY_CHAT_TYPE_QUIZ_SET_ANSWER 18 +#define EASY_CHAT_TYPE_APPRENTICE 19 +#define EASY_CHAT_TYPE_QUESTIONNAIRE 20 + +#define EASY_CHAT_PERSON_REPORTER_MALE 0 +#define EASY_CHAT_PERSON_REPORTER_FEMALE 1 +#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 diff --git a/include/easy_chat.h b/include/easy_chat.h index b7685e48c..2efdc4e5d 100644 --- a/include/easy_chat.h +++ b/include/easy_chat.h @@ -6,11 +6,11 @@ struct EasyChatScreenTemplate { - u8 unk_00; + u8 type; u8 numColumns; u8 numRows; - u8 unk_03_0:7; - u8 unk_03_7:1; + u8 frameId:7; + u8 fourFooterOptions:1; const u8 *titleText; const u8 *instructionsText1; const u8 *instructionsText2; @@ -20,7 +20,7 @@ struct EasyChatScreenTemplate struct EasyChatScreen { - /*0x00*/ u8 kind; + /*0x00*/ u8 type; /*0x01*/ u8 templateId; /*0x02*/ u8 numColumns; /*0x03*/ u8 numRows; @@ -28,7 +28,7 @@ struct EasyChatScreen /*0x05*/ s8 mainCursorColumn; /*0x06*/ s8 mainCursorRow; /*0x07*/ u8 unk_07; - /*0x08*/ u8 unk_08; + /*0x08*/ u8 stateBackup; /*0x09*/ u8 unk_09; /*0x0A*/ s8 unk_0a; /*0x0B*/ s8 unk_0b; @@ -38,7 +38,7 @@ struct EasyChatScreen /*0x0F*/ u8 unk_0f; /*0x10*/ s8 unk_10; /*0x11*/ s8 unk_11; - /*0x12*/ u8 sizeParam; + /*0x12*/ u8 displayedPersonType; /*0x13*/ u8 unk_13; /*0x14*/ u8 unk_14[0x20]; /*0x34*/ const u8 *titleText; @@ -75,13 +75,13 @@ struct Unk203A11C u16 unkB00[BG_SCREEN_SIZE / 2]; }; -struct Unk08597C30 +struct EasyChatPhraseFrameDimensions { - u8 unk0_0:5; - u8 unk0_5:3; - u8 unk1; - u8 unk2; - u8 unk3; + u8 left:5; + u8 top:3; + u8 width; + u8 height; + u8 footerId; }; struct EasyChatWordInfo @@ -122,7 +122,7 @@ struct EasyChatWordsByLetter }; void InitEasyChatPhrases(void); -void easy_chat_input_maybe(void); +void ShowEasyChatScreen(void); u8 * CopyEasyChatWord(u8 *dest, u16 word); bool32 sub_811F8D8(int word); void InitializeEasyChatWordArray(u16 *words, u16 length); @@ -132,7 +132,7 @@ u16 sub_811EE38(u16 group); u16 sub_811F01C(void); u16 EasyChat_GetNumWordsInGroup(u8); u16 sub_811EE90(u16); -void sub_811A20C(u8 kind, u16 *words, MainCallback callback, u8 sizeParam); +void DoEasyChatScreen(u8 type, u16 *words, MainCallback callback, u8 displayedPersonType); void sub_811F8BC(void); #endif // GUARD_EASYCHAT_H diff --git a/include/global.h b/include/global.h index ee0ba6893..cc026f36a 100644 --- a/include/global.h +++ b/include/global.h @@ -870,10 +870,10 @@ struct SaveBlock1 /*0x2BA1*/ u8 outbreakPokemonProbability; /*0x2BA2*/ u16 outbreakDaysLeft; /*0x2BA4*/ struct GabbyAndTyData gabbyAndTyData; - /*0x2BB0*/ u16 unk2BB0[6]; - /*0x2BBC*/ u16 unk2BBC[6]; - /*0x2BC8*/ u16 unk2BC8[6]; - /*0x2BD4*/ u16 unk2BD4[6]; + /*0x2BB0*/ u16 easyChatProfile[6]; + /*0x2BBC*/ u16 easyChatBattleStart[6]; + /*0x2BC8*/ u16 easyChatBattleWon[6]; + /*0x2BD4*/ u16 easyChatBattleLost[6]; /*0x2BE0*/ struct MailStruct mail[MAIL_COUNT]; /*0x2E20*/ u8 additionalPhrases[8]; // bitfield for 33 additional phrases in easy chat system /*0x2E28*/ OldMan oldMan; diff --git a/src/battle_tower.c b/src/battle_tower.c index fbb77789e..06aaef48d 100644 --- a/src/battle_tower.c +++ b/src/battle_tower.c @@ -2401,9 +2401,9 @@ static void sub_8163EE4(void) for (i = 0; i < 6; i++) { - playerRecord->greeting[i] = gSaveBlock1Ptr->unk2BBC[i]; - playerRecord->speechWon[i] = gSaveBlock1Ptr->unk2BC8[i]; - playerRecord->speechLost[i] = gSaveBlock1Ptr->unk2BD4[i]; + playerRecord->greeting[i] = gSaveBlock1Ptr->easyChatBattleStart[i]; + playerRecord->speechWon[i] = gSaveBlock1Ptr->easyChatBattleWon[i]; + playerRecord->speechLost[i] = gSaveBlock1Ptr->easyChatBattleLost[i]; } for (i = 0; i < 4; i++) @@ -3059,7 +3059,7 @@ static void FillEReaderTrainerWithPlayerData(void) j = 7; for (i = 0; i < 6; i++) { - ereaderTrainer->greeting[i] = gSaveBlock1Ptr->unk2BBC[i]; + ereaderTrainer->greeting[i] = gSaveBlock1Ptr->easyChatBattleStart[i]; ereaderTrainer->farewellPlayerLost[i] = j; ereaderTrainer->farewellPlayerWon[i] = j + 6; j++; diff --git a/src/easy_chat.c b/src/easy_chat.c index 3c436246d..aa681eeba 100644 --- a/src/easy_chat.c +++ b/src/easy_chat.c @@ -34,18 +34,18 @@ #include "constants/species.h" #define EZCHAT_TASK_STATE 0 -#define EZCHAT_TASK_KIND 1 +#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 -EWRAM_DATA struct EasyChatScreen *gEasyChatScreen = NULL; -EWRAM_DATA struct Unk203A11C *gUnknown_0203A11C = 0; -EWRAM_DATA struct Unk203A120 *gUnknown_0203A120 = 0; +static EWRAM_DATA struct EasyChatScreen *sEasyChatScreen = NULL; +static EWRAM_DATA struct Unk203A11C *sUnknown_0203A11C = NULL; +static EWRAM_DATA struct Unk203A120 *sUnknown_0203A120 = NULL; static void sub_811A2C0(u8); -static void sub_811A278(void); +static void MainCallback_EasyChatScreen(void); static bool8 sub_811A428(u8); static void sub_811A2FC(u8); static void sub_811A4D0(MainCallback); @@ -67,8 +67,8 @@ static u16 sub_811B0E8(void); static u16 sub_811B0F8(void); static u16 sub_811B150(void); static u16 sub_811B1B4(void); -static u8 sub_811BA68(void); -static u8 sub_811BCC8(u8); +static u8 GetEasyChatScreenFrameId(void); +static u8 GetEachChatScreenTemplateId(u8); static void sub_811BDF0(u8 *); static void sub_811BF78(void); static bool8 sub_811BF8C(void); @@ -79,7 +79,7 @@ static bool8 sub_811C170(void); static bool8 sub_811F28C(void); static void sub_811F2B8(void); static u8 sub_811F3AC(void); -static int sub_811BA3C(void); +static int FooterHasFourOptions(void); static int sub_811B184(void); static int sub_811B264(void); static int sub_811B32C(void); @@ -169,7 +169,7 @@ static bool8 sub_811CDD4(void); static bool8 sub_811CE14(void); static bool8 sub_811CE54(void); static void sub_811DF60(u8, u8); -static int sub_811E920(int); +static int GetFooterOptionXOffset(int); static void sub_811DF90(void); static void sub_811D104(u8); static void sub_811D214(u8); @@ -228,10 +228,10 @@ static u16 sub_811F5C4(u16); static u16 sub_811F6B8(u16); static bool8 sub_811F764(u16, u8); static int sub_811F838(u16); -static void sub_811A8CC(void); -static void sub_811A8F0(void); -static void sub_811A914(void); -static void sub_811A938(void); +static void DoQuizAnswerEasyChatScreen(void); +static void DoQuizQuestionEasyChatScreen(void); +static void DoQuizSetAnswerEasyChatScreen(void); +static void DoQuizSetQuestionEasyChatScreen(void); struct Unk8597530 { @@ -242,28 +242,29 @@ struct Unk8597530 static const struct Unk8597530 sUnknown_08597530[] = { { .word = 26, - .callback = sub_811A8CC, + .callback = DoQuizAnswerEasyChatScreen, }, { .word = 25, - .callback = sub_811A8F0, + .callback = DoQuizQuestionEasyChatScreen, }, { .word = 28, - .callback = sub_811A914, + .callback = DoQuizSetAnswerEasyChatScreen, }, { .word = 27, - .callback = sub_811A938, + .callback = DoQuizSetQuestionEasyChatScreen, }, }; -static const struct EasyChatScreenTemplate gEasyChatScreenTemplates[] = { + +static const struct EasyChatScreenTemplate sEasyChatScreenTemplates[] = { { - .unk_00 = 0, + .type = EASY_CHAT_TYPE_PROFILE, .numColumns = 2, .numRows = 2, - .unk_03_0 = 0, - .unk_03_7 = 0, + .frameId = 0, + .fourFooterOptions = FALSE, .titleText = gText_Profile, .instructionsText1 = gText_CombineFourWordsOrPhrases, .instructionsText2 = gText_AndMakeYourProfile, @@ -271,11 +272,11 @@ static const struct EasyChatScreenTemplate gEasyChatScreenTemplates[] = { .confirmText2 = gText_IsAsShownOkay, }, { - .unk_00 = 1, + .type = EASY_CHAT_TYPE_BATTLE_START, .numColumns = 2, .numRows = 3, - .unk_03_0 = 1, - .unk_03_7 = 0, + .frameId = 1, + .fourFooterOptions = FALSE, .titleText = gText_AtTheBattlesStart, .instructionsText1 = gText_CombineSixWordsOrPhrases, .instructionsText2 = gText_AndMakeAMessage, @@ -283,11 +284,11 @@ static const struct EasyChatScreenTemplate gEasyChatScreenTemplates[] = { .confirmText2 = gText_IsAsShownOkay, }, { - .unk_00 = 2, + .type = EASY_CHAT_TYPE_BATTLE_WON, .numColumns = 2, .numRows = 3, - .unk_03_0 = 1, - .unk_03_7 = 0, + .frameId = 1, + .fourFooterOptions = FALSE, .titleText = gText_UponWinningABattle, .instructionsText1 = gText_CombineSixWordsOrPhrases, .instructionsText2 = gText_AndMakeAMessage, @@ -295,11 +296,11 @@ static const struct EasyChatScreenTemplate gEasyChatScreenTemplates[] = { .confirmText2 = gText_IsAsShownOkay, }, { - .unk_00 = 3, + .type = EASY_CHAT_TYPE_BATTLE_LOST, .numColumns = 2, .numRows = 3, - .unk_03_0 = 1, - .unk_03_7 = 0, + .frameId = 1, + .fourFooterOptions = FALSE, .titleText = gText_UponLosingABattle, .instructionsText1 = gText_CombineSixWordsOrPhrases, .instructionsText2 = gText_AndMakeAMessage, @@ -307,11 +308,11 @@ static const struct EasyChatScreenTemplate gEasyChatScreenTemplates[] = { .confirmText2 = gText_IsAsShownOkay, }, { - .unk_00 = 4, + .type = EASY_CHAT_TYPE_MAIL, .numColumns = 2, .numRows = 5, - .unk_03_0 = 2, - .unk_03_7 = 0, + .frameId = 2, + .fourFooterOptions = FALSE, .titleText = NULL, .instructionsText1 = gText_CombineNineWordsOrPhrases, .instructionsText2 = gText_AndMakeAMessage2, @@ -319,11 +320,11 @@ static const struct EasyChatScreenTemplate gEasyChatScreenTemplates[] = { .confirmText2 = gText_IsAsShownOkay, }, { - .unk_00 = 5, + .type = EASY_CHAT_TYPE_INTERVIEW, .numColumns = 2, .numRows = 2, - .unk_03_0 = 5, - .unk_03_7 = 0, + .frameId = 5, + .fourFooterOptions = FALSE, .titleText = gText_Interview, .instructionsText1 = gText_CombineFourWordsOrPhrases, .instructionsText2 = gText_LetsReplyToTheInterview, @@ -331,11 +332,11 @@ static const struct EasyChatScreenTemplate gEasyChatScreenTemplates[] = { .confirmText2 = gText_IsAsShownOkay, }, { - .unk_00 = 6, + .type = EASY_CHAT_TYPE_BARD_SONG, .numColumns = 2, .numRows = 3, - .unk_03_0 = 1, - .unk_03_7 = 0, + .frameId = 1, + .fourFooterOptions = FALSE, .titleText = gText_TheBardsSong, .instructionsText1 = gText_ChangeJustOneWordOrPhrase, .instructionsText2 = gText_AndImproveTheBardsSong, @@ -343,11 +344,11 @@ static const struct EasyChatScreenTemplate gEasyChatScreenTemplates[] = { .confirmText2 = gText_IsAsShownOkay, }, { - .unk_00 = 7, + .type = EASY_CHAT_TYPE_FAN_CLUB, .numColumns = 1, .numRows = 1, - .unk_03_0 = 4, - .unk_03_7 = 0, + .frameId = 4, + .fourFooterOptions = FALSE, .titleText = gText_Interview, .instructionsText1 = gText_FindWordsThatDescribeYour, .instructionsText2 = gText_FeelingsRightNow, @@ -355,11 +356,11 @@ static const struct EasyChatScreenTemplate gEasyChatScreenTemplates[] = { .confirmText2 = gText_IsAsShownOkay, }, { - .unk_00 = 9, + .type = EASY_CHAT_TYPE_TRENDY_PHRASE, .numColumns = 2, .numRows = 1, - .unk_03_0 = 3, - .unk_03_7 = 0, + .frameId = 3, + .fourFooterOptions = FALSE, .titleText = gText_WhatsHipAndHappening, .instructionsText1 = gText_CombineTwoWordsOrPhrases, .instructionsText2 = gText_AndMakeATrendySaying, @@ -367,11 +368,11 @@ static const struct EasyChatScreenTemplate gEasyChatScreenTemplates[] = { .confirmText2 = gText_IsAsShownOkay, }, { - .unk_00 = 16, + .type = EASY_CHAT_TYPE_QUIZ_QUESTION, .numColumns = 2, .numRows = 5, - .unk_03_0 = 7, - .unk_03_7 = 1, + .frameId = 7, + .fourFooterOptions = TRUE, .titleText = NULL, .instructionsText1 = gText_AfterYouHaveReadTheQuiz, .instructionsText2 = gText_QuestionPressTheAButton, @@ -379,11 +380,11 @@ static const struct EasyChatScreenTemplate gEasyChatScreenTemplates[] = { .confirmText2 = NULL, }, { - .unk_00 = 15, + .type = EASY_CHAT_TYPE_QUIZ_ANSWER, .numColumns = 1, .numRows = 1, - .unk_03_0 = 6, - .unk_03_7 = 1, + .frameId = 6, + .fourFooterOptions = TRUE, .titleText = gText_TheQuizAnswerIs, .instructionsText1 = gText_OutOfTheListedChoices, .instructionsText2 = gText_SelectTheAnswerToTheQuiz, @@ -391,11 +392,11 @@ static const struct EasyChatScreenTemplate gEasyChatScreenTemplates[] = { .confirmText2 = gText_IsAsShownOkay, }, { - .unk_00 = 17, + .type = EASY_CHAT_TYPE_QUIZ_SET_QUESTION, .numColumns = 2, .numRows = 5, - .unk_03_0 = 8, - .unk_03_7 = 1, + .frameId = 8, + .fourFooterOptions = TRUE, .titleText = NULL, .instructionsText1 = gText_CombineNineWordsOrPhrases, .instructionsText2 = gText_AndCreateAQuiz, @@ -403,11 +404,11 @@ static const struct EasyChatScreenTemplate gEasyChatScreenTemplates[] = { .confirmText2 = NULL, }, { - .unk_00 = 18, + .type = EASY_CHAT_TYPE_QUIZ_SET_ANSWER, .numColumns = 1, .numRows = 1, - .unk_03_0 = 6, - .unk_03_7 = 1, + .frameId = 6, + .fourFooterOptions = TRUE, .titleText = gText_TheQuizAnswerIs, .instructionsText1 = gText_PickAWordOrPhraseAnd, .instructionsText2 = gText_SetTheQuizAnswer, @@ -415,11 +416,11 @@ static const struct EasyChatScreenTemplate gEasyChatScreenTemplates[] = { .confirmText2 = NULL, }, { - .unk_00 = 6, + .type = EASY_CHAT_TYPE_BARD_SONG, .numColumns = 2, .numRows = 3, - .unk_03_0 = 1, - .unk_03_7 = 0, + .frameId = 1, + .fourFooterOptions = FALSE, .titleText = gText_TheBardsSong, .instructionsText1 = gText_ChangeJustOneWordOrPhrase, .instructionsText2 = gText_AndImproveTheBardsSong, @@ -427,11 +428,11 @@ static const struct EasyChatScreenTemplate gEasyChatScreenTemplates[] = { .confirmText2 = gText_IsAsShownOkay, }, { - .unk_00 = 19, + .type = EASY_CHAT_TYPE_APPRENTICE, .numColumns = 2, .numRows = 3, - .unk_03_0 = 1, - .unk_03_7 = 0, + .frameId = 1, + .fourFooterOptions = FALSE, .titleText = gText_ApprenticesPhrase, .instructionsText1 = gText_FindWordsWhichFit, .instructionsText2 = gText_TheTrainersImage, @@ -439,11 +440,11 @@ static const struct EasyChatScreenTemplate gEasyChatScreenTemplates[] = { .confirmText2 = gText_IsAsShownOkay, }, { - .unk_00 = 13, + .type = EASY_CHAT_TYPE_GOOD_SAYING, .numColumns = 2, .numRows = 1, - .unk_03_0 = 3, - .unk_03_7 = 0, + .frameId = 3, + .fourFooterOptions = FALSE, .titleText = gText_GoodSaying, .instructionsText1 = gText_CombineTwoWordsOrPhrases2, .instructionsText2 = gText_ToTeachHerAGoodSaying, @@ -451,11 +452,11 @@ static const struct EasyChatScreenTemplate gEasyChatScreenTemplates[] = { .confirmText2 = gText_IsAsShownOkay, }, { - .unk_00 = 10, + .type = EASY_CHAT_TYPE_GABBY_AND_TY, .numColumns = 1, .numRows = 1, - .unk_03_0 = 4, - .unk_03_7 = 0, + .frameId = 4, + .fourFooterOptions = FALSE, .titleText = gText_Interview, .instructionsText1 = gText_FindWordsThatDescribeYour, .instructionsText2 = gText_FeelingsRightNow, @@ -463,11 +464,11 @@ static const struct EasyChatScreenTemplate gEasyChatScreenTemplates[] = { .confirmText2 = gText_IsAsShownOkay, }, { - .unk_00 = 12, + .type = EASY_CHAT_TYPE_BATTLE_TOWER_INTERVIEW, .numColumns = 1, .numRows = 1, - .unk_03_0 = 4, - .unk_03_7 = 0, + .frameId = 4, + .fourFooterOptions = FALSE, .titleText = gText_Interview, .instructionsText1 = gText_FindWordsThatDescribeYour, .instructionsText2 = gText_FeelingsRightNow, @@ -475,11 +476,11 @@ static const struct EasyChatScreenTemplate gEasyChatScreenTemplates[] = { .confirmText2 = gText_IsAsShownOkay, }, { - .unk_00 = 11, + .type = EASY_CHAT_TYPE_CONTEST_INTERVIEW, .numColumns = 1, .numRows = 1, - .unk_03_0 = 4, - .unk_03_7 = 0, + .frameId = 4, + .fourFooterOptions = FALSE, .titleText = gText_Interview, .instructionsText1 = gText_FindWordsThatDescribeYour, .instructionsText2 = gText_FeelingsRightNow, @@ -487,11 +488,11 @@ static const struct EasyChatScreenTemplate gEasyChatScreenTemplates[] = { .confirmText2 = gText_IsAsShownOkay, }, { - .unk_00 = 14, + .type = EASY_CHAT_TYPE_FAN_QUESTION, .numColumns = 1, .numRows = 1, - .unk_03_0 = 4, - .unk_03_7 = 0, + .frameId = 4, + .fourFooterOptions = FALSE, .titleText = gText_FansQuestion, .instructionsText1 = gText_FindWordsWhichFit, .instructionsText2 = gText_TheTrainersImage, @@ -499,11 +500,11 @@ static const struct EasyChatScreenTemplate gEasyChatScreenTemplates[] = { .confirmText2 = gText_IsAsShownOkay, }, { - .unk_00 = 20, + .type = EASY_CHAT_TYPE_QUESTIONNAIRE, .numColumns = 2, .numRows = 2, - .unk_03_0 = 0, - .unk_03_7 = 0, + .frameId = 0, + .fourFooterOptions = FALSE, .titleText = gText_Questionnaire, .instructionsText1 = gText_CombineFourWordsOrPhrases, .instructionsText2 = gText_AndFillOutTheQuestionnaire, @@ -534,10 +535,10 @@ static const u16 sBerryMasterWifePhrases[][2] = { {EC_WORD_SUPER, EC_WORD_HUSTLE}, }; -static const u16 sUnknown_08597780[] = INCBIN_U16("graphics/misc/interview_triangle_cursor.gbapal"); -static const u32 sUnknown_085977A0[] = INCBIN_U32("graphics/misc/interview_triangle_cursor.4bpp"); -static const u32 sUnknown_085977C0[] = INCBIN_U32("graphics/misc/interview_arrow.4bpp"); -static const u32 sUnknown_085978C0[] = INCBIN_U32("graphics/misc/interview_buttons.4bpp"); +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 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"); @@ -546,69 +547,69 @@ static const u32 sUnknown_08597B54[] = INCBIN_U32("graphics/misc/interview_frame 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 Unk08597C30 gUnknown_08597C30[] = { +static const struct EasyChatPhraseFrameDimensions sPhraseFrameDimensions[] = { { - .unk0_0 = 3, - .unk0_5 = 4, - .unk1 = 24, - .unk2 = 4, - .unk3 = 0, + .left = 3, + .top = 4, + .width = 24, + .height = 4, + .footerId = 0, }, { - .unk0_0 = 3, - .unk0_5 = 3, - .unk1 = 24, - .unk2 = 6, - .unk3 = 0, + .left = 3, + .top = 3, + .width = 24, + .height = 6, + .footerId = 0, }, { - .unk0_0 = 3, - .unk0_5 = 0, - .unk1 = 24, - .unk2 = 10, - .unk3 = 0, + .left = 3, + .top = 0, + .width = 24, + .height = 10, + .footerId = 0, }, { - .unk0_0 = 3, - .unk0_5 = 5, - .unk1 = 24, - .unk2 = 2, - .unk3 = 0, + .left = 3, + .top = 5, + .width = 24, + .height = 2, + .footerId = 0, }, { - .unk0_0 = 16, - .unk0_5 = 5, - .unk1 = 12, - .unk2 = 2, - .unk3 = 0, + .left = 16, + .top = 5, + .width = 12, + .height = 2, + .footerId = 0, }, { - .unk0_0 = 3, - .unk0_5 = 4, - .unk1 = 24, - .unk2 = 4, - .unk3 = 0, + .left = 3, + .top = 4, + .width = 24, + .height = 4, + .footerId = 0, }, { - .unk0_0 = 9, - .unk0_5 = 4, - .unk1 = 12, - .unk2 = 2, - .unk3 = 1, + .left = 9, + .top = 4, + .width = 12, + .height = 2, + .footerId = 1, }, { - .unk0_0 = 5, - .unk0_5 = 3, - .unk1 = 0x14, - .unk2 = 10, - .unk3 = 3, + .left = 5, + .top = 3, + .width = 0x14, + .height = 10, + .footerId = 3, }, { - .unk0_0 = 3, - .unk0_5 = 0, - .unk1 = 24, - .unk2 = 10, - .unk3 = 2, + .left = 3, + .top = 0, + .width = 24, + .height = 10, + .footerId = 2, }, }; @@ -701,28 +702,28 @@ static const u8 *const sUnknown_08597C90[] = { gUnknown_862B86C, }; -static const struct SpriteSheet sUnknown_08597CA0[] = { +static const struct SpriteSheet sEasyChatSpriteSheets[] = { { - .data = sUnknown_085977A0, + .data = sEasyChatTriangleCursorGfx, .size = 0x0020, .tag = 0 }, { - .data = sUnknown_085977C0, + .data = sEasyChatScrollIndicatorGfx, .size = 0x0100, .tag = 2 }, { - .data = sUnknown_085978C0, + .data = sEasyChatStartSelectButtonsGfx, .size = 0x0100, .tag = 3 }, {0} }; -static const struct SpritePalette sUnknown_08597CC0[] = { +static const struct SpritePalette sEasyChatSpritePalettes[] = { { - .data = sUnknown_08597780, + .data = sEasyChatTriangleCursorPalette, .tag = 0, }, { @@ -999,7 +1000,7 @@ static const struct SpriteTemplate sUnknown_08597E48 = { .callback = SpriteCallbackDummy, }; -static const u8 sUnknown_08597E60[][4] = { +static const u8 sFooterOptionXOffsets[][4] = { {16, 111, 196, 0}, {16, 78, 130, 160}, {16, 80, 134, 170}, @@ -1039,14 +1040,14 @@ const u8 *const gEasyChatGroupNamePointers[] = { [EC_GROUP_POKEMON_2] = gEasyChatGroupName_Pokemon2, }; -static const u16 sUnknown_0859E62C[] = { +static const u16 sDefaultProfileWords[] = { EC_WORD_I_AM, EC_WORD_A, EC_WORD_POKEMON, EC_WORD_FRIEND, }; -static const u16 sUnknown_0859E634[] = { +static const u16 sDefaultBattleStartWords[] = { EC_WORD_ARE, EC_WORD_YOU, EC_WORD_READY, @@ -1077,20 +1078,20 @@ static const u16 sUnknown_0859E658[] = { SPECIES_DEOXYS, }; -void sub_811A20C(u8 kind, u16 *words, MainCallback callback, u8 sizeParam) +void DoEasyChatScreen(u8 type, u16 *words, MainCallback callback, u8 displayedPersonType) { u8 taskId; ResetTasks(); taskId = CreateTask(sub_811A2C0, 0); - gTasks[taskId].data[EZCHAT_TASK_KIND] = kind; - gTasks[taskId].data[EZCHAT_TASK_SIZE] = sizeParam; + 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(sub_811A278); + SetMainCallback2(MainCallback_EasyChatScreen); } -static void sub_811A278(void) +static void MainCallback_EasyChatScreen(void) { RunTasks(); AnimateSprites(); @@ -1098,7 +1099,7 @@ static void sub_811A278(void) UpdatePaletteFade(); } -static void sub_811A290(void) +static void VBlankCallback_EasyChatScreen(void) { TransferPlttBuffer(); LoadOam(); @@ -1136,22 +1137,22 @@ static void sub_811A2FC(u8 taskId) switch (data[EZCHAT_TASK_STATE]) { case 0: - SetVBlankCallback(sub_811A290); + SetVBlankCallback(VBlankCallback_EasyChatScreen); BlendPalettes(0xFFFFFFFF, 16, 0); - BeginNormalPaletteFade(-1, -1, 16, 0, 0); + BeginNormalPaletteFade(0xFFFFFFFF, -1, 16, 0, 0); data[EZCHAT_TASK_STATE] = 5; break; case 1: v0 = sub_811AAAC(); if (sub_811A88C(v0)) { - BeginNormalPaletteFade(-1, -2, 0, 16, 0); + BeginNormalPaletteFade(0xFFFFFFFF, -2, 0, 16, 0); data[EZCHAT_TASK_STATE] = 3; data[EZCHAT_TASK_UNK06] = v0; } else if (v0 == 0x18) { - BeginNormalPaletteFade(-1, -1, 0, 16, 0); + BeginNormalPaletteFade(0xFFFFFFFF, -1, 0, 16, 0); data[EZCHAT_TASK_STATE] = 4; } else if (v0 != 0) @@ -1163,27 +1164,19 @@ static void sub_811A2FC(u8 taskId) break; case 2: if (!sub_811C170()) - { data[EZCHAT_TASK_STATE] = 1; - } break; case 3: if (!gPaletteFade.active) - { sub_811A8A4(data[EZCHAT_TASK_UNK06]); - } break; case 4: if (!gPaletteFade.active) - { sub_811A4D0((MainCallback)GetWordTaskArg(taskId, EZCHAT_TASK_MAINCALLBACK)); - } break; case 5: if (!gPaletteFade.active) - { data[EZCHAT_TASK_STATE] = 1; - } break; } } @@ -1208,7 +1201,7 @@ static bool8 sub_811A428(u8 taskId) } break; case 2: - if (!EasyChat_AllocateResources(data[EZCHAT_TASK_KIND], (u16 *)GetWordTaskArg(taskId, EZCHAT_TASK_WORDS), data[EZCHAT_TASK_SIZE])) + if (!EasyChat_AllocateResources(data[EZCHAT_TASK_TYPE], (u16 *)GetWordTaskArg(taskId, EZCHAT_TASK_WORDS), data[EZCHAT_TASK_SIZE])) { sub_811A4D0((MainCallback)GetWordTaskArg(taskId, EZCHAT_TASK_MAINCALLBACK)); } @@ -1241,98 +1234,98 @@ static void sub_811A4D0(MainCallback callback) SetMainCallback2(callback); } -void easy_chat_input_maybe(void) +void ShowEasyChatScreen(void) { int i; u16 *words; struct MauvilleManBard *bard; - u8 sizeParam = 3; + u8 displayedPersonType = EASY_CHAT_PERSON_DISPLAY_NONE; switch (gSpecialVar_0x8004) { - case 0: - words = gSaveBlock1Ptr->unk2BB0; + case EASY_CHAT_TYPE_PROFILE: + words = gSaveBlock1Ptr->easyChatProfile; break; - case 1: - words = gSaveBlock1Ptr->unk2BBC; + case EASY_CHAT_TYPE_BATTLE_START: + words = gSaveBlock1Ptr->easyChatBattleStart; break; - case 2: - words = gSaveBlock1Ptr->unk2BC8; + case EASY_CHAT_TYPE_BATTLE_WON: + words = gSaveBlock1Ptr->easyChatBattleWon; break; - case 3: - words = gSaveBlock1Ptr->unk2BD4; + case EASY_CHAT_TYPE_BATTLE_LOST: + words = gSaveBlock1Ptr->easyChatBattleLost; break; - case 4: + case EASY_CHAT_TYPE_MAIL: words = gSaveBlock1Ptr->mail[gSpecialVar_0x8005].words; break; - case 6: + case EASY_CHAT_TYPE_BARD_SONG: bard = &gSaveBlock1Ptr->oldMan.bard; for (i = 0; i < 6; i ++) - { bard->temporaryLyrics[i] = bard->songLyrics[i]; - } + words = bard->temporaryLyrics; break; - case 5: + case EASY_CHAT_TYPE_INTERVIEW: words = gSaveBlock1Ptr->tvShows[gSpecialVar_0x8005].bravoTrainer.words; - sizeParam = gSpecialVar_0x8006; + displayedPersonType = gSpecialVar_0x8006; break; - case 7: + case EASY_CHAT_TYPE_FAN_CLUB: words = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8005].fanclubOpinions.words[gSpecialVar_0x8006]; - sizeParam = 1; + displayedPersonType = EASY_CHAT_PERSON_REPORTER_FEMALE; break; - case 8: + case EASY_CHAT_TYPE_UNK_8: words = gSaveBlock1Ptr->tvShows[gSpecialVar_0x8005].unkShow04.words; - sizeParam = 0; + displayedPersonType = EASY_CHAT_PERSON_REPORTER_MALE; break; - case 9: + case EASY_CHAT_TYPE_TRENDY_PHRASE: words = (u16 *)gStringVar3; words[0] = gSaveBlock1Ptr->easyChatPairs[0].words[0]; words[1] = gSaveBlock1Ptr->easyChatPairs[0].words[1]; break; - case 10: + case EASY_CHAT_TYPE_GABBY_AND_TY: words = gSaveBlock1Ptr->gabbyAndTyData.quote; *words = -1; - sizeParam = 1; + displayedPersonType = EASY_CHAT_PERSON_REPORTER_FEMALE; break; - case 11: + case EASY_CHAT_TYPE_CONTEST_INTERVIEW: words = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8005].bravoTrainer.words[gSpecialVar_0x8006]; - sizeParam = 0; + displayedPersonType = EASY_CHAT_PERSON_REPORTER_MALE; break; - case 12: + case EASY_CHAT_TYPE_BATTLE_TOWER_INTERVIEW: words = gSaveBlock1Ptr->tvShows[gSpecialVar_0x8005].fanclubOpinions.words18; - sizeParam = 1; + displayedPersonType = EASY_CHAT_PERSON_REPORTER_FEMALE; break; - case 13: + case EASY_CHAT_TYPE_GOOD_SAYING: words = (u16 *)gStringVar3; InitializeEasyChatWordArray(words, 2); break; - case 14: + case EASY_CHAT_TYPE_FAN_QUESTION: words = gSaveBlock1Ptr->tvShows[gSpecialVar_0x8005].fanClubSpecial.words; words[0] = -1; - sizeParam = 2; + displayedPersonType = EASY_CHAT_PERSON_BOY; break; - case 15: + case EASY_CHAT_TYPE_QUIZ_ANSWER: words = &gSaveBlock1Ptr->lilycoveLady.quiz.unk_016; break; - case 16: + case EASY_CHAT_TYPE_QUIZ_QUESTION: return; - case 17: + case EASY_CHAT_TYPE_QUIZ_SET_QUESTION: words = gSaveBlock1Ptr->lilycoveLady.quiz.unk_002; break; - case 18: + case EASY_CHAT_TYPE_QUIZ_SET_ANSWER: words = &gSaveBlock1Ptr->lilycoveLady.quiz.unk_014; break; - case 19: + case EASY_CHAT_TYPE_APPRENTICE: words = gSaveBlock2Ptr->apprentices[0].easyChatWords; break; - case 20: + case EASY_CHAT_TYPE_QUESTIONNAIRE: words = GetSaveBlock1Field3564(); break; default: return; } + CleanupOverworldWindowsAndTilemaps(); - sub_811A20C(gSpecialVar_0x8004, words, CB2_ReturnToFieldContinueScript, sizeParam); + DoEasyChatScreen(gSpecialVar_0x8004, words, CB2_ReturnToFieldContinueScript, displayedPersonType); } static void sub_811A7E4(void) @@ -1351,7 +1344,7 @@ static void sub_811A7E4(void) lilycoveLady = &gSaveBlock1Ptr->lilycoveLady; lilycoveLady->quiz.unk_016 = -1; CleanupOverworldWindowsAndTilemaps(); - sub_811A8F0(); + DoQuizQuestionEasyChatScreen(); } return; } @@ -1389,88 +1382,100 @@ static void sub_811A8A4(u16 word) sub_811A4D0(sUnknown_08597530[i].callback); } -static void sub_811A8CC(void) +static void DoQuizAnswerEasyChatScreen(void) { - sub_811A20C(0xF, &gSaveBlock1Ptr->lilycoveLady.quiz.unk_016, CB2_ReturnToFieldContinueScript, 3); + DoEasyChatScreen( + EASY_CHAT_TYPE_QUIZ_ANSWER, + &gSaveBlock1Ptr->lilycoveLady.quiz.unk_016, + CB2_ReturnToFieldContinueScript, + EASY_CHAT_PERSON_DISPLAY_NONE); } -static void sub_811A8F0(void) +static void DoQuizQuestionEasyChatScreen(void) { - sub_811A20C(0x10, gSaveBlock1Ptr->lilycoveLady.quiz.unk_002, CB2_ReturnToFieldContinueScript, 3); + DoEasyChatScreen(EASY_CHAT_TYPE_QUIZ_QUESTION, + gSaveBlock1Ptr->lilycoveLady.quiz.unk_002, + CB2_ReturnToFieldContinueScript, + EASY_CHAT_PERSON_DISPLAY_NONE); } -static void sub_811A914(void) +static void DoQuizSetAnswerEasyChatScreen(void) { - sub_811A20C(0x12, &gSaveBlock1Ptr->lilycoveLady.quiz.unk_014, CB2_ReturnToFieldContinueScript, 3); + DoEasyChatScreen(EASY_CHAT_TYPE_QUIZ_SET_ANSWER, + &gSaveBlock1Ptr->lilycoveLady.quiz.unk_014, + CB2_ReturnToFieldContinueScript, + EASY_CHAT_PERSON_DISPLAY_NONE); } -static void sub_811A938(void) +static void DoQuizSetQuestionEasyChatScreen(void) { - sub_811A20C(0x11, gSaveBlock1Ptr->lilycoveLady.quiz.unk_002, CB2_ReturnToFieldContinueScript, 3); + DoEasyChatScreen(EASY_CHAT_TYPE_QUIZ_SET_QUESTION, + gSaveBlock1Ptr->lilycoveLady.quiz.unk_002, + CB2_ReturnToFieldContinueScript, + EASY_CHAT_PERSON_DISPLAY_NONE); } -static bool8 EasyChat_AllocateResources(u8 kind, u16 *words, u8 sizeParam) +static bool8 EasyChat_AllocateResources(u8 type, u16 *words, u8 displayedPersonType) { u8 templateId; int i; - gEasyChatScreen = malloc(sizeof(*gEasyChatScreen)); - if (gEasyChatScreen == NULL) - { + sEasyChatScreen = malloc(sizeof(*sEasyChatScreen)); + if (sEasyChatScreen == NULL) return FALSE; - } - gEasyChatScreen->kind = kind; - gEasyChatScreen->words = words; - gEasyChatScreen->mainCursorColumn = 0; - gEasyChatScreen->mainCursorRow = 0; - gEasyChatScreen->unk_09 = 0; - gEasyChatScreen->sizeParam = sizeParam; - gEasyChatScreen->unk_13 = 0; - templateId = sub_811BCC8(kind); - if (kind == 0x10) + + sEasyChatScreen->type = type; + sEasyChatScreen->words = words; + sEasyChatScreen->mainCursorColumn = 0; + sEasyChatScreen->mainCursorRow = 0; + sEasyChatScreen->unk_09 = 0; + sEasyChatScreen->displayedPersonType = displayedPersonType; + sEasyChatScreen->unk_13 = 0; + templateId = GetEachChatScreenTemplateId(type); + if (type == EASY_CHAT_TYPE_QUIZ_QUESTION) { - sub_811BDF0(gEasyChatScreen->unk_14); - gEasyChatScreen->titleText = gEasyChatScreen->unk_14; - gEasyChatScreen->state = 7; + sub_811BDF0(sEasyChatScreen->unk_14); + sEasyChatScreen->titleText = sEasyChatScreen->unk_14; + sEasyChatScreen->state = 7; } else { - gEasyChatScreen->state = 0; - gEasyChatScreen->titleText = gEasyChatScreenTemplates[templateId].titleText; - } - gEasyChatScreen->numColumns = gEasyChatScreenTemplates[templateId].numColumns; - gEasyChatScreen->numRows = gEasyChatScreenTemplates[templateId].numRows; - gEasyChatScreen->unk_07 = gEasyChatScreen->numColumns * gEasyChatScreen->numRows; - gEasyChatScreen->templateId = templateId; - if (gEasyChatScreen->unk_07 > 9) - { - gEasyChatScreen->unk_07 = 9; + sEasyChatScreen->state = 0; + sEasyChatScreen->titleText = sEasyChatScreenTemplates[templateId].titleText; } + + sEasyChatScreen->numColumns = sEasyChatScreenTemplates[templateId].numColumns; + sEasyChatScreen->numRows = sEasyChatScreenTemplates[templateId].numRows; + sEasyChatScreen->unk_07 = sEasyChatScreen->numColumns * sEasyChatScreen->numRows; + sEasyChatScreen->templateId = templateId; + if (sEasyChatScreen->unk_07 > 9) + sEasyChatScreen->unk_07 = 9; + if (words != NULL) { - CpuCopy16(words, gEasyChatScreen->ecWordBuffer, gEasyChatScreen->unk_07 * sizeof(u16)); + CpuCopy16(words, sEasyChatScreen->ecWordBuffer, sEasyChatScreen->unk_07 * sizeof(u16)); } else { - for (i = 0; i < gEasyChatScreen->unk_07; i ++) - { - gEasyChatScreen->ecWordBuffer[i] = -1; - } - gEasyChatScreen->words = gEasyChatScreen->ecWordBuffer; + for (i = 0; i < sEasyChatScreen->unk_07; i ++) + sEasyChatScreen->ecWordBuffer[i] = -1; + + sEasyChatScreen->words = sEasyChatScreen->ecWordBuffer; } - gEasyChatScreen->unk_0d = (sub_811F3AC() - 1) / 2 + 1; + + sEasyChatScreen->unk_0d = (sub_811F3AC() - 1) / 2 + 1; return TRUE; } static void EasyChat_FreeResources(void) { - if (gEasyChatScreen != NULL) - FREE_AND_SET_NULL(gEasyChatScreen); + if (sEasyChatScreen != NULL) + FREE_AND_SET_NULL(sEasyChatScreen); } static u16 sub_811AAAC(void) { - switch (gEasyChatScreen->state) + switch (sEasyChatScreen->state) { case 0: return sub_811AB68(); @@ -1500,7 +1505,7 @@ static u16 sub_811AAAC(void) bool32 sub_811AB44(void) { - switch (sub_811BA68()) + switch (GetEasyChatScreenFrameId()) { case 2: case 7: @@ -1517,10 +1522,10 @@ static u16 sub_811AB68(void) if (gMain.newKeys & A_BUTTON) { sub_811BF78(); - gEasyChatScreen->state = 2; - gEasyChatScreen->unk_0a = 0; - gEasyChatScreen->unk_0b = 0; - gEasyChatScreen->unk_0c = 0; + sEasyChatScreen->state = 2; + sEasyChatScreen->unk_0a = 0; + sEasyChatScreen->unk_0b = 0; + sEasyChatScreen->unk_0c = 0; return 9; } else if (gMain.newKeys & B_BUTTON) @@ -1533,51 +1538,51 @@ static u16 sub_811AB68(void) } else if (gMain.newKeys & DPAD_UP) { - gEasyChatScreen->mainCursorRow--; + sEasyChatScreen->mainCursorRow--; break; } else if (gMain.newKeys & DPAD_LEFT) { - gEasyChatScreen->mainCursorColumn--; + sEasyChatScreen->mainCursorColumn--; break; } else if (gMain.newKeys & DPAD_DOWN) { - gEasyChatScreen->mainCursorRow++; + sEasyChatScreen->mainCursorRow++; break; } else if (gMain.newKeys & DPAD_RIGHT) { - gEasyChatScreen->mainCursorColumn++; + sEasyChatScreen->mainCursorColumn++; break; } return 0; } while (0); - if (gEasyChatScreen->mainCursorRow < 0) - gEasyChatScreen->mainCursorRow = gEasyChatScreenTemplates[gEasyChatScreen->templateId].numRows; + if (sEasyChatScreen->mainCursorRow < 0) + sEasyChatScreen->mainCursorRow = sEasyChatScreenTemplates[sEasyChatScreen->templateId].numRows; - if (gEasyChatScreen->mainCursorRow > gEasyChatScreenTemplates[gEasyChatScreen->templateId].numRows) - gEasyChatScreen->mainCursorRow = 0; + if (sEasyChatScreen->mainCursorRow > sEasyChatScreenTemplates[sEasyChatScreen->templateId].numRows) + sEasyChatScreen->mainCursorRow = 0; - if (gEasyChatScreen->mainCursorRow == gEasyChatScreenTemplates[gEasyChatScreen->templateId].numRows) + if (sEasyChatScreen->mainCursorRow == sEasyChatScreenTemplates[sEasyChatScreen->templateId].numRows) { - if (gEasyChatScreen->mainCursorColumn > 2) - gEasyChatScreen->mainCursorColumn = 2; + if (sEasyChatScreen->mainCursorColumn > 2) + sEasyChatScreen->mainCursorColumn = 2; - gEasyChatScreen->state = 1; + sEasyChatScreen->state = 1; return 3; } - if (gEasyChatScreen->mainCursorColumn < 0) - gEasyChatScreen->mainCursorColumn = gEasyChatScreenTemplates[gEasyChatScreen->templateId].numColumns - 1; + if (sEasyChatScreen->mainCursorColumn < 0) + sEasyChatScreen->mainCursorColumn = sEasyChatScreenTemplates[sEasyChatScreen->templateId].numColumns - 1; - if (gEasyChatScreen->mainCursorColumn >= gEasyChatScreenTemplates[gEasyChatScreen->templateId].numColumns) - gEasyChatScreen->mainCursorColumn = 0; + if (sEasyChatScreen->mainCursorColumn >= sEasyChatScreenTemplates[sEasyChatScreen->templateId].numColumns) + sEasyChatScreen->mainCursorColumn = 0; - if (sub_811AB44() && gEasyChatScreen->mainCursorColumn == 1 && gEasyChatScreen->mainCursorRow == 4) - gEasyChatScreen->mainCursorColumn = 0; + if (sub_811AB44() && sEasyChatScreen->mainCursorColumn == 1 && sEasyChatScreen->mainCursorRow == 4) + sEasyChatScreen->mainCursorColumn = 0; return 2; } @@ -1588,7 +1593,7 @@ static u16 sub_811ACDC(void) { if (gMain.newKeys & A_BUTTON) { - switch (gEasyChatScreen->mainCursorColumn) + switch (sEasyChatScreen->mainCursorColumn) { case 0: return sub_811B184(); @@ -1611,47 +1616,47 @@ static u16 sub_811ACDC(void) } else if (gMain.newKeys & DPAD_UP) { - gEasyChatScreen->mainCursorRow--; + sEasyChatScreen->mainCursorRow--; break; } else if (gMain.newKeys & DPAD_LEFT) { - gEasyChatScreen->mainCursorColumn--; + sEasyChatScreen->mainCursorColumn--; break; } else if (gMain.newKeys & DPAD_DOWN) { - gEasyChatScreen->mainCursorRow = 0; + sEasyChatScreen->mainCursorRow = 0; break; } else if (gMain.newKeys & DPAD_RIGHT) { - gEasyChatScreen->mainCursorColumn++; + sEasyChatScreen->mainCursorColumn++; break; } return 0; } while (0); - if (gEasyChatScreen->mainCursorRow == gEasyChatScreenTemplates[gEasyChatScreen->templateId].numRows) + if (sEasyChatScreen->mainCursorRow == sEasyChatScreenTemplates[sEasyChatScreen->templateId].numRows) { - int numFooterColumns = sub_811BA3C() ? 4 : 3; - if (gEasyChatScreen->mainCursorColumn < 0) - gEasyChatScreen->mainCursorColumn = numFooterColumns - 1; + int numFooterColumns = FooterHasFourOptions() ? 4 : 3; + if (sEasyChatScreen->mainCursorColumn < 0) + sEasyChatScreen->mainCursorColumn = numFooterColumns - 1; - if (gEasyChatScreen->mainCursorColumn >= numFooterColumns) - gEasyChatScreen->mainCursorColumn = 0; + if (sEasyChatScreen->mainCursorColumn >= numFooterColumns) + sEasyChatScreen->mainCursorColumn = 0; return 3; } - if (gEasyChatScreen->mainCursorColumn >= gEasyChatScreenTemplates[gEasyChatScreen->templateId].numColumns) - gEasyChatScreen->mainCursorColumn = gEasyChatScreenTemplates[gEasyChatScreen->templateId].numColumns - 1; + if (sEasyChatScreen->mainCursorColumn >= sEasyChatScreenTemplates[sEasyChatScreen->templateId].numColumns) + sEasyChatScreen->mainCursorColumn = sEasyChatScreenTemplates[sEasyChatScreen->templateId].numColumns - 1; - if (sub_811AB44() && gEasyChatScreen->mainCursorColumn == 1 && gEasyChatScreen->mainCursorRow == 4) - gEasyChatScreen->mainCursorColumn = 0; + if (sub_811AB44() && sEasyChatScreen->mainCursorColumn == 1 && sEasyChatScreen->mainCursorRow == 4) + sEasyChatScreen->mainCursorColumn = 0; - gEasyChatScreen->state = 0; + sEasyChatScreen->state = 0; return 2; } @@ -1662,10 +1667,10 @@ static u16 sub_811AE44(void) if (gMain.newKeys & A_BUTTON) { - if (gEasyChatScreen->unk_0a != -1) + if (sEasyChatScreen->unk_0a != -1) return sub_811B2B0(); - switch (gEasyChatScreen->unk_0b) + switch (sEasyChatScreen->unk_0b) { case 0: return sub_811B33C(); @@ -1698,7 +1703,7 @@ static u16 sub_811AF00(void) { if (gMain.newKeys & B_BUTTON) { - gEasyChatScreen->state = 2; + sEasyChatScreen->state = 2; return 14; } @@ -1734,11 +1739,11 @@ static u16 sub_811AF8C(void) { case MENU_B_PRESSED: // B Button case 1: // No - gEasyChatScreen->state = sub_811B2A4(); + sEasyChatScreen->state = sub_811B2A4(); return 7; case 0: // Yes gSpecialVar_Result = 0; - var0 = gEasyChatScreen->kind - 17; + var0 = sEasyChatScreen->type - EASY_CHAT_TYPE_QUIZ_SET_QUESTION; if (var0 < 2) sub_811B3E4(); @@ -1754,7 +1759,7 @@ static u16 sub_811AFEC(void) { case MENU_B_PRESSED: // B Button case 1: // No - gEasyChatScreen->state = sub_811B2A4(); + sEasyChatScreen->state = sub_811B2A4(); return 7; case 0: // Yes sub_811BE9C(); @@ -1772,11 +1777,11 @@ static u16 sub_811B040(void) { case MENU_B_PRESSED: // B Button case 1: // No - gEasyChatScreen->state = 1; + sEasyChatScreen->state = 1; return 7; case 0: // Yes sub_811B418(); - gEasyChatScreen->state = 1; + sEasyChatScreen->state = 1; return 8; default: return 0; @@ -1798,7 +1803,7 @@ static u16 sub_811B0BC(void) { if (gMain.newKeys & (A_BUTTON | B_BUTTON)) { - gEasyChatScreen->state = sub_811B2A4(); + sEasyChatScreen->state = sub_811B2A4(); return 7; } @@ -1807,7 +1812,7 @@ static u16 sub_811B0BC(void) static u16 sub_811B0E8(void) { - gEasyChatScreen->state = 10; + sEasyChatScreen->state = 10; return 6; } @@ -1818,8 +1823,8 @@ static u16 sub_811B0F8(void) case MENU_B_PRESSED: // B Button case 1: // No sub_811B454(); - gEasyChatScreen->unk_08 = 0; - gEasyChatScreen->state = 8; + sEasyChatScreen->stateBackup = 0; + sEasyChatScreen->state = 8; return 31; case 0: // Yes gSpecialVar_Result = sub_811B4EC(); @@ -1832,124 +1837,127 @@ static u16 sub_811B0F8(void) static u16 sub_811B150(void) { - if (gEasyChatScreen->kind == 19 || gEasyChatScreen->kind == 11) + if (sEasyChatScreen->type == EASY_CHAT_TYPE_APPRENTICE + || sEasyChatScreen->type == EASY_CHAT_TYPE_CONTEST_INTERVIEW) { - gEasyChatScreen->unk_08 = gEasyChatScreen->state; - gEasyChatScreen->state = 8; + sEasyChatScreen->stateBackup = sEasyChatScreen->state; + sEasyChatScreen->state = 8; return 34; } else { - gEasyChatScreen->unk_08 = gEasyChatScreen->state; - gEasyChatScreen->state = 4; + sEasyChatScreen->stateBackup = sEasyChatScreen->state; + sEasyChatScreen->state = 4; return 5; } } static int sub_811B184(void) { - gEasyChatScreen->unk_08 = gEasyChatScreen->state; - if (gEasyChatScreen->kind != 6) + sEasyChatScreen->stateBackup = sEasyChatScreen->state; + if (sEasyChatScreen->type != EASY_CHAT_TYPE_BARD_SONG) { - gEasyChatScreen->state = 5; + sEasyChatScreen->state = 5; return 4; } else { - gEasyChatScreen->unk_08 = gEasyChatScreen->state; - gEasyChatScreen->state = 8; + sEasyChatScreen->stateBackup = sEasyChatScreen->state; + sEasyChatScreen->state = 8; return 32; } } static u16 sub_811B1B4(void) { - gEasyChatScreen->unk_08 = gEasyChatScreen->state; - if (gEasyChatScreen->kind == 17) + sEasyChatScreen->stateBackup = sEasyChatScreen->state; + if (sEasyChatScreen->type == EASY_CHAT_TYPE_QUIZ_SET_QUESTION) { if (sub_811BD64()) { - gEasyChatScreen->state = 8; + sEasyChatScreen->state = 8; return 29; } if (sub_811BDB0()) { - gEasyChatScreen->state = 8; + sEasyChatScreen->state = 8; return 30; } - gEasyChatScreen->state = 6; + sEasyChatScreen->state = 6; return 6; } - else if (gEasyChatScreen->kind == 18) + else if (sEasyChatScreen->type == EASY_CHAT_TYPE_QUIZ_SET_ANSWER) { if (sub_811BDB0()) { - gEasyChatScreen->state = 8; + sEasyChatScreen->state = 8; return 30; } if (sub_811BD64()) { - gEasyChatScreen->state = 8; + sEasyChatScreen->state = 8; return 29; } - gEasyChatScreen->state = 6; + sEasyChatScreen->state = 6; return 6; } - else if (gEasyChatScreen->kind == 9 || gEasyChatScreen->kind == 13) + else if (sEasyChatScreen->type == EASY_CHAT_TYPE_TRENDY_PHRASE + || sEasyChatScreen->type == EASY_CHAT_TYPE_GOOD_SAYING) { if (!sub_811BD2C()) { - gEasyChatScreen->state = 8; + sEasyChatScreen->state = 8; return 33; } - gEasyChatScreen->state = 6; + sEasyChatScreen->state = 6; return 6; } - else if (gEasyChatScreen->kind == 19 || gEasyChatScreen->kind == 11) + else if (sEasyChatScreen->type == EASY_CHAT_TYPE_APPRENTICE + || sEasyChatScreen->type == EASY_CHAT_TYPE_CONTEST_INTERVIEW) { if (sub_811BCF4()) { - gEasyChatScreen->state = 8; + sEasyChatScreen->state = 8; return 34; } - gEasyChatScreen->state = 6; + sEasyChatScreen->state = 6; return 6; } - else if (gEasyChatScreen->kind == 20) + else if (sEasyChatScreen->type == EASY_CHAT_TYPE_QUESTIONNAIRE) { - gEasyChatScreen->state = 6; + sEasyChatScreen->state = 6; return 6; } else { if (sub_811BCF4() == 1 || !sub_811B4EC()) { - gEasyChatScreen->state = 4; + sEasyChatScreen->state = 4; return 5; } - gEasyChatScreen->state = 6; + sEasyChatScreen->state = 6; return 6; } } static int sub_811B264(void) { - gEasyChatScreen->unk_08 = gEasyChatScreen->state; - switch (gEasyChatScreen->kind) + sEasyChatScreen->stateBackup = sEasyChatScreen->state; + switch (sEasyChatScreen->type) { - case 15: + case EASY_CHAT_TYPE_QUIZ_ANSWER: return 25; - case 17: + case EASY_CHAT_TYPE_QUIZ_SET_QUESTION: sub_811B3E4(); return 28; - case 18: + case EASY_CHAT_TYPE_QUIZ_SET_ANSWER: sub_811B3E4(); return 27; default: @@ -1959,14 +1967,14 @@ static int sub_811B264(void) static u8 sub_811B2A4(void) { - return gEasyChatScreen->unk_08; + return sEasyChatScreen->stateBackup; } static int sub_811B2B0(void) { u16 var1; - if (gEasyChatScreen->unk_09 == 0) + if (sEasyChatScreen->unk_09 == 0) { u8 groupId = sub_811F3B8(sub_811B8E8()); sub_811F548(0, groupId); @@ -1980,36 +1988,36 @@ static int sub_811B2B0(void) if (var1 == 0) return 0; - gEasyChatScreen->unk_0f = (var1 - 1) / 2; - gEasyChatScreen->unk_0e = 0; - gEasyChatScreen->unk_10 = 0; - gEasyChatScreen->unk_11 = 0; - gEasyChatScreen->state = 3; + sEasyChatScreen->unk_0f = (var1 - 1) / 2; + sEasyChatScreen->unk_0e = 0; + sEasyChatScreen->unk_10 = 0; + sEasyChatScreen->unk_11 = 0; + sEasyChatScreen->state = 3; return 11; } static int sub_811B32C(void) { - gEasyChatScreen->state = 0; + sEasyChatScreen->state = 0; return 10; } static int sub_811B33C(void) { - gEasyChatScreen->unk_0a = 0; - gEasyChatScreen->unk_0b = 0; - gEasyChatScreen->unk_0c = 0; - if (!gEasyChatScreen->unk_09) - gEasyChatScreen->unk_09 = 1; + sEasyChatScreen->unk_0a = 0; + sEasyChatScreen->unk_0b = 0; + sEasyChatScreen->unk_0c = 0; + if (!sEasyChatScreen->unk_09) + sEasyChatScreen->unk_09 = 1; else - gEasyChatScreen->unk_09 = 0; + sEasyChatScreen->unk_09 = 0; return 23; } static int sub_811B368(void) { - if (gEasyChatScreen->kind == 6) + if (sEasyChatScreen->type == EASY_CHAT_TYPE_BARD_SONG) { PlaySE(SE_HAZURE); return 0; @@ -2032,14 +2040,14 @@ static int sub_811B394(void) else { sub_811B488(easyChatWord); - if (gEasyChatScreen->kind != 6) + if (sEasyChatScreen->type != EASY_CHAT_TYPE_BARD_SONG) { - gEasyChatScreen->state = 0; + sEasyChatScreen->state = 0; return 12; } else { - gEasyChatScreen->state = 9; + sEasyChatScreen->state = 9; return 13; } } @@ -2048,36 +2056,36 @@ static int sub_811B394(void) static void sub_811B3E4(void) { int i; - for (i = 0; i < gEasyChatScreen->unk_07; i++) - gEasyChatScreen->words[i] = gEasyChatScreen->ecWordBuffer[i]; + for (i = 0; i < sEasyChatScreen->unk_07; i++) + sEasyChatScreen->words[i] = sEasyChatScreen->ecWordBuffer[i]; } static void sub_811B418(void) { int i; - for (i = 0; i < gEasyChatScreen->unk_07; i++) - gEasyChatScreen->ecWordBuffer[i] = 0xFFFF; + for (i = 0; i < sEasyChatScreen->unk_07; i++) + sEasyChatScreen->ecWordBuffer[i] = 0xFFFF; } static void sub_811B454(void) { int i; - for (i = 0; i < gEasyChatScreen->unk_07; i++) - gEasyChatScreen->ecWordBuffer[i] = gEasyChatScreen->words[i]; + for (i = 0; i < sEasyChatScreen->unk_07; i++) + sEasyChatScreen->ecWordBuffer[i] = sEasyChatScreen->words[i]; } static void sub_811B488(u16 easyChatWord) { u16 index = sub_811B8C8(); - gEasyChatScreen->ecWordBuffer[index] = easyChatWord; + sEasyChatScreen->ecWordBuffer[index] = easyChatWord; } static u8 sub_811B4AC(void) { u16 i; - for (i = 0; i < gEasyChatScreen->unk_07; i++) + for (i = 0; i < sEasyChatScreen->unk_07; i++) { - if (gEasyChatScreen->ecWordBuffer[i] != gEasyChatScreen->words[i]) + if (sEasyChatScreen->ecWordBuffer[i] != sEasyChatScreen->words[i]) return 1; } @@ -2086,7 +2094,7 @@ static u8 sub_811B4AC(void) static int sub_811B4EC(void) { - u8 var0 = gEasyChatScreen->kind - 17; + u8 var0 = sEasyChatScreen->type - EASY_CHAT_TYPE_QUIZ_SET_QUESTION; if (var0 < 2) { if (sub_811BD64()) @@ -2105,9 +2113,9 @@ static int sub_811B4EC(void) static u16 sub_811B528(int arg0) { - if (gEasyChatScreen->unk_0a != -1) + if (sEasyChatScreen->unk_0a != -1) { - if (gEasyChatScreen->unk_09 == 0) + if (sEasyChatScreen->unk_09 == 0) return sub_811B568(arg0); else return sub_811B634(arg0); @@ -2123,32 +2131,32 @@ static int sub_811B568(u32 arg0) switch (arg0) { case 2: - if (gEasyChatScreen->unk_0b != -gEasyChatScreen->unk_0c) + if (sEasyChatScreen->unk_0b != -sEasyChatScreen->unk_0c) { - if (gEasyChatScreen->unk_0b) + if (sEasyChatScreen->unk_0b) { - gEasyChatScreen->unk_0b--; + sEasyChatScreen->unk_0b--; return 15; } else { - gEasyChatScreen->unk_0c--; + sEasyChatScreen->unk_0c--; return 17; } } break; case 3: - if (gEasyChatScreen->unk_0b + gEasyChatScreen->unk_0c < gEasyChatScreen->unk_0d - 1) + if (sEasyChatScreen->unk_0b + sEasyChatScreen->unk_0c < sEasyChatScreen->unk_0d - 1) { int var0; - if (gEasyChatScreen->unk_0b < 3) + if (sEasyChatScreen->unk_0b < 3) { - gEasyChatScreen->unk_0b++; + sEasyChatScreen->unk_0b++; var0 = 15; } else { - gEasyChatScreen->unk_0c++; + sEasyChatScreen->unk_0c++; var0 = 16; } @@ -2157,16 +2165,16 @@ static int sub_811B568(u32 arg0) } break; case 1: - if (gEasyChatScreen->unk_0a) - gEasyChatScreen->unk_0a--; + if (sEasyChatScreen->unk_0a) + sEasyChatScreen->unk_0a--; else sub_811B744(); return 15; case 0: - if (gEasyChatScreen->unk_0a < 1) + if (sEasyChatScreen->unk_0a < 1) { - gEasyChatScreen->unk_0a++; + sEasyChatScreen->unk_0a++; if (sub_811B9C8()) sub_811B744(); } @@ -2185,30 +2193,30 @@ static int sub_811B634(u32 arg0) switch (arg0) { case 2: - if (gEasyChatScreen->unk_0b > 0) - gEasyChatScreen->unk_0b--; + if (sEasyChatScreen->unk_0b > 0) + sEasyChatScreen->unk_0b--; else - gEasyChatScreen->unk_0b = 3; + sEasyChatScreen->unk_0b = 3; sub_811B978(); return 15; case 3: - if (gEasyChatScreen->unk_0b < 3) - gEasyChatScreen->unk_0b++; + if (sEasyChatScreen->unk_0b < 3) + sEasyChatScreen->unk_0b++; else - gEasyChatScreen->unk_0b = 0; + sEasyChatScreen->unk_0b = 0; sub_811B978(); return 15; case 0: - gEasyChatScreen->unk_0a++; + sEasyChatScreen->unk_0a++; if (sub_811B9C8()) sub_811B744(); return 15; case 1: - gEasyChatScreen->unk_0a--; - if (gEasyChatScreen->unk_0a < 0) + sEasyChatScreen->unk_0a--; + if (sEasyChatScreen->unk_0a < 0) sub_811B744(); return 15; @@ -2222,26 +2230,26 @@ static int sub_811B6C4(u32 arg0) switch (arg0) { case 2: - if (gEasyChatScreen->unk_0b) - gEasyChatScreen->unk_0b--; + if (sEasyChatScreen->unk_0b) + sEasyChatScreen->unk_0b--; else - gEasyChatScreen->unk_0b = 2; + sEasyChatScreen->unk_0b = 2; return 15; case 3: - if (gEasyChatScreen->unk_0b < 2) - gEasyChatScreen->unk_0b++; + if (sEasyChatScreen->unk_0b < 2) + sEasyChatScreen->unk_0b++; else - gEasyChatScreen->unk_0b = 0; + sEasyChatScreen->unk_0b = 0; return 15; case 1: - gEasyChatScreen->unk_0b++; + sEasyChatScreen->unk_0b++; sub_811B768(); return 15; case 0: - gEasyChatScreen->unk_0a = 0; - gEasyChatScreen->unk_0b++; + sEasyChatScreen->unk_0a = 0; + sEasyChatScreen->unk_0b++; return 15; } @@ -2250,21 +2258,21 @@ static int sub_811B6C4(u32 arg0) static void sub_811B744(void) { - gEasyChatScreen->unk_0a = 0xFF; - if (gEasyChatScreen->unk_0b) - gEasyChatScreen->unk_0b--; + sEasyChatScreen->unk_0a = 0xFF; + if (sEasyChatScreen->unk_0b) + sEasyChatScreen->unk_0b--; } static void sub_811B768(void) { - if (gEasyChatScreen->unk_09 == 0) + if (sEasyChatScreen->unk_09 == 0) { - gEasyChatScreen->unk_0a = 1; + sEasyChatScreen->unk_0a = 1; sub_811B978(); } else { - gEasyChatScreen->unk_0a = sub_811B960(gEasyChatScreen->unk_0b); + sEasyChatScreen->unk_0a = sub_811B960(sEasyChatScreen->unk_0b); } } @@ -2274,16 +2282,16 @@ static u16 sub_811B794(u32 arg0) switch (arg0) { case 2: - if (gEasyChatScreen->unk_11 + gEasyChatScreen->unk_0e > 0) + if (sEasyChatScreen->unk_11 + sEasyChatScreen->unk_0e > 0) { - if (gEasyChatScreen->unk_11 > 0) + if (sEasyChatScreen->unk_11 > 0) { - gEasyChatScreen->unk_11--; + sEasyChatScreen->unk_11--; result = 18; } else { - gEasyChatScreen->unk_0e--; + sEasyChatScreen->unk_0e--; result = 19; } @@ -2292,16 +2300,16 @@ static u16 sub_811B794(u32 arg0) } break; case 3: - if (gEasyChatScreen->unk_11 + gEasyChatScreen->unk_0e < gEasyChatScreen->unk_0f) + if (sEasyChatScreen->unk_11 + sEasyChatScreen->unk_0e < sEasyChatScreen->unk_0f) { - if (gEasyChatScreen->unk_11 < 3) + if (sEasyChatScreen->unk_11 < 3) { - gEasyChatScreen->unk_11++; + sEasyChatScreen->unk_11++; result = 18; } else { - gEasyChatScreen->unk_0e++; + sEasyChatScreen->unk_0e++; result = 20; } @@ -2310,42 +2318,42 @@ static u16 sub_811B794(u32 arg0) } break; case 1: - if (gEasyChatScreen->unk_10 > 0) - gEasyChatScreen->unk_10--; + if (sEasyChatScreen->unk_10 > 0) + sEasyChatScreen->unk_10--; else - gEasyChatScreen->unk_10 = 1; + sEasyChatScreen->unk_10 = 1; sub_811B9A0(); return 18; case 0: - if (gEasyChatScreen->unk_10 < 1) + if (sEasyChatScreen->unk_10 < 1) { - gEasyChatScreen->unk_10++; + sEasyChatScreen->unk_10++; if (sub_811BA1C()) - gEasyChatScreen->unk_10 = 0; + sEasyChatScreen->unk_10 = 0; } else { - gEasyChatScreen->unk_10 = 0; + sEasyChatScreen->unk_10 = 0; } return 18; case 4: - if (gEasyChatScreen->unk_0e) + if (sEasyChatScreen->unk_0e) { - if (gEasyChatScreen->unk_0e > 3) - gEasyChatScreen->unk_0e -= 4; + if (sEasyChatScreen->unk_0e > 3) + sEasyChatScreen->unk_0e -= 4; else - gEasyChatScreen->unk_0e = 0; + sEasyChatScreen->unk_0e = 0; return 21; } break; case 5: - if (gEasyChatScreen->unk_0e <= gEasyChatScreen->unk_0f - 4) + if (sEasyChatScreen->unk_0e <= sEasyChatScreen->unk_0f - 4) { - gEasyChatScreen->unk_0e += 4; - if (gEasyChatScreen->unk_0e > gEasyChatScreen->unk_0f - 3) - gEasyChatScreen->unk_0e = gEasyChatScreen->unk_0f + 0xFD; + sEasyChatScreen->unk_0e += 4; + if (sEasyChatScreen->unk_0e > sEasyChatScreen->unk_0f - 3) + sEasyChatScreen->unk_0e = sEasyChatScreen->unk_0f + 0xFD; sub_811B9A0(); return 22; @@ -2358,24 +2366,24 @@ static u16 sub_811B794(u32 arg0) static u16 sub_811B8C8(void) { - return (gEasyChatScreen->mainCursorRow * gEasyChatScreen->numColumns) + gEasyChatScreen->mainCursorColumn; + return (sEasyChatScreen->mainCursorRow * sEasyChatScreen->numColumns) + sEasyChatScreen->mainCursorColumn; } static u16 sub_811B8E8(void) { - return 2 * (gEasyChatScreen->unk_0b + gEasyChatScreen->unk_0c) + gEasyChatScreen->unk_0a; + return 2 * (sEasyChatScreen->unk_0b + sEasyChatScreen->unk_0c) + sEasyChatScreen->unk_0a; } static int sub_811B908(void) { - int var0 = (u8)gEasyChatScreen->unk_0a < 7 ? gEasyChatScreen->unk_0a : 0; - int var1 = (u8)gEasyChatScreen->unk_0b < 4 ? gEasyChatScreen->unk_0b : 0; + 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]; } static u16 sub_811B940(void) { - return 2 * (gEasyChatScreen->unk_11 + gEasyChatScreen->unk_0e) + gEasyChatScreen->unk_10; + return 2 * (sEasyChatScreen->unk_11 + sEasyChatScreen->unk_0e) + sEasyChatScreen->unk_10; } static u8 sub_811B960(u8 arg0) @@ -2394,8 +2402,8 @@ static void sub_811B978(void) { while (sub_811B9C8()) { - if (gEasyChatScreen->unk_0a) - gEasyChatScreen->unk_0a--; + if (sEasyChatScreen->unk_0a) + sEasyChatScreen->unk_0a--; else break; } @@ -2405,8 +2413,8 @@ static void sub_811B9A0(void) { while (sub_811BA1C()) { - if (gEasyChatScreen->unk_10) - gEasyChatScreen->unk_10--; + if (sEasyChatScreen->unk_10) + sEasyChatScreen->unk_10--; else break; } @@ -2414,10 +2422,10 @@ static void sub_811B9A0(void) static u8 sub_811B9C8(void) { - if (gEasyChatScreen->unk_09 == 0) + if (sEasyChatScreen->unk_09 == 0) return sub_811B8E8() >= sub_811F3AC() ? 1 : 0; else - return gEasyChatScreen->unk_0a > sub_811B960(gEasyChatScreen->unk_0b) ? 1 : 0; + return sEasyChatScreen->unk_0a > sub_811B960(sEasyChatScreen->unk_0b) ? 1 : 0; } static u8 sub_811BA1C(void) @@ -2425,73 +2433,73 @@ static u8 sub_811BA1C(void) return sub_811B940() >= sub_811F5B0() ? 1 : 0; } -static int sub_811BA3C(void) +static int FooterHasFourOptions(void) { - return gEasyChatScreenTemplates[gEasyChatScreen->templateId].unk_03_7; + return sEasyChatScreenTemplates[sEasyChatScreen->templateId].fourFooterOptions; } -u8 sub_811BA5C(void) +static u8 GetEasyChatScreenType(void) { - return gEasyChatScreen->kind; + return sEasyChatScreen->type; } -static u8 sub_811BA68(void) +static u8 GetEasyChatScreenFrameId(void) { - return gEasyChatScreenTemplates[gEasyChatScreen->templateId].unk_03_0; + return sEasyChatScreenTemplates[sEasyChatScreen->templateId].frameId; } -const u8 *sub_811BA88(void) +const u8 *GetTitleText(void) { - return gEasyChatScreen->titleText; + return sEasyChatScreen->titleText; } -u16 *sub_811BA94(void) +static u16 *GetEasyChatWordBuffer(void) { - return gEasyChatScreen->ecWordBuffer; + return sEasyChatScreen->ecWordBuffer; } -u8 sub_811BAA0(void) +static u8 GetNumRows(void) { - return gEasyChatScreen->numRows; + return sEasyChatScreen->numRows; } -u8 sub_811BAAC(void) +static u8 GetNumColumns(void) { - return gEasyChatScreen->numColumns; + return sEasyChatScreen->numColumns; } -u8 sub_811BAB8(void) +static u8 GetMainCursorColumn(void) { - return gEasyChatScreen->mainCursorColumn; + return sEasyChatScreen->mainCursorColumn; } -u8 sub_811BAC4(void) +static u8 GetMainCursorRow(void) { - return gEasyChatScreen->mainCursorRow; + return sEasyChatScreen->mainCursorRow; } static void GetEasyChatInstructionsText(const u8 **str1, const u8 **str2) { - *str1 = gEasyChatScreenTemplates[gEasyChatScreen->templateId].instructionsText1; - *str2 = gEasyChatScreenTemplates[gEasyChatScreen->templateId].instructionsText2; + *str1 = sEasyChatScreenTemplates[sEasyChatScreen->templateId].instructionsText1; + *str2 = sEasyChatScreenTemplates[sEasyChatScreen->templateId].instructionsText2; } static void GetEasyChatConfirmText(const u8 **str1, const u8 **str2) { - *str1 = gEasyChatScreenTemplates[gEasyChatScreen->templateId].confirmText1; - *str2 = gEasyChatScreenTemplates[gEasyChatScreen->templateId].confirmText2; + *str1 = sEasyChatScreenTemplates[sEasyChatScreen->templateId].confirmText1; + *str2 = sEasyChatScreenTemplates[sEasyChatScreen->templateId].confirmText2; } static void sub_811BB40(const u8 **str1, const u8 **str2) { - switch (gEasyChatScreen->kind) + switch (sEasyChatScreen->type) { - case 4: + case EASY_CHAT_TYPE_MAIL: *str1 = gText_StopGivingPkmnMail; *str2 = NULL; break; - case 15: - case 16: + case EASY_CHAT_TYPE_QUIZ_ANSWER: + case EASY_CHAT_TYPE_QUIZ_QUESTION: *str1 = gText_LikeToQuitQuiz; *str2 = gText_ChallengeQuestionMark; break; @@ -2511,34 +2519,34 @@ static void GetEasyChatConfirmDeletionText(const u8 **str1, const u8 **str2) void sub_811BB9C(u8 *arg0, u8 *arg1) { - *arg0 = gEasyChatScreen->unk_0a; - *arg1 = gEasyChatScreen->unk_0b; + *arg0 = sEasyChatScreen->unk_0a; + *arg1 = sEasyChatScreen->unk_0b; } u8 sub_811BBB0(void) { - return gEasyChatScreen->unk_09; + return sEasyChatScreen->unk_09; } u8 sub_811BBBC(void) { - return gEasyChatScreen->unk_0c; + return sEasyChatScreen->unk_0c; } void sub_811BBC8(u8 *arg0, u8 *arg1) { - *arg0 = gEasyChatScreen->unk_10; - *arg1 = gEasyChatScreen->unk_11; + *arg0 = sEasyChatScreen->unk_10; + *arg1 = sEasyChatScreen->unk_11; } u8 sub_811BBDC(void) { - return gEasyChatScreen->unk_0e; + return sEasyChatScreen->unk_0e; } u8 sub_811BBE8(void) { - return gEasyChatScreen->unk_0f; + return sEasyChatScreen->unk_0f; } static u8 unref_sub_811BBF4(void) @@ -2548,14 +2556,14 @@ static u8 unref_sub_811BBF4(void) int sub_811BBF8(void) { - switch (gEasyChatScreen->state) + switch (sEasyChatScreen->state) { case 2: - if (gEasyChatScreen->unk_09 == 0 && gEasyChatScreen->unk_0c) + if (sEasyChatScreen->unk_09 == 0 && sEasyChatScreen->unk_0c) return 1; break; case 3: - if (gEasyChatScreen->unk_0e) + if (sEasyChatScreen->unk_0e) return 1; break; } @@ -2565,14 +2573,14 @@ int sub_811BBF8(void) int sub_811BC2C(void) { - switch (gEasyChatScreen->state) + switch (sEasyChatScreen->state) { case 2: - if (gEasyChatScreen->unk_09 == 0 && gEasyChatScreen->unk_0c + 4 <= gEasyChatScreen->unk_0d - 1) + if (sEasyChatScreen->unk_09 == 0 && sEasyChatScreen->unk_0c + 4 <= sEasyChatScreen->unk_0d - 1) return 1; break; case 3: - if (gEasyChatScreen->unk_0e + 4 <= gEasyChatScreen->unk_0f) + if (sEasyChatScreen->unk_0e + 4 <= sEasyChatScreen->unk_0f) return 1; break; } @@ -2580,9 +2588,9 @@ int sub_811BC2C(void) return 0; } -static int sub_811BC70(void) +static int FooterHasFourOptions_(void) { - return sub_811BA3C(); + return FooterHasFourOptions(); } u8 sub_811BC7C(const u16 *arg0, u8 arg1) @@ -2591,25 +2599,25 @@ u8 sub_811BC7C(const u16 *arg0, u8 arg1) for (i = 0; i < arg1; i++) { - if (arg0[i] != gEasyChatScreen->ecWordBuffer[i]) + if (arg0[i] != sEasyChatScreen->ecWordBuffer[i]) return 1; } return 0; } -u8 sub_811BCBC(void) +static u8 GetDisplayedPersonType(void) { - return gEasyChatScreen->sizeParam; + return sEasyChatScreen->displayedPersonType; } -static u8 sub_811BCC8(u8 entryType) +static u8 GetEachChatScreenTemplateId(u8 type) { u32 i; - for (i = 0; i < ARRAY_COUNT(gEasyChatScreenTemplates); i++) + for (i = 0; i < ARRAY_COUNT(sEasyChatScreenTemplates); i++) { - if (gEasyChatScreenTemplates[i].unk_00 == entryType) + if (sEasyChatScreenTemplates[i].type == type) return i; } @@ -2620,9 +2628,9 @@ static int sub_811BCF4(void) { int i; - for (i = 0; i < gEasyChatScreen->unk_07; i++) + for (i = 0; i < sEasyChatScreen->unk_07; i++) { - if (gEasyChatScreen->ecWordBuffer[i] != 0xFFFF) + if (sEasyChatScreen->ecWordBuffer[i] != 0xFFFF) return 0; } @@ -2633,9 +2641,9 @@ static int sub_811BD2C(void) { int i; - for (i = 0; i < gEasyChatScreen->unk_07; i++) + for (i = 0; i < sEasyChatScreen->unk_07; i++) { - if (gEasyChatScreen->ecWordBuffer[i] == 0xFFFF) + if (sEasyChatScreen->ecWordBuffer[i] == 0xFFFF) return 0; } @@ -2647,7 +2655,7 @@ static int sub_811BD64(void) int i; struct SaveBlock1 *saveBlock1; - if (gEasyChatScreen->kind == 17) + if (sEasyChatScreen->type == EASY_CHAT_TYPE_QUIZ_SET_QUESTION) return sub_811BCF4(); saveBlock1 = gSaveBlock1Ptr; @@ -2663,7 +2671,7 @@ static int sub_811BD64(void) static int sub_811BDB0(void) { struct LilycoveLadyQuiz *quiz; - if (gEasyChatScreen->kind == 18) + if (sEasyChatScreen->type == EASY_CHAT_TYPE_QUIZ_SET_ANSWER) return sub_811BCF4(); quiz = &gSaveBlock1Ptr->lilycoveLady.quiz; @@ -2694,10 +2702,10 @@ static void sub_811BE54(void) u16 *ecWord; u8 *str; - ecWord = gEasyChatScreen->ecWordBuffer; + ecWord = sEasyChatScreen->ecWordBuffer; str = gStringVar2; i = 0; - while (i < gEasyChatScreen->unk_07) + while (i < sEasyChatScreen->unk_07) { str = CopyEasyChatWordPadded(str, *ecWord, 0); *str = 0; @@ -2712,22 +2720,22 @@ static void sub_811BE54(void) static void sub_811BE9C(void) { - switch (gEasyChatScreen->kind) + switch (sEasyChatScreen->type) { - case 0: + case EASY_CHAT_TYPE_PROFILE: FlagSet(FLAG_SYS_CHAT_USED); break; - case 20: + case EASY_CHAT_TYPE_QUESTIONNAIRE: if (sub_811BF20()) gSpecialVar_0x8004 = 2; else gSpecialVar_0x8004 = 0; break; - case 9: + case EASY_CHAT_TYPE_TRENDY_PHRASE: sub_811BE54(); - gSpecialVar_0x8004 = sub_81226D8(gEasyChatScreen->ecWordBuffer); + gSpecialVar_0x8004 = sub_81226D8(sEasyChatScreen->ecWordBuffer); break; - case 13: + case EASY_CHAT_TYPE_GOOD_SAYING: gSpecialVar_0x8004 = sub_811BF40(); break; } @@ -2752,7 +2760,7 @@ static u16 sub_811BF40(void) static void sub_811BF78(void) { - gEasyChatScreen->unk_13 = 0; + sEasyChatScreen->unk_13 = 0; } static int sub_811BF88(int easyChatWord) @@ -2770,13 +2778,13 @@ static bool8 sub_811BF8C(void) static bool8 sub_811BFA4(void) { - switch (gUnknown_0203A11C->unk0) + switch (sUnknown_0203A11C->unk0) { case 0: ResetBgsAndClearDma3BusyFlags(0); InitBgsFromTemplates(0, sEasyChatBgTemplates, ARRAY_COUNT(sEasyChatBgTemplates)); - SetBgTilemapBuffer(3, gUnknown_0203A11C->unkB00); - SetBgTilemapBuffer(1, gUnknown_0203A11C->unk300); + SetBgTilemapBuffer(3, sUnknown_0203A11C->unkB00); + SetBgTilemapBuffer(1, sUnknown_0203A11C->unk300); InitWindows(sEasyChatWindowTemplates); DeactivateAllTextPrinters(); sub_811CF64(); @@ -2787,7 +2795,7 @@ static bool8 sub_811BFA4(void) DecompressAndLoadBgGfxUsingHeap(3, gEasyChatWindow_Gfx, 0, 0, 0); CopyToBgTilemapBuffer(3, gEasyChatWindow_Tilemap, 0, 0); sub_811D60C(); - sub_811D424(gUnknown_0203A11C->unk300); + sub_811D424(sUnknown_0203A11C->unk300); sub_811D230(); sub_811E948(); CopyBgTilemapBufferToVram(3); @@ -2804,7 +2812,7 @@ static bool8 sub_811BFA4(void) break; case 4: sub_811DE90(); - if (sub_811BA5C() != 16) + if (GetEasyChatScreenType() != EASY_CHAT_TYPE_QUIZ_QUESTION) sub_811DEC4(); break; case 5: @@ -2830,26 +2838,26 @@ static bool8 sub_811BFA4(void) return FALSE; } - gUnknown_0203A11C->unk0++; + sUnknown_0203A11C->unk0++; return TRUE; } static void sub_811C13C(void) { - if (gUnknown_0203A11C) - FREE_AND_SET_NULL(gUnknown_0203A11C); + if (sUnknown_0203A11C) + FREE_AND_SET_NULL(sUnknown_0203A11C); } static void sub_811C158(u16 arg0) { - gUnknown_0203A11C->unk4 = arg0; - gUnknown_0203A11C->unk0 = 0; + sUnknown_0203A11C->unk4 = arg0; + sUnknown_0203A11C->unk0 = 0; sub_811C170(); } static bool8 sub_811C170(void) { - switch (gUnknown_0203A11C->unk4) + switch (sUnknown_0203A11C->unk4) { case 0: return FALSE; case 1: return sub_811C2D4(); @@ -2892,11 +2900,11 @@ static bool8 sub_811C170(void) static bool8 sub_811C2D4(void) { - switch (gUnknown_0203A11C->unk0) + switch (sUnknown_0203A11C->unk0) { case 0: sub_811D2C8(); - gUnknown_0203A11C->unk0++; + sUnknown_0203A11C->unk0++; break; case 1: return IsDma3ManagerBusyWithBgCopy(); @@ -2910,21 +2918,21 @@ static bool8 sub_811C30C(void) u8 i; u16 *ecWordBuffer; u16 *ecWord; - u8 var0; + u8 frameId; u8 cursorColumn, cursorRow, numColumns; s16 var1; int stringWidth; int trueStringWidth; u8 var2; - u8 sp0[64]; + u8 str[64]; - ecWordBuffer = sub_811BA94(); - var0 = sub_811BA68(); - cursorColumn = sub_811BAB8(); - cursorRow = sub_811BAC4(); - numColumns = sub_811BAAC(); + ecWordBuffer = GetEasyChatWordBuffer(); + frameId = GetEasyChatScreenFrameId(); + cursorColumn = GetMainCursorColumn(); + cursorRow = GetMainCursorRow(); + numColumns = GetNumColumns(); ecWord = &ecWordBuffer[cursorRow * numColumns]; - var1 = 8 * gUnknown_08597C30[var0].unk0_0 + 13; + var1 = 8 * sPhraseFrameDimensions[frameId].left + 13; for (i = 0; i < cursorColumn; i++) { if (*ecWord == 0xFFFF) @@ -2933,8 +2941,8 @@ static bool8 sub_811C30C(void) } else { - CopyEasyChatWord(sp0, *ecWord); - stringWidth = GetStringWidth(1, sp0, 0); + CopyEasyChatWord(str, *ecWord); + stringWidth = GetStringWidth(1, str, 0); } trueStringWidth = stringWidth + 17; @@ -2942,27 +2950,27 @@ static bool8 sub_811C30C(void) ecWord++; } - var2 = 8 * (gUnknown_08597C30[var0].unk0_5 + cursorRow * 2); + var2 = 8 * (sPhraseFrameDimensions[frameId].top + cursorRow * 2); sub_811DF60(var1, var2 + 8); return FALSE; } static bool8 sub_811C3E4(void) { - u8 var0 = sub_811E920(sub_811BAB8()); - sub_811DF60(var0, 96); + u8 xOffset = GetFooterOptionXOffset(GetMainCursorColumn()); + sub_811DF60(xOffset, 96); return FALSE; } static bool8 sub_811C404(void) { - switch (gUnknown_0203A11C->unk0) + switch (sUnknown_0203A11C->unk0) { case 0: sub_811DF90(); sub_811D104(2); sub_811D214(1); - gUnknown_0203A11C->unk0++; + sUnknown_0203A11C->unk0++; break; case 1: return IsDma3ManagerBusyWithBgCopy(); @@ -2973,13 +2981,13 @@ static bool8 sub_811C404(void) static bool8 sub_811C448(void) { - switch (gUnknown_0203A11C->unk0) + switch (sUnknown_0203A11C->unk0) { case 0: sub_811DF90(); sub_811D104(3); sub_811D214(0); - gUnknown_0203A11C->unk0++; + sUnknown_0203A11C->unk0++; break; case 1: return IsDma3ManagerBusyWithBgCopy(); @@ -2990,13 +2998,13 @@ static bool8 sub_811C448(void) static bool8 sub_811C48C(void) { - switch (gUnknown_0203A11C->unk0) + switch (sUnknown_0203A11C->unk0) { case 0: sub_811DF90(); sub_811D104(1); sub_811D214(1); - gUnknown_0203A11C->unk0++; + sUnknown_0203A11C->unk0++; break; case 1: return IsDma3ManagerBusyWithBgCopy(); @@ -3007,14 +3015,14 @@ static bool8 sub_811C48C(void) static bool8 sub_811C4D0(void) { - switch (gUnknown_0203A11C->unk0) + switch (sUnknown_0203A11C->unk0) { case 0: sub_811DFB0(); sub_811D104(0); sub_811D2C8(); ShowBg(0); - gUnknown_0203A11C->unk0++; + sUnknown_0203A11C->unk0++; break; case 1: return IsDma3ManagerBusyWithBgCopy(); @@ -3025,13 +3033,13 @@ static bool8 sub_811C4D0(void) static bool8 sub_811C518(void) { - switch (gUnknown_0203A11C->unk0) + switch (sUnknown_0203A11C->unk0) { case 0: sub_811DFB0(); sub_811D104(0); sub_811D2C8(); - gUnknown_0203A11C->unk0++; + sUnknown_0203A11C->unk0++; // Fall through case 1: return IsDma3ManagerBusyWithBgCopy(); @@ -3042,31 +3050,31 @@ static bool8 sub_811C518(void) static bool8 sub_811C554(void) { - switch (gUnknown_0203A11C->unk0) + switch (sUnknown_0203A11C->unk0) { case 0: sub_811DF90(); HideBg(0); sub_811DE5C(0, 0, 0, 0); sub_811D6D4(); - gUnknown_0203A11C->unk0++; + sUnknown_0203A11C->unk0++; break; case 1: if (!IsDma3ManagerBusyWithBgCopy()) { sub_811D9CC(0); - gUnknown_0203A11C->unk0++; + sUnknown_0203A11C->unk0++; } break; case 2: if (!IsDma3ManagerBusyWithBgCopy() && !sub_811DAA4()) - gUnknown_0203A11C->unk0++; + sUnknown_0203A11C->unk0++; break; case 3: if (!IsDma3ManagerBusyWithBgCopy()) { sub_811E3AC(); - gUnknown_0203A11C->unk0++; + sUnknown_0203A11C->unk0++; } break; case 4: @@ -3075,7 +3083,7 @@ static bool8 sub_811C554(void) sub_811DFC8(); sub_811E6E0(0); sub_811E64C(); - gUnknown_0203A11C->unk0++; + sUnknown_0203A11C->unk0++; return FALSE; } break; @@ -3088,31 +3096,31 @@ static bool8 sub_811C554(void) static bool8 sub_811C620(void) { - switch (gUnknown_0203A11C->unk0) + switch (sUnknown_0203A11C->unk0) { case 0: sub_811E050(); sub_811E4AC(); sub_811E6B0(); - gUnknown_0203A11C->unk0++; + sUnknown_0203A11C->unk0++; break; case 1: if (sub_811E4D0() == TRUE) break; sub_811D9CC(1); - gUnknown_0203A11C->unk0++; + sUnknown_0203A11C->unk0++; // Fall through case 2: if (!sub_811DAA4()) - gUnknown_0203A11C->unk0++; + sUnknown_0203A11C->unk0++; break; case 3: if (!IsDma3ManagerBusyWithBgCopy()) { sub_811DFB0(); ShowBg(0); - gUnknown_0203A11C->unk0++; + sUnknown_0203A11C->unk0++; } break; case 4: @@ -3124,20 +3132,20 @@ static bool8 sub_811C620(void) static bool8 sub_811C6C0(void) { - switch (gUnknown_0203A11C->unk0) + switch (sUnknown_0203A11C->unk0) { case 0: sub_811E050(); sub_811E6B0(); sub_811E55C(); sub_811D9CC(5); - gUnknown_0203A11C->unk0++; + sUnknown_0203A11C->unk0++; break; case 1: if (!sub_811DAA4() && !sub_811E5B8()) { sub_811D6D4(); - gUnknown_0203A11C->unk0++; + sUnknown_0203A11C->unk0++; } break; case 2: @@ -3145,7 +3153,7 @@ static bool8 sub_811C6C0(void) { sub_811D9CC(6); sub_811E578(); - gUnknown_0203A11C->unk0++; + sUnknown_0203A11C->unk0++; } break; case 3: @@ -3153,7 +3161,7 @@ static bool8 sub_811C6C0(void) { sub_811E64C(); sub_811DFC8(); - gUnknown_0203A11C->unk0++; + sUnknown_0203A11C->unk0++; return FALSE; } break; @@ -3172,11 +3180,11 @@ static bool8 sub_811C780(void) static bool8 sub_811C78C(void) { - switch (gUnknown_0203A11C->unk0) + switch (sUnknown_0203A11C->unk0) { case 0: sub_811DDAC(1, 4); - gUnknown_0203A11C->unk0++; + sUnknown_0203A11C->unk0++; // Fall through case 1: if (!sub_811DE10()) @@ -3193,17 +3201,17 @@ static bool8 sub_811C78C(void) static bool8 sub_811C7D4(void) { - switch (gUnknown_0203A11C->unk0) + switch (sUnknown_0203A11C->unk0) { case 0: sub_811DDAC(-1, 4); - gUnknown_0203A11C->unk0++; + sUnknown_0203A11C->unk0++; // Fall through case 1: if (!sub_811DE10()) { sub_811E64C(); - gUnknown_0203A11C->unk0++; + sUnknown_0203A11C->unk0++; return FALSE; } break; @@ -3216,33 +3224,33 @@ static bool8 sub_811C7D4(void) static bool8 sub_811C830(void) { - switch (gUnknown_0203A11C->unk0) + switch (sUnknown_0203A11C->unk0) { case 0: sub_811E050(); sub_811E4AC(); sub_811E6B0(); - gUnknown_0203A11C->unk0++; + sUnknown_0203A11C->unk0++; break; case 1: if (!sub_811E4D0()) { sub_811D9B4(); - gUnknown_0203A11C->unk0++; + sUnknown_0203A11C->unk0++; } break; case 2: if (!IsDma3ManagerBusyWithBgCopy()) { sub_811D9CC(2); - gUnknown_0203A11C->unk0++; + sUnknown_0203A11C->unk0++; } break; case 3: if (!sub_811DAA4()) { sub_811D698(2); - gUnknown_0203A11C->unk0++; + sUnknown_0203A11C->unk0++; } break; case 4: @@ -3252,7 +3260,7 @@ static bool8 sub_811C830(void) sub_811E6E0(1); sub_811E64C(); sub_811E794(); - gUnknown_0203A11C->unk0++; + sUnknown_0203A11C->unk0++; return FALSE; } break; @@ -3265,38 +3273,38 @@ static bool8 sub_811C830(void) static bool8 sub_811C8F0(void) { - switch (gUnknown_0203A11C->unk0) + switch (sUnknown_0203A11C->unk0) { case 0: sub_811D2C8(); - gUnknown_0203A11C->unk0++; + sUnknown_0203A11C->unk0++; break; case 1: sub_811E380(); sub_811E6B0(); sub_811E7F8(); sub_811D9B4(); - gUnknown_0203A11C->unk0++; + sUnknown_0203A11C->unk0++; break; case 2: if (!IsDma3ManagerBusyWithBgCopy()) { sub_811D9CC(3); - gUnknown_0203A11C->unk0++; + sUnknown_0203A11C->unk0++; } break; case 3: if (!sub_811DAA4()) { ShowBg(0); - gUnknown_0203A11C->unk0++; + sUnknown_0203A11C->unk0++; } break; case 4: if (!IsDma3ManagerBusyWithBgCopy()) { sub_811DFB0(); - gUnknown_0203A11C->unk0++; + sUnknown_0203A11C->unk0++; return FALSE; } break; @@ -3309,45 +3317,45 @@ static bool8 sub_811C8F0(void) static bool8 sub_811C99C(void) { - switch (gUnknown_0203A11C->unk0) + switch (sUnknown_0203A11C->unk0) { case 0: sub_811D2C8(); - gUnknown_0203A11C->unk0++; + sUnknown_0203A11C->unk0++; break; case 1: sub_811E380(); sub_811E6B0(); sub_811E7F8(); sub_811D9B4(); - gUnknown_0203A11C->unk0++; + sUnknown_0203A11C->unk0++; break; case 2: if (!IsDma3ManagerBusyWithBgCopy()) { sub_811D9CC(3); - gUnknown_0203A11C->unk0++; + sUnknown_0203A11C->unk0++; } break; case 3: if (!sub_811DAA4()) { sub_811D104(3); - gUnknown_0203A11C->unk0++; + sUnknown_0203A11C->unk0++; } break; case 4: if (!IsDma3ManagerBusyWithBgCopy()) { ShowBg(0); - gUnknown_0203A11C->unk0++; + sUnknown_0203A11C->unk0++; } break; case 5: if (!IsDma3ManagerBusyWithBgCopy()) { sub_811DFB0(); - gUnknown_0203A11C->unk0++; + sUnknown_0203A11C->unk0++; return FALSE; } break; @@ -3360,34 +3368,34 @@ static bool8 sub_811C99C(void) static bool8 sub_811CA5C(void) { - switch (gUnknown_0203A11C->unk0) + switch (sUnknown_0203A11C->unk0) { case 0: sub_811E380(); sub_811E6B0(); sub_811E7F8(); sub_811D9B4(); - gUnknown_0203A11C->unk0++; + sUnknown_0203A11C->unk0++; break; case 1: if (!IsDma3ManagerBusyWithBgCopy()) { sub_811D9CC(4); - gUnknown_0203A11C->unk0++; + sUnknown_0203A11C->unk0++; } break; case 2: if (!sub_811DAA4()) { sub_811D6D4(); - gUnknown_0203A11C->unk0++; + sUnknown_0203A11C->unk0++; } break; case 3: if (!IsDma3ManagerBusyWithBgCopy()) { sub_811E3AC(); - gUnknown_0203A11C->unk0++; + sUnknown_0203A11C->unk0++; } break; case 4: @@ -3396,7 +3404,7 @@ static bool8 sub_811CA5C(void) sub_811DFC8(); sub_811E6E0(0); sub_811E64C(); - gUnknown_0203A11C->unk0++; + sUnknown_0203A11C->unk0++; return FALSE; } break; @@ -3413,17 +3421,17 @@ static bool8 sub_811CB18(void) static bool8 sub_811CB24(void) { - switch (gUnknown_0203A11C->unk0) + switch (sUnknown_0203A11C->unk0) { case 0: sub_811D7A4(); - gUnknown_0203A11C->unk0++; + sUnknown_0203A11C->unk0++; break; case 1: if (!IsDma3ManagerBusyWithBgCopy()) { sub_811DDAC(1, 4); - gUnknown_0203A11C->unk0++; + sUnknown_0203A11C->unk0++; } break; case 2: @@ -3432,7 +3440,7 @@ static bool8 sub_811CB24(void) sub_811E30C(); sub_811E64C(); sub_811E794(); - gUnknown_0203A11C->unk0++; + sUnknown_0203A11C->unk0++; return FALSE; } break; @@ -3445,17 +3453,17 @@ static bool8 sub_811CB24(void) static bool8 sub_811CB98(void) { - switch (gUnknown_0203A11C->unk0) + switch (sUnknown_0203A11C->unk0) { case 0: sub_811D7C8(); - gUnknown_0203A11C->unk0++; + sUnknown_0203A11C->unk0++; break; case 1: if (!IsDma3ManagerBusyWithBgCopy()) { sub_811DDAC(-1, 4); - gUnknown_0203A11C->unk0++; + sUnknown_0203A11C->unk0++; } break; case 2: @@ -3463,7 +3471,7 @@ static bool8 sub_811CB98(void) { sub_811E64C(); sub_811E794(); - gUnknown_0203A11C->unk0++; + sUnknown_0203A11C->unk0++; return FALSE; } break; @@ -3476,18 +3484,18 @@ static bool8 sub_811CB98(void) static bool8 sub_811CC08(void) { - switch (gUnknown_0203A11C->unk0) + switch (sUnknown_0203A11C->unk0) { case 0: sub_811D7EC(); - gUnknown_0203A11C->unk0++; + sUnknown_0203A11C->unk0++; break; case 1: if (!IsDma3ManagerBusyWithBgCopy()) { s16 var0 = sub_811BBDC() - sub_811DE48(); sub_811DDAC(var0, 8); - gUnknown_0203A11C->unk0++; + sUnknown_0203A11C->unk0++; } break; case 2: @@ -3496,7 +3504,7 @@ static bool8 sub_811CC08(void) sub_811E30C(); sub_811E64C(); sub_811E794(); - gUnknown_0203A11C->unk0++; + sUnknown_0203A11C->unk0++; return FALSE; } break; @@ -3509,18 +3517,18 @@ static bool8 sub_811CC08(void) static bool8 sub_811CC90(void) { - switch (gUnknown_0203A11C->unk0) + switch (sUnknown_0203A11C->unk0) { case 0: sub_811D830(); - gUnknown_0203A11C->unk0++; + sUnknown_0203A11C->unk0++; break; case 1: if (!IsDma3ManagerBusyWithBgCopy()) { s16 var0 = sub_811BBDC() - sub_811DE48(); sub_811DDAC(var0, 8); - gUnknown_0203A11C->unk0++; + sUnknown_0203A11C->unk0++; } break; case 2: @@ -3528,7 +3536,7 @@ static bool8 sub_811CC90(void) { sub_811E64C(); sub_811E794(); - gUnknown_0203A11C->unk0++; + sUnknown_0203A11C->unk0++; return FALSE; } break; @@ -3541,12 +3549,12 @@ static bool8 sub_811CC90(void) static bool8 sub_811CD14(void) { - switch (gUnknown_0203A11C->unk0) + switch (sUnknown_0203A11C->unk0) { case 0: sub_811DF90(); sub_811D104(4); - gUnknown_0203A11C->unk0++; + sUnknown_0203A11C->unk0++; break; case 1: return IsDma3ManagerBusyWithBgCopy(); @@ -3557,12 +3565,12 @@ static bool8 sub_811CD14(void) static bool8 sub_811CD54(void) { - switch (gUnknown_0203A11C->unk0) + switch (sUnknown_0203A11C->unk0) { case 0: sub_811DF90(); sub_811D104(5); - gUnknown_0203A11C->unk0++; + sUnknown_0203A11C->unk0++; break; case 1: return IsDma3ManagerBusyWithBgCopy(); @@ -3573,12 +3581,12 @@ static bool8 sub_811CD54(void) static bool8 sub_811CD94(void) { - switch (gUnknown_0203A11C->unk0) + switch (sUnknown_0203A11C->unk0) { case 0: sub_811DF90(); sub_811D104(6); - gUnknown_0203A11C->unk0++; + sUnknown_0203A11C->unk0++; break; case 1: return IsDma3ManagerBusyWithBgCopy(); @@ -3589,12 +3597,12 @@ static bool8 sub_811CD94(void) static bool8 sub_811CDD4(void) { - switch (gUnknown_0203A11C->unk0) + switch (sUnknown_0203A11C->unk0) { case 0: sub_811DF90(); sub_811D104(7); - gUnknown_0203A11C->unk0++; + sUnknown_0203A11C->unk0++; break; case 1: return IsDma3ManagerBusyWithBgCopy(); @@ -3605,12 +3613,12 @@ static bool8 sub_811CDD4(void) static bool8 sub_811CE14(void) { - switch (gUnknown_0203A11C->unk0) + switch (sUnknown_0203A11C->unk0) { case 0: sub_811DF90(); sub_811D104(8); - gUnknown_0203A11C->unk0++; + sUnknown_0203A11C->unk0++; break; case 1: return IsDma3ManagerBusyWithBgCopy(); @@ -3621,12 +3629,12 @@ static bool8 sub_811CE14(void) static bool8 sub_811CE54(void) { - switch (gUnknown_0203A11C->unk0) + switch (sUnknown_0203A11C->unk0) { case 0: sub_811DF90(); sub_811D104(9); - gUnknown_0203A11C->unk0++; + sUnknown_0203A11C->unk0++; break; case 1: return IsDma3ManagerBusyWithBgCopy(); @@ -3637,22 +3645,22 @@ static bool8 sub_811CE54(void) static bool8 sub_811CE94(void) { - gUnknown_0203A11C = Alloc(sizeof(*gUnknown_0203A11C)); - if (!gUnknown_0203A11C) + sUnknown_0203A11C = Alloc(sizeof(*sUnknown_0203A11C)); + if (!sUnknown_0203A11C) return FALSE; - gUnknown_0203A11C->unk0 = 0; - gUnknown_0203A11C->unk2D8 = NULL; - gUnknown_0203A11C->unk2DC = NULL; - gUnknown_0203A11C->unk2E0 = NULL; - gUnknown_0203A11C->unk2E4 = NULL; - gUnknown_0203A11C->unk2E8 = NULL; - gUnknown_0203A11C->unk2EC = NULL; - gUnknown_0203A11C->unk2F0 = NULL; - gUnknown_0203A11C->unk2F4 = NULL; - gUnknown_0203A11C->unk2F8 = NULL; - gUnknown_0203A11C->unk2FC = NULL; - gUnknown_0203A11C->unkA = sub_811BC70(); + 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_(); return TRUE; } @@ -3684,7 +3692,7 @@ static void sub_811CF64(void) static void sub_811CFCC(void) { int xOffset; - const u8 *titleText = sub_811BA88(); + const u8 *titleText = GetTitleText(); if (!titleText) return; @@ -3776,19 +3784,19 @@ static void sub_811D214(u8 initialCursorPos) static void sub_811D230(void) { - u8 var0; + u8 frameId; struct WindowTemplate template; - var0 = sub_811BA68(); + frameId = GetEasyChatScreenFrameId(); template.bg = 3; - template.tilemapLeft = gUnknown_08597C30[var0].unk0_0; - template.tilemapTop = gUnknown_08597C30[var0].unk0_5; - template.width = gUnknown_08597C30[var0].unk1; - template.height = gUnknown_08597C30[var0].unk2; + template.tilemapLeft = sPhraseFrameDimensions[frameId].left; + template.tilemapTop = sPhraseFrameDimensions[frameId].top; + template.width = sPhraseFrameDimensions[frameId].width; + template.height = sPhraseFrameDimensions[frameId].height; template.paletteNum = 11; template.baseBlock = 0x6C; - gUnknown_0203A11C->windowId = AddWindow(&template); - PutWindowTilemap(gUnknown_0203A11C->windowId); + sUnknown_0203A11C->windowId = AddWindow(&template); + PutWindowTilemap(sUnknown_0203A11C->windowId); } static void sub_811D2C8(void) @@ -3797,27 +3805,27 @@ static void sub_811D2C8(void) u16 *ecWord; u8 numColumns, numRows; u8 *str; - int var0; + int frameId; int var1; int i, j, k; - ecWord = sub_811BA94(); - numColumns = sub_811BAAC(); - numRows = sub_811BAA0(); - var0 = sub_811BA68(); + ecWord = GetEasyChatWordBuffer(); + numColumns = GetNumColumns(); + numRows = GetNumRows(); + frameId = GetEasyChatScreenFrameId(); var1 = 0; - if (var0 == 7) + if (frameId == 7) var1 = 1; - FillWindowPixelBuffer(gUnknown_0203A11C->windowId, 0x11); + FillWindowPixelBuffer(sUnknown_0203A11C->windowId, 0x11); for (i = 0; i < numRows; i++) { memcpy(spC, sText_Clear17, sizeof(sText_Clear17)); if (var1) spC[2] = 6; - str = gUnknown_0203A11C->unkB; - gUnknown_0203A11C->unkB[0] = EOS; + str = sUnknown_0203A11C->unkB; + sUnknown_0203A11C->unkB[0] = EOS; str = StringAppend(str, spC); for (j = 0; j < numColumns; j++) { @@ -3846,7 +3854,7 @@ static void sub_811D2C8(void) spC[2] = 3; str = StringAppend(str, spC); - if (var0 == 2 || var0 == 7 || var0 == 8) + if (frameId == 2 || frameId == 7 || frameId == 8) { if (j == 0 && i == 4) break; @@ -3854,27 +3862,27 @@ static void sub_811D2C8(void) } *str = EOS; - sub_811D028(gUnknown_0203A11C->windowId, 1, gUnknown_0203A11C->unkB, 0, i * 16 + 1, 0xFF, 0); + sub_811D028(sUnknown_0203A11C->windowId, 1, sUnknown_0203A11C->unkB, 0, i * 16 + 1, 0xFF, 0); } - CopyWindowToVram(gUnknown_0203A11C->windowId, 3); + CopyWindowToVram(sUnknown_0203A11C->windowId, 3); } static void sub_811D424(u16 *tilemap) { - u8 var0; + u8 frameId; int right, bottom; int x, y; - var0 = sub_811BA68(); + frameId = GetEasyChatScreenFrameId(); CpuFastFill(0, tilemap, BG_SCREEN_SIZE); - if (var0 == 2 || var0 == 8) + if (frameId == 2 || frameId == 8) { - right = gUnknown_08597C30[var0].unk0_0 + gUnknown_08597C30[var0].unk1; - bottom = gUnknown_08597C30[var0].unk0_5 + gUnknown_08597C30[var0].unk2; - for (y = gUnknown_08597C30[var0].unk0_5; y < bottom; y++) + right = sPhraseFrameDimensions[frameId].left + sPhraseFrameDimensions[frameId].width; + bottom = sPhraseFrameDimensions[frameId].top + sPhraseFrameDimensions[frameId].height; + for (y = sPhraseFrameDimensions[frameId].top; y < bottom; y++) { - x = gUnknown_08597C30[var0].unk0_0 - 1; + x = sPhraseFrameDimensions[frameId].left - 1; tilemap[y * 32 + x] = 0x1005; x++; for (; x < right; x++) @@ -3885,10 +3893,10 @@ static void sub_811D424(u16 *tilemap) } else { - y = gUnknown_08597C30[var0].unk0_5 - 1; - x = gUnknown_08597C30[var0].unk0_0 - 1; - right = gUnknown_08597C30[var0].unk0_0 + gUnknown_08597C30[var0].unk1; - bottom = gUnknown_08597C30[var0].unk0_5 + gUnknown_08597C30[var0].unk2; + y = sPhraseFrameDimensions[frameId].top - 1; + x = sPhraseFrameDimensions[frameId].left - 1; + right = sPhraseFrameDimensions[frameId].left + sPhraseFrameDimensions[frameId].width; + bottom = sPhraseFrameDimensions[frameId].top + sPhraseFrameDimensions[frameId].height; tilemap[y * 32 + x] = 0x1001; x++; for (; x < right; x++) @@ -3898,7 +3906,7 @@ static void sub_811D424(u16 *tilemap) y++; for (; y < bottom; y++) { - x = gUnknown_08597C30[var0].unk0_0 - 1; + x = sPhraseFrameDimensions[frameId].left - 1; tilemap[y * 32 + x] = 0x1005; x++; for (; x < right; x++) @@ -3907,7 +3915,7 @@ static void sub_811D424(u16 *tilemap) tilemap[y* 32 + x] = 0x1007; } - x = gUnknown_08597C30[var0].unk0_0 - 1; + x = sPhraseFrameDimensions[frameId].left - 1; tilemap[y * 32 + x] = 0x1009; x++; for (; x < right; x++) @@ -3919,12 +3927,12 @@ static void sub_811D424(u16 *tilemap) static void sub_811D60C(void) { - u8 var0; + u8 frameId; u16 *tilemap; tilemap = GetBgTilemapBuffer(3); - var0 = sub_811BA68(); - switch (gUnknown_08597C30[var0].unk3) + frameId = GetEasyChatScreenFrameId(); + switch (sPhraseFrameDimensions[frameId].footerId) { case 2: tilemap += 0x2A0; @@ -4072,11 +4080,11 @@ static void sub_811D864(u8 arg0, u8 arg1) easyChatWord = sub_811F578(var0++); if (easyChatWord != 0xFFFF) { - CopyEasyChatWordPadded(gUnknown_0203A11C->unkCC, easyChatWord, 0); + CopyEasyChatWordPadded(sUnknown_0203A11C->unkCC, easyChatWord, 0); if (!sub_811BF88(easyChatWord)) - sub_811D028(2, 1, gUnknown_0203A11C->unkCC, (j * 13 + 3) * 8, y, 0xFF, NULL); + sub_811D028(2, 1, sUnknown_0203A11C->unkCC, (j * 13 + 3) * 8, y, 0xFF, NULL); else - sub_811D058(2, 1, gUnknown_0203A11C->unkCC, (j * 13 + 3) * 8, y, 0xFF, 1, 5, 3); + sub_811D058(2, 1, sUnknown_0203A11C->unkCC, (j * 13 + 3) * 8, y, 0xFF, 1, 5, 3); } } @@ -4122,48 +4130,48 @@ static void sub_811D9CC(int arg0) switch (arg0) { case 0: - gUnknown_0203A11C->unk6 = 0; - gUnknown_0203A11C->unk7 = 10; + sUnknown_0203A11C->unk6 = 0; + sUnknown_0203A11C->unk7 = 10; break; case 1: - gUnknown_0203A11C->unk6 = 9; - gUnknown_0203A11C->unk7 = 0; + sUnknown_0203A11C->unk6 = 9; + sUnknown_0203A11C->unk7 = 0; break; case 2: - gUnknown_0203A11C->unk6 = 11; - gUnknown_0203A11C->unk7 = 17; + sUnknown_0203A11C->unk6 = 11; + sUnknown_0203A11C->unk7 = 17; break; case 3: - gUnknown_0203A11C->unk6 = 17; - gUnknown_0203A11C->unk7 = 0; + sUnknown_0203A11C->unk6 = 17; + sUnknown_0203A11C->unk7 = 0; break; case 4: - gUnknown_0203A11C->unk6 = 17; - gUnknown_0203A11C->unk7 = 10; + sUnknown_0203A11C->unk6 = 17; + sUnknown_0203A11C->unk7 = 10; break; case 5: - gUnknown_0203A11C->unk6 = 18; - gUnknown_0203A11C->unk7 = 22; + sUnknown_0203A11C->unk6 = 18; + sUnknown_0203A11C->unk7 = 22; break; case 6: - gUnknown_0203A11C->unk6 = 22; - gUnknown_0203A11C->unk7 = 18; + sUnknown_0203A11C->unk6 = 22; + sUnknown_0203A11C->unk7 = 18; break; } - gUnknown_0203A11C->unk8 = gUnknown_0203A11C->unk6 < gUnknown_0203A11C->unk7 ? 1 : -1; + sUnknown_0203A11C->unk8 = sUnknown_0203A11C->unk6 < sUnknown_0203A11C->unk7 ? 1 : -1; } static bool8 sub_811DAA4(void) { u8 var0, var1; - if (gUnknown_0203A11C->unk6 == gUnknown_0203A11C->unk7) + if (sUnknown_0203A11C->unk6 == sUnknown_0203A11C->unk7) return FALSE; - gUnknown_0203A11C->unk6 += gUnknown_0203A11C->unk8; - sub_811DADC(gUnknown_0203A11C->unk6); - var0 = gUnknown_0203A11C->unk6; - var1 = gUnknown_0203A11C->unk7; + sUnknown_0203A11C->unk6 += sUnknown_0203A11C->unk8; + sub_811DADC(sUnknown_0203A11C->unk6); + var0 = sUnknown_0203A11C->unk6; + var1 = sUnknown_0203A11C->unk7; return (var0 ^ var1) > 0; } @@ -4244,7 +4252,7 @@ static void sub_811DC28(int left, int top, int width, int height) int bottom; int x, y; - tilemap = gUnknown_0203A11C->unk300; + tilemap = sUnknown_0203A11C->unk300; right = left + width - 1; bottom = top + height - 1; x = left; @@ -4278,7 +4286,7 @@ static void sub_811DC28(int left, int top, int width, int height) static void sub_811DD84(void) { ChangeBgY(2, 0x800, 0); - gUnknown_0203A11C->unk2CE = 0; + sUnknown_0203A11C->unk2CE = 0; } static void sub_811DDAC(s16 arg0, u8 arg1) @@ -4287,15 +4295,15 @@ static void sub_811DDAC(s16 arg0, u8 arg1) s16 var0; bgY = GetBgY(2); - gUnknown_0203A11C->unk2CE += arg0; + sUnknown_0203A11C->unk2CE += arg0; var0 = arg0 * 16; bgY += var0 << 8; if (arg1) { - gUnknown_0203A11C->unk2D0 = bgY; - gUnknown_0203A11C->unk2D4 = arg1 * 256; + sUnknown_0203A11C->unk2D0 = bgY; + sUnknown_0203A11C->unk2D4 = arg1 * 256; if (var0 < 0) - gUnknown_0203A11C->unk2D4 = -gUnknown_0203A11C->unk2D4; + sUnknown_0203A11C->unk2D4 = -sUnknown_0203A11C->unk2D4; } else { @@ -4308,20 +4316,20 @@ static bool8 sub_811DE10(void) int bgY; bgY = GetBgY(2); - if (bgY == gUnknown_0203A11C->unk2D0) + if (bgY == sUnknown_0203A11C->unk2D0) { return FALSE; } else { - ChangeBgY(2, gUnknown_0203A11C->unk2D4, 1); + ChangeBgY(2, sUnknown_0203A11C->unk2D4, 1); return TRUE; } } static int sub_811DE48(void) { - return gUnknown_0203A11C->unk2CE; + return sUnknown_0203A11C->unk2CE; } static void sub_811DE5C(u8 left, u8 top, u8 width, u8 height) @@ -4336,19 +4344,19 @@ static void sub_811DE90(void) { u32 i; - LoadSpriteSheets(sUnknown_08597CA0); - LoadSpritePalettes(sUnknown_08597CC0); + LoadSpriteSheets(sEasyChatSpriteSheets); + LoadSpritePalettes(sEasyChatSpritePalettes); for (i = 0; i < ARRAY_COUNT(sUnknown_08597CE8); i++) LoadCompressedSpriteSheet(&sUnknown_08597CE8[i]); } static void sub_811DEC4(void) { - u8 var0 = sub_811BA68(); - int x = gUnknown_08597C30[var0].unk0_0 * 8 + 13; - int y = gUnknown_08597C30[var0].unk0_5 * 8 + 8; + 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); - gUnknown_0203A11C->unk2D8 = &gSprites[spriteId]; + sUnknown_0203A11C->unk2D8 = &gSprites[spriteId]; gSprites[spriteId].data[1] = 1; } @@ -4367,44 +4375,44 @@ static void sub_811DF28(struct Sprite *sprite) static void sub_811DF60(u8 x, u8 y) { - gUnknown_0203A11C->unk2D8->pos1.x = x; - gUnknown_0203A11C->unk2D8->pos1.y = y; - gUnknown_0203A11C->unk2D8->pos2.x = 0; - gUnknown_0203A11C->unk2D8->data[0] = 0; + sUnknown_0203A11C->unk2D8->pos1.x = x; + sUnknown_0203A11C->unk2D8->pos1.y = y; + sUnknown_0203A11C->unk2D8->pos2.x = 0; + sUnknown_0203A11C->unk2D8->data[0] = 0; } static void sub_811DF90(void) { - gUnknown_0203A11C->unk2D8->data[0] = 0; - gUnknown_0203A11C->unk2D8->data[1] = 0; - gUnknown_0203A11C->unk2D8->pos2.x = 0; + sUnknown_0203A11C->unk2D8->data[0] = 0; + sUnknown_0203A11C->unk2D8->data[1] = 0; + sUnknown_0203A11C->unk2D8->pos2.x = 0; } static void sub_811DFB0(void) { - gUnknown_0203A11C->unk2D8->data[1] = 1; + sUnknown_0203A11C->unk2D8->data[1] = 1; } static void sub_811DFC8(void) { u8 spriteId = CreateSprite(&sUnknown_08597D68, 0, 0, 3); - gUnknown_0203A11C->unk2DC = &gSprites[spriteId]; - gUnknown_0203A11C->unk2DC->pos2.x = 32; + sUnknown_0203A11C->unk2DC = &gSprites[spriteId]; + sUnknown_0203A11C->unk2DC->pos2.x = 32; spriteId = CreateSprite(&sUnknown_08597D68, 0, 0, 3); - gUnknown_0203A11C->unk2E0 = &gSprites[spriteId]; - gUnknown_0203A11C->unk2E0->pos2.x = -32; + sUnknown_0203A11C->unk2E0 = &gSprites[spriteId]; + sUnknown_0203A11C->unk2E0->pos2.x = -32; - gUnknown_0203A11C->unk2DC->hFlip = 1; + sUnknown_0203A11C->unk2DC->hFlip = 1; sub_811E088(); } static void sub_811E050(void) { - DestroySprite(gUnknown_0203A11C->unk2DC); - gUnknown_0203A11C->unk2DC = NULL; - DestroySprite(gUnknown_0203A11C->unk2E0); - gUnknown_0203A11C->unk2E0 = NULL; + DestroySprite(sUnknown_0203A11C->unk2DC); + sUnknown_0203A11C->unk2DC = NULL; + DestroySprite(sUnknown_0203A11C->unk2E0); + sUnknown_0203A11C->unk2E0 = NULL; } static void sub_811E088(void) @@ -4412,7 +4420,7 @@ static void sub_811E088(void) u8 var0; u8 var1; - if (gUnknown_0203A11C->unk2DC && gUnknown_0203A11C->unk2E0) + if (sUnknown_0203A11C->unk2DC && sUnknown_0203A11C->unk2E0) { sub_811BB9C(&var0, &var1); if (!sub_811BBB0()) @@ -4426,23 +4434,23 @@ static void sub_811E0EC(s8 arg0, s8 arg1) { if (arg0 != -1) { - StartSpriteAnim(gUnknown_0203A11C->unk2DC, 0); - gUnknown_0203A11C->unk2DC->pos1.x = arg0 * 84 + 58; - gUnknown_0203A11C->unk2DC->pos1.y = arg1 * 16 + 96; + StartSpriteAnim(sUnknown_0203A11C->unk2DC, 0); + sUnknown_0203A11C->unk2DC->pos1.x = arg0 * 84 + 58; + sUnknown_0203A11C->unk2DC->pos1.y = arg1 * 16 + 96; - StartSpriteAnim(gUnknown_0203A11C->unk2E0, 0); - gUnknown_0203A11C->unk2E0->pos1.x = arg0 * 84 + 58; - gUnknown_0203A11C->unk2E0->pos1.y = arg1 * 16 + 96; + StartSpriteAnim(sUnknown_0203A11C->unk2E0, 0); + sUnknown_0203A11C->unk2E0->pos1.x = arg0 * 84 + 58; + sUnknown_0203A11C->unk2E0->pos1.y = arg1 * 16 + 96; } else { - StartSpriteAnim(gUnknown_0203A11C->unk2DC, 1); - gUnknown_0203A11C->unk2DC->pos1.x = 216; - gUnknown_0203A11C->unk2DC->pos1.y = arg1 * 16 + 112; + StartSpriteAnim(sUnknown_0203A11C->unk2DC, 1); + sUnknown_0203A11C->unk2DC->pos1.x = 216; + sUnknown_0203A11C->unk2DC->pos1.y = arg1 * 16 + 112; - StartSpriteAnim(gUnknown_0203A11C->unk2E0, 1); - gUnknown_0203A11C->unk2E0->pos1.x = 216; - gUnknown_0203A11C->unk2E0->pos1.y = arg1 * 16 + 112; + StartSpriteAnim(sUnknown_0203A11C->unk2E0, 1); + sUnknown_0203A11C->unk2E0->pos1.x = 216; + sUnknown_0203A11C->unk2E0->pos1.y = arg1 * 16 + 112; } } @@ -4466,32 +4474,32 @@ static void sub_811E1A4(s8 arg0, s8 arg1) anim = 3; } - StartSpriteAnim(gUnknown_0203A11C->unk2DC, anim); - gUnknown_0203A11C->unk2DC->pos1.x = x; - gUnknown_0203A11C->unk2DC->pos1.y = y; + StartSpriteAnim(sUnknown_0203A11C->unk2DC, anim); + sUnknown_0203A11C->unk2DC->pos1.x = x; + sUnknown_0203A11C->unk2DC->pos1.y = y; - StartSpriteAnim(gUnknown_0203A11C->unk2E0, anim); - gUnknown_0203A11C->unk2E0->pos1.x = x; - gUnknown_0203A11C->unk2E0->pos1.y = y; + StartSpriteAnim(sUnknown_0203A11C->unk2E0, anim); + sUnknown_0203A11C->unk2E0->pos1.x = x; + sUnknown_0203A11C->unk2E0->pos1.y = y; } else { - StartSpriteAnim(gUnknown_0203A11C->unk2DC, 1); - gUnknown_0203A11C->unk2DC->pos1.x = 216; - gUnknown_0203A11C->unk2DC->pos1.y = arg1 * 16 + 112; + StartSpriteAnim(sUnknown_0203A11C->unk2DC, 1); + sUnknown_0203A11C->unk2DC->pos1.x = 216; + sUnknown_0203A11C->unk2DC->pos1.y = arg1 * 16 + 112; - StartSpriteAnim(gUnknown_0203A11C->unk2E0, 1); - gUnknown_0203A11C->unk2E0->pos1.x = 216; - gUnknown_0203A11C->unk2E0->pos1.y = arg1 * 16 + 112; + StartSpriteAnim(sUnknown_0203A11C->unk2E0, 1); + sUnknown_0203A11C->unk2E0->pos1.x = 216; + sUnknown_0203A11C->unk2E0->pos1.y = arg1 * 16 + 112; } } static void sub_811E288(void) { u8 spriteId = CreateSprite(&sUnknown_08597D18, 0, 0, 4); - gUnknown_0203A11C->unk2E4 = &gSprites[spriteId]; - gUnknown_0203A11C->unk2E4->callback = sub_811E2DC; - gUnknown_0203A11C->unk2E4->oam.priority = 2; + sUnknown_0203A11C->unk2E4 = &gSprites[spriteId]; + sUnknown_0203A11C->unk2E4->callback = sub_811E2DC; + sUnknown_0203A11C->unk2E4->oam.priority = 2; sub_811E30C(); } @@ -4518,58 +4526,58 @@ static void sub_811E30C(void) static void sub_811E34C(u8 x, u8 y) { - if (gUnknown_0203A11C->unk2E4) + if (sUnknown_0203A11C->unk2E4) { - gUnknown_0203A11C->unk2E4->pos1.x = x; - gUnknown_0203A11C->unk2E4->pos1.y = y; - gUnknown_0203A11C->unk2E4->pos2.x = 0; - gUnknown_0203A11C->unk2E4->data[0] = 0; + sUnknown_0203A11C->unk2E4->pos1.x = x; + sUnknown_0203A11C->unk2E4->pos1.y = y; + sUnknown_0203A11C->unk2E4->pos2.x = 0; + sUnknown_0203A11C->unk2E4->data[0] = 0; } } static void sub_811E380(void) { - if (gUnknown_0203A11C->unk2E4) + if (sUnknown_0203A11C->unk2E4) { - DestroySprite(gUnknown_0203A11C->unk2E4); - gUnknown_0203A11C->unk2E4 = NULL; + DestroySprite(sUnknown_0203A11C->unk2E4); + sUnknown_0203A11C->unk2E4 = NULL; } } static void sub_811E3AC(void) { u8 spriteId = CreateSprite(&sUnknown_08597DF0, 208, 128, 6); - gUnknown_0203A11C->unk2E8 = &gSprites[spriteId]; - gUnknown_0203A11C->unk2E8->pos2.x = -64; + sUnknown_0203A11C->unk2E8 = &gSprites[spriteId]; + sUnknown_0203A11C->unk2E8->pos2.x = -64; spriteId = CreateSprite(&sUnknown_08597DD0, 208, 80, 5); - gUnknown_0203A11C->unk2EC = &gSprites[spriteId]; - gUnknown_0203A11C->unk9 = 0; + sUnknown_0203A11C->unk2EC = &gSprites[spriteId]; + sUnknown_0203A11C->unk9 = 0; } static bool8 sub_811E418(void) { - switch (gUnknown_0203A11C->unk9) + switch (sUnknown_0203A11C->unk9) { default: return FALSE; case 0: - gUnknown_0203A11C->unk2E8->pos2.x += 8; - if (gUnknown_0203A11C->unk2E8->pos2.x >= 0) + sUnknown_0203A11C->unk2E8->pos2.x += 8; + if (sUnknown_0203A11C->unk2E8->pos2.x >= 0) { - gUnknown_0203A11C->unk2E8->pos2.x = 0; + sUnknown_0203A11C->unk2E8->pos2.x = 0; if (!sub_811BBB0()) - StartSpriteAnim(gUnknown_0203A11C->unk2EC, 1); + StartSpriteAnim(sUnknown_0203A11C->unk2EC, 1); else - StartSpriteAnim(gUnknown_0203A11C->unk2EC, 2); + StartSpriteAnim(sUnknown_0203A11C->unk2EC, 2); - gUnknown_0203A11C->unk9++; + sUnknown_0203A11C->unk9++; } break; case 1: - if (gUnknown_0203A11C->unk2EC->animEnded) + if (sUnknown_0203A11C->unk2EC->animEnded) { - gUnknown_0203A11C->unk9 = 2; + sUnknown_0203A11C->unk9 = 2; return FALSE; } } @@ -4579,29 +4587,29 @@ static bool8 sub_811E418(void) static void sub_811E4AC(void) { - gUnknown_0203A11C->unk9 = 0; - StartSpriteAnim(gUnknown_0203A11C->unk2EC, 3); + sUnknown_0203A11C->unk9 = 0; + StartSpriteAnim(sUnknown_0203A11C->unk2EC, 3); } static bool8 sub_811E4D0(void) { - switch (gUnknown_0203A11C->unk9) + switch (sUnknown_0203A11C->unk9) { default: return FALSE; case 0: - if (gUnknown_0203A11C->unk2EC->animEnded) - gUnknown_0203A11C->unk9 = 1; + if (sUnknown_0203A11C->unk2EC->animEnded) + sUnknown_0203A11C->unk9 = 1; break; case 1: - gUnknown_0203A11C->unk2E8->pos2.x -= 8; - if (gUnknown_0203A11C->unk2E8->pos2.x <= -64) + sUnknown_0203A11C->unk2E8->pos2.x -= 8; + if (sUnknown_0203A11C->unk2E8->pos2.x <= -64) { - DestroySprite(gUnknown_0203A11C->unk2EC); - DestroySprite(gUnknown_0203A11C->unk2E8); - gUnknown_0203A11C->unk2EC = NULL; - gUnknown_0203A11C->unk2E8 = NULL; - gUnknown_0203A11C->unk9++; + DestroySprite(sUnknown_0203A11C->unk2EC); + DestroySprite(sUnknown_0203A11C->unk2E8); + sUnknown_0203A11C->unk2EC = NULL; + sUnknown_0203A11C->unk2E8 = NULL; + sUnknown_0203A11C->unk9++; return FALSE; } } @@ -4611,33 +4619,33 @@ static bool8 sub_811E4D0(void) static void sub_811E55C(void) { - StartSpriteAnim(gUnknown_0203A11C->unk2EC, 4); + StartSpriteAnim(sUnknown_0203A11C->unk2EC, 4); } static void sub_811E578(void) { if (!sub_811BBB0()) - StartSpriteAnim(gUnknown_0203A11C->unk2EC, 1); + StartSpriteAnim(sUnknown_0203A11C->unk2EC, 1); else - StartSpriteAnim(gUnknown_0203A11C->unk2EC, 2); + StartSpriteAnim(sUnknown_0203A11C->unk2EC, 2); } static bool8 sub_811E5B8(void) { - return !gUnknown_0203A11C->unk2EC->animEnded; + return !sUnknown_0203A11C->unk2EC->animEnded; } static void sub_811E5D4(void) { u8 spriteId = CreateSprite(&sUnknown_08597E48, 96, 80, 0); if (spriteId != MAX_SPRITES) - gUnknown_0203A11C->unk2F0 = &gSprites[spriteId]; + sUnknown_0203A11C->unk2F0 = &gSprites[spriteId]; spriteId = CreateSprite(&sUnknown_08597E48, 96, 156, 0); if (spriteId != MAX_SPRITES) { - gUnknown_0203A11C->unk2F4 = &gSprites[spriteId]; - gUnknown_0203A11C->unk2F4->vFlip = 1; + sUnknown_0203A11C->unk2F4 = &gSprites[spriteId]; + sUnknown_0203A11C->unk2F4->vFlip = 1; } sub_811E6B0(); @@ -4645,27 +4653,27 @@ static void sub_811E5D4(void) static void sub_811E64C(void) { - gUnknown_0203A11C->unk2F0->invisible = !sub_811BBF8(); - gUnknown_0203A11C->unk2F4->invisible = !sub_811BC2C(); + sUnknown_0203A11C->unk2F0->invisible = !sub_811BBF8(); + sUnknown_0203A11C->unk2F4->invisible = !sub_811BC2C(); } static void sub_811E6B0(void) { - gUnknown_0203A11C->unk2F0->invisible = 1; - gUnknown_0203A11C->unk2F4->invisible = 1; + sUnknown_0203A11C->unk2F0->invisible = 1; + sUnknown_0203A11C->unk2F4->invisible = 1; } static void sub_811E6E0(int arg0) { if (!arg0) { - gUnknown_0203A11C->unk2F0->pos1.x = 96; - gUnknown_0203A11C->unk2F4->pos1.x = 96; + sUnknown_0203A11C->unk2F0->pos1.x = 96; + sUnknown_0203A11C->unk2F4->pos1.x = 96; } else { - gUnknown_0203A11C->unk2F0->pos1.x = 120; - gUnknown_0203A11C->unk2F4->pos1.x = 120; + sUnknown_0203A11C->unk2F0->pos1.x = 120; + sUnknown_0203A11C->unk2F4->pos1.x = 120; } } @@ -4673,13 +4681,13 @@ static void sub_811E720(void) { u8 spriteId = CreateSprite(&sUnknown_08597E30, 220, 84, 1); if (spriteId != MAX_SPRITES) - gUnknown_0203A11C->unk2F8 = &gSprites[spriteId]; + sUnknown_0203A11C->unk2F8 = &gSprites[spriteId]; spriteId = CreateSprite(&sUnknown_08597E30, 220, 156, 1); if (spriteId != MAX_SPRITES) { - gUnknown_0203A11C->unk2FC = &gSprites[spriteId]; - StartSpriteAnim(gUnknown_0203A11C->unk2FC, 1); + sUnknown_0203A11C->unk2FC = &gSprites[spriteId]; + StartSpriteAnim(sUnknown_0203A11C->unk2FC, 1); } sub_811E7F8(); @@ -4687,14 +4695,14 @@ static void sub_811E720(void) static void sub_811E794(void) { - gUnknown_0203A11C->unk2F8->invisible = !sub_811BBF8(); - gUnknown_0203A11C->unk2FC->invisible = !sub_811BC2C(); + sUnknown_0203A11C->unk2F8->invisible = !sub_811BBF8(); + sUnknown_0203A11C->unk2FC->invisible = !sub_811BC2C(); } static void sub_811E7F8(void) { - gUnknown_0203A11C->unk2F8->invisible = 1; - gUnknown_0203A11C->unk2FC->invisible = 1; + sUnknown_0203A11C->unk2F8->invisible = 1; + sUnknown_0203A11C->unk2FC->invisible = 1; } static void sub_811E828(void) @@ -4702,22 +4710,22 @@ static void sub_811E828(void) int graphicsId; u8 spriteId; - switch (sub_811BCBC()) + switch (GetDisplayedPersonType()) { - case 0: + case EASY_CHAT_PERSON_REPORTER_MALE: graphicsId = EVENT_OBJ_GFX_REPORTER_M; break; - case 1: + case EASY_CHAT_PERSON_REPORTER_FEMALE: graphicsId = EVENT_OBJ_GFX_REPORTER_F; break; - case 2: + case EASY_CHAT_PERSON_BOY: graphicsId = EVENT_OBJ_GFX_BOY_1; break; default: return; } - if (sub_811BA68() != 4) + if (GetEasyChatScreenFrameId() != 4) return; spriteId = AddPseudoEventObject(graphicsId, SpriteCallbackDummy, 76, 40, 0); @@ -4741,10 +4749,10 @@ static void sub_811E828(void) } } -int sub_811E8E4(void) +int GetFooterIndex(void) { - u8 var0 = sub_811BA68(); - switch (gUnknown_08597C30[var0].unk3) + u8 frameId = GetEasyChatScreenFrameId(); + switch (sPhraseFrameDimensions[frameId].footerId) { case 1: return 1; @@ -4757,11 +4765,11 @@ int sub_811E8E4(void) } } -static int sub_811E920(int arg0) +static int GetFooterOptionXOffset(int option) { - int var0 = sub_811E8E4(); - if (var0 < 3) - return sUnknown_08597E60[var0][arg0] + 4; + int footerIndex = GetFooterIndex(); + if (footerIndex < 3) + return sFooterOptionXOffsets[footerIndex][option] + 4; else return 0; } @@ -4771,8 +4779,8 @@ static void sub_811E948(void) int i; u16 windowId; struct WindowTemplate template; - int var0 = sub_811E8E4(); - if (var0 == 3) + int footerId = GetFooterIndex(); + if (footerId == 3) return; template.bg = 3; @@ -4786,10 +4794,10 @@ static void sub_811E948(void) FillWindowPixelBuffer(windowId, 0x11); for (i = 0; i < 4; i++) { - const u8 *str = sFooterTextOptions[var0][i]; + const u8 *str = sFooterTextOptions[footerId][i]; if (str) { - int x = sUnknown_08597E60[var0][i]; + int x = sFooterOptionXOffsets[footerId][i]; sub_811D028(windowId, 1, str, x, 1, 0, NULL); } } @@ -5075,13 +5083,13 @@ void sub_811EECC(void) switch (gSpecialVar_0x8004) { case 0: - easyChatWords = gSaveBlock1Ptr->unk2BB0; + easyChatWords = gSaveBlock1Ptr->easyChatProfile; columns = 2; rows = 2; break; case 1: - easyChatWords = gSaveBlock1Ptr->unk2BBC; - if (sub_811EDC4(gSaveBlock1Ptr->unk2BBC, 3, 2, 18)) + easyChatWords = gSaveBlock1Ptr->easyChatBattleStart; + if (sub_811EDC4(gSaveBlock1Ptr->easyChatBattleStart, 3, 2, 18)) { columns = 2; rows = 3; @@ -5093,12 +5101,12 @@ void sub_811EECC(void) } break; case 2: - easyChatWords = gSaveBlock1Ptr->unk2BC8; + easyChatWords = gSaveBlock1Ptr->easyChatBattleWon; columns = 3; rows = 2; break; case 3: - easyChatWords = gSaveBlock1Ptr->unk2BD4; + easyChatWords = gSaveBlock1Ptr->easyChatBattleLost; columns = 3; rows = 2; break; @@ -5237,16 +5245,16 @@ void InitEasyChatPhrases(void) u16 i, j; for (i = 0; i < 4; i++) - gSaveBlock1Ptr->unk2BB0[i] = sUnknown_0859E62C[i]; + gSaveBlock1Ptr->easyChatProfile[i] = sDefaultProfileWords[i]; for (i = 0; i < 6; i++) - gSaveBlock1Ptr->unk2BBC[i] = sUnknown_0859E634[i]; + gSaveBlock1Ptr->easyChatBattleStart[i] = sDefaultBattleStartWords[i]; for (i = 0; i < 6; i++) - gSaveBlock1Ptr->unk2BC8[i] = sUnknown_0859E640[i]; + gSaveBlock1Ptr->easyChatBattleWon[i] = sUnknown_0859E640[i]; for (i = 0; i < 6; i++) - gSaveBlock1Ptr->unk2BD4[i] = sUnknown_0859E64C[i]; + gSaveBlock1Ptr->easyChatBattleLost[i] = sUnknown_0859E64C[i]; for (i = 0; i < MAIL_COUNT; i++) { @@ -5264,8 +5272,8 @@ void InitEasyChatPhrases(void) static bool8 sub_811F28C(void) { - gUnknown_0203A120 = Alloc(sizeof(*gUnknown_0203A120)); - if (!gUnknown_0203A120) + sUnknown_0203A120 = Alloc(sizeof(*sUnknown_0203A120)); + if (!sUnknown_0203A120) return FALSE; sub_811F2D4(); @@ -5275,46 +5283,46 @@ static bool8 sub_811F28C(void) static void sub_811F2B8(void) { - if (gUnknown_0203A120) - FREE_AND_SET_NULL(gUnknown_0203A120); + if (sUnknown_0203A120) + FREE_AND_SET_NULL(sUnknown_0203A120); } static void sub_811F2D4(void) { int i; - gUnknown_0203A120->unk0 = 0; + sUnknown_0203A120->unk0 = 0; if (GetNationalPokedexCount(FLAG_GET_SEEN)) - gUnknown_0203A120->unk2[gUnknown_0203A120->unk0++] = EC_GROUP_POKEMON; + sUnknown_0203A120->unk2[sUnknown_0203A120->unk0++] = EC_GROUP_POKEMON; for (i = EC_GROUP_TRAINER; i <= EC_GROUP_ADJECTIVES; i++) - gUnknown_0203A120->unk2[gUnknown_0203A120->unk0++] = i; + sUnknown_0203A120->unk2[sUnknown_0203A120->unk0++] = i; if (FlagGet(FLAG_SYS_GAME_CLEAR)) { - gUnknown_0203A120->unk2[gUnknown_0203A120->unk0++] = EC_GROUP_EVENTS; - gUnknown_0203A120->unk2[gUnknown_0203A120->unk0++] = EC_GROUP_MOVE_1; - gUnknown_0203A120->unk2[gUnknown_0203A120->unk0++] = EC_GROUP_MOVE_2; + 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; } if (FlagGet(FLAG_SYS_HIPSTER_MEET)) - gUnknown_0203A120->unk2[gUnknown_0203A120->unk0++] = EC_GROUP_TRENDY_SAYING; + sUnknown_0203A120->unk2[sUnknown_0203A120->unk0++] = EC_GROUP_TRENDY_SAYING; if (IsNationalPokedexEnabled()) - gUnknown_0203A120->unk2[gUnknown_0203A120->unk0++] = EC_GROUP_POKEMON_2; + sUnknown_0203A120->unk2[sUnknown_0203A120->unk0++] = EC_GROUP_POKEMON_2; } static u8 sub_811F3AC(void) { - return gUnknown_0203A120->unk0; + return sUnknown_0203A120->unk0; } static u8 sub_811F3B8(u8 index) { - if (index >= gUnknown_0203A120->unk0) + if (index >= sUnknown_0203A120->unk0) return EC_NUM_GROUPS; else - return gUnknown_0203A120->unk2[index]; + return sUnknown_0203A120->unk2[index]; } u8 *unref_sub_811F3E0(u8 *dest, u8 groupId, u16 totalChars) @@ -5362,7 +5370,7 @@ static void sub_811F46C(void) { numWords = gEasyChatWordsByLetterPointers[i].numWords; words = gEasyChatWordsByLetterPointers[i].words; - gUnknown_0203A120->unk2E[i] = 0; + sUnknown_0203A120->unk2E[i] = 0; index = 0; for (j = 0; j < numWords; j++) { @@ -5382,8 +5390,8 @@ static void sub_811F46C(void) { if (sub_811F860(words[k])) { - gUnknown_0203A120->unk64[i][index++] = words[k]; - gUnknown_0203A120->unk2E[i]++; + sUnknown_0203A120->unk64[i][index++] = words[k]; + sUnknown_0203A120->unk2E[i]++; break; } } @@ -5396,22 +5404,22 @@ static void sub_811F46C(void) static void sub_811F548(int arg0, u16 groupId) { if (!arg0) - gUnknown_0203A120->unk3BA0 = sub_811F5C4(groupId); + sUnknown_0203A120->unk3BA0 = sub_811F5C4(groupId); else - gUnknown_0203A120->unk3BA0 = sub_811F6B8(groupId); + sUnknown_0203A120->unk3BA0 = sub_811F6B8(groupId); } static u16 sub_811F578(u16 arg0) { - if (arg0 >= gUnknown_0203A120->unk3BA0) + if (arg0 >= sUnknown_0203A120->unk3BA0) return 0xFFFF; else - return gUnknown_0203A120->unk3984[arg0]; + return sUnknown_0203A120->unk3984[arg0]; } static u16 sub_811F5B0(void) { - return gUnknown_0203A120->unk3BA0; + return sUnknown_0203A120->unk3BA0; } static u16 sub_811F5C4(u16 groupId) @@ -5429,7 +5437,7 @@ static u16 sub_811F5C4(u16 groupId) for (i = 0, totalWords = 0; i < numWords; i++) { if (sub_811F764(list[i], groupId)) - gUnknown_0203A120->unk3984[totalWords++] = EC_WORD(groupId, list[i]); + sUnknown_0203A120->unk3984[totalWords++] = EC_WORD(groupId, list[i]); } return totalWords; @@ -5441,7 +5449,7 @@ static u16 sub_811F5C4(u16 groupId) { u16 alphabeticalOrder = wordInfo[i].alphabeticalOrder; if (sub_811F764(alphabeticalOrder, groupId)) - gUnknown_0203A120->unk3984[totalWords++] = EC_WORD(groupId, alphabeticalOrder); + sUnknown_0203A120->unk3984[totalWords++] = EC_WORD(groupId, alphabeticalOrder); } return totalWords; @@ -5453,8 +5461,8 @@ static u16 sub_811F6B8(u16 alphabeticalGroup) u16 i; u16 totalWords; - for (i = 0, totalWords = 0; i < gUnknown_0203A120->unk2E[alphabeticalGroup]; i++) - gUnknown_0203A120->unk3984[totalWords++] = gUnknown_0203A120->unk64[alphabeticalGroup][i]; + for (i = 0, totalWords = 0; i < sUnknown_0203A120->unk2E[alphabeticalGroup]; i++) + sUnknown_0203A120->unk3984[totalWords++] = sUnknown_0203A120->unk64[alphabeticalGroup][i]; return totalWords; } @@ -5462,9 +5470,9 @@ static u16 sub_811F6B8(u16 alphabeticalGroup) static bool8 sub_811F72C(u8 arg0) { int i; - for (i = 0; i < gUnknown_0203A120->unk0; i++) + for (i = 0; i < sUnknown_0203A120->unk0; i++) { - if (gUnknown_0203A120->unk2[i] == arg0) + if (sUnknown_0203A120->unk2[i] == arg0) return TRUE; } diff --git a/src/lilycove_lady.c b/src/lilycove_lady.c index 3d4f8a90d..dc38d8848 100644 --- a/src/lilycove_lady.c +++ b/src/lilycove_lady.c @@ -695,7 +695,7 @@ u8 sub_818E2D8(void) void sub_818E2FC(void) { - easy_chat_input_maybe(); + ShowEasyChatScreen(); } bool8 sub_818E308(void) @@ -763,8 +763,8 @@ void sub_818E430(void) void sub_818E47C(void) { - gSpecialVar_0x8004 = 0x11; - easy_chat_input_maybe(); + gSpecialVar_0x8004 = EASY_CHAT_TYPE_QUIZ_SET_QUESTION; + ShowEasyChatScreen(); } void sub_818E490(void) diff --git a/src/party_menu.c b/src/party_menu.c index 645390aff..4103c212c 100755 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -63,6 +63,7 @@ #include "window.h" #include "constants/battle.h" #include "constants/battle_frontier.h" +#include "constants/easy_chat.h" #include "constants/field_effects.h" #include "constants/flags.h" #include "constants/items.h" @@ -4211,7 +4212,11 @@ static void sub_81B452C(void) { u8 mail = GetMonData(&gPlayerParty[gUnknown_0203CEC8.unk9], MON_DATA_MAIL); - sub_811A20C(4, gSaveBlock1Ptr->mail[mail].words, sub_81B4578, 3); + DoEasyChatScreen( + EASY_CHAT_TYPE_MAIL, + gSaveBlock1Ptr->mail[mail].words, + sub_81B4578, + EASY_CHAT_PERSON_DISPLAY_NONE); } static void sub_81B4578(void) @@ -6385,7 +6390,11 @@ static void sub_81B814C(void) sub_81B1DB8(&gPlayerParty[gUnknown_0203CEC8.unk9], gUnknown_0203CEC8.unkC); mail = GetMonData(&gPlayerParty[gUnknown_0203CEC8.unk9], MON_DATA_MAIL); - sub_811A20C(4, gSaveBlock1Ptr->mail[mail].words, sub_81B81A8, 3); + DoEasyChatScreen( + EASY_CHAT_TYPE_MAIL, + gSaveBlock1Ptr->mail[mail].words, + sub_81B81A8, + EASY_CHAT_PERSON_DISPLAY_NONE); } static void sub_81B81A8(void) diff --git a/src/trainer_card.c b/src/trainer_card.c index 49a62284f..4019ef0bd 100755 --- a/src/trainer_card.c +++ b/src/trainer_card.c @@ -695,7 +695,7 @@ static void SetPlayerCardData(struct TrainerCard *trainerCard, u8 cardType) trainerCard->money = GetMoney(&gSaveBlock1Ptr->money); for (i = 0; i < 4; i++) - trainerCard->var_28[i] = gSaveBlock1Ptr->unk2BB0[i]; + trainerCard->var_28[i] = gSaveBlock1Ptr->easyChatProfile[i]; StringCopy(trainerCard->playerName, gSaveBlock2Ptr->playerName); diff --git a/src/tv.c b/src/tv.c index 248721083..f282b09f0 100644 --- a/src/tv.c +++ b/src/tv.c @@ -2448,8 +2448,8 @@ void sub_80EE72C(void) show->trainerFanClub.kind = TVSHOW_TRAINER_FAN_CLUB; show->trainerFanClub.active = FALSE; StringCopy(show->trainerFanClub.playerName, gSaveBlock2Ptr->playerName); - show->trainerFanClub.words[0] = gSaveBlock1Ptr->unk2BB0[0]; - show->trainerFanClub.words[1] = gSaveBlock1Ptr->unk2BB0[1]; + show->trainerFanClub.words[0] = gSaveBlock1Ptr->easyChatProfile[0]; + show->trainerFanClub.words[1] = gSaveBlock1Ptr->easyChatProfile[1]; tv_store_id_3x(show); show->trainerFanClub.language = gGameLanguage; }