summaryrefslogtreecommitdiff
path: root/macosx/plugins/DFInput/macsrc
diff options
context:
space:
mode:
authorSND\edgbla_cp <SND\edgbla_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2011-08-23 20:48:39 +0000
committerSND\edgbla_cp <SND\edgbla_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2011-08-23 20:48:39 +0000
commit1e052267fb32e68328c769bfde987bd382829dd5 (patch)
tree82cb7279c869321209563ce70119ce642629c4e1 /macosx/plugins/DFInput/macsrc
parent47d52dacd0e12e909bf91c9bd99478e6b90dbfec (diff)
downloadpcsxr-1e052267fb32e68328c769bfde987bd382829dd5.tar.gz
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@69887 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'macosx/plugins/DFInput/macsrc')
-rw-r--r--macosx/plugins/DFInput/macsrc/ControllerList.m6
-rw-r--r--macosx/plugins/DFInput/macsrc/cfg.c8
-rw-r--r--macosx/plugins/DFInput/macsrc/xkb.c17
3 files changed, 28 insertions, 3 deletions
diff --git a/macosx/plugins/DFInput/macsrc/ControllerList.m b/macosx/plugins/DFInput/macsrc/ControllerList.m
index 5d67370a..578898c3 100644
--- a/macosx/plugins/DFInput/macsrc/ControllerList.m
+++ b/macosx/plugins/DFInput/macsrc/ControllerList.m
@@ -52,7 +52,7 @@ static int currentController;
/* NSDataSource */
- (int)numberOfRowsInTableView:(NSTableView *)aTableView
{
- return DKEY_TOTAL + (g.cfg.PadDef[currentController].Type == PSE_PAD_TYPE_ANALOGPAD ? 8 : -2);
+ return DKEY_TOTAL + (g.cfg.PadDef[currentController].Type == PSE_PAD_TYPE_ANALOGPAD ? 8 : -3);
}
static const NSString *LabelText[DKEY_TOTAL + 8] = {
@@ -72,6 +72,7 @@ static const NSString *LabelText[DKEY_TOTAL + 8] = {
@"Start",
@"L3",
@"R3",
+ @"Analog",
@"L-Stick Right",
@"L-Stick Left",
@"L-Stick Down",
@@ -98,7 +99,8 @@ static const int DPad[DKEY_TOTAL] = {
DKEY_SELECT,
DKEY_START,
DKEY_L3,
- DKEY_R3
+ DKEY_R3,
+ DKEY_ANALOG
};
+ (int)getButtonOfRow:(int)row
diff --git a/macosx/plugins/DFInput/macsrc/cfg.c b/macosx/plugins/DFInput/macsrc/cfg.c
index dec4ff3f..e27dafb0 100644
--- a/macosx/plugins/DFInput/macsrc/cfg.c
+++ b/macosx/plugins/DFInput/macsrc/cfg.c
@@ -49,6 +49,7 @@ static void SetDefaultConfig() {
g.cfg.PadDef[0].KeyDef[DKEY_CIRCLE].Key = 8;
g.cfg.PadDef[0].KeyDef[DKEY_CROSS].Key = 7;
g.cfg.PadDef[0].KeyDef[DKEY_SQUARE].Key = 2;
+ g.cfg.PadDef[0].KeyDef[DKEY_ANALOG].Key = 12;
// Pad1 joystick
g.cfg.PadDef[0].KeyDef[DKEY_SELECT].JoyEvType = BUTTON;
@@ -156,6 +157,11 @@ void LoadPADConfig() {
g.cfg.PadDef[current].KeyDef[DKEY_R3].Key = a;
g.cfg.PadDef[current].KeyDef[DKEY_R3].JoyEvType = b;
g.cfg.PadDef[current].KeyDef[DKEY_R3].J.d = c;
+ } else if (strncmp(buf, "Analog=", 7) == 0) {
+ sscanf(buf, "Analog=%d,%d,%d", &a, &b, &c);
+ g.cfg.PadDef[current].KeyDef[DKEY_ANALOG].Key = a;
+ g.cfg.PadDef[current].KeyDef[DKEY_ANALOG].JoyEvType = b;
+ g.cfg.PadDef[current].KeyDef[DKEY_ANALOG].J.d = c;
} else if (strncmp(buf, "Start=", 6) == 0) {
sscanf(buf, "Start=%d,%d,%d", &a, &b, &c);
g.cfg.PadDef[current].KeyDef[DKEY_START].Key = a;
@@ -294,6 +300,8 @@ void SavePADConfig() {
g.cfg.PadDef[i].KeyDef[DKEY_L3].JoyEvType, g.cfg.PadDef[i].KeyDef[DKEY_L3].J.d);
fprintf(fp, "R3=%d,%d,%d\n", g.cfg.PadDef[i].KeyDef[DKEY_R3].Key,
g.cfg.PadDef[i].KeyDef[DKEY_R3].JoyEvType, g.cfg.PadDef[i].KeyDef[DKEY_R3].J.d);
+ fprintf(fp, "Analog=%d,%d,%d\n", g.cfg.PadDef[i].KeyDef[DKEY_ANALOG].Key,
+ g.cfg.PadDef[i].KeyDef[DKEY_ANALOG].JoyEvType, g.cfg.PadDef[i].KeyDef[DKEY_ANALOG].J.d);
fprintf(fp, "Start=%d,%d,%d\n", g.cfg.PadDef[i].KeyDef[DKEY_START].Key,
g.cfg.PadDef[i].KeyDef[DKEY_START].JoyEvType, g.cfg.PadDef[i].KeyDef[DKEY_START].J.d);
fprintf(fp, "Up=%d,%d,%d\n", g.cfg.PadDef[i].KeyDef[DKEY_UP].Key,
diff --git a/macosx/plugins/DFInput/macsrc/xkb.c b/macosx/plugins/DFInput/macsrc/xkb.c
index e9345c2b..c5cfcaf2 100644
--- a/macosx/plugins/DFInput/macsrc/xkb.c
+++ b/macosx/plugins/DFInput/macsrc/xkb.c
@@ -26,6 +26,20 @@ void InitKeyboard() {
void DestroyKeyboard() {
}
+static void bdown(int pad, int bit)
+{
+ if(bit < 16)
+ g.PadState[pad].KeyStatus &= ~(1 << bit);
+ else if(bit == DKEY_ANALOG)
+ g.PadState[pad].PadModeSwitch = 1;
+}
+
+static void bup(int pad, int bit)
+{
+ if(bit < 16)
+ g.PadState[pad].KeyStatus |= (1 << bit);
+}
+
void CheckKeyboard() {
int i, j, k;
uint16_t key;
@@ -48,7 +62,8 @@ void CheckKeyboard() {
key = g.cfg.PadDef[i].KeyDef[j].Key;
if (key == 0) continue;
- if (KeyDown(key)) g.PadState[i].KeyStatus &= ~(1 << j);
+ if (KeyDown(key)) bdown(i, j);
+ else bup(i, j);
}
if (g.cfg.PadDef[i].Type != PSE_PAD_TYPE_ANALOGPAD) continue;