From e48843798080b3595f7ce3c0d22804f519e07d1c Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Sun, 5 Apr 2015 16:13:54 +0300 Subject: [PATCH] HD SCSI emulator Seek. --- hardfile.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/hardfile.cpp b/hardfile.cpp index 23af5224..5dbfa929 100644 --- a/hardfile.cpp +++ b/hardfile.cpp @@ -1235,6 +1235,15 @@ int scsi_hd_emulate (struct hardfiledata *hfd, struct hd_hardfiledata *hdhfd, ua goto readprot; scsi_len = 0; break; + case 0x0b: /* SEEK (6) */ + if (nodisk (hfd)) + goto nodisk; + offset = ((cmdbuf[1] & 31) << 16) | (cmdbuf[2] << 8) | cmdbuf[3]; + offset *= hfd->ci.blocksize; + if (!checkbounds(hfd, offset, hfd->ci.blocksize)) + goto outofbounds; + scsi_len = 0; + break; case 0x08: /* READ (6) */ if (nodisk (hfd)) goto nodisk; @@ -1368,6 +1377,15 @@ int scsi_hd_emulate (struct hardfiledata *hfd, struct hd_hardfiledata *hdhfd, ua scsi_len = lr = 8; } break; + case 0x2b: /* SEEK (10) */ + if (nodisk (hfd)) + goto nodisk; + offset = rl (cmdbuf + 2); + offset *= hfd->ci.blocksize; + if (!checkbounds (hfd, offset, hfd->ci.blocksize)) + goto outofbounds; + scsi_len = 0; + break; case 0x28: /* READ (10) */ if (nodisk (hfd)) goto nodisk; -- 2.47.3