[uae] Re: SCSI support on OS X

  • From: Toni Wilen <twilen@xxxxxxxxxx>
  • To: uae@xxxxxxxxxxxxx
  • Date: Sun, 21 Mar 2004 09:17:52 +0200

Richard, did you miss new scsi_atapi_fixup_inquiry() in blkdev.c?
It fixes this problem. PlayCD wants ANSI version == 2 or complains
and exits. (ATAPI ~ SCSI-2 minus MODE_SENSE_6, MODE_SELECT_6 and ANSI
version == 0 in INQUIRY)

The problem on OS X, though, is that this translation code won't be used, because libscg (the SCSI transport library) doesn't report when a device is actually an ATAPI device on OS X.

Neither does Windows.. (SPTI or ASPI)


I use this piece of code to detect ATAPI:

static int isatapi (int unitnum)
{
    uae_u8 cmd[6] = { 0x12,0,0,0,36,0 }; /* INQUIRY */
    uae_u8 out[36];
    int outlen = sizeof (out);
    uae_u8 *p = execscsicmd_in (unitnum, cmd, sizeof (cmd), &outlen);
    if (!p)
        return 0;
    if (outlen >= 2 && (p[0] & 31) == 5 && (p[2] & 7) == 0)
        return 1;
    return 0;
}


Other related posts: