add Interrupt and Reset buttons

This commit is contained in:
Jesús A. Álvarez 2016-05-25 20:49:56 +02:00
parent a4d235426b
commit e8daea9f56
14 changed files with 94 additions and 0 deletions

View File

@ -33,5 +33,8 @@ extern NSString * const MNVMDidEjectDiskNotification;
- (BOOL)insertDisk:(NSString*)path;
- (BOOL)isDiskInserted:(NSString*)path;
- (void)macInterrupt;
- (void)macReset;
@end

View File

@ -23,6 +23,8 @@ IMPORTFUNC blnr Sony_Insert1(NSString *filePath, blnr silentfail);
IMPORTFUNC blnr Sony_IsInserted(NSString *filePath);
EXPORTVAR(ui3b,SpeedValue);
IMPORTPROC SetKeyState(int key, blnr down);
IMPORTPROC MacInterrupt();
IMPORTPROC MacReset();
static AppDelegate *sharedAppDelegate = nil;
NSString * const MNVMDidInsertDiskNotification = @"MNVMDidInsertDisk";
@ -266,6 +268,14 @@ NSString * const MNVMDidEjectDiskNotification = @"MNVMDidEjectDisk";
SetMouseButton(down);
}
- (void)macInterrupt {
MacInterrupt();
}
-(void)macReset {
MacReset();
}
#pragma mark - Keyboard
- (int)translateScanCode:(int)scancode {

View File

@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "interrupt.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "interrupt@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "interrupt@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "reset.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "reset@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "reset@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@ -230,6 +230,18 @@
<action selector="showSettings:" destination="mbX-kA-h6M" id="dIs-rf-PeS"/>
</connections>
</barButtonItem>
<barButtonItem style="plain" systemItem="flexibleSpace" id="klq-lo-Wrl"/>
<barButtonItem image="Interrupt" id="YFW-lp-dCD">
<connections>
<action selector="macInterrupt:" destination="mbX-kA-h6M" id="zmC-N7-nZp"/>
</connections>
</barButtonItem>
<barButtonItem width="42" style="plain" systemItem="fixedSpace" id="bwn-1m-FZJ"/>
<barButtonItem image="Reset" id="l5C-8z-pWj">
<connections>
<action selector="macReset:" destination="mbX-kA-h6M" id="n8H-fa-LkM"/>
</connections>
</barButtonItem>
</toolbarItems>
<navigationItem key="navigationItem" title="Insert Disk" id="hjJ-Yt-wg8">
<barButtonItem key="backBarButtonItem" title="Disk" id="pie-Ez-AWv"/>
@ -267,6 +279,8 @@
</scene>
</scenes>
<resources>
<image name="Interrupt" width="30" height="30"/>
<image name="Reset" width="30" height="30"/>
<image name="Settings" width="30" height="30"/>
<image name="floppy30" width="30" height="30"/>
</resources>

View File

@ -12,5 +12,7 @@
- (IBAction)showSettings:(id)sender;
- (IBAction)dismiss:(id)sender;
- (IBAction)macInterrupt:(id)sender;
- (IBAction)macReset:(id)sender;
@end

View File

@ -77,6 +77,8 @@
[self.tableView reloadData];
}
#pragma mark - Button Actions
- (void)showSettings:(id)sender {
[[AppDelegate sharedInstance] showSettings:sender];
}
@ -85,6 +87,15 @@
[self dismissViewControllerAnimated:YES completion:nil];
}
- (void)macInterrupt:(id)sender {
[self dismiss:sender];
[[AppDelegate sharedInstance] macInterrupt];
}
- (void)macReset:(id)sender {
[[AppDelegate sharedInstance] macReset];
}
#pragma mark - Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {

View File

@ -1687,3 +1687,11 @@ GLOBALPROC RunEmulator(void) {
}
UnInitOSGLU();
}
GLOBALPROC MacInterrupt(void) {
WantMacInterrupt = trueblnr;
}
GLOBALPROC MacReset(void) {
WantMacReset = trueblnr;
}