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

Arranges for the ZX80/81 to get a peek at target configuration prior to construction. I'm as yet undecided on whether to make this the norm.

This commit is contained in:
Thomas Harte 2017-08-27 16:42:16 -04:00
parent 522839143f
commit 4a66dd9e82
7 changed files with 25 additions and 9 deletions

View File

@ -388,8 +388,8 @@ class ConcreteMachine:
using namespace ZX8081;
// See header; constructs and returns an instance of the ZX80/81.
Machine *Machine::ZX8081() {
// See header; constructs and returns an instance of the ZX80 or 81.
Machine *Machine::ZX8081(const StaticAnalyser::Target &target_hint) {
return new ZX8081::ConcreteMachine;
}

View File

@ -38,7 +38,7 @@ class Machine:
public ConfigurationTarget::Machine,
public KeyboardMachine::Machine {
public:
static Machine *ZX8081();
static Machine *ZX8081(const StaticAnalyser::Target &target_hint);
virtual ~Machine();
virtual void set_rom(ROMType type, std::vector<uint8_t> data) = 0;

View File

@ -1061,6 +1061,7 @@
4BF1354A1D6D2C300054B2EA /* StaticAnalyser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StaticAnalyser.cpp; path = ../../StaticAnalyser/StaticAnalyser.cpp; sourceTree = "<group>"; };
4BF1354B1D6D2C300054B2EA /* StaticAnalyser.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = StaticAnalyser.hpp; path = ../../StaticAnalyser/StaticAnalyser.hpp; sourceTree = "<group>"; };
4BF4A2D91F534DB300B171F4 /* TargetPlatforms.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = TargetPlatforms.hpp; sourceTree = "<group>"; };
4BF4A2DA1F5365C600B171F4 /* CSZX8081+Instantiation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "CSZX8081+Instantiation.h"; sourceTree = "<group>"; };
4BF6606A1F281573002CB053 /* ClockReceiver.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = ClockReceiver.hpp; sourceTree = "<group>"; };
4BF8295B1D8F048B001BAE39 /* MFM.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MFM.cpp; path = Encodings/MFM.cpp; sourceTree = "<group>"; };
4BF8295C1D8F048B001BAE39 /* MFM.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = MFM.hpp; path = Encodings/MFM.hpp; sourceTree = "<group>"; };
@ -1238,6 +1239,7 @@
4BCF1FA61DADC5250039D2E7 /* CSOric.h */,
4B2A539D1D117D36003C6002 /* CSVic20.h */,
4B14978D1EE4B4D200CE2596 /* CSZX8081.h */,
4BF4A2DA1F5365C600B171F4 /* CSZX8081+Instantiation.h */,
4B38F34B1F2EC3CA00D9235D /* CSAmstradCPC.mm */,
4B2A539A1D117D36003C6002 /* CSAtari2600.mm */,
4B2A539C1D117D36003C6002 /* CSElectron.mm */,

View File

@ -19,7 +19,7 @@
#import "CSElectron.h"
#import "CSOric.h"
#import "CSVic20.h"
#import "CSZX8081.h"
#import "CSZX8081+Instantiation.h"
#import "Clock_Signal-Swift.h"
@ -59,7 +59,7 @@
case StaticAnalyser::Target::Electron: return [[CSElectron alloc] init];
case StaticAnalyser::Target::Oric: return [[CSOric alloc] init];
case StaticAnalyser::Target::Vic20: return [[CSVic20 alloc] init];
case StaticAnalyser::Target::ZX8081: return [[CSZX8081 alloc] init];
case StaticAnalyser::Target::ZX8081: return [[CSZX8081 alloc] initWithIntendedTarget:_target];
default: return nil;
}
}

View File

@ -0,0 +1,16 @@
//
// CSZX8081+Instantiation.h
// Clock Signal
//
// Created by Thomas Harte on 27/08/2017.
// Copyright © 2017 Thomas Harte. All rights reserved.
//
#include "StaticAnalyser.hpp"
#import "CSZX8081.h"
@interface CSZX8081 (Instantiation)
- (instancetype)initWithIntendedTarget:(const StaticAnalyser::Target &)target;
@end

View File

@ -12,8 +12,6 @@
@interface CSZX8081 : CSMachine <CSKeyboardMachine, CSFastLoading>
- (instancetype)init;
@property (nonatomic, assign) BOOL useFastLoadingHack;
@property (nonatomic, assign) BOOL useAutomaticTapeMotorControl;

View File

@ -18,8 +18,8 @@
std::unique_ptr<ZX8081::Machine> _zx8081;
}
- (instancetype)init {
ZX8081::Machine *machine = ZX8081::Machine::ZX8081();
- (instancetype)initWithIntendedTarget:(const StaticAnalyser::Target &)target {
ZX8081::Machine *machine = ZX8081::Machine::ZX8081(target);
self = [super initWithMachine:machine];
if(self) {