Cocoa Port: Update the UI for the removal of GFX3D_Zelda_Shadow_Depth_Hack, the changes in StylusJitter, and the addition of gamehacks.

This commit is contained in:
rogerman 2017-03-05 00:22:28 -08:00
parent 5563d61f66
commit e38246da31
11 changed files with 405 additions and 742 deletions

View File

@ -598,7 +598,6 @@ extern struct TCommonSettings
} gamehacks; } gamehacks;
int StylusPressure; int StylusPressure;
bool StylusJitter;
bool dispLayers[2][5]; bool dispLayers[2][5];

View File

@ -66,14 +66,14 @@
<false/> <false/>
<key>Emulation_StylusPressure</key> <key>Emulation_StylusPressure</key>
<integer>50</integer> <integer>50</integer>
<key>Emulation_StylusEnableJitter</key>
<false/>
<key>Emulation_UseDebugConsole</key> <key>Emulation_UseDebugConsole</key>
<false/> <false/>
<key>Emulation_UseExternalBIOSImages</key> <key>Emulation_UseExternalBIOSImages</key>
<false/> <false/>
<key>Emulation_UseExternalFirmwareImage</key> <key>Emulation_UseExternalFirmwareImage</key>
<false/> <false/>
<key>Emulation_UseGameSpecificHacks</key>
<true/>
<key>EmulationSlot1_DeviceType</key> <key>EmulationSlot1_DeviceType</key>
<integer>1</integer> <integer>1</integer>
<key>FirmwareConfig_Birthday</key> <key>FirmwareConfig_Birthday</key>
@ -702,8 +702,6 @@
<array/> <array/>
<key>Microphone_HardwareMicMute</key> <key>Microphone_HardwareMicMute</key>
<false/> <false/>
<key>Render3D_DepthComparisonThreshold</key>
<integer>0</integer>
<key>Render3D_EdgeMarking</key> <key>Render3D_EdgeMarking</key>
<true/> <true/>
<key>Render3D_Fog</key> <key>Render3D_Fog</key>

View File

@ -94,7 +94,6 @@ class GPUEventHandlerOSX;
@property (assign) BOOL render3DEdgeMarking; @property (assign) BOOL render3DEdgeMarking;
@property (assign) BOOL render3DFog; @property (assign) BOOL render3DFog;
@property (assign) BOOL render3DTextures; @property (assign) BOOL render3DTextures;
@property (assign) NSUInteger render3DDepthComparisonThreshold;
@property (assign) NSUInteger render3DThreads; @property (assign) NSUInteger render3DThreads;
@property (assign) BOOL render3DLineHack; @property (assign) BOOL render3DLineHack;
@property (assign) BOOL render3DMultisample; @property (assign) BOOL render3DMultisample;

View File

