From be3d963074ee8adf5da0371761e090488b3681d3 Mon Sep 17 00:00:00 2001 From: "SND\\MaddTheSane_cp" Date: Sat, 15 Dec 2012 21:07:55 +0000 Subject: Mac Patch 13437. git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@81770 e17a0e51-4ae3-4d35-97c3-1a29b211df97 --- macosx/ConfigurationController.h | 7 + macosx/ConfigurationController.m | 15 +- macosx/EmuThread.m | 6 +- macosx/English.lproj/Configuration.xib | 749 ++++++++++++++++++--- macosx/English.lproj/Credits.rtf | 3 +- macosx/English.lproj/InfoPlist.strings | 2 +- macosx/English.lproj/KeyNames.plist | 202 ++++++ macosx/English.lproj/PCSXR.xib | 80 ++- macosx/ExtendedKeys.h | 6 +- macosx/HotkeyController.h | 30 + macosx/HotkeyController.m | 206 ++++++ macosx/Pcsxr.xcodeproj/project.pbxproj | 28 +- macosx/PcsxrController.h | 3 + macosx/PcsxrController.m | 25 +- macosx/hotkeys.h | 15 + macosx/main.m | 4 + macosx/plugins/DFInput/English.lproj/Credits.rtf | 17 +- .../English.lproj/NetPcsxrHIDInputPluginMain.xib | 108 +-- .../PeopsSoftGPU.xcodeproj/project.pbxproj | 4 +- macosx/plugins/DFXVideo/macsrc/ExtendedKeys.h | 6 +- macosx/plugins/DFXVideo/macsrc/drawgl.m | 3 + .../PeopsXgl/PeopsXGL.xcodeproj/project.pbxproj | 6 +- macosx/plugins/PeopsXgl/macsrc/ExtendedKeys.h | 6 +- macosx/plugins/PeopsXgl/macsrc/drawgl.m | 3 + 24 files changed, 1347 insertions(+), 187 deletions(-) create mode 100644 macosx/English.lproj/KeyNames.plist create mode 100644 macosx/HotkeyController.h create mode 100644 macosx/HotkeyController.m create mode 100644 macosx/hotkeys.h diff --git a/macosx/ConfigurationController.h b/macosx/ConfigurationController.h index bcfdc314..2e88f445 100644 --- a/macosx/ConfigurationController.h +++ b/macosx/ConfigurationController.h @@ -2,6 +2,7 @@ #import #import "PluginController.h" +#import "HotkeyController.h" #import "PluginList.h" extern NSString *memChangeNotifier; @@ -31,6 +32,10 @@ extern NSString *memChangeNotifier; IBOutlet id noFastBootCell; IBOutlet id enableNetPlayCell; IBOutlet id widescreen; + + // Hotkeys + IBOutlet HotkeyController *hkController; + IBOutlet NSTabViewItem *hkTab; IBOutlet NSTextField *mcd1Label; IBOutlet NSTextField *mcd2Label; @@ -50,4 +55,6 @@ extern NSString *memChangeNotifier; - (NSString *)keyForSender:(id)sender; + (void)setMemoryCard:(int)theCard toPath:(NSString *)theFile; +- (void)tabView:(NSTabView *)tabView didSelectTabViewItem:(NSTabViewItem *)tabViewItem; + @end diff --git a/macosx/ConfigurationController.m b/macosx/ConfigurationController.m index 42eeee89..730dfaf8 100644 --- a/macosx/ConfigurationController.m +++ b/macosx/ConfigurationController.m @@ -213,7 +213,9 @@ NSString *memChangeNotifier = @"PcsxrMemoryCardDidChangeNotifier"; [padPlugin setPluginsTo:[list pluginsForType:PSE_LT_PAD] withType: PSE_LT_PAD]; [cdromPlugin setPluginsTo:[list pluginsForType:PSE_LT_CDR] withType: PSE_LT_CDR]; [netPlugin setPluginsTo:[list pluginsForType:PSE_LT_NET] withType: PSE_LT_NET]; - + + // Setup hotkey view + [hkController initialize]; } - (void)dealloc @@ -258,4 +260,15 @@ NSString *memChangeNotifier = @"PcsxrMemoryCardDidChangeNotifier"; } } +- (void)tabView:(NSTabView *)tabView didSelectTabViewItem:(NSTabViewItem *)tabViewItem +{ + NSWindow *window = [self window]; + if(tabViewItem == hkTab) { + [window makeFirstResponder:(NSView*)hkController]; + } + else if([window firstResponder] == (NSView*)hkController) { + [hkController resignFirstResponder]; + } +} + @end diff --git a/macosx/EmuThread.m b/macosx/EmuThread.m index 2c34bfa4..89a95ef9 100755 --- a/macosx/EmuThread.m +++ b/macosx/EmuThread.m @@ -29,7 +29,7 @@ static pthread_mutex_t eventMutex; #define EMUEVENT_RESET (1<<1) #define EMUEVENT_STOP (1<<2) -static NSString *ThreadInfo = @"PSX Emu Background thread"; +static NSString * const ThreadInfo = @"PSX Emu Background thread"; @implementation EmuThread @@ -380,8 +380,8 @@ done: GPU_freeze(2, (GPUFreeze_t *)&num); int ret = SaveState([path fileSystemRepresentation]); - if (ret == 0) sprintf (Text, _("*PCSXR*: Saved State %d"), num+1); - else sprintf (Text, _("*PCSXR*: Error Saving State %d"), num+1); + if (ret == 0) sprintf (Text, _("*PCSXR*: Saved State %d"), num); + else sprintf (Text, _("*PCSXR*: Error Saving State %d"), num); GPU_displayText(Text); if (!emuWasPaused) { diff --git a/macosx/English.lproj/Configuration.xib b/macosx/English.lproj/Configuration.xib index a1e6f40a..8a9178db 100644 --- a/macosx/English.lproj/Configuration.xib +++ b/macosx/English.lproj/Configuration.xib @@ -2,30 +2,30 @@ 1060 - 11E53 - 2182 - 1138.47 + 11G63 + 2844 + 1138.51 569.00 com.apple.InterfaceBuilder.CocoaPlugin - 2182 + 2844 - NSPopUpButton - NSMenuItem - NSMenu - NSButtonCell - NSButton - NSTextFieldCell NSBox - NSTabView - NSMatrix + NSButton + NSButtonCell NSCustomObject + NSMatrix + NSMenu + NSMenuItem + NSPopUpButton + NSPopUpButtonCell + NSTabView NSTabViewItem + NSTextField + NSTextFieldCell NSView NSWindowTemplate - NSPopUpButtonCell - NSTextField com.apple.InterfaceBuilder.CocoaPlugin @@ -67,13 +67,14 @@ {{13, 10}, {526, 344}} + 1 - + 256 @@ -89,7 +90,6 @@ 274 {{20, 41}, {135, 128}} - YES 6 @@ -308,7 +308,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 256 {{17, 9}, {137, 26}} - YES @@ -417,13 +416,11 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA {{2, 2}, {175, 179}} - {{17, 96}, {179, 196}} - {0, 0} @@ -439,7 +436,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 6 System textBackgroundColor - + 3 MQA @@ -468,7 +465,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 306 {{18, 16}, {238, 40}} - YES 2 @@ -535,13 +531,11 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA {{2, 2}, {273, 74}} - {{212, 201}, {277, 91}} - {0, 0} @@ -574,7 +568,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 256 {{18, 16}, {232, 40}} - + YES 2 1 @@ -675,13 +669,11 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA {{2, 2}, {273, 74}} - {{212, 96}, {277, 91}} - {0, 0} @@ -703,8 +695,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA {{10, 33}, {506, 298}} - - Emulation @@ -1696,14 +1686,300 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA + + 4 + + + 256 + + + + 268 + {{-3, 267}, {121, 32}} + + + + _NS:9 + 100 + YES + + 67108864 + 134217728 + Fast Forward + + _NS:9 + + 100 + -1232977920 + 129 + + + + 200 + 25 + + + + + 268 + {{120, 273}, {310, 22}} + + + + _NS:9 + YES + + -2075131840 + 272634880 + + + None... + _NS:9 + + YES + 1 + + 6 + System + headerColor + + + + 1 + MC4xNzQwOTY0ODI5IDAuMzI3ODI0MzQ2NSAwLjY1NzM3NTE2OTgAA + + + + + + 268 + {{-3, 236}, {121, 32}} + + + + _NS:9 + 101 + YES + + 67108864 + 134217728 + Save State + + _NS:9 + + 100 + -1232977920 + 129 + + + + 200 + 25 + + + + + 268 + {{120, 243}, {310, 22}} + + + + _NS:9 + YES + + -2075131840 + 272634880 + + + None... + _NS:9 + + YES + 1 + + + 1 + MC4xNzQwOTY0ODI5IDAuMzI3ODI0MzQ2NSAwLjY1NzM3NTE2OTgAA + + + + + + 268 + {{-3, 204}, {121, 32}} + + + + _NS:9 + 102 + YES + + 67108864 + 134217728 + Load State + + _NS:9 + + 100 + -1232977920 + 129 + + + + 200 + 25 + + + + + 268 + {{120, 211}, {310, 22}} + + + + _NS:9 + YES + + -2075131840 + 272634880 + + + None... + _NS:9 + + YES + 1 + + + 1 + MC4xNzQwOTY0ODI5IDAuMzI3ODI0MzQ2NSAwLjY1NzM3NTE2OTgAA + + + + + + 268 + {{-3, 172}, {121, 32}} + + + + _NS:9 + 103 + YES + + 67108864 + 134217728 + Next State + + _NS:9 + + 100 + -1232977920 + 129 + + + + 200 + 25 + + + + + 268 + {{120, 179}, {310, 22}} + + + + _NS:9 + YES + + -2075131840 + 272634880 + + + None... + _NS:9 + + YES + 1 + + + 1 + MC4xNzQwOTY0ODI5IDAuMzI3ODI0MzQ2NSAwLjY1NzM3NTE2OTgAA + + + + + + 268 + {{-3, 138}, {121, 32}} + + + + _NS:9 + 104 + YES + + 67108864 + 134217728 + Previous State + + _NS:9 + + 100 + -1232977920 + 129 + + + + 200 + 25 + + + + + 268 + {{120, 146}, {310, 22}} + + + + _NS:9 + YES + + -2075131840 + 272634880 + + + None... + _NS:9 + + YES + 1 + + + 1 + MC4xNzQwOTY0ODI5IDAuMzI3ODI0MzQ2NSAwLjY1NzM3NTE2OTgAA + + + + + {{10, 33}, {506, 298}} + + + + + Hotkeys + + + - + 0 YES YES - + @@ -1712,7 +1988,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA - {{0, 0}, {1680, 1028}} + {{0, 0}, {1440, 878}} {552, 382} {2000, 382} YES @@ -1999,6 +2275,22 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 654 + + + hkTab + + + + 781 + + + + hkController + + + + 832 + delegate @@ -2007,6 +2299,14 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 478 + + + delegate + + + + 780 + configureButton @@ -2247,6 +2547,86 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 639 + + + hotkeySet: + + + + 784 + + + + FastForward + + + + 849 + + + + hotkeySet: + + + + 854 + + + + hotkeySet: + + + + 857 + + + + hotkeySet: + + + + 863 + + + + hotkeySet: + + + + 869 + + + + SaveState + + + + 876 + + + + LoadState + + + + 877 + + + + NextState + + + + 878 + + + + PrevState + + + + 879 + @@ -2292,6 +2672,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA + @@ -3020,6 +3401,162 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA Widescreen + + 655 + + + + + + + + 656 + + + + + + + + + + + + + + + Hotkey View + + + 769 + + + + + + + + 770 + + + + + 771 + + + + + + + + 772 + + + + + 850 + + + + + + + + 851 + + + + + + + + 852 + + + + + 853 + + + + + 855 + + + + + + + + 856 + + + + + 861 + + + + + + + + 862 + + + + + 867 + + + + + + + + 868 + + + + + 870 + + + + + + + + 871 + + + + + 872 + + + + + + + + 873 + + + + + 874 + + + + + + + + 875 + + + @@ -3185,12 +3722,40 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + HotkeyController + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + FastForward + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + SaveState + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + LoadState + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + NextState + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + PrevState + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin - 654 + 879 @@ -3238,6 +3803,8 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA id id PluginController + HotkeyController + NSTabViewItem NSTextField NSTextField PluginController @@ -3280,6 +3847,14 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA graphicsPlugin PluginController + + hkController + HotkeyController + + + hkTab + NSTabViewItem + mcd1Label NSTextField @@ -3351,47 +3926,79 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA - NamedSlider - NSSlider + HotkeyController + NSView + + hotkeySet: + id + + + hotkeySet: + + hotkeySet: + id + + + + NSTextField + NSTextField + NSTextField + NSTextField + NSTextField + + + + FastForward + NSTextField + + + LoadState + NSTextField + + + NextState + NSTextField + + + PrevState + NSTextField + + + SaveState + NSTextField + + IBProjectSource - ./Classes/NamedSlider.h + ./Classes/HotkeyController.h PluginController - NSWindowController + NSObject - id - id - id + id + id + id - - cancel: + + doAbout: id - - ok: + + doConfigure: id - - reset: + + selectPlugin: id NSButton NSButton - NSControl - NamedSlider - NSControl - NSControl NSPopUpButton - NamedSlider - NamedSlider - NSControl - NSControl @@ -3402,42 +4009,10 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA configureButton NSButton - - hiCompBox - NSControl - - - interpolValue - NamedSlider - - - irqWaitBox - NSControl - - - monoSoundBox - NSControl - pluginMenu NSPopUpButton - - reverbValue - NamedSlider - - - volumeValue - NamedSlider - - - xaEnableBox - NSControl - - - xaSpeedBox - NSControl - IBProjectSource @@ -3452,10 +4027,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA com.apple.InterfaceBuilder.CocoaPlugin.macosx - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 diff --git a/macosx/English.lproj/Credits.rtf b/macosx/English.lproj/Credits.rtf index 04f82b37..c3ef8f25 100644 --- a/macosx/English.lproj/Credits.rtf +++ b/macosx/English.lproj/Credits.rtf @@ -1,4 +1,4 @@ -{\rtf1\ansi\ansicpg1252\cocoartf1187\cocoasubrtf340 +{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf510 {\fonttbl\f0\fswiss\fcharset0 Helvetica;} {\colortbl;\red255\green255\blue255;} \vieww10800\viewh8400\viewkind0 @@ -8,6 +8,7 @@ \b0 \ Gil Pedersen\ Madd the Sane\ + Nicolas P\'e9pin-Perreault\ \ \b Icon Design: diff --git a/macosx/English.lproj/InfoPlist.strings b/macosx/English.lproj/InfoPlist.strings index 13b0bca3..485a44d8 100644 --- a/macosx/English.lproj/InfoPlist.strings +++ b/macosx/English.lproj/InfoPlist.strings @@ -3,7 +3,7 @@ CFBundleName = "PCSXR"; CFBundleShortVersionString = "PCSX-Reloaded"; CFBundleGetInfoString = "PlayStation Emulator based on PCSX-df Project."; -NSHumanReadableCopyright = "Copyright (c) 2003-2005 PCSX Team, Gil Pedersen.\nCopyright (c) 2009-2011 PCSX-Reloaded Team."; +NSHumanReadableCopyright = "Copyright (c) 2003-2005 PCSX Team, Gil Pedersen, Nicolas Pepin-Perreault.\nCopyright (c) 2009-2011 PCSX-Reloaded Team."; "Playstation Emulator Plug-in" = "Playstation Emulator Plug-in"; "Playstation BIOS Image" = "Playstation BIOS Image"; "PCSXR Memory Card" = "PCSXR Memory Card"; diff --git a/macosx/English.lproj/KeyNames.plist b/macosx/English.lproj/KeyNames.plist new file mode 100644 index 00000000..bde23943 --- /dev/null +++ b/macosx/English.lproj/KeyNames.plist @@ -0,0 +1,202 @@ + + + + + 12 + Q + 13 + W + 14 + E + 15 + R + 17 + T + 16 + Y + 32 + U + 34 + I + 31 + O + 35 + P + 0 + A + 1 + S + 2 + D + 3 + F + 5 + G + 4 + H + 38 + J + 40 + K + 37 + L + 6 + Z + 7 + X + 8 + C + 9 + V + 11 + B + 45 + N + 46 + M + 18 + 1 + 19 + 2 + 20 + 3 + 21 + 4 + 23 + 5 + 22 + 6 + 26 + 7 + 28 + 8 + 25 + 9 + 29 + 0 + 122 + F1 + 120 + F2 + 99 + F3 + 118 + F4 + 96 + F5 + 97 + F6 + 98 + F7 + 100 + F8 + 101 + F9 + 109 + F10 + 103 + F11 + 111 + F12 + 105 + F13 + 107 + F14 + 113 + F15 + 106 + F16 + 64 + F17 + 79 + F18 + 80 + F19 + 50 + ` + 27 + - + 24 + = + 51 + Delete (Backspace) + 48 + Tab + 33 + [ + 30 + ] + 42 + \ + 41 + ; (Semicolon) + 39 + ' (Quote) + 36 + Return + 43 + , (Comma) + 47 + . (Period) + 44 + / + 49 + Space + 115 + Home + 119 + End + 116 + Page Up + 121 + Page Down + 117 + Forward Delete + 126 + Up Arrow + 125 + Down Arrow + 123 + Left Arrow + 124 + Right Arrow + 82 + NumPad 0 + 83 + NumPad 1 + 84 + NumPad 2 + 85 + NumPad 3 + 86 + NumPad 4 + 87 + NumPad 5 + 88 + NumPad 6 + 89 + NumPad 7 + 91 + NumPad 8 + 92 + NumPad 9 + 71 + NumPad Clear + 81 + NumPad = + 75 + NumPad / + 67 + NumPad * + 78 + NumPad - + 69 + NumPad + + 65 + NumPad . + 76 + NumPad Enter + 53 + Escape + + diff --git a/macosx/English.lproj/PCSXR.xib b/macosx/English.lproj/PCSXR.xib index 0f6743f8..3af0f7cb 100644 --- a/macosx/English.lproj/PCSXR.xib +++ b/macosx/English.lproj/PCSXR.xib @@ -2,19 +2,19 @@ 1060 - 11C74 - 1938 - 1138.23 - 567.00 + 11G63 + 2844 + 1138.51 + 569.00 com.apple.InterfaceBuilder.CocoaPlugin - 1938 + 2844 YES + NSCustomObject NSMenu NSMenuItem - NSCustomObject YES @@ -302,6 +302,15 @@ YES + + Slot 0 + 0 + 1048576 + 2147483647 + + + + Slot 1 1 @@ -368,6 +377,15 @@ YES + + Slot 0 + 0 + 1572864 + 2147483647 + + + + Slot 1 1 @@ -768,6 +786,22 @@ 319 + + + freeze: + + + + 321 + + + + defrost: + + + + 323 + @@ -1018,6 +1052,7 @@ + @@ -1070,6 +1105,7 @@ + @@ -1158,6 +1194,16 @@ + + 320 + + + + + 322 + + + @@ -1213,6 +1259,8 @@ 311.IBPluginDependency 312.IBPluginDependency 318.IBPluginDependency + 320.IBPluginDependency + 322.IBPluginDependency 5.IBPluginDependency 56.IBPluginDependency 57.IBPluginDependency @@ -1221,7 +1269,7 @@ 83.IBPluginDependency 92.IBPluginDependency - + YES com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -1279,6 +1327,8 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin @@ -1293,7 +1343,7 @@ - 319 + 323 @@ -1317,7 +1367,7 @@ runCD: runIso: - + YES id id @@ -1348,7 +1398,7 @@ runCD: runIso: - + YES defrost: @@ -1420,10 +1470,6 @@ com.apple.InterfaceBuilder.CocoaPlugin.macosx - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 @@ -1437,10 +1483,10 @@ NSMenuCheckmark NSMenuMixedState - + YES - {9, 8} - {7, 2} + {11, 11} + {10, 3} diff --git a/macosx/ExtendedKeys.h b/macosx/ExtendedKeys.h index 1b6475b8..24f54912 100644 --- a/macosx/ExtendedKeys.h +++ b/macosx/ExtendedKeys.h @@ -17,7 +17,11 @@ enum { PSX_STOP_KEY = 0xFF1B/*XK_Escape*/, GPU_FULLSCREEN_KEY = 0x0100, - GPU_FPS_DISPLAY_KEY = 0xFFFF/*XK_Delete*/ + GPU_FPS_DISPLAY_KEY = 0xFFFF,/*XK_Delete*/ + + // Fake HotKeys + GPU_HOTKEYS = 0x020, + GPU_FAST_FORWARD }; #endif //__EXTENDED_KEYS_H__ diff --git a/macosx/HotkeyController.h b/macosx/HotkeyController.h new file mode 100644 index 00000000..59492c79 --- /dev/null +++ b/macosx/HotkeyController.h @@ -0,0 +1,30 @@ +/** + * HotkeyController + * Nicolas Pépin-Perreault - npepinpe - 2012 + */ + +#import + +@interface HotkeyController : NSView +{ + NSButton *lastConfigButton; + NSInteger configInput; + NSMutableDictionary *hotkeysList; + NSDictionary *keyNameTable; + NSMutableDictionary *hotkeyOutlets; + + IBOutlet NSTextField *FastForward; + IBOutlet NSTextField *SaveState; + IBOutlet NSTextField *LoadState; + IBOutlet NSTextField *NextState; + IBOutlet NSTextField *PrevState; +} + +@property (assign) NSInteger configInput; + +- (void) initialize; +- (BOOL) handleMouseDown:(NSEvent *)mouseEvent; +- (IBAction) hotkeySet:(id)sender; +- (void) hotkeyCancel; + +@end diff --git a/macosx/HotkeyController.m b/macosx/HotkeyController.m new file mode 100644 index 00000000..65ec1055 --- /dev/null +++ b/macosx/HotkeyController.m @@ -0,0 +1,206 @@ +/** + * HotkeyController.m + * Pcsxr + * + * Created by Nicolas Pepin-Perreault on 12-12-10. + * + * Adapted from the Cocoa port of DeSMuMe + */ + +#import "HotkeyController.h" + +#define INPUT_HOLD_TIME 0.1 + +@implementation HotkeyController + +@synthesize configInput; + +- (void)initialize +{ + lastConfigButton = nil; + configInput = 0; + hotkeysList = [[NSMutableDictionary alloc] initWithCapacity:16]; + keyNameTable = [[NSDictionary alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"KeyNames" ofType:@"plist"]]; + hotkeyOutlets = [[NSMutableDictionary alloc] initWithCapacity:8]; + + [self mapOutletToIdentifier:FastForward forIdentifier:@"FastForward"]; + [self mapOutletToIdentifier:SaveState forIdentifier:@"SaveState"]; + [self mapOutletToIdentifier:LoadState forIdentifier:@"LoadState"]; + [self mapOutletToIdentifier:NextState forIdentifier:@"NextState"]; + [self mapOutletToIdentifier:PrevState forIdentifier:@"PrevState"]; +} + +- (void)dealloc +{ + [[NSNotificationCenter defaultCenter] removeObserver:self]; + + [hotkeysList release]; + [keyNameTable release]; + [hotkeyOutlets release]; + + [super dealloc]; +} + +- (void)mapOutletToIdentifier:(id)outlet forIdentifier:(NSString*)identifier +{ + [hotkeyOutlets setObject:outlet forKey:identifier]; + [self setHotkeyDisplay:identifier]; +} + +- (void)setHotkeyDisplay:(NSString*)keyIdent +{ + NSString *label = [self parseMappingDisplayString:keyIdent]; + NSTextField *displayField = [hotkeyOutlets objectForKey:keyIdent]; + + if(displayField) { + [[displayField cell] setStringValue:label]; + } +} + +- (void)mouseDown:(NSEvent *)theEvent +{ + BOOL isHandled = [self handleMouseDown:theEvent]; + if (!isHandled) + { + [super mouseDown:theEvent]; + } +} + +- (void)mouseDragged:(NSEvent *)theEvent +{ + [self mouseDown:theEvent]; +} + +- (void)rightMouseDown:(NSEvent *)theEvent +{ + BOOL isHandled = [self handleMouseDown:theEvent]; + if (!isHandled) + { + [super rightMouseDown:theEvent]; + } +} + +- (void)rightMouseDragged:(NSEvent *)theEvent +{ + [self rightMouseDown:theEvent]; +} + +- (void)otherMouseDown:(NSEvent *)theEvent +{ + BOOL isHandled = [self handleMouseDown:theEvent]; + if (!isHandled) + { + [super otherMouseDown:theEvent]; + } +} + +- (void)otherMouseDragged:(NSEvent *)theEvent +{ + [self otherMouseDown:theEvent]; +} + +- (BOOL) handleMouseDown:(NSEvent *)mouseEvent +{ + if (configInput != 0) + { + [self hotkeyCancel]; + } + + return YES; +} + + +- (void)keyDown:(NSEvent *)theEvent +{ + NSString *keyCode = [NSString stringWithFormat:@"%d", [theEvent keyCode]]; + NSString *keyLabel = (NSString *)[keyNameTable valueForKey:keyCode]; + + if (configInput != 0) + { + // Save input + NSString *ident = [lastConfigButton identifier]; + [self saveHotkey:ident device:@"NSEventKeyboard" deviceLabel:@"Keyboard" code:keyCode label:keyLabel]; + [self setHotkeyDisplay:ident]; + [self hotkeyCancel]; + } +} + +- (void)saveHotkey:(NSString*)keyIdent device:(NSString*)device deviceLabel:(NSString*)deviceLabel code:(NSString*)keyCode label:(NSString*)keyLabel +{ + NSMutableDictionary *tempUserMappings = [NSMutableDictionary dictionaryWithDictionary:[[NSUserDefaults standardUserDefaults] dictionaryForKey:@"HotkeyBindings"]]; + [tempUserMappings setValue:[[NSDictionary alloc] initWithObjectsAndKeys: + device, @"device", + deviceLabel, @"deviceName", + keyCode, @"keyCode", + keyLabel, @"keyLabel", + nil] forKey:keyIdent]; + [[NSUserDefaults standardUserDefaults] setValue:tempUserMappings forKey:@"HotkeyBindings"]; +} + +- (NSString *) parseMappingDisplayString:(NSString *)keyString +{ + NSDictionary *userMappings = [[NSUserDefaults standardUserDefaults] dictionaryForKey:@"HotkeyBindings"]; + NSDictionary *binding = (NSDictionary *)[userMappings valueForKey:keyString]; + + NSString *displayString = @""; + if(binding) { + NSString *deviceLabel = (NSString *)[binding valueForKey:@"deviceName"]; + NSString *keyLabel = (NSString *)[binding valueForKey:@"keyLabel"]; + + displayString = [NSString stringWithString:deviceLabel]; + displayString = [displayString stringByAppendingString:@": "]; + displayString = [displayString stringByAppendingString:keyLabel]; + } + + return displayString; +} + +- (IBAction) hotkeySet:(id)sender +{ + NSButton *theButton = (NSButton *)sender; + + if (configInput && lastConfigButton != theButton) + { + [lastConfigButton setState:NSOffState]; + } + + if ([theButton state] == NSOnState) + { + lastConfigButton = theButton; + [hotkeysList removeAllObjects]; + configInput = [theButton tag]; + } + else + { + [self hotkeyCancel]; + } + +} + +- (void) hotkeyCancel +{ + if (lastConfigButton != nil) + { + [lastConfigButton setState:NSOffState]; + lastConfigButton = nil; + } + + configInput = 0; +} + +- (BOOL)acceptsFirstResponder +{ + return YES; +} + +- (BOOL)becomeFirstResponder +{ + return YES; +} + +- (BOOL)resignFirstResponder +{ + return YES; +} + +@end diff --git a/macosx/Pcsxr.xcodeproj/project.pbxproj b/macosx/Pcsxr.xcodeproj/project.pbxproj index 7af155ed..55ed00f1 100644 --- a/macosx/Pcsxr.xcodeproj/project.pbxproj +++ b/macosx/Pcsxr.xcodeproj/project.pbxproj @@ -7,6 +7,9 @@ objects = { /* Begin PBXBuildFile section */ + 02717968167884C9004AED62 /* hotkeys.m in Sources */ = {isa = PBXBuildFile; fileRef = 02717967167884C9004AED62 /* hotkeys.m */; }; + 0280B7AD16764CC5007B8001 /* HotkeyController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0280B7AC16764CC3007B8001 /* HotkeyController.m */; }; + 02FE55E816765F9400205CF2 /* KeyNames.plist in Resources */ = {isa = PBXBuildFile; fileRef = 02FE55E616765F9400205CF2 /* KeyNames.plist */; }; 28F0C3C6146521A700A90285 /* Configuration.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28F0C3C4146521A700A90285 /* Configuration.xib */; }; 28F0C3C9146521B000A90285 /* PCSXR.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28F0C3C7146521B000A90285 /* PCSXR.xib */; }; 28F0C3CC146521B700A90285 /* AddPluginSheet.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28F0C3CA146521B700A90285 /* AddPluginSheet.xib */; }; @@ -221,6 +224,11 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 02717967167884C9004AED62 /* hotkeys.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = hotkeys.m; sourceTree = ""; }; + 02717969167884DF004AED62 /* hotkeys.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = hotkeys.h; sourceTree = ""; }; + 0280B7AB16764CC3007B8001 /* HotkeyController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HotkeyController.h; sourceTree = ""; }; + 0280B7AC16764CC3007B8001 /* HotkeyController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HotkeyController.m; sourceTree = ""; }; + 02FE55E716765F9400205CF2 /* English */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = English; path = KeyNames.plist; sourceTree = ""; }; 28F0C3C5146521A700A90285 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = Configuration.xib; sourceTree = ""; }; 28F0C3C8146521B000A90285 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = PCSXR.xib; sourceTree = ""; }; 28F0C3CB146521B700A90285 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = AddPluginSheet.xib; sourceTree = ""; }; @@ -249,7 +257,7 @@ 2BBB1127051DC00500B84448 /* PluginList.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = PluginList.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 2BBB1787051E0D9700B84448 /* English */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = English; path = Credits.rtf; sourceTree = ""; }; 2BBB1791051E113B00B84448 /* EmuThread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EmuThread.h; sourceTree = ""; }; - 2BBB1792051E113B00B84448 /* EmuThread.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 2; path = EmuThread.m; sourceTree = ""; }; + 2BBB1792051E113B00B84448 /* EmuThread.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = EmuThread.m; sourceTree = ""; }; 2BBB17DA051E4D0F00B84448 /* Plugin.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = Plugin.c; sourceTree = SOURCE_ROOT; }; 2BC4786204C7FD3600CAB520 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; 559366C012B694DF004ACC1E /* iGte.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = iGte.h; sourceTree = ""; }; @@ -415,6 +423,7 @@ 2BA178AD0514CE260026D74D /* Resources */ = { isa = PBXGroup; children = ( + 02FE55E616765F9400205CF2 /* KeyNames.plist */, 2BBB1786051E0D9700B84448 /* Credits.rtf */, 28F0C3C4146521A700A90285 /* Configuration.xib */, 2BA178B20514CE260026D74D /* InfoPlist.strings */, @@ -475,6 +484,10 @@ 55BBA69814953887003B2CEC /* PcsxrDiscHandler.m */, 55BBA69A14958399003B2CEC /* PcsxrFreezeStateHandler.h */, 55BBA69B1495839A003B2CEC /* PcsxrFreezeStateHandler.m */, + 0280B7AB16764CC3007B8001 /* HotkeyController.h */, + 0280B7AC16764CC3007B8001 /* HotkeyController.m */, + 02717967167884C9004AED62 /* hotkeys.m */, + 02717969167884DF004AED62 /* hotkeys.h */, ); name = MacOSX; sourceTree = ""; @@ -770,6 +783,7 @@ 559DACEE146C72FF00C5DF71 /* Localizable.strings in Resources */, 55A90223147D7C7A0037E18F /* MemCardManager.xib in Resources */, 55C7A214148B2B3800C22ABC /* PcsxrMemCardDocument.xib in Resources */, + 02FE55E816765F9400205CF2 /* KeyNames.plist in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -826,6 +840,8 @@ 55BBA69614945628003B2CEC /* PcsxrPluginHandler.m in Sources */, 55BBA69914953887003B2CEC /* PcsxrDiscHandler.m in Sources */, 55BBA69C1495839A003B2CEC /* PcsxrFreezeStateHandler.m in Sources */, + 0280B7AD16764CC5007B8001 /* HotkeyController.m in Sources */, + 02717968167884C9004AED62 /* hotkeys.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -870,6 +886,14 @@ /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ + 02FE55E616765F9400205CF2 /* KeyNames.plist */ = { + isa = PBXVariantGroup; + children = ( + 02FE55E716765F9400205CF2 /* English */, + ); + name = KeyNames.plist; + sourceTree = ""; + }; 28F0C3C4146521A700A90285 /* Configuration.xib */ = { isa = PBXVariantGroup; children = ( @@ -972,7 +996,7 @@ GCC_DYNAMIC_NO_PIC = YES; GCC_ENABLE_ASM_KEYWORD = YES; GCC_ENABLE_CPP_EXCEPTIONS = NO; - GCC_GENERATE_DEBUGGING_SYMBOLS = YES; + GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_OPTIMIZATION_LEVEL = s; GCC_PREPROCESSOR_DEFINITIONS = ( PCSXRCORE, diff --git a/macosx/PcsxrController.h b/macosx/PcsxrController.h index 8d5be9d7..b89587c0 100644 --- a/macosx/PcsxrController.h +++ b/macosx/PcsxrController.h @@ -31,5 +31,8 @@ + (void)setConfigFromDefaults; + (void)setDefaultFromConfig:(NSString *)defaultKey; + (BOOL)biosAvailable; ++ (NSString*)saveStatePath:(int)slot; ++ (void)saveState:(int)num; ++ (void)loadState:(int)num; @end diff --git a/macosx/PcsxrController.m b/macosx/PcsxrController.m index 20f4d93d..f23d7dfd 100644 --- a/macosx/PcsxrController.m +++ b/macosx/PcsxrController.m @@ -211,15 +211,23 @@ static NSString *HandleBinCue(NSString *toHandle) - (IBAction)freeze:(id)sender { NSInteger num = [sender tag]; - NSString *path = [saveStatePath stringByAppendingPathComponent:[NSString stringWithFormat:@"%s-%3.3ld.pcsxrstate", CdromId, (long)num]]; + [PcsxrController saveState:num]; +} - [EmuThread freezeAt:path which:num-1]; ++ (void)saveState:(int)num +{ + [EmuThread freezeAt:[PcsxrController saveStatePath:num] which:num]; } - (IBAction)defrost:(id)sender { - NSString *path = [saveStatePath stringByAppendingPathComponent:[NSString stringWithFormat:@"%s-%3.3ld.pcsxrstate", CdromId, (long)[sender tag]]]; - [EmuThread defrostAt:path]; + NSInteger num = [sender tag]; + [PcsxrController loadState:num]; +} + ++ (void)loadState:(int)num +{ + [EmuThread defrostAt:[PcsxrController saveStatePath:num]]; } - (IBAction)fullscreen:(id)sender @@ -532,6 +540,15 @@ static NSString *HandleBinCue(NSString *toHandle) [PcsxrController setConfigFromDefaults]; } ++ (NSString*)saveStatePath:(int)slot +{ + if(slot >= 0) { + return [saveStatePath stringByAppendingPathComponent:[NSString stringWithFormat:@"%s-%3.3ld.pcsxrstate", CdromId, (long)slot]]; + } + + return saveStatePath; +} + - (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename { NSError *err = nil; diff --git a/macosx/hotkeys.h b/macosx/hotkeys.h new file mode 100644 index 00000000..592ea0b7 --- /dev/null +++ b/macosx/hotkeys.h @@ -0,0 +1,15 @@ +// +// hotkeys.h +// Pcsxr +// +// Created by Nicolas Pepin-Perreault on 12-12-12. +// +// + +#ifndef Pcsxr_hotkeys_h +#define Pcsxr_hotkeys_h + +void attachHotkeys(); +void detachHotkeys(); + +#endif diff --git a/macosx/main.m b/macosx/main.m index 9cf60eb3..2508b21e 100644 --- a/macosx/main.m +++ b/macosx/main.m @@ -14,6 +14,7 @@ #include "psxcommon.h" #include "sio.h" #import +#import "hotkeys.h" static BOOL sysInited = NO; //#define EMU_LOG @@ -76,6 +77,8 @@ int SysInit() { if (success != kIOReturnSuccess) { NSLog(@"Unable to stop sleep, error code %d", success); } + + attachHotkeys(); return 0; } @@ -164,6 +167,7 @@ void SysClose() { if (emuLog != NULL) fclose(emuLog); sysInited = NO; + detachHotkeys(); } void OnFile_Exit() { diff --git a/macosx/plugins/DFInput/English.lproj/Credits.rtf b/macosx/plugins/DFInput/English.lproj/Credits.rtf index 1a837294..894a64cb 100644 --- a/macosx/plugins/DFInput/English.lproj/Credits.rtf +++ b/macosx/plugins/DFInput/English.lproj/Credits.rtf @@ -1,17 +1,18 @@ -{\rtf1\mac\ansicpg10025\cocoartf824\cocoasubrtf420 -{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fswiss\fcharset77 Helvetica;} +{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf510 +{\fonttbl\f0\fswiss\fcharset0 Helvetica;} {\colortbl;\red255\green255\blue255;} \vieww9000\viewh9000\viewkind0 -\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720 \f0\b\fs24 \cf0 Macintosh Port: -\f1\b0 \ +\b0 \ Wei Mingzhi\ Gil Pedersen\ + Nicolas P\'e9pin-Perreault\ \ -\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural -\f0\b \cf0 Original coder: -\f1\b0 \ -\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural +\b \cf0 Original coder: +\b0 \ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720 \cf0 Wei Mingzhi} \ No newline at end of file diff --git a/macosx/plugins/DFInput/English.lproj/NetPcsxrHIDInputPluginMain.xib b/macosx/plugins/DFInput/English.lproj/NetPcsxrHIDInputPluginMain.xib index e519f5e7..ccf49bd8 100644 --- a/macosx/plugins/DFInput/English.lproj/NetPcsxrHIDInputPluginMain.xib +++ b/macosx/plugins/DFInput/English.lproj/NetPcsxrHIDInputPluginMain.xib @@ -2,34 +2,34 @@ 1060 - 11C74 - 1938 - 1138.23 - 567.00 + 11G63 + 2844 + 1138.51 + 569.00 com.apple.InterfaceBuilder.CocoaPlugin - 1938 + 2844 - NSPopUpButtonCell - NSTextField - NSScroller - NSTableHeaderView NSButton - NSPopUpButton - NSScrollView NSButtonCell - NSTextFieldCell + NSCustomObject + NSCustomView NSMenu NSMenuItem - NSTableView + NSPopUpButton + NSPopUpButtonCell + NSScrollView + NSScroller NSTabView - NSCustomView NSTabViewItem + NSTableColumn + NSTableHeaderView + NSTableView + NSTextField + NSTextFieldCell NSView NSWindowTemplate - NSTableColumn - NSCustomObject com.apple.InterfaceBuilder.CocoaPlugin @@ -69,7 +69,6 @@ 274 {{13, 40}, {437, 378}} - pad1 @@ -82,14 +81,12 @@ 274 {417, 332} - NSView NSResponder {{10, 33}, {417, 332}} - Controller 1 @@ -143,7 +140,6 @@ 289 {{328, 12}, {121, 32}} - YES 67239424 @@ -165,7 +161,6 @@ 289 {{207, 12}, {121, 32}} - YES 67239424 @@ -187,7 +182,6 @@ {463, 424} - {{0, 0}, {1440, 878}} {310, 182} @@ -200,7 +194,7 @@ - 274 + 314 @@ -209,7 +203,7 @@ 256 - {375, 233} + {366, 233} 1 @@ -217,21 +211,23 @@ 256 - {375, 17} + {366, 17} - - + + 256 - {{361, 0}, {16, 17}} + {{367, 0}, {16, 17}} + + key - 76 - 76 + 120 + 100 1000 75628096 @@ -276,7 +272,7 @@ button - 292.96499633789062 + 239.96499633789062 46.965000152587891 1000 @@ -320,7 +316,7 @@ 14 - 851443712 + 1925185536 1 @@ -332,7 +328,7 @@ 1 - {{1, 17}, {375, 233}} + {{1, 17}, {366, 233}} @@ -348,7 +344,7 @@ 256 - {{361, 17}, {15, 233}} + {{367, 17}, {15, 233}} @@ -372,7 +368,7 @@ - {{1, 0}, {375, 17}} + {{1, 0}, {366, 17}} @@ -380,8 +376,9 @@ 4 + - {{20, 42}, {377, 251}} + {{20, 42}, {383, 251}} @@ -390,12 +387,13 @@ + QSAAAEEgAABBgAAAQYAAAA - 289 - {{295, 297}, {105, 22}} + 303 + {{301, 297}, {105, 22}} 2 @@ -464,8 +462,8 @@ - 291 - {{259, 302}, {34, 14}} + 303 + {{265, 302}, {34, 14}} YES @@ -481,8 +479,8 @@ - 256 - {{17, 20}, {383, 14}} + 303 + {{23, 20}, {383, 14}} YES @@ -501,8 +499,8 @@ - 256 - {{62, 297}, {195, 22}} + 303 + {{68, 297}, {195, 22}} 1 @@ -550,8 +548,8 @@ - 256 - {{17, 299}, {43, 17}} + 303 + {{20, 299}, {48, 19}} YES @@ -566,7 +564,7 @@ - {417, 336} + {423, 336} NetPcsxrHIDInputPluginPadView @@ -1034,6 +1032,14 @@ + + NetPcsxrHIDInputPluginMappingCell + NSTextFieldCell + + IBProjectSource + ./Classes/NetPcsxrHIDInputPluginMappingCell.h + + NetPcsxrHIDInputPluginPadController NSWindowController @@ -1058,15 +1064,11 @@ com.apple.InterfaceBuilder.CocoaPlugin.macosx - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - YES 3 - {9, 8} - {7, 2} + {11, 11} + {10, 3} diff --git a/macosx/plugins/DFXVideo/PeopsSoftGPU.xcodeproj/project.pbxproj b/macosx/plugins/DFXVideo/PeopsSoftGPU.xcodeproj/project.pbxproj index 794a2cc9..387d04cc 100644 --- a/macosx/plugins/DFXVideo/PeopsSoftGPU.xcodeproj/project.pbxproj +++ b/macosx/plugins/DFXVideo/PeopsSoftGPU.xcodeproj/project.pbxproj @@ -31,6 +31,7 @@ /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + 0271796B1678A767004AED62 /* ExtendedKeys.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ExtendedKeys.h; path = ../../ExtendedKeys.h; sourceTree = ""; }; 28586CC814651E9B0082B8EC /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/NetSfPeopsSoftGPUConfig.xib; sourceTree = ""; }; 28586CCA14651EAB0082B8EC /* NetSfPeopsSoftGPUInterface.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = NetSfPeopsSoftGPUInterface.xib; sourceTree = ""; }; 2B038C06069183300082466B /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; @@ -39,7 +40,6 @@ 2B3E5DF0062B36FB001D796E /* PluginWindowController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = PluginWindowController.h; path = macsrc/PluginWindowController.h; sourceTree = SOURCE_ROOT; }; 2B3E5DF1062B36FB001D796E /* PluginWindowController.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = PluginWindowController.m; path = macsrc/PluginWindowController.m; sourceTree = SOURCE_ROOT; }; 2B51949E06B3D2D200744730 /* GLUT.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLUT.framework; path = /System/Library/Frameworks/GLUT.framework; sourceTree = ""; }; - 2B57868106BE7B3700BBA288 /* ExtendedKeys.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ExtendedKeys.h; path = macsrc/ExtendedKeys.h; sourceTree = SOURCE_ROOT; }; 2B957EAE0635DFE400543905 /* PluginWindow.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = PluginWindow.h; path = macsrc/PluginWindow.h; sourceTree = SOURCE_ROOT; }; 2B957EAF0635DFE400543905 /* PluginWindow.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = PluginWindow.m; path = macsrc/PluginWindow.m; sourceTree = SOURCE_ROOT; }; 2B959E4306342D32000F2A2D /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = ""; }; @@ -118,6 +118,7 @@ 2BD2E2F40779F50B00657C69 /* macsrc */ = { isa = PBXGroup; children = ( + 0271796B1678A767004AED62 /* ExtendedKeys.h */, 2BB260A60777462E00F6854C /* PluginConfigController.h */, 2BB260A70777462E00F6854C /* PluginConfigController.m */, 2B3E5DF0062B36FB001D796E /* PluginWindowController.h */, @@ -127,7 +128,6 @@ 2BAF4FC90632967A00DB9A16 /* PluginGLView.h */, 2BAF4FCA0632967A00DB9A16 /* PluginGLView.m */, 2B3E5D64062B2CC1001D796E /* drawgl.m */, - 2B57868106BE7B3700BBA288 /* ExtendedKeys.h */, 5555E0CA160695BF00C0A310 /* SGPUPreferences.h */, ); name = macsrc; diff --git a/macosx/plugins/DFXVideo/macsrc/ExtendedKeys.h b/macosx/plugins/DFXVideo/macsrc/ExtendedKeys.h index 1b6475b8..24f54912 100644 --- a/macosx/plugins/DFXVideo/macsrc/ExtendedKeys.h +++ b/macosx/plugins/DFXVideo/macsrc/ExtendedKeys.h @@ -17,7 +17,11 @@ enum { PSX_STOP_KEY = 0xFF1B/*XK_Escape*/, GPU_FULLSCREEN_KEY = 0x0100, - GPU_FPS_DISPLAY_KEY = 0xFFFF/*XK_Delete*/ + GPU_FPS_DISPLAY_KEY = 0xFFFF,/*XK_Delete*/ + + // Fake HotKeys + GPU_HOTKEYS = 0x020, + GPU_FAST_FORWARD }; #endif //__EXTENDED_KEYS_H__ diff --git a/macosx/plugins/DFXVideo/macsrc/drawgl.m b/macosx/plugins/DFXVideo/macsrc/drawgl.m index 18d3762a..be679143 100644 --- a/macosx/plugins/DFXVideo/macsrc/drawgl.m +++ b/macosx/plugins/DFXVideo/macsrc/drawgl.m @@ -175,6 +175,9 @@ void ShowTextGpuPic(void) void HandleKey(int keycode) { switch (keycode) { + case GPU_FAST_FORWARD: + UseFrameLimit ^= 1; + break; case GPU_FULLSCREEN_KEY: [gameController setFullscreen:![gameController fullscreen]]; break; diff --git a/macosx/plugins/PeopsXgl/PeopsXGL.xcodeproj/project.pbxproj b/macosx/plugins/PeopsXgl/PeopsXGL.xcodeproj/project.pbxproj index 7b38805f..20926fce 100644 --- a/macosx/plugins/PeopsXgl/PeopsXGL.xcodeproj/project.pbxproj +++ b/macosx/plugins/PeopsXgl/PeopsXGL.xcodeproj/project.pbxproj @@ -31,6 +31,7 @@ /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + 0271796D1678A778004AED62 /* ExtendedKeys.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ExtendedKeys.h; path = ../../ExtendedKeys.h; sourceTree = ""; }; 28586CBD14651D960082B8EC /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = plugins/PeopsXgl/English.lproj/NetSfPeopsOpenGLConfig.xib; sourceTree = ""; }; 28586CBF14651E560082B8EC /* NetSfPeopsOpenGLGPUInterface.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = NetSfPeopsOpenGLGPUInterface.xib; sourceTree = ""; }; 2B038C06069183300082466B /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; @@ -40,7 +41,6 @@ 2BAF50930632BB1A00DB9A16 /* PeopsXGL.psxplugin */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PeopsXGL.psxplugin; sourceTree = BUILT_PRODUCTS_DIR; }; 2BD2E768077AF53E00657C69 /* English */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = English; path = English.lproj/Credits.rtf; sourceTree = ""; }; 3F31AF6A1302D4B600CBB551 /* drawgl.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = drawgl.m; path = macsrc/drawgl.m; sourceTree = SOURCE_ROOT; }; - 3F31AF6B1302D4B600CBB551 /* ExtendedKeys.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ExtendedKeys.h; path = macsrc/ExtendedKeys.h; sourceTree = SOURCE_ROOT; }; 3F31AF6E1302D4B600CBB551 /* PluginGLView.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = PluginGLView.h; path = macsrc/PluginGLView.h; sourceTree = SOURCE_ROOT; }; 3F31AF6F1302D4B600CBB551 /* PluginGLView.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = PluginGLView.m; path = macsrc/PluginGLView.m; sourceTree = SOURCE_ROOT; }; 3F31AF701302D4B600CBB551 /* PluginWindow.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = PluginWindow.h; path = macsrc/PluginWindow.h; sourceTree = SOURCE_ROOT; }; @@ -119,11 +119,11 @@ 2BD2E2F40779F50B00657C69 /* macsrc */ = { isa = PBXGroup; children = ( + 0271796D1678A778004AED62 /* ExtendedKeys.h */, 3F7F38021307999800556C34 /* NetSfPeopsOpenGLPluginConfigController.h */, 3F7F38031307999800556C34 /* NetSfPeopsOpenGLPluginConfigController.m */, 55F36E4A146C9F9900718DE6 /* drawgl.h */, 3F31AF6A1302D4B600CBB551 /* drawgl.m */, - 3F31AF6B1302D4B600CBB551 /* ExtendedKeys.h */, 3F31AF6E1302D4B600CBB551 /* PluginGLView.h */, 3F31AF6F1302D4B600CBB551 /* PluginGLView.m */, 3F31AF701302D4B600CBB551 /* PluginWindow.h */, @@ -305,7 +305,7 @@ COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; - GCC_OPTIMIZATION_LEVEL = 1; + GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = NO; GCC_PREPROCESSOR_DEFINITIONS = ( "PCSXRPLUG=PeopsXGL", diff --git a/macosx/plugins/PeopsXgl/macsrc/ExtendedKeys.h b/macosx/plugins/PeopsXgl/macsrc/ExtendedKeys.h index 1b6475b8..24f54912 100644 --- a/macosx/plugins/PeopsXgl/macsrc/ExtendedKeys.h +++ b/macosx/plugins/PeopsXgl/macsrc/ExtendedKeys.h @@ -17,7 +17,11 @@ enum { PSX_STOP_KEY = 0xFF1B/*XK_Escape*/, GPU_FULLSCREEN_KEY = 0x0100, - GPU_FPS_DISPLAY_KEY = 0xFFFF/*XK_Delete*/ + GPU_FPS_DISPLAY_KEY = 0xFFFF,/*XK_Delete*/ + + // Fake HotKeys + GPU_HOTKEYS = 0x020, + GPU_FAST_FORWARD }; #endif //__EXTENDED_KEYS_H__ diff --git a/macosx/plugins/PeopsXgl/macsrc/drawgl.m b/macosx/plugins/PeopsXgl/macsrc/drawgl.m index dcf9e675..5a75efab 100644 --- a/macosx/plugins/PeopsXgl/macsrc/drawgl.m +++ b/macosx/plugins/PeopsXgl/macsrc/drawgl.m @@ -233,6 +233,9 @@ void ShowTextGpuPic(void) void HandleKey(int keycode) { switch (keycode) { + case GPU_FAST_FORWARD: + bUseFrameLimit = !bUseFrameLimit; + break; case GPU_FULLSCREEN_KEY: [gameController setFullscreen:![gameController fullscreen]]; break; -- cgit v1.2.3