mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-23 21:39:52 +00:00
Merge pull request #6469 from unknownbrackets/logging
Enforce semicolons at the end of log lines
This commit is contained in:
commit
bfffe33438
12
Common/Log.h
12
Common/Log.h
@ -110,12 +110,12 @@ void GenericLog(LOGTYPES_LEVELS level, LOGTYPES_TYPE type,
|
|||||||
GenericLog(v, t, __FILE__, __LINE__, __VA_ARGS__); \
|
GenericLog(v, t, __FILE__, __LINE__, __VA_ARGS__); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define ERROR_LOG(t,...) { GENERIC_LOG(LogTypes::t, LogTypes::LERROR, __VA_ARGS__) }
|
#define ERROR_LOG(t,...) do { GENERIC_LOG(LogTypes::t, LogTypes::LERROR, __VA_ARGS__) } while (false)
|
||||||
#define WARN_LOG(t,...) { GENERIC_LOG(LogTypes::t, LogTypes::LWARNING, __VA_ARGS__) }
|
#define WARN_LOG(t,...) do { GENERIC_LOG(LogTypes::t, LogTypes::LWARNING, __VA_ARGS__) } while (false)
|
||||||
#define NOTICE_LOG(t,...) { GENERIC_LOG(LogTypes::t, LogTypes::LNOTICE, __VA_ARGS__) }
|
#define NOTICE_LOG(t,...) do { GENERIC_LOG(LogTypes::t, LogTypes::LNOTICE, __VA_ARGS__) } while (false)
|
||||||
#define INFO_LOG(t,...) { GENERIC_LOG(LogTypes::t, LogTypes::LINFO, __VA_ARGS__) }
|
#define INFO_LOG(t,...) do { GENERIC_LOG(LogTypes::t, LogTypes::LINFO, __VA_ARGS__) } while (false)
|
||||||
#define DEBUG_LOG(t,...) { GENERIC_LOG(LogTypes::t, LogTypes::LDEBUG, __VA_ARGS__) }
|
#define DEBUG_LOG(t,...) do { GENERIC_LOG(LogTypes::t, LogTypes::LDEBUG, __VA_ARGS__) } while (false)
|
||||||
#define VERBOSE_LOG(t,...) { GENERIC_LOG(LogTypes::t, LogTypes::LVERBOSE, __VA_ARGS__) }
|
#define VERBOSE_LOG(t,...) do { GENERIC_LOG(LogTypes::t, LogTypes::LVERBOSE, __VA_ARGS__) } while (false)
|
||||||
|
|
||||||
#if MAX_LOGLEVEL >= DEBUG_LEVEL
|
#if MAX_LOGLEVEL >= DEBUG_LEVEL
|
||||||
#define _dbg_assert_(_t_, _a_) \
|
#define _dbg_assert_(_t_, _a_) \
|
||||||
|
@ -335,7 +335,7 @@ void __DisplayVblankBeginCallback(SceUID threadID, SceUID prevCallbackId) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
vblankPausedWaits[pauseKey] = vCount + waitData.vcountUnblock;
|
vblankPausedWaits[pauseKey] = vCount + waitData.vcountUnblock;
|
||||||
DEBUG_LOG(SCEDISPLAY, "sceDisplayWaitVblankCB: Suspending vblank wait for callback")
|
DEBUG_LOG(SCEDISPLAY, "sceDisplayWaitVblankCB: Suspending vblank wait for callback");
|
||||||
}
|
}
|
||||||
|
|
||||||
void __DisplayVblankEndCallback(SceUID threadID, SceUID prevCallbackId) {
|
void __DisplayVblankEndCallback(SceUID threadID, SceUID prevCallbackId) {
|
||||||
@ -356,7 +356,7 @@ void __DisplayVblankEndCallback(SceUID threadID, SceUID prevCallbackId) {
|
|||||||
|
|
||||||
// Still have to wait a bit longer.
|
// Still have to wait a bit longer.
|
||||||
vblankWaitingThreads.push_back(WaitVBlankInfo(__KernelGetCurThread(), vcountUnblock - vCount));
|
vblankWaitingThreads.push_back(WaitVBlankInfo(__KernelGetCurThread(), vcountUnblock - vCount));
|
||||||
DEBUG_LOG(SCEDISPLAY, "sceDisplayWaitVblankCB: Resuming vblank wait from callback")
|
DEBUG_LOG(SCEDISPLAY, "sceDisplayWaitVblankCB: Resuming vblank wait from callback");
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Also average actualFps
|
// TODO: Also average actualFps
|
||||||
|
@ -366,7 +366,7 @@ void __IoSyncNotify(u64 userdata, int cyclesLate) {
|
|||||||
void __IoAsyncBeginCallback(SceUID threadID, SceUID prevCallbackId) {
|
void __IoAsyncBeginCallback(SceUID threadID, SceUID prevCallbackId) {
|
||||||
auto result = HLEKernel::WaitBeginCallback<FileNode, WAITTYPE_ASYNCIO, SceUID>(threadID, prevCallbackId, -1);
|
auto result = HLEKernel::WaitBeginCallback<FileNode, WAITTYPE_ASYNCIO, SceUID>(threadID, prevCallbackId, -1);
|
||||||
if (result == HLEKernel::WAIT_CB_SUCCESS) {
|
if (result == HLEKernel::WAIT_CB_SUCCESS) {
|
||||||
DEBUG_LOG(SCEIO, "sceIoWaitAsync: Suspending wait for callback")
|
DEBUG_LOG(SCEIO, "sceIoWaitAsync: Suspending wait for callback");
|
||||||
} else if (result == HLEKernel::WAIT_CB_BAD_WAIT_ID) {
|
} else if (result == HLEKernel::WAIT_CB_BAD_WAIT_ID) {
|
||||||
WARN_LOG_REPORT(SCEIO, "sceIoWaitAsync: beginning callback with bad wait id?");
|
WARN_LOG_REPORT(SCEIO, "sceIoWaitAsync: beginning callback with bad wait id?");
|
||||||
}
|
}
|
||||||
|
@ -207,9 +207,9 @@ void __KernelEventFlagBeginCallback(SceUID threadID, SceUID prevCallbackId)
|
|||||||
{
|
{
|
||||||
auto result = HLEKernel::WaitBeginCallback<EventFlag, WAITTYPE_EVENTFLAG, EventFlagTh>(threadID, prevCallbackId, eventFlagWaitTimer);
|
auto result = HLEKernel::WaitBeginCallback<EventFlag, WAITTYPE_EVENTFLAG, EventFlagTh>(threadID, prevCallbackId, eventFlagWaitTimer);
|
||||||
if (result == HLEKernel::WAIT_CB_SUCCESS)
|
if (result == HLEKernel::WAIT_CB_SUCCESS)
|
||||||
DEBUG_LOG(SCEKERNEL, "sceKernelWaitEventFlagCB: Suspending lock wait for callback")
|
DEBUG_LOG(SCEKERNEL, "sceKernelWaitEventFlagCB: Suspending lock wait for callback");
|
||||||
else if (result == HLEKernel::WAIT_CB_BAD_WAIT_DATA)
|
else if (result == HLEKernel::WAIT_CB_BAD_WAIT_DATA)
|
||||||
ERROR_LOG_REPORT(SCEKERNEL, "sceKernelWaitEventFlagCB: wait not found to pause for callback")
|
ERROR_LOG_REPORT(SCEKERNEL, "sceKernelWaitEventFlagCB: wait not found to pause for callback");
|
||||||
else
|
else
|
||||||
WARN_LOG_REPORT(SCEKERNEL, "sceKernelWaitEventFlagCB: beginning callback with bad wait id?");
|
WARN_LOG_REPORT(SCEKERNEL, "sceKernelWaitEventFlagCB: beginning callback with bad wait id?");
|
||||||
}
|
}
|
||||||
|
@ -234,9 +234,9 @@ void __KernelMbxBeginCallback(SceUID threadID, SceUID prevCallbackId)
|
|||||||
{
|
{
|
||||||
auto result = HLEKernel::WaitBeginCallback<Mbx, WAITTYPE_SEMA, MbxWaitingThread>(threadID, prevCallbackId, mbxWaitTimer);
|
auto result = HLEKernel::WaitBeginCallback<Mbx, WAITTYPE_SEMA, MbxWaitingThread>(threadID, prevCallbackId, mbxWaitTimer);
|
||||||
if (result == HLEKernel::WAIT_CB_SUCCESS)
|
if (result == HLEKernel::WAIT_CB_SUCCESS)
|
||||||
DEBUG_LOG(SCEKERNEL, "sceKernelReceiveMbxCB: Suspending mbx wait for callback")
|
DEBUG_LOG(SCEKERNEL, "sceKernelReceiveMbxCB: Suspending mbx wait for callback");
|
||||||
else if (result == HLEKernel::WAIT_CB_BAD_WAIT_DATA)
|
else if (result == HLEKernel::WAIT_CB_BAD_WAIT_DATA)
|
||||||
ERROR_LOG_REPORT(SCEKERNEL, "sceKernelReceiveMbxCB: wait not found to pause for callback")
|
ERROR_LOG_REPORT(SCEKERNEL, "sceKernelReceiveMbxCB: wait not found to pause for callback");
|
||||||
else
|
else
|
||||||
WARN_LOG_REPORT(SCEKERNEL, "sceKernelReceiveMbxCB: beginning callback with bad wait id?");
|
WARN_LOG_REPORT(SCEKERNEL, "sceKernelReceiveMbxCB: beginning callback with bad wait id?");
|
||||||
}
|
}
|
||||||
|
@ -517,9 +517,9 @@ void __KernelFplBeginCallback(SceUID threadID, SceUID prevCallbackId)
|
|||||||
{
|
{
|
||||||
auto result = HLEKernel::WaitBeginCallback<FPL, WAITTYPE_FPL, FplWaitingThread>(threadID, prevCallbackId, fplWaitTimer);
|
auto result = HLEKernel::WaitBeginCallback<FPL, WAITTYPE_FPL, FplWaitingThread>(threadID, prevCallbackId, fplWaitTimer);
|
||||||
if (result == HLEKernel::WAIT_CB_SUCCESS)
|
if (result == HLEKernel::WAIT_CB_SUCCESS)
|
||||||
DEBUG_LOG(SCEKERNEL, "sceKernelAllocateFplCB: Suspending fpl wait for callback")
|
DEBUG_LOG(SCEKERNEL, "sceKernelAllocateFplCB: Suspending fpl wait for callback");
|
||||||
else if (result == HLEKernel::WAIT_CB_BAD_WAIT_DATA)
|
else if (result == HLEKernel::WAIT_CB_BAD_WAIT_DATA)
|
||||||
ERROR_LOG_REPORT(SCEKERNEL, "sceKernelAllocateFplCB: wait not found to pause for callback")
|
ERROR_LOG_REPORT(SCEKERNEL, "sceKernelAllocateFplCB: wait not found to pause for callback");
|
||||||
else
|
else
|
||||||
WARN_LOG_REPORT(SCEKERNEL, "sceKernelAllocateFplCB: beginning callback with bad wait id?");
|
WARN_LOG_REPORT(SCEKERNEL, "sceKernelAllocateFplCB: beginning callback with bad wait id?");
|
||||||
}
|
}
|
||||||
@ -1136,7 +1136,7 @@ int sceKernelPrintf(const char *formatString)
|
|||||||
result.resize(result.size() - 1);
|
result.resize(result.size() - 1);
|
||||||
|
|
||||||
if (supported)
|
if (supported)
|
||||||
INFO_LOG(SCEKERNEL, "sceKernelPrintf: %s", result.c_str())
|
INFO_LOG(SCEKERNEL, "sceKernelPrintf: %s", result.c_str());
|
||||||
else
|
else
|
||||||
ERROR_LOG(SCEKERNEL, "UNIMPL sceKernelPrintf(%s, %08x, %08x, %08x)", format.c_str(), PARAM(1), PARAM(2), PARAM(3));
|
ERROR_LOG(SCEKERNEL, "UNIMPL sceKernelPrintf(%s, %08x, %08x, %08x)", format.c_str(), PARAM(1), PARAM(2), PARAM(3));
|
||||||
return 0;
|
return 0;
|
||||||
@ -1381,9 +1381,9 @@ void __KernelVplBeginCallback(SceUID threadID, SceUID prevCallbackId)
|
|||||||
{
|
{
|
||||||
auto result = HLEKernel::WaitBeginCallback<VPL, WAITTYPE_VPL, VplWaitingThread>(threadID, prevCallbackId, vplWaitTimer);
|
auto result = HLEKernel::WaitBeginCallback<VPL, WAITTYPE_VPL, VplWaitingThread>(threadID, prevCallbackId, vplWaitTimer);
|
||||||
if (result == HLEKernel::WAIT_CB_SUCCESS)
|
if (result == HLEKernel::WAIT_CB_SUCCESS)
|
||||||
DEBUG_LOG(SCEKERNEL, "sceKernelAllocateVplCB: Suspending vpl wait for callback")
|
DEBUG_LOG(SCEKERNEL, "sceKernelAllocateVplCB: Suspending vpl wait for callback");
|
||||||
else if (result == HLEKernel::WAIT_CB_BAD_WAIT_DATA)
|
else if (result == HLEKernel::WAIT_CB_BAD_WAIT_DATA)
|
||||||
ERROR_LOG_REPORT(SCEKERNEL, "sceKernelAllocateVplCB: wait not found to pause for callback")
|
ERROR_LOG_REPORT(SCEKERNEL, "sceKernelAllocateVplCB: wait not found to pause for callback");
|
||||||
else
|
else
|
||||||
WARN_LOG_REPORT(SCEKERNEL, "sceKernelAllocateVplCB: beginning callback with bad wait id?");
|
WARN_LOG_REPORT(SCEKERNEL, "sceKernelAllocateVplCB: beginning callback with bad wait id?");
|
||||||
}
|
}
|
||||||
|
@ -532,10 +532,10 @@ void WriteVarSymbol(u32 exportAddress, u32 relocAddress, u8 type, bool reverse =
|
|||||||
|
|
||||||
// The ABI requires that these come in pairs, at least.
|
// The ABI requires that these come in pairs, at least.
|
||||||
if (lastHI16Relocs.empty()) {
|
if (lastHI16Relocs.empty()) {
|
||||||
ERROR_LOG_REPORT(LOADER, "LO16 without any HI16 variable import at %08x for %08x", relocAddress, exportAddress)
|
ERROR_LOG_REPORT(LOADER, "LO16 without any HI16 variable import at %08x for %08x", relocAddress, exportAddress);
|
||||||
// Try to process at least the low relocation...
|
// Try to process at least the low relocation...
|
||||||
} else if (lastHI16ExportAddress != exportAddress) {
|
} else if (lastHI16ExportAddress != exportAddress) {
|
||||||
ERROR_LOG_REPORT(LOADER, "HI16 and LO16 imports do not match at %08x for %08x (should be %08x)", relocAddress, lastHI16ExportAddress, exportAddress)
|
ERROR_LOG_REPORT(LOADER, "HI16 and LO16 imports do not match at %08x for %08x (should be %08x)", relocAddress, lastHI16ExportAddress, exportAddress);
|
||||||
} else {
|
} else {
|
||||||
// Process each of the HI16. Usually there's only one.
|
// Process each of the HI16. Usually there's only one.
|
||||||
for (auto it = lastHI16Relocs.begin(), end = lastHI16Relocs.end(); it != end; ++it)
|
for (auto it = lastHI16Relocs.begin(), end = lastHI16Relocs.end(); it != end; ++it)
|
||||||
@ -1366,7 +1366,7 @@ Module *__KernelLoadModule(u8 *fileptr, SceKernelLMOption *options, std::string
|
|||||||
size_t size = offsets[6] - offsets[5];
|
size_t size = offsets[6] - offsets[5];
|
||||||
temp = new u8[size];
|
temp = new u8[size];
|
||||||
memcpy(temp, fileptr + offsets[5], size);
|
memcpy(temp, fileptr + offsets[5], size);
|
||||||
INFO_LOG(LOADER, "Elf unaligned, aligning!")
|
INFO_LOG(LOADER, "Elf unaligned, aligning!");
|
||||||
}
|
}
|
||||||
|
|
||||||
module = __KernelLoadELFFromPtr(temp ? temp : fileptr + offsets[5], PSP_GetDefaultLoadAddress(), error_string, &magic);
|
module = __KernelLoadELFFromPtr(temp ? temp : fileptr + offsets[5], PSP_GetDefaultLoadAddress(), error_string, &magic);
|
||||||
@ -1624,14 +1624,14 @@ u32 sceKernelLoadModule(const char *name, u32 flags, u32 optionAddr)
|
|||||||
|
|
||||||
if (info.name == "BOOT.BIN")
|
if (info.name == "BOOT.BIN")
|
||||||
{
|
{
|
||||||
NOTICE_LOG(LOADER, "Module %s is blacklisted or undecryptable - we try __KernelLoadExec", name)
|
NOTICE_LOG(LOADER, "Module %s is blacklisted or undecryptable - we try __KernelLoadExec", name);
|
||||||
return __KernelLoadExec(name, 0, &error_string);
|
return __KernelLoadExec(name, 0, &error_string);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Module was blacklisted or couldn't be decrypted, which means it's a kernel module we don't want to run..
|
// Module was blacklisted or couldn't be decrypted, which means it's a kernel module we don't want to run..
|
||||||
// Let's just act as if it worked.
|
// Let's just act as if it worked.
|
||||||
NOTICE_LOG(LOADER, "Module %s is blacklisted or undecryptable - we lie about success", name)
|
NOTICE_LOG(LOADER, "Module %s is blacklisted or undecryptable - we lie about success", name);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1987,7 +1987,7 @@ u32 sceKernelGetModuleIdByAddress(u32 moduleAddr)
|
|||||||
|
|
||||||
kernelObjects.Iterate(&__GetModuleIdByAddressIterator, &state);
|
kernelObjects.Iterate(&__GetModuleIdByAddressIterator, &state);
|
||||||
if (state.result == (SceUID)SCE_KERNEL_ERROR_UNKNOWN_MODULE)
|
if (state.result == (SceUID)SCE_KERNEL_ERROR_UNKNOWN_MODULE)
|
||||||
ERROR_LOG(SCEMODULE, "sceKernelGetModuleIdByAddress(%08x): module not found", moduleAddr)
|
ERROR_LOG(SCEMODULE, "sceKernelGetModuleIdByAddress(%08x): module not found", moduleAddr);
|
||||||
else
|
else
|
||||||
DEBUG_LOG(SCEMODULE, "%x=sceKernelGetModuleIdByAddress(%08x)", state.result, moduleAddr);
|
DEBUG_LOG(SCEMODULE, "%x=sceKernelGetModuleIdByAddress(%08x)", state.result, moduleAddr);
|
||||||
return state.result;
|
return state.result;
|
||||||
|
@ -534,9 +534,9 @@ void __KernelMsgPipeBeginCallback(SceUID threadID, SceUID prevCallbackId)
|
|||||||
{
|
{
|
||||||
auto result = HLEKernel::WaitBeginCallback<MsgPipeWaitingThread>(threadID, prevCallbackId, waitTimer, ko->sendWaitingThreads, ko->pausedSendWaits, timeoutPtr != 0);
|
auto result = HLEKernel::WaitBeginCallback<MsgPipeWaitingThread>(threadID, prevCallbackId, waitTimer, ko->sendWaitingThreads, ko->pausedSendWaits, timeoutPtr != 0);
|
||||||
if (result == HLEKernel::WAIT_CB_SUCCESS)
|
if (result == HLEKernel::WAIT_CB_SUCCESS)
|
||||||
DEBUG_LOG(SCEKERNEL, "sceKernelSendMsgPipeCB: Suspending wait for callback")
|
DEBUG_LOG(SCEKERNEL, "sceKernelSendMsgPipeCB: Suspending wait for callback");
|
||||||
else if (result == HLEKernel::WAIT_CB_BAD_WAIT_DATA)
|
else if (result == HLEKernel::WAIT_CB_BAD_WAIT_DATA)
|
||||||
ERROR_LOG_REPORT(SCEKERNEL, "sceKernelSendMsgPipeCB: wait not found to pause for callback")
|
ERROR_LOG_REPORT(SCEKERNEL, "sceKernelSendMsgPipeCB: wait not found to pause for callback");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
WARN_LOG_REPORT(SCEKERNEL, "sceKernelSendMsgPipeCB: beginning callback with bad wait id?");
|
WARN_LOG_REPORT(SCEKERNEL, "sceKernelSendMsgPipeCB: beginning callback with bad wait id?");
|
||||||
@ -547,9 +547,9 @@ void __KernelMsgPipeBeginCallback(SceUID threadID, SceUID prevCallbackId)
|
|||||||
{
|
{
|
||||||
auto result = HLEKernel::WaitBeginCallback<MsgPipeWaitingThread>(threadID, prevCallbackId, waitTimer, ko->receiveWaitingThreads, ko->pausedReceiveWaits, timeoutPtr != 0);
|
auto result = HLEKernel::WaitBeginCallback<MsgPipeWaitingThread>(threadID, prevCallbackId, waitTimer, ko->receiveWaitingThreads, ko->pausedReceiveWaits, timeoutPtr != 0);
|
||||||
if (result == HLEKernel::WAIT_CB_SUCCESS)
|
if (result == HLEKernel::WAIT_CB_SUCCESS)
|
||||||
DEBUG_LOG(SCEKERNEL, "sceKernelReceiveMsgPipeCB: Suspending wait for callback")
|
DEBUG_LOG(SCEKERNEL, "sceKernelReceiveMsgPipeCB: Suspending wait for callback");
|
||||||
else if (result == HLEKernel::WAIT_CB_BAD_WAIT_DATA)
|
else if (result == HLEKernel::WAIT_CB_BAD_WAIT_DATA)
|
||||||
ERROR_LOG_REPORT(SCEKERNEL, "sceKernelReceiveMsgPipeCB: wait not found to pause for callback")
|
ERROR_LOG_REPORT(SCEKERNEL, "sceKernelReceiveMsgPipeCB: wait not found to pause for callback");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
WARN_LOG_REPORT(SCEKERNEL, "sceKernelReceiveMsgPipeCB: beginning callback with bad wait id?");
|
WARN_LOG_REPORT(SCEKERNEL, "sceKernelReceiveMsgPipeCB: beginning callback with bad wait id?");
|
||||||
@ -603,30 +603,26 @@ bool __KernelCheckResumeMsgPipeReceive(MsgPipe *m, MsgPipeWaitingThread &waitInf
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void __KernelMsgPipeEndCallback(SceUID threadID, SceUID prevCallbackId)
|
void __KernelMsgPipeEndCallback(SceUID threadID, SceUID prevCallbackId) {
|
||||||
{
|
|
||||||
u32 error;
|
u32 error;
|
||||||
u32 waitValue = __KernelGetWaitValue(threadID, error);
|
u32 waitValue = __KernelGetWaitValue(threadID, error);
|
||||||
u32 timeoutPtr = __KernelGetWaitTimeoutPtr(threadID, error);
|
u32 timeoutPtr = __KernelGetWaitTimeoutPtr(threadID, error);
|
||||||
SceUID uid = __KernelGetWaitID(threadID, WAITTYPE_MSGPIPE, error);
|
SceUID uid = __KernelGetWaitID(threadID, WAITTYPE_MSGPIPE, error);
|
||||||
MsgPipe *ko = uid == 0 ? NULL : kernelObjects.Get<MsgPipe>(uid, error);
|
MsgPipe *ko = uid == 0 ? NULL : kernelObjects.Get<MsgPipe>(uid, error);
|
||||||
|
|
||||||
if (ko == NULL)
|
if (ko == NULL) {
|
||||||
{
|
|
||||||
ERROR_LOG_REPORT(SCEKERNEL, "__KernelMsgPipeEndCallback: Invalid object");
|
ERROR_LOG_REPORT(SCEKERNEL, "__KernelMsgPipeEndCallback: Invalid object");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (waitValue)
|
switch (waitValue) {
|
||||||
{
|
|
||||||
case MSGPIPE_WAIT_VALUE_SEND:
|
case MSGPIPE_WAIT_VALUE_SEND:
|
||||||
{
|
{
|
||||||
MsgPipeWaitingThread dummy;
|
MsgPipeWaitingThread dummy;
|
||||||
auto result = HLEKernel::WaitEndCallback<MsgPipe, WAITTYPE_MSGPIPE, MsgPipeWaitingThread>(threadID, prevCallbackId, waitTimer, __KernelCheckResumeMsgPipeSend, dummy, ko->sendWaitingThreads, ko->pausedSendWaits);
|
auto result = HLEKernel::WaitEndCallback<MsgPipe, WAITTYPE_MSGPIPE, MsgPipeWaitingThread>(threadID, prevCallbackId, waitTimer, __KernelCheckResumeMsgPipeSend, dummy, ko->sendWaitingThreads, ko->pausedSendWaits);
|
||||||
if (result == HLEKernel::WAIT_CB_RESUMED_WAIT)
|
if (result == HLEKernel::WAIT_CB_RESUMED_WAIT) {
|
||||||
DEBUG_LOG(SCEKERNEL, "sceKernelSendMsgPipeCB: Resuming wait from callback")
|
DEBUG_LOG(SCEKERNEL, "sceKernelSendMsgPipeCB: Resuming wait from callback");
|
||||||
else if (result == HLEKernel::WAIT_CB_TIMED_OUT)
|
} else if (result == HLEKernel::WAIT_CB_TIMED_OUT) {
|
||||||
{
|
|
||||||
// It was re-added to the the waiting threads list, but it timed out. Let's remove it.
|
// It was re-added to the the waiting threads list, but it timed out. Let's remove it.
|
||||||
ko->RemoveSendWaitingThread(threadID);
|
ko->RemoveSendWaitingThread(threadID);
|
||||||
}
|
}
|
||||||
@ -637,10 +633,9 @@ void __KernelMsgPipeEndCallback(SceUID threadID, SceUID prevCallbackId)
|
|||||||
{
|
{
|
||||||
MsgPipeWaitingThread dummy;
|
MsgPipeWaitingThread dummy;
|
||||||
auto result = HLEKernel::WaitEndCallback<MsgPipe, WAITTYPE_MSGPIPE, MsgPipeWaitingThread>(threadID, prevCallbackId, waitTimer, __KernelCheckResumeMsgPipeReceive, dummy, ko->receiveWaitingThreads, ko->pausedReceiveWaits);
|
auto result = HLEKernel::WaitEndCallback<MsgPipe, WAITTYPE_MSGPIPE, MsgPipeWaitingThread>(threadID, prevCallbackId, waitTimer, __KernelCheckResumeMsgPipeReceive, dummy, ko->receiveWaitingThreads, ko->pausedReceiveWaits);
|
||||||
if (result == HLEKernel::WAIT_CB_RESUMED_WAIT)
|
if (result == HLEKernel::WAIT_CB_RESUMED_WAIT) {
|
||||||
DEBUG_LOG(SCEKERNEL, "sceKernelReceiveMsgPipeCB: Resuming wait from callback")
|
DEBUG_LOG(SCEKERNEL, "sceKernelReceiveMsgPipeCB: Resuming wait from callback");
|
||||||
else if (result == HLEKernel::WAIT_CB_TIMED_OUT)
|
} else if (result == HLEKernel::WAIT_CB_TIMED_OUT) {
|
||||||
{
|
|
||||||
// It was re-added to the the waiting threads list, but it timed out. Let's remove it.
|
// It was re-added to the the waiting threads list, but it timed out. Let's remove it.
|
||||||
ko->RemoveReceiveWaitingThread(threadID);
|
ko->RemoveReceiveWaitingThread(threadID);
|
||||||
}
|
}
|
||||||
|
@ -293,7 +293,7 @@ void __KernelMutexBeginCallback(SceUID threadID, SceUID prevCallbackId)
|
|||||||
{
|
{
|
||||||
auto result = HLEKernel::WaitBeginCallback<Mutex, WAITTYPE_MUTEX, SceUID>(threadID, prevCallbackId, mutexWaitTimer);
|
auto result = HLEKernel::WaitBeginCallback<Mutex, WAITTYPE_MUTEX, SceUID>(threadID, prevCallbackId, mutexWaitTimer);
|
||||||
if (result == HLEKernel::WAIT_CB_SUCCESS)
|
if (result == HLEKernel::WAIT_CB_SUCCESS)
|
||||||
DEBUG_LOG(SCEKERNEL, "sceKernelLockMutexCB: Suspending lock wait for callback")
|
DEBUG_LOG(SCEKERNEL, "sceKernelLockMutexCB: Suspending lock wait for callback");
|
||||||
else
|
else
|
||||||
WARN_LOG_REPORT(SCEKERNEL, "sceKernelLockMutexCB: beginning callback with bad wait id?");
|
WARN_LOG_REPORT(SCEKERNEL, "sceKernelLockMutexCB: beginning callback with bad wait id?");
|
||||||
}
|
}
|
||||||
@ -915,7 +915,7 @@ void __KernelLwMutexBeginCallback(SceUID threadID, SceUID prevCallbackId)
|
|||||||
{
|
{
|
||||||
auto result = HLEKernel::WaitBeginCallback<LwMutex, WAITTYPE_LWMUTEX, SceUID>(threadID, prevCallbackId, lwMutexWaitTimer);
|
auto result = HLEKernel::WaitBeginCallback<LwMutex, WAITTYPE_LWMUTEX, SceUID>(threadID, prevCallbackId, lwMutexWaitTimer);
|
||||||
if (result == HLEKernel::WAIT_CB_SUCCESS)
|
if (result == HLEKernel::WAIT_CB_SUCCESS)
|
||||||
DEBUG_LOG(SCEKERNEL, "sceKernelLockLwMutexCB: Suspending lock wait for callback")
|
DEBUG_LOG(SCEKERNEL, "sceKernelLockLwMutexCB: Suspending lock wait for callback");
|
||||||
else
|
else
|
||||||
WARN_LOG_REPORT(SCEKERNEL, "sceKernelLockLwMutexCB: beginning callback with bad wait id?");
|
WARN_LOG_REPORT(SCEKERNEL, "sceKernelLockLwMutexCB: beginning callback with bad wait id?");
|
||||||
}
|
}
|
||||||
|
@ -141,7 +141,7 @@ void __KernelSemaBeginCallback(SceUID threadID, SceUID prevCallbackId)
|
|||||||
{
|
{
|
||||||
auto result = HLEKernel::WaitBeginCallback<Semaphore, WAITTYPE_SEMA, SceUID>(threadID, prevCallbackId, semaWaitTimer);
|
auto result = HLEKernel::WaitBeginCallback<Semaphore, WAITTYPE_SEMA, SceUID>(threadID, prevCallbackId, semaWaitTimer);
|
||||||
if (result == HLEKernel::WAIT_CB_SUCCESS)
|
if (result == HLEKernel::WAIT_CB_SUCCESS)
|
||||||
DEBUG_LOG(SCEKERNEL, "sceKernelWaitSemaCB: Suspending sema wait for callback")
|
DEBUG_LOG(SCEKERNEL, "sceKernelWaitSemaCB: Suspending sema wait for callback");
|
||||||
else
|
else
|
||||||
WARN_LOG_REPORT(SCEKERNEL, "sceKernelWaitSemaCB: beginning callback with bad wait id?");
|
WARN_LOG_REPORT(SCEKERNEL, "sceKernelWaitSemaCB: beginning callback with bad wait id?");
|
||||||
}
|
}
|
||||||
@ -409,9 +409,9 @@ int sceKernelWaitSema(SceUID id, int wantedCount, u32 timeoutPtr)
|
|||||||
{
|
{
|
||||||
int result = __KernelWaitSema(id, wantedCount, timeoutPtr, false);
|
int result = __KernelWaitSema(id, wantedCount, timeoutPtr, false);
|
||||||
if (result == (int)SCE_KERNEL_ERROR_ILLEGAL_COUNT)
|
if (result == (int)SCE_KERNEL_ERROR_ILLEGAL_COUNT)
|
||||||
DEBUG_LOG(SCEKERNEL, "SCE_KERNEL_ERROR_ILLEGAL_COUNT=sceKernelWaitSema(%i, %i, %i)", id, wantedCount, timeoutPtr)
|
DEBUG_LOG(SCEKERNEL, "SCE_KERNEL_ERROR_ILLEGAL_COUNT=sceKernelWaitSema(%i, %i, %i)", id, wantedCount, timeoutPtr);
|
||||||
else if (result == 0)
|
else if (result == 0)
|
||||||
DEBUG_LOG(SCEKERNEL, "0=sceKernelWaitSema(%i, %i, %i)", id, wantedCount, timeoutPtr)
|
DEBUG_LOG(SCEKERNEL, "0=sceKernelWaitSema(%i, %i, %i)", id, wantedCount, timeoutPtr);
|
||||||
else
|
else
|
||||||
DEBUG_LOG(SCEKERNEL, "%08x=sceKernelWaitSema(%i, %i, %i)", result, id, wantedCount, timeoutPtr);
|
DEBUG_LOG(SCEKERNEL, "%08x=sceKernelWaitSema(%i, %i, %i)", result, id, wantedCount, timeoutPtr);
|
||||||
return result;
|
return result;
|
||||||
@ -421,9 +421,9 @@ int sceKernelWaitSemaCB(SceUID id, int wantedCount, u32 timeoutPtr)
|
|||||||
{
|
{
|
||||||
int result = __KernelWaitSema(id, wantedCount, timeoutPtr, true);
|
int result = __KernelWaitSema(id, wantedCount, timeoutPtr, true);
|
||||||
if (result == (int)SCE_KERNEL_ERROR_ILLEGAL_COUNT)
|
if (result == (int)SCE_KERNEL_ERROR_ILLEGAL_COUNT)
|
||||||
DEBUG_LOG(SCEKERNEL, "SCE_KERNEL_ERROR_ILLEGAL_COUNT=sceKernelWaitSemaCB(%i, %i, %i)", id, wantedCount, timeoutPtr)
|
DEBUG_LOG(SCEKERNEL, "SCE_KERNEL_ERROR_ILLEGAL_COUNT=sceKernelWaitSemaCB(%i, %i, %i)", id, wantedCount, timeoutPtr);
|
||||||
else if (result == 0)
|
else if (result == 0)
|
||||||
DEBUG_LOG(SCEKERNEL, "0=sceKernelWaitSemaCB(%i, %i, %i)", id, wantedCount, timeoutPtr)
|
DEBUG_LOG(SCEKERNEL, "0=sceKernelWaitSemaCB(%i, %i, %i)", id, wantedCount, timeoutPtr);
|
||||||
else
|
else
|
||||||
DEBUG_LOG(SCEKERNEL, "%08x=sceKernelWaitSemaCB(%i, %i, %i)", result, id, wantedCount, timeoutPtr);
|
DEBUG_LOG(SCEKERNEL, "%08x=sceKernelWaitSemaCB(%i, %i, %i)", result, id, wantedCount, timeoutPtr);
|
||||||
return result;
|
return result;
|
||||||
|
@ -1067,9 +1067,9 @@ void __KernelThreadEndBeginCallback(SceUID threadID, SceUID prevCallbackId)
|
|||||||
{
|
{
|
||||||
auto result = HLEKernel::WaitBeginCallback<Thread, WAITTYPE_THREADEND, SceUID>(threadID, prevCallbackId, eventThreadEndTimeout);
|
auto result = HLEKernel::WaitBeginCallback<Thread, WAITTYPE_THREADEND, SceUID>(threadID, prevCallbackId, eventThreadEndTimeout);
|
||||||
if (result == HLEKernel::WAIT_CB_SUCCESS)
|
if (result == HLEKernel::WAIT_CB_SUCCESS)
|
||||||
DEBUG_LOG(SCEKERNEL, "sceKernelWaitThreadEndCB: Suspending wait for callback")
|
DEBUG_LOG(SCEKERNEL, "sceKernelWaitThreadEndCB: Suspending wait for callback");
|
||||||
else if (result == HLEKernel::WAIT_CB_BAD_WAIT_DATA)
|
else if (result == HLEKernel::WAIT_CB_BAD_WAIT_DATA)
|
||||||
ERROR_LOG_REPORT(SCEKERNEL, "sceKernelWaitThreadEndCB: wait not found to pause for callback")
|
ERROR_LOG_REPORT(SCEKERNEL, "sceKernelWaitThreadEndCB: wait not found to pause for callback");
|
||||||
else
|
else
|
||||||
WARN_LOG_REPORT(SCEKERNEL, "sceKernelWaitThreadEndCB: beginning callback with bad wait id?");
|
WARN_LOG_REPORT(SCEKERNEL, "sceKernelWaitThreadEndCB: beginning callback with bad wait id?");
|
||||||
}
|
}
|
||||||
@ -2507,32 +2507,30 @@ int sceKernelChangeCurrentThreadAttr(u32 clearAttr, u32 setAttr)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int sceKernelChangeThreadPriority(SceUID threadID, int priority)
|
int sceKernelChangeThreadPriority(SceUID threadID, int priority) {
|
||||||
{
|
if (threadID == 0) {
|
||||||
if (threadID == 0)
|
|
||||||
threadID = currentThread;
|
threadID = currentThread;
|
||||||
|
}
|
||||||
|
|
||||||
// 0 means the current (running) thread's priority, not target's.
|
// 0 means the current (running) thread's priority, not target's.
|
||||||
if (priority == 0)
|
if (priority == 0) {
|
||||||
{
|
|
||||||
Thread *cur = __GetCurrentThread();
|
Thread *cur = __GetCurrentThread();
|
||||||
if (!cur)
|
if (!cur) {
|
||||||
ERROR_LOG_REPORT(SCEKERNEL, "sceKernelChangeThreadPriority(%i, %i): no current thread?", threadID, priority)
|
ERROR_LOG_REPORT(SCEKERNEL, "sceKernelChangeThreadPriority(%i, %i): no current thread?", threadID, priority);
|
||||||
else
|
} else {
|
||||||
priority = cur->nt.currentPriority;
|
priority = cur->nt.currentPriority;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 error;
|
u32 error;
|
||||||
Thread *thread = kernelObjects.Get<Thread>(threadID, error);
|
Thread *thread = kernelObjects.Get<Thread>(threadID, error);
|
||||||
if (thread)
|
if (thread) {
|
||||||
{
|
if (thread->isStopped()) {
|
||||||
if (thread->isStopped())
|
|
||||||
{
|
|
||||||
ERROR_LOG_REPORT(SCEKERNEL, "sceKernelChangeThreadPriority(%i, %i): thread is dormant", threadID, priority);
|
ERROR_LOG_REPORT(SCEKERNEL, "sceKernelChangeThreadPriority(%i, %i): thread is dormant", threadID, priority);
|
||||||
return SCE_KERNEL_ERROR_DORMANT;
|
return SCE_KERNEL_ERROR_DORMANT;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (priority < 0x08 || priority > 0x77)
|
if (priority < 0x08 || priority > 0x77) {
|
||||||
{
|
|
||||||
ERROR_LOG_REPORT(SCEKERNEL, "sceKernelChangeThreadPriority(%i, %i): bogus priority", threadID, priority);
|
ERROR_LOG_REPORT(SCEKERNEL, "sceKernelChangeThreadPriority(%i, %i): bogus priority", threadID, priority);
|
||||||
return SCE_KERNEL_ERROR_ILLEGAL_PRIORITY;
|
return SCE_KERNEL_ERROR_ILLEGAL_PRIORITY;
|
||||||
}
|
}
|
||||||
@ -2544,17 +2542,17 @@ int sceKernelChangeThreadPriority(SceUID threadID, int priority)
|
|||||||
|
|
||||||
thread->nt.currentPriority = priority;
|
thread->nt.currentPriority = priority;
|
||||||
threadReadyQueue.prepare(thread->nt.currentPriority);
|
threadReadyQueue.prepare(thread->nt.currentPriority);
|
||||||
if (thread->isRunning())
|
if (thread->isRunning()) {
|
||||||
thread->nt.status = (thread->nt.status & ~THREADSTATUS_RUNNING) | THREADSTATUS_READY;
|
thread->nt.status = (thread->nt.status & ~THREADSTATUS_RUNNING) | THREADSTATUS_READY;
|
||||||
if (thread->isReady())
|
}
|
||||||
|
if (thread->isReady()) {
|
||||||
threadReadyQueue.push_back(thread->nt.currentPriority, threadID);
|
threadReadyQueue.push_back(thread->nt.currentPriority, threadID);
|
||||||
|
}
|
||||||
|
|
||||||
hleEatCycles(450);
|
hleEatCycles(450);
|
||||||
hleReSchedule("change thread priority");
|
hleReSchedule("change thread priority");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
ERROR_LOG(SCEKERNEL, "%08x=sceKernelChangeThreadPriority(%i, %i) failed - no such thread", error, threadID, priority);
|
ERROR_LOG(SCEKERNEL, "%08x=sceKernelChangeThreadPriority(%i, %i) failed - no such thread", error, threadID, priority);
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
@ -248,7 +248,7 @@ u32 sceSasGetPauseFlag(u32 core) {
|
|||||||
pauseFlag |= (1 << i);
|
pauseFlag |= (1 << i);
|
||||||
}
|
}
|
||||||
|
|
||||||
DEBUG_LOG(SCESAS, "sceSasGetPauseFlag(%08x)", pauseFlag)
|
DEBUG_LOG(SCESAS, "sceSasGetPauseFlag(%08x)", pauseFlag);
|
||||||
return pauseFlag;
|
return pauseFlag;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -376,11 +376,11 @@ u32 sceSasSetADSR(u32 core, int voiceNum, int flag, int a, int d, int s, int r)
|
|||||||
// Create a mask like flag for the invalid values.
|
// Create a mask like flag for the invalid values.
|
||||||
int invalid = (a < 0 ? 0x1 : 0) | (d < 0 ? 0x2 : 0) | (s < 0 ? 0x4 : 0) | (r < 0 ? 0x8 : 0);
|
int invalid = (a < 0 ? 0x1 : 0) | (d < 0 ? 0x2 : 0) | (s < 0 ? 0x4 : 0) | (r < 0 ? 0x8 : 0);
|
||||||
if (invalid & flag) {
|
if (invalid & flag) {
|
||||||
WARN_LOG_REPORT(SCESAS, "sceSasSetADSR(%08x, %i, %i, %08x, %08x, %08x, %08x): invalid value", core, voiceNum, flag, a, d, s, r)
|
WARN_LOG_REPORT(SCESAS, "sceSasSetADSR(%08x, %i, %i, %08x, %08x, %08x, %08x): invalid value", core, voiceNum, flag, a, d, s, r);
|
||||||
return ERROR_SAS_INVALID_ADSR_RATE;
|
return ERROR_SAS_INVALID_ADSR_RATE;
|
||||||
}
|
}
|
||||||
|
|
||||||
DEBUG_LOG(SCESAS, "0=sceSasSetADSR(%08x, %i, %i, %08x, %08x, %08x, %08x)", core, voiceNum, flag, a, d, s, r)
|
DEBUG_LOG(SCESAS, "0=sceSasSetADSR(%08x, %i, %i, %08x, %08x, %08x, %08x)", core, voiceNum, flag, a, d, s, r);
|
||||||
|
|
||||||
SasVoice &v = sas->voices[voiceNum];
|
SasVoice &v = sas->voices[voiceNum];
|
||||||
if ((flag & 0x1) != 0) v.envelope.attackRate = a;
|
if ((flag & 0x1) != 0) v.envelope.attackRate = a;
|
||||||
|
@ -398,8 +398,7 @@ void Jit::Comp_VBranch(MIPSOpcode op)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Jit::Comp_Jump(MIPSOpcode op)
|
void Jit::Comp_Jump(MIPSOpcode op) {
|
||||||
{
|
|
||||||
if (js.inDelaySlot) {
|
if (js.inDelaySlot) {
|
||||||
ERROR_LOG_REPORT(JIT, "Branch in Jump delay slot at %08x in block starting at %08x", js.compilerPC, js.blockStart);
|
ERROR_LOG_REPORT(JIT, "Branch in Jump delay slot at %08x in block starting at %08x", js.compilerPC, js.blockStart);
|
||||||
return;
|
return;
|
||||||
@ -408,18 +407,17 @@ void Jit::Comp_Jump(MIPSOpcode op)
|
|||||||
u32 targetAddr = (js.compilerPC & 0xF0000000) | off;
|
u32 targetAddr = (js.compilerPC & 0xF0000000) | off;
|
||||||
|
|
||||||
// Might be a stubbed address or something?
|
// Might be a stubbed address or something?
|
||||||
if (!Memory::IsValidAddress(targetAddr))
|
if (!Memory::IsValidAddress(targetAddr)) {
|
||||||
{
|
if (js.nextExit == 0) {
|
||||||
if (js.nextExit == 0)
|
ERROR_LOG_REPORT(JIT, "Jump to invalid address: %08x", targetAddr);
|
||||||
ERROR_LOG_REPORT(JIT, "Jump to invalid address: %08x", targetAddr)
|
} else {
|
||||||
else
|
|
||||||
js.compiling = false;
|
js.compiling = false;
|
||||||
|
}
|
||||||
// TODO: Mark this block dirty or something? May be indication it will be changed by imports.
|
// TODO: Mark this block dirty or something? May be indication it will be changed by imports.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (op >> 26)
|
switch (op >> 26) {
|
||||||
{
|
|
||||||
case 2: //j
|
case 2: //j
|
||||||
CompileDelaySlot(DELAYSLOT_NICE);
|
CompileDelaySlot(DELAYSLOT_NICE);
|
||||||
if (jo.continueJumps && js.numInstructions < jo.continueMaxInstructions) {
|
if (jo.continueJumps && js.numInstructions < jo.continueMaxInstructions) {
|
||||||
|
@ -162,7 +162,7 @@ void Jit::EatInstruction(MIPSOpcode op) {
|
|||||||
ERROR_LOG_REPORT_ONCE(ateDelaySlot, JIT, "Ate a branch op.");
|
ERROR_LOG_REPORT_ONCE(ateDelaySlot, JIT, "Ate a branch op.");
|
||||||
}
|
}
|
||||||
if (js.inDelaySlot) {
|
if (js.inDelaySlot) {
|
||||||
ERROR_LOG_REPORT_ONCE(ateInDelaySlot, JIT, "Ate an instruction inside a delay slot.")
|
ERROR_LOG_REPORT_ONCE(ateInDelaySlot, JIT, "Ate an instruction inside a delay slot.");
|
||||||
}
|
}
|
||||||
|
|
||||||
js.numInstructions++;
|
js.numInstructions++;
|
||||||
|
@ -516,8 +516,7 @@ void Jit::Comp_VBranch(MIPSOpcode op)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Jit::Comp_Jump(MIPSOpcode op)
|
void Jit::Comp_Jump(MIPSOpcode op) {
|
||||||
{
|
|
||||||
CONDITIONAL_LOG;
|
CONDITIONAL_LOG;
|
||||||
if (js.inDelaySlot) {
|
if (js.inDelaySlot) {
|
||||||
ERROR_LOG_REPORT(JIT, "Branch in Jump delay slot at %08x in block starting at %08x", js.compilerPC, js.blockStart);
|
ERROR_LOG_REPORT(JIT, "Branch in Jump delay slot at %08x in block starting at %08x", js.compilerPC, js.blockStart);
|
||||||
@ -527,18 +526,17 @@ void Jit::Comp_Jump(MIPSOpcode op)
|
|||||||
u32 targetAddr = (js.compilerPC & 0xF0000000) | off;
|
u32 targetAddr = (js.compilerPC & 0xF0000000) | off;
|
||||||
|
|
||||||
// Might be a stubbed address or something?
|
// Might be a stubbed address or something?
|
||||||
if (!Memory::IsValidAddress(targetAddr))
|
if (!Memory::IsValidAddress(targetAddr)) {
|
||||||
{
|
if (js.nextExit == 0) {
|
||||||
if (js.nextExit == 0)
|
ERROR_LOG_REPORT(JIT, "Jump to invalid address: %08x", targetAddr);
|
||||||
ERROR_LOG_REPORT(JIT, "Jump to invalid address: %08x", targetAddr)
|
} else {
|
||||||
else
|
|
||||||
js.compiling = false;
|
js.compiling = false;
|
||||||
|
}
|
||||||
// TODO: Mark this block dirty or something? May be indication it will be changed by imports.
|
// TODO: Mark this block dirty or something? May be indication it will be changed by imports.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (op >> 26)
|
switch (op >> 26) {
|
||||||
{
|
|
||||||
case 2: //j
|
case 2: //j
|
||||||
CompileDelaySlot(DELAYSLOT_NICE);
|
CompileDelaySlot(DELAYSLOT_NICE);
|
||||||
if (jo.continueJumps && js.numInstructions < jo.continueMaxInstructions)
|
if (jo.continueJumps && js.numInstructions < jo.continueMaxInstructions)
|
||||||
|
@ -260,7 +260,7 @@ void Jit::EatInstruction(MIPSOpcode op)
|
|||||||
ERROR_LOG_REPORT_ONCE(ateDelaySlot, JIT, "Ate a branch op.");
|
ERROR_LOG_REPORT_ONCE(ateDelaySlot, JIT, "Ate a branch op.");
|
||||||
}
|
}
|
||||||
if (js.inDelaySlot) {
|
if (js.inDelaySlot) {
|
||||||
ERROR_LOG_REPORT_ONCE(ateInDelaySlot, JIT, "Ate an instruction inside a delay slot.")
|
ERROR_LOG_REPORT_ONCE(ateInDelaySlot, JIT, "Ate an instruction inside a delay slot.");
|
||||||
}
|
}
|
||||||
|
|
||||||
CheckJitBreakpoint(js.compilerPC + 4, 0);
|
CheckJitBreakpoint(js.compilerPC + 4, 0);
|
||||||
|
@ -19,22 +19,22 @@
|
|||||||
#include "Common/Log.h"
|
#include "Common/Log.h"
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#define DEBUG_LOG_REPORT(t,...) { DEBUG_LOG(t, __VA_ARGS__); Reporting::ReportMessage(__VA_ARGS__); }
|
#define DEBUG_LOG_REPORT(t,...) do { DEBUG_LOG(t, __VA_ARGS__); Reporting::ReportMessage(__VA_ARGS__); } while (false)
|
||||||
#define ERROR_LOG_REPORT(t,...) { ERROR_LOG(t, __VA_ARGS__); Reporting::ReportMessage(__VA_ARGS__); }
|
#define ERROR_LOG_REPORT(t,...) do { ERROR_LOG(t, __VA_ARGS__); Reporting::ReportMessage(__VA_ARGS__); } while (false)
|
||||||
#define WARN_LOG_REPORT(t,...) { WARN_LOG(t, __VA_ARGS__); Reporting::ReportMessage(__VA_ARGS__); }
|
#define WARN_LOG_REPORT(t,...) do { WARN_LOG(t, __VA_ARGS__); Reporting::ReportMessage(__VA_ARGS__); } while (false)
|
||||||
#define NOTICE_LOG_REPORT(t,...) { NOTICE_LOG(t, __VA_ARGS__); Reporting::ReportMessage(__VA_ARGS__); }
|
#define NOTICE_LOG_REPORT(t,...) do { NOTICE_LOG(t, __VA_ARGS__); Reporting::ReportMessage(__VA_ARGS__); } while (false)
|
||||||
#define INFO_LOG_REPORT(t,...) { INFO_LOG(t, __VA_ARGS__); Reporting::ReportMessage(__VA_ARGS__); }
|
#define INFO_LOG_REPORT(t,...) do { INFO_LOG(t, __VA_ARGS__); Reporting::ReportMessage(__VA_ARGS__); } while (false)
|
||||||
|
|
||||||
#define DEBUG_LOG_REPORT_ONCE(n,t,...) { if (Reporting::ShouldLogOnce(#n)) { DEBUG_LOG_REPORT(t, __VA_ARGS__); } }
|
#define DEBUG_LOG_REPORT_ONCE(n,t,...) do { if (Reporting::ShouldLogOnce(#n)) { DEBUG_LOG_REPORT(t, __VA_ARGS__); } } while (false)
|
||||||
#define ERROR_LOG_REPORT_ONCE(n,t,...) { if (Reporting::ShouldLogOnce(#n)) { ERROR_LOG_REPORT(t, __VA_ARGS__); } }
|
#define ERROR_LOG_REPORT_ONCE(n,t,...) do { if (Reporting::ShouldLogOnce(#n)) { ERROR_LOG_REPORT(t, __VA_ARGS__); } } while (false)
|
||||||
#define WARN_LOG_REPORT_ONCE(n,t,...) { if (Reporting::ShouldLogOnce(#n)) { WARN_LOG_REPORT(t, __VA_ARGS__); } }
|
#define WARN_LOG_REPORT_ONCE(n,t,...) do { if (Reporting::ShouldLogOnce(#n)) { WARN_LOG_REPORT(t, __VA_ARGS__); } } while (false)
|
||||||
#define NOTICE_LOG_REPORT_ONCE(n,t,...) { if (Reporting::ShouldLogOnce(#n)) { NOTICE_LOG_REPORT(t, __VA_ARGS__); } }
|
#define NOTICE_LOG_REPORT_ONCE(n,t,...) do { if (Reporting::ShouldLogOnce(#n)) { NOTICE_LOG_REPORT(t, __VA_ARGS__); } } while (false)
|
||||||
#define INFO_LOG_REPORT_ONCE(n,t,...) { if (Reporting::ShouldLogOnce(#n)) { INFO_LOG_REPORT(t, __VA_ARGS__); } }
|
#define INFO_LOG_REPORT_ONCE(n,t,...) do { if (Reporting::ShouldLogOnce(#n)) { INFO_LOG_REPORT(t, __VA_ARGS__); } } while (false)
|
||||||
|
|
||||||
#define ERROR_LOG_ONCE(n,t,...) { if (Reporting::ShouldLogOnce(#n)) { ERROR_LOG(t, __VA_ARGS__); } }
|
#define ERROR_LOG_ONCE(n,t,...) do { if (Reporting::ShouldLogOnce(#n)) { ERROR_LOG(t, __VA_ARGS__); } } while (false)
|
||||||
#define WARN_LOG_ONCE(n,t,...) { if (Reporting::ShouldLogOnce(#n)) { WARN_LOG(t, __VA_ARGS__); } }
|
#define WARN_LOG_ONCE(n,t,...) do { if (Reporting::ShouldLogOnce(#n)) { WARN_LOG(t, __VA_ARGS__); } } while (false)
|
||||||
#define NOTICE_LOG_ONCE(n,t,...) { if (Reporting::ShouldLogOnce(#n)) { NOTICE_LOG(t, __VA_ARGS__); } }
|
#define NOTICE_LOG_ONCE(n,t,...) do { if (Reporting::ShouldLogOnce(#n)) { NOTICE_LOG(t, __VA_ARGS__); } } while (false)
|
||||||
#define INFO_LOG_ONCE(n,t,...) { if (Reporting::ShouldLogOnce(#n)) { INFO_LOG(t, __VA_ARGS__); } }
|
#define INFO_LOG_ONCE(n,t,...) do { if (Reporting::ShouldLogOnce(#n)) { INFO_LOG(t, __VA_ARGS__); } } while (false)
|
||||||
|
|
||||||
class PointerWrap;
|
class PointerWrap;
|
||||||
|
|
||||||
|
@ -948,8 +948,8 @@ void FramebufferManagerDX9::DecimateFBOs() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (age > FBO_OLD_AGE) {
|
if (age > FBO_OLD_AGE) {
|
||||||
INFO_LOG(SCEGE, "Decimating FBO for %08x (%i x %i x %i), age %i", vfb->fb_address, vfb->width, vfb->height, vfb->format, age)
|
INFO_LOG(SCEGE, "Decimating FBO for %08x (%i x %i x %i), age %i", vfb->fb_address, vfb->width, vfb->height, vfb->format, age);
|
||||||
DestroyFramebuf(vfb);
|
DestroyFramebuf(vfb);
|
||||||
vfbs_.erase(vfbs_.begin() + i--);
|
vfbs_.erase(vfbs_.begin() + i--);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -959,8 +959,8 @@ void FramebufferManagerDX9::DecimateFBOs() {
|
|||||||
VirtualFramebufferDX9 *vfb = bvfbs_[i];
|
VirtualFramebufferDX9 *vfb = bvfbs_[i];
|
||||||
int age = frameLastFramebufUsed - vfb->last_frame_render;
|
int age = frameLastFramebufUsed - vfb->last_frame_render;
|
||||||
if (age > FBO_OLD_AGE) {
|
if (age > FBO_OLD_AGE) {
|
||||||
INFO_LOG(SCEGE, "Decimating FBO for %08x (%i x %i x %i), age %i", vfb->fb_address, vfb->width, vfb->height, vfb->format, age)
|
INFO_LOG(SCEGE, "Decimating FBO for %08x (%i x %i x %i), age %i", vfb->fb_address, vfb->width, vfb->height, vfb->format, age);
|
||||||
DestroyFramebuf(vfb);
|
DestroyFramebuf(vfb);
|
||||||
bvfbs_.erase(bvfbs_.begin() + i--);
|
bvfbs_.erase(bvfbs_.begin() + i--);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1006,8 +1006,8 @@ void FramebufferManagerDX9::UpdateFromMemory(u32 addr, int size) {
|
|||||||
needUnbind = true;
|
needUnbind = true;
|
||||||
DrawPixels(Memory::GetPointer(addr), vfb->format, vfb->fb_stride);
|
DrawPixels(Memory::GetPointer(addr), vfb->format, vfb->fb_stride);
|
||||||
} else {
|
} else {
|
||||||
INFO_LOG(SCEGE, "Invalidating FBO for %08x (%i x %i x %i)", vfb->fb_address, vfb->width, vfb->height, vfb->format)
|
INFO_LOG(SCEGE, "Invalidating FBO for %08x (%i x %i x %i)", vfb->fb_address, vfb->width, vfb->height, vfb->format);
|
||||||
DestroyFramebuf(vfb);
|
DestroyFramebuf(vfb);
|
||||||
vfbs_.erase(vfbs_.begin() + i--);
|
vfbs_.erase(vfbs_.begin() + i--);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1214,7 +1214,7 @@ void DIRECTX9_GPU::ExecuteOp(u32 op, u32 diff) {
|
|||||||
|
|
||||||
case GE_CMD_TEXLEVEL:
|
case GE_CMD_TEXLEVEL:
|
||||||
if (data == 1)
|
if (data == 1)
|
||||||
WARN_LOG_REPORT_ONCE(texLevel1, G3D, "Unsupported texture level bias settings: %06x", data)
|
WARN_LOG_REPORT_ONCE(texLevel1, G3D, "Unsupported texture level bias settings: %06x", data);
|
||||||
else if (data != 0)
|
else if (data != 0)
|
||||||
WARN_LOG_REPORT_ONCE(texLevel2, G3D, "Unsupported texture level bias settings: %06x", data);
|
WARN_LOG_REPORT_ONCE(texLevel2, G3D, "Unsupported texture level bias settings: %06x", data);
|
||||||
break;
|
break;
|
||||||
|
@ -906,8 +906,9 @@ void VertexDecoderDX9::SetVertexType(u32 fmt) {
|
|||||||
}
|
}
|
||||||
decFmt.posoff = decOff;
|
decFmt.posoff = decOff;
|
||||||
decOff += DecFmtSize(decFmt.posfmt);
|
decOff += DecFmtSize(decFmt.posfmt);
|
||||||
} else
|
} else {
|
||||||
ERROR_LOG_REPORT(G3D, "Vertices without position found")
|
ERROR_LOG_REPORT(G3D, "Vertices without position found");
|
||||||
|
}
|
||||||
|
|
||||||
decFmt.stride = decOff;
|
decFmt.stride = decOff;
|
||||||
|
|
||||||
|
@ -2003,7 +2003,7 @@ void FramebufferManager::DecimateFBOs() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (age > FBO_OLD_AGE) {
|
if (age > FBO_OLD_AGE) {
|
||||||
INFO_LOG(SCEGE, "Decimating FBO for %08x (%i x %i x %i), age %i", vfb->fb_address, vfb->width, vfb->height, vfb->format, age)
|
INFO_LOG(SCEGE, "Decimating FBO for %08x (%i x %i x %i), age %i", vfb->fb_address, vfb->width, vfb->height, vfb->format, age);
|
||||||
DestroyFramebuf(vfb);
|
DestroyFramebuf(vfb);
|
||||||
vfbs_.erase(vfbs_.begin() + i--);
|
vfbs_.erase(vfbs_.begin() + i--);
|
||||||
}
|
}
|
||||||
@ -2024,7 +2024,7 @@ void FramebufferManager::DecimateFBOs() {
|
|||||||
VirtualFramebuffer *vfb = bvfbs_[i];
|
VirtualFramebuffer *vfb = bvfbs_[i];
|
||||||
int age = frameLastFramebufUsed - vfb->last_frame_render;
|
int age = frameLastFramebufUsed - vfb->last_frame_render;
|
||||||
if (age > FBO_OLD_AGE) {
|
if (age > FBO_OLD_AGE) {
|
||||||
INFO_LOG(SCEGE, "Decimating FBO for %08x (%i x %i x %i), age %i", vfb->fb_address, vfb->width, vfb->height, vfb->format, age)
|
INFO_LOG(SCEGE, "Decimating FBO for %08x (%i x %i x %i), age %i", vfb->fb_address, vfb->width, vfb->height, vfb->format, age);
|
||||||
DestroyFramebuf(vfb);
|
DestroyFramebuf(vfb);
|
||||||
bvfbs_.erase(bvfbs_.begin() + i--);
|
bvfbs_.erase(bvfbs_.begin() + i--);
|
||||||
}
|
}
|
||||||
@ -2078,7 +2078,7 @@ void FramebufferManager::UpdateFromMemory(u32 addr, int size, bool safe) {
|
|||||||
DrawPixels(vfb, 0, 0, Memory::GetPointer(addr | 0x04000000), fmt, vfb->fb_stride, vfb->width, vfb->height);
|
DrawPixels(vfb, 0, 0, Memory::GetPointer(addr | 0x04000000), fmt, vfb->fb_stride, vfb->width, vfb->height);
|
||||||
SetColorUpdated(vfb);
|
SetColorUpdated(vfb);
|
||||||
} else {
|
} else {
|
||||||
INFO_LOG(SCEGE, "Invalidating FBO for %08x (%i x %i x %i)", vfb->fb_address, vfb->width, vfb->height, vfb->format)
|
INFO_LOG(SCEGE, "Invalidating FBO for %08x (%i x %i x %i)", vfb->fb_address, vfb->width, vfb->height, vfb->format);
|
||||||
DestroyFramebuf(vfb);
|
DestroyFramebuf(vfb);
|
||||||
vfbs_.erase(vfbs_.begin() + i--);
|
vfbs_.erase(vfbs_.begin() + i--);
|
||||||
}
|
}
|
||||||
|
@ -506,7 +506,7 @@ UI::EventReturn JitCompareScreen::OnRandomVFPUBlock(UI::EventParams &e) {
|
|||||||
if (MIPSGetInfo(opcode) & IS_VFPU) {
|
if (MIPSGetInfo(opcode) & IS_VFPU) {
|
||||||
char temp[256];
|
char temp[256];
|
||||||
MIPSDisAsm(opcode, addr, temp);
|
MIPSDisAsm(opcode, addr, temp);
|
||||||
INFO_LOG(HLE, "Stopping VFPU instruction: %s", temp)
|
INFO_LOG(HLE, "Stopping VFPU instruction: %s", temp);
|
||||||
anyVFPU = true;
|
anyVFPU = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user