Document easy_chat
This commit is contained in:
+1
-1
@@ -1863,7 +1863,7 @@ sub_80E678C: @ 80E678C
|
||||
movs r1, 0x3
|
||||
movs r2, 0x2
|
||||
movs r3, 0x12
|
||||
bl sub_80BD974
|
||||
bl EC_DoesEasyChatStringFitOnLine
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _080E67E4
|
||||
|
||||
+12
-12
@@ -3443,7 +3443,7 @@ _080FEDC0:
|
||||
bl ResetPaletteFade
|
||||
b _080FEE16
|
||||
_080FEDD4:
|
||||
bl sub_80BDE44
|
||||
bl InitEasyChatSelection
|
||||
b _080FEDF2
|
||||
_080FEDDA:
|
||||
ldrb r4, [r6, 0x2]
|
||||
@@ -3490,7 +3490,7 @@ _080FEE1E:
|
||||
sub_80FEE24: @ 80FEE24
|
||||
push {r4,lr}
|
||||
adds r4, r0, 0
|
||||
bl sub_80BDE70
|
||||
bl DestroyEasyChatSelectionData
|
||||
bl sub_80FF010
|
||||
bl sub_810011C
|
||||
bl FreeAllWindowBuffers
|
||||
@@ -3701,7 +3701,7 @@ _080FEFE0:
|
||||
ldrb r2, [r0, 0x7]
|
||||
adds r0, r6, 0
|
||||
bl CpuSet
|
||||
bl sub_80BDF38
|
||||
bl GetNumDisplayableGroups
|
||||
ldr r2, [r4]
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
@@ -4565,12 +4565,12 @@ sub_80FF5FC: @ 80FF5FC
|
||||
bl sub_80FFB8C
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
bl sub_80BDF44
|
||||
bl GetSelectedGroupByIndex
|
||||
adds r1, r0, 0
|
||||
lsls r1, 24
|
||||
lsrs r1, 24
|
||||
movs r0, 0
|
||||
bl sub_80BE16C
|
||||
bl GetUnlockedECWords
|
||||
b _080FF638
|
||||
.align 2, 0
|
||||
_080FF624: .4byte gUnknown_203ACE8
|
||||
@@ -4580,9 +4580,9 @@ _080FF628:
|
||||
lsls r1, 16
|
||||
lsrs r1, 16
|
||||
movs r0, 0x1
|
||||
bl sub_80BE16C
|
||||
bl GetUnlockedECWords
|
||||
_080FF638:
|
||||
bl sub_80BE1D4
|
||||
bl GetNumDisplayedWords
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
cmp r0, 0
|
||||
@@ -4673,7 +4673,7 @@ sub_80FF6C8: @ 80FF6C8
|
||||
bl sub_80FFBE4
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
bl sub_80BE19C
|
||||
bl GetDisplayedWordByIndex
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
bl sub_80FF768
|
||||
@@ -5506,7 +5506,7 @@ sub_80FFC6C: @ 80FFC6C
|
||||
bne _080FFC9C
|
||||
bl sub_80FFB8C
|
||||
adds r4, r0, 0
|
||||
bl sub_80BDF38
|
||||
bl GetNumDisplayableGroups
|
||||
movs r1, 0
|
||||
lsls r0, 24
|
||||
lsls r4, 16
|
||||
@@ -5546,7 +5546,7 @@ sub_80FFCC0: @ 80FFCC0
|
||||
push {r4,lr}
|
||||
bl sub_80FFBE4
|
||||
adds r4, r0, 0
|
||||
bl sub_80BE1D4
|
||||
bl GetNumDisplayedWords
|
||||
movs r1, 0
|
||||
lsls r4, 16
|
||||
lsls r0, 16
|
||||
@@ -8492,7 +8492,7 @@ _0810134A:
|
||||
lsls r0, r5, 24
|
||||
lsrs r0, 24
|
||||
adds r5, 0x1
|
||||
bl sub_80BDF44
|
||||
bl GetSelectedGroupByIndex
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
cmp r0, 0x16
|
||||
@@ -8708,7 +8708,7 @@ _081014E6:
|
||||
lsls r0, r4, 16
|
||||
lsrs r0, 16
|
||||
adds r4, 0x1
|
||||
bl sub_80BE19C
|
||||
bl GetDisplayedWordByIndex
|
||||
lsls r0, 16
|
||||
lsrs r1, r0, 16
|
||||
ldr r0, _08101554 @ =0x0000ffff
|
||||
|
||||
@@ -11329,7 +11329,7 @@ EventScript_1BEE9E:: @ 81BEE9E
|
||||
EventScript_1BEEA8:: @ 81BEEA8
|
||||
setvar VAR_0x4001, 1
|
||||
setvar VAR_0x8004, 0
|
||||
special sub_80BDA7C
|
||||
special Special_BufferEasyChatMessage
|
||||
waitmessage
|
||||
delay 80
|
||||
msgbox gUnknown_81BF28E
|
||||
@@ -11376,7 +11376,7 @@ EventScript_1BEF35:: @ 81BEF35
|
||||
EventScript_1BEF3F:: @ 81BEF3F
|
||||
setvar VAR_0x4001, 1
|
||||
setvar VAR_0x8004, 0
|
||||
special sub_80BDA7C
|
||||
special Special_BufferEasyChatMessage
|
||||
waitmessage
|
||||
delay 80
|
||||
msgbox gUnknown_81BF30D
|
||||
|
||||
+1
-1
@@ -104,7 +104,7 @@ gSpecials:: @ 815FD60
|
||||
def_special Field_AskSaveTheGame
|
||||
def_special nullsub_56
|
||||
def_special sub_80FEE44
|
||||
def_special sub_80BDA7C
|
||||
def_special Special_BufferEasyChatMessage
|
||||
def_special nullsub_75
|
||||
def_special nullsub_75
|
||||
def_special nullsub_75
|
||||
|
||||
@@ -1076,4 +1076,6 @@
|
||||
#define EC_INDEX(word) ((word) & 0x1FF)
|
||||
#define EC_WORD(groupId, index) ((((groupId) & 0x7F) << 9) | ((index) & 0x1FF))
|
||||
|
||||
#define EC_WORD_UNDEFINED (0xFFFF)
|
||||
|
||||
#endif // GUARD_CONSTANTS_EASY_CHAT_H
|
||||
|
||||
+8
-7
@@ -33,15 +33,16 @@ struct EasyChatWordsByLetter
|
||||
void InitEasyChatPhrases(void);
|
||||
u8 *CopyEasyChatWord(u8 *dest, u16 word);
|
||||
u8 *ConvertEasyChatWordsToString(u8 *dest, const u16 *src, u16 length1, u16 length2);
|
||||
void sub_80BDE28(void);
|
||||
bool8 EC_DoesEasyChatStringFitOnLine(const u16 *easyChatWords, u8 columns, u8 rows, u16 maxLength);
|
||||
void ResetSomeMEventECBuffer_3120_338(void);
|
||||
void InitEasyChatPhrases(void);
|
||||
void EnableRareWord(u8);
|
||||
bool8 sub_80BDE44(void);
|
||||
void sub_80BDE70(void);
|
||||
u8 sub_80BDF44(u8);
|
||||
void sub_80BE16C(int, u16);
|
||||
u16 sub_80BE1D4(void);
|
||||
u16 sub_80BE19C(u16);
|
||||
bool8 InitEasyChatSelection(void);
|
||||
void DestroyEasyChatSelectionData(void);
|
||||
u8 GetSelectedGroupByIndex(u8);
|
||||
void GetUnlockedECWords(bool32 isAlphabetical, u16 groupId);
|
||||
u16 GetDisplayedWordByIndex(u16 index);
|
||||
u16 GetNumDisplayedWords(void);
|
||||
const u8 *GetEasyChatWordGroupName(u8);
|
||||
u8 *CopyEasyChatWordPadded(u8 *, u16, u16);
|
||||
|
||||
|
||||
+107
-107
@@ -32,26 +32,26 @@
|
||||
|
||||
struct Unk203A120
|
||||
{
|
||||
u16 unk0;
|
||||
u16 unk2[EC_NUM_GROUPS];
|
||||
u16 unk2E[27];
|
||||
u16 unk64[27][270];
|
||||
u16 numGroups;
|
||||
u16 groups[EC_NUM_GROUPS];
|
||||
u16 alphabeticalGroups[27];
|
||||
u16 alphabeticalWordsByGroup[27][270];
|
||||
u8 filler3958[0x2C];
|
||||
u16 unk3984[0x10E];
|
||||
u16 unk3BA0;
|
||||
u16 allWords[270];
|
||||
u16 totalWords;
|
||||
}; /*size = 0x3BA4*/
|
||||
|
||||
static EWRAM_DATA struct Unk203A120 * gUnknown_20399BC = NULL;
|
||||
static EWRAM_DATA struct Unk203A120 * sEasyChatSelectionData = NULL;
|
||||
|
||||
static bool8 sub_80BDCA8(void);
|
||||
static bool8 EC_IsNationalPokedexEnabled(void);
|
||||
static u16 GetRandomECPokemon(void);
|
||||
static void sub_80BDE88(void);
|
||||
static void sub_80BDFF8(void);
|
||||
static u16 sub_80BE1E8(u16);
|
||||
static u16 sub_80BE2F8(u16);
|
||||
static bool8 sub_80BE3A4(u16, u8);
|
||||
static int sub_80BE418(u16 species);
|
||||
static u8 sub_80BE440(u16 word);
|
||||
static void PopulateECGroups(void);
|
||||
static void PopulateAlphabeticalGroups(void);
|
||||
static u16 GetUnlockedWordsInECGroup(u16);
|
||||
static u16 GetUnlockedWordsInAlphabeticalGroup(u16);
|
||||
static bool8 UnlockedECMonOrMove(u16, u8);
|
||||
static int EC_IsDeoxys(u16 species);
|
||||
static u8 IsWordUnlocked(u16 word);
|
||||
|
||||
#include "data/easy_chat/easy_chat_groups.h"
|
||||
#include "data/easy_chat/easy_chat_words_by_letter.h"
|
||||
@@ -97,11 +97,11 @@ static const u16 sDefaultBattleStartWords[] = {
|
||||
EC_WORD_EXCL,
|
||||
};
|
||||
|
||||
static const u16 gUnknown_83EE004[] = {
|
||||
static const u16 sDeoxysValue[] = {
|
||||
SPECIES_DEOXYS,
|
||||
};
|
||||
|
||||
static bool8 sub_80BD718(u8 groupId)
|
||||
static bool8 IsECGroupUnlocked(u8 groupId)
|
||||
{
|
||||
switch (groupId)
|
||||
{
|
||||
@@ -112,7 +112,7 @@ static bool8 sub_80BD718(u8 groupId)
|
||||
case EC_GROUP_MOVE_2:
|
||||
return FlagGet(FLAG_SYS_GAME_CLEAR);
|
||||
case EC_GROUP_POKEMON:
|
||||
return sub_80BDCA8();
|
||||
return EC_IsNationalPokedexEnabled();
|
||||
default:
|
||||
return TRUE;
|
||||
}
|
||||
@@ -123,20 +123,20 @@ static u16 EasyChat_GetNumWordsInGroup(u8 groupId)
|
||||
if (groupId == EC_GROUP_POKEMON)
|
||||
return GetNationalPokedexCount(FLAG_GET_SEEN);
|
||||
|
||||
if (sub_80BD718(groupId))
|
||||
if (IsECGroupUnlocked(groupId))
|
||||
return gEasyChatGroups[groupId].numEnabledWords;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static bool8 sub_80BD78C(u16 easyChatWord)
|
||||
static bool8 IsECWordInvalid(u16 easyChatWord)
|
||||
{
|
||||
u16 i;
|
||||
u8 groupId;
|
||||
u32 index;
|
||||
u16 numWords;
|
||||
const u16 *list;
|
||||
if (easyChatWord == 0xFFFF)
|
||||
if (easyChatWord == EC_WORD_UNDEFINED)
|
||||
return FALSE;
|
||||
|
||||
groupId = EC_GROUP(easyChatWord);
|
||||
@@ -184,11 +184,11 @@ static const u8 *GetEasyChatWord(u8 groupId, u16 index)
|
||||
u8 *CopyEasyChatWord(u8 *dest, u16 easyChatWord)
|
||||
{
|
||||
u8 *resultStr;
|
||||
if (sub_80BD78C(easyChatWord))
|
||||
if (IsECWordInvalid(easyChatWord))
|
||||
{
|
||||
resultStr = StringCopy(dest, gText_ThreeQuestionMarks);
|
||||
}
|
||||
else if (easyChatWord != 0xFFFF)
|
||||
else if (easyChatWord != EC_WORD_UNDEFINED)
|
||||
{
|
||||
u16 index = EC_INDEX(easyChatWord);
|
||||
u8 groupId = EC_GROUP(easyChatWord);
|
||||
@@ -213,7 +213,7 @@ u8 *ConvertEasyChatWordsToString(u8 *dest, const u16 *src, u16 columns, u16 rows
|
||||
for (j = 0; j < numColumns; j++)
|
||||
{
|
||||
dest = CopyEasyChatWord(dest, *src);
|
||||
if (*src != 0xFFFF)
|
||||
if (*src != EC_WORD_UNDEFINED)
|
||||
{
|
||||
*dest = CHAR_SPACE;
|
||||
dest++;
|
||||
@@ -234,10 +234,10 @@ u8 *ConvertEasyChatWordsToString(u8 *dest, const u16 *src, u16 columns, u16 rows
|
||||
|
||||
static u16 GetEasyChatWordStringLength(u16 easyChatWord)
|
||||
{
|
||||
if (easyChatWord == 0xFFFF)
|
||||
if (easyChatWord == EC_WORD_UNDEFINED)
|
||||
return 0;
|
||||
|
||||
if (sub_80BD78C(easyChatWord))
|
||||
if (IsECWordInvalid(easyChatWord))
|
||||
{
|
||||
return StringLength(gText_ThreeQuestionMarks);
|
||||
}
|
||||
@@ -249,24 +249,24 @@ static u16 GetEasyChatWordStringLength(u16 easyChatWord)
|
||||
}
|
||||
}
|
||||
|
||||
bool8 sub_80BD974(const u16 *easyChatWords, u8 arg1, u8 arg2, u16 arg3)
|
||||
bool8 EC_DoesEasyChatStringFitOnLine(const u16 *easyChatWords, u8 columns, u8 rows, u16 maxLength)
|
||||
{
|
||||
u8 i, j;
|
||||
|
||||
for (i = 0; i < arg2; i++)
|
||||
for (i = 0; i < rows; i++)
|
||||
{
|
||||
u16 totalLength = arg1 - 1;
|
||||
for (j = 0; j < arg1; j++)
|
||||
u16 totalLength = columns - 1;
|
||||
for (j = 0; j < columns; j++)
|
||||
totalLength += GetEasyChatWordStringLength(*(easyChatWords++));
|
||||
|
||||
if (totalLength > arg3)
|
||||
if (totalLength > maxLength)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static u16 sub_80BD9E8(u16 groupId)
|
||||
static u16 GetRandomWordFromGroup(u16 groupId)
|
||||
{
|
||||
u16 index = Random() % gEasyChatGroups[groupId].numWords;
|
||||
if (groupId == EC_GROUP_POKEMON_2
|
||||
@@ -280,18 +280,18 @@ static u16 sub_80BD9E8(u16 groupId)
|
||||
return EC_WORD(groupId, index);
|
||||
}
|
||||
|
||||
static u16 sub_80BDA40(u16 groupId)
|
||||
static u16 GetRandomWordFromAnyGroup(u16 groupId)
|
||||
{
|
||||
if (!sub_80BD718(groupId))
|
||||
return 0xFFFF;
|
||||
if (!IsECGroupUnlocked(groupId))
|
||||
return EC_WORD_UNDEFINED;
|
||||
|
||||
if (groupId == EC_GROUP_POKEMON)
|
||||
return GetRandomECPokemon();
|
||||
|
||||
return sub_80BD9E8(groupId);
|
||||
return GetRandomWordFromGroup(groupId);
|
||||
}
|
||||
|
||||
void sub_80BDA7C(void)
|
||||
void Special_BufferEasyChatMessage(void)
|
||||
{
|
||||
u16 *easyChatWords;
|
||||
int columns, rows;
|
||||
@@ -304,7 +304,7 @@ void sub_80BDA7C(void)
|
||||
break;
|
||||
case 1:
|
||||
easyChatWords = gSaveBlock1Ptr->easyChatBattleStart;
|
||||
if (sub_80BD974(gSaveBlock1Ptr->easyChatBattleStart, 3, 2, 18))
|
||||
if (EC_DoesEasyChatStringFitOnLine(gSaveBlock1Ptr->easyChatBattleStart, 3, 2, 18))
|
||||
{
|
||||
columns = 2;
|
||||
rows = 3;
|
||||
@@ -336,7 +336,7 @@ void sub_80BDA7C(void)
|
||||
void BufferRandomHobbyOrLifestyleString(void)
|
||||
{
|
||||
int groupId = Random() & 1 ? EC_GROUP_HOBBIES : EC_GROUP_LIFESTYLE;
|
||||
u16 easyChatWord = sub_80BDA40(groupId);
|
||||
u16 easyChatWord = GetRandomWordFromAnyGroup(groupId);
|
||||
CopyEasyChatWord(gStringVar2, easyChatWord);
|
||||
}
|
||||
|
||||
@@ -377,7 +377,7 @@ static u16 UnlockRandomTrendySaying(void)
|
||||
u16 additionalPhraseId;
|
||||
u8 numAdditionalPhrasesUnlocked = GetNumUnlockedTrendySayings();
|
||||
if (numAdditionalPhrasesUnlocked == 33)
|
||||
return 0xFFFF;
|
||||
return EC_WORD_UNDEFINED;
|
||||
|
||||
additionalPhraseId = Random() % (33 - numAdditionalPhrasesUnlocked);
|
||||
for (i = 0; i < 33; i++)
|
||||
@@ -396,7 +396,7 @@ static u16 UnlockRandomTrendySaying(void)
|
||||
}
|
||||
}
|
||||
|
||||
return 0xFFFF;
|
||||
return EC_WORD_UNDEFINED;
|
||||
}
|
||||
|
||||
static u16 GetRandomUnlockedTrendySaying(void)
|
||||
@@ -404,7 +404,7 @@ static u16 GetRandomUnlockedTrendySaying(void)
|
||||
u16 i;
|
||||
u16 additionalPhraseId = GetNumUnlockedTrendySayings();
|
||||
if (additionalPhraseId == 0)
|
||||
return 0xFFFF;
|
||||
return EC_WORD_UNDEFINED;
|
||||
|
||||
additionalPhraseId = Random() % additionalPhraseId;
|
||||
for (i = 0; i < 33; i++)
|
||||
@@ -418,10 +418,10 @@ static u16 GetRandomUnlockedTrendySaying(void)
|
||||
}
|
||||
}
|
||||
|
||||
return 0xFFFF;
|
||||
return EC_WORD_UNDEFINED;
|
||||
}
|
||||
|
||||
static bool8 sub_80BDCA8(void)
|
||||
static bool8 EC_IsNationalPokedexEnabled(void)
|
||||
{
|
||||
return IsNationalPokedexEnabled();
|
||||
}
|
||||
@@ -433,7 +433,7 @@ static u16 GetRandomECPokemon(void)
|
||||
const u16 *species;
|
||||
u16 index = EasyChat_GetNumWordsInGroup(EC_GROUP_POKEMON_2);
|
||||
if (index == 0)
|
||||
return 0xFFFF;
|
||||
return EC_WORD_UNDEFINED;
|
||||
|
||||
index = Random() % index;
|
||||
species = gEasyChatGroups[EC_GROUP_POKEMON_2].wordData.valueList;
|
||||
@@ -452,7 +452,7 @@ static u16 GetRandomECPokemon(void)
|
||||
species++;
|
||||
}
|
||||
|
||||
return 0xFFFF;
|
||||
return EC_WORD_UNDEFINED;
|
||||
}
|
||||
|
||||
void InitEasyChatPhrases(void)
|
||||
@@ -467,14 +467,14 @@ void InitEasyChatPhrases(void)
|
||||
|
||||
for (i = 0; i < 6; i++)
|
||||
{
|
||||
gSaveBlock1Ptr->easyChatBattleWon[i] = 0xFFFF;
|
||||
gSaveBlock1Ptr->easyChatBattleLost[i] = 0xFFFF;
|
||||
gSaveBlock1Ptr->easyChatBattleWon[i] = EC_WORD_UNDEFINED;
|
||||
gSaveBlock1Ptr->easyChatBattleLost[i] = EC_WORD_UNDEFINED;
|
||||
}
|
||||
|
||||
for (i = 0; i < MAIL_COUNT; i++)
|
||||
{
|
||||
for (j = 0; j < MAIL_WORDS_COUNT; j++)
|
||||
gSaveBlock1Ptr->mail[i].words[j] = 0xFFFF;
|
||||
gSaveBlock1Ptr->mail[i].words[j] = EC_WORD_UNDEFINED;
|
||||
}
|
||||
|
||||
// BUG: This is supposed to clear 64 bits, but this loop is clearing 64 bytes.
|
||||
@@ -485,64 +485,64 @@ void InitEasyChatPhrases(void)
|
||||
gSaveBlock1Ptr->additionalPhrases[i] = 0;
|
||||
}
|
||||
|
||||
void sub_80BDE28(void)
|
||||
void ResetSomeMEventECBuffer_3120_338(void)
|
||||
{
|
||||
s32 i;
|
||||
u16 *ptr = sub_8143DA8();
|
||||
for (i = 0; i < 4; i++)
|
||||
ptr[i] = 0xFFFF;
|
||||
ptr[i] = EC_WORD_UNDEFINED;
|
||||
}
|
||||
|
||||
bool8 sub_80BDE44(void)
|
||||
bool8 InitEasyChatSelection(void)
|
||||
{
|
||||
gUnknown_20399BC = Alloc(sizeof(*gUnknown_20399BC));
|
||||
if (!gUnknown_20399BC)
|
||||
sEasyChatSelectionData = Alloc(sizeof(*sEasyChatSelectionData));
|
||||
if (!sEasyChatSelectionData)
|
||||
return FALSE;
|
||||
|
||||
sub_80BDE88();
|
||||
sub_80BDFF8();
|
||||
PopulateECGroups();
|
||||
PopulateAlphabeticalGroups();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void sub_80BDE70(void)
|
||||
void DestroyEasyChatSelectionData(void)
|
||||
{
|
||||
if (gUnknown_20399BC != NULL)
|
||||
Free(gUnknown_20399BC);
|
||||
if (sEasyChatSelectionData != NULL)
|
||||
Free(sEasyChatSelectionData);
|
||||
}
|
||||
|
||||
static void sub_80BDE88(void)
|
||||
static void PopulateECGroups(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
gUnknown_20399BC->unk0 = 0;
|
||||
sEasyChatSelectionData->numGroups = 0;
|
||||
if (GetNationalPokedexCount(FLAG_GET_SEEN))
|
||||
gUnknown_20399BC->unk2[gUnknown_20399BC->unk0++] = EC_GROUP_POKEMON;
|
||||
sEasyChatSelectionData->groups[sEasyChatSelectionData->numGroups++] = EC_GROUP_POKEMON;
|
||||
|
||||
for (i = EC_GROUP_TRAINER; i <= EC_GROUP_ADJECTIVES; i++)
|
||||
gUnknown_20399BC->unk2[gUnknown_20399BC->unk0++] = i;
|
||||
sEasyChatSelectionData->groups[sEasyChatSelectionData->numGroups++] = i;
|
||||
|
||||
if (FlagGet(FLAG_SYS_GAME_CLEAR))
|
||||
{
|
||||
gUnknown_20399BC->unk2[gUnknown_20399BC->unk0++] = EC_GROUP_EVENTS;
|
||||
gUnknown_20399BC->unk2[gUnknown_20399BC->unk0++] = EC_GROUP_MOVE_1;
|
||||
gUnknown_20399BC->unk2[gUnknown_20399BC->unk0++] = EC_GROUP_MOVE_2;
|
||||
sEasyChatSelectionData->groups[sEasyChatSelectionData->numGroups++] = EC_GROUP_EVENTS;
|
||||
sEasyChatSelectionData->groups[sEasyChatSelectionData->numGroups++] = EC_GROUP_MOVE_1;
|
||||
sEasyChatSelectionData->groups[sEasyChatSelectionData->numGroups++] = EC_GROUP_MOVE_2;
|
||||
}
|
||||
|
||||
if (IsNationalPokedexEnabled())
|
||||
gUnknown_20399BC->unk2[gUnknown_20399BC->unk0++] = EC_GROUP_POKEMON_2;
|
||||
sEasyChatSelectionData->groups[sEasyChatSelectionData->numGroups++] = EC_GROUP_POKEMON_2;
|
||||
}
|
||||
|
||||
u8 sub_80BDF38(void)
|
||||
u8 GetNumDisplayableGroups(void)
|
||||
{
|
||||
return gUnknown_20399BC->unk0;
|
||||
return sEasyChatSelectionData->numGroups;
|
||||
}
|
||||
|
||||
u8 sub_80BDF44(u8 index)
|
||||
u8 GetSelectedGroupByIndex(u8 index)
|
||||
{
|
||||
if (index >= gUnknown_20399BC->unk0)
|
||||
if (index >= sEasyChatSelectionData->numGroups)
|
||||
return EC_NUM_GROUPS;
|
||||
else
|
||||
return gUnknown_20399BC->unk2[index];
|
||||
return sEasyChatSelectionData->groups[index];
|
||||
}
|
||||
|
||||
static u8 *unref_sub_80BDF6C(u8 *dest, u8 groupId, u16 totalChars)
|
||||
@@ -578,7 +578,7 @@ u8 *CopyEasyChatWordPadded(u8 *dest, u16 easyChatWord, u16 totalChars)
|
||||
return str;
|
||||
}
|
||||
|
||||
static void sub_80BDFF8(void)
|
||||
static void PopulateAlphabeticalGroups(void)
|
||||
{
|
||||
static int i;
|
||||
static int j;
|
||||
@@ -592,11 +592,11 @@ static void sub_80BDFF8(void)
|
||||
{
|
||||
numWords = gEasyChatWordsByLetterPointers[i].numWords;
|
||||
words = gEasyChatWordsByLetterPointers[i].words;
|
||||
gUnknown_20399BC->unk2E[i] = 0;
|
||||
sEasyChatSelectionData->alphabeticalGroups[i] = 0;
|
||||
index = 0;
|
||||
for (j = 0; j < numWords; )
|
||||
{
|
||||
if (*words == 0xFFFF)
|
||||
if (*words == EC_WORD_UNDEFINED)
|
||||
{
|
||||
words++;
|
||||
numToProcess = *words++;
|
||||
@@ -609,10 +609,10 @@ static void sub_80BDFF8(void)
|
||||
|
||||
for (k = 0; k < numToProcess; k++)
|
||||
{
|
||||
if (sub_80BE440(words[k]))
|
||||
if (IsWordUnlocked(words[k]))
|
||||
{
|
||||
gUnknown_20399BC->unk64[i][index++] = words[k];
|
||||
gUnknown_20399BC->unk2E[i]++;
|
||||
sEasyChatSelectionData->alphabeticalWordsByGroup[i][index++] = words[k];
|
||||
sEasyChatSelectionData->alphabeticalGroups[i]++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -623,28 +623,28 @@ static void sub_80BDFF8(void)
|
||||
}
|
||||
}
|
||||
|
||||
void sub_80BE16C(int arg0, u16 groupId)
|
||||
void GetUnlockedECWords(bool32 isAlphabetical, u16 groupId)
|
||||
{
|
||||
if (!arg0)
|
||||
gUnknown_20399BC->unk3BA0 = sub_80BE1E8(groupId);
|
||||
if (!isAlphabetical)
|
||||
sEasyChatSelectionData->totalWords = GetUnlockedWordsInECGroup(groupId);
|
||||
else
|
||||
gUnknown_20399BC->unk3BA0 = sub_80BE2F8(groupId);
|
||||
sEasyChatSelectionData->totalWords = GetUnlockedWordsInAlphabeticalGroup(groupId);
|
||||
}
|
||||
|
||||
u16 sub_80BE19C(u16 arg0)
|
||||
u16 GetDisplayedWordByIndex(u16 index)
|
||||
{
|
||||
if (arg0 >= gUnknown_20399BC->unk3BA0)
|
||||
return 0xFFFF;
|
||||
if (index >= sEasyChatSelectionData->totalWords)
|
||||
return EC_WORD_UNDEFINED;
|
||||
else
|
||||
return gUnknown_20399BC->unk3984[arg0];
|
||||
return sEasyChatSelectionData->allWords[index];
|
||||
}
|
||||
|
||||
u16 sub_80BE1D4(void)
|
||||
u16 GetNumDisplayedWords(void)
|
||||
{
|
||||
return gUnknown_20399BC->unk3BA0;
|
||||
return sEasyChatSelectionData->totalWords;
|
||||
}
|
||||
|
||||
static u16 sub_80BE1E8(u16 groupId)
|
||||
static u16 GetUnlockedWordsInECGroup(u16 groupId)
|
||||
{
|
||||
u16 i;
|
||||
u16 totalWords;
|
||||
@@ -658,8 +658,8 @@ static u16 sub_80BE1E8(u16 groupId)
|
||||
list = gEasyChatGroups[groupId].wordData.valueList;
|
||||
for (i = 0, totalWords = 0; i < numWords; i++)
|
||||
{
|
||||
if (sub_80BE3A4(list[i], groupId))
|
||||
gUnknown_20399BC->unk3984[totalWords++] = EC_WORD(groupId, list[i]);
|
||||
if (UnlockedECMonOrMove(list[i], groupId))
|
||||
sEasyChatSelectionData->allWords[totalWords++] = EC_WORD(groupId, list[i]);
|
||||
}
|
||||
|
||||
return totalWords;
|
||||
@@ -670,45 +670,45 @@ static u16 sub_80BE1E8(u16 groupId)
|
||||
for (i = 0, totalWords = 0; i < numWords; i++)
|
||||
{
|
||||
u16 alphabeticalOrder = wordInfo[i].alphabeticalOrder;
|
||||
if (sub_80BE3A4(alphabeticalOrder, groupId))
|
||||
gUnknown_20399BC->unk3984[totalWords++] = EC_WORD(groupId, alphabeticalOrder);
|
||||
if (UnlockedECMonOrMove(alphabeticalOrder, groupId))
|
||||
sEasyChatSelectionData->allWords[totalWords++] = EC_WORD(groupId, alphabeticalOrder);
|
||||
}
|
||||
|
||||
return totalWords;
|
||||
}
|
||||
}
|
||||
|
||||
static u16 sub_80BE2F8(u16 alphabeticalGroup)
|
||||
static u16 GetUnlockedWordsInAlphabeticalGroup(u16 alphabeticalGroup)
|
||||
{
|
||||
u16 i;
|
||||
u16 totalWords;
|
||||
|
||||
for (i = 0, totalWords = 0; i < gUnknown_20399BC->unk2E[alphabeticalGroup]; i++)
|
||||
gUnknown_20399BC->unk3984[totalWords++] = gUnknown_20399BC->unk64[alphabeticalGroup][i];
|
||||
for (i = 0, totalWords = 0; i < sEasyChatSelectionData->alphabeticalGroups[alphabeticalGroup]; i++)
|
||||
sEasyChatSelectionData->allWords[totalWords++] = sEasyChatSelectionData->alphabeticalWordsByGroup[alphabeticalGroup][i];
|
||||
|
||||
return totalWords;
|
||||
}
|
||||
|
||||
static bool8 sub_80BE36C(u8 arg0)
|
||||
static bool8 IsGroupSelectable(u8 groupIdx)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < gUnknown_20399BC->unk0; i++)
|
||||
for (i = 0; i < sEasyChatSelectionData->numGroups; i++)
|
||||
{
|
||||
if (gUnknown_20399BC->unk2[i] == arg0)
|
||||
if (sEasyChatSelectionData->groups[i] == groupIdx)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static bool8 sub_80BE3A4(u16 wordIndex, u8 groupId)
|
||||
static bool8 UnlockedECMonOrMove(u16 wordIndex, u8 groupId)
|
||||
{
|
||||
switch (groupId)
|
||||
{
|
||||
case EC_GROUP_POKEMON:
|
||||
return GetSetPokedexFlag(SpeciesToNationalPokedexNum(wordIndex), FLAG_GET_SEEN);
|
||||
case EC_GROUP_POKEMON_2:
|
||||
if (sub_80BE418(wordIndex))
|
||||
if (EC_IsDeoxys(wordIndex))
|
||||
return GetSetPokedexFlag(SpeciesToNationalPokedexNum(wordIndex), FLAG_GET_SEEN);
|
||||
return TRUE;
|
||||
case EC_GROUP_MOVE_1:
|
||||
@@ -719,25 +719,25 @@ static bool8 sub_80BE3A4(u16 wordIndex, u8 groupId)
|
||||
}
|
||||
}
|
||||
|
||||
static int sub_80BE418(u16 species)
|
||||
static int EC_IsDeoxys(u16 species)
|
||||
{
|
||||
u32 i;
|
||||
for (i = 0; i < ARRAY_COUNT(gUnknown_83EE004); i++)
|
||||
for (i = 0; i < ARRAY_COUNT(sDeoxysValue); i++)
|
||||
{
|
||||
if (gUnknown_83EE004[i] == species)
|
||||
if (sDeoxysValue[i] == species)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static u8 sub_80BE440(u16 easyChatWord)
|
||||
static u8 IsWordUnlocked(u16 easyChatWord)
|
||||
{
|
||||
u8 groupId = EC_GROUP(easyChatWord);
|
||||
u32 index = EC_INDEX(easyChatWord);
|
||||
if (!sub_80BE36C(groupId))
|
||||
if (!IsGroupSelectable(groupId))
|
||||
return FALSE;
|
||||
else
|
||||
return sub_80BE3A4(index, groupId);
|
||||
return UnlockedECMonOrMove(index, groupId);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -487,7 +487,7 @@ void sub_8143D24(void)
|
||||
{
|
||||
CpuFill32(0, &gSaveBlock1Ptr->unk_3120, sizeof(gSaveBlock1Ptr->unk_3120));
|
||||
sub_8143ED0();
|
||||
sub_80BDE28();
|
||||
ResetSomeMEventECBuffer_3120_338();
|
||||
}
|
||||
|
||||
struct MEventBuffer_3120_Sub * GetSavedWonderNews(void)
|
||||
|
||||
Reference in New Issue
Block a user