mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-07-05 14:31:17 +12:00
Migrate force_log_printf to new logging (#714)
This commit is contained in:
parent
072c18a6e3
commit
4be57f4896
108 changed files with 401 additions and 399 deletions
|
@ -175,14 +175,14 @@ void coreinitExport_OSGetSharedData(PPCInterpreter_t* hCPU)
|
|||
}
|
||||
}
|
||||
// some games require a valid result or they will crash, return a pointer to our placeholder font
|
||||
forceLog_printf("OSGetSharedData() called by game but no shareddata fonts loaded. Use placeholder font");
|
||||
cemuLog_log(LogType::Force, "OSGetSharedData() called by game but no shareddata fonts loaded. Use placeholder font");
|
||||
if (placeholderFont == MPTR_NULL)
|
||||
{
|
||||
// load and then return placeholder font
|
||||
uint8* placeholderFontPtr = extractCafeDefaultFont(&placeholderFontSize);
|
||||
placeholderFont = coreinit_allocFromSysArea(placeholderFontSize, 256);
|
||||
if (placeholderFont == MPTR_NULL)
|
||||
forceLog_printf("Failed to alloc placeholder font sys memory");
|
||||
cemuLog_log(LogType::Force, "Failed to alloc placeholder font sys memory");
|
||||
memcpy(memory_getPointerFromVirtualOffset(placeholderFont), placeholderFontPtr, placeholderFontSize);
|
||||
free(placeholderFontPtr);
|
||||
}
|
||||
|
@ -204,7 +204,7 @@ typedef struct
|
|||
void coreinitExport_OSDriver_Register(PPCInterpreter_t* hCPU)
|
||||
{
|
||||
#ifdef CEMU_DEBUG_ASSERT
|
||||
forceLog_printf("OSDriver_Register(0x%08x,0x%08x,0x%08x,0x%08x,0x%08x,0x%08x)", hCPU->gpr[3], hCPU->gpr[4], hCPU->gpr[5], hCPU->gpr[6], hCPU->gpr[7], hCPU->gpr[8]);
|
||||
cemuLog_log(LogType::Force, "OSDriver_Register(0x{:08x},0x{:08x},0x{:08x},0x{:08x},0x{:08x},0x{:08x})", hCPU->gpr[3], hCPU->gpr[4], hCPU->gpr[5], hCPU->gpr[6], hCPU->gpr[7], hCPU->gpr[8]);
|
||||
#endif
|
||||
OSDriverCallbacks_t* driverCallbacks = (OSDriverCallbacks_t*)memory_getPointerFromVirtualOffset(hCPU->gpr[5]);
|
||||
|
||||
|
@ -271,7 +271,7 @@ namespace coreinit
|
|||
|
||||
void coreinit_exit(uint32 r)
|
||||
{
|
||||
forceLog_printf("coreinit.exit(%d)", r);
|
||||
cemuLog_log(LogType::Force, "coreinit.exit({})", r);
|
||||
cemu_assert_debug(false);
|
||||
// never return
|
||||
while (true) std::this_thread::sleep_for(std::chrono::milliseconds(100));
|
||||
|
|
|
@ -129,7 +129,7 @@ namespace coreinit
|
|||
{
|
||||
if (!_avoidCodeGenJIT)
|
||||
{
|
||||
forceLog_printf("Disable JIT on dynamic code area");
|
||||
cemuLog_log(LogType::Force, "Disable JIT on dynamic code area");
|
||||
}
|
||||
_avoidCodeGenJIT = true; // this function getting called is usually a sign that
|
||||
// does this have a return value?
|
||||
|
@ -145,4 +145,4 @@ namespace coreinit
|
|||
|
||||
cafeExportRegister("coreinit", OSSwitchSecCodeGenMode, LogType::Placeholder);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -186,7 +186,7 @@ namespace coreinit
|
|||
|
||||
void __FSErrorAndBlock(std::string_view msg)
|
||||
{
|
||||
forceLog_printf("Critical error in FS: %s", msg.data());
|
||||
cemuLog_log(LogType::Force, "Critical error in FS: {}", msg);
|
||||
while (true)
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
|
||||
}
|
||||
|
@ -513,7 +513,7 @@ namespace coreinit
|
|||
fsCmdBlockBody->asyncResult.fsStatusNew = (uint32)result;
|
||||
while (OSSendMessage(ioMsgQueue, &fsCmdBlockBody->asyncResult.msgUnion.osMsg, 0) == 0)
|
||||
{
|
||||
forceLog_printf("FS driver: Failed to add message to result queue. Retrying...");
|
||||
cemuLog_log(LogType::Force, "FS driver: Failed to add message to result queue. Retrying...");
|
||||
if (ppcInterpreterCurrentInstance)
|
||||
PPCCore_switchToScheduler();
|
||||
else
|
||||
|
@ -626,15 +626,16 @@ namespace coreinit
|
|||
{
|
||||
if (fsCmdBlockBody->asyncResult.msgUnion.fsMsg.commandType != _swapEndianU32(8))
|
||||
{
|
||||
forceLog_printf("Corrupted FS command detected in stage %s", stage);
|
||||
forceLog_printf("Printing CMD block: ");
|
||||
cemuLog_log(LogType::Force, "Corrupted FS command detected in stage {}", stage);
|
||||
cemuLog_log(LogType::Force, "Printing CMD block: ");
|
||||
for (uint32 i = 0; i < (sizeof(FSCmdBlockBody_t) + 31) / 32; i++)
|
||||
{
|
||||
uint8* p = ((uint8*)fsCmdBlockBody) + i * 32;
|
||||
forceLog_printf("%04x: %02x %02x %02x %02x - %02x %02x %02x %02x - %02x %02x %02x %02x - %02x %02x %02x %02x | %02x %02x %02x %02x - %02x %02x %02x %02x - %02x %02x %02x %02x - %02x %02x %02x %02x",
|
||||
i * 32,
|
||||
p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], p[8], p[9], p[10], p[11], p[12], p[13], p[14], p[15],
|
||||
cemuLog_log(LogType::Force, "{:04x}: {:02x} {:02x} {:02x} {:02x} - {:02x} {:02x} {:02x} {:02x} - {:02x} {:02x} {:02x} {:02x} - {:02x} {:02x} {:02x} {:02x} | {:02x} {:02x} {:02x} {:02x} - {:02x} {:02x} {:02x} {:02x} - {:02x} {:02x} {:02x} {:02x} - {:02x} {:02x} {:02x} {:02x}",
|
||||
i * 32,
|
||||
p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], p[8], p[9], p[10], p[11], p[12], p[13], p[14], p[15],
|
||||
p[16], p[17], p[18], p[19], p[20], p[21], p[22], p[23], p[24], p[25], p[26], p[27], p[28], p[29], p[30], p[31]);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -659,7 +660,7 @@ namespace coreinit
|
|||
else
|
||||
{
|
||||
// todo - error handling
|
||||
forceLog_printf("FS handleAsyncResult(): unexpected error %08x", errHandling);
|
||||
cemuLog_log(LogType::Force, "FS handleAsyncResult(): unexpected error {:08x}", errHandling);
|
||||
cemu_assert_debug(false);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -86,7 +86,7 @@ namespace coreinit
|
|||
}
|
||||
if (mutexIndex == -1)
|
||||
{
|
||||
forceLog_printf("__ghs_flock_create(): No flock available");
|
||||
cemuLog_log(LogType::Force, "__ghs_flock_create(): No flock available");
|
||||
cemu_assert(false); // no available mutex
|
||||
}
|
||||
// mark mutex as reserved
|
||||
|
@ -282,4 +282,4 @@ namespace coreinit
|
|||
|
||||
cafeExportRegister("coreinit", __tls_get_addr, LogType::Placeholder);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
|
|
@ -100,7 +100,7 @@ namespace coreinit
|
|||
{
|
||||
// out of bounds
|
||||
#ifdef CEMU_DEBUG_ASSERT
|
||||
forceLog_printf("LCDealloc(): Out of bounds");
|
||||
cemuLog_log(LogType::Force, "LCDealloc(): Out of bounds");
|
||||
#endif
|
||||
osLib_returnFromFunction(hCPU, 0);
|
||||
return;
|
||||
|
@ -209,7 +209,7 @@ namespace coreinit
|
|||
{
|
||||
if (_lcDisableErrorCounter < 15)
|
||||
{
|
||||
forceLog_printf("LC disabled but there is still memory allocated");
|
||||
cemuLog_log(LogType::Force, "LC disabled but there is still memory allocated");
|
||||
_lcDisableErrorCounter++;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -154,7 +154,7 @@ void coreinitExport_MCP_GetTitleInfo(PPCInterpreter_t* hCPU)
|
|||
|
||||
if (mcpRequest->titleListRequest.titleCount == 0)
|
||||
{
|
||||
forceLog_printf("MCP_GetTitleInfo() failed to get title info");
|
||||
cemuLog_log(LogType::Force, "MCP_GetTitleInfo() failed to get title info");
|
||||
}
|
||||
|
||||
osLib_returnFromFunction(hCPU, mcpRequest->returnCode);
|
||||
|
@ -558,4 +558,4 @@ void coreinitExport_UCReadSysConfig(PPCInterpreter_t* hCPU)
|
|||
}
|
||||
}
|
||||
osLib_returnFromFunction(hCPU, 0); // 0 -> success
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ MPTR coreinit_allocFromSysArea(uint32 size, uint32 alignment)
|
|||
sysAreaAllocatorOffset += (size+3)&~3;
|
||||
if( sysAreaAllocatorOffset >= mmuRange_CEMU_AREA.getSize() )
|
||||
{
|
||||
forceLog_printf("Ran out of system memory");
|
||||
cemuLog_log(LogType::Force, "Ran out of system memory");
|
||||
cemu_assert(false); // out of bounds
|
||||
}
|
||||
s_allocator_mutex.unlock();
|
||||
|
@ -645,4 +645,4 @@ namespace coreinit
|
|||
cafeExportRegister("coreinit", MEMGetPrevListObject, LogType::CoreinitMem);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -236,7 +236,7 @@ namespace coreinit
|
|||
blockHeapHead->nextFreeBlock = _swapEndianU32(nextFreeBlockMPTR);
|
||||
if (_swapEndianU32(blockHeapHead->freeBlocksLeft) == 0)
|
||||
{
|
||||
forceLog_printf("BlockHeap: No free blocks left\n");
|
||||
cemuLog_log(LogType::Force, "BlockHeap: No free blocks left");
|
||||
assert_dbg();
|
||||
}
|
||||
blockHeapHead->freeBlocksLeft = _swapEndianU32(_swapEndianU32(blockHeapHead->freeBlocksLeft) - 1);
|
||||
|
|
|
@ -452,7 +452,7 @@ void* MEMAllocFromExpHeapEx(MEMHeapHandle heap, uint32 size, sint32 alignment)
|
|||
if (alignment == 0)
|
||||
{
|
||||
// this is a guaranteed crash on the actual console
|
||||
forceLog_printf("MEMAllocFromExpHeapEx(): Alignment 0 not allowed");
|
||||
cemuLog_log(LogType::Force, "MEMAllocFromExpHeapEx(): Alignment 0 not allowed");
|
||||
alignment = 4;
|
||||
return nullptr;
|
||||
}
|
||||
|
|
|
@ -550,7 +550,7 @@ namespace coreinit
|
|||
if (fastMutex->owner != currentThread)
|
||||
{
|
||||
// seen in Paper Mario Color Splash
|
||||
//forceLog_printf("OSFastMutex_Unlock() called on mutex which is not owned by current thread");
|
||||
//cemuLog_log(LogType::Force, "OSFastMutex_Unlock() called on mutex which is not owned by current thread");
|
||||
_OSFastMutex_ReleaseContention(fastMutex);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -238,7 +238,7 @@ namespace coreinit
|
|||
{
|
||||
// workaround for games that restart threads to quickly
|
||||
// seen in Fast Racing Neo at boot (0x020617BC OSCreateThread)
|
||||
forceLog_printf("Game attempting to re-initialize existing thread");
|
||||
cemuLog_log(LogType::Force, "Game attempting to re-initialize existing thread");
|
||||
while ((thread->state == OSThread_t::THREAD_STATE::STATE_READY || thread->state == OSThread_t::THREAD_STATE::STATE_RUNNING) && thread->suspendCounter == 0)
|
||||
{
|
||||
// wait for thread to finish
|
||||
|
@ -248,7 +248,7 @@ namespace coreinit
|
|||
}
|
||||
if (__OSIsThreadActive(thread) && thread->state == OSThread_t::THREAD_STATE::STATE_MORIBUND)
|
||||
{
|
||||
forceLog_printf("Calling OSCreateThread() on thread which is still active (Thread exited without detached flag). Forcing OSDetachThread()...");
|
||||
cemuLog_log(LogType::Force, "Calling OSCreateThread() on thread which is still active (Thread exited without detached flag). Forcing OSDetachThread()...");
|
||||
__OSUnlockScheduler();
|
||||
OSDetachThread(thread);
|
||||
__OSLockScheduler();
|
||||
|
|
|
@ -282,7 +282,7 @@ namespace GX2
|
|||
}
|
||||
else
|
||||
{
|
||||
forceLog_printf("GX2PatchDisplayList(): unsupported patchType %d", (uint32)patchType);
|
||||
cemuLog_log(LogType::Force, "GX2PatchDisplayList(): unsupported patchType {}", (uint32)patchType);
|
||||
cemu_assert_debug(false);
|
||||
}
|
||||
}
|
||||
|
@ -305,4 +305,4 @@ namespace GX2
|
|||
cafeExportRegister("gx2", GX2PatchDisplayList, LogType::GX2);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -133,7 +133,7 @@ namespace GX2
|
|||
{
|
||||
if ((size_t)eventType >= GX2CallbackEventTypeCount)
|
||||
{
|
||||
forceLog_printf("GX2SetEventCallback(): Unknown eventType\n");
|
||||
cemuLog_log(LogType::Force, "GX2SetEventCallback(): Unknown eventType");
|
||||
return;
|
||||
}
|
||||
s_eventCallback[(size_t)eventType].callbackFuncPtr = callbackFuncPtr;
|
||||
|
@ -144,7 +144,7 @@ namespace GX2
|
|||
{
|
||||
if ((size_t)eventType >= GX2CallbackEventTypeCount)
|
||||
{
|
||||
forceLog_printf("GX2GetEventCallback(): Unknown eventType\n");
|
||||
cemuLog_log(LogType::Force, "GX2GetEventCallback(): Unknown eventType");
|
||||
return;
|
||||
}
|
||||
if (callbackFuncPtrOut)
|
||||
|
@ -308,4 +308,4 @@ namespace GX2
|
|||
coreinit::OSInitEvent(s_updateRetirementEvent, coreinit::OSEvent::EVENT_STATE::STATE_NOT_SIGNALED, coreinit::OSEvent::EVENT_MODE::MODE_AUTO);
|
||||
coreinit::OSInitSemaphore(s_eventCbQueueSemaphore, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ void gx2Export_GX2SetSwapInterval(PPCInterpreter_t* hCPU)
|
|||
gx2Log_printf("GX2SetSwapInterval(%d)\n", hCPU->gpr[3]);
|
||||
if( hCPU->gpr[3] >= 20 )
|
||||
{
|
||||
forceLog_printf("GX2SetSwapInterval() called with out of range value (%d)\n", hCPU->gpr[3]);
|
||||
cemuLog_log(LogType::Force, "GX2SetSwapInterval() called with out of range value ({})", hCPU->gpr[3]);
|
||||
}
|
||||
else
|
||||
LatteGPUState.sharedArea->swapInterval = hCPU->gpr[3];
|
||||
|
|
|
@ -577,7 +577,7 @@ namespace H264
|
|||
WORD32 status = ih264d_api_function(m_codecCtx, &s_dec_ip, &s_dec_op);
|
||||
if (status != 0)
|
||||
{
|
||||
forceLog_printf("H264: Unable to determine buffer sizes for stream");
|
||||
cemuLog_log(LogType::Force, "H264: Unable to determine buffer sizes for stream");
|
||||
return false;
|
||||
}
|
||||
numByteConsumed = s_dec_op.u4_num_bytes_consumed;
|
||||
|
|
|
@ -167,7 +167,7 @@ void micExport_MICInit(PPCInterpreter_t* hCPU)
|
|||
}
|
||||
catch (std::runtime_error& ex)
|
||||
{
|
||||
forceLog_printf("can't initialize audio input: %s", ex.what());
|
||||
cemuLog_log(LogType::Force, "can't initialize audio input: {}", ex.what());
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
@ -467,4 +467,4 @@ namespace mic
|
|||
osLib_addFunction("mic", "MICSetState", micExport_MICSetState);
|
||||
osLib_addFunction("mic", "MICSetDataConsumed", micExport_MICSetDataConsumed);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
|
|
@ -1497,7 +1497,7 @@ void nnBossNsDataExport_DeleteRealFileWithHistory(PPCInterpreter_t* hCPU)
|
|||
if (nsData->storage.storageKind == nn::boss::kStorageKind_NBDL)
|
||||
{
|
||||
// todo
|
||||
forceLog_printf("BOSS NBDL: Unsupported delete");
|
||||
cemuLog_log(LogType::Force, "BOSS NBDL: Unsupported delete");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1505,7 +1505,7 @@ void nnBossNsDataExport_DeleteRealFileWithHistory(PPCInterpreter_t* hCPU)
|
|||
std::string filePath = nnBossNsDataExport_GetPath(nsData).c_str();
|
||||
fsc_remove((char*)filePath.c_str(), &fscStatus);
|
||||
if (fscStatus != 0)
|
||||
forceLog_printf("Unhandeled FSC status in BOSS DeleteRealFileWithHistory()");
|
||||
cemuLog_log(LogType::Force, "Unhandeled FSC status in BOSS DeleteRealFileWithHistory()");
|
||||
}
|
||||
osLib_returnFromFunction(hCPU, 0);
|
||||
}
|
||||
|
@ -1551,7 +1551,7 @@ void nnBossNsDataExport_getSize(PPCInterpreter_t* hCPU)
|
|||
bossStorageFadEntry_t fadEntry;
|
||||
if (nnBossStorageFad_getEntryByName(&nsData->storage, nsData->name, &fadEntry) == false)
|
||||
{
|
||||
forceLog_printf("BOSS storage cant find file %s", nsData->name);
|
||||
cemuLog_log(LogType::Force, "BOSS storage cant find file {}", nsData->name);
|
||||
osLib_returnFromFunction(hCPU, 0);
|
||||
return;
|
||||
}
|
||||
|
@ -1566,7 +1566,7 @@ void nnBossNsDataExport_getSize(PPCInterpreter_t* hCPU)
|
|||
|
||||
if (fscStorageFile == nullptr)
|
||||
{
|
||||
forceLog_printf("BOSS storage cant open file alias %s", nsData->name);
|
||||
cemuLog_log(LogType::Force, "BOSS storage cant open file alias {}", nsData->name);
|
||||
osLib_returnFromFunction(hCPU, 0);
|
||||
return;
|
||||
}
|
||||
|
@ -1586,7 +1586,7 @@ uint32 nnBossNsData_read(nsData_t* nsData, uint64* sizeOutBE, void* buffer, sint
|
|||
bossStorageFadEntry_t fadEntry;
|
||||
if (nnBossStorageFad_getEntryByName(&nsData->storage, nsData->name, &fadEntry) == false)
|
||||
{
|
||||
forceLog_printf("BOSS storage cant find file %s for reading", nsData->name);
|
||||
cemuLog_log(LogType::Force, "BOSS storage cant find file {} for reading", nsData->name);
|
||||
return 0x80000000; // todo - proper error code
|
||||
}
|
||||
// open file
|
||||
|
@ -1600,7 +1600,7 @@ uint32 nnBossNsData_read(nsData_t* nsData, uint64* sizeOutBE, void* buffer, sint
|
|||
|
||||
if (!fscStorageFile)
|
||||
{
|
||||
forceLog_printf("BOSS storage cant open file alias %s for reading", nsData->name);
|
||||
cemuLog_log(LogType::Force, "BOSS storage cant open file alias {} for reading", nsData->name);
|
||||
return 0x80000000; // todo - proper error code
|
||||
}
|
||||
// get size
|
||||
|
@ -1635,7 +1635,7 @@ uint32 nnBossNsData_seek(nsData_t* nsData, uint64 seek, uint32 mode)
|
|||
bossStorageFadEntry_t fadEntry;
|
||||
if (nnBossStorageFad_getEntryByName(&nsData->storage, nsData->name, &fadEntry) == false)
|
||||
{
|
||||
forceLog_printf("BOSS storage cant find file %s for reading", nsData->name);
|
||||
cemuLog_log(LogType::Force, "BOSS storage cant find file {} for reading", nsData->name);
|
||||
return 0x80000000; // todo - proper error code
|
||||
}
|
||||
// open file
|
||||
|
@ -1649,7 +1649,7 @@ uint32 nnBossNsData_seek(nsData_t* nsData, uint64 seek, uint32 mode)
|
|||
|
||||
if (fscStorageFile == nullptr)
|
||||
{
|
||||
forceLog_printf("BOSS storage cant open file alias %s for reading", nsData->name);
|
||||
cemuLog_log(LogType::Force, "BOSS storage cant open file alias {} for reading", nsData->name);
|
||||
return 0x80000000; // todo - proper error code
|
||||
}
|
||||
// get size
|
||||
|
@ -1801,4 +1801,4 @@ void nnBoss_load()
|
|||
osLib_addFunction("nn_boss", "Read__Q3_2nn4boss6NsDataFPLPvUi", nnBossNsDataExport_readWithSizeOut);
|
||||
osLib_addFunction("nn_boss", "Seek__Q3_2nn4boss6NsDataFLQ3_2nn4boss12PositionBase", nnBossNsDataExport_seek);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -473,7 +473,7 @@ namespace nn
|
|||
}
|
||||
if (joinFlagMask == 0x65 || joinFlagMask == 0x66)
|
||||
{
|
||||
forceLog_printf("Unsupported friend invite");
|
||||
cemuLog_log(LogType::Force, "Unsupported friend invite");
|
||||
}
|
||||
|
||||
osLib_returnFromFunction(hCPU, 0);
|
||||
|
|
|
@ -89,12 +89,12 @@ namespace nn
|
|||
nnIdbeHeader_t* idbeHeader = (nnIdbeHeader_t*)iconInput;
|
||||
if (idbeHeader->formatVersion != 0)
|
||||
{
|
||||
forceLog_printf("idbe header version unknown (%d)", (sint32)idbeHeader->formatVersion);
|
||||
cemuLog_log(LogType::Force, "idbe header version unknown ({})", (sint32)idbeHeader->formatVersion);
|
||||
return false;
|
||||
}
|
||||
if (idbeHeader->keyIndex >= 4)
|
||||
{
|
||||
forceLog_printf("idbe header key count invalid (%d)", (sint32)idbeHeader->keyIndex);
|
||||
cemuLog_log(LogType::Force, "idbe header key count invalid ({})", (sint32)idbeHeader->keyIndex);
|
||||
return false;
|
||||
}
|
||||
// decrypt data
|
||||
|
@ -175,4 +175,4 @@ namespace nn
|
|||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -214,9 +214,9 @@ void amiiboDecrypt()
|
|||
bool isValidTagHMAC = memcmp(nfp_data.amiiboNFCData.tagHMAC, nfp_data.amiiboInternal.tagHMAC, 32) == 0;
|
||||
bool isValidDataHMAC = memcmp(nfp_data.amiiboNFCData.dataHMAC, nfp_data.amiiboInternal.dataHMAC, 32) == 0;
|
||||
if (!isValidTagHMAC)
|
||||
forceLog_printf("Decrypt amiibo has invalid tag HMAC");
|
||||
cemuLog_log(LogType::Force, "Decrypt amiibo has invalid tag HMAC");
|
||||
if (!isValidDataHMAC)
|
||||
forceLog_printf("Decrypt amiibo has invalid data HMAC");
|
||||
cemuLog_log(LogType::Force, "Decrypt amiibo has invalid data HMAC");
|
||||
nfp_data.hasInvalidHMAC = !isValidTagHMAC || !isValidDataHMAC;
|
||||
}
|
||||
|
||||
|
|
|
@ -667,7 +667,7 @@ void nnNfpExport_CreateApplicationArea(PPCInterpreter_t* hCPU)
|
|||
// this API forces a flush (unsure, but without this data written by Smash doesn't stick)
|
||||
if (!nnNfp_writeCurrentAmiibo())
|
||||
{
|
||||
forceLog_printf("Failed to write Amiibo file data when trying to remove appArea");
|
||||
cemuLog_log(LogType::Force, "Failed to write Amiibo file data when trying to remove appArea");
|
||||
osLib_returnFromFunction(hCPU, BUILD_NN_RESULT(NN_RESULT_LEVEL_STATUS, NN_RESULT_MODULE_NN_NFP, 0));
|
||||
return;
|
||||
}
|
||||
|
@ -697,7 +697,7 @@ void nnNfpExport_DeleteApplicationArea(PPCInterpreter_t* hCPU)
|
|||
// this API forces a flush
|
||||
if (!nnNfp_writeCurrentAmiibo())
|
||||
{
|
||||
forceLog_printf("Failed to write Amiibo file data when trying to remove appArea");
|
||||
cemuLog_log(LogType::Force, "Failed to write Amiibo file data when trying to remove appArea");
|
||||
osLib_returnFromFunction(hCPU, BUILD_NN_RESULT(NN_RESULT_LEVEL_STATUS, NN_RESULT_MODULE_NN_NFP, 0));
|
||||
return;
|
||||
}
|
||||
|
@ -712,14 +712,14 @@ void nnNfpExport_Flush(PPCInterpreter_t* hCPU)
|
|||
// write Amiibo data
|
||||
if (nfp_data.isReadOnly)
|
||||
{
|
||||
forceLog_printf("Cannot write to Amiibo when it is mounted in read-only mode");
|
||||
cemuLog_log(LogType::Force, "Cannot write to Amiibo when it is mounted in read-only mode");
|
||||
osLib_returnFromFunction(hCPU, BUILD_NN_RESULT(NN_RESULT_LEVEL_STATUS, NN_RESULT_MODULE_NN_NFP, 0));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!nnNfp_writeCurrentAmiibo())
|
||||
{
|
||||
forceLog_printf("Failed to write Amiibo data");
|
||||
cemuLog_log(LogType::Force, "Failed to write Amiibo data");
|
||||
osLib_returnFromFunction(hCPU, BUILD_NN_RESULT(NN_RESULT_LEVEL_STATUS, NN_RESULT_MODULE_NN_NFP, 0));
|
||||
return;
|
||||
}
|
||||
|
@ -837,7 +837,7 @@ bool nnNfp_touchNfcTagFromFile(const wchar_t* filePath, uint32* nfcError)
|
|||
|
||||
if (serialCheckByte0 != bcc0 || serialCheckByte1 != bcc1)
|
||||
{
|
||||
forceLog_printf("nn_nfp: Mismatch in serial checksum of scanned NFC tag");
|
||||
cemuLog_log(LogType::Force, "nn_nfp: Mismatch in serial checksum of scanned NFC tag");
|
||||
}
|
||||
nfp_data.amiiboProcessedData.uidLength = 7;
|
||||
memcpy(nfp_data.amiiboProcessedData.uid, serialNumber, 7);
|
||||
|
|
|
@ -205,7 +205,7 @@ namespace nn
|
|||
|
||||
uint32 UploadPostDataByPostApp(void *postParam)
|
||||
{
|
||||
forceLog_printf("UploadPostDataByPostApp() called. Returning error");
|
||||
cemuLog_log(LogType::Force, "UploadPostDataByPostApp() called. Returning error");
|
||||
return BUILD_NN_RESULT(NN_RESULT_LEVEL_STATUS, NN_RESULT_MODULE_NN_OLV, 0); // undefined error
|
||||
}
|
||||
|
||||
|
@ -226,4 +226,4 @@ namespace nn
|
|||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -165,7 +165,7 @@ namespace nsyshid
|
|||
HIDDevice_t* hidDevice = getFreeDevice();
|
||||
if (hidDevice == nullptr)
|
||||
{
|
||||
forceLog_printf("HID: Maximum number of supported devices exceeded");
|
||||
cemuLog_log(LogType::Force, "HID: Maximum number of supported devices exceeded");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -194,12 +194,12 @@ namespace nsyshid
|
|||
}
|
||||
if (maxPacketInputLength <= 0 || maxPacketInputLength >= 0xF000)
|
||||
{
|
||||
forceLog_printf("HID: Input packet length not available or out of range (length = %d)", maxPacketInputLength);
|
||||
cemuLog_log(LogType::Force, "HID: Input packet length not available or out of range (length = {})", maxPacketInputLength);
|
||||
maxPacketInputLength = 0x20;
|
||||
}
|
||||
if (maxPacketOutputLength <= 0 || maxPacketOutputLength >= 0xF000)
|
||||
{
|
||||
forceLog_printf("HID: Output packet length not available or out of range (length = %d)", maxPacketOutputLength);
|
||||
cemuLog_log(LogType::Force, "HID: Output packet length not available or out of range (length = {})", maxPacketOutputLength);
|
||||
maxPacketOutputLength = 0x20;
|
||||
}
|
||||
// setup HIDDevice struct
|
||||
|
@ -487,7 +487,7 @@ namespace nsyshid
|
|||
retryCount++;
|
||||
if (retryCount >= 40)
|
||||
{
|
||||
forceLog_printf("HID async SetReport failed");
|
||||
cemuLog_log(LogType::Force, "HID async SetReport failed");
|
||||
sint32 errorCode = -1;
|
||||
doHIDTransferCallback(callbackFuncMPTR, callbackParamMPTR, hidDeviceInfo->handle, errorCode, memory_getVirtualOffsetFromPointer(originalData), 0);
|
||||
free(reportData);
|
||||
|
@ -545,7 +545,7 @@ namespace nsyshid
|
|||
HIDDeviceInfo_t* hidDeviceInfo = getHIDDeviceInfoByHandle(hidHandle, true);
|
||||
if (hidDeviceInfo == nullptr)
|
||||
{
|
||||
forceLog_printf("nsyshid.HIDSetReport(): Unable to find device with hid handle %d", hidHandle);
|
||||
cemuLog_log(LogType::Force, "nsyshid.HIDSetReport(): Unable to find device with hid handle {}", hidHandle);
|
||||
osLib_returnFromFunction(hCPU, -1);
|
||||
return;
|
||||
}
|
||||
|
@ -641,7 +641,7 @@ namespace nsyshid
|
|||
}
|
||||
else
|
||||
{
|
||||
forceLog_printf("Failed HID read");
|
||||
cemuLog_log(LogType::Force, "Failed HID read");
|
||||
returnCode = -1;
|
||||
}
|
||||
free(tempBuffer);
|
||||
|
@ -677,7 +677,7 @@ namespace nsyshid
|
|||
HIDDeviceInfo_t* hidDeviceInfo = getHIDDeviceInfoByHandle(hidHandle, true);
|
||||
if (hidDeviceInfo == nullptr)
|
||||
{
|
||||
forceLog_printf("nsyshid.HIDRead(): Unable to find device with hid handle %d", hidHandle);
|
||||
cemuLog_log(LogType::Force, "nsyshid.HIDRead(): Unable to find device with hid handle {}", hidHandle);
|
||||
osLib_returnFromFunction(hCPU, -1);
|
||||
return;
|
||||
}
|
||||
|
@ -776,7 +776,7 @@ namespace nsyshid
|
|||
HIDDeviceInfo_t* hidDeviceInfo = getHIDDeviceInfoByHandle(hidHandle, true);
|
||||
if (hidDeviceInfo == nullptr)
|
||||
{
|
||||
forceLog_printf("nsyshid.HIDWrite(): Unable to find device with hid handle %d", hidHandle);
|
||||
cemuLog_log(LogType::Force, "nsyshid.HIDWrite(): Unable to find device with hid handle {}", hidHandle);
|
||||
osLib_returnFromFunction(hCPU, -1);
|
||||
return;
|
||||
}
|
||||
|
@ -841,4 +841,4 @@ namespace nsyshid
|
|||
};
|
||||
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -695,7 +695,7 @@ void nsysnetExport_inet_pton(PPCInterpreter_t* hCPU)
|
|||
|
||||
if (af != 2)
|
||||
{
|
||||
forceLog_printf("inet_pton() only supports AF_INET");
|
||||
cemuLog_log(LogType::Force, "inet_pton() only supports AF_INET");
|
||||
osLib_returnFromFunction(hCPU, 0);
|
||||
return;
|
||||
}
|
||||
|
@ -848,7 +848,7 @@ void nsysnetExport_accept(PPCInterpreter_t* hCPU)
|
|||
|
||||
if (memory_readU32(lenMPTR) != 16)
|
||||
{
|
||||
forceLog_printf("invalid sockaddr len in accept()");
|
||||
cemuLog_log(LogType::Force, "invalid sockaddr len in accept()");
|
||||
cemu_assert_debug(false);
|
||||
osLib_returnFromFunction(hCPU, 0);
|
||||
return;
|
||||
|
@ -873,7 +873,7 @@ void nsysnetExport_accept(PPCInterpreter_t* hCPU)
|
|||
else
|
||||
{
|
||||
// blocking accept is not supported yet
|
||||
forceLog_printf("blocking accept() not supported");
|
||||
cemuLog_log(LogType::Force, "blocking accept() not supported");
|
||||
cemu_assert_debug(false);
|
||||
}
|
||||
|
||||
|
@ -901,7 +901,7 @@ void nsysnetExport_connect(PPCInterpreter_t* hCPU)
|
|||
hostAddr.sa_family = _swapEndianU16(addr->sa_family);
|
||||
memcpy(hostAddr.sa_data, addr->sa_data, 14);
|
||||
sint32 hr = connect(vs->s, &hostAddr, sizeof(sockaddr));
|
||||
forceLog_printf("Attempt connect to %d.%d.%d.%d:%d", (sint32)(uint8)hostAddr.sa_data[2], (sint32)(uint8)hostAddr.sa_data[3], (sint32)(uint8)hostAddr.sa_data[4], (sint32)(uint8)hostAddr.sa_data[5], _swapEndianU16(*(uint16*)hostAddr.sa_data+0));
|
||||
cemuLog_log(LogType::Force, "Attempt connect to {}.{}.{}.{}:{}", (sint32)(uint8)hostAddr.sa_data[2], (sint32)(uint8)hostAddr.sa_data[3], (sint32)(uint8)hostAddr.sa_data[4], (sint32)(uint8)hostAddr.sa_data[5], _swapEndianU16(*(uint16*)hostAddr.sa_data+0));
|
||||
|
||||
r = _translateError(hr, GETLASTERR, _ERROR_MODE_CONNECT);
|
||||
|
||||
|
@ -1182,7 +1182,7 @@ void nsysnetExport_select(PPCInterpreter_t* hCPU)
|
|||
break;
|
||||
}
|
||||
}
|
||||
//forceLog_printf("selectEndTime %d", timeGetTime());
|
||||
//cemuLog_log(LogType::Force, "selectEndTime {}", timeGetTime());
|
||||
|
||||
|
||||
//extern int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
|
||||
|
@ -1353,7 +1353,7 @@ void nsysnetExport_gethostbyaddr(PPCInterpreter_t* hCPU)
|
|||
}
|
||||
else
|
||||
{
|
||||
forceLog_printf("he->h_name not set or name too long");
|
||||
cemuLog_log(LogType::Force, "he->h_name not set or name too long");
|
||||
strcpy(_staticHostentName.GetPtr(), "");
|
||||
}
|
||||
// setup wuHostent address list
|
||||
|
|
|
@ -262,7 +262,7 @@ namespace snd_core
|
|||
if (numberOfDecodedAdpcmSamples >= 4096)
|
||||
{
|
||||
memset(output, 0, sizeof(float)*sampleCount);
|
||||
forceLog_printf("Too many ADPCM samples to decode. ratio = %08x", ratio);
|
||||
cemuLog_log(LogType::Force, "Too many ADPCM samples to decode. ratio = {:08x}", ratio);
|
||||
return;
|
||||
}
|
||||
AX_readADPCMSamples(internalShadowCopy, adpcmSampleBuffer, numberOfDecodedAdpcmSamples);
|
||||
|
|
|
@ -436,7 +436,7 @@ namespace snd_core
|
|||
}
|
||||
catch (std::runtime_error& ex)
|
||||
{
|
||||
forceLog_printf("can't initialize tv audio: %s", ex.what());
|
||||
cemuLog_log(LogType::Force, "can't initialize tv audio: {}", ex.what());
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
@ -477,7 +477,7 @@ namespace snd_core
|
|||
}
|
||||
catch (std::runtime_error& ex)
|
||||
{
|
||||
forceLog_printf("can't initialize pad audio: %s", ex.what());
|
||||
cemuLog_log(LogType::Force, "can't initialize pad audio: {}", ex.what());
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
@ -574,4 +574,4 @@ namespace snd_core
|
|||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -233,13 +233,13 @@ namespace snd_core
|
|||
{
|
||||
if (voice == nullptr)
|
||||
{
|
||||
forceLog_printf("AXVoiceBegin(): Invalid voice");
|
||||
cemuLog_log(LogType::Force, "AXVoiceBegin(): Invalid voice");
|
||||
return -1;
|
||||
}
|
||||
uint32 index = (uint32)voice->index;
|
||||
if (index >= AX_MAX_VOICES)
|
||||
{
|
||||
forceLog_printf("AXVoiceBegin(): Invalid voice index");
|
||||
cemuLog_log(LogType::Force, "AXVoiceBegin(): Invalid voice index");
|
||||
return -1;
|
||||
}
|
||||
if (AXIst_IsFrameBeingProcessed())
|
||||
|
@ -273,13 +273,13 @@ namespace snd_core
|
|||
{
|
||||
if (voice == nullptr)
|
||||
{
|
||||
forceLog_printf("AXVoiceBegin(): Invalid voice");
|
||||
cemuLog_log(LogType::Force, "AXVoiceBegin(): Invalid voice");
|
||||
return -1;
|
||||
}
|
||||
uint32 index = (uint32)voice->index;
|
||||
if (index >= AX_MAX_VOICES)
|
||||
{
|
||||
forceLog_printf("AXVoiceBegin(): Invalid voice index");
|
||||
cemuLog_log(LogType::Force, "AXVoiceBegin(): Invalid voice index");
|
||||
return -1;
|
||||
}
|
||||
if (AXIst_IsFrameBeingProcessed())
|
||||
|
@ -428,7 +428,7 @@ namespace snd_core
|
|||
__AXVoiceListSpinlock.lock();
|
||||
if (vpb->priority == (uint32be)AX_PRIORITY_FREE)
|
||||
{
|
||||
forceLog_printf("AXFreeVoice() called on free voice\n");
|
||||
cemuLog_log(LogType::Force, "AXFreeVoice() called on free voice");
|
||||
__AXVoiceListSpinlock.unlock();
|
||||
return;
|
||||
}
|
||||
|
@ -692,7 +692,7 @@ namespace snd_core
|
|||
}
|
||||
else
|
||||
{
|
||||
forceLog_printf("AXSetVoiceSrcType(): Unsupported src type %d", srcType);
|
||||
cemuLog_log(LogType::Force, "AXSetVoiceSrcType(): Unsupported src type {}", srcType);
|
||||
}
|
||||
AXSetSyncFlag(vpb, AX_SYNCFLAG_SRCFILTER);
|
||||
AXVoiceProtection_Acquire(vpb);
|
||||
|
@ -843,7 +843,7 @@ namespace snd_core
|
|||
MPTR sampleBase = _swapEndianU32(pbOffset->samples);
|
||||
if (sampleBase == MPTR_NULL)
|
||||
{
|
||||
forceLog_printf("AXSetVoiceOffsets(): Invalid sample address");
|
||||
cemuLog_log(LogType::Force, "AXSetVoiceOffsets(): Invalid sample address");
|
||||
cemu_assert_debug(false);
|
||||
return;
|
||||
}
|
||||
|
@ -1283,4 +1283,4 @@ namespace snd_core
|
|||
cafeExportRegister("sndcore2", AXGetVoiceOffsets, LogType::SoundAPI);
|
||||
cafeExportRegister("sndcore2", AXGetVoiceCurrentOffsetEx, LogType::SoundAPI);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -453,7 +453,7 @@ void sysappExport__SYSLaunchMiiStudio(PPCInterpreter_t* hCPU)
|
|||
void sysappExport__SYSReturnToCallerWithStandardResult(PPCInterpreter_t* hCPU)
|
||||
{
|
||||
ppcDefineParamU32BEPtr(resultPtr, 0);
|
||||
forceLog_printf("_SYSReturnToCallerWithStandardResult(0x%08x) result: 0x%08x", hCPU->gpr[3], (uint32)*resultPtr);
|
||||
cemuLog_log(LogType::Force, "_SYSReturnToCallerWithStandardResult(0x{:08x}) result: 0x{:08x}", hCPU->gpr[3], (uint32)*resultPtr);
|
||||
while (true) std::this_thread::sleep_for(std::chrono::milliseconds(10));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue