From b65980cd4ea7e1a8052a0d2c5cb6edd73d35b89c Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 19 Jan 2021 17:50:52 -0500 Subject: Remove unused local variables and functions --- src/mauville_old_man.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src/mauville_old_man.c') diff --git a/src/mauville_old_man.c b/src/mauville_old_man.c index af68c6116..c97ee94f3 100644 --- a/src/mauville_old_man.c +++ b/src/mauville_old_man.c @@ -1324,7 +1324,6 @@ static void PrintStoryList(void) { s32 i; s32 width = GetStringWidth(1, gText_Exit, 0); - u8 tileWidth; for (i = 0; i < NUM_STORYTELLER_TALES; i++) { s32 curWidth; -- cgit v1.2.3 From c6141fea831a30a0d2de24b3c02375a01014ec97 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Mon, 22 Feb 2021 12:12:35 -0500 Subject: Document easy chat --- src/mauville_old_man.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/mauville_old_man.c') diff --git a/src/mauville_old_man.c b/src/mauville_old_man.c index c97ee94f3..cdcde9b06 100644 --- a/src/mauville_old_man.c +++ b/src/mauville_old_man.c @@ -250,7 +250,7 @@ void ScrSpecial_HipsterTeachWord(void) { u16 phrase = GetNewHipsterPhraseToTeach(); - if (phrase == 0xFFFF) + if (phrase == EC_EMPTY_WORD) { gSpecialVar_Result = FALSE; } @@ -283,7 +283,7 @@ void ScrSpecial_GenerateGiddyLine(void) if (giddy->taleCounter == 0) InitGiddyTaleList(); - if (giddy->randomWords[giddy->taleCounter] != 0xFFFF) // is not the last element of the array? + if (giddy->randomWords[giddy->taleCounter] != EC_EMPTY_WORD) { u8 *stringPtr; u32 adjective = Random(); @@ -316,7 +316,7 @@ static void InitGiddyTaleList(void) {EC_GROUP_HOBBIES, 0}, {EC_GROUP_MOVE_1, 0}, {EC_GROUP_MOVE_2, 0}, - {EC_GROUP_POKEMON_2, 0} + {EC_GROUP_POKEMON_NATIONAL, 0} }; u16 i; u16 r10; @@ -348,7 +348,7 @@ static void InitGiddyTaleList(void) r1 = Random() % 10; if (r1 < 3 && r7 < 8) { - giddy->randomWords[i] = 0xFFFF; + giddy->randomWords[i] = EC_EMPTY_WORD; r7++; } else -- cgit v1.2.3 From 6cceb05cb75f368c924c19fd456c2e09e71426a0 Mon Sep 17 00:00:00 2001 From: Marcus Huderle Date: Mon, 29 Mar 2021 11:20:00 -0500 Subject: Document some text-related things --- src/mauville_old_man.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/mauville_old_man.c') diff --git a/src/mauville_old_man.c b/src/mauville_old_man.c index cdcde9b06..228415628 100644 --- a/src/mauville_old_man.c +++ b/src/mauville_old_man.c @@ -425,21 +425,21 @@ static void StartBardSong(bool8 useTemporaryLyrics) gTasks[taskId].tUseTemporaryLyrics = useTemporaryLyrics; } -static void sub_81206F0(void) +static void EnableTextPrinters(void) { - gUnknown_03002F84 = FALSE; + gDisableTextPrinters = FALSE; } -static void BardSong_TextSubPrinter(struct TextPrinterTemplate * printer, u16 a1) +static void BardSong_DisableTextPrinters(struct TextPrinterTemplate * printer, u16 a1) { - gUnknown_03002F84 = TRUE; + gDisableTextPrinters = TRUE; } static void sub_8120708(const u8 * src) { DrawDialogueFrame(0, 0); - AddTextPrinterParameterized(0, 1, src, 0, 1, 1, BardSong_TextSubPrinter); - gUnknown_03002F84 = TRUE; + AddTextPrinterParameterized(0, 1, src, 0, 1, 1, BardSong_DisableTextPrinters); + gDisableTextPrinters = TRUE; CopyWindowToVram(0, 3); } @@ -620,7 +620,7 @@ static void Task_BardSong(u8 taskId) else if (gStringVar4[task->tCharIndex] == CHAR_SPACE) { - sub_81206F0(); + EnableTextPrinters(); task->tCharIndex++; task->tState = 2; task->data[2] = 0; @@ -640,7 +640,7 @@ static void Task_BardSong(u8 taskId) else if (gStringVar4[task->tCharIndex] == CHAR_SONG_WORD_SEPARATOR) { gStringVar4[task->tCharIndex] = CHAR_SPACE; // restore it back to a space - sub_81206F0(); + EnableTextPrinters(); task->tCharIndex++; task->data[2] = 0; } @@ -649,7 +649,7 @@ static void Task_BardSong(u8 taskId) switch (task->data[1]) { case 0: - sub_81206F0(); + EnableTextPrinters(); task->data[1]++; break; case 1: -- cgit v1.2.3 From aad090e154d4cb1397468f3b19071ddad688a7bc Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sun, 25 Apr 2021 17:22:45 -0400 Subject: Document TV --- src/mauville_old_man.c | 48 +++++++++++++++++++++++------------------------- 1 file changed, 23 insertions(+), 25 deletions(-) (limited to 'src/mauville_old_man.c') diff --git a/src/mauville_old_man.c b/src/mauville_old_man.c index 228415628..239639e0b 100644 --- a/src/mauville_old_man.c +++ b/src/mauville_old_man.c @@ -680,45 +680,43 @@ void ScrSpecial_SetMauvilleOldManObjEventGfx(void) // Language fixers? -void sub_8120B70(union OldMan * oldMan) +void SanitizeMauvilleOldManForRuby(union OldMan * oldMan) { s32 i; u8 playerName[PLAYER_NAME_LENGTH + 1]; switch (oldMan->common.id) { - case MAUVILLE_MAN_TRADER: + case MAUVILLE_MAN_TRADER: + { + struct MauvilleOldManTrader * trader = &oldMan->trader; + for (i = 0; i < NUM_TRADER_ITEMS; i++) { - struct MauvilleOldManTrader * trader = &oldMan->trader; - for (i = 0; i < NUM_TRADER_ITEMS; i++) - { - if (trader->language[i] == LANGUAGE_JAPANESE) - { - ConvertInternationalString(trader->playerNames[i], LANGUAGE_JAPANESE); - } - } + if (trader->language[i] == LANGUAGE_JAPANESE) + ConvertInternationalString(trader->playerNames[i], LANGUAGE_JAPANESE); } - break; - case MAUVILLE_MAN_STORYTELLER: + break; + } + case MAUVILLE_MAN_STORYTELLER: + { + struct MauvilleManStoryteller * storyteller = &oldMan->storyteller; + for (i = 0; i < NUM_STORYTELLER_TALES; i++) { - struct MauvilleManStoryteller * storyteller = &oldMan->storyteller; - for (i = 0; i < NUM_STORYTELLER_TALES; i++) + if (storyteller->gameStatIDs[i] != 0) { - if (storyteller->gameStatIDs[i] != 0) + memcpy(playerName, storyteller->trainerNames[i], PLAYER_NAME_LENGTH); + playerName[PLAYER_NAME_LENGTH] = EOS; + if (IsStringJapanese(playerName)) { - memcpy(playerName, storyteller->trainerNames[i], PLAYER_NAME_LENGTH); - playerName[PLAYER_NAME_LENGTH] = EOS; - if (IsStringJapanese(playerName)) - { - memset(playerName, CHAR_SPACE, PLAYER_NAME_LENGTH + 1); - StringCopy(playerName, gText_Friend); - memcpy(storyteller->trainerNames[i], playerName, PLAYER_NAME_LENGTH); - storyteller->language[i] = GAME_LANGUAGE; - } + memset(playerName, CHAR_SPACE, PLAYER_NAME_LENGTH + 1); + StringCopy(playerName, gText_Friend); + memcpy(storyteller->trainerNames[i], playerName, PLAYER_NAME_LENGTH); + storyteller->language[i] = GAME_LANGUAGE; } } } - break; + break; + } } } -- cgit v1.2.3