2 // OS agnostic CDROM interface functions
6 // This file is basically a shell to keep the front-end clean and also pull in the
7 // appropriate back-end code depending on which target is being compiled for.
10 #include "cdintf.h" // Every OS has to implement these
12 #include <cdio/cdio.h> // Now using OS agnostic CD access routines!
18 // OS dependent implementations
20 #if defined(__GCCWIN32__)
22 #include "cdintf_win32.cpp"
24 #elif defined(__GCCUNIX__)
27 #include "cdintf_osx.cpp"
31 #include "cdintf_linux.cpp"
39 static void TestCDIO(void)
41 // See what (if anything) is installed.
42 CdIo_t * p_cdio = cdio_open(0, DRIVER_DEVICE);
43 driver_id_t driver_id;
47 WriteLog("CDIO: The driver selected is %s.\n", cdio_get_driver_name(p_cdio));
48 WriteLog("CDIO: The default device for this driver is %s.\n\n", cdio_get_default_device(p_cdio));
53 WriteLog("CDIO: A suitable CD-ROM driver was not found.\n\n");
59 // *** OK, here's where we're going to attempt to put the platform agnostic CD interface ***
62 static CdIo_t * cdioPtr = NULL;
66 cdioPtr = cdio_open(NULL, DRIVER_DEVICE);
70 WriteLog("CDINTF: No suitable CD-ROM driver found.\n");
74 WriteLog("CDINTF: Successfully opened CD-ROM interface.\n");
81 WriteLog("CDINTF: Shutting down CD-ROM subsystem.\n");
84 cdio_destroy(cdioPtr);
87 bool CDIntfReadBlock(uint32 sector, uint8 * buffer)
90 WriteLog("CDINTF: ReadBlock unimplemented!\n");
94 uint32 CDIntfGetNumSessions(void)
97 // Still need relevant code here... !!! FIX !!!
101 void CDIntfSelectDrive(uint32 driveNum)
104 WriteLog("CDINTF: SelectDrive unimplemented!\n");
107 uint32 CDIntfGetCurrentDrive(void)
110 WriteLog("CDINTF: GetCurrentDrive unimplemented!\n");
114 const uint8 * CDIntfGetDriveName(uint32 driveNum)
116 // driveNum is currently ignored... !!! FIX !!!
118 uint8 * driveName = (uint8 *)cdio_get_default_device(cdioPtr);
119 WriteLog("CDINTF: The drive name for the current driver is %s.\n", driveName);
124 uint8 CDIntfGetSessionInfo(uint32 session, uint32 offset)
127 WriteLog("CDINTF: GetSessionInfo unimplemented!\n");
131 uint8 CDIntfGetTrackInfo(uint32 track, uint32 offset)
134 WriteLog("CDINTF: GetTrackInfo unimplemented!\n");