diff options
| author | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2013-09-12 17:37:00 +0000 |
|---|---|---|
| committer | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2013-09-12 17:37:00 +0000 |
| commit | 6d34781f490cb921edff2f822b87117c32bc9fc1 (patch) | |
| tree | d3c650239c33b64dcea0d0ce7ee946d1131cf4c9 /macosx/plugins/DFInput/macsrc | |
| parent | 59132f7e4e49b3d0147c39632d3b3fa6cf8854c7 (diff) | |
| download | pcsxr-6d34781f490cb921edff2f822b87117c32bc9fc1.tar.gz | |
Slight modification to OS X's pad plug-in code.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@87141 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'macosx/plugins/DFInput/macsrc')
| -rwxr-xr-x | macosx/plugins/DFInput/macsrc/PadController.m | 2 | ||||
| -rwxr-xr-x | macosx/plugins/DFInput/macsrc/cfg.c | 2 | ||||
| -rw-r--r-- | macosx/plugins/DFInput/macsrc/cfgHelper.m | 41 |
3 files changed, 24 insertions, 21 deletions
diff --git a/macosx/plugins/DFInput/macsrc/PadController.m b/macosx/plugins/DFInput/macsrc/PadController.m index 06b1f05a..b35e7439 100755 --- a/macosx/plugins/DFInput/macsrc/PadController.m +++ b/macosx/plugins/DFInput/macsrc/PadController.m @@ -311,7 +311,7 @@ void LoadPADConfig() void SavePADConfig() { NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; - NSMutableDictionary *pad1Dict = nil, *pad2Dict = nil; + NSMutableDictionary *pad1Dict, *pad2Dict; NSDictionary *prefDict = [defaults dictionaryForKey:PrefsKey]; pad1Dict = [[NSMutableDictionary alloc] initWithDictionary:prefDict[kDFPad1]]; pad2Dict = [[NSMutableDictionary alloc] initWithDictionary:prefDict[kDFPad2]]; diff --git a/macosx/plugins/DFInput/macsrc/cfg.c b/macosx/plugins/DFInput/macsrc/cfg.c index babf0621..703a001a 100755 --- a/macosx/plugins/DFInput/macsrc/cfg.c +++ b/macosx/plugins/DFInput/macsrc/cfg.c @@ -28,7 +28,7 @@ long PADconfigure(void) { if (SDL_WasInit(SDL_INIT_JOYSTICK)) return PSE_ERR_FATAL; // cannot change settings on the fly DoConfiguration(); - LoadPADConfig(); + //LoadPADConfig(); return PSE_ERR_SUCCESS; } diff --git a/macosx/plugins/DFInput/macsrc/cfgHelper.m b/macosx/plugins/DFInput/macsrc/cfgHelper.m index 638624a6..bb856824 100644 --- a/macosx/plugins/DFInput/macsrc/cfgHelper.m +++ b/macosx/plugins/DFInput/macsrc/cfgHelper.m @@ -42,26 +42,28 @@ #define dRightAnalogYP @"RightAnalogYP" #define dRightAnalogYM @"RightAnalogYM" +#define VibrateOn @"Visual Vibration" + NSDictionary *DefaultPadArray(int padnum) { - NSMutableDictionary *mutArray = [NSMutableDictionary dictionaryWithObjectsAndKeys: - @(padnum), deviceNumber, - @(PSE_PAD_TYPE_STANDARD), padType, - [NSMutableDictionary dictionaryWithObjectsAndKeys:@8, joyVal, @(BUTTON), joyType, nil], dSelect, - [NSMutableDictionary dictionaryWithObjectsAndKeys:@9, joyVal, @(BUTTON), joyType, nil], dStart, - [NSMutableDictionary dictionaryWithObjectsAndKeys:@(-2), joyVal, @(AXIS), joyType, nil], dUp, - [NSMutableDictionary dictionaryWithObjectsAndKeys:@1, joyVal, @(AXIS), joyType, nil], dRight, - [NSMutableDictionary dictionaryWithObjectsAndKeys:@2, joyVal, @(AXIS), joyType, nil], dDown, - [NSMutableDictionary dictionaryWithObjectsAndKeys:@(-1), joyVal, @(AXIS), joyType, nil], dLeft, - [NSMutableDictionary dictionaryWithObjectsAndKeys:@4, joyVal, @(BUTTON), joyType, nil], dL2, - [NSMutableDictionary dictionaryWithObjectsAndKeys:@6, joyVal, @(BUTTON), joyType, nil], dL1, - [NSMutableDictionary dictionaryWithObjectsAndKeys:@5, joyVal, @(BUTTON), joyType, nil], dR2, - [NSMutableDictionary dictionaryWithObjectsAndKeys:@7, joyVal, @(BUTTON), joyType, nil], dR1, - [NSMutableDictionary dictionaryWithObjectsAndKeys:@0, joyVal, @(BUTTON), joyType, nil], dTriangle, - [NSMutableDictionary dictionaryWithObjectsAndKeys:@1, joyVal, @(BUTTON), joyType, nil], dCircle, - [NSMutableDictionary dictionaryWithObjectsAndKeys:@2, joyVal, @(BUTTON), joyType, nil], dCross, - [NSMutableDictionary dictionaryWithObjectsAndKeys:@3, joyVal, @(BUTTON), joyType, nil], dSquare, - nil]; + NSMutableDictionary *mutArray = + [NSMutableDictionary dictionaryWithDictionary:@{VibrateOn: @NO, + deviceNumber: @(padnum), + padType: @(PSE_PAD_TYPE_STANDARD), + dSelect: [NSMutableDictionary dictionaryWithObjectsAndKeys:@8, joyVal, @(BUTTON), joyType, nil], + dStart: [NSMutableDictionary dictionaryWithObjectsAndKeys:@9, joyVal, @(BUTTON), joyType, nil], + dUp: [NSMutableDictionary dictionaryWithObjectsAndKeys:@(-2), joyVal, @(AXIS), joyType, nil], + dRight: [NSMutableDictionary dictionaryWithObjectsAndKeys:@1, joyVal, @(AXIS), joyType, nil], + dDown: [NSMutableDictionary dictionaryWithObjectsAndKeys:@2, joyVal, @(AXIS), joyType, nil], + dLeft: [NSMutableDictionary dictionaryWithObjectsAndKeys:@(-1), joyVal, @(AXIS), joyType, nil], + dL2: [NSMutableDictionary dictionaryWithObjectsAndKeys:@4, joyVal, @(BUTTON), joyType, nil], + dL1: [NSMutableDictionary dictionaryWithObjectsAndKeys:@6, joyVal, @(BUTTON), joyType, nil], + dR2: [NSMutableDictionary dictionaryWithObjectsAndKeys:@5, joyVal, @(BUTTON), joyType, nil], + dR1: [NSMutableDictionary dictionaryWithObjectsAndKeys:@7, joyVal, @(BUTTON), joyType, nil], + dTriangle: [NSMutableDictionary dictionaryWithObjectsAndKeys:@0, joyVal, @(BUTTON), joyType, nil], + dCircle: [NSMutableDictionary dictionaryWithObjectsAndKeys:@1, joyVal, @(BUTTON), joyType, nil], + dCross: [NSMutableDictionary dictionaryWithObjectsAndKeys:@2, joyVal, @(BUTTON), joyType, nil], + dSquare: [NSMutableDictionary dictionaryWithObjectsAndKeys:@3, joyVal, @(BUTTON), joyType, nil]}]; if (padnum == 0) { mutArray[dSelect][dfKey] = @9; mutArray[dStart][dfKey] = @10; @@ -151,7 +153,7 @@ void LoadPadArray(int padnum, NSDictionary *nsPrefs) PADDEF *curDef = &g.cfg.PadDef[padnum]; curDef->DevNum = [nsPrefs[deviceNumber] charValue]; curDef->Type = [nsPrefs[padType] unsignedShortValue]; - curDef->VisualVibration = 0; //Not implemented on OS X right now. + curDef->VisualVibration = [nsPrefs[VibrateOn] boolValue]; //Not implemented on OS X right now. //Analog buttons SetKeyFromDictionary(nsPrefs[dL3], &curDef->KeyDef[DKEY_L3]); @@ -194,6 +196,7 @@ NSDictionary *SavePadArray(int padnum) PADDEF *curDef = &g.cfg.PadDef[padnum]; mutArray[deviceNumber] = @(curDef->DevNum); mutArray[padType] = @(curDef->Type); + mutArray[VibrateOn] = curDef->VisualVibration ? @YES : @NO; switch (curDef->Type) { case PSE_PAD_TYPE_ANALOGPAD: |
