Migrate force_log_printf to new logging (#714)

This commit is contained in:
why-keith 2023-04-12 15:31:34 +01:00 committed by GitHub
parent 072c18a6e3
commit 4be57f4896
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
108 changed files with 401 additions and 399 deletions

View File

@ -166,7 +166,7 @@ std::error_code Account::Load()
}
catch(const std::exception& ex)
{
forceLog_printf("handled error in Account::Load: %s", ex.what());
cemuLog_log(LogType::Force, "handled error in Account::Load: {}", ex.what());
return AccountErrc::ParseError;
}
}
@ -347,7 +347,7 @@ void Account::UpdatePersisidDat()
f.close();
}
else
forceLog_printf("Unable to save persisid.dat");
cemuLog_log(LogType::Force, "Unable to save persisid.dat");
}
bool Account::HasFreeAccountSlots()

View File

@ -133,7 +133,7 @@ void LoadMainExecutable()
// otherwise search for first file with .rpx extension in the code folder
if (!ScanForRPX())
{
forceLog_printf("Unable to find RPX executable");
cemuLog_log(LogType::Force, "Unable to find RPX executable");
cemuLog_waitForFlush();
cemu_assert(false);
}
@ -143,7 +143,7 @@ void LoadMainExecutable()
uint8* rpxData = fsc_extractFile(_pathToExecutable.c_str(), &rpxSize);
if (rpxData == nullptr)
{
forceLog_printf("Failed to load \"%s\"", _pathToExecutable.c_str());
cemuLog_log(LogType::Force, "Failed to load \"{}\"", _pathToExecutable);
cemuLog_waitForFlush();
cemu_assert(false);
}
@ -383,7 +383,7 @@ void cemu_initForGame()
RPLLoader_Link();
RPLLoader_NotifyControlPassedToApplication();
uint32 linkTime = GetTickCount() - linkTimeStart;
forceLog_printf("RPL link time: %dms", linkTime);
cemuLog_log(LogType::Force, "RPL link time: {}ms", linkTime);
// for HBL ELF: Setup OS-specifics struct
if (isLaunchTypeELF)
{
@ -406,13 +406,13 @@ void cemu_initForGame()
}
debugger_handleEntryBreakpoint(_entryPoint);
// load graphic packs
forceLog_printf("------- Activate graphic packs -------");
cemuLog_log(LogType::Force, "------- Activate graphic packs -------");
GraphicPack2::ActivateForCurrentTitle();
// print audio log
IAudioAPI::PrintLogging();
IAudioInputAPI::PrintLogging();
// everything initialized
forceLog_printf("------- Run title -------");
cemuLog_log(LogType::Force, "------- Run title -------");
// wait till GPU thread is initialized
while (g_isGPUInitFinished == false) std::this_thread::sleep_for(std::chrono::milliseconds(50));
// init initial thread

View File

