mirror of
https://github.com/akuker/RASCSI.git
synced 2026-04-21 18:17:07 +00:00
Add support for SCSI-1 CD Drives, .is1 extension (#1109)
* Add SCSI-1 option for scsicd with file extension is1 Update tests Update documentation with is1 file extension * Fix tests
This commit is contained in:
@@ -59,6 +59,7 @@ DeviceFactory::DeviceFactory()
|
||||
extension_mapping["hdr"] = SCRM;
|
||||
extension_mapping["mos"] = SCMO;
|
||||
extension_mapping["iso"] = SCCD;
|
||||
extension_mapping["is1"] = SCCD;
|
||||
|
||||
device_mapping["bridge"] = SCBR;
|
||||
device_mapping["daynaport"] = SCDP;
|
||||
@@ -118,7 +119,8 @@ shared_ptr<PrimaryDevice> DeviceFactory::CreateDevice(PbDeviceType type, int lun
|
||||
break;
|
||||
|
||||
case SCCD:
|
||||
device = make_shared<SCSICD>(lun, sector_sizes.find(SCCD)->second);
|
||||
device = make_shared<SCSICD>(lun, sector_sizes.find(SCCD)->second,
|
||||
GetExtensionLowerCase(filename) == "is1" ? scsi_level::SCSI_1_CCS : scsi_level::SCSI_2);
|
||||
device->SetProduct("SCSI CD-ROM");
|
||||
break;
|
||||
|
||||
|
||||
@@ -21,7 +21,8 @@
|
||||
using namespace scsi_defs;
|
||||
using namespace scsi_command_util;
|
||||
|
||||
SCSICD::SCSICD(int lun, const unordered_set<uint32_t>& sector_sizes) : Disk(SCCD, lun)
|
||||
SCSICD::SCSICD(int lun, const unordered_set<uint32_t>& sector_sizes, scsi_defs::scsi_level level)
|
||||
: Disk(SCCD, lun), scsi_level(level)
|
||||
{
|
||||
SetSectorSizes(sector_sizes);
|
||||
|
||||
@@ -164,7 +165,7 @@ void SCSICD::ReadToc()
|
||||
|
||||
vector<uint8_t> SCSICD::InquiryInternal() const
|
||||
{
|
||||
return HandleInquiry(device_type::CD_ROM, scsi_level::SCSI_2, true);
|
||||
return HandleInquiry(device_type::CD_ROM, scsi_level, true);
|
||||
}
|
||||
|
||||
void SCSICD::SetUpModePages(map<int, vector<byte>>& pages, int page, bool changeable) const
|
||||
|
||||
@@ -22,7 +22,7 @@ class SCSICD : public Disk, private ScsiMmcCommands
|
||||
{
|
||||
public:
|
||||
|
||||
SCSICD(int, const unordered_set<uint32_t>&);
|
||||
SCSICD(int, const unordered_set<uint32_t>&, scsi_defs::scsi_level = scsi_level::SCSI_2);
|
||||
~SCSICD() override = default;
|
||||
|
||||
bool Init(const unordered_map<string, string>&) override;
|
||||
@@ -43,6 +43,7 @@ private:
|
||||
|
||||
void AddCDROMPage(map<int, vector<byte>>&, bool) const;
|
||||
void AddCDDAPage(map<int, vector<byte>>&, bool) const;
|
||||
scsi_defs::scsi_level scsi_level;
|
||||
|
||||
void OpenIso();
|
||||
void OpenPhysical();
|
||||
|
||||
Reference in New Issue
Block a user