From 4d33692c6f2c9355ffa53b6da203ed9ab2090a50 Mon Sep 17 00:00:00 2001 From: Peter Veenstra Date: Fri, 21 Apr 2006 08:35:31 +0000 Subject: [PATCH] Add the CDROM device in the device chain. Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@2609 --- src/dos/dos_mscdex.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/dos/dos_mscdex.cpp b/src/dos/dos_mscdex.cpp index 70c5d93f..0bf8fffa 100644 --- a/src/dos/dos_mscdex.cpp +++ b/src/dos/dos_mscdex.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: dos_mscdex.cpp,v 1.41 2006-04-17 20:06:39 c2woody Exp $ */ +/* $Id: dos_mscdex.cpp,v 1.42 2006-04-21 08:35:31 qbix79 Exp $ */ #include #include @@ -208,10 +208,22 @@ int CMscdex::AddDrive(Bit16u _drive, char* physicalPath, Bit8u& subUnit) Bit16u seg = DOS_GetMemory(driverSize/16+((driverSize%16)>0)); DOS_DeviceHeader devHeader(PhysMake(seg,0)); devHeader.SetNextDeviceHeader (0xFFFFFFFF); + devHeader.SetAttribute(0xc800); devHeader.SetDriveLetter (_drive+1); devHeader.SetNumSubUnits (1); devHeader.SetName ("MSCD001 "); + //Link it in the device chain + Bit32u start = dos_infoblock.GetDeviceChain(); + Bit16u segm = start>>16; + Bit16u offm = start&0xFFFF; + while(start != 0xFFFFFFFF) { + segm = start>>16; + offm = start&0xFFFF; + start = real_readd(segm,offm); + } + real_writed(segm,offm,seg<<16); + // Create Callback Strategy Bit16u off = sizeof(DOS_DeviceHeader::sDeviceHeader); Bitu call_strategy=CALLBACK_Allocate(); @@ -888,6 +900,8 @@ static Bit16u MSCDEX_IOCTL_Optput(PhysPt buffer,Bit8u drive_unit) { case 0x00 : // Unload /eject media if (!mscdex->LoadUnloadMedia(drive_unit,true)) return 0x02; break; + case 0x03: //Audio Channel control + MSCDEX_LOG("MSCDEX: Audio Channel Control used. Not handled. Faking succes!"); case 0x01 : // (un)Lock door // do nothing -> report as success break;