Fix SCSI timing errors - 45ns Hold Time and 90ns assertion/deassertion period now...
[SCSI2SD-V6.git] / src / firmware / scsi.c
index d927aadb96cb3d257761851cda54d294dfb2e142..bbb3e4843a5572f0e522f936d9f79348e7b8afe0 100755 (executable)
@@ -244,12 +244,15 @@ static void process_Command()
        scsiEnterPhase(COMMAND);\r
        scsiDev.parityError = 0;\r
 \r
-       memset(scsiDev.cdb, 0, sizeof(scsiDev.cdb));\r
-       scsiDev.cdb[0] = scsiReadByte();\r
+       memset(scsiDev.cdb + 6, 0, sizeof(scsiDev.cdb) - 6);\r
+       scsiRead(scsiDev.cdb, 6);\r
 \r
        group = scsiDev.cdb[0] >> 5;\r
        scsiDev.cdbLen = CmdGroupBytes[group];\r
-       scsiRead(scsiDev.cdb + 1, scsiDev.cdbLen - 1);\r
+       if (scsiDev.cdbLen - 6 > 0)\r
+       {\r
+               scsiRead(scsiDev.cdb + 6, scsiDev.cdbLen - 6);\r
+       }\r
 \r
        command = scsiDev.cdb[0];\r
 \r