Cocoa Port: Do some refactoring to remove extraneous connections in EmuControllerDelegate.

This commit is contained in:
rogerman 2017-09-11 15:26:37 -07:00
parent 221fa5f72b
commit cb4ecbe17e
11 changed files with 243 additions and 262 deletions

View File

@ -81,7 +81,8 @@ ClientExecutionControl::ClientExecutionControl()
_settingsPending.executionSpeed = SPEED_SCALAR_NORMAL; _settingsPending.executionSpeed = SPEED_SCALAR_NORMAL;
_settingsPending.enableFrameSkip = true; _settingsPending.enableFrameSkip = true;
_settingsPending.frameJumpTarget = 0; _settingsPending.frameJumpRelativeTarget = 60;
_settingsPending.frameJumpTarget = 60;
_settingsPending.execBehavior = ExecutionBehavior_Pause; _settingsPending.execBehavior = ExecutionBehavior_Pause;
_settingsPending.jumpBehavior = FrameJumpBehavior_Forward; _settingsPending.jumpBehavior = FrameJumpBehavior_Forward;
@ -672,6 +673,24 @@ void ClientExecutionControl::ResetFramesToSkip()
pthread_mutex_unlock(&this->_mutexSettingsPendingOnNDSExec); pthread_mutex_unlock(&this->_mutexSettingsPendingOnNDSExec);
} }
uint64_t ClientExecutionControl::GetFrameJumpRelativeTarget()
{
pthread_mutex_lock(&this->_mutexSettingsPendingOnExecutionLoopStart);
const uint64_t jumpTarget = this->_settingsPending.frameJumpRelativeTarget;
pthread_mutex_unlock(&this->_mutexSettingsPendingOnExecutionLoopStart);
return jumpTarget;
}
void ClientExecutionControl::SetFrameJumpRelativeTarget(uint64_t newRelativeTarget)
{
pthread_mutex_lock(&this->_mutexSettingsPendingOnExecutionLoopStart);
this->_settingsPending.frameJumpRelativeTarget = newRelativeTarget;
this->_newSettingsPendingOnExecutionLoopStart = true;
pthread_mutex_unlock(&this->_mutexSettingsPendingOnExecutionLoopStart);
}
uint64_t ClientExecutionControl::GetFrameJumpTarget() uint64_t ClientExecutionControl::GetFrameJumpTarget()
{ {
pthread_mutex_lock(&this->_mutexSettingsPendingOnExecutionLoopStart); pthread_mutex_lock(&this->_mutexSettingsPendingOnExecutionLoopStart);
@ -729,12 +748,20 @@ void ClientExecutionControl::SetExecutionBehavior(ExecutionBehavior newBehavior)
FrameJumpBehavior ClientExecutionControl::GetFrameJumpBehavior() FrameJumpBehavior ClientExecutionControl::GetFrameJumpBehavior()
{ {
return this->_settingsPending.jumpBehavior; pthread_mutex_lock(&this->_mutexSettingsPendingOnExecutionLoopStart);
const FrameJumpBehavior jumpBehavior = this->_settingsPending.jumpBehavior;
pthread_mutex_unlock(&this->_mutexSettingsPendingOnExecutionLoopStart);
return jumpBehavior;
} }
void ClientExecutionControl::SetFrameJumpBehavior(FrameJumpBehavior newBehavior) void ClientExecutionControl::SetFrameJumpBehavior(FrameJumpBehavior newBehavior)
{ {
pthread_mutex_lock(&this->_mutexSettingsPendingOnExecutionLoopStart);
this->_settingsPending.jumpBehavior = newBehavior; this->_settingsPending.jumpBehavior = newBehavior;
this->_newSettingsPendingOnExecutionLoopStart = true;
pthread_mutex_unlock(&this->_mutexSettingsPendingOnExecutionLoopStart);
} }
void ClientExecutionControl::ApplySettingsOnReset() void ClientExecutionControl::ApplySettingsOnReset()
@ -821,7 +848,24 @@ void ClientExecutionControl::ApplySettingsOnExecutionLoopStart()
this->_settingsApplied.enableExecutionSpeedLimiter = this->_settingsPending.enableExecutionSpeedLimiter; this->_settingsApplied.enableExecutionSpeedLimiter = this->_settingsPending.enableExecutionSpeedLimiter;
this->_settingsApplied.executionSpeed = speedScalar; this->_settingsApplied.executionSpeed = speedScalar;
this->_settingsApplied.frameJumpTarget = this->_settingsPending.frameJumpTarget; this->_settingsApplied.jumpBehavior = this->_settingsPending.jumpBehavior;
this->_settingsApplied.frameJumpRelativeTarget = this->_settingsPending.frameJumpRelativeTarget;
switch (this->_settingsApplied.jumpBehavior)
{
case FrameJumpBehavior_Forward:
this->_settingsApplied.frameJumpTarget = this->_ndsFrameInfo.frameIndex + this->_settingsApplied.frameJumpRelativeTarget;
break;
case FrameJumpBehavior_NextMarker:
// TODO: Support frame markers in replays.
break;
case FrameJumpBehavior_ToFrame:
default:
this->_settingsApplied.frameJumpTarget = this->_settingsPending.frameJumpTarget;
break;
}
const bool needBehaviorChange = (this->_settingsApplied.execBehavior != this->_settingsPending.execBehavior); const bool needBehaviorChange = (this->_settingsApplied.execBehavior != this->_settingsPending.execBehavior);
if (needBehaviorChange) if (needBehaviorChange)
@ -1380,6 +1424,15 @@ const NDSFrameInfo& ClientExecutionControl::GetNDSFrameInfo()
return this->_ndsFrameInfo; return this->_ndsFrameInfo;
} }
uint64_t ClientExecutionControl::GetFrameIndex()
{
pthread_mutex_lock(&this->_mutexOutputPostNDSExec);
const uint64_t frameIndex = this->_ndsFrameInfo.frameIndex;
pthread_mutex_unlock(&this->_mutexOutputPostNDSExec);
return frameIndex;
}
double ClientExecutionControl::GetFrameTime() double ClientExecutionControl::GetFrameTime()
{ {
return this->_frameTime; return this->_frameTime;

View File

@ -345,6 +345,7 @@ struct ClientExecutionControlSettings
double executionSpeed; double executionSpeed;
bool enableFrameSkip; bool enableFrameSkip;
uint64_t frameJumpRelativeTarget;
uint64_t frameJumpTarget; uint64_t frameJumpTarget;
ExecutionBehavior execBehavior; ExecutionBehavior execBehavior;
@ -569,6 +570,9 @@ public:
void SetFramesToSkip(uint8_t numFrames); void SetFramesToSkip(uint8_t numFrames);
void ResetFramesToSkip(); void ResetFramesToSkip();
uint64_t GetFrameJumpRelativeTarget();
void SetFrameJumpRelativeTarget(uint64_t newRelativeTarget);
uint64_t GetFrameJumpTarget(); uint64_t GetFrameJumpTarget();
uint64_t GetFrameJumpTargetApplied(); uint64_t GetFrameJumpTargetApplied();
void SetFrameJumpTarget(uint64_t newJumpTarget); void SetFrameJumpTarget(uint64_t newJumpTarget);
@ -613,6 +617,7 @@ public:
void FetchOutputPostNDSExec(); void FetchOutputPostNDSExec();
const NDSFrameInfo& GetNDSFrameInfo(); const NDSFrameInfo& GetNDSFrameInfo();
uint64_t GetFrameIndex();
double GetFrameTime(); double GetFrameTime();
uint8_t CalculateFrameSkip(double startAbsoluteTime, double frameAbsoluteTime); uint8_t CalculateFrameSkip(double startAbsoluteTime, double frameAbsoluteTime);

View File

@ -88,6 +88,10 @@ typedef struct
@property (assign) BOOL isCheatingEnabled; @property (assign) BOOL isCheatingEnabled;
@property (assign) CGFloat speedScalar; @property (assign) CGFloat speedScalar;
@property (assign) NSInteger frameJumpBehavior;
@property (assign) NSUInteger frameJumpNumberFramesForward;
@property (assign) NSUInteger frameJumpToFrameIndex;
@property (assign) BOOL isGdbStubStarted; @property (assign) BOOL isGdbStubStarted;
@property (assign) BOOL isInDebugTrap; @property (assign) BOOL isInDebugTrap;
@property (assign) BOOL enableGdbStubARM9; @property (assign) BOOL enableGdbStubARM9;
@ -130,8 +134,6 @@ typedef struct
- (void) reset; - (void) reset;
- (void) getTimedEmulatorStatistics:(NSTimer *)timer; - (void) getTimedEmulatorStatistics:(NSTimer *)timer;
- (NSUInteger) frameNumber; - (NSUInteger) frameNumber;
- (void) frameJumpTo:(NSUInteger)targetFrameNum;
- (void) frameJump:(NSUInteger)relativeFrameNum;
- (void) addOutput:(CocoaDSOutput *)theOutput; - (void) addOutput:(CocoaDSOutput *)theOutput;
- (void) removeOutput:(CocoaDSOutput *)theOutput; - (void) removeOutput:(CocoaDSOutput *)theOutput;

View File

@ -89,6 +89,10 @@ volatile bool execute = true;
@dynamic isCheatingEnabled; @dynamic isCheatingEnabled;
@dynamic speedScalar; @dynamic speedScalar;
@dynamic frameJumpBehavior;
@dynamic frameJumpNumberFramesForward;
@dynamic frameJumpToFrameIndex;
@dynamic isGdbStubStarted; @dynamic isGdbStubStarted;
@dynamic isInDebugTrap; @dynamic isInDebugTrap;
@synthesize enableGdbStubARM9; @synthesize enableGdbStubARM9;
@ -300,6 +304,40 @@ volatile bool execute = true;
return scalar; return scalar;
} }
- (void) setFrameJumpBehavior:(NSInteger)theBehavior
{
execControl->SetFrameJumpBehavior((FrameJumpBehavior)theBehavior);
}
- (NSInteger) frameJumpBehavior
{
const NSInteger theBehavior = (NSInteger)execControl->GetFrameJumpBehavior();
return theBehavior;
}
- (void) setFrameJumpNumberFramesForward:(NSUInteger)numberFrames
{
execControl->SetFrameJumpRelativeTarget((uint64_t)numberFrames);
[self setFrameJumpToFrameIndex:[self frameNumber] + numberFrames];
}
- (NSUInteger) frameJumpNumberFramesForward
{
const NSUInteger numberFrames = execControl->GetFrameJumpRelativeTarget();
return numberFrames;
}
- (void) setFrameJumpToFrameIndex:(NSUInteger)frameIndex
{
execControl->SetFrameJumpTarget((uint64_t)frameIndex);
}
- (NSUInteger) frameJumpToFrameIndex
{
const NSUInteger frameIndex = execControl->GetFrameJumpTarget();
return frameIndex;
}
- (void) setIsSpeedLimitEnabled:(BOOL)enable - (void) setIsSpeedLimitEnabled:(BOOL)enable
{ {
execControl->SetEnableSpeedLimiter((enable) ? true : false); execControl->SetEnableSpeedLimiter((enable) ? true : false);
@ -557,6 +595,33 @@ volatile bool execute = true;
- (void) setCoreState:(NSInteger)coreState - (void) setCoreState:(NSInteger)coreState
{ {
if (coreState == ExecutionBehavior_FrameJump)
{
uint64_t frameIndex = [self frameNumber];
switch ([self frameJumpBehavior])
{
case FrameJumpBehavior_Forward:
[self setFrameJumpToFrameIndex:[self frameJumpNumberFramesForward] + frameIndex];
break;
case FrameJumpBehavior_NextMarker:
// TODO: Support frame jumping to replay markers.
break;
case FrameJumpBehavior_ToFrame:
default:
break;
}
uint64_t jumpTarget = [self frameJumpToFrameIndex];
if (frameIndex >= jumpTarget)
{
return;
}
}
pthread_mutex_lock(&threadParam.mutexThreadExecute); pthread_mutex_lock(&threadParam.mutexThreadExecute);
execControl->SetExecutionBehavior((ExecutionBehavior)coreState); execControl->SetExecutionBehavior((ExecutionBehavior)coreState);
@ -572,7 +637,7 @@ volatile bool execute = true;
[cdsOutput setIdle:YES]; [cdsOutput setIdle:YES];
} }
[self setFrameStatus:[NSString stringWithFormat:@"%lu", (unsigned long)[self frameNumber]]]; [self setFrameStatus:[NSString stringWithFormat:@"%llu", (unsigned long long)[self frameNumber]]];
[_fpsTimer invalidate]; [_fpsTimer invalidate];
_fpsTimer = nil; _fpsTimer = nil;
break; break;
@ -585,7 +650,7 @@ volatile bool execute = true;
[cdsOutput setIdle:NO]; [cdsOutput setIdle:NO];
} }
[self setFrameStatus:[NSString stringWithFormat:@"%lu", (unsigned long)[self frameNumber]]]; [self setFrameStatus:[NSString stringWithFormat:@"%llu", (unsigned long long)[self frameNumber]]];
[_fpsTimer invalidate]; [_fpsTimer invalidate];
_fpsTimer = nil; _fpsTimer = nil;
break; break;
@ -625,7 +690,7 @@ volatile bool execute = true;
} }
} }
[self setFrameStatus:[NSString stringWithFormat:@"Jumping to frame %lu.", (unsigned long)execControl->GetFrameJumpTarget()]]; [self setFrameStatus:[NSString stringWithFormat:@"Jumping to frame %llu.", (unsigned long long)execControl->GetFrameJumpTarget()]];
[_fpsTimer invalidate]; [_fpsTimer invalidate];
_fpsTimer = nil; _fpsTimer = nil;
break; break;
@ -810,26 +875,7 @@ volatile bool execute = true;
- (NSUInteger) frameNumber - (NSUInteger) frameNumber
{ {
pthread_rwlock_rdlock(&threadParam.rwlockCoreExecute); return (NSUInteger)execControl->GetFrameIndex();
const NSUInteger currFrameNum = currFrameCounter;
pthread_rwlock_unlock(&threadParam.rwlockCoreExecute);
return currFrameNum;
}
- (void) frameJumpTo:(NSUInteger)targetFrameNum
{
execControl->SetFrameJumpTarget(targetFrameNum);
if (targetFrameNum > [self frameNumber])
{
[self setCoreState:ExecutionBehavior_FrameJump];
}
}
- (void) frameJump:(NSUInteger)relativeFrameNum
{
[self frameJumpTo:[self frameNumber] + relativeFrameNum];
} }
- (void) addOutput:(CocoaDSOutput *)theOutput - (void) addOutput:(CocoaDSOutput *)theOutput

