From 8df65ef7a08ee617dc858e4f40429c01f866f1dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Calixte?= Date: Thu, 20 May 2021 19:22:55 +0200 Subject: more extern cleanups --- arm9/src/script_buffers.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'arm9/src/script_buffers.c') diff --git a/arm9/src/script_buffers.c b/arm9/src/script_buffers.c index e9a55051..68ab5934 100644 --- a/arm9/src/script_buffers.c +++ b/arm9/src/script_buffers.c @@ -21,8 +21,6 @@ extern void StringCat_HandleTrainerName(struct String * dest, const struct Strin extern void StrAddChar(struct String * str, u16 val); extern void * FUN_02006BB0(NarcId, s32, s32, struct UnkStruct_0200B870_sub **, u32); extern BOOL UncompressFromNarc(NarcId narcId, s32 memberNo, BOOL a2, u32 heap_id, BOOL a4); -extern void FUN_02019658(int, u8 *, u16, u16, u16, u16, u16, u16, u16, u16); -extern void FUN_020196F4(int, u8, u16, u16, u16, u16); const u16 UNK_020ECE6C[][2] = { { 0x0140, 0x0008 }, @@ -803,12 +801,12 @@ void MessagePrinter_delete(struct UnkStruct_0200B870 * a0) } } -void FUN_0200B9A8(struct UnkStruct_0200B870 * a0, int a1, int a2, int a3, int a4) +void FUN_0200B9A8(struct UnkStruct_0200B870 * a0, int a1, struct Window *a2, int a3, int a4) { FUN_02019658(a2, a0->unk_4->unk_14 + UNK_020ECE6C[a1][0], 0, 0, UNK_020ECE6C[a1][1], 8, (u16)a3, (u16)a4, UNK_020ECE6C[a1][1], 8); } -void FUN_0200B9EC(struct UnkStruct_0200B870 * string, u32 value, u32 n, enum PrintingMode mode, int sp30, int r5, int r7) +void FUN_0200B9EC(struct UnkStruct_0200B870 * string, u32 value, u32 n, enum PrintingMode mode, struct Window *sp30, int r5, int r7) { ConvertUIntToDecimalString(string->data, value, mode, n); for (int i = 0; string->data[i] != EOS; i++) -- cgit v1.2.3 From bcc2b21b1db3a0a54c5d5c446644b288064e14d9 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Fri, 21 May 2021 13:45:38 -0400 Subject: ListMenuUpdateSelectedRowIndexAndScrollOffset --- arm9/src/script_buffers.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'arm9/src/script_buffers.c') diff --git a/arm9/src/script_buffers.c b/arm9/src/script_buffers.c index e9a55051..55ceca6a 100644 --- a/arm9/src/script_buffers.c +++ b/arm9/src/script_buffers.c @@ -22,7 +22,7 @@ extern void StrAddChar(struct String * str, u16 val); extern void * FUN_02006BB0(NarcId, s32, s32, struct UnkStruct_0200B870_sub **, u32); extern BOOL UncompressFromNarc(NarcId narcId, s32 memberNo, BOOL a2, u32 heap_id, BOOL a4); extern void FUN_02019658(int, u8 *, u16, u16, u16, u16, u16, u16, u16, u16); -extern void FUN_020196F4(int, u8, u16, u16, u16, u16); +extern void FillWindowPixelRect(int, u8, u16, u16, u16, u16); const u16 UNK_020ECE6C[][2] = { { 0x0140, 0x0008 }, @@ -819,7 +819,7 @@ void FUN_0200B9EC(struct UnkStruct_0200B870 * string, u32 value, u32 n, enum Pri } else { - FUN_020196F4(sp30, (u8)string->unk_28, (u16)r5, (u16)r7, 8, 8); + FillWindowPixelRect(sp30, (u8)string->unk_28, (u16)r5, (u16)r7, 8, 8); } r5 += 8; } -- cgit v1.2.3 From 4d5947ecb02e28fce1cd1156bd6908571fbf29bd Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Fri, 21 May 2021 21:50:44 -0400 Subject: Adjust typing in text.c routines --- arm9/src/script_buffers.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'arm9/src/script_buffers.c') diff --git a/arm9/src/script_buffers.c b/arm9/src/script_buffers.c index 55ceca6a..e17654d8 100644 --- a/arm9/src/script_buffers.c +++ b/arm9/src/script_buffers.c @@ -21,7 +21,7 @@ extern void StringCat_HandleTrainerName(struct String * dest, const struct Strin extern void StrAddChar(struct String * str, u16 val); extern void * FUN_02006BB0(NarcId, s32, s32, struct UnkStruct_0200B870_sub **, u32); extern BOOL UncompressFromNarc(NarcId narcId, s32 memberNo, BOOL a2, u32 heap_id, BOOL a4); -extern void FUN_02019658(int, u8 *, u16, u16, u16, u16, u16, u16, u16, u16); +extern void BlitBitmapRectToWindow(int, u8 *, u16, u16, u16, u16, u16, u16, u16, u16); extern void FillWindowPixelRect(int, u8, u16, u16, u16, u16); const u16 UNK_020ECE6C[][2] = { @@ -805,7 +805,7 @@ void MessagePrinter_delete(struct UnkStruct_0200B870 * a0) void FUN_0200B9A8(struct UnkStruct_0200B870 * a0, int a1, int a2, int a3, int a4) { - FUN_02019658(a2, a0->unk_4->unk_14 + UNK_020ECE6C[a1][0], 0, 0, UNK_020ECE6C[a1][1], 8, (u16)a3, (u16)a4, UNK_020ECE6C[a1][1], 8); + BlitBitmapRectToWindow(a2, a0->unk_4->unk_14 + UNK_020ECE6C[a1][0], 0, 0, UNK_020ECE6C[a1][1], 8, (u16)a3, (u16)a4, UNK_020ECE6C[a1][1], 8); } void FUN_0200B9EC(struct UnkStruct_0200B870 * string, u32 value, u32 n, enum PrintingMode mode, int sp30, int r5, int r7) @@ -815,7 +815,7 @@ void FUN_0200B9EC(struct UnkStruct_0200B870 * string, u32 value, u32 n, enum Pri { if (string->data[i] >= 0x00A2 && string->data[i] <= 0x00AB) { - FUN_02019658(sp30, string->unk_4->unk_14 + (string->data[i] - 0x00A2) * 32, 0, 0, 8, 8, (u16)r5, (u16)r7, 8, 8); + BlitBitmapRectToWindow(sp30, string->unk_4->unk_14 + (string->data[i] - 0x00A2) * 32, 0, 0, 8, 8, (u16)r5, (u16)r7, 8, 8); } else { -- cgit v1.2.3 From de6f8fc978e5297d3f425d2d6c8517e9bb8e75ff Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 22 May 2021 10:37:04 -0400 Subject: Merge conflicting prototypes --- arm9/src/script_buffers.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'arm9/src/script_buffers.c') diff --git a/arm9/src/script_buffers.c b/arm9/src/script_buffers.c index e17654d8..939781f4 100644 --- a/arm9/src/script_buffers.c +++ b/arm9/src/script_buffers.c @@ -12,6 +12,8 @@ #include "trainer_data.h" #include "script_buffers.h" #include "unk_02024E64.h" +#include "window.h" +#include "text.h" #pragma thumb on @@ -20,9 +22,7 @@ extern void GetECWordIntoStringByIndex(u32 a0, struct String * a1); extern void StringCat_HandleTrainerName(struct String * dest, const struct String * src); extern void StrAddChar(struct String * str, u16 val); extern void * FUN_02006BB0(NarcId, s32, s32, struct UnkStruct_0200B870_sub **, u32); -extern BOOL UncompressFromNarc(NarcId narcId, s32 memberNo, BOOL a2, u32 heap_id, BOOL a4); -extern void BlitBitmapRectToWindow(int, u8 *, u16, u16, u16, u16, u16, u16, u16, u16); -extern void FillWindowPixelRect(int, u8, u16, u16, u16, u16); +extern void * UncompressFromNarc(NarcId narcId, s32 memberNo, BOOL isCompressed, u32 heap_id, BOOL allocAtEnd); const u16 UNK_020ECE6C[][2] = { { 0x0140, 0x0008 }, @@ -803,24 +803,24 @@ void MessagePrinter_delete(struct UnkStruct_0200B870 * a0) } } -void FUN_0200B9A8(struct UnkStruct_0200B870 * a0, int a1, int a2, int a3, int a4) +void FUN_0200B9A8(struct UnkStruct_0200B870 * a0, int a1, struct Window * a2, int a3, int a4) { BlitBitmapRectToWindow(a2, a0->unk_4->unk_14 + UNK_020ECE6C[a1][0], 0, 0, UNK_020ECE6C[a1][1], 8, (u16)a3, (u16)a4, UNK_020ECE6C[a1][1], 8); } -void FUN_0200B9EC(struct UnkStruct_0200B870 * string, u32 value, u32 n, enum PrintingMode mode, int sp30, int r5, int r7) +void FUN_0200B9EC(struct UnkStruct_0200B870 * string, u32 value, u32 n, enum PrintingMode mode, struct Window *window, int x, int y) { ConvertUIntToDecimalString(string->data, value, mode, n); for (int i = 0; string->data[i] != EOS; i++) { - if (string->data[i] >= 0x00A2 && string->data[i] <= 0x00AB) + if (string->data[i] >= CHAR_0 && string->data[i] <= CHAR_9) { - BlitBitmapRectToWindow(sp30, string->unk_4->unk_14 + (string->data[i] - 0x00A2) * 32, 0, 0, 8, 8, (u16)r5, (u16)r7, 8, 8); + BlitBitmapRectToWindow(window, string->unk_4->unk_14 + (string->data[i] - CHAR_0) * 32, 0, 0, 8, 8, (u16)x, (u16)y, 8, 8); } else { - FillWindowPixelRect(sp30, (u8)string->unk_28, (u16)r5, (u16)r7, 8, 8); + FillWindowPixelRect(window, (u8)string->unk_28, (u16)x, (u16)y, 8, 8); } - r5 += 8; + x += 8; } } -- cgit v1.2.3 From fea86c63479708926cce890f65cf7c9217f6fc4c Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 29 May 2021 11:17:47 -0400 Subject: Name funcs in gf_gfx_loader --- arm9/src/script_buffers.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'arm9/src/script_buffers.c') diff --git a/arm9/src/script_buffers.c b/arm9/src/script_buffers.c index 596056b1..1242d550 100644 --- a/arm9/src/script_buffers.c +++ b/arm9/src/script_buffers.c @@ -20,8 +20,8 @@ extern u32 GetCityNamesMsgdataIdByCountry(u32); extern void GetECWordIntoStringByIndex(u32 a0, struct String * a1); extern void StringCat_HandleTrainerName(struct String * dest, const struct String * src); extern void StrAddChar(struct String * str, u16 val); -extern void * FUN_02006BB0(NarcId, s32, s32, struct UnkStruct_0200B870_sub **, u32); -extern void * UncompressFromNarc(NarcId narcId, s32 memberNo, BOOL isCompressed, u32 heap_id, BOOL allocAtEnd); +extern void * GfGfxLoader_GetCharData(NarcId, s32, s32, struct UnkStruct_0200B870_sub **, u32); +extern void * GfGfxLoader_LoadFromNarc(NarcId narcId, s32 memberNo, BOOL isCompressed, u32 heap_id, BOOL allocAtEnd); const u16 UNK_020ECE6C[][2] = { { 0x0140, 0x0008 }, @@ -751,7 +751,7 @@ struct UnkStruct_0200B870 * MessagePrinter_new(u32 r5, u32 r6, u32 sp4, u32 r4) struct UnkStruct_0200B870 * sp8 = AllocFromHeap(r4, sizeof(struct UnkStruct_0200B870)); if (sp8 != NULL) { - sp8->unk_0 = FUN_02006BB0(NARC_GRAPHIC_FONT, 4, 1, &sp8->unk_4, r4); + sp8->unk_0 = GfGfxLoader_GetCharData(NARC_GRAPHIC_FONT, 4, 1, &sp8->unk_4, r4); int i; u8 * ptr = sp8->unk_4->unk_14; for (i = 0; i < sp8->unk_4->unk_10; i++) -- cgit v1.2.3