-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathcdrom.c
114 lines (96 loc) · 2.45 KB
/
cdrom.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
/*
* SDLCL - SDL Compatibility Library
* Copyright (C) 2017 Alan Williams <mralert@gmail.com>
*
* Portions taken from SDL 1.2.15
* Copyright (C) 1997-2012 Sam Latinga <slouken@libsdl.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <stdlib.h>
#include "SDL2.h"
#define SDL1_MAX_TRACKS 99
#define SDL1_AUDIO_TRACK 0x00
#define SDL1_DATA_TRACK 0x04
typedef enum {
CD1_TRAYEMPTY,
CD1_STOPPED,
CD1_PLAYING,
CD1_PAUSED,
CD1_ERROR = -1
} CD1status;
typedef struct SDL1_CDtrack {
Uint8 id;
Uint8 type;
Uint16 unused;
Uint32 length;
Uint32 offset;
} SDL1_CDtrack;
typedef struct SDL1_CD {
int id;
CD1status status;
int numtracks;
int cur_track;
int cur_frame;
SDL1_CDtrack track[SDL1_MAX_TRACKS + 1];
} SDL1_CD;
DECLSPEC int SDLCALL SDL_CDNumDrives (void) {
return 0;
}
DECLSPEC const char *SDLCALL SDL_CDName (int drive) {
(void)drive;
return NULL;
}
DECLSPEC SDL1_CD *SDLCALL SDL_CDOpen (int drive) {
(void)drive;
return NULL;
}
DECLSPEC CD1status SDLCALL SDL_CDStatus (SDL1_CD *cdrom) {
(void)cdrom;
return CD1_ERROR;
}
DECLSPEC int SDLCALL SDL_CDPlayTracks (SDL1_CD *cdrom, int start_track, int start_frame, int ntracks, int nframes) {
(void)cdrom;
(void)start_track;
(void)start_frame;
(void)ntracks;
(void)nframes;
return -1;
}
DECLSPEC int SDLCALL SDL_CDPlay (SDL1_CD *cdrom, int start, int length) {
(void)cdrom;
(void)start;
(void)length;
return -1;
}
DECLSPEC int SDLCALL SDL_CDPause (SDL1_CD *cdrom) {
(void)cdrom;
return -1;
}
DECLSPEC int SDLCALL SDL_CDResume (SDL1_CD *cdrom) {
(void)cdrom;
return -1;
}
DECLSPEC int SDLCALL SDL_CDStop (SDL1_CD *cdrom) {
(void)cdrom;
return -1;
}
DECLSPEC int SDLCALL SDL_CDEject (SDL1_CD *cdrom) {
(void)cdrom;
return -1;
}
DECLSPEC void SDLCALL SDL_CDClose (SDL1_CD *cdrom) {
(void)cdrom;
}