Skip to content

Commit

Permalink
Document easy_chat
Browse files Browse the repository at this point in the history
  • Loading branch information
PikalaxALT committed Nov 1, 2019
1 parent 115fd2a commit 2100eb9
Show file tree
Hide file tree
Showing 8 changed files with 134 additions and 131 deletions.
2 changes: 1 addition & 1 deletion asm/battle_tower.s
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
24 changes: 12 additions & 12 deletions asm/link_rfu.s
Original file line number Diff line number Diff line change
Expand Up @@ -3443,7 +3443,7 @@ _080FEDC0:
bl ResetPaletteFade
b _080FEE16
_080FEDD4:
bl sub_80BDE44
bl InitEasyChatSelection
b _080FEDF2
_080FEDDA:
ldrb r4, [r6, 0x2]
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions data/event_scripts.s
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion data/specials.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions include/constants/easy_chat.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
15 changes: 8 additions & 7 deletions include/easy_chat.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
Loading

0 comments on commit 2100eb9

Please sign in to comment.