Cocoa Port:

- Add the following toolbar items: Frame Advance, Enable/Disable HUD, Toggle Displays
This commit is contained in:
rogerman 2016-02-12 06:51:34 +00:00
parent 25f33c54ba
commit e8f660b381
3 changed files with 3101 additions and 2865 deletions

File diff suppressed because it is too large Load Diff

View File

@ -168,6 +168,7 @@ class OGLVideoOutput;
- (IBAction) changeVolume:(id)sender;
- (IBAction) toggleExecutePause:(id)sender;
- (IBAction) frameAdvance:(id)sender;
- (IBAction) reset:(id)sender;
- (IBAction) changeCoreSpeed:(id)sender;
- (IBAction) openRom:(id)sender;
@ -194,6 +195,7 @@ class OGLVideoOutput;
- (IBAction) toggleShowHUDInput:(id)sender;
- (IBAction) toggleShowHUDCPULoadAverage:(id)sender;
- (IBAction) toggleShowHUDRealTimeClock:(id)sender;
- (IBAction) toggleNDSDisplays:(id)sender;
- (IBAction) toggleKeepMinDisplaySizeAtNormal:(id)sender;
- (IBAction) toggleStatusBar:(id)sender;
- (IBAction) toggleFullScreenDisplay:(id)sender;

View File

@ -823,6 +823,11 @@ static std::unordered_map<NSScreen *, DisplayWindowController *> _screenMap; //
[emuControl toggleExecutePause:sender];
}
- (IBAction) frameAdvance:(id)sender
{
[emuControl frameAdvance:sender];
}
- (IBAction) reset:(id)sender
{
[emuControl reset:sender];
@ -941,6 +946,11 @@ static std::unordered_map<NSScreen *, DisplayWindowController *> _screenMap; //
[self setVideoPixelScaler:[CocoaDSUtil getIBActionSenderTag:sender]];
}
- (IBAction) toggleNDSDisplays:(id)sender
{
[self setDisplayOrder:([self displayOrder] == DS_DISPLAY_ORDER_MAIN_FIRST) ? DS_DISPLAY_ORDER_TOUCH_FIRST : DS_DISPLAY_ORDER_MAIN_FIRST];
}
- (IBAction) writeDefaultsDisplayRotation:(id)sender
{
[[NSUserDefaults standardUserDefaults] setDouble:[self displayRotation] forKey:@"DisplayView_Rotation"];
@ -1467,6 +1477,16 @@ static std::unordered_map<NSScreen *, DisplayWindowController *> _screenMap; //
[theItem setLabel:NSSTRING_TITLE_PAUSE_CONTROL];
[theItem setImage:[emuControl iconPause]];
}
}
else if (theAction == @selector(frameAdvance:))
{
if (![emuControl masterExecuteFlag] ||
[emuControl currentRom] == nil ||
[emuControl isUserInterfaceBlockingExecution] ||
[emuControl executionState] != CORESTATE_PAUSE)
{
enable = NO;
}
}
else if (theAction == @selector(reset:))
{
@ -1479,7 +1499,7 @@ static std::unordered_map<NSScreen *, DisplayWindowController *> _screenMap; //
{
NSInteger speedScalar = (NSInteger)([emuControl speedScalar] * 100.0);
if (speedScalar == (NSInteger)(SPEED_SCALAR_DOUBLE * 100.0))
if (speedScalar != (NSInteger)(SPEED_SCALAR_NORMAL * 100.0))
{
[theItem setLabel:NSSTRING_TITLE_SPEED_1X];
[theItem setTag:100];
@ -1499,6 +1519,18 @@ static std::unordered_map<NSScreen *, DisplayWindowController *> _screenMap; //
enable = NO;
}
}
else if (theAction == @selector(toggleHUDVisibility:))
{
if ([[self view] isHUDVisible])
{
[theItem setLabel:NSSTRING_TITLE_DISABLE_HUD];
}
else
{
[theItem setLabel:NSSTRING_TITLE_ENABLE_HUD];
}
}
return enable;
}