PAD: add back config screen, pause core when opened

This commit is contained in:
Gauvain 'GovanifY' Roussel-Tarbouriech 2020-12-11 04:25:21 +01:00 committed by lightningterror
parent 6df4fea079
commit 2e0be1f75a
9 changed files with 21 additions and 7 deletions

View File

@ -88,7 +88,7 @@ void CloseLogging()
#endif
}
s32 PADinit(u32 flags)
s32 PADinit()
{
initLogging();

View File

@ -121,7 +121,7 @@ void PADSaveConfig();
void SysMessage(char *fmt, ...);
s32 PADinit(u32 flags);
s32 PADinit();
void PADshutdown();
s32 PADopen(void *pDsp);
void PADsetSettingsDir(const char *dir);

View File

@ -19,7 +19,7 @@
#include "keyboard.h"
#include "PAD.h"
extern std::string s_strIniPath;
extern std::string s_padstrIniPath;
void DefaultKeyboardValues()
{
@ -43,10 +43,10 @@ void PADSaveConfig()
{
FILE *f;
const std::string iniFile(s_strIniPath + "OnePAD2.ini");
const std::string iniFile(s_padstrIniPath + "PAD.ini");
f = fopen(iniFile.c_str(), "w");
if (f == NULL) {
printf("OnePAD: failed to save ini %s\n", iniFile.c_str());
printf("PAD: failed to save ini %s\n", iniFile.c_str());
return;
}
@ -75,7 +75,7 @@ void PADLoadConfig()
g_conf.init();
const std::string iniFile(s_strIniPath + "OnePAD2.ini");
const std::string iniFile(s_padstrIniPath + "PAD.ini");
f = fopen(iniFile.c_str(), "r");
if (f == NULL) {
printf("OnePAD: failed to load ini %s\n", iniFile.c_str());

View File

@ -13,6 +13,7 @@
* If not, see <http://www.gnu.org/licenses/>.
*/
#include "AppCoreThread.h"
#include "GamePad.h"
#include "PAD.h"
#include "keyboard.h"
@ -114,8 +115,10 @@ void PADupdate(int pad)
void PADconfigure()
{
ScopedCoreThreadPause paused_core;
PADLoadConfig();
DisplayDialog();
paused_core.AllowResume();
return;
}

View File

@ -30,6 +30,7 @@
#include "SPU2/spu2.h"
#include "DEV9/DEV9.h"
#include "USB/USB.h"
#include "PAD/Linux/PAD.h"
#include "../DebugTools/MIPSAnalyst.h"
#include "../DebugTools/SymbolMap.h"
@ -327,7 +328,7 @@ void SysCoreThread::OnResumeInThread(bool isSuspended)
}
FWopen();
SPU2open((void*)pDsp);
PADopen();
PADopen((void*)pDsp);
}

View File

@ -35,6 +35,7 @@
#include "Patch.h"
#include "R5900Exceptions.h"
#include "Sio.h"
#include "PAD/Linux/PAD.h"
#ifndef DISABLE_RECORDING
#include "Recording/InputRecordingControls.h"

View File

@ -250,6 +250,7 @@ void MainEmuFrame::ConnectMenus()
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_PADSettings_Click, this, MenuId_Config_PAD);
Bind(wxEVT_MENU, &MainEmuFrame::Menu_GSSettings_Click, this, MenuId_Video_CoreSettings);
Bind(wxEVT_MENU, &MainEmuFrame::Menu_WindowSettings_Click, this, MenuId_Video_WindowSettings);
@ -443,6 +444,7 @@ void MainEmuFrame::CreateConfigMenu()
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.Append(MenuId_Config_PAD, _("&GamePad Settings..."));
m_menuConfig.AppendSeparator();

View File

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

View File

@ -23,6 +23,7 @@
#include "System/SysThreads.h"
#include "DEV9/DEV9.h"
#include "USB/USB.h"
#include "PAD/Linux/PAD.h"
#include "ConsoleLogger.h"
#include "MainFrame.h"
@ -70,6 +71,11 @@ void MainEmuFrame::Menu_USBSettings_Click(wxCommandEvent& event)
USBconfigure();
}
void MainEmuFrame::Menu_PADSettings_Click(wxCommandEvent& event)
{
PADconfigure();
}
void MainEmuFrame::Menu_WindowSettings_Click(wxCommandEvent &event)
{
wxCommandEvent evt(pxEvt_SetSettingsPage);