From cef14adf67fe1fe00dc95c0ce96beb83f09260b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Tue, 18 Mar 2025 13:47:09 +0100 Subject: [PATCH] Assorted logging fixes and cleanup --- Core/HLE/sceIo.cpp | 5 +++-- Core/HLE/sceKernelModule.cpp | 2 +- UI/EmuScreen.cpp | 4 ++-- UI/ImDebugger/ImDebugger.h | 3 ++- UI/NativeApp.cpp | 2 +- 5 files changed, 9 insertions(+), 7 deletions(-) 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()); }