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");
79 WriteLog("CDINTF: Shutting down CD-ROM subsystem.\n");
82 cdio_destroy(cdioPtr);
85 bool CDIntfReadBlock(uint32 sector, uint8 * buffer)
88 WriteLog("CDINTF: ReadBlock unimplemented!\n");
92 uint32 CDIntfGetNumSessions(void)
95 // Still need relevant code here... !!! FIX !!!
99 void CDIntfSelectDrive(uint32 driveNum)
102 WriteLog("CDINTF: SelectDrive unimplemented!\n");
105 uint32 CDIntfGetCurrentDrive(void)
108 WriteLog("CDINTF: GetCurrentDrive unimplemented!\n");
112 const uint8 * CDIntfGetDriveName(uint32 driveNum)
114 // driveNum is currently ignored... !!! FIX !!!
116 uint8 * driveName = (uint8 *)cdio_get_default_device(cdioPtr);
117 WriteLog("CDINTF: The drive name for the current driver is %s.\n", driveName);
122 uint8 CDIntfGetSessionInfo(uint32 session, uint32 offset)
125 WriteLog("CDINTF: GetSessionInfo unimplemented!\n");
129 uint8 CDIntfGetTrackInfo(uint32 track, uint32 offset)
132 WriteLog("CDINTF: GetTrackInfo unimplemented!\n");