mirror of https://github.com/PCSX2/pcsx2.git
onepad: apply a patch to the ini settings.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3054 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
e3cc848a72
commit
f67299ad83
|
@ -35,7 +35,6 @@ extern "C"
|
||||||
#include "callbacks.h"
|
#include "callbacks.h"
|
||||||
}
|
}
|
||||||
|
|
||||||
extern string s_strIniPath;
|
|
||||||
GtkWidget *Conf, *About, *MsgDlg;
|
GtkWidget *Conf, *About, *MsgDlg;
|
||||||
GtkWidget *s_devicecombo;
|
GtkWidget *s_devicecombo;
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,8 @@ extern "C"
|
||||||
#include "callbacks.h"
|
#include "callbacks.h"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern std::string s_strIniPath;
|
||||||
|
|
||||||
string KeyName(int pad, int key)
|
string KeyName(int pad, int key)
|
||||||
{
|
{
|
||||||
string tmp;
|
string tmp;
|
||||||
|
@ -123,11 +125,11 @@ void SaveConfig()
|
||||||
FILE *f;
|
FILE *f;
|
||||||
char cfg[255];
|
char cfg[255];
|
||||||
|
|
||||||
strcpy(cfg, s_strIniPath.c_str());
|
const std::string iniFile(s_strIniPath + "OnePAD.ini");
|
||||||
f = fopen(cfg, "w");
|
f = fopen(iniFile.c_str(), "w");
|
||||||
if (f == NULL)
|
if (f == NULL)
|
||||||
{
|
{
|
||||||
printf("ZeroPAD: failed to save ini %s\n", s_strIniPath.c_str());
|
printf("ZeroPAD: failed to save ini %s\n", iniFile.c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -147,17 +149,16 @@ void LoadConfig()
|
||||||
{
|
{
|
||||||
FILE *f;
|
FILE *f;
|
||||||
char str[256];
|
char str[256];
|
||||||
char cfg[255];
|
|
||||||
|
|
||||||
memset(&conf, 0, sizeof(conf));
|
memset(&conf, 0, sizeof(conf));
|
||||||
DefaultValues();
|
DefaultValues();
|
||||||
conf.log = 0;
|
conf.log = 0;
|
||||||
|
|
||||||
strcpy(cfg, s_strIniPath.c_str());
|
const std::string iniFile(s_strIniPath + "OnePAD.ini");
|
||||||
f = fopen(cfg, "r");
|
f = fopen(iniFile.c_str(), "r");
|
||||||
if (f == NULL)
|
if (f == NULL)
|
||||||
{
|
{
|
||||||
printf("OnePAD: failed to load ini %s\n", s_strIniPath.c_str());
|
printf("OnePAD: failed to load ini %s\n", iniFile.c_str());
|
||||||
SaveConfig(); //save and return
|
SaveConfig(); //save and return
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -338,11 +338,6 @@ void OnConf_Key(GtkButton *button, gpointer user_data)
|
||||||
|
|
||||||
EXPORT_C_(void) PADconfigure()
|
EXPORT_C_(void) PADconfigure()
|
||||||
{
|
{
|
||||||
char strcurdir[256];
|
|
||||||
getcwd(strcurdir, 256);
|
|
||||||
s_strIniPath = strcurdir;
|
|
||||||
s_strIniPath += "/inis/OnePAD.ini";
|
|
||||||
|
|
||||||
LoadConfig();
|
LoadConfig();
|
||||||
|
|
||||||
Conf = create_Conf();
|
Conf = create_Conf();
|
||||||
|
|
|
@ -37,7 +37,6 @@ extern "C"
|
||||||
}
|
}
|
||||||
|
|
||||||
extern GtkWidget *Conf, *s_devicecombo;
|
extern GtkWidget *Conf, *s_devicecombo;
|
||||||
extern string s_strIniPath;
|
|
||||||
extern void init_tree_view();
|
extern void init_tree_view();
|
||||||
extern void destroy_tree_view();
|
extern void destroy_tree_view();
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ keyEvent event;
|
||||||
u16 status[2];
|
u16 status[2];
|
||||||
int pressure;
|
int pressure;
|
||||||
static keyEvent s_event;
|
static keyEvent s_event;
|
||||||
string s_strIniPath = "inis/OnePAD.ini";
|
std::string s_strIniPath("inis/");
|
||||||
bool toggleAutoRepeat = true;
|
bool toggleAutoRepeat = true;
|
||||||
|
|
||||||
const u32 version = PS2E_PAD_VERSION;
|
const u32 version = PS2E_PAD_VERSION;
|
||||||
|
@ -243,13 +243,6 @@ EXPORT_C_(s32) PADinit(u32 flags)
|
||||||
status[0] = 0xffff;
|
status[0] = 0xffff;
|
||||||
status[1] = 0xffff;
|
status[1] = 0xffff;
|
||||||
|
|
||||||
#ifdef __LINUX__
|
|
||||||
/*char strcurdir[256];
|
|
||||||
getcwd(strcurdir, 256);
|
|
||||||
s_strIniPath = strcurdir;
|
|
||||||
s_strIniPath += "/inis/OnePAD.ini";*/
|
|
||||||
#endif
|
|
||||||
|
|
||||||
LoadConfig();
|
LoadConfig();
|
||||||
|
|
||||||
PADsetMode(0, 0);
|
PADsetMode(0, 0);
|
||||||
|
@ -286,6 +279,13 @@ EXPORT_C_(s32) PADopen(void *pDsp)
|
||||||
return _PADopen(pDsp);
|
return _PADopen(pDsp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CALLBACK PADsetSettingsDir(const char* dir)
|
||||||
|
{
|
||||||
|
// Get the path to the ini directory.
|
||||||
|
s_strIniPath = (dir==NULL) ? "inis/" : dir;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
EXPORT_C_(void) PADclose()
|
EXPORT_C_(void) PADclose()
|
||||||
{
|
{
|
||||||
pthread_spin_destroy(&s_mutexStatus);
|
pthread_spin_destroy(&s_mutexStatus);
|
||||||
|
|
Loading…
Reference in New Issue