2019-07-26 05:51:36 +00:00
|
|
|
//
|
|
|
|
// AppDelegate.swift
|
|
|
|
// A2Mac
|
|
|
|
//
|
|
|
|
// Created by Tamas Rudnai on 7/25/19.
|
|
|
|
// Copyright © 2019 GameAlloy. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
import Cocoa
|
|
|
|
|
|
|
|
@NSApplicationMain
|
|
|
|
class AppDelegate: NSObject, NSApplicationDelegate {
|
|
|
|
|
|
|
|
|
2020-04-26 07:23:05 +00:00
|
|
|
@IBAction func ROM_Selected(_ sender: NSMenuItem) {
|
|
|
|
if let menuIdentifier = sender.identifier {
|
|
|
|
// rom_loadFile( Bundle.main.resourcePath, menuIdentifier.rawValue + ".rom" )
|
|
|
|
ViewController.romFileName = menuIdentifier.rawValue + ".rom"
|
|
|
|
m6502_ColdReset( Bundle.main.resourcePath, ViewController.romFileName )
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-02-23 06:16:41 +00:00
|
|
|
@IBAction func Disk1_Selected(_ sender: NSMenuItem) {
|
|
|
|
if let menuIdentifier = sender.identifier {
|
2020-06-04 18:37:35 +00:00
|
|
|
let woz_err = woz_loadFile( Bundle.main.resourcePath! + "/" + menuIdentifier.rawValue + ".woz" )
|
|
|
|
ViewController.current?.chk_woz_load(err: woz_err)
|
2020-02-23 06:16:41 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-07-26 05:51:36 +00:00
|
|
|
func applicationDidFinishLaunching(_ aNotification: Notification) {
|
|
|
|
// Insert code here to initialize your application
|
|
|
|
}
|
|
|
|
|
|
|
|
func applicationWillTerminate(_ aNotification: Notification) {
|
|
|
|
// Insert code here to tear down your application
|
|
|
|
}
|
2020-06-03 17:23:55 +00:00
|
|
|
|
2020-06-02 17:10:18 +00:00
|
|
|
@IBAction func selectAnImageFromFile(sender: AnyObject) {
|
2020-06-04 18:37:35 +00:00
|
|
|
ViewController.current?.openDiskImage()
|
2020-06-02 17:10:18 +00:00
|
|
|
}
|
2019-07-26 05:51:36 +00:00
|
|
|
|
2020-06-03 17:23:55 +00:00
|
|
|
|
|
|
|
func application(_ sender: NSApplication, openFile filename: String) -> Bool {
|
2020-06-04 18:37:35 +00:00
|
|
|
let woz_err = woz_loadFile( filename )
|
2020-06-03 17:23:55 +00:00
|
|
|
|
2020-06-04 18:37:35 +00:00
|
|
|
return woz_err == 0;
|
2020-06-03 17:23:55 +00:00
|
|
|
}
|
2020-06-04 18:37:35 +00:00
|
|
|
|
2019-07-26 05:51:36 +00:00
|
|
|
}
|
|
|
|
|