mirror of
https://github.com/TomHarte/CLK.git
synced 2025-01-03 15:29:45 +00:00
Add an Archimedes enum, start looking at analysis.
This commit is contained in:
parent
4c45f4468e
commit
ddf136556d
@ -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) {
|
Analyser::Static::TargetList Analyser::Static::Acorn::GetTargets(const Media &media, const std::string &, TargetPlatform::IntType) {
|
||||||
auto target = std::make_unique<Target>();
|
auto target = std::make_unique<Target>();
|
||||||
|
|
||||||
// strip out inappropriate cartridges
|
// Strip out inappropriate cartridges.
|
||||||
target->media.cartridges = AcornCartridgesFrom(media.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()) {
|
if(!media.tapes.empty()) {
|
||||||
std::shared_ptr<Storage::Tape::Tape> tape = media.tapes.front();
|
std::shared_ptr<Storage::Tape::Tape> tape = media.tapes.front();
|
||||||
std::vector<File> files = GetFiles(tape);
|
std::vector<File> files = GetFiles(tape);
|
||||||
@ -101,6 +101,8 @@ 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;
|
||||||
|
|
||||||
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);
|
||||||
|
@ -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.
|
// 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;
|
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);
|
file_.seek(513, SEEK_SET);
|
||||||
uint8_t bytes[4];
|
uint8_t bytes[4];
|
||||||
file_.read(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_.seek(0x6fb, SEEK_SET);
|
||||||
file_.read(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;
|
||||||
|
|
||||||
// Pick a number of heads; treat this image as double sided if it's too large to be single-sided.
|
// 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);
|
head_count_ = 1 + (file_.stats().st_size > sectors_per_track * sizeT(128 << sector_size) * 80);
|
||||||
|
@ -23,24 +23,25 @@ enum Type: IntType {
|
|||||||
AcornAtom = 1 << 5,
|
AcornAtom = 1 << 5,
|
||||||
AcornElectron = 1 << 6,
|
AcornElectron = 1 << 6,
|
||||||
Amiga = 1 << 7,
|
Amiga = 1 << 7,
|
||||||
BBCMaster = 1 << 8,
|
Archimedes = 1 << 8,
|
||||||
BBCModelA = 1 << 9,
|
BBCMaster = 1 << 9,
|
||||||
BBCModelB = 1 << 10,
|
BBCModelA = 1 << 10,
|
||||||
Coleco = 1 << 11,
|
BBCModelB = 1 << 11,
|
||||||
Commodore = 1 << 12,
|
Coleco = 1 << 12,
|
||||||
DiskII = 1 << 13,
|
Commodore = 1 << 13,
|
||||||
Enterprise = 1 << 14,
|
DiskII = 1 << 14,
|
||||||
Sega = 1 << 15,
|
Enterprise = 1 << 15,
|
||||||
Macintosh = 1 << 16,
|
Sega = 1 << 16,
|
||||||
MSX = 1 << 17,
|
Macintosh = 1 << 17,
|
||||||
Oric = 1 << 18,
|
MSX = 1 << 18,
|
||||||
ZX80 = 1 << 19,
|
Oric = 1 << 19,
|
||||||
ZX81 = 1 << 20,
|
ZX80 = 1 << 20,
|
||||||
ZXSpectrum = 1 << 21,
|
ZX81 = 1 << 21,
|
||||||
PCCompatible = 1 << 22,
|
ZXSpectrum = 1 << 22,
|
||||||
FAT12 = 1 << 23,
|
PCCompatible = 1 << 23,
|
||||||
|
FAT12 = 1 << 24,
|
||||||
|
|
||||||
Acorn = AcornAtom | AcornElectron | BBCMaster | BBCModelA | BBCModelB,
|
Acorn = AcornAtom | AcornElectron | BBCMaster | BBCModelA | BBCModelB | Archimedes,
|
||||||
ZX8081 = ZX80 | ZX81,
|
ZX8081 = ZX80 | ZX81,
|
||||||
AllCartridge = Atari2600 | AcornElectron | Coleco | MSX,
|
AllCartridge = Atari2600 | AcornElectron | Coleco | MSX,
|
||||||
AllDisk = Acorn | AmstradCPC | Commodore | Oric | MSX | ZXSpectrum | Macintosh | AtariST | DiskII | Amiga | PCCompatible | FAT12,
|
AllDisk = Acorn | AmstradCPC | Commodore | Oric | MSX | ZXSpectrum | Macintosh | AtariST | DiskII | Amiga | PCCompatible | FAT12,
|
||||||
|
Loading…
Reference in New Issue
Block a user