@@ -128,11 +128,11 @@ void Interpreter::subfic(UGeckoInstruction inst)

void Interpreter::twi(UGeckoInstruction inst)
{
s32 a = rGPR[inst.RA];
s32 b = inst.SIMM_16;
s32 TO = inst.TO;
const s32 a = rGPR[inst.RA];
const s32 b = inst.SIMM_16;
const s32 TO = inst.TO;

DEBUG_LOG(POWERPC, "twi rA %x SIMM %x TO %0x", a, b, TO);
DEBUG_LOG_FMT(POWERPC, "twi rA {:x} SIMM {:x} TO {:x}", a, b, TO);

if (((a < b) && (TO & 0x10)) || ((a > b) && (TO & 0x08)) || ((a == b) && (TO & 0x04)) ||
(((u32)a < (u32)b) && (TO & 0x02)) || (((u32)a > (u32)b) && (TO & 0x01)))
@@ -371,11 +371,11 @@ void Interpreter::srwx(UGeckoInstruction inst)

void Interpreter::tw(UGeckoInstruction inst)
{
s32 a = rGPR[inst.RA];
s32 b = rGPR[inst.RB];
s32 TO = inst.TO;
const s32 a = rGPR[inst.RA];
const s32 b = rGPR[inst.RB];
const s32 TO = inst.TO;

DEBUG_LOG(POWERPC, "tw rA %0x rB %0x TO %0x", a, b, TO);
DEBUG_LOG_FMT(POWERPC, "tw rA {:x} rB {:x} TO {:x}", a, b, TO);

if (((a < b) && (TO & 0x10)) || ((a > b) && (TO & 0x08)) || ((a == b) && (TO & 0x04)) ||
(((u32)a < (u32)b) && (TO & 0x02)) || (((u32)a > (u32)b) && (TO & 0x01)))
@@ -268,8 +268,8 @@ void Interpreter::lmw(UGeckoInstruction inst)

if (PowerPC::ppcState.Exceptions & EXCEPTION_DSI)
{
PanicAlert("DSI exception in lmw");
NOTICE_LOG(POWERPC, "DSI exception in lmw");
PanicAlertFmt("DSI exception in lmw");
NOTICE_LOG_FMT(POWERPC, "DSI exception in lmw");
return;
}
else
@@ -295,8 +295,8 @@ void Interpreter::stmw(UGeckoInstruction inst)
PowerPC::Write_U32(rGPR[i], address);
if (PowerPC::ppcState.Exceptions & EXCEPTION_DSI)
{
PanicAlert("DSI exception in stmw");
NOTICE_LOG(POWERPC, "DSI exception in stmw");
PanicAlertFmt("DSI exception in stmw");
NOTICE_LOG_FMT(POWERPC, "DSI exception in stmw");
return;
}
}
@@ -689,7 +689,7 @@ void Interpreter::lswx(UGeckoInstruction inst)
// Not64 (Homebrew N64 Emulator for Wii) triggers the following case.
if (PowerPC::ppcState.Exceptions & EXCEPTION_DSI)
{
NOTICE_LOG(POWERPC, "DSI exception in lswx");
NOTICE_LOG_FMT(POWERPC, "DSI exception in lswx");
return;
}
rGPR[reg] |= temp_value;
@@ -878,7 +878,7 @@ void Interpreter::lswi(UGeckoInstruction inst)
const u32 temp_value = PowerPC::Read_U8(EA) << (24 - i);
if (PowerPC::ppcState.Exceptions & EXCEPTION_DSI)
{
PanicAlert("DSI exception in lsw.");
PanicAlertFmt("DSI exception in lsw.");
return;
}

@@ -293,7 +293,7 @@ void Interpreter::mtspr(UGeckoInstruction inst)
{
case SPR_TL:
case SPR_TU:
PanicAlert("Illegal Write to TL/TU");
PanicAlertFmt("Illegal Write to TL/TU");
break;

case SPR_TL_W:
@@ -317,16 +317,16 @@ void Interpreter::mtspr(UGeckoInstruction inst)
old_hid0.Hex = old_value;
if (HID0.ICE != old_hid0.ICE)
{
INFO_LOG(POWERPC, "Instruction Cache Enable (HID0.ICE) = %d", (int)HID0.ICE);
INFO_LOG_FMT(POWERPC, "Instruction Cache Enable (HID0.ICE) = {}", HID0.ICE);
}
if (HID0.ILOCK != old_hid0.ILOCK)
{
INFO_LOG(POWERPC, "Instruction Cache Lock (HID0.ILOCK) = %d", (int)HID0.ILOCK);
INFO_LOG_FMT(POWERPC, "Instruction Cache Lock (HID0.ILOCK) = {}", HID0.ILOCK);
}
if (HID0.ICFI)
{
HID0.ICFI = 0;
INFO_LOG(POWERPC, "Flush Instruction Cache! ICE=%d", (int)HID0.ICE);
INFO_LOG_FMT(POWERPC, "Flush Instruction Cache! ICE={}", HID0.ICE);
// this is rather slow
// most games do it only once during initialization
PowerPC::ppcState.iCache.Reset();
@@ -352,7 +352,7 @@ void Interpreter::mtspr(UGeckoInstruction inst)
case SPR_HID4:
if (old_value != rSPR(index))
{
INFO_LOG(POWERPC, "HID4 updated %x %x", old_value, rSPR(index));
INFO_LOG_FMT(POWERPC, "HID4 updated {:x} {:x}", old_value, rSPR(index));
PowerPC::IBATUpdated();
PowerPC::DBATUpdated();
}
@@ -399,7 +399,7 @@ void Interpreter::mtspr(UGeckoInstruction inst)
case SPR_DEC:
if (!(old_value >> 31) && (rGPR[inst.RD] >> 31)) // top bit from 0 to 1
{
INFO_LOG(POWERPC, "Software triggered Decrementer exception");
INFO_LOG_FMT(POWERPC, "Software triggered Decrementer exception");
PowerPC::ppcState.Exceptions |= EXCEPTION_DECREMENTER;
}
SystemTimers::DecrementerSet();
@@ -432,7 +432,7 @@ void Interpreter::mtspr(UGeckoInstruction inst)
case SPR_DBAT7U:
if (old_value != rSPR(index))
{
INFO_LOG(POWERPC, "DBAT updated %u %x %x", index, old_value, rSPR(index));
INFO_LOG_FMT(POWERPC, "DBAT updated {} {:x} {:x}", index, old_value, rSPR(index));
PowerPC::DBATUpdated();
}
break;
@@ -455,7 +455,7 @@ void Interpreter::mtspr(UGeckoInstruction inst)
case SPR_IBAT7U:
if (old_value != rSPR(index))
{
INFO_LOG(POWERPC, "IBAT updated %u %x %x", index, old_value, rSPR(index));
INFO_LOG_FMT(POWERPC, "IBAT updated {} {:x} {:x}", index, old_value, rSPR(index));
PowerPC::IBATUpdated();
}
break;
@@ -195,7 +195,8 @@ bool Jit64::HandleStackFault()
if (!m_enable_blr_optimization || !Core::IsCPUThread())
return false;

WARN_LOG(POWERPC, "BLR cache disabled due to excessive BL in the emulated program.");
WARN_LOG_FMT(POWERPC, "BLR cache disabled due to excessive BL in the emulated program.");

m_enable_blr_optimization = false;
#ifndef _WIN32
// Windows does this automatically.
@@ -248,7 +249,7 @@ bool Jit64::BackPatch(u32 emAddress, SContext* ctx)
auto it = m_back_patch_info.find(codePtr);
if (it == m_back_patch_info.end())
{
PanicAlert("BackPatch: no register use entry for address %p", codePtr);
PanicAlertFmt("BackPatch: no register use entry for address {}", fmt::ptr(codePtr));
return false;
}

@@ -481,7 +482,7 @@ static void ImHere()
if ((been_here.find(PC)->second) & 1023)
return;
}
INFO_LOG(DYNA_REC, "I'm here - PC = %08x , LR = %08x", PC, LR);
INFO_LOG_FMT(DYNA_REC, "I'm here - PC = {:08x} , LR = {:08x}", PC, LR);
been_here[PC] = 1;
}

@@ -728,9 +729,10 @@ void Jit64::Trace()
}
#endif

