From 65a5c92c7e18ee75dac695a8b76cb2e99c5605ef Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 24 Jan 2016 22:52:19 -0800 Subject: [PATCH] Io: Change some logging flags. Not used yet, just prep work. --- Core/HLE/HLE.cpp | 11 ++++++- Core/HLE/sceIo.cpp | 78 +++++++++++++++++++++++----------------------- 2 files changed, 49 insertions(+), 40 deletions(-) diff --git a/Core/HLE/HLE.cpp b/Core/HLE/HLE.cpp index e54acc45c..441ff5491 100644 --- a/Core/HLE/HLE.cpp +++ b/Core/HLE/HLE.cpp @@ -43,6 +43,10 @@ #include "Core/HLE/sceKernelInterrupt.h" #include "Core/HLE/HLE.h" +#ifdef BLACKBERRY +using std::strnlen; +#endif + enum { // Do nothing after the syscall. @@ -606,7 +610,12 @@ size_t hleFormatLogArgs(char *message, size_t sz, const char *argmask) { case 's': if (Memory::IsValidAddress(regval)) { - APPEND_FMT("%s", Memory::GetCharPointer(regval)); + const char *s = Memory::GetCharPointer(regval); + if (strnlen(s, 64) >= 64) { + APPEND_FMT("%.64s...", Memory::GetCharPointer(regval)); + } else { + APPEND_FMT("%s", Memory::GetCharPointer(regval)); + } } else { APPEND_FMT("(invalid)"); } diff --git a/Core/HLE/sceIo.cpp b/Core/HLE/sceIo.cpp index abe300c1c..f0dc09da7 100644 --- a/Core/HLE/sceIo.cpp +++ b/Core/HLE/sceIo.cpp @@ -2418,43 +2418,43 @@ KernelObject *__KernelDirListingObject() { } const HLEFunction IoFileMgrForUser[] = { - {0XB29DDF9C, &WrapU_C, "sceIoDopen", 'x', "s" }, - {0XE3EB004C, &WrapU_IU, "sceIoDread", 'x', "ix" }, - {0XEB092469, &WrapU_I, "sceIoDclose", 'x', "i" }, - {0XE95A012B, &WrapU_UUUUUU, "sceIoIoctlAsync", 'x', "xxxxxx"}, - {0X63632449, &WrapU_UUUUUU, "sceIoIoctl", 'x', "xxxxxx"}, - {0XACE946E8, &WrapU_CU, "sceIoGetstat", 'x', "sx" }, - {0XB8A740F4, &WrapU_CUU, "sceIoChstat", 'x', "sxx" }, - {0X55F4717D, &WrapU_C, "sceIoChdir", 'x', "s" }, + {0XB29DDF9C, &WrapU_C, "sceIoDopen", 'i', "s" }, + {0XE3EB004C, &WrapU_IU, "sceIoDread", 'i', "ix" }, + {0XEB092469, &WrapU_I, "sceIoDclose", 'i', "i" }, + {0XE95A012B, &WrapU_UUUUUU, "sceIoIoctlAsync", 'i', "ixpipi"}, + {0X63632449, &WrapU_UUUUUU, "sceIoIoctl", 'i', "ixpipi"}, + {0XACE946E8, &WrapU_CU, "sceIoGetstat", 'i', "sx" }, + {0XB8A740F4, &WrapU_CUU, "sceIoChstat", 'i', "sxx" }, + {0X55F4717D, &WrapU_C, "sceIoChdir", 'i', "s" }, {0X08BD7374, &WrapU_I, "sceIoGetDevType", 'x', "i" }, - {0XB2A628C1, &WrapU_UUUIUI, "sceIoAssign", 'x', "xxxixi"}, - {0XE8BC6571, &WrapU_I, "sceIoCancel", 'x', "i" }, - {0XB293727F, &WrapI_II, "sceIoChangeAsyncPriority", 'i', "ii" }, - {0X810C4BC3, &WrapU_I, "sceIoClose", 'x', "i" }, + {0XB2A628C1, &WrapU_UUUIUI, "sceIoAssign", 'i', "sssixi"}, + {0XE8BC6571, &WrapU_I, "sceIoCancel", 'i', "i" }, + {0XB293727F, &WrapI_II, "sceIoChangeAsyncPriority", 'i', "ix" }, + {0X810C4BC3, &WrapU_I, "sceIoClose", 'i', "i" }, {0XFF5940B6, &WrapI_I, "sceIoCloseAsync", 'i', "i" }, - {0X54F5FB11, &WrapU_CIUIUI, "sceIoDevctl", 'x', "sixixi"}, - {0XCB05F8D6, &WrapU_IUU, "sceIoGetAsyncStat", 'x', "ixx" }, + {0X54F5FB11, &WrapU_CIUIUI, "sceIoDevctl", 'i', "sxpipi"}, + {0XCB05F8D6, &WrapU_IUU, "sceIoGetAsyncStat", 'i', "iiP" }, {0X27EB27B8, &WrapI64_II64I, "sceIoLseek", 'I', "iIi" }, - {0X68963324, &WrapU_III, "sceIoLseek32", 'x', "iii" }, - {0X1B385D8F, &WrapU_III, "sceIoLseek32Async", 'x', "iii" }, - {0X71B19E77, &WrapU_II64I, "sceIoLseekAsync", 'x', "iIi" }, - {0X109F50BC, &WrapU_CII, "sceIoOpen", 'x', "sii" }, - {0X89AA9906, &WrapU_CII, "sceIoOpenAsync", 'x', "sii" }, - {0X06A70004, &WrapU_CI, "sceIoMkdir", 'x', "si" }, - {0X3251EA56, &WrapU_IU, "sceIoPollAsync", 'x', "ix" }, - {0X6A638D83, &WrapU_IUI, "sceIoRead", 'x', "ixi" }, - {0XA0B5A7C2, &WrapU_IUI, "sceIoReadAsync", 'x', "ixi" }, - {0XF27A9C51, &WrapU_C, "sceIoRemove", 'x', "s" }, - {0X779103A0, &WrapU_CC, "sceIoRename", 'x', "ss" }, - {0X1117C65F, &WrapU_C, "sceIoRmdir", 'x', "s" }, - {0XA12A0514, &WrapU_IUU, "sceIoSetAsyncCallback", 'x', "ixx" }, - {0XAB96437F, &WrapU_CI, "sceIoSync", 'x', "si" }, - {0X6D08A871, &WrapU_C, "sceIoUnassign", 'x', "s" }, - {0X42EC03AC, &WrapU_IUI, "sceIoWrite", 'x', "ixi" }, - {0X0FACAB19, &WrapU_IUI, "sceIoWriteAsync", 'x', "ixi" }, - {0X35DBD746, &WrapI_IU, "sceIoWaitAsyncCB", 'i', "ix" }, - {0XE23EEC33, &WrapI_IU, "sceIoWaitAsync", 'i', "ix" }, - {0X5C2BE2CC, &WrapU_UIU, "sceIoGetFdList", 'x', "xix" }, + {0X68963324, &WrapU_III, "sceIoLseek32", 'i', "iii" }, + {0X1B385D8F, &WrapU_III, "sceIoLseek32Async", 'i', "iii" }, + {0X71B19E77, &WrapU_II64I, "sceIoLseekAsync", 'i', "iIi" }, + {0X109F50BC, &WrapU_CII, "sceIoOpen", 'i', "sii" }, + {0X89AA9906, &WrapU_CII, "sceIoOpenAsync", 'i', "sii" }, + {0X06A70004, &WrapU_CI, "sceIoMkdir", 'i', "si" }, + {0X3251EA56, &WrapU_IU, "sceIoPollAsync", 'i', "iP" }, + {0X6A638D83, &WrapU_IUI, "sceIoRead", 'i', "ixi" }, + {0XA0B5A7C2, &WrapU_IUI, "sceIoReadAsync", 'i', "ixi" }, + {0XF27A9C51, &WrapU_C, "sceIoRemove", 'i', "s" }, + {0X779103A0, &WrapU_CC, "sceIoRename", 'i', "ss" }, + {0X1117C65F, &WrapU_C, "sceIoRmdir", 'i', "s" }, + {0XA12A0514, &WrapU_IUU, "sceIoSetAsyncCallback", 'i', "ixx" }, + {0XAB96437F, &WrapU_CI, "sceIoSync", 'i', "si" }, + {0X6D08A871, &WrapU_C, "sceIoUnassign", 'i', "s" }, + {0X42EC03AC, &WrapU_IUI, "sceIoWrite", 'i', "ixi" }, + {0X0FACAB19, &WrapU_IUI, "sceIoWriteAsync", 'i', "ixi" }, + {0X35DBD746, &WrapI_IU, "sceIoWaitAsyncCB", 'i', "iP" }, + {0XE23EEC33, &WrapI_IU, "sceIoWaitAsync", 'i', "iP" }, + {0X5C2BE2CC, &WrapU_UIU, "sceIoGetFdList", 'i', "xip" }, }; void Register_IoFileMgrForUser() { @@ -2463,11 +2463,11 @@ void Register_IoFileMgrForUser() { const HLEFunction StdioForUser[] = { - {0X172D316E, &WrapU_V, "sceKernelStdin", 'x', "" }, - {0XA6BAB2E9, &WrapU_V, "sceKernelStdout", 'x', "" }, - {0XF78BA90A, &WrapU_V, "sceKernelStderr", 'x', "" }, - {0X432D8F5C, &WrapU_U, "sceKernelRegisterStdoutPipe", 'x', "x" }, - {0X6F797E03, &WrapU_U, "sceKernelRegisterStderrPipe", 'x', "x" }, + {0X172D316E, &WrapU_V, "sceKernelStdin", 'i', "" }, + {0XA6BAB2E9, &WrapU_V, "sceKernelStdout", 'i', "" }, + {0XF78BA90A, &WrapU_V, "sceKernelStderr", 'i', "" }, + {0X432D8F5C, &WrapU_U, "sceKernelRegisterStdoutPipe", 'i', "x" }, + {0X6F797E03, &WrapU_U, "sceKernelRegisterStderrPipe", 'i', "x" }, {0XA46785C9, nullptr, "sceKernelStdioSendChar", '?', "" }, {0X0CBB0571, nullptr, "sceKernelStdioLseek", '?', "" }, {0X3054D478, nullptr, "sceKernelStdioRead", '?', "" },