USB: add back config screen, pause core when opened

This commit is contained in:
Gauvain 'GovanifY' Roussel-Tarbouriech 2020-11-02 22:58:49 +01:00 committed by refractionpcsx2
parent a6c67dde55
commit 37e54ebd9f
6 changed files with 20 additions and 9 deletions

View File

@ -33,6 +33,8 @@ extern u8 *ram;
// ---------------------------------------------------------------------
void USBconfigure();
void DestroyDevices();
void CreateDevices();

View File

@ -1,3 +1,4 @@
#include "AppCoreThread.h"
#include "../USB.h"
#include "resource.h"
#include "Config.h"
@ -226,12 +227,14 @@ EXPORT_C_(BOOL) AboutDlgProc(HWND hW, UINT uMsg, WPARAM wParam, LPARAM lParam) {
return FALSE;
}
EXPORT_C_(void) USBconfigure() {
void USBconfigure() {
ScopedCoreThreadPause paused_core;
RegisterDevice::Register();
DialogBox(hInst,
MAKEINTRESOURCE(IDD_CONFIG),
GetActiveWindow(),
(DLGPROC)ConfigureDlgProc);
paused_core.AllowResume();
}
EXPORT_C_(void) USBabout() {

View File

@ -5,6 +5,7 @@
#include <map>
#include <vector>
#include <string>
#include "AppCoreThread.h"
#include "../gtk.h"
#include "../osdebugout.h"
@ -14,6 +15,7 @@
#include "../usb-mic/audiodeviceproxy.h"
#include "config.h"
#include "../USB.h"
// src/USB.cpp
extern bool configChanged;
@ -185,11 +187,9 @@ static GtkWidget* new_frame(const char *label, GtkWidget *box)
return vbox;
}
#ifdef __cplusplus
extern "C" {
#endif
void CALLBACK USBconfigure() {
void USBconfigure() {
ScopedCoreThreadPause paused_core;
RegisterDevice::Register();
LoadConfig();
@ -301,11 +301,8 @@ void CALLBACK USBconfigure() {
configChanged = true;
}
// ClearAPIs();
paused_core.AllowResume();
}
void CALLBACK USBabout() {
}
#ifdef __cplusplus
} //extern "C"
#endif

View File

@ -249,6 +249,7 @@ void MainEmuFrame::ConnectMenus()
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_USBSettings_Click, this, MenuId_Config_USB);
Bind(wxEVT_MENU, &MainEmuFrame::Menu_GSSettings_Click, this, MenuId_Video_CoreSettings);
Bind(wxEVT_MENU, &MainEmuFrame::Menu_WindowSettings_Click, this, MenuId_Video_WindowSettings);
@ -441,6 +442,7 @@ void MainEmuFrame::CreateConfigMenu()
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.Append(MenuId_Config_USB, _("&USB Settings..."));
m_menuConfig.AppendSeparator();

View File

@ -193,6 +193,7 @@ protected:
void Menu_SysSettings_Click(wxCommandEvent& event);
void Menu_NetworkSettings_Click(wxCommandEvent &event);
void Menu_AudioSettings_Click(wxCommandEvent& event);
void Menu_USBSettings_Click(wxCommandEvent& event);
void Menu_McdSettings_Click(wxCommandEvent& event);
void Menu_WindowSettings_Click(wxCommandEvent& event);
void Menu_GSSettings_Click(wxCommandEvent& event);

View File

@ -22,6 +22,7 @@
#include "SPU2/spu2.h"
#include "System/SysThreads.h"
#include "DEV9/DEV9.h"
#include "USB/USB.h"
#include "ConsoleLogger.h"
#include "MainFrame.h"
@ -64,6 +65,11 @@ void MainEmuFrame::Menu_NetworkSettings_Click(wxCommandEvent &event)
DEV9configure();
}
void MainEmuFrame::Menu_USBSettings_Click(wxCommandEvent& event)
{
USBconfigure();
}
void MainEmuFrame::Menu_WindowSettings_Click(wxCommandEvent &event)
{
wxCommandEvent evt(pxEvt_SetSettingsPage);