mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-22 02:32:36 +01:00
Logging system rework
* use one central unified log with channels/priorities ad-hoc listener registration and de-registration * disable buffering by default * add multi-threaded ringbuffer implementation * use buffered listener for the gui (using the ringbuffer)
This commit is contained in:
parent
394b698e92
commit
21da317453
225
Utilities/Log.cpp
Normal file
225
Utilities/Log.cpp
Normal file
@ -0,0 +1,225 @@
|
||||
#include "stdafx.h"
|
||||
#include "Log.h"
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <cinttypes>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
#include <mutex>
|
||||
#include <condition_variable>
|
||||
#include <thread>
|
||||
#include <set>
|
||||
#include <array>
|
||||
|
||||
using namespace Log;
|
||||
|
||||
LogManager *gLogManager = nullptr;
|
||||
|
||||
u32 LogMessage::size()
|
||||
{
|
||||
//1 byte for NULL terminator
|
||||
return sizeof(LogMessage::size_type) + sizeof(LogType) + sizeof(LogSeverity) + sizeof(std::string::value_type)*mText.size() + 1;
|
||||
}
|
||||
|
||||
void LogMessage::serialize(char *output)
|
||||
{
|
||||
LogMessage::size_type size = this->size();
|
||||
memcpy(output, &size, sizeof(LogMessage::size_type));
|
||||
output += sizeof(LogMessage::size_type);
|
||||
memcpy(output, &mType, sizeof(LogType));
|
||||
output += sizeof(LogType);
|
||||
memcpy(output, &mServerity, sizeof(LogSeverity));
|
||||
output += sizeof(LogSeverity);
|
||||
memcpy(output, mText.c_str(), mText.size() );
|
||||
output += sizeof(std::string::value_type)*mText.size();
|
||||
*output = '\0';
|
||||
|
||||
}
|
||||
LogMessage LogMessage::deserialize(char *input, u32* size_out)
|
||||
{
|
||||
LogMessage msg;
|
||||
LogMessage::size_type msgSize = *(reinterpret_cast<LogMessage::size_type*>(input));
|
||||
input += sizeof(LogMessage::size_type);
|
||||
msg.mType = *(reinterpret_cast<LogType*>(input));
|
||||
input += sizeof(LogType);
|
||||
msg.mServerity = *(reinterpret_cast<LogSeverity*>(input));
|
||||
input += sizeof(LogSeverity);
|
||||
if (msgSize > 9000)
|
||||
{
|
||||
int wtf = 6;
|
||||
}
|
||||
msg.mText.append(input, msgSize - 1 - sizeof(LogSeverity) - sizeof(LogType));
|
||||
if (size_out){(*size_out) = msgSize;}
|
||||
return msg;
|
||||
}
|
||||
|
||||
|
||||
|
||||
LogChannel::LogChannel() : LogChannel("unknown")
|
||||
{}
|
||||
|
||||
LogChannel::LogChannel(const std::string& name) :
|
||||
name(name)
|
||||
, mEnabled(true)
|
||||
, mLogLevel(Warning)
|
||||
{}
|
||||
|
||||
void LogChannel::log(LogMessage msg)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mListenerLock);
|
||||
for (auto &listener : mListeners)
|
||||
{
|
||||
listener->log(msg);
|
||||
}
|
||||
}
|
||||
|
||||
void LogChannel::addListener(std::shared_ptr<LogListener> listener)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mListenerLock);
|
||||
mListeners.insert(listener);
|
||||
}
|
||||
void LogChannel::removeListener(std::shared_ptr<LogListener> listener)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mListenerLock);
|
||||
mListeners.erase(listener);
|
||||
}
|
||||
|
||||
struct CoutListener : LogListener
|
||||
{
|
||||
void log(LogMessage msg)
|
||||
{
|
||||
std::cerr << msg.mText << std::endl;
|
||||
}
|
||||
};
|
||||
|
||||
struct FileListener : LogListener
|
||||
{
|
||||
rFile mFile;
|
||||
bool mPrependChannelName;
|
||||
|
||||
FileListener(const std::string& name = _PRGNAME_, bool prependChannel = true)
|
||||
: mFile(name + ".log", rFile::write),
|
||||
mPrependChannelName(prependChannel)
|
||||
{
|
||||
if (!mFile.IsOpened())
|
||||
{
|
||||
rMessageBox("Can't create log file! (" + name + ".log)", rMessageBoxCaptionStr, rICON_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
void log(LogMessage msg)
|
||||
{
|
||||
if (mPrependChannelName)
|
||||
{
|
||||
msg.mText.insert(0, gTypeNameTable[static_cast<u32>(msg.mType)].mName);
|
||||
}
|
||||
mFile.Write(msg.mText);
|
||||
}
|
||||
};
|
||||
|
||||
LogManager::LogManager()
|
||||
#ifdef BUFFERED_LOGGING
|
||||
: mExiting(false), mLogConsumer()
|
||||
#endif
|
||||
{
|
||||
auto it = mChannels.begin();
|
||||
std::shared_ptr<LogListener> listener(new FileListener());
|
||||
for (const LogTypeName& name : gTypeNameTable)
|
||||
{
|
||||
it->name = name.mName;
|
||||
it->addListener(listener);
|
||||
it++;
|
||||
}
|
||||
std::shared_ptr<LogListener> TTYListener(new FileListener("TTY",false));
|
||||
getChannel(TTY).addListener(TTYListener);
|
||||
#ifdef BUFFERED_LOGGING
|
||||
mLogConsumer = std::thread(&LogManager::consumeLog, this);
|
||||
#endif
|
||||
}
|
||||
|
||||
LogManager::~LogManager()
|
||||
{
|
||||
#ifdef BUFFERED_LOGGING
|
||||
mExiting = true;
|
||||
mBufferReady.notify_all();
|
||||
mLogConsumer.join();
|
||||
}
|
||||
|
||||
void LogManager::consumeLog()
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(mStatusMut);
|
||||
while (!mExiting)
|
||||
{
|
||||
mBufferReady.wait(lock);
|
||||
mBuffer.lockGet();
|
||||
size_t size = mBuffer.size();
|
||||
std::vector<char> local_messages(size);
|
||||
mBuffer.popN(&local_messages.front(), size);
|
||||
mBuffer.unlockGet();
|
||||
|
||||
u32 cursor = 0;
|
||||
u32 removed = 0;
|
||||
while (cursor < size)
|
||||
{
|
||||
Log::LogMessage msg = Log::LogMessage::deserialize(local_messages.data() + cursor, &removed);
|
||||
cursor += removed;
|
||||
getChannel(msg.mType).log(msg);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void LogManager::log(LogMessage msg)
|
||||
{
|
||||
//don't do any formatting changes or filtering to the TTY output since we
|
||||
//use the raw output to do diffs with the output of a real PS3 and some
|
||||
//programs write text in single bytes to the console
|
||||
if (msg.mType != TTY)
|
||||
{
|
||||
std::string prefix;
|
||||
switch (msg.mServerity)
|
||||
{
|
||||
case Success:
|
||||
prefix = "S ";
|
||||
break;
|
||||
case Notice:
|
||||
prefix = "! ";
|
||||
break;
|
||||
case Warning:
|
||||
prefix = "W ";
|
||||
break;
|
||||
case Error:
|
||||
prefix = "E ";
|
||||
break;
|
||||
}
|
||||
if (NamedThreadBase* thr = GetCurrentNamedThread())
|
||||
{
|
||||
prefix += thr->GetThreadName();
|
||||
}
|
||||
msg.mText.insert(0, prefix);
|
||||
msg.mText.append(1,'\n');
|
||||
}
|
||||
#ifdef BUFFERED_LOGGING
|
||||
size_t size = msg.size();
|
||||
std::vector<char> temp_buffer(size);
|
||||
msg.serialize(temp_buffer.data());
|
||||
mBuffer.pushRange(temp_buffer.begin(), temp_buffer.end());
|
||||
mBufferReady.notify_one();
|
||||
#else
|
||||
mChannels[static_cast<u32>(msg.mType)].log(msg);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
LogManager& LogManager::getInstance()
|
||||
{
|
||||
if (!gLogManager)
|
||||
{
|
||||
gLogManager = new LogManager();
|
||||
}
|
||||
return *gLogManager;
|
||||
}
|
||||
LogChannel &LogManager::getChannel(LogType type)
|
||||
{
|
||||
return mChannels[static_cast<u32>(type)];
|
||||
}
|
139
Utilities/Log.h
Normal file
139
Utilities/Log.h
Normal file
@ -0,0 +1,139 @@
|
||||
#pragma once
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <cinttypes>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
#include <mutex>
|
||||
#include <set>
|
||||
#include <array>
|
||||
#include "Utilities/MTRingbuffer.h"
|
||||
|
||||
//#define BUFFERED_LOGGING 1
|
||||
|
||||
//another msvc bug makes these not work, uncomment these and replace it with the one at the bottom when it's fixed
|
||||
//#define LOG_MESSAGE(logType, severity, text) Log::LogManager::getInstance().log({logType, severity, text})
|
||||
|
||||
//first parameter is of type Log::LogType and text is of type std::string
|
||||
#define LOG_MESSAGE(logType, severity, text) do{Log::LogMessage msg{logType, severity, text}; Log::LogManager::getInstance().log(msg);}while(0)
|
||||
|
||||
#define LOG_SUCCESS(logType, text) LOG_MESSAGE(logType, Log::Success, text)
|
||||
#define LOG_NOTICE(logType, text) LOG_MESSAGE(logType, Log::Notice, text)
|
||||
#define LOG_WARNING(logType, text) LOG_MESSAGE(logType, Log::Warning, text)
|
||||
#define LOG_ERROR(logType, text) LOG_MESSAGE(logType, Log::Error, text)
|
||||
|
||||
#define LOGF_SUCCESS(logType, fmtstring, ...) LOG_SUCCESS(logType, fmt::Format(fmtstring, ##__VA_ARGS__ ))
|
||||
#define LOGF_NOTICE(logType, fmtstring, ...) LOG_NOTICE(logType, fmt::Format(fmtstring, ##__VA_ARGS__ ))
|
||||
#define LOGF_WARNING(logType, fmtstring, ...) LOG_WARNING(logType, fmt::Format(fmtstring, ##__VA_ARGS__ ))
|
||||
#define LOGF_ERROR(logType, fmtstring, ...) LOG_ERROR(logType, fmt::Format(fmtstring, ##__VA_ARGS__ ))
|
||||
|
||||
namespace Log
|
||||
{
|
||||
const unsigned int MAX_LOG_BUFFER_LENGTH = 1024*1024;
|
||||
const unsigned int gBuffSize = 1000;
|
||||
|
||||
enum LogType : u32
|
||||
{
|
||||
GENERAL = 0,
|
||||
LOADER,
|
||||
MEMORY,
|
||||
RSX,
|
||||
HLE,
|
||||
PPU,
|
||||
SPU,
|
||||
TTY,
|
||||
};
|
||||
|
||||
|
||||
struct LogTypeName
|
||||
{
|
||||
LogType mType;
|
||||
std::string mName;
|
||||
};
|
||||
|
||||
//well I'd love make_array() but alas manually counting is not the end of the world
|
||||
static const std::array<LogTypeName, 8> gTypeNameTable = { {
|
||||
{ GENERAL, "G: " },
|
||||
{ LOADER, "LDR: " },
|
||||
{ MEMORY, "MEM: " },
|
||||
{ RSX, "RSX: " },
|
||||
{ HLE, "HLE: " },
|
||||
{ PPU, "PPU: " },
|
||||
{ SPU, "SPU: " },
|
||||
{ TTY, "TTY: " }
|
||||
} };
|
||||
|
||||
enum LogSeverity : u32
|
||||
{
|
||||
Success = 0,
|
||||
Notice,
|
||||
Warning,
|
||||
Error,
|
||||
};
|
||||
|
||||
struct LogMessage
|
||||
{
|
||||
using size_type = u32;
|
||||
LogType mType;
|
||||
LogSeverity mServerity;
|
||||
std::string mText;
|
||||
|
||||
u32 size();
|
||||
void serialize(char *output);
|
||||
static LogMessage deserialize(char *input, u32* size_out=nullptr);
|
||||
};
|
||||
|
||||
struct LogListener
|
||||
{
|
||||
virtual ~LogListener() {};
|
||||
virtual void log(LogMessage msg) = 0;
|
||||
};
|
||||
|
||||
struct LogChannel
|
||||
{
|
||||
LogChannel();
|
||||
LogChannel(const std::string& name);
|
||||
LogChannel(LogChannel& other) = delete;
|
||||
LogChannel& operator = (LogChannel& other) = delete;
|
||||
void log(LogMessage msg);
|
||||
void addListener(std::shared_ptr<LogListener> listener);
|
||||
void removeListener(std::shared_ptr<LogListener> listener);
|
||||
std::string name;
|
||||
private:
|
||||
bool mEnabled;
|
||||
LogSeverity mLogLevel;
|
||||
std::mutex mListenerLock;
|
||||
std::set<std::shared_ptr<LogListener>> mListeners;
|
||||
};
|
||||
|
||||
struct LogManager
|
||||
{
|
||||
LogManager();
|
||||
~LogManager();
|
||||
static LogManager& getInstance();
|
||||
LogChannel& getChannel(LogType type);
|
||||
void log(LogMessage msg);
|
||||
#ifdef BUFFERED_LOGGING
|
||||
void consumeLog();
|
||||
#endif
|
||||
private:
|
||||
#ifdef BUFFERED_LOGGING
|
||||
MTRingbuffer<char, MAX_LOG_BUFFER_LENGTH> mBuffer;
|
||||
std::condition_variable mBufferReady;
|
||||
std::mutex mStatusMut;
|
||||
std::atomic<bool> mExiting;
|
||||
std::thread mLogConsumer;
|
||||
#endif
|
||||
std::array<LogChannel, std::tuple_size<decltype(gTypeNameTable)>::value> mChannels;
|
||||
//std::array<LogChannel,gTypeNameTable.size()> mChannels; //TODO: use this once Microsoft sorts their shit out
|
||||
};
|
||||
}
|
||||
|
||||
static struct { inline operator Log::LogType() { return Log::LogType::GENERAL; } } GENERAL;
|
||||
static struct { inline operator Log::LogType() { return Log::LogType::LOADER; } } LOADER;
|
||||
static struct { inline operator Log::LogType() { return Log::LogType::MEMORY; } } MEMORY;
|
||||
static struct { inline operator Log::LogType() { return Log::LogType::RSX; } } RSX;
|
||||
static struct { inline operator Log::LogType() { return Log::LogType::HLE; } } HLE;
|
||||
static struct { inline operator Log::LogType() { return Log::LogType::PPU; } } PPU;
|
||||
static struct { inline operator Log::LogType() { return Log::LogType::SPU; } } SPU;
|
||||
static struct { inline operator Log::LogType() { return Log::LogType::TTY; } } TTY;
|
159
Utilities/MTRingbuffer.h
Normal file
159
Utilities/MTRingbuffer.h
Normal file
@ -0,0 +1,159 @@
|
||||
#pragma once
|
||||
#include <thread>
|
||||
#include <array>
|
||||
#include <mutex>
|
||||
#include <algorithm>
|
||||
|
||||
//Simple non-resizable FIFO Ringbuffer that can be simultaneously be read from and written to
|
||||
//if we ever get to use boost please replace this with boost::circular_buffer, there's no reason
|
||||
//why we would have to keep this amateur attempt at such a fundamental data-structure around
|
||||
template< typename T, unsigned int MAX_MTRINGBUFFER_BUFFER_SIZE>
|
||||
class MTRingbuffer{
|
||||
std::array<T, MAX_MTRINGBUFFER_BUFFER_SIZE> mBuffer;
|
||||
//this is a recursive mutex because the get methods lock it but the only
|
||||
//way to be sure that they do not block is to check the size and the only
|
||||
//way to check the size and use get atomically is to lock this mutex,
|
||||
//so it goes:
|
||||
//lock get mutex-->check size-->call get-->lock get mutex-->unlock get mutex-->return from get-->unlock get mutex
|
||||
std::recursive_mutex mMutGet;
|
||||
std::mutex mMutPut;
|
||||
|
||||
size_t mGet;
|
||||
size_t mPut;
|
||||
size_t moveGet(size_t by = 1){ return (mGet + by) % MAX_MTRINGBUFFER_BUFFER_SIZE; }
|
||||
size_t movePut(size_t by = 1){ return (mPut + by) % MAX_MTRINGBUFFER_BUFFER_SIZE; }
|
||||
public:
|
||||
MTRingbuffer() : mGet(0), mPut(0){}
|
||||
|
||||
//blocks until there's something to get, so check "free()" if you want to avoid blocking
|
||||
//also lock the get mutex around the free() check and the pop if you want to avoid racing
|
||||
T pop()
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> lock(mMutGet);
|
||||
while (mGet == mPut)
|
||||
{
|
||||
//wait until there's actually something to get
|
||||
//throwing an exception might be better, blocking here is a little awkward
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(1));
|
||||
}
|
||||
size_t ret = mGet;
|
||||
mGet = moveGet();
|
||||
return mBuffer[ret];
|
||||
}
|
||||
|
||||
//blocks if the buffer is full until there's enough room
|
||||
void push(T &putEle)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mMutPut);
|
||||
while (movePut() == mGet)
|
||||
{
|
||||
//if this is reached a lot it's time to increase the buffer size
|
||||
//or implement dynamic re-sizing
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(1));
|
||||
}
|
||||
mBuffer[mPut] = std::forward(putEle);
|
||||
mPut = movePut();
|
||||
}
|
||||
|
||||
bool empty()
|
||||
{
|
||||
return mGet == mPut;
|
||||
}
|
||||
|
||||
//returns the amount of free places, this is the amount of actual free spaces-1
|
||||
//since mGet==mPut signals an empty buffer we can't actually use the last free
|
||||
//space, so we shouldn't report it as free.
|
||||
size_t free()
|
||||
{
|
||||
if (mGet < mPut)
|
||||
{
|
||||
return mBuffer.size() - (mPut - mGet) - 1;
|
||||
}
|
||||
else if (mGet > mPut)
|
||||
{
|
||||
return mGet - mPut - 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return mBuffer.size() - 1;
|
||||
}
|
||||
}
|
||||
|
||||
size_t size()
|
||||
{
|
||||
//the magic -1 is the same magic 1 that is explained in the free() function
|
||||
return mBuffer.size() - free() - 1;
|
||||
}
|
||||
|
||||
//takes random access iterator to T
|
||||
template<typename IteratorType>
|
||||
void pushRange(IteratorType from, IteratorType until)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mMutPut);
|
||||
size_t length = until - from;
|
||||
|
||||
//if whatever we're trying to store is greater than the entire buffer the following loop will be infinite
|
||||
assert(mBuffer.size() > length);
|
||||
while (free() < length)
|
||||
{
|
||||
//if this is reached a lot it's time to increase the buffer size
|
||||
//or implement dynamic re-sizing
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(1));
|
||||
}
|
||||
if (mPut + length <= mBuffer.size())
|
||||
{
|
||||
std::copy(from, until, mBuffer.begin() + mPut);
|
||||
}
|
||||
else
|
||||
{
|
||||
size_t tillEnd = mBuffer.size() - mPut;
|
||||
std::copy(from, from + tillEnd, mBuffer.begin() + mPut);
|
||||
std::copy(from + tillEnd, until, mBuffer.begin());
|
||||
}
|
||||
mPut = movePut(length);
|
||||
|
||||
}
|
||||
|
||||
//takes output iterator to T
|
||||
template<typename IteratorType>
|
||||
void popN(IteratorType output, size_t n)
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> lock(mMutGet);
|
||||
//make sure we're not trying to retrieve more than is in
|
||||
assert(n <= size());
|
||||
peekN<IteratorType>(output, n);
|
||||
mGet = moveGet(n);
|
||||
}
|
||||
|
||||
//takes output iterator to T
|
||||
template<typename IteratorType>
|
||||
void peekN(IteratorType output, size_t n)
|
||||
{
|
||||
size_t lGet = mGet;
|
||||
if (lGet + n <= mBuffer.size())
|
||||
{
|
||||
std::copy_n(mBuffer.begin() + lGet, n, output);
|
||||
}
|
||||
else
|
||||
{
|
||||
auto next = std::copy(mBuffer.begin() + lGet, mBuffer.end(), output);
|
||||
std::copy_n(mBuffer.begin(), n - (mBuffer.size() - lGet), next);
|
||||
}
|
||||
}
|
||||
|
||||
//well this is just asking for trouble
|
||||
//but the comment above the declaration of mMutGet explains why it's there
|
||||
//if there's a better way please remove this
|
||||
void lockGet()
|
||||
{
|
||||
mMutGet.lock();
|
||||
}
|
||||
|
||||
//well this is just asking for trouble
|
||||
//but the comment above the declaration of mMutGet explains why it's there
|
||||
//if there's a better way please remove this
|
||||
void unlockGet()
|
||||
{
|
||||
mMutGet.unlock();
|
||||
}
|
||||
};
|
@ -1,5 +1,5 @@
|
||||
#include <stdafx.h>
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/CPU/CPUThread.h"
|
||||
|
@ -148,7 +148,7 @@ public:
|
||||
{
|
||||
if (!Emu.IsStopped())
|
||||
{
|
||||
ConLog.Error("SMutexLockerBase: thread id == 0");
|
||||
LOG_ERROR(HLE, "SMutexLockerBase: thread id == 0");
|
||||
Emu.Pause();
|
||||
}
|
||||
return;
|
||||
|
@ -4,6 +4,7 @@
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
#include <cstdio>
|
||||
#include <functional>
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#define snprintf _snprintf
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
|
||||
#include "Thread.h"
|
||||
|
||||
@ -134,7 +134,7 @@ void thread::start(std::function<void()> func)
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
ConLog.Error("Crash :(");
|
||||
LOG_ERROR(HLE, "Crash :(");
|
||||
//std::terminate();
|
||||
}
|
||||
|
||||
|
@ -120,7 +120,7 @@ size_t rFile::Write(const void *buffer, size_t count)
|
||||
|
||||
bool rFile::Write(const std::string &text)
|
||||
{
|
||||
return reinterpret_cast<wxFile*>(handle)->Write(fmt::FromUTF8(text));
|
||||
return reinterpret_cast<wxFile*>(handle)->Write(reinterpret_cast<const void*>(text.c_str()),text.size());
|
||||
}
|
||||
|
||||
bool rFile::Close()
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "stdafx.h"
|
||||
#include "unedat.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
|
||||
void generate_key(int crypto_mode, int version, unsigned char *key_final, unsigned char *iv_final, unsigned char *key, unsigned char *iv)
|
||||
{
|
||||
@ -74,7 +74,7 @@ bool crypto(int hash_mode, int crypto_mode, int version, unsigned char *in, unsi
|
||||
}
|
||||
else
|
||||
{
|
||||
ConLog.Error("EDAT: Unknown crypto algorithm!\n");
|
||||
LOG_ERROR(LOADER, "EDAT: Unknown crypto algorithm!\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -92,7 +92,7 @@ bool crypto(int hash_mode, int crypto_mode, int version, unsigned char *in, unsi
|
||||
}
|
||||
else
|
||||
{
|
||||
ConLog.Error("EDAT: Unknown hashing algorithm!\n");
|
||||
LOG_ERROR(LOADER, "EDAT: Unknown hashing algorithm!\n");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -158,7 +158,7 @@ int decrypt_data(rFile *in, rFile *out, EDAT_SDAT_HEADER *edat, NPD_HEADER *npd,
|
||||
|
||||
if ((edat->flags & EDAT_FLAG_0x3C) != 0 || (edat->flags & EDAT_FLAG_0x3D) != 0)
|
||||
{
|
||||
ConLog.Error("EDAT: Flag 0x3C/0x3D EDAT files are unsupported yet");
|
||||
LOG_ERROR(LOADER, "EDAT: Flag 0x3C/0x3D EDAT files are unsupported yet");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -268,15 +268,15 @@ int decrypt_data(rFile *in, rFile *out, EDAT_SDAT_HEADER *edat, NPD_HEADER *npd,
|
||||
memset(decomp_data, 0, decomp_size);
|
||||
|
||||
if (verbose)
|
||||
ConLog.Write("EDAT: Decompressing...\n");
|
||||
LOG_NOTICE(LOADER, "EDAT: Decompressing...\n");
|
||||
|
||||
int res = lz_decompress(decomp_data, dec_data, decomp_size);
|
||||
out->Write(decomp_data, res);
|
||||
|
||||
if (verbose)
|
||||
{
|
||||
ConLog.Write("EDAT: Compressed block size: %d\n", pad_length);
|
||||
ConLog.Write("EDAT: Decompressed block size: %d\n", res);
|
||||
LOGF_NOTICE(LOADER, "EDAT: Compressed block size: %d\n", pad_length);
|
||||
LOGF_NOTICE(LOADER, "EDAT: Decompressed block size: %d\n", res);
|
||||
}
|
||||
|
||||
edat->file_size -= res;
|
||||
@ -285,11 +285,11 @@ int decrypt_data(rFile *in, rFile *out, EDAT_SDAT_HEADER *edat, NPD_HEADER *npd,
|
||||
{
|
||||
if (res < 0)
|
||||
{
|
||||
ConLog.Error("EDAT: Decompression failed!\n");
|
||||
LOG_ERROR(LOADER, "EDAT: Decompression failed!\n");
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
ConLog.Success("EDAT: Data successfully decompressed!\n");
|
||||
LOG_SUCCESS(LOADER, "EDAT: Data successfully decompressed!\n");
|
||||
}
|
||||
|
||||
delete[] decomp_data;
|
||||
@ -315,7 +315,7 @@ static bool check_flags(EDAT_SDAT_HEADER *edat, NPD_HEADER *npd)
|
||||
{
|
||||
if (edat->flags & 0x7EFFFFFE)
|
||||
{
|
||||
ConLog.Error("EDAT: Bad header flags!\n");
|
||||
LOG_ERROR(LOADER, "EDAT: Bad header flags!\n");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -323,7 +323,7 @@ static bool check_flags(EDAT_SDAT_HEADER *edat, NPD_HEADER *npd)
|
||||
{
|
||||
if (edat->flags & 0x7EFFFFE0)
|
||||
{
|
||||
ConLog.Error("EDAT: Bad header flags!\n");
|
||||
LOG_ERROR(LOADER, "EDAT: Bad header flags!\n");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -331,13 +331,13 @@ static bool check_flags(EDAT_SDAT_HEADER *edat, NPD_HEADER *npd)
|
||||
{
|
||||
if (edat->flags & 0x7EFFFFC0)
|
||||
{
|
||||
ConLog.Error("EDAT: Bad header flags!\n");
|
||||
LOG_ERROR(LOADER, "EDAT: Bad header flags!\n");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (npd->version > 4)
|
||||
{
|
||||
ConLog.Error("EDAT: Unknown version - %d\n", npd->version);
|
||||
LOGF_ERROR(LOADER, "EDAT: Unknown version - %d\n", npd->version);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -370,7 +370,7 @@ int check_data(unsigned char *key, EDAT_SDAT_HEADER *edat, NPD_HEADER *npd, rFil
|
||||
int hash_mode = ((edat->flags & EDAT_ENCRYPTED_KEY_FLAG) == 0) ? 0x00000002 : 0x10000002;
|
||||
if ((edat->flags & EDAT_DEBUG_DATA_FLAG) != 0)
|
||||
{
|
||||
ConLog.Warning("EDAT: DEBUG data detected!\n");
|
||||
LOG_ERROR(LOADER, "EDAT: DEBUG data detected!\n");
|
||||
hash_mode |= 0x01000000;
|
||||
}
|
||||
|
||||
@ -382,14 +382,14 @@ int check_data(unsigned char *key, EDAT_SDAT_HEADER *edat, NPD_HEADER *npd, rFil
|
||||
if (!crypto(hash_mode, crypto_mode, (npd->version == 4), header, tmp, 0xA0, header_key, header_iv, key, hash_result))
|
||||
{
|
||||
if (verbose)
|
||||
ConLog.Warning("EDAT: Header hash is invalid!\n");
|
||||
LOG_WARNING(LOADER, "EDAT: Header hash is invalid!\n");
|
||||
}
|
||||
|
||||
// Parse the metadata info.
|
||||
int metadata_section_size = 0x10;
|
||||
if (((edat->flags & EDAT_COMPRESSED_FLAG) != 0))
|
||||
{
|
||||
ConLog.Warning("EDAT: COMPRESSED data detected!\n");
|
||||
LOG_WARNING(LOADER, "EDAT: COMPRESSED data detected!\n");
|
||||
metadata_section_size = 0x20;
|
||||
}
|
||||
|
||||
@ -418,7 +418,7 @@ int check_data(unsigned char *key, EDAT_SDAT_HEADER *edat, NPD_HEADER *npd, rFil
|
||||
if (!crypto(hash_mode, crypto_mode, (npd->version == 4), data, tmp, block_size, header_key, header_iv, key, hash_result))
|
||||
{
|
||||
if (verbose)
|
||||
ConLog.Warning("EDAT: Metadata hash from block 0x%08x is invalid!\n", metadata_offset + bytes_read);
|
||||
LOGF_WARNING(LOADER, "EDAT: Metadata hash from block 0x%08x is invalid!\n", metadata_offset + bytes_read);
|
||||
}
|
||||
|
||||
// Adjust sizes.
|
||||
@ -455,9 +455,9 @@ void validate_data(const char* file_name, unsigned char *klicensee, NPD_HEADER *
|
||||
if (verbose)
|
||||
{
|
||||
if (title_hash_result)
|
||||
ConLog.Success("EDAT: NPD title hash is valid!\n");
|
||||
LOG_SUCCESS(LOADER, "EDAT: NPD title hash is valid!\n");
|
||||
else
|
||||
ConLog.Warning("EDAT: NPD title hash is invalid!\n");
|
||||
LOG_WARNING(LOADER, "EDAT: NPD title hash is invalid!\n");
|
||||
}
|
||||
|
||||
// Check for an empty dev_hash (can't validate if devklic is NULL);
|
||||
@ -474,7 +474,7 @@ void validate_data(const char* file_name, unsigned char *klicensee, NPD_HEADER *
|
||||
if (isDevklicEmpty)
|
||||
{
|
||||
if (verbose)
|
||||
ConLog.Warning("EDAT: NPD dev hash is empty!\n");
|
||||
LOG_WARNING(LOADER, "EDAT: NPD dev hash is empty!\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -487,9 +487,9 @@ void validate_data(const char* file_name, unsigned char *klicensee, NPD_HEADER *
|
||||
if (verbose)
|
||||
{
|
||||
if (dev_hash_result)
|
||||
ConLog.Success("EDAT: NPD dev hash is valid!\n");
|
||||
LOG_SUCCESS(LOADER, "EDAT: NPD dev hash is valid!\n");
|
||||
else
|
||||
ConLog.Warning("EDAT: NPD dev hash is invalid!\n");
|
||||
LOG_WARNING(LOADER, "EDAT: NPD dev hash is invalid!\n");
|
||||
}
|
||||
}
|
||||
|
||||
@ -522,7 +522,7 @@ bool extract_data(rFile *input, rFile *output, const char* input_file_name, unsi
|
||||
unsigned char npd_magic[4] = {0x4E, 0x50, 0x44, 0x00}; //NPD0
|
||||
if(memcmp(NPD->magic, npd_magic, 4))
|
||||
{
|
||||
ConLog.Error("EDAT: File has invalid NPD header.");
|
||||
LOG_ERROR(LOADER, "EDAT: File has invalid NPD header.");
|
||||
delete NPD;
|
||||
delete EDAT;
|
||||
return 1;
|
||||
@ -534,16 +534,16 @@ bool extract_data(rFile *input, rFile *output, const char* input_file_name, unsi
|
||||
|
||||
if (verbose)
|
||||
{
|
||||
ConLog.Write("NPD HEADER\n");
|
||||
ConLog.Write("NPD version: %d\n", NPD->version);
|
||||
ConLog.Write("NPD license: %d\n", NPD->license);
|
||||
ConLog.Write("NPD type: %d\n", NPD->type);
|
||||
ConLog.Write("\n");
|
||||
ConLog.Write("EDAT HEADER\n");
|
||||
ConLog.Write("EDAT flags: 0x%08X\n", EDAT->flags);
|
||||
ConLog.Write("EDAT block size: 0x%08X\n", EDAT->block_size);
|
||||
ConLog.Write("EDAT file size: 0x%08X\n", EDAT->file_size);
|
||||
ConLog.Write("\n");
|
||||
LOG_NOTICE(LOADER, "NPD HEADER\n");
|
||||
LOGF_NOTICE(LOADER, "NPD version: %d\n", NPD->version);
|
||||
LOGF_NOTICE(LOADER, "NPD license: %d\n", NPD->license);
|
||||
LOGF_NOTICE(LOADER, "NPD type: %d\n", NPD->type);
|
||||
LOG_NOTICE(LOADER, "\n");
|
||||
LOG_NOTICE(LOADER, "EDAT HEADER\n");
|
||||
LOGF_NOTICE(LOADER, "EDAT flags: 0x%08X\n", EDAT->flags);
|
||||
LOGF_NOTICE(LOADER, "EDAT block size: 0x%08X\n", EDAT->block_size);
|
||||
LOGF_NOTICE(LOADER, "EDAT file size: 0x%08X\n", EDAT->file_size);
|
||||
LOG_NOTICE(LOADER, "\n");
|
||||
}
|
||||
|
||||
// Set decryption key.
|
||||
@ -552,7 +552,7 @@ bool extract_data(rFile *input, rFile *output, const char* input_file_name, unsi
|
||||
|
||||
if((EDAT->flags & SDAT_FLAG) == SDAT_FLAG)
|
||||
{
|
||||
ConLog.Warning("EDAT: SDAT detected!\n");
|
||||
LOG_WARNING(LOADER, "EDAT: SDAT detected!\n");
|
||||
xor_(key, NPD->dev_hash, SDAT_KEY, 0x10);
|
||||
}
|
||||
else
|
||||
@ -579,7 +579,7 @@ bool extract_data(rFile *input, rFile *output, const char* input_file_name, unsi
|
||||
|
||||
if (!test)
|
||||
{
|
||||
ConLog.Error("EDAT: A valid RAP file is needed!");
|
||||
LOG_ERROR(LOADER, "EDAT: A valid RAP file is needed!");
|
||||
delete NPD;
|
||||
delete EDAT;
|
||||
return 1;
|
||||
@ -587,19 +587,19 @@ bool extract_data(rFile *input, rFile *output, const char* input_file_name, unsi
|
||||
}
|
||||
}
|
||||
|
||||
ConLog.Write("EDAT: Parsing data...\n");
|
||||
LOG_NOTICE(LOADER, "EDAT: Parsing data...\n");
|
||||
if (check_data(key, EDAT, NPD, input, verbose))
|
||||
ConLog.Error("EDAT: Data parsing failed!\n");
|
||||
LOG_ERROR(LOADER, "EDAT: Data parsing failed!\n");
|
||||
else
|
||||
ConLog.Success("EDAT: Data successfully parsed!\n");
|
||||
LOG_SUCCESS(LOADER, "EDAT: Data successfully parsed!\n");
|
||||
|
||||
printf("\n");
|
||||
|
||||
ConLog.Write("EDAT: Decrypting data...\n");
|
||||
LOG_NOTICE(LOADER, "EDAT: Decrypting data...\n");
|
||||
if (decrypt_data(input, output, EDAT, NPD, key, verbose))
|
||||
ConLog.Error("EDAT: Data decryption failed!");
|
||||
LOG_ERROR(LOADER, "EDAT: Data decryption failed!");
|
||||
else
|
||||
ConLog.Success("EDAT: Data successfully decrypted!");
|
||||
LOG_SUCCESS(LOADER, "EDAT: Data successfully decrypted!");
|
||||
|
||||
delete NPD;
|
||||
delete EDAT;
|
||||
@ -652,21 +652,21 @@ int DecryptEDAT(const std::string& input_file_name, const std::string& output_fi
|
||||
memcpy(devklic, custom_klic, 0x10);
|
||||
else
|
||||
{
|
||||
ConLog.Error("EDAT: Invalid custom klic!\n");
|
||||
LOG_ERROR(LOADER, "EDAT: Invalid custom klic!\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
default:
|
||||
ConLog.Error("EDAT: Invalid mode!\n");
|
||||
LOG_ERROR(LOADER, "EDAT: Invalid mode!\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Check the input/output files.
|
||||
if (!input.IsOpened() || !output.IsOpened())
|
||||
{
|
||||
ConLog.Error("EDAT: Failed to open files!\n");
|
||||
LOG_ERROR(LOADER, "EDAT: Failed to open files!\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -2,13 +2,13 @@
|
||||
#include "unpkg.h"
|
||||
#include <wx/progdlg.h>
|
||||
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
|
||||
// Decryption.
|
||||
bool CheckHeader(rFile& pkg_f, PKGHeader* m_header)
|
||||
{
|
||||
if (m_header->pkg_magic != 0x7F504B47) {
|
||||
ConLog.Error("PKG: Not a package file!");
|
||||
LOG_ERROR(LOADER, "PKG: Not a package file!");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -17,7 +17,7 @@ bool CheckHeader(rFile& pkg_f, PKGHeader* m_header)
|
||||
case PKG_RELEASE_TYPE_DEBUG: break;
|
||||
case PKG_RELEASE_TYPE_RELEASE: break;
|
||||
default:
|
||||
ConLog.Error("PKG: Unknown PKG type!");
|
||||
LOG_ERROR(LOADER, "PKG: Unknown PKG type!");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -26,22 +26,22 @@ bool CheckHeader(rFile& pkg_f, PKGHeader* m_header)
|
||||
case PKG_PLATFORM_TYPE_PS3: break;
|
||||
case PKG_PLATFORM_TYPE_PSP: break;
|
||||
default:
|
||||
ConLog.Error("PKG: Unknown PKG type!");
|
||||
LOG_ERROR(LOADER, "PKG: Unknown PKG type!");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (m_header->header_size != PKG_HEADER_SIZE) {
|
||||
ConLog.Error("PKG: Wrong header size!");
|
||||
LOG_ERROR(LOADER, "PKG: Wrong header size!");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (m_header->pkg_size != pkg_f.Length()) {
|
||||
ConLog.Error("PKG: File size mismatch.");
|
||||
LOG_ERROR(LOADER, "PKG: File size mismatch.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (m_header->data_size + m_header->data_offset + 0x60 != pkg_f.Length()) {
|
||||
ConLog.Error("PKG: Data size mismatch.");
|
||||
LOG_ERROR(LOADER, "PKG: Data size mismatch.");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -53,7 +53,7 @@ bool LoadHeader(rFile& pkg_f, PKGHeader* m_header)
|
||||
pkg_f.Seek(0);
|
||||
|
||||
if (pkg_f.Read(m_header, sizeof(PKGHeader)) != sizeof(PKGHeader)) {
|
||||
ConLog.Error("PKG: Package file is too short!");
|
||||
LOG_ERROR(LOADER, "PKG: Package file is too short!");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -141,7 +141,7 @@ bool LoadEntries(rFile& dec_pkg_f, PKGHeader* m_header, PKGEntry *m_entries)
|
||||
dec_pkg_f.Read(m_entries, sizeof(PKGEntry) * m_header->file_count);
|
||||
|
||||
if (m_entries->name_offset / sizeof(PKGEntry) != m_header->file_count) {
|
||||
ConLog.Error("PKG: Entries are damaged!");
|
||||
LOG_ERROR(LOADER, "PKG: Entries are damaged!");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/FS/vfsLocalFile.h"
|
||||
#include "unself.h"
|
||||
|
||||
@ -17,7 +17,7 @@ bool SELFDecrypter::LoadHeaders(bool isElf32)
|
||||
// Check SCE magic.
|
||||
if (!sce_hdr.CheckMagic())
|
||||
{
|
||||
ConLog.Error("SELF: Not a SELF file!");
|
||||
LOGF_ERROR(LOADER, "SELF: Not a SELF file!");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -41,7 +41,7 @@ bool SELFDecrypter::LoadHeaders(bool isElf32)
|
||||
phdr32_arr.clear();
|
||||
if(elf32_hdr.e_phoff == 0 && elf32_hdr.e_phnum)
|
||||
{
|
||||
ConLog.Error("SELF: ELF program header offset is null!");
|
||||
LOGF_ERROR(LOADER, "SELF: ELF program header offset is null!");
|
||||
return false;
|
||||
}
|
||||
self_f.Seek(self_hdr.se_phdroff);
|
||||
@ -56,7 +56,7 @@ bool SELFDecrypter::LoadHeaders(bool isElf32)
|
||||
phdr64_arr.clear();
|
||||
if(elf64_hdr.e_phoff == 0 && elf64_hdr.e_phnum)
|
||||
{
|
||||
ConLog.Error("SELF: ELF program header offset is null!");
|
||||
LOGF_ERROR(LOADER, "SELF: ELF program header offset is null!");
|
||||
return false;
|
||||
}
|
||||
self_f.Seek(self_hdr.se_phdroff);
|
||||
@ -101,7 +101,7 @@ bool SELFDecrypter::LoadHeaders(bool isElf32)
|
||||
shdr32_arr.clear();
|
||||
if(elf32_hdr.e_shoff == 0 && elf32_hdr.e_shnum)
|
||||
{
|
||||
ConLog.Warning("SELF: ELF section header offset is null!");
|
||||
LOGF_WARNING(LOADER, "SELF: ELF section header offset is null!");
|
||||
return true;
|
||||
}
|
||||
self_f.Seek(self_hdr.se_shdroff);
|
||||
@ -116,7 +116,7 @@ bool SELFDecrypter::LoadHeaders(bool isElf32)
|
||||
shdr64_arr.clear();
|
||||
if(elf64_hdr.e_shoff == 0 && elf64_hdr.e_shnum)
|
||||
{
|
||||
ConLog.Warning("SELF: ELF section header offset is null!");
|
||||
LOGF_WARNING(LOADER, "SELF: ELF section header offset is null!");
|
||||
return true;
|
||||
}
|
||||
self_f.Seek(self_hdr.se_shdroff);
|
||||
@ -132,46 +132,46 @@ bool SELFDecrypter::LoadHeaders(bool isElf32)
|
||||
|
||||
void SELFDecrypter::ShowHeaders(bool isElf32)
|
||||
{
|
||||
ConLog.Write("SCE header");
|
||||
ConLog.Write("----------------------------------------------------");
|
||||
LOGF_NOTICE(LOADER, "SCE header");
|
||||
LOGF_NOTICE(LOADER, "----------------------------------------------------");
|
||||
sce_hdr.Show();
|
||||
ConLog.Write("----------------------------------------------------");
|
||||
ConLog.Write("SELF header");
|
||||
ConLog.Write("----------------------------------------------------");
|
||||
LOGF_NOTICE(LOADER, "----------------------------------------------------");
|
||||
LOGF_NOTICE(LOADER, "SELF header");
|
||||
LOGF_NOTICE(LOADER, "----------------------------------------------------");
|
||||
self_hdr.Show();
|
||||
ConLog.Write("----------------------------------------------------");
|
||||
ConLog.Write("APP INFO");
|
||||
ConLog.Write("----------------------------------------------------");
|
||||
LOGF_NOTICE(LOADER, "----------------------------------------------------");
|
||||
LOGF_NOTICE(LOADER, "APP INFO");
|
||||
LOGF_NOTICE(LOADER, "----------------------------------------------------");
|
||||
app_info.Show();
|
||||
ConLog.Write("----------------------------------------------------");
|
||||
ConLog.Write("ELF header");
|
||||
ConLog.Write("----------------------------------------------------");
|
||||
LOGF_NOTICE(LOADER, "----------------------------------------------------");
|
||||
LOGF_NOTICE(LOADER, "ELF header");
|
||||
LOGF_NOTICE(LOADER, "----------------------------------------------------");
|
||||
isElf32 ? elf32_hdr.Show() : elf64_hdr.Show();
|
||||
ConLog.Write("----------------------------------------------------");
|
||||
ConLog.Write("ELF program headers");
|
||||
ConLog.Write("----------------------------------------------------");
|
||||
LOGF_NOTICE(LOADER, "----------------------------------------------------");
|
||||
LOGF_NOTICE(LOADER, "ELF program headers");
|
||||
LOGF_NOTICE(LOADER, "----------------------------------------------------");
|
||||
for(unsigned int i = 0; i < ((isElf32) ? phdr32_arr.size() : phdr64_arr.size()); i++)
|
||||
isElf32 ? phdr32_arr[i].Show() : phdr64_arr[i].Show();
|
||||
ConLog.Write("----------------------------------------------------");
|
||||
ConLog.Write("Section info");
|
||||
ConLog.Write("----------------------------------------------------");
|
||||
LOGF_NOTICE(LOADER, "----------------------------------------------------");
|
||||
LOGF_NOTICE(LOADER, "Section info");
|
||||
LOGF_NOTICE(LOADER, "----------------------------------------------------");
|
||||
for(unsigned int i = 0; i < secinfo_arr.size(); i++)
|
||||
secinfo_arr[i].Show();
|
||||
ConLog.Write("----------------------------------------------------");
|
||||
ConLog.Write("SCE version info");
|
||||
ConLog.Write("----------------------------------------------------");
|
||||
LOGF_NOTICE(LOADER, "----------------------------------------------------");
|
||||
LOGF_NOTICE(LOADER, "SCE version info");
|
||||
LOGF_NOTICE(LOADER, "----------------------------------------------------");
|
||||
scev_info.Show();
|
||||
ConLog.Write("----------------------------------------------------");
|
||||
ConLog.Write("Control info");
|
||||
ConLog.Write("----------------------------------------------------");
|
||||
LOGF_NOTICE(LOADER, "----------------------------------------------------");
|
||||
LOGF_NOTICE(LOADER, "Control info");
|
||||
LOGF_NOTICE(LOADER, "----------------------------------------------------");
|
||||
for(unsigned int i = 0; i < ctrlinfo_arr.size(); i++)
|
||||
ctrlinfo_arr[i].Show();
|
||||
ConLog.Write("----------------------------------------------------");
|
||||
ConLog.Write("ELF section headers");
|
||||
ConLog.Write("----------------------------------------------------");
|
||||
LOGF_NOTICE(LOADER, "----------------------------------------------------");
|
||||
LOGF_NOTICE(LOADER, "ELF section headers");
|
||||
LOGF_NOTICE(LOADER, "----------------------------------------------------");
|
||||
for(unsigned int i = 0; i < ((isElf32) ? shdr32_arr.size() : shdr64_arr.size()); i++)
|
||||
isElf32 ? shdr32_arr[i].Show() : shdr64_arr[i].Show();
|
||||
ConLog.Write("----------------------------------------------------");
|
||||
LOGF_NOTICE(LOADER, "----------------------------------------------------");
|
||||
}
|
||||
|
||||
bool SELFDecrypter::DecryptNPDRM(u8 *metadata, u32 metadata_size)
|
||||
@ -195,7 +195,7 @@ bool SELFDecrypter::DecryptNPDRM(u8 *metadata, u32 metadata_size)
|
||||
// If not, the data has no NPDRM layer.
|
||||
if (!ctrl)
|
||||
{
|
||||
ConLog.Warning("SELF: No NPDRM control info found!");
|
||||
LOGF_WARNING(LOADER, "SELF: No NPDRM control info found!");
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -208,7 +208,7 @@ bool SELFDecrypter::DecryptNPDRM(u8 *metadata, u32 metadata_size)
|
||||
|
||||
if (ctrl->npdrm.license == 1) // Network license.
|
||||
{
|
||||
ConLog.Error("SELF: Can't decrypt network NPDRM!");
|
||||
LOGF_ERROR(LOADER, "SELF: Can't decrypt network NPDRM!");
|
||||
return false;
|
||||
}
|
||||
else if (ctrl->npdrm.license == 2) // Local license.
|
||||
@ -216,7 +216,7 @@ bool SELFDecrypter::DecryptNPDRM(u8 *metadata, u32 metadata_size)
|
||||
// Try to find a RAP file to get the key.
|
||||
if (!GetKeyFromRap(ctrl->npdrm.content_id, npdrm_key))
|
||||
{
|
||||
ConLog.Error("SELF: Can't find RAP file for NPDRM decryption!");
|
||||
LOGF_ERROR(LOADER, "SELF: Can't find RAP file for NPDRM decryption!");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -227,7 +227,7 @@ bool SELFDecrypter::DecryptNPDRM(u8 *metadata, u32 metadata_size)
|
||||
}
|
||||
else
|
||||
{
|
||||
ConLog.Error("SELF: Invalid NPDRM license type!");
|
||||
LOGF_ERROR(LOADER, "SELF: Invalid NPDRM license type!");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -290,7 +290,7 @@ bool SELFDecrypter::LoadMetadata()
|
||||
if ((meta_info.key_pad[0] != 0x00) ||
|
||||
(meta_info.iv_pad[0] != 0x00))
|
||||
{
|
||||
ConLog.Error("SELF: Failed to decrypt metadata info!");
|
||||
LOGF_ERROR(LOADER, "SELF: Failed to decrypt metadata info!");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -392,7 +392,7 @@ bool SELFDecrypter::MakeElf(const std::string& elf, bool isElf32)
|
||||
rFile e(elf.c_str(), rFile::write);
|
||||
if(!e.IsOpened())
|
||||
{
|
||||
ConLog.Error("Could not create ELF file! (%s)", elf.c_str());
|
||||
LOGF_ERROR(LOADER, "Could not create ELF file! (%s)", elf.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -510,7 +510,7 @@ bool SELFDecrypter::GetKeyFromRap(u8 *content_id, u8 *npdrm_key)
|
||||
// Check if we have a valid RAP file.
|
||||
if (!rFile::Exists(rap_path))
|
||||
{
|
||||
ConLog.Error("This application requires a valid RAP file for decryption!");
|
||||
LOGF_ERROR(LOADER, "This application requires a valid RAP file for decryption!");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -519,11 +519,11 @@ bool SELFDecrypter::GetKeyFromRap(u8 *content_id, u8 *npdrm_key)
|
||||
|
||||
if (!rap_file.IsOpened())
|
||||
{
|
||||
ConLog.Error("Failed to load RAP file!");
|
||||
LOGF_ERROR(LOADER, "Failed to load RAP file!");
|
||||
return false;
|
||||
}
|
||||
|
||||
ConLog.Write("Loading RAP file %s", (ci_str + ".rap").c_str());
|
||||
LOGF_NOTICE(LOADER, "Loading RAP file %s", (ci_str + ".rap").c_str());
|
||||
rap_file.Read(rap_key, 0x10);
|
||||
rap_file.Close();
|
||||
|
||||
@ -573,7 +573,7 @@ bool CheckDebugSelf(const std::string& self, const std::string& elf)
|
||||
|
||||
if(!s.IsOpened())
|
||||
{
|
||||
ConLog.Error("Could not open SELF file! (%s)", self.c_str());
|
||||
LOGF_ERROR(LOADER, "Could not open SELF file! (%s)", self.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -585,7 +585,7 @@ bool CheckDebugSelf(const std::string& self, const std::string& elf)
|
||||
// Check for DEBUG version.
|
||||
if(swap16(key_version) == 0x8000)
|
||||
{
|
||||
ConLog.Warning("Debug SELF detected! Removing fake header...");
|
||||
LOGF_WARNING(LOADER, "Debug SELF detected! Removing fake header...");
|
||||
|
||||
// Get the real elf offset.
|
||||
s.Seek(0x10);
|
||||
@ -600,7 +600,7 @@ bool CheckDebugSelf(const std::string& self, const std::string& elf)
|
||||
rFile e(elf, rFile::write);
|
||||
if(!e.IsOpened())
|
||||
{
|
||||
ConLog.Error("Could not create ELF file! (%s)", elf.c_str());
|
||||
LOGF_ERROR(LOADER, "Could not create ELF file! (%s)", elf.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -640,28 +640,28 @@ bool DecryptSelf(const std::string& elf, const std::string& self)
|
||||
// Load the SELF file headers.
|
||||
if (!self_dec.LoadHeaders(isElf32))
|
||||
{
|
||||
ConLog.Error("SELF: Failed to load SELF file headers!");
|
||||
LOGF_ERROR(LOADER, "SELF: Failed to load SELF file headers!");
|
||||
return false;
|
||||
}
|
||||
|
||||
// Load and decrypt the SELF file metadata.
|
||||
if (!self_dec.LoadMetadata())
|
||||
{
|
||||
ConLog.Error("SELF: Failed to load SELF file metadata!");
|
||||
LOGF_ERROR(LOADER, "SELF: Failed to load SELF file metadata!");
|
||||
return false;
|
||||
}
|
||||
|
||||
// Decrypt the SELF file data.
|
||||
if (!self_dec.DecryptData())
|
||||
{
|
||||
ConLog.Error("SELF: Failed to decrypt SELF file data!");
|
||||
LOGF_ERROR(LOADER, "SELF: Failed to decrypt SELF file data!");
|
||||
return false;
|
||||
}
|
||||
|
||||
// Make a new ELF file from this SELF.
|
||||
if (!self_dec.MakeElf(elf, isElf32))
|
||||
{
|
||||
ConLog.Error("SELF: Failed to make ELF file from SELF!");
|
||||
LOGF_ERROR(LOADER, "SELF: Failed to make ELF file from SELF!");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -25,10 +25,10 @@ struct AppInfo
|
||||
|
||||
void Show()
|
||||
{
|
||||
ConLog.Write("AuthID: 0x%llx", authid);
|
||||
ConLog.Write("VendorID: 0x%08x", vendor_id);
|
||||
ConLog.Write("SELF type: 0x%08x", self_type);
|
||||
ConLog.Write("Version: 0x%llx", version);
|
||||
LOGF_NOTICE(LOADER, "AuthID: 0x%llx", authid);
|
||||
LOGF_NOTICE(LOADER, "VendorID: 0x%08x", vendor_id);
|
||||
LOGF_NOTICE(LOADER, "SELF type: 0x%08x", self_type);
|
||||
LOGF_NOTICE(LOADER, "Version: 0x%llx", version);
|
||||
}
|
||||
};
|
||||
|
||||
@ -53,12 +53,12 @@ struct SectionInfo
|
||||
|
||||
void Show()
|
||||
{
|
||||
ConLog.Write("Offset: 0x%llx", offset);
|
||||
ConLog.Write("Size: 0x%llx", size);
|
||||
ConLog.Write("Compressed: 0x%08x", compressed);
|
||||
ConLog.Write("Unknown1: 0x%08x", unknown1);
|
||||
ConLog.Write("Unknown2: 0x%08x", unknown2);
|
||||
ConLog.Write("Encrypted: 0x%08x", encrypted);
|
||||
LOGF_NOTICE(LOADER, "Offset: 0x%llx", offset);
|
||||
LOGF_NOTICE(LOADER, "Size: 0x%llx", size);
|
||||
LOGF_NOTICE(LOADER, "Compressed: 0x%08x", compressed);
|
||||
LOGF_NOTICE(LOADER, "Unknown1: 0x%08x", unknown1);
|
||||
LOGF_NOTICE(LOADER, "Unknown2: 0x%08x", unknown2);
|
||||
LOGF_NOTICE(LOADER, "Encrypted: 0x%08x", encrypted);
|
||||
}
|
||||
};
|
||||
|
||||
@ -79,10 +79,10 @@ struct SCEVersionInfo
|
||||
|
||||
void Show()
|
||||
{
|
||||
ConLog.Write("Sub-header type: 0x%08x", subheader_type);
|
||||
ConLog.Write("Present: 0x%08x", present);
|
||||
ConLog.Write("Size: 0x%08x", size);
|
||||
ConLog.Write("Unknown: 0x%08x", unknown);
|
||||
LOGF_NOTICE(LOADER, "Sub-header type: 0x%08x", subheader_type);
|
||||
LOGF_NOTICE(LOADER, "Present: 0x%08x", present);
|
||||
LOGF_NOTICE(LOADER, "Size: 0x%08x", size);
|
||||
LOGF_NOTICE(LOADER, "Unknown: 0x%08x", unknown);
|
||||
}
|
||||
};
|
||||
|
||||
@ -181,20 +181,20 @@ struct ControlInfo
|
||||
|
||||
void Show()
|
||||
{
|
||||
ConLog.Write("Type: 0x%08x", type);
|
||||
ConLog.Write("Size: 0x%08x", size);
|
||||
ConLog.Write("Next: 0x%llx", next);
|
||||
LOGF_NOTICE(LOADER, "Type: 0x%08x", type);
|
||||
LOGF_NOTICE(LOADER, "Size: 0x%08x", size);
|
||||
LOGF_NOTICE(LOADER, "Next: 0x%llx", next);
|
||||
|
||||
if (type == 1)
|
||||
{
|
||||
ConLog.Write("Control flag 1: 0x%08x", control_flags.ctrl_flag1);
|
||||
ConLog.Write("Unknown1: 0x%08x", control_flags.unknown1);
|
||||
ConLog.Write("Unknown2: 0x%08x", control_flags.unknown2);
|
||||
ConLog.Write("Unknown3: 0x%08x", control_flags.unknown3);
|
||||
ConLog.Write("Unknown4: 0x%08x", control_flags.unknown4);
|
||||
ConLog.Write("Unknown5: 0x%08x", control_flags.unknown5);
|
||||
ConLog.Write("Unknown6: 0x%08x", control_flags.unknown6);
|
||||
ConLog.Write("Unknown7: 0x%08x", control_flags.unknown7);
|
||||
LOGF_NOTICE(LOADER, "Control flag 1: 0x%08x", control_flags.ctrl_flag1);
|
||||
LOGF_NOTICE(LOADER, "Unknown1: 0x%08x", control_flags.unknown1);
|
||||
LOGF_NOTICE(LOADER, "Unknown2: 0x%08x", control_flags.unknown2);
|
||||
LOGF_NOTICE(LOADER, "Unknown3: 0x%08x", control_flags.unknown3);
|
||||
LOGF_NOTICE(LOADER, "Unknown4: 0x%08x", control_flags.unknown4);
|
||||
LOGF_NOTICE(LOADER, "Unknown5: 0x%08x", control_flags.unknown5);
|
||||
LOGF_NOTICE(LOADER, "Unknown6: 0x%08x", control_flags.unknown6);
|
||||
LOGF_NOTICE(LOADER, "Unknown7: 0x%08x", control_flags.unknown7);
|
||||
}
|
||||
else if (type == 2)
|
||||
{
|
||||
@ -204,8 +204,8 @@ struct ControlInfo
|
||||
for (int i = 0; i < 20; i++)
|
||||
digest_str += fmt::Format("%02x", file_digest_30.digest[i]);
|
||||
|
||||
ConLog.Write("Digest: %s", digest_str.c_str());
|
||||
ConLog.Write("Unknown: 0x%llx", file_digest_30.unknown);
|
||||
LOGF_NOTICE(LOADER, "Digest: %s", digest_str.c_str());
|
||||
LOGF_NOTICE(LOADER, "Unknown: 0x%llx", file_digest_30.unknown);
|
||||
}
|
||||
else if (size == 0x40)
|
||||
{
|
||||
@ -217,9 +217,9 @@ struct ControlInfo
|
||||
digest_str2 += fmt::Format("%02x", file_digest_40.digest2[i]);
|
||||
}
|
||||
|
||||
ConLog.Write("Digest1: %s", digest_str1.c_str());
|
||||
ConLog.Write("Digest2: %s", digest_str2.c_str());
|
||||
ConLog.Write("Unknown: 0x%llx", file_digest_40.unknown);
|
||||
LOGF_NOTICE(LOADER, "Digest1: %s", digest_str1.c_str());
|
||||
LOGF_NOTICE(LOADER, "Digest2: %s", digest_str2.c_str());
|
||||
LOGF_NOTICE(LOADER, "Unknown: 0x%llx", file_digest_40.unknown);
|
||||
}
|
||||
}
|
||||
else if (type == 3)
|
||||
@ -237,16 +237,16 @@ struct ControlInfo
|
||||
xordigest_str += fmt::Format("%02x", npdrm.xordigest[i]);
|
||||
}
|
||||
|
||||
ConLog.Write("Magic: 0x%08x", npdrm.magic);
|
||||
ConLog.Write("Unknown1: 0x%08x", npdrm.unknown1);
|
||||
ConLog.Write("License: 0x%08x", npdrm.license);
|
||||
ConLog.Write("Type: 0x%08x", npdrm.type);
|
||||
ConLog.Write("ContentID: %s", contentid_str.c_str());
|
||||
ConLog.Write("Digest: %s", digest_str.c_str());
|
||||
ConLog.Write("Inverse digest: %s", invdigest_str.c_str());
|
||||
ConLog.Write("XOR digest: %s", xordigest_str.c_str());
|
||||
ConLog.Write("Unknown2: 0x%llx", npdrm.unknown2);
|
||||
ConLog.Write("Unknown3: 0x%llx", npdrm.unknown3);
|
||||
LOGF_NOTICE(LOADER, "Magic: 0x%08x", npdrm.magic);
|
||||
LOGF_NOTICE(LOADER, "Unknown1: 0x%08x", npdrm.unknown1);
|
||||
LOGF_NOTICE(LOADER, "License: 0x%08x", npdrm.license);
|
||||
LOGF_NOTICE(LOADER, "Type: 0x%08x", npdrm.type);
|
||||
LOGF_NOTICE(LOADER, "ContentID: %s", contentid_str.c_str());
|
||||
LOGF_NOTICE(LOADER, "Digest: %s", digest_str.c_str());
|
||||
LOGF_NOTICE(LOADER, "Inverse digest: %s", invdigest_str.c_str());
|
||||
LOGF_NOTICE(LOADER, "XOR digest: %s", xordigest_str.c_str());
|
||||
LOGF_NOTICE(LOADER, "Unknown2: 0x%llx", npdrm.unknown2);
|
||||
LOGF_NOTICE(LOADER, "Unknown3: 0x%llx", npdrm.unknown3);
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -281,10 +281,10 @@ struct MetadataInfo
|
||||
iv_pad_str += fmt::Format("%02x", iv_pad[i]);
|
||||
}
|
||||
|
||||
ConLog.Write("Key: %s", key_str.c_str());
|
||||
ConLog.Write("Key pad: %s", key_pad_str.c_str());
|
||||
ConLog.Write("IV: %s", iv_str.c_str());
|
||||
ConLog.Write("IV pad: %s", iv_pad_str.c_str());
|
||||
LOGF_NOTICE(LOADER, "Key: %s", key_str.c_str());
|
||||
LOGF_NOTICE(LOADER, "Key pad: %s", key_pad_str.c_str());
|
||||
LOGF_NOTICE(LOADER, "IV: %s", iv_str.c_str());
|
||||
LOGF_NOTICE(LOADER, "IV pad: %s", iv_pad_str.c_str());
|
||||
}
|
||||
};
|
||||
|
||||
@ -320,13 +320,13 @@ struct MetadataHeader
|
||||
|
||||
void Show()
|
||||
{
|
||||
ConLog.Write("Signature input length: 0x%llx", signature_input_length);
|
||||
ConLog.Write("Unknown1: 0x%08x", unknown1);
|
||||
ConLog.Write("Section count: 0x%08x", section_count);
|
||||
ConLog.Write("Key count: 0x%08x", key_count);
|
||||
ConLog.Write("Optional header size: 0x%08x", opt_header_size);
|
||||
ConLog.Write("Unknown2: 0x%08x", unknown2);
|
||||
ConLog.Write("Unknown3: 0x%08x", unknown3);
|
||||
LOGF_NOTICE(LOADER, "Signature input length: 0x%llx", signature_input_length);
|
||||
LOGF_NOTICE(LOADER, "Unknown1: 0x%08x", unknown1);
|
||||
LOGF_NOTICE(LOADER, "Section count: 0x%08x", section_count);
|
||||
LOGF_NOTICE(LOADER, "Key count: 0x%08x", key_count);
|
||||
LOGF_NOTICE(LOADER, "Optional header size: 0x%08x", opt_header_size);
|
||||
LOGF_NOTICE(LOADER, "Unknown2: 0x%08x", unknown2);
|
||||
LOGF_NOTICE(LOADER, "Unknown3: 0x%08x", unknown3);
|
||||
}
|
||||
};
|
||||
|
||||
@ -371,16 +371,16 @@ struct MetadataSectionHeader
|
||||
|
||||
void Show()
|
||||
{
|
||||
ConLog.Write("Data offset: 0x%llx", data_offset);
|
||||
ConLog.Write("Data size: 0x%llx", data_size);
|
||||
ConLog.Write("Type: 0x%08x", type);
|
||||
ConLog.Write("Program index: 0x%08x", program_idx);
|
||||
ConLog.Write("Hashed: 0x%08x", hashed);
|
||||
ConLog.Write("SHA1 index: 0x%08x", sha1_idx);
|
||||
ConLog.Write("Encrypted: 0x%08x", encrypted);
|
||||
ConLog.Write("Key index: 0x%08x", key_idx);
|
||||
ConLog.Write("IV index: 0x%08x", iv_idx);
|
||||
ConLog.Write("Compressed: 0x%08x", compressed);
|
||||
LOGF_NOTICE(LOADER, "Data offset: 0x%llx", data_offset);
|
||||
LOGF_NOTICE(LOADER, "Data size: 0x%llx", data_size);
|
||||
LOGF_NOTICE(LOADER, "Type: 0x%08x", type);
|
||||
LOGF_NOTICE(LOADER, "Program index: 0x%08x", program_idx);
|
||||
LOGF_NOTICE(LOADER, "Hashed: 0x%08x", hashed);
|
||||
LOGF_NOTICE(LOADER, "SHA1 index: 0x%08x", sha1_idx);
|
||||
LOGF_NOTICE(LOADER, "Encrypted: 0x%08x", encrypted);
|
||||
LOGF_NOTICE(LOADER, "Key index: 0x%08x", key_idx);
|
||||
LOGF_NOTICE(LOADER, "IV index: 0x%08x", iv_idx);
|
||||
LOGF_NOTICE(LOADER, "Compressed: 0x%08x", compressed);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -260,7 +260,7 @@ public:
|
||||
protected:
|
||||
void NULL_OP()
|
||||
{
|
||||
ConLog.Error("null");
|
||||
LOG_ERROR(HLE, "null");
|
||||
Emu.Pause();
|
||||
}
|
||||
|
||||
@ -316,7 +316,7 @@ protected:
|
||||
|
||||
void UNK(const u16 code0, const u16 code1)
|
||||
{
|
||||
ConLog.Error("Unknown/Illegal opcode! (0x%04x : 0x%04x)", code0, code1);
|
||||
LOGF_ERROR(HLE, "Unknown/Illegal opcode! (0x%04x : 0x%04x)", code0, code1);
|
||||
Emu.Pause();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/Cell/PPCThread.h"
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "rpcs3/Ini.h"
|
||||
@ -18,7 +18,7 @@ void printAlError(ALenum err, const char* situation)
|
||||
{
|
||||
if(err != AL_NO_ERROR)
|
||||
{
|
||||
ConLog.Error("%s: OpenAL error 0x%04x", situation, err);
|
||||
LOGF_ERROR(HLE, "%s: OpenAL error 0x%04x", situation, err);
|
||||
Emu.Pause();
|
||||
}
|
||||
}
|
||||
@ -27,7 +27,7 @@ void printAlcError(ALCenum err, const char* situation)
|
||||
{
|
||||
if(err != ALC_NO_ERROR)
|
||||
{
|
||||
ConLog.Error("%s: OpenALC error 0x%04x", situation, err);
|
||||
LOGF_ERROR(HLE, "%s: OpenALC error 0x%04x", situation, err);
|
||||
Emu.Pause();
|
||||
}
|
||||
}
|
||||
@ -137,7 +137,7 @@ void OpenALThread::AddData(const void* src, ALsizei size)
|
||||
|
||||
int bsize = size < m_buffer_size ? size : m_buffer_size;
|
||||
if (!AddBlock(buffer, bsize, bsrc))
|
||||
ConLog.Error("OpenALThread::AddBlock: invalid block size: %d", bsize);
|
||||
LOGF_ERROR(HLE, "OpenALThread::AddBlock: invalid block size: %d", bsize);
|
||||
|
||||
alSourceQueueBuffers(m_source, 1, &buffer);
|
||||
checkForAlError("alSourceQueueBuffers");
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/SysCalls/ErrorCodes.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "rpcs3/Ini.h"
|
||||
@ -149,7 +149,7 @@ void CPUThread::SetBranch(const u64 pc, bool record_branch)
|
||||
{
|
||||
if(!Memory.IsGoodAddr(m_offset + pc))
|
||||
{
|
||||
ConLog.Error("%s branch error: bad address 0x%llx #pc: 0x%llx", GetFName().c_str(), m_offset + pc, m_offset + PC);
|
||||
LOGF_ERROR(PPU, "%s branch error: bad address 0x%llx #pc: 0x%llx", GetFName().c_str(), m_offset + pc, m_offset + PC);
|
||||
Emu.Pause();
|
||||
}
|
||||
|
||||
@ -282,7 +282,7 @@ void CPUThread::ExecOnce()
|
||||
|
||||
void CPUThread::Task()
|
||||
{
|
||||
if (Ini.HLELogging.GetValue()) ConLog.Write("%s enter", CPUThread::GetFName().c_str());
|
||||
if (Ini.HLELogging.GetValue()) LOGF_NOTICE(PPU, "%s enter", CPUThread::GetFName().c_str());
|
||||
|
||||
const std::vector<u64>& bp = Emu.GetBreakPoints();
|
||||
|
||||
@ -333,18 +333,18 @@ void CPUThread::Task()
|
||||
}
|
||||
catch(const std::string& e)
|
||||
{
|
||||
ConLog.Error("Exception: %s", e.c_str());
|
||||
LOGF_ERROR(PPU, "Exception: %s", e.c_str());
|
||||
}
|
||||
catch(const char* e)
|
||||
{
|
||||
ConLog.Error("Exception: %s", e);
|
||||
LOGF_ERROR(PPU, "Exception: %s", e);
|
||||
}
|
||||
catch(int exitcode)
|
||||
{
|
||||
ConLog.Success("Exit Code: %d", exitcode);
|
||||
LOGF_SUCCESS(PPU, "Exit Code: %d", exitcode);
|
||||
}
|
||||
|
||||
if (Ini.HLELogging.GetValue()) ConLog.Write("%s leave", CPUThread::GetFName().c_str());
|
||||
if (Ini.HLELogging.GetValue()) LOGF_NOTICE(PPU, "%s leave", CPUThread::GetFName().c_str());
|
||||
}
|
||||
|
||||
s64 CPUThread::ExecAsCallback(u64 pc, bool wait, u64 a1, u64 a2, u64 a3, u64 a4) // not multithread-safe
|
||||
@ -353,7 +353,7 @@ s64 CPUThread::ExecAsCallback(u64 pc, bool wait, u64 a1, u64 a2, u64 a3, u64 a4)
|
||||
{
|
||||
if (Emu.IsStopped())
|
||||
{
|
||||
ConLog.Warning("ExecAsCallback() aborted");
|
||||
LOGF_WARNING(PPU, "ExecAsCallback() aborted");
|
||||
return CELL_ECANCELED; // doesn't mean anything
|
||||
}
|
||||
Sleep(1);
|
||||
@ -379,11 +379,11 @@ s64 CPUThread::ExecAsCallback(u64 pc, bool wait, u64 a1, u64 a2, u64 a3, u64 a4)
|
||||
{
|
||||
if (Emu.IsStopped())
|
||||
{
|
||||
ConLog.Warning("ExecAsCallback(wait=%s) aborted", wait ? "true" : "false");
|
||||
LOGF_WARNING(PPU, "ExecAsCallback(wait=%s) aborted", wait ? "true" : "false");
|
||||
return CELL_EABORT; // doesn't mean anything
|
||||
}
|
||||
Sleep(1);
|
||||
}
|
||||
|
||||
return wait * m_exit_status;
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
|
||||
|
@ -183,7 +183,7 @@ struct DMAC
|
||||
return true;
|
||||
|
||||
default:
|
||||
ConLog.Error("DMAC::ProcessCmd(): Unknown DMA cmd.");
|
||||
LOGF_ERROR(HLE, "DMAC::ProcessCmd(): Unknown DMA cmd.");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -268,19 +268,19 @@ struct DMAC
|
||||
u16 tag = (u16)size_tag;
|
||||
u16 size = size_tag >> 16;
|
||||
|
||||
ConLog.Warning("RawSPU DMA %s:", op == MFC_PUT_CMD ? "PUT" : "GET");
|
||||
ConLog.Warning("*** lsa = 0x%x", lsa);
|
||||
ConLog.Warning("*** ea = 0x%llx", ea);
|
||||
ConLog.Warning("*** tag = 0x%x", tag);
|
||||
ConLog.Warning("*** size = 0x%x", size);
|
||||
ConLog.SkipLn();
|
||||
LOGF_WARNING(HLE, "RawSPU DMA %s:", op == MFC_PUT_CMD ? "PUT" : "GET");
|
||||
LOGF_WARNING(HLE, "*** lsa = 0x%x", lsa);
|
||||
LOGF_WARNING(HLE, "*** ea = 0x%llx", ea);
|
||||
LOGF_WARNING(HLE, "*** tag = 0x%x", tag);
|
||||
LOGF_WARNING(HLE, "*** size = 0x%x", size);
|
||||
LOG_WARNING(HLE, " ");
|
||||
|
||||
MFC_CMDStatus.SetValue(dmac.Cmd(cmd, tag, lsa, ea, size));
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
ConLog.Error("Unknown MFC cmd. (opcode=0x%x, cmd=0x%x)", op, cmd);
|
||||
LOGF_ERROR(HLE, "Unknown MFC cmd. (opcode=0x%x, cmd=0x%x)", op, cmd);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "PPCDecoder.h"
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "PPCThread.h"
|
||||
|
@ -70,16 +70,16 @@ private:
|
||||
|
||||
if(Ini.HLELogging.GetValue())
|
||||
{
|
||||
ConLog.Warning("SysCall[0x%llx ('%s')] done with code [0x%llx]! #pc: 0x%llx", CPU.GPR[11], SysCalls::GetHLEFuncName(CPU.GPR[11]).c_str(), CPU.GPR[3], CPU.PC);
|
||||
LOGF_WARNING(PPU, "SysCall[0x%llx ('%s')] done with code [0x%llx]! #pc: 0x%llx", CPU.GPR[11], SysCalls::GetHLEFuncName(CPU.GPR[11]).c_str(), CPU.GPR[3], CPU.PC);
|
||||
}
|
||||
/*else if ((s64)CPU.GPR[3] < 0) // probably, error code
|
||||
{
|
||||
ConLog.Error("SysCall[0x%llx] done with code [0x%llx]! #pc: 0x%llx", CPU.GPR[11], CPU.GPR[3], CPU.PC);
|
||||
LOGF_ERROR(PPU, "SysCall[0x%llx] done with code [0x%llx]! #pc: 0x%llx", CPU.GPR[11], CPU.GPR[3], CPU.PC);
|
||||
if(CPU.GPR[11] > 1024)
|
||||
SysCalls::DoFunc(CPU.GPR[11]);
|
||||
}*/
|
||||
#ifdef HLE_CALL_DEBUG
|
||||
ConLog.Write("SysCall[%lld] done with code [0x%llx]! #pc: 0x%llx", CPU.GPR[11], CPU.GPR[3], CPU.PC);
|
||||
LOGF_NOTICE(PPU, "SysCall[%lld] done with code [0x%llx]! #pc: 0x%llx", CPU.GPR[11], CPU.GPR[3], CPU.PC);
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -2097,7 +2097,7 @@ private:
|
||||
Emu.GetSFuncManager().StaticExecute(CPU.GPR[11]);
|
||||
if (Ini.HLELogging.GetValue())
|
||||
{
|
||||
ConLog.Write("'%s' done with code[0x%llx]! #pc: 0x%llx",
|
||||
LOGF_NOTICE(PPU, "'%s' done with code[0x%llx]! #pc: 0x%llx",
|
||||
Emu.GetSFuncManager()[CPU.GPR[11]]->name, CPU.GPR[3], CPU.PC);
|
||||
}
|
||||
break;
|
||||
@ -2687,7 +2687,7 @@ private:
|
||||
const u64 RA = CPU.GPR[ra];
|
||||
CPU.GPR[rd] = RA + CPU.XER.CA;
|
||||
CPU.XER.CA = CPU.IsCarry(RA, CPU.XER.CA);
|
||||
if(oe) ConLog.Warning("addzeo");
|
||||
if(oe) LOG_WARNING(PPU, "addzeo");
|
||||
if(rc) CPU.UpdateCR0<s64>(CPU.GPR[rd]);
|
||||
}
|
||||
void SUBFZE(u32 rd, u32 ra, u32 oe, bool rc)
|
||||
@ -2695,7 +2695,7 @@ private:
|
||||
const u64 RA = CPU.GPR[ra];
|
||||
CPU.GPR[rd] = ~RA + CPU.XER.CA;
|
||||
CPU.XER.CA = CPU.IsCarry(~RA, CPU.XER.CA);
|
||||
if (oe) ConLog.Warning("subfzeo");
|
||||
if (oe) LOG_WARNING(PPU, "subfzeo");
|
||||
if (rc) CPU.UpdateCR0<s64>(CPU.GPR[rd]);
|
||||
}
|
||||
void STDCX_(u32 rs, u32 ra, u32 rb)
|
||||
@ -2728,7 +2728,7 @@ private:
|
||||
const u64 RA = CPU.GPR[ra];
|
||||
CPU.GPR[rd] = ~RA + CPU.XER.CA + ~0ULL;
|
||||
CPU.XER.CA = CPU.IsCarry(~RA, CPU.XER.CA, ~0ULL);
|
||||
if (oe) ConLog.Warning("subfmeo");
|
||||
if (oe) LOG_WARNING(PPU, "subfmeo");
|
||||
if (rc) CPU.UpdateCR0<s64>(CPU.GPR[rd]);
|
||||
}
|
||||
void MULLD(u32 rd, u32 ra, u32 rb, u32 oe, bool rc)
|
||||
@ -3509,7 +3509,7 @@ private:
|
||||
void MTFSB1(u32 crbd, bool rc)
|
||||
{
|
||||
u64 mask = (1ULL << crbd);
|
||||
if ((crbd == 29) && !CPU.FPSCR.NI) ConLog.Warning("Non-IEEE mode enabled");
|
||||
if ((crbd == 29) && !CPU.FPSCR.NI) LOG_WARNING(PPU, "Non-IEEE mode enabled");
|
||||
CPU.FPSCR.FPSCR |= mask;
|
||||
|
||||
if(rc) UNIMPLEMENTED();
|
||||
@ -3523,7 +3523,7 @@ private:
|
||||
void MTFSB0(u32 crbd, bool rc)
|
||||
{
|
||||
u64 mask = (1ULL << crbd);
|
||||
if ((crbd == 29) && !CPU.FPSCR.NI) ConLog.Warning("Non-IEEE mode disabled");
|
||||
if ((crbd == 29) && !CPU.FPSCR.NI) LOG_WARNING(PPU, "Non-IEEE mode disabled");
|
||||
CPU.FPSCR.FPSCR &= ~mask;
|
||||
|
||||
if(rc) UNIMPLEMENTED();
|
||||
@ -3534,12 +3534,12 @@ private:
|
||||
|
||||
if(i)
|
||||
{
|
||||
if ((crfd == 29) && !CPU.FPSCR.NI) ConLog.Warning("Non-IEEE mode enabled");
|
||||
if ((crfd == 29) && !CPU.FPSCR.NI) LOG_WARNING(PPU, "Non-IEEE mode enabled");
|
||||
CPU.FPSCR.FPSCR |= mask;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((crfd == 29) && CPU.FPSCR.NI) ConLog.Warning("Non-IEEE mode disabled");
|
||||
if ((crfd == 29) && CPU.FPSCR.NI) LOG_WARNING(PPU, "Non-IEEE mode disabled");
|
||||
CPU.FPSCR.FPSCR &= ~mask;
|
||||
}
|
||||
|
||||
@ -3563,9 +3563,9 @@ private:
|
||||
if (CPU.FPSCR.NI != oldNI)
|
||||
{
|
||||
if (oldNI)
|
||||
ConLog.Warning("Non-IEEE mode disabled");
|
||||
LOG_WARNING(PPU, "Non-IEEE mode disabled");
|
||||
else
|
||||
ConLog.Warning("Non-IEEE mode enabled");
|
||||
LOG_WARNING(PPU, "Non-IEEE mode enabled");
|
||||
}
|
||||
if(rc) UNK("mtfsf.");
|
||||
}
|
||||
@ -3995,20 +3995,20 @@ private:
|
||||
|
||||
void UNK(const std::string& err, bool pause = true)
|
||||
{
|
||||
ConLog.Error(err + fmt::Format(" #pc: 0x%llx", CPU.PC));
|
||||
LOGF_ERROR(PPU, err + fmt::Format(" #pc: 0x%llx", CPU.PC));
|
||||
|
||||
if(!pause) return;
|
||||
|
||||
Emu.Pause();
|
||||
|
||||
for(uint i=0; i<32; ++i) ConLog.Write("r%d = 0x%llx", i, CPU.GPR[i]);
|
||||
for(uint i=0; i<32; ++i) ConLog.Write("f%d = %llf", i, CPU.FPR[i]);
|
||||
for(uint i=0; i<32; ++i) ConLog.Write("v%d = 0x%s [%s]", i, CPU.VPR[i].ToString(true).c_str(), CPU.VPR[i].ToString().c_str());
|
||||
ConLog.Write("CR = 0x%08x", CPU.CR);
|
||||
ConLog.Write("LR = 0x%llx", CPU.LR);
|
||||
ConLog.Write("CTR = 0x%llx", CPU.CTR);
|
||||
ConLog.Write("XER = 0x%llx [CA=%lld | OV=%lld | SO=%lld]", CPU.XER, fmt::by_value(CPU.XER.CA), fmt::by_value(CPU.XER.OV), fmt::by_value(CPU.XER.SO));
|
||||
ConLog.Write("FPSCR = 0x%x "
|
||||
for(uint i=0; i<32; ++i) LOGF_NOTICE(PPU, "r%d = 0x%llx", i, CPU.GPR[i]);
|
||||
for(uint i=0; i<32; ++i) LOGF_NOTICE(PPU, "f%d = %llf", i, CPU.FPR[i]);
|
||||
for(uint i=0; i<32; ++i) LOGF_NOTICE(PPU, "v%d = 0x%s [%s]", i, CPU.VPR[i].ToString(true).c_str(), CPU.VPR[i].ToString().c_str());
|
||||
LOGF_NOTICE(PPU, "CR = 0x%08x", CPU.CR);
|
||||
LOGF_NOTICE(PPU, "LR = 0x%llx", CPU.LR);
|
||||
LOGF_NOTICE(PPU, "CTR = 0x%llx", CPU.CTR);
|
||||
LOGF_NOTICE(PPU, "XER = 0x%llx [CA=%lld | OV=%lld | SO=%lld]", CPU.XER, fmt::by_value(CPU.XER.CA), fmt::by_value(CPU.XER.OV), fmt::by_value(CPU.XER.SO));
|
||||
LOGF_NOTICE(PPU, "FPSCR = 0x%x "
|
||||
"[RN=%d | NI=%d | XE=%d | ZE=%d | UE=%d | OE=%d | VE=%d | "
|
||||
"VXCVI=%d | VXSQRT=%d | VXSOFT=%d | FPRF=%d | "
|
||||
"FI=%d | FR=%d | VXVC=%d | VXIMZ=%d | "
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
|
||||
#include "PPUProgramCompiler.h"
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/Cell/PPUThread.h"
|
||||
@ -76,7 +76,7 @@ void PPUThread::InitRegs()
|
||||
|
||||
if(thread_num < 0)
|
||||
{
|
||||
ConLog.Error("GetThreadNumById failed.");
|
||||
LOG_ERROR(PPU, "GetThreadNumById failed.");
|
||||
Emu.Pause();
|
||||
return;
|
||||
}
|
||||
@ -87,7 +87,7 @@ void PPUThread::InitRegs()
|
||||
|
||||
if(tls_size >= Emu.GetTLSMemsz())
|
||||
{
|
||||
ConLog.Error("Out of TLS memory.");
|
||||
LOG_ERROR(PPU, "Out of TLS memory.");
|
||||
Emu.Pause();
|
||||
return;
|
||||
}
|
||||
@ -163,7 +163,7 @@ void PPUThread::DoRun()
|
||||
break;
|
||||
|
||||
default:
|
||||
ConLog.Error("Invalid CPU decoder mode: %d", Ini.CPUDecoderMode.GetValue());
|
||||
LOGF_ERROR(PPU, "Invalid CPU decoder mode: %d", Ini.CPUDecoderMode.GetValue());
|
||||
Emu.Pause();
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/SysCalls/lv2/SC_Lwmutex.h"
|
||||
@ -38,7 +38,7 @@ bool RawSPUThread::Read8(const u64 addr, u8* value)
|
||||
}
|
||||
|
||||
u32 offset = addr - GetStartAddr() - RAW_SPU_PROB_OFFSET;
|
||||
ConLog.Error("RawSPUThread[%d]: Read8(0x%x)", m_index, offset);
|
||||
LOGF_ERROR(Log::SPU, "RawSPUThread[%d]: Read8(0x%x)", m_index, offset);
|
||||
Emu.Pause();
|
||||
return false;
|
||||
}
|
||||
@ -51,7 +51,7 @@ bool RawSPUThread::Read16(const u64 addr, u16* value)
|
||||
}
|
||||
|
||||
u32 offset = addr - GetStartAddr() - RAW_SPU_PROB_OFFSET;
|
||||
ConLog.Error("RawSPUThread[%d]: Read16(0x%x)", m_index, offset);
|
||||
LOGF_ERROR(Log::SPU, "RawSPUThread[%d]: Read16(0x%x)", m_index, offset);
|
||||
Emu.Pause();
|
||||
return false;
|
||||
}
|
||||
@ -66,39 +66,39 @@ bool RawSPUThread::Read32(const u64 addr, u32* value)
|
||||
u32 offset = addr - GetStartAddr() - RAW_SPU_PROB_OFFSET;
|
||||
switch(offset)
|
||||
{
|
||||
case MFC_LSA_offs: ConLog.Warning("RawSPUThread[%d]: Read32(MFC_LSA)", m_index); *value = MFC2.LSA.GetValue(); break;
|
||||
case MFC_EAH_offs: ConLog.Warning("RawSPUThread[%d]: Read32(MFC_EAH)", m_index); *value = MFC2.EAH.GetValue(); break;
|
||||
case MFC_EAL_offs: ConLog.Warning("RawSPUThread[%d]: Read32(MFC_EAL)", m_index); *value = MFC2.EAL.GetValue(); break;
|
||||
case MFC_Size_Tag_offs: ConLog.Warning("RawSPUThread[%d]: Read32(MFC_Size_Tag)", m_index); *value = MFC2.Size_Tag.GetValue(); break;
|
||||
case MFC_CMDStatus_offs: ConLog.Warning("RawSPUThread[%d]: Read32(MFC_CMDStatus)", m_index); *value = MFC2.CMDStatus.GetValue(); break;
|
||||
case MFC_LSA_offs: LOGF_WARNING(Log::SPU, "RawSPUThread[%d]: Read32(MFC_LSA)", m_index); *value = MFC2.LSA.GetValue(); break;
|
||||
case MFC_EAH_offs: LOGF_WARNING(Log::SPU, "RawSPUThread[%d]: Read32(MFC_EAH)", m_index); *value = MFC2.EAH.GetValue(); break;
|
||||
case MFC_EAL_offs: LOGF_WARNING(Log::SPU, "RawSPUThread[%d]: Read32(MFC_EAL)", m_index); *value = MFC2.EAL.GetValue(); break;
|
||||
case MFC_Size_Tag_offs: LOGF_WARNING(Log::SPU, "RawSPUThread[%d]: Read32(MFC_Size_Tag)", m_index); *value = MFC2.Size_Tag.GetValue(); break;
|
||||
case MFC_CMDStatus_offs: LOGF_WARNING(Log::SPU, "RawSPUThread[%d]: Read32(MFC_CMDStatus)", m_index); *value = MFC2.CMDStatus.GetValue(); break;
|
||||
case MFC_QStatus_offs:
|
||||
ConLog.Warning("RawSPUThread[%d]: Read32(MFC_QStatus)", m_index);
|
||||
LOGF_WARNING(Log::SPU, "RawSPUThread[%d]: Read32(MFC_QStatus)", m_index);
|
||||
*value = MFC2.QStatus.GetValue();
|
||||
break;
|
||||
case Prxy_QueryType_offs: ConLog.Warning("RawSPUThread[%d]: Read32(Prxy_QueryType)", m_index); *value = Prxy.QueryType.GetValue(); break;
|
||||
case Prxy_QueryMask_offs: ConLog.Warning("RawSPUThread[%d]: Read32(Prxy_QueryMask)", m_index); *value = Prxy.QueryMask.GetValue(); break;
|
||||
case Prxy_TagStatus_offs: ConLog.Warning("RawSPUThread[%d]: Read32(Prxy_TagStatus)", m_index); *value = Prxy.TagStatus.GetValue(); break;
|
||||
case Prxy_QueryType_offs: LOGF_WARNING(Log::SPU, "RawSPUThread[%d]: Read32(Prxy_QueryType)", m_index); *value = Prxy.QueryType.GetValue(); break;
|
||||
case Prxy_QueryMask_offs: LOGF_WARNING(Log::SPU, "RawSPUThread[%d]: Read32(Prxy_QueryMask)", m_index); *value = Prxy.QueryMask.GetValue(); break;
|
||||
case Prxy_TagStatus_offs: LOGF_WARNING(Log::SPU, "RawSPUThread[%d]: Read32(Prxy_TagStatus)", m_index); *value = Prxy.TagStatus.GetValue(); break;
|
||||
case SPU_Out_MBox_offs:
|
||||
//ConLog.Warning("RawSPUThread[%d]: Read32(SPU_Out_MBox)", m_index);
|
||||
//LOGF_WARNING(Log::SPU, "RawSPUThread[%d]: Read32(SPU_Out_MBox)", m_index);
|
||||
SPU.Out_MBox.PopUncond(*value); //if Out_MBox is empty yet, the result will be undefined
|
||||
break;
|
||||
case SPU_In_MBox_offs: ConLog.Warning("RawSPUThread[%d]: Read32(SPU_In_MBox)", m_index); while(!SPU.In_MBox.Pop(*value) && !Emu.IsStopped()) Sleep(1); break;
|
||||
case SPU_MBox_Status_offs: //ConLog.Warning("RawSPUThread[%d]: Read32(SPU_MBox_Status)", m_index);
|
||||
case SPU_In_MBox_offs: LOGF_WARNING(Log::SPU, "RawSPUThread[%d]: Read32(SPU_In_MBox)", m_index); while(!SPU.In_MBox.Pop(*value) && !Emu.IsStopped()) Sleep(1); break;
|
||||
case SPU_MBox_Status_offs: //LOGF_WARNING(Log::SPU, "RawSPUThread[%d]: Read32(SPU_MBox_Status)", m_index);
|
||||
//SPU.MBox_Status.SetValue(SPU.Out_MBox.GetCount() ? SPU.MBox_Status.GetValue() | 1 : SPU.MBox_Status.GetValue() & ~1);
|
||||
SPU.MBox_Status.SetValue((SPU.Out_MBox.GetCount() & 0xff) | (SPU.In_MBox.GetFreeCount() << 8));
|
||||
*value = SPU.MBox_Status.GetValue();
|
||||
break;
|
||||
case SPU_RunCntl_offs: ConLog.Warning("RawSPUThread[%d]: Read32(SPU_RunCntl)", m_index); *value = SPU.RunCntl.GetValue(); break;
|
||||
case SPU_RunCntl_offs: LOGF_WARNING(Log::SPU, "RawSPUThread[%d]: Read32(SPU_RunCntl)", m_index); *value = SPU.RunCntl.GetValue(); break;
|
||||
case SPU_Status_offs:
|
||||
//ConLog.Warning("RawSPUThread[%d]: Read32(SPU_Status)", m_index);
|
||||
//LOGF_WARNING(Log::SPU, "RawSPUThread[%d]: Read32(SPU_Status)", m_index);
|
||||
*value = SPU.Status.GetValue();
|
||||
break;
|
||||
case SPU_NPC_offs: ConLog.Warning("RawSPUThread[%d]: Read32(SPU_NPC)", m_index); *value = SPU.NPC.GetValue(); break;
|
||||
case SPU_RdSigNotify1_offs: ConLog.Warning("RawSPUThread[%d]: Read32(SPU_RdSigNotify1)", m_index); *value = SPU.SNR[0].GetValue(); break;
|
||||
case SPU_RdSigNotify2_offs: ConLog.Warning("RawSPUThread[%d]: Read32(SPU_RdSigNotify2)", m_index); *value = SPU.SNR[1].GetValue(); break;
|
||||
case SPU_NPC_offs: LOGF_WARNING(Log::SPU, "RawSPUThread[%d]: Read32(SPU_NPC)", m_index); *value = SPU.NPC.GetValue(); break;
|
||||
case SPU_RdSigNotify1_offs: LOGF_WARNING(Log::SPU, "RawSPUThread[%d]: Read32(SPU_RdSigNotify1)", m_index); *value = SPU.SNR[0].GetValue(); break;
|
||||
case SPU_RdSigNotify2_offs: LOGF_WARNING(Log::SPU, "RawSPUThread[%d]: Read32(SPU_RdSigNotify2)", m_index); *value = SPU.SNR[1].GetValue(); break;
|
||||
|
||||
default:
|
||||
ConLog.Error("RawSPUThread[%d]: Read32(0x%x)", m_index, offset);
|
||||
LOGF_ERROR(Log::SPU, "RawSPUThread[%d]: Read32(0x%x)", m_index, offset);
|
||||
Emu.Pause();
|
||||
break;
|
||||
}
|
||||
@ -114,7 +114,7 @@ bool RawSPUThread::Read64(const u64 addr, u64* value)
|
||||
}
|
||||
|
||||
u32 offset = addr - GetStartAddr() - RAW_SPU_PROB_OFFSET;
|
||||
ConLog.Error("RawSPUThread[%d]: Read64(0x%x)", m_index, offset);
|
||||
LOGF_ERROR(Log::SPU, "RawSPUThread[%d]: Read64(0x%x)", m_index, offset);
|
||||
Emu.Pause();
|
||||
return false;
|
||||
}
|
||||
@ -127,7 +127,7 @@ bool RawSPUThread::Read128(const u64 addr, u128* value)
|
||||
}
|
||||
|
||||
u32 offset = addr - GetStartAddr() - RAW_SPU_PROB_OFFSET;
|
||||
ConLog.Error("RawSPUThread[%d]: Read128(0x%x)", m_index, offset);
|
||||
LOGF_ERROR(Log::SPU, "RawSPUThread[%d]: Read128(0x%x)", m_index, offset);
|
||||
Emu.Pause();
|
||||
return false;
|
||||
}
|
||||
@ -140,7 +140,7 @@ bool RawSPUThread::Write8(const u64 addr, const u8 value)
|
||||
}
|
||||
|
||||
u32 offset = addr - GetStartAddr() - RAW_SPU_PROB_OFFSET;
|
||||
ConLog.Error("RawSPUThread[%d]: Write8(0x%x, 0x%x)", m_index, offset, value);
|
||||
LOGF_ERROR(Log::SPU, "RawSPUThread[%d]: Write8(0x%x, 0x%x)", m_index, offset, value);
|
||||
Emu.Pause();
|
||||
return false;
|
||||
}
|
||||
@ -153,7 +153,7 @@ bool RawSPUThread::Write16(const u64 addr, const u16 value)
|
||||
}
|
||||
|
||||
u32 offset = addr - GetStartAddr() - RAW_SPU_PROB_OFFSET;
|
||||
ConLog.Error("RawSPUThread[%d]: Write16(0x%x, 0x%x)", m_index, offset, value);
|
||||
LOGF_ERROR(Log::SPU, "RawSPUThread[%d]: Write16(0x%x, 0x%x)", m_index, offset, value);
|
||||
Emu.Pause();
|
||||
return false;
|
||||
}
|
||||
@ -177,20 +177,20 @@ bool RawSPUThread::Write32(const u64 addr, const u32 value)
|
||||
MFC2.CMDStatus.SetValue(value);
|
||||
EnqMfcCmd(MFC2);
|
||||
break;
|
||||
case MFC_QStatus_offs: ConLog.Warning("RawSPUThread[%d]: Write32(MFC_QStatus, 0x%x)", m_index, value); MFC2.QStatus.SetValue(value); break;
|
||||
case MFC_QStatus_offs: LOGF_WARNING(Log::SPU, "RawSPUThread[%d]: Write32(MFC_QStatus, 0x%x)", m_index, value); MFC2.QStatus.SetValue(value); break;
|
||||
case Prxy_QueryType_offs:
|
||||
{
|
||||
ConLog.Warning("RawSPUThread[%d]: Write32(Prxy_QueryType, 0x%x)", m_index, value);
|
||||
LOGF_WARNING(Log::SPU, "RawSPUThread[%d]: Write32(Prxy_QueryType, 0x%x)", m_index, value);
|
||||
Prxy.QueryType.SetValue(value);
|
||||
|
||||
switch(value)
|
||||
{
|
||||
case 2:
|
||||
ConLog.Warning("RawSPUThread[%d]: Prxy Query Immediate.", m_index);
|
||||
LOGF_WARNING(Log::SPU, "RawSPUThread[%d]: Prxy Query Immediate.", m_index);
|
||||
break;
|
||||
|
||||
default:
|
||||
ConLog.Error("RawSPUThread[%d]: Unknown Prxy Query Type. (prxy_query=0x%x)", m_index, value);
|
||||
LOGF_ERROR(Log::SPU, "RawSPUThread[%d]: Unknown Prxy Query Type. (prxy_query=0x%x)", m_index, value);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -198,22 +198,22 @@ bool RawSPUThread::Write32(const u64 addr, const u32 value)
|
||||
MFC2.QStatus.SetValue(Prxy.QueryMask.GetValue());
|
||||
}
|
||||
break;
|
||||
case Prxy_QueryMask_offs: ConLog.Warning("RawSPUThread[%d]: Write32(Prxy_QueryMask, 0x%x)", m_index, value); Prxy.QueryMask.SetValue(value); break;
|
||||
case Prxy_TagStatus_offs: ConLog.Warning("RawSPUThread[%d]: Write32(Prxy_TagStatus, 0x%x)", m_index, value); Prxy.TagStatus.SetValue(value); break;
|
||||
case SPU_Out_MBox_offs: ConLog.Warning("RawSPUThread[%d]: Write32(SPU_Out_MBox, 0x%x)", m_index, value); while(!SPU.Out_MBox.Push(value) && !Emu.IsStopped()) Sleep(1); break;
|
||||
case Prxy_QueryMask_offs: LOGF_WARNING(Log::SPU, "RawSPUThread[%d]: Write32(Prxy_QueryMask, 0x%x)", m_index, value); Prxy.QueryMask.SetValue(value); break;
|
||||
case Prxy_TagStatus_offs: LOGF_WARNING(Log::SPU, "RawSPUThread[%d]: Write32(Prxy_TagStatus, 0x%x)", m_index, value); Prxy.TagStatus.SetValue(value); break;
|
||||
case SPU_Out_MBox_offs: LOGF_WARNING(Log::SPU, "RawSPUThread[%d]: Write32(SPU_Out_MBox, 0x%x)", m_index, value); while(!SPU.Out_MBox.Push(value) && !Emu.IsStopped()) Sleep(1); break;
|
||||
case SPU_In_MBox_offs:
|
||||
//ConLog.Warning("RawSPUThread[%d]: Write32(SPU_In_MBox, 0x%x)", m_index, value);
|
||||
//LOGF_WARNING(Log::SPU, "RawSPUThread[%d]: Write32(SPU_In_MBox, 0x%x)", m_index, value);
|
||||
SPU.In_MBox.PushUncond(value); //if In_MBox is already full, the last message will be overwritten
|
||||
break;
|
||||
case SPU_MBox_Status_offs: ConLog.Warning("RawSPUThread[%d]: Write32(SPU_MBox_Status, 0x%x)", m_index, value); SPU.MBox_Status.SetValue(value); break;
|
||||
case SPU_RunCntl_offs: ConLog.Warning("RawSPUThread[%d]: Write32(SPU_RunCntl, 0x%x)", m_index, value); SPU.RunCntl.SetValue(value); break;
|
||||
case SPU_Status_offs: ConLog.Warning("RawSPUThread[%d]: Write32(SPU_Status, 0x%x)", m_index, value); SPU.Status.SetValue(value); break;
|
||||
case SPU_NPC_offs: ConLog.Warning("RawSPUThread[%d]: Write32(SPU_NPC, 0x%x)", m_index, value); SPU.NPC.SetValue(value); break;
|
||||
case SPU_RdSigNotify1_offs: ConLog.Warning("RawSPUThread[%d]: Write32(SPU_RdSigNotify1, 0x%x)", m_index, value); SPU.SNR[0].SetValue(value); break;
|
||||
case SPU_RdSigNotify2_offs: ConLog.Warning("RawSPUThread[%d]: Write32(SPU_RdSigNotify2, 0x%x)", m_index, value); SPU.SNR[1].SetValue(value); break;
|
||||
case SPU_MBox_Status_offs: LOGF_WARNING(Log::SPU, "RawSPUThread[%d]: Write32(SPU_MBox_Status, 0x%x)", m_index, value); SPU.MBox_Status.SetValue(value); break;
|
||||
case SPU_RunCntl_offs: LOGF_WARNING(Log::SPU, "RawSPUThread[%d]: Write32(SPU_RunCntl, 0x%x)", m_index, value); SPU.RunCntl.SetValue(value); break;
|
||||
case SPU_Status_offs: LOGF_WARNING(Log::SPU, "RawSPUThread[%d]: Write32(SPU_Status, 0x%x)", m_index, value); SPU.Status.SetValue(value); break;
|
||||
case SPU_NPC_offs: LOGF_WARNING(Log::SPU, "RawSPUThread[%d]: Write32(SPU_NPC, 0x%x)", m_index, value); SPU.NPC.SetValue(value); break;
|
||||
case SPU_RdSigNotify1_offs: LOGF_WARNING(Log::SPU, "RawSPUThread[%d]: Write32(SPU_RdSigNotify1, 0x%x)", m_index, value); SPU.SNR[0].SetValue(value); break;
|
||||
case SPU_RdSigNotify2_offs: LOGF_WARNING(Log::SPU, "RawSPUThread[%d]: Write32(SPU_RdSigNotify2, 0x%x)", m_index, value); SPU.SNR[1].SetValue(value); break;
|
||||
|
||||
default:
|
||||
ConLog.Error("RawSPUThread[%d]: Write32(0x%x, 0x%x)", m_index, offset, value);
|
||||
LOGF_ERROR(Log::SPU, "RawSPUThread[%d]: Write32(0x%x, 0x%x)", m_index, offset, value);
|
||||
Emu.Pause();
|
||||
break;
|
||||
}
|
||||
@ -229,7 +229,7 @@ bool RawSPUThread::Write64(const u64 addr, const u64 value)
|
||||
}
|
||||
|
||||
u32 offset = addr - GetStartAddr() - RAW_SPU_PROB_OFFSET;
|
||||
ConLog.Error("RawSPUThread[%d]: Write64(0x%x, 0x%llx)", m_index, offset, value);
|
||||
LOGF_ERROR(Log::SPU, "RawSPUThread[%d]: Write64(0x%x, 0x%llx)", m_index, offset, value);
|
||||
Emu.Pause();
|
||||
return false;
|
||||
}
|
||||
@ -242,7 +242,7 @@ bool RawSPUThread::Write128(const u64 addr, const u128 value)
|
||||
}
|
||||
|
||||
u32 offset = addr - GetStartAddr() - RAW_SPU_PROB_OFFSET;
|
||||
ConLog.Error("RawSPUThread[%d]: Write128(0x%x, 0x%llx_%llx)", m_index, offset, value._u64[1], value._u64[0]);
|
||||
LOGF_ERROR(Log::SPU, "RawSPUThread[%d]: Write128(0x%x, 0x%llx_%llx)", m_index, offset, value._u64[1], value._u64[0]);
|
||||
Emu.Pause();
|
||||
return false;
|
||||
}
|
||||
@ -260,7 +260,7 @@ u32 RawSPUThread::GetIndex() const
|
||||
|
||||
void RawSPUThread::Task()
|
||||
{
|
||||
if (Ini.HLELogging.GetValue()) ConLog.Write("%s enter", PPCThread::GetFName().c_str());
|
||||
if (Ini.HLELogging.GetValue()) LOGF_NOTICE(Log::SPU, "%s enter", PPCThread::GetFName().c_str());
|
||||
|
||||
const std::vector<u64>& bp = Emu.GetBreakPoints();
|
||||
|
||||
@ -312,7 +312,7 @@ void RawSPUThread::Task()
|
||||
is_last_paused = false;
|
||||
PC = SPU.NPC.GetValue();
|
||||
SPU.Status.SetValue(SPU_STATUS_RUNNING);
|
||||
ConLog.Warning("Starting RawSPU...");
|
||||
LOGF_WARNING(Log::SPU, "Starting RawSPU...");
|
||||
}
|
||||
|
||||
Step();
|
||||
@ -336,12 +336,12 @@ void RawSPUThread::Task()
|
||||
}
|
||||
catch(const std::string& e)
|
||||
{
|
||||
ConLog.Error("Exception: %s", e.c_str());
|
||||
LOGF_ERROR(Log::SPU, "Exception: %s", e.c_str());
|
||||
}
|
||||
catch(const char* e)
|
||||
{
|
||||
ConLog.Error("Exception: %s", e);
|
||||
LOGF_ERROR(Log::SPU, "Exception: %s", e);
|
||||
}
|
||||
|
||||
if (Ini.HLELogging.GetValue()) ConLog.Write("%s leave", PPCThread::GetFName().c_str());
|
||||
if (Ini.HLELogging.GetValue()) LOGF_NOTICE(Log::SPU, "%s leave", PPCThread::GetFName().c_str());
|
||||
}
|
||||
|
@ -18,9 +18,9 @@
|
||||
#define MEM_AND_REG_HASH() \
|
||||
unsigned char mem_h[20]; sha1(&Memory[CPU.dmac.ls_offset], 256*1024, mem_h); \
|
||||
unsigned char reg_h[20]; sha1((const unsigned char*)CPU.GPR, sizeof(CPU.GPR), reg_h); \
|
||||
ConLog.Write("Mem hash: 0x%llx, reg hash: 0x%llx", *(u64*)mem_h, *(u64*)reg_h);
|
||||
LOGF_NOTICE(Log::SPU, "Mem hash: 0x%llx, reg hash: 0x%llx", *(u64*)mem_h, *(u64*)reg_h);
|
||||
|
||||
#define LOG2_OPCODE(...) //MEM_AND_REG_HASH(); ConLog.Write(__FUNCTION__ "(): " __VA_ARGS__)
|
||||
#define LOG2_OPCODE(...) //MEM_AND_REG_HASH(); LOGF_NOTICE(Log::SPU, __FUNCTION__ "(): " __VA_ARGS__)
|
||||
|
||||
#define LOG5_OPCODE(...) ///
|
||||
|
||||
@ -339,7 +339,7 @@ private:
|
||||
u32 lsa = (CPU.GPR[ra]._u32[3] + CPU.GPR[rb]._u32[3]) & 0x3fff0;
|
||||
if(!CPU.IsGoodLSA(lsa))
|
||||
{
|
||||
ConLog.Error("STQX: bad lsa (0x%x)", lsa);
|
||||
LOGF_ERROR(Log::SPU, "STQX: bad lsa (0x%x)", lsa);
|
||||
Emu.Pause();
|
||||
return;
|
||||
}
|
||||
@ -438,7 +438,7 @@ private:
|
||||
|
||||
if(!CPU.IsGoodLSA(lsa))
|
||||
{
|
||||
ConLog.Error("LQX: bad lsa (0x%x)", lsa);
|
||||
LOGF_ERROR(Log::SPU, "LQX: bad lsa (0x%x)", lsa);
|
||||
Emu.Pause();
|
||||
return;
|
||||
}
|
||||
@ -1126,7 +1126,7 @@ private:
|
||||
u32 lsa = (i16 << 2) & 0x3fff0;
|
||||
if(!CPU.IsGoodLSA(lsa))
|
||||
{
|
||||
ConLog.Error("STQA: bad lsa (0x%x)", lsa);
|
||||
LOGF_ERROR(Log::SPU, "STQA: bad lsa (0x%x)", lsa);
|
||||
Emu.Pause();
|
||||
return;
|
||||
}
|
||||
@ -1177,7 +1177,7 @@ private:
|
||||
u32 lsa = branchTarget(CPU.PC, i16) & 0x3fff0;
|
||||
if(!CPU.IsGoodLSA(lsa))
|
||||
{
|
||||
ConLog.Error("STQR: bad lsa (0x%x)", lsa);
|
||||
LOGF_ERROR(Log::SPU, "STQR: bad lsa (0x%x)", lsa);
|
||||
Emu.Pause();
|
||||
return;
|
||||
}
|
||||
@ -1195,7 +1195,7 @@ private:
|
||||
u32 lsa = (i16 << 2) & 0x3fff0;
|
||||
if(!CPU.IsGoodLSA(lsa))
|
||||
{
|
||||
ConLog.Error("LQA: bad lsa (0x%x)", lsa);
|
||||
LOGF_ERROR(Log::SPU, "LQA: bad lsa (0x%x)", lsa);
|
||||
Emu.Pause();
|
||||
return;
|
||||
}
|
||||
@ -1245,7 +1245,7 @@ private:
|
||||
u32 lsa = branchTarget(CPU.PC, i16) & 0x3fff0;
|
||||
if(!CPU.IsGoodLSA(lsa))
|
||||
{
|
||||
ConLog.Error("LQR: bad lsa (0x%x)", lsa);
|
||||
LOGF_ERROR(Log::SPU, "LQR: bad lsa (0x%x)", lsa);
|
||||
Emu.Pause();
|
||||
return;
|
||||
}
|
||||
@ -1334,11 +1334,11 @@ private:
|
||||
const u32 lsa = (CPU.GPR[ra]._i32[3] + i10) & 0x3fff0;
|
||||
if(!CPU.IsGoodLSA(lsa))
|
||||
{
|
||||
ConLog.Error("STQD: bad lsa (0x%x)", lsa);
|
||||
LOGF_ERROR(Log::SPU, "STQD: bad lsa (0x%x)", lsa);
|
||||
Emu.Pause();
|
||||
return;
|
||||
}
|
||||
//ConLog.Write("STQD(lsa=0x%x): GPR[%d] (0x%llx%llx)", lsa, rt, CPU.GPR[rt]._u64[1], CPU.GPR[rt]._u64[0]);
|
||||
//LOGF_NOTICE(Log::SPU, "STQD(lsa=0x%x): GPR[%d] (0x%llx%llx)", lsa, rt, CPU.GPR[rt]._u64[1], CPU.GPR[rt]._u64[0]);
|
||||
CPU.WriteLS128(lsa, CPU.GPR[rt]._u128);
|
||||
}
|
||||
void LQD(u32 rt, s32 i10, u32 ra) //i10 is shifted left by 4 while decoding
|
||||
@ -1346,7 +1346,7 @@ private:
|
||||
const u32 lsa = (CPU.GPR[ra]._i32[3] + i10) & 0x3fff0;
|
||||
if(!CPU.IsGoodLSA(lsa))
|
||||
{
|
||||
ConLog.Error("LQD: bad lsa (0x%x)", lsa);
|
||||
LOGF_ERROR(Log::SPU, "LQD: bad lsa (0x%x)", lsa);
|
||||
Emu.Pause();
|
||||
return;
|
||||
}
|
||||
@ -1540,8 +1540,8 @@ private:
|
||||
|
||||
void UNK(const std::string& err)
|
||||
{
|
||||
ConLog.Error(err + fmt::Format(" #pc: 0x%x", CPU.PC));
|
||||
LOGF_ERROR(Log::SPU, err + fmt::Format(" #pc: 0x%x", CPU.PC));
|
||||
Emu.Pause();
|
||||
for(uint i=0; i<128; ++i) ConLog.Write("r%d = 0x%s", i, CPU.GPR[i].ToString().c_str());
|
||||
for(uint i=0; i<128; ++i) LOGF_NOTICE(Log::SPU, "r%d = 0x%s", i, CPU.GPR[i].ToString().c_str());
|
||||
}
|
||||
};
|
||||
|
@ -3845,7 +3845,7 @@ private:
|
||||
|
||||
void UNK(const std::string& err)
|
||||
{
|
||||
ConLog.Error(err + fmt::Format(" #pc: 0x%x", CPU.PC));
|
||||
LOGF_ERROR(Log::SPU, err + fmt::Format(" #pc: 0x%x", CPU.PC));
|
||||
c.mov(cpu_qword(PC), (u32)CPU.PC);
|
||||
do_finalize = true;
|
||||
Emu.Pause();
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/SysCalls/lv2/SC_Lwmutex.h"
|
||||
@ -164,7 +164,7 @@ u8 SPURecompilerCore::DecodeMemory(const u64 address)
|
||||
|
||||
if (!pos)
|
||||
{
|
||||
ConLog.Error("SPURecompilerCore::DecodeMemory(): ls_addr = 0");
|
||||
LOGF_ERROR(Log::SPU, "SPURecompilerCore::DecodeMemory(): ls_addr = 0");
|
||||
Emu.Pause();
|
||||
return 0;
|
||||
}
|
||||
@ -185,7 +185,7 @@ u8 SPURecompilerCore::DecodeMemory(const u64 address)
|
||||
if (!is_valid)
|
||||
{
|
||||
// TODO
|
||||
ConLog.Error("SPURecompilerCore::DecodeMemory(ls_addr=0x%x): code has changed", pos * sizeof(u32));
|
||||
LOGF_ERROR(Log::SPU, "SPURecompilerCore::DecodeMemory(ls_addr=0x%x): code has changed", pos * sizeof(u32));
|
||||
Emu.Pause();
|
||||
return 0;
|
||||
}
|
||||
@ -198,7 +198,7 @@ u8 SPURecompilerCore::DecodeMemory(const u64 address)
|
||||
did_compile = true;
|
||||
if (entry[pos].valid == 0)
|
||||
{
|
||||
ConLog.Error("SPURecompilerCore::Compile(ls_addr=0x%x): branch to 0x0 opcode", pos * sizeof(u32));
|
||||
LOGF_ERROR(Log::SPU, "SPURecompilerCore::Compile(ls_addr=0x%x): branch to 0x0 opcode", pos * sizeof(u32));
|
||||
Emu.Pause();
|
||||
return 0;
|
||||
}
|
||||
@ -206,7 +206,7 @@ u8 SPURecompilerCore::DecodeMemory(const u64 address)
|
||||
|
||||
if (!entry[pos].pointer)
|
||||
{
|
||||
ConLog.Error("SPURecompilerCore::DecodeMemory(ls_addr=0x%x): compilation failed", pos * sizeof(u32));
|
||||
LOGF_ERROR(Log::SPU, "SPURecompilerCore::DecodeMemory(ls_addr=0x%x): compilation failed", pos * sizeof(u32));
|
||||
Emu.Pause();
|
||||
return 0;
|
||||
}
|
||||
@ -223,7 +223,7 @@ u8 SPURecompilerCore::DecodeMemory(const u64 address)
|
||||
//if (pos == 0x19c >> 2)
|
||||
{
|
||||
//Emu.Pause();
|
||||
//for (uint i = 0; i < 128; ++i) ConLog.Write("r%d = 0x%s", i, CPU.GPR[i].ToString().c_str());
|
||||
//for (uint i = 0; i < 128; ++i) LOGF_NOTICE(Log::SPU, "r%d = 0x%s", i, CPU.GPR[i].ToString().c_str());
|
||||
}
|
||||
}
|
||||
|
||||
@ -243,7 +243,7 @@ u8 SPURecompilerCore::DecodeMemory(const u64 address)
|
||||
//if (pos == 0x340 >> 2)
|
||||
{
|
||||
//Emu.Pause();
|
||||
//for (uint i = 0; i < 128; ++i) ConLog.Write("r%d = 0x%s", i, CPU.GPR[i].ToString().c_str());
|
||||
//for (uint i = 0; i < 128; ++i) LOGF_NOTICE(Log::SPU, "r%d = 0x%s", i, CPU.GPR[i].ToString().c_str());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/SysCalls/lv2/SC_Lwmutex.h"
|
||||
@ -86,7 +86,7 @@ void SPUThread::DoRun()
|
||||
break;
|
||||
|
||||
default:
|
||||
ConLog.Error("Invalid SPU decoder mode: %d", Ini.SPUDecoderMode.GetValue());
|
||||
LOGF_ERROR(Log::SPU, "Invalid SPU decoder mode: %d", Ini.SPUDecoderMode.GetValue());
|
||||
Emu.Pause();
|
||||
}
|
||||
}
|
||||
|
@ -211,7 +211,7 @@ public:
|
||||
return this->low >> 22 & 0x3;
|
||||
|
||||
default:
|
||||
ConLog.Error("Unexpected slice value in FPSCR::checkSliceRounding(): %d", slice);
|
||||
LOGF_ERROR(SPU, "Unexpected slice value in FPSCR::checkSliceRounding(): %d", slice);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@ -599,7 +599,7 @@ public:
|
||||
u32 num = (ea & SYS_SPU_THREAD_BASE_MASK) / SYS_SPU_THREAD_OFFSET; // thread number in group
|
||||
if (num >= group->list.size() || !group->list[num])
|
||||
{
|
||||
ConLog.Error("DMAC::ProcessCmd(): SPU Thread Group MMIO Access (ea=0x%llx): invalid thread", ea);
|
||||
LOGF_ERROR(Log::SPU, "DMAC::ProcessCmd(): SPU Thread Group MMIO Access (ea=0x%llx): invalid thread", ea);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -618,13 +618,13 @@ public:
|
||||
}
|
||||
else
|
||||
{
|
||||
ConLog.Error("DMAC::ProcessCmd(): SPU Thread Group MMIO Access (ea=0x%llx, size=%d, cmd=0x%x): invalid command", ea, size, cmd);
|
||||
LOGF_ERROR(Log::SPU, "DMAC::ProcessCmd(): SPU Thread Group MMIO Access (ea=0x%llx, size=%d, cmd=0x%x): invalid command", ea, size, cmd);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ConLog.Error("DMAC::ProcessCmd(): SPU Thread Group MMIO Access (ea=0x%llx): group not set", ea);
|
||||
LOGF_ERROR(Log::SPU, "DMAC::ProcessCmd(): SPU Thread Group MMIO Access (ea=0x%llx): group not set", ea);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -646,7 +646,7 @@ public:
|
||||
|
||||
default:
|
||||
{
|
||||
ConLog.Error("DMAC::ProcessCmd(): Unknown DMA cmd.");
|
||||
LOG_ERROR(Log::SPU, "DMAC::ProcessCmd(): Unknown DMA cmd.");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -664,7 +664,7 @@ public:
|
||||
}
|
||||
else
|
||||
{
|
||||
ConLog.Error("DMAC::ProcessCmd(): PUT* cmd failed (ea=0x%llx, lsa=0x%x, size=%d)", ea, lsa, size);
|
||||
LOGF_ERROR(Log::SPU, "DMAC::ProcessCmd(): PUT* cmd failed (ea=0x%llx, lsa=0x%x, size=%d)", ea, lsa, size);
|
||||
return false; // TODO: page fault (?)
|
||||
}
|
||||
}
|
||||
@ -677,14 +677,14 @@ public:
|
||||
}
|
||||
else
|
||||
{
|
||||
ConLog.Error("DMAC::ProcessCmd(): GET* cmd failed (ea=0x%llx, lsa=0x%x, size=%d)", ea, lsa, size);
|
||||
LOGF_ERROR(Log::SPU, "DMAC::ProcessCmd(): GET* cmd failed (ea=0x%llx, lsa=0x%x, size=%d)", ea, lsa, size);
|
||||
return false; // TODO: page fault (?)
|
||||
}
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
ConLog.Error("DMAC::ProcessCmd(): Unknown DMA cmd.");
|
||||
LOG_ERROR(Log::SPU, "DMAC::ProcessCmd(): Unknown DMA cmd.");
|
||||
return false; // ???
|
||||
}
|
||||
}
|
||||
@ -725,7 +725,7 @@ public:
|
||||
u32 size = rec->ts;
|
||||
if (size < 16 && size != 1 && size != 2 && size != 4 && size != 8)
|
||||
{
|
||||
ConLog.Error("DMA List: invalid transfer size(%d)", size);
|
||||
LOGF_ERROR(Log::SPU, "DMA List: invalid transfer size(%d)", size);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -737,7 +737,7 @@ public:
|
||||
}
|
||||
|
||||
if (Ini.HLELogging.GetValue() || rec->s)
|
||||
ConLog.Write("*** list element(%d/%d): s = 0x%x, ts = 0x%x, low ea = 0x%x (lsa = 0x%x)",
|
||||
LOGF_NOTICE(Log::SPU, "*** list element(%d/%d): s = 0x%x, ts = 0x%x, low ea = 0x%x (lsa = 0x%x)",
|
||||
i, list_size, (u16)rec->s, (u16)rec->ts, (u32)rec->ea, lsa | (addr & 0xf));
|
||||
|
||||
lsa += std::max(size, (u32)16);
|
||||
@ -748,7 +748,7 @@ public:
|
||||
|
||||
if (StallList[tag].MFCArgs)
|
||||
{
|
||||
ConLog.Error("DMA List: existing stalled list found (tag=%d)", tag);
|
||||
LOGF_ERROR(Log::SPU, "DMA List: existing stalled list found (tag=%d)", tag);
|
||||
}
|
||||
StallList[tag].MFCArgs = &MFCArgs;
|
||||
StallList[tag].cmd = cmd;
|
||||
@ -780,7 +780,7 @@ public:
|
||||
case MFC_PUTR_CMD: // ???
|
||||
case MFC_GET_CMD:
|
||||
{
|
||||
if (Ini.HLELogging.GetValue()) ConLog.Write("DMA %s%s%s%s: lsa = 0x%x, ea = 0x%llx, tag = 0x%x, size = 0x%x, cmd = 0x%x",
|
||||
if (Ini.HLELogging.GetValue()) LOGF_NOTICE(Log::SPU, "DMA %s%s%s%s: lsa = 0x%x, ea = 0x%llx, tag = 0x%x, size = 0x%x, cmd = 0x%x",
|
||||
(op & MFC_PUT_CMD ? "PUT" : "GET"),
|
||||
(op & MFC_RESULT_MASK ? "R" : ""),
|
||||
(op & MFC_BARRIER_MASK ? "B" : ""),
|
||||
@ -795,7 +795,7 @@ public:
|
||||
case MFC_PUTRL_CMD: // ???
|
||||
case MFC_GETL_CMD:
|
||||
{
|
||||
if (Ini.HLELogging.GetValue()) ConLog.Write("DMA %s%s%s%s: lsa = 0x%x, list = 0x%llx, tag = 0x%x, size = 0x%x, cmd = 0x%x",
|
||||
if (Ini.HLELogging.GetValue()) LOGF_NOTICE(Log::SPU, "DMA %s%s%s%s: lsa = 0x%x, list = 0x%llx, tag = 0x%x, size = 0x%x, cmd = 0x%x",
|
||||
(op & MFC_PUT_CMD ? "PUT" : "GET"),
|
||||
(op & MFC_RESULT_MASK ? "RL" : "L"),
|
||||
(op & MFC_BARRIER_MASK ? "B" : ""),
|
||||
@ -811,7 +811,7 @@ public:
|
||||
case MFC_PUTLLUC_CMD:
|
||||
case MFC_PUTQLLUC_CMD:
|
||||
{
|
||||
if (Ini.HLELogging.GetValue() || size != 128) ConLog.Write("DMA %s: lsa=0x%x, ea = 0x%llx, (tag) = 0x%x, (size) = 0x%x, cmd = 0x%x",
|
||||
if (Ini.HLELogging.GetValue() || size != 128) LOGF_NOTICE(Log::SPU, "DMA %s: lsa=0x%x, ea = 0x%llx, (tag) = 0x%x, (size) = 0x%x, cmd = 0x%x",
|
||||
(op == MFC_GETLLAR_CMD ? "GETLLAR" :
|
||||
op == MFC_PUTLLC_CMD ? "PUTLLC" :
|
||||
op == MFC_PUTLLUC_CMD ? "PUTLLUC" : "PUTQLLUC"),
|
||||
@ -857,7 +857,7 @@ public:
|
||||
{
|
||||
if (buf[last].hi != reservation.data[last].hi && buf[last].lo != reservation.data[last].lo)
|
||||
{
|
||||
ConLog.Error("MFC_PUTLLC_CMD: TODO: 128bit compare and swap");
|
||||
LOG_ERROR(Log::SPU, "MFC_PUTLLC_CMD: TODO: 128bit compare and swap");
|
||||
Emu.Pause();
|
||||
Prxy.AtomicStat.PushUncond(MFC_PUTLLC_SUCCESS);
|
||||
}
|
||||
@ -885,7 +885,7 @@ public:
|
||||
}
|
||||
else // full 64 bit
|
||||
{
|
||||
ConLog.Error("MFC_PUTLLC_CMD: TODO: 64bit compare and swap");
|
||||
LOGF_ERROR(Log::SPU, "MFC_PUTLLC_CMD: TODO: 64bit compare and swap");
|
||||
Emu.Pause();
|
||||
Prxy.AtomicStat.PushUncond(MFC_PUTLLC_SUCCESS);
|
||||
}*/
|
||||
@ -894,7 +894,7 @@ public:
|
||||
else
|
||||
{
|
||||
ProcessCmd(MFC_PUT_CMD, tag, lsa, ea, 128);
|
||||
ConLog.Error("MFC_PUTLLC_CMD: Reservation Error: impossibru (~ 16x%d (mask=0x%x)) (opcode=0x%x, cmd=0x%x, lsa = 0x%x, ea = 0x%llx, tag = 0x%x, size = 0x%x)",
|
||||
LOGF_ERROR(Log::SPU, "MFC_PUTLLC_CMD: Reservation Error: impossibru (~ 16x%d (mask=0x%x)) (opcode=0x%x, cmd=0x%x, lsa = 0x%x, ea = 0x%llx, tag = 0x%x, size = 0x%x)",
|
||||
changed, mask, op, cmd, lsa, ea, tag, size);
|
||||
Emu.Pause();
|
||||
Prxy.AtomicStat.PushUncond(MFC_PUTLLC_SUCCESS);
|
||||
@ -929,7 +929,7 @@ public:
|
||||
break;
|
||||
|
||||
default:
|
||||
ConLog.Error("Unknown MFC cmd. (opcode=0x%x, cmd=0x%x, lsa = 0x%x, ea = 0x%llx, tag = 0x%x, size = 0x%x)",
|
||||
LOGF_ERROR( Log::SPU, "Unknown MFC cmd. (opcode=0x%x, cmd=0x%x, lsa = 0x%x, ea = 0x%llx, tag = 0x%x, size = 0x%x)",
|
||||
op, cmd, lsa, ea, tag, size);
|
||||
break;
|
||||
}
|
||||
@ -949,7 +949,7 @@ public:
|
||||
return count;
|
||||
|
||||
case SPU_WrOutIntrMbox:
|
||||
ConLog.Warning("GetChannelCount(%s) = 0", spu_ch_name[ch]);
|
||||
LOGF_WARNING(Log::SPU, "GetChannelCount(%s) = 0", spu_ch_name[ch]);
|
||||
return 0;
|
||||
|
||||
case MFC_RdTagStat:
|
||||
@ -971,7 +971,7 @@ public:
|
||||
return Prxy.AtomicStat.GetCount();
|
||||
|
||||
default:
|
||||
ConLog.Error("%s error: unknown/illegal channel (%d [%s]).",
|
||||
LOGF_ERROR(Log::SPU, "%s error: unknown/illegal channel (%d [%s]).",
|
||||
__FUNCTION__, ch, spu_ch_name[ch]);
|
||||
break;
|
||||
}
|
||||
@ -988,7 +988,7 @@ public:
|
||||
case SPU_WrOutIntrMbox:
|
||||
if (!group) // if RawSPU
|
||||
{
|
||||
if (Ini.HLELogging.GetValue()) ConLog.Write("SPU_WrOutIntrMbox: interrupt(v=0x%x)", v);
|
||||
if (Ini.HLELogging.GetValue()) LOGF_NOTICE(Log::SPU, "SPU_WrOutIntrMbox: interrupt(v=0x%x)", v);
|
||||
SPU.Out_IntrMBox.PushUncond(v);
|
||||
m_intrtag[2].stat |= 1;
|
||||
if (CPUThread* t = Emu.GetCPU().GetThread(m_intrtag[2].thread))
|
||||
@ -998,7 +998,7 @@ public:
|
||||
Sleep(1);
|
||||
if (Emu.IsStopped())
|
||||
{
|
||||
ConLog.Warning("%s(%s) aborted", __FUNCTION__, spu_ch_name[ch]);
|
||||
LOGF_WARNING(Log::SPU, "%s(%s) aborted", __FUNCTION__, spu_ch_name[ch]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -1019,20 +1019,20 @@ public:
|
||||
u32 data;
|
||||
if (!SPU.Out_MBox.Pop(data))
|
||||
{
|
||||
ConLog.Error("sys_spu_thread_send_event(v=0x%x, spup=%d): Out_MBox is empty", v, spup);
|
||||
LOGF_ERROR(Log::SPU, "sys_spu_thread_send_event(v=0x%x, spup=%d): Out_MBox is empty", v, spup);
|
||||
return;
|
||||
}
|
||||
|
||||
if (SPU.In_MBox.GetCount())
|
||||
{
|
||||
ConLog.Error("sys_spu_thread_send_event(v=0x%x, spup=%d): In_MBox is not empty", v, spup);
|
||||
LOGF_ERROR(Log::SPU, "sys_spu_thread_send_event(v=0x%x, spup=%d): In_MBox is not empty", v, spup);
|
||||
SPU.In_MBox.PushUncond(CELL_EBUSY); // ???
|
||||
return;
|
||||
}
|
||||
|
||||
if (Ini.HLELogging.GetValue())
|
||||
{
|
||||
ConLog.Write("sys_spu_thread_send_event(spup=%d, data0=0x%x, data1=0x%x)", spup, v & 0x00ffffff, data);
|
||||
LOGF_NOTICE(Log::SPU, "sys_spu_thread_send_event(spup=%d, data0=0x%x, data1=0x%x)", spup, v & 0x00ffffff, data);
|
||||
}
|
||||
|
||||
EventPort& port = SPUPs[spup];
|
||||
@ -1042,7 +1042,7 @@ public:
|
||||
if (!port.eq)
|
||||
{
|
||||
// spu_printf fails there
|
||||
ConLog.Warning("sys_spu_thread_send_event(spup=%d, data0=0x%x, data1=0x%x): event queue not connected", spup, v & 0x00ffffff, data);
|
||||
LOGF_WARNING(Log::SPU, "sys_spu_thread_send_event(spup=%d, data0=0x%x, data1=0x%x): event queue not connected", spup, (v & 0x00ffffff), data);
|
||||
SPU.In_MBox.PushUncond(CELL_ENOTCONN); // TODO: check error passing
|
||||
return;
|
||||
}
|
||||
@ -1064,25 +1064,25 @@ public:
|
||||
u32 data;
|
||||
if (!SPU.Out_MBox.Pop(data))
|
||||
{
|
||||
ConLog.Error("sys_event_flag_set_bit(v=0x%x (flag=%d)): Out_MBox is empty", v, flag);
|
||||
LOGF_ERROR(Log::SPU, "sys_event_flag_set_bit(v=0x%x (flag=%d)): Out_MBox is empty", v, flag);
|
||||
return;
|
||||
}
|
||||
|
||||
if (flag > 63)
|
||||
{
|
||||
ConLog.Error("sys_event_flag_set_bit(id=%d, v=0x%x): flag > 63", data, v, flag);
|
||||
LOGF_ERROR(Log::SPU, "sys_event_flag_set_bit(id=%d, v=0x%x): flag > 63", data, v, flag);
|
||||
return;
|
||||
}
|
||||
|
||||
//if (Ini.HLELogging.GetValue())
|
||||
{
|
||||
ConLog.Warning("sys_event_flag_set_bit(id=%d, v=0x%x (flag=%d))", data, v, flag);
|
||||
LOGF_WARNING(Log::SPU, "sys_event_flag_set_bit(id=%d, v=0x%x (flag=%d))", data, v, flag);
|
||||
}
|
||||
|
||||
EventFlag* ef;
|
||||
if (!Emu.GetIdManager().GetIDData(data, ef))
|
||||
{
|
||||
ConLog.Error("sys_event_flag_set_bit(id=%d, v=0x%x (flag=%d)): EventFlag not found", data, v, flag);
|
||||
LOGF_ERROR(Log::SPU, "sys_event_flag_set_bit(id=%d, v=0x%x (flag=%d)): EventFlag not found", data, v, flag);
|
||||
SPU.In_MBox.PushUncond(CELL_ESRCH);
|
||||
return;
|
||||
}
|
||||
@ -1110,11 +1110,11 @@ public:
|
||||
u32 data;
|
||||
if (SPU.Out_MBox.Pop(data))
|
||||
{
|
||||
ConLog.Error("SPU_WrOutIntrMbox: unknown data (v=0x%x); Out_MBox = 0x%x", v, data);
|
||||
LOGF_ERROR(Log::SPU, "SPU_WrOutIntrMbox: unknown data (v=0x%x); Out_MBox = 0x%x", v, data);
|
||||
}
|
||||
else
|
||||
{
|
||||
ConLog.Error("SPU_WrOutIntrMbox: unknown data (v=0x%x)", v);
|
||||
LOGF_ERROR(Log::SPU, "SPU_WrOutIntrMbox: unknown data (v=0x%x)", v);
|
||||
}
|
||||
SPU.In_MBox.PushUncond(CELL_EINVAL); // ???
|
||||
return;
|
||||
@ -1166,13 +1166,13 @@ public:
|
||||
{
|
||||
if (v >= 32)
|
||||
{
|
||||
ConLog.Error("MFC_WrListStallAck error: invalid tag(%d)", v);
|
||||
LOGF_ERROR(Log::SPU, "MFC_WrListStallAck error: invalid tag(%d)", v);
|
||||
return;
|
||||
}
|
||||
StalledList temp = StallList[v];
|
||||
if (!temp.MFCArgs)
|
||||
{
|
||||
ConLog.Error("MFC_WrListStallAck error: empty tag(%d)", v);
|
||||
LOGF_ERROR(Log::SPU, "MFC_WrListStallAck error: empty tag(%d)", v);
|
||||
return;
|
||||
}
|
||||
StallList[v].MFCArgs = nullptr;
|
||||
@ -1181,11 +1181,11 @@ public:
|
||||
break;
|
||||
|
||||
default:
|
||||
ConLog.Error("%s error: unknown/illegal channel (%d [%s]).", __FUNCTION__, ch, spu_ch_name[ch]);
|
||||
LOGF_ERROR(Log::SPU, "%s error: unknown/illegal channel (%d [%s]).", __FUNCTION__, ch, spu_ch_name[ch]);
|
||||
break;
|
||||
}
|
||||
|
||||
if (Emu.IsStopped()) ConLog.Warning("%s(%s) aborted", __FUNCTION__, spu_ch_name[ch]);
|
||||
if (Emu.IsStopped()) LOGF_WARNING(Log::SPU, "%s(%s) aborted", __FUNCTION__, spu_ch_name[ch]);
|
||||
}
|
||||
|
||||
void ReadChannel(SPU_GPR_hdr& r, u32 ch)
|
||||
@ -1224,11 +1224,11 @@ public:
|
||||
break;
|
||||
|
||||
default:
|
||||
ConLog.Error("%s error: unknown/illegal channel (%d [%s]).", __FUNCTION__, ch, spu_ch_name[ch]);
|
||||
LOGF_ERROR(Log::SPU, "%s error: unknown/illegal channel (%d [%s]).", __FUNCTION__, ch, spu_ch_name[ch]);
|
||||
break;
|
||||
}
|
||||
|
||||
if (Emu.IsStopped()) ConLog.Warning("%s(%s) aborted", __FUNCTION__, spu_ch_name[ch]);
|
||||
if (Emu.IsStopped()) LOGF_WARNING(Log::SPU, "%s(%s) aborted", __FUNCTION__, spu_ch_name[ch]);
|
||||
}
|
||||
|
||||
void DoStop(u32 code)
|
||||
@ -1242,21 +1242,21 @@ public:
|
||||
u32 spuq = 0;
|
||||
if (!SPU.Out_MBox.Pop(spuq))
|
||||
{
|
||||
ConLog.Error("sys_spu_thread_receive_event: cannot read Out_MBox");
|
||||
LOG_ERROR(Log::SPU, "sys_spu_thread_receive_event: cannot read Out_MBox");
|
||||
SPU.In_MBox.PushUncond(CELL_EINVAL); // ???
|
||||
return;
|
||||
}
|
||||
|
||||
if (SPU.In_MBox.GetCount())
|
||||
{
|
||||
ConLog.Error("sys_spu_thread_receive_event(spuq=0x%x): In_MBox is not empty", spuq);
|
||||
LOGF_ERROR(Log::SPU, "sys_spu_thread_receive_event(spuq=0x%x): In_MBox is not empty", spuq);
|
||||
SPU.In_MBox.PushUncond(CELL_EBUSY); // ???
|
||||
return;
|
||||
}
|
||||
|
||||
if (Ini.HLELogging.GetValue())
|
||||
{
|
||||
ConLog.Write("sys_spu_thread_receive_event(spuq=0x%x)", spuq);
|
||||
LOGF_NOTICE(Log::SPU, "sys_spu_thread_receive_event(spuq=0x%x)", spuq);
|
||||
}
|
||||
|
||||
EventQueue* eq;
|
||||
@ -1307,7 +1307,7 @@ public:
|
||||
Sleep(1);
|
||||
if (Emu.IsStopped())
|
||||
{
|
||||
ConLog.Warning("sys_spu_thread_receive_event(spuq=0x%x) aborted", spuq);
|
||||
LOGF_WARNING(Log::SPU, "sys_spu_thread_receive_event(spuq=0x%x) aborted", spuq);
|
||||
eq->sq.invalidate(tid);
|
||||
return;
|
||||
}
|
||||
@ -1317,12 +1317,12 @@ public:
|
||||
case 0x102:
|
||||
if (!SPU.Out_MBox.GetCount())
|
||||
{
|
||||
ConLog.Error("sys_spu_thread_exit (no status, code 0x102)");
|
||||
LOG_ERROR(Log::SPU, "sys_spu_thread_exit (no status, code 0x102)");
|
||||
}
|
||||
else if (Ini.HLELogging.GetValue())
|
||||
{
|
||||
// the real exit status
|
||||
ConLog.Write("sys_spu_thread_exit (status=0x%x)", SPU.Out_MBox.GetValue());
|
||||
LOGF_NOTICE(Log::SPU, "sys_spu_thread_exit (status=0x%x)", SPU.Out_MBox.GetValue());
|
||||
}
|
||||
SPU.Status.SetValue(SPU_STATUS_STOPPED_BY_STOP);
|
||||
Stop();
|
||||
@ -1330,11 +1330,11 @@ public:
|
||||
default:
|
||||
if (!SPU.Out_MBox.GetCount())
|
||||
{
|
||||
ConLog.Error("Unknown STOP code: 0x%x (no message)", code);
|
||||
LOGF_ERROR(Log::SPU, "Unknown STOP code: 0x%x (no message)", code);
|
||||
}
|
||||
else
|
||||
{
|
||||
ConLog.Error("Unknown STOP code: 0x%x (message=0x%x)", code, SPU.Out_MBox.GetValue());
|
||||
LOGF_ERROR(Log::SPU, "Unknown STOP code: 0x%x (message=0x%x)", code, SPU.Out_MBox.GetValue());
|
||||
}
|
||||
SPU.Status.SetValue(SPU_STATUS_STOPPED_BY_STOP);
|
||||
Stop();
|
||||
|
@ -1,44 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
class LogWriter
|
||||
{
|
||||
rFile m_logfile;
|
||||
|
||||
void WriteToLog(const std::string& prefix, const std::string& value, u8 lvl);
|
||||
|
||||
public:
|
||||
LogWriter();
|
||||
|
||||
template <typename ...Arg>
|
||||
void Write(const std::string &fmt, Arg... args)
|
||||
{
|
||||
std::string frmt = fmt::Format(fmt, std::forward<Arg>(args)...);
|
||||
WriteToLog("!", frmt, 2);
|
||||
}
|
||||
|
||||
template <typename ...Arg>
|
||||
void Error(const std::string &fmt, Arg... args)
|
||||
{
|
||||
std::string frmt = fmt::Format(fmt, std::forward<Arg>(args)...);
|
||||
WriteToLog("E", frmt, 4);
|
||||
}
|
||||
|
||||
template <typename ...Arg>
|
||||
void Warning(const std::string &fmt, Arg... args)
|
||||
{
|
||||
std::string frmt = fmt::Format(fmt, std::forward<Arg>(args)...);
|
||||
WriteToLog("W", frmt, 3);
|
||||
}
|
||||
|
||||
template <typename ...Arg>
|
||||
void Success(const std::string &fmt, Arg... args)
|
||||
{
|
||||
std::string frmt = fmt::Format(fmt, std::forward<Arg>(args)...);
|
||||
WriteToLog("S", frmt, 1);
|
||||
}
|
||||
|
||||
virtual void SkipLn();
|
||||
};
|
||||
|
||||
|
||||
extern LogWriter ConLog;
|
@ -1,97 +0,0 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "DbgConsole.h"
|
||||
|
||||
BEGIN_EVENT_TABLE(DbgConsole, FrameBase)
|
||||
EVT_CLOSE(DbgConsole::OnQuit)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
DbgConsole::DbgConsole()
|
||||
: FrameBase(nullptr, wxID_ANY, "Debug Console", "", wxDefaultSize, wxDefaultPosition, wxDEFAULT_FRAME_STYLE, true)
|
||||
, ThreadBase("DbgConsole thread")
|
||||
, m_output(nullptr)
|
||||
{
|
||||
m_console = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition,
|
||||
wxSize(500, 500), wxTE_MULTILINE | wxTE_READONLY | wxTE_RICH2);
|
||||
m_console->SetBackgroundColour(wxColor("Black"));
|
||||
m_console->SetFont(wxFont(8, wxFONTFAMILY_MODERN, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL));
|
||||
|
||||
m_color_white = new wxTextAttr(wxColour(255, 255, 255));
|
||||
m_color_red = new wxTextAttr(wxColour(255, 0, 0));
|
||||
|
||||
if (Ini.HLESaveTTY.GetValue())
|
||||
m_output = new wxFile("tty.log", wxFile::write);
|
||||
}
|
||||
|
||||
DbgConsole::~DbgConsole()
|
||||
{
|
||||
ThreadBase::Stop();
|
||||
m_dbg_buffer.Flush();
|
||||
|
||||
safe_delete(m_console);
|
||||
safe_delete(m_color_white);
|
||||
safe_delete(m_color_red);
|
||||
safe_delete(m_output);
|
||||
}
|
||||
|
||||
void DbgConsole::Write(int ch, const std::string& text)
|
||||
{
|
||||
while (m_dbg_buffer.IsBusy())
|
||||
{
|
||||
if (Emu.IsStopped())
|
||||
{
|
||||
return;
|
||||
}
|
||||
Sleep(1);
|
||||
}
|
||||
m_dbg_buffer.Push(DbgPacket(ch, text));
|
||||
|
||||
if (!IsAlive()) Start();
|
||||
}
|
||||
|
||||
void DbgConsole::Clear()
|
||||
{
|
||||
m_console->Clear();
|
||||
}
|
||||
|
||||
void DbgConsole::Task()
|
||||
{
|
||||
while (!TestDestroy())
|
||||
{
|
||||
if (!m_dbg_buffer.HasNewPacket())
|
||||
{
|
||||
if (Emu.IsStopped())
|
||||
{
|
||||
break;
|
||||
}
|
||||
Sleep(1);
|
||||
continue;
|
||||
}
|
||||
|
||||
DbgPacket packet = m_dbg_buffer.Pop();
|
||||
m_console->SetDefaultStyle(packet.m_ch == 1 ? *m_color_red : *m_color_white);
|
||||
m_console->SetInsertionPointEnd();
|
||||
m_console->WriteText(fmt::FromUTF8(packet.m_text));
|
||||
|
||||
if (m_output && Ini.HLESaveTTY.GetValue())
|
||||
m_output->Write(fmt::FromUTF8(packet.m_text));
|
||||
|
||||
if (!DbgConsole::IsShown()) Show();
|
||||
}
|
||||
}
|
||||
|
||||
void DbgConsole::OnQuit(wxCloseEvent& event)
|
||||
{
|
||||
ThreadBase::Stop(false);
|
||||
Hide();
|
||||
|
||||
if (m_output)
|
||||
{
|
||||
m_output->Close();
|
||||
m_output = nullptr;
|
||||
}
|
||||
|
||||
//event.Skip();
|
||||
}
|
@ -1,93 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstring> //for memset
|
||||
|
||||
struct DbgPacket
|
||||
{
|
||||
int m_ch;
|
||||
std::string m_text;
|
||||
|
||||
DbgPacket(int ch, const std::string& text)
|
||||
: m_ch(ch)
|
||||
, m_text(text)
|
||||
{
|
||||
}
|
||||
|
||||
DbgPacket()
|
||||
{
|
||||
}
|
||||
|
||||
void Clear()
|
||||
{
|
||||
m_text.clear();
|
||||
}
|
||||
};
|
||||
|
||||
struct _DbgBuffer : public MTPacketBuffer<DbgPacket>
|
||||
{
|
||||
_DbgBuffer() : MTPacketBuffer<DbgPacket>(1024)
|
||||
{
|
||||
}
|
||||
|
||||
void _push(const DbgPacket& data)
|
||||
{
|
||||
const u32 stext = data.m_text.length();
|
||||
|
||||
m_buffer.resize(m_buffer.size() + sizeof(int) + sizeof(u32) + stext);
|
||||
|
||||
u32 c_put = m_put;
|
||||
|
||||
memcpy(&m_buffer[c_put], &data.m_ch, sizeof(int));
|
||||
c_put += sizeof(int);
|
||||
|
||||
memcpy(&m_buffer[c_put], &stext, sizeof(u32));
|
||||
c_put += sizeof(u32);
|
||||
memcpy(&m_buffer[c_put], data.m_text.data(), stext);
|
||||
c_put += stext;
|
||||
|
||||
m_put = c_put;
|
||||
CheckBusy();
|
||||
}
|
||||
|
||||
DbgPacket _pop()
|
||||
{
|
||||
DbgPacket ret;
|
||||
|
||||
u32 c_get = m_get;
|
||||
|
||||
ret.m_ch = *(int*)&m_buffer[c_get];
|
||||
c_get += sizeof(int);
|
||||
|
||||
const u32& stext = *(u32*)&m_buffer[c_get];
|
||||
c_get += sizeof(u32);
|
||||
if (stext) ret.m_text = std::string(reinterpret_cast<const char*>(&m_buffer[c_get]), stext);
|
||||
c_get += stext;
|
||||
|
||||
m_get = c_get;
|
||||
if (!HasNewPacket()) Flush();
|
||||
|
||||
return ret;
|
||||
}
|
||||
};
|
||||
|
||||
class DbgConsole
|
||||
: public FrameBase
|
||||
, public ThreadBase
|
||||
{
|
||||
wxFile* m_output;
|
||||
wxTextCtrl* m_console;
|
||||
wxTextAttr* m_color_white;
|
||||
wxTextAttr* m_color_red;
|
||||
_DbgBuffer m_dbg_buffer;
|
||||
|
||||
public:
|
||||
DbgConsole();
|
||||
~DbgConsole();
|
||||
void Write(int ch, const std::string& text);
|
||||
void Clear();
|
||||
virtual void Task();
|
||||
|
||||
private:
|
||||
void OnQuit(wxCloseEvent& event);
|
||||
DECLARE_EVENT_TABLE();
|
||||
};
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "event.h"
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
|
||||
#include "VFS.h"
|
||||
#include "Emu/HDD/HDD.h"
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "vfsLocalFile.h"
|
||||
|
||||
static const rFile::OpenMode vfs2wx_mode(vfsOpenMode mode)
|
||||
@ -53,7 +53,7 @@ bool vfsLocalFile::Open(const std::string& path, vfsOpenMode mode)
|
||||
|
||||
bool vfsLocalFile::Create(const std::string& path)
|
||||
{
|
||||
ConLog.Warning("vfsLocalFile::Create('%s')", path.c_str());
|
||||
LOGF_WARNING(HLE, "vfsLocalFile::Create('%s')", path.c_str());
|
||||
for(uint p=1; p < path.length() && path[p] != '\0' ; p++)
|
||||
{
|
||||
for(; p < path.length() && path[p] != '\0'; p++)
|
||||
@ -65,7 +65,7 @@ bool vfsLocalFile::Create(const std::string& path)
|
||||
const std::string& dir = path.substr(0, p);
|
||||
if(!rDirExists(dir))
|
||||
{
|
||||
ConLog.Write("create dir: %s", dir.c_str());
|
||||
LOGF_NOTICE(HLE, "create dir: %s", dir.c_str());
|
||||
rMkdir(dir);
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "vfsStreamMemory.h"
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "GLBuffers.h"
|
||||
#include "GLGSRender.h"
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "GLFragmentProgram.h"
|
||||
@ -19,7 +19,7 @@ void GLFragmentDecompilerThread::SetDst(std::string code, bool append_mask)
|
||||
case 7: code = "(" + code + " / 8.0)"; break;
|
||||
|
||||
default:
|
||||
ConLog.Error("Bad scale: %d", fmt::by_value(src1.scale));
|
||||
LOGF_ERROR(RSX, "Bad scale: %d", fmt::by_value(src1.scale));
|
||||
Emu.Pause();
|
||||
break;
|
||||
}
|
||||
@ -210,7 +210,7 @@ template<typename T> std::string GLFragmentDecompilerThread::GetSRC(T src)
|
||||
}
|
||||
else
|
||||
{
|
||||
ConLog.Error("Bad src reg num: %d", fmt::by_value(dst.src_attr_reg_num));
|
||||
LOGF_ERROR(RSX, "Bad src reg num: %d", fmt::by_value(dst.src_attr_reg_num));
|
||||
ret += m_parr.AddParam(PARAM_IN, "vec4", "unk");
|
||||
Emu.Pause();
|
||||
}
|
||||
@ -224,7 +224,7 @@ template<typename T> std::string GLFragmentDecompilerThread::GetSRC(T src)
|
||||
break;
|
||||
|
||||
default:
|
||||
ConLog.Error("Bad src type %d", fmt::by_value(src.reg_type));
|
||||
LOGF_ERROR(RSX, "Bad src type %d", fmt::by_value(src.reg_type));
|
||||
Emu.Pause();
|
||||
break;
|
||||
}
|
||||
@ -416,7 +416,7 @@ void GLFragmentDecompilerThread::Task()
|
||||
//case 0x45: SetDst("return"); break; //RET
|
||||
|
||||
default:
|
||||
ConLog.Error("Unknown fp opcode 0x%x (inst %d)", opcode, m_size / (4 * 4));
|
||||
LOGF_ERROR(RSX, "Unknown fp opcode 0x%x (inst %d)", opcode, m_size / (4 * 4));
|
||||
//Emu.Pause();
|
||||
break;
|
||||
}
|
||||
@ -515,12 +515,12 @@ void GLShaderProgram::Compile()
|
||||
char* buf = new char[infoLength]; // Buffer to store infoLog
|
||||
|
||||
glGetShaderInfoLog(m_id, infoLength, &len, buf); // Retrieve the shader info log into our buffer
|
||||
ConLog.Error("Failed to compile shader: %s", buf); // Write log to the console
|
||||
LOGF_ERROR(RSX, "Failed to compile shader: %s", buf); // Write log to the console
|
||||
|
||||
delete[] buf;
|
||||
}
|
||||
|
||||
ConLog.Write(m_shader.c_str()); // Log the text of the shader that failed to compile
|
||||
LOG_NOTICE(RSX, m_shader.c_str()); // Log the text of the shader that failed to compile
|
||||
Emu.Pause(); // Pause the emulator, we can't really continue from here
|
||||
}
|
||||
}
|
||||
@ -540,7 +540,7 @@ void GLShaderProgram::Delete()
|
||||
{
|
||||
if (Emu.IsStopped())
|
||||
{
|
||||
ConLog.Warning("GLShaderProgram::Delete(): glDeleteShader(%d) avoided", m_id);
|
||||
LOGF_WARNING(RSX, "GLShaderProgram::Delete(): glDeleteShader(%d) avoided", m_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "GLGSRender.h"
|
||||
@ -9,7 +9,7 @@
|
||||
#define DUMP_VERTEX_DATA 0
|
||||
|
||||
#if CMD_DEBUG
|
||||
#define CMD_LOG ConLog.Write
|
||||
#define CMD_LOG(...) LOGF_NOTICE(RSX, __VA_ARGS__)
|
||||
#else
|
||||
#define CMD_LOG(...)
|
||||
#endif
|
||||
@ -27,7 +27,7 @@ void printGlError(GLenum err, const char* situation)
|
||||
{
|
||||
if(err != GL_NO_ERROR)
|
||||
{
|
||||
ConLog.Error("%s: opengl error 0x%04x", situation, err);
|
||||
LOGF_ERROR(RSX, "%s: opengl error 0x%04x", situation, err);
|
||||
Emu.Pause();
|
||||
}
|
||||
}
|
||||
@ -180,7 +180,7 @@ void GLGSRender::EnableVertexData(bool indexed_draw)
|
||||
break;
|
||||
|
||||
default:
|
||||
ConLog.Error("Bad cv type! %d", m_vertex_data[i].type);
|
||||
LOGF_ERROR(HLE, "Bad cv type! %d", m_vertex_data[i].type);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -309,7 +309,7 @@ void GLGSRender::InitFragmentData()
|
||||
{
|
||||
if(!m_cur_shader_prog)
|
||||
{
|
||||
ConLog.Error("InitFragmentData: m_cur_shader_prog == NULL");
|
||||
LOGF_ERROR(RSX, "InitFragmentData: m_cur_shader_prog == NULL");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -330,20 +330,20 @@ void GLGSRender::InitFragmentData()
|
||||
}
|
||||
|
||||
//if(m_fragment_constants.GetCount())
|
||||
// ConLog.SkipLn();
|
||||
// LOG_NOTICE(HLE, "");
|
||||
}
|
||||
|
||||
bool GLGSRender::LoadProgram()
|
||||
{
|
||||
if(!m_cur_shader_prog)
|
||||
{
|
||||
ConLog.Warning("LoadProgram: m_cur_shader_prog == NULL");
|
||||
LOGF_WARNING(RSX, "LoadProgram: m_cur_shader_prog == NULL");
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!m_cur_vertex_prog)
|
||||
{
|
||||
ConLog.Warning("LoadProgram: m_cur_vertex_prog == NULL");
|
||||
LOGF_WARNING(RSX, "LoadProgram: m_cur_vertex_prog == NULL");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -354,7 +354,7 @@ bool GLGSRender::LoadProgram()
|
||||
|
||||
if(m_fp_buf_num == -1)
|
||||
{
|
||||
ConLog.Warning("FP not found in buffer!");
|
||||
LOGF_WARNING(RSX, "FP not found in buffer!");
|
||||
m_shader_prog.DecompileAsync(*m_cur_shader_prog);
|
||||
m_shader_prog.Wait();
|
||||
m_shader_prog.Compile();
|
||||
@ -366,7 +366,7 @@ bool GLGSRender::LoadProgram()
|
||||
|
||||
if(m_vp_buf_num == -1)
|
||||
{
|
||||
ConLog.Warning("VP not found in buffer!");
|
||||
LOGF_WARNING(RSX, "VP not found in buffer!");
|
||||
m_vertex_prog.DecompileAsync(*m_cur_vertex_prog);
|
||||
m_vertex_prog.Wait();
|
||||
m_vertex_prog.Compile();
|
||||
@ -450,7 +450,7 @@ void GLGSRender::WriteDepthBuffer()
|
||||
u32 address = GetAddress(m_surface_offset_z, m_context_dma_z - 0xfeed0000);
|
||||
if (!Memory.IsGoodAddr(address))
|
||||
{
|
||||
ConLog.Warning("Bad depth address: address=0x%x, offset=0x%x, dma=0x%x", address, m_surface_offset_z, m_context_dma_z);
|
||||
LOGF_WARNING(RSX, "Bad depth address: address=0x%x, offset=0x%x, dma=0x%x", address, m_surface_offset_z, m_context_dma_z);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -484,7 +484,7 @@ void GLGSRender::WriteColourBufferA()
|
||||
u32 address = GetAddress(m_surface_offset_a, m_context_dma_color_a - 0xfeed0000);
|
||||
if (!Memory.IsGoodAddr(address))
|
||||
{
|
||||
ConLog.Warning("Bad colour buffer a address: address=0x%x, offset=0x%x, dma=0x%x", address, m_surface_offset_a, m_context_dma_color_a);
|
||||
LOGF_WARNING(RSX, "Bad colour buffer a address: address=0x%x, offset=0x%x, dma=0x%x", address, m_surface_offset_a, m_context_dma_color_a);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -513,7 +513,7 @@ void GLGSRender::WriteColourBufferB()
|
||||
u32 address = GetAddress(m_surface_offset_b, m_context_dma_color_b - 0xfeed0000);
|
||||
if (!Memory.IsGoodAddr(address))
|
||||
{
|
||||
ConLog.Warning("Bad colour buffer b address: address=0x%x, offset=0x%x, dma=0x%x", address, m_surface_offset_b, m_context_dma_color_b);
|
||||
LOGF_WARNING(RSX, "Bad colour buffer b address: address=0x%x, offset=0x%x, dma=0x%x", address, m_surface_offset_b, m_context_dma_color_b);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -543,7 +543,7 @@ void GLGSRender::WriteColourBufferC()
|
||||
u32 address = GetAddress(m_surface_offset_c, m_context_dma_color_c - 0xfeed0000);
|
||||
if (!Memory.IsGoodAddr(address))
|
||||
{
|
||||
ConLog.Warning("Bad colour buffer c address: address=0x%x, offset=0x%x, dma=0x%x", address, m_surface_offset_c, m_context_dma_color_c);
|
||||
LOGF_WARNING(RSX, "Bad colour buffer c address: address=0x%x, offset=0x%x, dma=0x%x", address, m_surface_offset_c, m_context_dma_color_c);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -572,7 +572,7 @@ void GLGSRender::WriteColourBufferD()
|
||||
u32 address = GetAddress(m_surface_offset_d, m_context_dma_color_d - 0xfeed0000);
|
||||
if (!Memory.IsGoodAddr(address))
|
||||
{
|
||||
ConLog.Warning("Bad colour buffer d address: address=0x%x, offset=0x%x, dma=0x%x", address, m_surface_offset_d, m_context_dma_color_d);
|
||||
LOGF_WARNING(RSX, "Bad colour buffer d address: address=0x%x, offset=0x%x, dma=0x%x", address, m_surface_offset_d, m_context_dma_color_d);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -703,14 +703,14 @@ void GLGSRender::ExecCMD()
|
||||
//return;
|
||||
if(!LoadProgram())
|
||||
{
|
||||
ConLog.Error("LoadProgram failed.");
|
||||
LOGF_ERROR(RSX, "LoadProgram failed.");
|
||||
Emu.Pause();
|
||||
return;
|
||||
}
|
||||
|
||||
if(!m_fbo.IsCreated() || RSXThread::m_width != last_width || RSXThread::m_height != last_height || last_depth_format != m_surface_depth_format)
|
||||
{
|
||||
ConLog.Warning("New FBO (%dx%d)", RSXThread::m_width, RSXThread::m_height);
|
||||
LOGF_WARNING(RSX, "New FBO (%dx%d)", RSXThread::m_width, RSXThread::m_height);
|
||||
last_width = RSXThread::m_width;
|
||||
last_height = RSXThread::m_height;
|
||||
last_depth_format = m_surface_depth_format;
|
||||
@ -753,7 +753,7 @@ void GLGSRender::ExecCMD()
|
||||
break;
|
||||
|
||||
default:
|
||||
ConLog.Error("Bad depth format! (%d)", m_surface_depth_format);
|
||||
LOGF_ERROR(RSX, "Bad depth format! (%d)", m_surface_depth_format);
|
||||
assert(0);
|
||||
break;
|
||||
}
|
||||
@ -821,7 +821,7 @@ void GLGSRender::ExecCMD()
|
||||
break;
|
||||
|
||||
default:
|
||||
ConLog.Error("Bad surface colour target: %d", m_surface_colour_target);
|
||||
LOGF_ERROR(RSX, "Bad surface colour target: %d", m_surface_colour_target);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -1099,7 +1099,7 @@ void GLGSRender::ExecCMD()
|
||||
|
||||
if(m_indexed_array.m_count && m_draw_array_count)
|
||||
{
|
||||
ConLog.Warning("m_indexed_array.m_count && draw_array_count");
|
||||
LOGF_WARNING(RSX, "m_indexed_array.m_count && draw_array_count");
|
||||
}
|
||||
|
||||
for(u32 i=0; i<m_textures_count; ++i)
|
||||
@ -1142,7 +1142,7 @@ void GLGSRender::ExecCMD()
|
||||
break;
|
||||
|
||||
default:
|
||||
ConLog.Error("Bad indexed array type (%d)", m_indexed_array.m_type);
|
||||
LOGF_ERROR(RSX, "Bad indexed array type (%d)", m_indexed_array.m_type);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -57,7 +57,7 @@ public:
|
||||
case 8: return GL_MIRROR_CLAMP_EXT;
|
||||
}
|
||||
|
||||
ConLog.Error("Texture wrap error: bad wrap (%d).", wrap);
|
||||
LOGF_ERROR(RSX, "Texture wrap error: bad wrap (%d).", wrap);
|
||||
return GL_REPEAT;
|
||||
}
|
||||
|
||||
@ -89,7 +89,7 @@ public:
|
||||
const u64 texaddr = GetAddress(tex.GetOffset(), tex.GetLocation());
|
||||
if (!Memory.IsGoodAddr(texaddr))
|
||||
{
|
||||
ConLog.Error("Bad texture address=0x%x", texaddr);
|
||||
LOGF_ERROR(RSX, "Bad texture address=0x%x", texaddr);
|
||||
return;
|
||||
}
|
||||
//ConLog.Warning("texture addr = 0x%x, width = %d, height = %d, max_aniso=%d, mipmap=%d, remap=0x%x, zfunc=0x%x, wraps=0x%x, wrapt=0x%x, wrapr=0x%x, minlod=0x%x, maxlod=0x%x",
|
||||
@ -420,7 +420,7 @@ public:
|
||||
}
|
||||
break;
|
||||
|
||||
default: ConLog.Error("Init tex error: Bad tex format (0x%x | %s | 0x%x)", format,
|
||||
default: LOGF_ERROR(RSX, "Init tex error: Bad tex format (0x%x | %s | 0x%x)", format,
|
||||
(is_swizzled ? "swizzled" : "linear"), tex.GetFormat() & 0x40); break;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "GLProgram.h"
|
||||
#include "GLGSRender.h"
|
||||
@ -54,13 +54,13 @@ void GLProgram::Create(const u32 vp, const u32 fp)
|
||||
char* buf = new char[bufLength+1];
|
||||
memset(buf, 0, bufLength+1);
|
||||
glGetProgramInfoLog(id, bufLength, NULL, buf);
|
||||
ConLog.Error("Could not link program: %s", buf);
|
||||
LOGF_ERROR(RSX, "Could not link program: %s", buf);
|
||||
delete[] buf;
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
//else ConLog.Write("program linked!");
|
||||
//else LOGF_NOTICE(HLE, "program linked!");
|
||||
|
||||
glGetProgramiv(id, GL_VALIDATE_STATUS, &linkStatus);
|
||||
if(linkStatus != GL_TRUE)
|
||||
@ -73,7 +73,7 @@ void GLProgram::Create(const u32 vp, const u32 fp)
|
||||
char* buf = new char[bufLength];
|
||||
memset(buf, 0, bufLength);
|
||||
glGetProgramInfoLog(id, bufLength, NULL, buf);
|
||||
ConLog.Error("Could not link program: %s", buf);
|
||||
LOGF_ERROR(RSX, "Could not link program: %s", buf);
|
||||
delete[] buf;
|
||||
|
||||
return;
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
|
||||
#include "GLProgramBuffer.h"
|
||||
@ -52,13 +52,13 @@ u32 GLProgramBuffer::GetProg(u32 fp, u32 vp) const
|
||||
if(fp == vp)
|
||||
{
|
||||
/*
|
||||
ConLog.Write("Get program (%d):", fp);
|
||||
ConLog.Write("*** prog id = %d", m_buf[fp].prog_id);
|
||||
ConLog.Write("*** vp id = %d", m_buf[fp].vp_id);
|
||||
ConLog.Write("*** fp id = %d", m_buf[fp].fp_id);
|
||||
LOGF_NOTICE(RSX, "Get program (%d):", fp);
|
||||
LOGF_NOTICE(RSX, "*** prog id = %d", m_buf[fp].prog_id);
|
||||
LOGF_NOTICE(RSX, "*** vp id = %d", m_buf[fp].vp_id);
|
||||
LOGF_NOTICE(RSX, "*** fp id = %d", m_buf[fp].fp_id);
|
||||
|
||||
ConLog.Write("*** vp shader = \n%s", m_buf[fp].vp_shader.wx_str());
|
||||
ConLog.Write("*** fp shader = \n%s", m_buf[fp].fp_shader.wx_str());
|
||||
LOGF_NOTICE(RSX, "*** vp shader = \n%s", m_buf[fp].vp_shader.wx_str());
|
||||
LOGF_NOTICE(RSX, "*** fp shader = \n%s", m_buf[fp].fp_shader.wx_str());
|
||||
*/
|
||||
return m_buf[fp].prog_id;
|
||||
}
|
||||
@ -70,13 +70,13 @@ u32 GLProgramBuffer::GetProg(u32 fp, u32 vp) const
|
||||
if(CmpVP(vp, i) && CmpFP(fp, i))
|
||||
{
|
||||
/*
|
||||
ConLog.Write("Get program (%d):", i);
|
||||
ConLog.Write("*** prog id = %d", m_buf[i].prog_id);
|
||||
ConLog.Write("*** vp id = %d", m_buf[i].vp_id);
|
||||
ConLog.Write("*** fp id = %d", m_buf[i].fp_id);
|
||||
LOGF_NOTICE(RSX, "Get program (%d):", i);
|
||||
LOGF_NOTICE(RSX, "*** prog id = %d", m_buf[i].prog_id);
|
||||
LOGF_NOTICE(RSX, "*** vp id = %d", m_buf[i].vp_id);
|
||||
LOGF_NOTICE(RSX, "*** fp id = %d", m_buf[i].fp_id);
|
||||
|
||||
ConLog.Write("*** vp shader = \n%s", m_buf[i].vp_shader.wx_str());
|
||||
ConLog.Write("*** fp shader = \n%s", m_buf[i].fp_shader.wx_str());
|
||||
LOGF_NOTICE(RSX, "*** vp shader = \n%s", m_buf[i].vp_shader.wx_str());
|
||||
LOGF_NOTICE(RSX, "*** fp shader = \n%s", m_buf[i].fp_shader.wx_str());
|
||||
*/
|
||||
return m_buf[i].prog_id;
|
||||
}
|
||||
@ -89,15 +89,15 @@ void GLProgramBuffer::Add(GLProgram& prog, GLShaderProgram& gl_fp, RSXShaderProg
|
||||
{
|
||||
GLBufferInfo new_buf;
|
||||
|
||||
ConLog.Write("Add program (%d):", m_buf.size());
|
||||
ConLog.Write("*** prog id = %d", prog.id);
|
||||
ConLog.Write("*** vp id = %d", gl_vp.id);
|
||||
ConLog.Write("*** fp id = %d", gl_fp.GetId());
|
||||
ConLog.Write("*** vp data size = %d", rsx_vp.data.size() * 4);
|
||||
ConLog.Write("*** fp data size = %d", rsx_fp.size);
|
||||
LOGF_NOTICE(RSX, "Add program (%d):", m_buf.size());
|
||||
LOGF_NOTICE(RSX, "*** prog id = %d", prog.id);
|
||||
LOGF_NOTICE(RSX, "*** vp id = %d", gl_vp.id);
|
||||
LOGF_NOTICE(RSX, "*** fp id = %d", gl_fp.GetId());
|
||||
LOGF_NOTICE(RSX, "*** vp data size = %d", rsx_vp.data.size() * 4);
|
||||
LOGF_NOTICE(RSX, "*** fp data size = %d", rsx_fp.size);
|
||||
|
||||
ConLog.Write("*** vp shader = \n%s", gl_vp.shader.c_str());
|
||||
ConLog.Write("*** fp shader = \n%s", gl_fp.GetShaderText().c_str());
|
||||
LOGF_NOTICE(RSX, "*** vp shader = \n%s", gl_vp.shader.c_str());
|
||||
LOGF_NOTICE(RSX, "*** fp shader = \n%s", gl_fp.GetShaderText().c_str());
|
||||
|
||||
|
||||
new_buf.prog_id = prog.id;
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
|
||||
@ -49,7 +49,7 @@ std::string GLVertexDecompilerThread::GetDST(bool isSca)
|
||||
|
||||
default:
|
||||
if (d3.dst > 15)
|
||||
ConLog.Error("dst index out of range: %u", d3.dst);
|
||||
LOGF_ERROR(RSX, "dst index out of range: %u", d3.dst);
|
||||
ret += m_parr.AddParam(PARAM_NONE, "vec4", std::string("dst_reg") + std::to_string(d3.dst), d3.dst == 0 ? "vec4(0.0f, 0.0f, 0.0f, 1.0f)" : "vec4(0.0)");
|
||||
break;
|
||||
}
|
||||
@ -83,7 +83,7 @@ std::string GLVertexDecompilerThread::GetSRC(const u32 n)
|
||||
}
|
||||
else
|
||||
{
|
||||
ConLog.Error("Bad input src num: %d", fmt::by_value(d1.input_src));
|
||||
LOGF_ERROR(RSX, "Bad input src num: %d", fmt::by_value(d1.input_src));
|
||||
ret += m_parr.AddParam(PARAM_IN, "vec4", "in_unk", d1.input_src);
|
||||
}
|
||||
break;
|
||||
@ -93,7 +93,7 @@ std::string GLVertexDecompilerThread::GetSRC(const u32 n)
|
||||
break;
|
||||
|
||||
default:
|
||||
ConLog.Error("Bad src%u reg type: %d", n, fmt::by_value(src[n].reg_type));
|
||||
LOGF_ERROR(RSX, "Bad src%u reg type: %d", n, fmt::by_value(src[n].reg_type));
|
||||
Emu.Pause();
|
||||
break;
|
||||
}
|
||||
@ -510,7 +510,7 @@ void GLVertexDecompilerThread::Task()
|
||||
|
||||
default:
|
||||
m_body.push_back(fmt::Format("//Unknown vp sca_opcode 0x%x", fmt::by_value(d1.sca_opcode)));
|
||||
ConLog.Error("Unknown vp sca_opcode 0x%x", fmt::by_value(d1.sca_opcode));
|
||||
LOGF_ERROR(RSX, "Unknown vp sca_opcode 0x%x", fmt::by_value(d1.sca_opcode));
|
||||
Emu.Pause();
|
||||
break;
|
||||
}
|
||||
@ -543,7 +543,7 @@ void GLVertexDecompilerThread::Task()
|
||||
|
||||
default:
|
||||
m_body.push_back(fmt::Format("//Unknown vp opcode 0x%x", fmt::by_value(d1.vec_opcode)));
|
||||
ConLog.Error("Unknown vp opcode 0x%x", fmt::by_value(d1.vec_opcode));
|
||||
LOGF_ERROR(RSX, "Unknown vp opcode 0x%x", fmt::by_value(d1.vec_opcode));
|
||||
Emu.Pause();
|
||||
break;
|
||||
}
|
||||
@ -553,7 +553,7 @@ void GLVertexDecompilerThread::Task()
|
||||
m_instr_count++;
|
||||
|
||||
if(i < m_data.size())
|
||||
ConLog.Error("Program end before buffer end.");
|
||||
LOG_ERROR(RSX, "Program end before buffer end.");
|
||||
|
||||
break;
|
||||
}
|
||||
@ -647,14 +647,14 @@ void GLVertexProgram::Compile()
|
||||
GLsizei len;
|
||||
memset(buf, 0, r+1);
|
||||
glGetShaderInfoLog(id, r, &len, buf);
|
||||
ConLog.Error("Failed to compile vertex shader: %s", buf);
|
||||
LOGF_ERROR(RSX, "Failed to compile vertex shader: %s", buf);
|
||||
delete[] buf;
|
||||
}
|
||||
|
||||
ConLog.Write(shader);
|
||||
LOG_NOTICE(RSX, shader);
|
||||
Emu.Pause();
|
||||
}
|
||||
//else ConLog.Write("Vertex shader compiled successfully!");
|
||||
//else LOGF_WARNING(RSX, "Vertex shader compiled successfully!");
|
||||
|
||||
}
|
||||
|
||||
@ -667,7 +667,7 @@ void GLVertexProgram::Delete()
|
||||
{
|
||||
if (Emu.IsStopped())
|
||||
{
|
||||
ConLog.Warning("GLVertexProgram::Delete(): glDeleteShader(%d) avoided", id);
|
||||
LOGF_WARNING(RSX, "GLVertexProgram::Delete(): glDeleteShader(%d) avoided", id);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1,12 +1,12 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "OpenGL.h"
|
||||
|
||||
void InitProcTable()
|
||||
{
|
||||
#ifdef _WIN32
|
||||
#define OPENGL_PROC(p, n) OPENGL_PROC2(p, n, gl##n)
|
||||
#define OPENGL_PROC2(p, n, tn) /*if(!gl##n)*/ if(!(gl##n = (p)wglGetProcAddress(#tn))) ConLog.Error("OpenGL: initialization of " #tn " failed.")
|
||||
#define OPENGL_PROC2(p, n, tn) /*if(!gl##n)*/ if(!(gl##n = (p)wglGetProcAddress(#tn))) LOG_ERROR(RSX, "OpenGL: initialization of " #tn " failed.")
|
||||
#include "GLProcTable.h"
|
||||
#undef OPENGL_PROC
|
||||
#undef OPENGL_PROC2
|
||||
@ -40,7 +40,7 @@ void OpenGL::Init()
|
||||
{
|
||||
#ifdef _WIN32
|
||||
#define OPENGL_PROC(p, n) OPENGL_PROC2(p, n, gl##n)
|
||||
#define OPENGL_PROC2(p, n, tn) if(!(n = (p)wglGetProcAddress(#tn))) ConLog.Error("OpenGL: initialization of " #tn " failed.")
|
||||
#define OPENGL_PROC2(p, n, tn) if(!(n = (p)wglGetProcAddress(#tn))) LOG_ERROR(RSX, "OpenGL: initialization of " #tn " failed.")
|
||||
#include "GLProcTable.h"
|
||||
#undef OPENGL_PROC
|
||||
#undef OPENGL_PROC2
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "rpcs3/Ini.h"
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "RSXThread.h"
|
||||
#include "RSXThread.h"
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "RSXThread.h"
|
||||
@ -20,7 +20,7 @@ u32 GetAddress(u32 offset, u8 location)
|
||||
return realAddr;
|
||||
}
|
||||
|
||||
ConLog.Error("GetAddress(offset=0x%x, location=0x%x)", location);
|
||||
LOGF_ERROR(RSX, "GetAddress(offset=0x%x, location=0x%x)", location);
|
||||
assert(0);
|
||||
return 0;
|
||||
}
|
||||
@ -97,14 +97,14 @@ u32 RSXVertexData::GetTypeSize()
|
||||
case 7: return 1;
|
||||
}
|
||||
|
||||
ConLog.Error("Bad vertex data type! %d", type);
|
||||
LOGF_ERROR(RSX, "Bad vertex data type! %d", type);
|
||||
return 1;
|
||||
}
|
||||
|
||||
#define CMD_DEBUG 0
|
||||
|
||||
#if CMD_DEBUG
|
||||
#define CMD_LOG ConLog.Write
|
||||
#define CMD_LOG(...) LOG_NOTICE(RSX, __VA_ARGS__)
|
||||
#else
|
||||
#define CMD_LOG(...)
|
||||
#endif
|
||||
@ -115,7 +115,7 @@ u32 RSXThread::OutOfArgsCount(const uint x, const u32 cmd, const u32 count)
|
||||
debug += "(";
|
||||
for(u32 i=0; i<count; ++i) debug += (i ? ", " : "") + fmt::Format("0x%x", ARGS(i));
|
||||
debug += ")";
|
||||
ConLog.Write("OutOfArgsCount(x=%u, count=%u): " + debug, x, count);
|
||||
LOGF_NOTICE(RSX, "OutOfArgsCount(x=%u, count=%u): " + debug, x, count);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -182,7 +182,7 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t& args, const u3
|
||||
debug += "(";
|
||||
for(u32 i=0; i<count; ++i) debug += (i ? ", " : "") + fmt::Format("0x%x", ARGS(i));
|
||||
debug += ")";
|
||||
ConLog.Write(debug);
|
||||
LOG_NOTICE(RSX, debug);
|
||||
#endif
|
||||
|
||||
u32 index = 0;
|
||||
@ -214,7 +214,7 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t& args, const u3
|
||||
|
||||
case NV4097_NO_OPERATION:
|
||||
{
|
||||
ConLog.Warning("NV4097_NO_OPERATION");
|
||||
LOGF_WARNING(RSX, "NV4097_NO_OPERATION");
|
||||
}
|
||||
break;
|
||||
|
||||
@ -274,7 +274,7 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t& args, const u3
|
||||
|
||||
case_16(NV4097_SET_TEX_COORD_CONTROL, 4) :
|
||||
{
|
||||
ConLog.Warning("NV4097_SET_TEX_COORD_CONTROL");
|
||||
LOGF_WARNING(RSX, "NV4097_SET_TEX_COORD_CONTROL");
|
||||
}
|
||||
break;
|
||||
|
||||
@ -304,7 +304,7 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t& args, const u3
|
||||
m_vertex_data[index].data.push_back(v1);
|
||||
m_vertex_data[index].data.push_back(v2);
|
||||
m_vertex_data[index].data.push_back(v3);
|
||||
//ConLog.Warning("index = %d, v0 = 0x%x, v1 = 0x%x, v2 = 0x%x, v3 = 0x%x", index, v0, v1, v2, v3);
|
||||
//LOGF_WARNING(RSX, "index = %d, v0 = 0x%x, v1 = 0x%x, v2 = 0x%x, v3 = 0x%x", index, v0, v1, v2, v3);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -323,7 +323,7 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t& args, const u3
|
||||
(float&)m_vertex_data[index].data[sizeof(float)*0] = v0;
|
||||
(float&)m_vertex_data[index].data[sizeof(float)*1] = v1;
|
||||
|
||||
//ConLog.Warning("index = %d, v0 = %f, v1 = %f", index, v0, v1);
|
||||
//LOGF_WARNING(RSX, "index = %d, v0 = %f, v1 = %f", index, v0, v1);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -348,7 +348,7 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t& args, const u3
|
||||
(float&)m_vertex_data[index].data[sizeof(float)*2] = v2;
|
||||
(float&)m_vertex_data[index].data[sizeof(float)*3] = v3;
|
||||
|
||||
//ConLog.Warning("index = %d, v0 = %f, v1 = %f, v2 = %f, v3 = %f", index, v0, v1, v2, v3);
|
||||
//LOGF_WARNING(RSX, "index = %d, v0 = %f, v1 = %f, v2 = %f, v3 = %f", index, v0, v1, v2, v3);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -383,7 +383,7 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t& args, const u3
|
||||
case NV4097_SET_VERTEX_ATTRIB_INPUT_MASK:
|
||||
{
|
||||
if (ARGS(0))
|
||||
ConLog.Warning("NV4097_SET_VERTEX_ATTRIB_INPUT_MASK: %x", ARGS(0));
|
||||
LOGF_WARNING(RSX, "NV4097_SET_VERTEX_ATTRIB_INPUT_MASK: %x", ARGS(0));
|
||||
|
||||
//VertexData[0].prog.attributeInputMask = ARGS(0);
|
||||
}
|
||||
@ -392,7 +392,7 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t& args, const u3
|
||||
case NV4097_SET_VERTEX_ATTRIB_OUTPUT_MASK:
|
||||
{
|
||||
if (ARGS(0))
|
||||
ConLog.Warning("NV4097_SET_VERTEX_ATTRIB_OUTPUT_MASK: %x", ARGS(0));
|
||||
LOGF_WARNING(RSX, "NV4097_SET_VERTEX_ATTRIB_OUTPUT_MASK: %x", ARGS(0));
|
||||
|
||||
//VertexData[0].prog.attributeOutputMask = ARGS(0);
|
||||
//FragmentData.prog.attributeInputMask = ARGS(0)/* & ~0x20*/;
|
||||
@ -415,7 +415,7 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t& args, const u3
|
||||
case NV4097_SET_COLOR_MASK_MRT:
|
||||
{
|
||||
if (ARGS(0))
|
||||
ConLog.Warning("NV4097_SET_COLOR_MASK_MRT: %x", ARGS(0));
|
||||
LOGF_WARNING(RSX, "NV4097_SET_COLOR_MASK_MRT: %x", ARGS(0));
|
||||
}
|
||||
break;
|
||||
|
||||
@ -479,7 +479,7 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t& args, const u3
|
||||
case NV4097_SET_BLEND_ENABLE_MRT:
|
||||
{
|
||||
if (ARGS(0))
|
||||
ConLog.Warning("NV4097_SET_BLEND_ENABLE_MRT: %x", ARGS(0));
|
||||
LOGF_WARNING(RSX, "NV4097_SET_BLEND_ENABLE_MRT: %x", ARGS(0));
|
||||
}
|
||||
break;
|
||||
|
||||
@ -519,7 +519,7 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t& args, const u3
|
||||
case NV4097_SET_BLEND_COLOR2:
|
||||
{
|
||||
if (ARGS(0))
|
||||
ConLog.Warning("NV4097_SET_BLEND_COLOR2: 0x % x", ARGS(0));
|
||||
LOGF_WARNING(RSX, "NV4097_SET_BLEND_COLOR2: 0x % x", ARGS(0));
|
||||
}
|
||||
break;
|
||||
|
||||
@ -534,7 +534,7 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t& args, const u3
|
||||
case NV4097_SET_REDUCE_DST_COLOR:
|
||||
{
|
||||
if (ARGS(0))
|
||||
ConLog.Warning("NV4097_SET_REDUCE_DST_COLOR: 0x % x", ARGS(0));
|
||||
LOGF_WARNING(RSX, "NV4097_SET_REDUCE_DST_COLOR: 0x % x", ARGS(0));
|
||||
}
|
||||
break;
|
||||
|
||||
@ -608,7 +608,7 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t& args, const u3
|
||||
case NV4097_SET_CLIP_MAX:
|
||||
{
|
||||
if (ARGS(0))
|
||||
ConLog.Warning("NV4097_SET_CLIP_MAX: %x", ARGS(0));
|
||||
LOGF_WARNING(RSX, "NV4097_SET_CLIP_MAX: %x", ARGS(0));
|
||||
}
|
||||
break;
|
||||
|
||||
@ -734,14 +734,14 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t& args, const u3
|
||||
case NV4097_SET_CLEAR_RECT_HORIZONTAL:
|
||||
{
|
||||
if (ARGS(0))
|
||||
ConLog.Warning("NV4097_SET_CLEAR_RECT_HORIZONTAL: %x", ARGS(0));
|
||||
LOGF_WARNING(RSX, "NV4097_SET_CLEAR_RECT_HORIZONTAL: %x", ARGS(0));
|
||||
}
|
||||
break;
|
||||
|
||||
case NV4097_SET_CLEAR_RECT_VERTICAL:
|
||||
{
|
||||
if (ARGS(0))
|
||||
ConLog.Warning("NV4097_SET_CLEAR_RECT_VERTICAL: %x", ARGS(0));
|
||||
LOGF_WARNING(RSX, "NV4097_SET_CLEAR_RECT_VERTICAL: %x", ARGS(0));
|
||||
}
|
||||
break;
|
||||
|
||||
@ -754,7 +754,7 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t& args, const u3
|
||||
const u32 first = ac & 0xffffff;
|
||||
const u32 _count = (ac >> 24) + 1;
|
||||
|
||||
//ConLog.Warning("NV4097_DRAW_ARRAYS: %d - %d", first, _count);
|
||||
//LOGF_WARNING(RSX, "NV4097_DRAW_ARRAYS: %d - %d", first, _count);
|
||||
|
||||
LoadVertexData(first, _count);
|
||||
|
||||
@ -791,7 +791,7 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t& args, const u3
|
||||
m_indexed_array.m_data.resize(m_indexed_array.m_data.size() + 4);
|
||||
index = Memory.Read32(m_indexed_array.m_addr + i * 4);
|
||||
*(u32*)&m_indexed_array.m_data[pos] = index;
|
||||
//ConLog.Warning("index 4: %d", *(u32*)&m_indexed_array.m_data[pos]);
|
||||
//LOGF_WARNING(RSX, "index 4: %d", *(u32*)&m_indexed_array.m_data[pos]);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -800,7 +800,7 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t& args, const u3
|
||||
int pos = m_indexed_array.m_data.size();
|
||||
m_indexed_array.m_data.resize(m_indexed_array.m_data.size() + 2);
|
||||
index = Memory.Read16(m_indexed_array.m_addr + i * 2);
|
||||
//ConLog.Warning("index 2: %d", index);
|
||||
//LOGF_WARNING(RSX, "index 2: %d", index);
|
||||
*(u16*)&m_indexed_array.m_data[pos] = index;
|
||||
}
|
||||
break;
|
||||
@ -819,7 +819,7 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t& args, const u3
|
||||
{
|
||||
const u32 a0 = ARGS(0);
|
||||
|
||||
//ConLog.Warning("NV4097_SET_BEGIN_END: %x", a0);
|
||||
//LOGF_WARNING(RSX, "NV4097_SET_BEGIN_END: %x", a0);
|
||||
|
||||
m_read_buffer = false;
|
||||
|
||||
@ -850,7 +850,7 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t& args, const u3
|
||||
{
|
||||
if(!m_cur_shader_prog)
|
||||
{
|
||||
ConLog.Error("NV4097_SET_SHADER_CONTROL: m_cur_shader_prog == NULL");
|
||||
LOGF_ERROR(RSX, "NV4097_SET_SHADER_CONTROL: m_cur_shader_prog == NULL");
|
||||
break;
|
||||
}
|
||||
|
||||
@ -877,7 +877,7 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t& args, const u3
|
||||
// Transform
|
||||
case NV4097_SET_TRANSFORM_PROGRAM_LOAD:
|
||||
{
|
||||
//ConLog.Warning("NV4097_SET_TRANSFORM_PROGRAM_LOAD: prog = %d", ARGS(0));
|
||||
//LOGF_WARNING(RSX, "NV4097_SET_TRANSFORM_PROGRAM_LOAD: prog = %d", ARGS(0));
|
||||
|
||||
m_cur_vertex_prog = &m_vertex_progs[ARGS(0)];
|
||||
m_cur_vertex_prog->data.clear();
|
||||
@ -886,7 +886,7 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t& args, const u3
|
||||
{
|
||||
const u32 start = ARGS(1);
|
||||
if(start)
|
||||
ConLog.Warning("NV4097_SET_TRANSFORM_PROGRAM_LOAD: start = %d", start);
|
||||
LOGF_WARNING(RSX, "NV4097_SET_TRANSFORM_PROGRAM_LOAD: start = %d", start);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -894,17 +894,17 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t& args, const u3
|
||||
case NV4097_SET_TRANSFORM_PROGRAM_START:
|
||||
{
|
||||
if (ARGS(0))
|
||||
ConLog.Warning("NV4097_SET_TRANSFORM_PROGRAM_START: 0x%x", ARGS(0));
|
||||
LOGF_WARNING(RSX, "NV4097_SET_TRANSFORM_PROGRAM_START: 0x%x", ARGS(0));
|
||||
}
|
||||
break;
|
||||
|
||||
case_32(NV4097_SET_TRANSFORM_PROGRAM, 4):
|
||||
{
|
||||
//ConLog.Warning("NV4097_SET_TRANSFORM_PROGRAM[%d](%d)", index, count);
|
||||
//LOGF_WARNING(RSX, "NV4097_SET_TRANSFORM_PROGRAM[%d](%d)", index, count);
|
||||
|
||||
if(!m_cur_vertex_prog)
|
||||
{
|
||||
ConLog.Warning("NV4097_SET_TRANSFORM_PROGRAM: m_cur_vertex_prog == NULL");
|
||||
LOGF_WARNING(RSX, "NV4097_SET_TRANSFORM_PROGRAM: m_cur_vertex_prog == NULL");
|
||||
break;
|
||||
}
|
||||
|
||||
@ -916,7 +916,7 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t& args, const u3
|
||||
|
||||
if(!m_cur_vertex_prog)
|
||||
{
|
||||
ConLog.Warning("NV4097_SET_TRANSFORM_TIMEOUT: m_cur_vertex_prog == NULL");
|
||||
LOGF_WARNING(RSX, "NV4097_SET_TRANSFORM_TIMEOUT: m_cur_vertex_prog == NULL");
|
||||
break;
|
||||
}
|
||||
|
||||
@ -950,28 +950,28 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t& args, const u3
|
||||
case NV4097_INVALIDATE_L2:
|
||||
{
|
||||
if (ARGS(0))
|
||||
ConLog.Warning("NV4097_INVALIDATE_L2: %x", ARGS(0));
|
||||
LOGF_WARNING(RSX, "NV4097_INVALIDATE_L2: %x", ARGS(0));
|
||||
}
|
||||
break;
|
||||
|
||||
case NV4097_INVALIDATE_VERTEX_CACHE_FILE:
|
||||
{
|
||||
if (ARGS(0))
|
||||
ConLog.Warning("NV4097_INVALIDATE_VERTEX_CACHE_FILE: %x", ARGS(0));
|
||||
LOGF_WARNING(RSX, "NV4097_INVALIDATE_VERTEX_CACHE_FILE: %x", ARGS(0));
|
||||
}
|
||||
break;
|
||||
|
||||
case NV4097_INVALIDATE_VERTEX_FILE:
|
||||
{
|
||||
if (ARGS(0))
|
||||
ConLog.Warning("NV4097_INVALIDATE_VERTEX_FILE: %x", ARGS(0));
|
||||
LOGF_WARNING(RSX, "NV4097_INVALIDATE_VERTEX_FILE: %x", ARGS(0));
|
||||
}
|
||||
break;
|
||||
|
||||
case NV4097_INVALIDATE_ZCULL:
|
||||
{
|
||||
if (ARGS(0))
|
||||
ConLog.Warning("NV4097_INVALIDATE_ZCULL: %x", ARGS(0));
|
||||
LOGF_WARNING(RSX, "NV4097_INVALIDATE_ZCULL: %x", ARGS(0));
|
||||
}
|
||||
break;
|
||||
|
||||
@ -1158,7 +1158,7 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t& args, const u3
|
||||
case NV4097_SET_POINT_PARAMS_ENABLE:
|
||||
{
|
||||
if (ARGS(0))
|
||||
ConLog.Error("NV4097_SET_POINT_PARAMS_ENABLE");
|
||||
LOG_ERROR(RSX, "NV4097_SET_POINT_PARAMS_ENABLE");
|
||||
}
|
||||
break;
|
||||
|
||||
@ -1235,7 +1235,7 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t& args, const u3
|
||||
case NV406E_SEMAPHORE_ACQUIRE:
|
||||
{
|
||||
if (ARGS(0))
|
||||
ConLog.Warning("NV406E_SEMAPHORE_ACQUIRE: %x", ARGS(0));
|
||||
LOGF_WARNING(RSX, "NV406E_SEMAPHORE_ACQUIRE: %x", ARGS(0));
|
||||
}
|
||||
break;
|
||||
|
||||
@ -1347,7 +1347,7 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t& args, const u3
|
||||
{
|
||||
if (count != 4)
|
||||
{
|
||||
ConLog.Error("NV4097_SET_SURFACE_PITCH_C: Bad count (%d)", count);
|
||||
LOGF_WARNING(RSX, "NV4097_SET_SURFACE_PITCH_C: Bad count (%d)", count);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -1361,7 +1361,7 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t& args, const u3
|
||||
case NV4097_SET_SURFACE_PITCH_D:
|
||||
{
|
||||
if (ARGS(0))
|
||||
ConLog.Warning("NV4097_SET_SURFACE_PITCH_D: %x", ARGS(0));
|
||||
LOGF_WARNING(RSX, "NV4097_SET_SURFACE_PITCH_D: %x", ARGS(0));
|
||||
}
|
||||
break;
|
||||
|
||||
@ -1401,7 +1401,7 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t& args, const u3
|
||||
case NV4097_SET_CONTEXT_DMA_COLOR_D:
|
||||
{
|
||||
if (ARGS(0))
|
||||
ConLog.Warning("NV4097_SET_CONTEXT_DMA_COLOR_D: %x", ARGS(0));
|
||||
LOGF_WARNING(RSX, "NV4097_SET_CONTEXT_DMA_COLOR_D: %x", ARGS(0));
|
||||
}
|
||||
break;
|
||||
|
||||
@ -1443,7 +1443,7 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t& args, const u3
|
||||
case NV4097_SET_ANTI_ALIASING_CONTROL:
|
||||
{
|
||||
if (ARGS(0))
|
||||
ConLog.Warning("NV4097_SET_ANTI_ALIASING_CONTROL: %x", ARGS(0));
|
||||
LOGF_WARNING(RSX, "NV4097_SET_ANTI_ALIASING_CONTROL: %x", ARGS(0));
|
||||
}
|
||||
break;
|
||||
|
||||
@ -1498,7 +1498,7 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t& args, const u3
|
||||
case NV4097_SET_ZCULL_CONTROL0:
|
||||
{
|
||||
if (ARGS(0))
|
||||
ConLog.Warning("NV4097_SET_ZCULL_CONTROL0: %x", ARGS(0));
|
||||
LOGF_WARNING(RSX, "NV4097_SET_ZCULL_CONTROL0: %x", ARGS(0));
|
||||
|
||||
//m_set_depth_func = true;
|
||||
//m_depth_func = ARGS(0) >> 4;
|
||||
@ -1508,7 +1508,7 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t& args, const u3
|
||||
case NV4097_SET_ZCULL_CONTROL1:
|
||||
{
|
||||
if (ARGS(0))
|
||||
ConLog.Warning("NV4097_SET_ZCULL_CONTROL1: %x", ARGS(0));
|
||||
LOGF_WARNING(RSX, "NV4097_SET_ZCULL_CONTROL1: %x", ARGS(0));
|
||||
|
||||
//m_set_depth_func = true;
|
||||
//m_depth_func = ARGS(0) >> 4;
|
||||
@ -1531,12 +1531,12 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t& args, const u3
|
||||
case CELL_GCM_ZCULL_STATS2:
|
||||
case CELL_GCM_ZCULL_STATS3:
|
||||
value = 0;
|
||||
ConLog.Warning("NV4097_GET_REPORT: Unimplemented type %d", type);
|
||||
LOGF_WARNING(RSX, "NV4097_GET_REPORT: Unimplemented type %d", type);
|
||||
break;
|
||||
|
||||
default:
|
||||
value = 0;
|
||||
ConLog.Error("NV4097_GET_REPORT: Bad type %d", type);
|
||||
LOGF_WARNING(RSX, "NV4097_GET_REPORT: Bad type %d", type);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -1586,7 +1586,7 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t& args, const u3
|
||||
case NV4097_SET_ZMIN_MAX_CONTROL:
|
||||
{
|
||||
if (ARGS(0))
|
||||
ConLog.Warning("NV4097_SET_ZMIN_MAX_CONTROL: %x", ARGS(0));
|
||||
LOGF_WARNING(RSX, "NV4097_SET_ZMIN_MAX_CONTROL: %x", ARGS(0));
|
||||
}
|
||||
break;
|
||||
|
||||
@ -1594,28 +1594,28 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t& args, const u3
|
||||
case NV4097_SET_WINDOW_OFFSET:
|
||||
{
|
||||
if (ARGS(0))
|
||||
ConLog.Warning("NV4097_SET_WINDOW_OFFSET: %x", ARGS(0));
|
||||
LOGF_WARNING(RSX, "NV4097_SET_WINDOW_OFFSET: %x", ARGS(0));
|
||||
}
|
||||
break;
|
||||
|
||||
case NV4097_SET_WINDOW_CLIP_TYPE:
|
||||
{
|
||||
if (ARGS(0))
|
||||
ConLog.Warning("NV4097_SET_WINDOW_CLIP_TYPE: %x", ARGS(0));
|
||||
LOGF_WARNING(RSX, "NV4097_SET_WINDOW_CLIP_TYPE: %x", ARGS(0));
|
||||
}
|
||||
break;
|
||||
|
||||
case NV4097_SET_WINDOW_CLIP_HORIZONTAL:
|
||||
{
|
||||
if (ARGS(0))
|
||||
ConLog.Warning("NV4097_SET_WINDOW_CLIP_HORIZONTAL: %x", ARGS(0));
|
||||
LOGF_WARNING(RSX, "NV4097_SET_WINDOW_CLIP_HORIZONTAL: %x", ARGS(0));
|
||||
}
|
||||
break;
|
||||
|
||||
case NV4097_SET_WINDOW_CLIP_VERTICAL:
|
||||
{
|
||||
if (ARGS(0))
|
||||
ConLog.Warning("NV4097_SET_WINDOW_CLIP_VERTICAL: %x", ARGS(0));
|
||||
LOGF_WARNING(RSX, "NV4097_SET_WINDOW_CLIP_VERTICAL: %x", ARGS(0));
|
||||
}
|
||||
break;
|
||||
|
||||
@ -1638,7 +1638,7 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t& args, const u3
|
||||
}
|
||||
else
|
||||
{
|
||||
ConLog.Warning("NV0039_SET_CONTEXT_DMA_BUFFER_IN: TODO: srcContext=0x%x, dstContext=0x%x", srcContext, dstContext);
|
||||
LOGF_WARNING(RSX, "NV0039_SET_CONTEXT_DMA_BUFFER_IN: TODO: srcContext=0x%x, dstContext=0x%x", srcContext, dstContext);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -1662,7 +1662,7 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t& args, const u3
|
||||
}
|
||||
else
|
||||
{
|
||||
ConLog.Warning("NV0039_OFFSET_IN: TODO: offset(in=0x%x, out=0x%x), pitch(in=0x%x, out=0x%x), line(len=0x%x, cnt=0x%x), fmt(in=0x%x, out=0x%x), notify=0x%x",
|
||||
LOGF_WARNING(RSX, "NV0039_OFFSET_IN: TODO: offset(in=0x%x, out=0x%x), pitch(in=0x%x, out=0x%x), line(len=0x%x, cnt=0x%x), fmt(in=0x%x, out=0x%x), notify=0x%x",
|
||||
inOffset, outOffset, inPitch, outPitch, lineLength, lineCount, inFormat, outFormat, notify);
|
||||
}
|
||||
}
|
||||
@ -1677,7 +1677,7 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t& args, const u3
|
||||
}
|
||||
else
|
||||
{
|
||||
ConLog.Warning("NV0039_OFFSET_OUT: TODO: offset=0x%x", offset);
|
||||
LOGF_WARNING(RSX, "NV0039_OFFSET_OUT: TODO: offset=0x%x", offset);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -1723,10 +1723,10 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t& args, const u3
|
||||
|
||||
if(count >= 5)
|
||||
{
|
||||
ConLog.Warning("NV308A_COLOR: count = %d", count);
|
||||
LOGF_WARNING(RSX, "NV308A_COLOR: count = %d", count);
|
||||
}
|
||||
|
||||
//ConLog.Warning("NV308A_COLOR: [%d]: %f, %f, %f, %f", c.id, c.x, c.y, c.z, c.w);
|
||||
//LOGF_WARNING(RSX, "NV308A_COLOR: [%d]: %f, %f, %f, %f", c.id, c.x, c.y, c.z, c.w);
|
||||
m_fragment_constants.push_back(c);
|
||||
}
|
||||
break;
|
||||
@ -1810,7 +1810,7 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t& args, const u3
|
||||
{
|
||||
if (ARGS(0) != CELL_GCM_CONTEXT_SURFACE2D)
|
||||
{
|
||||
ConLog.Warning("NV3089_SET_CONTEXT_SURFACE: Unsupported surface (0x%x)", ARGS(0));
|
||||
LOGF_WARNING(RSX, "NV3089_SET_CONTEXT_SURFACE: Unsupported surface (0x%x)", ARGS(0));
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -1821,7 +1821,7 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t& args, const u3
|
||||
log += "(";
|
||||
for(u32 i=0; i<count; ++i) log += (i ? ", " : "") + fmt::Format("0x%x", ARGS(i));
|
||||
log += ")";
|
||||
ConLog.Error("TODO: " + log);
|
||||
LOG_WARNING(RSX, "TODO: " + log);
|
||||
//Emu.Pause();
|
||||
}
|
||||
break;
|
||||
@ -1866,7 +1866,7 @@ void RSXThread::End()
|
||||
void RSXThread::Task()
|
||||
{
|
||||
u8 inc;
|
||||
ConLog.Write("RSX thread started");
|
||||
LOGF_NOTICE(RSX, "RSX thread started");
|
||||
|
||||
OnInitThread();
|
||||
|
||||
@ -1874,7 +1874,7 @@ void RSXThread::Task()
|
||||
{
|
||||
if (Emu.IsStopped())
|
||||
{
|
||||
ConLog.Warning("RSX thread aborted");
|
||||
LOGF_WARNING(RSX, "RSX thread aborted");
|
||||
return;
|
||||
}
|
||||
std::lock_guard<std::mutex> lock(m_cs_main);
|
||||
@ -1912,7 +1912,7 @@ void RSXThread::Task()
|
||||
if(cmd & CELL_GCM_METHOD_FLAG_JUMP)
|
||||
{
|
||||
u32 addr = cmd & ~(CELL_GCM_METHOD_FLAG_JUMP | CELL_GCM_METHOD_FLAG_NON_INCREMENT);
|
||||
//ConLog.Warning("rsx jump(0x%x) #addr=0x%x, cmd=0x%x, get=0x%x, put=0x%x", addr, m_ioAddress + get, cmd, get, put);
|
||||
//LOGF_WARNING(RSX, "rsx jump(0x%x) #addr=0x%x, cmd=0x%x, get=0x%x, put=0x%x", addr, m_ioAddress + get, cmd, get, put);
|
||||
m_ctrl->get = addr;
|
||||
continue;
|
||||
}
|
||||
@ -1921,22 +1921,22 @@ void RSXThread::Task()
|
||||
m_call_stack.push(get + 4);
|
||||
u32 offs = cmd & ~CELL_GCM_METHOD_FLAG_CALL;
|
||||
u32 addr = Memory.RSXIOMem.GetStartAddr() + offs;
|
||||
//ConLog.Warning("rsx call(0x%x) #0x%x - 0x%x - 0x%x", offs, addr, cmd, get);
|
||||
//LOGF_WARNING(RSX, "rsx call(0x%x) #0x%x - 0x%x - 0x%x", offs, addr, cmd, get);
|
||||
m_ctrl->get = offs;
|
||||
continue;
|
||||
}
|
||||
if(cmd == CELL_GCM_METHOD_FLAG_RETURN)
|
||||
{
|
||||
//ConLog.Warning("rsx return!");
|
||||
//LOGF_WARNING(RSX, "rsx return!");
|
||||
u32 get = m_call_stack.top();
|
||||
m_call_stack.pop();
|
||||
//ConLog.Warning("rsx return(0x%x)", get);
|
||||
//LOGF_WARNING(RSX, "rsx return(0x%x)", get);
|
||||
m_ctrl->get = get;
|
||||
continue;
|
||||
}
|
||||
if(cmd & CELL_GCM_METHOD_FLAG_NON_INCREMENT)
|
||||
{
|
||||
//ConLog.Warning("non increment cmd! 0x%x", cmd);
|
||||
//LOGF_WARNING(RSX, "non increment cmd! 0x%x", cmd);
|
||||
inc=0;
|
||||
}
|
||||
|
||||
@ -1961,7 +1961,7 @@ void RSXThread::Task()
|
||||
//memset(Memory.GetMemFromAddr(p.m_ioAddress + get), 0, (count + 1) * 4);
|
||||
}
|
||||
|
||||
ConLog.Write("RSX thread ended");
|
||||
LOGF_NOTICE(RSX, "RSX thread ended");
|
||||
|
||||
OnExitThread();
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "HDD.h"
|
||||
|
||||
vfsDeviceHDD::vfsDeviceHDD(const std::string& hdd_path) : m_hdd_path(hdd_path)
|
||||
|
@ -445,7 +445,7 @@ public:
|
||||
m_cur_dir_block = m_hdd_info.next_block;
|
||||
if(!m_hdd_info.block_size)
|
||||
{
|
||||
ConLog.Error("Bad block size!");
|
||||
LOG_ERROR(HLE, "Bad block size!");
|
||||
m_hdd_info.block_size = 2048;
|
||||
}
|
||||
m_hdd_file.Seek(m_cur_dir_block * m_hdd_info.block_size);
|
||||
@ -486,7 +486,7 @@ public:
|
||||
|
||||
int OpenDir(const std::string& name)
|
||||
{
|
||||
ConLog.Warning("OpenDir(%s)", name.c_str());
|
||||
LOGF_WARNING(HLE, "OpenDir(%s)", name.c_str());
|
||||
u64 entry_block;
|
||||
if(!SearchEntry(name, entry_block))
|
||||
return -1;
|
||||
@ -594,7 +594,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
ConLog.Write("CREATING ENTRY AT 0x%llx", new_block);
|
||||
LOGF_NOTICE(HLE, "CREATING ENTRY AT 0x%llx", new_block);
|
||||
WriteBlock(new_block, g_used_block);
|
||||
|
||||
{
|
||||
@ -744,7 +744,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
ConLog.Write("ENTRY FOUND AT 0x%llx", file_block);
|
||||
LOGF_NOTICE(HLE, "ENTRY FOUND AT 0x%llx", file_block);
|
||||
m_file.Open(file_block);
|
||||
|
||||
return vfsFileBase::Open(path, mode);
|
||||
@ -774,7 +774,7 @@ public:
|
||||
|
||||
if(entry.type == vfsHDD_Entry_Dir && name != "." && name != "..")
|
||||
{
|
||||
ConLog.Warning("Removing sub folder '%s'", name.c_str());
|
||||
LOGF_WARNING(HLE, "Removing sub folder '%s'", name.c_str());
|
||||
RemoveBlocksDir(entry.data_block);
|
||||
}
|
||||
else if(entry.type == vfsHDD_Entry_File)
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "rpcs3/Ini.h"
|
||||
#include "Keyboard.h"
|
||||
#include "Null/NullKeyboardHandler.h"
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "rpcs3/Ini.h"
|
||||
#include "Mouse.h"
|
||||
#include "Null/NullMouseHandler.h"
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "rpcs3/Ini.h"
|
||||
#include "Pad.h"
|
||||
#include "Null/NullPadHandler.h"
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "stdafx.h"
|
||||
#if defined (_WIN32)
|
||||
#include <algorithm>
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "XInputPadHandler.h"
|
||||
#include <cstring>
|
||||
|
||||
@ -113,7 +113,7 @@ void XInputPadHandler::Close()
|
||||
{
|
||||
active = false;
|
||||
if (WaitForSingleObject(thread, THREAD_TIMEOUT) != WAIT_OBJECT_0)
|
||||
ConLog.Error("XInput thread could not stop within %d milliseconds", THREAD_TIMEOUT);
|
||||
LOGF_ERROR(HLE, "XInput thread could not stop within %d milliseconds", THREAD_TIMEOUT);
|
||||
thread = nullptr;
|
||||
}
|
||||
|
||||
|
@ -212,10 +212,10 @@ bool DynamicMemoryBlockBase<PT>::Free(u64 addr)
|
||||
}
|
||||
}
|
||||
|
||||
ConLog.Error("DynamicMemoryBlock::Free(addr=0x%llx): failed", addr);
|
||||
LOGF_ERROR(MEMORY, "DynamicMemoryBlock::Free(addr=0x%llx): failed", addr);
|
||||
for (u32 i = 0; i < m_allocated.size(); i++)
|
||||
{
|
||||
ConLog.Write("*** Memory Block: addr = 0x%llx, size = 0x%x", m_allocated[i].addr, m_allocated[i].size);
|
||||
LOGF_NOTICE(MEMORY, "*** Memory Block: addr = 0x%llx, size = 0x%x", m_allocated[i].addr, m_allocated[i].size);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -233,7 +233,7 @@ u8* DynamicMemoryBlockBase<PT>::GetMem(u64 addr) const // lock-free, addr is fix
|
||||
}
|
||||
}
|
||||
|
||||
ConLog.Error("GetMem(%llx) from not allocated address.", addr);
|
||||
LOGF_ERROR(MEMORY, "GetMem(%llx) from not allocated address.", addr);
|
||||
assert(0);
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "stdafx.h"
|
||||
#include <atomic>
|
||||
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Memory.h"
|
||||
#include "MemoryBlock.h"
|
||||
#include "Emu/System.h"
|
||||
@ -331,7 +331,7 @@ bool MemoryBlockLE::Write128(const u64 addr, const u128 value)
|
||||
//NullMemoryBlock
|
||||
bool NullMemoryBlock::Read8(const u64 addr, u8* )
|
||||
{
|
||||
ConLog.Error("Read8 from null block: [%08llx]", addr);
|
||||
LOGF_ERROR(MEMORY, "Read8 from null block: [%08llx]", addr);
|
||||
if (!Ini.CPUIgnoreRWErrors.GetValue())
|
||||
Emu.Pause();
|
||||
return false;
|
||||
@ -339,7 +339,7 @@ bool NullMemoryBlock::Read8(const u64 addr, u8* )
|
||||
|
||||
bool NullMemoryBlock::Read16(const u64 addr, u16* )
|
||||
{
|
||||
ConLog.Error("Read16 from null block: [%08llx]", addr);
|
||||
LOGF_ERROR(MEMORY, "Read16 from null block: [%08llx]", addr);
|
||||
if (!Ini.CPUIgnoreRWErrors.GetValue())
|
||||
Emu.Pause();
|
||||
return false;
|
||||
@ -347,7 +347,7 @@ bool NullMemoryBlock::Read16(const u64 addr, u16* )
|
||||
|
||||
bool NullMemoryBlock::Read32(const u64 addr, u32* )
|
||||
{
|
||||
ConLog.Error("Read32 from null block: [%08llx]", addr);
|
||||
LOGF_ERROR(MEMORY, "Read32 from null block: [%08llx]", addr);
|
||||
if (!Ini.CPUIgnoreRWErrors.GetValue())
|
||||
Emu.Pause();
|
||||
return false;
|
||||
@ -355,7 +355,7 @@ bool NullMemoryBlock::Read32(const u64 addr, u32* )
|
||||
|
||||
bool NullMemoryBlock::Read64(const u64 addr, u64* )
|
||||
{
|
||||
ConLog.Error("Read64 from null block: [%08llx]", addr);
|
||||
LOGF_ERROR(MEMORY, "Read64 from null block: [%08llx]", addr);
|
||||
if (!Ini.CPUIgnoreRWErrors.GetValue())
|
||||
Emu.Pause();
|
||||
return false;
|
||||
@ -363,7 +363,7 @@ bool NullMemoryBlock::Read64(const u64 addr, u64* )
|
||||
|
||||
bool NullMemoryBlock::Read128(const u64 addr, u128* )
|
||||
{
|
||||
ConLog.Error("Read128 from null block: [%08llx]", addr);
|
||||
LOGF_ERROR(MEMORY, "Read128 from null block: [%08llx]", addr);
|
||||
if (!Ini.CPUIgnoreRWErrors.GetValue())
|
||||
Emu.Pause();
|
||||
return false;
|
||||
@ -371,7 +371,7 @@ bool NullMemoryBlock::Read128(const u64 addr, u128* )
|
||||
|
||||
bool NullMemoryBlock::Write8(const u64 addr, const u8 value)
|
||||
{
|
||||
ConLog.Error("Write8 to null block: [%08llx]: %x", addr, value);
|
||||
LOGF_ERROR(MEMORY, "Write8 to null block: [%08llx]: %x", addr, value);
|
||||
if (!Ini.CPUIgnoreRWErrors.GetValue())
|
||||
Emu.Pause();
|
||||
return false;
|
||||
@ -379,7 +379,7 @@ bool NullMemoryBlock::Write8(const u64 addr, const u8 value)
|
||||
|
||||
bool NullMemoryBlock::Write16(const u64 addr, const u16 value)
|
||||
{
|
||||
ConLog.Error("Write16 to null block: [%08llx]: %x", addr, value);
|
||||
LOGF_ERROR(MEMORY, "Write16 to null block: [%08llx]: %x", addr, value);
|
||||
if (!Ini.CPUIgnoreRWErrors.GetValue())
|
||||
Emu.Pause();
|
||||
return false;
|
||||
@ -387,7 +387,7 @@ bool NullMemoryBlock::Write16(const u64 addr, const u16 value)
|
||||
|
||||
bool NullMemoryBlock::Write32(const u64 addr, const u32 value)
|
||||
{
|
||||
ConLog.Error("Write32 to null block: [%08llx]: %x", addr, value);
|
||||
LOGF_ERROR(MEMORY, "Write32 to null block: [%08llx]: %x", addr, value);
|
||||
if (!Ini.CPUIgnoreRWErrors.GetValue())
|
||||
Emu.Pause();
|
||||
return false;
|
||||
@ -395,7 +395,7 @@ bool NullMemoryBlock::Write32(const u64 addr, const u32 value)
|
||||
|
||||
bool NullMemoryBlock::Write64(const u64 addr, const u64 value)
|
||||
{
|
||||
ConLog.Error("Write64 to null block: [%08llx]: %llx", addr, value);
|
||||
LOGF_ERROR(MEMORY, "Write64 to null block: [%08llx]: %llx", addr, value);
|
||||
if (!Ini.CPUIgnoreRWErrors.GetValue())
|
||||
Emu.Pause();
|
||||
return false;
|
||||
@ -403,7 +403,7 @@ bool NullMemoryBlock::Write64(const u64 addr, const u64 value)
|
||||
|
||||
bool NullMemoryBlock::Write128(const u64 addr, const u128 value)
|
||||
{
|
||||
ConLog.Error("Write128 to null block: [%08llx]: %llx_%llx", addr, value.hi, value.lo);
|
||||
LOGF_ERROR(MEMORY, "Write128 to null block: [%08llx]: %llx_%llx", addr, value.hi, value.lo);
|
||||
if (!Ini.CPUIgnoreRWErrors.GetValue())
|
||||
Emu.Pause();
|
||||
return false;
|
||||
|
@ -211,7 +211,7 @@ public:
|
||||
if(m_inited) return;
|
||||
m_inited = true;
|
||||
|
||||
ConLog.Write("Initing memory...");
|
||||
LOG_NOTICE(MEMORY, "Initing memory...");
|
||||
|
||||
switch(type)
|
||||
{
|
||||
@ -240,7 +240,7 @@ public:
|
||||
break;
|
||||
}
|
||||
|
||||
ConLog.Write("Memory initialized.");
|
||||
LOG_NOTICE(MEMORY, "Memory initialized.");
|
||||
}
|
||||
|
||||
bool IsGoodAddr(const u64 addr)
|
||||
@ -271,7 +271,7 @@ public:
|
||||
if(!m_inited) return;
|
||||
m_inited = false;
|
||||
|
||||
ConLog.Write("Closing memory...");
|
||||
LOG_NOTICE(MEMORY, "Closing memory...");
|
||||
|
||||
for (auto block : MemoryBlocks)
|
||||
{
|
||||
@ -405,7 +405,7 @@ public:
|
||||
|
||||
if(mem.IsNULL())
|
||||
{
|
||||
ConLog.Error("ReadLeft[%d] from null block (0x%llx)", size, addr);
|
||||
LOGF_ERROR(MEMORY, "ReadLeft[%d] from null block (0x%llx)", size, addr);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -418,7 +418,7 @@ public:
|
||||
|
||||
if(mem.IsNULL())
|
||||
{
|
||||
ConLog.Error("WriteLeft[%d] to null block (0x%llx)", size, addr);
|
||||
LOGF_ERROR(MEMORY, "WriteLeft[%d] to null block (0x%llx)", size, addr);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -431,7 +431,7 @@ public:
|
||||
|
||||
if(mem.IsNULL())
|
||||
{
|
||||
ConLog.Error("ReadRight[%d] from null block (0x%llx)", size, addr);
|
||||
LOGF_ERROR(MEMORY, "ReadRight[%d] from null block (0x%llx)", size, addr);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -444,7 +444,7 @@ public:
|
||||
|
||||
if(mem.IsNULL())
|
||||
{
|
||||
ConLog.Error("WriteRight[%d] to null block (0x%llx)", size, addr);
|
||||
LOGF_ERROR(MEMORY, "WriteRight[%d] to null block (0x%llx)", size, addr);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -477,7 +477,7 @@ public:
|
||||
{
|
||||
if(!IsGoodAddr(addr, str.length()))
|
||||
{
|
||||
ConLog.Error("Memory::WriteString error: bad address (0x%llx)", addr);
|
||||
LOGF_ERROR(MEMORY,"Memory::WriteString error: bad address (0x%llx)", addr);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -527,7 +527,7 @@ public:
|
||||
}
|
||||
|
||||
MemoryBlocks.push_back((new MemoryMirror())->SetRange(GetMemFromAddr(src_addr), dst_addr, size));
|
||||
ConLog.Warning("memory mapped 0x%llx to 0x%llx size=0x%x", src_addr, dst_addr, size);
|
||||
LOGF_WARNING(MEMORY, "memory mapped 0x%llx to 0x%llx size=0x%x", src_addr, dst_addr, size);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,7 @@ struct MemBlockInfo : public MemInfo
|
||||
{
|
||||
if(!mem)
|
||||
{
|
||||
ConLog.Error("Not enough free memory.");
|
||||
LOG_ERROR(MEMORY, "Not enough free memory.");
|
||||
assert(0);
|
||||
}
|
||||
memset(mem, 0, size);
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Callback.h"
|
||||
@ -66,7 +66,7 @@ again:
|
||||
{
|
||||
if (Emu.IsStopped())
|
||||
{
|
||||
ConLog.Warning("Callback::Branch() aborted");
|
||||
LOG_WARNING(HLE, "Callback::Branch() aborted");
|
||||
return;
|
||||
}
|
||||
Sleep(1);
|
||||
@ -80,7 +80,7 @@ again:
|
||||
}
|
||||
if (Emu.IsStopped())
|
||||
{
|
||||
ConLog.Warning("Callback::Branch() aborted");
|
||||
LOG_WARNING(HLE, "Callback::Branch() aborted");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -109,7 +109,7 @@ again:
|
||||
{
|
||||
if (Emu.IsStopped())
|
||||
{
|
||||
ConLog.Warning("Callback::Branch(true) aborted (end)");
|
||||
LOG_WARNING(HLE, "Callback::Branch(true) aborted (end)");
|
||||
return;
|
||||
}
|
||||
Sleep(1);
|
||||
|
@ -1,10 +1,10 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "SysCalls.h"
|
||||
|
||||
#define FUNC_LOG_ERROR(x) ConLog.Error(x); return 0
|
||||
#define FUNC_LOG_ERROR(x) LOG_ERROR(HLE, x); return 0
|
||||
std::string SysCalls::GetHLEFuncName(const u32 fid)
|
||||
{
|
||||
switch(fid)
|
||||
@ -3846,4 +3846,4 @@ std::string SysCalls::GetHLEFuncName(const u32 fid)
|
||||
}
|
||||
|
||||
return fmt::Format("Unknown func id: 0x%08x", fid);
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/Cell/PPUThread.h"
|
||||
@ -160,7 +160,7 @@ void Module::Log(const u32 id, std::string fmt, ...)
|
||||
{
|
||||
va_list list;
|
||||
va_start(list, fmt);
|
||||
ConLog.Write(GetName() + fmt::Format("[%d]: ", id) + fmt::FormatV(fmt, list));
|
||||
LOG_NOTICE(HLE, GetName() + fmt::Format("[%d]: ", id) + fmt::FormatV(fmt, list));
|
||||
va_end(list);
|
||||
}
|
||||
}
|
||||
@ -171,7 +171,7 @@ void Module::Log(std::string fmt, ...)
|
||||
{
|
||||
va_list list;
|
||||
va_start(list, fmt);
|
||||
ConLog.Write(GetName() + ": " + fmt::FormatV(fmt, list));
|
||||
LOG_NOTICE(HLE, GetName() + ": " + fmt::FormatV(fmt, list));
|
||||
va_end(list);
|
||||
}
|
||||
}
|
||||
@ -180,7 +180,7 @@ void Module::Warning(const u32 id, std::string fmt, ...)
|
||||
{
|
||||
va_list list;
|
||||
va_start(list, fmt);
|
||||
ConLog.Warning(GetName() + fmt::Format("[%d] warning: ", id) + fmt::FormatV(fmt, list));
|
||||
LOG_WARNING(HLE, GetName() + fmt::Format("[%d] warning: ", id) + fmt::FormatV(fmt, list));
|
||||
va_end(list);
|
||||
}
|
||||
|
||||
@ -188,7 +188,7 @@ void Module::Warning(std::string fmt, ...)
|
||||
{
|
||||
va_list list;
|
||||
va_start(list, fmt);
|
||||
ConLog.Warning(GetName() + " warning: " + fmt::FormatV(fmt, list));
|
||||
LOG_WARNING(HLE, GetName() + " warning: " + fmt::FormatV(fmt, list));
|
||||
va_end(list);
|
||||
}
|
||||
|
||||
@ -196,7 +196,7 @@ void Module::Error(const u32 id, std::string fmt, ...)
|
||||
{
|
||||
va_list list;
|
||||
va_start(list, fmt);
|
||||
ConLog.Error(GetName() + fmt::Format("[%d] error: ", id) + fmt::FormatV(fmt, list));
|
||||
LOG_ERROR(HLE, GetName() + fmt::Format("[%d] error: ", id) + fmt::FormatV(fmt, list));
|
||||
va_end(list);
|
||||
}
|
||||
|
||||
@ -204,7 +204,7 @@ void Module::Error(std::string fmt, ...)
|
||||
{
|
||||
va_list list;
|
||||
va_start(list, fmt);
|
||||
ConLog.Error(GetName() + " error: " + fmt::FormatV(fmt, list));
|
||||
LOG_ERROR(HLE, GetName() + " error: " + fmt::FormatV(fmt, list));
|
||||
va_end(list);
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/Cell/PPUThread.h"
|
||||
@ -36,7 +36,7 @@ next:
|
||||
{
|
||||
if (Emu.IsStopped())
|
||||
{
|
||||
ConLog.Warning("adecRawRead(): aborted");
|
||||
LOG_WARNING(HLE, "adecRawRead(): aborted");
|
||||
return 0;
|
||||
}
|
||||
Sleep(1);
|
||||
@ -53,7 +53,7 @@ next:
|
||||
{
|
||||
if (!Memory.CopyToReal(buf, adec.reader.addr, adec.reader.size))
|
||||
{
|
||||
ConLog.Error("adecRawRead(): data reading failed (reader.size=0x%x)", adec.reader.size);
|
||||
LOGF_ERROR(HLE, "adecRawRead(): data reading failed (reader.size=0x%x)", adec.reader.size);
|
||||
Emu.Pause();
|
||||
return 0;
|
||||
}
|
||||
@ -68,11 +68,11 @@ next:
|
||||
|
||||
adec.reader.addr = adec.task.au.addr;
|
||||
adec.reader.size = adec.task.au.size;
|
||||
//ConLog.Write("Audio AU: size = 0x%x, pts = 0x%llx", adec.task.au.size, adec.task.au.pts);
|
||||
//LOGF_NOTICE(HLE, "Audio AU: size = 0x%x, pts = 0x%llx", adec.task.au.size, adec.task.au.pts);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
ConLog.Error("adecRawRead(): sequence error (task %d)", adec.job.Peek().type);
|
||||
LOGF_ERROR(HLE, "adecRawRead(): sequence error (task %d)", adec.job.Peek().type);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -89,7 +89,7 @@ next:
|
||||
}
|
||||
else if (!Memory.CopyToReal(buf, adec.reader.addr, buf_size))
|
||||
{
|
||||
ConLog.Error("adecRawRead(): data reading failed (buf_size=0x%x)", buf_size);
|
||||
LOGF_ERROR(HLE, "adecRawRead(): data reading failed (buf_size=0x%x)", buf_size);
|
||||
Emu.Pause();
|
||||
return 0;
|
||||
}
|
||||
@ -111,7 +111,7 @@ int adecRead(void* opaque, u8* buf, int buf_size)
|
||||
{
|
||||
if (buf_size < (int)adec.reader.rem_size)
|
||||
{
|
||||
ConLog.Error("adecRead(): too small buf_size (rem_size = %d, buf_size = %d)", adec.reader.rem_size, buf_size);
|
||||
LOGF_ERROR(HLE, "adecRead(): too small buf_size (rem_size = %d, buf_size = %d)", adec.reader.rem_size, buf_size);
|
||||
Emu.Pause();
|
||||
return 0;
|
||||
}
|
||||
@ -131,7 +131,7 @@ int adecRead(void* opaque, u8* buf, int buf_size)
|
||||
if (adecRawRead(opaque, header, 8) < 8) break;
|
||||
if (header[0] != 0x0f || header[1] != 0xd0)
|
||||
{
|
||||
ConLog.Error("adecRead(): 0x0FD0 header not found");
|
||||
LOGF_ERROR(HLE, "adecRead(): 0x0FD0 header not found");
|
||||
Emu.Pause();
|
||||
return -1;
|
||||
}
|
||||
@ -141,7 +141,7 @@ int adecRead(void* opaque, u8* buf, int buf_size)
|
||||
OMAHeader oma(1 /* atrac3p id */, header[2], header[3]);
|
||||
if (buf_size < sizeof(oma) + 8)
|
||||
{
|
||||
ConLog.Error("adecRead(): OMAHeader writing failed");
|
||||
LOGF_ERROR(HLE, "adecRead(): OMAHeader writing failed");
|
||||
Emu.Pause();
|
||||
return 0;
|
||||
}
|
||||
@ -159,7 +159,7 @@ int adecRead(void* opaque, u8* buf, int buf_size)
|
||||
|
||||
u32 size = (((header[2] & 0x3) << 8) | header[3]) * 8 + 8; // data to be read before next header
|
||||
|
||||
//ConLog.Write("*** audio block read: size = 0x%x", size);
|
||||
//LOGF_NOTICE(HLE, "*** audio block read: size = 0x%x", size);
|
||||
|
||||
if (buf_size < (int)size)
|
||||
{
|
||||
@ -198,7 +198,7 @@ u32 adecOpen(AudioDecoder* data)
|
||||
|
||||
thread t("Audio Decoder[" + std::to_string(adec_id) + "] Thread", [&]()
|
||||
{
|
||||
ConLog.Write("Audio Decoder thread started");
|
||||
LOGF_NOTICE(HLE, "Audio Decoder thread started");
|
||||
|
||||
AdecTask& task = adec.task;
|
||||
|
||||
@ -231,7 +231,7 @@ u32 adecOpen(AudioDecoder* data)
|
||||
case adecStartSeq:
|
||||
{
|
||||
// TODO: reset data
|
||||
ConLog.Warning("adecStartSeq:");
|
||||
LOGF_WARNING(HLE, "adecStartSeq:");
|
||||
|
||||
adec.reader.addr = 0;
|
||||
adec.reader.size = 0;
|
||||
@ -247,7 +247,7 @@ u32 adecOpen(AudioDecoder* data)
|
||||
case adecEndSeq:
|
||||
{
|
||||
// TODO: finalize
|
||||
ConLog.Warning("adecEndSeq:");
|
||||
LOGF_WARNING(HLE, "adecEndSeq:");
|
||||
|
||||
/*Callback cb;
|
||||
cb.SetAddr(adec.cbFunc);
|
||||
@ -268,7 +268,7 @@ u32 adecOpen(AudioDecoder* data)
|
||||
|
||||
adec.reader.addr = task.au.addr;
|
||||
adec.reader.size = task.au.size;
|
||||
//ConLog.Write("Audio AU: size = 0x%x, pts = 0x%llx", task.au.size, task.au.pts);
|
||||
//LOGF_NOTICE(HLE, "Audio AU: size = 0x%x, pts = 0x%llx", task.au.size, task.au.pts);
|
||||
|
||||
if (adec.just_started)
|
||||
{
|
||||
@ -317,33 +317,33 @@ u32 adecOpen(AudioDecoder* data)
|
||||
err = avformat_open_input(&adec.fmt, NULL, av_find_input_format("oma"), NULL);
|
||||
if (err)
|
||||
{
|
||||
ConLog.Error("adecDecodeAu: avformat_open_input() failed");
|
||||
LOGF_ERROR(HLE, "adecDecodeAu: avformat_open_input() failed");
|
||||
Emu.Pause();
|
||||
break;
|
||||
}
|
||||
AVCodec* codec = avcodec_find_decoder(AV_CODEC_ID_ATRAC3P); // ???
|
||||
if (!codec)
|
||||
{
|
||||
ConLog.Error("adecDecodeAu: avcodec_find_decoder() failed");
|
||||
LOGF_ERROR(HLE, "adecDecodeAu: avcodec_find_decoder() failed");
|
||||
Emu.Pause();
|
||||
break;
|
||||
}
|
||||
/*err = avformat_find_stream_info(adec.fmt, NULL);
|
||||
if (err)
|
||||
{
|
||||
ConLog.Error("adecDecodeAu: avformat_find_stream_info() failed");
|
||||
LOGF_ERROR(HLE, "adecDecodeAu: avformat_find_stream_info() failed");
|
||||
Emu.Pause();
|
||||
break;
|
||||
}
|
||||
if (!adec.fmt->nb_streams)
|
||||
{
|
||||
ConLog.Error("adecDecodeAu: no stream found");
|
||||
LOGF_ERROR(HLE, "adecDecodeAu: no stream found");
|
||||
Emu.Pause();
|
||||
break;
|
||||
}*/
|
||||
if (!avformat_new_stream(adec.fmt, codec))
|
||||
{
|
||||
ConLog.Error("adecDecodeAu: avformat_new_stream() failed");
|
||||
LOGF_ERROR(HLE, "adecDecodeAu: avformat_new_stream() failed");
|
||||
Emu.Pause();
|
||||
break;
|
||||
}
|
||||
@ -358,7 +358,7 @@ u32 adecOpen(AudioDecoder* data)
|
||||
}
|
||||
if (err)
|
||||
{
|
||||
ConLog.Error("adecDecodeAu: avcodec_open2() failed");
|
||||
LOGF_ERROR(HLE, "adecDecodeAu: avcodec_open2() failed");
|
||||
Emu.Pause();
|
||||
break;
|
||||
}
|
||||
@ -371,7 +371,7 @@ u32 adecOpen(AudioDecoder* data)
|
||||
{
|
||||
if (Emu.IsStopped())
|
||||
{
|
||||
ConLog.Warning("adecDecodeAu: aborted");
|
||||
LOGF_WARNING(HLE, "adecDecodeAu: aborted");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -420,7 +420,7 @@ u32 adecOpen(AudioDecoder* data)
|
||||
|
||||
if (!frame.data)
|
||||
{
|
||||
ConLog.Error("adecDecodeAu: av_frame_alloc() failed");
|
||||
LOGF_ERROR(HLE, "adecDecodeAu: av_frame_alloc() failed");
|
||||
Emu.Pause();
|
||||
break;
|
||||
}
|
||||
@ -433,7 +433,7 @@ u32 adecOpen(AudioDecoder* data)
|
||||
{
|
||||
if (!last_frame && decode < 0)
|
||||
{
|
||||
ConLog.Error("adecDecodeAu: AU decoding error(0x%x)", decode);
|
||||
LOGF_ERROR(HLE, "adecDecodeAu: AU decoding error(0x%x)", decode);
|
||||
}
|
||||
if (!got_frame && adec.reader.size == 0) break;
|
||||
}
|
||||
@ -460,18 +460,18 @@ u32 adecOpen(AudioDecoder* data)
|
||||
|
||||
if (frame.data->format != AV_SAMPLE_FMT_FLTP)
|
||||
{
|
||||
ConLog.Error("adecDecodeaAu: unsupported frame format(%d)", frame.data->format);
|
||||
LOGF_ERROR(HLE, "adecDecodeaAu: unsupported frame format(%d)", frame.data->format);
|
||||
Emu.Pause();
|
||||
break;
|
||||
}
|
||||
if (frame.data->channels != 2)
|
||||
{
|
||||
ConLog.Error("adecDecodeAu: unsupported channel count (%d)", frame.data->channels);
|
||||
LOGF_ERROR(HLE, "adecDecodeAu: unsupported channel count (%d)", frame.data->channels);
|
||||
Emu.Pause();
|
||||
break;
|
||||
}
|
||||
|
||||
//ConLog.Write("got audio frame (pts=0x%llx, nb_samples=%d, ch=%d, sample_rate=%d, nbps=%d)",
|
||||
//LOGF_NOTICE(HLE, "got audio frame (pts=0x%llx, nb_samples=%d, ch=%d, sample_rate=%d, nbps=%d)",
|
||||
//frame.pts, frame.data->nb_samples, frame.data->channels, frame.data->sample_rate,
|
||||
//av_get_bytes_per_sample((AVSampleFormat)frame.data->format));
|
||||
|
||||
@ -497,16 +497,16 @@ u32 adecOpen(AudioDecoder* data)
|
||||
case adecClose:
|
||||
{
|
||||
adec.is_finished = true;
|
||||
ConLog.Write("Audio Decoder thread ended");
|
||||
LOGF_NOTICE(HLE, "Audio Decoder thread ended");
|
||||
return;
|
||||
}
|
||||
|
||||
default:
|
||||
ConLog.Error("Audio Decoder thread error: unknown task(%d)", task.type);
|
||||
LOGF_ERROR(HLE, "Audio Decoder thread error: unknown task(%d)", task.type);
|
||||
}
|
||||
}
|
||||
adec.is_finished = true;
|
||||
ConLog.Warning("Audio Decoder thread aborted");
|
||||
LOGF_WARNING(HLE, "Audio Decoder thread aborted");
|
||||
});
|
||||
|
||||
t.detach();
|
||||
@ -518,8 +518,8 @@ bool adecCheckType(AudioCodecType type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case CELL_ADEC_TYPE_ATRACX: ConLog.Write("*** (?) type: ATRAC3plus"); break;
|
||||
case CELL_ADEC_TYPE_ATRACX_2CH: ConLog.Write("*** type: ATRAC3plus 2ch"); break;
|
||||
case CELL_ADEC_TYPE_ATRACX: LOGF_NOTICE(HLE, "*** (?) type: ATRAC3plus"); break;
|
||||
case CELL_ADEC_TYPE_ATRACX_2CH: LOGF_NOTICE(HLE, "*** type: ATRAC3plus 2ch"); break;
|
||||
|
||||
case CELL_ADEC_TYPE_ATRACX_6CH:
|
||||
case CELL_ADEC_TYPE_ATRACX_8CH:
|
||||
@ -609,7 +609,7 @@ int cellAdecClose(u32 handle)
|
||||
{
|
||||
if (Emu.IsStopped())
|
||||
{
|
||||
ConLog.Warning("cellAdecClose(%d) aborted", handle);
|
||||
LOGF_WARNING(HLE, "cellAdecClose(%d) aborted", handle);
|
||||
break;
|
||||
}
|
||||
Sleep(1);
|
||||
@ -732,7 +732,7 @@ int cellAdecGetPcm(u32 handle, u32 outBuffer_addr)
|
||||
|
||||
if (!swr)
|
||||
{
|
||||
ConLog.Error("cellAdecGetPcm(%d): swr_alloc_set_opts() failed", handle);
|
||||
LOGF_ERROR(HLE, "cellAdecGetPcm(%d): swr_alloc_set_opts() failed", handle);
|
||||
Emu.Pause();
|
||||
free(out);
|
||||
if (af.data)
|
||||
@ -759,7 +759,7 @@ int cellAdecGetPcm(u32 handle, u32 outBuffer_addr)
|
||||
|
||||
if (!Memory.CopyFromReal(outBuffer_addr, out, af.size))
|
||||
{
|
||||
ConLog.Error("cellAdecGetPcm(%d): data copying failed (addr=0x%x)", handle, outBuffer_addr);
|
||||
LOGF_ERROR(HLE, "cellAdecGetPcm(%d): data copying failed (addr=0x%x)", handle, outBuffer_addr);
|
||||
Emu.Pause();
|
||||
}
|
||||
|
||||
|
@ -1133,14 +1133,14 @@ public:
|
||||
AVCodec* codec = avcodec_find_decoder(AV_CODEC_ID_ATRAC3P);
|
||||
if (!codec)
|
||||
{
|
||||
ConLog.Error("AudioDecoder(): avcodec_find_decoder(ATRAC3P) failed");
|
||||
LOGF_ERROR(HLE, "AudioDecoder(): avcodec_find_decoder(ATRAC3P) failed");
|
||||
Emu.Pause();
|
||||
return;
|
||||
}
|
||||
fmt = avformat_alloc_context();
|
||||
if (!fmt)
|
||||
{
|
||||
ConLog.Error("AudioDecoder(): avformat_alloc_context failed");
|
||||
LOGF_ERROR(HLE, "AudioDecoder(): avformat_alloc_context failed");
|
||||
Emu.Pause();
|
||||
return;
|
||||
}
|
||||
@ -1148,7 +1148,7 @@ public:
|
||||
fmt->pb = avio_alloc_context(io_buf, 4096, 0, this, adecRead, NULL, NULL);
|
||||
if (!fmt->pb)
|
||||
{
|
||||
ConLog.Error("AudioDecoder(): avio_alloc_context failed");
|
||||
LOGF_ERROR(HLE, "AudioDecoder(): avio_alloc_context failed");
|
||||
Emu.Pause();
|
||||
return;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/Cell/PPUThread.h"
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/Cell/PPUThread.h"
|
||||
@ -50,11 +50,11 @@ int cellAudioInit()
|
||||
|
||||
if (do_dump && !m_dump.Init())
|
||||
{
|
||||
ConLog.Error("cellAudioInit(): AudioDumper::Init() failed");
|
||||
LOGF_ERROR(HLE, "cellAudioInit(): AudioDumper::Init() failed");
|
||||
return;
|
||||
}
|
||||
|
||||
ConLog.Write("Audio thread started");
|
||||
LOGF_NOTICE(HLE, "Audio thread started");
|
||||
|
||||
if (Ini.AudioDumpToFile.GetValue())
|
||||
m_dump.WriteHeader();
|
||||
@ -146,7 +146,7 @@ int cellAudioInit()
|
||||
{
|
||||
if (Emu.IsStopped())
|
||||
{
|
||||
ConLog.Warning("Audio thread aborted");
|
||||
LOGF_WARNING(HLE, "Audio thread aborted");
|
||||
goto abort;
|
||||
}
|
||||
|
||||
@ -426,7 +426,7 @@ int cellAudioInit()
|
||||
{
|
||||
if (m_dump.WriteData(&buf8ch, sizeof(buf8ch)) != sizeof(buf8ch)) // write file data
|
||||
{
|
||||
ConLog.Error("cellAudioInit(): AudioDumper::WriteData() failed");
|
||||
LOGF_ERROR(HLE, "cellAudioInit(): AudioDumper::WriteData() failed");
|
||||
goto abort;
|
||||
}
|
||||
}
|
||||
@ -434,21 +434,21 @@ int cellAudioInit()
|
||||
{
|
||||
if (m_dump.WriteData(&buf2ch, sizeof(buf2ch)) != sizeof(buf2ch)) // write file data
|
||||
{
|
||||
ConLog.Error("cellAudioInit(): AudioDumper::WriteData() failed");
|
||||
LOGF_ERROR(HLE, "cellAudioInit(): AudioDumper::WriteData() failed");
|
||||
goto abort;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ConLog.Error("cellAudioInit(): unknown AudioDumper::GetCh() value (%d)", m_dump.GetCh());
|
||||
LOGF_ERROR(HLE, "cellAudioInit(): unknown AudioDumper::GetCh() value (%d)", m_dump.GetCh());
|
||||
goto abort;
|
||||
}
|
||||
}
|
||||
|
||||
//ConLog.Write("Audio perf: start=%d (access=%d, AddData=%d, events=%d, dump=%d)",
|
||||
//LOGF_NOTICE(HLE, "Audio perf: start=%d (access=%d, AddData=%d, events=%d, dump=%d)",
|
||||
//stamp0 - m_config.start_time, stamp1 - stamp0, stamp2 - stamp1, stamp3 - stamp2, get_system_time() - stamp3);
|
||||
}
|
||||
ConLog.Write("Audio thread ended");
|
||||
LOGF_NOTICE(HLE, "Audio thread ended");
|
||||
abort:
|
||||
queue.Push(nullptr);
|
||||
queue_float.Push(nullptr);
|
||||
@ -480,7 +480,7 @@ abort:
|
||||
{
|
||||
if (Emu.IsStopped())
|
||||
{
|
||||
ConLog.Warning("cellAudioInit() aborted");
|
||||
LOGF_WARNING(HLE, "cellAudioInit() aborted");
|
||||
return CELL_OK;
|
||||
}
|
||||
Sleep(1);
|
||||
@ -505,7 +505,7 @@ int cellAudioQuit()
|
||||
Sleep(1);
|
||||
if (Emu.IsStopped())
|
||||
{
|
||||
ConLog.Warning("cellAudioQuit(): aborted");
|
||||
LOGF_WARNING(HLE, "cellAudioQuit(): aborted");
|
||||
return CELL_OK;
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/Cell/PPUThread.h"
|
||||
@ -47,7 +47,7 @@ u32 dmuxOpen(Demuxer* data)
|
||||
|
||||
thread t("Demuxer[" + std::to_string(dmux_id) + "] Thread", [&]()
|
||||
{
|
||||
ConLog.Write("Demuxer thread started (mem=0x%x, size=0x%x, cb=0x%x, arg=0x%x)", dmux.memAddr, dmux.memSize, dmux.cbFunc, dmux.cbArg);
|
||||
LOGF_NOTICE(HLE, "Demuxer thread started (mem=0x%x, size=0x%x, cb=0x%x, arg=0x%x)", dmux.memAddr, dmux.memSize, dmux.cbFunc, dmux.cbArg);
|
||||
|
||||
DemuxerTask task;
|
||||
DemuxerStream stream;
|
||||
@ -134,7 +134,7 @@ u32 dmuxOpen(Demuxer* data)
|
||||
|
||||
if (!pes.new_au) // temporarily
|
||||
{
|
||||
ConLog.Error("No pts info found");
|
||||
LOGF_ERROR(HLE, "No pts info found");
|
||||
}
|
||||
|
||||
// read additional header:
|
||||
@ -149,7 +149,7 @@ u32 dmuxOpen(Demuxer* data)
|
||||
{
|
||||
if (Emu.IsStopped())
|
||||
{
|
||||
ConLog.Warning("esATX[%d] was full, waiting aborted", ch);
|
||||
LOGF_WARNING(HLE, "esATX[%d] was full, waiting aborted", ch);
|
||||
return;
|
||||
}
|
||||
Sleep(1);
|
||||
@ -166,7 +166,7 @@ u32 dmuxOpen(Demuxer* data)
|
||||
|
||||
es.push(stream, len - pes.size - 3, pes);
|
||||
es.finish(stream);
|
||||
//ConLog.Write("*** AT3+ AU sent (len=0x%x, pts=0x%llx)", len - pes.size - 3, pes.pts);
|
||||
//LOGF_NOTICE(HLE, "*** AT3+ AU sent (len=0x%x, pts=0x%llx)", len - pes.size - 3, pes.pts);
|
||||
|
||||
mem_ptr_t<CellDmuxEsMsg> esMsg(a128(dmux.memAddr) + (cb_add ^= 16));
|
||||
esMsg->msgType = CELL_DMUX_ES_MSG_TYPE_AU_FOUND;
|
||||
@ -198,7 +198,7 @@ u32 dmuxOpen(Demuxer* data)
|
||||
{
|
||||
if (Emu.IsStopped())
|
||||
{
|
||||
ConLog.Warning("esAVC[%d] was full, waiting aborted", ch);
|
||||
LOGF_WARNING(HLE, "esAVC[%d] was full, waiting aborted", ch);
|
||||
return;
|
||||
}
|
||||
Sleep(1);
|
||||
@ -236,7 +236,7 @@ u32 dmuxOpen(Demuxer* data)
|
||||
|
||||
if (pes.new_au)
|
||||
{
|
||||
//ConLog.Write("*** AVC AU detected (pts=0x%llx, dts=0x%llx)", pes.pts, pes.dts);
|
||||
//LOGF_NOTICE(HLE, "*** AVC AU detected (pts=0x%llx, dts=0x%llx)", pes.pts, pes.dts);
|
||||
}
|
||||
|
||||
if (es.isfull())
|
||||
@ -268,7 +268,7 @@ u32 dmuxOpen(Demuxer* data)
|
||||
case 0x1dc: case 0x1dd: case 0x1de: case 0x1df:
|
||||
{
|
||||
// unknown
|
||||
ConLog.Warning("Unknown MPEG stream found");
|
||||
LOGF_WARNING(HLE, "Unknown MPEG stream found");
|
||||
stream.skip(4);
|
||||
stream.get(len);
|
||||
stream.skip(len);
|
||||
@ -277,7 +277,7 @@ u32 dmuxOpen(Demuxer* data)
|
||||
|
||||
case USER_DATA_START_CODE:
|
||||
{
|
||||
ConLog.Error("USER_DATA_START_CODE found");
|
||||
LOGF_ERROR(HLE, "USER_DATA_START_CODE found");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -304,7 +304,7 @@ u32 dmuxOpen(Demuxer* data)
|
||||
{
|
||||
if (task.stream.discontinuity)
|
||||
{
|
||||
ConLog.Warning("dmuxSetStream (beginning)");
|
||||
LOGF_WARNING(HLE, "dmuxSetStream (beginning)");
|
||||
for (u32 i = 0; i < 192; i++)
|
||||
{
|
||||
if (esALL[i])
|
||||
@ -318,13 +318,13 @@ u32 dmuxOpen(Demuxer* data)
|
||||
|
||||
if (updates_count != updates_signaled)
|
||||
{
|
||||
ConLog.Error("dmuxSetStream: stream update inconsistency (input=%d, signaled=%d)", updates_count, updates_signaled);
|
||||
LOGF_ERROR(HLE, "dmuxSetStream: stream update inconsistency (input=%d, signaled=%d)", updates_count, updates_signaled);
|
||||
return;
|
||||
}
|
||||
|
||||
updates_count++;
|
||||
stream = task.stream;
|
||||
//ConLog.Write("*** stream updated(addr=0x%x, size=0x%x, discont=%d, userdata=0x%llx)",
|
||||
//LOGF_NOTICE(HLE, "*** stream updated(addr=0x%x, size=0x%x, discont=%d, userdata=0x%llx)",
|
||||
//stream.addr, stream.size, stream.discontinuity, stream.userdata);
|
||||
|
||||
dmux.is_running = true;
|
||||
@ -357,7 +357,7 @@ u32 dmuxOpen(Demuxer* data)
|
||||
case dmuxClose:
|
||||
{
|
||||
dmux.is_finished = true;
|
||||
ConLog.Write("Demuxer thread ended");
|
||||
LOGF_NOTICE(HLE, "Demuxer thread ended");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -381,7 +381,7 @@ u32 dmuxOpen(Demuxer* data)
|
||||
}
|
||||
else
|
||||
{
|
||||
ConLog.Warning("dmuxEnableEs: (TODO) unsupported filter (0x%x, 0x%x, 0x%x, 0x%x)", es.fidMajor, es.fidMinor, es.sup1, es.sup2);
|
||||
LOGF_WARNING(HLE, "dmuxEnableEs: (TODO) unsupported filter (0x%x, 0x%x, 0x%x, 0x%x)", es.fidMajor, es.fidMinor, es.sup1, es.sup2);
|
||||
}
|
||||
es.dmux = &dmux;
|
||||
}
|
||||
@ -392,7 +392,7 @@ u32 dmuxOpen(Demuxer* data)
|
||||
ElementaryStream& es = *task.es.es_ptr;
|
||||
if (es.dmux != &dmux)
|
||||
{
|
||||
ConLog.Warning("dmuxDisableEs: invalid elementary stream");
|
||||
LOGF_WARNING(HLE, "dmuxDisableEs: invalid elementary stream");
|
||||
break;
|
||||
}
|
||||
for (u32 i = 0; i < 192; i++)
|
||||
@ -450,11 +450,11 @@ u32 dmuxOpen(Demuxer* data)
|
||||
break;
|
||||
|
||||
default:
|
||||
ConLog.Error("Demuxer thread error: unknown task(%d)", task.type);
|
||||
LOGF_ERROR(HLE, "Demuxer thread error: unknown task(%d)", task.type);
|
||||
return;
|
||||
}
|
||||
}
|
||||
ConLog.Warning("Demuxer thread aborted");
|
||||
LOGF_WARNING(HLE, "Demuxer thread aborted");
|
||||
});
|
||||
|
||||
t.detach();
|
||||
@ -598,7 +598,7 @@ int cellDmuxClose(u32 demuxerHandle)
|
||||
{
|
||||
if (Emu.IsStopped())
|
||||
{
|
||||
ConLog.Warning("cellDmuxClose(%d) aborted", demuxerHandle);
|
||||
LOGF_WARNING(HLE, "cellDmuxClose(%d) aborted", demuxerHandle);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@ -630,7 +630,7 @@ int cellDmuxSetStream(u32 demuxerHandle, const u32 streamAddress, u32 streamSize
|
||||
{
|
||||
if (Emu.IsStopped())
|
||||
{
|
||||
ConLog.Warning("cellDmuxSetStream(%d) aborted (waiting)", demuxerHandle);
|
||||
LOGF_WARNING(HLE, "cellDmuxSetStream(%d) aborted (waiting)", demuxerHandle);
|
||||
return CELL_OK;
|
||||
}
|
||||
Sleep(1);
|
||||
@ -649,12 +649,12 @@ int cellDmuxSetStream(u32 demuxerHandle, const u32 streamAddress, u32 streamSize
|
||||
u32 addr;
|
||||
if (!dmux->fbSetStream.Pop(addr))
|
||||
{
|
||||
ConLog.Warning("cellDmuxSetStream(%d) aborted (fbSetStream.Pop())", demuxerHandle);
|
||||
LOGF_WARNING(HLE, "cellDmuxSetStream(%d) aborted (fbSetStream.Pop())", demuxerHandle);
|
||||
return CELL_OK;
|
||||
}
|
||||
if (addr != info.addr)
|
||||
{
|
||||
ConLog.Error("cellDmuxSetStream(%d): wrong stream queued (right=0x%x, queued=0x%x)", demuxerHandle, info.addr, addr);
|
||||
LOGF_ERROR(HLE, "cellDmuxSetStream(%d): wrong stream queued (right=0x%x, queued=0x%x)", demuxerHandle, info.addr, addr);
|
||||
Emu.Pause();
|
||||
}
|
||||
return CELL_OK;
|
||||
@ -690,12 +690,12 @@ int cellDmuxResetStreamAndWaitDone(u32 demuxerHandle)
|
||||
u32 addr;
|
||||
if (!dmux->fbSetStream.Pop(addr))
|
||||
{
|
||||
ConLog.Warning("cellDmuxResetStreamAndWaitDone(%d) aborted (fbSetStream.Pop())", demuxerHandle);
|
||||
LOGF_WARNING(HLE, "cellDmuxResetStreamAndWaitDone(%d) aborted (fbSetStream.Pop())", demuxerHandle);
|
||||
return CELL_OK;
|
||||
}
|
||||
if (addr != 0)
|
||||
{
|
||||
ConLog.Error("cellDmuxResetStreamAndWaitDone(%d): wrong stream queued (0x%x)", demuxerHandle, addr);
|
||||
LOGF_ERROR(HLE, "cellDmuxResetStreamAndWaitDone(%d): wrong stream queued (0x%x)", demuxerHandle, addr);
|
||||
Emu.Pause();
|
||||
}
|
||||
return CELL_OK;
|
||||
@ -1013,4 +1013,4 @@ void cellDmux_init()
|
||||
cellDmux->AddFunc(0x002e8da2, cellDmuxPeekAuEx);
|
||||
cellDmux->AddFunc(0x24ea6474, cellDmuxReleaseAu);
|
||||
cellDmux->AddFunc(0xebb3b2bd, cellDmuxFlushEs);
|
||||
}
|
||||
}
|
||||
|
@ -394,14 +394,14 @@ struct PesHeader
|
||||
new_au = true;
|
||||
if ((v & 0xF0) != 0x30 || (size - empty) < 10)
|
||||
{
|
||||
ConLog.Error("PesHeader(): pts not found");
|
||||
LOGF_ERROR(HLE, "PesHeader(): pts not found");
|
||||
Emu.Pause();
|
||||
}
|
||||
pts = stream.get_ts(v);
|
||||
stream.get(v);
|
||||
if ((v & 0xF0) != 0x10)
|
||||
{
|
||||
ConLog.Error("PesHeader(): dts not found");
|
||||
LOGF_ERROR(HLE, "PesHeader(): dts not found");
|
||||
Emu.Pause();
|
||||
}
|
||||
dts = stream.get_ts(v);
|
||||
@ -557,7 +557,7 @@ public:
|
||||
{
|
||||
if (size > GetMaxAU())
|
||||
{
|
||||
ConLog.Error("es::freespace(): last_size too big (size=0x%x, max_au=0x%x)", size, GetMaxAU());
|
||||
LOGF_ERROR(HLE, "es::freespace(): last_size too big (size=0x%x, max_au=0x%x)", size, GetMaxAU());
|
||||
Emu.Pause();
|
||||
return 0;
|
||||
}
|
||||
@ -587,7 +587,7 @@ public:
|
||||
u32 addr;
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(m_mutex);
|
||||
//if (fidMajor != 0xbd) ConLog.Write(">>> es::finish(): peek=0x%x, first=0x%x, put=0x%x, size=0x%x", peek, first, put, size);
|
||||
//if (fidMajor != 0xbd) LOGF_NOTICE(HLE, ">>> es::finish(): peek=0x%x, first=0x%x, put=0x%x, size=0x%x", peek, first, put, size);
|
||||
|
||||
addr = put;
|
||||
/*if (!first)
|
||||
@ -600,7 +600,7 @@ public:
|
||||
}*/
|
||||
|
||||
mem_ptr_t<CellDmuxAuInfo> info(put);
|
||||
//if (fidMajor != 0xbd) ConLog.Warning("es::finish(): (%s) size = 0x%x, info_addr=0x%x, pts = 0x%x",
|
||||
//if (fidMajor != 0xbd) LOGF_WARNING(HLE, "es::finish(): (%s) size = 0x%x, info_addr=0x%x, pts = 0x%x",
|
||||
//wxString(fidMajor == 0xbd ? "ATRAC3P Audio" : "Video AVC").wx_str(),
|
||||
//(u32)info->auSize, put, (u32)info->ptsLower);
|
||||
|
||||
@ -611,11 +611,11 @@ public:
|
||||
size = 0;
|
||||
|
||||
put_count++;
|
||||
//if (fidMajor != 0xbd) ConLog.Write("<<< es::finish(): peek=0x%x, first=0x%x, put=0x%x, size=0x%x", peek, first, put, size);
|
||||
//if (fidMajor != 0xbd) LOGF_NOTICE(HLE, "<<< es::finish(): peek=0x%x, first=0x%x, put=0x%x, size=0x%x", peek, first, put, size);
|
||||
}
|
||||
if (!entries.Push(addr))
|
||||
{
|
||||
ConLog.Error("es::finish() aborted (no space)");
|
||||
LOGF_ERROR(HLE, "es::finish() aborted (no space)");
|
||||
}
|
||||
}
|
||||
|
||||
@ -625,7 +625,7 @@ public:
|
||||
|
||||
if (is_full())
|
||||
{
|
||||
ConLog.Error("es::push(): buffer is full");
|
||||
LOGF_ERROR(HLE, "es::push(): buffer is full");
|
||||
Emu.Pause();
|
||||
return;
|
||||
}
|
||||
@ -634,7 +634,7 @@ public:
|
||||
size += sz;
|
||||
if (!Memory.Copy(data_addr, stream.addr, sz))
|
||||
{
|
||||
ConLog.Error("es::push(): data copying failed");
|
||||
LOGF_ERROR(HLE, "es::push(): data copying failed");
|
||||
Emu.Pause();
|
||||
return;
|
||||
}
|
||||
@ -674,22 +674,22 @@ public:
|
||||
bool release()
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(m_mutex);
|
||||
//if (fidMajor != 0xbd) ConLog.Write(">>> es::release(): peek=0x%x, first=0x%x, put=0x%x, size=0x%x", peek, first, put, size);
|
||||
//if (fidMajor != 0xbd) LOGF_NOTICE(HLE, ">>> es::release(): peek=0x%x, first=0x%x, put=0x%x, size=0x%x", peek, first, put, size);
|
||||
if (released >= put_count)
|
||||
{
|
||||
ConLog.Error("es::release(): buffer is empty");
|
||||
LOGF_ERROR(HLE, "es::release(): buffer is empty");
|
||||
return false;
|
||||
}
|
||||
|
||||
u32 addr = entries.Peek();
|
||||
|
||||
mem_ptr_t<CellDmuxAuInfo> info(addr);
|
||||
//if (fidMajor != 0xbd) ConLog.Warning("es::release(): (%s) size = 0x%x, info = 0x%x, pts = 0x%x",
|
||||
//if (fidMajor != 0xbd) LOGF_WARNING(HLE, "es::release(): (%s) size = 0x%x, info = 0x%x, pts = 0x%x",
|
||||
//wxString(fidMajor == 0xbd ? "ATRAC3P Audio" : "Video AVC").wx_str(), (u32)info->auSize, first, (u32)info->ptsLower);
|
||||
|
||||
if (released >= peek_count)
|
||||
{
|
||||
ConLog.Error("es::release(): buffer has not been seen yet");
|
||||
LOGF_ERROR(HLE, "es::release(): buffer has not been seen yet");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -711,30 +711,30 @@ public:
|
||||
released++;
|
||||
if (!entries.Pop(addr))
|
||||
{
|
||||
ConLog.Error("es::release(): entries.Pop() aborted (no entries found)");
|
||||
LOGF_ERROR(HLE, "es::release(): entries.Pop() aborted (no entries found)");
|
||||
return false;
|
||||
}
|
||||
//if (fidMajor != 0xbd) ConLog.Write("<<< es::release(): peek=0x%x, first=0x%x, put=0x%x, size=0x%x", peek, first, put, size);
|
||||
//if (fidMajor != 0xbd) LOGF_NOTICE(HLE, "<<< es::release(): peek=0x%x, first=0x%x, put=0x%x, size=0x%x", peek, first, put, size);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool peek(u32& out_data, bool no_ex, u32& out_spec, bool update_index)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(m_mutex);
|
||||
//if (fidMajor != 0xbd) ConLog.Write(">>> es::peek(%sAu%s): peek=0x%x, first=0x%x, put=0x%x, size=0x%x", wxString(update_index ? "Get" : "Peek").wx_str(),
|
||||
//if (fidMajor != 0xbd) LOGF_NOTICE(HLE, ">>> es::peek(%sAu%s): peek=0x%x, first=0x%x, put=0x%x, size=0x%x", wxString(update_index ? "Get" : "Peek").wx_str(),
|
||||
//wxString(no_ex ? "" : "Ex").wx_str(), peek, first, put, size);
|
||||
if (peek_count >= put_count) return false;
|
||||
|
||||
if (peek_count < released)
|
||||
{
|
||||
ConLog.Error("es::peek(): sequence error: peek_count < released (peek_count=%d, released=%d)", peek_count, released);
|
||||
LOGF_ERROR(HLE, "es::peek(): sequence error: peek_count < released (peek_count=%d, released=%d)", peek_count, released);
|
||||
Emu.Pause();
|
||||
return false;
|
||||
}
|
||||
|
||||
u32 addr = entries.Peek(peek_count - released);
|
||||
mem_ptr_t<CellDmuxAuInfo> info(addr);
|
||||
//if (fidMajor != 0xbd) ConLog.Warning("es::peek(%sAu(Ex)): (%s) size = 0x%x, info = 0x%x, pts = 0x%x",
|
||||
//if (fidMajor != 0xbd) LOGF_WARNING(HLE, "es::peek(%sAu(Ex)): (%s) size = 0x%x, info = 0x%x, pts = 0x%x",
|
||||
//wxString(update_index ? "Get" : "Peek").wx_str(),
|
||||
//wxString(fidMajor == 0xbd ? "ATRAC3P Audio" : "Video AVC").wx_str(), (u32)info->auSize, peek, (u32)info->ptsLower);
|
||||
|
||||
@ -760,7 +760,7 @@ public:
|
||||
peek_count++;
|
||||
}
|
||||
|
||||
//if (fidMajor != 0xbd) ConLog.Write("<<< es::peek(%sAu%s): peek=0x%x, first=0x%x, put=0x%x, size=0x%x", wxString(update_index ? "Get" : "Peek").wx_str(),
|
||||
//if (fidMajor != 0xbd) LOGF_NOTICE(HLE, "<<< es::peek(%sAu%s): peek=0x%x, first=0x%x, put=0x%x, size=0x%x", wxString(update_index ? "Get" : "Peek").wx_str(),
|
||||
//wxString(no_ex ? "" : "Ex").wx_str(), peek, first, put, size);
|
||||
return true;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/Cell/PPUThread.h"
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/Cell/PPUThread.h"
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/Cell/PPUThread.h"
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/Cell/PPUThread.h"
|
||||
@ -478,7 +478,7 @@ int cellGcmSetPrepareFlip(mem_ptr_t<CellGcmContextData> ctxt, u32 id)
|
||||
|
||||
if(current + 8 >= end)
|
||||
{
|
||||
ConLog.Warning("bad flip!");
|
||||
LOG_WARNING(HLE, "bad flip!");
|
||||
//cellGcmCallback(ctxt.GetAddr(), current + 8 - end);
|
||||
//copied:
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/Cell/PPUThread.h"
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/Cell/PPUThread.h"
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/Cell/PPUThread.h"
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/Cell/PPUThread.h"
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/Cell/PPUThread.h"
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/Cell/PPUThread.h"
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/Cell/PPUThread.h"
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/Cell/PPUThread.h"
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/Cell/PPUThread.h"
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/Cell/PPUThread.h"
|
||||
@ -93,7 +93,7 @@ int cellSyncMutexLock(mem_ptr_t<CellSyncMutex> mutex)
|
||||
Sleep(1);
|
||||
if (Emu.IsStopped())
|
||||
{
|
||||
ConLog.Warning("cellSyncMutexLock(mutex=0x%x) aborted", mutex.GetAddr());
|
||||
LOGF_WARNING(HLE, "cellSyncMutexLock(mutex=0x%x) aborted", mutex.GetAddr());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/Cell/PPUThread.h"
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/Cell/PPUThread.h"
|
||||
@ -350,7 +350,7 @@ int cellSysutilCheckCallback()
|
||||
Sleep(1);
|
||||
if (Emu.IsStopped())
|
||||
{
|
||||
ConLog.Warning("cellSysutilCheckCallback() aborted");
|
||||
LOG_WARNING(HLE, "cellSysutilCheckCallback() aborted");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/Cell/PPUThread.h"
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/Cell/PPUThread.h"
|
||||
@ -230,7 +230,7 @@ s32 modifySaveDataFiles(mem_func_ptr_t<CellSaveDataFileCallback>& funcFile, mem_
|
||||
{
|
||||
funcFile(result.GetAddr(), fileGet.GetAddr(), fileSet.GetAddr());
|
||||
if (result->result < 0) {
|
||||
ConLog.Error("modifySaveDataFiles: CellSaveDataFileCallback failed."); // TODO: Once we verify that the entire SysCall is working, delete this debug error message.
|
||||
LOGF_ERROR(HLE, "modifySaveDataFiles: CellSaveDataFileCallback failed."); // TODO: Once we verify that the entire SysCall is working, delete this debug error message.
|
||||
return CELL_SAVEDATA_ERROR_CBRESULT;
|
||||
}
|
||||
if (result->result == CELL_SAVEDATA_CBRESULT_OK_LAST) {
|
||||
@ -251,7 +251,7 @@ s32 modifySaveDataFiles(mem_func_ptr_t<CellSaveDataFileCallback>& funcFile, mem_
|
||||
case CELL_SAVEDATA_FILETYPE_CONTENT_SND0: filepath += "SND0.AT3"; break;
|
||||
|
||||
default:
|
||||
ConLog.Error("modifySaveDataFiles: Unknown fileType! Aborting...");
|
||||
LOGF_ERROR(HLE, "modifySaveDataFiles: Unknown fileType! Aborting...");
|
||||
return CELL_SAVEDATA_ERROR_PARAM;
|
||||
}
|
||||
|
||||
@ -274,11 +274,11 @@ s32 modifySaveDataFiles(mem_func_ptr_t<CellSaveDataFileCallback>& funcFile, mem_
|
||||
break;
|
||||
|
||||
case CELL_SAVEDATA_FILEOP_WRITE_NOTRUNC:
|
||||
ConLog.Warning("modifySaveDataFiles: File operation CELL_SAVEDATA_FILEOP_WRITE_NOTRUNC not yet implemented");
|
||||
LOGF_WARNING(HLE, "modifySaveDataFiles: File operation CELL_SAVEDATA_FILEOP_WRITE_NOTRUNC not yet implemented");
|
||||
break;
|
||||
|
||||
default:
|
||||
ConLog.Error("modifySaveDataFiles: Unknown fileOperation! Aborting...");
|
||||
LOGF_ERROR(HLE, "modifySaveDataFiles: Unknown fileOperation! Aborting...");
|
||||
return CELL_SAVEDATA_ERROR_PARAM;
|
||||
}
|
||||
|
||||
@ -339,7 +339,7 @@ int cellSaveDataListSave2(u32 version, mem_ptr_t<CellSaveDataSetList> setList, m
|
||||
|
||||
funcList(result.GetAddr(), listGet.GetAddr(), listSet.GetAddr());
|
||||
if (result->result < 0) {
|
||||
ConLog.Error("cellSaveDataListSave2: CellSaveDataListCallback failed."); // TODO: Once we verify that the entire SysCall is working, delete this debug error message.
|
||||
LOGF_ERROR(HLE, "cellSaveDataListSave2: CellSaveDataListCallback failed."); // TODO: Once we verify that the entire SysCall is working, delete this debug error message.
|
||||
return CELL_SAVEDATA_ERROR_CBRESULT;
|
||||
}
|
||||
if (!listSet->fixedList.IsGood())
|
||||
@ -349,7 +349,7 @@ int cellSaveDataListSave2(u32 version, mem_ptr_t<CellSaveDataSetList> setList, m
|
||||
if (listSet->newData.IsGood())
|
||||
addNewSaveDataEntry(saveEntries, (u32)listSet->newData.GetAddr());
|
||||
if (saveEntries.size() == 0) {
|
||||
ConLog.Warning("cellSaveDataListSave2: No save entries found!"); // TODO: Find a better way to handle this error
|
||||
LOGF_WARNING(HLE, "cellSaveDataListSave2: No save entries found!"); // TODO: Find a better way to handle this error
|
||||
return CELL_SAVEDATA_RET_OK;
|
||||
}
|
||||
|
||||
@ -362,7 +362,7 @@ int cellSaveDataListSave2(u32 version, mem_ptr_t<CellSaveDataSetList> setList, m
|
||||
funcStat(result.GetAddr(), statGet.GetAddr(), statSet.GetAddr());
|
||||
Memory.Free(statGet->fileList.GetAddr());
|
||||
if (result->result < 0) {
|
||||
ConLog.Error("cellSaveDataListLoad2: CellSaveDataStatCallback failed."); // TODO: Once we verify that the entire SysCall is working, delete this debug error message.
|
||||
LOGF_ERROR(HLE, "cellSaveDataListLoad2: CellSaveDataStatCallback failed."); // TODO: Once we verify that the entire SysCall is working, delete this debug error message.
|
||||
return CELL_SAVEDATA_ERROR_CBRESULT;
|
||||
}
|
||||
/*if (statSet->setParam.IsGood())
|
||||
@ -424,7 +424,7 @@ int cellSaveDataListLoad2(u32 version, mem_ptr_t<CellSaveDataSetList> setList, m
|
||||
|
||||
funcList(result.GetAddr(), listGet.GetAddr(), listSet.GetAddr());
|
||||
if (result->result < 0) {
|
||||
ConLog.Error("cellSaveDataListLoad2: CellSaveDataListCallback failed."); // TODO: Once we verify that the entire SysCall is working, delete this debug error message.
|
||||
LOGF_ERROR(HLE, "cellSaveDataListLoad2: CellSaveDataListCallback failed."); // TODO: Once we verify that the entire SysCall is working, delete this debug error message.
|
||||
return CELL_SAVEDATA_ERROR_CBRESULT;
|
||||
}
|
||||
if (!listSet->fixedList.IsGood())
|
||||
@ -434,7 +434,7 @@ int cellSaveDataListLoad2(u32 version, mem_ptr_t<CellSaveDataSetList> setList, m
|
||||
if (listSet->newData.IsGood())
|
||||
addNewSaveDataEntry(saveEntries, (u32)listSet->newData.GetAddr());
|
||||
if (saveEntries.size() == 0) {
|
||||
ConLog.Warning("cellSaveDataListLoad2: No save entries found!"); // TODO: Find a better way to handle this error
|
||||
LOGF_WARNING(HLE, "cellSaveDataListLoad2: No save entries found!"); // TODO: Find a better way to handle this error
|
||||
return CELL_SAVEDATA_RET_OK;
|
||||
}
|
||||
|
||||
@ -447,7 +447,7 @@ int cellSaveDataListLoad2(u32 version, mem_ptr_t<CellSaveDataSetList> setList, m
|
||||
funcStat(result.GetAddr(), statGet.GetAddr(), statSet.GetAddr());
|
||||
Memory.Free(statGet->fileList.GetAddr());
|
||||
if (result->result < 0) {
|
||||
ConLog.Error("cellSaveDataListLoad2: CellSaveDataStatCallback failed."); // TODO: Once we verify that the entire SysCall is working, delete this debug error message.
|
||||
LOGF_ERROR(HLE, "cellSaveDataListLoad2: CellSaveDataStatCallback failed."); // TODO: Once we verify that the entire SysCall is working, delete this debug error message.
|
||||
return CELL_SAVEDATA_ERROR_CBRESULT;
|
||||
}
|
||||
/*if (statSet->setParam.IsGood())
|
||||
@ -508,7 +508,7 @@ int cellSaveDataFixedSave2(u32 version, mem_ptr_t<CellSaveDataSetList> setList,
|
||||
}
|
||||
funcFixed(result.GetAddr(), listGet.GetAddr(), fixedSet.GetAddr());
|
||||
if (result->result < 0) {
|
||||
ConLog.Error("cellSaveDataFixedSave2: CellSaveDataFixedCallback failed."); // TODO: Once we verify that the entire SysCall is working, delete this debug error message.
|
||||
LOGF_ERROR(HLE, "cellSaveDataFixedSave2: CellSaveDataFixedCallback failed."); // TODO: Once we verify that the entire SysCall is working, delete this debug error message.
|
||||
return CELL_SAVEDATA_ERROR_CBRESULT;
|
||||
}
|
||||
setSaveDataFixed(saveEntries, fixedSet.GetAddr());
|
||||
@ -519,7 +519,7 @@ int cellSaveDataFixedSave2(u32 version, mem_ptr_t<CellSaveDataSetList> setList,
|
||||
funcStat(result.GetAddr(), statGet.GetAddr(), statSet.GetAddr());
|
||||
Memory.Free(statGet->fileList.GetAddr());
|
||||
if (result->result < 0) {
|
||||
ConLog.Error("cellSaveDataFixedSave2: CellSaveDataStatCallback failed."); // TODO: Once we verify that the entire SysCall is working, delete this debug error message.
|
||||
LOGF_ERROR(HLE, "cellSaveDataFixedSave2: CellSaveDataStatCallback failed."); // TODO: Once we verify that the entire SysCall is working, delete this debug error message.
|
||||
return CELL_SAVEDATA_ERROR_CBRESULT;
|
||||
}
|
||||
/*if (statSet->setParam.IsGood())
|
||||
@ -580,7 +580,7 @@ int cellSaveDataFixedLoad2(u32 version, mem_ptr_t<CellSaveDataSetList> setList,
|
||||
}
|
||||
funcFixed(result.GetAddr(), listGet.GetAddr(), fixedSet.GetAddr());
|
||||
if (result->result < 0) {
|
||||
ConLog.Error("cellSaveDataFixedLoad2: CellSaveDataFixedCallback failed."); // TODO: Once we verify that the entire SysCall is working, delete this debug error message.
|
||||
LOGF_ERROR(HLE, "cellSaveDataFixedLoad2: CellSaveDataFixedCallback failed."); // TODO: Once we verify that the entire SysCall is working, delete this debug error message.
|
||||
return CELL_SAVEDATA_ERROR_CBRESULT;
|
||||
}
|
||||
setSaveDataFixed(saveEntries, fixedSet.GetAddr());
|
||||
@ -591,7 +591,7 @@ int cellSaveDataFixedLoad2(u32 version, mem_ptr_t<CellSaveDataSetList> setList,
|
||||
funcStat(result.GetAddr(), statGet.GetAddr(), statSet.GetAddr());
|
||||
Memory.Free(statGet->fileList.GetAddr());
|
||||
if (result->result < 0) {
|
||||
ConLog.Error("cellSaveDataFixedLoad2: CellSaveDataStatCallback failed."); // TODO: Once we verify that the entire SysCall is working, delete this debug error message.
|
||||
LOGF_ERROR(HLE, "cellSaveDataFixedLoad2: CellSaveDataStatCallback failed."); // TODO: Once we verify that the entire SysCall is working, delete this debug error message.
|
||||
return CELL_SAVEDATA_ERROR_CBRESULT;
|
||||
}
|
||||
/*if (statSet->setParam.IsGood())
|
||||
@ -647,7 +647,7 @@ int cellSaveDataAutoSave2(u32 version, u32 dirName_addr, u32 errDialog, mem_ptr_
|
||||
|
||||
Memory.Free(statGet->fileList.GetAddr());
|
||||
if (result->result < 0) {
|
||||
ConLog.Error("cellSaveDataAutoSave2: CellSaveDataStatCallback failed."); // TODO: Once we verify that the entire SysCall is working, delete this debug error message.
|
||||
LOGF_ERROR(HLE, "cellSaveDataAutoSave2: CellSaveDataStatCallback failed."); // TODO: Once we verify that the entire SysCall is working, delete this debug error message.
|
||||
return CELL_SAVEDATA_ERROR_CBRESULT;
|
||||
}
|
||||
/*if (statSet->setParam.IsGood())
|
||||
@ -690,7 +690,7 @@ int cellSaveDataAutoLoad2(u32 version, u32 dirName_addr, u32 errDialog, mem_ptr_
|
||||
|
||||
// The target entry does not exist
|
||||
if (saveEntries.size() == 0) {
|
||||
ConLog.Warning("cellSaveDataAutoLoad2: Couldn't find save entry (%s)", dirName.c_str());
|
||||
LOGF_WARNING(HLE, "cellSaveDataAutoLoad2: Couldn't find save entry (%s)", dirName.c_str());
|
||||
return CELL_OK; // TODO: Can anyone check the actual behaviour of a PS3 when saves are not found?
|
||||
}
|
||||
|
||||
@ -700,7 +700,7 @@ int cellSaveDataAutoLoad2(u32 version, u32 dirName_addr, u32 errDialog, mem_ptr_
|
||||
|
||||
Memory.Free(statGet->fileList.GetAddr());
|
||||
if (result->result < 0) {
|
||||
ConLog.Error("cellSaveDataAutoLoad2: CellSaveDataStatCallback failed."); // TODO: Once we verify that the entire SysCall is working, delete this debug error message.
|
||||
LOGF_ERROR(HLE, "cellSaveDataAutoLoad2: CellSaveDataStatCallback failed."); // TODO: Once we verify that the entire SysCall is working, delete this debug error message.
|
||||
return CELL_SAVEDATA_ERROR_CBRESULT;
|
||||
}
|
||||
/*if (statSet->setParam.IsGood())
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/Cell/PPUThread.h"
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/Cell/PPUThread.h"
|
||||
@ -35,7 +35,7 @@ next:
|
||||
{
|
||||
if (Emu.IsStopped())
|
||||
{
|
||||
ConLog.Warning("vdecRead(): aborted");
|
||||
LOGF_WARNING(HLE, "vdecRead(): aborted");
|
||||
return 0;
|
||||
}
|
||||
Sleep(1);
|
||||
@ -52,7 +52,7 @@ next:
|
||||
{
|
||||
if (!Memory.CopyToReal(buf, vdec.reader.addr, vdec.reader.size))
|
||||
{
|
||||
ConLog.Error("vdecRead(): data reading failed (reader.size=0x%x)", vdec.reader.size);
|
||||
LOGF_ERROR(HLE, "vdecRead(): data reading failed (reader.size=0x%x)", vdec.reader.size);
|
||||
Emu.Pause();
|
||||
return 0;
|
||||
}
|
||||
@ -71,11 +71,11 @@ next:
|
||||
|
||||
vdec.reader.addr = vdec.task.addr;
|
||||
vdec.reader.size = vdec.task.size;
|
||||
//ConLog.Write("Video AU: size = 0x%x, pts = 0x%llx, dts = 0x%llx", vdec.task.size, vdec.task.pts, vdec.task.dts);
|
||||
//LOGF_NOTICE(HLE, "Video AU: size = 0x%x, pts = 0x%llx, dts = 0x%llx", vdec.task.size, vdec.task.pts, vdec.task.dts);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
ConLog.Error("vdecRead(): sequence error (task %d)", vdec.job.Peek().type);
|
||||
LOGF_ERROR(HLE, "vdecRead(): sequence error (task %d)", vdec.job.Peek().type);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -92,7 +92,7 @@ next:
|
||||
}
|
||||
else if (!Memory.CopyToReal(buf, vdec.reader.addr, buf_size))
|
||||
{
|
||||
ConLog.Error("vdecRead(): data reading failed (buf_size=0x%x)", buf_size);
|
||||
LOGF_ERROR(HLE, "vdecRead(): data reading failed (buf_size=0x%x)", buf_size);
|
||||
Emu.Pause();
|
||||
return 0;
|
||||
}
|
||||
@ -136,7 +136,7 @@ u32 vdecOpen(VideoDecoder* data)
|
||||
|
||||
thread t("Video Decoder[" + std::to_string(vdec_id) + "] Thread", [&]()
|
||||
{
|
||||
ConLog.Write("Video Decoder thread started");
|
||||
LOGF_NOTICE(HLE, "Video Decoder thread started");
|
||||
|
||||
VdecTask& task = vdec.task;
|
||||
|
||||
@ -169,7 +169,7 @@ u32 vdecOpen(VideoDecoder* data)
|
||||
case vdecStartSeq:
|
||||
{
|
||||
// TODO: reset data
|
||||
ConLog.Warning("vdecStartSeq:");
|
||||
LOGF_WARNING(HLE, "vdecStartSeq:");
|
||||
|
||||
vdec.reader.addr = 0;
|
||||
vdec.reader.size = 0;
|
||||
@ -181,7 +181,7 @@ u32 vdecOpen(VideoDecoder* data)
|
||||
case vdecEndSeq:
|
||||
{
|
||||
// TODO: finalize
|
||||
ConLog.Warning("vdecEndSeq:");
|
||||
LOGF_WARNING(HLE, "vdecEndSeq:");
|
||||
|
||||
vdec.vdecCb->ExecAsCallback(vdec.cbFunc, false, vdec.id, CELL_VDEC_MSG_TYPE_SEQDONE, CELL_OK, vdec.cbArg);
|
||||
/*Callback cb;
|
||||
@ -202,13 +202,13 @@ u32 vdecOpen(VideoDecoder* data)
|
||||
|
||||
if (task.mode != CELL_VDEC_DEC_MODE_NORMAL)
|
||||
{
|
||||
ConLog.Error("vdecDecodeAu: unsupported decoding mode(%d)", task.mode);
|
||||
LOGF_ERROR(HLE, "vdecDecodeAu: unsupported decoding mode(%d)", task.mode);
|
||||
break;
|
||||
}
|
||||
|
||||
vdec.reader.addr = task.addr;
|
||||
vdec.reader.size = task.size;
|
||||
//ConLog.Write("Video AU: size = 0x%x, pts = 0x%llx, dts = 0x%llx", task.size, task.pts, task.dts);
|
||||
//LOGF_NOTICE(HLE, "Video AU: size = 0x%x, pts = 0x%llx, dts = 0x%llx", task.size, task.pts, task.dts);
|
||||
|
||||
if (vdec.just_started)
|
||||
{
|
||||
@ -249,33 +249,33 @@ u32 vdecOpen(VideoDecoder* data)
|
||||
err = avformat_open_input(&vdec.fmt, NULL, av_find_input_format("mpeg"), NULL);
|
||||
if (err)
|
||||
{
|
||||
ConLog.Error("vdecDecodeAu: avformat_open_input() failed");
|
||||
LOGF_ERROR(HLE, "vdecDecodeAu: avformat_open_input() failed");
|
||||
Emu.Pause();
|
||||
break;
|
||||
}
|
||||
AVCodec* codec = avcodec_find_decoder(AV_CODEC_ID_H264); // ???
|
||||
if (!codec)
|
||||
{
|
||||
ConLog.Error("vdecDecodeAu: avcodec_find_decoder() failed");
|
||||
LOGF_ERROR(HLE, "vdecDecodeAu: avcodec_find_decoder() failed");
|
||||
Emu.Pause();
|
||||
break;
|
||||
}
|
||||
/*err = avformat_find_stream_info(vdec.fmt, NULL);
|
||||
if (err)
|
||||
{
|
||||
ConLog.Error("vdecDecodeAu: avformat_find_stream_info() failed");
|
||||
LOGF_ERROR(HLE, "vdecDecodeAu: avformat_find_stream_info() failed");
|
||||
Emu.Pause();
|
||||
break;
|
||||
}
|
||||
if (!vdec.fmt->nb_streams)
|
||||
{
|
||||
ConLog.Error("vdecDecodeAu: no stream found");
|
||||
LOGF_ERROR(HLE, "vdecDecodeAu: no stream found");
|
||||
Emu.Pause();
|
||||
break;
|
||||
}*/
|
||||
if (!avformat_new_stream(vdec.fmt, codec))
|
||||
{
|
||||
ConLog.Error("vdecDecodeAu: avformat_new_stream() failed");
|
||||
LOGF_ERROR(HLE, "vdecDecodeAu: avformat_new_stream() failed");
|
||||
Emu.Pause();
|
||||
break;
|
||||
}
|
||||
@ -290,7 +290,7 @@ u32 vdecOpen(VideoDecoder* data)
|
||||
}
|
||||
if (err)
|
||||
{
|
||||
ConLog.Error("vdecDecodeAu: avcodec_open2() failed");
|
||||
LOGF_ERROR(HLE, "vdecDecodeAu: avcodec_open2() failed");
|
||||
Emu.Pause();
|
||||
break;
|
||||
}
|
||||
@ -305,7 +305,7 @@ u32 vdecOpen(VideoDecoder* data)
|
||||
{
|
||||
if (Emu.IsStopped())
|
||||
{
|
||||
ConLog.Warning("vdecDecodeAu: aborted");
|
||||
LOGF_WARNING(HLE, "vdecDecodeAu: aborted");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -338,7 +338,7 @@ u32 vdecOpen(VideoDecoder* data)
|
||||
|
||||
if (!frame.data)
|
||||
{
|
||||
ConLog.Error("vdecDecodeAu: av_frame_alloc() failed");
|
||||
LOGF_ERROR(HLE, "vdecDecodeAu: av_frame_alloc() failed");
|
||||
Emu.Pause();
|
||||
break;
|
||||
}
|
||||
@ -351,7 +351,7 @@ u32 vdecOpen(VideoDecoder* data)
|
||||
{
|
||||
if (!last_frame && decode < 0)
|
||||
{
|
||||
ConLog.Error("vdecDecodeAu: AU decoding error(0x%x)", decode);
|
||||
LOGF_ERROR(HLE, "vdecDecodeAu: AU decoding error(0x%x)", decode);
|
||||
}
|
||||
if (!got_picture && vdec.reader.size == 0) break; // video end?
|
||||
}
|
||||
@ -374,7 +374,7 @@ u32 vdecOpen(VideoDecoder* data)
|
||||
frame.dts = (frame.pts - vdec.first_pts) + vdec.first_dts;
|
||||
frame.userdata = task.userData;
|
||||
|
||||
//ConLog.Write("got picture (pts=0x%llx, dts=0x%llx)", frame.pts, frame.dts);
|
||||
//LOGF_NOTICE(HLE, "got picture (pts=0x%llx, dts=0x%llx)", frame.pts, frame.dts);
|
||||
|
||||
vdec.frames.Push(frame); // !!!!!!!!
|
||||
frame.data = nullptr; // to prevent destruction
|
||||
@ -398,23 +398,23 @@ u32 vdecOpen(VideoDecoder* data)
|
||||
case vdecClose:
|
||||
{
|
||||
vdec.is_finished = true;
|
||||
ConLog.Write("Video Decoder thread ended");
|
||||
LOGF_NOTICE(HLE, "Video Decoder thread ended");
|
||||
return;
|
||||
}
|
||||
|
||||
case vdecSetFrameRate:
|
||||
{
|
||||
ConLog.Error("TODO: vdecSetFrameRate(%d)", task.frc);
|
||||
LOGF_ERROR(HLE, "TODO: vdecSetFrameRate(%d)", task.frc);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
ConLog.Error("Video Decoder thread error: unknown task(%d)", task.type);
|
||||
LOGF_ERROR(HLE, "Video Decoder thread error: unknown task(%d)", task.type);
|
||||
}
|
||||
}
|
||||
|
||||
vdec.is_finished = true;
|
||||
ConLog.Warning("Video Decoder thread aborted");
|
||||
LOGF_WARNING(HLE, "Video Decoder thread aborted");
|
||||
});
|
||||
|
||||
t.detach();
|
||||
@ -502,7 +502,7 @@ int cellVdecClose(u32 handle)
|
||||
{
|
||||
if (Emu.IsStopped())
|
||||
{
|
||||
ConLog.Warning("cellVdecClose(%d) aborted", handle);
|
||||
LOGF_WARNING(HLE, "cellVdecClose(%d) aborted", handle);
|
||||
break;
|
||||
}
|
||||
Sleep(1);
|
||||
@ -553,7 +553,7 @@ int cellVdecEndSeq(u32 handle)
|
||||
{
|
||||
if (Emu.IsStopped())
|
||||
{
|
||||
ConLog.Warning("cellVdecEndSeq(%d) aborted", handle);
|
||||
LOGF_WARNING(HLE, "cellVdecEndSeq(%d) aborted", handle);
|
||||
return CELL_OK;
|
||||
}
|
||||
Sleep(1);
|
||||
@ -751,13 +751,13 @@ int cellVdecGetPicItem(u32 handle, mem32_t picItem_ptr)
|
||||
}
|
||||
else
|
||||
{
|
||||
ConLog.Error("cellVdecGetPicItem: unsupported time_base.den (%d)", vdec->ctx->time_base.den);
|
||||
LOGF_ERROR(HLE, "cellVdecGetPicItem: unsupported time_base.den (%d)", vdec->ctx->time_base.den);
|
||||
Emu.Pause();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ConLog.Error("cellVdecGetPicItem: unsupported time_base.num (%d)", vdec->ctx->time_base.num);
|
||||
LOGF_ERROR(HLE, "cellVdecGetPicItem: unsupported time_base.num (%d)", vdec->ctx->time_base.num);
|
||||
Emu.Pause();
|
||||
}
|
||||
avc->fixed_frame_rate_flag = true;
|
||||
|
@ -741,14 +741,14 @@ public:
|
||||
AVCodec* codec = avcodec_find_decoder(AV_CODEC_ID_H264);
|
||||
if (!codec)
|
||||
{
|
||||
ConLog.Error("VideoDecoder(): avcodec_find_decoder(H264) failed");
|
||||
LOGF_ERROR(HLE, "VideoDecoder(): avcodec_find_decoder(H264) failed");
|
||||
Emu.Pause();
|
||||
return;
|
||||
}
|
||||
fmt = avformat_alloc_context();
|
||||
if (!fmt)
|
||||
{
|
||||
ConLog.Error("VideoDecoder(): avformat_alloc_context failed");
|
||||
LOGF_ERROR(HLE, "VideoDecoder(): avformat_alloc_context failed");
|
||||
Emu.Pause();
|
||||
return;
|
||||
}
|
||||
@ -756,7 +756,7 @@ public:
|
||||
fmt->pb = avio_alloc_context(io_buf, 4096, 0, this, vdecRead, NULL, NULL);
|
||||
if (!fmt->pb)
|
||||
{
|
||||
ConLog.Error("VideoDecoder(): avio_alloc_context failed");
|
||||
LOGF_ERROR(HLE, "VideoDecoder(): avio_alloc_context failed");
|
||||
Emu.Pause();
|
||||
return;
|
||||
}
|
||||
@ -785,4 +785,4 @@ public:
|
||||
avformat_free_context(fmt);
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/Cell/PPUThread.h"
|
||||
@ -38,7 +38,7 @@ u32 vpostOpen(VpostInstance* data)
|
||||
{
|
||||
u32 id = cellVpost->GetNewId(data);
|
||||
|
||||
ConLog.Write("*** Vpost instance created (to_rgba=%d): id = %d", data->to_rgba, id);
|
||||
LOGF_NOTICE(HLE, "*** Vpost instance created (to_rgba=%d): id = %d", data->to_rgba, id);
|
||||
|
||||
return id;
|
||||
}
|
||||
@ -123,15 +123,15 @@ int cellVpostExec(u32 handle, const u32 inPicBuff_addr, const mem_ptr_t<CellVpos
|
||||
}
|
||||
|
||||
ctrlParam->inWindow; // ignored
|
||||
if (ctrlParam->inWindow.x) ConLog.Warning("*** inWindow.x = %d", (u32)ctrlParam->inWindow.x);
|
||||
if (ctrlParam->inWindow.y) ConLog.Warning("*** inWindow.y = %d", (u32)ctrlParam->inWindow.y);
|
||||
if (ctrlParam->inWindow.width != w) ConLog.Warning("*** inWindow.width = %d", (u32)ctrlParam->inWindow.width);
|
||||
if (ctrlParam->inWindow.height != h) ConLog.Warning("*** inWindow.height = %d", (u32)ctrlParam->inWindow.height);
|
||||
if (ctrlParam->inWindow.x) LOGF_WARNING(HLE, "*** inWindow.x = %d", (u32)ctrlParam->inWindow.x);
|
||||
if (ctrlParam->inWindow.y) LOGF_WARNING(HLE, "*** inWindow.y = %d", (u32)ctrlParam->inWindow.y);
|
||||
if (ctrlParam->inWindow.width != w) LOGF_WARNING(HLE, "*** inWindow.width = %d", (u32)ctrlParam->inWindow.width);
|
||||
if (ctrlParam->inWindow.height != h) LOGF_WARNING(HLE, "*** inWindow.height = %d", (u32)ctrlParam->inWindow.height);
|
||||
ctrlParam->outWindow; // ignored
|
||||
if (ctrlParam->outWindow.x) ConLog.Warning("*** outWindow.x = %d", (u32)ctrlParam->outWindow.x);
|
||||
if (ctrlParam->outWindow.y) ConLog.Warning("*** outWindow.y = %d", (u32)ctrlParam->outWindow.y);
|
||||
if (ctrlParam->outWindow.width != ow) ConLog.Warning("*** outWindow.width = %d", (u32)ctrlParam->outWindow.width);
|
||||
if (ctrlParam->outWindow.height != oh) ConLog.Warning("*** outWindow.height = %d", (u32)ctrlParam->outWindow.height);
|
||||
if (ctrlParam->outWindow.x) LOGF_WARNING(HLE, "*** outWindow.x = %d", (u32)ctrlParam->outWindow.x);
|
||||
if (ctrlParam->outWindow.y) LOGF_WARNING(HLE, "*** outWindow.y = %d", (u32)ctrlParam->outWindow.y);
|
||||
if (ctrlParam->outWindow.width != ow) LOGF_WARNING(HLE, "*** outWindow.width = %d", (u32)ctrlParam->outWindow.width);
|
||||
if (ctrlParam->outWindow.height != oh) LOGF_WARNING(HLE, "*** outWindow.height = %d", (u32)ctrlParam->outWindow.height);
|
||||
ctrlParam->execType; // ignored
|
||||
ctrlParam->scalerType; // ignored
|
||||
ctrlParam->ipcType; // ignored
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/Cell/PPUThread.h"
|
||||
@ -241,7 +241,7 @@ int cellSurMixerStart()
|
||||
{
|
||||
if (Emu.IsStopped())
|
||||
{
|
||||
ConLog.Warning("Surmixer aborted");
|
||||
LOG_WARNING(HLE, "Surmixer aborted");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -953,4 +953,4 @@ void libmixer_init()
|
||||
REG_SUB_EMPTY(libmixer, "surmxUti", cellSurMixerUtilGetLevelFromDB);
|
||||
REG_SUB_EMPTY(libmixer, "surmxUti", cellSurMixerUtilGetLevelFromDBIndex);
|
||||
REG_SUB_EMPTY(libmixer, "surmxUti", cellSurMixerUtilNoteToRatio);
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/Cell/PPUThread.h"
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/Cell/PPUThread.h"
|
||||
@ -361,7 +361,7 @@ int sceNpTrophyGetTrophyUnlockState(u32 context, u32 handle, mem_ptr_t<SceNpTrop
|
||||
sceNpTrophyInternalContext& ctxt = s_npTrophyInstance.contexts[context];
|
||||
count = ctxt.tropusr->GetTrophiesCount();
|
||||
if (count.GetValue() > 128)
|
||||
ConLog.Warning("sceNpTrophyGetTrophyUnlockState: More than 128 trophies detected!");
|
||||
LOG_WARNING(HLE, "sceNpTrophyGetTrophyUnlockState: More than 128 trophies detected!");
|
||||
|
||||
// Pack up to 128 bools in u32 flag_bits[4]
|
||||
for (u32 id=0; id<count.GetValue(); id++)
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/Cell/PPUThread.h"
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/Cell/PPUThread.h"
|
||||
@ -149,7 +149,7 @@ void fsAioRead(u32 fd, mem_ptr_t<CellFsAio> aio, int xid, mem_func_ptr_t<void (*
|
||||
Sleep(1);
|
||||
if (Emu.IsStopped())
|
||||
{
|
||||
ConLog.Warning("fsAioRead() aborted");
|
||||
LOG_WARNING(HLE, "fsAioRead() aborted");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -209,7 +209,7 @@ void fsAioRead(u32 fd, mem_ptr_t<CellFsAio> aio, int xid, mem_func_ptr_t<void (*
|
||||
fin:
|
||||
file.Seek(old_pos);
|
||||
|
||||
ConLog.Warning("*** fsAioRead(fd=%d, offset=0x%llx, buf_addr=0x%x, size=0x%x, error=0x%x, res=0x%x, xid=0x%x [%s])",
|
||||
LOGF_WARNING(HLE, "*** fsAioRead(fd=%d, offset=0x%llx, buf_addr=0x%x, size=0x%x, error=0x%x, res=0x%x, xid=0x%x [%s])",
|
||||
fd, (u64)aio->offset, buf_addr, (u64)aio->size, error, res, xid, orig_file->GetPath().c_str());
|
||||
|
||||
if (func) // start callback thread
|
||||
@ -223,7 +223,7 @@ fin:
|
||||
Sleep(1);
|
||||
if (Emu.IsStopped())
|
||||
{
|
||||
ConLog.Warning("fsAioRead() aborted");
|
||||
LOGF_WARNING(HLE, "fsAioRead() aborted");
|
||||
break;
|
||||
}
|
||||
}*/
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/Cell/PPUThread.h"
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/Cell/PPUThread.h"
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/Cell/PPUThread.h"
|
||||
@ -54,14 +54,14 @@ void StaticFuncManager::StaticAnalyse(void* ptr, u32 size, u32 base)
|
||||
k--;
|
||||
if (can_skip) // cannot define this behaviour properly
|
||||
{
|
||||
ConLog.Warning("StaticAnalyse(): can_skip = %d (unchanged)", can_skip);
|
||||
LOGF_WARNING(LOADER, "StaticAnalyse(): can_skip = %d (unchanged)", can_skip);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (can_skip) // cannot define this behaviour properly
|
||||
{
|
||||
ConLog.Warning("StaticAnalyse(): can_skip = %d (set to 0)", can_skip);
|
||||
LOGF_WARNING(LOADER, "StaticAnalyse(): can_skip = %d (set to 0)", can_skip);
|
||||
can_skip = 0;
|
||||
}
|
||||
}
|
||||
@ -85,7 +85,7 @@ void StaticFuncManager::StaticAnalyse(void* ptr, u32 size, u32 base)
|
||||
}
|
||||
if (found)
|
||||
{
|
||||
ConLog.Write("Function '%s' hooked (addr=0x%x)", m_static_funcs_list[j]->name, i * 4 + base);
|
||||
LOGF_NOTICE(LOADER, "Function '%s' hooked (addr=0x%x)", m_static_funcs_list[j]->name, i * 4 + base);
|
||||
m_static_funcs_list[j]->found++;
|
||||
data[i+0] = re32(0x39600000 | j); // li r11, j
|
||||
data[i+1] = se32(0x44000003); // sc 3
|
||||
@ -129,7 +129,7 @@ void StaticFuncManager::StaticAnalyse(void* ptr, u32 size, u32 base)
|
||||
if (count == 0)
|
||||
{
|
||||
res |= GSR_MISSING;
|
||||
ConLog.Error("Function '%s' not found", m_static_funcs_list[j]->name);
|
||||
LOGF_ERROR(LOADER, "Function '%s' not found", m_static_funcs_list[j]->name);
|
||||
}
|
||||
else if (count > 1)
|
||||
{
|
||||
@ -146,7 +146,7 @@ void StaticFuncManager::StaticAnalyse(void* ptr, u32 size, u32 base)
|
||||
if (m_static_funcs_list[k]->found)
|
||||
{
|
||||
res |= GSR_EXCESS;
|
||||
ConLog.Error("Function '%s' hooked twice", m_static_funcs_list[j]->name);
|
||||
LOGF_ERROR(LOADER, "Function '%s' hooked twice", m_static_funcs_list[j]->name);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -154,7 +154,7 @@ void StaticFuncManager::StaticAnalyse(void* ptr, u32 size, u32 base)
|
||||
else
|
||||
{
|
||||
res |= GSR_EXCESS;
|
||||
ConLog.Error("Function '%s' hooked twice", m_static_funcs_list[j]->name);
|
||||
LOGF_ERROR(LOADER, "Function '%s' hooked twice", m_static_funcs_list[j]->name);
|
||||
}
|
||||
}
|
||||
|
||||
@ -170,11 +170,11 @@ void StaticFuncManager::StaticAnalyse(void* ptr, u32 size, u32 base)
|
||||
|
||||
if (res == GSR_SUCCESS)
|
||||
{
|
||||
ConLog.Success("Function group [%s] successfully hooked", std::string(name, 9).c_str());
|
||||
LOGF_SUCCESS(LOADER, "Function group [%s] successfully hooked", std::string(name, 9).c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
ConLog.Error("Function group [%s] failed:%s%s", std::string(name, 9).c_str(),
|
||||
LOGF_ERROR(LOADER, "Function group [%s] failed:%s%s", std::string(name, 9).c_str(),
|
||||
(res & GSR_MISSING ? " missing;" : ""),
|
||||
(res & GSR_EXCESS ? " excess;" : ""));
|
||||
}
|
||||
@ -190,7 +190,7 @@ void StaticFuncManager::StaticExecute(u32 code)
|
||||
}
|
||||
else
|
||||
{
|
||||
ConLog.Error("StaticExecute(%d): unknown function or illegal opcode", code);
|
||||
LOGF_ERROR(LOADER, "StaticExecute(%d): unknown function or illegal opcode", code);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/ConLog.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/Cell/PPUThread.h"
|
||||
@ -553,7 +553,7 @@ void default_syscall()
|
||||
{
|
||||
//tty
|
||||
case 988:
|
||||
ConLog.Warning("SysCall 988! r3: 0x%llx, r4: 0x%llx, pc: 0x%llx",
|
||||
LOGF_WARNING(HLE, "SysCall 988! r3: 0x%llx, r4: 0x%llx, pc: 0x%llx",
|
||||
CPU.GPR[3], CPU.GPR[4], CPU.PC);
|
||||
RESULT(0);
|
||||
return;
|
||||
@ -561,16 +561,16 @@ void default_syscall()
|
||||
case 999:
|
||||
dump_enable = !dump_enable;
|
||||
Emu.Pause();
|
||||
ConLog.Warning("Dump %s", (dump_enable ? "enabled" : "disabled"));
|
||||
LOGF_WARNING(HLE, "Dump %s", (dump_enable ? "enabled" : "disabled"));
|
||||
return;
|
||||
|
||||
case 1000:
|
||||
Ini.HLELogging.SetValue(!Ini.HLELogging.GetValue());
|
||||
ConLog.Warning("Log %s", (Ini.HLELogging.GetValue() ? "enabled" : "disabled"));
|
||||
LOGF_WARNING(HLE, "Log %s", (Ini.HLELogging.GetValue() ? "enabled" : "disabled"));
|
||||
return;
|
||||
}
|
||||
|
||||
ConLog.Error("Unknown syscall: %d - %08x", code, code);
|
||||
LOGF_ERROR(HLE, "Unknown syscall: %d - %08x", code, code);
|
||||
RESULT(0);
|
||||
return;
|
||||
}
|
||||
@ -589,7 +589,7 @@ void SysCalls::DoSyscall(u32 code)
|
||||
}
|
||||
|
||||
|
||||
ConLog.Error("TODO: %s", GetHLEFuncName(code).c_str());
|
||||
LOGF_ERROR(HLE, "TODO: %s", GetHLEFuncName(code).c_str());
|
||||
declCPU();
|
||||
RESULT(0);
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user