diff options
Diffstat (limited to 'arm9/src/font.c')
-rw-r--r-- | arm9/src/font.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/arm9/src/font.c b/arm9/src/font.c index 6c838892..5e46b237 100644 --- a/arm9/src/font.c +++ b/arm9/src/font.c @@ -4,6 +4,7 @@ #include "graphic/font.naix" #include "render_text.h" #include "string16.h" +#include "unk_02021590.h" #include "text.h" #include "unk_0201B8B8.h" @@ -11,7 +12,12 @@ struct UnkStruct_02002C14 *UNK_02106FC8; struct UnkStruct_02002C14 UNK_02106FCC; -const u16 UNK_020ECB54[4][2] = { { 0, 0 }, { 1, 0 }, { 2, 0 }, { 3, 0 } }; +const u16 UNK_020ECB54[4][2] = { + { NARC_font_narc_0000_bin, FALSE }, + { NARC_font_narc_0001_bin, FALSE }, + { NARC_font_narc_0002_bin, FALSE }, + { NARC_font_narc_0003_bin, FALSE } +}; const struct FontInfo gFontInfos[5] = { { 0x0B, 0x10, 0x00, 0x00, 0x00, 0x01, 0x0F, 0x02 }, @@ -21,12 +27,6 @@ const struct FontInfo gFontInfos[5] = { { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, }; -extern struct UnkStruct_0202199C *FUN_02021590(u32, u16, u32, u16, u32); -extern void FUN_020215E0(struct UnkStruct_0202199C *, u32, u32); -extern void FUN_020215C8(struct UnkStruct_0202199C *param0); -extern void FUN_02021750(struct UnkStruct_0202199C *, u32); -extern u32 FUN_020218D8(struct UnkStruct_0202199C *, u16 *str, u32); - THUMB_FUNC void FUN_02002C14() { UNK_02106FC8 = &UNK_02106FCC; @@ -40,10 +40,10 @@ THUMB_FUNC void FUN_02002C14() SetFontsPointer(&gFontInfos[0]); } -THUMB_FUNC void FUN_02002C50(u32 param0, u32 param1) +THUMB_FUNC void FUN_02002C50(u32 font_id, u32 heap_id) { - UNK_02106FC8->unk94[param0] = - FUN_02021590(14, UNK_020ECB54[param0][0], 1, UNK_020ECB54[param0][1], param1); + UNK_02106FC8->unk94[font_id] = + FontData_new(NARC_GRAPHIC_FONT, UNK_020ECB54[font_id][0], 1, UNK_020ECB54[font_id][1], heap_id); } THUMB_FUNC void FUN_02002C84(s32 param0, u32 param1) @@ -51,7 +51,7 @@ THUMB_FUNC void FUN_02002C84(s32 param0, u32 param1) GF_ASSERT(param0 < 4); GF_ASSERT(UNK_02106FC8->unk94[param0] != NULL); - FUN_020215E0(UNK_02106FC8->unk94[param0], 0, param1); + FontData_ModeSwitch(UNK_02106FC8->unk94[param0], 0, param1); } THUMB_FUNC void FUN_02002CC0(s32 param0) @@ -59,7 +59,7 @@ THUMB_FUNC void FUN_02002CC0(s32 param0) GF_ASSERT(param0 < 4); GF_ASSERT(UNK_02106FC8->unk94[param0] != NULL); - FUN_020215E0(UNK_02106FC8->unk94[param0], 1, 0); + FontData_ModeSwitch(UNK_02106FC8->unk94[param0], 1, 0); } THUMB_FUNC void FUN_02002CF8(int param0) @@ -89,16 +89,16 @@ THUMB_FUNC void FUN_02002CF8(int param0) if (UNK_02106FC8->unk94[param0] != NULL) { - FUN_020215C8(UNK_02106FC8->unk94[param0]); + FontData_delete(UNK_02106FC8->unk94[param0]); UNK_02106FC8->unk94[param0] = NULL; } } -THUMB_FUNC struct UnkStruct_02002C14 *FUN_02002D94(u32 param0, u32 param1) +THUMB_FUNC struct UnkStruct_02002C14_sub *FUN_02002D94(u32 param0, u32 param1) { - FUN_02021750(UNK_02106FC8->unk94[param0], param1); + TryLoadGlyph(UNK_02106FC8->unk94[param0], param1, &UNK_02106FC8->unk00); - return UNK_02106FC8; + return &UNK_02106FC8->unk00; } THUMB_FUNC u32 FontFunc(u32 fontId, struct TextPrinter *printer) @@ -119,14 +119,14 @@ THUMB_FUNC u32 FUN_02002DE0(u32 param0, u16 *str, u32 param2) { GF_ASSERT(UNK_02106FC8->unk94[param0] != NULL); - FUN_020218D8(UNK_02106FC8->unk94[param0], str, param2); + return GetStringWidth(UNK_02106FC8->unk94[param0], str, param2); } THUMB_FUNC u32 FUN_02002E14(u32 param0, struct String *str, u32 param2) { GF_ASSERT(UNK_02106FC8->unk94[param0] != NULL); - FUN_020218D8(UNK_02106FC8->unk94[param0], String_c_str(str), param2); + return GetStringWidth(UNK_02106FC8->unk94[param0], String_c_str(str), param2); } THUMB_FUNC s32 GetFontAttribute(u8 fontId, s32 attr) @@ -163,7 +163,7 @@ THUMB_FUNC s32 GetFontAttribute(u8 fontId, s32 attr) return ret; } -THUMB_FUNC void FUN_02002ED0(u32 layer, u32 baseAddr, u32 heap_id) +THUMB_FUNC void FUN_02002ED0(enum GFBgLayer layer, u32 baseAddr, u32 heap_id) { GfGfxLoader_GXLoadPal( NARC_GRAPHIC_FONT, NARC_font_narc_0006_NCLR, layer, baseAddr, 0x20, heap_id); |