本文整理汇总了C++中PSPWCharPointer类的典型用法代码示例。如果您正苦于以下问题:C++ PSPWCharPointer类的具体用法?C++ PSPWCharPointer怎么用?C++ PSPWCharPointer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PSPWCharPointer类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sceCccSJIStoUTF16
int sceCccSJIStoUTF16(u32 dstAddr, int dstSize, u32 srcAddr)
{
PSPCharPointer src;
PSPWCharPointer dst;
dst = dstAddr;
src = srcAddr;
if (!dst.IsValid() || !src.IsValid())
{
ERROR_LOG(HLE, "sceCccSJIStoUTF16(%08x, %d, %08x): invalid pointers", dstAddr, dstSize, srcAddr);
return 0;
}
if (!jis2ucsTable.IsValid())
{
ERROR_LOG(HLE, "sceCccSJIStoUTF16(%08x, %d, %08x): table not loaded", dstAddr, dstSize, srcAddr);
return 0;
}
DEBUG_LOG(HLE, "sceCccSJIStoUTF16(%08x, %d, %08x)", dstAddr, dstSize, srcAddr);
ShiftJIS sjis(src);
int n = 0;
while (u32 c = sjis.next())
{
dst += UTF16LE::encode(dst, __CccJIStoUCS(c, errorUTF16));
n++;
}
return n;
}
示例2: sceCccUTF16toSJIS
int sceCccUTF16toSJIS(u32 dstAddr, int dstSize, u32 srcAddr)
{
PSPWCharPointer src;
PSPCharPointer dst;
dst = dstAddr;
src = srcAddr;
if (!dst.IsValid() || !src.IsValid())
{
ERROR_LOG(HLE, "sceCccUTF16toSJIS(%08x, %d, %08x): invalid pointers", dstAddr, dstSize, srcAddr);
return 0;
}
if (!ucs2jisTable.IsValid())
{
ERROR_LOG(HLE, "sceCccUTF16toSJIS(%08x, %d, %08x): table not loaded", dstAddr, dstSize, srcAddr);
return 0;
}
DEBUG_LOG(HLE, "sceCccUTF16toSJIS(%08x, %d, %08x)", dstAddr, dstSize, srcAddr);
UTF16LE utf(src);
int n = 0;
while (u32 c = utf.next())
{
dst += ShiftJIS::encode(dst, __CccUCStoJIS(c, errorSJIS));
n++;
}
return n;
}
示例3: sceCccStrlenUTF16
int sceCccStrlenUTF16(u32 strAddr)
{
PSPWCharPointer str;
str = strAddr;
if (!str.IsValid())
{
ERROR_LOG(HLE, "sceCccStrlenUTF16(%08x): invalid pointer", strAddr);
return 0;
}
DEBUG_LOG(HLE, "sceCccStrlenUTF16(%08x): invalid pointer", strAddr);
return UTF16LE(str).length();
}
示例4: sceCccSJIStoUTF16
int sceCccSJIStoUTF16(u32 dstAddr, u32 dstSize, u32 srcAddr)
{
const auto src = PSPConstCharPointer::Create(srcAddr);
auto dst = PSPWCharPointer::Create(dstAddr);
if (!dst.IsValid() || !src.IsValid())
{
ERROR_LOG(HLE, "sceCccSJIStoUTF16(%08x, %d, %08x): invalid pointers", dstAddr, dstSize, srcAddr);
return 0;
}
if (!jis2ucsTable.IsValid())
{
ERROR_LOG(HLE, "sceCccSJIStoUTF16(%08x, %d, %08x): table not loaded", dstAddr, dstSize, srcAddr);
return 0;
}
const auto dstEnd = PSPWCharPointer::Create(dstAddr + (dstSize & ~1));
DEBUG_LOG(HLE, "sceCccSJIStoUTF16(%08x, %d, %08x)", dstAddr, dstSize, srcAddr);
ShiftJIS sjis(src);
int n = 0;
while (u32 c = sjis.next())
{
if (dst + UTF16LE::encodeUnits(c) >= dstEnd)
break;
dst += UTF16LE::encode(dst, __CccJIStoUCS(c, errorUTF16));
n++;
}
if (dst < dstEnd)
*dst++ = 0;
CBreakPoints::ExecMemCheck(srcAddr, false, sjis.byteIndex(), currentMIPS->pc);
CBreakPoints::ExecMemCheck(dstAddr, true, dst.ptr - dstAddr, currentMIPS->pc);
return n;
}
示例5: sceCccUTF8toUTF16
int sceCccUTF8toUTF16(u32 dstAddr, int dstSize, u32 srcAddr)
{
PSPCharPointer src;
PSPWCharPointer dst;
dst = dstAddr;
src = srcAddr;
if (!dst.IsValid() || !src.IsValid())
{
ERROR_LOG(HLE, "sceCccUTF8toUTF16(%08x, %d, %08x): invalid pointers", dstAddr, dstSize, srcAddr);
return 0;
}
DEBUG_LOG(HLE, "sceCccUTF8toUTF16(%08x, %d, %08x)", dstAddr, dstSize, srcAddr);
UTF8 utf(src);
int n = 0;
while (u32 c = utf.next())
{
dst += UTF16LE::encode(dst, c);
n++;
}
return n;
}
示例6: sceCccUTF16toSJIS
int sceCccUTF16toSJIS(u32 dstAddr, u32 dstSize, u32 srcAddr)
{
const auto src = PSPConstWCharPointer::Create(srcAddr);
auto dst = PSPCharPointer::Create(dstAddr);
if (!dst.IsValid() || !src.IsValid())
{
ERROR_LOG(HLE, "sceCccUTF16toSJIS(%08x, %d, %08x): invalid pointers", dstAddr, dstSize, srcAddr);
return 0;
}
if (!ucs2jisTable.IsValid())
{
ERROR_LOG(HLE, "sceCccUTF16toSJIS(%08x, %d, %08x): table not loaded", dstAddr, dstSize, srcAddr);
return 0;
}
const auto dstEnd = PSPCharPointer::Create(dstAddr + dstSize);
DEBUG_LOG(HLE, "sceCccUTF16toSJIS(%08x, %d, %08x)", dstAddr, dstSize, srcAddr);
UTF16LE utf(src);
int n = 0;
while (u32 c = utf.next())
{
if (dst + ShiftJIS::encodeUnits(c) >= dstEnd)
break;
dst += ShiftJIS::encode(dst, __CccUCStoJIS(c, errorSJIS));
n++;
}
if (dst < dstEnd)
*dst++ = 0;
CBreakPoints::ExecMemCheck(srcAddr, false, utf.shortIndex() * sizeof(uint16_t), currentMIPS->pc);
CBreakPoints::ExecMemCheck(dstAddr, true, dst.ptr - dstAddr, currentMIPS->pc);
return n;
}
示例7: sceCccJIStoUCS
u32 sceCccJIStoUCS(u32 c, u32 alt)
{
if (jis2ucsTable.IsValid())
{
DEBUG_LOG(HLE, "sceCccUCStoJIS(%08x, %08x)", c, alt);
return __CccJIStoUCS(c, alt);
}
else
{
ERROR_LOG(HLE, "sceCccUCStoJIS(%08x, %08x): table not loaded", c, alt);
return alt;
}
}