2016-08-24 01:35:59 +00:00
|
|
|
//
|
|
|
|
// StaticAnalyser.hpp
|
|
|
|
// Clock Signal
|
|
|
|
//
|
|
|
|
// Created by Thomas Harte on 23/08/2016.
|
|
|
|
// Copyright © 2016 Thomas Harte. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef StaticAnalyser_hpp
|
|
|
|
#define StaticAnalyser_hpp
|
|
|
|
|
|
|
|
#include "../Storage/Tape/Tape.hpp"
|
2016-08-27 17:42:51 +00:00
|
|
|
#include "../Storage/Disk/Disk.hpp"
|
2016-08-27 22:26:51 +00:00
|
|
|
#include "../Storage/Cartridge/Cartridge.hpp"
|
|
|
|
|
2016-08-24 01:35:59 +00:00
|
|
|
#include <string>
|
|
|
|
#include <list>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
namespace StaticAnalyser {
|
|
|
|
|
2016-09-08 02:17:19 +00:00
|
|
|
enum class Vic20MemoryModel {
|
|
|
|
Unexpanded,
|
|
|
|
EightKB,
|
|
|
|
ThirtyTwoKB
|
|
|
|
};
|
|
|
|
|
2017-02-20 22:44:36 +00:00
|
|
|
enum class Atari2600PagingModel {
|
|
|
|
None,
|
2017-02-27 02:24:54 +00:00
|
|
|
CommaVid,
|
2017-02-20 22:44:36 +00:00
|
|
|
Atari8k,
|
|
|
|
Atari16k,
|
|
|
|
Atari32k,
|
|
|
|
ActivisionStack,
|
|
|
|
ParkerBros,
|
2017-02-26 22:11:57 +00:00
|
|
|
Tigervision,
|
2017-03-01 01:28:14 +00:00
|
|
|
CBSRamPlus,
|
|
|
|
MNetwork,
|
2017-03-14 00:43:12 +00:00
|
|
|
MegaBoy,
|
2017-03-13 12:15:36 +00:00
|
|
|
Pitfall2
|
2017-02-20 22:44:36 +00:00
|
|
|
};
|
|
|
|
|
2017-06-11 23:12:20 +00:00
|
|
|
enum class ZX8081MemoryModel {
|
|
|
|
Unexpanded,
|
|
|
|
SixteenKB,
|
|
|
|
SixtyFourKB
|
|
|
|
};
|
|
|
|
|
2017-08-05 23:20:38 +00:00
|
|
|
enum class AmstradCPCModel {
|
|
|
|
CPC464,
|
|
|
|
CPC664,
|
|
|
|
CPC6128
|
|
|
|
};
|
|
|
|
|
2017-08-17 14:48:29 +00:00
|
|
|
/*!
|
|
|
|
A list of disks, tapes and cartridges.
|
|
|
|
*/
|
|
|
|
struct Media {
|
|
|
|
std::list<std::shared_ptr<Storage::Disk::Disk>> disks;
|
|
|
|
std::list<std::shared_ptr<Storage::Tape::Tape>> tapes;
|
|
|
|
std::list<std::shared_ptr<Storage::Cartridge::Cartridge>> cartridges;
|
2017-12-02 21:01:30 +00:00
|
|
|
|
|
|
|
bool empty() const {
|
|
|
|
return disks.empty() && tapes.empty() && cartridges.empty();
|
|
|
|
}
|
2017-08-17 14:48:29 +00:00
|
|
|
};
|
|
|
|
|
2016-08-28 16:20:40 +00:00
|
|
|
/*!
|
|
|
|
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.
|
|
|
|
*/
|
2016-08-24 01:35:59 +00:00
|
|
|
struct Target {
|
2017-11-21 02:55:32 +00:00
|
|
|
enum Machine {
|
2017-07-31 01:15:20 +00:00
|
|
|
AmstradCPC,
|
2016-08-28 16:20:40 +00:00
|
|
|
Atari2600,
|
|
|
|
Electron,
|
2017-11-25 18:18:24 +00:00
|
|
|
MSX,
|
2017-06-04 21:04:06 +00:00
|
|
|
Oric,
|
2017-07-31 01:15:20 +00:00
|
|
|
Vic20,
|
2017-06-11 23:12:20 +00:00
|
|
|
ZX8081
|
2016-08-28 16:20:40 +00:00
|
|
|
} machine;
|
2016-08-24 01:35:59 +00:00
|
|
|
float probability;
|
|
|
|
|
2017-08-05 23:20:38 +00:00
|
|
|
// TODO: this is too C-like a solution; make Target a base class and
|
|
|
|
// turn the following into information held by more specific subclasses.
|
2016-08-24 01:35:59 +00:00
|
|
|
union {
|
2016-08-27 18:25:16 +00:00
|
|
|
struct {
|
2016-08-30 01:10:38 +00:00
|
|
|
bool has_adfs;
|
|
|
|
bool has_dfs;
|
2017-01-08 19:46:19 +00:00
|
|
|
bool should_shift_restart;
|
2016-08-27 18:25:16 +00:00
|
|
|
} acorn;
|
2016-11-15 02:31:47 +00:00
|
|
|
|
2017-02-20 22:44:36 +00:00
|
|
|
struct {
|
|
|
|
Atari2600PagingModel paging_model;
|
2017-02-26 22:11:57 +00:00
|
|
|
bool uses_superchip;
|
2017-02-20 22:44:36 +00:00
|
|
|
} atari;
|
|
|
|
|
2016-11-15 02:31:47 +00:00
|
|
|
struct {
|
|
|
|
bool use_atmos_rom;
|
2016-11-21 12:59:25 +00:00
|
|
|
bool has_microdisc;
|
2016-11-15 02:31:47 +00:00
|
|
|
} oric;
|
2017-02-20 22:44:36 +00:00
|
|
|
|
|
|
|
struct {
|
|
|
|
Vic20MemoryModel memory_model;
|
|
|
|
bool has_c1540;
|
|
|
|
} vic20;
|
2017-06-11 23:12:20 +00:00
|
|
|
|
|
|
|
struct {
|
|
|
|
ZX8081MemoryModel memory_model;
|
|
|
|
bool isZX81;
|
|
|
|
} zx8081;
|
2017-08-05 23:20:38 +00:00
|
|
|
|
|
|
|
struct {
|
|
|
|
AmstradCPCModel model;
|
|
|
|
} amstradcpc;
|
2016-08-30 01:10:38 +00:00
|
|
|
};
|
2016-08-24 01:35:59 +00:00
|
|
|
|
|
|
|
std::string loadingCommand;
|
2017-08-17 14:48:29 +00:00
|
|
|
Media media;
|
2016-08-24 01:35:59 +00:00
|
|
|
};
|
|
|
|
|
2016-08-28 16:20:40 +00:00
|
|
|
/*!
|
|
|
|
Attempts, through any available means, to return a list of potential targets for the file with the given name.
|
2017-11-08 03:51:06 +00:00
|
|
|
|
2016-08-28 16:20:40 +00:00
|
|
|
@returns The list of potential targets, sorted from most to least probable.
|
|
|
|
*/
|
2016-08-27 17:42:51 +00:00
|
|
|
std::list<Target> GetTargets(const char *file_name);
|
2016-08-24 01:35:59 +00:00
|
|
|
|
2017-08-17 14:48:29 +00:00
|
|
|
/*!
|
|
|
|
Inspects the supplied file and determines the media included.
|
|
|
|
*/
|
|
|
|
Media GetMedia(const char *file_name);
|
|
|
|
|
2016-08-24 01:35:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* StaticAnalyser_hpp */
|