DEBUG_LOG(DYNA_REC, "JIT64 PC: %08x SRR0: %08x SRR1: %08x FPSCR: %08x MSR: %08x LR: %08x %s %s",
PC, SRR0, SRR1, FPSCR.Hex, MSR.Hex, PowerPC::ppcState.spr[8], regs.c_str(),
fregs.c_str());
DEBUG_LOG_FMT(DYNA_REC,
"JIT64 PC: {:08x} SRR0: {:08x} SRR1: {:08x} FPSCR: {:08x} "
"MSR: {:08x} LR: {:08x} {} {}",
PC, SRR0, SRR1, FPSCR.Hex, MSR.Hex, PowerPC::ppcState.spr[8], regs, fregs);
}

void Jit64::Jit(u32 em_address)
@@ -754,7 +756,7 @@ void Jit64::Jit(u32 em_address, bool clear_cache_and_retry_on_failure)
{
if (!SConfig::GetInstance().bJITNoBlockCache)
{
WARN_LOG(POWERPC, "flushing trampoline code cache, please report if this happens a lot");
WARN_LOG_FMT(POWERPC, "flushing trampoline code cache, please report if this happens a lot");
}
ClearCache();
}
@@ -805,7 +807,7 @@ void Jit64::Jit(u32 em_address, bool clear_cache_and_retry_on_failure)
NPC = nextPC;
PowerPC::ppcState.Exceptions |= EXCEPTION_ISI;
PowerPC::CheckExceptions();
WARN_LOG(POWERPC, "ISI exception at 0x%08x", nextPC);
WARN_LOG_FMT(POWERPC, "ISI exception at {:#010x}", nextPC);
return;
}

@@ -843,33 +845,34 @@ void Jit64::Jit(u32 em_address, bool clear_cache_and_retry_on_failure)
{
// Code generation failed due to not enough free space in either the near or far code regions.
// Clear the entire JIT cache and retry.
WARN_LOG(POWERPC, "flushing code caches, please report if this happens a lot");
WARN_LOG_FMT(POWERPC, "flushing code caches, please report if this happens a lot");
ClearCache();
Jit(em_address, false);
return;
}

PanicAlertT("JIT failed to find code space after a cache clear. This should never happen. Please "
"report this incident on the bug tracker. Dolphin will now exit.");
exit(-1);
PanicAlertFmtT(
"JIT failed to find code space after a cache clear. This should never happen. Please "
"report this incident on the bug tracker. Dolphin will now exit.");
std::exit(-1);
}

bool Jit64::SetEmitterStateToFreeCodeRegion()
{
// Find the largest free memory blocks and set code emitters to point at them.
// If we can't find a free block return false instead, which will trigger a JIT cache clear.
auto free_near = m_free_ranges_near.by_size_begin();
const auto free_near = m_free_ranges_near.by_size_begin();
if (free_near == m_free_ranges_near.by_size_end())
{
WARN_LOG(POWERPC, "Failed to find free memory region in near code region.");
WARN_LOG_FMT(POWERPC, "Failed to find free memory region in near code region.");
return false;
}
SetCodePtr(free_near.from(), free_near.to());

auto free_far = m_free_ranges_far.by_size_begin();
const auto free_far = m_free_ranges_far.by_size_begin();
if (free_far == m_free_ranges_far.by_size_end())
{
WARN_LOG(POWERPC, "Failed to find free memory region in far code region.");
WARN_LOG_FMT(POWERPC, "Failed to find free memory region in far code region.");
return false;
}
m_far_code.SetCodePtr(free_far.from(), free_far.to());
@@ -1163,8 +1166,8 @@ bool Jit64::DoJit(u32 em_address, JitBlock* b, u32 nextPC)
#if defined(_DEBUG) || defined(DEBUGFAST)
if (!gpr.SanityCheck() || !fpr.SanityCheck())
{
std::string ppc_inst = Common::GekkoDisassembler::Disassemble(op.inst.hex, em_address);
NOTICE_LOG(DYNA_REC, "Unflushed register: %s", ppc_inst.c_str());
const std::string ppc_inst = Common::GekkoDisassembler::Disassemble(op.inst.hex, em_address);
NOTICE_LOG_FMT(DYNA_REC, "Unflushed register: {}", ppc_inst);
}
#endif
i += js.skipInstructions;
@@ -1181,9 +1184,9 @@ bool Jit64::DoJit(u32 em_address, JitBlock* b, u32 nextPC)
if (HasWriteFailed() || m_far_code.HasWriteFailed())
{
if (HasWriteFailed())
WARN_LOG(POWERPC, "JIT ran out of space in near code region during code generation.");
WARN_LOG_FMT(POWERPC, "JIT ran out of space in near code region during code generation.");
if (m_far_code.HasWriteFailed())
WARN_LOG(POWERPC, "JIT ran out of space in far code region during code generation.");
WARN_LOG_FMT(POWERPC, "JIT ran out of space in far code region during code generation.");

return false;
}
@@ -1282,7 +1285,7 @@ void LogGeneratedX86(size_t size, const PPCAnalyst::CodeBuffer& code_buffer, con
{
const PPCAnalyst::CodeOp& op = code_buffer[i];
const std::string disasm = Common::GekkoDisassembler::Disassemble(op.inst.hex, op.address);
DEBUG_LOG(DYNA_REC, "IR_X86 PPC: %08x %s\n", op.address, disasm.c_str());
DEBUG_LOG_FMT(DYNA_REC, "IR_X86 PPC: {:08x} {}\n", op.address, disasm);
}

disassembler x64disasm;
@@ -1295,7 +1298,7 @@ void LogGeneratedX86(size_t size, const PPCAnalyst::CodeBuffer& code_buffer, con
{
char sptr[1000] = "";
disasmPtr += x64disasm.disasm64(disasmPtr, disasmPtr, reinterpret_cast<u8*>(disasmPtr), sptr);
DEBUG_LOG(DYNA_REC, "IR_X86 x86: %s", sptr);
DEBUG_LOG_FMT(DYNA_REC, "IR_X86 x86: {}", sptr);
}

if (b->codeSize <= 250)
@@ -1308,6 +1311,6 @@ void LogGeneratedX86(size_t size, const PPCAnalyst::CodeBuffer& code_buffer, con
ss.fill('0');
ss << static_cast<u32>(*(normalEntry + i));
}
DEBUG_LOG(DYNA_REC, "IR_X86 bin: %s\n\n\n", ss.str().c_str());
DEBUG_LOG_FMT(DYNA_REC, "IR_X86 bin: {}\n\n\n", ss.str());
}
}
@@ -404,7 +404,7 @@ void Jit64::fsign(UGeckoInstruction inst)
packed);
break;
default:
PanicAlert("fsign bleh");
PanicAlertFmt("fsign bleh");
break;
}
}
@@ -401,7 +401,7 @@ void Jit64::DoMergedBranch()
}
else
{
PanicAlert("WTF invalid branch");
PanicAlertFmt("WTF invalid branch");
}
}

