diff --git a/desmume/src/cocoa/DefaultUserPrefs.plist b/desmume/src/cocoa/DefaultUserPrefs.plist index 6de956719..9c0a0db5b 100644 --- a/desmume/src/cocoa/DefaultUserPrefs.plist +++ b/desmume/src/cocoa/DefaultUserPrefs.plist @@ -64,6 +64,10 @@ 12 Emulation_RigorousTiming + Emulation_StylusPressure + 50 + Emulation_StylusEnableJitter + Emulation_UseDebugConsole Emulation_UseExternalBIOSImages diff --git a/desmume/src/cocoa/cocoa_input.h b/desmume/src/cocoa/cocoa_input.h index 5021d1528..8a8652277 100644 --- a/desmume/src/cocoa/cocoa_input.h +++ b/desmume/src/cocoa/cocoa_input.h @@ -91,21 +91,26 @@ typedef struct @interface CocoaDSController : NSObject { id delegate; - float micLevel; + + NDSInput ndsInput[DSControllerState_StatesCount]; BOOL autohold; - BOOL hardwareMicMute; BOOL _isAutoholdCleared; + + NSPoint touchLocation; + NSInteger paddleAdjust; + NSInteger stylusPressure; + BOOL stylusEnableJitter; + + float micLevel; + BOOL hardwareMicMute; BOOL _useHardwareMic; size_t _availableMicSamples; std::vector *_hwMicLevelList; NSInteger micMode; - NSPoint touchLocation; - NDSInput ndsInput[DSControllerState_StatesCount]; AudioSampleBlockGenerator *selectedAudioFileGenerator; CoreAudioInput *CAInputDevice; AudioGenerator *softwareMicSampleGenerator; - NSInteger paddleAdjust; NSString *hardwareMicInfoString; NSString *hardwareMicNameString; @@ -117,6 +122,9 @@ typedef struct @property (retain) id delegate; @property (assign) BOOL autohold; +@property (assign) NSInteger paddleAdjust; +@property (assign) NSInteger stylusPressure; +@property (assign) BOOL stylusEnableJitter; @property (readonly) BOOL isHardwareMicAvailable; @property (readonly) BOOL isHardwareMicIdle; @property (readonly) BOOL isHardwareMicInClip; @@ -132,7 +140,6 @@ typedef struct @property (readonly) CoreAudioInput *CAInputDevice; @property (readonly) AudioGenerator *softwareMicSampleGenerator; @property (assign) AudioSampleBlockGenerator *selectedAudioFileGenerator; -@property (assign) NSInteger paddleAdjust; @property (retain) NSString *hardwareMicInfoString; @property (retain) NSString *hardwareMicNameString; @property (retain) NSString *hardwareMicManufacturerString; diff --git a/desmume/src/cocoa/cocoa_input.mm b/desmume/src/cocoa/cocoa_input.mm index 89548d02a..895eb7edf 100644 --- a/desmume/src/cocoa/cocoa_input.mm +++ b/desmume/src/cocoa/cocoa_input.mm @@ -35,6 +35,10 @@ SineWaveGenerator sineWaveGenerator(250.0, MIC_SAMPLE_RATE); @implementation CocoaDSController @synthesize delegate; +@dynamic autohold; +@synthesize paddleAdjust; +@synthesize stylusPressure; +@synthesize stylusEnableJitter; @dynamic isHardwareMicAvailable; @dynamic isHardwareMicIdle; @dynamic isHardwareMicInClip; @@ -46,12 +50,10 @@ SineWaveGenerator sineWaveGenerator(250.0, MIC_SAMPLE_RATE); @dynamic hardwareMicPause; @dynamic softwareMicState; @dynamic softwareMicMode; -@dynamic autohold; @synthesize micMode; @synthesize CAInputDevice; @synthesize softwareMicSampleGenerator; @synthesize selectedAudioFileGenerator; -@synthesize paddleAdjust; @synthesize hardwareMicInfoString; @synthesize hardwareMicNameString; @synthesize hardwareMicManufacturerString; @@ -343,6 +345,9 @@ SineWaveGenerator sineWaveGenerator(250.0, MIC_SAMPLE_RATE); flushedStates[DSControllerState_Lid]); // Setup the DS touch pad. + CommonSettings.StylusPressure = (int)[self stylusPressure]; + CommonSettings.StylusJitter = ([self stylusEnableJitter]) ? true : false; + if (isTouchDown) { NDS_setTouchPos((u16)theLocation.x, (u16)theLocation.y); diff --git a/desmume/src/cocoa/translations/English.lproj/MainMenu.strings b/desmume/src/cocoa/translations/English.lproj/MainMenu.strings index 3b88fb428..b5170efba 100644 Binary files a/desmume/src/cocoa/translations/English.lproj/MainMenu.strings and b/desmume/src/cocoa/translations/English.lproj/MainMenu.strings differ diff --git a/desmume/src/cocoa/translations/English.lproj/MainMenu.xib b/desmume/src/cocoa/translations/English.lproj/MainMenu.xib index f648350fe..3f801579b 100644 --- a/desmume/src/cocoa/translations/English.lproj/MainMenu.xib +++ b/desmume/src/cocoa/translations/English.lproj/MainMenu.xib @@ -769,6 +769,14 @@ + + + Show Stylus Settings... + + 2147483647 + + + YES @@ -3756,7 +3764,6 @@ L3d3dy5hZHZhbnNjZW5lLmNvbS9vZmZsaW5lL2RhdGFzL0FEVkFOc0NFbmVfUlRvb2xEUy56aXA {{13, 10}, {463, 412}} - 1 @@ -6456,7 +6463,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 public.item - {{13, 10}, {528, 388}} + {{13, 10}, {528, 423}} @@ -6528,7 +6535,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 - {{6, 248}, {496, 74}} + {{6, 303}, {496, 74}} {0, 0} @@ -6880,7 +6887,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 268 {{371, 10}, {19, 27}} - + YES 67895328 @@ -6901,7 +6908,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 - {{6, 166}, {496, 78}} + {{6, 221}, {496, 78}} {0, 0} @@ -6919,6 +6926,294 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 2 NO + + + 12 + + + + 274 + + + + 268 + {{337, 17}, {141, 18}} + + + _NS:9 + YES + + 67108864 + 268435456 + Enable Stylus Jitter + + _NS:9 + + 1211912448 + 2 + + + + + 200 + 25 + + NO + + + + 268 + {{16, 14}, {66, 17}} + + + _NS:526 + {251, 750} + YES + + 68157504 + 272630784 + Pressure: + + _NS:526 + + + + + NO + 1 + + + + 268 + {{86, 12}, {176, 26}} + + + _NS:9 + YES + + -2080112384 + 0 + + _NS:9 + + 100 + 0.0 + 50 + 0.0 + 11 + 1 + NO + NO + + NO + + + + 268 + {{266, 14}, {52, 17}} + + + _NS:526 + {251, 750} + YES + + 68157504 + 272630784 + + + + + + + -∞ + % + + +∞ + % + + #'%' + #'%' + + + + + + + + NaN + + + + + + 3 + YES + YES + YES + + . + , + NO + NO + NO + + u%% + _NS:526 + + + + + NO + 1 + + + + 268 + {{83, 36}, {26, 14}} + + + _NS:526 + {251, 750} + YES + + 68157504 + 138544128 + 0 + + _NS:526 + + + + + NO + 1 + + + + 268 + {{161, 36}, {26, 14}} + + + _NS:526 + {251, 750} + YES + + 68157504 + 138544128 + 50 + + _NS:526 + + + + + NO + 1 + + + + 268 + {{236, 36}, {31, 14}} + + + _NS:526 + {251, 750} + YES + + 68157504 + 138544128 + 100 + + _NS:526 + + + + + NO + 1 + + + {{1, 1}, {494, 60}} + + + _NS:11 + + + {{6, 141}, {496, 76}} + + + _NS:9 + {0, 0} + + 67108864 + 0 + Stylus Configuration + + + + + + 1 + 0 + 2 + NO + + + + 12 + + + + 274 + + + + 268 + {{16, 12}, {462, 18}} + + + YES + + -2080374784 + 0 + Use ADVANsCEne Database when auto-detecting the ROM save type + + + 1211912448 + 2 + + + + + 200 + 25 + + NO + + + {{1, 1}, {494, 38}} + + + + + {{6, 83}, {496, 54}} + + + {0, 0} + + 67108864 + 0 + ROM Save Configuration + + + + + + 1 + 0 + 2 + NO + 12 @@ -6956,7 +7251,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 268 {{16, 12}, {118, 18}} - YES 67108864 @@ -6981,7 +7275,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 - {{6, 88}, {496, 74}} + {{6, 5}, {496, 74}} {0, 0} @@ -6999,64 +7293,8 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 2 NO - - - 12 - - - - 274 - - - - 268 - {{16, 12}, {462, 18}} - - - YES - - -2080374784 - 0 - Use ADVANsCEne Database when auto-detecting the ROM save type - - - 1211912448 - 2 - - - - - 200 - 25 - - NO - - - {{1, 1}, {494, 38}} - - - - - {{6, 30}, {496, 54}} - - - {0, 0} - - 67108864 - 0 - ROM Save Configuration - - - - - - 1 - 0 - 2 - NO - - {{10, 33}, {508, 342}} + {{10, 33}, {508, 377}} @@ -7280,7 +7518,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 - {{6, 166}, {496, 159}} + {{6, 198}, {496, 159}} {0, 0} @@ -7444,7 +7682,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 - {{6, 27}, {496, 135}} + {{6, 59}, {496, 135}} {0, 0} @@ -7463,7 +7701,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 NO - {{10, 33}, {508, 342}} + {{10, 33}, {508, 374}} BIOS and Firmware @@ -7813,7 +8051,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 - {{101, 63}, {312, 153}} + {{101, 95}, {312, 153}} {0, 0} @@ -7834,7 +8072,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 268 - {{244, 315}, {169, 26}} + {{244, 347}, {169, 26}} YES @@ -7901,7 +8139,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 268 - {{74, 321}, {168, 17}} + {{74, 353}, {168, 17}} YES @@ -8003,7 +8241,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 - {{101, 220}, {312, 93}} + {{101, 252}, {312, 93}} {0, 0} @@ -8059,7 +8297,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 - {{101, 5}, {312, 54}} + {{101, 37}, {312, 54}} {0, 0} @@ -8078,7 +8316,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 NO - {{10, 33}, {508, 342}} + {{10, 33}, {508, 374}} 3D Rendering @@ -8096,7 +8334,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 - {554, 412} + {554, 447} NSView @@ -21621,6 +21859,251 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 3DRenderingSettingsPanel YES + + 279 + 2 + {{196, 132}, {254, 112}} + -461896704 + Stylus Settings + NSPanel + + + + + 256 + + + + 268 + {{64, 43}, {125, 20}} + + + _NS:9 + YES + + 67108864 + 268566528 + Enable Stylus Jitter + + _NS:9 + + 1211912448 + 2 + + + + + 200 + 25 + + NO + + + + 268 + {{18, 74}, {54, 14}} + + + _NS:526 + {251, 750} + YES + + 68157504 + 272761856 + Pressure: + + _NS:526 + + + + + NO + 1 + + + + 268 + {{46, 19}, {162, 19}} + + YES + + -2080374784 + 134217728 + Save Settings as Default + + YES + 12 + 787 + + + -2038153216 + 164 + + + 400 + 75 + + NO + + + + 268 + {{76, 66}, {110, 26}} + + + _NS:9 + YES + + -2080112384 + 0 + + _NS:9 + + 100 + 0.0 + 50 + 0.0 + 11 + 1 + NO + NO + + NO + + + + 268 + {{190, 69}, {46, 14}} + + + _NS:526 + {251, 750} + YES + + 68157504 + 272761856 + + + + + + + -∞ + % + + +∞ + % + + #'%' + #'%' + + + + + + + + NaN + + + + + + 3 + YES + YES + YES + + . + , + NO + NO + NO + + u%% + _NS:526 + + + + + NO + 1 + + + + 268 + {{73, 91}, {26, 11}} + + + _NS:526 + {251, 750} + YES + + 68157504 + 138675200 + 0 + + _NS:526 + + + + + NO + 1 + + + + 268 + {{118, 91}, {26, 11}} + + + _NS:526 + {251, 750} + YES + + 68157504 + 138675200 + 50 + + _NS:526 + + + + + NO + 1 + + + + 268 + {{163, 91}, {26, 11}} + + + _NS:526 + {251, 750} + YES + + 68157504 + 138675200 + 100 + + _NS:526 + + + + + NO + 1 + + + {254, 112} + + _NS:21 + + {{0, 0}, {1920, 1177}} + StylusSettingsPanel + YES + 279 2 @@ -35058,6 +35541,14 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 10019 + + + writeDefaultsStylusSettings: + + + + 10078 + content @@ -39214,6 +39705,110 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 10008 + + + makeKeyAndOrderFront: + + + + 10048 + + + + value: selection.cdsController.stylusEnableJitter + + + + + + value: selection.cdsController.stylusEnableJitter + value + selection.cdsController.stylusEnableJitter + 2 + + + 10059 + + + + value: selection.cdsController.stylusPressure + + + + + + value: selection.cdsController.stylusPressure + value + selection.cdsController.stylusPressure + 2 + + + 10066 + + + + value: selection.cdsController.stylusPressure + + + + + + value: selection.cdsController.stylusPressure + value + selection.cdsController.stylusPressure + 2 + + + 10071 + + + + value: values.Emulation_StylusEnableJitter + + + + + + value: values.Emulation_StylusEnableJitter + value + values.Emulation_StylusEnableJitter + 2 + + + 10102 + + + + value: values.Emulation_StylusPressure + + + + + + value: values.Emulation_StylusPressure + value + values.Emulation_StylusPressure + 2 + + + 10099 + + + + value: values.Emulation_StylusPressure + + + + + + value: values.Emulation_StylusPressure + value + values.Emulation_StylusPressure + 2 + + + 10107 + @@ -39558,6 +40153,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 + @@ -47858,8 +48454,9 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 - + + @@ -48205,41 +48802,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 - - 2344 - - - - - - - - - 2369 - - - - - - - - 2367 - - - - - - - - 2368 - - - - - 2370 - - - 5186 @@ -52823,6 +53385,295 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 + + 10036 + + + + + + Stylus Settings + + + 10037 + + + + + + + + + + + + + + + 10038 + + + + + + + + 10039 + + + + + 10043 + + + + + + + + 10044 + + + + + 10047 + + + + + 10060 + + + + + + + + 10061 + + + + + 10063 + + + + + + + + 10064 + + + + + 10067 + + + + + + + + 10068 + + + + + + + + 10069 + + + + + 10072 + + + + + + + + 10073 + + + + + 10074 + + + + + + + + 10075 + + + + + 10076 + + + + + + + + 10077 + + + + + 10079 + + + + + + + + + + + + + + 10080 + + + + + + + + 10081 + + + + + + + + 10082 + + + + + + + + 10083 + + + + + + + + 10084 + + + + + + + + 10085 + + + + + + + + 10086 + + + + + + + + 10087 + + + + + 10088 + + + + + 10089 + + + + + 10090 + + + + + + + + 10091 + + + + + 10092 + + + + + 10093 + + + + + 10094 + + + + + 2344 + + + + + + + + + 2369 + + + + + + + + 2367 + + + + + + + + 2368 + + + + + 2370 + + + @@ -52848,6 +53699,92 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + {87, 599} + com.apple.InterfaceBuilder.CocoaPlugin + + + com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + Enabling this setting will cause periodic adjustments to the touch location of the stylus, simulating human hand jitter. Some games may require this setting enabled to work properly. However, TAS recording will be less accurate. + + + 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 + + ToolTip + + ToolTip + + Adjusts the pressure of the NDS stylus upon the touch screen, where 0% is the lightest pressure and 100% is the heaviest pressure. This setting can be useful for certain homebrew ROMs. + + + 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 + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + Enabling this setting will cause periodic adjustments to the touch location of the stylus by default, simulating human hand jitter. Some games may require this setting enabled to work properly. However, TAS recording will be less accurate. + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + + + + ToolTip + + ToolTip + + Adjusts the pressure of the NDS stylus upon the touch screen by default, where 0% is the lightest pressure and 100% is the heaviest pressure. This setting can be useful for certain homebrew ROMs. + + + 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 + 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 com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -53096,7 +54033,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 com.apple.InterfaceBuilder.CocoaPlugin - {225, 911} + {225, 928.5} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin Emulation @@ -53406,7 +54343,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {492, 305.5} + {50, 735.5} com.apple.InterfaceBuilder.CocoaPlugin {{942, 249}, {288, 511}} @@ -53558,7 +54495,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {990.5, 1116.5} + {153.5, 729.5} com.apple.InterfaceBuilder.CocoaPlugin {{84, 481}, {301, 467}} @@ -56078,7 +57015,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 - 10035 + 10107 @@ -56909,6 +57846,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 id id id + id @@ -57107,6 +58045,10 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 writeDefaultsSoundSettings: id + + writeDefaultsStylusSettings: + id + NSObjectController @@ -57260,6 +58202,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 id id id + id @@ -57462,6 +58405,10 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 writeDefaultsSoundSettings: id + + writeDefaultsStylusSettings: + id + IBProjectSource diff --git a/desmume/src/cocoa/userinterface/EmuControllerDelegate.h b/desmume/src/cocoa/userinterface/EmuControllerDelegate.h index d9b80569e..fde764f22 100644 --- a/desmume/src/cocoa/userinterface/EmuControllerDelegate.h +++ b/desmume/src/cocoa/userinterface/EmuControllerDelegate.h @@ -231,6 +231,7 @@ class AudioSampleBlockGenerator; - (IBAction) writeDefaultsEmulationSettings:(id)sender; - (IBAction) writeDefaultsSlot1Settings:(id)sender; - (IBAction) writeDefaultsSoundSettings:(id)sender; +- (IBAction) writeDefaultsStylusSettings:(id)sender; - (IBAction) closeSheet:(id)sender; diff --git a/desmume/src/cocoa/userinterface/EmuControllerDelegate.mm b/desmume/src/cocoa/userinterface/EmuControllerDelegate.mm index 0a2c4946d..d40f6fccc 100644 --- a/desmume/src/cocoa/userinterface/EmuControllerDelegate.mm +++ b/desmume/src/cocoa/userinterface/EmuControllerDelegate.mm @@ -1002,6 +1002,15 @@ [[NSUserDefaults standardUserDefaults] setInteger:[[speakerBindings valueForKey:@"spuSyncMethod"] integerValue] forKey:@"SPU_SyncMethod"]; } +- (IBAction) writeDefaultsStylusSettings:(id)sender +{ + CocoaDSCore *cdsCore = (CocoaDSCore *)[cdsCoreController content]; + CocoaDSController *cdsController = [cdsCore cdsController]; + + [[NSUserDefaults standardUserDefaults] setInteger:[cdsController stylusPressure] forKey:@"Emulation_StylusPressure"]; + [[NSUserDefaults standardUserDefaults] setBool:[cdsController stylusEnableJitter] forKey:@"Emulation_StylusEnableJitter"]; +} + - (IBAction) closeSheet:(id)sender { NSWindow *sheet = [(NSControl *)sender window]; @@ -2185,6 +2194,10 @@ [[cdsCore cdsGPU] setRender3DLineHack:[[NSUserDefaults standardUserDefaults] boolForKey:@"Render3D_LineHack"]]; [[cdsCore cdsGPU] setRender3DMultisample:[[NSUserDefaults standardUserDefaults] boolForKey:@"Render3D_Multisample"]]; [[cdsCore cdsGPU] setRender3DFragmentSamplingHack:[[NSUserDefaults standardUserDefaults] boolForKey:@"Render3D_FragmentSamplingHack"]]; + + // Set the stylus options per user preferences. + [[cdsCore cdsController] setStylusPressure:[[NSUserDefaults standardUserDefaults] integerForKey:@"Emulation_StylusPressure"]]; + [[cdsCore cdsController] setStylusEnableJitter:[[NSUserDefaults standardUserDefaults] boolForKey:@"Emulation_StylusEnableJitter"]]; } #pragma mark NSUserInterfaceValidations Protocol