2 // OS agnostic CDROM interface functions
6 // This now uses the supposedly cross-platform libcdio to do the necessary
7 // low-level CD twiddling we need that libsdl can't do currently. Jury is
8 // still out on whether or not to make this a conditional compilation or not.
11 // Comment this out if you don't have libcdio installed
12 // (Actually, this is defined in the Makefile to prevent having to edit
13 // things too damn much. Jury is still out whether or not to make this
15 //#define HAVE_LIB_CDIO
17 #include "cdintf.h" // Every OS has to implement these
20 #include <cdio/cdio.h> // Now using OS agnostic CD access routines!
26 static void TestCDIO(void)
28 // See what (if anything) is installed.
29 CdIo_t * p_cdio = cdio_open(0, DRIVER_DEVICE);
30 driver_id_t driver_id;
34 WriteLog("CDIO: The driver selected is %s.\n", cdio_get_driver_name(p_cdio));
35 WriteLog("CDIO: The default device for this driver is %s.\n\n", cdio_get_default_device(p_cdio));
40 WriteLog("CDIO: A suitable CD-ROM driver was not found.\n\n");
46 // *** OK, here's where we're going to attempt to put the platform agnostic CD interface ***
50 static CdIo_t * cdioPtr = NULL;
56 cdioPtr = cdio_open(NULL, DRIVER_DEVICE);
61 WriteLog("CDINTF: No suitable CD-ROM driver found.\n");
66 WriteLog("CDINTF: Successfully opened CD-ROM interface.\n");
74 WriteLog("CDINTF: Shutting down CD-ROM subsystem.\n");
78 cdio_destroy(cdioPtr);
82 bool CDIntfReadBlock(uint32 sector, uint8 * buffer)
84 #warning !!! FIX !!! CDIntfReadBlock not implemented!
86 WriteLog("CDINTF: ReadBlock unimplemented!\n");
90 uint32 CDIntfGetNumSessions(void)
92 #warning !!! FIX !!! CDIntfGetNumSessions not implemented!
94 // Still need relevant code here... !!! FIX !!!
98 void CDIntfSelectDrive(uint32 driveNum)
100 #warning !!! FIX !!! CDIntfSelectDrive not implemented!
102 WriteLog("CDINTF: SelectDrive unimplemented!\n");
105 uint32 CDIntfGetCurrentDrive(void)
107 #warning !!! FIX !!! CDIntfGetCurrentDrive not implemented!
109 WriteLog("CDINTF: GetCurrentDrive unimplemented!\n");
113 const uint8 * CDIntfGetDriveName(uint32 driveNum)
115 #warning !!! FIX !!! CDIntfGetDriveName driveNum is currently ignored!
116 // driveNum is currently ignored... !!! FIX !!!
119 uint8 * driveName = (uint8 *)cdio_get_default_device(cdioPtr);
120 WriteLog("CDINTF: The drive name for the current driver is %s.\n", driveName);
124 return (uint8 *)"NONE";
128 uint8 CDIntfGetSessionInfo(uint32 session, uint32 offset)
130 #warning !!! FIX !!! CDIntfGetSessionInfo not implemented!
132 WriteLog("CDINTF: GetSessionInfo unimplemented!\n");
136 uint8 CDIntfGetTrackInfo(uint32 track, uint32 offset)
138 #warning !!! FIX !!! CDIntfTrackInfo not implemented!
140 WriteLog("CDINTF: GetTrackInfo unimplemented!\n");