Add an Archimedes enum, start looking at analysis.

This commit is contained in:
Thomas Harte 2024-02-22 13:51:44 -05:00
parent 4c45f4468e
commit ddf136556d
3 changed files with 25 additions and 22 deletions

View File

@ -62,10 +62,10 @@ static std::vector<std::shared_ptr<Storage::Cartridge::Cartridge>>
Analyser::Static::TargetList Analyser::Static::Acorn::GetTargets(const Media &media, const std::string &, TargetPlatform::IntType) {
auto target = std::make_unique<Target>();
// 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<Storage::Tape::Tape> tape = media.tapes.front();
std::vector<File> 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<Storage::Disk::Disk> disk = media.disks.front();
std::unique_ptr<Catalogue> dfs_catalogue, adfs_catalogue;
dfs_catalogue = GetDFSCatalogue(disk);

View File

@ -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);

View File

@ -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,