@@ -516,7 +516,7 @@ void Jit64::cmpXX(UGeckoInstruction inst)

default:
signedCompare = false; // silence compiler warning
PanicAlert("cmpXX");
PanicAlertFmt("cmpXX");
}

if (gpr.IsImm(a) && comparand.IsImm())
@@ -689,7 +689,7 @@ void Jit64::boolX(UGeckoInstruction inst)
}
else
{
PanicAlert("WTF!");
PanicAlertFmt("WTF!");
}
}
else if ((a == s) || (a == b))
@@ -763,7 +763,7 @@ void Jit64::boolX(UGeckoInstruction inst)
}
else
{
PanicAlert("WTF");
PanicAlertFmt("WTF");
}
}
else
@@ -829,7 +829,7 @@ void Jit64::boolX(UGeckoInstruction inst)
}
else
{
PanicAlert("WTF!");
PanicAlertFmt("WTF!");
}
}
if (inst.Rc)
@@ -100,12 +100,12 @@ void Jit64::lXXx(UGeckoInstruction inst)
break;

default:
PanicAlert("Invalid instruction");
PanicAlertFmt("Invalid instruction");
}
break;

default:
PanicAlert("Invalid instruction");
PanicAlertFmt("Invalid instruction");
}

// PowerPC has no 8-bit sign extended load, but x86 does, so merge extsb with the load if we find
@@ -150,7 +150,7 @@ void Jit64::lXXx(UGeckoInstruction inst)
}
else if (update && ((a == 0) || (d == a)))
{
PanicAlert("Invalid instruction");
PanicAlertFmt("Invalid instruction");
}
else
{
@@ -360,7 +360,7 @@ void Jit64::stX(UGeckoInstruction inst)
bool update = (inst.OPCD & 1) && offset;

if (!a && update)
PanicAlert("Invalid stX");
PanicAlertFmt("Invalid stX");

int accessSize;
switch (inst.OPCD & ~1)
@@ -452,7 +452,7 @@ void Jit64::stXx(UGeckoInstruction inst)
accessSize = 8;
break;
default:
PanicAlert("stXx: invalid access size");
PanicAlertFmt("stXx: invalid access size");
accessSize = 0;
break;
}
@@ -74,7 +74,7 @@ void Jit64::ps_sum(UGeckoInstruction inst)
}
break;
default:
PanicAlert("ps_sum WTF!!!");
PanicAlertFmt("ps_sum WTF!!!");
}
HandleNaNs(inst, Rd, tmp, tmp == XMM1 ? XMM0 : XMM1);
ForceSinglePrecision(Rd, Rd);
@@ -106,7 +106,7 @@ void Jit64::ps_muls(UGeckoInstruction inst)
avx_op(&XEmitter::VSHUFPD, &XEmitter::SHUFPD, XMM1, Rc, Rc, 3);
break;
default:
PanicAlert("ps_muls WTF!!!");
PanicAlertFmt("ps_muls WTF!!!");
}
if (round_input)
Force25BitPrecision(XMM1, R(XMM1), XMM0);
@@ -41,7 +41,7 @@ const u8* TrampolineCache::GenerateTrampoline(const TrampolineInfo& info)
const u8* TrampolineCache::GenerateReadTrampoline(const TrampolineInfo& info)
{
if (GetSpaceLeft() < 1024)
PanicAlert("Trampoline cache full");
PanicAlertFmt("Trampoline cache full");

const u8* trampoline = GetCodePtr();

@@ -57,7 +57,7 @@ const u8* TrampolineCache::GenerateReadTrampoline(const TrampolineInfo& info)
const u8* TrampolineCache::GenerateWriteTrampoline(const TrampolineInfo& info)
{
if (GetSpaceLeft() < 1024)
PanicAlert("Trampoline cache full");
PanicAlertFmt("Trampoline cache full");

const u8* trampoline = GetCodePtr();

@@ -78,7 +78,7 @@ bool JitArm64::HandleFault(uintptr_t access_address, SContext* ctx)
// We can't handle any fault from other threads.
if (!Core::IsCPUThread())
{
ERROR_LOG(DYNA_REC, "Exception handler - Not on CPU thread");
ERROR_LOG_FMT(DYNA_REC, "Exception handler - Not on CPU thread");
DoBacktrace(access_address, ctx);
return false;
}
@@ -97,7 +97,7 @@ bool JitArm64::HandleFault(uintptr_t access_address, SContext* ctx)

if (!success)
{
ERROR_LOG(DYNA_REC, "Exception handler - Unhandled fault");
ERROR_LOG_FMT(DYNA_REC, "Exception handler - Unhandled fault");
DoBacktrace(access_address, ctx);
}
return success;
@@ -108,7 +108,7 @@ bool JitArm64::HandleStackFault()
if (!m_enable_blr_optimization)
return false;

ERROR_LOG(POWERPC, "BLR cache disabled due to excessive BL in the emulated program.");
ERROR_LOG_FMT(POWERPC, "BLR cache disabled due to excessive BL in the emulated program.");
m_enable_blr_optimization = false;
#ifndef _WIN32
Common::UnWriteProtectMemory(m_stack_base + GUARD_OFFSET, GUARD_SIZE);
@@ -228,8 +228,8 @@ void JitArm64::DoNothing(UGeckoInstruction inst)

void JitArm64::Break(UGeckoInstruction inst)
{
WARN_LOG(DYNA_REC, "Breaking! %08x - Fix me ;)", inst.hex);
exit(0);
WARN_LOG_FMT(DYNA_REC, "Breaking! {:08x} - Fix me ;)", inst.hex);
std::exit(0);
}

void JitArm64::Cleanup()
@@ -505,8 +505,8 @@ void JitArm64::DumpCode(const u8* start, const u8* end)
{
std::string output;
for (const u8* code = start; code < end; code += sizeof(u32))
output += StringFromFormat("%08x", Common::swap32(code));
WARN_LOG(DYNA_REC, "Code dump from %p to %p:\n%s", start, end, output.c_str());
output += fmt::format("{:08x}", Common::swap32(code));
WARN_LOG_FMT(DYNA_REC, "Code dump from {} to {}:\n{}", fmt::ptr(start), fmt::ptr(end), output);
}

void JitArm64::BeginTimeProfile(JitBlock* b)
@@ -593,7 +593,7 @@ void JitArm64::Jit(u32)
NPC = nextPC;
PowerPC::ppcState.Exceptions |= EXCEPTION_ISI;
PowerPC::CheckExceptions();
WARN_LOG(POWERPC, "ISI exception at 0x%08x", nextPC);
WARN_LOG_FMT(POWERPC, "ISI exception at {:#010x}", nextPC);
return;
}

@@ -607,7 +607,7 @@ void JitArm64::DoJit(u32 em_address, JitBlock* b, u32 nextPC)
if (em_address == 0)
{
Core::SetState(Core::State::Paused);
WARN_LOG(DYNA_REC, "ERROR: Compiling at 0. LR=%08x CTR=%08x", LR, CTR);
WARN_LOG_FMT(DYNA_REC, "ERROR: Compiling at 0. LR={:08x} CTR={:08x}", LR, CTR);
}

js.isLastInstruction = false;
@@ -24,28 +24,30 @@ using namespace Arm64Gen;
void JitArm64::DoBacktrace(uintptr_t access_address, SContext* ctx)
{
for (int i = 0; i < 30; i += 2)
ERROR_LOG(DYNA_REC, "R%d: 0x%016llx\tR%d: 0x%016llx", i, ctx->CTX_REG(i), i + 1,
ctx->CTX_REG(i + 1));
{
ERROR_LOG_FMT(DYNA_REC, "R{}: {:#018x}\tR{}: {:#018x}", i, ctx->CTX_REG(i), i + 1,
ctx->CTX_REG(i + 1));
}

ERROR_LOG(DYNA_REC, "R30: 0x%016llx\tSP: 0x%016llx", ctx->CTX_LR, ctx->CTX_SP);
ERROR_LOG_FMT(DYNA_REC, "R30: {:#018x}\tSP: {:#018x}", ctx->CTX_LR, ctx->CTX_SP);

ERROR_LOG(DYNA_REC, "Access Address: 0x%016lx", access_address);
ERROR_LOG(DYNA_REC, "PC: 0x%016llx", ctx->CTX_PC);
ERROR_LOG_FMT(DYNA_REC, "Access Address: {:#018x}", access_address);
ERROR_LOG_FMT(DYNA_REC, "PC: {:#018x}", ctx->CTX_PC);

ERROR_LOG(DYNA_REC, "Memory Around PC");
ERROR_LOG_FMT(DYNA_REC, "Memory Around PC");

std::string pc_memory = "";
std::string pc_memory;
for (u64 pc = (ctx->CTX_PC - 32); pc < (ctx->CTX_PC + 32); pc += 16)
{
pc_memory += StringFromFormat("%08x%08x%08x%08x", Common::swap32(*(u32*)pc),
Common::swap32(*(u32*)(pc + 4)), Common::swap32(*(u32*)(pc + 8)),
Common::swap32(*(u32*)(pc + 12)));
pc_memory += fmt::format("{:08x}{:08x}{:08x}{:08x}", Common::swap32(*(u32*)pc),
Common::swap32(*(u32*)(pc + 4)), Common::swap32(*(u32*)(pc + 8)),
Common::swap32(*(u32*)(pc + 12)));

ERROR_LOG(DYNA_REC, "0x%016" PRIx64 ": %08x %08x %08x %08x", pc, *(u32*)pc, *(u32*)(pc + 4),
*(u32*)(pc + 8), *(u32*)(pc + 12));
ERROR_LOG_FMT(DYNA_REC, "{:#018x}: {:08x} {:08x} {:08x} {:08x}", pc, *(u32*)pc, *(u32*)(pc + 4),
*(u32*)(pc + 8), *(u32*)(pc + 12));
}

ERROR_LOG(DYNA_REC, "Full block: %s", pc_memory.c_str());
ERROR_LOG_FMT(DYNA_REC, "Full block: {}", pc_memory);
}

void JitArm64::EmitBackpatchRoutine(u32 flags, bool fastmem, bool do_farcode, ARM64Reg RS,
@@ -294,9 +296,9 @@ bool JitArm64::HandleFastmemFault(uintptr_t access_address, SContext* ctx)
!(access_address >= (uintptr_t)Memory::logical_base &&
access_address < (uintptr_t)Memory::logical_base + 0x100010000))
{
ERROR_LOG(DYNA_REC,
"Exception handler - access below memory space. PC: 0x%016llx 0x%016lx < 0x%016lx",
ctx->CTX_PC, access_address, (uintptr_t)Memory::physical_base);
ERROR_LOG_FMT(DYNA_REC,
"Exception handler - access below memory space. PC: {:#018x} {:#018x} < {:#018x}",
ctx->CTX_PC, access_address, (uintptr_t)Memory::physical_base);
return false;
}

@@ -253,7 +253,7 @@ void JitArm64::boolX(UGeckoInstruction inst)
}
else
{
PanicAlert("WTF!");
PanicAlertFmt("WTF!");
}
}
else
@@ -295,7 +295,7 @@ void JitArm64::boolX(UGeckoInstruction inst)
}
else
{
PanicAlert("WTF!");
PanicAlertFmt("WTF!");
}
if (inst.Rc)
ComputeRC0(gpr.R(a));
@@ -41,7 +41,7 @@ ARM64Reg Arm64RegCache::GetReg()
// Holy cow, how did you run out of registers?
// We can't return anything reasonable in this case. Return INVALID_REG and watch the failure
// happen
WARN_LOG(DYNA_REC, "All available registers are locked dumb dumb");
WARN_LOG_FMT(DYNA_REC, "All available registers are locked dumb dumb");
return INVALID_REG;
}

