2015-12-24 17:36:41 +00:00
|
|
|
//
|
|
|
|
// 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
|
|
|
|
|
2015-12-29 11:00:34 +00:00
|
|
|
@synthesize paused = _paused;
|
|
|
|
|
2015-12-24 17:36:41 +00:00
|
|
|
- (void)viewDidLoad {
|
|
|
|
[super viewDidLoad];
|
2015-12-24 22:21:30 +00:00
|
|
|
// [self mainToolBar ];
|
2015-12-24 17:36:41 +00:00
|
|
|
// Do any additional setup after loading the view.
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)didReceiveMemoryWarning {
|
|
|
|
[super didReceiveMemoryWarning];
|
|
|
|
// Dispose of any resources that can be recreated.
|
|
|
|
}
|
|
|
|
|
2015-12-29 11:00:34 +00:00
|
|
|
|
2015-12-24 17:36:41 +00:00
|
|
|
#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.
|
2015-12-31 21:52:25 +00:00
|
|
|
cpu_pause();
|
2015-12-24 17:36:41 +00:00
|
|
|
}
|
2015-12-29 11:00:34 +00:00
|
|
|
|
|
|
|
|
2016-01-01 10:22:18 +00:00
|
|
|
- (IBAction)unwindForSegue:(UIStoryboardSegue*)sender
|
2015-12-31 21:52:25 +00:00
|
|
|
{
|
|
|
|
cpu_resume();
|
|
|
|
}
|
2016-01-03 15:06:53 +00:00
|
|
|
- (IBAction)upSwipe:(id)sender
|
|
|
|
{
|
|
|
|
self.mainToolBar.hidden=NO;
|
|
|
|
}
|
2015-12-29 11:00:34 +00:00
|
|
|
|
2015-12-30 16:03:29 +00:00
|
|
|
- (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]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-12-27 18:16:47 +00:00
|
|
|
-(IBAction)rebootItemSelected:(id)sender{
|
2015-12-24 17:36:41 +00:00
|
|
|
cpu65_reboot();
|
|
|
|
}
|
|
|
|
|
2015-12-27 18:16:47 +00:00
|
|
|
-(IBAction)prefsItemSelected:(id)sender{
|
|
|
|
cpu_pause();
|
2015-12-29 21:05:01 +00:00
|
|
|
//[self.viewPrefs ];
|
2015-12-24 17:36:41 +00:00
|
|
|
//pause
|
|
|
|
//show pref windows
|
2015-12-27 18:16:47 +00:00
|
|
|
cpu_resume();
|
2015-12-24 17:36:41 +00:00
|
|
|
}
|
|
|
|
|
2015-12-29 11:00:34 +00:00
|
|
|
- (IBAction)toggleCPUSpeedItemSelected:(id)sender
|
2015-12-24 17:36:41 +00:00
|
|
|
{
|
|
|
|
cpu_pause();
|
|
|
|
timing_toggleCPUSpeed();
|
2017-09-14 03:27:42 +00:00
|
|
|
video_animation_s *anim = video_getAnimationDriver();
|
|
|
|
if (anim && anim->animation_showCPUSpeed)
|
2015-12-24 17:36:41 +00:00
|
|
|
{
|
2017-09-14 03:27:42 +00:00
|
|
|
anim->animation_showCPUSpeed();
|
2015-12-24 17:36:41 +00:00
|
|
|
}
|
|
|
|
cpu_resume();
|
|
|
|
}
|
2015-12-29 11:00:34 +00:00
|
|
|
|
|
|
|
- (IBAction)togglePauseItemSelected:(id)sender
|
|
|
|
{
|
|
|
|
NSAssert(pthread_main_np(), @"Pause emulation called from non-main thread");
|
|
|
|
self.paused = !_paused;
|
|
|
|
}
|
2017-09-14 03:27:42 +00:00
|
|
|
|
2015-12-29 11:00:34 +00:00
|
|
|
- (void)setPaused:(BOOL)paused
|
|
|
|
{
|
|
|
|
if (_paused == paused)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
_paused = paused;
|
|
|
|
if (paused)
|
|
|
|
{
|
2017-09-14 03:27:42 +00:00
|
|
|
cpu_pause();
|
2015-12-29 11:00:34 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
cpu_resume();
|
|
|
|
}
|
2017-09-14 03:27:42 +00:00
|
|
|
|
|
|
|
video_animation_s *anim = video_getAnimationDriver();
|
|
|
|
if (anim && anim->animation_showPaused)
|
2015-12-29 11:00:34 +00:00
|
|
|
{
|
2017-09-14 03:27:42 +00:00
|
|
|
anim->animation_showPaused();
|
2015-12-29 11:00:34 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-01-03 15:06:53 +00:00
|
|
|
- (void)dealloc {
|
|
|
|
[super dealloc];
|
|
|
|
}
|
2015-12-24 17:36:41 +00:00
|
|
|
@end
|