diff --git a/MA2ME/AppDelegate.m b/MA2ME/AppDelegate.m
index 8d072fb..81c580d 100644
--- a/MA2ME/AppDelegate.m
+++ b/MA2ME/AppDelegate.m
@@ -23,6 +23,7 @@
/* kvo */
@property NSString *commandLine;
+@property NSArray *args;
@property NSString *mameROM;
@property BOOL mameWindow;
@@ -135,9 +136,10 @@ static NSString * JoinArguments(NSArray *argv) {
NSMutableString *rv = [NSMutableString new];
- unsigned ix = 0;
+ //unsigned ix = 0;
+ [rv appendString: @"mame"];
for (NSString *s in argv) {
- if (ix++) [rv appendString: @" "];
+ [rv appendString: @" "];
NSUInteger l = [s length];
if (!l) {
@@ -194,7 +196,7 @@ static NSString * JoinArguments(NSArray *argv) {
NSMutableArray *argv = [NSMutableArray new];
- [argv addObject: @"mame"];
+ //[argv addObject: @"mame"];
[argv addObject: _mameROM];
if (_mameDebug) [argv addObject: @"-debug"];
@@ -225,23 +227,25 @@ static NSString * JoinArguments(NSArray *argv) {
}
}
-
+ // -speed n
+ // -scale n
- NSArray *args;
- args = [_slotController args];
- if ([args count]) {
- [argv addObjectsFromArray: args];
+ NSArray *tmp;
+ tmp = [_slotController args];
+ if ([tmp count]) {
+ [argv addObjectsFromArray: tmp];
}
-
- args = [_mediaController args];
- if ([args count]) {
- [argv addObjectsFromArray: args];
+
+ tmp = [_mediaController args];
+ if ([tmp count]) {
+ [argv addObjectsFromArray: tmp];
}
if (_mameNoThrottle) [argv addObject: @"-nothrottle"];
[self setCommandLine: JoinArguments(argv)]; //[argv componentsJoinedByString:@" "]];
+ [self setArgs: argv];
}
-(IBAction)modelClick:(id)sender {
@@ -323,6 +327,26 @@ static NSString * JoinArguments(NSArray *argv) {
return [a count];
}
+#pragma mark - IBActions
+
+- (IBAction)launchAction:(id)sender {
+ if (![_args count]) return;
+
+ NSError *error = nil;
+ NSURL *url = [NSURL fileURLWithPath: @"/usr/local/bin/mame"];
+
+ NSTask *task = [NSTask launchedTaskWithExecutableURL: url
+ arguments: _args
+ error: &error
+ terminationHandler: ^(NSTask *t){
+
+
+
+
+ }];
+ if (error) NSLog(@"launchAction: %@", error);
+}
+
@end
diff --git a/MA2ME/Base.lproj/MainMenu.xib b/MA2ME/Base.lproj/MainMenu.xib
index 1afc79d..ae31839 100644
--- a/MA2ME/Base.lproj/MainMenu.xib
+++ b/MA2ME/Base.lproj/MainMenu.xib
@@ -740,6 +740,9 @@
+
+
+