@@ -278,7 +278,7 @@ ARM64Reg Arm64GPRCache::R(const GuestRegInfo& guest_reg)
}
break;
default:
ERROR_LOG(DYNA_REC, "Invalid OpArg Type!");
ERROR_LOG_FMT(DYNA_REC, "Invalid OpArg Type!");
break;
}
// We've got an issue if we end up here
@@ -70,7 +70,7 @@ void JitArm64::GenerateAsm()
// } while (CPU::GetState() == CPU::State::Running);
AlignCodePage();
dispatcher = GetCodePtr();
WARN_LOG(DYNA_REC, "Dispatcher is %p", dispatcher);
WARN_LOG_FMT(DYNA_REC, "Dispatcher is {}", fmt::ptr(dispatcher));

// Downcount Check
// The result of slice decrementation should be in flags if somebody jumped here
@@ -71,9 +71,9 @@ CPUCoreBase* InitJitCore(PowerPC::CPUCore core)
break;

default:
PanicAlertT("The selected CPU emulation core (%d) is not available. "
"Please select a different CPU emulation core in the settings.",
static_cast<int>(core));
PanicAlertFmtT("The selected CPU emulation core ({0}) is not available. "
"Please select a different CPU emulation core in the settings.",
core);
g_jit = nullptr;
return nullptr;
}
@@ -102,7 +102,7 @@ void WriteProfileResults(const std::string& filename)
File::IOFile f(filename, "w");
if (!f)
{
PanicAlert("Failed to open %s", filename.c_str());
PanicAlertFmt("Failed to open {}", filename);
return;
}
f.WriteString("origAddr\tblkName\trunCount\tcost\ttimeCost\tpercent\ttimePercent\tOvAllinBlkTime("
@@ -122,17 +122,17 @@ static u32 EFB_Read(const u32 addr)

if (addr & 0x00800000)
{
ERROR_LOG(MEMMAP, "Unimplemented Z+Color EFB read @ 0x%08x", addr);
ERROR_LOG_FMT(MEMMAP, "Unimplemented Z+Color EFB read @ {:#010x}", addr);
}
else if (addr & 0x00400000)
{
var = g_video_backend->Video_AccessEFB(EFBAccessType::PeekZ, x, y, 0);
DEBUG_LOG(MEMMAP, "EFB Z Read @ %u, %u\t= 0x%08x", x, y, var);
DEBUG_LOG_FMT(MEMMAP, "EFB Z Read @ {}, {}\t= {:#010x}", x, y, var);
}
else
{
var = g_video_backend->Video_AccessEFB(EFBAccessType::PeekColor, x, y, 0);
DEBUG_LOG(MEMMAP, "EFB Color Read @ %u, %u\t= 0x%08x", x, y, var);
DEBUG_LOG_FMT(MEMMAP, "EFB Color Read @ {}, {}\t= {:#010x}", x, y, var);
}

return var;
@@ -147,17 +147,17 @@ static void EFB_Write(u32 data, u32 addr)
{
// It's possible to do a z-tested write to EFB by writing a 64bit value to this address range.
// Not much is known, but let's at least get some loging.
ERROR_LOG(MEMMAP, "Unimplemented Z+Color EFB write. %08x @ 0x%08x", data, addr);
ERROR_LOG_FMT(MEMMAP, "Unimplemented Z+Color EFB write. {:08x} @ {:#010x}", data, addr);
}
else if (addr & 0x00400000)
{
g_video_backend->Video_AccessEFB(EFBAccessType::PokeZ, x, y, data);
DEBUG_LOG(MEMMAP, "EFB Z Write %08x @ %u, %u", data, x, y);
DEBUG_LOG_FMT(MEMMAP, "EFB Z Write {:08x} @ {}, {}", data, x, y);
}
else
{
g_video_backend->Video_AccessEFB(EFBAccessType::PokeColor, x, y, data);
DEBUG_LOG(MEMMAP, "EFB Color Write %08x @ %u, %u", data, x, y);
DEBUG_LOG_FMT(MEMMAP, "EFB Color Write {:08x} @ {}, {}", data, x, y);
}
}