@ -300,7 +300,7 @@ void GamePatch_scan()
if( hleAddr )
{
#ifdef CEMU_DEBUG_ASSERT
forceLog_printf("HLE: XCX GPU hang detection");
cemuLog_log(LogType::Force, "HLE: XCX GPU hang detection");
#endif
// remove the ADDI r25, r25, 1 instruction
memory_writeU32(hleAddr, memory_readU32(hleAddr+4));
@ -310,7 +310,7 @@ void GamePatch_scan()
if( hleAddr )
{
#ifdef CEMU_DEBUG_ASSERT
forceLog_printf("HLE: Prevent XCX rendertarget reduction");
cemuLog_log(LogType::Force, "HLE: Prevent XCX rendertarget reduction");
#endif
uint32 bl = memory_readU32(hleAddr+0x14);
uint32 func_isReductionBuffer = hleAddr + 0x14 + (bl&0x3FFFFFC);
@ -326,7 +326,7 @@ void GamePatch_scan()
if (hleAddr)
{
#ifdef CEMU_DEBUG_ASSERT
forceLog_printf("HLE: Patch BotW busy loop 1 at 0x%08x", hleAddr);
cemuLog_log(LogType::Force, "HLE: Patch BotW busy loop 1 at 0x{:08x}", hleAddr);
#endif
sint32 functionIndex = hleIndex_h000000001;
uint32 opcode = (1 << 26) | (functionIndex); // opcode for HLE: 0x1000 + FunctionIndex
@ -337,7 +337,7 @@ void GamePatch_scan()
if (hleAddr)
{
#ifdef CEMU_DEBUG_ASSERT
forceLog_printf("HLE: Patch BotW busy loop 2 at 0x%08x", hleAddr);
cemuLog_log(LogType::Force, "HLE: Patch BotW busy loop 2 at 0x{:08x}", hleAddr);
#endif
sint32 functionIndex = hleIndex_h000000002;
uint32 opcode = (1 << 26) | (functionIndex); // opcode for HLE: 0x1000 + FunctionIndex
@ -372,7 +372,7 @@ void GamePatch_scan()
if (hleAddr)
{
uint32 patchAddr = hleAddr + 0x10;
forceLog_printf("HLE: Patch MH3U race condition candidate at 0x%08x", patchAddr);
cemuLog_log(LogType::Force, "HLE: Patch MH3U race condition candidate at 0x{:08x}", patchAddr);
uint32 funcAddr = PPCInterpreter_makeCallableExportDepr(hleExport_mh3u_raceConditionWorkaround);
// set absolute jump
uint32 opc = 0x48000000;
@ -411,7 +411,7 @@ void GamePatch_scan()
if (hleAddr)
{
// replace CMPL with CMP
forceLog_printf("Patching Bayonetta 2 audio bug at: 0x%08x", hleAddr+0x34);
cemuLog_log(LogType::Force, "Patching Bayonetta 2 audio bug at: 0x{:08x}", hleAddr+0x34);
uint32 opc = memory_readU32(hleAddr + 0x34);
opc &= ~(0x3FF << 1); // turn CMPL to CMP
memory_writeU32(hleAddr + 0x34, opc);
@ -444,7 +444,7 @@ void GamePatch_scan()
hleAddr = hle_locate(sm3dw_dynFrameBufferResScale, nullptr, sizeof(sm3dw_dynFrameBufferResScale));
if (hleAddr)
{
forceLog_printf("Patching SM3DW dynamic resolution scaling at: 0x%08x", hleAddr);
cemuLog_log(LogType::Force, "Patching SM3DW dynamic resolution scaling at: 0x{:08x}", hleAddr);
memory_writeU32(hleAddr, 0x4E800020); // BLR
}
@ -453,7 +453,7 @@ void GamePatch_scan()
hleAddr = hle_locate(tww_waitFunc, nullptr, sizeof(tww_waitFunc));
if (hleAddr)
{
forceLog_printf("Patching TWW race conditon at: 0x%08x", hleAddr);
cemuLog_log(LogType::Force, "Patching TWW race conditon at: 0x{:08x}", hleAddr);
// NOP calls to Lock/Unlock mutex
memory_writeU32(hleAddr + 0x34, 0x60000000);
memory_writeU32(hleAddr + 0x48, 0x60000000);
@ -462,7 +462,7 @@ void GamePatch_scan()
}
uint32 hleInstallEnd = GetTickCount();
forceLog_printf("HLE scan time: %dms", hleInstallEnd-hleInstallStart);
cemuLog_log(LogType::Force, "HLE scan time: {}ms", hleInstallEnd-hleInstallStart);
}
RunAtCemuBoot _loadGamePatchAPI([]()

View File

@ -173,7 +173,7 @@ void GraphicPack2::ActivateForCurrentTitle()
{
if (gp->GetPresets().empty())
{
forceLog_printf("Activate graphic pack: %s", gp->GetPath().c_str());
cemuLog_log(LogType::Force, "Activate graphic pack: {}", gp->GetPath());
}
else
{
@ -720,7 +720,7 @@ void GraphicPack2::LoadShaders()
}
catch (const std::exception& ex)
{
forceLog_printf("graphicPack: error while loading custom shader: %s", ex.what());
cemuLog_log(LogType::Force, "graphicPack: error while loading custom shader: {}", ex.what());
}
}
}
@ -743,7 +743,7 @@ bool GraphicPack2::IsPresetVisible(const PresetPtr& preset) const
}
catch (const std::exception& ex)
{
forceLog_printf("error when trying to check visiblity of preset: %s", ex.what());
cemuLog_log(LogType::Force, "error when trying to check visiblity of preset: {}", ex.what());
return false;
}
}
@ -974,7 +974,7 @@ bool GraphicPack2::Activate()
}
catch(const std::exception& ex)
{
forceLog_printf((char*)ex.what());
cemuLog_log(LogType::Force, ex.what());
return false;
}
@ -998,11 +998,11 @@ bool GraphicPack2::Activate()
if (LatteTiming_getCustomVsyncFrequency(globalCustomVsyncFreq))
{
if (customVsyncFreq != globalCustomVsyncFreq)
forceLog_printf("rules.txt error: Mismatching vsync frequency %d in graphic pack \'%s\'", customVsyncFreq, GetPath().c_str());
cemuLog_log(LogType::Force, "rules.txt error: Mismatching vsync frequency {} in graphic pack \'{}\'", customVsyncFreq, GetPath());
}
else
{
forceLog_printf("Set vsync frequency to %d (graphic pack %s)", customVsyncFreq, GetPath().c_str());
cemuLog_log(LogType::Force, "Set vsync frequency to {} (graphic pack {})", customVsyncFreq, GetPath());
LatteTiming_setCustomVsyncFrequency(customVsyncFreq);
}
}

View File

@ -353,7 +353,7 @@ PATCH_RESOLVE_RESULT PatchEntryInstruction::resolveReloc(PatchContext_t& ctx, PP
// absolute
if (result >= 0x3FFFFFC)
{
forceLog_printf("Target \'%s\' for branch at line %d out of range", reloc->m_expression.c_str(), m_lineNumber);
cemuLog_log(LogType::Force, "Target \'{}\' for branch at line {} out of range", reloc->m_expression, m_lineNumber);
return PATCH_RESOLVE_RESULT::VALUE_ERROR;
}
opcode &= ~0x3FFFFFC;
@ -438,7 +438,7 @@ PATCH_RESOLVE_RESULT PatchEntryInstruction::resolve(PatchContext_t& ctx)
{
if (_relocateAddress(resolverState.currentGroup, &ctx, m_addr, m_relocatedAddr) == false)
{
forceLog_printf("Patches: Address 0x%08x (line %d) is not within code cave or any module section", this->getAddr(), this->m_lineNumber);
cemuLog_log(LogType::Force, "Patches: Address 0x{:08x} (line {}) is not within code cave or any module section", this->getAddr(), this->m_lineNumber);
cemu_assert_debug(false);
return PATCH_RESOLVE_RESULT::INVALID_ADDRESS;
}
@ -639,12 +639,12 @@ void GraphicPack2::ApplyPatchGroups(std::vector<PatchGroup*>& groups, const RPLM
if (patchGroup->codeCaveSize > 0)
{
auto codeCaveMem = RPLLoader_AllocateCodeCaveMem(256, patchGroup->codeCaveSize);
forceLog_printf("Applying patch group \'%s\' (Codecave: %08x-%08x)", patchGroup->name.c_str(), codeCaveMem.GetMPTR(), codeCaveMem.GetMPTR() + patchGroup->codeCaveSize);
cemuLog_log(LogType::Force, "Applying patch group \'{}\' (Codecave: {:08x}-{:08x})", patchGroup->name, codeCaveMem.GetMPTR(), codeCaveMem.GetMPTR() + patchGroup->codeCaveSize);
patchGroup->codeCaveMem = codeCaveMem;
}
else
{
forceLog_printf("Applying patch group \'%s\'", patchGroup->name.c_str());
cemuLog_log(LogType::Force, "Applying patch group \'{}\'", patchGroup->name);
patchGroup->codeCaveMem = nullptr;
}
}

View File

@ -68,7 +68,7 @@ void GraphicPack2::AddPatchGroup(PatchGroup* group)
if (group->list_patches.size() < (numEstimatedCodeCaveInstr / 8))
{
// if less than 1/8th of the code cave is filled print a warning
forceLog_printf("Graphic pack patches: Code cave for group [%s] in gfx pack \"%s\" ranges from 0 to 0x%x but has only few instructions. Is this intentional?", group->name.c_str(), this->m_name.c_str(), codeCaveMaxAddr);
cemuLog_log(LogType::Force, "Graphic pack patches: Code cave for group [{}] in gfx pack \"{}\" ranges from 0 to 0x{:x} but has only few instructions. Is this intentional?", group->name, this->m_name, codeCaveMaxAddr);
}
group->codeCaveSize = codeCaveMaxAddr;
list_patchGroups.emplace_back(group);

View File

@ -515,7 +515,7 @@ void PPCInterpreter_MTFSF(PPCInterpreter_t* hCPU, uint32 Opcode)
static bool logFPSCRWriteOnce = false;
if( logFPSCRWriteOnce == false )
{
forceLog_printf("Unsupported write to FPSCR\n");
cemuLog_log(LogType::Force, "Unsupported write to FPSCR");
logFPSCRWriteOnce = true;
}
PPCInterpreter_nextInstruction(hCPU);

View File

@ -60,12 +60,12 @@ uint64 PPCTimer_estimateRDTSCFrequency()
uint64 tsc_freq = muldiv64(tsc_diff, hrtFreq, hrtDiff);
// uint64 freqMultiplier = tsc_freq / hrtFreq;
//forceLog_printf("RDTSC measurement test:");
//forceLog_printf("TSC-diff: 0x%016llx", tsc_diff);
//forceLog_printf("TSC-freq: 0x%016llx", tsc_freq);
//forceLog_printf("HPC-diff: 0x%016llx", qpc_diff);
//forceLog_printf("HPC-freq: 0x%016llx", (uint64)qpc_freq.QuadPart);
//forceLog_printf("Multiplier: 0x%016llx", freqMultiplier);
//cemuLog_log(LogType::Force, "RDTSC measurement test:");
//cemuLog_log(LogType::Force, "TSC-diff: 0x{:016x}", tsc_diff);
//cemuLog_log(LogType::Force, "TSC-freq: 0x{:016x}", tsc_freq);
//cemuLog_log(LogType::Force, "HPC-diff: 0x{:016x}", qpc_diff);
//cemuLog_log(LogType::Force, "HPC-freq: 0x{:016x}", (uint64)qpc_freq.QuadPart);
//cemuLog_log(LogType::Force, "Multiplier: 0x{:016x}", freqMultiplier);
return tsc_freq;
}

View File

@ -82,7 +82,7 @@ void PPCRecompiler_enter(PPCInterpreter_t* hCPU, PPCREC_JUMP_ENTRY funcPtr)
{
auto t = std::chrono::high_resolution_clock::now();
auto dur = std::chrono::duration_cast<std::chrono::microseconds>(t.time_since_epoch()).count();
forceLog_printf("Recompiler exit: 0x%08x LR: 0x%08x Timestamp %lld.%04lld", hCPU->instructionPointer, hCPU->spr.LR, dur / 1000LL, (dur % 1000LL));
cemuLog_log(LogType::Force, "Recompiler exit: 0x{:08x} LR: 0x{:08x} Timestamp {}.{:04}", hCPU->instructionPointer, hCPU->spr.LR, dur / 1000LL, (dur % 1000LL));
}
#endif
#else
@ -341,7 +341,7 @@ void PPCRecompiler_reserveLookupTableBlock(uint32 offset)
void* p3 = MemMapper::AllocateMemory(&(ppcRecompilerInstanceData->ppcRecompilerDirectJumpTable[offset/4]), (PPC_REC_ALLOC_BLOCK_SIZE/4)*sizeof(void*), MemMapper::PAGE_PERMISSION::P_RW, true);
if( !p1 || !p3 )
{
forceLog_printf("Failed to allocate memory for recompiler (0x%08x)", offset);
cemuLog_log(LogType::Force, "Failed to allocate memory for recompiler (0x{:08x})", offset);
cemu_assert(false);
return;
}
@ -584,7 +584,7 @@ void PPCRecompiler_init()
PPCRecompiler_initPlatform();
forceLog_printf("Recompiler initialized");
cemuLog_log(LogType::Force, "Recompiler initialized");
ppcRecompilerEnabled = true;

View File

@ -643,7 +643,7 @@ bool PPCRecompilerImlGen_B(ppcImlGenContext_t* ppcImlGenContext, uint32 opcode)
{
// generate NOP iml instead of BL macro (this assures that segment PPC range remains intact)
PPCRecompilerImlGen_generateNewInstruction_noOp(ppcImlGenContext, NULL);
//forceLog_printf("Inline func 0x%08x at %08x", jumpAddressDest, ppcImlGenContext->ppcAddressOfCurrentInstruction);
//cemuLog_log(LogType::Force, "Inline func 0x{:08x} at {:08x}", jumpAddressDest, ppcImlGenContext->ppcAddressOfCurrentInstruction);
uint32* prevInstructionPtr = ppcImlGenContext->currentInstruction;
ppcImlGenContext->currentInstruction = (uint32*)memory_getPointerFromVirtualOffset(jumpAddressDest);
PPCRecompiler_generateInlinedCode(ppcImlGenContext, jumpAddressDest, inlineFuncInstructionCount);

View File

@ -871,11 +871,11 @@ public:
// retry allocation
if (!newRange->allocateCacheMemory())
{
forceLog_printf("Out-of-memory in GPU buffer (trying to allocate: %dKB) Cleaning up cache...", (rangeEnd - rangeBegin + 1023) / 1024);
cemuLog_log(LogType::Force, "Out-of-memory in GPU buffer (trying to allocate: {}KB) Cleaning up cache...", (rangeEnd - rangeBegin + 1023) / 1024);
CleanupCacheAggressive(rangeBegin, rangeEnd);
if (!newRange->allocateCacheMemory())
{
forceLog_printf("Failed to free enough memory in GPU buffer");
cemuLog_log(LogType::Force, "Failed to free enough memory in GPU buffer");
cemu_assert(false);
}
}
@ -907,7 +907,7 @@ public:
// todo - add support for splitting BufferCacheNode memory allocations, then we dont need to do a separate allocation
if (!newRange->allocateCacheMemory())
{
forceLog_printf("Out-of-memory in GPU buffer during split operation");
cemuLog_log(LogType::Force, "Out-of-memory in GPU buffer during split operation");
cemu_assert(false);
}
newRange->syncFromNode(nodeObject);

View File

@ -222,7 +222,7 @@ LatteParsedGSCopyShader* LatteGSCopyShaderParser_parse(uint8* programData, uint3
}
else
{
forceLog_printf("Copyshader: Unknown 23_7 clause 0x%x found\n", cf_inst23_7);
cemuLog_log(LogType::Force, "Copyshader: Unknown 23_7 clause 0x{:x} found", cf_inst23_7);
cemu_assert_debug(false);
}
if( isEndOfProgram )

View File

@ -507,7 +507,7 @@ bool LatteMRT::UpdateCurrentFBO()
else if (rtEffectiveSize->width != effectiveWidth && rtEffectiveSize->height != effectiveHeight)
{
#ifdef CEMU_DEBUG_ASSERT
forceLog_printf("Color buffer size mismatch (%dx%d). Effective size: %dx%d Real size: %dx%d Mismatching texture: %08x %dx%d fmt %04x", rtEffectiveSize->width, rtEffectiveSize->height, effectiveWidth, effectiveHeight, colorAttachmentView->baseTexture->width, colorAttachmentView->baseTexture->height, colorAttachmentView->baseTexture->physAddress, colorAttachmentView->baseTexture->width, colorAttachmentView->baseTexture->height, (uint32)colorAttachmentView->baseTexture->format);
cemuLog_log(LogType::Force, "Color buffer size mismatch ({}x{}). Effective size: {}x{} Real size: {}x{} Mismatching texture: {:08x} {}x{} fmt {:04x}", rtEffectiveSize->width, rtEffectiveSize->height, effectiveWidth, effectiveHeight, colorAttachmentView->baseTexture->width, colorAttachmentView->baseTexture->height, colorAttachmentView->baseTexture->physAddress, colorAttachmentView->baseTexture->width, colorAttachmentView->baseTexture->height, (uint32)colorAttachmentView->baseTexture->format);
#endif
}
// currently the first color attachment defines the size of the current render target

View File

@ -301,7 +301,7 @@ void LatteShader_CreateRendererShader(LatteDecompilerShader* shader, bool compil
{
if (shader->hasError )
{
forceLog_printf("Unable to compile shader %" PRIx64, shader->baseHash);
cemuLog_log(LogType::Force, "Unable to compile shader {:016x}", shader->baseHash);
return;
}

View File

@ -319,7 +319,7 @@ void LatteShaderCache_load()
if (LatteShaderCache_readSeparableShader(fileData.data(), fileData.size()) == false)
{
// something is wrong with the stored shader, remove entry from shader cache files
forceLog_printf("Shader cache entry %d invalid, deleting...", loadIndex);
cemuLog_log(LogType::Force, "Shader cache entry {} invalid, deleting...", loadIndex);
fc_shaderCacheGeneric->DeleteFile({ name1, name2 });
}
numLoadedShaders++;
@ -338,7 +338,7 @@ void LatteShaderCache_load()
GetProcessMemoryInfo(GetCurrentProcess(), &pmc2, sizeof(PROCESS_MEMORY_COUNTERS));
LONGLONG totalMem2 = pmc2.PagefileUsage;
LONGLONG memCommited = totalMem2 - totalMem1;
forceLog_printf("Shader cache loaded with %d shaders. Commited mem %dMB. Took %dms", numLoadedShaders, (sint32)(memCommited/1024/1024), timeLoad);
cemuLog_log(LogType::Force, "Shader cache loaded with {} shaders. Commited mem {}MB. Took {}ms", numLoadedShaders, (sint32)(memCommited/1024/1024), timeLoad);
#endif
LatteShaderCache_finish();
// if Vulkan then also load pipeline cache

View File

@ -19,7 +19,7 @@ bool gxShader_checkIfSuccessfullyLinked(GLuint glProgram)
tempLength = sizeof(infoLog)-1;
glGetProgramInfoLog(glProgram, std::min(tempLength, infoLogLength), (GLsizei*)&tempLength, (GLcharARB*)infoLog);
infoLog[tempLength] = '\0';
forceLog_printf("Link error in raw shader");
cemuLog_log(LogType::Force, "Link error in raw shader");
cemuLog_log(LogType::Force, infoLog);
return false;
}
@ -83,8 +83,8 @@ GLuint gpu7ShaderGLDepr_compileShader(const std::string& source, uint32_t type)
char log[2048]{};
GLsizei log_size;
glGetShaderInfoLog(shader_object, std::min(log_length, (GLint)sizeof(log) - 1), &log_size, log);
forceLog_printf("Error/Warning in vertex shader:");
forceLog_printf("%s", log);
cemuLog_log(LogType::Force, "Error/Warning in vertex shader:");
cemuLog_log(LogType::Force, log);
}
return shader_object;
@ -112,8 +112,8 @@ GLuint gpu7ShaderGLDepr_compileVertexShader(const char* shaderSource, sint32 sha
{
char messageLog[2048]{};
glGetShaderInfoLog(shaderObject, std::min<uint32>(shaderLogLengthInfo, sizeof(messageLog) - 1), (GLsizei*)&shaderLogLen, (GLcharARB*)messageLog);
forceLog_printf("Error/Warning in vertex shader:");
forceLog_printf("%s", messageLog);
cemuLog_log(LogType::Force, "Error/Warning in vertex shader:");
cemuLog_log(LogType::Force, messageLog);
}
return shaderObject;
}
@ -132,8 +132,8 @@ GLuint gpu7ShaderGLDepr_compileFragmentShader(const char* shaderSource, sint32 s
{
memset(messageLog, 0, sizeof(messageLog));
glGetShaderInfoLog(shaderObject, std::min<uint32>(shaderLogLengthInfo, sizeof(messageLog) - 1), (GLsizei*)&shaderLogLen, (GLcharARB*)messageLog);
forceLog_printf("Error/Warning in fragment shader:");
forceLog_printf("%s", messageLog);
cemuLog_log(LogType::Force, "Error/Warning in fragment shader:");
cemuLog_log(LogType::Force, messageLog);
}
return shaderObject;
}

View File

@ -376,13 +376,13 @@ void LatteTexture_CopySlice(LatteTexture* srcTexture, sint32 srcSlice, sint32 sr
sint32 effectiveHeight_dst = dstTexture->overwriteInfo.hasResolutionOverwrite ? dstTexture->overwriteInfo.height : dstTexture->height;
if (cafeLog_isLoggingFlagEnabled(LOG_TYPE_TEXTURE_CACHE))
{
forceLog_printf("_copySlice(): Unable to sync textures with mismatching scale ratio (due to texture rule)");
cemuLog_log(LogType::Force, "_copySlice(): Unable to sync textures with mismatching scale ratio (due to texture rule)");
float ratioWidth_src = (float)effectiveWidth_src / (float)srcTexture->width;
float ratioHeight_src = (float)effectiveHeight_src / (float)srcTexture->height;
float ratioWidth_dst = (float)effectiveWidth_dst / (float)dstTexture->width;
float ratioHeight_dst = (float)effectiveHeight_dst / (float)dstTexture->height;
forceLog_printf("Source: %08x origResolution %4d/%4d effectiveResolution %4d/%4d fmt %04x mipIndex %d ratioW/H: %.4f/%.4f", srcTexture->physAddress, srcTexture->width, srcTexture->height, effectiveWidth_src, effectiveHeight_src, (uint32)srcTexture->format, srcMip, ratioWidth_src, ratioHeight_src);
forceLog_printf("Destination: %08x origResolution %4d/%4d effectiveResolution %4d/%4d fmt %04x mipIndex %d ratioW/H: %.4f/%.4f", dstTexture->physAddress, dstTexture->width, dstTexture->height, effectiveWidth_dst, effectiveHeight_dst, (uint32)dstTexture->format, dstMip, ratioWidth_dst, ratioHeight_dst);
cemuLog_log(LogType::Force, "Source: {:08x} origResolution {:4}/{:4} effectiveResolution {:4}/{:4} fmt {:04x} mipIndex {} ratioW/H: {:.4}/{:.4}", srcTexture->physAddress, srcTexture->width, srcTexture->height, effectiveWidth_src, effectiveHeight_src, (uint32)srcTexture->format, srcMip, ratioWidth_src, ratioHeight_src);
cemuLog_log(LogType::Force, "Destination: {:08x} origResolution {:4}/{:4} effectiveResolution {:4}/{:4} fmt {:04x} mipIndex {} ratioW/H: {:.4}/{:.4}", dstTexture->physAddress, dstTexture->width, dstTexture->height, effectiveWidth_dst, effectiveHeight_dst, (uint32)dstTexture->format, dstMip, ratioWidth_dst, ratioHeight_dst);
}
//forceLogDebug_printf("If these textures are not meant to share data you can ignore this");
return;

View File

@ -661,7 +661,7 @@ void LatteTextureLoader_UpdateTextureSliceData(LatteTexture* tex, sint32 texture
uint64 benchmarkResultMicroSeconds = (benchmark_end.QuadPart - benchmark_begin.QuadPart) * 1000000ULL / benchmark_freq.QuadPart;
textureDecodeBenchmark_perFormatSum[(int)tex->format & 0x3F] += benchmarkResultMicroSeconds;
textureDecodeBenchmark_totalSum += benchmarkResultMicroSeconds;
forceLog_printf("TexDecode %04dx%04dx%04d Fmt %04x Dim %d TileMode %02x Took %03d.%03dms Sum(format) %06dms Sum(total) %06dms", textureLoader.width, textureLoader.height, textureLoader.surfaceInfoDepth, (int)tex->format, (int)tex->dim, textureLoader.tileMode, (uint32)(benchmarkResultMicroSeconds / 1000ULL), (uint32)(benchmarkResultMicroSeconds % 1000ULL), (uint32)(textureDecodeBenchmark_perFormatSum[tex->gx2Format & 0x3F] / 1000ULL), (uint32)(textureDecodeBenchmark_totalSum / 1000ULL));
cemuLog_log(LogType::Force, "TexDecode {:04}x{:04}x{:04} Fmt {:04x} Dim {} TileMode {:02x} Took {:03}.{:03}ms Sum(format) {:06}ms Sum(total) {:06}ms", textureLoader.width, textureLoader.height, textureLoader.surfaceInfoDepth, (int)tex->format, (int)tex->dim, textureLoader.tileMode, (uint32)(benchmarkResultMicroSeconds / 1000ULL), (uint32)(benchmarkResultMicroSeconds % 1000ULL), (uint32)(textureDecodeBenchmark_perFormatSum[tex->gx2Format & 0x3F] / 1000ULL), (uint32)(textureDecodeBenchmark_totalSum / 1000ULL));
#endif
// convert texture to RGBA when dumping is enabled
@ -738,11 +738,11 @@ void LatteTextureLoader_writeReadbackTextureToMemory(LatteTextureDefinition* tex
#ifdef CEMU_DEBUG_ASSERT
if (textureData->depth != 1)
forceLog_printf("_writeReadbackTextureToMemory(): Texture has multiple slices (not supported)");
cemuLog_log(LogType::Force, "_writeReadbackTextureToMemory(): Texture has multiple slices (not supported)");
#endif
if (textureLoader.physAddress == MPTR_NULL)
{
forceLog_printf("_writeReadbackTextureToMemory(): Texture has invalid address");
cemuLog_log(LogType::Force, "_writeReadbackTextureToMemory(): Texture has invalid address");
return;
}

View File

@ -76,7 +76,7 @@ void LatteTextureReadback_Initate(LatteTextureView* textureView)
// currently we don't support readback for resized textures
if (textureView->baseTexture->overwriteInfo.hasResolutionOverwrite)
{
forceLog_printf("_initate(): Readback is not supported for textures with modified resolution");
cemuLog_log(LogType::Force, "_initate(): Readback is not supported for textures with modified resolution");
return;
}
// check if texture isn't already queued for transfer
@ -128,7 +128,7 @@ void LatteTextureReadback_UpdateFinishedTransfers(bool forceFinish)
HRTick currentTick = HighResolutionTimer().now().getTick();
double elapsedSecondsTransfer = HighResolutionTimer::getTimeDiff(readbackInfo->transferStartTime, currentTick);
double elapsedSecondsWaiting = HighResolutionTimer::getTimeDiff(readbackInfo->waitStartTime, currentTick);
forceLog_printf("[Texture-Readback] %08x Res %4d/%4d TM %d FMT %04x ReadbackLatency: %6.3lfms WaitTime: %6.3lfms ForcedWait %s", readbackInfo->hostTextureCopy.physAddress, readbackInfo->hostTextureCopy.width, readbackInfo->hostTextureCopy.height, readbackInfo->hostTextureCopy.tileMode, (uint32)readbackInfo->hostTextureCopy.format, elapsedSecondsTransfer * 1000.0, elapsedSecondsWaiting * 1000.0, forceFinish?"yes":"no");
cemuLog_log(LogType::Force, "[Texture-Readback] {:08x} Res {:4}/{:4} TM {} FMT {:04x} ReadbackLatency: {:6.3}ms WaitTime: {:6.3}ms ForcedWait {}", readbackInfo->hostTextureCopy.physAddress, readbackInfo->hostTextureCopy.width, readbackInfo->hostTextureCopy.height, readbackInfo->hostTextureCopy.tileMode, (uint32)readbackInfo->hostTextureCopy.format, elapsedSecondsTransfer * 1000.0, elapsedSecondsWaiting * 1000.0, forceFinish?"yes":"no");
#endif
uint8* pixelData = readbackInfo->GetData();
LatteTextureLoader_writeReadbackTextureToMemory(&readbackInfo->hostTextureCopy, 0, 0, pixelData);

View File

@ -125,7 +125,7 @@ void LatteTextureGL::GetOpenGLFormatInfo(bool isDepth, Latte::E_GX2SURFFMT forma
return;
}
// unsupported depth format
forceLog_printf("OpenGL: Unsupported texture depth format 0x%04x", (uint32)format);
cemuLog_log(LogType::Force, "OpenGL: Unsupported texture depth format 0x{:04x}", (uint32)format);
// use placeholder format
formatInfoOut->setDepthFormat(GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, false);
formatInfoOut->markAsAlternativeFormat();
@ -499,7 +499,7 @@ void LatteTextureGL::GetOpenGLFormatInfo(bool isDepth, Latte::E_GX2SURFFMT forma
}
else
{
forceLog_printf("OpenGL: Unsupported texture format 0x%04x", (uint32)format);
cemuLog_log(LogType::Force, "OpenGL: Unsupported texture format 0x{:04x}", (uint32)format);
cemu_assert_unimplemented();
}
formatInfoOut->glInternalFormat = glInternalFormat;

View File

@ -89,7 +89,7 @@ OpenGLRenderer::OpenGLRenderer()
void* buffer = glMapNamedBufferRange(glRendererState.uploadBuffer, 0, TEXBUFFER_SIZE, GL_MAP_WRITE_BIT | GL_MAP_PERSISTENT_BIT | GL_MAP_UNSYNCHRONIZED_BIT | GL_MAP_FLUSH_EXPLICIT_BIT);
if (buffer == nullptr)
{
forceLog_printf("Failed to allocate GL texture upload buffer. Using traditional API instead");
cemuLog_log(LogType::Force, "Failed to allocate GL texture upload buffer. Using traditional API instead");
cemu_assert_debug(false);
}
glRendererState.uploadBufferPtr = buffer;
@ -104,7 +104,7 @@ OpenGLRenderer::OpenGLRenderer()
}
catch (const std::exception& ex)
{
forceLog_printf("Unable to create dxgi wrapper: %s (VRAM overlay stat won't be available)", ex.what());
cemuLog_log(LogType::Force, "Unable to create dxgi wrapper: {} (VRAM overlay stat won't be available)", ex.what());
}
#endif
}
@ -254,7 +254,7 @@ void OpenGLRenderer::Initialize()
{
Renderer::Initialize();
auto lock = cafeLog_acquire();
forceLog_printf("------- Init OpenGL graphics backend -------");
cemuLog_log(LogType::Force, "------- Init OpenGL graphics backend -------");
GLCanvas_MakeCurrent(false);
LoadOpenGLImports();
@ -268,12 +268,12 @@ void OpenGLRenderer::Initialize()
if (glMaxShaderCompilerThreadsARB)
glMaxShaderCompilerThreadsARB(0xFFFFFFFF);
forceLog_printf("OpenGL extensions:");
forceLog_printf("ARB_clip_control: %s", glClipControl ? "available" : "not supported");
forceLog_printf("ARB_get_program_binary: %s", (glGetProgramBinary != NULL && glProgramBinary != NULL) ? "available" : "not supported");
forceLog_printf("ARB_clear_texture: %s", (glClearTexImage != NULL) ? "available" : "not supported");
forceLog_printf("ARB_copy_image: %s", (glCopyImageSubData != NULL) ? "available" : "not supported");
forceLog_printf("NV_depth_buffer_float: %s", (glDepthRangedNV != NULL) ? "available" : "not supported");
cemuLog_log(LogType::Force, "OpenGL extensions:");
cemuLog_log(LogType::Force, "ARB_clip_control: {}", glClipControl ? "available" : "not supported");
cemuLog_log(LogType::Force, "ARB_get_program_binary: {}", (glGetProgramBinary != NULL && glProgramBinary != NULL) ? "available" : "not supported");
cemuLog_log(LogType::Force, "ARB_clear_texture: {}", (glClearTexImage != NULL) ? "available" : "not supported");
cemuLog_log(LogType::Force, "ARB_copy_image: {}", (glCopyImageSubData != NULL) ? "available" : "not supported");
cemuLog_log(LogType::Force, "NV_depth_buffer_float: {}", (glDepthRangedNV != NULL) ? "available" : "not supported");
// generate default frame buffer
glGenFramebuffers(1, &m_defaultFramebufferId);
@ -376,9 +376,9 @@ void OpenGLRenderer::GetVendorInformation()
char* glRendererString = (char*)glGetString(GL_RENDERER);
char* glVersionString = (char*)glGetString(GL_VERSION);
forceLog_printf("GL_VENDOR: %s", glVendorString ? glVendorString : "unknown");
forceLog_printf("GL_RENDERER: %s", glRendererString ? glRendererString : "unknown");
forceLog_printf("GL_VERSION: %s", glVersionString ? glVersionString : "unknown");
cemuLog_log(LogType::Force, "GL_VENDOR: {}", glVendorString ? glVendorString : "unknown");
cemuLog_log(LogType::Force, "GL_RENDERER: {}", glRendererString ? glRendererString : "unknown");
cemuLog_log(LogType::Force, "GL_VERSION: {}", glVersionString ? glVersionString : "unknown");
if(boost::icontains(glVersionString, "Mesa"))
{
@ -424,7 +424,7 @@ void _glDebugCallback(GLenum source, GLenum type, GLuint id, GLenum severity, GL
if (LatteGPUState.glVendor == GLVENDOR_NVIDIA && strstr(message, "does not have a defined base level"))
return;
forceLog_printf("GLDEBUG: %s", message);
cemuLog_log(LogType::Force, "GLDEBUG: {}", message);
cemu_assert_debug(false);
}

View File

@ -494,7 +494,7 @@ void LatteDrawGL_prepareIndicesWithGPUCache(MPTR indexDataMPTR, _INDEX_TYPE inde
break;
if (indexDataCacheFirst == nullptr)
{
forceLog_printf("Unable to allocate entry in index cache");
cemuLog_log(LogType::Force, "Unable to allocate entry in index cache");
assert_dbg();
}
}

View File

@ -41,7 +41,7 @@ void OpenGLRenderer::bufferCache_copyStreamoutToMainBuffer(uint32 srcOffset, uin
if (glCopyNamedBufferSubData)
glCopyNamedBufferSubData(glStreamoutCacheRingBuffer, glAttributeCacheAB, srcOffset, dstOffset, size);
else
forceLog_printf("glCopyNamedBufferSubData() not supported");
cemuLog_log(LogType::Force, "glCopyNamedBufferSubData() not supported");
}
void OpenGLRenderer::streamout_rendererFinishDrawcall()

View File

@ -119,8 +119,8 @@ RendererShaderGL::RendererShaderGL(ShaderType type, uint64 baseHash, uint64 auxH
char log[2048]{};
GLsizei log_size;
glGetShaderInfoLog(m_shader_object, std::min<uint32>(log_length, sizeof(log) - 1), &log_size, log);
forceLog_printf("Error/Warning in shader:");
forceLog_printf("%s", log);
cemuLog_log(LogType::Force, "Error/Warning in shader:");
cemuLog_log(LogType::Force, log);
}
// set debug name
@ -192,7 +192,7 @@ bool RendererShaderGL::WaitForCompiled()
tempLength = sizeof(infoLog) - 1;
glGetShaderInfoLog(m_shader_object, std::min(infoLogLength, tempLength), (GLsizei*)&tempLength, (GLcharARB*)infoLog);
infoLog[tempLength] = '\0';
forceLog_printf("Compile error in shader. Log:", infoLog);
cemuLog_log(LogType::Force, "Compile error in shader. Log:");
cemuLog_log(LogType::Force, infoLog);
}
if (m_shader_object != 0)
@ -212,7 +212,7 @@ bool RendererShaderGL::WaitForCompiled()
tempLength = sizeof(infoLog) - 1;
glGetProgramInfoLog(m_program, std::min(infoLogLength, tempLength), (GLsizei*)&tempLength, (GLcharARB*)infoLog);
infoLog[tempLength] = '\0';
forceLog_printf("Link error in shader. Log:", infoLog);
cemuLog_log(LogType::Force, "Link error in shader. Log:");
cemuLog_log(LogType::Force, infoLog);
}
m_isCompiled = true;
@ -273,7 +273,7 @@ void RendererShaderGL::ShaderCacheLoading_begin(uint64 cacheTitleId)
UNREACHABLE;
}
forceLog_printf("Using precompiled shaders: %s", usePrecompiled ? "true" : "false");
cemuLog_log(LogType::Force, "Using precompiled shaders: {}", usePrecompiled ? "true" : "false");
if (usePrecompiled)
{

View File

@ -52,7 +52,7 @@ VkSurfaceKHR CreateCocoaSurface(VkInstance instance, void* handle)
VkResult err;
if ((err = vkCreateMetalSurfaceEXT(instance, &surface, nullptr, &result)) != VK_SUCCESS)
{
forceLog_printf("Cannot create a Metal Vulkan surface: %d", (sint32)err);
cemuLog_log(LogType::Force, "Cannot create a Metal Vulkan surface: {}", (sint32)err);
throw std::runtime_error(fmt::format("Cannot create a Metal Vulkan surface: {}", err));
}

View File

@ -210,7 +210,7 @@ VkSampler LatteTextureViewVk::GetDefaultTextureSampler(bool useLinearTexFilter)
if (vkCreateSampler(m_device, &samplerInfo, nullptr, &sampler) != VK_SUCCESS)
{
forceLog_printf("Failed to create default sampler");
cemuLog_log(LogType::Force, "Failed to create default sampler");
throw std::runtime_error("failed to create texture sampler!");
}

View File

@ -239,7 +239,7 @@ void RendererShaderVk::CreateVkShaderModule(std::span<uint32> spirvBuffer)
VkResult result = vkCreateShaderModule(m_device, &createInfo, nullptr, &m_shader_module);
if (result != VK_SUCCESS)
{
forceLog_printf("Vulkan: Shader error");
cemuLog_log(LogType::Force, "Vulkan: Shader error");
throw std::runtime_error(fmt::format("Failed to create shader module: {}", result));
}

View File

@ -226,8 +226,8 @@ bool SwapchainInfoVk::AcquireImage(uint64 timeout)
void SwapchainInfoVk::UnrecoverableError(const char* errMsg)
{
forceLog_printf("Unrecoverable error in Vulkan swapchain");
forceLog_printf("Msg: %s", errMsg);
cemuLog_log(LogType::Force, "Unrecoverable error in Vulkan swapchain");
cemuLog_log(LogType::Force, "Msg: {}", errMsg);
throw std::runtime_error(errMsg);
}
@ -269,7 +269,7 @@ SwapchainInfoVk::SwapchainSupportDetails SwapchainInfoVk::QuerySwapchainSupport(
if (result != VK_SUCCESS)
{
if (result != VK_ERROR_SURFACE_LOST_KHR)
forceLog_printf("vkGetPhysicalDeviceSurfaceCapabilitiesKHR failed. Error %d", (sint32)result);
cemuLog_log(LogType::Force, "vkGetPhysicalDeviceSurfaceCapabilitiesKHR failed. Error {}", (sint32)result);
throw std::runtime_error(fmt::format("Unable to retrieve physical device surface capabilities: {}", result));
}
@ -277,7 +277,7 @@ SwapchainInfoVk::SwapchainSupportDetails SwapchainInfoVk::QuerySwapchainSupport(
result = vkGetPhysicalDeviceSurfaceFormatsKHR(device, surface, &formatCount, nullptr);
if (result != VK_SUCCESS)
{
forceLog_printf("vkGetPhysicalDeviceSurfaceFormatsKHR failed. Error %d", (sint32)result);
cemuLog_log(LogType::Force, "vkGetPhysicalDeviceSurfaceFormatsKHR failed. Error {}", (sint32)result);
throw std::runtime_error(fmt::format("Unable to retrieve the number of formats for a surface on a physical device: {}", result));
}
@ -287,7 +287,7 @@ SwapchainInfoVk::SwapchainSupportDetails SwapchainInfoVk::QuerySwapchainSupport(
result = vkGetPhysicalDeviceSurfaceFormatsKHR(device, surface, &formatCount, details.formats.data());
if (result != VK_SUCCESS)
{
forceLog_printf("vkGetPhysicalDeviceSurfaceFormatsKHR failed. Error %d", (sint32)result);
cemuLog_log(LogType::Force, "vkGetPhysicalDeviceSurfaceFormatsKHR failed. Error {}", (sint32)result);
throw std::runtime_error(fmt::format("Unable to retrieve the formats for a surface on a physical device: {}", result));
}
}
@ -296,7 +296,7 @@ SwapchainInfoVk::SwapchainSupportDetails SwapchainInfoVk::QuerySwapchainSupport(
result = vkGetPhysicalDeviceSurfacePresentModesKHR(device, surface, &presentModeCount, nullptr);
if (result != VK_SUCCESS)
{
forceLog_printf("vkGetPhysicalDeviceSurfacePresentModesKHR failed. Error %d", (sint32)result);
cemuLog_log(LogType::Force, "vkGetPhysicalDeviceSurfacePresentModesKHR failed. Error {}", (sint32)result);
throw std::runtime_error(fmt::format("Unable to retrieve the count of present modes for a surface on a physical device: {}", result));
}
@ -306,7 +306,7 @@ SwapchainInfoVk::SwapchainSupportDetails SwapchainInfoVk::QuerySwapchainSupport(
result = vkGetPhysicalDeviceSurfacePresentModesKHR(device, surface, &presentModeCount, details.presentModes.data());
if (result != VK_SUCCESS)
{
forceLog_printf("vkGetPhysicalDeviceSurfacePresentModesKHR failed. Error %d", (sint32)result);
cemuLog_log(LogType::Force, "vkGetPhysicalDeviceSurfacePresentModesKHR failed. Error {}", (sint32)result);
throw std::runtime_error(fmt::format("Unable to retrieve the present modes for a surface on a physical device: {}", result));
}
}
@ -357,14 +357,14 @@ VkPresentModeKHR SwapchainInfoVk::ChoosePresentMode(const std::vector<VkPresentM
if (std::find(modes.cbegin(), modes.cend(), VK_PRESENT_MODE_MAILBOX_KHR) != modes.cend())
return VK_PRESENT_MODE_MAILBOX_KHR;
forceLog_printf("Vulkan: Can't find mailbox present mode");
cemuLog_log(LogType::Force, "Vulkan: Can't find mailbox present mode");
}
else if (vsyncState == VSync::Immediate)
{
if (std::find(modes.cbegin(), modes.cend(), VK_PRESENT_MODE_IMMEDIATE_KHR) != modes.cend())
return VK_PRESENT_MODE_IMMEDIATE_KHR;
forceLog_printf("Vulkan: Can't find immediate present mode");
cemuLog_log(LogType::Force, "Vulkan: Can't find immediate present mode");
}
else if (vsyncState == VSync::SYNC_AND_LIMIT)
{
@ -373,7 +373,7 @@ VkPresentModeKHR SwapchainInfoVk::ChoosePresentMode(const std::vector<VkPresentM
//if (std::find(modes.cbegin(), modes.cend(), VK_PRESENT_MODE_IMMEDIATE_KHR) != modes.cend())
// return VK_PRESENT_MODE_IMMEDIATE_KHR;
//else
// forceLog_printf("Vulkan: Present mode 'immediate' not available. Vsync might not behave as intended");
// cemuLog_log(LogType::Force, "Vulkan: Present mode 'immediate' not available. Vsync might not behave as intended");
return VK_PRESENT_MODE_FIFO_KHR;
}

View File

@ -81,7 +81,7 @@ uint32 LatteTextureReadbackInfoVk::GetImageSize(LatteTextureView* textureView)
}
else
{
forceLog_printf("Unsupported texture readback format %04x\n", (uint32)textureView->format);
cemuLog_log(LogType::Force, "Unsupported texture readback format {:04x}", (uint32)textureView->format);
cemu_assert_debug(false);
return 0;
}

View File

@ -231,9 +231,9 @@ uint32 VkTextureChunkedHeap::allocateNewChunk(uint32 chunkIndex, uint32 minimumA
allocationSize /= 2;
if (allocationSize < minimumAllocationSize)
break;
forceLog_printf("Failed to allocate texture memory chunk with size %dMB. Trying again with smaller allocation size\n", allocationSize / 1024 / 1024);
cemuLog_log(LogType::Force, "Failed to allocate texture memory chunk with size {}MB. Trying again with smaller allocation size", allocationSize / 1024 / 1024);
}
forceLog_printf("Unable to allocate image memory chunk (%d heaps)", deviceLocalMemoryTypeIndices.size());
cemuLog_log(LogType::Force, "Unable to allocate image memory chunk ({} heaps)", deviceLocalMemoryTypeIndices.size());
throw std::runtime_error("failed to allocate image memory!");
return 0;
}
@ -299,7 +299,7 @@ size_t VKRMemoryManager::GetTotalMemoryForBufferType(VkBufferUsageFlags usage, V
bufferInfo.sharingMode = VK_SHARING_MODE_EXCLUSIVE;
if (vkCreateBuffer(logicalDevice, &bufferInfo, nullptr, &temporaryBuffer) != VK_SUCCESS)
{
forceLog_printf("Vulkan: GetTotalMemoryForBufferType() failed to create temporary buffer");
cemuLog_log(LogType::Force, "Vulkan: GetTotalMemoryForBufferType() failed to create temporary buffer");
return 0;
}
@ -513,7 +513,7 @@ void VKRMemoryManager::imageMemoryFree(VkImageMemAllocation* imageMemAllocation)
auto heapItr = map_textureHeap.find(imageMemAllocation->typeFilter);
if (heapItr == map_textureHeap.end())
{
forceLog_printf("Internal texture heap error");
cemuLog_log(LogType::Force, "Internal texture heap error");
return;
}
heapItr->second->freeMem(imageMemAllocation->mem);

View File

@ -33,7 +33,7 @@ public:
if ((alignment & (alignment - 1)) != 0)
{
// not a power of two
forceLog_printf("VkTextureChunkedHeap: Invalid alignment %d", alignment);
cemuLog_log(LogType::Force, "VkTextureChunkedHeap: Invalid alignment {}", alignment);
}
return this->alloc(size, alignment);
}

View File

@ -129,7 +129,7 @@ private:
NTSTATUS r = pfnD3DKMTWaitForVerticalBlankEvent(&arg);
if (r != 0)
{
//forceLog_printf("Wait for VerticalBlank failed\n");
//cemuLog_log(LogType::Force, "Wait for VerticalBlank failed");
Sleep(1000 / 60);
failCount++;
if (failCount >= 10)

View File

@ -19,7 +19,7 @@ bool InitializeGlobalVulkan()
if (hmodule == nullptr)
{
forceLog_printf("Vulkan loader not available. Outdated graphics driver or Vulkan runtime not installed?");
cemuLog_log(LogType::Force, "Vulkan loader not available. Outdated graphics driver or Vulkan runtime not installed?");
return false;
}
@ -28,7 +28,7 @@ bool InitializeGlobalVulkan()
if(!vkEnumerateInstanceVersion)
{
forceLog_printf("vkEnumerateInstanceVersion not available. Outdated graphics driver or Vulkan runtime?");
cemuLog_log(LogType::Force, "vkEnumerateInstanceVersion not available. Outdated graphics driver or Vulkan runtime?");
FreeLibrary(hmodule);
return false;
}
@ -84,7 +84,7 @@ bool InitializeGlobalVulkan()
if (!vulkan_so)
{
forceLog_printf("Vulkan loader not available.");
cemuLog_log(LogType::Force, "Vulkan loader not available.");
return false;
}
@ -93,7 +93,7 @@ bool InitializeGlobalVulkan()
if(!vkEnumerateInstanceVersion)
{
forceLog_printf("vkEnumerateInstanceVersion not available. Outdated graphics driver or Vulkan runtime?");
cemuLog_log(LogType::Force, "vkEnumerateInstanceVersion not available. Outdated graphics driver or Vulkan runtime?");
return false;
}

View File

@ -225,7 +225,7 @@ VkFormat PipelineCompiler::GetVertexFormat(uint8 format)
case FMT_2_10_10_10:
return VK_FORMAT_R32_UINT; // verified to match OpenGL
default:
forceLog_printf("Unsupported vertex format: %02x", format);
cemuLog_log(LogType::Force, "Unsupported vertex format: {:02x}", format);
assert_dbg();
return VK_FORMAT_UNDEFINED;
}
@ -398,7 +398,7 @@ bool PipelineCompiler::InitShaderStages(VulkanRenderer* vkRenderer, RendererShad
(vkGeometryShader && vkGeometryShader->GetShaderModule() == VK_NULL_HANDLE) ||
(vkPixelShader && vkPixelShader->GetShaderModule() == VK_NULL_HANDLE))
{
forceLog_printf("Vulkan-Info: Pipeline creation failed due to invalid shader(s)");
cemuLog_log(LogType::Force, "Vulkan-Info: Pipeline creation failed due to invalid shader(s)");
return false;
}
@ -921,7 +921,7 @@ bool PipelineCompiler::InitFromCurrentGPUState(PipelineInfo* pipelineInfo, const
VkResult result = vkCreatePipelineLayout(vkRenderer->m_logicalDevice, &pipelineLayoutInfo, nullptr, &m_pipeline_layout);
if (result != VK_SUCCESS)
{
forceLog_printf("%s", fmt::format("Failed to create pipeline layout: {}", result).c_str());
cemuLog_log(LogType::Force, "Failed to create pipeline layout: {}", result);
s_nvidiaWorkaround.unlock();
return false;
}
@ -1041,7 +1041,7 @@ bool PipelineCompiler::Compile(bool forceCompile, bool isRenderThread, bool show
}
else
{
forceLog_printf("Failed to create graphics pipeline. Error %d", (sint32)result);
cemuLog_log(LogType::Force, "Failed to create graphics pipeline. Error {}", (sint32)result);
cemu_assert_debug(false);
return true; // true indicates that caller should no longer attempt to compile this pipeline again
}

View File

@ -112,7 +112,7 @@ uint32 LatteQueryObjectVk::acquireQueryIndex()
{
if (m_rendererVk->m_occlusionQueries.list_availableQueryIndices.empty())
{
forceLog_printf("Vulkan-Error: Exhausted query pool");
cemuLog_log(LogType::Force, "Vulkan-Error: Exhausted query pool");
assert_dbg();
}
uint32 queryIndex = m_rendererVk->m_occlusionQueries.list_availableQueryIndices.back();
@ -152,7 +152,7 @@ LatteQueryObject* VulkanRenderer::occlusionQuery_create()
auto r = vkCreateQueryPool(m_logicalDevice, &queryPoolCreateInfo, nullptr, &m_occlusionQueries.queryPool);
if (r != VK_SUCCESS)
{
forceLog_printf("Vulkan-Error: Failed to create query pool with error %d", (sint32)r);
cemuLog_log(LogType::Force, "Vulkan-Error: Failed to create query pool with error {}", (sint32)r);
return nullptr;
}
}

View File

@ -210,11 +210,11 @@ void VulkanRenderer::DetermineVendor()
if(driverId == VK_DRIVER_ID_MESA_RADV || driverId == VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESA)
m_vendor = GfxVendor::Mesa;
forceLog_printf("Using GPU: %s", properties.properties.deviceName);
cemuLog_log(LogType::Force, "Using GPU: {}", properties.properties.deviceName);
if (m_featureControl.deviceExtensions.driver_properties)
{
forceLog_printf("Driver version: %s", driverProperties.driverInfo);
cemuLog_log(LogType::Force, "Driver version: {}", driverProperties.driverInfo);
if(m_vendor == GfxVendor::Nvidia)
{
@ -225,7 +225,7 @@ void VulkanRenderer::DetermineVendor()
else
{
forceLog_printf("Driver version (as stored in device info): %08X", properties.properties.driverVersion);
cemuLog_log(LogType::Force, "Driver version (as stored in device info): {:08}", properties.properties.driverVersion);
if(m_vendor == GfxVendor::Nvidia)
{
@ -291,11 +291,11 @@ void VulkanRenderer::GetDeviceFeatures()
{
if (m_featureControl.deviceExtensions.custom_border_color)
{
forceLog_printf("VK_EXT_custom_border_color is present but only with limited support. Cannot emulate arbitrary border color");
cemuLog_log(LogType::Force, "VK_EXT_custom_border_color is present but only with limited support. Cannot emulate arbitrary border color");
}
else
{
forceLog_printf("VK_EXT_custom_border_color not supported. Cannot emulate arbitrary border color");
cemuLog_log(LogType::Force, "VK_EXT_custom_border_color not supported. Cannot emulate arbitrary border color");
}
}
@ -309,11 +309,11 @@ VulkanRenderer::VulkanRenderer()
{
glslang::InitializeProcess();
forceLog_printf("------- Init Vulkan graphics backend -------");
cemuLog_log(LogType::Force, "------- Init Vulkan graphics backend -------");
const bool useValidationLayer = cafeLog_isLoggingFlagEnabled(LOG_TYPE_VULKAN_VALIDATION);
if (useValidationLayer)
forceLog_printf("Validation layer is enabled");
cemuLog_log(LogType::Force, "Validation layer is enabled");
VkResult err;
@ -397,19 +397,19 @@ VulkanRenderer::VulkanRenderer()
if (m_physicalDevice == VK_NULL_HANDLE && fallbackDevice != VK_NULL_HANDLE)
{
forceLog_printf("The selected GPU could not be found or is not suitable. Falling back to first available device instead");
cemuLog_log(LogType::Force, "The selected GPU could not be found or is not suitable. Falling back to first available device instead");
m_physicalDevice = fallbackDevice;
config.graphic_device_uuid = {}; // resetting device selection
}
else if (m_physicalDevice == VK_NULL_HANDLE)
{
forceLog_printf("No physical GPU could be found with the required extensions and swap chain support.");
cemuLog_log(LogType::Force, "No physical GPU could be found with the required extensions and swap chain support.");
throw std::runtime_error("No physical GPU could be found with the required extensions and swap chain support.");
}
CheckDeviceExtensionSupport(m_physicalDevice, m_featureControl); // todo - merge this with GetDeviceFeatures and separate from IsDeviceSuitable?
if (m_featureControl.debugMarkersSupported)
forceLog_printf("Debug: Frame debugger attached, will use vkDebugMarkerSetObjectNameEXT");
cemuLog_log(LogType::Force, "Debug: Frame debugger attached, will use vkDebugMarkerSetObjectNameEXT");
DetermineVendor();
GetDeviceFeatures();
@ -430,7 +430,7 @@ VulkanRenderer::VulkanRenderer()
}
catch (const std::exception& ex)
{
forceLog_printf("can't create dxgi wrapper: %s", ex.what());
cemuLog_log(LogType::Force, "can't create dxgi wrapper: {}", ex.what());
}
// create logical device
@ -452,7 +452,7 @@ VulkanRenderer::VulkanRenderer()
if (m_vendor == GfxVendor::AMD)
{
deviceFeatures.robustBufferAccess = VK_TRUE;
forceLog_printf("Enable robust buffer access");
cemuLog_log(LogType::Force, "Enable robust buffer access");
}
if (m_featureControl.mode.useTFEmulationViaSSBO)
{
@ -487,7 +487,7 @@ VulkanRenderer::VulkanRenderer()
VkResult result = vkCreateDevice(m_physicalDevice, &createInfo, nullptr, &m_logicalDevice);
if (result != VK_SUCCESS)
{
forceLog_printf("Vulkan: Unable to create a logical device. Error %d", (sint32)result);
cemuLog_log(LogType::Force, "Vulkan: Unable to create a logical device. Error {}", (sint32)result);
throw std::runtime_error(fmt::format("Unable to create a logical device: {}", result));
}
@ -514,7 +514,7 @@ VulkanRenderer::VulkanRenderer()
}
if (m_featureControl.instanceExtensions.debug_utils)
forceLog_printf("Using available debug function: vkCreateDebugUtilsMessengerEXT()");
cemuLog_log(LogType::Force, "Using available debug function: vkCreateDebugUtilsMessengerEXT()");
// set initial viewport and scissor box size
m_state.currentViewport.width = 4;
@ -578,11 +578,11 @@ VulkanRenderer::VulkanRenderer()
if (m_featureControl.mode.useBufferSurfaceCopies)
{
//forceLog_printf("Enable surface copies via buffer");
//cemuLog_log(LogType::Force, "Enable surface copies via buffer");
}
else
{
//forceLog_printf("Disable surface copies via buffer (Requires 2GB. Has only %lluMB available)", availableSurfaceCopyBufferMem / 1024ull / 1024ull);
//cemuLog_log(LogType::Force, "Disable surface copies via buffer (Requires 2GB. Has only {}MB available)", availableSurfaceCopyBufferMem / 1024ull / 1024ull);
}
}
@ -1212,11 +1212,11 @@ std::vector<const char*> VulkanRenderer::CheckInstanceExtensionSupport(FeatureCo
}
if (!requiredInstanceExtensions.empty())
{
forceLog_printf("The following required Vulkan instance extensions are not supported:");
cemuLog_log(LogType::Force, "The following required Vulkan instance extensions are not supported:");
std::stringstream ss;
for (const auto& extension : requiredInstanceExtensions)
forceLog_printf("%s", extension);
cemuLog_log(LogType::Force, "{}", extension);
cemuLog_waitForFlush();
throw std::runtime_error(ss.str());
}
@ -1262,7 +1262,7 @@ VkSurfaceKHR VulkanRenderer::CreateWinSurface(VkInstance instance, HWND hwindow)
VkResult err;
if ((err = vkCreateWin32SurfaceKHR(instance, &sci, nullptr, &result)) != VK_SUCCESS)
{
forceLog_printf("Cannot create a Win32 Vulkan surface: %d", (sint32)err);
cemuLog_log(LogType::Force, "Cannot create a Win32 Vulkan surface: {}", (sint32)err);
throw std::runtime_error(fmt::format("Cannot create a Win32 Vulkan surface: {}", err));
}
@ -1283,7 +1283,7 @@ VkSurfaceKHR VulkanRenderer::CreateXlibSurface(VkInstance instance, Display* dpy
VkResult err;
if ((err = vkCreateXlibSurfaceKHR(instance, &sci, nullptr, &result)) != VK_SUCCESS)
{
forceLog_printf("Cannot create a X11 Vulkan surface: %d", (sint32)err);
cemuLog_log(LogType::Force, "Cannot create a X11 Vulkan surface: {}", (sint32)err);
throw std::runtime_error(fmt::format("Cannot create a X11 Vulkan surface: {}", err));
}
@ -1302,7 +1302,7 @@ VkSurfaceKHR VulkanRenderer::CreateXcbSurface(VkInstance instance, xcb_connectio
VkResult err;
if ((err = vkCreateXcbSurfaceKHR(instance, &sci, nullptr, &result)) != VK_SUCCESS)
{
forceLog_printf("Cannot create a XCB Vulkan surface: %d", (sint32)err);
cemuLog_log(LogType::Force, "Cannot create a XCB Vulkan surface: {}", (sint32)err);
throw std::runtime_error(fmt::format("Cannot create a XCB Vulkan surface: {}", err));
}
@ -1321,7 +1321,7 @@ VkSurfaceKHR VulkanRenderer::CreateWaylandSurface(VkInstance instance, wl_displa
VkResult err;
if ((err = vkCreateWaylandSurfaceKHR(instance, &sci, nullptr, &result)) != VK_SUCCESS)
{
forceLog_printf("Cannot create a Wayland Vulkan surface: %d", (sint32)err);
cemuLog_log(LogType::Force, "Cannot create a Wayland Vulkan surface: {}", (sint32)err);
throw std::runtime_error(fmt::format("Cannot create a Wayland Vulkan surface: {}", err));
}
@ -1382,7 +1382,7 @@ void VulkanRenderer::CreateCommandBuffers()
const VkResult result = vkAllocateCommandBuffers(m_logicalDevice, &allocInfo, m_commandBuffers.data());
if (result != VK_SUCCESS)
{
forceLog_printf("Failed to allocate command buffers: %d", result);
cemuLog_log(LogType::Force, "Failed to allocate command buffers: {}", result);
throw std::runtime_error(fmt::format("Failed to allocate command buffers: {}", result));
}
@ -1561,8 +1561,8 @@ void VulkanRenderer::Shutdown()
void VulkanRenderer::UnrecoverableError(const char* errMsg) const
{
forceLog_printf("Unrecoverable error in Vulkan renderer");
forceLog_printf("Msg: %s", errMsg);
cemuLog_log(LogType::Force, "Unrecoverable error in Vulkan renderer");
cemuLog_log(LogType::Force, "Msg: {}", errMsg);
throw std::runtime_error(errMsg);
}
@ -1632,14 +1632,14 @@ void VulkanRenderer::QueryMemoryInfo()
{
VkPhysicalDeviceMemoryProperties memProperties;
vkGetPhysicalDeviceMemoryProperties(m_physicalDevice, &memProperties);
forceLog_printf("Vulkan device memory info:");
cemuLog_log(LogType::Force, "Vulkan device memory info:");
for (uint32 i = 0; i < memProperties.memoryHeapCount; i++)
{
forceLog_printf("Heap %d - Size %dMB Flags 0x%08x", i, (sint32)(memProperties.memoryHeaps[i].size / 1024ll / 1024ll), (uint32)memProperties.memoryHeaps[i].flags);
cemuLog_log(LogType::Force, "Heap {} - Size {}MB Flags 0x{:08x}", i, (sint32)(memProperties.memoryHeaps[i].size / 1024ll / 1024ll), (uint32)memProperties.memoryHeaps[i].flags);
}
for (uint32 i = 0; i < memProperties.memoryTypeCount; i++)
{
forceLog_printf("Memory %d - HeapIndex %d Flags 0x%08x", i, (sint32)memProperties.memoryTypes[i].heapIndex, (uint32)memProperties.memoryTypes[i].propertyFlags);
cemuLog_log(LogType::Force, "Memory {} - HeapIndex {} Flags 0x{:08x}", i, (sint32)memProperties.memoryTypes[i].heapIndex, (uint32)memProperties.memoryTypes[i].propertyFlags);
}
}
@ -1700,7 +1700,7 @@ void VulkanRenderer::QueryAvailableFormats()
if (fmtProp.optimalTilingFeatures == 0)
{
forceLog_printf("%s not supported", it.name);
cemuLog_log(LogType::Force, "{} not supported", it.name);
}
else if ((fmtProp.optimalTilingFeatures & requestedBits) != requestedBits)
{
@ -1716,7 +1716,7 @@ void VulkanRenderer::QueryAvailableFormats()
// missingStr.append(" TRANSFER_DST");
//if (!(fmtProp.optimalTilingFeatures & VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT))
// missingStr.append(" SAMPLED_IMAGE");
//forceLog_printf("%s", missingStr.c_str());
//cemuLog_log(LogType::Force, "{}", missingStr.c_str());
}
}
}
@ -1765,7 +1765,7 @@ ImTextureID VulkanRenderer::GenerateTexture(const std::vector<uint8>& data, cons
}
catch (const std::exception& ex)
{
forceLog_printf("can't generate imgui texture: %s", ex.what());
cemuLog_log(LogType::Force, "can't generate imgui texture: {}", ex.what());
return nullptr;
}
}
@ -1888,7 +1888,7 @@ void VulkanRenderer::ProcessFinishedCommandBuffers()
// not signaled
break;
}
forceLog_printf("vkGetFenceStatus returned unexpected error %d", (sint32)fenceStatus);
cemuLog_log(LogType::Force, "vkGetFenceStatus returned unexpected error {}", (sint32)fenceStatus);
cemu_assert_debug(false);
}
if (finishedCmdBuffers)
@ -1904,11 +1904,11 @@ void VulkanRenderer::WaitForNextFinishedCommandBuffer()
VkResult result = vkWaitForFences(m_logicalDevice, 1, &m_cmd_buffer_fences[m_commandBufferSyncIndex], true, UINT64_MAX);
if (result == VK_TIMEOUT)
{
forceLog_printf("vkWaitForFences: Returned VK_TIMEOUT on infinite fence");
cemuLog_log(LogType::Force, "vkWaitForFences: Returned VK_TIMEOUT on infinite fence");
}
else if (result != VK_SUCCESS)
{
forceLog_printf("vkWaitForFences: Returned unhandled error %d", (sint32)result);
cemuLog_log(LogType::Force, "vkWaitForFences: Returned unhandled error {}", (sint32)result);
}
// process
ProcessFinishedCommandBuffers();
@ -2040,7 +2040,7 @@ void VulkanRenderer::PipelineCacheSaveThread(size_t cache_size)
}
catch (const std::exception& ex)
{
forceLog_printf("can't create vulkan pipeline cache directory \"%s\": %s", dir.generic_string().c_str(), ex.what());
cemuLog_log(LogType::Force, "can't create vulkan pipeline cache directory \"{}\": {}", _pathToUtf8(dir), ex.what());
return;
}
}
@ -2089,12 +2089,12 @@ void VulkanRenderer::PipelineCacheSaveThread(size_t cache_size)
}
else
{
forceLog_printf("can't write pipeline cache to disk");
cemuLog_log(LogType::Force, "can't write pipeline cache to disk");
}
}
else
{
forceLog_printf("can't retrieve pipeline cache data: 0x%x", res);
cemuLog_log(LogType::Force, "can't retrieve pipeline cache data: 0x{:x}", res);
}
}
else
@ -2205,7 +2205,7 @@ void VulkanRenderer::GetTextureFormatInfoVK(Latte::E_GX2SURFFMT format, bool isD
formatInfoOut->decoder = TextureDecoder_D32_S8_UINT_X24::getInstance();
break;
default:
forceLog_printf("Unsupported depth texture format %04x", (uint32)format);
cemuLog_log(LogType::Force, "Unsupported depth texture format {:04x}", (uint32)format);
// default to placeholder format
formatInfoOut->vkImageFormat = VK_FORMAT_D16_UNORM;
formatInfoOut->vkImageAspect = VK_IMAGE_ASPECT_DEPTH_BIT;
@ -2458,7 +2458,7 @@ void VulkanRenderer::GetTextureFormatInfoVK(Latte::E_GX2SURFFMT format, bool isD
formatInfoOut->vkImageFormat = VK_FORMAT_R8G8B8A8_UINT; // todo - should we use ABGR format?
formatInfoOut->decoder = TextureDecoder_X24_G8_UINT::getInstance(); // todo - verify
default:
forceLog_printf("Unsupported color texture format %04x\n", (uint32)format);
cemuLog_log(LogType::Force, "Unsupported color texture format {:04x}", (uint32)format);
cemu_assert_debug(false);
}
}
@ -2581,7 +2581,7 @@ VkPipeline VulkanRenderer::backbufferBlit_createGraphicsPipeline(VkDescriptorSet
result = vkCreateGraphicsPipelines(m_logicalDevice, m_pipeline_cache, 1, &pipelineInfo, nullptr, &pipeline);
if (result != VK_SUCCESS)
{
forceLog_printf("Failed to create graphics pipeline. Error %d", result);
cemuLog_log(LogType::Force, "Failed to create graphics pipeline. Error {}", result);
throw std::runtime_error(fmt::format("Failed to create graphics pipeline: {}", result));
}
@ -3882,7 +3882,7 @@ VKRObjectRenderPass::VKRObjectRenderPass(AttachmentInfo_t& attachmentInfo, sint3
if (vkCreateRenderPass(VulkanRenderer::GetInstance()->GetLogicalDevice(), &renderPassInfo, nullptr, &m_renderPass) != VK_SUCCESS)
{
forceLog_printf("Vulkan-Error: Failed to create render pass");
cemuLog_log(LogType::Force, "Vulkan-Error: Failed to create render pass");
throw std::runtime_error("failed to create render pass!");
}

View File

@ -677,7 +677,7 @@ VkDescriptorSetInfo* VulkanRenderer::draw_getOrCreateDescriptorSet(PipelineInfo*
info.imageView = nullTexture1D.view;
info.sampler = nullTexture1D.sampler;
textureArray.emplace_back(info);
// forceLog_printf("Vulkan-Info: Shader 0x%016llx uses 1D texture but bound texture has mismatching type (dim: 0x%02x)", shader->baseHash, textureView->gx2Dim);
// cemuLog_log(LogType::Force, "Vulkan-Info: Shader 0x{:016x} uses 1D texture but bound texture has mismatching type (dim: 0x{:02x})", shader->baseHash, textureView->gx2Dim);
continue;
}
else if (textureDim == Latte::E_DIM::DIM_2D && (textureView->dim != Latte::E_DIM::DIM_2D && textureView->dim != Latte::E_DIM::DIM_2D_MSAA))
@ -688,7 +688,7 @@ VkDescriptorSetInfo* VulkanRenderer::draw_getOrCreateDescriptorSet(PipelineInfo*
info.imageView = nullTexture2D.view;
info.sampler = nullTexture2D.sampler;
textureArray.emplace_back(info);
// forceLog_printf("Vulkan-Info: Shader 0x%016llx uses 2D texture but bound texture has mismatching type (dim: 0x%02x)", shader->baseHash, textureView->gx2Dim);
// cemuLog_log(LogType::Force, "Vulkan-Info: Shader 0x{:016x} uses 2D texture but bound texture has mismatching type (dim: 0x{:02x})", shader->baseHash, textureView->gx2Dim);
continue;
}

View File

@ -353,7 +353,7 @@ CopySurfacePipelineInfo* VulkanRenderer::copySurface_getOrCreateGraphicsPipeline
VkResult result = vkCreatePipelineLayout(m_logicalDevice, &pipelineLayoutInfo, nullptr, &vkObjPipeline->pipeline_layout);
if (result != VK_SUCCESS)
{
forceLog_printf("%s", fmt::format("Failed to create pipeline layout: {}", result).c_str());
cemuLog_log(LogType::Force, "Failed to create pipeline layout: {}", result);
vkObjPipeline->pipeline = VK_NULL_HANDLE;
return copyPipeline;
}
@ -413,7 +413,7 @@ CopySurfacePipelineInfo* VulkanRenderer::copySurface_getOrCreateGraphicsPipeline
result = vkCreateGraphicsPipelines(m_logicalDevice, m_pipeline_cache, 1, &pipelineInfo, nullptr, &copyPipeline->vkObjPipeline->pipeline);
if (result != VK_SUCCESS)
{
forceLog_printf("Failed to create graphics pipeline for surface copy. Error %d Info:", (sint32)result);
cemuLog_log(LogType::Force, "Failed to create graphics pipeline for surface copy. Error {} Info:", (sint32)result);
cemu_assert_debug(false);
copyPipeline->vkObjPipeline->pipeline = VK_NULL_HANDLE;
}
@ -806,7 +806,7 @@ void VulkanRenderer::surfaceCopy_viaBuffer(LatteTextureVk* srcTextureVk, sint32
memoryManager->CreateBuffer(m_surfaceCopyBufferSize, VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT, VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT, m_surfaceCopyBuffer, m_surfaceCopyBufferMemory);
if (m_surfaceCopyBuffer == VK_NULL_HANDLE)
{
forceLog_printf("Vulkan: Failed to allocate surface copy buffer with size %llu", allocSize);
cemuLog_log(LogType::Force, "Vulkan: Failed to allocate surface copy buffer with size {}", allocSize);
return;
}
}

View File

@ -339,7 +339,7 @@ namespace iosu
}
else
{
forceLog_printf("ACPGetTitleSaveMetaXml(): Meta file \"%s\" does not exist", xmlPath);
cemuLog_log(LogType::Force, "ACPGetTitleSaveMetaXml(): Meta file \"{}\" does not exist", xmlPath);
memset(acpMetaXml, 0, sizeof(acpMetaXml_t));
}
return 0;
@ -373,7 +373,7 @@ namespace iosu
free(metaBootMovieData);
}
else
forceLog_printf("ACPGetTitleMetaData(): Unable to load \"%s\"", filePath);
cemuLog_log(LogType::Force, "ACPGetTitleMetaData(): Unable to load \"{}\"", filePath);
// bootLogoTex.tga
sprintf(filePath, "%smeta/bootLogoTex.tga", titlePath);
uint32 metaBootLogoSize = 0;
@ -384,7 +384,7 @@ namespace iosu
free(metaBootLogoData);
}
else
forceLog_printf("ACPGetTitleMetaData(): Unable to load \"%s\"", filePath);
cemuLog_log(LogType::Force, "ACPGetTitleMetaData(): Unable to load \"{}\"", filePath);
return 0;
@ -418,7 +418,7 @@ namespace iosu
}
else
{
forceLog_printf("ACPGetTitleMetaXml(): Meta file \"%s\" does not exist", filePath);
cemuLog_log(LogType::Force, "ACPGetTitleMetaXml(): Meta file \"{}\" does not exist", filePath);
}
return 0;
@ -470,7 +470,7 @@ namespace iosu
FSCVirtualFile* fscDirIterator = fsc_openDirIterator(searchPath, &fscStatus);
if (fscDirIterator == nullptr)
{
forceLog_printf("ACPGetTitleSaveDirEx(): Failed to iterate directories in \"%s\"", searchPath);
cemuLog_log(LogType::Force, "ACPGetTitleSaveDirEx(): Failed to iterate directories in \"{}\"", searchPath);
*countOut = 0;
}
else

View File

@ -322,7 +322,7 @@ namespace iosu
forceLogDebug_printf("sslctx_function: adding ca cert: %d", (int)task_settings->settings[location]);
if (!iosuCrypto_addCACertificate(sslctx, task_settings->settings[location]))
{
forceLog_printf("Failed to load CA certificate file");
cemuLog_log(LogType::Force, "Failed to load CA certificate file");
assert_dbg();
}
}
@ -334,13 +334,13 @@ namespace iosu
{
if (!iosuCrypto_addCACertificate(sslctx, 105))
{
forceLog_printf("Failed to load certificate file");
cemuLog_log(LogType::Force, "Failed to load certificate file");
assert_dbg();
}
if (!iosuCrypto_addClientCertificate(sslctx, 3))
{
forceLog_printf("Failed to load client certificate file");
cemuLog_log(LogType::Force, "Failed to load client certificate file");
assert_dbg();
}
}

