Clean up among the logs. Remove MASTER_LOG.

This commit is contained in:
Henrik Rydgård 2017-03-06 13:10:23 +01:00
parent cfe2621604
commit 440e72d250
36 changed files with 181 additions and 179 deletions

View File

@ -43,7 +43,7 @@ PointerWrapSection PointerWrap::Section(const char *title, int minVer, int ver)
Do(foundVersion);
if (error == ERROR_FAILURE || foundVersion < minVer || foundVersion > ver) {
WARN_LOG(COMMON, "Savestate failure: wrong version %d found for %s", foundVersion, title);
WARN_LOG(SAVESTATE, "Savestate failure: wrong version %d found for %s", foundVersion, title);
SetError(ERROR_FAILURE);
return PointerWrapSection(*this, -1, title);
}
@ -165,31 +165,31 @@ PointerWrapSection::~PointerWrapSection() {
CChunkFileReader::Error CChunkFileReader::LoadFileHeader(File::IOFile &pFile, SChunkHeader &header, std::string *title) {
if (!pFile) {
ERROR_LOG(COMMON, "ChunkReader: Can't open file for reading");
ERROR_LOG(SAVESTATE, "ChunkReader: Can't open file for reading");
return ERROR_BAD_FILE;
}
const u64 fileSize = pFile.GetSize();
u64 headerSize = sizeof(SChunkHeader);
if (fileSize < headerSize) {
ERROR_LOG(COMMON, "ChunkReader: File too small");
ERROR_LOG(SAVESTATE, "ChunkReader: File too small");
return ERROR_BAD_FILE;
}
if (!pFile.ReadArray(&header, 1)) {
ERROR_LOG(COMMON, "ChunkReader: Bad header size");
ERROR_LOG(SAVESTATE, "ChunkReader: Bad header size");
return ERROR_BAD_FILE;
}
if (header.Revision < REVISION_MIN) {
ERROR_LOG(COMMON, "ChunkReader: Wrong file revision, got %d expected >= %d", header.Revision, REVISION_MIN);
ERROR_LOG(SAVESTATE, "ChunkReader: Wrong file revision, got %d expected >= %d", header.Revision, REVISION_MIN);
return ERROR_BAD_FILE;
}
if (header.Revision >= REVISION_TITLE) {
char titleFixed[128];
if (!pFile.ReadArray(titleFixed, sizeof(titleFixed))) {
ERROR_LOG(COMMON, "ChunkReader: Unable to read title");
ERROR_LOG(SAVESTATE, "ChunkReader: Unable to read title");
return ERROR_BAD_FILE;
}
@ -204,7 +204,7 @@ CChunkFileReader::Error CChunkFileReader::LoadFileHeader(File::IOFile &pFile, SC
u32 sz = (u32)(fileSize - headerSize);
if (header.ExpectedSize != sz) {
ERROR_LOG(COMMON, "ChunkReader: Bad file size, got %u expected %u", sz, header.ExpectedSize);
ERROR_LOG(SAVESTATE, "ChunkReader: Bad file size, got %u expected %u", sz, header.ExpectedSize);
return ERROR_BAD_FILE;
}
@ -213,7 +213,7 @@ CChunkFileReader::Error CChunkFileReader::LoadFileHeader(File::IOFile &pFile, SC
CChunkFileReader::Error CChunkFileReader::GetFileTitle(const std::string &filename, std::string *title) {
if (!File::Exists(filename)) {
ERROR_LOG(COMMON, "ChunkReader: File doesn't exist");
ERROR_LOG(SAVESTATE, "ChunkReader: File doesn't exist");
return ERROR_BAD_FILE;
}
@ -225,7 +225,7 @@ CChunkFileReader::Error CChunkFileReader::GetFileTitle(const std::string &filena
CChunkFileReader::Error CChunkFileReader::LoadFile(const std::string &filename, const char *gitVersion, u8 *&_buffer, size_t &sz, std::string *failureReason) {
if (!File::Exists(filename)) {
*failureReason = "LoadStateDoesntExist";
ERROR_LOG(COMMON, "ChunkReader: File doesn't exist");
ERROR_LOG(SAVESTATE, "ChunkReader: File doesn't exist");
return ERROR_BAD_FILE;
}
@ -241,7 +241,7 @@ CChunkFileReader::Error CChunkFileReader::LoadFile(const std::string &filename,
u8 *buffer = new u8[sz];
if (!pFile.ReadBytes(buffer, sz))
{
ERROR_LOG(COMMON, "ChunkReader: Error reading file");
ERROR_LOG(SAVESTATE, "ChunkReader: Error reading file");
delete [] buffer;
return ERROR_BAD_FILE;
}
@ -252,7 +252,7 @@ CChunkFileReader::Error CChunkFileReader::LoadFile(const std::string &filename,
size_t uncomp_size = header.UncompressedSize;
snappy_uncompress((const char *)buffer, sz, (char *)uncomp_buffer, &uncomp_size);
if ((u32)uncomp_size != header.UncompressedSize) {
ERROR_LOG(COMMON, "Size mismatch: file: %u calc: %u", header.UncompressedSize, (u32)uncomp_size);
ERROR_LOG(SAVESTATE, "Size mismatch: file: %u calc: %u", header.UncompressedSize, (u32)uncomp_size);
delete [] uncomp_buffer;
return ERROR_BAD_FILE;
}
@ -266,12 +266,12 @@ CChunkFileReader::Error CChunkFileReader::LoadFile(const std::string &filename,
// Takes ownership of buffer.
CChunkFileReader::Error CChunkFileReader::SaveFile(const std::string &filename, const std::string &title, const char *gitVersion, u8 *buffer, size_t sz) {
INFO_LOG(COMMON, "ChunkReader: Writing %s", filename.c_str());
INFO_LOG(SAVESTATE, "ChunkReader: Writing %s", filename.c_str());
File::IOFile pFile(filename, "wb");
if (!pFile)
{
ERROR_LOG(COMMON, "ChunkReader: Error opening file for write");
ERROR_LOG(SAVESTATE, "ChunkReader: Error opening file for write");
delete[] buffer;
return ERROR_BAD_FILE;
}
@ -300,36 +300,36 @@ CChunkFileReader::Error CChunkFileReader::SaveFile(const std::string &filename,
delete [] buffer;
header.ExpectedSize = (u32)comp_len;
if (!pFile.WriteArray(&header, 1)) {
ERROR_LOG(COMMON, "ChunkReader: Failed writing header");
ERROR_LOG(SAVESTATE, "ChunkReader: Failed writing header");
return ERROR_BAD_FILE;
}
if (!pFile.WriteArray(titleFixed, sizeof(titleFixed))) {
ERROR_LOG(COMMON, "ChunkReader: Failed writing title");
ERROR_LOG(SAVESTATE, "ChunkReader: Failed writing title");
return ERROR_BAD_FILE;
}
if (!pFile.WriteBytes(&compressed_buffer[0], comp_len)) {
ERROR_LOG(COMMON, "ChunkReader: Failed writing compressed data");
ERROR_LOG(SAVESTATE, "ChunkReader: Failed writing compressed data");
return ERROR_BAD_FILE;
} else {
INFO_LOG(COMMON, "Savestate: Compressed %i bytes into %i", (int)sz, (int)comp_len);
INFO_LOG(SAVESTATE, "Savestate: Compressed %i bytes into %i", (int)sz, (int)comp_len);
}
delete [] compressed_buffer;
} else {
if (!pFile.WriteArray(&header, 1))
{
ERROR_LOG(COMMON, "ChunkReader: Failed writing header");
ERROR_LOG(SAVESTATE, "ChunkReader: Failed writing header");
delete[] buffer;
return ERROR_BAD_FILE;
}
if (!pFile.WriteBytes(&buffer[0], sz))
{
ERROR_LOG(COMMON, "ChunkReader: Failed writing data");
ERROR_LOG(SAVESTATE, "ChunkReader: Failed writing data");
delete[] buffer;
return ERROR_BAD_FILE;
}
delete [] buffer;
}
INFO_LOG(COMMON, "ChunkReader: Done writing %s", filename.c_str());
INFO_LOG(SAVESTATE, "ChunkReader: Done writing %s", filename.c_str());
return ERROR_NONE;
}

View File

@ -449,7 +449,7 @@ public:
break;
default:
ERROR_LOG(COMMON, "Savestate error: invalid mode %d.", mode);
ERROR_LOG(SAVESTATE, "Savestate error: invalid mode %d.", mode);
}
}
@ -537,7 +537,7 @@ public:
{
if (shouldExist != 0)
{
WARN_LOG(COMMON, "Savestate failure: incorrect item marker %d", shouldExist);
WARN_LOG(SAVESTATE, "Savestate failure: incorrect item marker %d", shouldExist);
SetError(ERROR_FAILURE);
}
if (mode == MODE_READ)
@ -629,7 +629,7 @@ public:
delete [] ptr;
}
INFO_LOG(COMMON, "ChunkReader: Done loading %s", filename.c_str());
INFO_LOG(SAVESTATE, "ChunkReader: Done loading %s", filename.c_str());
if (error == ERROR_NONE) {
failureReason->clear();
}

View File

@ -36,8 +36,6 @@ namespace LogTypes
{
enum LOG_TYPE {
MASTER_LOG,
SCEAUDIO,
SCECTRL,
SCEDISPLAY,
@ -51,7 +49,9 @@ enum LOG_TYPE {
SCERTC,
SCESAS,
SCEUTILITY,
SCEMISC,
SYSTEM,
BOOT,
COMMON,
CPU,
@ -64,6 +64,7 @@ enum LOG_TYPE {
MEMMAP,
TIME,
SASMIX,
SAVESTATE,
NUMBER_OF_LOGS, // Must be last
};
@ -132,7 +133,7 @@ bool GenericLogEnabled(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type);
#endif // dbg_assert
#endif // MAX_LOGLEVEL DEBUG
#define _assert_(_a_) _dbg_assert_(MASTER_LOG, _a_)
#define _assert_(_a_) _dbg_assert_(SYSTEM, _a_)
#ifdef _MSC_VER
#define _assert_msg_(_t_, _a_, _fmt_, ...) \

View File

@ -59,34 +59,35 @@ struct LogNameTableEntry {
};
static const LogNameTableEntry logTable[] = {
{LogTypes::MASTER_LOG, "*"},
{LogTypes::SCEAUDIO, "SCEAUDIO"},
{LogTypes::SCECTRL, "SCECTRL"},
{LogTypes::SCEDISPLAY, "SCEDISP"},
{LogTypes::SCEFONT, "SCEFONT"},
{LogTypes::SCEGE, "SCESCEGE"},
{LogTypes::SCEINTC, "SCEINTC"},
{LogTypes::SCEIO, "SCEIO"},
{LogTypes::SCEKERNEL, "SCEKERNEL"},
{LogTypes::SCEMODULE, "SCEMODULE"},
{LogTypes::SCENET, "SCENET"},
{LogTypes::SCERTC, "SCERTC"},
{LogTypes::SCESAS, "SCESAS"},
{LogTypes::SCEUTILITY, "SCEUTIL"},
{LogTypes::SCEMISC, "SCEMISC"},
{LogTypes::SCEAUDIO ,"SCEAUDIO"},
{LogTypes::SCECTRL ,"SCECTRL"},
{LogTypes::SCEDISPLAY ,"SCEDISP"},
{LogTypes::SCEFONT ,"SCEFONT"},
{LogTypes::SCEGE ,"SCESCEGE"},
{LogTypes::SCEINTC ,"SCEINTC"},
{LogTypes::SCEIO ,"SCEIO"},
{LogTypes::SCEKERNEL ,"SCEKERNEL"},
{LogTypes::SCEMODULE ,"SCEMODULE"},
{LogTypes::SCENET ,"SCENET"},
{LogTypes::SCERTC ,"SCERTC"},
{LogTypes::SCESAS ,"SCESAS"},
{LogTypes::SCEUTILITY ,"SCEUTIL"},
{LogTypes::BOOT ,"BOOT"},
{LogTypes::COMMON ,"COMMON"},
{LogTypes::CPU ,"CPU"},
{LogTypes::FILESYS ,"FILESYS"},
{LogTypes::G3D ,"G3D"},
{LogTypes::HLE ,"HLE"},
{LogTypes::JIT ,"JIT"},
{LogTypes::LOADER ,"LOAD"},
{LogTypes::ME ,"ME"},
{LogTypes::MEMMAP ,"MM"},
{LogTypes::TIME ,"TIME"},
{LogTypes::SASMIX ,"SASMIX"},
{LogTypes::SYSTEM, "SYSTEM"},
{LogTypes::BOOT, "BOOT"},
{LogTypes::COMMON, "COMMON"},
{LogTypes::CPU, "CPU"},
{LogTypes::FILESYS, "FILESYS"},
{LogTypes::G3D, "G3D"},
{LogTypes::HLE, "HLE"},
{LogTypes::JIT, "JIT"},
{LogTypes::LOADER, "LOADER"},
{LogTypes::ME, "ME"},
{LogTypes::MEMMAP, "MEMMAP"},
{LogTypes::TIME, "TIME"},
{LogTypes::SASMIX, "SASMIX"},
{LogTypes::SAVESTATE, "SAVESTATE"},
};
LogManager::LogManager() {

View File

@ -54,7 +54,7 @@ bool MsgAlert(bool yes_no, int Style, const char* format, ...)
CharArrayFromFormatV(buffer, sizeof(buffer)-1, format, args);
va_end(args);
ERROR_LOG(MASTER_LOG, "%s: %s", caption, buffer);
ERROR_LOG(SYSTEM, "%s: %s", caption, buffer);
// Don't ignore questions, especially AskYesNo, PanicYesNo could be ignored
if (AlertEnabled || Style == QUESTION || Style == CRITICAL)

View File

@ -305,7 +305,7 @@ bool HasKey(int key)
case 0x63: case 0x64:
return true;
default:
INFO_LOG(HLE, "Missing key %02X, cannot decrypt module", key);
INFO_LOG(LOADER, "Missing key %02X, cannot decrypt module", key);
return false;
}
}

View File

@ -51,7 +51,7 @@ u32 BlockDevice::CalculateCRC() {
u8 block[2048];
for (u32 i = 0; i < GetNumBlocks(); ++i) {
if (!ReadBlock(i, block, true)) {
ERROR_LOG(HLE, "Failed to read block for CRC");
ERROR_LOG(FILESYS, "Failed to read block for CRC");
return 0;
}
crc = crc32(crc, block, 2048);

View File

@ -26,13 +26,13 @@
#include "Core/Config.h"
static int kuKernelLoadModule(const char *path, uint32_t flags, uint32_t lmOptionAddr) {
INFO_LOG(HLE, "kuKernelLoadModule - forwarding to sceKernelLoadModule");
INFO_LOG(SCEKERNEL, "kuKernelLoadModule - forwarding to sceKernelLoadModule");
// Simply forward the call, like JPSCP does.
return sceKernelLoadModule(path, flags, lmOptionAddr);
}
static int kuKernelGetModel() {
INFO_LOG(HLE, "kuKernelGetModel()");
INFO_LOG(SCEKERNEL, "kuKernelGetModel()");
return g_Config.iPSPModel;
}

View File

@ -28,10 +28,10 @@
static u32 sceAdler32(u32 adler, u32 data, u32 datalen) {
if (!Memory::IsValidAddress(data) || !Memory::IsValidAddress(data + datalen - 1)) {
ERROR_LOG(HLE, "sceAdler32(adler=%08x, data=%08x, datalen=%08x) - bad address(es)", adler, data, datalen);
ERROR_LOG(SCEMISC, "sceAdler32(adler=%08x, data=%08x, datalen=%08x) - bad address(es)", adler, data, datalen);
return -1;
}
INFO_LOG(HLE, "sceAdler32(adler=%08x, data=%08x, datalen=%08x)", adler, data, datalen);
INFO_LOG(SCEMISC, "sceAdler32(adler=%08x, data=%08x, datalen=%08x)", adler, data, datalen);
u8 *buf = Memory::GetPointerUnchecked(data);
u32 ret = adler32(adler, buf, datalen);
@ -39,12 +39,10 @@ static u32 sceAdler32(u32 adler, u32 data, u32 datalen) {
return ret;
}
const HLEFunction sceAdler[] =
{
{0X9702EF11, &WrapU_UUU<sceAdler32>, "sceAdler32", 'x', "xxx"},
const HLEFunction sceAdler[] = {
{0X9702EF11, &WrapU_UUU<sceAdler32>, "sceAdler32", 'x', "xxx"},
};
void Register_sceAdler()
{
void Register_sceAdler() {
RegisterModule("sceAdler", ARRAY_SIZE(sceAdler), sceAdler);
}

View File

@ -28,24 +28,24 @@ u32 audioRoutingMode = AUDIO_ROUTING_SPEAKER_ON;
u32 audioRoutineVolumeMode = AUDIO_ROUTING_SPEAKER_ON;
static int sceAudioRoutingGetMode() {
INFO_LOG(HLE, "sceAudioRoutingGetMode");
INFO_LOG(SCEAUDIO, "sceAudioRoutingGetMode");
return 0;
}
static int sceAudioRoutingSetVolumeMode(int mode) {
INFO_LOG(HLE, "sceAudioRoutingSetVolumeMode %d", mode);
INFO_LOG(SCEAUDIO, "sceAudioRoutingSetVolumeMode %d", mode);
int previousMode = audioRoutineVolumeMode;
audioRoutineVolumeMode = audioRoutingMode;
return previousMode;
}
static int sceAudioRoutingGetVolumeMode() {
INFO_LOG(HLE, "sceAudioRoutingGetMode");
INFO_LOG(SCEAUDIO, "sceAudioRoutingGetMode");
return 0;
}
static int sceAudioRoutingSetMode(int mode) {
INFO_LOG(HLE, "sceAudioRoutingSetMode %d", mode);
INFO_LOG(SCEAUDIO, "sceAudioRoutingSetMode %d", mode);
int previousMode = audioRoutingMode;
audioRoutingMode = mode;
return previousMode;

View File

@ -85,7 +85,7 @@ static u32 __CccJIStoUCS(u32 c, u32 alt)
static void sceCccSetTable(u32 jis2ucs, u32 ucs2jis)
{
// Both tables jis2ucs and ucs2jis have a size of 0x20000 bytes.
DEBUG_LOG(HLE, "sceCccSetTable(%08x, %08x)", jis2ucs, ucs2jis);
DEBUG_LOG(SCEMISC, "sceCccSetTable(%08x, %08x)", jis2ucs, ucs2jis);
ucs2jisTable = ucs2jis;
jis2ucsTable = jis2ucs;
}
@ -96,14 +96,14 @@ static int sceCccUTF8toUTF16(u32 dstAddr, u32 dstSize, u32 srcAddr)
auto dst = PSPWCharPointer::Create(dstAddr);
if (!dst.IsValid() || !src.IsValid())
{
ERROR_LOG(HLE, "sceCccUTF8toUTF16(%08x, %d, %08x): invalid pointers", dstAddr, dstSize, srcAddr);
ERROR_LOG(SCEMISC, "sceCccUTF8toUTF16(%08x, %d, %08x): invalid pointers", dstAddr, dstSize, srcAddr);
return 0;
}
// Round dstSize down if it represents half a character.
const auto dstEnd = PSPWCharPointer::Create(dstAddr + (dstSize & ~1));
DEBUG_LOG(HLE, "sceCccUTF8toUTF16(%08x, %d, %08x)", dstAddr, dstSize, srcAddr);
DEBUG_LOG(SCEMISC, "sceCccUTF8toUTF16(%08x, %d, %08x)", dstAddr, dstSize, srcAddr);
UTF8 utf(src);
int n = 0;
while (u32 c = utf.next())
@ -128,18 +128,18 @@ static int sceCccUTF8toSJIS(u32 dstAddr, u32 dstSize, u32 srcAddr)
auto dst = PSPCharPointer::Create(dstAddr);
if (!dst.IsValid() || !src.IsValid())
{
ERROR_LOG(HLE, "sceCccUTF8toSJIS(%08x, %d, %08x): invalid pointers", dstAddr, dstSize, srcAddr);
ERROR_LOG(SCEMISC, "sceCccUTF8toSJIS(%08x, %d, %08x): invalid pointers", dstAddr, dstSize, srcAddr);
return 0;
}
if (!ucs2jisTable.IsValid())
{
ERROR_LOG(HLE, "sceCccUTF8toSJIS(%08x, %d, %08x): table not loaded", dstAddr, dstSize, srcAddr);
ERROR_LOG(SCEMISC, "sceCccUTF8toSJIS(%08x, %d, %08x): table not loaded", dstAddr, dstSize, srcAddr);
return 0;
}
const auto dstEnd = PSPCharPointer::Create(dstAddr + dstSize);
DEBUG_LOG(HLE, "sceCccUTF8toSJIS(%08x, %d, %08x)", dstAddr, dstSize, srcAddr);
DEBUG_LOG(SCEMISC, "sceCccUTF8toSJIS(%08x, %d, %08x)", dstAddr, dstSize, srcAddr);
UTF8 utf(src);
int n = 0;
while (u32 c = utf.next())
@ -164,13 +164,13 @@ static int sceCccUTF16toUTF8(u32 dstAddr, u32 dstSize, u32 srcAddr)
auto dst = PSPCharPointer::Create(dstAddr);
if (!dst.IsValid() || !src.IsValid())
{
ERROR_LOG(HLE, "sceCccUTF16toUTF8(%08x, %d, %08x): invalid pointers", dstAddr, dstSize, srcAddr);
ERROR_LOG(SCEMISC, "sceCccUTF16toUTF8(%08x, %d, %08x): invalid pointers", dstAddr, dstSize, srcAddr);
return 0;
}
const auto dstEnd = PSPCharPointer::Create(dstAddr + dstSize);
DEBUG_LOG(HLE, "sceCccUTF16toUTF8(%08x, %d, %08x)", dstAddr, dstSize, srcAddr);
DEBUG_LOG(SCEMISC, "sceCccUTF16toUTF8(%08x, %d, %08x)", dstAddr, dstSize, srcAddr);
UTF16LE utf(src);
int n = 0;
while (u32 c = utf.next())
@ -195,18 +195,18 @@ static int sceCccUTF16toSJIS(u32 dstAddr, u32 dstSize, u32 srcAddr)
auto dst = PSPCharPointer::Create(dstAddr);
if (!dst.IsValid() || !src.IsValid())
{
ERROR_LOG(HLE, "sceCccUTF16toSJIS(%08x, %d, %08x): invalid pointers", dstAddr, dstSize, srcAddr);
ERROR_LOG(SCEMISC, "sceCccUTF16toSJIS(%08x, %d, %08x): invalid pointers", dstAddr, dstSize, srcAddr);
return 0;
}
if (!ucs2jisTable.IsValid())
{
ERROR_LOG(HLE, "sceCccUTF16toSJIS(%08x, %d, %08x): table not loaded", dstAddr, dstSize, srcAddr);
ERROR_LOG(SCEMISC, "sceCccUTF16toSJIS(%08x, %d, %08x): table not loaded", dstAddr, dstSize, srcAddr);
return 0;
}
const auto dstEnd = PSPCharPointer::Create(dstAddr + dstSize);
DEBUG_LOG(HLE, "sceCccUTF16toSJIS(%08x, %d, %08x)", dstAddr, dstSize, srcAddr);
DEBUG_LOG(SCEMISC, "sceCccUTF16toSJIS(%08x, %d, %08x)", dstAddr, dstSize, srcAddr);
UTF16LE utf(src);
int n = 0;
while (u32 c = utf.next())
@ -231,18 +231,18 @@ static int sceCccSJIStoUTF8(u32 dstAddr, u32 dstSize, u32 srcAddr)
auto dst = PSPCharPointer::Create(dstAddr);
if (!dst.IsValid() || !src.IsValid())
{
ERROR_LOG(HLE, "sceCccSJIStoUTF8(%08x, %d, %08x): invalid pointers", dstAddr, dstSize, srcAddr);
ERROR_LOG(SCEMISC, "sceCccSJIStoUTF8(%08x, %d, %08x): invalid pointers", dstAddr, dstSize, srcAddr);
return 0;
}
if (!jis2ucsTable.IsValid())
{
ERROR_LOG(HLE, "sceCccSJIStoUTF8(%08x, %d, %08x): table not loaded", dstAddr, dstSize, srcAddr);
ERROR_LOG(SCEMISC, "sceCccSJIStoUTF8(%08x, %d, %08x): table not loaded", dstAddr, dstSize, srcAddr);
return 0;
}
const auto dstEnd = PSPCharPointer::Create(dstAddr + dstSize);
DEBUG_LOG(HLE, "sceCccSJIStoUTF8(%08x, %d, %08x)", dstAddr, dstSize, srcAddr);
DEBUG_LOG(SCEMISC, "sceCccSJIStoUTF8(%08x, %d, %08x)", dstAddr, dstSize, srcAddr);
ShiftJIS sjis(src);
int n = 0;
while (u32 c = sjis.next())
@ -267,18 +267,18 @@ static int sceCccSJIStoUTF16(u32 dstAddr, u32 dstSize, u32 srcAddr)
auto dst = PSPWCharPointer::Create(dstAddr);
if (!dst.IsValid() || !src.IsValid())
{
ERROR_LOG(HLE, "sceCccSJIStoUTF16(%08x, %d, %08x): invalid pointers", dstAddr, dstSize, srcAddr);
ERROR_LOG(SCEMISC, "sceCccSJIStoUTF16(%08x, %d, %08x): invalid pointers", dstAddr, dstSize, srcAddr);
return 0;
}
if (!jis2ucsTable.IsValid())
{
ERROR_LOG(HLE, "sceCccSJIStoUTF16(%08x, %d, %08x): table not loaded", dstAddr, dstSize, srcAddr);
ERROR_LOG(SCEMISC, "sceCccSJIStoUTF16(%08x, %d, %08x): table not loaded", dstAddr, dstSize, srcAddr);
return 0;
}
const auto dstEnd = PSPWCharPointer::Create(dstAddr + (dstSize & ~1));
DEBUG_LOG(HLE, "sceCccSJIStoUTF16(%08x, %d, %08x)", dstAddr, dstSize, srcAddr);
DEBUG_LOG(SCEMISC, "sceCccSJIStoUTF16(%08x, %d, %08x)", dstAddr, dstSize, srcAddr);
ShiftJIS sjis(src);
int n = 0;
while (u32 c = sjis.next())
@ -302,10 +302,10 @@ static int sceCccStrlenUTF8(u32 strAddr)
const auto str = PSPConstCharPointer::Create(strAddr);
if (!str.IsValid())
{
ERROR_LOG(HLE, "sceCccStrlenUTF8(%08x): invalid pointer", strAddr);
ERROR_LOG(SCEMISC, "sceCccStrlenUTF8(%08x): invalid pointer", strAddr);
return 0;
}
DEBUG_LOG(HLE, "sceCccStrlenUTF8(%08x): invalid pointer", strAddr);
DEBUG_LOG(SCEMISC, "sceCccStrlenUTF8(%08x): invalid pointer", strAddr);
return UTF8(str).length();
}
@ -314,10 +314,10 @@ static int sceCccStrlenUTF16(u32 strAddr)
const auto str = PSPConstWCharPointer::Create(strAddr);
if (!str.IsValid())
{
ERROR_LOG(HLE, "sceCccStrlenUTF16(%08x): invalid pointer", strAddr);
ERROR_LOG(SCEMISC, "sceCccStrlenUTF16(%08x): invalid pointer", strAddr);
return 0;
}
DEBUG_LOG(HLE, "sceCccStrlenUTF16(%08x): invalid pointer", strAddr);
DEBUG_LOG(SCEMISC, "sceCccStrlenUTF16(%08x): invalid pointer", strAddr);
return UTF16LE(str).length();
}
@ -326,10 +326,10 @@ static int sceCccStrlenSJIS(u32 strAddr)
const auto str = PSPCharPointer::Create(strAddr);
if (!str.IsValid())
{
ERROR_LOG(HLE, "sceCccStrlenSJIS(%08x): invalid pointer", strAddr);
ERROR_LOG(SCEMISC, "sceCccStrlenSJIS(%08x): invalid pointer", strAddr);
return 0;
}
DEBUG_LOG(HLE, "sceCccStrlenSJIS(%08x): invalid pointer", strAddr);
DEBUG_LOG(SCEMISC, "sceCccStrlenSJIS(%08x): invalid pointer", strAddr);
return ShiftJIS(str).length();
}
@ -339,10 +339,10 @@ static u32 sceCccEncodeUTF8(u32 dstAddrAddr, u32 ucs)
if (!dstp.IsValid() || !dstp->IsValid())
{
ERROR_LOG(HLE, "sceCccEncodeUTF8(%08x, U+%04x): invalid pointer", dstAddrAddr, ucs);
ERROR_LOG(SCEMISC, "sceCccEncodeUTF8(%08x, U+%04x): invalid pointer", dstAddrAddr, ucs);
return 0;
}
DEBUG_LOG(HLE, "sceCccEncodeUTF8(%08x, U+%04x)", dstAddrAddr, ucs);
DEBUG_LOG(SCEMISC, "sceCccEncodeUTF8(%08x, U+%04x)", dstAddrAddr, ucs);
*dstp += UTF8::encode(*dstp, ucs);
return dstp->ptr;
}
@ -353,10 +353,10 @@ static void sceCccEncodeUTF16(u32 dstAddrAddr, u32 ucs)
if (!dstp.IsValid() || !dstp->IsValid())
{
ERROR_LOG(HLE, "sceCccEncodeUTF16(%08x, U+%04x): invalid pointer", dstAddrAddr, ucs);
ERROR_LOG(SCEMISC, "sceCccEncodeUTF16(%08x, U+%04x): invalid pointer", dstAddrAddr, ucs);
return;
}
DEBUG_LOG(HLE, "sceCccEncodeUTF16(%08x, U+%04x)", dstAddrAddr, ucs);
DEBUG_LOG(SCEMISC, "sceCccEncodeUTF16(%08x, U+%04x)", dstAddrAddr, ucs);
// Anything above 0x10FFFF is unencodable, and 0xD800 - 0xDFFF are reserved for surrogate pairs.
if (ucs > 0x10FFFF || (ucs & 0xD800) == 0xD800)
ucs = errorUTF16;
@ -369,10 +369,10 @@ static u32 sceCccEncodeSJIS(u32 dstAddrAddr, u32 jis)
if (!dstp.IsValid() || !dstp->IsValid())
{
ERROR_LOG(HLE, "sceCccEncodeSJIS(%08x, U+%04x): invalid pointer", dstAddrAddr, jis);
ERROR_LOG(SCEMISC, "sceCccEncodeSJIS(%08x, U+%04x): invalid pointer", dstAddrAddr, jis);
return 0;
}
DEBUG_LOG(HLE, "sceCccEncodeSJIS(%08x, U+%04x)", dstAddrAddr, jis);
DEBUG_LOG(SCEMISC, "sceCccEncodeSJIS(%08x, U+%04x)", dstAddrAddr, jis);
*dstp += ShiftJIS::encode(*dstp, jis);
return dstp->ptr;
}
@ -382,12 +382,12 @@ static u32 sceCccDecodeUTF8(u32 dstAddrAddr)
auto dstp = PSPPointer<PSPConstCharPointer>::Create(dstAddrAddr);
if (!dstp.IsValid() || !dstp->IsValid()) {
ERROR_LOG(HLE, "sceCccDecodeUTF8(%08x): invalid pointer", dstAddrAddr);
ERROR_LOG(SCEMISC, "sceCccDecodeUTF8(%08x): invalid pointer", dstAddrAddr);
// Should crash?
return 0;
}
DEBUG_LOG(HLE, "sceCccDecodeUTF8(%08x)", dstAddrAddr);
DEBUG_LOG(SCEMISC, "sceCccDecodeUTF8(%08x)", dstAddrAddr);
UTF8 utf(*dstp);
u32 result = utf.next();
*dstp += utf.byteIndex();
@ -402,12 +402,12 @@ static u32 sceCccDecodeUTF16(u32 dstAddrAddr)
auto dstp = PSPPointer<PSPConstWCharPointer>::Create(dstAddrAddr);
if (!dstp.IsValid() || !dstp->IsValid()) {
ERROR_LOG(HLE, "sceCccDecodeUTF16(%08x): invalid pointer", dstAddrAddr);
ERROR_LOG(SCEMISC, "sceCccDecodeUTF16(%08x): invalid pointer", dstAddrAddr);
// Should crash?
return 0;
}
DEBUG_LOG(HLE, "sceCccDecodeUTF16(%08x)", dstAddrAddr);
DEBUG_LOG(SCEMISC, "sceCccDecodeUTF16(%08x)", dstAddrAddr);
// TODO: Does it do any detection of BOM?
UTF16LE utf(*dstp);
u32 result = utf.next();
@ -423,12 +423,12 @@ static u32 sceCccDecodeSJIS(u32 dstAddrAddr)
auto dstp = PSPPointer<PSPConstCharPointer>::Create(dstAddrAddr);
if (!dstp.IsValid() || !dstp->IsValid()) {
ERROR_LOG(HLE, "sceCccDecodeSJIS(%08x): invalid pointer", dstAddrAddr);
ERROR_LOG(SCEMISC, "sceCccDecodeSJIS(%08x): invalid pointer", dstAddrAddr);
// Should crash?
return 0;
}
DEBUG_LOG(HLE, "sceCccDecodeSJIS(%08x)", dstAddrAddr);
DEBUG_LOG(SCEMISC, "sceCccDecodeSJIS(%08x)", dstAddrAddr);
ShiftJIS sjis(*dstp);
u32 result = sjis.next();
*dstp += sjis.byteIndex();
@ -440,49 +440,49 @@ static u32 sceCccDecodeSJIS(u32 dstAddrAddr)
static int sceCccIsValidUTF8(u32 c)
{
WARN_LOG(HLE, "UNIMPL sceCccIsValidUTF8(%08x)", c);
WARN_LOG(SCEMISC, "UNIMPL sceCccIsValidUTF8(%08x)", c);
return c != 0;
}
static int sceCccIsValidUTF16(u32 c)
{
WARN_LOG(HLE, "UNIMPL sceCccIsValidUTF16(%08x)", c);
WARN_LOG(SCEMISC, "UNIMPL sceCccIsValidUTF16(%08x)", c);
return c != 0;
}
static int sceCccIsValidSJIS(u32 c)
{
WARN_LOG(HLE, "UNIMPL sceCccIsValidSJIS(%08x)", c);
WARN_LOG(SCEMISC, "UNIMPL sceCccIsValidSJIS(%08x)", c);
return c != 0;
}
static int sceCccIsValidUCS2(u32 c)
{
WARN_LOG(HLE, "UNIMPL sceCccIsValidUCS2(%08x)", c);
WARN_LOG(SCEMISC, "UNIMPL sceCccIsValidUCS2(%08x)", c);
return c != 0;
}
static int sceCccIsValidUCS4(u32 c)
{
WARN_LOG(HLE, "UNIMPL sceCccIsValidUCS4(%08x)", c);
WARN_LOG(SCEMISC, "UNIMPL sceCccIsValidUCS4(%08x)", c);
return c != 0;
}
static int sceCccIsValidJIS(u32 c)
{
WARN_LOG(HLE, "UNIMPL sceCccIsValidJIS(%08x)", c);
WARN_LOG(SCEMISC, "UNIMPL sceCccIsValidJIS(%08x)", c);
return c != 0;
}
static int sceCccIsValidUnicode(u32 c)
{
WARN_LOG(HLE, "UNIMPL sceCccIsValidUnicode(%08x)", c);
WARN_LOG(SCEMISC, "UNIMPL sceCccIsValidUnicode(%08x)", c);
return c != 0;
}
static u32 sceCccSetErrorCharUTF8(u32 c)
{
DEBUG_LOG(HLE, "sceCccSetErrorCharUTF8(%08x)", c);
DEBUG_LOG(SCEMISC, "sceCccSetErrorCharUTF8(%08x)", c);
int result = errorUTF8;
errorUTF8 = c;
return result;
@ -490,7 +490,7 @@ static u32 sceCccSetErrorCharUTF8(u32 c)
static u32 sceCccSetErrorCharUTF16(u32 c)
{
DEBUG_LOG(HLE, "sceCccSetErrorCharUTF16(%08x)", c);
DEBUG_LOG(SCEMISC, "sceCccSetErrorCharUTF16(%08x)", c);
int result = errorUTF16;
errorUTF16 = c;
return result;
@ -498,7 +498,7 @@ static u32 sceCccSetErrorCharUTF16(u32 c)
static u32 sceCccSetErrorCharSJIS(u32 c)
{
DEBUG_LOG(HLE, "sceCccSetErrorCharSJIS(%04x)", c);
DEBUG_LOG(SCEMISC, "sceCccSetErrorCharSJIS(%04x)", c);
int result = errorSJIS;
errorSJIS = c;
return result;
@ -508,12 +508,12 @@ static u32 sceCccUCStoJIS(u32 c, u32 alt)
{
if (ucs2jisTable.IsValid())
{
DEBUG_LOG(HLE, "sceCccUCStoJIS(%08x, %08x)", c, alt);
DEBUG_LOG(SCEMISC, "sceCccUCStoJIS(%08x, %08x)", c, alt);
return __CccUCStoJIS(c, alt);
}
else
{
ERROR_LOG(HLE, "sceCccUCStoJIS(%08x, %08x): table not loaded", c, alt);
ERROR_LOG(SCEMISC, "sceCccUCStoJIS(%08x, %08x): table not loaded", c, alt);
return alt;
}
}
@ -522,12 +522,12 @@ static u32 sceCccJIStoUCS(u32 c, u32 alt)
{
if (jis2ucsTable.IsValid())
{
DEBUG_LOG(HLE, "sceCccUCStoJIS(%08x, %08x)", c, alt);
DEBUG_LOG(SCEMISC, "sceCccUCStoJIS(%08x, %08x)", c, alt);
return __CccJIStoUCS(c, alt);
}
else
{
ERROR_LOG(HLE, "sceCccUCStoJIS(%08x, %08x): table not loaded", c, alt);
ERROR_LOG(SCEMISC, "sceCccUCStoJIS(%08x, %08x): table not loaded", c, alt);
return alt;
}
}

View File

@ -602,7 +602,7 @@ KernelObject *KernelObjectPool::CreateByIDType(int type) {
return __KernelThreadEventHandlerObject();
default:
ERROR_LOG(COMMON, "Unable to load state: could not find object type %d.", type);
ERROR_LOG(SAVESTATE, "Unable to load state: could not find object type %d.", type);
return NULL;
}
}

View File

@ -347,15 +347,15 @@ struct SceKernelVplHeader {
while (b.ptr < lastBlock.ptr) {
bool isFree = b->next.ptr != SentinelPtr();
if (nextFreeBlock_ == b && isFree) {
NOTICE_LOG(HLE, "NEXT: %x -> %x (size %x)", b.ptr - startPtr_, b->next.ptr - startPtr_, b->sizeInBlocks * 8);
NOTICE_LOG(SCEKERNEL, "NEXT: %x -> %x (size %x)", b.ptr - startPtr_, b->next.ptr - startPtr_, b->sizeInBlocks * 8);
} else if (isFree) {
NOTICE_LOG(HLE, "FREE: %x -> %x (size %x)", b.ptr - startPtr_, b->next.ptr - startPtr_, b->sizeInBlocks * 8);
NOTICE_LOG(SCEKERNEL, "FREE: %x -> %x (size %x)", b.ptr - startPtr_, b->next.ptr - startPtr_, b->sizeInBlocks * 8);
} else {
NOTICE_LOG(HLE, "BLOCK: %x (size %x)", b.ptr - startPtr_, b->sizeInBlocks * 8);
NOTICE_LOG(SCEKERNEL, "BLOCK: %x (size %x)", b.ptr - startPtr_, b->sizeInBlocks * 8);
}
b += b->sizeInBlocks;
}
NOTICE_LOG(HLE, "LAST: %x -> %x (size %x)", lastBlock.ptr - startPtr_, lastBlock->next.ptr - startPtr_, lastBlock->sizeInBlocks * 8);
NOTICE_LOG(SCEKERNEL, "LAST: %x -> %x (size %x)", lastBlock.ptr - startPtr_, lastBlock->next.ptr - startPtr_, lastBlock->sizeInBlocks * 8);
}
PSPPointer<SceKernelVplBlock> MergeBlocks(PSPPointer<SceKernelVplBlock> first, PSPPointer<SceKernelVplBlock> second) {

View File

@ -794,7 +794,7 @@ void Module::Cleanup() {
}
if (memoryBlockAddr != 0 && nm.text_addr != 0 && memoryBlockSize >= nm.data_size + nm.bss_size + nm.text_size) {
DEBUG_LOG(HLE, "Zeroing out module %s memory: %08x - %08x", nm.name, memoryBlockAddr, memoryBlockAddr + memoryBlockSize);
DEBUG_LOG(LOADER, "Zeroing out module %s memory: %08x - %08x", nm.name, memoryBlockAddr, memoryBlockAddr + memoryBlockSize);
for (u32 i = 0; i < (u32)(nm.text_size + 3); i += 4) {
Memory::Write_U32(MIPS_MAKE_BREAK(1), nm.text_addr + i);
}

View File

@ -325,7 +325,7 @@ void ADSREnvelope::SetSimpleEnvelope(u32 ADSREnv1, u32 ADSREnv2) {
sustainLevel = getSustainLevel(ADSREnv1);
if (attackRate < 0 || decayRate < 0 || sustainRate < 0 || releaseRate < 0) {
ERROR_LOG_REPORT(SCESAS, "Simple ADSR resulted in invalid rates: %04x, %04x", ADSREnv1, ADSREnv2);
ERROR_LOG_REPORT(SASMIX, "Simple ADSR resulted in invalid rates: %04x, %04x", ADSREnv1, ADSREnv2);
}
}
@ -545,7 +545,7 @@ void SasInstance::MixVoice(SasVoice &voice) {
if (voice.HaveSamplesEnded())
voice.envelope.End();
if (voice.envelope.HasEnded()) {
// NOTICE_LOG(SCESAS, "Hit end of envelope");
// NOTICE_LOG(SASMIX, "Hit end of envelope");
voice.playing = false;
voice.on = false;
}
@ -576,7 +576,7 @@ void SasInstance::Mix(u32 outAddr, u32 inAddr, int leftVol, int rightVol) {
s16 *outpR = outp + grainSize * 1;
s16 *outpSendL = outp + grainSize * 2;
s16 *outpSendR = outp + grainSize * 3;
WARN_LOG_REPORT_ONCE(sasraw, SCESAS, "sceSasCore: raw outputMode");
WARN_LOG_REPORT_ONCE(sasraw, SASMIX, "sceSasCore: raw outputMode");
for (int i = 0; i < grainSize * 2; i += 2) {
*outpL++ = clamp_s16(mixBuffer[i + 0]);
*outpR++ = clamp_s16(mixBuffer[i + 1]);
@ -702,7 +702,7 @@ void SasInstance::DoState(PointerWrap &p) {
int n = PSP_SAS_VOICES_MAX;
p.Do(n);
if (n != PSP_SAS_VOICES_MAX) {
ERROR_LOG(HLE, "Savestate failure: wrong number of SAS voices");
ERROR_LOG(SAVESTATE, "Wrong number of SAS voices");
return;
}
p.DoArray(voices, ARRAY_SIZE(voices));

View File

@ -367,13 +367,13 @@ __forceinline static Opcode Read_Instruction(u32 address, bool resolveReplacemen
u32 op;
if (GetReplacedOpAt(address, &op)) {
if (MIPS_IS_EMUHACK(op)) {
ERROR_LOG(HLE,"WTF 1");
ERROR_LOG(MEMMAP, "WTF 1");
return Opcode(op);
} else {
return Opcode(op);
}
} else {
ERROR_LOG(HLE, "Replacement, but no replacement op? %08x", inst.encoding);
ERROR_LOG(MEMMAP, "Replacement, but no replacement op? %08x", inst.encoding);
}
}
return inst;
@ -381,7 +381,7 @@ __forceinline static Opcode Read_Instruction(u32 address, bool resolveReplacemen
u32 op;
if (GetReplacedOpAt(address, &op)) {
if (MIPS_IS_EMUHACK(op)) {
ERROR_LOG(HLE,"WTF 2");
ERROR_LOG(MEMMAP, "WTF 2");
return Opcode(op);
} else {
return Opcode(op);

View File

@ -577,7 +577,7 @@ namespace SaveState
if (!__KernelIsRunning())
{
ERROR_LOG(COMMON, "Savestate failure: Unable to load without kernel, this should never happen.");
ERROR_LOG(SAVESTATE, "Savestate failure: Unable to load without kernel, this should never happen.");
return;
}
@ -603,7 +603,7 @@ namespace SaveState
switch (op.type)
{
case SAVESTATE_LOAD:
INFO_LOG(COMMON, "Loading state from %s", op.filename.c_str());
INFO_LOG(SAVESTATE, "Loading state from %s", op.filename.c_str());
result = CChunkFileReader::Load(op.filename, PPSSPP_GIT_VERSION, state, &reason);
if (result == CChunkFileReader::ERROR_NONE) {
callbackMessage = sc->T("Loaded State");
@ -612,7 +612,7 @@ namespace SaveState
} else if (result == CChunkFileReader::ERROR_BROKEN_STATE) {
HandleFailure();
callbackMessage = i18nLoadFailure;
ERROR_LOG(COMMON, "Load state failure: %s", reason.c_str());
ERROR_LOG(SAVESTATE, "Load state failure: %s", reason.c_str());
callbackResult = false;
} else {
callbackMessage = sc->T(reason.c_str(), i18nLoadFailure);
@ -621,7 +621,7 @@ namespace SaveState
break;
case SAVESTATE_SAVE:
INFO_LOG(COMMON, "Saving state to %s", op.filename.c_str());
INFO_LOG(SAVESTATE, "Saving state to %s", op.filename.c_str());
result = CChunkFileReader::Save(op.filename, g_paramSFO.GetValueString("TITLE"), PPSSPP_GIT_VERSION, state);
if (result == CChunkFileReader::ERROR_NONE) {
callbackMessage = sc->T("Saved State");
@ -629,7 +629,7 @@ namespace SaveState
} else if (result == CChunkFileReader::ERROR_BROKEN_STATE) {
HandleFailure();
callbackMessage = i18nSaveFailure;
ERROR_LOG(COMMON, "Save state failure: %s", reason.c_str());
ERROR_LOG(SAVESTATE, "Save state failure: %s", reason.c_str());
callbackResult = false;
} else {
callbackMessage = i18nSaveFailure;
@ -640,14 +640,14 @@ namespace SaveState
case SAVESTATE_VERIFY:
callbackResult = CChunkFileReader::Verify(state) == CChunkFileReader::ERROR_NONE;
if (callbackResult) {
INFO_LOG(COMMON, "Verified save state system");
INFO_LOG(SAVESTATE, "Verified save state system");
} else {
ERROR_LOG(COMMON, "Save state system verification failed");
ERROR_LOG(SAVESTATE, "Save state system verification failed");
}
break;
case SAVESTATE_REWIND:
INFO_LOG(COMMON, "Rewinding to recent savestate snapshot");
INFO_LOG(SAVESTATE, "Rewinding to recent savestate snapshot");
result = rewindStates.Restore();
if (result == CChunkFileReader::ERROR_NONE) {
callbackMessage = sc->T("Loaded State");
@ -673,12 +673,12 @@ namespace SaveState
case SAVESTATE_SAVE_SCREENSHOT:
callbackResult = TakeGameScreenshot(op.filename.c_str(), SCREENSHOT_JPG, SCREENSHOT_DISPLAY);
if (!callbackResult) {
ERROR_LOG(COMMON, "Failed to take a screenshot for the savestate! %s", op.filename.c_str());
ERROR_LOG(SAVESTATE, "Failed to take a screenshot for the savestate! %s", op.filename.c_str());
}
break;
default:
ERROR_LOG(COMMON, "Savestate failure: unknown operation type %d", op.type);
ERROR_LOG(SAVESTATE, "Savestate failure: unknown operation type %d", op.type);
callbackResult = false;
break;
}

View File

@ -71,13 +71,13 @@ private:
static bool WriteScreenshotToJPEG(const char *filename, int width, int height, int num_channels, const uint8_t *image_data, const jpge::params &comp_params) {
JPEGFileStream dst_stream(filename);
if (!dst_stream.Valid()) {
ERROR_LOG(COMMON, "Unable to open screenshot file for writing.");
ERROR_LOG(SYSTEM, "Unable to open screenshot file for writing.");
return false;
}
jpge::jpeg_encoder dst_image;
if (!dst_image.init(&dst_stream, width, height, num_channels, comp_params)) {
ERROR_LOG(COMMON, "Screenshot JPEG encode init failed.");
ERROR_LOG(SYSTEM, "Screenshot JPEG encode init failed.");
return false;
}
@ -85,18 +85,18 @@ static bool WriteScreenshotToJPEG(const char *filename, int width, int height, i
for (int i = 0; i < height; i++) {
const uint8_t *buf = image_data + i * width * num_channels;
if (!dst_image.process_scanline(buf)) {
ERROR_LOG(COMMON, "Screenshot JPEG encode scanline failed.");
ERROR_LOG(SYSTEM, "Screenshot JPEG encode scanline failed.");
return false;
}
}
if (!dst_image.process_scanline(NULL)) {
ERROR_LOG(COMMON, "Screenshot JPEG encode scanline flush failed.");
ERROR_LOG(SYSTEM, "Screenshot JPEG encode scanline flush failed.");
return false;
}
}
if (!dst_stream.Valid()) {
ERROR_LOG(COMMON, "Screenshot file write failed.");
ERROR_LOG(SYSTEM, "Screenshot file write failed.");
}
dst_image.deinit();
@ -106,18 +106,18 @@ static bool WriteScreenshotToJPEG(const char *filename, int width, int height, i
static bool WriteScreenshotToPNG(png_imagep image, const char *filename, int convert_to_8bit, const void *buffer, png_int_32 row_stride, const void *colormap) {
FILE *fp = File::OpenCFile(filename, "wb");
if (!fp) {
ERROR_LOG(COMMON, "Unable to open screenshot file for writing.");
ERROR_LOG(SYSTEM, "Unable to open screenshot file for writing.");
return false;
}
if (png_image_write_to_stdio(image, fp, convert_to_8bit, buffer, row_stride, colormap)) {
if (fclose(fp) != 0) {
ERROR_LOG(COMMON, "Screenshot file write failed.");
ERROR_LOG(SYSTEM, "Screenshot file write failed.");
return false;
}
return true;
} else {
ERROR_LOG(COMMON, "Screenshot PNG encode failed.");
ERROR_LOG(SYSTEM, "Screenshot PNG encode failed.");
fclose(fp);
remove(filename);
return false;
@ -204,7 +204,7 @@ const u8 *ConvertBufferTo888RGB(const GPUDebugBuffer &buf, u8 *&temp, u32 &w, u3
b = (src >> 16) & 0xFF;
break;
default:
ERROR_LOG(COMMON, "Unsupported framebuffer format for screenshot: %d", buf.GetFormat());
ERROR_LOG(G3D, "Unsupported framebuffer format for screenshot: %d", buf.GetFormat());
return nullptr;
}
}
@ -217,7 +217,7 @@ const u8 *ConvertBufferTo888RGB(const GPUDebugBuffer &buf, u8 *&temp, u32 &w, u3
bool TakeGameScreenshot(const char *filename, ScreenshotFormat fmt, ScreenshotType type, int *width, int *height, int maxRes) {
if (!gpuDebug) {
ERROR_LOG(COMMON, "Can't take screenshots when GPU not running");
ERROR_LOG(SYSTEM, "Can't take screenshots when GPU not running");
return false;
}
GPUDebugBuffer buf;
@ -236,7 +236,7 @@ bool TakeGameScreenshot(const char *filename, ScreenshotFormat fmt, ScreenshotTy
}
if (!success) {
ERROR_LOG(COMMON, "Failed to obtain screenshot data.");
ERROR_LOG(G3D, "Failed to obtain screenshot data.");
return false;
}
@ -273,7 +273,7 @@ bool TakeGameScreenshot(const char *filename, ScreenshotFormat fmt, ScreenshotTy
png_image_free(&png);
if (png.warning_or_error >= 2) {
ERROR_LOG(COMMON, "Saving screenshot to PNG produced errors.");
ERROR_LOG(SYSTEM, "Saving screenshot to PNG produced errors.");
success = false;
}
} else if (success && fmt == SCREENSHOT_JPG) {
@ -287,7 +287,7 @@ bool TakeGameScreenshot(const char *filename, ScreenshotFormat fmt, ScreenshotTy
}
#endif
if (!success) {
ERROR_LOG(COMMON, "Failed to write screenshot.");
ERROR_LOG(SYSTEM, "Failed to write screenshot.");
}
return success;
}

View File

@ -269,18 +269,18 @@ void TextureReplacer::PopulateReplacement(ReplacedTexture *result, u64 cachekey,
static bool WriteTextureToPNG(png_imagep image, const std::string &filename, int convert_to_8bit, const void *buffer, png_int_32 row_stride, const void *colormap) {
FILE *fp = File::OpenCFile(filename, "wb");
if (!fp) {
ERROR_LOG(COMMON, "Unable to open texture file for writing.");
ERROR_LOG(SYSTEM, "Unable to open texture file for writing.");
return false;
}
if (png_image_write_to_stdio(image, fp, convert_to_8bit, buffer, row_stride, colormap)) {
if (fclose(fp) != 0) {
ERROR_LOG(COMMON, "Texture file write failed.");
ERROR_LOG(SYSTEM, "Texture file write failed.");
return false;
}
return true;
} else {
ERROR_LOG(COMMON, "Texture PNG encode failed.");
ERROR_LOG(SYSTEM, "Texture PNG encode failed.");
fclose(fp);
remove(filename.c_str());
return false;

View File

@ -579,7 +579,7 @@ bool TextureScalerCommon::ScaleInto(u32 *outputBuf, u32 *src, u32 &dstFmt, int &
#ifdef SCALING_MEASURE_TIME
if (width*height > 64 * 64 * factor*factor) {
double t = real_time_now() - t_start;
NOTICE_LOG(MASTER_LOG, "TextureScaler: processed %9d pixels in %6.5lf seconds. (%9.2lf Mpixels/second)",
NOTICE_LOG(G3D, "TextureScaler: processed %9d pixels in %6.5lf seconds. (%9.2lf Mpixels/second)",
width*height, t, (width*height) / (t * 1000 * 1000));
}
#endif

View File

@ -291,7 +291,7 @@ JittedVertexDecoder VertexDecoderJitCache::Compile(const VertexDecoder &dec, int
SetCodePtr(const_cast<u8 *>(start));
char temp[1024] = {0};
dec.ToString(temp);
INFO_LOG(HLE, "Could not compile vertex decoder: %s", temp);
INFO_LOG(G3D, "Could not compile vertex decoder: %s", temp);
return 0;
}
}
@ -321,7 +321,7 @@ JittedVertexDecoder VertexDecoderJitCache::Compile(const VertexDecoder &dec, int
DisassembleArm(start, GetCodePtr() - start);
char temp[1024] = {0};
dec.ToString(temp);
INFO_LOG(HLE, "%s", temp);
INFO_LOG(G3D, "%s", temp);
*/
*jittedSize = GetCodePtr() - start;

View File

@ -254,7 +254,7 @@ JittedVertexDecoder VertexDecoderJitCache::Compile(const VertexDecoder &dec, int
SetCodePtr(const_cast<u8 *>(start));
char temp[1024] = {0};
dec.ToString(temp);
ERROR_LOG(HLE, "Could not compile vertex decoder, failed at step %d: %s", i, temp);
ERROR_LOG(G3D, "Could not compile vertex decoder, failed at step %d: %s", i, temp);
return nullptr;
}
}

View File

@ -824,7 +824,7 @@ void FramebufferManagerD3D11::PackFramebufferD3D11_(VirtualFramebuffer *vfb, int
// We always need to convert from the framebuffer native format.
// Right now that's always 8888.
DEBUG_LOG(HLE, "Reading framebuffer to mem, fb_address = %08x", fb_address);
DEBUG_LOG(G3D, "Reading framebuffer to mem, fb_address = %08x", fb_address);
ID3D11Texture2D *colorTex = (ID3D11Texture2D *)draw_->GetFramebufferAPITexture(vfb->fbo, Draw::FB_COLOR_BIT, 0);
D3D11_BOX srcBox{ 0, 0, 0, vfb->width, vfb->height, 1 };

View File

@ -109,7 +109,7 @@ static void RunPauseAction() {
break;
default:
ERROR_LOG(HLE, "Unsupported pause action, forgot to add it to the switch.");
ERROR_LOG(G3D, "Unsupported pause action, forgot to add it to the switch.");
}
actionComplete = true;

View File

@ -692,7 +692,7 @@ static const D3DVERTEXELEMENT9 g_FramebufferVertexElements[] = {
// We always need to convert from the framebuffer native format.
// Right now that's always 8888.
DEBUG_LOG(HLE, "Reading framebuffer to mem, fb_address = %08x", fb_address);
DEBUG_LOG(G3D, "Reading framebuffer to mem, fb_address = %08x", fb_address);
LPDIRECT3DSURFACE9 renderTarget = (LPDIRECT3DSURFACE9)draw_->GetFramebufferAPITexture(vfb->fbo, Draw::FB_COLOR_BIT | Draw::FB_SURFACE_BIT, 0);
D3DSURFACE_DESC desc;

View File

@ -581,7 +581,7 @@ VSShader *ShaderManagerDX9::ApplyShader(int prim, u32 vertType) {
if (vs->Failed()) {
I18NCategory *gr = GetI18NCategory("Graphics");
ERROR_LOG(HLE, "Shader compilation failed, falling back to software transform");
ERROR_LOG(G3D, "Shader compilation failed, falling back to software transform");
host->NotifyUserMessage(gr->T("hardware transform error - falling back to software"), 2.5f, 0xFF3030FF);
delete vs;

View File

@ -44,7 +44,7 @@ public:
codec = PSP_CODEC_AT3;
break;
default:
ERROR_LOG(HLE, "Unexpected SND0.AT3 format %04x", format);
ERROR_LOG(SCEAUDIO, "Unexpected SND0.AT3 format %04x", format);
return;
}

View File

@ -201,7 +201,7 @@ UI::EventReturn LogScreen::OnSubmit(UI::EventParams &e) {
// TODO: Can add all sorts of fun stuff here that we can't be bothered writing proper UI for, like various memdumps etc.
NOTICE_LOG(HLE, "Submitted: %s", cmd.c_str());
NOTICE_LOG(SYSTEM, "Submitted: %s", cmd.c_str());
UpdateLog();
cmdLine_->SetText("");

View File

@ -991,7 +991,7 @@ void EmuScreen::render() {
SaveState::SaveToRam(freezeState_);
} else if (PSP_CoreParameter().frozen) {
if (CChunkFileReader::ERROR_NONE != SaveState::LoadFromRam(freezeState_)) {
ERROR_LOG(HLE, "Failed to load freeze state. Unfreezing.");
ERROR_LOG(SAVESTATE, "Failed to load freeze state. Unfreezing.");
PSP_CoreParameter().frozen = false;
}
}

View File

@ -78,9 +78,9 @@ bool GameInfo::Delete() {
{
// TODO: This could be handled by Core/Util/GameManager too somehow.
std::string directoryToRemove = ResolvePBPDirectory(filePath_);
INFO_LOG(HLE, "Deleting %s", directoryToRemove.c_str());
INFO_LOG(SYSTEM, "Deleting %s", directoryToRemove.c_str());
if (!File::DeleteDirRecursively(directoryToRemove)) {
ERROR_LOG(HLE, "Failed to delete file");
ERROR_LOG(SYSTEM, "Failed to delete file");
return false;
}
g_Config.CleanRecent();

View File

@ -160,7 +160,7 @@ static void ExecuteServer() {
if (!http->Listen(g_Config.iRemoteISOPort)) {
if (!http->Listen(0)) {
ERROR_LOG(COMMON, "Unable to listen on any port");
ERROR_LOG(FILESYS, "Unable to listen on any port");
UpdateStatus(ServerStatus::STOPPED);
return;
}

View File

@ -278,7 +278,7 @@ UI::EventReturn ProductView::OnInstall(UI::EventParams &e) {
if (installButton_) {
installButton_->SetEnabled(false);
}
INFO_LOG(HLE, "Triggering install of %s", zipUrl.c_str());
INFO_LOG(SYSTEM, "Triggering install of %s", zipUrl.c_str());
g_GameManager.DownloadAndInstall(zipUrl);
return UI::EVENT_DONE;
}

View File

@ -169,7 +169,7 @@ void CGEDebugger::DescribePrimaryPreview(const GPUgstate &state, wchar_t desc[25
return;
}
_assert_msg_(MASTER_LOG, primaryBuffer_ != nullptr, "Must have a valid primaryBuffer_");
_assert_msg_(G3D, primaryBuffer_ != nullptr, "Must have a valid primaryBuffer_");
switch (PrimaryDisplayType(fbTabs->CurrentTabIndex())) {
case PRIMARY_FRAMEBUF:
@ -727,14 +727,14 @@ BOOL CGEDebugger::DlgProc(UINT message, WPARAM wParam, LPARAM lParam) {
u32 pc = (u32)wParam;
ClearTempBreakpoints();
auto info = gpuDebug->DissassembleOp(pc);
NOTICE_LOG(COMMON, "Waiting at %08x, %s", pc, info.desc.c_str());
NOTICE_LOG(G3D, "Waiting at %08x, %s", pc, info.desc.c_str());
UpdatePreviews();
}
break;
case WM_GEDBG_BREAK_DRAW:
{
NOTICE_LOG(COMMON, "Waiting at a draw");
NOTICE_LOG(G3D, "Waiting at a draw");
UpdatePreviews();
}
break;

View File

@ -155,11 +155,11 @@ void CGEDebugger::UpdatePrimPreview(u32 op) {
const u32 prim_type = (op >> 16) & 0x7;
int count = op & 0xFFFF;
if (prim_type >= 7) {
ERROR_LOG(COMMON, "Unsupported prim type: %x", op);
ERROR_LOG(G3D, "Unsupported prim type: %x", op);
return;
}
if (!gpuDebug) {
ERROR_LOG(COMMON, "Invalid debugging environment, shutting down?");
ERROR_LOG(G3D, "Invalid debugging environment, shutting down?");
return;
}
if (count == 0) {
@ -171,7 +171,7 @@ void CGEDebugger::UpdatePrimPreview(u32 op) {
static std::vector<u16> indices;
if (!gpuDebug->GetCurrentSimpleVertices(count, vertices, indices)) {
ERROR_LOG(COMMON, "Vertex preview not yet supported");
ERROR_LOG(G3D, "Vertex preview not yet supported");
return;
}

View File

@ -266,6 +266,8 @@ namespace MainWindow
// Moves the internal display window to match the inner size of the main window.
MoveWindow(hwndDisplay, 0, 0, width, height, TRUE);
INFO_LOG(SYSTEM, "New width/height: %dx%d", width, height);
// Setting pixelWidth to be too small could have odd consequences.
if (width >= 4 && height >= 4) {
// The framebuffer manager reads these once per frame, hopefully safe enough.. should really use a mutex or some

View File

@ -82,7 +82,7 @@ namespace WindowsRawInput {
dev[2].dwFlags = 0;
if (!RegisterRawInputDevices(dev, 3, sizeof(RAWINPUTDEVICE))) {
WARN_LOG(COMMON, "Unable to register raw input devices: %s", GetLastErrorMsg());
WARN_LOG(SYSTEM, "Unable to register raw input devices: %s", GetLastErrorMsg());
}
}