diff --git a/src/raspberrypi/devices/device_factory.cpp b/src/raspberrypi/devices/device_factory.cpp index e9180e80..4dba02df 100644 --- a/src/raspberrypi/devices/device_factory.cpp +++ b/src/raspberrypi/devices/device_factory.cpp @@ -82,7 +82,7 @@ Device *DeviceFactory::CreateDevice(PbDeviceType& type, const string& filename, device = new SCSIHD_NEC(); ((Disk *)device)->SetVendor("NEC"); } else { - device = new SCSIHD(); + device = new SCSIHD(false); device->SetProtectable(true); ((Disk *)device)->SetSectorSizes(sector_sizes_scsi); } @@ -94,6 +94,7 @@ Device *DeviceFactory::CreateDevice(PbDeviceType& type, const string& filename, device->SetRemovable(true); device->SetLockable(true); device->SetProtectable(true); + device->SetProduct("SCSI HD (REM.)"); ((Disk *)device)->SetSectorSizes(sector_sizes_scsi); break; diff --git a/src/raspberrypi/devices/scsihd.cpp b/src/raspberrypi/devices/scsihd.cpp index 46dfd619..72f089f8 100644 --- a/src/raspberrypi/devices/scsihd.cpp +++ b/src/raspberrypi/devices/scsihd.cpp @@ -19,6 +19,8 @@ #include #include "../rascsi.h" +#define DEFAULT_PRODUCT "SCSI HD" + //=========================================================================== // // SCSI Hard Disk @@ -32,7 +34,6 @@ //--------------------------------------------------------------------------- SCSIHD::SCSIHD(bool removable) : Disk(removable ? "SCRM" : "SCHD") { - SetRemovable(removable); } //--------------------------------------------------------------------------- @@ -86,20 +87,22 @@ void SCSIHD::Open(const Filepath& path) throw io_exception("File size must not exceed 2 TB"); } - // Set the default product name based on the drive capacity - int capacity; - string unit; - if (GetBlockCount() >> 11 >= 1) { - capacity = GetBlockCount() >> 11; - unit = "MB"; + // For non-removable media drives set the default product name based on the drive capacity + if (!IsRemovable()) { + int capacity; + string unit; + if (GetBlockCount() >> 11 >= 1) { + capacity = GetBlockCount() >> 11; + unit = "MB"; + } + else { + capacity = GetBlockCount() >> 1; + unit = "KB"; + } + stringstream product; + product << DEFAULT_PRODUCT << " " << capacity << " " << unit; + SetProduct(product.str(), false); } - else { - capacity = GetBlockCount() >> 1; - unit = "KB"; - } - stringstream product; - product << DEFAULT_PRODUCT << " " << capacity << " " << unit; - SetProduct(product.str(), false); Disk::Open(path); FileSupport::SetPath(path); diff --git a/src/raspberrypi/devices/scsihd.h b/src/raspberrypi/devices/scsihd.h index 7c003325..1886dea2 100644 --- a/src/raspberrypi/devices/scsihd.h +++ b/src/raspberrypi/devices/scsihd.h @@ -19,8 +19,6 @@ #include "disk.h" #include "filepath.h" -#define DEFAULT_PRODUCT "SCSI HD" - //=========================================================================== // // SCSI Hard Disk @@ -30,7 +28,7 @@ class SCSIHD : public Disk, public FileSupport { public: // Basic Functions - SCSIHD(bool = false); // Constructor + SCSIHD(bool); // Constructor void Reset(); // Reset void Open(const Filepath& path); // Open diff --git a/src/raspberrypi/devices/scsihd_nec.cpp b/src/raspberrypi/devices/scsihd_nec.cpp index 8b8c8f01..b7f67511 100644 --- a/src/raspberrypi/devices/scsihd_nec.cpp +++ b/src/raspberrypi/devices/scsihd_nec.cpp @@ -29,7 +29,7 @@ // Constructor // //--------------------------------------------------------------------------- -SCSIHD_NEC::SCSIHD_NEC() : SCSIHD() +SCSIHD_NEC::SCSIHD_NEC() : SCSIHD(false) { // Work initialization cylinders = 0;