@@ -250,7 +250,7 @@ static T ReadFromHardware(u32 em_address)
return (T)Memory::mmio_mapping->Read<typename std::make_unsigned<T>::type>(em_address);
}

PanicAlert("Unable to resolve read address %x PC %x", em_address, PC);
PanicAlertFmt("Unable to resolve read address {:x} PC {:x}", em_address, PC);
return 0;
}

@@ -368,8 +368,7 @@ static void WriteToHardware(u32 em_address, const T data)
}
}

PanicAlert("Unable to resolve write address %x PC %x", em_address, PC);
return;
PanicAlertFmt("Unable to resolve write address {:x} PC {:x}", em_address, PC);
}
// =====================

@@ -942,8 +941,8 @@ static void GenerateDSIException(u32 effective_address, bool write)
// DSI exceptions are only supported in MMU mode.
if (!SConfig::GetInstance().bMMU)
{
PanicAlert("Invalid %s 0x%08x, PC = 0x%08x ", write ? "write to" : "read from",
effective_address, PC);
PanicAlertFmt("Invalid {} {:#010x}, PC = {:#010x}", write ? "write to" : "read from",
effective_address, PC);
return;
}

@@ -963,7 +962,7 @@ static void GenerateISIException(u32 effective_address)
NPC = effective_address;

PowerPC::ppcState.Exceptions |= EXCEPTION_ISI;
WARN_LOG(POWERPC, "ISI exception at 0x%08x", PC);
WARN_LOG_FMT(POWERPC, "ISI exception at {:#010x}", PC);
}