View File

@ -12,6 +12,8 @@
</object> </object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs"> <object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool> <bool key="EncodedWithXMLCoder">YES</bool>
<integer value="8991"/>
<integer value="576"/>
</object> </object>
<object class="NSArray" key="IBDocument.PluginDependencies"> <object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool> <bool key="EncodedWithXMLCoder">YES</bool>
@ -20732,7 +20734,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2
<object class="NSWindowTemplate" id="743100165"> <object class="NSWindowTemplate" id="743100165">
<int key="NSWindowStyleMask">23</int> <int key="NSWindowStyleMask">23</int>
<int key="NSWindowBacking">2</int> <int key="NSWindowBacking">2</int>
<string key="NSWindowRect">{{144, 214}, {254, 262}}</string> <string key="NSWindowRect">{{144, 234}, {254, 242}}</string>
<int key="NSWTFlags">-461896704</int> <int key="NSWTFlags">-461896704</int>
<string key="NSWindowTitle">Execution Control</string> <string key="NSWindowTitle">Execution Control</string>
<string key="NSWindowClass">NSPanel</string> <string key="NSWindowClass">NSPanel</string>
@ -20740,14 +20742,14 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2
<nil key="NSUserInterfaceItemIdentifier"/> <nil key="NSUserInterfaceItemIdentifier"/>
<string key="NSWindowContentMaxSize">{1.7976931348623157e+308, 1.7976931348623157e+308}</string> <string key="NSWindowContentMaxSize">{1.7976931348623157e+308, 1.7976931348623157e+308}</string>
<object class="NSView" key="NSWindowView" id="1071235285"> <object class="NSView" key="NSWindowView" id="1071235285">
<nil key="NSNextResponder"/> <reference key="NSNextResponder"/>
<int key="NSvFlags">256</int> <int key="NSvFlags">256</int>
<object class="NSMutableArray" key="NSSubviews"> <object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool> <bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSButton" id="987271593"> <object class="NSButton" id="987271593">
<reference key="NSNextResponder" ref="1071235285"/> <reference key="NSNextResponder" ref="1071235285"/>
<int key="NSvFlags">268</int> <int key="NSvFlags">268</int>
<string key="NSFrame">{{0, 230}, {32, 32}}</string> <string key="NSFrame">{{0, 210}, {32, 32}}</string>
<reference key="NSSuperview" ref="1071235285"/> <reference key="NSSuperview" ref="1071235285"/>
<string key="NSReuseIdentifierKey">_NS:2530</string> <string key="NSReuseIdentifierKey">_NS:2530</string>
<bool key="NSEnabled">YES</bool> <bool key="NSEnabled">YES</bool>
@ -20774,7 +20776,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2
<object class="NSButton" id="24823560"> <object class="NSButton" id="24823560">
<reference key="NSNextResponder" ref="1071235285"/> <reference key="NSNextResponder" ref="1071235285"/>
<int key="NSvFlags">268</int> <int key="NSvFlags">268</int>
<string key="NSFrame">{{32, 230}, {32, 32}}</string> <string key="NSFrame">{{32, 210}, {32, 32}}</string>
<reference key="NSSuperview" ref="1071235285"/> <reference key="NSSuperview" ref="1071235285"/>
<string key="NSReuseIdentifierKey">_NS:2530</string> <string key="NSReuseIdentifierKey">_NS:2530</string>
<bool key="NSEnabled">YES</bool> <bool key="NSEnabled">YES</bool>
@ -20801,7 +20803,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2
<object class="NSButton" id="638248312"> <object class="NSButton" id="638248312">
<reference key="NSNextResponder" ref="1071235285"/> <reference key="NSNextResponder" ref="1071235285"/>
<int key="NSvFlags">268</int> <int key="NSvFlags">268</int>
<string key="NSFrame">{{64, 230}, {32, 32}}</string> <string key="NSFrame">{{64, 210}, {32, 32}}</string>
<reference key="NSSuperview" ref="1071235285"/> <reference key="NSSuperview" ref="1071235285"/>
<string key="NSReuseIdentifierKey">_NS:2530</string> <string key="NSReuseIdentifierKey">_NS:2530</string>
<bool key="NSEnabled">YES</bool> <bool key="NSEnabled">YES</bool>
@ -20828,7 +20830,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2
<object class="NSButton" id="673376854"> <object class="NSButton" id="673376854">
<reference key="NSNextResponder" ref="1071235285"/> <reference key="NSNextResponder" ref="1071235285"/>
<int key="NSvFlags">268</int> <int key="NSvFlags">268</int>
<string key="NSFrame">{{222, 230}, {32, 32}}</string> <string key="NSFrame">{{222, 210}, {32, 32}}</string>
<reference key="NSSuperview" ref="1071235285"/> <reference key="NSSuperview" ref="1071235285"/>
<string key="NSReuseIdentifierKey">_NS:2530</string> <string key="NSReuseIdentifierKey">_NS:2530</string>
<bool key="NSEnabled">YES</bool> <bool key="NSEnabled">YES</bool>
@ -20855,7 +20857,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2
<object class="NSButton" id="1051817973"> <object class="NSButton" id="1051817973">
<reference key="NSNextResponder" ref="1071235285"/> <reference key="NSNextResponder" ref="1071235285"/>
<int key="NSvFlags">268</int> <int key="NSvFlags">268</int>
<string key="NSFrame">{{96, 230}, {32, 32}}</string> <string key="NSFrame">{{96, 210}, {32, 32}}</string>
<reference key="NSSuperview" ref="1071235285"/> <reference key="NSSuperview" ref="1071235285"/>
<string key="NSReuseIdentifierKey">_NS:2530</string> <string key="NSReuseIdentifierKey">_NS:2530</string>
<bool key="NSEnabled">YES</bool> <bool key="NSEnabled">YES</bool>
@ -20895,7 +20897,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2
<object class="NSMutableArray" key="NSSubviews"> <object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool> <bool key="EncodedWithXMLCoder">YES</bool>
</object> </object>
<string key="NSFrame">{{176, 53}, {64, 19}}</string> <string key="NSFrame">{{176, 33}, {64, 19}}</string>
<reference key="NSSuperview" ref="765987896"/> <reference key="NSSuperview" ref="765987896"/>
<string key="NSReuseIdentifierKey">_NS:817</string> <string key="NSReuseIdentifierKey">_NS:817</string>
<bool key="NSEnabled">YES</bool> <bool key="NSEnabled">YES</bool>
@ -20974,7 +20976,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2
<object class="NSMutableArray" key="NSSubviews"> <object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool> <bool key="EncodedWithXMLCoder">YES</bool>
</object> </object>
<string key="NSFrame">{{176, 33}, {64, 19}}</string> <string key="NSFrame">{{176, 13}, {64, 19}}</string>
<reference key="NSSuperview" ref="765987896"/> <reference key="NSSuperview" ref="765987896"/>
<string key="NSReuseIdentifierKey">_NS:817</string> <string key="NSReuseIdentifierKey">_NS:817</string>
<bool key="NSEnabled">YES</bool> <bool key="NSEnabled">YES</bool>
@ -21043,12 +21045,12 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2
<object class="NSMatrix" id="253303397"> <object class="NSMatrix" id="253303397">
<reference key="NSNextResponder" ref="765987896"/> <reference key="NSNextResponder" ref="765987896"/>
<int key="NSvFlags">268</int> <int key="NSvFlags">268</int>
<string key="NSFrame">{{18, 14}, {150, 58}}</string> <string key="NSFrame">{{18, 14}, {150, 38}}</string>
<reference key="NSSuperview" ref="765987896"/> <reference key="NSSuperview" ref="765987896"/>
<string key="NSReuseIdentifierKey">_NS:736</string> <string key="NSReuseIdentifierKey">_NS:736</string>
<bool key="NSEnabled">YES</bool> <bool key="NSEnabled">YES</bool>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool> <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
<int key="NSNumRows">3</int> <int key="NSNumRows">2</int>
<int key="NSNumCols">1</int> <int key="NSNumCols">1</int>
<object class="NSMutableArray" key="NSCells"> <object class="NSMutableArray" key="NSCells">
<bool key="EncodedWithXMLCoder">YES</bool> <bool key="EncodedWithXMLCoder">YES</bool>
@ -21172,53 +21174,6 @@ QXBwbGUgQ29tcHV0ZXIsIEluYy4sIDIwMDUAAAAAA</bytes>
<int key="NSPeriodicDelay">400</int> <int key="NSPeriodicDelay">400</int>
<int key="NSPeriodicInterval">75</int> <int key="NSPeriodicInterval">75</int>
</object> </object>
<object class="NSButtonCell" id="621920339">
<int key="NSCellFlags">603979776</int>
<int key="NSCellFlags2">131072</int>
<string key="NSContents">Jump to next marker</string>
<reference key="NSSupport" ref="26"/>
<reference key="NSControlView" ref="253303397"/>
<int key="NSTag">2</int>
<int key="NSButtonFlags">1211912448</int>
<int key="NSButtonFlags2">0</int>
<object class="NSImage" key="NSNormalImage">
<int key="NSImageFlags">12779520</int>
<object class="NSMutableArray" key="NSReps">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray">
<bool key="EncodedWithXMLCoder">YES</bool>
<integer value="0"/>
<object class="NSCoreUIImageRep">
<object class="NSMutableDictionary" key="NSCoreUIImageOptions">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>size</string>
<string>state</string>
<string>value</string>
<string>widget</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>regular</string>
<string>normal</string>
<integer value="0"/>
<string>radiobutton</string>
</object>
</object>
<string key="NSSize">{18, 18}</string>
<int key="NSBitsPerSample">0</int>
<bool key="NSHasAlpha">YES</bool>
<string key="NSColorSpaceName">NSCalibratedRGBColorSpace</string>
</object>
</object>
</object>
<reference key="NSColor" ref="122595646"/>
</object>
<reference key="NSAlternateImage" ref="491083016"/>
<int key="NSPeriodicDelay">400</int>
<int key="NSPeriodicInterval">75</int>
</object>
</object> </object>
<string key="NSCellSize">{150, 18}</string> <string key="NSCellSize">{150, 18}</string>
<string key="NSIntercellSpacing">{4, 2}</string> <string key="NSIntercellSpacing">{4, 2}</string>
@ -21335,12 +21290,12 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2
<reference key="NSFont" ref="462791774"/> <reference key="NSFont" ref="462791774"/>
</object> </object>
</object> </object>
<string key="NSFrame">{{1, 1}, {258, 82}}</string> <string key="NSFrame">{{1, 1}, {258, 62}}</string>
<reference key="NSSuperview" ref="830110984"/> <reference key="NSSuperview" ref="830110984"/>
<string key="NSReuseIdentifierKey">_NS:21</string> <string key="NSReuseIdentifierKey">_NS:21</string>
</object> </object>
</object> </object>
<string key="NSFrame">{{-3, 124}, {260, 98}}</string> <string key="NSFrame">{{-3, 124}, {260, 78}}</string>
<reference key="NSSuperview" ref="1071235285"/> <reference key="NSSuperview" ref="1071235285"/>
<string key="NSReuseIdentifierKey">_NS:18</string> <string key="NSReuseIdentifierKey">_NS:18</string>
<string key="NSOffsets">{0, 0}</string> <string key="NSOffsets">{0, 0}</string>
@ -21645,7 +21600,8 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2
<int key="NSTextFieldAlignmentRectInsetsVersion">1</int> <int key="NSTextFieldAlignmentRectInsetsVersion">1</int>
</object> </object>
</object> </object>
<string key="NSFrameSize">{254, 262}</string> <string key="NSFrameSize">{254, 242}</string>
<reference key="NSSuperview"/>
<string key="NSReuseIdentifierKey">_NS:103</string> <string key="NSReuseIdentifierKey">_NS:103</string>
</object> </object>
<string key="NSScreenRect">{{0, 0}, {1920, 1177}}</string> <string key="NSScreenRect">{{0, 0}, {1920, 1177}}</string>
@ -30882,6 +30838,9 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2
<string>cdsGPU.render3DTextureSmoothing</string> <string>cdsGPU.render3DTextureSmoothing</string>
<string>emuFlagUseGameSpecificHacks</string> <string>emuFlagUseGameSpecificHacks</string>
<string>cdsGPU.gpuColorFormat</string> <string>cdsGPU.gpuColorFormat</string>
<string>frameJumpBehavior</string>
<string>frameJumpNumberFramesForward</string>
<string>frameJumpToFrameIndex</string>
</object> </object>
<string key="NSObjectClassName">CocoaDSCore</string> <string key="NSObjectClassName">CocoaDSCore</string>
<object class="_NSManagedProxy" key="_NSManagedProxy"/> <object class="_NSManagedProxy" key="_NSManagedProxy"/>
@ -30921,9 +30880,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2
<string>mainWindow.screenshotFileFormat</string> <string>mainWindow.screenshotFileFormat</string>
<string>selectedExportRomSaveID</string> <string>selectedExportRomSaveID</string>
<string>mainWindow.displayGap</string> <string>mainWindow.displayGap</string>
<string>frameJumpType</string>
<string>frameJumpFramesForward</string>
<string>frameJumpToFrame</string>
<string>mainWindow.outputFilter</string> <string>mainWindow.outputFilter</string>
<string>mainWindow.videoSourceDeposterize</string> <string>mainWindow.videoSourceDeposterize</string>
<string>mainWindow.videoFiltersPreferGPU</string> <string>mainWindow.videoFiltersPreferGPU</string>
@ -40986,54 +40942,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2
</object> </object>
<int key="connectionID">9093</int> <int key="connectionID">9093</int>
</object> </object>
<object class="IBConnectionRecord">
<object class="IBBindingConnection" key="connection">
<string key="label">selectedTag: selection.frameJumpType</string>
<reference key="source" ref="253303397"/>
<reference key="destination" ref="258098641"/>
<object class="NSNibBindingConnector" key="connector">
<reference key="NSSource" ref="253303397"/>
<reference key="NSDestination" ref="258098641"/>
<string key="NSLabel">selectedTag: selection.frameJumpType</string>
<string key="NSBinding">selectedTag</string>
<string key="NSKeyPath">selection.frameJumpType</string>
<int key="NSNibBindingConnectorVersion">2</int>
</object>
</object>
<int key="connectionID">9096</int>
</object>
<object class="IBConnectionRecord">
<object class="IBBindingConnection" key="connection">
<string key="label">value: selection.frameJumpFramesForward</string>
<reference key="source" ref="1005221604"/>
<reference key="destination" ref="258098641"/>
<object class="NSNibBindingConnector" key="connector">
<reference key="NSSource" ref="1005221604"/>
<reference key="NSDestination" ref="258098641"/>
<string key="NSLabel">value: selection.frameJumpFramesForward</string>
<string key="NSBinding">value</string>
<string key="NSKeyPath">selection.frameJumpFramesForward</string>
<int key="NSNibBindingConnectorVersion">2</int>
</object>
</object>
<int key="connectionID">9097</int>
</object>
<object class="IBConnectionRecord">
<object class="IBBindingConnection" key="connection">
<string key="label">value: selection.frameJumpToFrame</string>
<reference key="source" ref="1048302620"/>
<reference key="destination" ref="258098641"/>
<object class="NSNibBindingConnector" key="connector">
<reference key="NSSource" ref="1048302620"/>
<reference key="NSDestination" ref="258098641"/>
<string key="NSLabel">value: selection.frameJumpToFrame</string>
<string key="NSBinding">value</string>
<string key="NSKeyPath">selection.frameJumpToFrame</string>
<int key="NSNibBindingConnectorVersion">2</int>
</object>
</object>
<int key="connectionID">9098</int>
</object>
<object class="IBConnectionRecord"> <object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection"> <object class="IBOutletConnection" key="connection">
<string key="label">executionControlWindow</string> <string key="label">executionControlWindow</string>
@ -44593,6 +44501,54 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2
</object> </object>
<int key="connectionID">10510</int> <int key="connectionID">10510</int>
</object> </object>
<object class="IBConnectionRecord">
<object class="IBBindingConnection" key="connection">
<string key="label">selectedTag: selection.frameJumpBehavior</string>
<reference key="source" ref="253303397"/>
<reference key="destination" ref="582168938"/>
<object class="NSNibBindingConnector" key="connector">
<reference key="NSSource" ref="253303397"/>
<reference key="NSDestination" ref="582168938"/>
<string key="NSLabel">selectedTag: selection.frameJumpBehavior</string>
<string key="NSBinding">selectedTag</string>
<string key="NSKeyPath">selection.frameJumpBehavior</string>
<int key="NSNibBindingConnectorVersion">2</int>
</object>
</object>
<int key="connectionID">10512</int>
</object>
<object class="IBConnectionRecord">
<object class="IBBindingConnection" key="connection">
<string key="label">value: selection.frameJumpNumberFramesForward</string>
<reference key="source" ref="1005221604"/>
<reference key="destination" ref="582168938"/>
<object class="NSNibBindingConnector" key="connector">
<reference key="NSSource" ref="1005221604"/>
<reference key="NSDestination" ref="582168938"/>
<string key="NSLabel">value: selection.frameJumpNumberFramesForward</string>
<string key="NSBinding">value</string>
<string key="NSKeyPath">selection.frameJumpNumberFramesForward</string>
<int key="NSNibBindingConnectorVersion">2</int>
</object>
</object>
<int key="connectionID">10514</int>
</object>
<object class="IBConnectionRecord">
<object class="IBBindingConnection" key="connection">
<string key="label">value: selection.frameJumpToFrameIndex</string>
<reference key="source" ref="1048302620"/>
<reference key="destination" ref="582168938"/>
<object class="NSNibBindingConnector" key="connector">
<reference key="NSSource" ref="1048302620"/>
<reference key="NSDestination" ref="582168938"/>
<string key="NSLabel">value: selection.frameJumpToFrameIndex</string>
<string key="NSBinding">value</string>
<string key="NSKeyPath">selection.frameJumpToFrameIndex</string>
<int key="NSNibBindingConnectorVersion">2</int>
</object>
</object>
<int key="connectionID">10516</int>
</object>
</object> </object>
<object class="IBMutableOrderedSet" key="objectRecords"> <object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects"> <object class="NSArray" key="orderedObjects">
@ -55502,18 +55458,12 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2
<reference key="object" ref="253303397"/> <reference key="object" ref="253303397"/>
<object class="NSMutableArray" key="children"> <object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool> <bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="621920339"/>
<reference ref="411711591"/> <reference ref="411711591"/>
<reference ref="674426613"/> <reference ref="674426613"/>
<reference ref="850478018"/> <reference ref="850478018"/>
</object> </object>
<reference key="parent" ref="830110984"/> <reference key="parent" ref="830110984"/>
</object> </object>
<object class="IBObjectRecord">
<int key="objectID">9038</int>
<reference key="object" ref="621920339"/>
<reference key="parent" ref="253303397"/>
</object>
<object class="IBObjectRecord"> <object class="IBObjectRecord">
<int key="objectID">9037</int> <int key="objectID">9037</int>
<reference key="object" ref="411711591"/> <reference key="object" ref="411711591"/>
@ -62868,7 +62818,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2
<string>9035.IBPluginDependency</string> <string>9035.IBPluginDependency</string>
<string>9036.IBPluginDependency</string> <string>9036.IBPluginDependency</string>
<string>9037.IBPluginDependency</string> <string>9037.IBPluginDependency</string>
<string>9038.IBPluginDependency</string>
<string>9039.IBPluginDependency</string> <string>9039.IBPluginDependency</string>
<string>904.IBPluginDependency</string> <string>904.IBPluginDependency</string>
<string>9040.IBPluginDependency</string> <string>9040.IBPluginDependency</string>
@ -64431,7 +64380,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2
<string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>{{329, 836}, {512, 20}}</string> <string>{{380, 836}, {512, 20}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
@ -65556,7 +65505,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2
<string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>{{599, 423}, {257, 413}}</string> <string>{{568, 423}, {257, 413}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
@ -66765,9 +66714,9 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2
<string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>{{307, 556}, {254, 262}}</string> <string>{{898, 620}, {254, 242}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>{{307, 556}, {254, 262}}</string> <string>{{898, 620}, {254, 242}}</string>
<boolean value="NO"/> <boolean value="NO"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<object class="NSMutableDictionary"> <object class="NSMutableDictionary">
@ -66871,7 +66820,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2
<string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1040"/> <integer value="1040"/>
<boolean value="YES"/> <boolean value="YES"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
@ -67353,7 +67301,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2
</object> </object>
</object> </object>
<nil key="sourceID"/> <nil key="sourceID"/>
<int key="maxID">10510</int> <int key="maxID">10516</int>
</object> </object>
<object class="IBClassDescriber" key="IBDocument.Classes"> <object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions"> <object class="NSMutableArray" key="referencedPartialClassDescriptions">

View File

@ -1596,17 +1596,18 @@ static std::unordered_map<NSScreen *, DisplayWindowController *> _screenMap; //
{ {
BOOL enable = YES; BOOL enable = YES;
const SEL theAction = [theItem action]; const SEL theAction = [theItem action];
CocoaDSCore *cdsCore = (CocoaDSCore *)[[emuControl cdsCoreController] content];
if (theAction == @selector(toggleExecutePause:)) if (theAction == @selector(toggleExecutePause:))
{ {
if (![emuControl masterExecuteFlag] || if (![cdsCore masterExecute] ||
[emuControl currentRom] == nil || [emuControl currentRom] == nil ||
[emuControl isUserInterfaceBlockingExecution]) [emuControl isUserInterfaceBlockingExecution])
{ {
enable = NO; enable = NO;
} }
if ([emuControl executionState] == ExecutionBehavior_Pause) if ([cdsCore coreState] == ExecutionBehavior_Pause)
{ {
[theItem setLabel:NSSTRING_TITLE_EXECUTE_CONTROL]; [theItem setLabel:NSSTRING_TITLE_EXECUTE_CONTROL];
[theItem setImage:[emuControl iconExecute]]; [theItem setImage:[emuControl iconExecute]];
@ -1619,10 +1620,10 @@ static std::unordered_map<NSScreen *, DisplayWindowController *> _screenMap; //
} }
else if (theAction == @selector(frameAdvance:)) else if (theAction == @selector(frameAdvance:))
{ {
if (![emuControl masterExecuteFlag] || if (![cdsCore masterExecute] ||
[emuControl currentRom] == nil || [emuControl currentRom] == nil ||
[emuControl isUserInterfaceBlockingExecution] || [emuControl isUserInterfaceBlockingExecution] ||
[emuControl executionState] != ExecutionBehavior_Pause) [cdsCore coreState] != ExecutionBehavior_Pause)
{ {
enable = NO; enable = NO;
} }
@ -1636,7 +1637,7 @@ static std::unordered_map<NSScreen *, DisplayWindowController *> _screenMap; //
} }
else if (theAction == @selector(changeCoreSpeed:)) else if (theAction == @selector(changeCoreSpeed:))
{ {
NSInteger speedScalar = (NSInteger)([emuControl speedScalar] * 100.0); NSInteger speedScalar = (NSInteger)([cdsCore speedScalar] * 100.0);
if (speedScalar != (NSInteger)(SPEED_SCALAR_NORMAL * 100.0)) if (speedScalar != (NSInteger)(SPEED_SCALAR_NORMAL * 100.0))
{ {

View File

@ -1,5 +1,5 @@
/* /*
Copyright (C) 2013-2015 DeSmuME Team Copyright (C) 2013-2017 DeSmuME Team
This file is free software: you can redistribute it and/or modify This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@ -77,15 +77,9 @@ class AudioSampleBlockGenerator;
NSURL *currentSaveStateURL; NSURL *currentSaveStateURL;
NSInteger selectedExportRomSaveID; NSInteger selectedExportRomSaveID;
NSInteger selectedRomSaveTypeID; NSInteger selectedRomSaveTypeID;
NSInteger frameJumpType;
NSInteger frameJumpFramesForward;
NSInteger frameJumpToFrame;
CGFloat lastSetSpeedScalar; CGFloat lastSetSpeedScalar;
BOOL isSoftwareMicActive;
BOOL isHardwareMicAvailable; BOOL isHardwareMicAvailable;
BOOL isHardwareMicIdle;
BOOL isHardwareMicInClip;
float currentMicGainValue; float currentMicGainValue;
BOOL isSoundMuted; BOOL isSoundMuted;
float lastSetVolumeValue; float lastSetVolumeValue;
@ -143,18 +137,12 @@ class AudioSampleBlockGenerator;
@property (readonly) NSImage *iconSpeedNormal; @property (readonly) NSImage *iconSpeedNormal;
@property (readonly) NSImage *iconSpeedDouble; @property (readonly) NSImage *iconSpeedDouble;
@property (readonly) BOOL masterExecuteFlag;
@property (readonly) NSInteger executionState;
@property (readonly) CGFloat lastSetSpeedScalar; @property (readonly) CGFloat lastSetSpeedScalar;
@property (readonly) CGFloat speedScalar;
@property (assign) BOOL isWorking; @property (assign) BOOL isWorking;
@property (assign) BOOL isRomLoading; @property (assign) BOOL isRomLoading;
@property (assign) NSString *statusText; @property (assign) NSString *statusText;
@property (assign) BOOL isSoftwareMicActive;
@property (assign) BOOL isHardwareMicAvailable; @property (assign) BOOL isHardwareMicAvailable;
@property (assign) BOOL isHardwareMicIdle;
@property (assign) BOOL isHardwareMicInClip;
@property (assign) float currentMicGainValue; @property (assign) float currentMicGainValue;
@property (assign) float currentVolumeValue; @property (assign) float currentVolumeValue;
@property (retain) NSImage *currentMicStatusIcon; @property (retain) NSImage *currentMicStatusIcon;
@ -165,9 +153,6 @@ class AudioSampleBlockGenerator;
@property (retain) NSURL *currentSaveStateURL; @property (retain) NSURL *currentSaveStateURL;
@property (assign) NSInteger selectedExportRomSaveID; @property (assign) NSInteger selectedExportRomSaveID;
@property (assign) NSInteger selectedRomSaveTypeID; @property (assign) NSInteger selectedRomSaveTypeID;
@property (assign) NSInteger frameJumpType;
@property (assign) NSInteger frameJumpFramesForward;
@property (assign) NSInteger frameJumpToFrame;
@property (retain) DisplayWindowController *mainWindow; @property (retain) DisplayWindowController *mainWindow;
@property (readonly) NSMutableArray *windowList; @property (readonly) NSMutableArray *windowList;

View File

@ -66,18 +66,12 @@
@synthesize iconSpeedNormal; @synthesize iconSpeedNormal;
@synthesize iconSpeedDouble; @synthesize iconSpeedDouble;
@dynamic masterExecuteFlag;
@dynamic executionState;
@synthesize lastSetSpeedScalar; @synthesize lastSetSpeedScalar;
@dynamic speedScalar;
@synthesize isWorking; @synthesize isWorking;
@synthesize isRomLoading; @synthesize isRomLoading;
@synthesize statusText; @synthesize statusText;
@synthesize isSoftwareMicActive;
@synthesize isHardwareMicAvailable; @synthesize isHardwareMicAvailable;
@synthesize isHardwareMicIdle;
@synthesize isHardwareMicInClip;
@synthesize currentMicGainValue; @synthesize currentMicGainValue;
@dynamic currentVolumeValue; @dynamic currentVolumeValue;
@synthesize currentMicStatusIcon; @synthesize currentMicStatusIcon;
@ -90,9 +84,6 @@
@synthesize currentSaveStateURL; @synthesize currentSaveStateURL;
@synthesize selectedExportRomSaveID; @synthesize selectedExportRomSaveID;
@synthesize selectedRomSaveTypeID; @synthesize selectedRomSaveTypeID;
@synthesize frameJumpType;
@synthesize frameJumpFramesForward;
@synthesize frameJumpToFrame;
@synthesize mainWindow; @synthesize mainWindow;
@synthesize windowList; @synthesize windowList;
@ -129,15 +120,9 @@
currentSaveStateURL = nil; currentSaveStateURL = nil;
selectedRomSaveTypeID = ROMSAVETYPE_AUTOMATIC; selectedRomSaveTypeID = ROMSAVETYPE_AUTOMATIC;
selectedExportRomSaveID = 0; selectedExportRomSaveID = 0;
frameJumpType = FrameJumpBehavior_Forward;
frameJumpFramesForward = 60;
frameJumpToFrame = 0;
lastSetSpeedScalar = 1.0f; lastSetSpeedScalar = 1.0f;
isSoftwareMicActive = NO;
isHardwareMicAvailable = NO; isHardwareMicAvailable = NO;
isHardwareMicIdle = YES;
isHardwareMicInClip = NO;
currentMicGainValue = 0.0f; currentMicGainValue = 0.0f;
isSoundMuted = NO; isSoundMuted = NO;
lastSetVolumeValue = MAX_VOLUME; lastSetVolumeValue = MAX_VOLUME;
@ -282,24 +267,6 @@
return theSpeaker; return theSpeaker;
} }
- (BOOL) masterExecuteFlag
{
CocoaDSCore *cdsCore = (CocoaDSCore *)[cdsCoreController content];
return [cdsCore masterExecute];
}
- (NSInteger) executionState
{
CocoaDSCore *cdsCore = (CocoaDSCore *)[cdsCoreController content];
return [cdsCore coreState];
}
- (CGFloat) speedScalar
{
CocoaDSCore *cdsCore = (CocoaDSCore *)[cdsCoreController content];
return [cdsCore speedScalar];
}
- (void) setCurrentVolumeValue:(float)vol - (void) setCurrentVolumeValue:(float)vol
{ {
currentVolumeValue = vol; currentVolumeValue = vol;
@ -1119,7 +1086,7 @@
const float sineWaveFrequency = cmdAttr.floatValue[0]; const float sineWaveFrequency = cmdAttr.floatValue[0];
[cdsController setSineWaveGeneratorFrequency:sineWaveFrequency]; [cdsController setSineWaveGeneratorFrequency:sineWaveFrequency];
NSString *audioFilePath = cmdAttr.object[0]; NSString *audioFilePath = (NSString *)cmdAttr.object[0];
[cdsController setSelectedAudioFileGenerator:[inputManager audioFileGeneratorFromFilePath:audioFilePath]]; [cdsController setSelectedAudioFileGenerator:[inputManager audioFileGeneratorFromFilePath:audioFilePath]];
} }
@ -1202,7 +1169,7 @@
return; return;
} }
const NSInteger slotNumber = (cmdAttr.useInputForSender) ? [CocoaDSUtil getIBActionSenderTag:cmdAttr.input.sender] : cmdAttr.intValue[0]; const NSInteger slotNumber = (cmdAttr.useInputForSender) ? [CocoaDSUtil getIBActionSenderTag:(id)cmdAttr.input.object] : cmdAttr.intValue[0];
if (slotNumber < 0 || slotNumber > MAX_SAVESTATE_SLOTS) if (slotNumber < 0 || slotNumber > MAX_SAVESTATE_SLOTS)
{ {
return; return;
@ -1247,7 +1214,7 @@
return; return;
} }
const NSInteger slotNumber = (cmdAttr.useInputForSender) ? [CocoaDSUtil getIBActionSenderTag:cmdAttr.input.sender] : cmdAttr.intValue[0]; const NSInteger slotNumber = (cmdAttr.useInputForSender) ? [CocoaDSUtil getIBActionSenderTag:(id)cmdAttr.input.object] : cmdAttr.intValue[0];
if (slotNumber < 0 || slotNumber > MAX_SAVESTATE_SLOTS) if (slotNumber < 0 || slotNumber > MAX_SAVESTATE_SLOTS)
{ {
return; return;
@ -1283,7 +1250,7 @@
return; return;
} }
const double relativeDegrees = (cmdAttr.useInputForSender) ? (double)[CocoaDSUtil getIBActionSenderTag:cmdAttr.input.sender] : (double)cmdAttr.intValue[0]; const double relativeDegrees = (cmdAttr.useInputForSender) ? (double)[CocoaDSUtil getIBActionSenderTag:(id)cmdAttr.input.object] : (double)cmdAttr.intValue[0];
const double angleDegrees = [mainWindow displayRotation] + relativeDegrees; const double angleDegrees = [mainWindow displayRotation] + relativeDegrees;
[mainWindow setDisplayRotation:angleDegrees]; [mainWindow setDisplayRotation:angleDegrees];
} }
@ -1429,7 +1396,7 @@
CommandAttributes cmdAttr; CommandAttributes cmdAttr;
[cmdAttrValue getValue:&cmdAttr]; [cmdAttrValue getValue:&cmdAttr];
if (cmdAttr.input.state == INPUT_ATTRIBUTE_STATE_OFF || [self currentRom] == nil) if ( (cmdAttr.input.state == INPUT_ATTRIBUTE_STATE_OFF) || ([self currentRom] == nil) )
{ {
return; return;
} }
@ -1451,7 +1418,7 @@
CommandAttributes cmdAttr; CommandAttributes cmdAttr;
[cmdAttrValue getValue:&cmdAttr]; [cmdAttrValue getValue:&cmdAttr];
if (cmdAttr.input.state == INPUT_ATTRIBUTE_STATE_OFF || [self currentRom] == nil) if ( (cmdAttr.input.state == INPUT_ATTRIBUTE_STATE_OFF) || ([self currentRom] == nil) )
{ {
return; return;
} }
@ -1464,7 +1431,7 @@
CommandAttributes cmdAttr; CommandAttributes cmdAttr;
[cmdAttrValue getValue:&cmdAttr]; [cmdAttrValue getValue:&cmdAttr];
if (cmdAttr.input.state == INPUT_ATTRIBUTE_STATE_OFF || [self currentRom] == nil) if ( (cmdAttr.input.state == INPUT_ATTRIBUTE_STATE_OFF) || ([self currentRom] == nil) )
{ {
return; return;
} }
@ -1479,7 +1446,9 @@
CocoaDSCore *cdsCore = (CocoaDSCore *)[cdsCoreController content]; CocoaDSCore *cdsCore = (CocoaDSCore *)[cdsCoreController content];
if (cmdAttr.input.state == INPUT_ATTRIBUTE_STATE_OFF || [cdsCore coreState] != ExecutionBehavior_Pause || [self currentRom] == nil) if ( (cmdAttr.input.state == INPUT_ATTRIBUTE_STATE_OFF) ||
([cdsCore coreState] != ExecutionBehavior_Pause) ||
([self currentRom] == nil) )
{ {
return; return;
} }
@ -1492,34 +1461,15 @@
CommandAttributes cmdAttr; CommandAttributes cmdAttr;
[cmdAttrValue getValue:&cmdAttr]; [cmdAttrValue getValue:&cmdAttr];
if (cmdAttr.input.state == INPUT_ATTRIBUTE_STATE_OFF || [self currentRom] == nil) if ( (cmdAttr.input.state == INPUT_ATTRIBUTE_STATE_OFF) || ([self currentRom] == nil) )
{ {
return; return;
} }
CocoaDSCore *cdsCore = (CocoaDSCore *)[cdsCoreController content];
[executionControlWindow makeFirstResponder:nil]; [executionControlWindow makeFirstResponder:nil];
NSUInteger jumpFrames = 0;
switch ([self frameJumpType]) CocoaDSCore *cdsCore = (CocoaDSCore *)[cdsCoreController content];
{ [cdsCore setCoreState:ExecutionBehavior_FrameJump];
case FrameJumpBehavior_Forward:
jumpFrames = [self frameJumpFramesForward];
[cdsCore frameJump:jumpFrames];
break;
case FrameJumpBehavior_ToFrame:
jumpFrames = [self frameJumpToFrame];
[cdsCore frameJumpTo:jumpFrames];
break;
case FrameJumpBehavior_NextMarker:
// TODO: Support when replay markers are implemented.
break;
default:
break;
}
} }
- (void) cmdReset:(NSValue *)cmdAttrValue - (void) cmdReset:(NSValue *)cmdAttrValue
@ -1527,13 +1477,11 @@
CommandAttributes cmdAttr; CommandAttributes cmdAttr;
[cmdAttrValue getValue:&cmdAttr]; [cmdAttrValue getValue:&cmdAttr];
if (cmdAttr.input.state == INPUT_ATTRIBUTE_STATE_OFF || [self currentRom] == nil) if ( (cmdAttr.input.state == INPUT_ATTRIBUTE_STATE_OFF) || ([self currentRom] == nil) )
{ {
return; return;
} }
CocoaDSCore *cdsCore = (CocoaDSCore *)[cdsCoreController content];
[self setStatusText:NSSTRING_STATUS_EMULATOR_RESETTING]; [self setStatusText:NSSTRING_STATUS_EMULATOR_RESETTING];
[self setIsWorking:YES]; [self setIsWorking:YES];
@ -1542,6 +1490,7 @@
[[windowController window] displayIfNeeded]; [[windowController window] displayIfNeeded];
} }
CocoaDSCore *cdsCore = (CocoaDSCore *)[cdsCoreController content];
[cdsCore reset]; [cdsCore reset];
for (DisplayWindowController *windowController in windowList) for (DisplayWindowController *windowController in windowList)
@ -1598,7 +1547,7 @@
} }
CocoaDSCore *cdsCore = (CocoaDSCore *)[cdsCoreController content]; CocoaDSCore *cdsCore = (CocoaDSCore *)[cdsCoreController content];
const NSInteger bitNumber = (cmdAttr.useInputForSender) ? [CocoaDSUtil getIBActionSenderTag:cmdAttr.input.sender] : cmdAttr.intValue[0]; const NSInteger bitNumber = (cmdAttr.useInputForSender) ? [CocoaDSUtil getIBActionSenderTag:(id)cmdAttr.input.object] : cmdAttr.intValue[0];
const UInt32 flagBit = [cdsCore.cdsGPU gpuStateFlags] ^ (1 << bitNumber); const UInt32 flagBit = [cdsCore.cdsGPU gpuStateFlags] ^ (1 << bitNumber);
[cdsCore.cdsGPU setGpuStateFlags:flagBit]; [cdsCore.cdsGPU setGpuStateFlags:flagBit];
@ -1998,7 +1947,7 @@
CocoaDSController *cdsController = [cdsCore cdsController]; CocoaDSController *cdsController = [cdsCore cdsController];
NSImage *micIcon = iconMicDisabled; NSImage *micIcon = iconMicDisabled;
if ([self isSoftwareMicActive]) if ([cdsController softwareMicState])
{ {
micIcon = iconMicManualOverride; micIcon = iconMicManualOverride;
} }
@ -2006,11 +1955,11 @@
{ {
if ([cdsController isHardwareMicAvailable]) if ([cdsController isHardwareMicAvailable])
{ {
if ([self isHardwareMicInClip]) if ([cdsController isHardwareMicInClip])
{ {
micIcon = iconMicInClip; micIcon = iconMicInClip;
} }
else if ([self isHardwareMicIdle]) else if ([cdsController isHardwareMicIdle])
{ {
micIcon = iconMicIdle; micIcon = iconMicIdle;
} }
@ -2304,11 +2253,6 @@
} }
else if (theAction == @selector(frameAdvance:)) else if (theAction == @selector(frameAdvance:))
{ {
if ([cdsCore coreState] != ExecutionBehavior_Pause)
{
enable = NO;
}
if ([cdsCore coreState] != ExecutionBehavior_Pause || if ([cdsCore coreState] != ExecutionBehavior_Pause ||
![cdsCore masterExecute] || ![cdsCore masterExecute] ||
[self currentRom] == nil || [self currentRom] == nil ||
@ -2534,9 +2478,6 @@
- (void) doMicLevelUpdateFromController:(CocoaDSController *)cdsController - (void) doMicLevelUpdateFromController:(CocoaDSController *)cdsController
{ {
[self setIsSoftwareMicActive:[cdsController softwareMicState]];
[self setIsHardwareMicIdle:[cdsController isHardwareMicIdle]];
[self setIsHardwareMicInClip:[cdsController isHardwareMicInClip]];
[self updateMicStatusIcon]; [self updateMicStatusIcon];
} }

View File

@ -66,7 +66,7 @@ typedef struct
float floatCoordX; // The X-coordinate as a float for commands that require a location float floatCoordX; // The X-coordinate as a float for commands that require a location
float floatCoordY; // The Y-coordinate as a float for commands that require a location float floatCoordY; // The Y-coordinate as a float for commands that require a location
float scalar; // A scalar value for commands that require a scalar float scalar; // A scalar value for commands that require a scalar
id sender; // An object for commands that require an object void *object; // An object for commands that require an object
} InputAttributes; } InputAttributes;
typedef struct typedef struct
@ -75,7 +75,7 @@ typedef struct
SEL selector; // The selector that is called on command dispatch SEL selector; // The selector that is called on command dispatch
int32_t intValue[4]; // Context dependent int values int32_t intValue[4]; // Context dependent int values
float floatValue[4]; // Context dependent float values float floatValue[4]; // Context dependent float values
id object[4]; // Context dependent objects void *object[4]; // Context dependent objects
bool useInputForIntCoord; // The command will prefer the input device's int coordinate bool useInputForIntCoord; // The command will prefer the input device's int coordinate
bool useInputForFloatCoord; // The command will prefer the input device's float coordinate bool useInputForFloatCoord; // The command will prefer the input device's float coordinate

View File

@ -453,7 +453,7 @@ InputAttributes InputAttributesOfHIDValue(IOHIDValueRef hidValueRef)
inputAttr.floatCoordX = 0.0f; inputAttr.floatCoordX = 0.0f;
inputAttr.floatCoordY = 0.0f; inputAttr.floatCoordY = 0.0f;
inputAttr.scalar = (float)(logicalValue - logicalMin) / (float)(logicalMax - logicalMin); inputAttr.scalar = (float)(logicalValue - logicalMin) / (float)(logicalMax - logicalMin);
inputAttr.sender = nil; inputAttr.object = nil;
if (!inputAttr.isAnalog) if (!inputAttr.isAnalog)
{ {
@ -2156,10 +2156,10 @@ NSMutableDictionary* DeviceInfoDictionaryWithCommandAttributes(const CommandAttr
nil]; nil];
// Set the object references last since these could be nil. // Set the object references last since these could be nil.
[newDeviceInfo setValue:cmdAttr->object[0] forKey:@"object0"]; [newDeviceInfo setValue:(id)cmdAttr->object[0] forKey:@"object0"];
[newDeviceInfo setValue:cmdAttr->object[1] forKey:@"object1"]; [newDeviceInfo setValue:(id)cmdAttr->object[1] forKey:@"object1"];
[newDeviceInfo setValue:cmdAttr->object[2] forKey:@"object2"]; [newDeviceInfo setValue:(id)cmdAttr->object[2] forKey:@"object2"];
[newDeviceInfo setValue:cmdAttr->object[3] forKey:@"object3"]; [newDeviceInfo setValue:(id)cmdAttr->object[3] forKey:@"object3"];
return newDeviceInfo; return newDeviceInfo;
} }
@ -2217,7 +2217,7 @@ InputAttributes InputManagerEncodeKeyboardInput(const unsigned short keyCode, BO
inputAttr.floatCoordX = 0.0f; inputAttr.floatCoordX = 0.0f;
inputAttr.floatCoordY = 0.0f; inputAttr.floatCoordY = 0.0f;
inputAttr.scalar = (keyPressed) ? 1.0f : 0.0f; inputAttr.scalar = (keyPressed) ? 1.0f : 0.0f;
inputAttr.sender = nil; inputAttr.object = nil;
return inputAttr; return inputAttr;
} }
@ -2255,7 +2255,7 @@ InputAttributes InputManagerEncodeMouseButtonInput(const NSInteger buttonNumber,
inputAttr.floatCoordX = touchLoc.x; inputAttr.floatCoordX = touchLoc.x;
inputAttr.floatCoordY = touchLoc.y; inputAttr.floatCoordY = touchLoc.y;
inputAttr.scalar = (buttonPressed) ? 1.0f : 0.0f; inputAttr.scalar = (buttonPressed) ? 1.0f : 0.0f;
inputAttr.sender = nil; inputAttr.object = nil;
return inputAttr; return inputAttr;
} }
@ -2275,7 +2275,7 @@ InputAttributes InputManagerEncodeIBAction(const SEL theSelector, id sender)
inputAttr.floatCoordX = 0.0f; inputAttr.floatCoordX = 0.0f;
inputAttr.floatCoordY = 0.0f; inputAttr.floatCoordY = 0.0f;
inputAttr.scalar = 1.0f; inputAttr.scalar = 1.0f;
inputAttr.sender = sender; inputAttr.object = sender;
return inputAttr; return inputAttr;
} }