scsicdrom: Move test_unit_ready.

Make it a separate method like scsihd.
This commit is contained in:
joevt 2024-03-09 23:24:05 -08:00 committed by dingusdev
parent 05da1708eb
commit a605c435b6
2 changed files with 9 additions and 2 deletions

View File

@ -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];

View File

@ -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();