diff --git a/Common/Log.h b/Common/Log.h index 2b2bdc02b2..2f0836e212 100644 --- a/Common/Log.h +++ b/Common/Log.h @@ -85,20 +85,10 @@ void GenericLog(LogLevel level, Log type, const char *file, int line, const char ; bool GenericLogEnabled(LogLevel level, Log type); -// We only disable DEBUG and VERBOSE on Android/iOS now. -#if defined(_DEBUG) || (!PPSSPP_PLATFORM(ANDROID) && !PPSSPP_PLATFORM(IOS)) +// If you want to see verbose logs, change this to VERBOSE_LEVEL. -// Needs to be an int (and not use the enum) because it's used by the preprocessor! #define MAX_LOGLEVEL DEBUG_LEVEL -#else - -#ifndef MAX_LOGLEVEL -#define MAX_LOGLEVEL INFO_LEVEL -#endif // loglevel - -#endif // logging - // Let the compiler optimize this out. // TODO: Compute a dynamic max level as well that can be checked here. #define GENERIC_LOG(t, v, ...) { \ diff --git a/Core/HLE/sceAtrac.cpp b/Core/HLE/sceAtrac.cpp index a77f073e58..0571a88587 100644 --- a/Core/HLE/sceAtrac.cpp +++ b/Core/HLE/sceAtrac.cpp @@ -1092,17 +1092,18 @@ u32 AtracSasDecodeData(int atracID, u8* outbuf, u32 outbufPtr, u32 *SamplesNum, // Ugly hack, but needed to support both old and new contexts. int AtracSasGetIDByContext(u32 contextAddr) { int atracID = (int)Memory::Read_U32(contextAddr + 0xfc); - if (atracID < PSP_MAX_ATRAC_IDS && atracContexts[atracID]->GetContextVersion() == 1) { + if (atracID < PSP_MAX_ATRAC_IDS && atracContexts[atracID] && atracContexts[atracID]->GetContextVersion() == 1) { // We can assume the old atracID hack was used, and atracID is valid. } else { // Let's just loop around the contexts and find it. atracID = -1; for (int i = 0; i < PSP_MAX_ATRAC_IDS; i++) { - if (atracContexts[i]) { - if (atracContexts[i]->GetContextVersion() == 2 && atracContexts[i]->context_.Equals(contextAddr)) { - atracID = i; - break; - } + if (!atracContexts[i]) { + continue; + } + if (atracContexts[i]->GetContextVersion() == 2 && atracContexts[i]->context_.Equals(contextAddr)) { + atracID = i; + break; } } _dbg_assert_(atracID != -1); diff --git a/Core/HLE/sceIo.cpp b/Core/HLE/sceIo.cpp index 3ebb53aa03..1ec25c8aae 100644 --- a/Core/HLE/sceIo.cpp +++ b/Core/HLE/sceIo.cpp @@ -2194,7 +2194,7 @@ static u32 sceIoOpenAsync(const char *filename, int flags, int mode) { FileNode *f = __IoOpen(error, filename, flags, mode); // We have to return an fd here, which may have been destroyed when we reach Wait if it failed. - if (f == nullptr) { + if (!f) { _assert_(error != 0); if (error == SCE_KERNEL_ERROR_NODEV) return hleLogError(Log::sceIo, error, "device not found"); @@ -2223,7 +2223,8 @@ static u32 sceIoOpenAsync(const char *filename, int flags, int mode) { if (error != 0) { f->asyncResult = (s64)error; - return hleLogError(Log::sceIo, fd, "file not found"); + // This is not necessarily an error, a lot of games check for the presence of files and are fine with no. + return hleLogWarning(Log::sceIo, fd, "file not found"); } f->asyncResult = fd; diff --git a/Core/HLE/sceKernelModule.cpp b/Core/HLE/sceKernelModule.cpp index a864f25e82..a5bc0afc58 100644 --- a/Core/HLE/sceKernelModule.cpp +++ b/Core/HLE/sceKernelModule.cpp @@ -2283,7 +2283,7 @@ static u32 sceKernelStartModule(u32 moduleId, u32 argsize, u32 argAddr, u32 retu } else if (module->isFake) { if (returnValueAddr) Memory::Write_U32(0, returnValueAddr); - return hleLogInfo(Log::sceModule, moduleId, "Faked (undecryptable module)"); + return hleLogInfo(Log::sceModule, moduleId, "Faked module"); } else if (module->nm.status == MODULE_STATUS_STARTED) { // TODO: Maybe should be SCE_KERNEL_ERROR_ALREADY_STARTED, but I get SCE_KERNEL_ERROR_ERROR. // But I also get crashes... diff --git a/UI/EmuScreen.cpp b/UI/EmuScreen.cpp index fd24329d31..637b8b8564 100644 --- a/UI/EmuScreen.cpp +++ b/UI/EmuScreen.cpp @@ -1753,10 +1753,10 @@ ScreenRenderFlags EmuScreen::render(ScreenRenderMode mode) { void EmuScreen::runImDebugger() { if (!lastImguiEnabled_ && g_Config.bShowImDebugger) { System_NotifyUIEvent(UIEventNotification::TEXT_GOTFOCUS); - INFO_LOG(Log::System, "activating keyboard"); + VERBOSE_LOG(Log::System, "activating keyboard"); } else if (lastImguiEnabled_ && !g_Config.bShowImDebugger) { System_NotifyUIEvent(UIEventNotification::TEXT_LOSTFOCUS); - INFO_LOG(Log::System, "deactivating keyboard"); + VERBOSE_LOG(Log::System, "deactivating keyboard"); } lastImguiEnabled_ = g_Config.bShowImDebugger; if (g_Config.bShowImDebugger) { diff --git a/UI/ImDebugger/ImDebugger.h b/UI/ImDebugger/ImDebugger.h index e3bc32773e..399cab5b26 100644 --- a/UI/ImDebugger/ImDebugger.h +++ b/UI/ImDebugger/ImDebugger.h @@ -164,7 +164,8 @@ struct ImConfig { int selectedBreakpoint = -1; int selectedMemCheck = -1; int selectedAtracCtx = 0; - u32 selectedMemoryBlock = 0; + int selectedMemoryBlock = 0; + uint64_t selectedTexAddr = 0; bool realtimePixelPreview = false; diff --git a/UI/NativeApp.cpp b/UI/NativeApp.cpp index b81ae6db14..65d12514bd 100644 --- a/UI/NativeApp.cpp +++ b/UI/NativeApp.cpp @@ -1071,7 +1071,7 @@ void NativeFrame(GraphicsContext *graphicsContext) { for (const auto &item : toProcess) { if (HandleGlobalMessage(item.message, item.value)) { // TODO: Add a to-string thingy. - INFO_LOG(Log::System, "Handled global message: %d / %s", (int)item.message, item.value.c_str()); + VERBOSE_LOG(Log::System, "Handled global message: %d / %s", (int)item.message, item.value.c_str()); } g_screenManager->sendMessage(item.message, item.value.c_str()); }