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