1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-12-25 03:32:01 +00:00

Allowed the static analyser to specify a ZX80 or 81, and a memory model. Neither is respected yet in the machine.

This commit is contained in:
Thomas Harte 2017-06-11 19:12:20 -04:00
parent e40d553045
commit 8116f85479
3 changed files with 23 additions and 5 deletions

View File

@ -50,7 +50,7 @@
case StaticAnalyser::Target::Electron: return @"ElectronOptions";
case StaticAnalyser::Target::Oric: return @"OricOptions";
case StaticAnalyser::Target::Vic20: return @"Vic20Options";
case StaticAnalyser::Target::ZX80: return @"ZX8081Options";
case StaticAnalyser::Target::ZX8081: return @"ZX8081Options";
default: return nil;
}
}
@ -63,7 +63,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::ZX80: return [[CSZX8081 alloc] init];
case StaticAnalyser::Target::ZX8081: return [[CSZX8081 alloc] init];
default: return nil;
}
}

View File

@ -40,6 +40,12 @@ enum class Atari2600PagingModel {
Pitfall2
};
enum class ZX8081MemoryModel {
Unexpanded,
SixteenKB,
SixtyFourKB
};
/*!
A list of disks, tapes and cartridges plus information about the machine to which to attach them and its configuration,
and instructions on how to launch the software attached, plus a measure of confidence in this target's correctness.
@ -50,7 +56,7 @@ struct Target {
Electron,
Vic20,
Oric,
ZX80
ZX8081
} machine;
float probability;
@ -75,6 +81,11 @@ struct Target {
Vic20MemoryModel memory_model;
bool has_c1540;
} vic20;
struct {
ZX8081MemoryModel memory_model;
bool isZX81;
} zx8081;
};
std::string loadingCommand;

View File

@ -36,9 +36,16 @@ void StaticAnalyser::ZX8081::AddTargets(
if(!tapes.empty()) {
std::vector<Storage::Data::ZX8081::File> files = GetFiles(tapes.front());
if(!files.empty()) {
// TODO: check files for machine type, memory size.
StaticAnalyser::Target target;
target.machine = Target::ZX80;
target.machine = Target::ZX8081;
target.zx8081.isZX81 = files.front().isZX81;
if(files.front().data.size() > 16384) {
target.zx8081.memory_model = ZX8081MemoryModel::SixtyFourKB;
} else if(files.front().data.size() > 1024) {
target.zx8081.memory_model = ZX8081MemoryModel::SixteenKB;
} else {
target.zx8081.memory_model = ZX8081MemoryModel::Unexpanded;
}
target.tapes = tapes;
destination.push_back(target);
}