diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/constants/easy_chat.h | 61 | ||||
-rw-r--r-- | include/constants/global.h | 1 | ||||
-rw-r--r-- | include/dewford_trend.h | 2 | ||||
-rw-r--r-- | include/easy_chat.h | 102 | ||||
-rw-r--r-- | include/global.h | 2 | ||||
-rw-r--r-- | include/graphics.h | 8 | ||||
-rwxr-xr-x | include/mevent.h | 4 |
7 files changed, 95 insertions, 85 deletions
diff --git a/include/constants/easy_chat.h b/include/constants/easy_chat.h index 8e82cfef0..069f17fcb 100644 --- a/include/constants/easy_chat.h +++ b/include/constants/easy_chat.h @@ -28,29 +28,29 @@ #define EASY_CHAT_PERSON_BOY 2 #define EASY_CHAT_PERSON_DISPLAY_NONE 3 -#define EC_GROUP_POKEMON 0x0 -#define EC_GROUP_TRAINER 0x1 -#define EC_GROUP_STATUS 0x2 -#define EC_GROUP_BATTLE 0x3 -#define EC_GROUP_GREETINGS 0x4 -#define EC_GROUP_PEOPLE 0x5 -#define EC_GROUP_VOICES 0x6 -#define EC_GROUP_SPEECH 0x7 -#define EC_GROUP_ENDINGS 0x8 -#define EC_GROUP_FEELINGS 0x9 -#define EC_GROUP_CONDITIONS 0xa -#define EC_GROUP_ACTIONS 0xb -#define EC_GROUP_LIFESTYLE 0xc -#define EC_GROUP_HOBBIES 0xd -#define EC_GROUP_TIME 0xe -#define EC_GROUP_MISC 0xf -#define EC_GROUP_ADJECTIVES 0x10 -#define EC_GROUP_EVENTS 0x11 -#define EC_GROUP_MOVE_1 0x12 -#define EC_GROUP_MOVE_2 0x13 -#define EC_GROUP_TRENDY_SAYING 0x14 -#define EC_GROUP_POKEMON_2 0x15 -#define EC_NUM_GROUPS 0x16 +#define EC_GROUP_POKEMON 0 +#define EC_GROUP_TRAINER 1 +#define EC_GROUP_STATUS 2 +#define EC_GROUP_BATTLE 3 +#define EC_GROUP_GREETINGS 4 +#define EC_GROUP_PEOPLE 5 +#define EC_GROUP_VOICES 6 +#define EC_GROUP_SPEECH 7 +#define EC_GROUP_ENDINGS 8 +#define EC_GROUP_FEELINGS 9 +#define EC_GROUP_CONDITIONS 10 +#define EC_GROUP_ACTIONS 11 +#define EC_GROUP_LIFESTYLE 12 +#define EC_GROUP_HOBBIES 13 +#define EC_GROUP_TIME 14 +#define EC_GROUP_MISC 15 +#define EC_GROUP_ADJECTIVES 16 +#define EC_GROUP_EVENTS 17 +#define EC_GROUP_MOVE_1 18 +#define EC_GROUP_MOVE_2 19 +#define EC_GROUP_TRENDY_SAYING 20 +#define EC_GROUP_POKEMON_NATIONAL 21 +#define EC_NUM_GROUPS 22 // TRAINER #define EC_WORD_I_CHOOSE_YOU (EC_GROUP_TRAINER << 9) | 0x0 @@ -1105,13 +1105,22 @@ #define PHRASE_COOL_LATIOS 4 #define PHRASE_SUPER_HUSTLE 5 +#define EC_NUM_ALPHABET_GROUPS 27 // 26 (1 for each letter) + 1 (Others) + +#define EC_MAX_WORDS_IN_GROUP 270 // The closest is words by letter S, at 262 + +#define EC_MASK_GROUP 0x7F +#define EC_MASK_INDEX 0x1FF + #define EC_POKEMON(mon) ((EC_GROUP_POKEMON << 9) | SPECIES_##mon) -#define EC_POKEMON2(mon) ((EC_GROUP_POKEMON_2 << 9) | SPECIES_##mon) +#define EC_POKEMON_NATIONAL(mon) ((EC_GROUP_POKEMON_NATIONAL << 9) | SPECIES_##mon) #define EC_MOVE(move) ((EC_GROUP_MOVE_1 << 9) | MOVE_##move) #define EC_MOVE2(move) ((EC_GROUP_MOVE_2 << 9) | MOVE_##move) #define EC_GROUP(word) ((word) >> 9) -#define EC_INDEX(word) ((word) & 0x1FF) -#define EC_WORD(group, index) ((((group) & 0x7F) << 9) | ((index) & 0x1FF)) +#define EC_INDEX(word) ((word) & EC_MASK_INDEX) +#define EC_WORD(group, index) ((((group) & EC_MASK_GROUP) << 9) | ((index) & EC_MASK_INDEX)) + +#define EC_EMPTY_WORD 0xFFFF #endif // GUARD_CONSTANTS_EASY_CHAT_H diff --git a/include/constants/global.h b/include/constants/global.h index d8dad0f45..213ccca5b 100644 --- a/include/constants/global.h +++ b/include/constants/global.h @@ -84,6 +84,7 @@ #define MAIL_WORDS_COUNT 9 #define EASY_CHAT_BATTLE_WORDS_COUNT 6 #define MOVE_NAME_LENGTH 12 +#define NUM_QUESTIONNAIRE_WORDS 4 #define MALE 0 #define FEMALE 1 diff --git a/include/dewford_trend.h b/include/dewford_trend.h index bdb0fc95c..a7ed006f0 100644 --- a/include/dewford_trend.h +++ b/include/dewford_trend.h @@ -4,7 +4,7 @@ void InitDewfordTrend(void); void UpdateDewfordTrendPerDay(u16); void UpdateDewfordTrendPerDay(u16 days); -bool8 sub_81226D8(u16 *a); +bool8 IsPhraseTrendy(u16 *a); void ReceiveEasyChatPairsData(struct EasyChatPair *a, size_t b, u8 unused); diff --git a/include/easy_chat.h b/include/easy_chat.h index 2fa7f7b3e..4d2bc7c98 100644 --- a/include/easy_chat.h +++ b/include/easy_chat.h @@ -24,55 +24,55 @@ struct EasyChatScreen /*0x01*/ u8 templateId; /*0x02*/ u8 numColumns; /*0x03*/ u8 numRows; - /*0x04*/ u8 state; + /*0x04*/ u8 inputState; /*0x05*/ s8 mainCursorColumn; /*0x06*/ s8 mainCursorRow; - /*0x07*/ u8 unk_07; - /*0x08*/ u8 stateBackup; - /*0x09*/ u8 unk_09; - /*0x0A*/ s8 unk_0a; - /*0x0B*/ s8 unk_0b; - /*0x0C*/ u8 unk_0c; - /*0x0D*/ u8 unk_0d; - /*0x0E*/ u8 unk_0e; - /*0x0F*/ u8 unk_0f; - /*0x10*/ s8 unk_10; - /*0x11*/ s8 unk_11; + /*0x07*/ u8 maxWords; + /*0x08*/ u8 inputStateBackup; + /*0x09*/ bool8 inAlphabetMode; + /*0x0A*/ s8 keyboardColumn; + /*0x0B*/ s8 keyboardRow; + /*0x0C*/ u8 keyboardScrollOffset; + /*0x0D*/ u8 keyboardLastRow; + /*0x0E*/ u8 wordSelectScrollOffset; + /*0x0F*/ u8 wordSelectLastRow; + /*0x10*/ s8 wordSelectColumn; + /*0x11*/ s8 wordSelectRow; /*0x12*/ u8 displayedPersonType; - /*0x13*/ u8 unk_13; - /*0x14*/ u8 unk_14[0x20]; + /*0x13*/ u8 unused; // Set to 0, never read + /*0x14*/ u8 quizTitle[32]; /*0x34*/ const u8 *titleText; - /*0x38*/ u16 *words; - /*0x3C*/ u16 ecWordBuffer[9]; + /*0x38*/ u16 *savedPhrase; + /*0x3C*/ u16 currentPhrase[9]; }; -struct Unk203A11C +struct EasyChatScreenControl { - u16 unk0; + u16 funcState; u16 windowId; - u16 unk4; - u8 unk6; - u8 unk7; - s8 unk8; - u8 unk9; - u8 unkA; - u8 unkB[0xC1]; - u8 unkCC[0x202]; - u16 unk2CE; - int unk2D0; - int unk2D4; - struct Sprite *unk2D8; - struct Sprite *unk2DC; - struct Sprite *unk2E0; - struct Sprite *unk2E4; - struct Sprite *unk2E8; - struct Sprite *unk2EC; - struct Sprite *unk2F0; - struct Sprite *unk2F4; - struct Sprite *unk2F8; - struct Sprite *unk2FC; - u16 unk300[BG_SCREEN_SIZE / 2]; - u16 unkB00[BG_SCREEN_SIZE / 2]; + u16 currentFuncId; + u8 curWindowAnimState; + u8 destWindowAnimState; + s8 windowAnimStateDir; + u8 modeWindowState; + bool8 fourFooterOptions; // Never read (template is used directly instead) + u8 phrasePrintBuffer[193]; + u8 wordSelectPrintBuffer[514]; + u16 scrollOffset; + int scrollDest; + int scrollSpeed; + struct Sprite *mainCursorSprite; + struct Sprite *rectangleCursorSpriteRight; + struct Sprite *rectangleCursorSpriteLeft; + struct Sprite *wordSelectCursorSprite; + struct Sprite *buttonWindowSprite; + struct Sprite *modeWindowSprite; + struct Sprite *scrollIndicatorUpSprite; + struct Sprite *scrollIndicatorDownSprite; + struct Sprite *startButtonSprite; + struct Sprite *selectButtonSprite; + u16 bg1TilemapBuffer[BG_SCREEN_SIZE / 2]; + u16 bg3TilemapBuffer[BG_SCREEN_SIZE / 2]; }; struct EasyChatPhraseFrameDimensions @@ -104,15 +104,15 @@ struct EasyChatGroup u16 numEnabledWords; }; -struct Unk203A120 +struct EasyChatScreenWordData { - u16 unk0; - u16 unk2[EC_NUM_GROUPS]; - u16 unk2E[27]; - u16 unk64[27][270]; - u8 filler3958[0x2C]; - u16 unk3984[0x10E]; - u16 unk3BA0; + u16 numUnlockedGroups; + u16 unlockedGroupIds[EC_NUM_GROUPS]; + u16 numUnlockedAlphabetWords[EC_NUM_ALPHABET_GROUPS]; + u16 unlockedAlphabetWords[EC_NUM_ALPHABET_GROUPS][EC_MAX_WORDS_IN_GROUP]; + u8 unused[44]; + u16 selectedGroupWords[EC_MAX_WORDS_IN_GROUP]; + u16 numSelectedGroupWords; }; /*size = 0x3BA4*/ struct EasyChatWordsByLetter @@ -124,7 +124,7 @@ struct EasyChatWordsByLetter void InitEasyChatPhrases(void); void ShowEasyChatScreen(void); u8 * CopyEasyChatWord(u8 *dest, u16 word); -bool32 sub_811F8D8(int word); +bool32 IsEasyChatAnswerUnlocked(int word); void InitializeEasyChatWordArray(u16 *words, u16 length); u8 *ConvertEasyChatWordsToString(u8 *dest, const u16 *src, u16 columns, u16 rows); bool8 IsBardWordInvalid(u16 word); @@ -133,7 +133,7 @@ u16 GetNewHipsterPhraseToTeach(void); u16 EasyChat_GetNumWordsInGroup(u8); u16 GetRandomEasyChatWordFromUnlockedGroup(u16); void DoEasyChatScreen(u8 type, u16 *words, MainCallback callback, u8 displayedPersonType); -void sub_811F8BC(void); +void InitQuestionnaireWords(void); void UnlockAdditionalPhrase(u8 additionalPhraseId); #endif // GUARD_EASYCHAT_H diff --git a/include/global.h b/include/global.h index 44df26a9b..3d3ea0229 100644 --- a/include/global.h +++ b/include/global.h @@ -893,7 +893,7 @@ struct MysteryEventStruct /*0x000 0x322C*/ struct WonderNewsSaveStruct wonderNews; /*0x1c0 0x33EC*/ struct WonderCardSaveStruct wonderCard; /*0x310 0x353C*/ struct MEventBuffer_3430 buffer_310; - /*0x338 0x3564*/ u16 unk_338[4]; + /*0x338 0x3564*/ u16 questionnaireWords[NUM_QUESTIONNAIRE_WORDS]; /*0x340 0x356C*/ struct MysteryEventStruct unk_340; /*0x344 0x3570*/ u32 unk_344[2][5]; }; // 0x36C 0x3598 diff --git a/include/graphics.h b/include/graphics.h index a78498d16..c0bd13e5b 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -4977,10 +4977,10 @@ extern const u32 gEasyChatWindow_Gfx[]; extern const u32 gEasyChatWindow_Tilemap[]; extern const u32 gEasyChatMode_Gfx[]; extern const u16 gEasyChatMode_Pal[]; -extern const u32 gEasyChatCursor_Gfx[]; -extern const u16 gEasyChatCursor_Pal[]; -extern const u32 gEasyChatRightWindow_Gfx[]; -extern const u16 gEasyChatRightWindow_Pal[]; +extern const u32 gEasyChatRectangleCursor_Gfx[]; +extern const u16 gEasyChatRectangleCursor_Pal[]; +extern const u32 gEasyChatButtonWindow_Gfx[]; +extern const u16 gEasyChatButtonWindow_Pal[]; // Use Pokeblock extern const u32 gUsePokeblockCondition_Gfx[]; diff --git a/include/mevent.h b/include/mevent.h index 8c0ebbad7..4b7d39b0c 100755 --- a/include/mevent.h +++ b/include/mevent.h @@ -21,7 +21,7 @@ struct MEventStruct_Unk1442CC u16 unk_0C; u32 unk_10; u16 unk_14; - u16 unk_16[4]; + u16 unk_16[NUM_QUESTIONNAIRE_WORDS]; struct MEventBuffer_3430_Sub unk_20; u8 unk_44; u8 unk_45[7]; @@ -36,7 +36,7 @@ struct WonderNews *GetSavedWonderNews(void); struct WonderCard *GetSavedWonderCard(void); struct MEventBuffer_3430_Sub *sav1_get_mevent_buffer_2(void); struct MysteryEventStruct *sub_801B044(void); -u16 *sub_801B058(void); +u16 *GetQuestionnaireWordsPtr(void); void DestroyWonderNews(void); bool32 sub_801B078(const struct WonderNews *src); bool32 ValidateReceivedWonderNews(void); |