diff --git a/Analyser/Static/Acorn/StaticAnalyser.cpp b/Analyser/Static/Acorn/StaticAnalyser.cpp index d5a34167b..0c3eac715 100644 --- a/Analyser/Static/Acorn/StaticAnalyser.cpp +++ b/Analyser/Static/Acorn/StaticAnalyser.cpp @@ -62,10 +62,10 @@ static std::vector> Analyser::Static::TargetList Analyser::Static::Acorn::GetTargets(const Media &media, const std::string &, TargetPlatform::IntType) { auto target = std::make_unique(); - // strip out inappropriate cartridges + // Strip out inappropriate cartridges. target->media.cartridges = AcornCartridgesFrom(media.cartridges); - // if there are any tapes, attempt to get data from the first + // If there are any tapes, attempt to get data from the first. if(!media.tapes.empty()) { std::shared_ptr tape = media.tapes.front(); std::vector files = GetFiles(tape); @@ -101,6 +101,8 @@ Analyser::Static::TargetList Analyser::Static::Acorn::GetTargets(const Media &me } if(!media.disks.empty()) { + // TODO: check for 'Hugo' versus 'Nick' in an ADFS catalogue as a hint for the Archimedes; + std::shared_ptr disk = media.disks.front(); std::unique_ptr dfs_catalogue, adfs_catalogue; dfs_catalogue = GetDFSCatalogue(disk); diff --git a/Storage/Disk/DiskImage/Formats/AcornADF.cpp b/Storage/Disk/DiskImage/Formats/AcornADF.cpp index 57e333c19..27eb68b1a 100644 --- a/Storage/Disk/DiskImage/Formats/AcornADF.cpp +++ b/Storage/Disk/DiskImage/Formats/AcornADF.cpp @@ -25,15 +25,15 @@ AcornADF::AcornADF(const std::string &file_name) : MFMSectorDump(file_name) { // Check that the disk image is at least large enough to hold an ADFS catalogue. if(file_.stats().st_size < 7 * sizeT(128 << sector_size)) throw Error::InvalidFormat; - // Check that the initial directory's 'Hugo's are present. + // Check that the initial directory's 'Hugo's or 'Nick's are present. file_.seek(513, SEEK_SET); uint8_t bytes[4]; file_.read(bytes, 4); - if(bytes[0] != 'H' || bytes[1] != 'u' || bytes[2] != 'g' || bytes[3] != 'o') throw Error::InvalidFormat; + if(memcmp(bytes, "Hugo", 4)) throw Error::InvalidFormat; file_.seek(0x6fb, SEEK_SET); file_.read(bytes, 4); - if(bytes[0] != 'H' || bytes[1] != 'u' || bytes[2] != 'g' || bytes[3] != 'o') throw Error::InvalidFormat; + if(memcmp(bytes, "Hugo", 4)) throw Error::InvalidFormat; // Pick a number of heads; treat this image as double sided if it's too large to be single-sided. head_count_ = 1 + (file_.stats().st_size > sectors_per_track * sizeT(128 << sector_size) * 80); diff --git a/Storage/TargetPlatforms.hpp b/Storage/TargetPlatforms.hpp index c352efe9f..94ecb1473 100644 --- a/Storage/TargetPlatforms.hpp +++ b/Storage/TargetPlatforms.hpp @@ -23,24 +23,25 @@ enum Type: IntType { AcornAtom = 1 << 5, AcornElectron = 1 << 6, Amiga = 1 << 7, - BBCMaster = 1 << 8, - BBCModelA = 1 << 9, - BBCModelB = 1 << 10, - Coleco = 1 << 11, - Commodore = 1 << 12, - DiskII = 1 << 13, - Enterprise = 1 << 14, - Sega = 1 << 15, - Macintosh = 1 << 16, - MSX = 1 << 17, - Oric = 1 << 18, - ZX80 = 1 << 19, - ZX81 = 1 << 20, - ZXSpectrum = 1 << 21, - PCCompatible = 1 << 22, - FAT12 = 1 << 23, + Archimedes = 1 << 8, + BBCMaster = 1 << 9, + BBCModelA = 1 << 10, + BBCModelB = 1 << 11, + Coleco = 1 << 12, + Commodore = 1 << 13, + DiskII = 1 << 14, + Enterprise = 1 << 15, + Sega = 1 << 16, + Macintosh = 1 << 17, + MSX = 1 << 18, + Oric = 1 << 19, + ZX80 = 1 << 20, + ZX81 = 1 << 21, + ZXSpectrum = 1 << 22, + PCCompatible = 1 << 23, + FAT12 = 1 << 24, - Acorn = AcornAtom | AcornElectron | BBCMaster | BBCModelA | BBCModelB, + Acorn = AcornAtom | AcornElectron | BBCMaster | BBCModelA | BBCModelB | Archimedes, ZX8081 = ZX80 | ZX81, AllCartridge = Atari2600 | AcornElectron | Coleco | MSX, AllDisk = Acorn | AmstradCPC | Commodore | Oric | MSX | ZXSpectrum | Macintosh | AtariST | DiskII | Amiga | PCCompatible | FAT12,