mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-23 13:30:02 +00:00
Actually use the table's arg and ret masks.
This commit is contained in:
parent
fcf0518223
commit
52a37c1330
@ -620,7 +620,7 @@ size_t hleFormatLogArgs(char *message, size_t sz, const char *argmask) {
|
|||||||
return used;
|
return used;
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 hleDoLog(LogTypes::LOG_TYPE t, LogTypes::LOG_LEVELS level, u32 res, const char *file, int line, const char *reportTag, char retmask, const char *argmask, const char *reason, ...) {
|
u32 hleDoLog(LogTypes::LOG_TYPE t, LogTypes::LOG_LEVELS level, u32 res, const char *file, int line, const char *reportTag, char retmask, const char *reason, ...) {
|
||||||
if (level > MAX_LOGLEVEL || !GenericLogEnabled(level, t)) {
|
if (level > MAX_LOGLEVEL || !GenericLogEnabled(level, t)) {
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@ -637,7 +637,11 @@ u32 hleDoLog(LogTypes::LOG_TYPE t, LogTypes::LOG_LEVELS level, u32 res, const ch
|
|||||||
}
|
}
|
||||||
|
|
||||||
char formatted_args[4096];
|
char formatted_args[4096];
|
||||||
hleFormatLogArgs(formatted_args, sizeof(formatted_args), argmask);
|
hleFormatLogArgs(formatted_args, sizeof(formatted_args), latestSyscall->argmask);
|
||||||
|
|
||||||
|
// This acts as an override (for error returns which are usually hex.)
|
||||||
|
if (retmask == '\0')
|
||||||
|
retmask = latestSyscall->retmask;
|
||||||
|
|
||||||
const char *fmt;
|
const char *fmt;
|
||||||
// TODO: Floats and other types... move to another func (for return type?) Hmm.
|
// TODO: Floats and other types... move to another func (for return type?) Hmm.
|
||||||
@ -669,6 +673,6 @@ u32 hleDoLog(LogTypes::LOG_TYPE t, LogTypes::LOG_LEVELS level, u32 res, const ch
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 hleDoLog(LogTypes::LOG_TYPE t, LogTypes::LOG_LEVELS level, u32 res, const char *file, int line, const char *reportTag, char retmask, const char *argmask) {
|
u32 hleDoLog(LogTypes::LOG_TYPE t, LogTypes::LOG_LEVELS level, u32 res, const char *file, int line, const char *reportTag, char retmask) {
|
||||||
return hleDoLog(t, level, res, file, line, reportTag, retmask, argmask, nullptr);
|
return hleDoLog(t, level, res, file, line, reportTag, retmask, nullptr);
|
||||||
}
|
}
|
||||||
|
@ -146,20 +146,20 @@ const HLEFunction *GetSyscallInfo(MIPSOpcode op);
|
|||||||
// For jit, takes arg: const HLEFunction *
|
// For jit, takes arg: const HLEFunction *
|
||||||
void *GetQuickSyscallFunc(MIPSOpcode op);
|
void *GetQuickSyscallFunc(MIPSOpcode op);
|
||||||
|
|
||||||
u32 hleDoLog(LogTypes::LOG_TYPE t, LogTypes::LOG_LEVELS level, u32 res, const char *file, int line, const char *reportTag, char retmask, const char *argmask, const char *reason, ...);
|
u32 hleDoLog(LogTypes::LOG_TYPE t, LogTypes::LOG_LEVELS level, u32 res, const char *file, int line, const char *reportTag, char retmask, const char *reason, ...);
|
||||||
u32 hleDoLog(LogTypes::LOG_TYPE t, LogTypes::LOG_LEVELS level, u32 res, const char *file, int line, const char *reportTag, char retmask, const char *argmask);
|
u32 hleDoLog(LogTypes::LOG_TYPE t, LogTypes::LOG_LEVELS level, u32 res, const char *file, int line, const char *reportTag, char retmask);
|
||||||
|
|
||||||
// Only one side of the ?: is evaluated (per c++ standard), so this should be safe.
|
// Only one side of the ?: is evaluated (per c++ standard), so this should be safe.
|
||||||
#define hleLogHelper(t, level, res, retmask, ...) (LogTypes::level > MAX_LOGLEVEL ? res : hleDoLog(LogTypes::t, LogTypes::level, res, __FILE__, __LINE__, nullptr, retmask, __VA_ARGS__))
|
#define hleLogHelper(t, level, res, retmask, ...) (LogTypes::level > MAX_LOGLEVEL ? res : hleDoLog(LogTypes::t, LogTypes::level, res, __FILE__, __LINE__, nullptr, retmask, ##__VA_ARGS__))
|
||||||
#define hleLogError(t, res, ...) hleLogHelper(t, LERROR, res, 'x', __VA_ARGS__)
|
#define hleLogError(t, res, ...) hleLogHelper(t, LERROR, res, 'x', ##__VA_ARGS__)
|
||||||
#define hleLogWarning(t, res, ...) hleLogHelper(t, LWARNING, res, 'x', __VA_ARGS__)
|
#define hleLogWarning(t, res, ...) hleLogHelper(t, LWARNING, res, 'x', ##__VA_ARGS__)
|
||||||
#define hleLogDebug(t, res, ...) hleLogHelper(t, LDEBUG, res, 'x', __VA_ARGS__)
|
#define hleLogDebug(t, res, ...) hleLogHelper(t, LDEBUG, res, 'x', ##__VA_ARGS__)
|
||||||
#define hleLogSuccessX(t, res, ...) hleLogHelper(t, LDEBUG, res, 'x', __VA_ARGS__)
|
#define hleLogSuccessX(t, res, ...) hleLogHelper(t, LDEBUG, res, 'x', ##__VA_ARGS__)
|
||||||
#define hleLogSuccessI(t, res, ...) hleLogHelper(t, LDEBUG, res, 'i', __VA_ARGS__)
|
#define hleLogSuccessI(t, res, ...) hleLogHelper(t, LDEBUG, res, 'i', ##__VA_ARGS__)
|
||||||
#define hleLogSuccessVerboseX(t, res, ...) hleLogHelper(t, LVERBOSE, res, 'x', __VA_ARGS__)
|
#define hleLogSuccessVerboseX(t, res, ...) hleLogHelper(t, LVERBOSE, res, 'x', ##__VA_ARGS__)
|
||||||
#define hleLogSuccessVerboseI(t, res, ...) hleLogHelper(t, LVERBOSE, res, 'i', __VA_ARGS__)
|
#define hleLogSuccessVerboseI(t, res, ...) hleLogHelper(t, LVERBOSE, res, 'i', ##__VA_ARGS__)
|
||||||
|
|
||||||
#define hleReportError(t, res, ...) hleDoLog(LogTypes::t, LogTypes::LERROR, res, __FILE__, __LINE__, "", 'x', __VA_ARGS__)
|
#define hleReportError(t, res, ...) hleDoLog(LogTypes::t, LogTypes::LERROR, res, __FILE__, __LINE__, "", 'x', ##__VA_ARGS__)
|
||||||
#define hleReportWarning(t, res, ...) hleDoLog(LogTypes::t, LogTypes::LWARNING, res, __FILE__, __LINE__, "", 'x', __VA_ARGS__)
|
#define hleReportWarning(t, res, ...) hleDoLog(LogTypes::t, LogTypes::LWARNING, res, __FILE__, __LINE__, "", 'x', ##__VA_ARGS__)
|
||||||
#define hleReportDebug(t, res, ...) hleDoLog(LogTypes::t, LogTypes::LDEBUG, res, __FILE__, __LINE__, "", 'x', __VA_ARGS__)
|
#define hleReportDebug(t, res, ...) hleDoLog(LogTypes::t, LogTypes::LDEBUG, res, __FILE__, __LINE__, "", 'x', ##__VA_ARGS__)
|
||||||
#define hleReportVerbose(t, res, ...) hleDoLog(LogTypes::t, LogTypes::LVERBOSE, res, __FILE__, __LINE__, "", 'x', __VA_ARGS__)
|
#define hleReportVerbose(t, res, ...) hleDoLog(LogTypes::t, LogTypes::LVERBOSE, res, __FILE__, __LINE__, "", 'x', ##__VA_ARGS__)
|
||||||
|
@ -823,7 +823,7 @@ const HLEFunction ThreadManForUser[] =
|
|||||||
{0XC11BA8C4, &WrapI_II<sceKernelNotifyCallback>, "sceKernelNotifyCallback", 'i', "ii" },
|
{0XC11BA8C4, &WrapI_II<sceKernelNotifyCallback>, "sceKernelNotifyCallback", 'i', "ii" },
|
||||||
{0XBA4051D6, &WrapI_I<sceKernelCancelCallback>, "sceKernelCancelCallback", 'i', "i" },
|
{0XBA4051D6, &WrapI_I<sceKernelCancelCallback>, "sceKernelCancelCallback", 'i', "i" },
|
||||||
{0X2A3D44FF, &WrapI_I<sceKernelGetCallbackCount>, "sceKernelGetCallbackCount", 'i', "i" },
|
{0X2A3D44FF, &WrapI_I<sceKernelGetCallbackCount>, "sceKernelGetCallbackCount", 'i', "i" },
|
||||||
{0X730ED8BC, &WrapI_IU<sceKernelReferCallbackStatus>, "sceKernelReferCallbackStatus", 'i', "ix" },
|
{0X730ED8BC, &WrapI_IU<sceKernelReferCallbackStatus>, "sceKernelReferCallbackStatus", 'i', "ip" },
|
||||||
|
|
||||||
{0X8125221D, &WrapI_CUU<sceKernelCreateMbx>, "sceKernelCreateMbx", 'i', "sxx" },
|
{0X8125221D, &WrapI_CUU<sceKernelCreateMbx>, "sceKernelCreateMbx", 'i', "sxx" },
|
||||||
{0X86255ADA, &WrapI_I<sceKernelDeleteMbx>, "sceKernelDeleteMbx", 'i', "i" },
|
{0X86255ADA, &WrapI_I<sceKernelDeleteMbx>, "sceKernelDeleteMbx", 'i', "i" },
|
||||||
|
@ -3020,9 +3020,9 @@ int sceKernelDeleteCallback(SceUID cbId)
|
|||||||
if (cb->nc.notifyCount != 0)
|
if (cb->nc.notifyCount != 0)
|
||||||
readyCallbacksCount--;
|
readyCallbacksCount--;
|
||||||
|
|
||||||
return hleLogSuccessI(SCEKERNEL, kernelObjects.Destroy<Callback>(cbId), "d");
|
return hleLogSuccessI(SCEKERNEL, kernelObjects.Destroy<Callback>(cbId));
|
||||||
} else {
|
} else {
|
||||||
return hleLogError(SCEKERNEL, error, "i", "bad cbId");
|
return hleLogError(SCEKERNEL, error, "bad cbId");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3033,9 +3033,9 @@ int sceKernelNotifyCallback(SceUID cbId, int notifyArg)
|
|||||||
Callback *cb = kernelObjects.Get<Callback>(cbId, error);
|
Callback *cb = kernelObjects.Get<Callback>(cbId, error);
|
||||||
if (cb) {
|
if (cb) {
|
||||||
__KernelNotifyCallback(cbId, notifyArg);
|
__KernelNotifyCallback(cbId, notifyArg);
|
||||||
return hleLogSuccessI(SCEKERNEL, 0, "ii");
|
return hleLogSuccessI(SCEKERNEL, 0);
|
||||||
} else {
|
} else {
|
||||||
return hleLogError(SCEKERNEL, error, "ii", "bad cbId");
|
return hleLogError(SCEKERNEL, error, "bad cbId");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3046,9 +3046,9 @@ int sceKernelCancelCallback(SceUID cbId)
|
|||||||
if (cb) {
|
if (cb) {
|
||||||
// This just resets the notify count.
|
// This just resets the notify count.
|
||||||
cb->nc.notifyArg = 0;
|
cb->nc.notifyArg = 0;
|
||||||
return hleLogSuccessI(SCEKERNEL, 0, "i");
|
return hleLogSuccessI(SCEKERNEL, 0);
|
||||||
} else {
|
} else {
|
||||||
return hleLogError(SCEKERNEL, error, "i", "bad cbId");
|
return hleLogError(SCEKERNEL, error, "bad cbId");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3057,9 +3057,9 @@ int sceKernelGetCallbackCount(SceUID cbId)
|
|||||||
u32 error;
|
u32 error;
|
||||||
Callback *cb = kernelObjects.Get<Callback>(cbId, error);
|
Callback *cb = kernelObjects.Get<Callback>(cbId, error);
|
||||||
if (cb) {
|
if (cb) {
|
||||||
return hleLogSuccessVerboseI(SCEKERNEL, cb->nc.notifyCount, "i");
|
return hleLogSuccessVerboseI(SCEKERNEL, cb->nc.notifyCount);
|
||||||
} else {
|
} else {
|
||||||
return hleLogError(SCEKERNEL, error, "i", "bad cbId");
|
return hleLogError(SCEKERNEL, error, "bad cbId");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3070,12 +3070,12 @@ int sceKernelReferCallbackStatus(SceUID cbId, u32 statusAddr)
|
|||||||
if (c) {
|
if (c) {
|
||||||
if (Memory::IsValidAddress(statusAddr) && Memory::Read_U32(statusAddr) != 0) {
|
if (Memory::IsValidAddress(statusAddr) && Memory::Read_U32(statusAddr) != 0) {
|
||||||
Memory::WriteStruct(statusAddr, &c->nc);
|
Memory::WriteStruct(statusAddr, &c->nc);
|
||||||
return hleLogSuccessI(SCEKERNEL, 0, "ip");
|
return hleLogSuccessI(SCEKERNEL, 0);
|
||||||
} else {
|
} else {
|
||||||
return hleLogDebug(SCEKERNEL, 0, "ip", "struct size was 0");
|
return hleLogDebug(SCEKERNEL, 0, "struct size was 0");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return hleLogError(SCEKERNEL, error, "ip", "bad cbId");
|
return hleLogError(SCEKERNEL, error, "bad cbId");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3105,7 +3105,7 @@ u32 sceKernelExtendThreadStack(u32 size, u32 entryAddr, u32 entryParameter)
|
|||||||
currentMIPS->r[MIPS_REG_SP] = thread->currentStack.end - 0x10;
|
currentMIPS->r[MIPS_REG_SP] = thread->currentStack.end - 0x10;
|
||||||
|
|
||||||
hleSkipDeadbeef();
|
hleSkipDeadbeef();
|
||||||
return hleLogSuccessI(SCEKERNEL, 0, "xxx");
|
return hleLogSuccessI(SCEKERNEL, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void __KernelReturnFromExtendStack()
|
void __KernelReturnFromExtendStack()
|
||||||
|
Loading…
Reference in New Issue
Block a user