1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-06-25 18:30:07 +00:00

Disabled all machine-specific document code, to force the migration of functionality. The 2600 works other than the little matter of input.

This commit is contained in:
Thomas Harte 2016-10-02 16:57:57 -04:00
parent 6c6e9830dd
commit 0c75c2fc41
8 changed files with 32 additions and 46 deletions

View File

@ -51,7 +51,7 @@
4B73C71A1D036BD90074D992 /* Vic20Document.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B73C7191D036BD90074D992 /* Vic20Document.swift */; };
4B73C71D1D036C030074D992 /* Vic20Document.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4B73C71B1D036C030074D992 /* Vic20Document.xib */; };
4B8FE21B1DA19D5F0090D3CE /* Atari2600Options.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4B8FE2131DA19D5F0090D3CE /* Atari2600Options.xib */; };
4B8FE21C1DA19D5F0090D3CE /* Document.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4B8FE2151DA19D5F0090D3CE /* Document.xib */; };
4B8FE21C1DA19D5F0090D3CE /* MachineDocument.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4B8FE2151DA19D5F0090D3CE /* MachineDocument.xib */; };
4B8FE21D1DA19D5F0090D3CE /* ElectronOptions.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4B8FE2171DA19D5F0090D3CE /* ElectronOptions.xib */; };
4B8FE21E1DA19D5F0090D3CE /* Vic20Options.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4B8FE2191DA19D5F0090D3CE /* Vic20Options.xib */; };
4B8FE2201DA19D7C0090D3CE /* Atari2600OptionsPanel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B8FE21F1DA19D7C0090D3CE /* Atari2600OptionsPanel.swift */; };
@ -475,7 +475,7 @@
4B73C7191D036BD90074D992 /* Vic20Document.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Vic20Document.swift; sourceTree = "<group>"; };
4B73C71C1D036C030074D992 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = "Clock Signal/Base.lproj/Vic20Document.xib"; sourceTree = SOURCE_ROOT; };
4B8FE2141DA19D5F0090D3CE /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = "Clock Signal/Base.lproj/Atari2600Options.xib"; sourceTree = SOURCE_ROOT; };
4B8FE2161DA19D5F0090D3CE /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = "Clock Signal/Base.lproj/Document.xib"; sourceTree = SOURCE_ROOT; };
4B8FE2161DA19D5F0090D3CE /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = "Clock Signal/Base.lproj/MachineDocument.xib"; sourceTree = SOURCE_ROOT; };
4B8FE2181DA19D5F0090D3CE /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = "Clock Signal/Base.lproj/ElectronOptions.xib"; sourceTree = SOURCE_ROOT; };
4B8FE21A1DA19D5F0090D3CE /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = "Clock Signal/Base.lproj/Vic20Options.xib"; sourceTree = SOURCE_ROOT; };
4B8FE21F1DA19D7C0090D3CE /* Atari2600OptionsPanel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Atari2600OptionsPanel.swift; sourceTree = "<group>"; };
@ -1055,7 +1055,7 @@
4B73C7191D036BD90074D992 /* Vic20Document.swift */,
4BB73EA51B587A5100552FC2 /* Atari2600Document.xib */,
4B8FE2131DA19D5F0090D3CE /* Atari2600Options.xib */,
4B8FE2151DA19D5F0090D3CE /* Document.xib */,
4B8FE2151DA19D5F0090D3CE /* MachineDocument.xib */,
4B2E2D931C399D1200138695 /* ElectronDocument.xib */,
4B8FE2171DA19D5F0090D3CE /* ElectronOptions.xib */,
4B73C71B1D036C030074D992 /* Vic20Document.xib */,
@ -1847,7 +1847,7 @@
4BB73EA91B587A5100552FC2 /* Assets.xcassets in Resources */,
4BB73EA71B587A5100552FC2 /* Atari2600Document.xib in Resources */,
4B8FE21B1DA19D5F0090D3CE /* Atari2600Options.xib in Resources */,
4B8FE21C1DA19D5F0090D3CE /* Document.xib in Resources */,
4B8FE21C1DA19D5F0090D3CE /* MachineDocument.xib in Resources */,
4B8FE21E1DA19D5F0090D3CE /* Vic20Options.xib in Resources */,
4B73C71D1D036C030074D992 /* Vic20Document.xib in Resources */,
4BB73EAC1B587A5100552FC2 /* MainMenu.xib in Resources */,
@ -2287,12 +2287,12 @@
name = Atari2600Options.xib;
sourceTree = "<group>";
};
4B8FE2151DA19D5F0090D3CE /* Document.xib */ = {
4B8FE2151DA19D5F0090D3CE /* MachineDocument.xib */ = {
isa = PBXVariantGroup;
children = (
4B8FE2161DA19D5F0090D3CE /* Base */,
);
name = Document.xib;
name = MachineDocument.xib;
sourceTree = "<group>";
};
4B8FE2171DA19D5F0090D3CE /* ElectronOptions.xib */ = {

View File

@ -10,36 +10,8 @@ import Cocoa
class Atari2600Document: MachineDocument {
fileprivate var atari2600 = CSAtari2600()
override var machine: CSMachine! {
get {
return atari2600
}
}
override var name: String! {
get {
return "atari2600"
}
}
// MARK: NSDocument overrides
override class func autosavesInPlace() -> Bool {
return true
}
override var windowNibName: String? {
return "Atari2600Document"
}
override func windowControllerDidLoadNib(_ aController: NSWindowController) {
super.windowControllerDidLoadNib(aController)
// show the options window but ensure the OpenGL view is key
self.openGLView.window?.makeKey()
}
// MARK: CSOpenGLViewResponderDelegate
fileprivate func inputForKey(_ event: NSEvent) -> Atari2600DigitalInput? {
/* fileprivate func inputForKey(_ event: NSEvent) -> Atari2600DigitalInput? {
switch event.keyCode {
case 123: return Atari2600DigitalInputJoy1Left
case 126: return Atari2600DigitalInputJoy1Up
@ -74,5 +46,5 @@ class Atari2600Document: MachineDocument {
if event.keyCode == 36 {
atari2600.setResetLineEnabled(false)
}
}
}*/
}

View File

@ -11,7 +11,7 @@ import AudioToolbox
class ElectronDocument: MachineDocument {
fileprivate lazy var electron = CSElectron()
/* fileprivate lazy var electron = CSElectron()
override var machine: CSMachine! {
get {
return electron
@ -84,5 +84,5 @@ class ElectronDocument: MachineDocument {
let displayType = standardUserDefaults.integer(forKey: self.displayTypeUserDefaultsKey)
electron.useTelevisionOutput = (displayType == 1)
self.displayTypeButton?.selectItem(at: displayType)
}
}*/
}

View File

@ -20,11 +20,7 @@ class MachineDocument:
{
lazy var actionLock = NSLock()
lazy var drawLock = NSLock()
var machine: CSMachine! {
get {
return nil
}
}
var machine: CSMachine!
var name: String! {
get {
return nil
@ -54,6 +50,10 @@ class MachineDocument:
return updater
}()
override var windowNibName: String? {
return "MachineDocument"
}
override func windowControllerDidLoadNib(_ aController: NSWindowController) {
super.windowControllerDidLoadNib(aController)
@ -104,6 +104,9 @@ class MachineDocument:
// MARK: configuring
func configureAs(_ analysis: CSStaticAnalyser) {
if let machine = analysis.newMachine() {
self.machine = machine
}
analysis.apply(to: self.machine)
if let optionsPanelNibName = analysis.optionsPanelNibName {

View File

@ -10,7 +10,7 @@ import Foundation
class Vic20Document: MachineDocument {
fileprivate lazy var vic20 = CSVic20()
/* fileprivate lazy var vic20 = CSVic20()
override var machine: CSMachine! {
get {
return vic20
@ -165,5 +165,5 @@ class Vic20Document: MachineDocument {
let country = standardUserDefaults.integer(forKey: self.countryUserDefaultsKey)
setCountry(country)
self.countryButton?.selectItem(at: country)
}
}*/
}

View File

@ -18,6 +18,7 @@
@property(nonatomic, readonly) NSString *optionsPanelNibName;
@property(nonatomic, readonly) NSString *userDefaultsPrefix;
- (CSMachine *)newMachine;
@property(nonatomic, readonly) NSString *displayName;

View File

@ -40,7 +40,7 @@
{
case StaticAnalyser::Target::Electron: return [ElectronDocument class];
case StaticAnalyser::Target::Vic20: return [Vic20Document class];
case StaticAnalyser::Target::Atari2600: return [Atari2600Document class];
case StaticAnalyser::Target::Atari2600: return [MachineDocument class];
}
return nil;
@ -58,6 +58,16 @@
return nil;
}
- (CSMachine *)newMachine
{
switch(_target.machine)
{
case StaticAnalyser::Target::Electron: return nil;
case StaticAnalyser::Target::Vic20: return nil;
case StaticAnalyser::Target::Atari2600: return [[CSAtari2600 alloc] init];
}
}
- (NSString *)userDefaultsPrefix
{
switch(_target.machine)