Recategorize some logging, in preparation for what's to come.

This commit is contained in:
Henrik Rydgård committed 2020-08-15 11:51:22 +02:00
1 parent 5c9f23d3b4
commit 0fcc0994b4
9 files changed
+30 -39

No files matched your search

+3 -1
View File
@@ -38,7 +38,7 @@
namespace LogTypes {
enum LOG_TYPE {
SYSTEM = 0,
SYSTEM = 0, // Catch-all for uncategorized things
BOOT,
COMMON,
CPU,
@@ -52,6 +52,8 @@ enum LOG_TYPE {
SASMIX,
SAVESTATE,
FRAMEBUF,
AUDIO,
IO,
SCEAUDIO,
SCECTRL,
+4 -4
View File
@@ -93,7 +93,9 @@ static const LogNameTableEntry logTable[] = {
{LogTypes::MEMMAP, "MEMMAP"},
{LogTypes::SASMIX, "SASMIX"},
{LogTypes::SAVESTATE, "SAVESTATE"},
{LogTypes::FRAMEBUF, "FRAMEBUF"},
{LogTypes::FRAMEBUF, "FRAMEBUF"},
{LogTypes::AUDIO, "AUDIO"},
{LogTypes::IO, "IO"},
{LogTypes::SCEAUDIO, "SCEAUDIO"},
{LogTypes::SCECTRL, "SCECTRL"},
@@ -113,9 +115,7 @@ static const LogNameTableEntry logTable[] = {
LogManager::LogManager() {
for (size_t i = 0; i < ARRAY_SIZE(logTable); i++) {
if (i != logTable[i].logType) {
FLOG("Bad logtable at %i", (int)i);
}
_assert_msg_(i == logTable[i].logType, "Bad logtable at %i", (int)i);
truncate_cpy(log_[logTable[i].logType].m_shortName, logTable[i].name);
log_[logTable[i].logType].enabled = true;
#if defined(_DEBUG)
+1 -1
View File
@@ -1799,7 +1799,7 @@ void __KernelGPUReplay() {
// Special ABI: s0 and s1 are the "args". Not null terminated.
const char *filenamep = Memory::GetCharPointer(currentMIPS->r[MIPS_REG_S1]);
if (!filenamep) {
ERROR_LOG(SYSTEM, "Failed to load dump filename");
ERROR_LOG(G3D, "Failed to load dump filename");
Core_Stop();
return;
}
+7 -13
View File
@@ -71,13 +71,12 @@ 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(SYSTEM, "Unable to open screenshot file for writing.");
ERROR_LOG(IO, "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(SYSTEM, "Screenshot JPEG encode init failed.");
return false;
}
@@ -85,12 +84,10 @@ 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(SYSTEM, "Screenshot JPEG encode scanline failed.");
return false;
}
}
if (!dst_image.process_scanline(NULL)) {
ERROR_LOG(SYSTEM, "Screenshot JPEG encode scanline flush failed.");
return false;
}
}
@@ -106,18 +103,15 @@ 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(SYSTEM, "Unable to open screenshot file for writing.");
ERROR_LOG(IO, "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(SYSTEM, "Screenshot file write failed.");
return false;
}
fclose(fp);
return true;
} else {
ERROR_LOG(SYSTEM, "Screenshot PNG encode failed.");
ERROR_LOG(IO, "Screenshot PNG encode failed.");
fclose(fp);
remove(filename);
return false;
@@ -347,7 +341,7 @@ bool TakeGameScreenshot(const char *filename, ScreenshotFormat fmt, ScreenshotTy
delete [] flipbuffer;
if (!success) {
ERROR_LOG(SYSTEM, "Failed to write screenshot.");
ERROR_LOG(IO, "Failed to write screenshot.");
}
return success;
}
@@ -368,7 +362,7 @@ bool Save888RGBScreenshot(const char *filename, ScreenshotFormat fmt, const u8 *
png_image_free(&png);
if (png.warning_or_error >= 2) {
ERROR_LOG(SYSTEM, "Saving screenshot to PNG produced errors.");
ERROR_LOG(IO, "Saving screenshot to PNG produced errors.");
success = false;
}
return success;
@@ -397,7 +391,7 @@ bool Save8888RGBAScreenshot(const char *filename, const u8 *buffer, int w, int h
png_image_free(&png);
if (png.warning_or_error >= 2) {
ERROR_LOG(SYSTEM, "Saving screenshot to PNG produced errors.");
ERROR_LOG(IO, "Saving screenshot to PNG produced errors.");
success = false;
}
return success;
+1 -5
View File
@@ -380,15 +380,11 @@ 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(SYSTEM, "Unable to open texture file for writing.");
ERROR_LOG(IO, "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(SYSTEM, "Texture file write failed.");
return false;
}
return true;
} else {
ERROR_LOG(SYSTEM, "Texture PNG encode failed.");
+2 -4
View File
@@ -11,9 +11,7 @@
constexpr size_t WaveFileWriter::BUFFER_SIZE;
WaveFileWriter::WaveFileWriter()
{
}
WaveFileWriter::WaveFileWriter() {}
WaveFileWriter::~WaveFileWriter()
{
@@ -30,7 +28,7 @@ bool WaveFileWriter::Start(const std::string& filename, unsigned int HLESampleRa
file.Open(filename, "wb");
if (!file) {
ERROR_LOG(SYSTEM, "The file %s could not be opened for writing. Please check if it's already opened by another program.", filename.c_str());
ERROR_LOG(IO, "The file %s could not be opened for writing. Please check if it's already opened by another program.", filename.c_str());
return false;
}
+2 -1
View File
@@ -887,7 +887,8 @@ void FramebufferManagerCommon::CopyDisplayToOutput(bool reallyDirty) {
if (vfb) {
// Okay, we found one above.
INFO_LOG_REPORT_ONCE(displayoffset, HLE, "Rendering from framebuf with offset %08x -> %08x+%dx%d", addr, vfb->fb_address, offsetX, offsetY);
// Log should be "Displaying from framebuf" but not worth changing the report.
INFO_LOG_REPORT_ONCE(displayoffset, FRAMEBUF, "Rendering from framebuf with offset %08x -> %08x+%dx%d", addr, vfb->fb_address, offsetX, offsetY);
}
}
+2 -2
View File
@@ -49,7 +49,7 @@ bool RIFFReader::Descend(uint32_t intoId) {
int startLocation = pos_;
if (pos_ + length > fileSize_) {
ERROR_LOG(SYSTEM, "Block extends outside of RIFF file - failing descend");
ERROR_LOG(IO, "Block extends outside of RIFF file - failing descend");
pos_ = stack[depth_].parentStartLocation;
return false;
}
@@ -64,7 +64,7 @@ bool RIFFReader::Descend(uint32_t intoId) {
if (length > 0) {
pos_ += length; // try next block
} else {
ERROR_LOG(SYSTEM, "Bad data in RIFF file : block length %d. Not descending.", length);
ERROR_LOG(IO, "Bad data in RIFF file : block length %d. Not descending.", length);
pos_ = stack[depth_].parentStartLocation;
return false;
}
+8 -8
View File
@@ -791,30 +791,30 @@ static void LogReadPixelsError(GLenum error) {
case GL_NO_ERROR:
break;
case GL_INVALID_ENUM:
ERROR_LOG(FRAMEBUF, "glReadPixels: GL_INVALID_ENUM");
ERROR_LOG(G3D, "glReadPixels: GL_INVALID_ENUM");
break;
case GL_INVALID_VALUE:
ERROR_LOG(FRAMEBUF, "glReadPixels: GL_INVALID_VALUE");
ERROR_LOG(G3D, "glReadPixels: GL_INVALID_VALUE");
break;
case GL_INVALID_OPERATION:
ERROR_LOG(FRAMEBUF, "glReadPixels: GL_INVALID_OPERATION");
ERROR_LOG(G3D, "glReadPixels: GL_INVALID_OPERATION");
break;
case GL_INVALID_FRAMEBUFFER_OPERATION:
ERROR_LOG(FRAMEBUF, "glReadPixels: GL_INVALID_FRAMEBUFFER_OPERATION");
ERROR_LOG(G3D, "glReadPixels: GL_INVALID_FRAMEBUFFER_OPERATION");
break;
case GL_OUT_OF_MEMORY:
ERROR_LOG(FRAMEBUF, "glReadPixels: GL_OUT_OF_MEMORY");
ERROR_LOG(G3D, "glReadPixels: GL_OUT_OF_MEMORY");
break;
#ifndef USING_GLES2
case GL_STACK_UNDERFLOW:
ERROR_LOG(FRAMEBUF, "glReadPixels: GL_STACK_UNDERFLOW");
ERROR_LOG(G3D, "glReadPixels: GL_STACK_UNDERFLOW");
break;
case GL_STACK_OVERFLOW:
ERROR_LOG(FRAMEBUF, "glReadPixels: GL_STACK_OVERFLOW");
ERROR_LOG(G3D, "glReadPixels: GL_STACK_OVERFLOW");
break;
#endif
default:
ERROR_LOG(FRAMEBUF, "glReadPixels: %08x", error);
ERROR_LOG(G3D, "glReadPixels: %08x", error);
break;
}
}