mirror of
https://github.com/TomHarte/CLK.git
synced 2024-09-30 07:55:01 +00:00
Add Hugo/Nick checks.
This commit is contained in:
parent
ddf136556d
commit
4b5456c9ba
@ -99,8 +99,11 @@ std::unique_ptr<Catalogue> Analyser::Static::Acorn::GetADFSCatalogue(const std::
|
|||||||
|
|
||||||
// Quick sanity checks.
|
// Quick sanity checks.
|
||||||
if(root_directory[0x4cb]) return nullptr;
|
if(root_directory[0x4cb]) return nullptr;
|
||||||
if(root_directory[1] != 'H' || root_directory[2] != 'u' || root_directory[3] != 'g' || root_directory[4] != 'o') return nullptr;
|
catalogue->is_hugo = !memcmp(&root_directory[1], "Hugo", 4) && !memcmp(&root_directory[0x4FB], "Hugo", 4);
|
||||||
if(root_directory[0x4FB] != 'H' || root_directory[0x4FC] != 'u' || root_directory[0x4FD] != 'g' || root_directory[0x4FE] != 'o') return nullptr;
|
const bool is_nick = !memcmp(&root_directory[1], "Nick", 4) && !memcmp(&root_directory[0x4FB], "Nick", 4);
|
||||||
|
if(!catalogue->is_hugo && !is_nick) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
switch(free_space_map_second_half->samples[0][0xfd]) {
|
switch(free_space_map_second_half->samples[0][0xfd]) {
|
||||||
default: catalogue->bootOption = Catalogue::BootOption::None; break;
|
default: catalogue->bootOption = Catalogue::BootOption::None; break;
|
||||||
|
@ -15,6 +15,7 @@ namespace Analyser::Static::Acorn {
|
|||||||
|
|
||||||
/// Describes a DFS- or ADFS-format catalogue(/directory): the list of files available and the catalogue's boot option.
|
/// Describes a DFS- or ADFS-format catalogue(/directory): the list of files available and the catalogue's boot option.
|
||||||
struct Catalogue {
|
struct Catalogue {
|
||||||
|
bool is_hugo = false;
|
||||||
std::string name;
|
std::string name;
|
||||||
std::vector<File> files;
|
std::vector<File> files;
|
||||||
enum class BootOption {
|
enum class BootOption {
|
||||||
|
@ -101,13 +101,15 @@ Analyser::Static::TargetList Analyser::Static::Acorn::GetTargets(const Media &me
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(!media.disks.empty()) {
|
if(!media.disks.empty()) {
|
||||||
// TODO: check for 'Hugo' versus 'Nick' in an ADFS catalogue as a hint for the Archimedes;
|
// TODO: below requires an [8-bit compatible] 'Hugo' ADFS catalogue, disallowing
|
||||||
|
// [Archimedes-exclusive] 'Nick' catalogues.
|
||||||
|
//
|
||||||
|
// Would be better to form the appropriate target in the latter case.
|
||||||
std::shared_ptr<Storage::Disk::Disk> disk = media.disks.front();
|
std::shared_ptr<Storage::Disk::Disk> disk = media.disks.front();
|
||||||
std::unique_ptr<Catalogue> dfs_catalogue, adfs_catalogue;
|
std::unique_ptr<Catalogue> dfs_catalogue, adfs_catalogue;
|
||||||
dfs_catalogue = GetDFSCatalogue(disk);
|
dfs_catalogue = GetDFSCatalogue(disk);
|
||||||
if(dfs_catalogue == nullptr) adfs_catalogue = GetADFSCatalogue(disk);
|
if(dfs_catalogue == nullptr) adfs_catalogue = GetADFSCatalogue(disk);
|
||||||
if(dfs_catalogue || adfs_catalogue) {
|
if(dfs_catalogue || (adfs_catalogue && adfs_catalogue->is_hugo)) {
|
||||||
// Accept the disk and determine whether DFS or ADFS ROMs are implied.
|
// Accept the disk and determine whether DFS or ADFS ROMs are implied.
|
||||||
// Use the Pres ADFS if using an ADFS, as it leaves Page at &EOO.
|
// Use the Pres ADFS if using an ADFS, as it leaves Page at &EOO.
|
||||||
target->media.disks = media.disks;
|
target->media.disks = media.disks;
|
||||||
|
Loading…
Reference in New Issue
Block a user