mirror of
https://github.com/mauiaaron/apple2.git
synced 2024-06-26 00:29:27 +00:00
Finally ! First time loading disk !!!
This commit is contained in:
parent
3cea55cc40
commit
b60a697b86
|
@ -126,6 +126,7 @@
|
|||
4E1733E41C2C5F7A00CDF9DF /* AppleViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E1733DD1C2C5E5D00CDF9DF /* AppleViewController.m */; };
|
||||
4ECBEADF1C3432010046F537 /* speedtest.dsk in Resources */ = {isa = PBXBuildFile; fileRef = 4ECBEADD1C3432010046F537 /* speedtest.dsk */; };
|
||||
4ECBEAE01C3432010046F537 /* testvm1.dsk in Resources */ = {isa = PBXBuildFile; fileRef = 4ECBEADE1C3432010046F537 /* testvm1.dsk */; };
|
||||
4EEF0E8A1C3536A3001BEB67 /* disksViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4EEF0E891C3536A3001BEB67 /* disksViewController.m */; };
|
||||
773B3D101956885A0085CE5F /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 773B3D0F1956885A0085CE5F /* Cocoa.framework */; };
|
||||
773B3D1A1956885A0085CE5F /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 773B3D181956885A0085CE5F /* InfoPlist.strings */; };
|
||||
773B3D201956885A0085CE5F /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 773B3D1E1956885A0085CE5F /* Credits.rtf */; };
|
||||
|
@ -401,6 +402,8 @@
|
|||
4E4E62A01C2C5B56002E324F /* iosPrefControllerViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = iosPrefControllerViewController.m; sourceTree = "<group>"; };
|
||||
4ECBEADD1C3432010046F537 /* speedtest.dsk */ = {isa = PBXFileReference; lastKnownFileType = file; path = speedtest.dsk; sourceTree = "<group>"; };
|
||||
4ECBEADE1C3432010046F537 /* testvm1.dsk */ = {isa = PBXFileReference; lastKnownFileType = file; path = testvm1.dsk; sourceTree = "<group>"; };
|
||||
4EEF0E881C3536A3001BEB67 /* disksViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = disksViewController.h; sourceTree = "<group>"; };
|
||||
4EEF0E891C3536A3001BEB67 /* disksViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = disksViewController.m; sourceTree = "<group>"; };
|
||||
773B3D0C1956885A0085CE5F /* Apple2Mac.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Apple2Mac.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
773B3D0F1956885A0085CE5F /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
|
||||
773B3D121956885A0085CE5F /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
|
||||
|
@ -892,6 +895,8 @@
|
|||
935C55231C12B9CE0013166D /* iOS */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
4EEF0E881C3536A3001BEB67 /* disksViewController.h */,
|
||||
4EEF0E891C3536A3001BEB67 /* disksViewController.m */,
|
||||
935C55471C12BE510013166D /* AppDelegate.h */,
|
||||
935C55481C12BE510013166D /* AppDelegate.m */,
|
||||
93206C831C156BD300668153 /* A2IXPopupChoreographer.h */,
|
||||
|
@ -1663,6 +1668,7 @@
|
|||
935C55671C136E070013166D /* glhudmodel.c in Sources */,
|
||||
935C55681C136E070013166D /* glnode.c in Sources */,
|
||||
935C556A1C136E070013166D /* matrixUtil.c in Sources */,
|
||||
4EEF0E8A1C3536A3001BEB67 /* disksViewController.m in Sources */,
|
||||
935C556B1C136E070013166D /* modelUtil.c in Sources */,
|
||||
935C556C1C136E070013166D /* sourceUtil.c in Sources */,
|
||||
935C556D1C136E070013166D /* vectorUtil.c in Sources */,
|
||||
|
|
17
Apple2Mac/Apple2Mac/disksViewController.h
Normal file
17
Apple2Mac/Apple2Mac/disksViewController.h
Normal file
|
@ -0,0 +1,17 @@
|
|||
//
|
||||
// disksViewController.h
|
||||
// Apple2Mac
|
||||
//
|
||||
// Created by Jerome Vernet on 31/12/2015.
|
||||
// Copyright © 2015 deadc0de.org. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface disksViewController : UIViewController<UIPickerViewDataSource, UIPickerViewDelegate>
|
||||
@property (retain, nonatomic) IBOutlet UIPickerView *disk1Picker;
|
||||
@property (retain, nonatomic) IBOutlet UIPickerView *disk2Picker;
|
||||
|
||||
@property (strong,nonatomic) NSArray *_disks;
|
||||
@property (retain,nonatomic) NSString *path;
|
||||
@end
|
64
Apple2Mac/Apple2Mac/disksViewController.m
Normal file
64
Apple2Mac/Apple2Mac/disksViewController.m
Normal file
|
@ -0,0 +1,64 @@
|
|||
//
|
||||
// disksViewController.m
|
||||
// Apple2Mac
|
||||
//
|
||||
// Created by Jerome Vernet on 31/12/2015.
|
||||
// Copyright © 2015 deadc0de.org. All rights reserved.
|
||||
//
|
||||
|
||||
#import "disksViewController.h"
|
||||
#import "common.h"
|
||||
|
||||
@implementation disksViewController
|
||||
|
||||
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view.
|
||||
|
||||
|
||||
|
||||
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
|
||||
self.path = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"Disks"];
|
||||
self._disks=[[NSFileManager defaultManager] contentsOfDirectoryAtPath:self.path error:NULL];
|
||||
|
||||
// Connect data
|
||||
self.disk1Picker.dataSource = self;
|
||||
self.disk1Picker.delegate = self;
|
||||
self.disk2Picker.dataSource = self;
|
||||
self.disk2Picker.delegate = self;
|
||||
}
|
||||
|
||||
// The number of columns of data
|
||||
- (int)numberOfComponentsInPickerView:(UIPickerView *)pickerView
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
// The number of rows of data
|
||||
- (int)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component
|
||||
{
|
||||
return self._disks.count;
|
||||
//_pickerData.cout;
|
||||
}
|
||||
|
||||
// The data to return for the row and component (column) that's being passed in
|
||||
- (NSString*)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component
|
||||
{
|
||||
return [self._disks objectAtIndex:row];
|
||||
}
|
||||
|
||||
// Catpure the picker view selection
|
||||
- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component
|
||||
{
|
||||
// This method is triggered whenever the user makes a change to the picker selection.
|
||||
// The parameter named row and component represents what was selected.
|
||||
NSLog(@"Selected Row %d %@", row,(NSString*)[self._disks objectAtIndex:row]);
|
||||
disk6_eject(0);
|
||||
const char *errMsg = disk6_insert(0, [[self.path stringByAppendingPathComponent:[self._disks objectAtIndex:row]] UTF8String], YES);
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
|
@ -202,6 +202,7 @@
|
|||
}
|
||||
*/
|
||||
|
||||
|
||||
- (void)dealloc {
|
||||
/* [_videoModePicker release];
|
||||
[_cpuSlider release];
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
</barButtonItem>
|
||||
<barButtonItem title="Disks" id="g21-de-0Ou">
|
||||
<connections>
|
||||
<segue destination="980-JU-ntO" kind="popoverPresentation" popoverAnchorBarButtonItem="g21-de-0Ou" id="q1r-MR-nbM">
|
||||
<segue destination="0hZ-GM-FUh" kind="popoverPresentation" popoverAnchorBarButtonItem="g21-de-0Ou" id="ic4-KT-dB8">
|
||||
<popoverArrowDirection key="popoverArrowDirection" up="YES" down="YES" left="YES" right="YES"/>
|
||||
</segue>
|
||||
</connections>
|
||||
|
@ -175,6 +175,48 @@
|
|||
</objects>
|
||||
<point key="canvasLocation" x="1092" y="-223"/>
|
||||
</scene>
|
||||
<!--Disks-->
|
||||
<scene sceneID="vaV-Cl-Zto">
|
||||
<objects>
|
||||
<viewController id="0hZ-GM-FUh" userLabel="Disks" customClass="disksViewController" sceneMemberID="viewController">
|
||||
<layoutGuides>
|
||||
<viewControllerLayoutGuide type="top" id="2FO-2b-fJK"/>
|
||||
<viewControllerLayoutGuide type="bottom" id="a8M-qc-lNk"/>
|
||||
</layoutGuides>
|
||||
<view key="view" contentMode="scaleToFill" id="ah2-22-5Cs">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Disk 1" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="TRZ-1C-cfv">
|
||||
<rect key="frame" x="31" y="20" width="46" height="21"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<pickerView contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="e8v-O0-bvT">
|
||||
<rect key="frame" x="0.0" y="49" width="600" height="216"/>
|
||||
</pickerView>
|
||||
<pickerView contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="fEc-OG-ExC">
|
||||
<rect key="frame" x="0.0" y="353" width="600" height="216"/>
|
||||
</pickerView>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Disk 2" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="cPG-e3-f3L">
|
||||
<rect key="frame" x="46" y="311" width="48" height="29"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
</view>
|
||||
<connections>
|
||||
<outlet property="disk1Picker" destination="e8v-O0-bvT" id="a8d-yH-zeq"/>
|
||||
<outlet property="disk2Picker" destination="fEc-OG-ExC" id="9NO-Ew-hPj"/>
|
||||
</connections>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="IYj-oP-tHf" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="1718" y="-470"/>
|
||||
</scene>
|
||||
<!--View Controller-->
|
||||
<scene sceneID="7d6-Zt-X84">
|
||||
<objects>
|
||||
|
@ -306,70 +348,6 @@
|
|||
</objects>
|
||||
<point key="canvasLocation" x="1058" y="1349"/>
|
||||
</scene>
|
||||
<!--Disk-->
|
||||
<scene sceneID="kmp-p5-5uY">
|
||||
<objects>
|
||||
<tableViewController id="980-JU-ntO" userLabel="Disk" sceneMemberID="viewController">
|
||||
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" id="BTP-a5-mnq">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<prototypes>
|
||||
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" rowHeight="87" id="x3K-si-dgt">
|
||||
<rect key="frame" x="0.0" y="28" width="600" height="87"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="x3K-si-dgt" id="6YL-HV-FVV">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="86"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="No Disk" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="nFV-GW-A8d">
|
||||
<rect key="frame" x="159" y="46" width="359" height="21"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Load/Unload Disk A" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="dhV-Qu-eN0">
|
||||
<rect key="frame" x="59" y="8" width="359" height="21"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="23"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
</tableViewCellContentView>
|
||||
</tableViewCell>
|
||||
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" rowHeight="110" id="ceu-H4-qtw">
|
||||
<rect key="frame" x="0.0" y="115" width="600" height="110"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="ceu-H4-qtw" id="qmX-ik-xRp">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="109"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="No Disk" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="8BF-Vq-y8h">
|
||||
<rect key="frame" x="158" y="53" width="359" height="21"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Load/Unload Disk A" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="6gn-21-pmx" userLabel="Load/Unload Disk B">
|
||||
<rect key="frame" x="59" y="24" width="379" height="21"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="23"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
</tableViewCellContentView>
|
||||
</tableViewCell>
|
||||
</prototypes>
|
||||
<connections>
|
||||
<outlet property="dataSource" destination="980-JU-ntO" id="Dqz-xg-zqk"/>
|
||||
<outlet property="delegate" destination="980-JU-ntO" id="Aul-0c-avM"/>
|
||||
</connections>
|
||||
</tableView>
|
||||
</tableViewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="cTY-sc-1Fe" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="1722" y="245"/>
|
||||
</scene>
|
||||
<!--LoadDisks-->
|
||||
<scene sceneID="C1L-T0-as8">
|
||||
<objects>
|
||||
|
|
Loading…
Reference in New Issue
Block a user