summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPikalaxALT <pikalaxalt@gmail.com>2021-05-22 18:11:00 -0400
committerPikalaxALT <pikalaxalt@gmail.com>2021-05-22 18:11:00 -0400
commite14ce23516daf20a5fcd9ca6ca53f30d33c4ef24 (patch)
tree20788d979ea7a2a4135cb29bef0606182fc91f4c
parentd5bd2337cf8970b1ce7f8a3d0e64aa092e705462 (diff)
Decompile list_menu_items
-rw-r--r--arm9/asm/list_menu_items.s162
-rw-r--r--arm9/src/error_message_reset.c2
-rw-r--r--arm9/src/list_menu.c22
-rw-r--r--arm9/src/list_menu_items.c93
-rw-r--r--arm9/src/scrcmd.c6
-rw-r--r--arm9/src/text.c16
-rw-r--r--arm9/src/text_02054590.c4
-rw-r--r--include/list_menu.h7
-rw-r--r--include/list_menu_items.h12
-rw-r--r--include/text.h14
-rw-r--r--include/text_02054590.h5
11 files changed, 144 insertions, 199 deletions
diff --git a/arm9/asm/list_menu_items.s b/arm9/asm/list_menu_items.s
deleted file mode 100644
index eecacb09..00000000
--- a/arm9/asm/list_menu_items.s
+++ /dev/null
@@ -1,162 +0,0 @@
- .include "asm/macros.inc"
- .include "global.inc"
-
- .text
-
- thumb_func_start ListMenuItems_ctor
-ListMenuItems_ctor: ; 0x02012838
- push {r3-r5, lr}
- add r5, r0, #0x0
- add r4, r1, #0x0
- add r1, r5, #0x1
- add r0, r4, #0x0
- lsl r1, r1, #0x3
- bl AllocFromHeap
- cmp r0, #0x0
- beq _0201286E
- mov r2, #0x0
- cmp r5, #0x0
- bls _02012862
- add r3, r0, #0x0
- add r1, r2, #0x0
-_02012856:
- str r1, [r3, #0x0]
- str r1, [r3, #0x4]
- add r2, r2, #0x1
- add r3, #0x8
- cmp r2, r5
- blo _02012856
-_02012862:
- mov r1, #0x0
- lsl r2, r2, #0x3
- mvn r1, r1
- str r1, [r0, r2]
- add r1, r0, r2
- str r4, [r1, #0x4]
-_0201286E:
- pop {r3-r5, pc}
-
- thumb_func_start ListMenuItems_dtor
-ListMenuItems_dtor: ; 0x02012870
- push {r4, lr}
- add r4, r0, #0x0
- bl ListMenuItems_DestroyMenuStrings
- add r0, r4, #0x0
- bl FreeToHeap
- pop {r4, pc}
-
- thumb_func_start ListMenuItems_AppendFromMsgData
-ListMenuItems_AppendFromMsgData: ; 0x02012880
- push {r3-r7, lr}
- add r6, r1, #0x0
- add r1, sp, #0x0
- add r7, r2, #0x0
- add r5, r3, #0x0
- bl ListMenuItems_NewItem
- add r4, r0, #0x0
- beq _0201289E
- add r0, r6, #0x0
- add r1, r7, #0x0
- bl NewString_ReadMsgData
- str r0, [r4, #0x0]
- str r5, [r4, #0x4]
-_0201289E:
- pop {r3-r7, pc}
-
- thumb_func_start ListMenuItems_AddItem
-ListMenuItems_AddItem: ; 0x020128A0
- push {r3-r6, lr}
- sub sp, #0x4
- add r6, r1, #0x0
- add r1, sp, #0x0
- add r5, r2, #0x0
- bl ListMenuItems_NewItem
- add r4, r0, #0x0
- beq _020128BE
- ldr r1, [sp, #0x0]
- add r0, r6, #0x0
- bl StringDup
- str r0, [r4, #0x0]
- str r5, [r4, #0x4]
-_020128BE:
- add sp, #0x4
- pop {r3-r6, pc}
- .balign 4
-
- thumb_func_start ListMenuItems_CopyItem
-ListMenuItems_CopyItem: ; 0x020128C4
- push {r3-r4, lr}
- sub sp, #0x4
- add r4, r1, #0x0
- add r1, sp, #0x0
- bl ListMenuItems_NewItem
- cmp r0, #0x0
- beq _020128DC
- ldr r1, [r4, #0x0]
- str r1, [r0, #0x0]
- ldr r1, [r4, #0x4]
- str r1, [r0, #0x4]
-_020128DC:
- add sp, #0x4
- pop {r3-r4, pc}
-
- thumb_func_start ListMenuItems_NewItem
-ListMenuItems_NewItem: ; 0x020128E0
- push {r4, lr}
- ldr r3, [r0, #0x0]
- cmp r3, #0x0
- beq _02012900
- mov r2, #0x0
- mvn r2, r2
-_020128EC:
- cmp r3, r2
- bne _020128F8
- bl ErrorHandling
- mov r0, #0x0
- pop {r4, pc}
-_020128F8:
- add r0, #0x8
- ldr r3, [r0, #0x0]
- cmp r3, #0x0
- bne _020128EC
-_02012900:
- mov r2, #0x0
- mvn r2, r2
- add r4, r0, #0x0
- cmp r3, r2
- beq _02012912
-_0201290A:
- add r0, #0x8
- ldr r3, [r0, #0x0]
- cmp r3, r2
- bne _0201290A
-_02012912:
- ldr r0, [r0, #0x4]
- str r0, [r1, #0x0]
- add r0, r4, #0x0
- pop {r4, pc}
- .balign 4
-
- thumb_func_start ListMenuItems_DestroyMenuStrings
-ListMenuItems_DestroyMenuStrings: ; 0x0201291C
- push {r4-r6, lr}
- add r5, r0, #0x0
- mov r0, #0x0
- ldr r1, [r5, #0x0]
- mvn r0, r0
- cmp r1, r0
- beq _02012942
- mov r4, #0x0
- add r6, r0, #0x0
-_0201292E:
- ldr r0, [r5, #0x0]
- cmp r0, #0x0
- beq _02012942
- bl String_dtor
- str r4, [r5, #0x0]
- add r5, #0x8
- ldr r0, [r5, #0x0]
- cmp r0, r6
- bne _0201292E
-_02012942:
- pop {r4-r6, pc}
diff --git a/arm9/src/error_message_reset.c b/arm9/src/error_message_reset.c
index 426ba876..80c7ada8 100644
--- a/arm9/src/error_message_reset.c
+++ b/arm9/src/error_message_reset.c
@@ -102,7 +102,7 @@ THUMB_FUNC void PrintErrorMessageAndReset()
ReadMsgDataIntoString(msg_data, 3, str);
- AddTextPrinterParameterized(&buf, 0, (const u16 *)str, 0, 0, 0, NULL); // wtf
+ AddTextPrinterParameterized(&buf, 0, str, 0, 0, 0, NULL);
String_dtor(str);
GX_BothDispOn();
diff --git a/arm9/src/list_menu.c b/arm9/src/list_menu.c
index 5ae5a5b4..c54677a9 100644
--- a/arm9/src/list_menu.c
+++ b/arm9/src/list_menu.c
@@ -60,7 +60,7 @@ THUMB_FUNC s32 ListMenu_ProcessInput(struct ListMenu * list)
list->unk_33 = 0;
if (gMain.newKeys & REG_PAD_KEYINPUT_A_MASK) {
- return list->template.items[list->cursorPos + list->itemsAbove].index;
+ return list->template.items[list->cursorPos + list->itemsAbove].value;
}
else if (gMain.newKeys & REG_PAD_KEYINPUT_B_MASK) {
return LIST_CANCEL;
@@ -192,7 +192,7 @@ THUMB_FUNC u8 ListMenuGetUnk33(struct ListMenu * list)
THUMB_FUNC s32 ListMenuGetValueByArrayId(struct ListMenu * list, s32 index)
{
- return list->template.items[index].index;
+ return list->template.items[index].value;
}
THUMB_FUNC s32 ListMenuGetTemplateField(struct ListMenu * list, u32 attr)
@@ -314,7 +314,7 @@ THUMB_FUNC void ListMenuGetItemStr(struct ListMenu * list, struct ListMenuItem *
list->template.items = items;
}
-THUMB_FUNC void ListMenuPrint(struct ListMenu * list, const u16 * str, u8 x, u8 y)
+THUMB_FUNC void ListMenuPrint(struct ListMenu * list, struct String * str, u8 x, u8 y)
{
if (str != NULL)
{
@@ -337,13 +337,13 @@ THUMB_FUNC void ListMenuPrintEntries(struct ListMenu * list, u16 startIndex, u16
for (i = 0; i < count; i++)
{
- if (list->template.items[startIndex].index != LIST_HEADER)
+ if (list->template.items[startIndex].value != LIST_HEADER)
x = list->template.item_X;
else
x = list->template.header_X;
y = (yOffset + i) * yMultiplier + list->template.upText_Y;
if (list->template.itemPrintFunc != NULL)
- list->template.itemPrintFunc(list, list->template.items[startIndex].index, y);
+ list->template.itemPrintFunc(list, list->template.items[startIndex].value, y);
ListMenuPrint(list, list->template.items[startIndex].text, x, y);
startIndex++;
}
@@ -409,7 +409,7 @@ THUMB_FUNC u8 ListMenuUpdateSelectedRowIndexAndScrollOffset(struct ListMenu *lis
while (itemsAbove != 0)
{
itemsAbove--;
- if (list->template.items[cursorPos + itemsAbove].index != LIST_HEADER)
+ if (list->template.items[cursorPos + itemsAbove].value != LIST_HEADER)
{
list->itemsAbove = itemsAbove;
return 1;
@@ -422,7 +422,7 @@ THUMB_FUNC u8 ListMenuUpdateSelectedRowIndexAndScrollOffset(struct ListMenu *lis
while (itemsAbove > newRow)
{
itemsAbove--;
- if (list->template.items[cursorPos + itemsAbove].index != LIST_HEADER)
+ if (list->template.items[cursorPos + itemsAbove].value != LIST_HEADER)
{
list->itemsAbove = itemsAbove;
return 1;
@@ -444,7 +444,7 @@ THUMB_FUNC u8 ListMenuUpdateSelectedRowIndexAndScrollOffset(struct ListMenu *lis
while (itemsAbove < list->template.maxShowed - 1)
{
itemsAbove++;
- if (list->template.items[cursorPos + itemsAbove].index != LIST_HEADER)
+ if (list->template.items[cursorPos + itemsAbove].value != LIST_HEADER)
{
list->itemsAbove = itemsAbove;
return 1;
@@ -457,7 +457,7 @@ THUMB_FUNC u8 ListMenuUpdateSelectedRowIndexAndScrollOffset(struct ListMenu *lis
while (itemsAbove < newRow)
{
itemsAbove++;
- if (list->template.items[cursorPos + itemsAbove].index != LIST_HEADER)
+ if (list->template.items[cursorPos + itemsAbove].value != LIST_HEADER)
{
list->itemsAbove = itemsAbove;
return 1;
@@ -529,7 +529,7 @@ THUMB_FUNC BOOL ListMenuChangeSelection(struct ListMenu * list, u8 updateCursorA
break;
cursorCount++;
}
- while (list->template.items[list->cursorPos + list->itemsAbove].index == LIST_HEADER);
+ while (list->template.items[list->cursorPos + list->itemsAbove].value == LIST_HEADER);
}
if (updateCursorAndCallCallback)
@@ -562,7 +562,7 @@ THUMB_FUNC void ListMenuCallSelectionChangedCallback(struct ListMenu * list, u8
{
if (list->template.moveCursorFunc != NULL)
{
- list->template.moveCursorFunc(list, list->template.items[list->cursorPos + list->itemsAbove].index, onInit);
+ list->template.moveCursorFunc(list, list->template.items[list->cursorPos + list->itemsAbove].value, onInit);
}
}
diff --git a/arm9/src/list_menu_items.c b/arm9/src/list_menu_items.c
new file mode 100644
index 00000000..7e7b36d2
--- /dev/null
+++ b/arm9/src/list_menu_items.c
@@ -0,0 +1,93 @@
+#include "global.h"
+#include "list_menu_items.h"
+#include "msgdata.h"
+#include "heap.h"
+
+void ListMenuItems_DestroyMenuStrings(struct ListMenuItem * items);
+struct ListMenuItem * ListMenuItems_SeekEnd(struct ListMenuItem * items, s32 * idx_p);
+
+THUMB_FUNC struct ListMenuItem * ListMenuItems_ctor(u32 count, u32 heap_id)
+{
+ s32 i;
+ struct ListMenuItem * ret = AllocFromHeap(heap_id, (count + 1) * sizeof(struct ListMenuItem));
+ if (ret != NULL)
+ {
+ for (i = 0; i < count; i++)
+ {
+ ret[i].text = NULL;
+ ret[i].value = 0;
+ }
+ ret[i].text = (struct String *)-1u;
+ ret[i].value = heap_id;
+ }
+ return ret;
+}
+
+THUMB_FUNC void ListMenuItems_dtor(struct ListMenuItem * items)
+{
+ ListMenuItems_DestroyMenuStrings(items);
+ FreeToHeap(items);
+}
+
+THUMB_FUNC void ListMenuItems_AppendFromMsgData(struct ListMenuItem * items, struct MsgData * msgData, u32 msgNo, s32 value)
+{
+ s32 heap_id;
+ struct ListMenuItem * newItem = ListMenuItems_SeekEnd(items, &heap_id);
+ if (newItem != NULL)
+ {
+ newItem->text = NewString_ReadMsgData(msgData, msgNo);
+ newItem->value = value;
+ }
+}
+
+THUMB_FUNC void ListMenuItems_AddItem(struct ListMenuItem * items, struct String * str, s32 value)
+{
+ s32 heap_id;
+ struct ListMenuItem * newItem = ListMenuItems_SeekEnd(items, &heap_id);
+ if (newItem != NULL)
+ {
+ newItem->text = StringDup(str, heap_id);
+ newItem->value = value;
+ }
+}
+
+THUMB_FUNC void ListMenuItems_CopyItem(struct ListMenuItem * items, struct ListMenuItem * src)
+{
+ s32 heap_id;
+ struct ListMenuItem * newItem = ListMenuItems_SeekEnd(items, &heap_id);
+ if (newItem != NULL)
+ {
+ newItem->text = src->text;
+ newItem->value = src->value;
+ }
+}
+
+THUMB_FUNC struct ListMenuItem * ListMenuItems_SeekEnd(struct ListMenuItem * items, s32 * heap_id_p)
+{
+ struct ListMenuItem * ret;
+ for (; items->text != NULL; items++)
+ {
+ if (items->text == (struct String *)-1u)
+ {
+ GF_ASSERT(0);
+ return NULL;
+ }
+ }
+ ret = items;
+ for (; items->text != (struct String *)-1u; items++)
+ ;
+ *heap_id_p = items->value;
+ return ret;
+}
+
+THUMB_FUNC void ListMenuItems_DestroyMenuStrings(struct ListMenuItem * items)
+{
+ s32 i;
+ for (i = 0; items[i].text != (struct String *)-1u; i++)
+ {
+ if (items[i].text == NULL)
+ break;
+ String_dtor(items[i].text);
+ items[i].text = NULL;
+ }
+}
diff --git a/arm9/src/scrcmd.c b/arm9/src/scrcmd.c
index 00ccd34d..5503f5f3 100644
--- a/arm9/src/scrcmd.c
+++ b/arm9/src/scrcmd.c
@@ -34,9 +34,9 @@ extern u32 FUN_02058510(u32 param0, u32 param1);
extern void MOD05_021E8128(u32 param0, u8 type, u16 map);
extern void MOD05_021E8130(u32 param0, u32 param1);
extern void MOD05_021E8158(struct UnkSavStruct80 *unk80);
-extern u32 MOD05_021E8140(u32 param0);
+extern struct Window * MOD05_021E8140(u32 param0);
extern BOOL MOD05_021E8148(u32 param0);
-extern u8 FUN_02054658(u32 param0, struct String *str, struct Options *opt, u32 param3);
+extern u8 FUN_02054658(struct Window * param0, struct String *str, struct Options *opt, u32 param3);
extern void MOD05_021E8144(u32 param0);
extern void FUN_0200CB00(u32 param0, u32 param1, u32 param2, u32 param3, u32 param4, u32 param5);
extern u32 Std_CreateYesNoMenu(u32 param0, u8 **param1, u32 param2, u32 param3, u32 param4);
@@ -893,7 +893,7 @@ THUMB_FUNC BOOL ScrCmd_CreateMessageBox(struct ScriptContext* ctx)
MOD05_021E8158(unk80);
ReadMsgDataIntoString(ctx->msgData, msg, *unk1);
StringExpandPlaceholders(*unk3, *unk2, *unk1);
- AddTextPrinterParameterized(MOD05_021E8140(unk80->unk60), 1, (u16 *)*unk2, 0, 0, 0, NULL);
+ AddTextPrinterParameterized(MOD05_021E8140(unk80->unk60), 1, *unk2, 0, 0, 0, NULL);
return TRUE;
}
diff --git a/arm9/src/text.c b/arm9/src/text.c
index b21acf88..83d2612b 100644
--- a/arm9/src/text.c
+++ b/arm9/src/text.c
@@ -95,12 +95,12 @@ THUMB_FUNC void FUN_0201BD7C(u32 param0)
FUN_0201BCFC(param0);
}
-THUMB_FUNC u16 AddTextPrinterParameterized(struct Window * window, u8 fontId, const u16 *str, u32 x, u32 y, u32 speed, u8 (*callback)(struct TextPrinterTemplate *, u16))
+THUMB_FUNC u16 AddTextPrinterParameterized(struct Window * window, u8 fontId, struct String *str, u32 x, u32 y, u32 speed, u8 (*callback)(struct TextPrinterTemplate *, u16))
{
struct TextPrinterTemplate printerTemplate;
printerTemplate.window = window;
- printerTemplate.currentChar = str;
+ printerTemplate.currentChar.wrapped = str;
printerTemplate.fontId = fontId;
printerTemplate.x = (u8)x;
printerTemplate.y = (u8)y;
@@ -118,12 +118,12 @@ THUMB_FUNC u16 AddTextPrinterParameterized(struct Window * window, u8 fontId, co
return AddTextPrinter(&printerTemplate, speed, callback);
}
-THUMB_FUNC u16 AddTextPrinterParameterized2(struct Window * window, u8 fontId, const u16 *str, u32 x, u32 y, u32 speed, u32 colors, u8 (*callback)(struct TextPrinterTemplate *, u16))
+THUMB_FUNC u16 AddTextPrinterParameterized2(struct Window * window, u8 fontId, struct String *str, u32 x, u32 y, u32 speed, u32 colors, u8 (*callback)(struct TextPrinterTemplate *, u16))
{
struct TextPrinterTemplate printerTemplate;
printerTemplate.window = window;
- printerTemplate.currentChar = str;
+ printerTemplate.currentChar.wrapped = str;
printerTemplate.fontId = fontId;
printerTemplate.x = (u8)x;
printerTemplate.y = (u8)y;
@@ -141,12 +141,12 @@ THUMB_FUNC u16 AddTextPrinterParameterized2(struct Window * window, u8 fontId, c
return AddTextPrinter(&printerTemplate, speed, callback);
}
-THUMB_FUNC u16 AddTextPrinterParameterized3(struct Window * window, u32 fontId, const u16 *str, u32 x, u32 y, u32 speed, u32 colors, u32 letterSpacing, u32 lineSpacing, u8 (*callback)(struct TextPrinterTemplate *, u16))
+THUMB_FUNC u16 AddTextPrinterParameterized3(struct Window * window, u32 fontId, struct String *str, u32 x, u32 y, u32 speed, u32 colors, u32 letterSpacing, u32 lineSpacing, u8 (*callback)(struct TextPrinterTemplate *, u16))
{
struct TextPrinterTemplate printerTemplate;
printerTemplate.window = window;
- printerTemplate.currentChar = str;
+ printerTemplate.currentChar.wrapped = str;
printerTemplate.fontId = (u8)fontId;
printerTemplate.x = (u8)x;
printerTemplate.y = (u8)y;
@@ -184,13 +184,13 @@ THUMB_FUNC u16 AddTextPrinter(struct TextPrinterTemplate *printerTemplate, u32 s
}
printer->printerTemplate = *printerTemplate;
- printer->printerTemplate.currentChar = String_c_str((struct String *)printer->printerTemplate.currentChar); //TODO clean up
+ printer->printerTemplate.currentChar.raw = String_c_str(printer->printerTemplate.currentChar.wrapped);
printer->callback = callback;
UNK_021C570C = 0;
FUN_0201C1A8(printer);
if (speed != 0xff && speed != 0)
{
- printer->textSpeedBottom += 0xff;
+ printer->textSpeedBottom--;
printer->textSpeedTop = 1;
printer->minLetterSpacing = FUN_0201BCC8(RunTextPrinter, printer, 1);
return printer->minLetterSpacing;
diff --git a/arm9/src/text_02054590.c b/arm9/src/text_02054590.c
index e2765c6f..b7c4f91c 100644
--- a/arm9/src/text_02054590.c
+++ b/arm9/src/text_02054590.c
@@ -53,7 +53,7 @@ THUMB_FUNC void FUN_0205464C(struct Window *param0)
FillWindowPixelBuffer(param0, 15);
}
-THUMB_FUNC u16 FUN_02054658(struct Window * window, const u16 *str, struct Options *options, u8 param3)
+THUMB_FUNC u16 FUN_02054658(struct Window * window, struct String *str, struct Options *options, u8 param3)
{
FUN_02002B60(param3);
FUN_02002B7C(0);
@@ -61,7 +61,7 @@ THUMB_FUNC u16 FUN_02054658(struct Window * window, const u16 *str, struct Optio
return AddTextPrinterParameterized(window, 1, str, 0, 0, (u32)Options_GetTextFrameDelay(options), NULL);
}
-THUMB_FUNC u16 DrawFieldMessage(struct Window * window, const u16 *str, u8 fontId, u32 speed, u8 a4, u32 a5)
+THUMB_FUNC u16 DrawFieldMessage(struct Window * window, struct String *str, u8 fontId, u32 speed, u8 a4, u32 a5)
{
FUN_02002B60(a4);
FUN_02002B7C(a5);
diff --git a/include/list_menu.h b/include/list_menu.h
index 3f60c6f2..c01bf070 100644
--- a/include/list_menu.h
+++ b/include/list_menu.h
@@ -2,6 +2,7 @@
#define POKEDIAMOND_LIST_MENU_H
#include "list_menu_cursor.h"
+#include "list_menu_items.h"
#define LIST_HEADER -3
#define LIST_CANCEL -2
@@ -13,12 +14,6 @@
struct ListMenu;
-struct ListMenuItem
-{
- const u16 * text;
- s32 index;
-};
-
// TODO: Document remaining fields.
// A lot of these are named based on similar fields in gen 3.
diff --git a/include/list_menu_items.h b/include/list_menu_items.h
new file mode 100644
index 00000000..a102c449
--- /dev/null
+++ b/include/list_menu_items.h
@@ -0,0 +1,12 @@
+#ifndef POKEDIAMOND_LIST_MENU_ITEMS_H
+#define POKEDIAMOND_LIST_MENU_ITEMS_H
+
+#include "string16.h"
+
+struct ListMenuItem
+{
+ struct String * text;
+ s32 value;
+};
+
+#endif // POKEDIAMOND_LIST_MENU_ITEMS_H
diff --git a/include/text.h b/include/text.h
index 57185a05..514e8ba7 100644
--- a/include/text.h
+++ b/include/text.h
@@ -16,9 +16,15 @@
#define CHAR_8 0x00AA
#define CHAR_9 0x00AB
+union StrbufForPrint
+{
+ struct String * wrapped;
+ const u16 * raw;
+};
+
struct TextPrinterTemplate
{
- const u16* currentChar; // 0
+ union StrbufForPrint currentChar; // 0
struct Window * window; // 4
u8 padding[1]; // 8
u8 fontId; // 9
@@ -76,9 +82,9 @@ BOOL FUN_0201BD44(u32 param0);
void FUN_0201BD5C(void);
u8 FUN_0201BD70(u32 param0);
void FUN_0201BD7C(u32 param0);
-u16 AddTextPrinterParameterized(struct Window * window, u8 fontId, const u16 *str, u32 x, u32 y, u32 speed, u8 (*callback)(struct TextPrinterTemplate *, u16));
-u16 AddTextPrinterParameterized2(struct Window * window, u8 fontId, const u16 *str, u32 x, u32 y, u32 speed, u32 colors, u8 (*callback)(struct TextPrinterTemplate *, u16));
-u16 AddTextPrinterParameterized3(struct Window * window, u32 fontId, const u16 *str, u32 x, u32 y, u32 speed, u32 colors, u32 letterSpacing, u32 lineSpacing, u8 (*callback)(struct TextPrinterTemplate *, u16));
+u16 AddTextPrinterParameterized(struct Window * window, u8 fontId, struct String *str, u32 x, u32 y, u32 speed, u8 (*callback)(struct TextPrinterTemplate *, u16));
+u16 AddTextPrinterParameterized2(struct Window * window, u8 fontId, struct String *str, u32 x, u32 y, u32 speed, u32 colors, u8 (*callback)(struct TextPrinterTemplate *, u16));
+u16 AddTextPrinterParameterized3(struct Window * window, u32 fontId, struct String *str, u32 x, u32 y, u32 speed, u32 colors, u32 letterSpacing, u32 lineSpacing, u8 (*callback)(struct TextPrinterTemplate *, u16));
u16 AddTextPrinter(struct TextPrinterTemplate *printerTemplate, u32 speed, u8 (*callback)(struct TextPrinterTemplate *, u16));
void RunTextPrinter(u32 param0, struct TextPrinter *printer);
u32 RenderFont(struct TextPrinter *printer);
diff --git a/include/text_02054590.h b/include/text_02054590.h
index b1ee055a..32dca79a 100644
--- a/include/text_02054590.h
+++ b/include/text_02054590.h
@@ -4,13 +4,14 @@
#include "global.h"
#include "options.h"
#include "window.h"
+#include "string16.h"
void FUN_02054590(u32 param0, u32 param1);
void FUN_020545B8(u32 param0, u32 param1, u32 param2);
void FUN_02054608(struct Window *param0, struct Options *options);
void FUN_0205464C(struct Window *param0);
-u16 FUN_02054658(struct Window * window, const u16 *str, struct Options *options, u8 param3);
-u16 DrawFieldMessage(struct Window * window, const u16 *str, u8 fontId, u32 speed, u8 a4, u32 a5);
+u16 FUN_02054658(struct Window * window, struct String *str, struct Options *options, u8 param3);
+u16 DrawFieldMessage(struct Window * window, struct String *str, u8 fontId, u32 speed, u8 a4, u32 a5);
u8 FUN_020546C8(u32 param0);
void FUN_020546E0(u32 param0, u32 param1, u32 param2, u32 param3);
void FUN_02054744(struct Window *param0, u32 param1, u32 param2);