From 85de557b808515075413e5926cba0ae6360d0c06 Mon Sep 17 00:00:00 2001 From: zilmar Date: Thu, 29 May 2025 12:04:20 +0930 Subject: [PATCH] Core: remove graphics plugin debug code that is not currently being used --- Source/Project64-core/Plugins/GFXPlugin.cpp | 23 +--------- Source/Project64-core/Plugins/GFXPlugin.h | 46 ------------------- Source/Project64/UserInterface/MainMenu.cpp | 11 ----- Source/Project64/UserInterface/MainWindow.cpp | 9 ---- 4 files changed, 1 insertion(+), 88 deletions(-) diff --git a/Source/Project64-core/Plugins/GFXPlugin.cpp b/Source/Project64-core/Plugins/GFXPlugin.cpp index a1b8380f3..6276f2e8a 100644 --- a/Source/Project64-core/Plugins/GFXPlugin.cpp +++ b/Source/Project64-core/Plugins/GFXPlugin.cpp @@ -22,11 +22,8 @@ CGfxPlugin::CGfxPlugin() : ViWidthChanged(nullptr), SoftReset(nullptr), GetRomBrowserMenu(nullptr), - OnRomBrowserMenuItem(nullptr), - GetDebugInfo(nullptr), - InitiateDebugger(nullptr) + OnRomBrowserMenuItem(nullptr) { - memset(&m_GFXDebug, 0, sizeof(m_GFXDebug)); } CGfxPlugin::~CGfxPlugin() @@ -109,8 +106,6 @@ bool CGfxPlugin::LoadFunctions(void) LoadFunction(ProcessRDPList); LoadFunction(CaptureScreen); LoadFunction(ShowCFB); - LoadFunction(GetDebugInfo); - _LoadFunction("InitiateGFXDebugger", InitiateDebugger); if (ProcessRDPList == nullptr) { @@ -137,11 +132,6 @@ bool CGfxPlugin::LoadFunctions(void) return false; } } - - if (GetDebugInfo != nullptr) - { - GetDebugInfo(&m_GFXDebug); - } return true; } @@ -522,13 +512,10 @@ void CGfxPlugin::UnloadPluginDetails(void) DynamicLibraryClose(m_LibHandle); m_LibHandle = nullptr; } - memset(&m_GFXDebug, 0, sizeof(m_GFXDebug)); ChangeWindow = nullptr; - GetDebugInfo = nullptr; DrawScreen = nullptr; DrawStatus = nullptr; - InitiateDebugger = nullptr; MoveScreen = nullptr; ProcessDList = nullptr; ProcessRDPList = nullptr; @@ -541,14 +528,6 @@ void CGfxPlugin::UnloadPluginDetails(void) WriteTrace(TraceVideoPlugin, TraceDebug, "Done"); } -void CGfxPlugin::ProcessMenuItem(int32_t id) -{ - if (m_GFXDebug.ProcessMenuItem) - { - m_GFXDebug.ProcessMenuItem(id); - } -} - #ifdef ANDROID void CGfxPlugin::SwapBuffers(void) { diff --git a/Source/Project64-core/Plugins/GFXPlugin.h b/Source/Project64-core/Plugins/GFXPlugin.h index aaa1d4580..85823cd47 100644 --- a/Source/Project64-core/Plugins/GFXPlugin.h +++ b/Source/Project64-core/Plugins/GFXPlugin.h @@ -3,41 +3,6 @@ class CGfxPlugin : public CPlugin { - typedef struct - { - // Menu - // Items should have an ID between 5101 and 5200 - void * hGFXMenu; - void(CALL * ProcessMenuItem)(int32_t ID); - - // Breakpoints - int32_t UseBPoints; - char BPPanelName[20]; - void(CALL * Add_BPoint)(void); - void(CALL * CreateBPPanel)(void * hDlg, void * rcBox); - void(CALL * HideBPPanel)(void); - void(CALL * PaintBPPanel)(void * ps); - void(CALL * ShowBPPanel)(void); - void(CALL * RefreshBpoints)(void * hList); - void(CALL * RemoveBpoint)(void * hList, int32_t index); - void(CALL * RemoveAllBpoint)(void); - - // GFX command window - void(CALL * Enter_GFX_Commands_Window)(void); - } GFXDEBUG_INFO; - - typedef struct - { - void(CALL * UpdateBreakPoints)(void); - void(CALL * UpdateMemory)(void); - void(CALL * UpdateR4300iRegisters)(void); - void(CALL * Enter_BPoint_Window)(void); - void(CALL * Enter_R4300i_Commands_Window)(void); - void(CALL * Enter_R4300i_Register_Window)(void); - void(CALL * Enter_RSP_Commands_Window)(void); - void(CALL * Enter_Memory_Window)(void); - } DEBUG_INFO; - public: CGfxPlugin(void); ~CGfxPlugin(); @@ -66,12 +31,6 @@ public: void *(CALL * GetRomBrowserMenu)(void); // Items should have an ID between 4101 and 4200 void(CALL * OnRomBrowserMenuItem)(int32_t MenuID, void * hParent, uint8_t * HEADER); - void * GetDebugMenu(void) - { - return m_GFXDebug.hGFXMenu; - } - void ProcessMenuItem(int32_t id); - private: CGfxPlugin(const CGfxPlugin &); CGfxPlugin & operator=(const CGfxPlugin &); @@ -93,11 +52,6 @@ private: bool Initiate_1_4(CN64System * System, RenderWindow * Window); bool Initiate_1_5(CN64System * System, RenderWindow * Window); - GFXDEBUG_INFO m_GFXDebug; - - void(CALL * GetDebugInfo)(GFXDEBUG_INFO * GFXDebugInfo); - void(CALL * InitiateDebugger)(DEBUG_INFO DebugInfo); - #ifdef ANDROID static void SwapBuffers(void); #endif diff --git a/Source/Project64/UserInterface/MainMenu.cpp b/Source/Project64/UserInterface/MainMenu.cpp index b4db107f1..190670b7c 100644 --- a/Source/Project64/UserInterface/MainMenu.cpp +++ b/Source/Project64/UserInterface/MainMenu.cpp @@ -1300,13 +1300,6 @@ void CMainMenu::FillOutMenu(HMENU hMenu) DebugMenu.push_back(Item); } - // Debug - RDP - if (g_Plugins && g_Plugins->Gfx() != nullptr && IsMenu((HMENU)g_Plugins->Gfx()->GetDebugMenu())) - { - Item.Reset(ID_PLUGIN_MENU, EMPTY_STRING, EMPTY_STDSTR, g_Plugins->Gfx()->GetDebugMenu(), L"&RDP"); - DebugMenu.push_back(Item); - } - // Notification menu Item.Reset(ID_DEBUG_SHOW_PIF_ERRORS, EMPTY_STRING, EMPTY_STDSTR, nullptr, L"On PIF errors"); if (g_Settings->LoadBool(Debugger_ShowPifErrors)) @@ -1452,10 +1445,6 @@ void CMainMenu::ResetMenu(void) m_Gui->SetWindowMenu(this); WriteTrace(TraceUserInterface, TraceDebug, "Remove plugin menu"); - if (g_Plugins->Gfx() != nullptr && IsMenu((HMENU)g_Plugins->Gfx()->GetDebugMenu())) - { - RemoveMenu((HMENU)OldMenuHandle, (UINT)((UINT_PTR)g_Plugins->Gfx()->GetDebugMenu()), MF_BYCOMMAND); - } if (g_Plugins->RSP() != nullptr && IsMenu((HMENU)g_Plugins->RSP()->GetDebugMenu())) { RemoveMenu((HMENU)OldMenuHandle, (UINT)((UINT_PTR)g_Plugins->RSP()->GetDebugMenu()), MF_BYCOMMAND); diff --git a/Source/Project64/UserInterface/MainWindow.cpp b/Source/Project64/UserInterface/MainWindow.cpp index a20f01a09..74e090d33 100644 --- a/Source/Project64/UserInterface/MainWindow.cpp +++ b/Source/Project64/UserInterface/MainWindow.cpp @@ -1133,15 +1133,6 @@ LRESULT CALLBACK CMainGui::MainGui_Proc(HWND hWnd, DWORD uMsg, WPARAM wParam, LP g_Plugins->RSP()->ProcessMenuItem(LOWORD(wParam)); } } - else if (LOWORD(wParam) > 5100 && LOWORD(wParam) <= 5200) - { - if (g_Plugins->Gfx()) - { - WriteTrace(TraceVideoPlugin, TraceDebug, "Starting"); - g_Plugins->Gfx()->ProcessMenuItem(LOWORD(wParam)); - WriteTrace(TraceVideoPlugin, TraceDebug, "Done"); - } - } else if (LOWORD(wParam) > 5200 && LOWORD(wParam) <= 5300) { if (g_Plugins->Gfx() && g_Plugins->Gfx()->OnRomBrowserMenuItem != nullptr)