diff --git a/macosx/Resources/Base.lproj/Configuration.xib b/macosx/Resources/Base.lproj/Configuration.xib index 15030841..cd0e573d 100644 --- a/macosx/Resources/Base.lproj/Configuration.xib +++ b/macosx/Resources/Base.lproj/Configuration.xib @@ -10,6 +10,8 @@ + + @@ -31,6 +33,7 @@ + @@ -250,6 +253,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.50 + 0.75 + 1.25 + 1.50 + 2.00 + 3.00 + 4.00 + 5.00 + + + + + + + + + + + diff --git a/macosx/Source/ConfigurationController.h b/macosx/Source/ConfigurationController.h index 90dde217..595b91f8 100644 --- a/macosx/Source/ConfigurationController.h +++ b/macosx/Source/ConfigurationController.h @@ -39,10 +39,14 @@ extern NSString *const memCardChangeNumberKey; @property (weak) IBOutlet NSButtonCell *noFastBootCell; @property (weak) IBOutlet NSButtonCell *enableNetPlayCell; @property (weak) IBOutlet NSButtonCell *widescreen; +@property (weak) IBOutlet NSButtonCell *cpuOverclocking; +@property (weak) IBOutlet NSButtonCell *wipeoutMemHack; +@property (weak) IBOutlet NSComboBox *cpuOverclockingValue; - (IBAction)setCheckbox:(id)sender; - (IBAction)setCheckboxInverse:(id)sender; - (IBAction)setVideoType:(id)sender; +- (IBAction)setOverclockValue:(NSComboBox *)sender; + (void)setMemoryCard:(NSInteger)theCard toPath:(NSString *)theFile; + (void)setMemoryCard:(NSInteger)theCard toURL:(NSURL *)theURL; diff --git a/macosx/Source/ConfigurationController.m b/macosx/Source/ConfigurationController.m index c7b63335..7485e067 100644 --- a/macosx/Source/ConfigurationController.m +++ b/macosx/Source/ConfigurationController.m @@ -41,6 +41,9 @@ NSString *const memCardChangeNumberKey = @"PcsxrMemoryCardThatChangedKey"; @synthesize memCardEdit; @synthesize hkController; @synthesize hkTab; +@synthesize cpuOverclocking; +@synthesize wipeoutMemHack; +@synthesize cpuOverclockingValue; + (void)setMemoryCard:(NSInteger)theCard toURL:(NSURL *)theURL; { @@ -178,6 +181,26 @@ NSString *const memCardChangeNumberKey = @"PcsxrMemoryCardThatChangedKey"; } } +- (IBAction)setOverclockValue:(NSComboBox *)sender +{ + float value = sender.floatValue; + if (value < 0.5) value = 0.5; + if (value > 5.0) value = 5.0; + + NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; + [defaults setFloat:value forKey:@"CpuOverclockingValue"]; + [PcsxrController setConfigFromDefaults]; + + [self setOverclockValueText]; +} + +- (void)setOverclockValueText +{ + NSString *value = [NSString stringWithFormat:@"%.2f", Config.PsxClock]; + [cpuOverclockingValue setStringValue:value]; + [cpuOverclockingValue selectItemWithObjectValue:value]; +} + - (void)awakeFromNib { NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; @@ -218,6 +241,10 @@ NSString *const memCardChangeNumberKey = @"PcsxrMemoryCardThatChangedKey"; _checkBoxDefaults[@"NoFastBoot"] = noFastBootCell; if (widescreen) _checkBoxDefaults[@"Widescreen"] = widescreen; + if (cpuOverclocking) + _checkBoxDefaults[@"CpuOverclocking"] = cpuOverclocking; + if (wipeoutMemHack) + _checkBoxDefaults[@"WipeoutMemHack"] = wipeoutMemHack; // make the visuals match the defaults @@ -234,6 +261,7 @@ NSString *const memCardChangeNumberKey = @"PcsxrMemoryCardThatChangedKey"; [usesHleCell setEnabled:NO]; } + [self setOverclockValueText]; // setup labels diff --git a/macosx/Source/PcsxrController.m b/macosx/Source/PcsxrController.m index 06fb1d55..2a7285b1 100644 --- a/macosx/Source/PcsxrController.m +++ b/macosx/Source/PcsxrController.m @@ -691,6 +691,7 @@ otherblock();\ // special cases //str = [[defaults stringForKey:@"PluginPAD"] fileSystemRepresentation]; //if (str != nil) strncpy(Config.Pad2, str, 255); + Config.PsxClock = [defaults floatForKey:@"CpuOverclockingValue"]; str = [[defaults stringForKey:@"Bios"] fileSystemRepresentation]; if (str) { @@ -823,7 +824,10 @@ otherblock();\ @"Widescreen": @NO, @"NetPlay": @NO, @"DidMoveMemoryObjects": @NO, - @"NoFastBoot": @NO}; + @"NoFastBoot": @NO, + @"CpuOverclocking": @NO, + @"CpuOverclockingValue": @1.5f, + @"WipeoutMemHack": @NO}; [defaults registerDefaults:appDefaults]; @@ -849,7 +853,9 @@ otherblock();\ @"RootCounterFix": [NSValue valueWithPointer:&Config.RCntFix], @"VideoSyncWAFix": [NSValue valueWithPointer:&Config.VSyncWA], @"Widescreen": [NSValue valueWithPointer:&Config.Widescreen], - @"NoFastBoot": [NSValue valueWithPointer:&Config.SlowBoot]}; + @"NoFastBoot": [NSValue valueWithPointer:&Config.SlowBoot], + @"CpuOverclocking": [NSValue valueWithPointer:&Config.OverClock], + @"WipeoutMemHack": [NSValue valueWithPointer:&Config.MemHack]}; // setup application support paths NSFileManager *manager = [NSFileManager defaultManager];