1 //
2 // OS agnostic CDROM interface functions
3 //
4 // by James Hammons
5 // (C) 2010 Underground Software
6 //
7 // JLH = James Hammons <jlhamm@acm.org>
8 //
9 // Who When What
10 // --- ---------- -------------------------------------------------------------
11 // JLH 01/16/2010 Created this log ;-)
12 //
13
14 //
15 // This now uses the supposedly cross-platform libcdio to do the necessary
16 // low-level CD twiddling we need that libsdl can't do currently. Jury is
17 // still out on whether or not to make this a conditional compilation or not.
18 //
19
20 // Comment this out if you don't have libcdio installed
21 // (Actually, this is defined in the Makefile to prevent having to edit
22 // things too damn much. Jury is still out whether or not to make this
23 // change permanent.)
24
25 #include <boolean.h>
26 #include "cdintf.h" // Every OS has to implement these
27
28 #include "log.h"
29
30 // *** OK, here's where we're going to attempt to put the platform agnostic CD interface ***
31
CDIntfInit(void)32 bool CDIntfInit(void)
33 {
34 WriteLog("CDINTF: No suitable CD-ROM driver found.\n");
35 return false;
36 }
37
CDIntfDone(void)38 void CDIntfDone(void)
39 {
40 WriteLog("CDINTF: Shutting down CD-ROM subsystem.\n");
41 }
42
CDIntfReadBlock(uint32_t sector,uint8_t * buffer)43 bool CDIntfReadBlock(uint32_t sector, uint8_t * buffer)
44 {
45 //#warning "!!! FIX !!! CDIntfReadBlock not implemented!"
46 // !!! FIX !!!
47 WriteLog("CDINTF: ReadBlock unimplemented!\n");
48 return false;
49 }
50
CDIntfGetNumSessions(void)51 uint32_t CDIntfGetNumSessions(void)
52 {
53 //#warning "!!! FIX !!! CDIntfGetNumSessions not implemented!"
54 // Still need relevant code here... !!! FIX !!!
55 return 2;
56 }
57
CDIntfSelectDrive(uint32_t driveNum)58 void CDIntfSelectDrive(uint32_t driveNum)
59 {
60 //#warning "!!! FIX !!! CDIntfSelectDrive not implemented!"
61 // !!! FIX !!!
62 WriteLog("CDINTF: SelectDrive unimplemented!\n");
63 }
64
CDIntfGetCurrentDrive(void)65 uint32_t CDIntfGetCurrentDrive(void)
66 {
67 //#warning "!!! FIX !!! CDIntfGetCurrentDrive not implemented!"
68 WriteLog("CDINTF: GetCurrentDrive unimplemented!\n");
69 return 0;
70 }
71
CDIntfGetDriveName(uint32_t driveNum)72 const uint8_t * CDIntfGetDriveName(uint32_t driveNum)
73 {
74 //#warning "!!! FIX !!! CDIntfGetDriveName driveNum is currently ignored!"
75 // driveNum is currently ignored... !!! FIX !!!
76
77 return (uint8_t *)"NONE";
78 }
79
CDIntfGetSessionInfo(uint32_t session,uint32_t offset)80 uint8_t CDIntfGetSessionInfo(uint32_t session, uint32_t offset)
81 {
82 //#warning "!!! FIX !!! CDIntfGetSessionInfo not implemented!"
83 WriteLog("CDINTF: GetSessionInfo unimplemented!\n");
84 return 0xFF;
85 }
86
CDIntfGetTrackInfo(uint32_t track,uint32_t offset)87 uint8_t CDIntfGetTrackInfo(uint32_t track, uint32_t offset)
88 {
89 //#warning "!!! FIX !!! CDIntfTrackInfo not implemented!"
90 WriteLog("CDINTF: GetTrackInfo unimplemented!\n");
91 return 0xFF;
92 }
93