From 9cf91328c14d5242327f0c3f0a891be021a92b84 Mon Sep 17 00:00:00 2001 From: joevt Date: Sat, 9 Mar 2024 23:58:39 -0800 Subject: [PATCH] scsicdrom: Move inquiry info to class fields. Like scsihd. --- devices/common/scsi/scsicdrom.cpp | 10 +++------- devices/common/scsi/scsicdrom.h | 5 +++++ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/devices/common/scsi/scsicdrom.cpp b/devices/common/scsi/scsicdrom.cpp index bc8b0cc..1929dd5 100644 --- a/devices/common/scsi/scsicdrom.cpp +++ b/devices/common/scsi/scsicdrom.cpp @@ -32,10 +32,6 @@ along with this program. If not, see . using namespace std; -static char cdrom_vendor_sony_id[] = "SONY "; -static char cdu8003a_product_id[] = "CD-ROM CDU-8003A"; -static char cdu8003a_revision_id[] = "1.9a"; - ScsiCdrom::ScsiCdrom(std::string name, int my_id) : CdromDrive(), ScsiDevice(name, my_id) { } @@ -221,9 +217,9 @@ void ScsiCdrom::inquiry() { this->data_buf[5] = 0; this->data_buf[6] = 0; this->data_buf[7] = 0x18; // supports synchronous xfers and linked commands - std::memcpy(&this->data_buf[8], cdrom_vendor_sony_id, 8); - std::memcpy(&this->data_buf[16], cdu8003a_product_id, 16); - std::memcpy(&this->data_buf[32], cdu8003a_revision_id, 4); + std::memcpy(&this->data_buf[8], vendor_info, 8); + std::memcpy(&this->data_buf[16], prod_info, 16); + std::memcpy(&this->data_buf[32], rev_info, 4); this->bytes_out = 36; this->msg_buf[0] = ScsiMessage::COMMAND_COMPLETE; diff --git a/devices/common/scsi/scsicdrom.h b/devices/common/scsi/scsicdrom.h index 2d74797..9dc7d03 100644 --- a/devices/common/scsi/scsicdrom.h +++ b/devices/common/scsi/scsicdrom.h @@ -53,6 +53,11 @@ private: bool eject_allowed = true; int bytes_out = 0; uint8_t data_buf[2048] = {}; + + //inquiry info + char vendor_info[9] = "SONY "; + char prod_info[17] = "CD-ROM CDU-8003A"; + char rev_info[5] = "1.9a"; }; #endif // SCSI_CDROM_H