]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
HD SCSI emulator Seek.
authorToni Wilen <twilen@winuae.net>
Sun, 5 Apr 2015 13:13:54 +0000 (16:13 +0300)
committerToni Wilen <twilen@winuae.net>
Sun, 5 Apr 2015 13:13:54 +0000 (16:13 +0300)
hardfile.cpp

index 23af522493089bd1b58ae215ed0840bc19219c23..5dbfa929bae2b54abdf045e667031cb108379924 100644 (file)
@@ -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;