From: Volker R. <vru...@us...> - 2002-07-31 05:21:48
|
Update of /cvsroot/bochs/bochs/iodev In directory usw-pr-cvs1:/tmp/cvs-serv24205 Modified Files: cdrom.cc Log Message: - the win32 version now uses the READ TOC function for files. This is a hack and works okay with one rom track only. We still have to implement reading the real TOC on win32. - in function GetCDCapacity(): type of variable 'buf[8]' must be 'unsigned char' - in function capacity(): win32 version returned the number of bytes, but it should return the number of blocks (ASPI blocksize is 2352) - description of the function capacity() fixed (it always returns blocks) Index: cdrom.cc =================================================================== RCS file: /cvsroot/bochs/bochs/iodev/cdrom.cc,v retrieving revision 1.36 retrieving revision 1.37 diff -u -d -r1.36 -r1.37 --- cdrom.cc 30 Jul 2002 06:25:57 -0000 1.36 +++ cdrom.cc 31 Jul 2002 05:21:46 -0000 1.37 @@ -159,7 +159,7 @@ HANDLE hEventSRB; SRB_ExecSCSICmd srb; DWORD dwStatus; - char buf[8]; + unsigned char buf[8]; hEventSRB = CreateEvent(NULL, TRUE, FALSE, NULL); @@ -409,7 +409,11 @@ BX_PANIC(("cdrom: read_toc: file not open.")); } +#ifdef WIN32 + if (1) { // This is a hack and works okay if there's one rom track only +#else if (using_file) { +#endif if ((start_track != 1) && (start_track != 0xaa)) return false; @@ -646,7 +650,7 @@ cdrom_interface::capacity() { // Return CD-ROM capacity. I believe you want to return - // the number of bytes of capacity the actual media has. + // the number of blocks of capacity the actual media has. #if !defined WIN32 // win32 has its own way of doing this @@ -796,10 +800,10 @@ #elif defined WIN32 { if(bUseASPI) { - return GetCDCapacity(hid, tid, lun); + return (GetCDCapacity(hid, tid, lun) / 2352); } else { unsigned long FileSize; - return (GetFileSize(hFile, &FileSize)); + return (GetFileSize(hFile, &FileSize) / 2048); } } #else |