mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
Misc cleanup, mostly logging code
This commit is contained in:
1 parent
0c111267b4
commit
78d3ee3d6a
8 files changed
+111
-138
No files matched your search
+1
-1
@@ -56,7 +56,7 @@ enum LOG_TYPE {
|
||||
INTC,
|
||||
MEMMAP,
|
||||
SOUND,
|
||||
SAS,
|
||||
SASMIX,
|
||||
HLE,
|
||||
TIMER,
|
||||
VIDEO,
|
||||
|
||||
+60
-65
@@ -17,6 +17,7 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include "base/logging.h"
|
||||
#include "util/text/utf8.h"
|
||||
#include "LogManager.h"
|
||||
#include "ConsoleListener.h"
|
||||
#include "Timer.h"
|
||||
@@ -35,9 +36,8 @@ const char *hleCurrentThreadName = NULL;
|
||||
// #define LOG_MSC_OUTPUTDEBUG true
|
||||
|
||||
void GenericLog(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type,
|
||||
const char *file, int line, const char* fmt, ...)
|
||||
{
|
||||
if(!g_Config.bEnableLogging) return;
|
||||
const char *file, int line, const char* fmt, ...) {
|
||||
if (!g_Config.bEnableLogging) return;
|
||||
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
@@ -49,30 +49,40 @@ void GenericLog(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type,
|
||||
|
||||
LogManager *LogManager::m_logManager = NULL;
|
||||
|
||||
LogManager::LogManager()
|
||||
{
|
||||
// create log files
|
||||
m_Log[LogTypes::MASTER_LOG] = new LogContainer("*", "Master Log");
|
||||
m_Log[LogTypes::BOOT] = new LogContainer("BOOT", "Boot");
|
||||
m_Log[LogTypes::COMMON] = new LogContainer("COMMON", "Common");
|
||||
m_Log[LogTypes::CPU] = new LogContainer("CPU", "CPU");
|
||||
m_Log[LogTypes::LOADER] = new LogContainer("LOAD", "Loader");
|
||||
m_Log[LogTypes::IO] = new LogContainer("IO", "IO");
|
||||
m_Log[LogTypes::DISCIO] = new LogContainer("DIO", "DiscIO");
|
||||
m_Log[LogTypes::PAD] = new LogContainer("PAD", "Pad");
|
||||
m_Log[LogTypes::FILESYS] = new LogContainer("FileSys", "File System");
|
||||
m_Log[LogTypes::G3D] = new LogContainer("G3D", "3D Graphics");
|
||||
m_Log[LogTypes::DMA] = new LogContainer("DMA", "DMA");
|
||||
m_Log[LogTypes::INTC] = new LogContainer("INTC", "Interrupts");
|
||||
m_Log[LogTypes::MEMMAP] = new LogContainer("MM", "Memory Map");
|
||||
m_Log[LogTypes::SOUND] = new LogContainer("SND", "Sound");
|
||||
m_Log[LogTypes::SAS] = new LogContainer("SAS", "Sound Mixer (Sas)");
|
||||
m_Log[LogTypes::HLE] = new LogContainer("HLE", "HLE");
|
||||
m_Log[LogTypes::TIMER] = new LogContainer("TMR", "Timer");
|
||||
m_Log[LogTypes::VIDEO] = new LogContainer("VID", "Video");
|
||||
m_Log[LogTypes::DYNA_REC] = new LogContainer("Jit", "JIT compiler");
|
||||
m_Log[LogTypes::NETPLAY] = new LogContainer("NET", "Net play");
|
||||
m_Log[LogTypes::ME] = new LogContainer("ME", "Media Engine");
|
||||
struct LogNameTableEntry {
|
||||
LogTypes::LOG_TYPE logType;
|
||||
const char *name;
|
||||
const char *longName;
|
||||
};
|
||||
|
||||
static const LogNameTableEntry logTable[] = {
|
||||
{LogTypes::MASTER_LOG, "*", "Master Log"},
|
||||
{LogTypes::BOOT ,"BOOT", "Boot"},
|
||||
{LogTypes::COMMON ,"COMMON", "Common"},
|
||||
{LogTypes::CPU ,"CPU", "CPU"},
|
||||
{LogTypes::LOADER ,"LOAD", "Loader"},
|
||||
{LogTypes::IO ,"IO", "IO"},
|
||||
{LogTypes::DISCIO ,"DIO", "DiscIO"},
|
||||
{LogTypes::PAD ,"PAD", "Pad"},
|
||||
{LogTypes::FILESYS ,"FileSys", "File System"},
|
||||
{LogTypes::G3D ,"G3D", "3D Graphics"},
|
||||
{LogTypes::DMA ,"DMA", "DMA"},
|
||||
{LogTypes::INTC ,"INTC", "Interrupts"},
|
||||
{LogTypes::MEMMAP ,"MM", "Memory Map"},
|
||||
{LogTypes::SOUND ,"SND", "Sound"},
|
||||
{LogTypes::SASMIX ,"SAS", "Sound Mixer (Sas)"},
|
||||
{LogTypes::HLE ,"HLE", "HLE"},
|
||||
{LogTypes::TIMER ,"TMR", "Timer"},
|
||||
{LogTypes::VIDEO ,"VID", "Video"},
|
||||
{LogTypes::DYNA_REC ,"Jit", "JIT compiler"},
|
||||
{LogTypes::NETPLAY ,"NET", "Net play"},
|
||||
{LogTypes::ME ,"ME", "Media Engine"},
|
||||
};
|
||||
|
||||
LogManager::LogManager() {
|
||||
for (size_t i = 0; i < ARRAY_SIZE(logTable); i++) {
|
||||
m_Log[logTable[i].logType] = new LogContainer(logTable[i].name, logTable[i].longName);
|
||||
}
|
||||
|
||||
// Remove file logging on small devices
|
||||
#if !defined(USING_GLES2) || defined(_DEBUG)
|
||||
@@ -85,8 +95,7 @@ LogManager::LogManager()
|
||||
m_debuggerLog = NULL;
|
||||
#endif
|
||||
|
||||
for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; ++i)
|
||||
{
|
||||
for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; ++i) {
|
||||
m_Log[i]->SetEnable(true);
|
||||
#if !defined(USING_GLES2) || defined(_DEBUG)
|
||||
m_Log[i]->AddListener(m_fileLog);
|
||||
@@ -123,36 +132,29 @@ LogManager::~LogManager()
|
||||
#endif
|
||||
}
|
||||
|
||||
void LogManager::ChangeFileLog(const char *filename)
|
||||
{
|
||||
if (m_fileLog != NULL)
|
||||
{
|
||||
void LogManager::ChangeFileLog(const char *filename) {
|
||||
if (m_fileLog != NULL) {
|
||||
for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; ++i)
|
||||
m_logManager->RemoveListener((LogTypes::LOG_TYPE)i, m_fileLog);
|
||||
delete m_fileLog;
|
||||
}
|
||||
|
||||
if (filename != NULL)
|
||||
{
|
||||
if (filename != NULL) {
|
||||
m_fileLog = new FileLogListener(filename);
|
||||
for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; ++i)
|
||||
m_Log[i]->AddListener(m_fileLog);
|
||||
}
|
||||
}
|
||||
|
||||
void LogManager::SaveConfig(IniFile::Section *section)
|
||||
{
|
||||
for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; i++)
|
||||
{
|
||||
void LogManager::SaveConfig(IniFile::Section *section) {
|
||||
for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; i++) {
|
||||
section->Set((std::string(m_Log[i]->GetShortName()) + "Enabled").c_str(), m_Log[i]->IsEnabled());
|
||||
section->Set((std::string(m_Log[i]->GetShortName()) + "Level").c_str(), (int)m_Log[i]->GetLevel());
|
||||
}
|
||||
}
|
||||
|
||||
void LogManager::LoadConfig(IniFile::Section *section)
|
||||
{
|
||||
for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; i++)
|
||||
{
|
||||
void LogManager::LoadConfig(IniFile::Section *section) {
|
||||
for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; i++) {
|
||||
bool enabled;
|
||||
int level;
|
||||
section->Get((std::string(m_Log[i]->GetShortName()) + "Enabled").c_str(), &enabled, true);
|
||||
@@ -162,8 +164,7 @@ void LogManager::LoadConfig(IniFile::Section *section)
|
||||
}
|
||||
}
|
||||
|
||||
void LogManager::Log(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type, const char *file, int line, const char *format, va_list args)
|
||||
{
|
||||
void LogManager::Log(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type, const char *file, int line, const char *format, va_list args) {
|
||||
std::lock_guard<std::mutex> lk(m_log_lock);
|
||||
|
||||
char msg[MAX_MSGLEN * 2];
|
||||
@@ -215,61 +216,56 @@ void LogManager::Log(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type, const
|
||||
log->Trigger(level, msg);
|
||||
}
|
||||
|
||||
void LogManager::Init()
|
||||
{
|
||||
void LogManager::Init() {
|
||||
m_logManager = new LogManager();
|
||||
}
|
||||
|
||||
void LogManager::Shutdown()
|
||||
{
|
||||
void LogManager::Shutdown() {
|
||||
delete m_logManager;
|
||||
m_logManager = NULL;
|
||||
}
|
||||
|
||||
LogContainer::LogContainer(const char* shortName, const char* fullName, bool enable)
|
||||
: m_enable(enable)
|
||||
{
|
||||
: m_enable(enable) {
|
||||
strncpy(m_fullName, fullName, 128);
|
||||
strncpy(m_shortName, shortName, 32);
|
||||
m_level = LogTypes::LDEBUG;
|
||||
}
|
||||
|
||||
// LogContainer
|
||||
void LogContainer::AddListener(LogListener *listener)
|
||||
{
|
||||
void LogContainer::AddListener(LogListener *listener) {
|
||||
std::lock_guard<std::mutex> lk(m_listeners_lock);
|
||||
m_listeners.insert(listener);
|
||||
}
|
||||
|
||||
void LogContainer::RemoveListener(LogListener *listener)
|
||||
{
|
||||
void LogContainer::RemoveListener(LogListener *listener) {
|
||||
std::lock_guard<std::mutex> lk(m_listeners_lock);
|
||||
m_listeners.erase(listener);
|
||||
}
|
||||
|
||||
void LogContainer::Trigger(LogTypes::LOG_LEVELS level, const char *msg)
|
||||
{
|
||||
void LogContainer::Trigger(LogTypes::LOG_LEVELS level, const char *msg) {
|
||||
#ifdef __SYMBIAN32__
|
||||
RDebug::Printf("%s",msg);
|
||||
#else
|
||||
std::lock_guard<std::mutex> lk(m_listeners_lock);
|
||||
|
||||
std::set<LogListener*>::const_iterator i;
|
||||
for (i = m_listeners.begin(); i != m_listeners.end(); ++i)
|
||||
{
|
||||
for (i = m_listeners.begin(); i != m_listeners.end(); ++i) {
|
||||
(*i)->Log(level, msg);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
FileLogListener::FileLogListener(const char *filename)
|
||||
{
|
||||
FileLogListener::FileLogListener(const char *filename) {
|
||||
#ifdef _WIN32
|
||||
m_logfile.open(ConvertUTF8ToWString(filename).c_str(), std::ios::app);
|
||||
#else
|
||||
m_logfile.open(filename, std::ios::app);
|
||||
#endif
|
||||
SetEnable(true);
|
||||
}
|
||||
|
||||
void FileLogListener::Log(LogTypes::LOG_LEVELS, const char *msg)
|
||||
{
|
||||
void FileLogListener::Log(LogTypes::LOG_LEVELS, const char *msg) {
|
||||
if (!IsEnabled() || !IsValid())
|
||||
return;
|
||||
|
||||
@@ -277,8 +273,7 @@ void FileLogListener::Log(LogTypes::LOG_LEVELS, const char *msg)
|
||||
m_logfile << msg << std::flush;
|
||||
}
|
||||
|
||||
void DebuggerLogListener::Log(LogTypes::LOG_LEVELS, const char *msg)
|
||||
{
|
||||
void DebuggerLogListener::Log(LogTypes::LOG_LEVELS, const char *msg) {
|
||||
#if _MSC_VER
|
||||
OutputDebugStringUTF8(msg);
|
||||
#endif
|
||||
|
||||
+15
-49
@@ -32,16 +32,14 @@
|
||||
extern const char *hleCurrentThreadName;
|
||||
|
||||
// pure virtual interface
|
||||
class LogListener
|
||||
{
|
||||
class LogListener {
|
||||
public:
|
||||
virtual ~LogListener() {}
|
||||
|
||||
virtual void Log(LogTypes::LOG_LEVELS, const char *msg) = 0;
|
||||
};
|
||||
|
||||
class FileLogListener : public LogListener
|
||||
{
|
||||
class FileLogListener : public LogListener {
|
||||
public:
|
||||
FileLogListener(const char *filename);
|
||||
|
||||
@@ -59,14 +57,12 @@ private:
|
||||
bool m_enable;
|
||||
};
|
||||
|
||||
class DebuggerLogListener : public LogListener
|
||||
{
|
||||
class DebuggerLogListener : public LogListener {
|
||||
public:
|
||||
void Log(LogTypes::LOG_LEVELS, const char *msg);
|
||||
};
|
||||
|
||||
class LogContainer
|
||||
{
|
||||
class LogContainer {
|
||||
public:
|
||||
LogContainer(const char* shortName, const char* fullName, bool enable = false);
|
||||
|
||||
@@ -98,8 +94,7 @@ private:
|
||||
|
||||
class ConsoleListener;
|
||||
|
||||
class LogManager : NonCopyable
|
||||
{
|
||||
class LogManager : NonCopyable {
|
||||
private:
|
||||
LogContainer* m_Log[LogTypes::NUMBER_OF_LOGS];
|
||||
FileLogListener *m_fileLog;
|
||||
@@ -117,68 +112,39 @@ public:
|
||||
void Log(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type,
|
||||
const char *file, int line, const char *fmt, va_list args);
|
||||
|
||||
void SetLogLevel(LogTypes::LOG_TYPE type, LogTypes::LOG_LEVELS level)
|
||||
{
|
||||
void SetLogLevel(LogTypes::LOG_TYPE type, LogTypes::LOG_LEVELS level) {
|
||||
m_Log[type]->SetLevel(level);
|
||||
}
|
||||
|
||||
LogTypes::LOG_LEVELS GetLogLevel(LogTypes::LOG_TYPE type)
|
||||
{
|
||||
return m_Log[type]->GetLevel();
|
||||
}
|
||||
|
||||
void SetEnable(LogTypes::LOG_TYPE type, bool enable)
|
||||
{
|
||||
void SetEnable(LogTypes::LOG_TYPE type, bool enable) {
|
||||
m_Log[type]->SetEnable(enable);
|
||||
}
|
||||
|
||||
bool IsEnabled(LogTypes::LOG_TYPE type) const
|
||||
{
|
||||
return m_Log[type]->IsEnabled();
|
||||
LogTypes::LOG_LEVELS GetLogLevel(LogTypes::LOG_TYPE type) {
|
||||
return m_Log[type]->GetLevel();
|
||||
}
|
||||
|
||||
const char* GetShortName(LogTypes::LOG_TYPE type) const
|
||||
{
|
||||
return m_Log[type]->GetShortName();
|
||||
}
|
||||
|
||||
const char* GetFullName(LogTypes::LOG_TYPE type) const
|
||||
{
|
||||
return m_Log[type]->GetFullName();
|
||||
}
|
||||
|
||||
void AddListener(LogTypes::LOG_TYPE type, LogListener *listener)
|
||||
{
|
||||
void AddListener(LogTypes::LOG_TYPE type, LogListener *listener) {
|
||||
m_Log[type]->AddListener(listener);
|
||||
}
|
||||
|
||||
void RemoveListener(LogTypes::LOG_TYPE type, LogListener *listener)
|
||||
{
|
||||
void RemoveListener(LogTypes::LOG_TYPE type, LogListener *listener) {
|
||||
m_Log[type]->RemoveListener(listener);
|
||||
}
|
||||
|
||||
FileLogListener *GetFileListener() const
|
||||
{
|
||||
return m_fileLog;
|
||||
}
|
||||
|
||||
ConsoleListener *GetConsoleListener() const
|
||||
{
|
||||
ConsoleListener *GetConsoleListener() const {
|
||||
return m_consoleLog;
|
||||
}
|
||||
|
||||
DebuggerLogListener *GetDebuggerListener() const
|
||||
{
|
||||
DebuggerLogListener *GetDebuggerListener() const {
|
||||
return m_debuggerLog;
|
||||
}
|
||||
|
||||
static LogManager* GetInstance()
|
||||
{
|
||||
static LogManager* GetInstance() {
|
||||
return m_logManager;
|
||||
}
|
||||
|
||||
static void SetInstance(LogManager *logManager)
|
||||
{
|
||||
static void SetInstance(LogManager *logManager) {
|
||||
m_logManager = logManager;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -262,10 +262,10 @@ u32 sceSasSetPitch(u32 core, int voiceNum, int pitch) {
|
||||
SasVoice &v = sas->voices[voiceNum];
|
||||
// Clamp pitch
|
||||
if (pitch < PSP_SAS_PITCH_MIN) {
|
||||
WARN_LOG(SAS, "bad pitch %i, clamping to %i", pitch, PSP_SAS_PITCH_MIN);
|
||||
WARN_LOG(HLE, "sceSasSetPitch: bad pitch %i, clamping to %i", pitch, PSP_SAS_PITCH_MIN);
|
||||
pitch = PSP_SAS_PITCH_MIN;
|
||||
} else if (pitch > PSP_SAS_PITCH_MAX) {
|
||||
WARN_LOG(SAS, "bad pitch %i, clamping to %i", pitch, PSP_SAS_PITCH_MAX);
|
||||
WARN_LOG(HLE, "sceSasSetPitch: bad pitch %i, clamping to %i", pitch, PSP_SAS_PITCH_MAX);
|
||||
pitch = PSP_SAS_PITCH_MAX;
|
||||
}
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ void VagDecoder::DecodeBlock(u8 *&readp) {
|
||||
predict_nr >>= 4;
|
||||
int flags = *readp++;
|
||||
if (flags == 7) {
|
||||
VERBOSE_LOG(SAS, "VAG ending block at %d", curBlock_);
|
||||
VERBOSE_LOG(SASMIX, "VAG ending block at %d", curBlock_);
|
||||
end_ = true;
|
||||
return;
|
||||
}
|
||||
@@ -105,14 +105,14 @@ void VagDecoder::GetSamples(s16 *outSamples, int numSamples) {
|
||||
u8 *readp = Memory::GetPointer(read_);
|
||||
if (!readp)
|
||||
{
|
||||
WARN_LOG(SAS, "Bad VAG samples address?");
|
||||
WARN_LOG(SASMIX, "Bad VAG samples address?");
|
||||
return;
|
||||
}
|
||||
u8 *origp = readp;
|
||||
for (int i = 0; i < numSamples; i++) {
|
||||
if (curSample == 28) {
|
||||
if (loopAtNextBlock_) {
|
||||
VERBOSE_LOG(SAS, "Looping VAG from block %d/%d to %d", curBlock_, numBlocks_, loopStartBlock_);
|
||||
VERBOSE_LOG(SASMIX, "Looping VAG from block %d/%d to %d", curBlock_, numBlocks_, loopStartBlock_);
|
||||
// data_ starts at curBlock = -1.
|
||||
read_ = data_ + 16 * loopStartBlock_ + 16;
|
||||
readp = Memory::GetPointer(read_);
|
||||
@@ -234,7 +234,7 @@ static int getSustainType(int bitfield2) {
|
||||
case 4: return PSP_SAS_ADSR_CURVE_MODE_LINEAR_BENT;
|
||||
case 6: return PSP_SAS_ADSR_CURVE_MODE_EXPONENT_DECREASE;
|
||||
}
|
||||
ERROR_LOG(SAS,"sasSetSimpleADSR,ERROR_SAS_INVALID_ADSR_CURVE_MODE");
|
||||
ERROR_LOG(SASMIX,"sasSetSimpleADSR,ERROR_SAS_INVALID_ADSR_CURVE_MODE");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -357,7 +357,7 @@ void SasInstance::Mix(u32 outAddr, u32 inAddr, int leftVol, int rightVol) {
|
||||
// But for now, see Smoothness HACKERY below :P
|
||||
u32 numSamples = (voice.sampleFrac + grainSize * voice.pitch) / PSP_SAS_PITCH_BASE;
|
||||
if ((int)numSamples > grainSize * 4) {
|
||||
ERROR_LOG(SAS, "numSamples too large, clamping: %i vs %i", numSamples, grainSize * 4);
|
||||
ERROR_LOG(SASMIX, "numSamples too large, clamping: %i vs %i", numSamples, grainSize * 4);
|
||||
numSamples = grainSize * 4;
|
||||
}
|
||||
|
||||
@@ -541,7 +541,7 @@ void SasVoice::KeyOn() {
|
||||
if (Memory::IsValidAddress(vagAddr)) {
|
||||
vag.Start(vagAddr, vagSize, loop);
|
||||
} else {
|
||||
ERROR_LOG(SAS, "Invalid VAG address %08x", vagAddr);
|
||||
ERROR_LOG(SASMIX, "Invalid VAG address %08x", vagAddr);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
|
||||
+15
-11
@@ -16,18 +16,19 @@
|
||||
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
|
||||
|
||||
#include "Common/ChunkFile.h"
|
||||
#include "../../Core.h"
|
||||
#include "../../CoreTiming.h"
|
||||
#include "../MIPS.h"
|
||||
#include "../MIPSCodeUtils.h"
|
||||
#include "../MIPSInt.h"
|
||||
#include "../MIPSTables.h"
|
||||
#include "Core/Reporting.h"
|
||||
#include "Core/Core.h"
|
||||
#include "Core/CoreTiming.h"
|
||||
#include "Core/MIPS/MIPS.h"
|
||||
#include "Core/MIPS/MIPSCodeUtils.h"
|
||||
#include "Core/MIPS/MIPSInt.h"
|
||||
#include "Core/MIPS/MIPSTables.h"
|
||||
|
||||
#include "ArmRegCache.h"
|
||||
#include "ArmJit.h"
|
||||
#include "CPUDetect.h"
|
||||
|
||||
#include "../../../ext/disarm.h"
|
||||
#include "ext/disarm.h"
|
||||
|
||||
void DisassembleArm(const u8 *data, int size) {
|
||||
char temp[256];
|
||||
@@ -129,11 +130,14 @@ void Jit::CompileAt(u32 addr)
|
||||
MIPSCompileOp(op);
|
||||
}
|
||||
|
||||
void Jit::EatInstruction(MIPSOpcode op)
|
||||
{
|
||||
void Jit::EatInstruction(MIPSOpcode op) {
|
||||
MIPSInfo info = MIPSGetInfo(op);
|
||||
_dbg_assert_msg_(JIT, !(info & DELAYSLOT), "Never eat a branch op.");
|
||||
_dbg_assert_msg_(JIT, !js.inDelaySlot, "Never eat an instruction inside a delayslot.");
|
||||
if (info & DELAYSLOT) {
|
||||
ERROR_LOG_REPORT_ONCE(ateDelaySlot, JIT, "Ate a branch op.");
|
||||
}
|
||||
if (js.inDelaySlot) {
|
||||
ERROR_LOG_REPORT_ONCE(ateInDelaySlot, JIT, "Ate an instruction inside a delay slot.")
|
||||
}
|
||||
|
||||
js.compilerPC += 4;
|
||||
js.downcountAmount += MIPSGetInstructionCycleEstimate(op);
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <iterator>
|
||||
|
||||
#include "Common/ChunkFile.h"
|
||||
#include "Core/Core.h"
|
||||
#include "Core/System.h"
|
||||
@@ -31,8 +32,8 @@
|
||||
#include "RegCache.h"
|
||||
#include "Jit.h"
|
||||
|
||||
#include "../../Host.h"
|
||||
#include "../../Debugger/Breakpoints.h"
|
||||
#include "Core/Host.h"
|
||||
#include "Core/Debugger/Breakpoints.h"
|
||||
|
||||
namespace MIPSComp
|
||||
{
|
||||
@@ -229,8 +230,12 @@ void Jit::CompileAt(u32 addr)
|
||||
void Jit::EatInstruction(MIPSOpcode op)
|
||||
{
|
||||
MIPSInfo info = MIPSGetInfo(op);
|
||||
_dbg_assert_msg_(JIT, !(info & DELAYSLOT), "Never eat a branch op.");
|
||||
_dbg_assert_msg_(JIT, !js.inDelaySlot, "Never eat an instruction inside a delayslot.");
|
||||
if (info & DELAYSLOT) {
|
||||
ERROR_LOG_REPORT_ONCE(ateDelaySlot, JIT, "Ate a branch op.");
|
||||
}
|
||||
if (js.inDelaySlot) {
|
||||
ERROR_LOG_REPORT_ONCE(ateInDelaySlot, JIT, "Ate an instruction inside a delay slot.")
|
||||
}
|
||||
|
||||
CheckJitBreakpoint(js.compilerPC + 4, 0);
|
||||
js.numInstructions++;
|
||||
|
||||
@@ -118,6 +118,9 @@ static inline void GetTexelCoordinates(int level, float s, float t, unsigned int
|
||||
int width = 1 << (gstate.texsize[level] & 0xf);
|
||||
int height = 1 << ((gstate.texsize[level]>>8) & 0xf);
|
||||
|
||||
// TODO: These should really be multiplied by 256 to get fixed point coordinates
|
||||
// so we can do texture filtering later.
|
||||
|
||||
u = (unsigned int)(s * width); // TODO: width-1 instead?
|
||||
v = (unsigned int)(t * height); // TODO: width-1 instead?
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user