@ -106,7 +106,6 @@ public:
@dynamic render3DEdgeMarking; @dynamic render3DEdgeMarking;
@dynamic render3DFog; @dynamic render3DFog;
@dynamic render3DTextures; @dynamic render3DTextures;
@dynamic render3DDepthComparisonThreshold;
@dynamic render3DThreads; @dynamic render3DThreads;
@dynamic render3DLineHack; @dynamic render3DLineHack;
@dynamic render3DMultisample; @dynamic render3DMultisample;
@ -386,22 +385,6 @@ public:
return state; return state;
} }
- (void) setRender3DDepthComparisonThreshold:(NSUInteger)threshold
{
gpuEvent->Render3DLock();
CommonSettings.GFX3D_Zelda_Shadow_Depth_Hack = threshold;
gpuEvent->Render3DUnlock();
}
- (NSUInteger) render3DDepthComparisonThreshold
{
gpuEvent->Render3DLock();
const NSUInteger threshold = (NSUInteger)CommonSettings.GFX3D_Zelda_Shadow_Depth_Hack;
gpuEvent->Render3DUnlock();
return threshold;
}
- (void) setRender3DThreads:(NSUInteger)numberThreads - (void) setRender3DThreads:(NSUInteger)numberThreads
{ {
NSUInteger numberCores = [[NSProcessInfo processInfo] activeProcessorCount]; NSUInteger numberCores = [[NSProcessInfo processInfo] activeProcessorCount];

View File

@ -121,6 +121,7 @@ typedef struct
@property (assign) NSUInteger emulationFlags; @property (assign) NSUInteger emulationFlags;
@property (assign) BOOL emuFlagAdvancedBusLevelTiming; @property (assign) BOOL emuFlagAdvancedBusLevelTiming;
@property (assign) BOOL emuFlagRigorousTiming; @property (assign) BOOL emuFlagRigorousTiming;
@property (assign) BOOL emuFlagUseGameSpecificHacks;
@property (assign) BOOL emuFlagUseExternalBios; @property (assign) BOOL emuFlagUseExternalBios;
@property (assign) BOOL emuFlagEmulateBiosInterrupts; @property (assign) BOOL emuFlagEmulateBiosInterrupts;
@property (assign) BOOL emuFlagPatchDelayLoop; @property (assign) BOOL emuFlagPatchDelayLoop;

View File

@ -98,6 +98,7 @@ volatile bool execute = true;
@dynamic emulationFlags; @dynamic emulationFlags;
@synthesize emuFlagAdvancedBusLevelTiming; @synthesize emuFlagAdvancedBusLevelTiming;
@synthesize emuFlagRigorousTiming; @synthesize emuFlagRigorousTiming;
@dynamic emuFlagUseGameSpecificHacks;
@synthesize emuFlagUseExternalBios; @synthesize emuFlagUseExternalBios;
@synthesize emuFlagEmulateBiosInterrupts; @synthesize emuFlagEmulateBiosInterrupts;
@synthesize emuFlagPatchDelayLoop; @synthesize emuFlagPatchDelayLoop;
@ -595,6 +596,23 @@ volatile bool execute = true;
return theFlags; return theFlags;
} }
- (void) setEmuFlagUseGameSpecificHacks:(BOOL)useTiming
{
pthread_rwlock_wrlock(&threadParam.rwlockCoreExecute);
CommonSettings.gamehacks.en = (useTiming) ? true : false;
CommonSettings.gamehacks.apply();
pthread_rwlock_unlock(&threadParam.rwlockCoreExecute);
}
- (BOOL) emuFlagUseGameSpecificHacks
{
pthread_rwlock_rdlock(&threadParam.rwlockCoreExecute);
const BOOL useTiming = (CommonSettings.gamehacks.en) ? YES : NO;
pthread_rwlock_unlock(&threadParam.rwlockCoreExecute);
return useTiming;
}
- (void) setCpuEmulationEngine:(NSInteger)engineID - (void) setCpuEmulationEngine:(NSInteger)engineID
{ {
OSSpinLockLock(&spinlockCPUEmulationEngine); OSSpinLockLock(&spinlockCPUEmulationEngine);

View File

@ -99,7 +99,6 @@ typedef struct
NSPoint touchLocation; NSPoint touchLocation;
NSInteger paddleAdjust; NSInteger paddleAdjust;
NSInteger stylusPressure; NSInteger stylusPressure;
BOOL stylusEnableJitter;
float micLevel; float micLevel;
BOOL hardwareMicMute; BOOL hardwareMicMute;
@ -124,7 +123,6 @@ typedef struct
@property (assign) BOOL autohold; @property (assign) BOOL autohold;
@property (assign) NSInteger paddleAdjust; @property (assign) NSInteger paddleAdjust;
@property (assign) NSInteger stylusPressure; @property (assign) NSInteger stylusPressure;
@property (assign) BOOL stylusEnableJitter;
@property (readonly) BOOL isHardwareMicAvailable; @property (readonly) BOOL isHardwareMicAvailable;
@property (readonly) BOOL isHardwareMicIdle; @property (readonly) BOOL isHardwareMicIdle;
@property (readonly) BOOL isHardwareMicInClip; @property (readonly) BOOL isHardwareMicInClip;

View File

@ -38,7 +38,6 @@ SineWaveGenerator sineWaveGenerator(250.0, MIC_SAMPLE_RATE);
@dynamic autohold; @dynamic autohold;
@synthesize paddleAdjust; @synthesize paddleAdjust;
@synthesize stylusPressure; @synthesize stylusPressure;
@synthesize stylusEnableJitter;
@dynamic isHardwareMicAvailable; @dynamic isHardwareMicAvailable;
@dynamic isHardwareMicIdle; @dynamic isHardwareMicIdle;
@dynamic isHardwareMicInClip; @dynamic isHardwareMicInClip;
@ -346,7 +345,6 @@ SineWaveGenerator sineWaveGenerator(250.0, MIC_SAMPLE_RATE);
// Setup the DS touch pad. // Setup the DS touch pad.
CommonSettings.StylusPressure = (int)[self stylusPressure]; CommonSettings.StylusPressure = (int)[self stylusPressure];
CommonSettings.StylusJitter = ([self stylusEnableJitter]) ? true : false;
if (isTouchDown) if (isTouchDown)
{ {

View File

@ -948,7 +948,6 @@
[[NSUserDefaults standardUserDefaults] setBool:[[cdsCore cdsGPU] render3DEdgeMarking] forKey:@"Render3D_EdgeMarking"]; [[NSUserDefaults standardUserDefaults] setBool:[[cdsCore cdsGPU] render3DEdgeMarking] forKey:@"Render3D_EdgeMarking"];
[[NSUserDefaults standardUserDefaults] setBool:[[cdsCore cdsGPU] render3DFog] forKey:@"Render3D_Fog"]; [[NSUserDefaults standardUserDefaults] setBool:[[cdsCore cdsGPU] render3DFog] forKey:@"Render3D_Fog"];
[[NSUserDefaults standardUserDefaults] setBool:[[cdsCore cdsGPU] render3DTextures] forKey:@"Render3D_Textures"]; [[NSUserDefaults standardUserDefaults] setBool:[[cdsCore cdsGPU] render3DTextures] forKey:@"Render3D_Textures"];
[[NSUserDefaults standardUserDefaults] setInteger:[[cdsCore cdsGPU] render3DDepthComparisonThreshold] forKey:@"Render3D_DepthComparisonThreshold"];
[[NSUserDefaults standardUserDefaults] setInteger:[[cdsCore cdsGPU] render3DThreads] forKey:@"Render3D_Threads"]; [[NSUserDefaults standardUserDefaults] setInteger:[[cdsCore cdsGPU] render3DThreads] forKey:@"Render3D_Threads"];
[[NSUserDefaults standardUserDefaults] setBool:[[cdsCore cdsGPU] render3DLineHack] forKey:@"Render3D_LineHack"]; [[NSUserDefaults standardUserDefaults] setBool:[[cdsCore cdsGPU] render3DLineHack] forKey:@"Render3D_LineHack"];
[[NSUserDefaults standardUserDefaults] setBool:[[cdsCore cdsGPU] render3DMultisample] forKey:@"Render3D_Multisample"]; [[NSUserDefaults standardUserDefaults] setBool:[[cdsCore cdsGPU] render3DMultisample] forKey:@"Render3D_Multisample"];
@ -971,6 +970,7 @@
[[NSUserDefaults standardUserDefaults] setBool:[cdsCore emuFlagAdvancedBusLevelTiming] forKey:@"Emulation_AdvancedBusLevelTiming"]; [[NSUserDefaults standardUserDefaults] setBool:[cdsCore emuFlagAdvancedBusLevelTiming] forKey:@"Emulation_AdvancedBusLevelTiming"];
[[NSUserDefaults standardUserDefaults] setBool:[cdsCore emuFlagRigorousTiming] forKey:@"Emulation_RigorousTiming"]; [[NSUserDefaults standardUserDefaults] setBool:[cdsCore emuFlagRigorousTiming] forKey:@"Emulation_RigorousTiming"];
[[NSUserDefaults standardUserDefaults] setBool:[cdsCore emuFlagUseGameSpecificHacks] forKey:@"Emulation_UseGameSpecificHacks"];
[[NSUserDefaults standardUserDefaults] setInteger:[cdsCore cpuEmulationEngine] forKey:@"Emulation_CPUEmulationEngine"]; [[NSUserDefaults standardUserDefaults] setInteger:[cdsCore cpuEmulationEngine] forKey:@"Emulation_CPUEmulationEngine"];
[[NSUserDefaults standardUserDefaults] setInteger:[cdsCore maxJITBlockSize] forKey:@"Emulation_MaxJITBlockSize"]; [[NSUserDefaults standardUserDefaults] setInteger:[cdsCore maxJITBlockSize] forKey:@"Emulation_MaxJITBlockSize"];
[[NSUserDefaults standardUserDefaults] setBool:[cdsCore emuFlagUseExternalBios] forKey:@"Emulation_UseExternalBIOSImages"]; [[NSUserDefaults standardUserDefaults] setBool:[cdsCore emuFlagUseExternalBios] forKey:@"Emulation_UseExternalBIOSImages"];
@ -1020,7 +1020,6 @@
CocoaDSController *cdsController = [cdsCore cdsController]; CocoaDSController *cdsController = [cdsCore cdsController];
[[NSUserDefaults standardUserDefaults] setInteger:[cdsController stylusPressure] forKey:@"Emulation_StylusPressure"]; [[NSUserDefaults standardUserDefaults] setInteger:[cdsController stylusPressure] forKey:@"Emulation_StylusPressure"];
[[NSUserDefaults standardUserDefaults] setBool:[cdsController stylusEnableJitter] forKey:@"Emulation_StylusEnableJitter"];
[[NSUserDefaults standardUserDefaults] synchronize]; [[NSUserDefaults standardUserDefaults] synchronize];
} }
@ -2203,7 +2202,6 @@
[[cdsCore cdsGPU] setRender3DEdgeMarking:[[NSUserDefaults standardUserDefaults] boolForKey:@"Render3D_EdgeMarking"]]; [[cdsCore cdsGPU] setRender3DEdgeMarking:[[NSUserDefaults standardUserDefaults] boolForKey:@"Render3D_EdgeMarking"]];
[[cdsCore cdsGPU] setRender3DFog:[[NSUserDefaults standardUserDefaults] boolForKey:@"Render3D_Fog"]]; [[cdsCore cdsGPU] setRender3DFog:[[NSUserDefaults standardUserDefaults] boolForKey:@"Render3D_Fog"]];
[[cdsCore cdsGPU] setRender3DTextures:[[NSUserDefaults standardUserDefaults] boolForKey:@"Render3D_Textures"]]; [[cdsCore cdsGPU] setRender3DTextures:[[NSUserDefaults standardUserDefaults] boolForKey:@"Render3D_Textures"]];
[[cdsCore cdsGPU] setRender3DDepthComparisonThreshold:(NSUInteger)[[NSUserDefaults standardUserDefaults] integerForKey:@"Render3D_DepthComparisonThreshold"]];
[[cdsCore cdsGPU] setRender3DLineHack:[[NSUserDefaults standardUserDefaults] boolForKey:@"Render3D_LineHack"]]; [[cdsCore cdsGPU] setRender3DLineHack:[[NSUserDefaults standardUserDefaults] boolForKey:@"Render3D_LineHack"]];
[[cdsCore cdsGPU] setRender3DMultisample:[[NSUserDefaults standardUserDefaults] boolForKey:@"Render3D_Multisample"]]; [[cdsCore cdsGPU] setRender3DMultisample:[[NSUserDefaults standardUserDefaults] boolForKey:@"Render3D_Multisample"]];
[[cdsCore cdsGPU] setRender3DTextureScalingFactor:(NSUInteger)[[NSUserDefaults standardUserDefaults] integerForKey:@"Render3D_TextureScalingFactor"]]; [[cdsCore cdsGPU] setRender3DTextureScalingFactor:(NSUInteger)[[NSUserDefaults standardUserDefaults] integerForKey:@"Render3D_TextureScalingFactor"]];
@ -2214,7 +2212,6 @@
// Set the stylus options per user preferences. // Set the stylus options per user preferences.
[[cdsCore cdsController] setStylusPressure:[[NSUserDefaults standardUserDefaults] integerForKey:@"Emulation_StylusPressure"]]; [[cdsCore cdsController] setStylusPressure:[[NSUserDefaults standardUserDefaults] integerForKey:@"Emulation_StylusPressure"]];
[[cdsCore cdsController] setStylusEnableJitter:[[NSUserDefaults standardUserDefaults] boolForKey:@"Emulation_StylusEnableJitter"]];
} }
#pragma mark NSUserInterfaceValidations Protocol #pragma mark NSUserInterfaceValidations Protocol
@ -2495,14 +2492,6 @@
return enable; return enable;
} }
#pragma mark NSControl Delegate Methods
- (void)controlTextDidEndEditing:(NSNotification *)aNotification
{
CocoaDSCore *cdsCore = (CocoaDSCore *)[cdsCoreController content];
[[cdsCore cdsGPU] setRender3DDepthComparisonThreshold:[(NSNumber *)[aNotification object] integerValue]];
}
#pragma mark CocoaDSControllerDelegate Protocol #pragma mark CocoaDSControllerDelegate Protocol
- (void) doMicLevelUpdateFromController:(CocoaDSController *)cdsController - (void) doMicLevelUpdateFromController:(CocoaDSController *)cdsController