mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Move SetDebugMode notification
This commit is contained in:
parent
fc1732cc22
commit
f60f5ccaea
13 changed files with 20 additions and 33 deletions
|
@ -138,7 +138,7 @@ enum class SystemNotification {
|
||||||
UI,
|
UI,
|
||||||
MEM_VIEW,
|
MEM_VIEW,
|
||||||
DISASSEMBLY,
|
DISASSEMBLY,
|
||||||
DEBUG_MODE,
|
DEBUG_MODE_CHANGE,
|
||||||
BOOT_DONE, // this is sent from EMU thread! Make sure that Host handles it properly!
|
BOOT_DONE, // this is sent from EMU thread! Make sure that Host handles it properly!
|
||||||
SYMBOL_MAP_UPDATED,
|
SYMBOL_MAP_UPDATED,
|
||||||
SWITCH_UMD_UPDATED,
|
SWITCH_UMD_UPDATED,
|
||||||
|
|
|
@ -368,20 +368,19 @@ bool Core_Run(GraphicsContext *ctx) {
|
||||||
|
|
||||||
void Core_EnableStepping(bool step, const char *reason, u32 relatedAddress) {
|
void Core_EnableStepping(bool step, const char *reason, u32 relatedAddress) {
|
||||||
if (step) {
|
if (step) {
|
||||||
host->SetDebugMode(true);
|
|
||||||
Core_UpdateState(CORE_STEPPING);
|
Core_UpdateState(CORE_STEPPING);
|
||||||
steppingCounter++;
|
steppingCounter++;
|
||||||
_assert_msg_(reason != nullptr, "No reason specified for break");
|
_assert_msg_(reason != nullptr, "No reason specified for break");
|
||||||
steppingReason = reason;
|
steppingReason = reason;
|
||||||
steppingAddress = relatedAddress;
|
steppingAddress = relatedAddress;
|
||||||
} else {
|
} else {
|
||||||
host->SetDebugMode(false);
|
|
||||||
// Clear the exception if we resume.
|
// Clear the exception if we resume.
|
||||||
Core_ResetException();
|
Core_ResetException();
|
||||||
coreState = CORE_RUNNING;
|
coreState = CORE_RUNNING;
|
||||||
coreStatePending = false;
|
coreStatePending = false;
|
||||||
m_StepCond.notify_all();
|
m_StepCond.notify_all();
|
||||||
}
|
}
|
||||||
|
System_Notify(SystemNotification::DEBUG_MODE_CHANGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Core_NextFrame() {
|
bool Core_NextFrame() {
|
||||||
|
|
|
@ -27,8 +27,6 @@ class Host {
|
||||||
public:
|
public:
|
||||||
virtual ~Host() {}
|
virtual ~Host() {}
|
||||||
|
|
||||||
virtual void SetDebugMode(bool mode) { }
|
|
||||||
|
|
||||||
virtual bool InitGraphics(std::string *error_string, GraphicsContext **ctx) = 0;
|
virtual bool InitGraphics(std::string *error_string, GraphicsContext **ctx) = 0;
|
||||||
virtual void ShutdownGraphics() = 0;
|
virtual void ShutdownGraphics() = 0;
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,8 @@
|
||||||
#include "UI/OnScreenDisplay.h"
|
#include "UI/OnScreenDisplay.h"
|
||||||
|
|
||||||
#include "Qt/mainwindow.h"
|
#include "Qt/mainwindow.h"
|
||||||
|
#include "Core/Debugger/SymbolMap.h"
|
||||||
|
|
||||||
|
|
||||||
class QtHost : public Host {
|
class QtHost : public Host {
|
||||||
public:
|
public:
|
||||||
|
@ -29,8 +31,6 @@ public:
|
||||||
mainWindow = mainWindow_;
|
mainWindow = mainWindow_;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetDebugMode(bool mode) override {}
|
|
||||||
|
|
||||||
bool InitGraphics(std::string *error_message, GraphicsContext **ctx) override { return true; }
|
bool InitGraphics(std::string *error_message, GraphicsContext **ctx) override { return true; }
|
||||||
void ShutdownGraphics() override {}
|
void ShutdownGraphics() override {}
|
||||||
|
|
||||||
|
|
|
@ -40,6 +40,8 @@
|
||||||
#include "Common/Profiler/Profiler.h"
|
#include "Common/Profiler/Profiler.h"
|
||||||
|
|
||||||
#include "QtMain.h"
|
#include "QtMain.h"
|
||||||
|
#include "QtHost.h"
|
||||||
|
#include "Qt/mainwindow.h"
|
||||||
#include "Common/Data/Text/I18n.h"
|
#include "Common/Data/Text/I18n.h"
|
||||||
#include "Common/Thread/ThreadUtil.h"
|
#include "Common/Thread/ThreadUtil.h"
|
||||||
#include "Common/Data/Encoding/Utf8.h"
|
#include "Common/Data/Encoding/Utf8.h"
|
||||||
|
@ -57,6 +59,7 @@ static float refreshRate = 60.f;
|
||||||
static int browseFileEvent = -1;
|
static int browseFileEvent = -1;
|
||||||
static int browseFolderEvent = -1;
|
static int browseFolderEvent = -1;
|
||||||
QTCamera *qtcamera = nullptr;
|
QTCamera *qtcamera = nullptr;
|
||||||
|
MainWindow *g_mainWindow;
|
||||||
|
|
||||||
#ifdef SDL
|
#ifdef SDL
|
||||||
SDL_AudioSpec g_retFmt;
|
SDL_AudioSpec g_retFmt;
|
||||||
|
@ -259,7 +262,7 @@ void System_Notify(SystemNotification notification) {
|
||||||
switch (notification) {
|
switch (notification) {
|
||||||
case SystemNotification::BOOT_DONE:
|
case SystemNotification::BOOT_DONE:
|
||||||
g_symbolMap->SortSymbols();
|
g_symbolMap->SortSymbols();
|
||||||
mainWindow->Notify(MainWindowMsg::BOOT_DONE);
|
g_mainWindow->Notify(MainWindowMsg::BOOT_DONE);
|
||||||
break;
|
break;
|
||||||
case SystemNotification::SYMBOL_MAP_UPDATED:
|
case SystemNotification::SYMBOL_MAP_UPDATED:
|
||||||
if (g_symbolMap)
|
if (g_symbolMap)
|
||||||
|
@ -782,6 +785,12 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
NativeInit(argc, (const char **)argv, savegame_dir.c_str(), external_dir.c_str(), nullptr);
|
NativeInit(argc, (const char **)argv, savegame_dir.c_str(), external_dir.c_str(), nullptr);
|
||||||
|
|
||||||
|
g_mainWindow = new MainWindow(nullptr, g_Config.UseFullScreen());
|
||||||
|
g_mainWindow->show();
|
||||||
|
if (host == nullptr) {
|
||||||
|
host = new QtHost(g_mainWindow);
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: Support other backends than GL, like Vulkan, in the Qt backend.
|
// TODO: Support other backends than GL, like Vulkan, in the Qt backend.
|
||||||
g_Config.iGPUBackend = (int)GPUBackend::OPENGL;
|
g_Config.iGPUBackend = (int)GPUBackend::OPENGL;
|
||||||
|
|
||||||
|
|
|
@ -24,8 +24,6 @@ class NativeHost : public Host {
|
||||||
public:
|
public:
|
||||||
NativeHost() {}
|
NativeHost() {}
|
||||||
|
|
||||||
void SetDebugMode(bool mode) override { }
|
|
||||||
|
|
||||||
bool InitGraphics(std::string *error_message, GraphicsContext **ctx) override { return true; }
|
bool InitGraphics(std::string *error_message, GraphicsContext **ctx) override { return true; }
|
||||||
void ShutdownGraphics() override {}
|
void ShutdownGraphics() override {}
|
||||||
|
|
||||||
|
|
|
@ -834,14 +834,6 @@ void NativeInit(int argc, const char *argv[], const char *savegame_dir, const ch
|
||||||
std::string sysName = System_GetProperty(SYSPROP_NAME);
|
std::string sysName = System_GetProperty(SYSPROP_NAME);
|
||||||
isOuya = KeyMap::IsOuya(sysName);
|
isOuya = KeyMap::IsOuya(sysName);
|
||||||
|
|
||||||
#if !defined(MOBILE_DEVICE) && defined(USING_QT_UI)
|
|
||||||
MainWindow *mainWindow = new MainWindow(nullptr, g_Config.UseFullScreen());
|
|
||||||
mainWindow->show();
|
|
||||||
if (host == nullptr) {
|
|
||||||
host = new QtHost(mainWindow);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// We do this here, instead of in NativeInitGraphics, because the display may be reset.
|
// We do this here, instead of in NativeInitGraphics, because the display may be reset.
|
||||||
// When it's reset we don't want to forget all our managed things.
|
// When it's reset we don't want to forget all our managed things.
|
||||||
CheckFailedGPUBackends();
|
CheckFailedGPUBackends();
|
||||||
|
|
|
@ -75,8 +75,6 @@ void UWPHost::UpdateSound() {
|
||||||
void UWPHost::ShutdownSound() {
|
void UWPHost::ShutdownSound() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void UWPHost::SetDebugMode(bool mode) {}
|
|
||||||
|
|
||||||
void UWPHost::PollControllers() {
|
void UWPHost::PollControllers() {
|
||||||
for (const auto& device : this->input)
|
for (const auto& device : this->input)
|
||||||
{
|
{
|
||||||
|
|
|
@ -12,8 +12,6 @@ public:
|
||||||
UWPHost();
|
UWPHost();
|
||||||
~UWPHost();
|
~UWPHost();
|
||||||
|
|
||||||
void SetDebugMode(bool mode) override;
|
|
||||||
|
|
||||||
// If returns false, will return a null context
|
// If returns false, will return a null context
|
||||||
bool InitGraphics(std::string *error_message, GraphicsContext **ctx) override;
|
bool InitGraphics(std::string *error_message, GraphicsContext **ctx) override;
|
||||||
void PollControllers() override;
|
void PollControllers() override;
|
||||||
|
|
|
@ -189,11 +189,6 @@ void WindowsHost::UpdateSound() {
|
||||||
void WindowsHost::ShutdownSound() {
|
void WindowsHost::ShutdownSound() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void WindowsHost::SetDebugMode(bool mode) {
|
|
||||||
if (disasmWindow)
|
|
||||||
PostDialogMessage(disasmWindow, WM_DEB_SETDEBUGLPARAM, 0, (LPARAM)mode);
|
|
||||||
}
|
|
||||||
|
|
||||||
void WindowsHost::PollControllers() {
|
void WindowsHost::PollControllers() {
|
||||||
static int checkCounter = 0;
|
static int checkCounter = 0;
|
||||||
static const int CHECK_FREQUENCY = 71;
|
static const int CHECK_FREQUENCY = 71;
|
||||||
|
|
|
@ -34,8 +34,6 @@ public:
|
||||||
UpdateConsolePosition();
|
UpdateConsolePosition();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetDebugMode(bool mode) override;
|
|
||||||
|
|
||||||
// If returns false, will return a null context
|
// If returns false, will return a null context
|
||||||
bool InitGraphics(std::string *error_message, GraphicsContext **ctx) override;
|
bool InitGraphics(std::string *error_message, GraphicsContext **ctx) override;
|
||||||
void PollControllers() override;
|
void PollControllers() override;
|
||||||
|
|
|
@ -384,9 +384,8 @@ void System_Notify(SystemNotification notification) {
|
||||||
g_symbolMap->SortSymbols();
|
g_symbolMap->SortSymbols();
|
||||||
PostMessage(MainWindow::GetHWND(), WM_USER + 1, 0, 0);
|
PostMessage(MainWindow::GetHWND(), WM_USER + 1, 0, 0);
|
||||||
|
|
||||||
bool mode = !g_Config.bAutoRun;
|
|
||||||
if (disasmWindow)
|
if (disasmWindow)
|
||||||
PostDialogMessage(disasmWindow, WM_DEB_SETDEBUGLPARAM, 0, (LPARAM)mode);
|
PostDialogMessage(disasmWindow, WM_DEB_SETDEBUGLPARAM, 0, (LPARAM)Core_IsStepping());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -421,6 +420,11 @@ void System_Notify(SystemNotification notification) {
|
||||||
case SystemNotification::SWITCH_UMD_UPDATED:
|
case SystemNotification::SWITCH_UMD_UPDATED:
|
||||||
PostMessage(MainWindow::GetHWND(), MainWindow::WM_USER_SWITCHUMD_UPDATED, 0, 0);
|
PostMessage(MainWindow::GetHWND(), MainWindow::WM_USER_SWITCHUMD_UPDATED, 0, 0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case SystemNotification::DEBUG_MODE_CHANGE:
|
||||||
|
if (disasmWindow)
|
||||||
|
PostDialogMessage(disasmWindow, WM_DEB_SETDEBUGLPARAM, 0, (LPARAM)Core_IsStepping());
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,8 +26,6 @@
|
||||||
// TODO: Get rid of this junk
|
// TODO: Get rid of this junk
|
||||||
class HeadlessHost : public Host {
|
class HeadlessHost : public Host {
|
||||||
public:
|
public:
|
||||||
void SetDebugMode(bool mode) override { }
|
|
||||||
|
|
||||||
void SetGraphicsCore(GPUCore core) { gpuCore_ = core; }
|
void SetGraphicsCore(GPUCore core) { gpuCore_ = core; }
|
||||||
bool InitGraphics(std::string *error_message, GraphicsContext **ctx) override {return false;}
|
bool InitGraphics(std::string *error_message, GraphicsContext **ctx) override {return false;}
|
||||||
void ShutdownGraphics() override {}
|
void ShutdownGraphics() override {}
|
||||||
|
|
Loading…
Add table
Reference in a new issue