From 77d9e303e3517f3319bc3a269d976a38f1ca9802 Mon Sep 17 00:00:00 2001 From: Viperio19 Date: Tue, 17 Dec 2024 23:19:52 +0100 Subject: [PATCH 1/4] Finishing touches to journal documentation --- .../journal_display/journal_controller.h | 30 + .../journal_display/journal_printer.h | 8 +- .../journal_display/struct_ov81_021D1610.h | 35 - include/journal.h | 2 + .../journal_display/journal_controller.c | 320 ++--- .../journal_display/journal_printer.c | 1115 +++++++++-------- src/journal.c | 6 +- 7 files changed, 756 insertions(+), 760 deletions(-) delete mode 100644 include/applications/journal_display/struct_ov81_021D1610.h diff --git a/include/applications/journal_display/journal_controller.h b/include/applications/journal_display/journal_controller.h index 47923fbb31..df089317b3 100644 --- a/include/applications/journal_display/journal_controller.h +++ b/include/applications/journal_display/journal_controller.h @@ -1,7 +1,14 @@ #ifndef POKEPLATINUM_JOURNAL_CONTROLLER_H #define POKEPLATINUM_JOURNAL_CONTROLLER_H +#include "bg_window.h" +#include "journal.h" +#include "message.h" #include "overlay_manager.h" +#include "savedata.h" +#include "strbuf.h" +#include "string_template.h" +#include "trainer_info.h" enum JournalState { JOURNAL_STATE_OPEN = 0, @@ -11,6 +18,29 @@ enum JournalState { JOURNAL_STATE_CLOSE, }; +typedef struct JournalManager { + BgConfig *bgConfig; + Window window[4]; + JournalEntry *journalEntry; + TrainerInfo *trainerInfo; + SaveData *saveData; + MessageLoader *loader; + StringTemplate *template; + Strbuf *strbuf; + u16 tilemapBuffer_5C[1024]; + u16 tilemapBuffer_85C[1024]; + s8 page; + u8 padding_105D; + s8 state; + s8 unk_105F; + s8 unk_1060; + u8 bgLayer1; + u8 bgLayer2; + u8 bgLayer3; + u8 bgLayer4; + u8 unused[3]; +} JournalManager; + int JournalController_Init(OverlayManager *ovyManager, int *state); int JournalController_Main(OverlayManager *ovyManager, int *state); int JournalController_Exit(OverlayManager *ovyManager, int *state); diff --git a/include/applications/journal_display/journal_printer.h b/include/applications/journal_display/journal_printer.h index f466a68908..adb15fd283 100644 --- a/include/applications/journal_display/journal_printer.h +++ b/include/applications/journal_display/journal_printer.h @@ -1,10 +1,10 @@ #ifndef POKEPLATINUM_JOURNAL_PRINTER_H #define POKEPLATINUM_JOURNAL_PRINTER_H -#include "applications/journal_display/struct_ov81_021D1610.h" +#include "applications/journal_display/journal_controller.h" -void ov81_021D1610(UnkStruct_ov81_021D1610 *param0); -void ov81_021D1634(UnkStruct_ov81_021D1610 *param0); -void ov81_021D164C(UnkStruct_ov81_021D1610 *param0, u32 param1); +void JournalPrinter_AddWindows(JournalManager *param0); +void JournalPrinter_RemoveWindows(JournalManager *param0); +void JournalPrinter_PrintEntry(JournalManager *param0, u32 param1); #endif // POKEPLATINUM_JOURNAL_PRINTER_H diff --git a/include/applications/journal_display/struct_ov81_021D1610.h b/include/applications/journal_display/struct_ov81_021D1610.h deleted file mode 100644 index d101dc471c..0000000000 --- a/include/applications/journal_display/struct_ov81_021D1610.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef POKEPLATINUM_STRUCT_OV81_021D1610_H -#define POKEPLATINUM_STRUCT_OV81_021D1610_H - -#include "bg_window.h" -#include "journal.h" -#include "message.h" -#include "savedata.h" -#include "strbuf.h" -#include "string_template.h" -#include "trainer_info.h" - -typedef struct { - BgConfig *bgConfig; - Window window[4]; - JournalEntry *journalEntry; - TrainerInfo *trainerInfo; - SaveData *saveData; - MessageLoader *loader; - StringTemplate *template; - Strbuf *strbuf; - u16 unk_5C[1024]; - u16 unk_85C[1024]; - s8 page; - u8 padding_105D; - s8 state; - s8 unk_105F; - s8 unk_1060; - u8 bgLayer1; - u8 bgLayer2; - u8 bgLayer3; - u8 bgLayer4; - u8 unused[3]; -} UnkStruct_ov81_021D1610; - -#endif // POKEPLATINUM_STRUCT_OV81_021D1610_H diff --git a/include/journal.h b/include/journal.h index e83a84143d..3c56829123 100644 --- a/include/journal.h +++ b/include/journal.h @@ -5,6 +5,8 @@ #include "savedata.h" #include "trainer_info.h" +#define MAX_JOURNAL_ENTRIES 10 + #define POKEMON_CAUGHT 1 #define POKEMON_DEFEATED 2 diff --git a/src/applications/journal_display/journal_controller.c b/src/applications/journal_display/journal_controller.c index b853cc0661..b79ba44ed7 100644 --- a/src/applications/journal_display/journal_controller.c +++ b/src/applications/journal_display/journal_controller.c @@ -4,12 +4,12 @@ #include #include "constants/heap.h" +#include "consts/gender.h" #include "consts/sdat.h" #include "struct_defs/struct_02099F80.h" #include "applications/journal_display/journal_printer.h" -#include "applications/journal_display/struct_ov81_021D1610.h" #include "bg_window.h" #include "core_sys.h" @@ -35,22 +35,22 @@ static void JournalController_MainCallback(void *data); static void JournalController_SetVRAMBanks(void); -static void JournalController_SetupBgs(BgConfig *param0); -static void JournalController_TeardownBgs(BgConfig *param0); -static void ov81_021D1050(UnkStruct_ov81_021D1610 *param0); -static void ov81_021D1130(UnkStruct_ov81_021D1610 *param0); -static void ov81_021D115C(UnkStruct_ov81_021D1610 *param0); -static int JournalController_IsOpeningTransitionDone(UnkStruct_ov81_021D1610 *param0); -static int JournalController_HandleInput(UnkStruct_ov81_021D1610 *param0); -static int JournalController_TurnPageLeft(UnkStruct_ov81_021D1610 *param0); -static int JournalController_TurnPageRight(UnkStruct_ov81_021D1610 *param0); -static int JournalController_IsClosingTransitionDone(UnkStruct_ov81_021D1610 *param0); -static u8 JournalController_NewDirectionPageExists(UnkStruct_ov81_021D1610 *param0, s8 pageChance); -static void ov81_021D1360(UnkStruct_ov81_021D1610 *param0); -static void ov81_021D140C(UnkStruct_ov81_021D1610 *param0, u8 bgLayer, u8 palette); -static void ov81_021D1434(UnkStruct_ov81_021D1610 *param0); -static u8 ov81_021D14E0(UnkStruct_ov81_021D1610 *param0); -static u8 ov81_021D156C(UnkStruct_ov81_021D1610 *param0); +static void JournalController_SetupBgs(BgConfig *bgConfig); +static void JournalController_TeardownBgs(BgConfig *bgConfig); +static void JournalController_LoadGraphics(JournalManager *journalManager); +static void JournalController_InitStringUtil(JournalManager *journalManager); +static void JournalController_FreeStringUtil(JournalManager *journalManager); +static int JournalController_IsOpeningTransitionDone(JournalManager *journalManager); +static int JournalController_HandleInput(JournalManager *journalManager); +static int JournalController_TurnPageLeft(JournalManager *journalManager); +static int JournalController_TurnPageRight(JournalManager *journalManager); +static int JournalController_IsClosingTransitionDone(JournalManager *journalManager); +static u8 JournalController_NewDirectionPageExists(JournalManager *journalManager, s8 pageChance); +static void ov81_021D1360(JournalManager *journalManager); +static void JournalController_LoadNewPagePalette(JournalManager *journalManager, u8 bgLayer, u8 palette); +static void ov81_021D1434(JournalManager *journalManager); +static u8 ov81_021D14E0(JournalManager *journalManager); +static u8 ov81_021D156C(JournalManager *journalManager); static const u8 Unk_ov81_021D33E8[9][32] = { { 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xA, 0xB, 0xC, 0xD, 0xE, 0xF, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F }, @@ -66,8 +66,8 @@ static const u8 Unk_ov81_021D33E8[9][32] = { int JournalController_Init(OverlayManager *ovyManager, int *state) { - UnkStruct_ov81_021D1610 *v0; - SaveData *v1; + JournalManager *journalManager; + SaveData *saveData; SetMainCallback(NULL, NULL); DisableHBlank(); @@ -82,27 +82,27 @@ int JournalController_Init(OverlayManager *ovyManager, int *state) SetAutorepeat(4, 8); Heap_Create(HEAP_ID_APPLICATION, HEAP_ID_JOURNAL, 0x20000); - v1 = OverlayManager_Args(ovyManager); - v0 = OverlayManager_NewData(ovyManager, sizeof(UnkStruct_ov81_021D1610), HEAP_ID_JOURNAL); - memset(v0, 0, sizeof(UnkStruct_ov81_021D1610)); - v0->bgConfig = BgConfig_New(HEAP_ID_JOURNAL); + saveData = OverlayManager_Args(ovyManager); + journalManager = OverlayManager_NewData(ovyManager, sizeof(JournalManager), HEAP_ID_JOURNAL); + memset(journalManager, 0, sizeof(JournalManager)); + journalManager->bgConfig = BgConfig_New(HEAP_ID_JOURNAL); - v0->saveData = v1; - v0->journalEntry = SaveData_GetJournal(v1); - v0->trainerInfo = SaveData_GetTrainerInfo(v1); + journalManager->saveData = saveData; + journalManager->journalEntry = SaveData_GetJournal(saveData); + journalManager->trainerInfo = SaveData_GetTrainerInfo(saveData); sub_0208C120(0, HEAP_ID_JOURNAL); Font_UseImmediateGlyphAccess(FONT_SYSTEM, HEAP_ID_JOURNAL); JournalController_SetVRAMBanks(); - JournalController_SetupBgs(v0->bgConfig); - ov81_021D1050(v0); - ov81_021D1130(v0); - ov81_021D1610(v0); - ov81_021D164C(v0, 0); - ov81_021D1434(v0); - - SetMainCallback(JournalController_MainCallback, v0); + JournalController_SetupBgs(journalManager->bgConfig); + JournalController_LoadGraphics(journalManager); + JournalController_InitStringUtil(journalManager); + JournalPrinter_AddWindows(journalManager); + JournalPrinter_PrintEntry(journalManager, 0); + ov81_021D1434(journalManager); + + SetMainCallback(JournalController_MainCallback, journalManager); GXLayers_TurnBothDispOn(); sub_02039734(); GXLayers_EngineAToggleLayers(GX_PLANEMASK_OBJ, 1); @@ -113,23 +113,23 @@ int JournalController_Init(OverlayManager *ovyManager, int *state) int JournalController_Main(OverlayManager *ovyManager, int *state) { - UnkStruct_ov81_021D1610 *v0 = OverlayManager_Data(ovyManager); + JournalManager *journalManager = OverlayManager_Data(ovyManager); switch (*state) { case JOURNAL_STATE_OPEN: - *state = JournalController_IsOpeningTransitionDone(v0); + *state = JournalController_IsOpeningTransitionDone(journalManager); break; case JOURNAL_STATE_HANDLE_INPUT: - *state = JournalController_HandleInput(v0); + *state = JournalController_HandleInput(journalManager); break; case JOURNAL_STATE_TURN_LEFT: - *state = JournalController_TurnPageLeft(v0); + *state = JournalController_TurnPageLeft(journalManager); break; case JOURNAL_STATE_TURN_RIGHT: - *state = JournalController_TurnPageRight(v0); + *state = JournalController_TurnPageRight(journalManager); break; case JOURNAL_STATE_CLOSE: - if (JournalController_IsClosingTransitionDone(v0) == 1) { + if (JournalController_IsClosingTransitionDone(journalManager) == 1) { return TRUE; } } @@ -139,13 +139,13 @@ int JournalController_Main(OverlayManager *ovyManager, int *state) int JournalController_Exit(OverlayManager *ovyManager, int *state) { - UnkStruct_ov81_021D1610 *v0 = OverlayManager_Data(ovyManager); + JournalManager *journalManager = OverlayManager_Data(ovyManager); SetMainCallback(NULL, NULL); - ov81_021D1634(v0); - JournalController_TeardownBgs(v0->bgConfig); - ov81_021D115C(v0); + JournalPrinter_RemoveWindows(journalManager); + JournalController_TeardownBgs(journalManager->bgConfig); + JournalController_FreeStringUtil(journalManager); Font_UseLazyGlyphAccess(FONT_SYSTEM); OverlayManager_FreeData(ovyManager); @@ -156,9 +156,9 @@ int JournalController_Exit(OverlayManager *ovyManager, int *state) static void JournalController_MainCallback(void *data) { - UnkStruct_ov81_021D1610 *v0 = data; + JournalManager *journalManager = data; - Bg_RunScheduledUpdates(v0->bgConfig); + Bg_RunScheduledUpdates(journalManager->bgConfig); OS_SetIrqCheckFlag(OS_IE_V_BLANK); } @@ -182,16 +182,16 @@ static void JournalController_SetVRAMBanks(void) static void JournalController_SetupBgs(BgConfig *bgConfig) { - GraphicsModes v0 = { + GraphicsModes graphicsModes = { GX_DISPMODE_GRAPHICS, GX_BGMODE_0, GX_BGMODE_0, GX_BG0_AS_2D, }; - SetAllGraphicsModes(&v0); + SetAllGraphicsModes(&graphicsModes); - BgTemplate v1 = { + BgTemplate bgTemplate1 = { 0, 0, 0x800, @@ -207,10 +207,10 @@ static void JournalController_SetupBgs(BgConfig *bgConfig) 0 }; - Bg_InitFromTemplate(bgConfig, 0, &v1, 0); + Bg_InitFromTemplate(bgConfig, 0, &bgTemplate1, 0); Bg_ClearTilemap(bgConfig, 0); - BgTemplate v2 = { + BgTemplate bgTemplate2 = { 0, 0, 0x800, @@ -226,10 +226,10 @@ static void JournalController_SetupBgs(BgConfig *bgConfig) 0 }; - Bg_InitFromTemplate(bgConfig, 1, &v2, 0); + Bg_InitFromTemplate(bgConfig, 1, &bgTemplate2, 0); Bg_ClearTilemap(bgConfig, 1); - BgTemplate v3 = { + BgTemplate bgTemplate3 = { 0, 0, 0x800, @@ -245,9 +245,9 @@ static void JournalController_SetupBgs(BgConfig *bgConfig) 0 }; - Bg_InitFromTemplate(bgConfig, 2, &v3, 0); + Bg_InitFromTemplate(bgConfig, 2, &bgTemplate3, 0); - BgTemplate v4 = { + BgTemplate bgTemplate4 = { 0, 0, 0x800, @@ -263,10 +263,10 @@ static void JournalController_SetupBgs(BgConfig *bgConfig) 0 }; - Bg_InitFromTemplate(bgConfig, 3, &v4, 0); + Bg_InitFromTemplate(bgConfig, 3, &bgTemplate4, 0); - Bg_ClearTilesRange(0, 32, 0, HEAP_ID_JOURNAL); - Bg_ClearTilesRange(1, 32, 0, HEAP_ID_JOURNAL); + Bg_ClearTilesRange(BG_LAYER_MAIN_0, 32, 0, HEAP_ID_JOURNAL); + Bg_ClearTilesRange(BG_LAYER_MAIN_1, 32, 0, HEAP_ID_JOURNAL); } static void JournalController_TeardownBgs(BgConfig *bgConfig) @@ -279,46 +279,46 @@ static void JournalController_TeardownBgs(BgConfig *bgConfig) Heap_FreeToHeapExplicit(HEAP_ID_JOURNAL, bgConfig); } -static void ov81_021D1050(UnkStruct_ov81_021D1610 *param0) +static void JournalController_LoadGraphics(JournalManager *journalManager) { - u16 *v0; - NARC *v1 = NARC_ctor(NARC_INDEX_GRAPHIC__F_NOTE_GRA, HEAP_ID_JOURNAL); + u16 *tilemapBuffer; + NARC *narc = NARC_ctor(NARC_INDEX_GRAPHIC__F_NOTE_GRA, HEAP_ID_JOURNAL); - if (TrainerInfo_Gender(param0->trainerInfo) == 0) { - Graphics_LoadTilesToBgLayerFromOpenNARC(v1, 2, param0->bgConfig, 2, 0, 0, 0, HEAP_ID_JOURNAL); - Graphics_LoadTilemapToBgLayerFromOpenNARC(v1, 0, param0->bgConfig, 2, 0, 0, 0, HEAP_ID_JOURNAL); - Graphics_LoadPaletteFromOpenNARC(v1, 4, 0, 0, 0, HEAP_ID_JOURNAL); + if (TrainerInfo_Gender(journalManager->trainerInfo) == GENDER_MALE) { + Graphics_LoadTilesToBgLayerFromOpenNARC(narc, 2, journalManager->bgConfig, 2, 0, 0, 0, HEAP_ID_JOURNAL); + Graphics_LoadTilemapToBgLayerFromOpenNARC(narc, 0, journalManager->bgConfig, 2, 0, 0, 0, HEAP_ID_JOURNAL); + Graphics_LoadPaletteFromOpenNARC(narc, 4, 0, 0, 0, HEAP_ID_JOURNAL); } else { - Graphics_LoadTilesToBgLayerFromOpenNARC(v1, 3, param0->bgConfig, 2, 0, 0, 0, HEAP_ID_JOURNAL); - Graphics_LoadTilemapToBgLayerFromOpenNARC(v1, 1, param0->bgConfig, 2, 0, 0, 0, HEAP_ID_JOURNAL); - Graphics_LoadPaletteFromOpenNARC(v1, 5, 0, 0, 0, HEAP_ID_JOURNAL); + Graphics_LoadTilesToBgLayerFromOpenNARC(narc, 3, journalManager->bgConfig, 2, 0, 0, 0, HEAP_ID_JOURNAL); + Graphics_LoadTilemapToBgLayerFromOpenNARC(narc, 1, journalManager->bgConfig, 2, 0, 0, 0, HEAP_ID_JOURNAL); + Graphics_LoadPaletteFromOpenNARC(narc, 5, 0, 0, 0, HEAP_ID_JOURNAL); } - NARC_dtor(v1); + NARC_dtor(narc); - v0 = Bg_GetTilemapBuffer(param0->bgConfig, 2); - MI_CpuCopy16(v0, param0->unk_5C, 0x800); - Bg_LoadTilemapBuffer(param0->bgConfig, 3, param0->unk_5C, 0x800); + tilemapBuffer = Bg_GetTilemapBuffer(journalManager->bgConfig, 2); + MI_CpuCopy16(tilemapBuffer, journalManager->tilemapBuffer_5C, 0x800); + Bg_LoadTilemapBuffer(journalManager->bgConfig, 3, journalManager->tilemapBuffer_5C, 0x800); Font_LoadTextPalette(0, 15 * 32, HEAP_ID_JOURNAL); Bg_MaskPalette(4, 0); } -static void ov81_021D1130(UnkStruct_ov81_021D1610 *param0) +static void JournalController_InitStringUtil(JournalManager *journalManager) { - param0->loader = MessageLoader_Init(0, 26, 366, HEAP_ID_JOURNAL); - param0->template = StringTemplate_Default(HEAP_ID_JOURNAL); - param0->strbuf = Strbuf_Init(128, HEAP_ID_JOURNAL); + journalManager->loader = MessageLoader_Init(0, 26, 366, HEAP_ID_JOURNAL); + journalManager->template = StringTemplate_Default(HEAP_ID_JOURNAL); + journalManager->strbuf = Strbuf_Init(128, HEAP_ID_JOURNAL); } -static void ov81_021D115C(UnkStruct_ov81_021D1610 *param0) +static void JournalController_FreeStringUtil(JournalManager *journalManager) { - MessageLoader_Free(param0->loader); - StringTemplate_Free(param0->template); - Strbuf_Free(param0->strbuf); + MessageLoader_Free(journalManager->loader); + StringTemplate_Free(journalManager->template); + Strbuf_Free(journalManager->strbuf); } -static int JournalController_IsOpeningTransitionDone(UnkStruct_ov81_021D1610 *param0) +static int JournalController_IsOpeningTransitionDone(JournalManager *journalManager) { if (IsScreenTransitionDone() == TRUE) { return JOURNAL_STATE_HANDLE_INPUT; @@ -327,10 +327,10 @@ static int JournalController_IsOpeningTransitionDone(UnkStruct_ov81_021D1610 *pa return JOURNAL_STATE_OPEN; } -static int JournalController_HandleInput(UnkStruct_ov81_021D1610 *param0) +static int JournalController_HandleInput(JournalManager *journalManager) { if (gCoreSys.pressedKeys & PAD_KEY_LEFT) { - if (JournalController_NewDirectionPageExists(param0, -1) == 1) { + if (JournalController_NewDirectionPageExists(journalManager, -1) == TRUE) { return JOURNAL_STATE_TURN_LEFT; } @@ -338,7 +338,7 @@ static int JournalController_HandleInput(UnkStruct_ov81_021D1610 *param0) } if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_KEY_RIGHT)) { - if (JournalController_NewDirectionPageExists(param0, 1) == 1) { + if (JournalController_NewDirectionPageExists(journalManager, 1) == TRUE) { return JOURNAL_STATE_TURN_RIGHT; } @@ -346,8 +346,8 @@ static int JournalController_HandleInput(UnkStruct_ov81_021D1610 *param0) } if (gCoreSys.pressedKeys & PAD_BUTTON_B) { - if (param0->page != 0) { - if (JournalController_NewDirectionPageExists(param0, -1) == 1) { + if (journalManager->page != 0) { + if (JournalController_NewDirectionPageExists(journalManager, -1) == TRUE) { return JOURNAL_STATE_TURN_LEFT; } } else { @@ -364,27 +364,27 @@ static int JournalController_HandleInput(UnkStruct_ov81_021D1610 *param0) return JOURNAL_STATE_HANDLE_INPUT; } -static int JournalController_TurnPageLeft(UnkStruct_ov81_021D1610 *param0) +static int JournalController_TurnPageLeft(JournalManager *journalManager) { - switch (param0->state) { + switch (journalManager->state) { case 0: - ov81_021D1360(param0); - ov81_021D140C(param0, param0->bgLayer3, param0->page - 1); - param0->page--; - ov81_021D164C(param0, param0->unk_1060 ^ 1); - param0->state = 1; + ov81_021D1360(journalManager); + JournalController_LoadNewPagePalette(journalManager, journalManager->bgLayer3, journalManager->page - 1); + journalManager->page--; + JournalPrinter_PrintEntry(journalManager, journalManager->unk_1060 ^ 1); + journalManager->state = 1; Sound_PlayEffect(SEQ_SE_DP_MEKURU3); break; case 1: - if (ov81_021D14E0(param0) == TRUE) { - param0->unk_105F = 0; - param0->state = 0; - param0->unk_1060 ^= 1; + if (ov81_021D14E0(journalManager) == TRUE) { + journalManager->unk_105F = 0; + journalManager->state = 0; + journalManager->unk_1060 ^= 1; - Bg_LoadToTilemapRect(param0->bgConfig, param0->bgLayer2, param0->unk_85C, 0, 0, 32, 32); - Bg_LoadToTilemapRect(param0->bgConfig, param0->bgLayer1, param0->unk_5C, 0, 0, 32, 32); - Bg_ScheduleTilemapTransfer(param0->bgConfig, param0->bgLayer2); - Bg_ScheduleTilemapTransfer(param0->bgConfig, param0->bgLayer1); + Bg_LoadToTilemapRect(journalManager->bgConfig, journalManager->bgLayer2, journalManager->tilemapBuffer_85C, 0, 0, 32, 32); + Bg_LoadToTilemapRect(journalManager->bgConfig, journalManager->bgLayer1, journalManager->tilemapBuffer_5C, 0, 0, 32, 32); + Bg_ScheduleTilemapTransfer(journalManager->bgConfig, journalManager->bgLayer2); + Bg_ScheduleTilemapTransfer(journalManager->bgConfig, journalManager->bgLayer1); return JOURNAL_STATE_HANDLE_INPUT; } @@ -393,21 +393,21 @@ static int JournalController_TurnPageLeft(UnkStruct_ov81_021D1610 *param0) return JOURNAL_STATE_TURN_LEFT; } -static int JournalController_TurnPageRight(UnkStruct_ov81_021D1610 *param0) +static int JournalController_TurnPageRight(JournalManager *journalManager) { - switch (param0->state) { + switch (journalManager->state) { case 0: - ov81_021D1360(param0); - param0->page++; - ov81_021D164C(param0, param0->unk_1060 ^ 1); - param0->state = 1; + ov81_021D1360(journalManager); + journalManager->page++; + JournalPrinter_PrintEntry(journalManager, journalManager->unk_1060 ^ 1); + journalManager->state = 1; Sound_PlayEffect(SEQ_SE_DP_MEKURU3); break; case 1: - if (ov81_021D156C(param0) == TRUE) { - param0->unk_105F = 0; - param0->state = 0; - param0->unk_1060 ^= 1; + if (ov81_021D156C(journalManager) == TRUE) { + journalManager->unk_105F = 0; + journalManager->state = 0; + journalManager->unk_1060 ^= 1; return JOURNAL_STATE_HANDLE_INPUT; } @@ -416,31 +416,31 @@ static int JournalController_TurnPageRight(UnkStruct_ov81_021D1610 *param0) return JOURNAL_STATE_TURN_RIGHT; } -static int JournalController_IsClosingTransitionDone(UnkStruct_ov81_021D1610 *param0) +static int JournalController_IsClosingTransitionDone(JournalManager *journalManager) { return IsScreenTransitionDone(); } -static void ov81_021D1360(UnkStruct_ov81_021D1610 *param0) +static void ov81_021D1360(JournalManager *journalManager) { - if (param0->unk_1060 == 0) { - param0->bgLayer2 = 0; - param0->bgLayer1 = 2; - param0->bgLayer4 = 1; - param0->bgLayer3 = 3; + if (journalManager->unk_1060 == 0) { + journalManager->bgLayer2 = 0; + journalManager->bgLayer1 = 2; + journalManager->bgLayer4 = 1; + journalManager->bgLayer3 = 3; } else { - param0->bgLayer2 = 1; - param0->bgLayer1 = 3; - param0->bgLayer4 = 0; - param0->bgLayer3 = 2; + journalManager->bgLayer2 = 1; + journalManager->bgLayer1 = 3; + journalManager->bgLayer4 = 0; + journalManager->bgLayer3 = 2; } } -static u8 JournalController_PageExists(UnkStruct_ov81_021D1610 *param0, u8 param1) +static u8 JournalController_PageExists(JournalManager *journalManager, u8 page) { JournalEntryTitle journalEntryTitle; - JournalEntry_GetData(param0->journalEntry, &journalEntryTitle, JOURNAL_TITLE, param1); + JournalEntry_GetData(journalManager->journalEntry, &journalEntryTitle, JOURNAL_TITLE, page); if (journalEntryTitle.year == 0 && journalEntryTitle.month == 0 && journalEntryTitle.day == 0) { return FALSE; @@ -449,85 +449,85 @@ static u8 JournalController_PageExists(UnkStruct_ov81_021D1610 *param0, u8 param return TRUE; } -static u8 JournalController_NewDirectionPageExists(UnkStruct_ov81_021D1610 *param0, s8 pageChange) +static u8 JournalController_NewDirectionPageExists(JournalManager *journalManager, s8 pageChange) { if (pageChange == 1) { - if (param0->page != 9 && JournalController_PageExists(param0, param0->page + 1) == TRUE) { + if (journalManager->page != (MAX_JOURNAL_ENTRIES - 1) && JournalController_PageExists(journalManager, journalManager->page + 1) == TRUE) { return TRUE; } - } else if (param0->page != 0 && JournalController_PageExists(param0, param0->page - 1) == TRUE) { + } else if (journalManager->page != 0 && JournalController_PageExists(journalManager, journalManager->page - 1) == TRUE) { return TRUE; } return FALSE; } -static void ov81_021D140C(UnkStruct_ov81_021D1610 *param0, u8 bgLayer, u8 palette) +static void JournalController_LoadNewPagePalette(JournalManager *journalManager, u8 bgLayer, u8 palette) { - Bg_ChangeTilemapRectPalette(param0->bgConfig, bgLayer, 0, 0, 32, 32, palette); - Bg_ScheduleTilemapTransfer(param0->bgConfig, bgLayer); + Bg_ChangeTilemapRectPalette(journalManager->bgConfig, bgLayer, 0, 0, 32, 32, palette); + Bg_ScheduleTilemapTransfer(journalManager->bgConfig, bgLayer); } -static void ov81_021D1434(UnkStruct_ov81_021D1610 *param0) +static void ov81_021D1434(JournalManager *journalManager) { - u16 *v0 = Bg_GetTilemapBuffer(param0->bgConfig, 0); - MI_CpuCopy16(v0, param0->unk_85C, 0x800); + u16 *tilemapBuffer = Bg_GetTilemapBuffer(journalManager->bgConfig, 0); + MI_CpuCopy16(tilemapBuffer, journalManager->tilemapBuffer_85C, 0x800); } -static void ov81_021D1450(UnkStruct_ov81_021D1610 *param0, u16 *param1, u16 param2, u16 param3) +static void ov81_021D1450(JournalManager *journalManager, u16 *tilemapBufferSrc, u16 bgLayer, u16 param3) { - u16 *v0 = Bg_GetTilemapBuffer(param0->bgConfig, param2); + u16 *tilemapBuffer = Bg_GetTilemapBuffer(journalManager->bgConfig, bgLayer); u16 j, i; for (i = 0; i < 32; i++) { if (Unk_ov81_021D33E8[param3][i] == 0xff) { - Bg_FillTilemapRect(param0->bgConfig, param2, 0, i, 0, 1, 32, 0); + Bg_FillTilemapRect(journalManager->bgConfig, bgLayer, 0, i, 0, 1, 32, 0); continue; } for (j = 0; j < 32; j++) { - v0[j * 32 + i] = param1[j * 32 + Unk_ov81_021D33E8[param3][i]]; + tilemapBuffer[j * 32 + i] = tilemapBufferSrc[j * 32 + Unk_ov81_021D33E8[param3][i]]; } } - Bg_ScheduleTilemapTransfer(param0->bgConfig, param2); + Bg_ScheduleTilemapTransfer(journalManager->bgConfig, bgLayer); } -static u8 ov81_021D14E0(UnkStruct_ov81_021D1610 *param0) +static u8 ov81_021D14E0(JournalManager *journalManager) { - ov81_021D1450(param0, param0->unk_85C, param0->bgLayer2, param0->unk_105F); - ov81_021D1450(param0, param0->unk_5C, param0->bgLayer1, param0->unk_105F); - ov81_021D140C(param0, param0->bgLayer1, param0->page + 1); + ov81_021D1450(journalManager, journalManager->tilemapBuffer_85C, journalManager->bgLayer2, journalManager->unk_105F); + ov81_021D1450(journalManager, journalManager->tilemapBuffer_5C, journalManager->bgLayer1, journalManager->unk_105F); + JournalController_LoadNewPagePalette(journalManager, journalManager->bgLayer1, journalManager->page + 1); - param0->unk_105F++; + journalManager->unk_105F++; - if (param0->unk_105F == 9) { - Bg_SetPriority(param0->bgLayer4, 0); - Bg_SetPriority(param0->bgLayer3, 1); - Bg_SetPriority(param0->bgLayer2, 2); - Bg_SetPriority(param0->bgLayer1, 3); + if (journalManager->unk_105F == 9) { + Bg_SetPriority(journalManager->bgLayer4, 0); + Bg_SetPriority(journalManager->bgLayer3, 1); + Bg_SetPriority(journalManager->bgLayer2, 2); + Bg_SetPriority(journalManager->bgLayer1, 3); return TRUE; } return FALSE; } -static u8 ov81_021D156C(UnkStruct_ov81_021D1610 *param0) +static u8 ov81_021D156C(JournalManager *journalManager) { - ov81_021D1450(param0, param0->unk_85C, param0->bgLayer4, 8 - param0->unk_105F); - ov81_021D1450(param0, param0->unk_5C, param0->bgLayer3, 8 - param0->unk_105F); - ov81_021D140C(param0, param0->bgLayer3, param0->page); - - if (param0->unk_105F == 1) { - Bg_SetPriority(param0->bgLayer4, 0); - Bg_SetPriority(param0->bgLayer3, 1); - Bg_SetPriority(param0->bgLayer2, 2); - Bg_SetPriority(param0->bgLayer1, 3); + ov81_021D1450(journalManager, journalManager->tilemapBuffer_85C, journalManager->bgLayer4, 8 - journalManager->unk_105F); + ov81_021D1450(journalManager, journalManager->tilemapBuffer_5C, journalManager->bgLayer3, 8 - journalManager->unk_105F); + JournalController_LoadNewPagePalette(journalManager, journalManager->bgLayer3, journalManager->page); + + if (journalManager->unk_105F == 1) { + Bg_SetPriority(journalManager->bgLayer4, 0); + Bg_SetPriority(journalManager->bgLayer3, 1); + Bg_SetPriority(journalManager->bgLayer2, 2); + Bg_SetPriority(journalManager->bgLayer1, 3); } - param0->unk_105F++; + journalManager->unk_105F++; - if (param0->unk_105F == 9) { + if (journalManager->unk_105F == 9) { return TRUE; } diff --git a/src/applications/journal_display/journal_printer.c b/src/applications/journal_display/journal_printer.c index 6d07959f5f..107e1f6918 100644 --- a/src/applications/journal_display/journal_printer.c +++ b/src/applications/journal_display/journal_printer.c @@ -7,8 +7,9 @@ #include "consts/gender.h" #include "consts/journal.h" -#include "applications/journal_display/struct_ov81_021D1610.h" +#include "applications/journal_display/journal_controller.h" #include "text/gmm/message_bank_journal_entries.h" +#include "text/gmm/message_bank_location_names.h" #include "bg_window.h" #include "font.h" @@ -22,71 +23,71 @@ #include "text.h" #include "trainer_data.h" -static u8 JournalDisplay_PrintTitle(UnkStruct_ov81_021D1610 *param0, Window *window1, Window *window2); -static void JournalDisplay_PrintLocationEvents(UnkStruct_ov81_021D1610 *param0, Window *window); -static void JournalDisplay_PrintPokemonEvent(UnkStruct_ov81_021D1610 *param0, Window *window); -static void JournalDisplay_PrintTrainerEvent(UnkStruct_ov81_021D1610 *param0, Window *window); -static void JournalDisplay_PrintOnlineEvents(UnkStruct_ov81_021D1610 *param0, Window *window); -static void JournalDisplay_PrintRestedAtHome(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); -static void JournalDisplay_PrintLeftResearchLab(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); -static void JournalDisplay_PrintUsedPCBox(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); -static void JournalDisplay_PrintShoppedAtMart(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); -static void JournalDisplay_PrintLotsOfShoppingAtMart(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); -static void JournalDisplay_PrintSoldALittleAtMart(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); -static void JournalDisplay_PrintSoldALotAtMart(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); -static void JournalDisplay_PrintDidBusinessAtMart(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); -static void JournalDisplay_PrintGymWasTooTough(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); -static void JournalDisplay_PrintBeatGymLeader(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); -static void JournalDisplay_PrintBeatEliteFourMember(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); -static void JournalDisplay_PrintBeatChampion(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); -static void JournalDisplay_PrintArrivedInLocation(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); -static void JournalDisplay_PrintLeftCave(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); -static void JournalDisplay_PrintLeftBuilding(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); -static void JournalDisplay_PrintGameCorner(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); -static void JournalDisplay_PrintSafariGame(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); -static void JournalDisplay_PrintItemWasObtained(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); -static void JournalDisplay_PrintUsedRockSmash(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); -static void JournalDisplay_PrintUsedCut(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); -static void JournalDisplay_PrintFlewToLocation(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); -static void JournalDisplay_PrintUsedDefog(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); -static void JournalDisplay_PrintUsedStrength(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); -static void JournalDisplay_PrintUsedSurf(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); -static void JournalDisplay_PrintUsedRockClimb(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); -static void JournalDisplay_PrintUsedWaterfall(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); -static void JournalDisplay_PrintUsedFlash(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); -static void JournalDisplay_PrintWarpedToLocation(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); -static void JournalDisplay_PrintUsedDig(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); -static void JournalDisplay_PrintLuredPokemon(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); -static void JournalDisplay_PrintUsedSoftboiled(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); -static void JournalDisplay_PrintUsedMilkDrink(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); -static void JournalDisplay_PrintDugUnderground(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); -static void JournalDisplay_PrintBuiltSecretBase(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); -static void JournalDisplay_PrintPlayedAtBattleFacility(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row, int eventType); -static void JournalDisplay_PrintPokemonCaught(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryMon *journalEntryMon); -static void JournalDisplay_PrintPokemonDefeated(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryMon *journalEntryMon); -static void JournalDisplay_PrintSingleBattleEvent(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row); -static void JournalDisplay_PrintDoubleBattleEvent(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row); -static void JournalDisplay_PrintMultiBattleEvent(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row); -static void JournalDisplay_PrintMixSingleBattleEvent(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row); -static void JournalDisplay_PrintMixMultiBattleEvent(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row); -static void JournalDisplay_PrintGreetedInUnionRoom(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row); -static void JournalDisplay_PrintGotPokemonFromTrade(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row); -static void JournalDisplay_PrintDrewPictures(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row); -static void JournalDisplay_PrintGotPokemonInFriendTrade(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row); -static void JournalDisplay_PrintChattedWithOthers(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row); -static void JournalDisplay_PrintUnionBattleEvent(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row); -static void JournalDisplay_PrintMixedRecords(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row); -static void JournalDisplay_PrintPlacedInContest(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row); -static void JournalDisplay_PrintMadePoffins(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row); -static void JournalDisplay_PrintGotPokemonGTS(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row); -static void JournalDisplay_PrintBattleRoom(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row); -static void JournalDisplay_PrintSpinTrade(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row); -static void JournalDisplay_PrintMiscEvent1(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row, int eventType); -static void JournalDisplay_PrintChattedInPlaza(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row); -static void JournalDisplay_PrintGotTapToy(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row); -static void JournalDisplay_PrintPlazaMinigame(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row); -static void JournalDisplay_PrintMiscEvent2(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row, int eventType); -static void JournalDisplay_PrintWiFiClub(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row); +static u8 JournalPrinter_PrintTitle(JournalManager *journalManager, Window *window1, Window *window2); +static void JournalPrinter_PrintLocationEvents(JournalManager *journalManager, Window *window); +static void JournalPrinter_PrintPokemonEvent(JournalManager *journalManager, Window *window); +static void JournalPrinter_PrintTrainerEvent(JournalManager *journalManager, Window *window); +static void JournalPrinter_PrintOnlineEvents(JournalManager *journalManager, Window *window); +static void JournalPrinter_PrintRestedAtHome(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); +static void JournalPrinter_PrintLeftResearchLab(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); +static void JournalPrinter_PrintUsedPCBox(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); +static void JournalPrinter_PrintShoppedAtMart(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); +static void JournalPrinter_PrintLotsOfShoppingAtMart(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); +static void JournalPrinter_PrintSoldALittleAtMart(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); +static void JournalPrinter_PrintSoldALotAtMart(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); +static void JournalPrinter_PrintDidBusinessAtMart(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); +static void JournalPrinter_PrintGymWasTooTough(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); +static void JournalPrinter_PrintBeatGymLeader(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); +static void JournalPrinter_PrintBeatEliteFourMember(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); +static void JournalPrinter_PrintBeatChampion(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); +static void JournalPrinter_PrintArrivedInLocation(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); +static void JournalPrinter_PrintLeftCave(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); +static void JournalPrinter_PrintLeftBuilding(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); +static void JournalPrinter_PrintGameCorner(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); +static void JournalPrinter_PrintSafariGame(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); +static void JournalPrinter_PrintItemWasObtained(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); +static void JournalPrinter_PrintUsedRockSmash(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); +static void JournalPrinter_PrintUsedCut(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); +static void JournalPrinter_PrintFlewToLocation(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); +static void JournalPrinter_PrintUsedDefog(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); +static void JournalPrinter_PrintUsedStrength(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); +static void JournalPrinter_PrintUsedSurf(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); +static void JournalPrinter_PrintUsedRockClimb(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); +static void JournalPrinter_PrintUsedWaterfall(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); +static void JournalPrinter_PrintUsedFlash(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); +static void JournalPrinter_PrintWarpedToLocation(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); +static void JournalPrinter_PrintUsedDig(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); +static void JournalPrinter_PrintLuredPokemon(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); +static void JournalPrinter_PrintUsedSoftboiled(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); +static void JournalPrinter_PrintUsedMilkDrink(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); +static void JournalPrinter_PrintDugUnderground(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); +static void JournalPrinter_PrintBuiltSecretBase(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row); +static void JournalPrinter_PrintPlayedAtBattleFacility(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row, int eventType); +static void JournalPrinter_PrintPokemonCaught(JournalManager *journalManager, Window *window, JournalEntryMon *journalEntryMon); +static void JournalPrinter_PrintPokemonDefeated(JournalManager *journalManager, Window *window, JournalEntryMon *journalEntryMon); +static void JournalPrinter_PrintSingleBattleEvent(JournalManager *journalManager, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row); +static void JournalPrinter_PrintDoubleBattleEvent(JournalManager *journalManager, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row); +static void JournalPrinter_PrintMultiBattleEvent(JournalManager *journalManager, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row); +static void JournalPrinter_PrintMixSingleBattleEvent(JournalManager *journalManager, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row); +static void JournalPrinter_PrintMixMultiBattleEvent(JournalManager *journalManager, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row); +static void JournalPrinter_PrintGreetedInUnionRoom(JournalManager *journalManager, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row); +static void JournalPrinter_PrintGotPokemonFromTrade(JournalManager *journalManager, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row); +static void JournalPrinter_PrintDrewPictures(JournalManager *journalManager, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row); +static void JournalPrinter_PrintGotPokemonInFriendTrade(JournalManager *journalManager, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row); +static void JournalPrinter_PrintChattedWithOthers(JournalManager *journalManager, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row); +static void JournalPrinter_PrintUnionBattleEvent(JournalManager *journalManager, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row); +static void JournalPrinter_PrintMixedRecords(JournalManager *journalManager, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row); +static void JournalPrinter_PrintPlacedInContest(JournalManager *journalManager, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row); +static void JournalPrinter_PrintMadePoffins(JournalManager *journalManager, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row); +static void JournalPrinter_PrintGotPokemonGTS(JournalManager *journalManager, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row); +static void JournalPrinter_PrintBattleRoom(JournalManager *journalManager, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row); +static void JournalPrinter_PrintSpinTrade(JournalManager *journalManager, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row); +static void JournalPrinter_PrintMiscEvent1(JournalManager *journalManager, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row, int eventType); +static void JournalPrinter_PrintChattedInPlaza(JournalManager *journalManager, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row); +static void JournalPrinter_PrintGotTapToy(JournalManager *journalManager, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row); +static void JournalPrinter_PrintPlazaMinigame(JournalManager *journalManager, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row); +static void JournalPrinter_PrintMiscEvent2(JournalManager *journalManager, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row, int eventType); +static void JournalPrinter_PrintWiFiClub(JournalManager *journalManager, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row); static const WindowTemplate Unk_ov81_021D3508[] = { { 0x0, 0x2, 0x2, 0x18, 0x2, 0xF, 0x1 }, @@ -95,694 +96,694 @@ static const WindowTemplate Unk_ov81_021D3508[] = { { 0x1, 0x4, 0x4, 0x1B, 0x12, 0xF, 0x31 } }; -void ov81_021D1610(UnkStruct_ov81_021D1610 *param0) +void JournalPrinter_AddWindows(JournalManager *journalManager) { u32 i; for (i = 0; i < 4; i++) { - Window_AddFromTemplate(param0->bgConfig, ¶m0->window[i], &Unk_ov81_021D3508[i]); + Window_AddFromTemplate(journalManager->bgConfig, &journalManager->window[i], &Unk_ov81_021D3508[i]); } } -void ov81_021D1634(UnkStruct_ov81_021D1610 *param0) +void JournalPrinter_RemoveWindows(JournalManager *journalManager) { u32 i; for (i = 0; i < 4; i++) { - Window_Remove(¶m0->window[i]); + Window_Remove(&journalManager->window[i]); } } -void ov81_021D164C(UnkStruct_ov81_021D1610 *param0, u32 param1) +void JournalPrinter_PrintEntry(JournalManager *journalManager, u32 param1) { - Window *v0; - Window *v1; + Window *window1; + Window *window2; if (param1 == 0) { - v0 = ¶m0->window[0]; - v1 = ¶m0->window[1]; + window1 = &journalManager->window[0]; + window2 = &journalManager->window[1]; } else { - v0 = ¶m0->window[2]; - v1 = ¶m0->window[3]; + window1 = &journalManager->window[2]; + window2 = &journalManager->window[3]; } - Window_FillTilemap(v0, 0); - Window_FillTilemap(v1, 0); + Window_FillTilemap(window1, 0); + Window_FillTilemap(window2, 0); - if (JournalDisplay_PrintTitle(param0, v0, v1) == 1) { - JournalDisplay_PrintLocationEvents(param0, v1); - JournalDisplay_PrintPokemonEvent(param0, v1); - JournalDisplay_PrintTrainerEvent(param0, v1); - JournalDisplay_PrintOnlineEvents(param0, v1); + if (JournalPrinter_PrintTitle(journalManager, window1, window2) == 1) { + JournalPrinter_PrintLocationEvents(journalManager, window2); + JournalPrinter_PrintPokemonEvent(journalManager, window2); + JournalPrinter_PrintTrainerEvent(journalManager, window2); + JournalPrinter_PrintOnlineEvents(journalManager, window2); } - Window_ScheduleCopyToVRAM(v0); - Window_ScheduleCopyToVRAM(v1); + Window_ScheduleCopyToVRAM(window1); + Window_ScheduleCopyToVRAM(window2); } -static u8 JournalDisplay_PrintTitle(UnkStruct_ov81_021D1610 *param0, Window *window1, Window *window2) +static u8 JournalPrinter_PrintTitle(JournalManager *journalManager, Window *window1, Window *window2) { JournalEntryTitle journalEntryTitle; - Strbuf *v1; - u32 v2; + Strbuf *strbuf; + u32 xOffset; - JournalEntry_GetData(param0->journalEntry, &journalEntryTitle, JOURNAL_TITLE, param0->page); + JournalEntry_GetData(journalManager->journalEntry, &journalEntryTitle, JOURNAL_TITLE, journalManager->page); if (journalEntryTitle.year == 0 && journalEntryTitle.month == 0 && journalEntryTitle.day == 0) { return 0; } - v1 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_date); + strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_date); - StringTemplate_SetMonthName(param0->template, 0, journalEntryTitle.month); - StringTemplate_SetNumber(param0->template, 1, journalEntryTitle.day, 2, 0, 1); - StringTemplate_Format(param0->template, param0->strbuf, v1); - Strbuf_Free(v1); - Text_AddPrinterWithParamsAndColor(window1, FONT_SYSTEM, param0->strbuf, 0, 0, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + StringTemplate_SetMonthName(journalManager->template, 0, journalEntryTitle.month); + StringTemplate_SetNumber(journalManager->template, 1, journalEntryTitle.day, 2, PADDING_MODE_NONE, CHARSET_MODE_EN); + StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); + Strbuf_Free(strbuf); + Text_AddPrinterWithParamsAndColor(window1, FONT_SYSTEM, journalManager->strbuf, 0, 0, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - v2 = Font_CalcStrbufWidth(FONT_SYSTEM, param0->strbuf, 0); - v1 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_sunday + journalEntryTitle.week); - Text_AddPrinterWithParamsAndColor(window1, FONT_SYSTEM, v1, v2 + 12, 0, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - Strbuf_Free(v1); + xOffset = Font_CalcStrbufWidth(FONT_SYSTEM, journalManager->strbuf, 0); + strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_sunday + journalEntryTitle.week); + Text_AddPrinterWithParamsAndColor(window1, FONT_SYSTEM, strbuf, xOffset + 12, 0, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Strbuf_Free(strbuf); - v1 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_started_from_location); - StringTemplate_SetLocationName(param0->template, 0, MapHeader_GetMapLabelTextID(journalEntryTitle.mapID)); + strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_started_from_location); + StringTemplate_SetLocationName(journalManager->template, 0, MapHeader_GetMapLabelTextID(journalEntryTitle.mapID)); - StringTemplate_Format(param0->template, param0->strbuf, v1); - Text_AddPrinterWithParamsAndColor(window2, FONT_SYSTEM, param0->strbuf, 0, 0, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - Strbuf_Free(v1); + StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); + Text_AddPrinterWithParamsAndColor(window2, FONT_SYSTEM, journalManager->strbuf, 0, 0, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Strbuf_Free(strbuf); return 1; } -static void JournalDisplay_PrintLocationEvents(UnkStruct_ov81_021D1610 *param0, Window *window) +static void JournalPrinter_PrintLocationEvents(JournalManager *journalManager, Window *window) { JournalEntryLocationEvent journalEntryLocationEvent[MAX_JOURNAL_LOCATION_EVENTS]; u32 i; - JournalEntry_GetData(param0->journalEntry, &journalEntryLocationEvent[0], JOURNAL_LOCATION, param0->page); + JournalEntry_GetData(journalManager->journalEntry, &journalEntryLocationEvent[0], JOURNAL_LOCATION, journalManager->page); for (i = 0; i < MAX_JOURNAL_LOCATION_EVENTS; i++) { switch (journalEntryLocationEvent[i].eventType) { case LOCATION_EVENT_NONE: return; case LOCATION_EVENT_RESTED_AT_HOME: - JournalDisplay_PrintRestedAtHome(param0, window, &journalEntryLocationEvent[i], i); + JournalPrinter_PrintRestedAtHome(journalManager, window, &journalEntryLocationEvent[i], i); break; case LOCATION_EVENT_LEFT_RESEARCH_LAB: - JournalDisplay_PrintLeftResearchLab(param0, window, &journalEntryLocationEvent[i], i); + JournalPrinter_PrintLeftResearchLab(journalManager, window, &journalEntryLocationEvent[i], i); break; case LOCATION_EVENT_USED_PC_BOX: - JournalDisplay_PrintUsedPCBox(param0, window, &journalEntryLocationEvent[i], i); + JournalPrinter_PrintUsedPCBox(journalManager, window, &journalEntryLocationEvent[i], i); break; case LOCATION_EVENT_SHOPPED_AT_MART: - JournalDisplay_PrintShoppedAtMart(param0, window, &journalEntryLocationEvent[i], i); + JournalPrinter_PrintShoppedAtMart(journalManager, window, &journalEntryLocationEvent[i], i); break; case LOCATION_EVENT_LOTS_OF_SHOPPING: - JournalDisplay_PrintLotsOfShoppingAtMart(param0, window, &journalEntryLocationEvent[i], i); + JournalPrinter_PrintLotsOfShoppingAtMart(journalManager, window, &journalEntryLocationEvent[i], i); break; case LOCATION_EVENT_SOLD_A_LITTLE: - JournalDisplay_PrintSoldALittleAtMart(param0, window, &journalEntryLocationEvent[i], i); + JournalPrinter_PrintSoldALittleAtMart(journalManager, window, &journalEntryLocationEvent[i], i); break; case LOCATION_EVENT_SOLD_A_LOT: - JournalDisplay_PrintSoldALotAtMart(param0, window, &journalEntryLocationEvent[i], i); + JournalPrinter_PrintSoldALotAtMart(journalManager, window, &journalEntryLocationEvent[i], i); break; case LOCATION_EVENT_BUSINESS_AT_MART: - JournalDisplay_PrintDidBusinessAtMart(param0, window, &journalEntryLocationEvent[i], i); + JournalPrinter_PrintDidBusinessAtMart(journalManager, window, &journalEntryLocationEvent[i], i); break; case LOCATION_EVENT_GYM_WAS_TOO_TOUGH: - JournalDisplay_PrintGymWasTooTough(param0, window, &journalEntryLocationEvent[i], i); + JournalPrinter_PrintGymWasTooTough(journalManager, window, &journalEntryLocationEvent[i], i); break; case LOCATION_EVENT_BEAT_GYM_LEADER: - JournalDisplay_PrintBeatGymLeader(param0, window, &journalEntryLocationEvent[i], i); + JournalPrinter_PrintBeatGymLeader(journalManager, window, &journalEntryLocationEvent[i], i); break; case LOCATION_EVENT_BEAT_ELITE_FOUR_MEMBER: - JournalDisplay_PrintBeatEliteFourMember(param0, window, &journalEntryLocationEvent[i], i); + JournalPrinter_PrintBeatEliteFourMember(journalManager, window, &journalEntryLocationEvent[i], i); break; case LOCATION_EVENT_BEAT_CHAMPION: - JournalDisplay_PrintBeatChampion(param0, window, &journalEntryLocationEvent[i], i); + JournalPrinter_PrintBeatChampion(journalManager, window, &journalEntryLocationEvent[i], i); break; case LOCATION_EVENT_ARRIVED_IN_LOCATION: - JournalDisplay_PrintArrivedInLocation(param0, window, &journalEntryLocationEvent[i], i); + JournalPrinter_PrintArrivedInLocation(journalManager, window, &journalEntryLocationEvent[i], i); break; case LOCATION_EVENT_LEFT_CAVE: - JournalDisplay_PrintLeftCave(param0, window, &journalEntryLocationEvent[i], i); + JournalPrinter_PrintLeftCave(journalManager, window, &journalEntryLocationEvent[i], i); break; case LOCATION_EVENT_LEFT_BUILDING: - JournalDisplay_PrintLeftBuilding(param0, window, &journalEntryLocationEvent[i], i); + JournalPrinter_PrintLeftBuilding(journalManager, window, &journalEntryLocationEvent[i], i); break; case LOCATION_EVENT_GAME_CORNER: - JournalDisplay_PrintGameCorner(param0, window, &journalEntryLocationEvent[i], i); + JournalPrinter_PrintGameCorner(journalManager, window, &journalEntryLocationEvent[i], i); break; case LOCATION_EVENT_SAFARI_GAME: - JournalDisplay_PrintSafariGame(param0, window, &journalEntryLocationEvent[i], i); + JournalPrinter_PrintSafariGame(journalManager, window, &journalEntryLocationEvent[i], i); break; case LOCATION_EVENT_ITEM_WAS_OBTAINED: - JournalDisplay_PrintItemWasObtained(param0, window, &journalEntryLocationEvent[i], i); + JournalPrinter_PrintItemWasObtained(journalManager, window, &journalEntryLocationEvent[i], i); break; case LOCATION_EVENT_USED_ROCK_SMASH: - JournalDisplay_PrintUsedRockSmash(param0, window, &journalEntryLocationEvent[i], i); + JournalPrinter_PrintUsedRockSmash(journalManager, window, &journalEntryLocationEvent[i], i); break; case LOCATION_EVENT_USED_CUT: - JournalDisplay_PrintUsedCut(param0, window, &journalEntryLocationEvent[i], i); + JournalPrinter_PrintUsedCut(journalManager, window, &journalEntryLocationEvent[i], i); break; case LOCATION_EVENT_FLEW_TO_LOCATION: - JournalDisplay_PrintFlewToLocation(param0, window, &journalEntryLocationEvent[i], i); + JournalPrinter_PrintFlewToLocation(journalManager, window, &journalEntryLocationEvent[i], i); break; case LOCATION_EVENT_USED_DEFOG: - JournalDisplay_PrintUsedDefog(param0, window, &journalEntryLocationEvent[i], i); + JournalPrinter_PrintUsedDefog(journalManager, window, &journalEntryLocationEvent[i], i); break; case LOCATION_EVENT_USED_STRENGTH: - JournalDisplay_PrintUsedStrength(param0, window, &journalEntryLocationEvent[i], i); + JournalPrinter_PrintUsedStrength(journalManager, window, &journalEntryLocationEvent[i], i); break; case LOCATION_EVENT_USED_SURF: - JournalDisplay_PrintUsedSurf(param0, window, &journalEntryLocationEvent[i], i); + JournalPrinter_PrintUsedSurf(journalManager, window, &journalEntryLocationEvent[i], i); break; case LOCATION_EVENT_USED_ROCK_CLIMB: - JournalDisplay_PrintUsedRockClimb(param0, window, &journalEntryLocationEvent[i], i); + JournalPrinter_PrintUsedRockClimb(journalManager, window, &journalEntryLocationEvent[i], i); break; case LOCATION_EVENT_USED_WATERFALL: - JournalDisplay_PrintUsedWaterfall(param0, window, &journalEntryLocationEvent[i], i); + JournalPrinter_PrintUsedWaterfall(journalManager, window, &journalEntryLocationEvent[i], i); break; case LOCATION_EVENT_USED_FLASH: - JournalDisplay_PrintUsedFlash(param0, window, &journalEntryLocationEvent[i], i); + JournalPrinter_PrintUsedFlash(journalManager, window, &journalEntryLocationEvent[i], i); break; case LOCATION_EVENT_WARPED_TO_LOCATION: - JournalDisplay_PrintWarpedToLocation(param0, window, &journalEntryLocationEvent[i], i); + JournalPrinter_PrintWarpedToLocation(journalManager, window, &journalEntryLocationEvent[i], i); break; case LOCATION_EVENT_USED_DIG: - JournalDisplay_PrintUsedDig(param0, window, &journalEntryLocationEvent[i], i); + JournalPrinter_PrintUsedDig(journalManager, window, &journalEntryLocationEvent[i], i); break; case LOCATION_EVENT_LURED_POKEMON: - JournalDisplay_PrintLuredPokemon(param0, window, &journalEntryLocationEvent[i], i); + JournalPrinter_PrintLuredPokemon(journalManager, window, &journalEntryLocationEvent[i], i); break; case LOCATION_EVENT_USED_SOFTBOILED: - JournalDisplay_PrintUsedSoftboiled(param0, window, &journalEntryLocationEvent[i], i); + JournalPrinter_PrintUsedSoftboiled(journalManager, window, &journalEntryLocationEvent[i], i); break; case LOCATION_EVENT_USED_MILK_DRINK: - JournalDisplay_PrintUsedMilkDrink(param0, window, &journalEntryLocationEvent[i], i); + JournalPrinter_PrintUsedMilkDrink(journalManager, window, &journalEntryLocationEvent[i], i); break; case LOCATION_EVENT_DUG_UNDERGROUND: - JournalDisplay_PrintDugUnderground(param0, window, &journalEntryLocationEvent[i], i); + JournalPrinter_PrintDugUnderground(journalManager, window, &journalEntryLocationEvent[i], i); break; case LOCATION_EVENT_BUILT_SECRET_BASE: - JournalDisplay_PrintBuiltSecretBase(param0, window, &journalEntryLocationEvent[i], i); + JournalPrinter_PrintBuiltSecretBase(journalManager, window, &journalEntryLocationEvent[i], i); break; case LOCATION_EVENT_BATTLE_TOWER: case LOCATION_EVENT_BATTLE_FACTORY: case LOCATION_EVENT_BATTLE_CASTLE: case LOCATION_EVENT_BATTLE_HALL: case LOCATION_EVENT_BATTLE_ARCADE: - JournalDisplay_PrintPlayedAtBattleFacility(param0, window, &journalEntryLocationEvent[i], i, journalEntryLocationEvent[i].eventType); + JournalPrinter_PrintPlayedAtBattleFacility(journalManager, window, &journalEntryLocationEvent[i], i, journalEntryLocationEvent[i].eventType); break; } } } -static void JournalDisplay_PrintPokemonEvent(UnkStruct_ov81_021D1610 *param0, Window *window) +static void JournalPrinter_PrintPokemonEvent(JournalManager *journalManager, Window *window) { JournalEntryMon journalEntryMon; - JournalEntry_GetData(param0->journalEntry, &journalEntryMon, JOURNAL_MON, param0->page); + JournalEntry_GetData(journalManager->journalEntry, &journalEntryMon, JOURNAL_MON, journalManager->page); switch (journalEntryMon.battleResult) { case 0: return; case POKEMON_CAUGHT: - JournalDisplay_PrintPokemonCaught(param0, window, &journalEntryMon); + JournalPrinter_PrintPokemonCaught(journalManager, window, &journalEntryMon); break; case POKEMON_DEFEATED: - JournalDisplay_PrintPokemonDefeated(param0, window, &journalEntryMon); + JournalPrinter_PrintPokemonDefeated(journalManager, window, &journalEntryMon); break; } } -static void JournalDisplay_PrintTrainerEvent(UnkStruct_ov81_021D1610 *param0, Window *window) +static void JournalPrinter_PrintTrainerEvent(JournalManager *journalManager, Window *window) { JournalEntryTrainer journalEntryTrainer; - Strbuf *v1; + Strbuf *strbuf; u32 strLength; - JournalEntry_GetData(param0->journalEntry, &journalEntryTrainer, JOURNAL_TRAINER, param0->page); + JournalEntry_GetData(journalManager->journalEntry, &journalEntryTrainer, JOURNAL_TRAINER, journalManager->page); if (journalEntryTrainer.standard == 0) { return; } - Strbuf *v3 = MessageBank_GetNewStrbufFromNARC(26, 433, MapHeader_GetMapLabelTextID(journalEntryTrainer.mapID), 42); - strLength = Strbuf_Length(v3); - Strbuf_Free(v3); + Strbuf *name = MessageBank_GetNewStrbufFromNARC(26, 433, MapHeader_GetMapLabelTextID(journalEntryTrainer.mapID), 42); + strLength = Strbuf_Length(name); + Strbuf_Free(name); if (TrainerData_LoadParam(journalEntryTrainer.trainerID, TRDATA_CLASS) == TRAINER_CLASS_RIVAL) { - v3 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_rival_name); - StringTemplate_SetRivalName(param0->template, 1, param0->saveData); - StringTemplate_Format(param0->template, param0->strbuf, v3); - strLength += Strbuf_Length(param0->strbuf); - Strbuf_Free(v3); + name = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_rival_name); + StringTemplate_SetRivalName(journalManager->template, 1, journalManager->saveData); + StringTemplate_Format(journalManager->template, journalManager->strbuf, name); + strLength += Strbuf_Length(journalManager->strbuf); + Strbuf_Free(name); } else { - v3 = MessageBank_GetNewStrbufFromNARC(26, 618, journalEntryTrainer.trainerID, 42); - strLength += Strbuf_Length(v3); - Strbuf_Free(v3); - StringTemplate_SetTrainerName(param0->template, 1, journalEntryTrainer.trainerID); + name = MessageBank_GetNewStrbufFromNARC(26, 618, journalEntryTrainer.trainerID, 42); + strLength += Strbuf_Length(name); + Strbuf_Free(name); + StringTemplate_SetTrainerName(journalManager->template, 1, journalEntryTrainer.trainerID); } if (strLength <= 14) { - v1 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_battled_trainer_at_location); + strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_battled_trainer_at_location); } else if (strLength <= 16) { - v1 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_beat_trainer_at_location); + strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_beat_trainer_at_location); } else if (strLength <= 19) { - v1 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_beat_trainer_at_location_2); + strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_beat_trainer_at_location_2); } else { - v1 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_met_locations_trainer); + strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_met_locations_trainer); } - StringTemplate_SetLocationName(param0->template, 0, MapHeader_GetMapLabelTextID(journalEntryTrainer.mapID)); - StringTemplate_Format(param0->template, param0->strbuf, v1); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, param0->strbuf, 0, ((16 * 4 + 16) + 16), TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - Strbuf_Free(v1); + StringTemplate_SetLocationName(journalManager->template, 0, MapHeader_GetMapLabelTextID(journalEntryTrainer.mapID)); + StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, ((16 * 4 + 16) + 16), TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Strbuf_Free(strbuf); } -static void JournalDisplay_PrintOnlineEvents(UnkStruct_ov81_021D1610 *param0, Window *window) +static void JournalPrinter_PrintOnlineEvents(JournalManager *journalManager, Window *window) { JournalEntryOnlineEvent journalEntryOnlineEvent[MAX_JOURNAL_ONLINE_EVENTS]; u32 i; - JournalEntry_GetData(param0->journalEntry, &journalEntryOnlineEvent[0], JOURNAL_ONLINE_EVENT, param0->page); + JournalEntry_GetData(journalManager->journalEntry, &journalEntryOnlineEvent[0], JOURNAL_ONLINE_EVENT, journalManager->page); for (i = 0; i < MAX_JOURNAL_ONLINE_EVENTS; i++) { switch (journalEntryOnlineEvent[i].eventType) { case ONLINE_EVENT_NONE: return; case ONLINE_EVENT_SINGLE_BATTLE: - JournalDisplay_PrintSingleBattleEvent(param0, window, &journalEntryOnlineEvent[i], i); + JournalPrinter_PrintSingleBattleEvent(journalManager, window, &journalEntryOnlineEvent[i], i); break; case ONLINE_EVENT_DOUBLE_BATTLE: - JournalDisplay_PrintDoubleBattleEvent(param0, window, &journalEntryOnlineEvent[i], i); + JournalPrinter_PrintDoubleBattleEvent(journalManager, window, &journalEntryOnlineEvent[i], i); break; case ONLINE_EVENT_MULTI_BATTLE: - JournalDisplay_PrintMultiBattleEvent(param0, window, &journalEntryOnlineEvent[i], i); + JournalPrinter_PrintMultiBattleEvent(journalManager, window, &journalEntryOnlineEvent[i], i); break; case ONLINE_EVENT_MIX_SINGLE_BATTLE: - JournalDisplay_PrintMixSingleBattleEvent(param0, window, &journalEntryOnlineEvent[i], i); + JournalPrinter_PrintMixSingleBattleEvent(journalManager, window, &journalEntryOnlineEvent[i], i); break; case ONLINE_EVENT_MIX_MULTI_BATTLE: - JournalDisplay_PrintMixMultiBattleEvent(param0, window, &journalEntryOnlineEvent[i], i); + JournalPrinter_PrintMixMultiBattleEvent(journalManager, window, &journalEntryOnlineEvent[i], i); break; case ONLINE_EVENT_GREETED_IN_UNION_ROOM: - JournalDisplay_PrintGreetedInUnionRoom(param0, window, &journalEntryOnlineEvent[i], i); + JournalPrinter_PrintGreetedInUnionRoom(journalManager, window, &journalEntryOnlineEvent[i], i); break; case ONLINE_EVENT_GOT_POKEMON_FROM_TRADE: - JournalDisplay_PrintGotPokemonFromTrade(param0, window, &journalEntryOnlineEvent[i], i); + JournalPrinter_PrintGotPokemonFromTrade(journalManager, window, &journalEntryOnlineEvent[i], i); break; case ONLINE_EVENT_DREW_PICTURES: - JournalDisplay_PrintDrewPictures(param0, window, &journalEntryOnlineEvent[i], i); + JournalPrinter_PrintDrewPictures(journalManager, window, &journalEntryOnlineEvent[i], i); break; case ONLINE_EVENT_GOT_POKEMON_IN_FRIEND_TRADE: - JournalDisplay_PrintGotPokemonInFriendTrade(param0, window, &journalEntryOnlineEvent[i], i); + JournalPrinter_PrintGotPokemonInFriendTrade(journalManager, window, &journalEntryOnlineEvent[i], i); break; case ONLINE_EVENT_CHATTED_WITH_OTHERS: - JournalDisplay_PrintChattedWithOthers(param0, window, &journalEntryOnlineEvent[i], i); + JournalPrinter_PrintChattedWithOthers(journalManager, window, &journalEntryOnlineEvent[i], i); break; case ONLINE_EVENT_UNION_BATTLE: - JournalDisplay_PrintUnionBattleEvent(param0, window, &journalEntryOnlineEvent[i], i); + JournalPrinter_PrintUnionBattleEvent(journalManager, window, &journalEntryOnlineEvent[i], i); break; case ONLINE_EVENT_MIXED_RECORDS: - JournalDisplay_PrintMixedRecords(param0, window, &journalEntryOnlineEvent[i], i); + JournalPrinter_PrintMixedRecords(journalManager, window, &journalEntryOnlineEvent[i], i); break; case ONLINE_EVENT_PLACED_IN_CONTEST: - JournalDisplay_PrintPlacedInContest(param0, window, &journalEntryOnlineEvent[i], i); + JournalPrinter_PrintPlacedInContest(journalManager, window, &journalEntryOnlineEvent[i], i); break; case ONLINE_EVENT_MADE_POFFINS: - JournalDisplay_PrintMadePoffins(param0, window, &journalEntryOnlineEvent[i], i); + JournalPrinter_PrintMadePoffins(journalManager, window, &journalEntryOnlineEvent[i], i); break; case ONLINE_EVENT_GOT_POKEMON_GTS: - JournalDisplay_PrintGotPokemonGTS(param0, window, &journalEntryOnlineEvent[i], i); + JournalPrinter_PrintGotPokemonGTS(journalManager, window, &journalEntryOnlineEvent[i], i); break; case ONLINE_EVENT_BATTLE_ROOM: - JournalDisplay_PrintBattleRoom(param0, window, &journalEntryOnlineEvent[i], i); + JournalPrinter_PrintBattleRoom(journalManager, window, &journalEntryOnlineEvent[i], i); break; case ONLINE_EVENT_SPIN_TRADE: - JournalDisplay_PrintSpinTrade(param0, window, &journalEntryOnlineEvent[i], i); + JournalPrinter_PrintSpinTrade(journalManager, window, &journalEntryOnlineEvent[i], i); break; case ONLINE_EVENT_WATCHED_BATTLE_VIDEOS: case ONLINE_EVENT_CHECKED_RANKINGS: case ONLINE_EVENT_CHECKED_DRESS_UP_DATA: case ONLINE_EVENT_CHECKED_BOX_DATA: - JournalDisplay_PrintMiscEvent1(param0, window, &journalEntryOnlineEvent[i], i, journalEntryOnlineEvent[i].eventType); + JournalPrinter_PrintMiscEvent1(journalManager, window, &journalEntryOnlineEvent[i], i, journalEntryOnlineEvent[i].eventType); break; case ONLINE_EVENT_CHATTED_IN_PLAZA: - JournalDisplay_PrintChattedInPlaza(param0, window, &journalEntryOnlineEvent[i], i); + JournalPrinter_PrintChattedInPlaza(journalManager, window, &journalEntryOnlineEvent[i], i); break; case ONLINE_EVENT_GOT_TAP_TOY: - JournalDisplay_PrintGotTapToy(param0, window, &journalEntryOnlineEvent[i], i); + JournalPrinter_PrintGotTapToy(journalManager, window, &journalEntryOnlineEvent[i], i); break; case ONLINE_EVENT_PLAZA_MINIGAME: - JournalDisplay_PrintPlazaMinigame(param0, window, &journalEntryOnlineEvent[i], i); + JournalPrinter_PrintPlazaMinigame(journalManager, window, &journalEntryOnlineEvent[i], i); break; case ONLINE_EVENT_PLAYED_WITH_FOOTPRINT_STAMP: case ONLINE_EVENT_VIEWED_PLAZA_VISITOR_PROFILES: case ONLINE_EVENT_READ_PLAZA_NEWS: case ONLINE_EVENT_JOINED_PARADE: - JournalDisplay_PrintMiscEvent2(param0, window, &journalEntryOnlineEvent[i], i, journalEntryOnlineEvent[i].eventType); + JournalPrinter_PrintMiscEvent2(journalManager, window, &journalEntryOnlineEvent[i], i, journalEntryOnlineEvent[i].eventType); break; case ONLINE_EVENT_WIFI_CLUB: - JournalDisplay_PrintWiFiClub(param0, window, &journalEntryOnlineEvent[i], i); + JournalPrinter_PrintWiFiClub(journalManager, window, &journalEntryOnlineEvent[i], i); break; } } } -static void JournalDisplay_PrintRestedAtHome(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) +static void JournalPrinter_PrintRestedAtHome(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) { - Strbuf *v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_rested_at_home); + Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_rested_at_home); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, v0, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - Strbuf_Free(v0); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Strbuf_Free(strbuf); } -static void JournalDisplay_PrintLeftResearchLab(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) +static void JournalPrinter_PrintLeftResearchLab(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) { - Strbuf *v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_left_research_lab); + Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_left_research_lab); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, v0, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - Strbuf_Free(v0); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Strbuf_Free(strbuf); } -static void JournalDisplay_PrintUsedPCBox(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) +static void JournalPrinter_PrintUsedPCBox(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) { - Strbuf *v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_used_pc_box); + Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_used_pc_box); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, v0, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - Strbuf_Free(v0); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Strbuf_Free(strbuf); } -static void JournalDisplay_PrintShoppedAtMart(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) +static void JournalPrinter_PrintShoppedAtMart(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) { - Strbuf *v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_shopped_at_poke_mart); + Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_shopped_at_poke_mart); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, v0, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - Strbuf_Free(v0); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Strbuf_Free(strbuf); } -static void JournalDisplay_PrintLotsOfShoppingAtMart(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) +static void JournalPrinter_PrintLotsOfShoppingAtMart(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) { - Strbuf *v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_lots_of_shopping_at_poke_mart); + Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_lots_of_shopping_at_poke_mart); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, v0, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - Strbuf_Free(v0); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Strbuf_Free(strbuf); } -static void JournalDisplay_PrintSoldALittleAtMart(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) +static void JournalPrinter_PrintSoldALittleAtMart(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) { - Strbuf *v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_sold_a_little_at_poke_mart); + Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_sold_a_little_at_poke_mart); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, v0, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - Strbuf_Free(v0); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Strbuf_Free(strbuf); } -static void JournalDisplay_PrintSoldALotAtMart(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) +static void JournalPrinter_PrintSoldALotAtMart(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) { - Strbuf *v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_sold_a_lot_at_poke_mart); + Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_sold_a_lot_at_poke_mart); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, v0, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - Strbuf_Free(v0); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Strbuf_Free(strbuf); } -static void JournalDisplay_PrintDidBusinessAtMart(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) +static void JournalPrinter_PrintDidBusinessAtMart(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) { - Strbuf *v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_did_business_at_poke_mart); + Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_did_business_at_poke_mart); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, v0, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - Strbuf_Free(v0); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Strbuf_Free(strbuf); } -static void JournalDisplay_PrintGymWasTooTough(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) +static void JournalPrinter_PrintGymWasTooTough(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) { - Strbuf *v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_gym_was_too_tough); + Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_gym_was_too_tough); - StringTemplate_SetGymName(param0->template, 0, journalEntryLocationEvent->locationID); - StringTemplate_Format(param0->template, param0->strbuf, v0); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, param0->strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - Strbuf_Free(v0); + StringTemplate_SetGymName(journalManager->template, 0, journalEntryLocationEvent->locationID); + StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Strbuf_Free(strbuf); } -static void JournalDisplay_PrintBeatGymLeader(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) +static void JournalPrinter_PrintBeatGymLeader(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) { - Strbuf *v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_beat_locations_gym_leader); + Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_beat_locations_gym_leader); - StringTemplate_SetGymName(param0->template, 0, journalEntryLocationEvent->locationID); - StringTemplate_SetTrainerName(param0->template, 1, journalEntryLocationEvent->trainerID); - StringTemplate_Format(param0->template, param0->strbuf, v0); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, param0->strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - Strbuf_Free(v0); + StringTemplate_SetGymName(journalManager->template, 0, journalEntryLocationEvent->locationID); + StringTemplate_SetTrainerName(journalManager->template, 1, journalEntryLocationEvent->trainerID); + StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Strbuf_Free(strbuf); } -static void JournalDisplay_PrintBeatEliteFourMember(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) +static void JournalPrinter_PrintBeatEliteFourMember(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) { - Strbuf *v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_beat_elite_four_member); + Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_beat_elite_four_member); - StringTemplate_SetTrainerName(param0->template, 0, journalEntryLocationEvent->trainerID); - StringTemplate_Format(param0->template, param0->strbuf, v0); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, param0->strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - Strbuf_Free(v0); + StringTemplate_SetTrainerName(journalManager->template, 0, journalEntryLocationEvent->trainerID); + StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Strbuf_Free(strbuf); } -static void JournalDisplay_PrintBeatChampion(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) +static void JournalPrinter_PrintBeatChampion(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) { - Strbuf *v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_beat_champion); + Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_beat_champion); - StringTemplate_SetTrainerName(param0->template, 0, journalEntryLocationEvent->trainerID); - StringTemplate_Format(param0->template, param0->strbuf, v0); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, param0->strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - Strbuf_Free(v0); + StringTemplate_SetTrainerName(journalManager->template, 0, journalEntryLocationEvent->trainerID); + StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Strbuf_Free(strbuf); } -static void JournalDisplay_PrintArrivedInLocation(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) +static void JournalPrinter_PrintArrivedInLocation(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) { - Strbuf *v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_arrived_in_location); + Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_arrived_in_location); - StringTemplate_SetLocationName(param0->template, 0, MapHeader_GetMapLabelTextID(journalEntryLocationEvent->locationID)); - StringTemplate_Format(param0->template, param0->strbuf, v0); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, param0->strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - Strbuf_Free(v0); + StringTemplate_SetLocationName(journalManager->template, 0, MapHeader_GetMapLabelTextID(journalEntryLocationEvent->locationID)); + StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Strbuf_Free(strbuf); } -static void JournalDisplay_PrintLeftCave(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) +static void JournalPrinter_PrintLeftCave(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) { - Strbuf *v0; - u32 v1 = journalEntryLocationEvent->locationID; + Strbuf *strbuf; + u32 mapLabelTextID = journalEntryLocationEvent->locationID; - if (v1 == 47 || v1 == 64 || v1 == 49) { - v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_departed_from_location); + if (mapLabelTextID == location_names_00047 || mapLabelTextID == location_names_00064 || mapLabelTextID == location_names_00049) { + strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_departed_from_location); } else { - v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_got_through_location); + strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_got_through_location); } - StringTemplate_SetLocationName(param0->template, 0, v1); - StringTemplate_Format(param0->template, param0->strbuf, v0); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, param0->strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - Strbuf_Free(v0); + StringTemplate_SetLocationName(journalManager->template, 0, mapLabelTextID); + StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Strbuf_Free(strbuf); } -static void JournalDisplay_PrintLeftBuilding(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) +static void JournalPrinter_PrintLeftBuilding(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) { - Strbuf *v0; - u32 v1 = journalEntryLocationEvent->locationID; + Strbuf *strbuf; + u32 mapLabelTextID = journalEntryLocationEvent->locationID; - if (sub_0202C6A4(v1) == 0) { - v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_departed_from_location); + if (sub_0202C6A4(mapLabelTextID) == 0) { + strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_departed_from_location); } else { - v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_exited_from_location); + strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_exited_from_location); } - StringTemplate_SetLocationName(param0->template, 0, v1); - StringTemplate_Format(param0->template, param0->strbuf, v0); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, param0->strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - Strbuf_Free(v0); + StringTemplate_SetLocationName(journalManager->template, 0, mapLabelTextID); + StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Strbuf_Free(strbuf); } -static void JournalDisplay_PrintGameCorner(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) +static void JournalPrinter_PrintGameCorner(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) { - Strbuf *v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_played_at_game_corner); + Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_played_at_game_corner); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, v0, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - Strbuf_Free(v0); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Strbuf_Free(strbuf); } -static void JournalDisplay_PrintSafariGame(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) +static void JournalPrinter_PrintSafariGame(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) { - Strbuf *v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_played_safari_game); + Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_played_safari_game); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, v0, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - Strbuf_Free(v0); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Strbuf_Free(strbuf); } -static void JournalDisplay_PrintItemWasObtained(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) +static void JournalPrinter_PrintItemWasObtained(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) { - Strbuf *v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_item_was_obtained); + Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_item_was_obtained); - StringTemplate_SetItemName(param0->template, 0, journalEntryLocationEvent->item); - StringTemplate_Format(param0->template, param0->strbuf, v0); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, param0->strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - Strbuf_Free(v0); + StringTemplate_SetItemName(journalManager->template, 0, journalEntryLocationEvent->item); + StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Strbuf_Free(strbuf); } -static void JournalDisplay_PrintUsedRockSmash(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) +static void JournalPrinter_PrintUsedRockSmash(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) { - Strbuf *v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_used_rock_smash_at_location); + Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_used_rock_smash_at_location); - StringTemplate_SetLocationName(param0->template, 0, MapHeader_GetMapLabelTextID(journalEntryLocationEvent->locationID)); - StringTemplate_Format(param0->template, param0->strbuf, v0); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, param0->strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - Strbuf_Free(v0); + StringTemplate_SetLocationName(journalManager->template, 0, MapHeader_GetMapLabelTextID(journalEntryLocationEvent->locationID)); + StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Strbuf_Free(strbuf); } -static void JournalDisplay_PrintUsedCut(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) +static void JournalPrinter_PrintUsedCut(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) { - Strbuf *v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_used_cut_at_location); + Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_used_cut_at_location); - StringTemplate_SetLocationName(param0->template, 0, MapHeader_GetMapLabelTextID(journalEntryLocationEvent->locationID)); - StringTemplate_Format(param0->template, param0->strbuf, v0); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, param0->strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - Strbuf_Free(v0); + StringTemplate_SetLocationName(journalManager->template, 0, MapHeader_GetMapLabelTextID(journalEntryLocationEvent->locationID)); + StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Strbuf_Free(strbuf); } -static void JournalDisplay_PrintFlewToLocation(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) +static void JournalPrinter_PrintFlewToLocation(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) { - Strbuf *v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_flew_to_location); + Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_flew_to_location); - StringTemplate_SetLocationName(param0->template, 0, MapHeader_GetMapLabelTextID(journalEntryLocationEvent->locationID)); - StringTemplate_Format(param0->template, param0->strbuf, v0); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, param0->strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - Strbuf_Free(v0); + StringTemplate_SetLocationName(journalManager->template, 0, MapHeader_GetMapLabelTextID(journalEntryLocationEvent->locationID)); + StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Strbuf_Free(strbuf); } -static void JournalDisplay_PrintUsedDefog(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) +static void JournalPrinter_PrintUsedDefog(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) { - Strbuf *v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_used_defog_at_location); + Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_used_defog_at_location); - StringTemplate_SetLocationName(param0->template, 0, MapHeader_GetMapLabelTextID(journalEntryLocationEvent->locationID)); - StringTemplate_Format(param0->template, param0->strbuf, v0); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, param0->strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - Strbuf_Free(v0); + StringTemplate_SetLocationName(journalManager->template, 0, MapHeader_GetMapLabelTextID(journalEntryLocationEvent->locationID)); + StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Strbuf_Free(strbuf); } -static void JournalDisplay_PrintUsedStrength(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) +static void JournalPrinter_PrintUsedStrength(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) { - Strbuf *v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_used_strength_at_location); + Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_used_strength_at_location); - StringTemplate_SetLocationName(param0->template, 0, MapHeader_GetMapLabelTextID(journalEntryLocationEvent->locationID)); - StringTemplate_Format(param0->template, param0->strbuf, v0); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, param0->strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - Strbuf_Free(v0); + StringTemplate_SetLocationName(journalManager->template, 0, MapHeader_GetMapLabelTextID(journalEntryLocationEvent->locationID)); + StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Strbuf_Free(strbuf); } -static void JournalDisplay_PrintUsedSurf(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) +static void JournalPrinter_PrintUsedSurf(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) { - Strbuf *v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_used_surf_at_location); + Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_used_surf_at_location); - StringTemplate_SetLocationName(param0->template, 0, MapHeader_GetMapLabelTextID(journalEntryLocationEvent->locationID)); - StringTemplate_Format(param0->template, param0->strbuf, v0); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, param0->strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - Strbuf_Free(v0); + StringTemplate_SetLocationName(journalManager->template, 0, MapHeader_GetMapLabelTextID(journalEntryLocationEvent->locationID)); + StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Strbuf_Free(strbuf); } -static void JournalDisplay_PrintUsedRockClimb(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) +static void JournalPrinter_PrintUsedRockClimb(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) { - Strbuf *v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_used_rock_climb_at_location); + Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_used_rock_climb_at_location); - StringTemplate_SetLocationName(param0->template, 0, MapHeader_GetMapLabelTextID(journalEntryLocationEvent->locationID)); - StringTemplate_Format(param0->template, param0->strbuf, v0); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, param0->strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - Strbuf_Free(v0); + StringTemplate_SetLocationName(journalManager->template, 0, MapHeader_GetMapLabelTextID(journalEntryLocationEvent->locationID)); + StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Strbuf_Free(strbuf); } -static void JournalDisplay_PrintUsedWaterfall(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) +static void JournalPrinter_PrintUsedWaterfall(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) { - Strbuf *v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_used_waterfall_at_location); + Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_used_waterfall_at_location); - StringTemplate_SetLocationName(param0->template, 0, MapHeader_GetMapLabelTextID(journalEntryLocationEvent->locationID)); - StringTemplate_Format(param0->template, param0->strbuf, v0); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, param0->strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - Strbuf_Free(v0); + StringTemplate_SetLocationName(journalManager->template, 0, MapHeader_GetMapLabelTextID(journalEntryLocationEvent->locationID)); + StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Strbuf_Free(strbuf); } -static void JournalDisplay_PrintUsedFlash(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) +static void JournalPrinter_PrintUsedFlash(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) { - Strbuf *v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_used_flash_at_location); + Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_used_flash_at_location); - StringTemplate_SetLocationName(param0->template, 0, MapHeader_GetMapLabelTextID(journalEntryLocationEvent->locationID)); - StringTemplate_Format(param0->template, param0->strbuf, v0); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, param0->strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - Strbuf_Free(v0); + StringTemplate_SetLocationName(journalManager->template, 0, MapHeader_GetMapLabelTextID(journalEntryLocationEvent->locationID)); + StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Strbuf_Free(strbuf); } -static void JournalDisplay_PrintWarpedToLocation(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) +static void JournalPrinter_PrintWarpedToLocation(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) { - Strbuf *v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_warped_to_location); + Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_warped_to_location); - StringTemplate_SetLocationName(param0->template, 0, MapHeader_GetMapLabelTextID(journalEntryLocationEvent->locationID)); - StringTemplate_Format(param0->template, param0->strbuf, v0); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, param0->strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - Strbuf_Free(v0); + StringTemplate_SetLocationName(journalManager->template, 0, MapHeader_GetMapLabelTextID(journalEntryLocationEvent->locationID)); + StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Strbuf_Free(strbuf); } -static void JournalDisplay_PrintUsedDig(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) +static void JournalPrinter_PrintUsedDig(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) { - Strbuf *v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_used_dig_at_location); + Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_used_dig_at_location); - StringTemplate_SetLocationName(param0->template, 0, MapHeader_GetMapLabelTextID(journalEntryLocationEvent->locationID)); - StringTemplate_Format(param0->template, param0->strbuf, v0); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, param0->strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - Strbuf_Free(v0); + StringTemplate_SetLocationName(journalManager->template, 0, MapHeader_GetMapLabelTextID(journalEntryLocationEvent->locationID)); + StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Strbuf_Free(strbuf); } -static void JournalDisplay_PrintLuredPokemon(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) +static void JournalPrinter_PrintLuredPokemon(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) { - Strbuf *v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_lured_pokemon); + Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_lured_pokemon); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, v0, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - Strbuf_Free(v0); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Strbuf_Free(strbuf); } -static void JournalDisplay_PrintUsedSoftboiled(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) +static void JournalPrinter_PrintUsedSoftboiled(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) { - Strbuf *v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_used_softboiled); + Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_used_softboiled); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, v0, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - Strbuf_Free(v0); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Strbuf_Free(strbuf); } -static void JournalDisplay_PrintUsedMilkDrink(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) +static void JournalPrinter_PrintUsedMilkDrink(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) { - Strbuf *v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_used_milk_drink); + Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_used_milk_drink); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, v0, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - Strbuf_Free(v0); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Strbuf_Free(strbuf); } -static void JournalDisplay_PrintDugUnderground(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) +static void JournalPrinter_PrintDugUnderground(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) { - Strbuf *v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_dug_underground); + Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_dug_underground); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, v0, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - Strbuf_Free(v0); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Strbuf_Free(strbuf); } -static void JournalDisplay_PrintBuiltSecretBase(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) +static void JournalPrinter_PrintBuiltSecretBase(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row) { - Strbuf *v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_built_secret_base); + Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_built_secret_base); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, v0, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - Strbuf_Free(v0); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Strbuf_Free(strbuf); } -static void JournalDisplay_PrintPlayedAtBattleFacility(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row, int eventType) +static void JournalPrinter_PrintPlayedAtBattleFacility(JournalManager *journalManager, Window *window, JournalEntryLocationEvent *journalEntryLocationEvent, u8 row, int eventType) { u32 message; - Strbuf *v1; + Strbuf *strbuf; switch (eventType) { case LOCATION_EVENT_BATTLE_TOWER: @@ -803,330 +804,330 @@ static void JournalDisplay_PrintPlayedAtBattleFacility(UnkStruct_ov81_021D1610 * break; } - v1 = MessageLoader_GetNewStrbuf(param0->loader, message); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, v1, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - Strbuf_Free(v1); + strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, message); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Strbuf_Free(strbuf); } -static void JournalDisplay_SetSpeciesName(UnkStruct_ov81_021D1610 *param0, u16 species, u8 gender, u8 idx) +static void JournalPrinter_SetSpeciesName(JournalManager *journalManager, u16 species, u8 gender, u8 idx) { Pokemon *mon = Pokemon_New(42); sub_02074088(mon, species, 1, 32, gender, 0, 0); - StringTemplate_SetSpeciesName(param0->template, idx, Pokemon_GetBoxPokemon(mon)); + StringTemplate_SetSpeciesName(journalManager->template, idx, Pokemon_GetBoxPokemon(mon)); Heap_FreeToHeap(mon); } -static void JournalDisplay_PrintPokemonCaught(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryMon *journalEntryMon) +static void JournalPrinter_PrintPokemonCaught(JournalManager *journalManager, Window *window, JournalEntryMon *journalEntryMon) { - Strbuf *v0; + Strbuf *strbuf; switch (journalEntryMon->stringVariant) { case 0: - v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_caught_pokemon); + strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_caught_pokemon); break; case 1: - v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_pokemon_was_caught); + strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_pokemon_was_caught); break; default: if (journalEntryMon->gender == GENDER_MALE) { - v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_caught_male_pokemon); + strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_caught_male_pokemon); } else if (journalEntryMon->gender == GENDER_FEMALE) { - v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_caught_female_pokemon); + strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_caught_female_pokemon); } else { - v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_caught_pokemon); + strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_caught_pokemon); } } - JournalDisplay_SetSpeciesName(param0, journalEntryMon->species, journalEntryMon->gender, 0); - StringTemplate_SetTimeOfDay(param0->template, 1, journalEntryMon->timeOfDay); + JournalPrinter_SetSpeciesName(journalManager, journalEntryMon->species, journalEntryMon->gender, 0); + StringTemplate_SetTimeOfDay(journalManager->template, 1, journalEntryMon->timeOfDay); - StringTemplate_Format(param0->template, param0->strbuf, v0); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, param0->strbuf, 0, (16 * 4 + 16), TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - Strbuf_Free(v0); + StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, (16 * 4 + 16), TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Strbuf_Free(strbuf); } -static void JournalDisplay_PrintPokemonDefeated(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryMon *journalEntryMon) +static void JournalPrinter_PrintPokemonDefeated(JournalManager *journalManager, Window *window, JournalEntryMon *journalEntryMon) { - Strbuf *v0; + Strbuf *strbuf; switch (journalEntryMon->stringVariant) { case 0: - v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_pokemon_was_defeated); + strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_pokemon_was_defeated); break; case 1: - v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_defeated_pokemon); + strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_defeated_pokemon); break; default: if (journalEntryMon->gender == GENDER_MALE) { - v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_defeated_male_pokemon); + strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_defeated_male_pokemon); } else if (journalEntryMon->gender == GENDER_FEMALE) { - v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_defeated_female_pokemon); + strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_defeated_female_pokemon); } else { - v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_pokemon_was_defeated); + strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_pokemon_was_defeated); } } - JournalDisplay_SetSpeciesName(param0, journalEntryMon->species, journalEntryMon->gender, 0); - StringTemplate_SetTimeOfDay(param0->template, 1, journalEntryMon->timeOfDay); + JournalPrinter_SetSpeciesName(journalManager, journalEntryMon->species, journalEntryMon->gender, 0); + StringTemplate_SetTimeOfDay(journalManager->template, 1, journalEntryMon->timeOfDay); - StringTemplate_Format(param0->template, param0->strbuf, v0); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, param0->strbuf, 0, (16 * 4 + 16), TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - Strbuf_Free(v0); + StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, (16 * 4 + 16), TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Strbuf_Free(strbuf); } -static void ov81_021D2A60(UnkStruct_ov81_021D1610 *param0, u16 *name, u8 param2, u8 idx) +static void JournalPrinter_SetPlayerOrPokemonName(JournalManager *journalManager, u16 *name, u8 unused, u8 idx) { - Strbuf *v0 = Strbuf_Init(32, 42); + Strbuf *strbuf = Strbuf_Init(32, HEAP_ID_JOURNAL); - Strbuf_CopyChars(v0, name); - StringTemplate_SetStrbuf(param0->template, idx, v0, param2, 1, GAME_LANGUAGE); - Strbuf_Free(v0); + Strbuf_CopyChars(strbuf, name); + StringTemplate_SetStrbuf(journalManager->template, idx, strbuf, unused, TRUE, GAME_LANGUAGE); + Strbuf_Free(strbuf); } -static void JournalDisplay_PrintSingleBattleEvent(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row) +static void JournalPrinter_PrintSingleBattleEvent(JournalManager *journalManager, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row) { - Strbuf *v0; + Strbuf *strbuf; switch (journalEntryOnlineEvent->result) { case 0: - v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_beat_player_single); + strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_beat_player_single); break; case 1: - v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_lost_to_player_single); + strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_lost_to_player_single); break; case 2: default: - v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_tied_player_single); + strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_tied_player_single); break; } - ov81_021D2A60(param0, journalEntryOnlineEvent->playerName1, journalEntryOnlineEvent->unused1, 0); - StringTemplate_Format(param0->template, param0->strbuf, v0); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, param0->strbuf, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - Strbuf_Free(v0); + JournalPrinter_SetPlayerOrPokemonName(journalManager, journalEntryOnlineEvent->playerName1, journalEntryOnlineEvent->unused1, 0); + StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Strbuf_Free(strbuf); } -static void JournalDisplay_PrintDoubleBattleEvent(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row) +static void JournalPrinter_PrintDoubleBattleEvent(JournalManager *journalManager, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row) { - Strbuf *v0; + Strbuf *strbuf; switch (journalEntryOnlineEvent->result) { case 0: - v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_beat_player_double); + strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_beat_player_double); break; case 1: - v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_lost_to_player_double); + strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_lost_to_player_double); break; case 2: default: - v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_tied_player_double); + strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_tied_player_double); break; } - ov81_021D2A60(param0, journalEntryOnlineEvent->playerName1, journalEntryOnlineEvent->unused1, 0); - StringTemplate_Format(param0->template, param0->strbuf, v0); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, param0->strbuf, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - Strbuf_Free(v0); + JournalPrinter_SetPlayerOrPokemonName(journalManager, journalEntryOnlineEvent->playerName1, journalEntryOnlineEvent->unused1, 0); + StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Strbuf_Free(strbuf); } -static void JournalDisplay_PrintMultiBattleEvent(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row) +static void JournalPrinter_PrintMultiBattleEvent(JournalManager *journalManager, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row) { - Strbuf *v0; + Strbuf *strbuf; switch (journalEntryOnlineEvent->result) { case 0: - v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_beat_players_multi); + strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_beat_players_multi); break; case 1: - v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_lost_to_players_multi); + strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_lost_to_players_multi); break; case 2: default: - v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_tied_players_multi); + strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_tied_players_multi); break; } - ov81_021D2A60(param0, journalEntryOnlineEvent->playerName1, journalEntryOnlineEvent->unused1, 0); - ov81_021D2A60(param0, journalEntryOnlineEvent->playerName2, journalEntryOnlineEvent->unused2, 1); - StringTemplate_Format(param0->template, param0->strbuf, v0); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, param0->strbuf, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - Strbuf_Free(v0); + JournalPrinter_SetPlayerOrPokemonName(journalManager, journalEntryOnlineEvent->playerName1, journalEntryOnlineEvent->unused1, 0); + JournalPrinter_SetPlayerOrPokemonName(journalManager, journalEntryOnlineEvent->playerName2, journalEntryOnlineEvent->unused2, 1); + StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Strbuf_Free(strbuf); } -static void JournalDisplay_PrintMixSingleBattleEvent(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row) +static void JournalPrinter_PrintMixSingleBattleEvent(JournalManager *journalManager, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row) { - Strbuf *v0; + Strbuf *strbuf; switch (journalEntryOnlineEvent->result) { case 0: - v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_beat_player_mix); + strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_beat_player_mix); break; case 1: - v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_lost_to_player_mix); + strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_lost_to_player_mix); break; case 2: default: - v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_tied_player_mix); + strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_tied_player_mix); break; } - ov81_021D2A60(param0, journalEntryOnlineEvent->playerName1, journalEntryOnlineEvent->unused1, 0); - StringTemplate_Format(param0->template, param0->strbuf, v0); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, param0->strbuf, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - Strbuf_Free(v0); + JournalPrinter_SetPlayerOrPokemonName(journalManager, journalEntryOnlineEvent->playerName1, journalEntryOnlineEvent->unused1, 0); + StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Strbuf_Free(strbuf); } -static void JournalDisplay_PrintMixMultiBattleEvent(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row) +static void JournalPrinter_PrintMixMultiBattleEvent(JournalManager *journalManager, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row) { - Strbuf *v0; + Strbuf *strbuf; switch (journalEntryOnlineEvent->result) { case 0: - v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_beat_players_mix); + strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_beat_players_mix); break; case 1: - v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_lost_to_players_mix); + strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_lost_to_players_mix); break; case 2: default: - v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_tied_players_mix); + strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_tied_players_mix); break; } - ov81_021D2A60(param0, journalEntryOnlineEvent->playerName1, journalEntryOnlineEvent->unused1, 0); - ov81_021D2A60(param0, journalEntryOnlineEvent->playerName2, journalEntryOnlineEvent->unused2, 1); - StringTemplate_Format(param0->template, param0->strbuf, v0); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, param0->strbuf, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - Strbuf_Free(v0); + JournalPrinter_SetPlayerOrPokemonName(journalManager, journalEntryOnlineEvent->playerName1, journalEntryOnlineEvent->unused1, 0); + JournalPrinter_SetPlayerOrPokemonName(journalManager, journalEntryOnlineEvent->playerName2, journalEntryOnlineEvent->unused2, 1); + StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Strbuf_Free(strbuf); } -static void JournalDisplay_PrintGreetedInUnionRoom(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row) +static void JournalPrinter_PrintGreetedInUnionRoom(JournalManager *journalManager, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row) { - Strbuf *v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_greeted_player_in_union_room); + Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_greeted_player_in_union_room); - ov81_021D2A60(param0, journalEntryOnlineEvent->playerName1, journalEntryOnlineEvent->unused1, 0); - StringTemplate_Format(param0->template, param0->strbuf, v0); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, param0->strbuf, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - Strbuf_Free(v0); + JournalPrinter_SetPlayerOrPokemonName(journalManager, journalEntryOnlineEvent->playerName1, journalEntryOnlineEvent->unused1, 0); + StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Strbuf_Free(strbuf); } -static void JournalDisplay_PrintGotPokemonFromTrade(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row) +static void JournalPrinter_PrintGotPokemonFromTrade(JournalManager *journalManager, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row) { - Strbuf *v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_got_pokemon_from_player); + Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_got_pokemon_from_player); - ov81_021D2A60(param0, journalEntryOnlineEvent->playerName1, journalEntryOnlineEvent->unused1, 0); - ov81_021D2A60(param0, journalEntryOnlineEvent->pokemonName, journalEntryOnlineEvent->unused3, 1); - StringTemplate_Format(param0->template, param0->strbuf, v0); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, param0->strbuf, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - Strbuf_Free(v0); + JournalPrinter_SetPlayerOrPokemonName(journalManager, journalEntryOnlineEvent->playerName1, journalEntryOnlineEvent->unused1, 0); + JournalPrinter_SetPlayerOrPokemonName(journalManager, journalEntryOnlineEvent->pokemonName, journalEntryOnlineEvent->unused3, 1); + StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Strbuf_Free(strbuf); } -static void JournalDisplay_PrintDrewPictures(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row) +static void JournalPrinter_PrintDrewPictures(JournalManager *journalManager, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row) { - Strbuf *v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_drew_pictures_with_others); + Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_drew_pictures_with_others); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, v0, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - Strbuf_Free(v0); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Strbuf_Free(strbuf); } -static void JournalDisplay_PrintGotPokemonInFriendTrade(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row) +static void JournalPrinter_PrintGotPokemonInFriendTrade(JournalManager *journalManager, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row) { - Strbuf *v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_got_pokemon_in_friend_trade); + Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_got_pokemon_in_friend_trade); - ov81_021D2A60(param0, journalEntryOnlineEvent->pokemonName, journalEntryOnlineEvent->unused3, 0); - StringTemplate_Format(param0->template, param0->strbuf, v0); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, param0->strbuf, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - Strbuf_Free(v0); + JournalPrinter_SetPlayerOrPokemonName(journalManager, journalEntryOnlineEvent->pokemonName, journalEntryOnlineEvent->unused3, 0); + StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Strbuf_Free(strbuf); } -static void JournalDisplay_PrintChattedWithOthers(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row) +static void JournalPrinter_PrintChattedWithOthers(JournalManager *journalManager, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row) { - Strbuf *v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_chatted_with_others); + Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_chatted_with_others); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, v0, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - Strbuf_Free(v0); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Strbuf_Free(strbuf); } -static void JournalDisplay_PrintUnionBattleEvent(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row) +static void JournalPrinter_PrintUnionBattleEvent(JournalManager *journalManager, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row) { - Strbuf *v0; + Strbuf *strbuf; switch (journalEntryOnlineEvent->result) { case 0: - v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_beat_player_union); + strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_beat_player_union); break; case 1: - v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_lost_to_player_union); + strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_lost_to_player_union); break; case 2: default: - v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_tied_player_union); + strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_tied_player_union); break; } - ov81_021D2A60(param0, journalEntryOnlineEvent->playerName1, journalEntryOnlineEvent->unused1, 0); - StringTemplate_Format(param0->template, param0->strbuf, v0); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, param0->strbuf, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - Strbuf_Free(v0); + JournalPrinter_SetPlayerOrPokemonName(journalManager, journalEntryOnlineEvent->playerName1, journalEntryOnlineEvent->unused1, 0); + StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Strbuf_Free(strbuf); } -static void JournalDisplay_PrintMixedRecords(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row) +static void JournalPrinter_PrintMixedRecords(JournalManager *journalManager, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row) { - Strbuf *v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_mixed_records); + Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_mixed_records); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, v0, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - Strbuf_Free(v0); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Strbuf_Free(strbuf); } -static void JournalDisplay_PrintPlacedInContest(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row) +static void JournalPrinter_PrintPlacedInContest(JournalManager *journalManager, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row) { - Strbuf *v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_placed_number_in_contest); + Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_placed_number_in_contest); - StringTemplate_SetNumber(param0->template, 0, journalEntryOnlineEvent->result, 1, 0, 1); - StringTemplate_Format(param0->template, param0->strbuf, v0); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, param0->strbuf, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - Strbuf_Free(v0); + StringTemplate_SetNumber(journalManager->template, 0, journalEntryOnlineEvent->result, 1, PADDING_MODE_NONE, CHARSET_MODE_EN); + StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Strbuf_Free(strbuf); } -static void JournalDisplay_PrintMadePoffins(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row) +static void JournalPrinter_PrintMadePoffins(JournalManager *journalManager, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row) { - Strbuf *v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_made_poffins_in_group); + Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_made_poffins_in_group); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, v0, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - Strbuf_Free(v0); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Strbuf_Free(strbuf); } -static void JournalDisplay_PrintGotPokemonGTS(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row) +static void JournalPrinter_PrintGotPokemonGTS(JournalManager *journalManager, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row) { - Strbuf *v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_got_players_pokemon_gts); + Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_got_players_pokemon_gts); - ov81_021D2A60(param0, journalEntryOnlineEvent->playerName1, journalEntryOnlineEvent->unused1, 0); - ov81_021D2A60(param0, journalEntryOnlineEvent->pokemonName, journalEntryOnlineEvent->unused3, 1); - StringTemplate_Format(param0->template, param0->strbuf, v0); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, param0->strbuf, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - Strbuf_Free(v0); + JournalPrinter_SetPlayerOrPokemonName(journalManager, journalEntryOnlineEvent->playerName1, journalEntryOnlineEvent->unused1, 0); + JournalPrinter_SetPlayerOrPokemonName(journalManager, journalEntryOnlineEvent->pokemonName, journalEntryOnlineEvent->unused3, 1); + StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Strbuf_Free(strbuf); } -static void JournalDisplay_PrintBattleRoom(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row) +static void JournalPrinter_PrintBattleRoom(JournalManager *journalManager, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row) { - Strbuf *v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_won_in_battle_room); + Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_won_in_battle_room); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, v0, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - Strbuf_Free(v0); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Strbuf_Free(strbuf); } -static void JournalDisplay_PrintSpinTrade(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row) +static void JournalPrinter_PrintSpinTrade(JournalManager *journalManager, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row) { - Strbuf *v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_did_spin_trade); + Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_did_spin_trade); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, v0, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - Strbuf_Free(v0); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Strbuf_Free(strbuf); } -static void JournalDisplay_PrintMiscEvent1(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row, int eventType) +static void JournalPrinter_PrintMiscEvent1(JournalManager *journalManager, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row, int eventType) { - Strbuf *v0; + Strbuf *strbuf; u32 message; switch (eventType) { @@ -1145,44 +1146,44 @@ static void JournalDisplay_PrintMiscEvent1(UnkStruct_ov81_021D1610 *param0, Wind break; } - v0 = MessageLoader_GetNewStrbuf(param0->loader, message); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, v0, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - Strbuf_Free(v0); + strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, message); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Strbuf_Free(strbuf); } -static void JournalDisplay_PrintChattedInPlaza(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row) +static void JournalPrinter_PrintChattedInPlaza(JournalManager *journalManager, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row) { - Strbuf *v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_chatted_with_player_in_plaza); + Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_chatted_with_player_in_plaza); - ov81_021D2A60(param0, journalEntryOnlineEvent->playerName1, journalEntryOnlineEvent->unused1, 0); - StringTemplate_Format(param0->template, param0->strbuf, v0); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, param0->strbuf, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - Strbuf_Free(v0); + JournalPrinter_SetPlayerOrPokemonName(journalManager, journalEntryOnlineEvent->playerName1, journalEntryOnlineEvent->unused1, 0); + StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Strbuf_Free(strbuf); } -static void JournalDisplay_PrintGotTapToy(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row) +static void JournalPrinter_PrintGotTapToy(JournalManager *journalManager, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row) { - Strbuf *v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_got_tap_toy_from_player); + Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_got_tap_toy_from_player); - ov81_021D2A60(param0, journalEntryOnlineEvent->playerName1, journalEntryOnlineEvent->unused1, 0); - StringTemplate_Format(param0->template, param0->strbuf, v0); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, param0->strbuf, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - Strbuf_Free(v0); + JournalPrinter_SetPlayerOrPokemonName(journalManager, journalEntryOnlineEvent->playerName1, journalEntryOnlineEvent->unused1, 0); + StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Strbuf_Free(strbuf); } -static void JournalDisplay_PrintPlazaMinigame(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row) +static void JournalPrinter_PrintPlazaMinigame(JournalManager *journalManager, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row) { - Strbuf *v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_played_plaza_mini_game); + Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_played_plaza_mini_game); - StringTemplate_SetPlazaMinigameName(param0->template, 0, journalEntryOnlineEvent->result); - StringTemplate_Format(param0->template, param0->strbuf, v0); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, param0->strbuf, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - Strbuf_Free(v0); + StringTemplate_SetPlazaMinigameName(journalManager->template, 0, journalEntryOnlineEvent->result); + StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Strbuf_Free(strbuf); } -static void JournalDisplay_PrintMiscEvent2(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row, int eventType) +static void JournalPrinter_PrintMiscEvent2(JournalManager *journalManager, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row, int eventType) { - Strbuf *v0; + Strbuf *strbuf; u32 message; switch (eventType) { @@ -1201,15 +1202,15 @@ static void JournalDisplay_PrintMiscEvent2(UnkStruct_ov81_021D1610 *param0, Wind break; } - v0 = MessageLoader_GetNewStrbuf(param0->loader, message); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, v0, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - Strbuf_Free(v0); + strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, message); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Strbuf_Free(strbuf); } -static void JournalDisplay_PrintWiFiClub(UnkStruct_ov81_021D1610 *param0, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row) +static void JournalPrinter_PrintWiFiClub(JournalManager *journalManager, Window *window, JournalEntryOnlineEvent *journalEntryOnlineEvent, u8 row) { - Strbuf *v0 = MessageLoader_GetNewStrbuf(param0->loader, journal_entries_played_at_wi_fi_club); + Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_played_at_wi_fi_club); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, v0, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); - Strbuf_Free(v0); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Strbuf_Free(strbuf); } diff --git a/src/journal.c b/src/journal.c index 5746348bcf..73734af697 100644 --- a/src/journal.c +++ b/src/journal.c @@ -14,8 +14,8 @@ #include "savedata.h" #include "trainer_info.h" -#include "res/text/gmm/message_bank_location_names.h" -#include "res/trainers/trdata.naix" +#include "text/gmm/message_bank_location_names.h" +#include "trainers/trdata.naix" #define LOCATION_EVENT(locationID, trainerID, eventType) ((locationID << 16) | ((trainerID & 0x3ff) << 6) | (eventType & 0x3f)) @@ -24,8 +24,6 @@ #define LOCATION_EVENT_LOCATION_ID(locationEvent) ((locationEvent >> 16) & 0xffff) #define LOCATION_EVENT_ITEM(locationEvent) ((locationEvent >> 16) & 0xffff) -#define MAX_JOURNAL_ENTRIES 10 - #define CHAR_NONE 0xffff #define GYM_NONE 0xff From 16ff9371fb7cb992f935a30b064bd549f2b305c7 Mon Sep 17 00:00:00 2001 From: Viperio19 Date: Tue, 17 Dec 2024 23:22:18 +0100 Subject: [PATCH 2/4] Formatting fix --- src/journal.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/journal.c b/src/journal.c index 73734af697..8feb1ea194 100644 --- a/src/journal.c +++ b/src/journal.c @@ -7,6 +7,9 @@ #include "consts/journal.h" #include "consts/map.h" +#include "text/gmm/message_bank_location_names.h" +#include "trainers/trdata.naix" + #include "heap.h" #include "map_header.h" #include "play_time.h" @@ -14,9 +17,6 @@ #include "savedata.h" #include "trainer_info.h" -#include "text/gmm/message_bank_location_names.h" -#include "trainers/trdata.naix" - #define LOCATION_EVENT(locationID, trainerID, eventType) ((locationID << 16) | ((trainerID & 0x3ff) << 6) | (eventType & 0x3f)) #define LOCATION_EVENT_TYPE(locationEvent) (locationEvent & 0x3f) From aa8de658febc97d65068deda387bd39d3e4cf225 Mon Sep 17 00:00:00 2001 From: Viperio19 Date: Sun, 29 Dec 2024 18:37:22 +0100 Subject: [PATCH 3/4] Adding more meaningful names and using constants --- .../journal_display/journal_controller.c | 3 +- .../journal_display/journal_printer.c | 40 +++++++++---------- 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/src/applications/journal_display/journal_controller.c b/src/applications/journal_display/journal_controller.c index b79ba44ed7..d44c44c808 100644 --- a/src/applications/journal_display/journal_controller.c +++ b/src/applications/journal_display/journal_controller.c @@ -10,6 +10,7 @@ #include "struct_defs/struct_02099F80.h" #include "applications/journal_display/journal_printer.h" +#include "text/pl_msg.naix" #include "bg_window.h" #include "core_sys.h" @@ -306,7 +307,7 @@ static void JournalController_LoadGraphics(JournalManager *journalManager) static void JournalController_InitStringUtil(JournalManager *journalManager) { - journalManager->loader = MessageLoader_Init(0, 26, 366, HEAP_ID_JOURNAL); + journalManager->loader = MessageLoader_Init(MESSAGE_LOADER_BANK_HANDLE, NARC_INDEX_MSGDATA__PL_MSG, message_bank_journal_entries, HEAP_ID_JOURNAL); journalManager->template = StringTemplate_Default(HEAP_ID_JOURNAL); journalManager->strbuf = Strbuf_Init(128, HEAP_ID_JOURNAL); } diff --git a/src/applications/journal_display/journal_printer.c b/src/applications/journal_display/journal_printer.c index 107e1f6918..c2e05b1a51 100644 --- a/src/applications/journal_display/journal_printer.c +++ b/src/applications/journal_display/journal_printer.c @@ -23,7 +23,7 @@ #include "text.h" #include "trainer_data.h" -static u8 JournalPrinter_PrintTitle(JournalManager *journalManager, Window *window1, Window *window2); +static u8 JournalPrinter_PrintTitle(JournalManager *journalManager, Window *titleWindow, Window *eventsWindow); static void JournalPrinter_PrintLocationEvents(JournalManager *journalManager, Window *window); static void JournalPrinter_PrintPokemonEvent(JournalManager *journalManager, Window *window); static void JournalPrinter_PrintTrainerEvent(JournalManager *journalManager, Window *window); @@ -116,32 +116,32 @@ void JournalPrinter_RemoveWindows(JournalManager *journalManager) void JournalPrinter_PrintEntry(JournalManager *journalManager, u32 param1) { - Window *window1; - Window *window2; + Window *titleWindow; + Window *eventsWindow; if (param1 == 0) { - window1 = &journalManager->window[0]; - window2 = &journalManager->window[1]; + titleWindow = &journalManager->window[0]; + eventsWindow = &journalManager->window[1]; } else { - window1 = &journalManager->window[2]; - window2 = &journalManager->window[3]; + titleWindow = &journalManager->window[2]; + eventsWindow = &journalManager->window[3]; } - Window_FillTilemap(window1, 0); - Window_FillTilemap(window2, 0); + Window_FillTilemap(titleWindow, 0); + Window_FillTilemap(eventsWindow, 0); - if (JournalPrinter_PrintTitle(journalManager, window1, window2) == 1) { - JournalPrinter_PrintLocationEvents(journalManager, window2); - JournalPrinter_PrintPokemonEvent(journalManager, window2); - JournalPrinter_PrintTrainerEvent(journalManager, window2); - JournalPrinter_PrintOnlineEvents(journalManager, window2); + if (JournalPrinter_PrintTitle(journalManager, titleWindow, eventsWindow) == 1) { + JournalPrinter_PrintLocationEvents(journalManager, eventsWindow); + JournalPrinter_PrintPokemonEvent(journalManager, eventsWindow); + JournalPrinter_PrintTrainerEvent(journalManager, eventsWindow); + JournalPrinter_PrintOnlineEvents(journalManager, eventsWindow); } - Window_ScheduleCopyToVRAM(window1); - Window_ScheduleCopyToVRAM(window2); + Window_ScheduleCopyToVRAM(titleWindow); + Window_ScheduleCopyToVRAM(eventsWindow); } -static u8 JournalPrinter_PrintTitle(JournalManager *journalManager, Window *window1, Window *window2) +static u8 JournalPrinter_PrintTitle(JournalManager *journalManager, Window *titleWindow, Window *eventsWindow) { JournalEntryTitle journalEntryTitle; Strbuf *strbuf; @@ -159,18 +159,18 @@ static u8 JournalPrinter_PrintTitle(JournalManager *journalManager, Window *wind StringTemplate_SetNumber(journalManager->template, 1, journalEntryTitle.day, 2, PADDING_MODE_NONE, CHARSET_MODE_EN); StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); Strbuf_Free(strbuf); - Text_AddPrinterWithParamsAndColor(window1, FONT_SYSTEM, journalManager->strbuf, 0, 0, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Text_AddPrinterWithParamsAndColor(titleWindow, FONT_SYSTEM, journalManager->strbuf, 0, 0, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); xOffset = Font_CalcStrbufWidth(FONT_SYSTEM, journalManager->strbuf, 0); strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_sunday + journalEntryTitle.week); - Text_AddPrinterWithParamsAndColor(window1, FONT_SYSTEM, strbuf, xOffset + 12, 0, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Text_AddPrinterWithParamsAndColor(titleWindow, FONT_SYSTEM, strbuf, xOffset + 12, 0, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); Strbuf_Free(strbuf); strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_started_from_location); StringTemplate_SetLocationName(journalManager->template, 0, MapHeader_GetMapLabelTextID(journalEntryTitle.mapID)); StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); - Text_AddPrinterWithParamsAndColor(window2, FONT_SYSTEM, journalManager->strbuf, 0, 0, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Text_AddPrinterWithParamsAndColor(eventsWindow, FONT_SYSTEM, journalManager->strbuf, 0, 0, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); Strbuf_Free(strbuf); return 1; From fb4265efc867670b20d991e41a788d68f6a141f1 Mon Sep 17 00:00:00 2001 From: Viperio19 Date: Wed, 1 Jan 2025 22:21:25 +0100 Subject: [PATCH 4/4] Using constants and defines --- .../journal_display/journal_controller.c | 12 +- .../journal_display/journal_printer.c | 134 ++++++++++-------- 2 files changed, 77 insertions(+), 69 deletions(-) diff --git a/src/applications/journal_display/journal_controller.c b/src/applications/journal_display/journal_controller.c index d44c44c808..31bbaac33b 100644 --- a/src/applications/journal_display/journal_controller.c +++ b/src/applications/journal_display/journal_controller.c @@ -208,8 +208,8 @@ static void JournalController_SetupBgs(BgConfig *bgConfig) 0 }; - Bg_InitFromTemplate(bgConfig, 0, &bgTemplate1, 0); - Bg_ClearTilemap(bgConfig, 0); + Bg_InitFromTemplate(bgConfig, BG_LAYER_MAIN_0, &bgTemplate1, BG_TYPE_STATIC); + Bg_ClearTilemap(bgConfig, BG_LAYER_MAIN_0); BgTemplate bgTemplate2 = { 0, @@ -227,8 +227,8 @@ static void JournalController_SetupBgs(BgConfig *bgConfig) 0 }; - Bg_InitFromTemplate(bgConfig, 1, &bgTemplate2, 0); - Bg_ClearTilemap(bgConfig, 1); + Bg_InitFromTemplate(bgConfig, BG_LAYER_MAIN_1, &bgTemplate2, BG_TYPE_STATIC); + Bg_ClearTilemap(bgConfig, BG_LAYER_MAIN_1); BgTemplate bgTemplate3 = { 0, @@ -246,7 +246,7 @@ static void JournalController_SetupBgs(BgConfig *bgConfig) 0 }; - Bg_InitFromTemplate(bgConfig, 2, &bgTemplate3, 0); + Bg_InitFromTemplate(bgConfig, BG_LAYER_MAIN_2, &bgTemplate3, BG_TYPE_STATIC); BgTemplate bgTemplate4 = { 0, @@ -264,7 +264,7 @@ static void JournalController_SetupBgs(BgConfig *bgConfig) 0 }; - Bg_InitFromTemplate(bgConfig, 3, &bgTemplate4, 0); + Bg_InitFromTemplate(bgConfig, BG_LAYER_MAIN_3, &bgTemplate4, BG_TYPE_STATIC); Bg_ClearTilesRange(BG_LAYER_MAIN_0, 32, 0, HEAP_ID_JOURNAL); Bg_ClearTilesRange(BG_LAYER_MAIN_1, 32, 0, HEAP_ID_JOURNAL); diff --git a/src/applications/journal_display/journal_printer.c b/src/applications/journal_display/journal_printer.c index c2e05b1a51..25ec294a39 100644 --- a/src/applications/journal_display/journal_printer.c +++ b/src/applications/journal_display/journal_printer.c @@ -10,6 +10,8 @@ #include "applications/journal_display/journal_controller.h" #include "text/gmm/message_bank_journal_entries.h" #include "text/gmm/message_bank_location_names.h" +#include "text/gmm/message_bank_npc_trainer_names.h" +#include "text/pl_msg.naix" #include "bg_window.h" #include "font.h" @@ -23,6 +25,12 @@ #include "text.h" #include "trainer_data.h" +#define ROW_HEIGHT 16 +#define LOCATION_EVENT_Y_OFFSET ROW_HEIGHT +#define POKEMON_EVENT_Y_OFFSET (LOCATION_EVENT_Y_OFFSET * MAX_JOURNAL_LOCATION_EVENTS + ROW_HEIGHT) +#define TRAINER_EVENT_Y_OFFSET (POKEMON_EVENT_Y_OFFSET + ROW_HEIGHT) +#define ONLINE_EVENT_Y_OFFSET (TRAINER_EVENT_Y_OFFSET + ROW_HEIGHT) + static u8 JournalPrinter_PrintTitle(JournalManager *journalManager, Window *titleWindow, Window *eventsWindow); static void JournalPrinter_PrintLocationEvents(JournalManager *journalManager, Window *window); static void JournalPrinter_PrintPokemonEvent(JournalManager *journalManager, Window *window); @@ -332,7 +340,7 @@ static void JournalPrinter_PrintTrainerEvent(JournalManager *journalManager, Win return; } - Strbuf *name = MessageBank_GetNewStrbufFromNARC(26, 433, MapHeader_GetMapLabelTextID(journalEntryTrainer.mapID), 42); + Strbuf *name = MessageBank_GetNewStrbufFromNARC(NARC_INDEX_MSGDATA__PL_MSG, message_bank_location_names, MapHeader_GetMapLabelTextID(journalEntryTrainer.mapID), location_names_00042); strLength = Strbuf_Length(name); Strbuf_Free(name); @@ -343,7 +351,7 @@ static void JournalPrinter_PrintTrainerEvent(JournalManager *journalManager, Win strLength += Strbuf_Length(journalManager->strbuf); Strbuf_Free(name); } else { - name = MessageBank_GetNewStrbufFromNARC(26, 618, journalEntryTrainer.trainerID, 42); + name = MessageBank_GetNewStrbufFromNARC(NARC_INDEX_MSGDATA__PL_MSG, message_bank_npc_trainer_names, journalEntryTrainer.trainerID, pl_msg_00000618_00042); strLength += Strbuf_Length(name); Strbuf_Free(name); StringTemplate_SetTrainerName(journalManager->template, 1, journalEntryTrainer.trainerID); @@ -361,7 +369,7 @@ static void JournalPrinter_PrintTrainerEvent(JournalManager *journalManager, Win StringTemplate_SetLocationName(journalManager->template, 0, MapHeader_GetMapLabelTextID(journalEntryTrainer.mapID)); StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, ((16 * 4 + 16) + 16), TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, TRAINER_EVENT_Y_OFFSET, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); Strbuf_Free(strbuf); } @@ -459,7 +467,7 @@ static void JournalPrinter_PrintRestedAtHome(JournalManager *journalManager, Win { Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_rested_at_home); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, LOCATION_EVENT_Y_OFFSET + row * ROW_HEIGHT, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); Strbuf_Free(strbuf); } @@ -467,7 +475,7 @@ static void JournalPrinter_PrintLeftResearchLab(JournalManager *journalManager, { Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_left_research_lab); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, LOCATION_EVENT_Y_OFFSET + row * ROW_HEIGHT, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); Strbuf_Free(strbuf); } @@ -475,7 +483,7 @@ static void JournalPrinter_PrintUsedPCBox(JournalManager *journalManager, Window { Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_used_pc_box); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, LOCATION_EVENT_Y_OFFSET + row * ROW_HEIGHT, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); Strbuf_Free(strbuf); } @@ -483,7 +491,7 @@ static void JournalPrinter_PrintShoppedAtMart(JournalManager *journalManager, Wi { Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_shopped_at_poke_mart); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, LOCATION_EVENT_Y_OFFSET + row * ROW_HEIGHT, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); Strbuf_Free(strbuf); } @@ -491,7 +499,7 @@ static void JournalPrinter_PrintLotsOfShoppingAtMart(JournalManager *journalMana { Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_lots_of_shopping_at_poke_mart); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, LOCATION_EVENT_Y_OFFSET + row * ROW_HEIGHT, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); Strbuf_Free(strbuf); } @@ -499,7 +507,7 @@ static void JournalPrinter_PrintSoldALittleAtMart(JournalManager *journalManager { Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_sold_a_little_at_poke_mart); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, LOCATION_EVENT_Y_OFFSET + row * ROW_HEIGHT, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); Strbuf_Free(strbuf); } @@ -507,7 +515,7 @@ static void JournalPrinter_PrintSoldALotAtMart(JournalManager *journalManager, W { Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_sold_a_lot_at_poke_mart); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, LOCATION_EVENT_Y_OFFSET + row * ROW_HEIGHT, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); Strbuf_Free(strbuf); } @@ -515,7 +523,7 @@ static void JournalPrinter_PrintDidBusinessAtMart(JournalManager *journalManager { Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_did_business_at_poke_mart); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, LOCATION_EVENT_Y_OFFSET + row * ROW_HEIGHT, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); Strbuf_Free(strbuf); } @@ -525,7 +533,7 @@ static void JournalPrinter_PrintGymWasTooTough(JournalManager *journalManager, W StringTemplate_SetGymName(journalManager->template, 0, journalEntryLocationEvent->locationID); StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, LOCATION_EVENT_Y_OFFSET + row * ROW_HEIGHT, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); Strbuf_Free(strbuf); } @@ -536,7 +544,7 @@ static void JournalPrinter_PrintBeatGymLeader(JournalManager *journalManager, Wi StringTemplate_SetGymName(journalManager->template, 0, journalEntryLocationEvent->locationID); StringTemplate_SetTrainerName(journalManager->template, 1, journalEntryLocationEvent->trainerID); StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, LOCATION_EVENT_Y_OFFSET + row * ROW_HEIGHT, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); Strbuf_Free(strbuf); } @@ -546,7 +554,7 @@ static void JournalPrinter_PrintBeatEliteFourMember(JournalManager *journalManag StringTemplate_SetTrainerName(journalManager->template, 0, journalEntryLocationEvent->trainerID); StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, LOCATION_EVENT_Y_OFFSET + row * ROW_HEIGHT, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); Strbuf_Free(strbuf); } @@ -556,7 +564,7 @@ static void JournalPrinter_PrintBeatChampion(JournalManager *journalManager, Win StringTemplate_SetTrainerName(journalManager->template, 0, journalEntryLocationEvent->trainerID); StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, LOCATION_EVENT_Y_OFFSET + row * ROW_HEIGHT, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); Strbuf_Free(strbuf); } @@ -566,7 +574,7 @@ static void JournalPrinter_PrintArrivedInLocation(JournalManager *journalManager StringTemplate_SetLocationName(journalManager->template, 0, MapHeader_GetMapLabelTextID(journalEntryLocationEvent->locationID)); StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, LOCATION_EVENT_Y_OFFSET + row * ROW_HEIGHT, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); Strbuf_Free(strbuf); } @@ -583,7 +591,7 @@ static void JournalPrinter_PrintLeftCave(JournalManager *journalManager, Window StringTemplate_SetLocationName(journalManager->template, 0, mapLabelTextID); StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, LOCATION_EVENT_Y_OFFSET + row * ROW_HEIGHT, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); Strbuf_Free(strbuf); } @@ -600,7 +608,7 @@ static void JournalPrinter_PrintLeftBuilding(JournalManager *journalManager, Win StringTemplate_SetLocationName(journalManager->template, 0, mapLabelTextID); StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, LOCATION_EVENT_Y_OFFSET + row * ROW_HEIGHT, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); Strbuf_Free(strbuf); } @@ -608,7 +616,7 @@ static void JournalPrinter_PrintGameCorner(JournalManager *journalManager, Windo { Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_played_at_game_corner); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, LOCATION_EVENT_Y_OFFSET + row * ROW_HEIGHT, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); Strbuf_Free(strbuf); } @@ -616,7 +624,7 @@ static void JournalPrinter_PrintSafariGame(JournalManager *journalManager, Windo { Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_played_safari_game); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, LOCATION_EVENT_Y_OFFSET + row * ROW_HEIGHT, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); Strbuf_Free(strbuf); } @@ -626,7 +634,7 @@ static void JournalPrinter_PrintItemWasObtained(JournalManager *journalManager, StringTemplate_SetItemName(journalManager->template, 0, journalEntryLocationEvent->item); StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, LOCATION_EVENT_Y_OFFSET + row * ROW_HEIGHT, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); Strbuf_Free(strbuf); } @@ -636,7 +644,7 @@ static void JournalPrinter_PrintUsedRockSmash(JournalManager *journalManager, Wi StringTemplate_SetLocationName(journalManager->template, 0, MapHeader_GetMapLabelTextID(journalEntryLocationEvent->locationID)); StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, LOCATION_EVENT_Y_OFFSET + row * ROW_HEIGHT, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); Strbuf_Free(strbuf); } @@ -646,7 +654,7 @@ static void JournalPrinter_PrintUsedCut(JournalManager *journalManager, Window * StringTemplate_SetLocationName(journalManager->template, 0, MapHeader_GetMapLabelTextID(journalEntryLocationEvent->locationID)); StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, LOCATION_EVENT_Y_OFFSET + row * ROW_HEIGHT, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); Strbuf_Free(strbuf); } @@ -656,7 +664,7 @@ static void JournalPrinter_PrintFlewToLocation(JournalManager *journalManager, W StringTemplate_SetLocationName(journalManager->template, 0, MapHeader_GetMapLabelTextID(journalEntryLocationEvent->locationID)); StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, LOCATION_EVENT_Y_OFFSET + row * ROW_HEIGHT, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); Strbuf_Free(strbuf); } @@ -666,7 +674,7 @@ static void JournalPrinter_PrintUsedDefog(JournalManager *journalManager, Window StringTemplate_SetLocationName(journalManager->template, 0, MapHeader_GetMapLabelTextID(journalEntryLocationEvent->locationID)); StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, LOCATION_EVENT_Y_OFFSET + row * ROW_HEIGHT, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); Strbuf_Free(strbuf); } @@ -676,7 +684,7 @@ static void JournalPrinter_PrintUsedStrength(JournalManager *journalManager, Win StringTemplate_SetLocationName(journalManager->template, 0, MapHeader_GetMapLabelTextID(journalEntryLocationEvent->locationID)); StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, LOCATION_EVENT_Y_OFFSET + row * ROW_HEIGHT, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); Strbuf_Free(strbuf); } @@ -686,7 +694,7 @@ static void JournalPrinter_PrintUsedSurf(JournalManager *journalManager, Window StringTemplate_SetLocationName(journalManager->template, 0, MapHeader_GetMapLabelTextID(journalEntryLocationEvent->locationID)); StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, LOCATION_EVENT_Y_OFFSET + row * ROW_HEIGHT, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); Strbuf_Free(strbuf); } @@ -696,7 +704,7 @@ static void JournalPrinter_PrintUsedRockClimb(JournalManager *journalManager, Wi StringTemplate_SetLocationName(journalManager->template, 0, MapHeader_GetMapLabelTextID(journalEntryLocationEvent->locationID)); StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, LOCATION_EVENT_Y_OFFSET + row * ROW_HEIGHT, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); Strbuf_Free(strbuf); } @@ -706,7 +714,7 @@ static void JournalPrinter_PrintUsedWaterfall(JournalManager *journalManager, Wi StringTemplate_SetLocationName(journalManager->template, 0, MapHeader_GetMapLabelTextID(journalEntryLocationEvent->locationID)); StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, LOCATION_EVENT_Y_OFFSET + row * ROW_HEIGHT, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); Strbuf_Free(strbuf); } @@ -716,7 +724,7 @@ static void JournalPrinter_PrintUsedFlash(JournalManager *journalManager, Window StringTemplate_SetLocationName(journalManager->template, 0, MapHeader_GetMapLabelTextID(journalEntryLocationEvent->locationID)); StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, LOCATION_EVENT_Y_OFFSET + row * ROW_HEIGHT, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); Strbuf_Free(strbuf); } @@ -726,7 +734,7 @@ static void JournalPrinter_PrintWarpedToLocation(JournalManager *journalManager, StringTemplate_SetLocationName(journalManager->template, 0, MapHeader_GetMapLabelTextID(journalEntryLocationEvent->locationID)); StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, LOCATION_EVENT_Y_OFFSET + row * ROW_HEIGHT, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); Strbuf_Free(strbuf); } @@ -736,7 +744,7 @@ static void JournalPrinter_PrintUsedDig(JournalManager *journalManager, Window * StringTemplate_SetLocationName(journalManager->template, 0, MapHeader_GetMapLabelTextID(journalEntryLocationEvent->locationID)); StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, LOCATION_EVENT_Y_OFFSET + row * ROW_HEIGHT, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); Strbuf_Free(strbuf); } @@ -744,7 +752,7 @@ static void JournalPrinter_PrintLuredPokemon(JournalManager *journalManager, Win { Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_lured_pokemon); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, LOCATION_EVENT_Y_OFFSET + row * ROW_HEIGHT, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); Strbuf_Free(strbuf); } @@ -752,7 +760,7 @@ static void JournalPrinter_PrintUsedSoftboiled(JournalManager *journalManager, W { Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_used_softboiled); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, LOCATION_EVENT_Y_OFFSET + row * ROW_HEIGHT, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); Strbuf_Free(strbuf); } @@ -760,7 +768,7 @@ static void JournalPrinter_PrintUsedMilkDrink(JournalManager *journalManager, Wi { Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_used_milk_drink); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, LOCATION_EVENT_Y_OFFSET + row * ROW_HEIGHT, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); Strbuf_Free(strbuf); } @@ -768,7 +776,7 @@ static void JournalPrinter_PrintDugUnderground(JournalManager *journalManager, W { Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_dug_underground); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, LOCATION_EVENT_Y_OFFSET + row * ROW_HEIGHT, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); Strbuf_Free(strbuf); } @@ -776,7 +784,7 @@ static void JournalPrinter_PrintBuiltSecretBase(JournalManager *journalManager, { Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_built_secret_base); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, LOCATION_EVENT_Y_OFFSET + row * ROW_HEIGHT, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); Strbuf_Free(strbuf); } @@ -805,7 +813,7 @@ static void JournalPrinter_PrintPlayedAtBattleFacility(JournalManager *journalMa } strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, message); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, 16 + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, LOCATION_EVENT_Y_OFFSET + row * ROW_HEIGHT, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); Strbuf_Free(strbuf); } @@ -843,7 +851,7 @@ static void JournalPrinter_PrintPokemonCaught(JournalManager *journalManager, Wi StringTemplate_SetTimeOfDay(journalManager->template, 1, journalEntryMon->timeOfDay); StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, (16 * 4 + 16), TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, POKEMON_EVENT_Y_OFFSET, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); Strbuf_Free(strbuf); } @@ -872,7 +880,7 @@ static void JournalPrinter_PrintPokemonDefeated(JournalManager *journalManager, StringTemplate_SetTimeOfDay(journalManager->template, 1, journalEntryMon->timeOfDay); StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, (16 * 4 + 16), TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, POKEMON_EVENT_Y_OFFSET, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); Strbuf_Free(strbuf); } @@ -904,7 +912,7 @@ static void JournalPrinter_PrintSingleBattleEvent(JournalManager *journalManager JournalPrinter_SetPlayerOrPokemonName(journalManager, journalEntryOnlineEvent->playerName1, journalEntryOnlineEvent->unused1, 0); StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, ONLINE_EVENT_Y_OFFSET + row * ROW_HEIGHT, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); Strbuf_Free(strbuf); } @@ -927,7 +935,7 @@ static void JournalPrinter_PrintDoubleBattleEvent(JournalManager *journalManager JournalPrinter_SetPlayerOrPokemonName(journalManager, journalEntryOnlineEvent->playerName1, journalEntryOnlineEvent->unused1, 0); StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, ONLINE_EVENT_Y_OFFSET + row * ROW_HEIGHT, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); Strbuf_Free(strbuf); } @@ -951,7 +959,7 @@ static void JournalPrinter_PrintMultiBattleEvent(JournalManager *journalManager, JournalPrinter_SetPlayerOrPokemonName(journalManager, journalEntryOnlineEvent->playerName1, journalEntryOnlineEvent->unused1, 0); JournalPrinter_SetPlayerOrPokemonName(journalManager, journalEntryOnlineEvent->playerName2, journalEntryOnlineEvent->unused2, 1); StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, ONLINE_EVENT_Y_OFFSET + row * ROW_HEIGHT, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); Strbuf_Free(strbuf); } @@ -974,7 +982,7 @@ static void JournalPrinter_PrintMixSingleBattleEvent(JournalManager *journalMana JournalPrinter_SetPlayerOrPokemonName(journalManager, journalEntryOnlineEvent->playerName1, journalEntryOnlineEvent->unused1, 0); StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, ONLINE_EVENT_Y_OFFSET + row * ROW_HEIGHT, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); Strbuf_Free(strbuf); } @@ -998,7 +1006,7 @@ static void JournalPrinter_PrintMixMultiBattleEvent(JournalManager *journalManag JournalPrinter_SetPlayerOrPokemonName(journalManager, journalEntryOnlineEvent->playerName1, journalEntryOnlineEvent->unused1, 0); JournalPrinter_SetPlayerOrPokemonName(journalManager, journalEntryOnlineEvent->playerName2, journalEntryOnlineEvent->unused2, 1); StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, ONLINE_EVENT_Y_OFFSET + row * ROW_HEIGHT, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); Strbuf_Free(strbuf); } @@ -1008,7 +1016,7 @@ static void JournalPrinter_PrintGreetedInUnionRoom(JournalManager *journalManage JournalPrinter_SetPlayerOrPokemonName(journalManager, journalEntryOnlineEvent->playerName1, journalEntryOnlineEvent->unused1, 0); StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, ONLINE_EVENT_Y_OFFSET + row * ROW_HEIGHT, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); Strbuf_Free(strbuf); } @@ -1019,7 +1027,7 @@ static void JournalPrinter_PrintGotPokemonFromTrade(JournalManager *journalManag JournalPrinter_SetPlayerOrPokemonName(journalManager, journalEntryOnlineEvent->playerName1, journalEntryOnlineEvent->unused1, 0); JournalPrinter_SetPlayerOrPokemonName(journalManager, journalEntryOnlineEvent->pokemonName, journalEntryOnlineEvent->unused3, 1); StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, ONLINE_EVENT_Y_OFFSET + row * ROW_HEIGHT, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); Strbuf_Free(strbuf); } @@ -1027,7 +1035,7 @@ static void JournalPrinter_PrintDrewPictures(JournalManager *journalManager, Win { Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_drew_pictures_with_others); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, ONLINE_EVENT_Y_OFFSET + row * ROW_HEIGHT, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); Strbuf_Free(strbuf); } @@ -1037,7 +1045,7 @@ static void JournalPrinter_PrintGotPokemonInFriendTrade(JournalManager *journalM JournalPrinter_SetPlayerOrPokemonName(journalManager, journalEntryOnlineEvent->pokemonName, journalEntryOnlineEvent->unused3, 0); StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, ONLINE_EVENT_Y_OFFSET + row * ROW_HEIGHT, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); Strbuf_Free(strbuf); } @@ -1045,7 +1053,7 @@ static void JournalPrinter_PrintChattedWithOthers(JournalManager *journalManager { Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_chatted_with_others); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, ONLINE_EVENT_Y_OFFSET + row * ROW_HEIGHT, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); Strbuf_Free(strbuf); } @@ -1068,7 +1076,7 @@ static void JournalPrinter_PrintUnionBattleEvent(JournalManager *journalManager, JournalPrinter_SetPlayerOrPokemonName(journalManager, journalEntryOnlineEvent->playerName1, journalEntryOnlineEvent->unused1, 0); StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, ONLINE_EVENT_Y_OFFSET + row * ROW_HEIGHT, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); Strbuf_Free(strbuf); } @@ -1076,7 +1084,7 @@ static void JournalPrinter_PrintMixedRecords(JournalManager *journalManager, Win { Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_mixed_records); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, ONLINE_EVENT_Y_OFFSET + row * ROW_HEIGHT, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); Strbuf_Free(strbuf); } @@ -1086,7 +1094,7 @@ static void JournalPrinter_PrintPlacedInContest(JournalManager *journalManager, StringTemplate_SetNumber(journalManager->template, 0, journalEntryOnlineEvent->result, 1, PADDING_MODE_NONE, CHARSET_MODE_EN); StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, ONLINE_EVENT_Y_OFFSET + row * ROW_HEIGHT, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); Strbuf_Free(strbuf); } @@ -1094,7 +1102,7 @@ static void JournalPrinter_PrintMadePoffins(JournalManager *journalManager, Wind { Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_made_poffins_in_group); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, ONLINE_EVENT_Y_OFFSET + row * ROW_HEIGHT, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); Strbuf_Free(strbuf); } @@ -1105,7 +1113,7 @@ static void JournalPrinter_PrintGotPokemonGTS(JournalManager *journalManager, Wi JournalPrinter_SetPlayerOrPokemonName(journalManager, journalEntryOnlineEvent->playerName1, journalEntryOnlineEvent->unused1, 0); JournalPrinter_SetPlayerOrPokemonName(journalManager, journalEntryOnlineEvent->pokemonName, journalEntryOnlineEvent->unused3, 1); StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, ONLINE_EVENT_Y_OFFSET + row * ROW_HEIGHT, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); Strbuf_Free(strbuf); } @@ -1113,7 +1121,7 @@ static void JournalPrinter_PrintBattleRoom(JournalManager *journalManager, Windo { Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_won_in_battle_room); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, ONLINE_EVENT_Y_OFFSET + row * ROW_HEIGHT, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); Strbuf_Free(strbuf); } @@ -1121,7 +1129,7 @@ static void JournalPrinter_PrintSpinTrade(JournalManager *journalManager, Window { Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_did_spin_trade); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, ONLINE_EVENT_Y_OFFSET + row * ROW_HEIGHT, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); Strbuf_Free(strbuf); } @@ -1147,7 +1155,7 @@ static void JournalPrinter_PrintMiscEvent1(JournalManager *journalManager, Windo } strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, message); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, ONLINE_EVENT_Y_OFFSET + row * ROW_HEIGHT, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); Strbuf_Free(strbuf); } @@ -1157,7 +1165,7 @@ static void JournalPrinter_PrintChattedInPlaza(JournalManager *journalManager, W JournalPrinter_SetPlayerOrPokemonName(journalManager, journalEntryOnlineEvent->playerName1, journalEntryOnlineEvent->unused1, 0); StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, ONLINE_EVENT_Y_OFFSET + row * ROW_HEIGHT, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); Strbuf_Free(strbuf); } @@ -1167,7 +1175,7 @@ static void JournalPrinter_PrintGotTapToy(JournalManager *journalManager, Window JournalPrinter_SetPlayerOrPokemonName(journalManager, journalEntryOnlineEvent->playerName1, journalEntryOnlineEvent->unused1, 0); StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, ONLINE_EVENT_Y_OFFSET + row * ROW_HEIGHT, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); Strbuf_Free(strbuf); } @@ -1177,7 +1185,7 @@ static void JournalPrinter_PrintPlazaMinigame(JournalManager *journalManager, Wi StringTemplate_SetPlazaMinigameName(journalManager->template, 0, journalEntryOnlineEvent->result); StringTemplate_Format(journalManager->template, journalManager->strbuf, strbuf); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, journalManager->strbuf, 0, ONLINE_EVENT_Y_OFFSET + row * ROW_HEIGHT, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); Strbuf_Free(strbuf); } @@ -1203,7 +1211,7 @@ static void JournalPrinter_PrintMiscEvent2(JournalManager *journalManager, Windo } strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, message); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, ONLINE_EVENT_Y_OFFSET + row * ROW_HEIGHT, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); Strbuf_Free(strbuf); } @@ -1211,6 +1219,6 @@ static void JournalPrinter_PrintWiFiClub(JournalManager *journalManager, Window { Strbuf *strbuf = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_played_at_wi_fi_club); - Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, (((16 * 4 + 16) + 16) + 16) + row * 16, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); + Text_AddPrinterWithParamsAndColor(window, FONT_SYSTEM, strbuf, 0, ONLINE_EVENT_Y_OFFSET + row * ROW_HEIGHT, TEXT_SPEED_NO_TRANSFER, TEXT_COLOR(1, 2, 0), NULL); Strbuf_Free(strbuf); }