Skip to content
Permalink
Browse files

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.
  • Loading branch information...
lioncash committed Jul 8, 2019
1 parent 457bff9 commit 98101bbbe4d54e3831800d63023d7c4730776b95
@@ -7,9 +7,10 @@
#include <cstddef>
#include <string>

#include <fmt/format.h>

#include "Common/Align.h"
#include "Common/GekkoDisassembler.h"
#include "Common/StringUtil.h"

#include "Core/Core.h"
#include "Core/HW/DSP.h"
@@ -199,7 +200,7 @@ std::string PPCDebugInterface::GetRawMemoryString(int memory, u32 address)
const bool is_aram = memory != 0;

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--" : "--------";
}
@@ -7,8 +7,9 @@
#include <cstddef>
#include <string>

#include <fmt/format.h>

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

0 comments on commit 98101bb

Please sign in to comment.
You can’t perform that action at this time.