void SDRUpdated()
@@ -1179,23 +1178,23 @@ static void UpdateBATs(BatTable& bat_table, u32 base_spr)
// With a valid BAT, the simplest way to match is
// (input & ~BL_mask) == BEPI. For now, assume it's
// implemented this way for invalid BATs as well.
WARN_LOG(POWERPC, "Bad BAT setup: BEPI overlaps BL");
WARN_LOG_FMT(POWERPC, "Bad BAT setup: BEPI overlaps BL");
continue;
}
if ((batl.BRPN & batu.BL) != 0)
{
// With a valid BAT, the simplest way to translate is
// (input & BL_mask) | BRPN_address. For now, assume it's
// implemented this way for invalid BATs as well.
WARN_LOG(POWERPC, "Bad BAT setup: BPRN overlaps BL");
WARN_LOG_FMT(POWERPC, "Bad BAT setup: BPRN overlaps BL");
}
if (!Common::IsValidLowMask((u32)batu.BL))
{
// With a valid BAT, the simplest way of masking is
// (input & ~BL_mask) for matching and (input & BL_mask) for
// translation. For now, assume it's implemented this way for
// invalid BATs as well.
WARN_LOG(POWERPC, "Bad BAT setup: invalid mask in BL");
WARN_LOG_FMT(POWERPC, "Bad BAT setup: invalid mask in BL");
}
for (u32 j = 0; j <= batu.BL; ++j)
{
@@ -374,7 +374,7 @@ void FindFunctions(u32 startAddr, u32 endAddr, PPCSymbolDB* func_db)
{
if (func.second.address == 4)
{
WARN_LOG(SYMBOLS, "Weird function");
WARN_LOG_FMT(SYMBOLS, "Weird function");
continue;
}
AnalyzeFunction2(&(func.second));
@@ -424,12 +424,12 @@ void FindFunctions(u32 startAddr, u32 endAddr, PPCSymbolDB* func_db)
else
unniceSize /= numUnNice;

INFO_LOG(SYMBOLS,
"Functions analyzed. %i leafs, %i nice, %i unnice."
"%i timer, %i rfi. %i are branchless leafs.",
numLeafs, numNice, numUnNice, numTimer, numRFI, numStraightLeaf);
INFO_LOG(SYMBOLS, "Average size: %i (leaf), %i (nice), %i(unnice)", leafSize, niceSize,
unniceSize);
INFO_LOG_FMT(SYMBOLS,
"Functions analyzed. {} leafs, {} nice, {} unnice."
"{} timer, {} rfi. {} are branchless leafs.",
numLeafs, numNice, numUnNice, numTimer, numRFI, numStraightLeaf);
INFO_LOG_FMT(SYMBOLS, "Average size: {} (leaf), {} (nice), {}(unnice)", leafSize, niceSize,
unniceSize);
}

static bool isCmp(const CodeOp& a)
@@ -184,12 +184,13 @@ u32 InstructionCache::ReadInstruction(u32 addr)
}
// update plru
plru[set] = (plru[set] & ~s_plru_mask[t]) | s_plru_value[t];
u32 res = Common::swap32(data[set][t][(addr >> 2) & 7]);
u32 inmem = Memory::Read_U32(addr);
const u32 res = Common::swap32(data[set][t][(addr >> 2) & 7]);
const u32 inmem = Memory::Read_U32(addr);
if (res != inmem)
{
INFO_LOG(POWERPC, "ICache read at %08x returned stale data: CACHED: %08x vs. RAM: %08x", addr,
res, inmem);
INFO_LOG_FMT(POWERPC,
"ICache read at {:08x} returned stale data: CACHED: {:08x} vs. RAM: {:08x}", addr,
res, inmem);
DolphinAnalytics::Instance().ReportGameQuirk(GameQuirk::ICACHE_MATTERS);
}
return res;
@@ -75,8 +75,8 @@ void PPCSymbolDB::AddKnownSymbol(u32 startAddr, u32 size, const std::string& nam
// Do not truncate symbol when a size is expected
if (size != 0 && tf.size != size)
{
WARN_LOG(SYMBOLS, "Analysed symbol (%s) size mismatch, %u expected but %u computed",
name.c_str(), size, tf.size);
WARN_LOG_FMT(SYMBOLS, "Analysed symbol ({}) size mismatch, {} expected but {} computed",
name, size, tf.size);
tf.size = size;
}
m_checksum_to_function[tf.hash].insert(&m_functions[startAddr]);
@@ -153,18 +153,18 @@ void PPCSymbolDB::PrintCalls(u32 funcAddr) const
const auto iter = m_functions.find(funcAddr);
if (iter == m_functions.end())
{
WARN_LOG(SYMBOLS, "Symbol does not exist");
WARN_LOG_FMT(SYMBOLS, "Symbol does not exist");
return;
}

const Common::Symbol& f = iter->second;
DEBUG_LOG(SYMBOLS, "The function %s at %08x calls:", f.name.c_str(), f.address);
DEBUG_LOG_FMT(SYMBOLS, "The function {} at {:08x} calls:", f.name, f.address);
for (const Common::SCall& call : f.calls)
{
const auto n = m_functions.find(call.function);
if (n != m_functions.end())
{
DEBUG_LOG(SYMBOLS, "* %08x : %s", call.call_address, n->second.name.c_str());
DEBUG_LOG_FMT(SYMBOLS, "* {:08x} : {}", call.call_address, n->second.name);
}
}
}
@@ -176,13 +176,13 @@ void PPCSymbolDB::PrintCallers(u32 funcAddr) const
return;

const Common::Symbol& f = iter->second;
DEBUG_LOG(SYMBOLS, "The function %s at %08x is called by:", f.name.c_str(), f.address);
DEBUG_LOG_FMT(SYMBOLS, "The function {} at {:08x} is called by:", f.name, f.address);
for (const Common::SCall& caller : f.callers)
{
const auto n = m_functions.find(caller.function);
if (n != m_functions.end())
{
DEBUG_LOG(SYMBOLS, "* %08x : %s", caller.call_address, n->second.name.c_str());
DEBUG_LOG_FMT(SYMBOLS, "* {:08x} : {}", caller.call_address, n->second.name);
}
}
}
@@ -416,7 +416,7 @@ bool PPCSymbolDB::LoadMap(const std::string& filename, bool bad)
}

Index();
NOTICE_LOG(SYMBOLS, "%d symbols loaded, %d symbols ignored.", good_count, bad_count);
NOTICE_LOG_FMT(SYMBOLS, "{} symbols loaded, {} symbols ignored.", good_count, bad_count);
return true;
}

@@ -157,7 +157,7 @@ void PrintInstructionRunCounts()
if (inst.second == 0)
break;

DEBUG_LOG(POWERPC, "%s : %" PRIu64, inst.first, inst.second);
DEBUG_LOG_FMT(POWERPC, "{} : {}", inst.first, inst.second);
}
}