View File

@ -393,24 +393,24 @@ bool iosuCrypto_addClientCertificate(void* sslctx, sint32 certificateId)
{
if (SSL_CTX_use_certificate(ctx, iosuCryptoCertificates.certList[i].cert) != 1)
{
forceLog_printf("Unable to setup certificate %d", certificateId);
cemuLog_log(LogType::Force, "Unable to setup certificate {}", certificateId);
return false;
}
if (SSL_CTX_use_RSAPrivateKey(ctx, iosuCryptoCertificates.certList[i].pkey) != 1)
{
forceLog_printf("Unable to setup certificate %d RSA private key", certificateId);
cemuLog_log(LogType::Force, "Unable to setup certificate {} RSA private key", certificateId);
return false;
}
if (SSL_CTX_check_private_key(ctx) == false)
{
forceLog_printf("Certificate private key could not be validated (verify required files for online mode or disable online mode)");
cemuLog_log(LogType::Force, "Certificate private key could not be validated (verify required files for online mode or disable online mode)");
}
return true;
}
}
forceLog_printf("Certificate not found (verify required files for online mode or disable online mode)");
cemuLog_log(LogType::Force, "Certificate not found (verify required files for online mode or disable online mode)");
return false;
}
@ -438,7 +438,7 @@ bool iosuCrypto_addCustomCACertificate(void* sslctx, uint8* certData, sint32 cer
X509* cert = d2i_X509(NULL, (const unsigned char**)&tempPtr, certLength);
if (cert == nullptr)
{
forceLog_printf("Invalid custom server PKI certificate");
cemuLog_log(LogType::Force, "Invalid custom server PKI certificate");
return false;
}
X509_STORE_add_cert(store, cert);
@ -571,7 +571,7 @@ void iosuCrypto_init()
// verify if OTP is ok
if (length != 1024) // todo - should also check some fixed values to verify integrity of otp dump
{
forceLog_printf("IOSU_CRYPTO: otp.bin has wrong size (must be 1024 bytes)");
cemuLog_log(LogType::Force, "IOSU_CRYPTO: otp.bin has wrong size (must be 1024 bytes)");
hasOtpMem = false;
}
else
@ -582,7 +582,7 @@ void iosuCrypto_init()
}
else
{
forceLog_printf("IOSU_CRYPTO: No otp.bin found. Online mode cannot be used");
cemuLog_log(LogType::Force, "IOSU_CRYPTO: No otp.bin found. Online mode cannot be used");
hasOtpMem = false;
}

