From 12506926578c2df402c211287d104c7dfed45e44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Fri, 24 Mar 2023 17:40:03 +0100 Subject: [PATCH 1/3] Convert host->SetWindowTitle to a request --- Common/System/Request.h | 4 ++++ Common/System/System.h | 7 ++++--- Core/Host.h | 1 - Core/PSPLoaders.cpp | 5 +++-- Core/System.cpp | 2 +- Qt/QtHost.h | 10 ---------- Qt/QtMain.cpp | 11 +++++++++++ UI/HostTypes.h | 1 - UWP/UWPHost.cpp | 3 --- UWP/UWPHost.h | 1 - Windows/EmuThread.cpp | 3 ++- Windows/WindowsHost.cpp | 20 -------------------- Windows/WindowsHost.h | 2 -- Windows/main.cpp | 18 ++++++++++++++++++ 14 files changed, 43 insertions(+), 45 deletions(-) diff --git a/Common/System/Request.h b/Common/System/Request.h index 745f4eb555..5c925184a4 100644 --- a/Common/System/Request.h +++ b/Common/System/Request.h @@ -121,3 +121,7 @@ inline void System_ShareText(const std::string &text) { inline void System_NotifyUIState(const std::string &state) { g_requestManager.MakeSystemRequest(SystemRequestType::NOTIFY_UI_STATE, nullptr, state, "", 0); } + +inline void System_SetWindowTitle(const std::string ¶m) { + g_requestManager.MakeSystemRequest(SystemRequestType::SET_WINDOW_TITLE, nullptr, param, "", 0); +} diff --git a/Common/System/System.h b/Common/System/System.h index 71bcb1cb71..f364ec45d4 100644 --- a/Common/System/System.h +++ b/Common/System/System.h @@ -64,16 +64,17 @@ enum class SystemRequestType { EXIT_APP, RESTART_APP, // For graphics backend changes COPY_TO_CLIPBOARD, + SHARE_TEXT, + SET_WINDOW_TITLE, TOGGLE_FULLSCREEN_STATE, GRAPHICS_BACKEND_FAILED_ALERT, + NOTIFY_UI_STATE, // Used on Android only. Not a SystemNotification since it takes a parameter. + // High-level hardware control CAMERA_COMMAND, GPS_COMMAND, MICROPHONE_COMMAND, - - SHARE_TEXT, - NOTIFY_UI_STATE, // Used on Android only. Not a SystemNotification since it takes a parameter. }; // Implementations are supposed to process the request, and post the response to the g_RequestManager (see Message.h). diff --git a/Core/Host.h b/Core/Host.h index 0fc4746710..34267e9652 100644 --- a/Core/Host.h +++ b/Core/Host.h @@ -33,7 +33,6 @@ public: virtual bool AttemptLoadSymbolMap(); virtual void SaveSymbolMap() {} - virtual void SetWindowTitle(const char *message) {} virtual bool CreateDesktopShortcut(std::string argumentPath, std::string title) {return false;} diff --git a/Core/PSPLoaders.cpp b/Core/PSPLoaders.cpp index ab060eb27b..ccf9a349dc 100644 --- a/Core/PSPLoaders.cpp +++ b/Core/PSPLoaders.cpp @@ -19,6 +19,7 @@ #include "Common/Data/Encoding/Utf8.h" #include "Common/Thread/ThreadUtil.h" +#include "Common/System/Request.h" #include "Common/File/FileUtil.h" #include "Common/StringUtils.h" @@ -248,7 +249,7 @@ bool Load_PSP_ISO(FileLoader *fileLoader, std::string *error_string) { if (g_paramSFO.ReadSFO(paramsfo)) { std::string title = StringFromFormat("%s : %s", g_paramSFO.GetValueString("DISC_ID").c_str(), g_paramSFO.GetValueString("TITLE").c_str()); INFO_LOG(LOADER, "%s", title.c_str()); - host->SetWindowTitle(title.c_str()); + System_SetWindowTitle(title); } } @@ -430,7 +431,7 @@ bool Load_PSP_ELF_PBP(FileLoader *fileLoader, std::string *error_string) { std::string title = StringFromFormat("%s : %s", discID.c_str(), homebrewTitle.c_str()); INFO_LOG(LOADER, "%s", title.c_str()); - host->SetWindowTitle(title.c_str()); + System_SetWindowTitle(title); // Migrate old save states from old versions of fake game IDs. const Path savestateDir = GetSysDirectory(DIRECTORY_SAVESTATE); diff --git a/Core/System.cpp b/Core/System.cpp index 5a1c26b338..bd02850911 100644 --- a/Core/System.cpp +++ b/Core/System.cpp @@ -522,7 +522,7 @@ void PSP_Shutdown() { CPU_Shutdown(); GPU_Shutdown(); g_paramSFO.Clear(); - host->SetWindowTitle(0); + System_SetWindowTitle(""); currentMIPS = 0; pspIsInited = false; pspIsIniting = false; diff --git a/Qt/QtHost.h b/Qt/QtHost.h index 71278529e5..275a99bcb8 100644 --- a/Qt/QtHost.h +++ b/Qt/QtHost.h @@ -23,7 +23,6 @@ #include "Qt/mainwindow.h" #include "Core/Debugger/SymbolMap.h" - class QtHost : public Host { public: QtHost(MainWindow *mainWindow_) @@ -42,15 +41,6 @@ public: auto fn = SymbolMapFilename(PSP_CoreParameter().fileToStart); g_symbolMap->SaveSymbolMap(fn); } - void SetWindowTitle(const char *message) override { - std::string title = std::string("PPSSPP ") + PPSSPP_GIT_VERSION; - if (message) - title += std::string(" - ") + message; -#ifdef _DEBUG - title += " (debug)"; -#endif - mainWindow->SetWindowTitleAsync(title); - } void NotifyUserMessage(const std::string &message, float duration = 1.0f, u32 color = 0x00FFFFFF, const char *id = nullptr) override { osm.Show(message, duration, color, -1, true, id); diff --git a/Qt/QtMain.cpp b/Qt/QtMain.cpp index 36a15643dc..86b4caf5d2 100644 --- a/Qt/QtMain.cpp +++ b/Qt/QtMain.cpp @@ -355,6 +355,17 @@ bool System_MakeRequest(SystemRequestType type, int requestId, const std::string case SystemRequestType::COPY_TO_CLIPBOARD: QApplication::clipboard()->setText(param1.c_str()); return true; + case SystemRequestType::SET_WINDOW_TITLE: + { + std::string title = std::string("PPSSPP ") + PPSSPP_GIT_VERSION; + if (!param1.empty()) + title += std::string(" - ") + param1; +#ifdef _DEBUG + title += " (debug)"; +#endif + g_mainWindow->SetWindowTitleAsync(title); + return true; + } case SystemRequestType::INPUT_TEXT_MODAL: { g_requestId = requestId; diff --git a/UI/HostTypes.h b/UI/HostTypes.h index ede4580f52..0ee6325d9a 100644 --- a/UI/HostTypes.h +++ b/UI/HostTypes.h @@ -27,7 +27,6 @@ public: void UpdateSound() override {} bool AttemptLoadSymbolMap() override {return false;} - void SetWindowTitle(const char *message) override {} void NotifyUserMessage(const std::string &message, float duration = 1.0f, u32 color = 0x00FFFFFF, const char *id = nullptr) override { osm.Show(message, duration, color, -1, true, id); diff --git a/UWP/UWPHost.cpp b/UWP/UWPHost.cpp index d620046e82..5048a95868 100644 --- a/UWP/UWPHost.cpp +++ b/UWP/UWPHost.cpp @@ -54,9 +54,6 @@ void UWPHost::SetConsolePosition() { void UWPHost::UpdateConsolePosition() { } -void UWPHost::SetWindowTitle(const char *message) { -} - void UWPHost::UpdateSound() { } diff --git a/UWP/UWPHost.h b/UWP/UWPHost.h index 8e13f6af2a..244a6af3f0 100644 --- a/UWP/UWPHost.h +++ b/UWP/UWPHost.h @@ -18,7 +18,6 @@ public: bool AttemptLoadSymbolMap() override; void SaveSymbolMap() override; - void SetWindowTitle(const char *message) override; void ToggleDebugConsoleVisibility() override; diff --git a/Windows/EmuThread.cpp b/Windows/EmuThread.cpp index 4748557d18..898a0f5d09 100644 --- a/Windows/EmuThread.cpp +++ b/Windows/EmuThread.cpp @@ -4,6 +4,7 @@ #include "Common/System/NativeApp.h" #include "Common/System/System.h" +#include "Common/System/Request.h" #include "Common/Data/Text/I18n.h" #include "Common/Input/InputState.h" #include "Common/Data/Encoding/Utf8.h" @@ -160,7 +161,7 @@ void MainThreadFunc() { } host = new WindowsHost(MainWindow::GetHInstance(), MainWindow::GetHWND(), MainWindow::GetDisplayHWND()); - host->SetWindowTitle(nullptr); + System_SetWindowTitle(""); // We convert command line arguments to UTF-8 immediately. std::vector wideArgs = GetWideCmdLine(); diff --git a/Windows/WindowsHost.cpp b/Windows/WindowsHost.cpp index 5217a01463..1783eab47f 100644 --- a/Windows/WindowsHost.cpp +++ b/Windows/WindowsHost.cpp @@ -109,26 +109,6 @@ void WindowsHost::UpdateConsolePosition() { } } -void WindowsHost::SetWindowTitle(const char *message) { -#ifdef GOLD - const char *name = "PPSSPP Gold "; -#else - const char *name = "PPSSPP "; -#endif - std::wstring winTitle = ConvertUTF8ToWString(std::string(name) + PPSSPP_GIT_VERSION); - if (message != nullptr) { - winTitle.append(ConvertUTF8ToWString(" - ")); - winTitle.append(ConvertUTF8ToWString(message)); - } -#ifdef _DEBUG - winTitle.append(L" (debug)"); -#endif - lastTitle_ = winTitle; - - MainWindow::SetWindowTitle(winTitle.c_str()); - PostMessage(mainWindow_, MainWindow::WM_USER_WINDOW_TITLE_CHANGED, 0, 0); -} - // UGLY! extern WindowsAudioBackend *winAudioBackend; diff --git a/Windows/WindowsHost.h b/Windows/WindowsHost.h index b13032b799..2aeba43996 100644 --- a/Windows/WindowsHost.h +++ b/Windows/WindowsHost.h @@ -36,7 +36,6 @@ public: bool AttemptLoadSymbolMap() override; void SaveSymbolMap() override; - void SetWindowTitle(const char *message) override; void ToggleDebugConsoleVisibility() override; @@ -53,7 +52,6 @@ private: HWND displayWindow_; HWND mainWindow_; size_t numDinputDevices_ = 0; - std::wstring lastTitle_; std::list> input; }; diff --git a/Windows/main.cpp b/Windows/main.cpp index 929abafdc8..561e374dc1 100644 --- a/Windows/main.cpp +++ b/Windows/main.cpp @@ -467,6 +467,24 @@ bool System_MakeRequest(SystemRequestType type, int requestId, const std::string W32Util::CopyTextToClipboard(MainWindow::GetDisplayHWND(), data); return true; } + case SystemRequestType::SET_WINDOW_TITLE: + { +#ifdef GOLD + const char *name = "PPSSPP Gold "; +#else + const char *name = "PPSSPP "; +#endif + std::wstring winTitle = ConvertUTF8ToWString(std::string(name) + PPSSPP_GIT_VERSION); + if (!param1.empty()) { + winTitle.append(ConvertUTF8ToWString(" - " + param1)); + } +#ifdef _DEBUG + winTitle.append(L" (debug)"); +#endif + MainWindow::SetWindowTitle(winTitle.c_str()); + PostMessage(MainWindow::GetHWND(), MainWindow::WM_USER_WINDOW_TITLE_CHANGED, 0, 0); + return true; + } case SystemRequestType::INPUT_TEXT_MODAL: if (g_dialogRunning) { g_dialogThread.join(); From 5af92cfca0f630f090db9d7ea5844d485a64c1ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Fri, 24 Mar 2023 17:52:17 +0100 Subject: [PATCH 2/3] Cleanup --- Windows/EmuThread.cpp | 11 +++-------- Windows/WindowsHost.cpp | 15 ++++----------- Windows/WindowsHost.h | 5 +---- 3 files changed, 8 insertions(+), 23 deletions(-) diff --git a/Windows/EmuThread.cpp b/Windows/EmuThread.cpp index 898a0f5d09..459bb5ce34 100644 --- a/Windows/EmuThread.cpp +++ b/Windows/EmuThread.cpp @@ -152,15 +152,10 @@ bool CreateGraphicsBackend(std::string *error_message, GraphicsContext **ctx) { } void MainThreadFunc() { - if (useEmuThread) { - // We'll start up a separate thread we'll call Emu - SetCurrentThreadName("Render"); - } else { - // This is both Emu and Render. - SetCurrentThreadName("Emu"); - } + // We'll start up a separate thread we'll call Emu + SetCurrentThreadName(useEmuThread ? "Render" : "Emu"); - host = new WindowsHost(MainWindow::GetHInstance(), MainWindow::GetHWND(), MainWindow::GetDisplayHWND()); + host = new WindowsHost(); System_SetWindowTitle(""); // We convert command line arguments to UTF-8 immediately. diff --git a/Windows/WindowsHost.cpp b/Windows/WindowsHost.cpp index 1783eab47f..339f62e158 100644 --- a/Windows/WindowsHost.cpp +++ b/Windows/WindowsHost.cpp @@ -44,12 +44,14 @@ #include "Core/Config.h" #include "Core/ConfigValues.h" #include "Core/CoreParameter.h" +#include "Core/HLE/Plugins.h" #include "Core/System.h" #include "Core/Debugger/SymbolMap.h" #include "Core/Instance.h" +#include "UI/OnScreenDisplay.h" + #include "Windows/EmuThread.h" -#include "Windows/WindowsAudio.h" #include "Windows/WindowsHost.h" #include "Windows/MainWindow.h" @@ -63,8 +65,6 @@ #include "Windows/XinputDevice.h" #include "Windows/main.h" -#include "UI/OnScreenDisplay.h" -#include float g_mouseDeltaX = 0; float g_mouseDeltaY = 0; @@ -73,11 +73,7 @@ static BOOL PostDialogMessage(Dialog *dialog, UINT message, WPARAM wParam = 0, L return PostMessage(dialog->GetDlgHandle(), message, wParam, lParam); } -WindowsHost::WindowsHost(HINSTANCE hInstance, HWND mainWindow, HWND displayWindow) - : hInstance_(hInstance), - displayWindow_(displayWindow), - mainWindow_(mainWindow) -{ +WindowsHost::WindowsHost() { g_mouseDeltaX = 0; g_mouseDeltaY = 0; @@ -109,9 +105,6 @@ void WindowsHost::UpdateConsolePosition() { } } -// UGLY! -extern WindowsAudioBackend *winAudioBackend; - void WindowsHost::PollControllers() { static int checkCounter = 0; static const int CHECK_FREQUENCY = 71; diff --git a/Windows/WindowsHost.h b/Windows/WindowsHost.h index 2aeba43996..e93af1e28a 100644 --- a/Windows/WindowsHost.h +++ b/Windows/WindowsHost.h @@ -26,7 +26,7 @@ extern float g_mouseDeltaY; class WindowsHost : public Host { public: - WindowsHost(HINSTANCE hInstance, HWND mainWindow, HWND displayWindow); + WindowsHost(); ~WindowsHost() { UpdateConsolePosition(); @@ -48,9 +48,6 @@ private: void SetConsolePosition(); void UpdateConsolePosition(); - HINSTANCE hInstance_; - HWND displayWindow_; - HWND mainWindow_; size_t numDinputDevices_ = 0; std::list> input; From 5a5779dcd63b693f48c7660e6f1ce4ce77a6520e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Fri, 24 Mar 2023 18:08:31 +0100 Subject: [PATCH 3/3] Remove symbol-map related functions from Host --- Common/System/System.h | 2 ++ Core/Debugger/SymbolMap.cpp | 7 +++--- Core/Debugger/SymbolMap.h | 2 +- Core/Host.cpp | 8 ------- Core/Host.h | 3 --- Core/System.cpp | 43 +++++++++++++++++++++++++++++++++---- Qt/QtHost.cpp | 4 ---- Qt/QtHost.h | 5 ----- UI/HostTypes.h | 3 +-- UWP/UWPHost.cpp | 29 ------------------------- UWP/UWPHost.h | 8 ------- Windows/WindowsHost.cpp | 26 ---------------------- Windows/WindowsHost.h | 3 --- Windows/main.cpp | 1 + headless/StubHost.h | 4 ---- libretro/libretro.cpp | 1 - 16 files changed, 48 insertions(+), 101 deletions(-) diff --git a/Common/System/System.h b/Common/System/System.h index f364ec45d4..6c4922a6c7 100644 --- a/Common/System/System.h +++ b/Common/System/System.h @@ -163,6 +163,8 @@ enum SystemProperty { SYSPROP_CAN_JIT, + SYSPROP_HAS_DEBUGGER, + SYSPROP_KEYBOARD_LAYOUT, SYSPROP_SKIP_UI, diff --git a/Core/Debugger/SymbolMap.cpp b/Core/Debugger/SymbolMap.cpp index d866f008bd..6cac800719 100644 --- a/Core/Debugger/SymbolMap.cpp +++ b/Core/Debugger/SymbolMap.cpp @@ -206,12 +206,12 @@ bool SymbolMap::LoadSymbolMap(const Path &filename) { return started; } -void SymbolMap::SaveSymbolMap(const Path &filename) const { +bool SymbolMap::SaveSymbolMap(const Path &filename) const { std::lock_guard guard(lock_); // Don't bother writing a blank file. if (!File::Exists(filename) && functions.empty() && data.empty()) { - return; + return true; } // TODO(scoped): Use gzdopen @@ -222,7 +222,7 @@ void SymbolMap::SaveSymbolMap(const Path &filename) const { #endif if (f == Z_NULL) - return; + return false; gzprintf(f, ".text\n"); @@ -241,6 +241,7 @@ void SymbolMap::SaveSymbolMap(const Path &filename) const { gzprintf(f, "%08x %08x %x %i %s\n", e.start, e.size, e.module, ST_DATA, GetLabelNameRel(e.start, e.module)); } gzclose(f); + return true; } bool SymbolMap::LoadNocashSym(const Path &filename) { diff --git a/Core/Debugger/SymbolMap.h b/Core/Debugger/SymbolMap.h index c0ee42ee75..defe069838 100644 --- a/Core/Debugger/SymbolMap.h +++ b/Core/Debugger/SymbolMap.h @@ -71,7 +71,7 @@ public: void SortSymbols(); bool LoadSymbolMap(const Path &filename); - void SaveSymbolMap(const Path &filename) const; + bool SaveSymbolMap(const Path &filename) const; bool LoadNocashSym(const Path &filename); void SaveNocashSym(const Path &filename) const; diff --git a/Core/Host.cpp b/Core/Host.cpp index 2a35248f03..81fb73f9bf 100644 --- a/Core/Host.cpp +++ b/Core/Host.cpp @@ -15,14 +15,6 @@ // Official git repository and contact information can be found at // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. -#include - #include "Core/Host.h" -#include "Core/Debugger/SymbolMap.h" Host *host = nullptr; - -bool Host::AttemptLoadSymbolMap() { - g_symbolMap->Clear(); - return false; -} diff --git a/Core/Host.h b/Core/Host.h index 34267e9652..d62d6e27dd 100644 --- a/Core/Host.h +++ b/Core/Host.h @@ -31,9 +31,6 @@ public: virtual void PollControllers() {} virtual void ToggleDebugConsoleVisibility() {} - virtual bool AttemptLoadSymbolMap(); - virtual void SaveSymbolMap() {} - virtual bool CreateDesktopShortcut(std::string argumentPath, std::string title) {return false;} virtual void NotifyUserMessage(const std::string &message, float duration = 1.0f, u32 color = 0x00FFFFFF, const char *id = nullptr) {} diff --git a/Core/System.cpp b/Core/System.cpp index bd02850911..66f1546611 100644 --- a/Core/System.cpp +++ b/Core/System.cpp @@ -35,13 +35,14 @@ #include "Common/System/System.h" #include "Common/System/Request.h" #include "Common/File/Path.h" +#include "Common/File/FileUtil.h" +#include "Common/File/DirListing.h" #include "Common/Math/math_util.h" #include "Common/Thread/ThreadUtil.h" #include "Common/Data/Encoding/Utf8.h" - -#include "Common/File/FileUtil.h" #include "Common/TimeUtil.h" #include "Common/GraphicsContext.h" + #include "Core/MemFault.h" #include "Core/HDRemaster.h" #include "Core/MIPS/MIPS.h" @@ -173,6 +174,40 @@ bool CPU_HasPendingAction() { void CPU_Shutdown(); +static Path SymbolMapFilename(const Path ¤tFilename, const char *ext) { + File::FileInfo info{}; + // can't fail, definitely exists if it gets this far + File::GetFileInfo(currentFilename, &info); + if (info.isDirectory) { + return currentFilename / (std::string(".ppsspp-symbols") + ext); + } + return currentFilename.WithReplacedExtension(ext); +}; + +static bool LoadSymbolsIfSupported() { + if (System_GetPropertyBool(SYSPROP_HAS_DEBUGGER)) { + if (!g_symbolMap) + return false; + + bool result1 = g_symbolMap->LoadSymbolMap(SymbolMapFilename(PSP_CoreParameter().fileToStart, ".ppmap")); + // Load the old-style map file. + if (!result1) + result1 = g_symbolMap->LoadSymbolMap(SymbolMapFilename(PSP_CoreParameter().fileToStart, ".map")); + bool result2 = g_symbolMap->LoadNocashSym(SymbolMapFilename(PSP_CoreParameter().fileToStart, ".sym")); + return result1 || result2; + } else { + g_symbolMap->Clear(); + return true; + } +} + +static bool SaveSymbolMapIfSupported() { + if (g_symbolMap) { + return g_symbolMap->SaveSymbolMap(SymbolMapFilename(PSP_CoreParameter().fileToStart, ".ppmap")); + } + return false; +} + bool DiscIDFromGEDumpPath(const Path &path, FileLoader *fileLoader, std::string *id) { using namespace GPURecord; @@ -283,7 +318,7 @@ bool CPU_Init(std::string *errorString) { } mipsr4k.Reset(); - host->AttemptLoadSymbolMap(); + LoadSymbolsIfSupported(); CoreTiming::Init(); @@ -324,7 +359,7 @@ void CPU_Shutdown() { PSPLoaders_Shutdown(); if (g_Config.bAutoSaveSymbolMap) { - host->SaveSymbolMap(); + SaveSymbolMapIfSupported(); } Replacement_Shutdown(); diff --git a/Qt/QtHost.cpp b/Qt/QtHost.cpp index 9528d4a5ac..7c323cfc9d 100644 --- a/Qt/QtHost.cpp +++ b/Qt/QtHost.cpp @@ -16,7 +16,3 @@ // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. #include "Qt/QtHost.h" - -Path QtHost::SymbolMapFilename(Path currentFilename) { - return currentFilename.WithReplacedExtension(".map"); -} diff --git a/Qt/QtHost.h b/Qt/QtHost.h index 275a99bcb8..a78ae11a2d 100644 --- a/Qt/QtHost.h +++ b/Qt/QtHost.h @@ -32,11 +32,6 @@ public: void UpdateSound() override {} - bool AttemptLoadSymbolMap() override { - auto fn = SymbolMapFilename(PSP_CoreParameter().fileToStart); - return g_symbolMap->LoadSymbolMap(fn); - } - void PrepareShutdown() { auto fn = SymbolMapFilename(PSP_CoreParameter().fileToStart); g_symbolMap->SaveSymbolMap(fn); diff --git a/UI/HostTypes.h b/UI/HostTypes.h index 0ee6325d9a..05c8e40158 100644 --- a/UI/HostTypes.h +++ b/UI/HostTypes.h @@ -18,6 +18,7 @@ #pragma once #include "Core/Host.h" +#include "Common/System/NativeApp.h" #include "UI/OnScreenDisplay.h" class NativeHost : public Host { @@ -26,8 +27,6 @@ public: void UpdateSound() override {} - bool AttemptLoadSymbolMap() override {return false;} - void NotifyUserMessage(const std::string &message, float duration = 1.0f, u32 color = 0x00FFFFFF, const char *id = nullptr) override { osm.Show(message, duration, color, -1, true, id); } diff --git a/UWP/UWPHost.cpp b/UWP/UWPHost.cpp index 5048a95868..d03c78eb65 100644 --- a/UWP/UWPHost.cpp +++ b/UWP/UWPHost.cpp @@ -48,12 +48,6 @@ UWPHost::~UWPHost() { } -void UWPHost::SetConsolePosition() { -} - -void UWPHost::UpdateConsolePosition() { -} - void UWPHost::UpdateSound() { } @@ -83,29 +77,6 @@ void UWPHost::PollControllers() { */ } -static Path SymbolMapFilename(const Path ¤tFilename, const char *ext) { - File::FileInfo info; - // can't fail, definitely exists if it gets this far - File::GetFileInfo(currentFilename, &info); - if (info.isDirectory) { - return currentFilename / (std::string(".ppsspp-symbols") + ext); - } - return currentFilename.WithReplacedExtension(ext); -} - -bool UWPHost::AttemptLoadSymbolMap() { - bool result1 = g_symbolMap->LoadSymbolMap(SymbolMapFilename(PSP_CoreParameter().fileToStart, ".ppmap")); - // Load the old-style map file. - if (!result1) - result1 = g_symbolMap->LoadSymbolMap(SymbolMapFilename(PSP_CoreParameter().fileToStart, ".map")); - bool result2 = g_symbolMap->LoadNocashSym(SymbolMapFilename(PSP_CoreParameter().fileToStart, ".sym")); - return result1 || result2; -} - -void UWPHost::SaveSymbolMap() { - g_symbolMap->SaveSymbolMap(SymbolMapFilename(PSP_CoreParameter().fileToStart, ".ppmap")); -} - void UWPHost::ToggleDebugConsoleVisibility() { // N/A } diff --git a/UWP/UWPHost.h b/UWP/UWPHost.h index 244a6af3f0..9341ce2bdd 100644 --- a/UWP/UWPHost.h +++ b/UWP/UWPHost.h @@ -16,18 +16,10 @@ public: void UpdateSound() override; - bool AttemptLoadSymbolMap() override; - void SaveSymbolMap() override; - void ToggleDebugConsoleVisibility() override; void NotifyUserMessage(const std::string &message, float duration = 1.0f, u32 color = 0x00FFFFFF, const char *id = nullptr) override; - GraphicsContext *GetGraphicsContext() { return nullptr; } - private: - void SetConsolePosition(); - void UpdateConsolePosition(); - std::list> input; }; diff --git a/Windows/WindowsHost.cpp b/Windows/WindowsHost.cpp index 339f62e158..f737c585e0 100644 --- a/Windows/WindowsHost.cpp +++ b/Windows/WindowsHost.cpp @@ -155,32 +155,6 @@ void WindowsHost::PollControllers() { HLEPlugins::PluginDataAxis[JOYSTICK_AXIS_MOUSE_REL_Y] = g_mouseDeltaY; } -static Path SymbolMapFilename(const Path ¤tFilename, const char *ext) { - File::FileInfo info{}; - // can't fail, definitely exists if it gets this far - File::GetFileInfo(currentFilename, &info); - if (info.isDirectory) { - return currentFilename / (std::string(".ppsspp-symbols") + ext); - } - return currentFilename.WithReplacedExtension(ext); -} - -bool WindowsHost::AttemptLoadSymbolMap() { - if (!g_symbolMap) - return false; - bool result1 = g_symbolMap->LoadSymbolMap(SymbolMapFilename(PSP_CoreParameter().fileToStart, ".ppmap")); - // Load the old-style map file. - if (!result1) - result1 = g_symbolMap->LoadSymbolMap(SymbolMapFilename(PSP_CoreParameter().fileToStart, ".map")); - bool result2 = g_symbolMap->LoadNocashSym(SymbolMapFilename(PSP_CoreParameter().fileToStart, ".sym")); - return result1 || result2; -} - -void WindowsHost::SaveSymbolMap() { - if (g_symbolMap) - g_symbolMap->SaveSymbolMap(SymbolMapFilename(PSP_CoreParameter().fileToStart, ".ppmap")); -} - // http://msdn.microsoft.com/en-us/library/aa969393.aspx HRESULT CreateLink(LPCWSTR lpszPathObj, LPCWSTR lpszArguments, LPCWSTR lpszPathLink, LPCWSTR lpszDesc) { HRESULT hres; diff --git a/Windows/WindowsHost.h b/Windows/WindowsHost.h index e93af1e28a..353996987a 100644 --- a/Windows/WindowsHost.h +++ b/Windows/WindowsHost.h @@ -34,9 +34,6 @@ public: void PollControllers() override; - bool AttemptLoadSymbolMap() override; - void SaveSymbolMap() override; - void ToggleDebugConsoleVisibility() override; bool CreateDesktopShortcut(std::string argumentPath, std::string title) override; diff --git a/Windows/main.cpp b/Windows/main.cpp index 561e374dc1..b78970e879 100644 --- a/Windows/main.cpp +++ b/Windows/main.cpp @@ -351,6 +351,7 @@ float System_GetPropertyFloat(SystemProperty prop) { bool System_GetPropertyBool(SystemProperty prop) { switch (prop) { + case SYSPROP_HAS_DEBUGGER: case SYSPROP_HAS_FILE_BROWSER: case SYSPROP_HAS_FOLDER_BROWSER: case SYSPROP_HAS_OPEN_DIRECTORY: diff --git a/headless/StubHost.h b/headless/StubHost.h index 280997f4d7..2da7c55797 100644 --- a/headless/StubHost.h +++ b/headless/StubHost.h @@ -28,10 +28,6 @@ public: virtual bool InitGraphics(std::string *error_message, GraphicsContext **ctx, GPUCore core) {return false;} virtual void ShutdownGraphics() {} - void UpdateSound() override {} - - bool AttemptLoadSymbolMap() override { g_symbolMap->Clear(); return false; } - void SendDebugOutput(const std::string &output) override { if (output.find('\n') != output.npos) { DoFlushDebugOutput(); diff --git a/libretro/libretro.cpp b/libretro/libretro.cpp index 453ac93eba..88b38fb7e5 100644 --- a/libretro/libretro.cpp +++ b/libretro/libretro.cpp @@ -396,7 +396,6 @@ class LibretroHost : public Host int samples = __AudioMix(audio, hostAttemptBlockSize, SAMPLERATE); AudioBufferWrite(audio, samples); } - bool AttemptLoadSymbolMap() override { return false; } }; class PrintfLogger : public LogListener