From 3a72e6a80d52215533936f92efbe8e4f3454b7e6 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sun, 12 Aug 2018 11:39:09 +0200 Subject: [PATCH] Easy chat review changes --- include/global.h | 4 ++-- src/easy_chat.c | 17 +++++++---------- src/lilycove_lady.c | 22 +++++++++++----------- 3 files changed, 20 insertions(+), 23 deletions(-) diff --git a/include/global.h b/include/global.h index a0722bcc9..eaac5ea89 100644 --- a/include/global.h +++ b/include/global.h @@ -719,8 +719,8 @@ struct LilycoveLadyQuiz /*0x000*/ u8 id; /*0x001*/ u8 phase; /*0x002*/ u16 unk_002[9]; - /*0x014*/ u16 unk_014[1]; - /*0x016*/ u16 unk_016[1]; + /*0x014*/ u16 unk_014; + /*0x016*/ u16 unk_016; /*0x018*/ u8 playerName[8]; /*0x020*/ u16 playerTrainerId[4]; /*0x028*/ u16 itemId; diff --git a/src/easy_chat.c b/src/easy_chat.c index 26a69f9ff..fbf4c0e70 100644 --- a/src/easy_chat.c +++ b/src/easy_chat.c @@ -166,7 +166,7 @@ static void sub_811A2FC(u8 taskId) { case 0: SetVBlankCallback(sub_811A290); - BlendPalettes(-1, 16, 0); + BlendPalettes(0xFFFFFFFF, 16, 0); BeginNormalPaletteFade(-1, -1, 16, 0, 0); data[EZCHAT_TASK_STATE] = 5; break; @@ -341,7 +341,7 @@ void easy_chat_input_maybe(void) sizeParam = 2; break; case 15: - words = gSaveBlock1Ptr->lilycoveLady.quiz.unk_016; + words = &gSaveBlock1Ptr->lilycoveLady.quiz.unk_016; break; case 16: return; @@ -349,7 +349,7 @@ void easy_chat_input_maybe(void) words = gSaveBlock1Ptr->lilycoveLady.quiz.unk_002; break; case 18: - words = gSaveBlock1Ptr->lilycoveLady.quiz.unk_014; + words = &gSaveBlock1Ptr->lilycoveLady.quiz.unk_014; break; case 19: words = (u16 *)&gSaveBlock2Ptr->field_DC[0].field_0[0x28]; @@ -378,7 +378,7 @@ static void sub_811A7E4(void) if (!gPaletteFade.active) { lilycoveLady = &gSaveBlock1Ptr->lilycoveLady; - lilycoveLady->quiz.unk_016[0] = -1; + lilycoveLady->quiz.unk_016 = -1; overworld_free_bg_tilemaps(); sub_811A8F0(); } @@ -420,7 +420,7 @@ static void sub_811A8A4(u16 word) void sub_811A8CC(void) { - sub_811A20C(0xF, gSaveBlock1Ptr->lilycoveLady.quiz.unk_016, CB2_ReturnToFieldContinueScript, 3); + sub_811A20C(0xF, &gSaveBlock1Ptr->lilycoveLady.quiz.unk_016, CB2_ReturnToFieldContinueScript, 3); } void sub_811A8F0(void) @@ -430,7 +430,7 @@ void sub_811A8F0(void) void sub_811A914(void) { - sub_811A20C(0x12, gSaveBlock1Ptr->lilycoveLady.quiz.unk_014, CB2_ReturnToFieldContinueScript, 3); + sub_811A20C(0x12, &gSaveBlock1Ptr->lilycoveLady.quiz.unk_014, CB2_ReturnToFieldContinueScript, 3); } void sub_811A938(void) @@ -494,10 +494,7 @@ static bool8 EasyChat_AllocateResources(u8 kind, u16 *words, u8 sizeParam) static void EasyChat_FreeResources(void) { if (gUnknown_0203A118 != NULL) - { - free(gUnknown_0203A118); - gUnknown_0203A118 = NULL; - } + FREE_AND_SET_NULL(gUnknown_0203A118); } static u16 sub_811AAAC(void) diff --git a/src/lilycove_lady.c b/src/lilycove_lady.c index 159ede91e..1012a8e08 100644 --- a/src/lilycove_lady.c +++ b/src/lilycove_lady.c @@ -508,7 +508,7 @@ static void sub_818DF00(void) { gUnknown_0203CD68->unk_002[i] = gUnknown_0860B1A4[v0][i]; } - gUnknown_0203CD68->unk_014[0] = sUnknown_0860B1E4[v0]; + gUnknown_0203CD68->unk_014 = sUnknown_0860B1E4[v0]; gUnknown_0203CD68->itemId = sUnknown_0860B204[v0]; gUnknown_0203CD68->unk_02b = v0; gUnknown_0203CD68->playerName[0] = EOS; @@ -525,8 +525,8 @@ static void SetLilycoveQuizLady(void) { gUnknown_0203CD68->unk_002[i] = -1; } - gUnknown_0203CD68->unk_014[0] = -1; - gUnknown_0203CD68->unk_016[0] = -1; + gUnknown_0203CD68->unk_014 = -1; + gUnknown_0203CD68->unk_016 = -1; for (i = 0; i < 4; i ++) { gUnknown_0203CD68->playerTrainerId[i] = 0; @@ -544,7 +544,7 @@ static void sub_818E004(void) gUnknown_0203CD68->id = LILYCOVE_LADY_QUIZ; gUnknown_0203CD68->phase = 0; gUnknown_0203CD68->unk_02a = 0; - gUnknown_0203CD68->unk_016[0] = -1; + gUnknown_0203CD68->unk_016 = -1; } u8 sub_818E038(void) @@ -572,7 +572,7 @@ u8 sub_818E06C(void) struct LilycoveLadyQuiz *quiz; quiz = &gSaveBlock1Ptr->lilycoveLady.quiz; - if (sub_811F8D8(quiz->unk_014[0]) == 0) + if (sub_811F8D8(quiz->unk_014) == 0) { i = quiz->unk_02b; do @@ -586,7 +586,7 @@ u8 sub_818E06C(void) { quiz->unk_002[j] = gUnknown_0860B1A4[i][j]; } - quiz->unk_014[0] = sUnknown_0860B1E4[i]; + quiz->unk_014 = sUnknown_0860B1E4[i]; quiz->itemId = sUnknown_0860B204[i]; quiz->unk_02b = i; quiz->playerName[0] = EOS; @@ -699,8 +699,8 @@ void sub_818E2FC(void) bool8 sub_818E308(void) { gUnknown_0203CD68 = &gSaveBlock1Ptr->lilycoveLady.quiz; - CopyEasyChatWord(gStringVar1, gUnknown_0203CD68->unk_014[0]); - CopyEasyChatWord(gStringVar2, gUnknown_0203CD68->unk_016[0]); + CopyEasyChatWord(gStringVar1, gUnknown_0203CD68->unk_014); + CopyEasyChatWord(gStringVar2, gUnknown_0203CD68->unk_016); return StringCompare(gStringVar1, gStringVar2) ? FALSE : TRUE; } @@ -725,7 +725,7 @@ void sub_818E39C(void) void sub_818E3BC(void) { gUnknown_0203CD68 = &gSaveBlock1Ptr->lilycoveLady.quiz; - gUnknown_0203CD68->unk_016[0] = -1; + gUnknown_0203CD68->unk_016 = -1; } void sub_818E3E0(void) @@ -756,7 +756,7 @@ void sub_818E430(void) { gUnknown_0203CD68->unk_002[i] = -1; } - gUnknown_0203CD68->unk_014[0] = -1; + gUnknown_0203CD68->unk_014 = -1; } void sub_818E47C(void) @@ -793,7 +793,7 @@ void sub_818E510(void) void sub_818E538(void) { gUnknown_0203CD68 = &gSaveBlock1Ptr->lilycoveLady.quiz; - CopyEasyChatWord(gStringVar3, gUnknown_0203CD68->unk_014[0]); + CopyEasyChatWord(gStringVar3, gUnknown_0203CD68->unk_014); } void sub_818E564(void)