mirror of
https://github.com/holub/mame
synced 2025-07-02 00:29:37 +03:00
Merge pull request #3934 from hp9k/nscsi_format_unit
nscsi_hd: add FORMAT_UNIT command (nw)
This commit is contained in:
commit
d1975b9a4b
@ -372,6 +372,27 @@ void nscsi_harddisk_device::scsi_command()
|
|||||||
scsi_status_complete(SS_GOOD);
|
scsi_status_complete(SS_GOOD);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case SC_FORMAT_UNIT:
|
||||||
|
LOG("command FORMAT UNIT:%s%s%s%s%s\n",
|
||||||
|
(scsi_cmdbuf[1] & 0x80) ? " FMT-PINFO" : "",
|
||||||
|
(scsi_cmdbuf[1] & 0x40) ? " RTO_REQ" : "",
|
||||||
|
(scsi_cmdbuf[1] & 0x20) ? " LONG-LIST" : "",
|
||||||
|
(scsi_cmdbuf[1] & 0x10) ? " FMTDATA" : "",
|
||||||
|
(scsi_cmdbuf[1] & 0x08) ? " CMPLIST" : "");
|
||||||
|
{
|
||||||
|
hard_disk_info *info = hard_disk_get_info(harddisk);
|
||||||
|
auto block = std::make_unique<uint8_t[]>(info->sectorbytes);
|
||||||
|
for(int cyl = 0; cyl < info->cylinders; cyl++) {
|
||||||
|
for(int head = 0; head < info->heads; head++) {
|
||||||
|
for(int sector = 0; sector < info->sectors; sector++) {
|
||||||
|
hard_disk_write(harddisk, cyl * head * sector, block.get());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
scsi_status_complete(SS_GOOD);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
LOG("command %02x ***UNKNOWN***\n", scsi_cmdbuf[0]);
|
LOG("command %02x ***UNKNOWN***\n", scsi_cmdbuf[0]);
|
||||||
nscsi_full_device::scsi_command();
|
nscsi_full_device::scsi_command();
|
||||||
|
Loading…
Reference in New Issue
Block a user