mirror of
https://github.com/mauiaaron/apple2.git
synced 2025-08-05 16:25:12 +00:00
IOS Stuff
This commit is contained in:
@@ -10,12 +10,13 @@
|
||||
#import "iosPrefControllerViewController.h"
|
||||
|
||||
@interface AppleViewController : UIViewController
|
||||
|
||||
@property (nonatomic, assign) BOOL paused;
|
||||
@property (assign) IBOutlet UIToolbar *mainToolBar;
|
||||
@property (assign) IBOutlet iosPrefControllerViewController *viewPrefs;
|
||||
|
||||
-(IBAction)rebootItemSelected:(id)sender;
|
||||
-(IBAction)prefsItemSelected:(id)sender;
|
||||
-(IBAction)toggleCPUSpeedItemSelected:(id)sender;
|
||||
-(IBAction)togglePauseItemSelected:(id)sender;
|
||||
|
||||
@end
|
||||
|
@@ -16,6 +16,8 @@
|
||||
|
||||
@implementation AppleViewController
|
||||
|
||||
@synthesize paused = _paused;
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// [self mainToolBar ];
|
||||
@@ -27,7 +29,7 @@
|
||||
// Dispose of any resources that can be recreated.
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
#pragma mark - Navigation
|
||||
|
||||
// In a storyboard-based application, you will often want to do a little preparation before navigation
|
||||
@@ -35,19 +37,24 @@
|
||||
// Get the new view controller using [segue destinationViewController].
|
||||
// Pass the selected object to the new view controller.
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
- (IBAction)unwindToMainViewController:(UIStoryboardSegue*)sender
|
||||
{ }
|
||||
|
||||
-(IBAction)rebootItemSelected:(id)sender{
|
||||
cpu65_reboot();
|
||||
}
|
||||
|
||||
-(IBAction)prefsItemSelected:(id)sender{
|
||||
cpu_pause();
|
||||
[self.viewPrefs ];
|
||||
//pause
|
||||
//show pref windows
|
||||
cpu_resume();
|
||||
}
|
||||
|
||||
- (IBAction)toggleCPUSpeedItem:(id)sender
|
||||
- (IBAction)toggleCPUSpeedItemSelected:(id)sender
|
||||
{
|
||||
cpu_pause();
|
||||
timing_toggleCPUSpeed();
|
||||
@@ -57,4 +64,32 @@
|
||||
}
|
||||
cpu_resume();
|
||||
}
|
||||
|
||||
- (IBAction)togglePauseItemSelected:(id)sender
|
||||
{
|
||||
NSAssert(pthread_main_np(), @"Pause emulation called from non-main thread");
|
||||
self.paused = !_paused;
|
||||
}
|
||||
- (void)setPaused:(BOOL)paused
|
||||
{
|
||||
if (_paused == paused)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_paused = paused;
|
||||
if (paused)
|
||||
{
|
||||
cpu_pause();
|
||||
}
|
||||
else
|
||||
{
|
||||
cpu_resume();
|
||||
}
|
||||
if (video_backend && video_backend->animation_showPaused)
|
||||
{
|
||||
video_backend->animation_showPaused();
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
@@ -17,7 +17,7 @@
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<toolbar opaque="NO" clearsContextBeforeDrawing="NO" contentMode="center" ambiguous="YES" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="MKz-35-wcI">
|
||||
<rect key="frame" x="0.0" y="568" width="600" height="32"/>
|
||||
<rect key="frame" x="-13" y="568" width="600" height="32"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="32" id="FMY-Nk-ouC"/>
|
||||
</constraints>
|
||||
@@ -34,7 +34,12 @@
|
||||
</barButtonItem>
|
||||
<barButtonItem title="Prefs" id="80q-oc-naJ">
|
||||
<connections>
|
||||
<action selector="prefsItemSelected:" destination="dkx-z0-nzr" id="dWF-4y-caU"/>
|
||||
<action selector="prefsItemSelected:" destination="dkx-z0-nzr" id="L1Z-h1-i72"/>
|
||||
</connections>
|
||||
</barButtonItem>
|
||||
<barButtonItem title="Pause" id="XF9-t2-IEl">
|
||||
<connections>
|
||||
<action selector="togglePauseItemSelected:" destination="dkx-z0-nzr" id="qVs-rI-2r2"/>
|
||||
</connections>
|
||||
</barButtonItem>
|
||||
</items>
|
||||
@@ -79,12 +84,18 @@
|
||||
<rect key="frame" x="143" y="196" width="46" height="30"/>
|
||||
<state key="normal" title="Button"/>
|
||||
</button>
|
||||
<toolbar opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="lfx-xk-tV7">
|
||||
<rect key="frame" x="0.0" y="556" width="600" height="44"/>
|
||||
<navigationBar contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="xl4-DT-0Un">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="44"/>
|
||||
<items>
|
||||
<barButtonItem title="OK" id="tk3-AG-KR8"/>
|
||||
<navigationItem title="Preferences" id="4Dl-i2-erE">
|
||||
<barButtonItem key="leftBarButtonItem" title="Back" id="LNc-VH-VvX">
|
||||
<connections>
|
||||
<segue destination="BYZ-38-t0r" kind="show" id="Qgp-u4-61g"/>
|
||||
</connections>
|
||||
</barButtonItem>
|
||||
</navigationItem>
|
||||
</items>
|
||||
</toolbar>
|
||||
</navigationBar>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
</view>
|
||||
@@ -97,6 +108,7 @@
|
||||
<!--View Controller-->
|
||||
<scene sceneID="7d6-Zt-X84">
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="3aI-5Q-HSv" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
<viewController storyboardIdentifier="MainMenu" id="jav-c9-0Cp" sceneMemberID="viewController">
|
||||
<layoutGuides>
|
||||
<viewControllerLayoutGuide type="top" id="rug-Qe-ZFP"/>
|
||||
@@ -116,7 +128,6 @@
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
</view>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="3aI-5Q-HSv" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="1058" y="605"/>
|
||||
</scene>
|
||||
|
Reference in New Issue
Block a user