1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2025-01-31 20:41:45 +01:00

Logging fixed

This commit is contained in:
Nekotekina 2015-02-25 14:48:12 +03:00
parent 432f0c3630
commit 0b21474b79
5 changed files with 24 additions and 40 deletions

View File

@ -18,10 +18,6 @@
#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
inline void InitRotateMask()
{
@ -107,28 +103,6 @@ private:
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()
{
throw "Null operation";
@ -2260,7 +2234,7 @@ private:
{
switch (lev)
{
case 0x0: SysCall(); break;
case 0x0: SysCalls::DoSyscall(CPU, CPU.GPR[11]); break;
case 0x1: throw "SC(): HyperCall LV1";
case 0x3: CPU.FastStop(); break;
default: throw fmt::Format("SC(): unknown level (0x%x)", lev);

View File

@ -91,10 +91,6 @@ public:
}
private:
void SysCall()
{
}
//0 - 10
void STOP(u32 code)
{
@ -1096,7 +1092,7 @@ private:
}
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);
result = +0.0f;
}

View File

@ -106,11 +106,16 @@ void execute_ppu_func_by_index(PPUThread& CPU, u32 index)
}
else if (func->func)
{
if (Ini.HLELogging.GetValue())
{
LOG_NOTICE(HLE, "HLE function called: %s", SysCalls::GetHLEFuncName(func->id));
}
func->func(CPU);
}
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;
}

View File

@ -921,23 +921,32 @@ void null_func(PPUThread& CPU)
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;
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.
Debug::AutoPause::getInstance().TryPause(code);
if(code < 1024)
if (Ini.HLELogging.GetValue())
{
sc_table[code](CPU);
return;
LOG_NOTICE(PPU, "SysCall called: %s [0x%llx]", "unknown", code);
}
throw "Invalid syscall number";
sc_table[code](CPU);
CPU.m_last_syscall = old_last_syscall;
}
IdManager& SysCallBase::GetIdManager() const

View File

@ -66,6 +66,6 @@ class PPUThread;
class SysCalls
{
public:
static void DoSyscall(PPUThread& CPU, u32 code);
static void DoSyscall(PPUThread& CPU, u64 code);
static std::string GetHLEFuncName(const u32 fid);
};