@@ -209,8 +209,7 @@ static void InitializeCPUCore(CPUCore cpu_core)
s_cpu_core_base = JitInterface::InitJitCore(cpu_core);
if (!s_cpu_core_base) // Handle Situations where JIT core isn't available
{
WARN_LOG(POWERPC, "CPU core %d not available. Falling back to default.",
static_cast<int>(cpu_core));
WARN_LOG_FMT(POWERPC, "CPU core {} not available. Falling back to default.", cpu_core);
s_cpu_core_base = JitInterface::InitJitCore(DefaultCPUCore());
}
break;
@@ -473,7 +472,7 @@ void CheckExceptions()
MSR.Hex &= ~0x04EF36;
PC = NPC = 0x00000400;

DEBUG_LOG(POWERPC, "EXCEPTION_ISI");
DEBUG_LOG_FMT(POWERPC, "EXCEPTION_ISI");
ppcState.Exceptions &= ~EXCEPTION_ISI;
}
else if (exceptions & EXCEPTION_PROGRAM)
@@ -485,7 +484,7 @@ void CheckExceptions()
MSR.Hex &= ~0x04EF36;
PC = NPC = 0x00000700;

DEBUG_LOG(POWERPC, "EXCEPTION_PROGRAM");
DEBUG_LOG_FMT(POWERPC, "EXCEPTION_PROGRAM");
ppcState.Exceptions &= ~EXCEPTION_PROGRAM;
}
else if (exceptions & EXCEPTION_SYSCALL)
@@ -496,7 +495,7 @@ void CheckExceptions()
MSR.Hex &= ~0x04EF36;
PC = NPC = 0x00000C00;

DEBUG_LOG(POWERPC, "EXCEPTION_SYSCALL (PC=%08x)", PC);
DEBUG_LOG_FMT(POWERPC, "EXCEPTION_SYSCALL (PC={:08x})", PC);
ppcState.Exceptions &= ~EXCEPTION_SYSCALL;
}
else if (exceptions & EXCEPTION_FPU_UNAVAILABLE)
@@ -508,7 +507,7 @@ void CheckExceptions()
MSR.Hex &= ~0x04EF36;
PC = NPC = 0x00000800;

DEBUG_LOG(POWERPC, "EXCEPTION_FPU_UNAVAILABLE");
DEBUG_LOG_FMT(POWERPC, "EXCEPTION_FPU_UNAVAILABLE");
ppcState.Exceptions &= ~EXCEPTION_FPU_UNAVAILABLE;
}
else if (exceptions & EXCEPTION_FAKE_MEMCHECK_HIT)
@@ -524,7 +523,7 @@ void CheckExceptions()
PC = NPC = 0x00000300;
// DSISR and DAR regs are changed in GenerateDSIException()

DEBUG_LOG(POWERPC, "EXCEPTION_DSI");
DEBUG_LOG_FMT(POWERPC, "EXCEPTION_DSI");
ppcState.Exceptions &= ~EXCEPTION_DSI;
}
else if (exceptions & EXCEPTION_ALIGNMENT)
@@ -537,7 +536,7 @@ void CheckExceptions()

// TODO crazy amount of DSISR options to check out

DEBUG_LOG(POWERPC, "EXCEPTION_ALIGNMENT");
DEBUG_LOG_FMT(POWERPC, "EXCEPTION_ALIGNMENT");
ppcState.Exceptions &= ~EXCEPTION_ALIGNMENT;
}

@@ -565,7 +564,7 @@ void CheckExternalExceptions()
MSR.Hex &= ~0x04EF36;
PC = NPC = 0x00000500;

DEBUG_LOG(POWERPC, "EXCEPTION_EXTERNAL_INT");
DEBUG_LOG_FMT(POWERPC, "EXCEPTION_EXTERNAL_INT");
ppcState.Exceptions &= ~EXCEPTION_EXTERNAL_INT;

DEBUG_ASSERT_MSG(POWERPC, (SRR1 & 0x02) != 0, "EXTERNAL_INT unrecoverable???");
@@ -578,7 +577,7 @@ void CheckExternalExceptions()
MSR.Hex &= ~0x04EF36;
PC = NPC = 0x00000F00;

DEBUG_LOG(POWERPC, "EXCEPTION_PERFORMANCE_MONITOR");
DEBUG_LOG_FMT(POWERPC, "EXCEPTION_PERFORMANCE_MONITOR");
ppcState.Exceptions &= ~EXCEPTION_PERFORMANCE_MONITOR;
}
else if (exceptions & EXCEPTION_DECREMENTER)
@@ -589,13 +588,14 @@ void CheckExternalExceptions()
MSR.Hex &= ~0x04EF36;
PC = NPC = 0x00000900;

DEBUG_LOG(POWERPC, "EXCEPTION_DECREMENTER");
DEBUG_LOG_FMT(POWERPC, "EXCEPTION_DECREMENTER");
ppcState.Exceptions &= ~EXCEPTION_DECREMENTER;
}
else
{
DEBUG_ASSERT_MSG(POWERPC, 0, "Unknown EXT interrupt: Exceptions == %08x", exceptions);
ERROR_LOG(POWERPC, "Unknown EXTERNAL INTERRUPT exception: Exceptions == %08x", exceptions);
ERROR_LOG_FMT(POWERPC, "Unknown EXTERNAL INTERRUPT exception: Exceptions == {:08x}",
exceptions);
}
}
}
@@ -608,9 +608,11 @@ void CheckBreakPoints()
CPU::Break();
if (PowerPC::breakpoints.IsBreakPointLogOnHit(PC))
{
NOTICE_LOG(MEMMAP, "BP %08x %s(%08x %08x %08x %08x %08x %08x %08x %08x %08x %08x) LR=%08x",
PC, g_symbolDB.GetDescription(PC).c_str(), GPR(3), GPR(4), GPR(5), GPR(6), GPR(7),
GPR(8), GPR(9), GPR(10), GPR(11), GPR(12), LR);
NOTICE_LOG_FMT(MEMMAP,
"BP {:08x} {}({:08x} {:08x} {:08x} {:08x} {:08x} {:08x} {:08x} {:08x} {:08x} "
"{:08x}) LR={:08x}",
PC, g_symbolDB.GetDescription(PC), GPR(3), GPR(4), GPR(5), GPR(6), GPR(7),
GPR(8), GPR(9), GPR(10), GPR(11), GPR(12), LR);
}
if (PowerPC::breakpoints.IsTempBreakPoint(PC))
PowerPC::breakpoints.Remove(PC);
@@ -619,7 +621,7 @@ void CheckBreakPoints()

void PowerPCState::SetSR(u32 index, u32 value)
{
DEBUG_LOG(POWERPC, "%08x: MMU: Segment register %i set to %08x", pc, index, value);
DEBUG_LOG_FMT(POWERPC, "{:08x}: MMU: Segment register {} set to {:08x}", pc, index, value);
sr[index] = value;
}

