From a605c435b658e1e3cddd3af7014ca648999bfe2a Mon Sep 17 00:00:00 2001 From: joevt Date: Sat, 9 Mar 2024 23:24:05 -0800 Subject: [PATCH] scsicdrom: Move test_unit_ready. Make it a separate method like scsihd. --- devices/common/scsi/scsicdrom.cpp | 8 +++++++- devices/common/scsi/scsicdrom.h | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/devices/common/scsi/scsicdrom.cpp b/devices/common/scsi/scsicdrom.cpp index a7cff07..068b259 100644 --- a/devices/common/scsi/scsicdrom.cpp +++ b/devices/common/scsi/scsicdrom.cpp @@ -60,7 +60,7 @@ void ScsiCdrom::process_command() switch (cmd[0]) { case ScsiCommand::TEST_UNIT_READY: - this->switch_phase(ScsiPhase::STATUS); + this->test_unit_ready(); break; case ScsiCommand::REWIND: this->illegal_command(cmd); @@ -198,6 +198,12 @@ void ScsiCdrom::read(const uint32_t lba, uint16_t nblocks, const uint8_t cmd_len this->switch_phase(ScsiPhase::DATA_IN); } +int ScsiCdrom::test_unit_ready() +{ + this->switch_phase(ScsiPhase::STATUS); + return ScsiError::NO_ERROR; +} + void ScsiCdrom::inquiry() { int page_num = cmd_buf[2]; int alloc_len = cmd_buf[4]; diff --git a/devices/common/scsi/scsicdrom.h b/devices/common/scsi/scsicdrom.h index 3fc8a2e..acd7735 100644 --- a/devices/common/scsi/scsicdrom.h +++ b/devices/common/scsi/scsicdrom.h @@ -1,6 +1,6 @@ /* DingusPPC - The Experimental PowerPC Macintosh emulator -Copyright (C) 2018-23 divingkatae and maximum +Copyright (C) 2018-24 divingkatae and maximum (theweirdo) spatium (Contact divingkatae#1017 or powermax#2286 on Discord for more info) @@ -46,6 +46,7 @@ public: virtual bool get_more_data() override; protected: + int test_unit_ready(); void read(uint32_t lba, uint16_t nblocks, uint8_t cmd_len); void inquiry(); void mode_sense();