summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPikalaxALT <pikalaxalt@gmail.com>2021-05-22 10:37:04 -0400
committerPikalaxALT <pikalaxalt@gmail.com>2021-05-22 10:37:04 -0400
commitde6f8fc978e5297d3f425d2d6c8517e9bb8e75ff (patch)
tree9a4e1be7cbadd711196e5efa1fafb9bfd2bba843
parent616cd9b1c1cf789ae990d4236085d1a6748d3850 (diff)
Merge conflicting prototypes
-rw-r--r--arm9/asm/unk_02006864.s2
-rw-r--r--arm9/modules/21/src/mod21_02254854.c2
-rw-r--r--arm9/src/script_buffers.c18
-rw-r--r--arm9/src/text.c14
-rw-r--r--arm9/src/unk_0200CA44.c10
-rw-r--r--include/script_buffers.h5
-rw-r--r--include/text.h17
-rw-r--r--include/unk_0200CA44.h10
-rw-r--r--include/window.h1
9 files changed, 42 insertions, 37 deletions
diff --git a/arm9/asm/unk_02006864.s b/arm9/asm/unk_02006864.s
index 5528150d..5bd62750 100644
--- a/arm9/asm/unk_02006864.s
+++ b/arm9/asm/unk_02006864.s
@@ -567,7 +567,7 @@ FUN_02006C88: ; 0x02006C88
thumb_func_start UncompressFromNarc
UncompressFromNarc: ; 0x02006C98
- ; BOOL UncompressFromNarc(NarcId narcId, s32 memberNo, BOOL a2, u32 heap_id, BOOL a4)
+ ; void * UncompressFromNarc(NarcId narcId, s32 memberNo, BOOL isCompressed, u32 heap_id, BOOL allocAtEnd)
push {r3-r7, lr}
add r5, r2, #0x0
add r7, r0, #0x0
diff --git a/arm9/modules/21/src/mod21_02254854.c b/arm9/modules/21/src/mod21_02254854.c
index a9a7599d..1c91afde 100644
--- a/arm9/modules/21/src/mod21_02254854.c
+++ b/arm9/modules/21/src/mod21_02254854.c
@@ -29,7 +29,7 @@ THUMB_FUNC BOOL MOD21_02254854(UnkStruct02254854 **param0, u32 param1, u32 param
UnkStruct02254854 *alloced = (UnkStruct02254854 *)AllocFromHeap(8, sizeof(UnkStruct02254854));
if (alloced != NULL)
{
- if (MOD21_0225489C(alloced, param1, param2, param3) && FUN_0200CA44((void (*)(u32, void *))MOD21_02254930, alloced, (void *)1))
+ if (MOD21_0225489C(alloced, param1, param2, param3) && FUN_0200CA44((void (*)(u32, struct TextPrinter *))MOD21_02254930, (struct TextPrinter *)alloced, 1))
{
*param0 = alloced;
return TRUE;
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;
}
}
diff --git a/arm9/src/text.c b/arm9/src/text.c
index eee77ae1..b21acf88 100644
--- a/arm9/src/text.c
+++ b/arm9/src/text.c
@@ -3,6 +3,8 @@
#include "string16.h"
#include "MI_memory.h"
#include "filesystem.h"
+#include "script_buffers.h"
+#include "unk_0200CA44.h"
const struct FontInfo *gFonts = NULL;
@@ -13,19 +15,13 @@ u16 UNK_021C5710;
u16 UNK_021C5712;
u8 UNK_021C570C;
-extern u32 FUN_0200CA7C(void (*func)(u32, struct TextPrinter *), struct TextPrinter *printer, u32 param2);
-
extern struct TextPrinter *FUN_0201B6C8(void);
-extern void FUN_0200CAB4(u32 param0);
extern void FUN_0201C1A8(struct TextPrinter *printer);
-extern void CopyWindowToVram(struct Window * window);
extern u32 FontFunc(u8 fontId, struct TextPrinter *printer);
-extern void *FUN_02006BB0(NarcId narcId, s32 param1, BOOL param2, void *param3, u32 heap_id);
-
-extern void BlitBitmapRectToWindow(struct Window * window, void * src, u16 srcX, u16 srcY, u16 srcWidth, u16 srcHeight, u16 dstX, u16 dstY, u16 dstWidth, u16 dstHeight);
+extern void * FUN_02006BB0(NarcId, s32, s32, struct UnkStruct_0200B870_sub **, u32);
THUMB_FUNC void SetFontsPointer(const struct FontInfo *fonts)
@@ -333,9 +329,9 @@ THUMB_FUNC void FUN_0201C1A8(struct TextPrinter *printer)
THUMB_FUNC u16 *FUN_0201C1B0(void)
{
void *res = AllocFromHeap(0, 32 * 24 * sizeof(u16));
- struct Font * var;
+ struct UnkStruct_0200B870_sub * var;
void *tmp = FUN_02006BB0(NARC_GRAPHIC_FONT, 5, 0, &var, 0);
- MIi_CpuCopy32(var->unk20, res, 32 * 24 * sizeof(u16));
+ MIi_CpuCopy32(var->unk_14, res, 32 * 24 * sizeof(u16));
FreeToHeap(tmp);
return res;
}
diff --git a/arm9/src/unk_0200CA44.c b/arm9/src/unk_0200CA44.c
index fd703cd3..6ffed8be 100644
--- a/arm9/src/unk_0200CA44.c
+++ b/arm9/src/unk_0200CA44.c
@@ -2,25 +2,25 @@
#include "main.h"
#include "unk_0200CA44.h"
-extern BOOL FUN_0201B60C(void *, void (*)(u32, void *), void *, void *);
+extern BOOL FUN_0201B60C(void *, void (*)(u32, struct TextPrinter *), struct TextPrinter *, u32);
extern void FUN_0201B6A0(s32);
-THUMB_FUNC BOOL FUN_0200CA44(void (*r0)(u32, void *), void * r1, void * r2)
+THUMB_FUNC BOOL FUN_0200CA44(void (*r0)(u32, struct TextPrinter *), struct TextPrinter * r1, u32 r2)
{
return FUN_0201B60C(gMain.unk18, r0, r1, r2);
}
-THUMB_FUNC BOOL FUN_0200CA60(void (*r0)(u32, void *), void * r1, void * r2)
+THUMB_FUNC BOOL FUN_0200CA60(void (*r0)(u32, struct TextPrinter *), struct TextPrinter * r1, u32 r2)
{
return FUN_0201B60C(gMain.unk1C, r0, r1, r2);
}
-THUMB_FUNC BOOL FUN_0200CA7C(void (*r0)(u32, void *), void * r1, void * r2)
+THUMB_FUNC BOOL FUN_0200CA7C(void (*r0)(u32, struct TextPrinter *), struct TextPrinter * r1, u32 r2)
{
return FUN_0201B60C(gMain.unk24, r0, r1, r2);
}
-THUMB_FUNC BOOL FUN_0200CA98(void (*r0)(u32, void *), void * r1, void * r2)
+THUMB_FUNC BOOL FUN_0200CA98(void (*r0)(u32, struct TextPrinter *), struct TextPrinter * r1, u32 r2)
{
return FUN_0201B60C(gMain.unk20, r0, r1, r2);
}
diff --git a/include/script_buffers.h b/include/script_buffers.h
index d0fff528..51a02e43 100644
--- a/include/script_buffers.h
+++ b/include/script_buffers.h
@@ -4,6 +4,7 @@
#include "pokemon.h"
#include "pokemon_storage_system.h"
#include "trainer_data.h"
+#include "window.h"
struct UnkStruct_0200AA80_sub_sub
{
@@ -105,7 +106,7 @@ void StringExpandPlaceholders(struct ScrStrBufs * mgr, struct String * dest, str
void ScrStrBufs_ResetBuffers(struct ScrStrBufs * mgr);
struct UnkStruct_0200B870 * MessagePrinter_new(u32 r5, u32 r6, u32 sp4, u32 r4);
void MessagePrinter_delete(struct UnkStruct_0200B870 * a0);
-void FUN_0200B9A8(struct UnkStruct_0200B870 * a0, int a1, int a2, int a3, int a4);
-void FUN_0200B9EC(struct UnkStruct_0200B870 * string, u32 value, u32 n, enum PrintingMode mode, int sp30, int r5, int r7);
+void FUN_0200B9A8(struct UnkStruct_0200B870 * a0, int a1, struct Window * a2, int a3, int a4);
+void FUN_0200B9EC(struct UnkStruct_0200B870 * string, u32 value, u32 n, enum PrintingMode mode, struct Window *window, int x, int y);
#endif //POKEDIAMOND_SCRIPT_BUFFERS_H
diff --git a/include/text.h b/include/text.h
index c9afc9b3..57185a05 100644
--- a/include/text.h
+++ b/include/text.h
@@ -5,6 +5,17 @@
#include "window.h"
#include "font.h"
+#define CHAR_0 0x00A2
+#define CHAR_1 0x00A3
+#define CHAR_2 0x00A4
+#define CHAR_3 0x00A5
+#define CHAR_4 0x00A6
+#define CHAR_5 0x00A7
+#define CHAR_6 0x00A8
+#define CHAR_7 0x00A9
+#define CHAR_8 0x00AA
+#define CHAR_9 0x00AB
+
struct TextPrinterTemplate
{
const u16* currentChar; // 0
@@ -26,12 +37,6 @@ struct TextPrinterTemplate
u8 unk4; // 17
};
-struct Font
-{
- u8 filler[20];
- void * unk20;
-};
-
struct TextPrinter
{
struct TextPrinterTemplate printerTemplate;
diff --git a/include/unk_0200CA44.h b/include/unk_0200CA44.h
index 2e479ab8..6dd208c3 100644
--- a/include/unk_0200CA44.h
+++ b/include/unk_0200CA44.h
@@ -1,10 +1,12 @@
#ifndef POKEDIAMOND_UNK_0200CA44_H
#define POKEDIAMOND_UNK_0200CA44_H
-BOOL FUN_0200CA44(void (*r0)(u32, void *), void * r1, void * r2);
-BOOL FUN_0200CA60(void (*r0)(u32, void *), void * r1, void * r2);
-BOOL FUN_0200CA7C(void (*r0)(u32, void *), void * r1, void * r2);
-BOOL FUN_0200CA98(void (*r0)(u32, void *), void * r1, void * r2);
+#include "text.h"
+
+BOOL FUN_0200CA44(void (*r0)(u32, struct TextPrinter *), struct TextPrinter * r1, u32 r2);
+BOOL FUN_0200CA60(void (*r0)(u32, struct TextPrinter *), struct TextPrinter * r1, u32 r2);
+BOOL FUN_0200CA7C(void (*r0)(u32, struct TextPrinter *), struct TextPrinter * r1, u32 r2);
+BOOL FUN_0200CA98(void (*r0)(u32, struct TextPrinter *), struct TextPrinter * r1, u32 r2);
void FUN_0200CAB4(s32 unk1);
#endif //POKEDIAMOND_UNK_0200CA44_H
diff --git a/include/window.h b/include/window.h
index ebe3338a..ed3576fb 100644
--- a/include/window.h
+++ b/include/window.h
@@ -21,5 +21,6 @@ extern void FillWindowPixelRect(struct Window *, u32 fillValue, u16 x, u16 y, u1
extern void ScrollWindow(struct Window *, u8, u8, u8);
extern u16 GetWindowWidth(struct Window *);
extern u16 GetWindowHeight(struct Window *);
+extern void BlitBitmapRectToWindow(struct Window * window, const void * src, u16 srcX, u16 srcY, u16 srcWidth, u16 srcHeight, u16 dstX, u16 dstY, u16 dstWidth, u16 dstHeight);
#endif // POKEDIAMOND_WINDOW_H