Core: Use fmt where applicable for DebugInterface implementations

These are trivial enough that they're basically one-to-one conversions
with minor changes of syntax.
This commit is contained in:
Lioncash 2019-07-08 18:00:56 -04:00
parent 457bff92c1
commit 98101bbbe4
2 changed files with 8 additions and 6 deletions

View File

@ -7,9 +7,10 @@
#include <cstddef> #include <cstddef>
#include <string> #include <string>
#include <fmt/format.h>
#include "Common/Align.h" #include "Common/Align.h"
#include "Common/GekkoDisassembler.h" #include "Common/GekkoDisassembler.h"
#include "Common/StringUtil.h"
#include "Core/Core.h" #include "Core/Core.h"
#include "Core/HW/DSP.h" #include "Core/HW/DSP.h"
@ -199,7 +200,7 @@ std::string PPCDebugInterface::GetRawMemoryString(int memory, u32 address)
const bool is_aram = memory != 0; const bool is_aram = memory != 0;
if (is_aram || PowerPC::HostIsRAMAddress(address)) if (is_aram || PowerPC::HostIsRAMAddress(address))
return StringFromFormat("%08X%s", ReadExtraMemory(memory, address), is_aram ? " (ARAM)" : ""); return fmt::format("{:08X}{}", ReadExtraMemory(memory, address), is_aram ? " (ARAM)" : "");
return is_aram ? "--ARAM--" : "--------"; return is_aram ? "--ARAM--" : "--------";
} }

View File

@ -7,8 +7,9 @@
#include <cstddef> #include <cstddef>
#include <string> #include <string>
#include <fmt/format.h>
#include "Common/MsgHandler.h" #include "Common/MsgHandler.h"
#include "Common/StringUtil.h"
#include "Core/DSP/DSPCore.h" #include "Core/DSP/DSPCore.h"
#include "Core/DSP/DSPMemoryMap.h" #include "Core/DSP/DSPMemoryMap.h"
#include "Core/HW/DSPLLE/DSPSymbols.h" #include "Core/HW/DSPLLE/DSPSymbols.h"
@ -156,7 +157,7 @@ std::string DSPDebugInterface::GetRawMemoryString(int memory, u32 address)
{ {
case 0: case 0:
case 0x8: case 0x8:
return StringFromFormat("%04x", dsp_imem_read(address)); return fmt::format("{:04x}", dsp_imem_read(address));
default: default:
return "--IMEM--"; return "--IMEM--";
} }
@ -166,9 +167,9 @@ std::string DSPDebugInterface::GetRawMemoryString(int memory, u32 address)
{ {
case 0: case 0:
case 1: case 1:
return StringFromFormat("%04x (DMEM)", dsp_dmem_read(address)); return fmt::format("{:04x} (DMEM)", dsp_dmem_read(address));
case 0xf: case 0xf:
return StringFromFormat("%04x (MMIO)", g_dsp.ifx_regs[address & 0xFF]); return fmt::format("{:04x} (MMIO)", g_dsp.ifx_regs[address & 0xFF]);
default: default:
return "--DMEM--"; return "--DMEM--";
} }