mirror of
https://github.com/akuker/RASCSI.git
synced 2024-12-23 21:29:30 +00:00
Device factory sets device features
This commit is contained in:
parent
ac9f9bb335
commit
2d364f16d8
@ -44,33 +44,64 @@ Device *DeviceFactory::CreateDevice(PbDeviceType& type, const string& filename,
|
||||
}
|
||||
}
|
||||
|
||||
Device *device = NULL;
|
||||
|
||||
switch (type) {
|
||||
case SAHD:
|
||||
return new SASIHD();
|
||||
device = new SASIHD();
|
||||
break;
|
||||
|
||||
case SCHD:
|
||||
if (ext == "hdn" || ext == "hdi" || ext == "nhd") {
|
||||
return new SCSIHD_NEC();
|
||||
device = new SCSIHD_NEC();
|
||||
((Disk *)device)->SetVendor("NEC");
|
||||
} else {
|
||||
return new SCSIHD();
|
||||
device = new SCSIHD();
|
||||
device->SetProtectable(true);
|
||||
((Disk *)device)->SetSectorSizeConfigurable(true);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case SCRM:
|
||||
return new SCSIHD(true);
|
||||
device = new SCSIHD(true);
|
||||
device->SetProtectable(true);
|
||||
device->SetLockable(true);
|
||||
((Disk *)device)->SetSectorSizeConfigurable(true);
|
||||
break;
|
||||
|
||||
case SCMO:
|
||||
return new SCSIMO();
|
||||
device = new SCSIMO();
|
||||
device->SetProtectable(true);
|
||||
device->SetRemovable(true);
|
||||
device->SetLockable(true);
|
||||
device->SetProduct("SCSI MO");
|
||||
break;
|
||||
|
||||
case SCCD:
|
||||
return new SCSICD();
|
||||
device = new SCSICD();
|
||||
device->SetReadOnly(true);
|
||||
device->SetRemovable(true);
|
||||
device->SetLockable(true);
|
||||
device->SetProduct("SCSI CD-ROM");
|
||||
break;
|
||||
|
||||
case SCBR:
|
||||
return new SCSIBR();
|
||||
device = new SCSIBR();
|
||||
device->SetProduct("BRIDGE");
|
||||
break;
|
||||
|
||||
case SCDP:
|
||||
return new SCSIDaynaPort();
|
||||
device = new SCSIDaynaPort();
|
||||
device->SetVendor("Dayna");
|
||||
device->SetProduct("SCSI/Link");
|
||||
device->SetRevision("1.4a");
|
||||
break;
|
||||
|
||||
default:
|
||||
return NULL;
|
||||
assert(false);
|
||||
break;
|
||||
}
|
||||
|
||||
return device;
|
||||
}
|
||||
|
@ -31,7 +31,6 @@
|
||||
//---------------------------------------------------------------------------
|
||||
SASIHD::SASIHD() : Disk("SAHD")
|
||||
{
|
||||
SetProtectable(true);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
@ -45,12 +45,6 @@ const BYTE SCSIDaynaPort::m_apple_talk_addr[6] = { 0x09, 0x00, 0x07, 0xff, 0xff,
|
||||
//---------------------------------------------------------------------------
|
||||
SCSIDaynaPort::SCSIDaynaPort() : Disk("SCDP")
|
||||
{
|
||||
SetRemovable(false);
|
||||
|
||||
SetVendor("Dayna");
|
||||
SetProduct("SCSI/Link");
|
||||
SetRevision("1.4a");
|
||||
|
||||
AddCommand(SCSIDEV::eCmdTestUnitReady, "TestUnitReady", &SCSIDaynaPort::TestUnitReady);
|
||||
AddCommand(SCSIDEV::eCmdRead6, "Read6", &SCSIDaynaPort::Read6);
|
||||
AddCommand(SCSIDEV::eCmdWrite6, "Write6", &SCSIDaynaPort::Write6);
|
||||
|
@ -36,10 +36,6 @@ using namespace std;
|
||||
//---------------------------------------------------------------------------
|
||||
SCSIBR::SCSIBR() : Disk("SCBR")
|
||||
{
|
||||
SetRemovable(false);
|
||||
|
||||
SetProduct("BRIDGE");
|
||||
|
||||
fsoptlen = 0;
|
||||
fsoutlen = 0;
|
||||
fsresult = 0;
|
||||
|
@ -226,11 +226,6 @@ bool CDTrack::IsAudio() const
|
||||
//---------------------------------------------------------------------------
|
||||
SCSICD::SCSICD() : Disk("SCCD"), MmcDevice(), FileSupport()
|
||||
{
|
||||
SetRemovable(true);
|
||||
SetReadOnly(true);
|
||||
|
||||
SetProduct("SCSI CD-ROM");
|
||||
|
||||
// NOT in raw format
|
||||
rawfile = false;
|
||||
|
||||
|
@ -33,8 +33,6 @@
|
||||
SCSIHD::SCSIHD(bool removable) : Disk(removable ? "SCRM" : "SCHD")
|
||||
{
|
||||
SetRemovable(removable);
|
||||
SetProtectable(true);
|
||||
SetSectorSizeConfigurable(true);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
@ -31,10 +31,6 @@
|
||||
//---------------------------------------------------------------------------
|
||||
SCSIHD_NEC::SCSIHD_NEC() : SCSIHD()
|
||||
{
|
||||
SetSectorSizeConfigurable(false);
|
||||
|
||||
SetVendor("NEC");
|
||||
|
||||
// Work initialization
|
||||
cylinders = 0;
|
||||
heads = 0;
|
||||
|
@ -32,10 +32,6 @@
|
||||
//---------------------------------------------------------------------------
|
||||
SCSIMO::SCSIMO() : Disk("SCMO")
|
||||
{
|
||||
SetRemovable(true);
|
||||
SetProtectable(true);
|
||||
|
||||
SetProduct("SCSI MO");
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user