mirror of
https://github.com/TomHarte/CLK.git
synced 2024-11-26 08:49:37 +00:00
Uses file containers' type distinguishers where available, and supplies potential insight to the ZX80/81 analyser as now required.
This commit is contained in:
parent
437023bff6
commit
63ee8c9d58
@ -63,6 +63,8 @@ static Media GetMediaAndPlatforms(const char *file_name, TargetPlatform::IntType
|
||||
#define Insert(list, class, platforms) \
|
||||
list.emplace_back(new Storage::class(file_name));\
|
||||
potential_platforms |= platforms;\
|
||||
TargetPlatform::TypeDistinguisher *distinguisher = dynamic_cast<TargetPlatform::TypeDistinguisher *>(list.back().get());\
|
||||
if(distinguisher) potential_platforms &= distinguisher->target_platform_type();
|
||||
|
||||
#define TryInsert(list, class, platforms) \
|
||||
try {\
|
||||
@ -115,6 +117,8 @@ static Media GetMediaAndPlatforms(const char *file_name, TargetPlatform::IntType
|
||||
#undef Insert
|
||||
#undef TryInsert
|
||||
|
||||
// Filter potential platforms as per file preferences, if any.
|
||||
|
||||
free(lowercase_extension);
|
||||
}
|
||||
|
||||
@ -141,7 +145,7 @@ std::list<Target> StaticAnalyser::GetTargets(const char *file_name) {
|
||||
if(potential_platforms & TargetPlatform::Atari2600) Atari::AddTargets(media, targets);
|
||||
if(potential_platforms & TargetPlatform::Commodore) Commodore::AddTargets(media, targets);
|
||||
if(potential_platforms & TargetPlatform::Oric) Oric::AddTargets(media, targets);
|
||||
if(potential_platforms & TargetPlatform::ZX8081) ZX8081::AddTargets(media, targets);
|
||||
if(potential_platforms & TargetPlatform::ZX8081) ZX8081::AddTargets(media, targets, potential_platforms);
|
||||
|
||||
// Reset any tapes to their initial position
|
||||
for(auto target : targets) {
|
||||
|
Loading…
Reference in New Issue
Block a user