diff --git a/src/raspberrypi/controllers/scsidev_ctrl.cpp b/src/raspberrypi/controllers/scsidev_ctrl.cpp index c1808b36..8f417a0b 100644 --- a/src/raspberrypi/controllers/scsidev_ctrl.cpp +++ b/src/raspberrypi/controllers/scsidev_ctrl.cpp @@ -247,7 +247,7 @@ void SCSIDEV::Execute() lun = (ctrl.cmd[1] >> 5) & 0x07; if (!ctrl.unit[lun]) { - LOGINFO("Invalid LUN %d for ID %d", lun, GetSCSIID()); + LOGDEBUG("Invalid LUN %d for ID %d", lun, GetSCSIID()); Error(ERROR_CODES::sense_key::ILLEGAL_REQUEST, ERROR_CODES::asc::INVALID_LUN); return; diff --git a/src/raspberrypi/devices/scsicd.cpp b/src/raspberrypi/devices/scsicd.cpp index 60ef23f3..a7f62c8c 100644 --- a/src/raspberrypi/devices/scsicd.cpp +++ b/src/raspberrypi/devices/scsicd.cpp @@ -307,6 +307,9 @@ void SCSICD::Open(const Filepath& path) throw file_not_found_exception("Can't open CD-ROM file"); } + // Default sector size is 2048 bytes + SetSectorSizeInBytes(GetConfiguredSectorSize() ? GetConfiguredSectorSize() : 2048, false); + // Close and transfer for physical CD access if (path.GetPath()[0] == _T('\\')) { // Close @@ -341,9 +344,6 @@ void SCSICD::Open(const Filepath& path) // Successful opening ASSERT(GetBlockCount() > 0); - // Default sector size is 2048 bytes - SetSectorSizeInBytes(GetConfiguredSectorSize() ? GetConfiguredSectorSize() : 2048, false); - Disk::Open(path); FileSupport::SetPath(path); @@ -420,7 +420,7 @@ void SCSICD::OpenIso(const Filepath& path) fio.Close(); if (rawfile) { - // Size must be a multiple of 2536 and less than 700MB + // Size must be a multiple of 2536 if (size % 2536) { stringstream error; error << "Raw ISO CD-ROM file size must be a multiple of 2536 bytes but is " << size << " bytes"; @@ -431,7 +431,7 @@ void SCSICD::OpenIso(const Filepath& path) SetBlockCount((DWORD)(size / 0x930)); } else { // Set the number of blocks - SetBlockCount((DWORD)(size >> 11)); + SetBlockCount((DWORD)(size >> GetSectorSize())); } // Create only one data track @@ -472,7 +472,7 @@ void SCSICD::OpenPhysical(const Filepath& path) } // Set the number of blocks - SetBlockCount((DWORD)(size >> 11)); + SetBlockCount((DWORD)(size >> GetSectorSize())); // Create only one data track ASSERT(!track[0]);