Compare commits

..
8 Commits
Author SHA1 Message Date
Kelvin Sherlock a653ca575b Bump version, add credits. 2020-08-31 19:09:21 -04:00
Kelvin Sherlock 48513422f5 add some mame build notes so I don't forget. 2020-08-31 18:33:58 -04:00
Kelvin Sherlock 598e95a6ca embed mame and sdl2 framework.
components will NOT be included in the repository.
2020-08-31 18:24:41 -04:00
Kelvin Sherlock 348353199f Change wording on system mame preference.
disable path when using standard mame
new functions to calculate mame executable path.
2020-08-31 18:23:48 -04:00
Kelvin Sherlock 1f47c7be88 git ignore. 2020-08-31 18:20:52 -04:00
Kelvin Sherlock 931488ac4c move log window to proper location. 2020-08-31 18:20:42 -04:00
Kelvin Sherlock 337b3eb1f2 Preferences Window Controller
validate the Mame executable path
option for system mame (doesn't do anything yet...)
2020-08-31 17:14:05 -04:00
Kelvin Sherlock 3cbc69bf38 improved error logging if mame can't be launched. 2020-08-31 16:39:48 -04:00
13 changed files with 285 additions and 20 deletions

No files matched your search

+3
View File
@@ -0,0 +1,3 @@
dist
embedded/mame64
embedded/SDL2.framework
+83 -3
View File
@@ -61,6 +61,11 @@
B64E15A924EA1D5300E8AD3D /* MachineViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B64E15A824EA1D5300E8AD3D /* MachineViewController.m */; };
B65593B124ECB61800722E0C /* SlotViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B65593B024ECB61800722E0C /* SlotViewController.m */; };
B658DBF324FB58EC0063AB5F /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = B6BA258624E99BEB005FB8FF /* Info.plist */; };
B66236A924FD9A34006CABD7 /* PreferencesWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = B66236A824FD9A34006CABD7 /* PreferencesWindowController.m */; };
B66236B424FDA527006CABD7 /* SDL2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B66236B224FDA522006CABD7 /* SDL2.framework */; };
B66236B524FDA527006CABD7 /* SDL2.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = B66236B224FDA522006CABD7 /* SDL2.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
B66236BC24FDA72E006CABD7 /* mame64 in CopyFiles */ = {isa = PBXBuildFile; fileRef = B66236B724FDA686006CABD7 /* mame64 */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
B66236C124FDB7A6006CABD7 /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = B66236BF24FDB7A6006CABD7 /* Credits.rtf */; };
B6BA258024E99BE9005FB8FF /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = B6BA257F24E99BE9005FB8FF /* AppDelegate.m */; };
B6BA258224E99BEB005FB8FF /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B6BA258124E99BEB005FB8FF /* Assets.xcassets */; };
B6BA258524E99BEB005FB8FF /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = B6BA258324E99BEB005FB8FF /* MainMenu.xib */; };
@@ -71,10 +76,34 @@
B6D6DE4124FADFAC00661A5F /* LaunchWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = B6D6DE4024FADFAC00661A5F /* LaunchWindowController.m */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
B66236B124FDA443006CABD7 /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
B66236B524FDA527006CABD7 /* SDL2.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
};
B66236BB24FDA71D006CABD7 /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 6;
files = (
B66236BC24FDA72E006CABD7 /* mame64 in CopyFiles */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
B6004DED24FB05D600D38596 /* LogWindowController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LogWindowController.h; sourceTree = "<group>"; };
B6004DEE24FB05D600D38596 /* LogWindowController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LogWindowController.m; sourceTree = "<group>"; };
B6004DEF24FB05D600D38596 /* LogWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = LogWindow.xib; sourceTree = "<group>"; };
B6004DEF24FB05D600D38596 /* LogWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = LogWindow.xib; path = Base.lproj/LogWindow.xib; sourceTree = "<group>"; };
B60A6E0B24ECE23F004B7EEF /* apple2gs.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = apple2gs.plist; sourceTree = "<group>"; };
B60A6E1224EE0AE2004B7EEF /* FlippedView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FlippedView.h; sourceTree = "<group>"; };
B60A6E1324EE0AE2004B7EEF /* FlippedView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FlippedView.m; sourceTree = "<group>"; };
@@ -131,6 +160,12 @@
B64E15A824EA1D5300E8AD3D /* MachineViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MachineViewController.m; sourceTree = "<group>"; };
B65593AF24ECB61800722E0C /* SlotViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SlotViewController.h; sourceTree = "<group>"; };
B65593B024ECB61800722E0C /* SlotViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SlotViewController.m; sourceTree = "<group>"; };
B66236A724FD9A34006CABD7 /* PreferencesWindowController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PreferencesWindowController.h; sourceTree = "<group>"; };
B66236A824FD9A34006CABD7 /* PreferencesWindowController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PreferencesWindowController.m; sourceTree = "<group>"; };
B66236B224FDA522006CABD7 /* SDL2.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL2.framework; path = embedded/SDL2.framework; sourceTree = "<group>"; };
B66236B724FDA686006CABD7 /* mame64 */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.executable"; name = mame64; path = embedded/mame64; sourceTree = "<group>"; };
B66236B824FDA698006CABD7 /* mame64 */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.executable"; name = mame64; path = embedded/mame64; sourceTree = "<group>"; };
B66236C024FDB7A6006CABD7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = Base; path = Base.lproj/Credits.rtf; sourceTree = "<group>"; };
B67BD48424EE249D0073E334 /* apple1.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = apple1.plist; sourceTree = "<group>"; };
B6BA257B24E99BE9005FB8FF /* Ample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Ample.app; sourceTree = BUILT_PRODUCTS_DIR; };
B6BA257E24E99BE9005FB8FF /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
@@ -152,6 +187,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
B66236B424FDA527006CABD7 /* SDL2.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -219,12 +255,31 @@
path = Resources;
sourceTree = "<group>";
};
B66236B624FDA686006CABD7 /* Frameworks */ = {
isa = PBXGroup;
children = (
B66236B724FDA686006CABD7 /* mame64 */,
);
name = Frameworks;
sourceTree = "<group>";
};
B66236BD24FDA7EA006CABD7 /* Embedded Content */ = {
isa = PBXGroup;
children = (
B66236B824FDA698006CABD7 /* mame64 */,
B66236B224FDA522006CABD7 /* SDL2.framework */,
);
name = "Embedded Content";
sourceTree = "<group>";
};
B6BA257224E99BE9005FB8FF = {
isa = PBXGroup;
children = (
B6BA257D24E99BE9005FB8FF /* Ample */,
B66236BD24FDA7EA006CABD7 /* Embedded Content */,
B6BA257C24E99BE9005FB8FF /* Products */,
B649798C24EEC165008ABD20 /* Recovered References */,
B66236B624FDA686006CABD7 /* Frameworks */,
);
sourceTree = "<group>";
};
@@ -253,6 +308,8 @@
B60A6E1224EE0AE2004B7EEF /* FlippedView.h */,
B6004DED24FB05D600D38596 /* LogWindowController.h */,
B6004DEE24FB05D600D38596 /* LogWindowController.m */,
B66236A724FD9A34006CABD7 /* PreferencesWindowController.h */,
B66236A824FD9A34006CABD7 /* PreferencesWindowController.m */,
B6BA258124E99BEB005FB8FF /* Assets.xcassets */,
B64E15AF24EA365E00E8AD3D /* Resources */,
B6BA258624E99BEB005FB8FF /* Info.plist */,
@@ -267,11 +324,12 @@
B6D6DE4224FAEE8900661A5F /* Nibs */ = {
isa = PBXGroup;
children = (
B6BA258324E99BEB005FB8FF /* MainMenu.xib */,
B66236BF24FDB7A6006CABD7 /* Credits.rtf */,
B6D6DE3C24FADF8B00661A5F /* LaunchWindow.xib */,
B6004DEF24FB05D600D38596 /* LogWindow.xib */,
B6D6DE3724FAC8B500661A5F /* Preferences.xib */,
B6BA258324E99BEB005FB8FF /* MainMenu.xib */,
B61099E524F5F230005CB652 /* MediaView.xib */,
B6D6DE3724FAC8B500661A5F /* Preferences.xib */,
B61099E324F5F230005CB652 /* SlotView.xib */,
);
name = Nibs;
@@ -287,6 +345,8 @@
B6BA257724E99BE9005FB8FF /* Sources */,
B6BA257824E99BE9005FB8FF /* Frameworks */,
B6BA257924E99BE9005FB8FF /* Resources */,
B66236B124FDA443006CABD7 /* Embed Frameworks */,
B66236BB24FDA71D006CABD7 /* CopyFiles */,
);
buildRules = (
);
@@ -364,6 +424,7 @@
B6109A1E24F5F377005CB652 /* apple2c.plist in Resources */,
B6109A1A24F5F377005CB652 /* microeng.plist in Resources */,
B6109A3E24F5F377005CB652 /* albert.plist in Resources */,
B66236C124FDB7A6006CABD7 /* Credits.rtf in Resources */,
B6109A4224F5F377005CB652 /* apple2p.plist in Resources */,
B6109A1824F5F377005CB652 /* hkc8800a.plist in Resources */,
B6109A2324F5F377005CB652 /* apple2gsr0.plist in Resources */,
@@ -405,6 +466,7 @@
B60A6E1424EE0AE2004B7EEF /* FlippedView.m in Sources */,
B6BA258024E99BE9005FB8FF /* AppDelegate.m in Sources */,
B6004DF024FB05D600D38596 /* LogWindowController.m in Sources */,
B66236A924FD9A34006CABD7 /* PreferencesWindowController.m in Sources */,
B65593B124ECB61800722E0C /* SlotViewController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -428,6 +490,14 @@
name = MediaView.xib;
sourceTree = "<group>";
};
B66236BF24FDB7A6006CABD7 /* Credits.rtf */ = {
isa = PBXVariantGroup;
children = (
B66236C024FDB7A6006CABD7 /* Base */,
);
name = Credits.rtf;
sourceTree = "<group>";
};
B6BA258324E99BEB005FB8FF /* MainMenu.xib */ = {
isa = PBXVariantGroup;
children = (
@@ -571,6 +641,11 @@
CODE_SIGN_ENTITLEMENTS = Ample/Ample.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Ample/Frameworks",
"$(PROJECT_DIR)/embedded",
);
INFOPLIST_FILE = Ample/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
@@ -588,6 +663,11 @@
CODE_SIGN_ENTITLEMENTS = Ample/Ample.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Ample/Frameworks",
"$(PROJECT_DIR)/embedded",
);
INFOPLIST_FILE = Ample/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
+2 -1
View File
@@ -10,6 +10,7 @@
#import "SlotViewController.h"
#import "MediaViewController.h"
#import "LaunchWindowController.h"
#import "PreferencesWindowController.h"
@interface AppDelegate ()
@@ -58,7 +59,7 @@
- (IBAction)displayPreferences:(id)sender {
if (!_prefs) {
_prefs = [[NSWindowController alloc] initWithWindowNibName: @"Preferences"];
_prefs = [PreferencesWindowController new];
}
[_prefs showWindow: sender];
}
+33
View File
@@ -0,0 +1,33 @@
{\rtf1\ansi\ansicpg1252\cocoartf1671\cocoasubrtf600
{\fonttbl\f0\fswiss\fcharset0 Helvetica-Bold;\f1\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;\red0\green0\blue0;\red255\green255\blue255;}
{\*\expandedcolortbl;;\cssrgb\c0\c0\c0;\cssrgb\c100000\c100000\c100000;}
\margl1440\margr1440\vieww9000\viewh8400\viewkind0
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
\f0\b\fs36 \cf2 Ample\cf0
\f1\b0\fs28 would like to thank\'85\
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
\cf0 \
\pard\pardeftab720\qc\partightenfactor0
{\field{\*\fldinst{HYPERLINK "https://www.mamedev.org"}}{\fldrslt
\f0\b\fs36 \cf0 \cb3 \expnd0\expndtw0\kerning0
MAME}}\cb3 \expnd0\expndtw0\kerning0
\
\pard\pardeftab720\partightenfactor0
\cf0 \
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qj\partightenfactor0
\cf0 \cb1 \kerning1\expnd0\expndtw0 The MAME project as a whole is distributed under the terms of the {\field{\*\fldinst{HYPERLINK "https://opensource.org/licenses/GPL-2.0"}}{\fldrslt GNU General Public License, 2}} (GPL-2.0), since it contains code made available under multiple GPL-compatible licenses. A great majority of files (over 90% including core files) are under the {\field{\*\fldinst{HYPERLINK "https://opensource.org/licenses/BSD-3-Clause"}}{\fldrslt BSD-3-Clause License}} and we would encourage new contributors to distribute files under this license.\
\
Please note that MAME is a registered trademark of Gregory Ember, and permission is required to use the "MAME" name, logo or wordmark.\cb3 \expnd0\expndtw0\kerning0
\
\pard\pardeftab720\partightenfactor0
\cf0 \
\pard\pardeftab720\qc\partightenfactor0
{\field{\*\fldinst{HYPERLINK "https://libsdl.org"}}{\fldrslt
\f0\b\fs36 \cf0 SDL}}\
\pard\pardeftab720\partightenfactor0
\cf0 \
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qj\partightenfactor0
\cf0 \cb1 \kerning1\expnd0\expndtw0 SDL 2.0 is distributed under the {\field{\*\fldinst{HYPERLINK "https://libsdl.org/license.php"}}{\fldrslt zlib license}}. This license allows you to use SDL freely in any software.\
}
File renamed without changes.
+19 -5
View File
@@ -6,9 +6,10 @@
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="NSWindowController">
<customObject id="-2" userLabel="File's Owner" customClass="PreferencesWindowController">
<connections>
<outlet property="window" destination="QvC-M9-y7g" id="SHw-b5-d6g"/>
<outlet property="pathField" destination="Oz5-Xb-btk" id="EnV-kr-0XI"/>
<outlet property="window" destination="QvC-M9-y7g" id="xJa-tx-X62"/>
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
@@ -23,7 +24,7 @@
<autoresizingMask key="autoresizingMask"/>
<subviews>
<textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Oz5-Xb-btk">
<rect key="frame" x="98" y="229" width="362" height="21"/>
<rect key="frame" x="98" y="181" width="362" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" borderStyle="bezel" drawsBackground="YES" id="vDR-2V-qxd">
<font key="font" usesAppearanceFont="YES"/>
@@ -31,11 +32,13 @@
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
<connections>
<action selector="pathChanged:" target="-2" id="RRj-dC-q2y"/>
<binding destination="yvB-HG-64y" name="enabled" keyPath="values.UseCustomMame" id="iex-A9-Db6"/>
<binding destination="yvB-HG-64y" name="value" keyPath="values.MamePath" id="H3O-1l-peo"/>
</connections>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Qmb-Ag-Xyr">
<rect key="frame" x="18" y="232" width="74" height="16"/>
<rect key="frame" x="18" y="184" width="74" height="16"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" lineBreakMode="clipping" title="MAME Path" id="Xcq-4g-Wlw">
<font key="font" metaFont="system"/>
@@ -44,7 +47,7 @@
</textFieldCell>
</textField>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="KAN-P2-ydI">
<rect key="frame" x="96" y="205" width="217" height="18"/>
<rect key="frame" x="96" y="234" width="217" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" title="Close log window on normal exit" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="QMz-O0-06U">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
@@ -54,6 +57,17 @@
<binding destination="yvB-HG-64y" name="value" keyPath="values.AutoCloseLogWindow" id="q0L-GA-wM2"/>
</connections>
</button>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="j7D-jC-17Q">
<rect key="frame" x="96" y="208" width="139" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" title="Use Custom MAME" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="V61-mz-QFo">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<binding destination="yvB-HG-64y" name="value" keyPath="values.UseCustomMame" id="lH4-dm-kQC"/>
</connections>
</button>
</subviews>
</view>
<point key="canvasLocation" x="140" y="147"/>
+2
View File
@@ -2,6 +2,8 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>UseCustomMame</key>
<false/>
<key>AutoCloseLogWindow</key>
<true/>
<key>MamePath</key>
+2 -2
View File
@@ -17,9 +17,9 @@
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>release 2</string>
<string>release 3</string>
<key>CFBundleVersion</key>
<string>2</string>
<string>3</string>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>NSHumanReadableCopyright</key>
+47 -8
View File
@@ -91,6 +91,39 @@ static NSString *kContextMachine = @"kContextMachine";
}
}
static NSURL *MameURL(void) {
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSBundle *bundle = [NSBundle mainBundle];
if ([defaults boolForKey: @"UseSystemMame"]) {
NSString *path = [defaults stringForKey: @"MamePath"];
if (![path length]) return [NSURL fileURLWithPath: path];
}
return [bundle URLForAuxiliaryExecutable: @"mame64"];
return nil;
}
static NSString *MamePath(void) {
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSBundle *bundle = [NSBundle mainBundle];
NSString *path;
if ([defaults boolForKey: @"UseCustomMame"]) {
path = [defaults stringForKey: @"MamePath"];
if ([path length]) return path;
}
path = [bundle pathForAuxiliaryExecutable: @"mame64"];
if ([path length]) return path;
return nil;
}
static NSString * JoinArguments(NSArray *argv) {
static NSCharacterSet *safe = nil;
@@ -110,7 +143,10 @@ static NSString * JoinArguments(NSArray *argv) {
//unsigned ix = 0;
[rv appendString: @"mame"];
//[rv appendString: @"mame"];
NSString *path = MamePath();
path = path ? [path lastPathComponent] : @"mame";
[rv appendString: path];
for (NSString *s in argv) {
[rv appendString: @" "];
NSUInteger l = [s length];
@@ -224,17 +260,20 @@ static NSString * JoinArguments(NSArray *argv) {
- (IBAction)launchAction:(id)sender {
if (![_args count]) return;
NSURL *url = MameURL();
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSString *path = [defaults stringForKey: @"MamePath"];
if (![path length]) path = @"/usr/local/bin/mame";
NSURL *url = [NSURL fileURLWithPath: path];
if (!url) {
NSAlert *alert = [NSAlert new];
[alert setMessageText: @"Unable to find MAME executable path"];
[alert runModal];
return;
}
NSTask *task = [NSTask new];
[task setExecutableURL: url];
+4 -1
View File
@@ -65,7 +65,10 @@ static NSMutableSet *LogWindows;
if (error) {
NSLog(@"launchAction: %@", error);
NSURL *url = [task executableURL];
NSString *path = [NSString stringWithCString: [url fileSystemRepresentation] encoding: NSUTF8StringEncoding];
NSLog(@"NSTask error. Path = %@ error = %@", path, error);
[self appendString: path];
[self appendString: [error description]];
return error;
}
+17
View File
@@ -0,0 +1,17 @@
//
// PreferencesWindowController.h
// Ample
//
// Created by Kelvin Sherlock on 8/31/2020.
// Copyright © 2020 Kelvin Sherlock. All rights reserved.
//
#import <Cocoa/Cocoa.h>
NS_ASSUME_NONNULL_BEGIN
@interface PreferencesWindowController : NSWindowController
@end
NS_ASSUME_NONNULL_END
+51
View File
@@ -0,0 +1,51 @@
//
// PreferencesWindowController.m
// Ample
//
// Created by Kelvin Sherlock on 8/31/2020.
// Copyright © 2020 Kelvin Sherlock. All rights reserved.
//
#import "PreferencesWindowController.h"
@interface PreferencesWindowController ()
@property (weak) IBOutlet NSTextField *pathField;
@end
@implementation PreferencesWindowController
-(NSString *)windowNibName {
return @"Preferences";
}
- (void)windowDidLoad {
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[super windowDidLoad];
// Implement this method to handle any initialization after your window controller's window has been loaded from its nib file.
[self validateMamePath: [defaults stringForKey: @"MamePath"]];
}
-(void)validateMamePath: (NSString *)path {
NSFileManager * fm = [NSFileManager defaultManager];
if ([path length] == 0 || [fm isExecutableFileAtPath: path]) {
[_pathField setTextColor: [NSColor blackColor]];
} else {
[_pathField setTextColor: [NSColor redColor]];
}
}
- (IBAction)pathChanged:(id)sender {
NSString *path = [sender stringValue];
[self validateMamePath: path];
}
@end
+22
View File
@@ -0,0 +1,22 @@
This folder should contain SDL2.framework and a mame64 executable. These will be included in the build.
* [SDL2](http://libsdl.org/download-2.0.php)
* [MAME](https://github.com/mamedev/mame) (requires building from source)
Not tested, but perhaps you could also download a [pre-built MAME](https://wiki.mamedev.org/index.php/SDL_Supported_Platforms) and use `install_name_tool` to fix the rpath.
Alternatively, adjust the xcode project to not embed them.
Building MAME:
This will build a subset of MAME which only includes apple2 support.
git clone mame ...
cd mame
make SOURCES=src/mame/drivers/apple1.cpp,src/mame/drivers/apple2.cpp,src/mame/drivers/apple2e.cpp,src/mame/drivers/apple2gs.cpp,src/mame/drivers/apple3.cpp SDL_FRAMEWORK_PATH=`pwd`/..
you can use `$LDFLAGS` to set the rpath (`LDFLAGS="-rpath @executable_path/../Frameworks" make ...`) or set it after with the `install_name_tool` tool - ``install_name_tool -add_rpath @executable_path/../Frameworks mame64`