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
This commit is contained in:
SND\MaddTheSane_cp 2013-09-12 17:37:00 +00:00
parent 59132f7e4e
commit 6d34781f49
4 changed files with 56 additions and 21 deletions

View File

@ -690,6 +690,7 @@
55EC05FA1788B1230053AC23 /* PcsxrMemCardArray.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PcsxrMemCardArray.m; sourceTree = "<group>"; usesTabs = 1; };
55EC05FC178916E70053AC23 /* MemBadgeView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MemBadgeView.h; sourceTree = "<group>"; };
55EC05FD178916E70053AC23 /* MemBadgeView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MemBadgeView.m; sourceTree = "<group>"; usesTabs = 1; };
55EE2D9017E2323400FED42A /* ecm.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ecm.h; sourceTree = "<group>"; };
712FD1E51093096F00575A92 /* debug.c */ = {isa = PBXFileReference; fileEncoding = 0; lastKnownFileType = sourcecode.c.c; path = debug.c; sourceTree = "<group>"; };
712FD1E61093096F00575A92 /* socket.c */ = {isa = PBXFileReference; fileEncoding = 0; lastKnownFileType = sourcecode.c.c; path = socket.c; sourceTree = "<group>"; };
712FD1E71093096F00575A92 /* socket.h */ = {isa = PBXFileReference; fileEncoding = 0; lastKnownFileType = sourcecode.c.h; path = socket.h; sourceTree = "<group>"; };
@ -958,6 +959,7 @@
71F4C5680FDED12800529849 /* decode_xa.c */,
71F4C5690FDED12800529849 /* decode_xa.h */,
71F4C56A0FDED12800529849 /* disr3000a.c */,
55EE2D9017E2323400FED42A /* ecm.h */,
7192F428129C412E0042D946 /* gpu.c */,
7192F429129C412E0042D946 /* gpu.h */,
71F4C56B0FDED12800529849 /* gte.c */,
@ -2560,6 +2562,7 @@
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
INSTALL_PATH = "$(USER_LIBRARY_DIR)/Playstation Emulator Plugins";
SDKROOT = macosx;
WRAPPER_EXTENSION = psxplugin;
};
name = Debug;
@ -2575,6 +2578,7 @@
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
INSTALL_PATH = "$(USER_LIBRARY_DIR)/Playstation Emulator Plugins";
SDKROOT = macosx;
WRAPPER_EXTENSION = psxplugin;
};
name = Release;
@ -2592,6 +2596,7 @@
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
INSTALL_PATH = "$(USER_LIBRARY_DIR)/Playstation Emulator Plugins";
SDKROOT = macosx;
WRAPPER_EXTENSION = psxplugin;
};
name = Debug;
@ -2607,6 +2612,7 @@
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
INSTALL_PATH = "$(USER_LIBRARY_DIR)/Playstation Emulator Plugins";
SDKROOT = macosx;
WRAPPER_EXTENSION = psxplugin;
};
name = Release;
@ -2630,6 +2636,7 @@
);
INSTALL_PATH = "$(USER_LIBRARY_DIR)/Playstation Emulator Plugins";
LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks";
SDKROOT = macosx;
WRAPPER_EXTENSION = psxplugin;
};
name = Debug;
@ -2651,6 +2658,7 @@
);
INSTALL_PATH = "$(USER_LIBRARY_DIR)/Playstation Emulator Plugins";
LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks";
SDKROOT = macosx;
WRAPPER_EXTENSION = psxplugin;
};
name = Release;
@ -2671,6 +2679,7 @@
INSTALL_PATH = "$(USER_LIBRARY_DIR)/Playstation Emulator Plugins";
OTHER_CFLAGS = "$(OPTIMIZATION_CFLAGS)";
PRODUCT_NAME = PeopsSoftGPU;
SDKROOT = macosx;
WRAPPER_EXTENSION = psxplugin;
};
name = Debug;
@ -2690,6 +2699,7 @@
INSTALL_PATH = "$(USER_LIBRARY_DIR)/Playstation Emulator Plugins";
OTHER_CFLAGS = "$(OPTIMIZATION_CFLAGS)";
PRODUCT_NAME = PeopsSoftGPU;
SDKROOT = macosx;
WRAPPER_EXTENSION = psxplugin;
};
name = Release;
@ -2716,6 +2726,7 @@
INFOPLIST_FILE = "plugins/DFSound/Info-SDL.plist";
INSTALL_PATH = "$(USER_LIBRARY_DIR)/Playstation Emulator Plugins";
LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks";
SDKROOT = macosx;
WRAPPER_EXTENSION = psxplugin;
};
name = Debug;
@ -2740,6 +2751,7 @@
INFOPLIST_FILE = "plugins/DFSound/Info-SDL.plist";
INSTALL_PATH = "$(USER_LIBRARY_DIR)/Playstation Emulator Plugins";
LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks";
SDKROOT = macosx;
WRAPPER_EXTENSION = psxplugin;
};
name = Release;
@ -2765,6 +2777,7 @@
"plugins/DFSound/Resorces/Shared/SPUShared-info.plist",
);
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
};
name = Debug;
};
@ -2788,6 +2801,7 @@
"plugins/DFSound/Resorces/Shared/SPUShared-info.plist",
);
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
};
name = Release;
};
@ -2808,6 +2822,7 @@
INFOPLIST_FILE = "plugins/DFSound/Info-AL.plist";
INSTALL_PATH = "$(USER_LIBRARY_DIR)/Playstation Emulator Plugins";
LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks";
SDKROOT = macosx;
WRAPPER_EXTENSION = psxplugin;
};
name = Debug;
@ -2827,6 +2842,7 @@
INFOPLIST_FILE = "plugins/DFSound/Info-AL.plist";
INSTALL_PATH = "$(USER_LIBRARY_DIR)/Playstation Emulator Plugins";
LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks";
SDKROOT = macosx;
WRAPPER_EXTENSION = psxplugin;
};
name = Release;
@ -2848,6 +2864,7 @@
INSTALL_PATH = "$(USER_LIBRARY_DIR)/Playstation Emulator Plugins";
OTHER_CFLAGS = "$(OPTIMIZATION_CFLAGS)";
PRODUCT_NAME = PeopsXGL;
SDKROOT = macosx;
WRAPPER_EXTENSION = psxplugin;
};
name = Debug;
@ -2867,6 +2884,7 @@
INSTALL_PATH = "$(USER_LIBRARY_DIR)/Playstation Emulator Plugins";
OTHER_CFLAGS = "$(OPTIMIZATION_CFLAGS)";
PRODUCT_NAME = PeopsXGL;
SDKROOT = macosx;
WRAPPER_EXTENSION = psxplugin;
};
name = Release;
@ -2884,6 +2902,7 @@
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
INSTALL_PATH = "$(USER_LIBRARY_DIR)/Playstation Emulator Plugins";
SDKROOT = macosx;
WRAPPER_EXTENSION = psxplugin;
};
name = Debug;
@ -2899,6 +2918,7 @@
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
INSTALL_PATH = "$(USER_LIBRARY_DIR)/Playstation Emulator Plugins";
SDKROOT = macosx;
WRAPPER_EXTENSION = psxplugin;
};
name = Release;
@ -2948,6 +2968,7 @@
"$(inherited)",
);
PRODUCT_NAME = PCSXR;
SDKROOT = macosx;
WRAPPER_EXTENSION = app;
};
name = Instrument;
@ -2972,6 +2993,7 @@
"plugins/DFSound/Resorces/Shared/SPUShared-info.plist",
);
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
};
name = Instrument;
};
@ -2986,6 +3008,7 @@
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
INSTALL_PATH = "$(USER_LIBRARY_DIR)/Playstation Emulator Plugins";
SDKROOT = macosx;
WRAPPER_EXTENSION = psxplugin;
};
name = Instrument;
@ -3007,6 +3030,7 @@
);
INSTALL_PATH = "$(USER_LIBRARY_DIR)/Playstation Emulator Plugins";
LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks";
SDKROOT = macosx;
WRAPPER_EXTENSION = psxplugin;
};
name = Instrument;
@ -3026,6 +3050,7 @@
INSTALL_PATH = "$(USER_LIBRARY_DIR)/Playstation Emulator Plugins";
OTHER_CFLAGS = "$(OPTIMIZATION_CFLAGS)";
PRODUCT_NAME = PeopsSoftGPU;
SDKROOT = macosx;
WRAPPER_EXTENSION = psxplugin;
};
name = Instrument;
@ -3045,6 +3070,7 @@
INSTALL_PATH = "$(USER_LIBRARY_DIR)/Playstation Emulator Plugins";
OTHER_CFLAGS = "$(OPTIMIZATION_CFLAGS)";
PRODUCT_NAME = PeopsXGL;
SDKROOT = macosx;
WRAPPER_EXTENSION = psxplugin;
};
name = Instrument;
@ -3069,6 +3095,7 @@
INFOPLIST_FILE = "plugins/DFSound/Info-SDL.plist";
INSTALL_PATH = "$(USER_LIBRARY_DIR)/Playstation Emulator Plugins";
LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks";
SDKROOT = macosx;
WRAPPER_EXTENSION = psxplugin;
};
name = Instrument;
@ -3088,6 +3115,7 @@
INFOPLIST_FILE = "plugins/DFSound/Info-AL.plist";
INSTALL_PATH = "$(USER_LIBRARY_DIR)/Playstation Emulator Plugins";
LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks";
SDKROOT = macosx;
WRAPPER_EXTENSION = psxplugin;
};
name = Instrument;
@ -3103,6 +3131,7 @@
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
INSTALL_PATH = "$(USER_LIBRARY_DIR)/Playstation Emulator Plugins";
SDKROOT = macosx;
WRAPPER_EXTENSION = psxplugin;
};
name = Instrument;
@ -3118,6 +3147,7 @@
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
INSTALL_PATH = "$(USER_LIBRARY_DIR)/Playstation Emulator Plugins";
SDKROOT = macosx;
WRAPPER_EXTENSION = psxplugin;
};
name = Instrument;
@ -3166,6 +3196,7 @@
LD_NO_PIE = YES;
OTHER_CFLAGS = "$(inherited)";
PRODUCT_NAME = PCSXR;
SDKROOT = macosx;
WRAPPER_EXTENSION = app;
};
name = Debug;
@ -3195,6 +3226,7 @@
"$(inherited)",
);
PRODUCT_NAME = PCSXR;
SDKROOT = macosx;
WRAPPER_EXTENSION = app;
};
name = Release;

View File

@ -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]];

View File

@ -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;
}

View File

@ -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: