CDPLAY - 5


cmd.bMediaDescriptor = 0;

cmd.lpTransferAddress = (DWORD)(void far *)&ed;

cmd.wDataSize = 1;

cmd.wStartSector = 0;

cmd.lpVolID = (DWORD)(void far *)NULL;

ed.bControl = 0;

CallCDDriver(&cmd, nCDUnit);

return cmd.rh.wStatus;

}

// ---------------------------------------------------

// CallCDDriver

// -

// ---------------------------------------------------

void CallCDDriver(void *rh, int nCDUnit)

{

static union REGS rg;

static struct SREGS srg;

segread(&srg);

rg.x.ax = 0x1510;

rg.x.cx = nCDUnit;

rg.x.bx = FP_OFF(rh);

int86x(0x2f, &rg, &rg, &srg);

}

// ---------------------------------------------------

// GetCDLetters

//

// -

// ---------------------------------------------------

void GetCDLetters(BYTE *bLetters)

{

static union REGS rg;

static struct SREGS srg;

segread(&srg);

rg.x.ax = 0x150d;

rg.x.bx = FP_OFF(bLetters);

int86x(0x2f, &rg, &rg, &srg);

}

// ---------------------------------------------------

// Red book

// Sierra

// ---------------------------------------------------

DWORD Red2Sierra(DWORD dwRedLoc)

{

BYTE bMin, bSec, bFrame;

bMin = (BYTE)((dwRedLoc >> 16) & 0xff);

bSec = (BYTE)((dwRedLoc >> 8) & 0xff);

bFrame = (BYTE)(dwRedLoc & 0xff);

return (DWORD)bMin * 75 * 60 + (DWORD)bSec * 75 +

(DWORD)bFrame - 150;

}