mirror of
https://github.com/dingusdev/dingusppc.git
synced 2025-02-08 02:30:40 +00:00
scsihd: remove duplicated code.
This commit is contained in:
parent
26153ca8ea
commit
0831182e39
@ -66,18 +66,12 @@ void ScsiHardDisk::process_command() {
|
|||||||
case ScsiCommand::TEST_UNIT_READY:
|
case ScsiCommand::TEST_UNIT_READY:
|
||||||
this->test_unit_ready();
|
this->test_unit_ready();
|
||||||
break;
|
break;
|
||||||
case ScsiCommand::REWIND:
|
|
||||||
this->illegal_command(cmd);
|
|
||||||
break;
|
|
||||||
case ScsiCommand::REQ_SENSE:
|
case ScsiCommand::REQ_SENSE:
|
||||||
this->req_sense(cmd[4]);
|
this->req_sense(cmd[4]);
|
||||||
break;
|
break;
|
||||||
case ScsiCommand::FORMAT_UNIT:
|
case ScsiCommand::FORMAT_UNIT:
|
||||||
this->format();
|
this->format();
|
||||||
break;
|
break;
|
||||||
case ScsiCommand::READ_BLK_LIMITS:
|
|
||||||
this->illegal_command(cmd);
|
|
||||||
break;
|
|
||||||
case ScsiCommand::READ_6:
|
case ScsiCommand::READ_6:
|
||||||
lba = ((cmd[1] & 0x1F) << 16) + (cmd[2] << 8) + cmd[3];
|
lba = ((cmd[1] & 0x1F) << 16) + (cmd[2] << 8) + cmd[3];
|
||||||
this->read(lba, cmd[4], 6);
|
this->read(lba, cmd[4], 6);
|
||||||
@ -86,36 +80,15 @@ void ScsiHardDisk::process_command() {
|
|||||||
lba = ((cmd[1] & 0x1F) << 16) + (cmd[2] << 8) + cmd[3];
|
lba = ((cmd[1] & 0x1F) << 16) + (cmd[2] << 8) + cmd[3];
|
||||||
this->write(lba, cmd[4], 6);
|
this->write(lba, cmd[4], 6);
|
||||||
break;
|
break;
|
||||||
case ScsiCommand::SEEK_6:
|
|
||||||
this->illegal_command(cmd);
|
|
||||||
break;
|
|
||||||
case ScsiCommand::INQUIRY:
|
case ScsiCommand::INQUIRY:
|
||||||
this->inquiry();
|
this->inquiry();
|
||||||
break;
|
break;
|
||||||
case ScsiCommand::VERIFY_6:
|
|
||||||
this->illegal_command(cmd);
|
|
||||||
break;
|
|
||||||
case ScsiCommand::MODE_SELECT_6:
|
case ScsiCommand::MODE_SELECT_6:
|
||||||
mode_select_6(cmd[4]);
|
mode_select_6(cmd[4]);
|
||||||
break;
|
break;
|
||||||
case ScsiCommand::RELEASE_UNIT:
|
|
||||||
this->illegal_command(cmd);
|
|
||||||
break;
|
|
||||||
case ScsiCommand::ERASE_6:
|
|
||||||
this->illegal_command(cmd);
|
|
||||||
break;
|
|
||||||
case ScsiCommand::MODE_SENSE_6:
|
case ScsiCommand::MODE_SENSE_6:
|
||||||
this->mode_sense_6();
|
this->mode_sense_6();
|
||||||
break;
|
break;
|
||||||
case ScsiCommand::START_STOP_UNIT:
|
|
||||||
this->illegal_command(cmd);
|
|
||||||
break;
|
|
||||||
case ScsiCommand::DIAG_RESULTS:
|
|
||||||
this->illegal_command(cmd);
|
|
||||||
break;
|
|
||||||
case ScsiCommand::SEND_DIAGS:
|
|
||||||
this->illegal_command(cmd);
|
|
||||||
break;
|
|
||||||
case ScsiCommand::PREVENT_ALLOW_MEDIUM_REMOVAL:
|
case ScsiCommand::PREVENT_ALLOW_MEDIUM_REMOVAL:
|
||||||
this->eject_allowed = (cmd[4] & 1) == 0;
|
this->eject_allowed = (cmd[4] & 1) == 0;
|
||||||
this->switch_phase(ScsiPhase::STATUS);
|
this->switch_phase(ScsiPhase::STATUS);
|
||||||
@ -135,29 +108,9 @@ void ScsiHardDisk::process_command() {
|
|||||||
this->write(lba, READ_WORD_BE_U(&cmd[7]), 10);
|
this->write(lba, READ_WORD_BE_U(&cmd[7]), 10);
|
||||||
this->switch_phase(ScsiPhase::DATA_OUT);
|
this->switch_phase(ScsiPhase::DATA_OUT);
|
||||||
break;
|
break;
|
||||||
case ScsiCommand::VERIFY_10:
|
|
||||||
this->illegal_command(cmd);
|
|
||||||
break;
|
|
||||||
case ScsiCommand::READ_BUFFER:
|
case ScsiCommand::READ_BUFFER:
|
||||||
read_buffer();
|
read_buffer();
|
||||||
break;
|
break;
|
||||||
case ScsiCommand::MODE_SENSE_10:
|
|
||||||
this->illegal_command(cmd);
|
|
||||||
break;
|
|
||||||
case ScsiCommand::READ_12:
|
|
||||||
this->illegal_command(cmd);
|
|
||||||
break;
|
|
||||||
|
|
||||||
// CD-ROM specific commands
|
|
||||||
case ScsiCommand::READ_TOC:
|
|
||||||
this->illegal_command(cmd);
|
|
||||||
break;
|
|
||||||
case ScsiCommand::SET_CD_SPEED:
|
|
||||||
this->illegal_command(cmd);
|
|
||||||
break;
|
|
||||||
case ScsiCommand::READ_CD:
|
|
||||||
this->illegal_command(cmd);
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
this->illegal_command(cmd);
|
this->illegal_command(cmd);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user