@@ -52,7 +52,7 @@ bool CSVSignatureDB::Load(const std::string& file_path)
}
else
{
WARN_LOG(SYMBOLS, "CSV database failed to parse line %zu", i);
WARN_LOG_FMT(SYMBOLS, "CSV database failed to parse line {}", i);
}
}

@@ -65,7 +65,7 @@ bool CSVSignatureDB::Save(const std::string& file_path) const

if (!f)
{
ERROR_LOG(SYMBOLS, "CSV database save failed");
ERROR_LOG_FMT(SYMBOLS, "CSV database save failed");
return false;
}
for (const auto& func : m_database)
@@ -77,6 +77,6 @@ bool CSVSignatureDB::Save(const std::string& file_path) const
func.second.object_name));
}

INFO_LOG(SYMBOLS, "CSV database save successful");
INFO_LOG_FMT(SYMBOLS, "CSV database save successful");
return true;
}
@@ -54,7 +54,7 @@ bool DSYSignatureDB::Save(const std::string& file_path) const

if (!f)
{
ERROR_LOG(SYMBOLS, "Database save failed");
ERROR_LOG_FMT(SYMBOLS, "Database save failed");
return false;
}
u32 fcount = static_cast<u32>(m_database.size());
@@ -69,6 +69,6 @@ bool DSYSignatureDB::Save(const std::string& file_path) const
f.WriteArray(&temp, 1);
}

INFO_LOG(SYMBOLS, "Database save successful");
INFO_LOG_FMT(SYMBOLS, "Database save successful");
return true;
}
@@ -38,7 +38,7 @@ bool GetCode(MEGASignature* sig, std::istringstream* iss)
}
else
{
WARN_LOG(SYMBOLS, "MEGA database failed to parse code");
WARN_LOG_FMT(SYMBOLS, "MEGA database failed to parse code");
return false;
}
}
@@ -80,17 +80,17 @@ bool GetRefs(MEGASignature* sig, std::istringstream* iss)
num = num.substr(1);
const char* ptr = num.c_str();
char* endptr;
u64 offset = strtoul(ptr, &endptr, 16);
const u64 offset = std::strtoul(ptr, &endptr, 16);

if (ptr == endptr || offset > std::numeric_limits<u32>::max())
{
WARN_LOG(SYMBOLS, "MEGA database failed to parse reference %u offset", ref_count);
WARN_LOG_FMT(SYMBOLS, "MEGA database failed to parse reference {} offset", ref_count);
return false;
}

if (!GetFunctionName(iss, &ref))
{
WARN_LOG(SYMBOLS, "MEGA database failed to parse reference %u name", ref_count);
WARN_LOG_FMT(SYMBOLS, "MEGA database failed to parse reference {} name", ref_count);
return false;
}
sig->refs.emplace_back(static_cast<u32>(offset), std::move(ref));
@@ -145,15 +145,15 @@ bool MEGASignatureDB::Load(const std::string& file_path)
}
else
{
WARN_LOG(SYMBOLS, "MEGA database failed to parse line %zu", i);
WARN_LOG_FMT(SYMBOLS, "MEGA database failed to parse line {}", i);
}
}
return true;
}

bool MEGASignatureDB::Save(const std::string& file_path) const
{
ERROR_LOG(SYMBOLS, "MEGA database save unsupported yet.");
ERROR_LOG_FMT(SYMBOLS, "MEGA database save unsupported yet.");
return false;
}

@@ -167,8 +167,8 @@ void MEGASignatureDB::Apply(PPCSymbolDB* symbol_db) const
if (Compare(symbol.address, symbol.size, sig))
{
symbol.name = sig.name;
INFO_LOG(SYMBOLS, "Found %s at %08x (size: %08x)!", sig.name.c_str(), symbol.address,
symbol.size);
INFO_LOG_FMT(SYMBOLS, "Found {} at {:08x} (size: {:08x})!", sig.name, symbol.address,
symbol.size);
break;
}
}
@@ -178,20 +178,20 @@ void MEGASignatureDB::Apply(PPCSymbolDB* symbol_db) const

void MEGASignatureDB::Populate(const PPCSymbolDB* func_db, const std::string& filter)
{
ERROR_LOG(SYMBOLS, "MEGA database can't be populated yet.");
ERROR_LOG_FMT(SYMBOLS, "MEGA database can't be populated yet.");
}

bool MEGASignatureDB::Add(u32 startAddr, u32 size, const std::string& name)
{
ERROR_LOG(SYMBOLS, "Can't add symbol to MEGA database yet.");
ERROR_LOG_FMT(SYMBOLS, "Can't add symbol to MEGA database yet.");
return false;
}

void MEGASignatureDB::List() const
{
for (const auto& entry : m_signatures)
{
DEBUG_LOG(SYMBOLS, "%s : %zu bytes", entry.name.c_str(), entry.code.size() * sizeof(u32));
DEBUG_LOG_FMT(SYMBOLS, "{} : {} bytes", entry.name, entry.code.size() * sizeof(u32));
}
INFO_LOG(SYMBOLS, "%zu functions known in current MEGA database.", m_signatures.size());
INFO_LOG_FMT(SYMBOLS, "{} functions known in current MEGA database.", m_signatures.size());
}
@@ -109,10 +109,10 @@ void HashSignatureDB::List() const
{
for (const auto& entry : m_database)
{
DEBUG_LOG(SYMBOLS, "%s : %i bytes, hash = %08x", entry.second.name.c_str(), entry.second.size,
entry.first);
DEBUG_LOG_FMT(SYMBOLS, "{} : {} bytes, hash = {:08x}", entry.second.name, entry.second.size,
entry.first);
}
INFO_LOG(SYMBOLS, "%zu functions known in current database.", m_database.size());
INFO_LOG_FMT(SYMBOLS, "{} functions known in current database.", m_database.size());
}

void HashSignatureDB::Clear()
@@ -130,13 +130,13 @@ void HashSignatureDB::Apply(PPCSymbolDB* symbol_db) const
function->Rename(entry.second.name);
if (entry.second.size == static_cast<unsigned int>(function->size))
{
INFO_LOG(SYMBOLS, "Found %s at %08x (size: %08x)!", entry.second.name.c_str(),
function->address, function->size);
INFO_LOG_FMT(SYMBOLS, "Found {} at {:08x} (size: {:08x})!", entry.second.name,
function->address, function->size);
}
else
{
ERROR_LOG(SYMBOLS, "Wrong size! Found %s at %08x (size: %08x instead of %08x)!",
entry.second.name.c_str(), function->address, function->size, entry.second.size);
ERROR_LOG_FMT(SYMBOLS, "Wrong size! Found {} at {:08x} (size: {:08x} instead of {:08x})!",
entry.second.name, function->address, function->size, entry.second.size);
}
}
}