aboutsummaryrefslogtreecommitdiff
path: root/src/ARMJIT.cpp
diff options
context:
space:
mode:
authorJesse Talavera-Greenberg <jesse@jesse.tg>2023-03-23 13:04:38 -0400
committerGitHub <noreply@github.com>2023-03-23 18:04:38 +0100
commit79dfb8dc8f356834f0b6cf7baf73f77552b08923 (patch)
tree9a2a139617b8e178edd153ac68d56f2d0e48e3ed /src/ARMJIT.cpp
parent19280cff2d3d618f032d0e6ef4b1d4414fa02f58 (diff)
Introduce `Platform::Log` (#1640)
* Add Platform::Log and Platform::LogLevel * Replace most printf calls with Platform::Log calls * Move a brace down * Move some log entries to one Log call - Some implementations of Log may assume a full line * Log the MAC address as LogLevel::Info
Diffstat (limited to 'src/ARMJIT.cpp')
-rw-r--r--src/ARMJIT.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/ARMJIT.cpp b/src/ARMJIT.cpp
index 32f20d5..77d8602 100644
--- a/src/ARMJIT.cpp
+++ b/src/ARMJIT.cpp
@@ -42,7 +42,10 @@
#include "SPU.h"
#include "Wifi.h"
#include "NDSCart.h"
+#include "Platform.h"
+using Platform::Log;
+using Platform::LogLevel;
#include "ARMJIT_x64/ARMJIT_Offsets.h"
static_assert(offsetof(ARM, CPSR) == ARM_CPSR_offset, "");
@@ -52,7 +55,7 @@ static_assert(offsetof(ARM, StopExecution) == ARM_StopExecution_offset, "");
namespace ARMJIT
{
-#define JIT_DEBUGPRINT(msg, ...)
+#define JIT_DEBUGPRINT(msg, ...) Platform::Log(Platform::LogLevel::Debug, msg, ## __VA_ARGS__)
//#define JIT_DEBUGPRINT(msg, ...) printf(msg, ## __VA_ARGS__)
Compiler* JITCompiler;
@@ -594,7 +597,7 @@ void CompileBlock(ARM* cpu)
u32 localAddr = LocaliseCodeAddress(cpu->Num, blockAddr);
if (!localAddr)
{
- printf("trying to compile non executable code? %x\n", blockAddr);
+ Log(LogLevel::Warn, "trying to compile non executable code? %x\n", blockAddr);
}
auto& map = cpu->Num == 0 ? JitBlocks9 : JitBlocks7;
@@ -764,7 +767,7 @@ void CompileBlock(ARM* cpu)
u32 translatedAddr = LocaliseCodeAddress(cpu->Num, literalAddr);
if (!translatedAddr)
{
- printf("literal in non executable memory?\n");
+ Log(LogLevel::Warn,"literal in non executable memory?\n");
}
if (InvalidLiterals.Find(translatedAddr) == -1)
{
@@ -1175,7 +1178,7 @@ template void CheckAndInvalidate<1, ARMJIT_Memory::memregion_NewSharedWRAM_C>(u3
void ResetBlockCache()
{
- printf("Resetting JIT block cache...\n");
+ Log(LogLevel::Debug, "Resetting JIT block cache...\n");
// could be replace through a function which only resets
// the permissions but we're too lazy