View File

@ -170,7 +170,7 @@ namespace iosu
inet_pton(AF_INET, nexTokenResult.nexToken.host, &hostIp);
g_fpd.nexFriendSession = new NexFriends(hostIp, nexTokenResult.nexToken.port, "ridfebb9", myPid, nexTokenResult.nexToken.nexPassword, nexTokenResult.nexToken.token, accountId, (uint8*)&miiData, (wchar_t*)screenName, (uint8)countryCode, g_fpd.myPresence);
g_fpd.nexFriendSession->setNotificationHandler(notificationHandler);
forceLog_printf("IOSU_FPD: Created friend server session");
cemuLog_log(LogType::Force, "IOSU_FPD: Created friend server session");
}
else
{

View File

@ -108,7 +108,7 @@ namespace iosu
uint32be titleCountBE = titleCount;
if (mcpGetTitleList(titleList, titleCount * sizeof(MCPTitleInfo), &titleCountBE) != 0)
{
forceLog_printf("IOSU: nim failed to acquire title list");
cemuLog_log(LogType::Force, "IOSU: nim failed to acquire title list");
free(titleList);
return;
}
@ -218,7 +218,7 @@ namespace iosu
if (!result)
{
memset(idbeIconOutput, 0, sizeof(NAPI::IDBEIconDataV0));
forceLog_printf("NIM: Unable to download IDBE icon");
cemuLog_log(LogType::Force, "NIM: Unable to download IDBE icon");
return 0;
}
// add new cache entry
@ -249,7 +249,7 @@ namespace iosu
{
if (g_nim.backgroundThreadStarted == false)
{
forceLog_printf("IOSU: Starting nim background thread");
cemuLog_log(LogType::Force, "IOSU: Starting nim background thread");
std::thread t(nim_backgroundThread);
t.detach();
g_nim.backgroundThreadStarted = true;

View File

@ -71,7 +71,7 @@ uint32 ELF_LoadFromMemory(uint8* elfData, sint32 size, const char* name)
if (shOffset > (uint32)size)
{
forceLog_printf("ELF section %d out of bounds", i);
cemuLog_log(LogType::Force, "ELF section {} out of bounds", i);
continue;
}
uint32 copySize = std::min(shSize, size - shOffset);

View File

@ -336,7 +336,7 @@ rplSectionEntryNew_t* RPLLoader_GetSection(RPLModule* rplLoaderContext, sint32 s
sint32 sectionCount = rplLoaderContext->rplHeader.sectionTableEntryCount;
if (sectionIndex < 0 || sectionIndex >= sectionCount)
{
forceLog_printf("RPLLoader: Section index out of bounds");
cemuLog_log(LogType::Force, "RPLLoader: Section index out of bounds");
rplLoaderContext->hasError = true;
return nullptr;
}
@ -363,7 +363,7 @@ RPLUncompressedSection* RPLLoader_LoadUncompressedSection(RPLModule* rplLoaderCo
if (!RPLLoader_CheckBounds(rplLoaderContext, section->fileOffset, section->sectionSize))
{
// BSS
forceLog_printf("RPLLoader: Raw data for section %d exceeds bounds of RPL file", sectionIndex);
cemuLog_log(LogType::Force, "RPLLoader: Raw data for section {} exceeds bounds of RPL file", sectionIndex);
rplLoaderContext->hasError = true;
delete uSection;
return nullptr;
@ -375,7 +375,7 @@ RPLUncompressedSection* RPLLoader_LoadUncompressedSection(RPLModule* rplLoaderCo
// decompress
if (!RPLLoader_CheckBounds(rplLoaderContext, section->fileOffset, sizeof(uint32be)) )
{
forceLog_printf("RPLLoader: Uncompressed data of section %d is too large", sectionIndex);
cemuLog_log(LogType::Force, "RPLLoader: Uncompressed data of section {} is too large", sectionIndex);
rplLoaderContext->hasError = true;
delete uSection;
return nullptr;
@ -383,7 +383,7 @@ RPLUncompressedSection* RPLLoader_LoadUncompressedSection(RPLModule* rplLoaderCo
uint32 uncompressedSize = *(uint32be*)(rplLoaderContext->RPLRawData.data() + (uint32)section->fileOffset);
if (uncompressedSize >= 1*1024*1024*1024) // sections bigger than 1GB not allowed
{
forceLog_printf("RPLLoader: Uncompressed data of section %d is too large", sectionIndex);
cemuLog_log(LogType::Force, "RPLLoader: Uncompressed data of section {} is too large", sectionIndex);
rplLoaderContext->hasError = true;
delete uSection;
return nullptr;
@ -405,7 +405,7 @@ RPLUncompressedSection* RPLLoader_LoadUncompressedSection(RPLModule* rplLoaderCo
inflateEnd(&strm);
if ((ret != Z_OK && ret != Z_STREAM_END) || strm.avail_in != 0 || strm.avail_out != 0)
{
forceLog_printf("RPLLoader: Error while inflating data for section %d", sectionIndex);
cemuLog_log(LogType::Force, "RPLLoader: Error while inflating data for section {}", sectionIndex);
rplLoaderContext->hasError = true;
delete uSection;
return nullptr;
@ -454,7 +454,7 @@ bool RPLLoader_LoadSingleSection(RPLModule* rplLoaderContext, sint32 sectionInde
// update size in section (todo - use separate field)
if (uncompressedSection->sectionData.size() < section->sectionSize)
forceLog_printf("RPLLoader: Section %d uncompresses to %d bytes but sectionSize is %d", sectionIndex, uncompressedSection->sectionData.size(), (uint32)section->sectionSize);
cemuLog_log(LogType::Force, "RPLLoader: Section {} uncompresses to {} bytes but sectionSize is {}", sectionIndex, uncompressedSection->sectionData.size(), (uint32)section->sectionSize);
section->sectionSize = uncompressedSection->sectionData.size();
@ -956,7 +956,7 @@ bool RPLLoader_FixImportSymbols(RPLModule* rplLoaderContext, sint32 symtabSectio
char* symbolName = (char*)strtabData + nameOffset;
if (nameOffset >= strtabSize)
{
forceLog_printf("RPLLoader: Symbol %d in section %d has out-of-bounds name offset", i, symSectionIndex);
cemuLog_log(LogType::Force, "RPLLoader: Symbol {} in section {} has out-of-bounds name offset", i, symSectionIndex);
continue;
}
@ -1287,7 +1287,7 @@ bool RPLLoader_ApplyRelocs(RPLModule* rplLoaderContext, sint32 relaSectionIndex,
uint32 crc = rplLoaderContext->GetSectionCRC(relaSectionIndex);
if (calcCRC != crc)
{
forceLog_printf("RPLLoader %s - Relocation section %d has CRC mismatch - Calc: %08x Actual: %08x", rplLoaderContext->moduleName2.c_str(), relaSectionIndex, calcCRC, crc);
cemuLog_log(LogType::Force, "RPLLoader {} - Relocation section {} has CRC mismatch - Calc: {:08x} Actual: {:08x}", rplLoaderContext->moduleName2.c_str(), relaSectionIndex, calcCRC, crc);
}
// process relocations
sint32 relocCount = relocSize / sizeof(rplRelocNew_t);
@ -1664,7 +1664,7 @@ RPLModule* rpl_loadFromMem(uint8* rplData, sint32 size, char* name)
// cancel if error
if (rpl->hasError)
{
forceLog_printf("RPLLoader: Unable to load RPL due to errors");
cemuLog_log(LogType::Force, "RPLLoader: Unable to load RPL due to errors");
delete rpl;
return nullptr;
}
@ -2120,7 +2120,7 @@ void RPLLoader_LoadDependency(rplDependency_t* dependency)
auto fileData = FileStream::LoadIntoMemory(filePath);
if (fileData)
{
forceLog_printf("Loading RPL: /cafeLibs/%s", dependency->filepath);
cemuLog_log(LogType::Force, "Loading RPL: /cafeLibs/{}", dependency->filepath);
dependency->rplLoaderContext = rpl_loadFromMem(fileData->data(), fileData->size(), dependency->filepath);
return;
}

View File

@ -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));

View File

@ -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?

View File

@ -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",
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;
}

View File

@ -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

View File

@ -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++;
}
}

View File

@ -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);

View File

@ -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();

View File

@ -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);

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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();

View File

@ -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);
}
}

View File

@ -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)

View File

@ -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];

View File

@ -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;

View File

@ -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);
}
}

