From ca8bf22423e2e721729ff99ed0812316f45b2a55 Mon Sep 17 00:00:00 2001 From: Gauvain 'GovanifY' Roussel-Tarbouriech Date: Sat, 3 Oct 2020 19:24:58 +0200 Subject: [PATCH] DEV9: add back configure GUI --- cmake/macros/CompileGResources.cmake | 2 +- pcsx2/CMakeLists.txt | 6 +++--- pcsx2/DEV9/DEV9.h | 1 + pcsx2/DEV9/Linux/Linux.cpp | 8 ++++---- pcsx2/DEV9/Win32/Win32.cpp | 6 ++++-- pcsx2/gui/MainFrame.cpp | 2 ++ pcsx2/gui/MainFrame.h | 1 + pcsx2/gui/MainMenuClicks.cpp | 8 +++++++- 8 files changed, 23 insertions(+), 11 deletions(-) diff --git a/cmake/macros/CompileGResources.cmake b/cmake/macros/CompileGResources.cmake index 386c354986..3f60ac7a42 100644 --- a/cmake/macros/CompileGResources.cmake +++ b/cmake/macros/CompileGResources.cmake @@ -83,7 +83,7 @@ function(COMPILE_GRESOURCES output xml_out) if (NOT "${CG_ARG_C_PREFIX}" STREQUAL "") list(APPEND CG_GENERATE_COMMAND_LINE --c-name "${CG_ARG_C_PREFIX}") endif() - set(CG_TARGET_FILE_ENDING "c") + set(CG_TARGET_FILE_ENDING "cpp") elseif ("${CG_ARG_TYPE}" STREQUAL "EMBED_H") # EMBED_H mode, output includable header file. list(APPEND CG_GENERATE_COMMAND_LINE --generate-header) diff --git a/pcsx2/CMakeLists.txt b/pcsx2/CMakeLists.txt index 98f9a70421..cd832f3b9e 100644 --- a/pcsx2/CMakeLists.txt +++ b/pcsx2/CMakeLists.txt @@ -1,4 +1,4 @@ -include(macros/GlibCompileResourcesSupport) +include(macros/CompileGResources) if (openSUSE) @@ -313,7 +313,7 @@ set(pcsx2DEV9Sources DEV9/Linux/Config.cpp DEV9/Linux/Linux.cpp DEV9/Linux/net.cpp - #${pcsx2DEV9UISources} + ${pcsx2DEV9UISources} ) # DEV9 headers @@ -323,7 +323,7 @@ set(pcsx2DEV9Headers DEV9/net.h DEV9/pcap_io.h DEV9/smap.h - #${pcsx2DEV9UIHeaders} + ${pcsx2DEV9UIHeaders} ) diff --git a/pcsx2/DEV9/DEV9.h b/pcsx2/DEV9/DEV9.h index 7323f8ada9..dcfa129cb4 100644 --- a/pcsx2/DEV9/DEV9.h +++ b/pcsx2/DEV9/DEV9.h @@ -636,6 +636,7 @@ static flash_info_t devices[] = { #define FLASH_REGSIZE 0x20 extern void dev9Irq(int cycles); +extern void DEV9configure(); void FLASHinit(); s32 DEV9init(); diff --git a/pcsx2/DEV9/Linux/Linux.cpp b/pcsx2/DEV9/Linux/Linux.cpp index fb8314b217..0ede58eb60 100644 --- a/pcsx2/DEV9/Linux/Linux.cpp +++ b/pcsx2/DEV9/Linux/Linux.cpp @@ -27,6 +27,7 @@ #include "pcap.h" #include "../pcap_io.h" #include "../net.h" +#include "AppCoreThread.h" static GtkBuilder * builder; @@ -118,9 +119,8 @@ static guint builder_add_from_resource(GtkBuilder *builder return ret; } -EXPORT_C_(void) -DEV9configure() { - +void DEV9configure() { + ScopedCoreThreadPause paused_core; gtk_init (NULL, NULL); GError *error = NULL; builder = gtk_builder_new(); @@ -140,7 +140,7 @@ DEV9configure() { break; } gtk_widget_hide (GTK_WIDGET(dlg)); - + paused_core.AllowResume(); } NetAdapter* GetNetAdapter() diff --git a/pcsx2/DEV9/Win32/Win32.cpp b/pcsx2/DEV9/Win32/Win32.cpp index f3da3629b3..3524dac9ce 100644 --- a/pcsx2/DEV9/Win32/Win32.cpp +++ b/pcsx2/DEV9/Win32/Win32.cpp @@ -24,6 +24,7 @@ #include "..\pcap_io.h" #include "..\net.h" #include "tap.h" +#include "AppCoreThread.h" extern HINSTANCE hInst; //HANDLE handleDEV9Thread = NULL; @@ -141,13 +142,14 @@ BOOL CALLBACK AboutDlgProc(HWND hW, UINT uMsg, WPARAM wParam, LPARAM lParam) { return FALSE; } -EXPORT_C_(void) -DEV9configure() { +void DEV9configure() { + ScopedCoreThreadPause paused_core; DialogBox(hInst, MAKEINTRESOURCE(IDD_CONFIG), GetActiveWindow(), (DLGPROC)ConfigureDlgProc); //SysMessage("Nothing to Configure"); + paused_core.AllowResume(); } EXPORT_C_(void) diff --git a/pcsx2/gui/MainFrame.cpp b/pcsx2/gui/MainFrame.cpp index 63c234d17a..bd2045e1ec 100644 --- a/pcsx2/gui/MainFrame.cpp +++ b/pcsx2/gui/MainFrame.cpp @@ -248,6 +248,7 @@ void MainEmuFrame::ConnectMenus() Bind(wxEVT_MENU, &MainEmuFrame::Menu_McdSettings_Click, this, MenuId_Config_McdSettings); Bind(wxEVT_MENU, &MainEmuFrame::Menu_SelectPluginsBios_Click, this, MenuId_Config_BIOS); Bind(wxEVT_MENU, &MainEmuFrame::Menu_AudioSettings_Click, this, MenuId_Config_SPU2); + Bind(wxEVT_MENU, &MainEmuFrame::Menu_NetworkSettings_Click, this, MenuId_Config_DEV9); Bind(wxEVT_MENU, &MainEmuFrame::Menu_GSSettings_Click, this, MenuId_Video_CoreSettings); Bind(wxEVT_MENU, &MainEmuFrame::Menu_WindowSettings_Click, this, MenuId_Video_WindowSettings); @@ -439,6 +440,7 @@ void MainEmuFrame::CreateConfigMenu() m_menuConfig.Append(MenuId_Config_McdSettings, _("&Memory Cards...")); m_menuConfig.Append(MenuId_Config_BIOS, _("&Plugin/BIOS Selector...")); m_menuConfig.Append(MenuId_Config_SPU2, _("&Audio Settings...")); + m_menuConfig.Append(MenuId_Config_DEV9, _("&Network and HDD Settings...") ); m_menuConfig.AppendSeparator(); diff --git a/pcsx2/gui/MainFrame.h b/pcsx2/gui/MainFrame.h index 7c57aba06c..5feb08dd1e 100644 --- a/pcsx2/gui/MainFrame.h +++ b/pcsx2/gui/MainFrame.h @@ -191,6 +191,7 @@ protected: void OnActivate(wxActivateEvent& evt); void Menu_SysSettings_Click(wxCommandEvent& event); + void Menu_NetworkSettings_Click(wxCommandEvent &event); void Menu_AudioSettings_Click(wxCommandEvent& event); void Menu_McdSettings_Click(wxCommandEvent& event); void Menu_WindowSettings_Click(wxCommandEvent& event); diff --git a/pcsx2/gui/MainMenuClicks.cpp b/pcsx2/gui/MainMenuClicks.cpp index 053ae408d4..10e6c7fce8 100644 --- a/pcsx2/gui/MainMenuClicks.cpp +++ b/pcsx2/gui/MainMenuClicks.cpp @@ -21,6 +21,7 @@ #include "GSFrame.h" #include "SPU2/spu2.h" #include "System/SysThreads.h" +#include "DEV9/DEV9.h" #include "ConsoleLogger.h" #include "MainFrame.h" @@ -58,7 +59,12 @@ void MainEmuFrame::Menu_McdSettings_Click(wxCommandEvent& event) AppOpenModalDialog(wxEmptyString, this); } -void MainEmuFrame::Menu_WindowSettings_Click(wxCommandEvent& event) +void MainEmuFrame::Menu_NetworkSettings_Click(wxCommandEvent &event) +{ + DEV9configure(); +} + +void MainEmuFrame::Menu_WindowSettings_Click(wxCommandEvent &event) { wxCommandEvent evt(pxEvt_SetSettingsPage); evt.SetString(L"GS Window");