diff --git a/arm9/source/game/nds.c b/arm9/source/game/nds.c index c1b76ea..1f5aa3b 100644 --- a/arm9/source/game/nds.c +++ b/arm9/source/game/nds.c @@ -1,5 +1,6 @@ #include "nds.h" #include "vff.h" +#include "utf.h" #define CRC16_TABVAL 0x0000, 0xCC01, 0xD801, 0x1400, 0xF001, 0x3C00, 0x2800, 0xE401, 0xA001, 0x6C00, 0x7800, 0xB401, 0x5000, 0x9C01, 0x8801, 0x4400 @@ -67,7 +68,7 @@ u32 LoadTwlMetaData(const char* path, TwlHeader* hdr, TwlIconData* icon) { u32 GetTwlTitle(char* desc, const TwlIconData* twl_icon) { const u16* title = twl_icon->title_eng; // english title memset(desc, 0, TWLICON_SIZE_DESC + 1); - for (u32 i = 0; i < TWLICON_SIZE_DESC; i++) desc[i] = (title[i] >= 0x80) ? ' ' : title[i]; + utf16_to_utf8((u8*) desc, title, TWLICON_SIZE_DESC, TWLICON_SIZE_DESC); return 0; } diff --git a/arm9/source/game/smdh.c b/arm9/source/game/smdh.c index 89ac81b..ea860c5 100644 --- a/arm9/source/game/smdh.c +++ b/arm9/source/game/smdh.c @@ -1,6 +1,7 @@ #include "smdh.h" +#include "utf.h" -#define SMDH_STRING(str, src, len) for (u32 i = 0; i < len; i++) str[i] = (src[i] >= 0x80) ? ' ' : src[i] +#define SMDH_STRING(str, src, len) utf16_to_utf8((u8*) str, src, len, len) // shamelessly stolen from bch2obj.py / 3ds_hb_menu :) #define SMDH_LUT 0, 1, 8, 9, 2, 3, 10, 11, 16, 17, 24, 25, 18, 19, 26, 27, \ 4, 5, 12, 13, 6, 7, 14, 15, 20, 21, 28, 29, 22, 23, 30, 31, \