View File

@ -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

View File

@ -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);

View File

@ -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

View File

@ -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;
}

View File

@ -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);

View File

@ -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
}

View File

@ -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;
}

View File

@ -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

View File

@ -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);

View File

@ -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);
}
}

View File

@ -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;
}

View File

@ -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));
}

View File

@ -263,7 +263,7 @@ void FileCache::fileCache_updateFiletable(sint32 extraEntriesToAllocate)
// update file table info in struct
if (this->fileTableEntries[0].name1 != FILECACHE_FILETABLE_NAME1 || this->fileTableEntries[0].name2 != FILECACHE_FILETABLE_NAME2)
{
forceLog_printf("Corruption in cache file detected");
cemuLog_log(LogType::Force, "Corruption in cache file detected");
assert_dbg();
}
this->fileTableOffset = this->fileTableEntries[0].fileOffset;
@ -390,7 +390,7 @@ void FileCache::_addFileInternal(uint64 name1, uint64 name2, const uint8* fileDa
{
if (name1 == FILECACHE_FILETABLE_NAME1 && name2 == FILECACHE_FILETABLE_NAME2)
{
forceLog_printf("Error in cache file");
cemuLog_log(LogType::Force, "Error in cache file");
cemu_assert_debug(false);
}
// no free entry, recreate file table with larger size
@ -552,7 +552,7 @@ bool FileCache::GetFileByIndex(sint32 index, uint64* name1, uint64* name2, std::
FileTableEntry* entry = this->fileTableEntries + index;
if (this->fileTableEntries == nullptr)
{
forceLog_printf("GetFileByIndex() fileTable is NULL");
cemuLog_log(LogType::Force, "GetFileByIndex() fileTable is NULL");
return false;
}
if (entry->name1 == FILECACHE_FILETABLE_FREE_NAME && entry->name2 == FILECACHE_FILETABLE_FREE_NAME)

View File

@ -672,7 +672,7 @@ void DownloadManager::_handle_connect()
{
if (!_connect_refreshIASAccountIdAndDeviceToken())
{
forceLog_printf("Failed to request IAS token");
cemuLog_log(LogType::Force, "Failed to request IAS token");
cemu_assert_debug(false);
m_connectState.store(CONNECT_STATE::FAILED);
setStatusMessage(std::string(_("Login failed. Outdated or incomplete online files?")), DLMGR_STATUS_CODE::FAILED);

View File

@ -253,7 +253,7 @@ namespace NAPI
result.deviceToken = responseNode.child_value("DeviceToken");
if (boost::iequals(responseNode.child_value("DeviceTokenExpired"), "true"))
forceLog_printf("Unexpected server response: Device token expired");
cemuLog_log(LogType::Force, "Unexpected server response: Device token expired");
/*
example response:
@ -363,7 +363,7 @@ namespace NAPI
else if (boost::iequals(serviceType, "NusURL"))
result.serviceURLs.NusURL = url;
else
forceLog_printf("GetAccountStatus: Unknown service URI type {}", serviceType);
cemuLog_log(LogType::Force, "GetAccountStatus: Unknown service URI type {}", serviceType);
}
// assign service URLs

View File

@ -21,16 +21,16 @@ CURLcode _sslctx_function_NUS(CURL* curl, void* sslctx, void* param)
{
if (iosuCrypto_addCACertificate(sslctx, 102) == false)
{
forceLog_printf("Invalid CA certificate (102)");
cemuLog_log(LogType::Force, "Invalid CA certificate (102)");
}
if (iosuCrypto_addCACertificate(sslctx, 0x69) == false)
{
forceLog_printf("Invalid CA certificate (105)");
cemuLog_log(LogType::Force, "Invalid CA certificate (105)");
}
if (iosuCrypto_addClientCertificate(sslctx, 3) == false)
{
forceLog_printf("Certificate error");
cemuLog_log(LogType::Force, "Certificate error");
}
SSL_CTX_set_mode((SSL_CTX*)sslctx, SSL_MODE_AUTO_RETRY);
SSL_CTX_set_verify_depth((SSL_CTX*)sslctx, 2);
@ -42,7 +42,7 @@ CURLcode _sslctx_function_IDBE(CURL* curl, void* sslctx, void* param)
{
if (iosuCrypto_addCACertificate(sslctx, 105) == false)
{
forceLog_printf("Invalid CA certificate (105)");
cemuLog_log(LogType::Force, "Invalid CA certificate (105)");
}
SSL_CTX_set_mode((SSL_CTX*)sslctx, SSL_MODE_AUTO_RETRY);
SSL_CTX_set_verify_depth((SSL_CTX*)sslctx, 2);
@ -54,12 +54,12 @@ CURLcode _sslctx_function_SOAP(CURL* curl, void* sslctx, void* param)
{
if (iosuCrypto_addCACertificate(sslctx, 102) == false)
{
forceLog_printf("Invalid CA certificate (102)");
forceLog_printf("Certificate error");
cemuLog_log(LogType::Force, "Invalid CA certificate (102)");
cemuLog_log(LogType::Force, "Certificate error");
}
if (iosuCrypto_addClientCertificate(sslctx, 1) == false)
{
forceLog_printf("Certificate error");
cemuLog_log(LogType::Force, "Certificate error");
}
SSL_CTX_set_mode((SSL_CTX*)sslctx, SSL_MODE_AUTO_RETRY);
SSL_CTX_set_verify_depth((SSL_CTX*)sslctx, 2);
@ -374,7 +374,7 @@ namespace NAPI
// parse XML response
if (!doc.load_buffer(soapHelper.getReceivedData().data(), soapHelper.getReceivedData().size()))
{
forceLog_printf("Failed to parse GetRegistrationInfo() response");
cemuLog_log(LogType::Force, "Failed to parse GetRegistrationInfo() response");
result.apiError = NAPI_RESULT::XML_ERROR;
return false;
}

View File

@ -74,7 +74,7 @@ namespace NAPI
pugi::xml_document doc;
if (!doc.load_buffer(receivedData.data(), receivedData.size()))
{
forceLog_printf("Failed to parse update list XML");
cemuLog_log(LogType::Force, "Failed to parse update list XML");
return result;
}
// example:

View File

@ -512,21 +512,21 @@ void nexServiceAuthentication_handleResponse_requestTicket(nexService* nex, nexS
authenticationService_t* authService = (authenticationService_t*)response->custom;
if (response->isSuccessful == false)
{
forceLog_printf("NEX: RPC error while requesting auth ticket with error code 0x%08x", response->errorCode);
cemuLog_log(LogType::Force, "NEX: RPC error while requesting auth ticket with error code 0x{:08x}", response->errorCode);
authService->hasError = true;
return;
}
uint32 returnValue = response->data.readU32();
if (returnValue & 0x80000000)
{
forceLog_printf("NEX: Failed to request auth ticket with error code 0x%08x", returnValue);
cemuLog_log(LogType::Force, "NEX: Failed to request auth ticket with error code 0x{:08x}", returnValue);
authService->hasError = true;
}
authService->kerberosTicket2Size = response->data.readBuffer(authService->kerberosTicket2, sizeof(authService->kerberosTicket2));
if (response->data.hasReadOutOfBounds())
{
authService->hasError = true;
forceLog_printf("NEX: Out of bounds error while reading auth ticket");
cemuLog_log(LogType::Force, "NEX: Out of bounds error while reading auth ticket");
return;
}
authService->done = true;
@ -538,7 +538,7 @@ void nexServiceAuthentication_handleResponse_login(nexService* nex, nexServiceRe
if (response->isSuccessful == false)
{
authService->hasError = true;
forceLog_printf("NEX: RPC error in login response 0x%08x", response->errorCode);
cemuLog_log(LogType::Force, "NEX: RPC error in login response 0x{:08x}", response->errorCode);
return;
}
@ -546,7 +546,7 @@ void nexServiceAuthentication_handleResponse_login(nexService* nex, nexServiceRe
if (returnValue & 0x80000000)
{
authService->hasError = true;
forceLog_printf("NEX: Error 0x%08x in login response (returnCode 0x%08x)", response->errorCode, returnValue);
cemuLog_log(LogType::Force, "NEX: Error 0x{:08x} in login response (returnCode 0x{:08x})", response->errorCode, returnValue);
return;
}
@ -571,7 +571,7 @@ void nexServiceAuthentication_handleResponse_login(nexService* nex, nexServiceRe
if (response->data.hasReadOutOfBounds())
{
authService->hasError = true;
forceLog_printf("NEX: Read out of bounds");
cemuLog_log(LogType::Force, "NEX: Read out of bounds");
return;
}
// request ticket data
@ -595,14 +595,14 @@ void nexServiceSecure_handleResponse_RegisterEx(nexService* nex, nexServiceRespo
uint32 returnCode = response->data.readU32();
if (response->isSuccessful == false || response->data.hasReadOutOfBounds())
{
forceLog_printf("NEX: RPC error in secure register");
cemuLog_log(LogType::Force, "NEX: RPC error in secure register");
info->isSuccessful = false;
info->isComplete = true;
return;
}
if (returnCode & 0x80000000)
{
forceLog_printf("NEX: Secure register failed with error code 0x%08x", returnCode);
cemuLog_log(LogType::Force, "NEX: Secure register failed with error code 0x{:08x}", returnCode);
info->isSuccessful = false;
info->isComplete = true;
return;
@ -627,7 +627,7 @@ nexService* nex_secureLogin(authServerInfo_t* authServerInfo, const char* access
if (prudpSecureSock->getConnectionState() == prudpClient::STATE_DISCONNECTED)
{
// timeout or disconnected
forceLog_printf("NEX: Secure login connection time-out");
cemuLog_log(LogType::Force, "NEX: Secure login connection time-out");
delete prudpSecureSock;
return nullptr;
}
@ -656,13 +656,13 @@ nexService* nex_secureLogin(authServerInfo_t* authServerInfo, const char* access
break;
if (nex->getState() == nexService::STATE_DISCONNECTED)
{
forceLog_printf("NEX: Connection error while registering");
cemuLog_log(LogType::Force, "NEX: Connection error while registering");
break;
}
}
if (secureRegisterExData.isSuccessful == false)
{
forceLog_printf("NEX: Failed to register to secure server");
cemuLog_log(LogType::Force, "NEX: Failed to register to secure server");
nex->destroy();
return nullptr;
}
@ -682,7 +682,7 @@ nexService* nex_establishSecureConnection(uint32 authServerIp, uint16 authServer
{
// error
authConnection->destroy();
forceLog_printf("NEX: Failed to connect to the NEX server");
cemuLog_log(LogType::Force, "NEX: Failed to connect to the NEX server");
return nullptr;
}
// send auth login request
@ -704,7 +704,7 @@ nexService* nex_establishSecureConnection(uint32 authServerIp, uint16 authServer
{
// error
authConnection->destroy();
forceLog_printf("NEX: Error during authentication");
cemuLog_log(LogType::Force, "NEX: Error during authentication");
return nullptr;
}
// close connection to auth server
@ -726,7 +726,7 @@ nexService* nex_establishSecureConnection(uint32 authServerIp, uint16 authServer
if (nexAuthService.kerberosTicket2Size < 16)
{
nexAuthService.hasError = true;
forceLog_printf("NEX: Kerberos ticket too short");
cemuLog_log(LogType::Force, "NEX: Kerberos ticket too short");
return nullptr;
}
// check hmac of ticket
@ -735,7 +735,7 @@ nexService* nex_establishSecureConnection(uint32 authServerIp, uint16 authServer
if (memcmp(hmacTicket, nexAuthService.kerberosTicket2 + nexAuthService.kerberosTicket2Size - 16, 16) != 0)
{
nexAuthService.hasError = true;
forceLog_printf("NEX: Kerberos ticket hmac invalid");
cemuLog_log(LogType::Force, "NEX: Kerberos ticket hmac invalid");
return nullptr;
}
// auth info
@ -752,7 +752,7 @@ nexService* nex_establishSecureConnection(uint32 authServerIp, uint16 authServer
if (packetKerberosTicket.hasReadOutOfBounds())
{
forceLog_printf("NEX: Parse error");
cemuLog_log(LogType::Force, "NEX: Parse error");
return nullptr;
}

View File

@ -335,7 +335,7 @@ void NexFriends::handleResponse_getAllInformation(nexServiceResponse_t* response
uint8 isPreferenceInvalid = response->data.readU8(); // if not zero, preferences must be setup
if (isPreferenceInvalid)
{
forceLog_printf("NEX: First time login into friend account, setting up default preferences");
cemuLog_log(LogType::Force, "NEX: First time login into friend account, setting up default preferences");
session->updatePreferences(nexPrincipalPreference(1, 1, 0));
}
@ -972,7 +972,7 @@ void NexFriends::update()
}
if (timeSinceLastLoginAttempt < delayTime)
return;
forceLog_printf("NEX: Attempt async friend service login");
cemuLog_log(LogType::Force, "NEX: Attempt async friend service login");
initiateLogin();
}
}
@ -980,7 +980,7 @@ void NexFriends::update()
{
if (this->nexCon == nullptr || this->nexCon->getState() != nexService::STATE_CONNECTED)
{
forceLog_printf("NEX: Lost friend server session");
cemuLog_log(LogType::Force, "NEX: Lost friend server session");
if (this->nexCon)
{
this->nexCon->destroy();

View File

@ -519,7 +519,7 @@ prudpClient::prudpClient(uint32 dstIp, uint16 dstPort, const char* key) : prudpC
{
if (tries == 4)
{
forceLog_printf("PRUDP: Failed to bind UDP socket");
cemuLog_log(LogType::Force, "PRUDP: Failed to bind UDP socket");
currentConnectionState = STATE_DISCONNECTED;
srcPort = 0;
return;

View File

@ -116,7 +116,7 @@ void DirectSoundAPI::AudioThread()
if (FAILED(hr))
{
forceLog_printf("DirectSound: Dropped audio block due to locking failure");
cemuLog_log(LogType::Force, "DirectSound: Dropped audio block due to locking failure");
continue;
}

View File

@ -27,14 +27,15 @@ IAudioAPI::IAudioAPI(uint32 samplerate, uint32 channels, uint32 samples_per_bloc
void IAudioAPI::PrintLogging()
{
forceLog_printf("------- Init Audio backend -------");
forceLog_printf("DirectSound: %s", s_availableApis[DirectSound] ? "available" : "not supported");
forceLog_printf("XAudio 2.8: %s", s_availableApis[XAudio2] ? "available" : "not supported");
cemuLog_log(LogType::Force, "------- Init Audio backend -------");
cemuLog_log(LogType::Force, "DirectSound: {}", s_availableApis[DirectSound] ? "available" : "not supported");
cemuLog_log(LogType::Force, "XAudio 2.8: {}", s_availableApis[XAudio2] ? "available" : "not supported");
if (!s_availableApis[XAudio2])
{
forceLog_printf("XAudio 2.7: %s", s_availableApis[XAudio27] ? "available" : "not supported")
cemuLog_log(LogType::Force, "XAudio 2.7: {}", s_availableApis[XAudio27] ? "available" : "not supported");
}
forceLog_printf("Cubeb: %s", s_availableApis[Cubeb] ? "available" : "not supported");
cemuLog_log(LogType::Force, "Cubeb: {}", s_availableApis[Cubeb] ? "available" : "not supported");
}
void IAudioAPI::InitWFX(sint32 samplerate, sint32 channels, sint32 bits_per_sample)

View File

@ -16,8 +16,8 @@ IAudioInputAPI::IAudioInputAPI(uint32 samplerate, uint32 channels, uint32 sample
void IAudioInputAPI::PrintLogging()
{
forceLog_printf("------- Init Audio input backend -------");
forceLog_printf("Cubeb: %s", s_availableApis[Cubeb] ? "available" : "not supported");
cemuLog_log(LogType::Force, "------- Init Audio input backend -------");
cemuLog_log(LogType::Force, "Cubeb: {}", s_availableApis[Cubeb] ? "available" : "not supported");
}
void IAudioInputAPI::InitializeStatic()

View File

@ -49,8 +49,8 @@ XAudio2API::XAudio2API(std::wstring device_id, uint32 samplerate, uint32 channel
m_wfx.Format.nChannels = channels;
m_wfx.Format.nSamplesPerSec = samplerate;
m_wfx.Format.wBitsPerSample = bits_per_sample;
m_wfx.Format.nBlockAlign = (m_wfx.Format.nChannels * m_wfx.Format.wBitsPerSample) / 8; // must equal (nChannels × wBitsPerSample) / 8
m_wfx.Format.nAvgBytesPerSec = m_wfx.Format.nSamplesPerSec * m_wfx.Format.nBlockAlign; // must equal nSamplesPerSec × nBlockAlign.
m_wfx.Format.nBlockAlign = (m_wfx.Format.nChannels * m_wfx.Format.wBitsPerSample) / 8; // must equal (nChannels × wBitsPerSample) / 8
m_wfx.Format.nAvgBytesPerSec = m_wfx.Format.nSamplesPerSec * m_wfx.Format.nBlockAlign; // must equal nSamplesPerSec × nBlockAlign.
m_wfx.Format.cbSize = sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX);
m_wfx.SubFormat = KSDATAFORMAT_SUBTYPE_PCM;
@ -258,7 +258,7 @@ const std::vector<XAudio2API::DeviceDescriptionPtr>& XAudio2API::RefreshDevices(
}
catch (const std::system_error& ex)
{
forceLog_printf("XAudio2API::RefreshDevices: error while refreshing device list (%s - code: 0x%08x)", ex.what(), ex.code().value());
cemuLog_log(LogType::Force, "XAudio2API::RefreshDevices: error while refreshing device list ({} - code: 0x{:08x})", ex.what(), ex.code().value());
}
CoUninitialize();

View File

@ -33,7 +33,7 @@ ActiveSettings::LoadOnce(const fs::path& user_data_path,
}
if (!TestWriteAccess(path))
{
cemuLog_log(LogType::Force, "Failed to write to {}", path.generic_string());
cemuLog_log(LogType::Force, "Failed to write to {}", _pathToUtf8(path));
failed_write_access.insert(path);
}
}

View File

@ -28,7 +28,7 @@ void CemuConfig::SetMLCPath(fs::path path, bool save)
catch (const PSDisabledException&) {}
catch (const std::exception& ex)
{
forceLog_printf("can't store custom mlc path in permanent storage: %s", ex.what());
cemuLog_log(LogType::Force, "can't store custom mlc path in permanent storage: {}", ex.what());
}
}
@ -114,7 +114,7 @@ void CemuConfig::Load(XMLConfigParser& parser)
}
catch (const std::exception&)
{
forceLog_printf("config load error: can't load recently launched game file: %s", path.c_str());
cemuLog_log(LogType::Force, "config load error: can't load recently launched game file: {}", path);
}
}
@ -132,7 +132,7 @@ void CemuConfig::Load(XMLConfigParser& parser)
}
catch (const std::exception&)
{
forceLog_printf("config load error: can't load recently launched nfc file: %s", path.c_str());
cemuLog_log(LogType::Force, "config load error: can't load recently launched nfc file: {}", path);
}
}
@ -150,7 +150,7 @@ void CemuConfig::Load(XMLConfigParser& parser)
}
catch (const std::exception&)
{
forceLog_printf("config load error: can't load game path: %s", path.c_str());
cemuLog_log(LogType::Force, "config load error: can't load game path: {}", path);
}
}
@ -186,7 +186,7 @@ void CemuConfig::Load(XMLConfigParser& parser)
}
catch (const std::exception&)
{
forceLog_printf("config load error: can't load game cache entry: %s", rpx);
cemuLog_log(LogType::Force, "config load error: can't load game cache entry: {}", rpx);
}
}
_lock.unlock();
@ -302,7 +302,7 @@ void CemuConfig::Load(XMLConfigParser& parser)
}
catch (const std::exception&)
{
forceLog_printf("config load error: can't load tv device: %s", tv);
cemuLog_log(LogType::Force, "config load error: can't load tv device: {}", tv);
}
const auto pad = audio.get("PadDevice", "");
@ -312,7 +312,7 @@ void CemuConfig::Load(XMLConfigParser& parser)
}
catch (const std::exception&)
{
forceLog_printf("config load error: can't load pad device: %s", pad);
cemuLog_log(LogType::Force, "config load error: can't load pad device: {}", pad);
}
const auto input_device_name = audio.get("InputDevice", "");
@ -322,7 +322,7 @@ void CemuConfig::Load(XMLConfigParser& parser)
}
catch (const std::exception&)
{
forceLog_printf("config load error: can't load input device: %s", input_device_name);
cemuLog_log(LogType::Force, "config load error: can't load input device: {}", input_device_name);
}
// account

View File

@ -252,7 +252,7 @@ bool LaunchSettings::ExtractorTool(std::wstring_view wud_path, std::string_view
}
catch (const std::exception& ex)
{
forceLog_printf("can't write file: %s", ex.what());
cemuLog_log(LogType::Force, "can't write file: {}", ex.what());
puts(fmt::format("can't write file: %s\n", ex.what()).c_str());
}
}

View File

@ -25,7 +25,7 @@ PermanentStorage::~PermanentStorage()
if (ec)
{
SystemException ex(ec);
forceLog_printf("can't remove permanent storage: %s", ex.what());
cemuLog_log(LogType::Force, "can't remove permanent storage: {}", ex.what());
}
}
}

View File

@ -390,7 +390,7 @@ public:
fs::create_directories(fs::path(filename).parent_path(), err);
if (err)
{
forceLog_printf("can't create parent path for save file: %s", err.message().c_str());
cemuLog_log(LogType::Force, "can't create parent path for save file: {}", err.message());
return false;
}

View File

@ -130,7 +130,7 @@ bool CemuUpdateWindow::QueryUpdateInfo(std::string& downloadUrlOut, std::string&
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &http_code);
if (http_code != 0 && http_code != 200)
{
forceLog_printf("Update check failed (http code: %d)", http_code);
cemuLog_log(LogType::Force, "Update check failed (http code: {})", http_code);
cemu_assert_debug(false);
return false;
}
@ -154,7 +154,7 @@ bool CemuUpdateWindow::QueryUpdateInfo(std::string& downloadUrlOut, std::string&
}
else
{
forceLog_printf("Update check failed with CURL error %d", (int)cr);
cemuLog_log(LogType::Force, "Update check failed with CURL error {}", (int)cr);
cemu_assert_debug(false);
}
@ -261,7 +261,7 @@ bool CemuUpdateWindow::DownloadCemuZip(const std::string& url, const fs::path& f
}
catch (const std::exception& ex)
{
forceLog_printf("can't remove update.zip on error: %s", ex.what());
cemuLog_log(LogType::Force, "can't remove update.zip on error: {}", ex.what());
}
}
return result;
@ -309,13 +309,13 @@ bool CemuUpdateWindow::ExtractUpdate(const fs::path& zipname, const fs::path& ta
catch (const std::exception& ex)
{
SystemException sys(ex);
forceLog_printf("can't create folder \"%s\" for update: %s", sb.name, sys.what());
cemuLog_log(LogType::Force, "can't create folder \"{}\" for update: {}", sb.name, sys.what());
}
// the root should have only one Cemu_... directory, we track it here
if ((std::count(sb.name, sb.name + len, '/') + std::count(sb.name, sb.name + len, '\\')) == 1)
{
if (!cemuFolderName.empty())
forceLog_printf("update zip has multiple folders in root");
cemuLog_log(LogType::Force, "update zip has multiple folders in root");
cemuFolderName.assign(sb.name, len - 1);
}
continue;
@ -325,7 +325,7 @@ bool CemuUpdateWindow::ExtractUpdate(const fs::path& zipname, const fs::path& ta
auto* zf = zip_fopen_index(za, i, 0);
if (!zf)
{
forceLog_printf("can't open zip file \"%s\"", sb.name);
cemuLog_log(LogType::Force, "can't open zip file \"{}\"", sb.name);
zip_close(za);
return false;
}
@ -334,7 +334,7 @@ bool CemuUpdateWindow::ExtractUpdate(const fs::path& zipname, const fs::path& ta
const auto read = zip_fread(zf, buffer.data(), sb.size);
if (read != (sint64)sb.size)
{
forceLog_printf("could only read 0x%x of 0x%x bytes from zip file \"%s\"", read, sb.size, sb.name);
cemuLog_log(LogType::Force, "could only read 0x{:x} of 0x{:x} bytes from zip file \"{}\"", read, sb.size, sb.name);
zip_close(za);
return false;
}
@ -342,7 +342,7 @@ bool CemuUpdateWindow::ExtractUpdate(const fs::path& zipname, const fs::path& ta
auto* file = fopen(fname.string().c_str(), "wb");
if (file == nullptr)
{
forceLog_printf("can't create update file \"%s\"", sb.name);
cemuLog_log(LogType::Force, "can't create update file \"{}\"", sb.name);
zip_close(za);
return false;
}
@ -460,7 +460,7 @@ void CemuUpdateWindow::WorkerThread()
catch (const std::exception& ex)
{
SystemException sys(ex);
forceLog_printf("can't remove extracted tmp files: %s", sys.what());
cemuLog_log(LogType::Force, "can't remove extracted tmp files: {}", sys.what());
}
}
@ -506,7 +506,7 @@ void CemuUpdateWindow::WorkerThread()
catch (const std::exception& ex)
{
SystemException sys(ex);
forceLog_printf("applying update error: %s", sys.what());
cemuLog_log(LogType::Force, "applying update error: {}", sys.what());
}
if ((counter++ % 10) == 0)
@ -529,7 +529,7 @@ void CemuUpdateWindow::WorkerThread()
catch (const std::exception& ex)
{
SystemException sys(ex);
forceLog_printf("update error: %s", sys.what());
cemuLog_log(LogType::Force, "update error: {}", sys.what());
// clean leftovers
if (exists(tmppath))

View File

@ -335,7 +335,7 @@ void ChecksumTool::LoadOnlineData() const
}
catch(const std::exception& ex)
{
forceLog_printf("error on updating json checksum data: %s", ex.what());
cemuLog_log(LogType::Force, "error on updating json checksum data: {}", ex.what());
}
wxQueueEvent(m_verify_online, new wxCommandEvent(wxEVT_ENABLE));

View File

@ -136,7 +136,7 @@ void DownloadGraphicPacksWindow::UpdateThread()
else
{
// cemu api request failed, use hardcoded github url
forceLog_printf("Graphic pack update request failed or returned invalid URL. Using default repository URL instead");
cemuLog_log(LogType::Force, "Graphic pack update request failed or returned invalid URL. Using default repository URL instead");
githubAPIUrl = "https://api.github.com/repos/slashiee/cemu_graphic_packs/releases/latest";
}
// github API request

View File

@ -105,7 +105,7 @@ bool GameUpdateWindow::ParseUpdate(const fs::path& metaPath)
}
catch (const std::exception& ex)
{
forceLog_printf("GameUpdateWindow::ParseUpdate exist-error: %s at %s", ex.what(), target_location.generic_u8string().c_str());
cemuLog_log(LogType::Force, "GameUpdateWindow::ParseUpdate exist-error: {} at {}", ex.what(), _pathToUtf8(target_location));
}
}

View File

@ -1276,7 +1276,7 @@ void GeneralSettings2::OnAccountDelete(wxCommandEvent& event)
catch(const std::exception& ex)
{
SystemException sys(ex);
forceLog_printf((char*)sys.what());
cemuLog_log(LogType::Force, sys.what());
}
}
@ -1743,7 +1743,7 @@ void GeneralSettings2::UpdateAudioDevice()
}
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());
}
}
}
@ -1792,7 +1792,7 @@ void GeneralSettings2::UpdateAudioDevice()
}
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());
}
}
}
@ -1840,7 +1840,7 @@ void GeneralSettings2::UpdateAudioDevice()
}
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());
}
}
}

View File

@ -1035,7 +1035,7 @@ void MainWindow::OnDebugSetting(wxCommandEvent& event)
catch (const std::exception& ex)
{
SystemException sys(ex);
forceLog_printf("error when creating dump curl folder: %s", sys.what());
cemuLog_log(LogType::Force, "error when creating dump curl folder: {}", sys.what());
ActiveSettings::EnableDumpLibcurlRequests(false);
}
}
@ -1092,7 +1092,7 @@ void MainWindow::OnDebugDumpUsedTextures(wxCommandEvent& event)
catch (const std::exception& ex)
{
SystemException sys(ex);
forceLog_printf("can't create texture dump folder: %s", ex.what());
cemuLog_log(LogType::Force, "can't create texture dump folder: {}", ex.what());
ActiveSettings::EnableDumpTextures(false);
}
}
@ -1113,7 +1113,7 @@ void MainWindow::OnDebugDumpUsedShaders(wxCommandEvent& event)
catch (const std::exception & ex)
{
SystemException sys(ex);
forceLog_printf("can't create shaders dump folder: %s", ex.what());
cemuLog_log(LogType::Force, "can't create shaders dump folder: {}", ex.what());
ActiveSettings::EnableDumpShaders(false);
}
}

View File

@ -535,7 +535,7 @@ void TitleManager::OnSaveDelete(wxCommandEvent& event)
}
if (!meta_file_edited)
forceLog_printf("TitleManager::OnSaveDelete: couldn't delete save entry in saveinfo.xml: %s", saveinfo.generic_u8string().c_str());
cemuLog_log(LogType::Force, "TitleManager::OnSaveDelete: couldn't delete save entry in saveinfo.xml: {}", _pathToUtf8(saveinfo));
// remove from title entry
auto& persistent_ids = entry->persistent_ids;

View File

@ -37,7 +37,7 @@ VulkanCanvas::VulkanCanvas(wxWindow* parent, const wxSize& size, bool is_main_wi
catch(const std::exception& ex)
{
const auto msg = fmt::format(fmt::runtime(_("Error when initializing Vulkan renderer:\n{}").ToStdString()), ex.what());
forceLog_printf(const_cast<char*>(msg.c_str()));
cemuLog_log(LogType::Force, msg);
wxMessageDialog dialog(this, msg, _("Error"), wxOK | wxCENTRE | wxICON_ERROR);
dialog.ShowModal();
exit(0);

View File

@ -875,7 +875,7 @@ void wxTitleManagerList::OnContextMenuSelected(wxCommandEvent& event)
}
catch (const std::exception& ex)
{
forceLog_printf("wxTitleManagerList::OnContextMenuSelected: can't launch title: %s", ex.what());
cemuLog_log(LogType::Force, "wxTitleManagerList::OnContextMenuSelected: can't launch title: {}", ex.what());
}
}
break;

View File

@ -232,7 +232,7 @@ void SaveImportWindow::OnImport(wxCommandEvent& event)
zip_stat_t sb{};
if (zip_stat_index(zip, i, 0, &sb) != 0)
{
forceLog_printf("zip stat index failed on %d entry", i);
cemuLog_log(LogType::Force, "zip stat index failed on {} entry", i);
continue;
}
@ -251,7 +251,7 @@ void SaveImportWindow::OnImport(wxCommandEvent& event)
{
fs::create_directories(path, ec);
if (ec)
forceLog_printf("can't create directory %s: %s", sb.name, ec.message().c_str());
cemuLog_log(LogType::Force, "can't create directory {}: {}", sb.name, ec.message());
continue;
}
@ -307,7 +307,7 @@ void SaveImportWindow::OnImport(wxCommandEvent& event)
timestamp.text().set(fmt::format("{:016x}", coreinit::coreinit_getOSTime() / ESPRESSO_TIMER_CLOCK).c_str()); // TODO time not initialized yet?
if(!doc.save_file(saveinfo.c_str()))
forceLog_printf("couldn't insert save entry in saveinfo.xml: %s", saveinfo.generic_u8string().c_str());
cemuLog_log(LogType::Force, "couldn't insert save entry in saveinfo.xml: {}", _pathToUtf8(saveinfo));
}
}
}

Some files were not shown because too many files have changed in this diff Show More