apple2ix/Apple2Mac/Apple2Mac/AppleViewController.m
Aaron Culliney 570147712c Get Mac and iOS builds working again
- iOS build is still super Alpha ;)
2017-09-13 20:27:42 -07:00

125 lines
2.7 KiB
Objective-C

//
// AppleViewController.m
// Apple2Mac
//
// Created by Jerome Vernet on 24/12/2015.
// Copyright © 2015 deadc0de.org. All rights reserved.
//
#import "AppleViewController.h"
#import "common.h"
#import "modelUtil.h"
@interface AppleViewController ()
@end
@implementation AppleViewController
@synthesize paused = _paused;
- (void)viewDidLoad {
[super viewDidLoad];
// [self mainToolBar ];
// Do any additional setup after loading the view.
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// 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
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
cpu_pause();
}
- (IBAction)unwindForSegue:(UIStoryboardSegue*)sender
{
cpu_resume();
}
- (IBAction)upSwipe:(id)sender
{
self.mainToolBar.hidden=NO;
}
- (IBAction)diskInsert:(id)sender
{
NSLog(@"LISTING ALL FILES FOUND");
int Count;
NSString *path;
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
path = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"Disks"];
NSArray *directoryContent = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:path error:NULL];
for (Count = 0; Count < (int)[directoryContent count]; Count++)
{
NSLog(@"File %d: %@", (Count + 1), [directoryContent objectAtIndex:Count]);
}
}
-(IBAction)rebootItemSelected:(id)sender{
cpu65_reboot();
}
-(IBAction)prefsItemSelected:(id)sender{
cpu_pause();
//[self.viewPrefs ];
//pause
//show pref windows
cpu_resume();
}
- (IBAction)toggleCPUSpeedItemSelected:(id)sender
{
cpu_pause();
timing_toggleCPUSpeed();
video_animation_s *anim = video_getAnimationDriver();
if (anim && anim->animation_showCPUSpeed)
{
anim->animation_showCPUSpeed();
}
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();
}
video_animation_s *anim = video_getAnimationDriver();
if (anim && anim->animation_showPaused)
{
anim->animation_showPaused();
}
}
- (void)dealloc {
[super dealloc];
}
@end