Logging fixed
This commit is contained in:
@@ -18,10 +18,6 @@
|
|||||||
|
|
||||||
#include <fenv.h>
|
#include <fenv.h>
|
||||||
|
|
||||||
#if 0//def _DEBUG
|
|
||||||
#define HLE_CALL_DEBUG
|
|
||||||
#endif
|
|
||||||
|
|
||||||
extern u64 rotate_mask[64][64]; // defined in PPUThread.cpp, static didn't work correctly in GCC 4.9 for some reason
|
extern u64 rotate_mask[64][64]; // defined in PPUThread.cpp, static didn't work correctly in GCC 4.9 for some reason
|
||||||
inline void InitRotateMask()
|
inline void InitRotateMask()
|
||||||
{
|
{
|
||||||
@@ -107,28 +103,6 @@ private:
|
|||||||
if (fetestexcept(FE_OVERFLOW)) CPU.SetFPSCRException(FPSCR_OX);
|
if (fetestexcept(FE_OVERFLOW)) CPU.SetFPSCRException(FPSCR_OX);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Exit() {}
|
|
||||||
|
|
||||||
void SysCall()
|
|
||||||
{
|
|
||||||
const u64 sc = CPU.GPR[11];
|
|
||||||
const u64 old_sc = CPU.m_last_syscall;
|
|
||||||
|
|
||||||
CPU.m_last_syscall = sc;
|
|
||||||
SysCalls::DoSyscall(CPU, (u32)sc);
|
|
||||||
|
|
||||||
if(Ini.HLELogging.GetValue())
|
|
||||||
{
|
|
||||||
LOG_WARNING(PPU, "SysCall[0x%llx ('%s')] done with code [0x%llx]! #pc: 0x%x",
|
|
||||||
sc, SysCalls::GetHLEFuncName((u32)sc).c_str(), CPU.GPR[3], CPU.PC);
|
|
||||||
}
|
|
||||||
#ifdef HLE_CALL_DEBUG
|
|
||||||
LOG_NOTICE(PPU, "SysCall[%lld] done with code [0x%llx]! #pc: 0x%x", sc, CPU.GPR[3], CPU.PC);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
CPU.m_last_syscall = old_sc;
|
|
||||||
}
|
|
||||||
|
|
||||||
void NULL_OP()
|
void NULL_OP()
|
||||||
{
|
{
|
||||||
throw "Null operation";
|
throw "Null operation";
|
||||||
@@ -2260,7 +2234,7 @@ private:
|
|||||||
{
|
{
|
||||||
switch (lev)
|
switch (lev)
|
||||||
{
|
{
|
||||||
case 0x0: SysCall(); break;
|
case 0x0: SysCalls::DoSyscall(CPU, CPU.GPR[11]); break;
|
||||||
case 0x1: throw "SC(): HyperCall LV1";
|
case 0x1: throw "SC(): HyperCall LV1";
|
||||||
case 0x3: CPU.FastStop(); break;
|
case 0x3: CPU.FastStop(); break;
|
||||||
default: throw fmt::Format("SC(): unknown level (0x%x)", lev);
|
default: throw fmt::Format("SC(): unknown level (0x%x)", lev);
|
||||||
|
|||||||
@@ -91,10 +91,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void SysCall()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
//0 - 10
|
//0 - 10
|
||||||
void STOP(u32 code)
|
void STOP(u32 code)
|
||||||
{
|
{
|
||||||
@@ -1096,7 +1092,7 @@ private:
|
|||||||
}
|
}
|
||||||
else if (result == 0.0f)
|
else if (result == 0.0f)
|
||||||
{
|
{
|
||||||
if (a != 0.0f & b != 0.0f)
|
if (a != 0.0f && b != 0.0f)
|
||||||
CPU.FPSCR.setSinglePrecisionExceptionFlags(w, FPSCR_SUNF | FPSCR_SDIFF);
|
CPU.FPSCR.setSinglePrecisionExceptionFlags(w, FPSCR_SUNF | FPSCR_SDIFF);
|
||||||
result = +0.0f;
|
result = +0.0f;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -106,11 +106,16 @@ void execute_ppu_func_by_index(PPUThread& CPU, u32 index)
|
|||||||
}
|
}
|
||||||
else if (func->func)
|
else if (func->func)
|
||||||
{
|
{
|
||||||
|
if (Ini.HLELogging.GetValue())
|
||||||
|
{
|
||||||
|
LOG_NOTICE(HLE, "HLE function called: %s", SysCalls::GetHLEFuncName(func->id));
|
||||||
|
}
|
||||||
|
|
||||||
func->func(CPU);
|
func->func(CPU);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LOG_ERROR(HLE, "Unimplemented function: %s", SysCalls::GetHLEFuncName(func->id));
|
LOG_ERROR(HLE, "Unimplemented function: %s -> CELL_OK", SysCalls::GetHLEFuncName(func->id));
|
||||||
CPU.GPR[3] = 0;
|
CPU.GPR[3] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -921,23 +921,32 @@ void null_func(PPUThread& CPU)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG_ERROR(HLE, "Unknown syscall: %d - %08x", code, code);
|
LOG_ERROR(HLE, "Unknown syscall: %d - %08x -> CELL_OK", code, code);
|
||||||
CPU.GPR[3] = 0;
|
CPU.GPR[3] = 0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SysCalls::DoSyscall(PPUThread& CPU, u32 code)
|
void SysCalls::DoSyscall(PPUThread& CPU, u64 code)
|
||||||
{
|
{
|
||||||
|
auto old_last_syscall = CPU.m_last_syscall;
|
||||||
|
CPU.m_last_syscall = code;
|
||||||
|
|
||||||
|
if (code >= 1024)
|
||||||
|
{
|
||||||
|
throw "Invalid syscall number";
|
||||||
|
}
|
||||||
|
|
||||||
//Auto Pause using simple singleton.
|
//Auto Pause using simple singleton.
|
||||||
Debug::AutoPause::getInstance().TryPause(code);
|
Debug::AutoPause::getInstance().TryPause(code);
|
||||||
|
|
||||||
if(code < 1024)
|
if (Ini.HLELogging.GetValue())
|
||||||
{
|
{
|
||||||
sc_table[code](CPU);
|
LOG_NOTICE(PPU, "SysCall called: %s [0x%llx]", "unknown", code);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
throw "Invalid syscall number";
|
sc_table[code](CPU);
|
||||||
|
|
||||||
|
CPU.m_last_syscall = old_last_syscall;
|
||||||
}
|
}
|
||||||
|
|
||||||
IdManager& SysCallBase::GetIdManager() const
|
IdManager& SysCallBase::GetIdManager() const
|
||||||
|
|||||||
@@ -66,6 +66,6 @@ class PPUThread;
|
|||||||
class SysCalls
|
class SysCalls
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static void DoSyscall(PPUThread& CPU, u32 code);
|
static void DoSyscall(PPUThread& CPU, u64 code);
|
||||||
static std::string GetHLEFuncName(const u32 fid);
|
static std::string GetHLEFuncName(const u32 fid);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user