mirror of
https://github.com/holub/mame
synced 2025-07-05 18:08:04 +03:00
Revert "nscsi_cd: make sgi cdrom identify as hard disk"
This stops indy_4610 from failing its SCSI test.
This reverts commit 2e25d99be6
.
This commit is contained in:
parent
88e9c67917
commit
d96773c67d
@ -64,8 +64,6 @@ nscsi_cdrom_apple_device::nscsi_cdrom_apple_device(const machine_config &mconfig
|
|||||||
nscsi_cdrom_device::nscsi_cdrom_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
|
nscsi_cdrom_device::nscsi_cdrom_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
|
||||||
: nscsi_full_device(mconfig, type, tag, owner, clock)
|
: nscsi_full_device(mconfig, type, tag, owner, clock)
|
||||||
, cdrom(nullptr)
|
, cdrom(nullptr)
|
||||||
, periph_qt(0x05)
|
|
||||||
, removable(true)
|
|
||||||
, bytes_per_block(bytes_per_sector)
|
, bytes_per_block(bytes_per_sector)
|
||||||
, lba(0)
|
, lba(0)
|
||||||
, cur_sector(0)
|
, cur_sector(0)
|
||||||
@ -225,8 +223,8 @@ void nscsi_cdrom_device::scsi_command()
|
|||||||
if (lun != 0)
|
if (lun != 0)
|
||||||
scsi_cmdbuf[0] = 0x7f;
|
scsi_cmdbuf[0] = 0x7f;
|
||||||
else
|
else
|
||||||
scsi_cmdbuf[0] = periph_qt;
|
scsi_cmdbuf[0] = 0x05; // device is present, device is CD/DVD (MMC-3)
|
||||||
scsi_cmdbuf[1] = removable ? 0x80 : 0;
|
scsi_cmdbuf[1] = 0x80; // media is removable
|
||||||
scsi_cmdbuf[2] = compliance; // device complies with SPC-3 standard
|
scsi_cmdbuf[2] = compliance; // device complies with SPC-3 standard
|
||||||
scsi_cmdbuf[3] = 0x02; // response data format = SPC-3 standard
|
scsi_cmdbuf[3] = 0x02; // response data format = SPC-3 standard
|
||||||
scsi_cmdbuf[4] = 0x20; // additional length
|
scsi_cmdbuf[4] = 0x20; // additional length
|
||||||
@ -266,7 +264,7 @@ void nscsi_cdrom_device::scsi_command()
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case SC_RECIEVE_DIAG_RES: {
|
case SC_RECIEVE_DIAG_RES: {
|
||||||
LOG("command RECEIVE DIAGNOSTICS RESULTS\n");
|
LOG("command RECIEVE DIAGNOSTICS RESULTS");
|
||||||
int size = (scsi_cmdbuf[3] << 8) | scsi_cmdbuf[4];
|
int size = (scsi_cmdbuf[3] << 8) | scsi_cmdbuf[4];
|
||||||
int pos = 0;
|
int pos = 0;
|
||||||
scsi_cmdbuf[pos++] = 0;
|
scsi_cmdbuf[pos++] = 0;
|
||||||
@ -284,7 +282,7 @@ void nscsi_cdrom_device::scsi_command()
|
|||||||
}
|
}
|
||||||
|
|
||||||
case SC_SEND_DIAGNOSTICS: {
|
case SC_SEND_DIAGNOSTICS: {
|
||||||
LOG("command SEND DIAGNOSTICS\n");
|
LOG("command SEND DIAGNOSTICS");
|
||||||
int size = (scsi_cmdbuf[3] << 8) | scsi_cmdbuf[4];
|
int size = (scsi_cmdbuf[3] << 8) | scsi_cmdbuf[4];
|
||||||
if(scsi_cmdbuf[1] & 4) {
|
if(scsi_cmdbuf[1] & 4) {
|
||||||
// Self-test
|
// Self-test
|
||||||
@ -607,25 +605,12 @@ enum sgi_scsi_command_e : uint8_t {
|
|||||||
SGI_HD2CDROM = 0xc9,
|
SGI_HD2CDROM = 0xc9,
|
||||||
};
|
};
|
||||||
|
|
||||||
void nscsi_cdrom_sgi_device::device_reset()
|
|
||||||
{
|
|
||||||
nscsi_cdrom_device::device_reset();
|
|
||||||
|
|
||||||
// identify as non-removable hard disk after reset
|
|
||||||
periph_qt = 0x00;
|
|
||||||
removable = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void nscsi_cdrom_sgi_device::scsi_command()
|
void nscsi_cdrom_sgi_device::scsi_command()
|
||||||
{
|
{
|
||||||
switch (scsi_cmdbuf[0]) {
|
switch (scsi_cmdbuf[0]) {
|
||||||
case SGI_HD2CDROM:
|
case SGI_HD2CDROM:
|
||||||
LOG("command SGI_HD2CDROM\n");
|
LOG("command SGI_HD2CDROM");
|
||||||
|
// No need to do anything (yet). Just acknowledge the command.
|
||||||
// now identify as removable cdrom
|
|
||||||
periph_qt = 0x05;
|
|
||||||
removable = true;
|
|
||||||
|
|
||||||
scsi_status_complete(SS_GOOD);
|
scsi_status_complete(SS_GOOD);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -39,9 +39,6 @@ protected:
|
|||||||
|
|
||||||
cdrom_file *cdrom;
|
cdrom_file *cdrom;
|
||||||
|
|
||||||
uint8_t periph_qt;
|
|
||||||
bool removable;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static constexpr uint32_t bytes_per_sector = 2048;
|
static constexpr uint32_t bytes_per_sector = 2048;
|
||||||
|
|
||||||
@ -67,8 +64,6 @@ public:
|
|||||||
nscsi_cdrom_sgi_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
|
nscsi_cdrom_sgi_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void device_reset() override;
|
|
||||||
|
|
||||||
virtual void scsi_command() override;
|
virtual void scsi_command() override;
|
||||||
virtual bool scsi_command_done(uint8_t command, uint8_t length) override;
|
virtual bool scsi_command_done(uint8_t command, uint8_t length) override;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user