Ninty doesn't support 4-byte UTF16

This commit is contained in:
Aurora 2016-09-16 12:58:03 +02:00
parent a413ed01f3
commit 4376a1093f

View File

@ -104,13 +104,6 @@ static void loadCustomVerString(u16 *out, u32 *verStringSize)
increase = 3; increase = 3;
out[finalSize++] = (u16)(((buf[i] & 0xF) << 12) | ((buf[i + 1] & 0x3F) << 6) | (buf[i + 2] & 0x3F)); out[finalSize++] = (u16)(((buf[i] & 0xF) << 12) | ((buf[i + 1] & 0x3F) << 6) | (buf[i + 2] & 0x3F));
} }
else if((buf[i] & 0xF8) == 0xF0 && i + 3 < fileSizeTmp && finalSize <= 17 && (buf[i + 1] & 0xC0) == 0x80 && (buf[i + 2] & 0xC0) == 0x80 && (buf[i + 3] & 0xC0) == 0x80)
{
increase = 4;
u32 value = (u32)(((buf[i] & 7) << 18) | ((buf[i + 1] & 0x3F) << 12) | ((buf[i + 2] & 0x3F) << 6) | (buf[i + 3] & 0x3F)) - 0x10000;
out[finalSize++] = 0xD800 | (u16)(value >> 10);
out[finalSize++] = 0xDC00 | (u16)(value & 0x3FF);
}
else break; else break;
} }
@ -403,12 +396,12 @@ void patchCode(u64 progId, u8 *code, u32 size)
{ {
static const u16 verPattern[] = u"Ver."; static const u16 verPattern[] = u"Ver.";
static u16 *verString; static u16 *verString;
u32 verStringSize; u32 verStringSize = 0;
u16 customVerString[19] = {0}; u16 customVerString[19];
loadCustomVerString(customVerString, &verStringSize); loadCustomVerString(customVerString, &verStringSize);
if(customVerString[0] != 0) verString = customVerString; if(verStringSize != 0) verString = customVerString;
else else
{ {
verStringSize = 8; verStringSize = 8;