19682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
29682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall/* Test the SDL CD-ROM audio functions */
39682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
49682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#include <stdlib.h>
59682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#include <stdio.h>
69682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#include <string.h>
79682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#include <ctype.h>
89682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
99682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#include "SDL.h"
109682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
119682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall/* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */
129682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallstatic void quit(int rc)
139682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall{
149682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall	SDL_Quit();
159682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall	exit(rc);
169682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall}
179682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
189682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallstatic void PrintStatus(int driveindex, SDL_CD *cdrom)
199682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall{
209682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall	CDstatus status;
219682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall	char *status_str;
229682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
239682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall	status = SDL_CDStatus(cdrom);
249682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall	switch (status) {
259682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall		case CD_TRAYEMPTY:
269682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall			status_str = "tray empty";
279682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall			break;
289682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall		case CD_STOPPED:
299682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall			status_str = "stopped";
309682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall			break;
319682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall		case CD_PLAYING:
329682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall			status_str = "playing";
339682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall			break;
349682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall		case CD_PAUSED:
359682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall			status_str = "paused";
369682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall			break;
379682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall		case CD_ERROR:
389682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall			status_str = "error state";
399682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall			break;
409682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall	}
419682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall	printf("Drive %d status: %s\n", driveindex, status_str);
429682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall	if ( status >= CD_PLAYING ) {
439682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall		int m, s, f;
449682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall		FRAMES_TO_MSF(cdrom->cur_frame, &m, &s, &f);
459682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall		printf("Currently playing track %d, %d:%2.2d\n",
469682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall			cdrom->track[cdrom->cur_track].id, m, s);
479682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall	}
489682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall}
499682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
509682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallstatic void ListTracks(SDL_CD *cdrom)
519682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall{
529682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall	int i;
539682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall	int m, s, f;
549682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall	char* trtype;
559682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
569682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall	SDL_CDStatus(cdrom);
579682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall	printf("Drive tracks: %d\n", cdrom->numtracks);
589682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall	for ( i=0; i<cdrom->numtracks; ++i ) {
599682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall		FRAMES_TO_MSF(cdrom->track[i].length, &m, &s, &f);
609682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall		if ( f > 0 )
619682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall			++s;
629682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall		switch(cdrom->track[i].type)
639682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall		{
649682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall		    case SDL_AUDIO_TRACK:
659682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall			trtype="audio";
669682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall			break;
679682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall		    case SDL_DATA_TRACK:
689682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall			trtype="data";
699682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall			break;
709682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall		    default:
719682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall			trtype="unknown";
729682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall			break;
739682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall		}
749682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall		printf("\tTrack (index %d) %d: %d:%2.2d / %d [%s track]\n", i,
759682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall					cdrom->track[i].id, m, s, cdrom->track[i].length, trtype);
769682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall	}
779682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall}
789682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
799682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallstatic void PrintUsage(char *argv0)
809682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall{
819682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall	fprintf(stderr, "Usage: %s [drive#] [command] [command] ...\n", argv0);
829682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall	fprintf(stderr, "Where 'command' is one of:\n");
839682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall	fprintf(stderr, "	-status\n");
849682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall	fprintf(stderr, "	-list\n");
859682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall	fprintf(stderr, "	-play [first_track] [first_frame] [num_tracks] [num_frames]\n");
869682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall	fprintf(stderr, "	-pause\n");
879682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall	fprintf(stderr, "	-resume\n");
889682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall	fprintf(stderr, "	-stop\n");
899682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall	fprintf(stderr, "	-eject\n");
909682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall	fprintf(stderr, "	-sleep <milliseconds>\n");
919682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall}
929682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
939682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallint main(int argc, char *argv[])
949682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall{
959682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall	int drive;
969682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall	int i;
979682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall	SDL_CD *cdrom;
989682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
999682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall	/* Initialize SDL first */
1009682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall	if ( SDL_Init(SDL_INIT_CDROM) < 0 ) {
1019682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall		fprintf(stderr, "Couldn't initialize SDL: %s\n",SDL_GetError());
1029682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall		return(1);
1039682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall	}
1049682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
1059682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall	/* Find out how many CD-ROM drives are connected to the system */
1069682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall	if ( SDL_CDNumDrives() == 0 ) {
1079682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall		printf("No CD-ROM devices detected\n");
1089682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall		quit(0);
1099682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall	}
1109682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall	printf("Drives available: %d\n", SDL_CDNumDrives());
1119682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall	for ( i=0; i<SDL_CDNumDrives(); ++i ) {
1129682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall		printf("Drive %d:  \"%s\"\n", i, SDL_CDName(i));
1139682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall	}
1149682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
1159682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall	/* Open the CD-ROM */
1169682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall	drive = 0;
1179682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall	i=1;
1189682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall	if ( argv[i] && isdigit(argv[i][0]) ) {
1199682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall		drive = atoi(argv[i++]);
1209682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall	}
1219682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall	cdrom = SDL_CDOpen(drive);
1229682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall	if ( cdrom == NULL ) {
1239682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall		fprintf(stderr, "Couldn't open drive %d: %s\n", drive,
1249682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall							SDL_GetError());
1259682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall		quit(2);
1269682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall	}
1279682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#ifdef TEST_NULLCD
1289682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall	cdrom = NULL;
1299682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#endif
1309682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
1319682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall	/* Find out which function to perform */
1329682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall	for ( ; argv[i]; ++i ) {
1339682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall		if ( strcmp(argv[i], "-status") == 0 ) {
1349682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall			/* PrintStatus(drive, cdrom); */
1359682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall		} else
1369682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall		if ( strcmp(argv[i], "-list") == 0 ) {
1379682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall			ListTracks(cdrom);
1389682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall		} else
1399682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall		if ( strcmp(argv[i], "-play") == 0 ) {
1409682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall			int strack, sframe;
1419682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall			int ntrack, nframe;
1429682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
1439682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall			strack = 0;
1449682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall			if ( argv[i+1] && isdigit(argv[i+1][0]) ) {
1459682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall				strack = atoi(argv[++i]);
1469682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall			}
1479682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall			sframe = 0;
1489682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall			if ( argv[i+1] && isdigit(argv[i+1][0]) ) {
1499682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall				sframe = atoi(argv[++i]);
1509682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall			}
1519682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall			ntrack = 0;
1529682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall			if ( argv[i+1] && isdigit(argv[i+1][0]) ) {
1539682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall				ntrack = atoi(argv[++i]);
1549682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall			}
1559682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall			nframe = 0;
1569682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall			if ( argv[i+1] && isdigit(argv[i+1][0]) ) {
1579682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall				nframe = atoi(argv[++i]);
1589682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall			}
1599682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall			if ( CD_INDRIVE(SDL_CDStatus(cdrom)) ) {
1609682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall				if ( SDL_CDPlayTracks(cdrom, strack, sframe,
1619682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall							ntrack, nframe) < 0 ) {
1629682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall					fprintf(stderr,
1639682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall			"Couldn't play tracks %d/%d for %d/%d: %s\n",
1649682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall				strack, sframe, ntrack, nframe, SDL_GetError());
1659682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall				}
1669682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall			} else {
1679682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall				fprintf(stderr, "No CD in drive!\n");
1689682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall			}
1699682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall		} else
1709682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall		if ( strcmp(argv[i], "-pause") == 0 ) {
1719682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall			if ( SDL_CDPause(cdrom) < 0 ) {
1729682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall				fprintf(stderr, "Couldn't pause CD: %s\n",
1739682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall								SDL_GetError());
1749682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall			}
1759682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall		} else
1769682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall		if ( strcmp(argv[i], "-resume") == 0 ) {
1779682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall			if ( SDL_CDResume(cdrom) < 0 ) {
1789682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall				fprintf(stderr, "Couldn't resume CD: %s\n",
1799682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall								SDL_GetError());
1809682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall			}
1819682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall		} else
1829682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall		if ( strcmp(argv[i], "-stop") == 0 ) {
1839682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall			if ( SDL_CDStop(cdrom) < 0 ) {
1849682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall				fprintf(stderr, "Couldn't eject CD: %s\n",
1859682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall								SDL_GetError());
1869682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall			}
1879682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall		} else
1889682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall		if ( strcmp(argv[i], "-eject") == 0 ) {
1899682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall			if ( SDL_CDEject(cdrom) < 0 ) {
1909682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall				fprintf(stderr, "Couldn't eject CD: %s\n",
1919682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall								SDL_GetError());
1929682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall			}
1939682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall		} else
1949682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall		if ( (strcmp(argv[i], "-sleep") == 0) &&
1959682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall				(argv[i+1] && isdigit(argv[i+1][0])) ) {
1969682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall			SDL_Delay(atoi(argv[++i]));
1979682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall			printf("Delayed %d milliseconds\n", atoi(argv[i]));
1989682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall		} else {
1999682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall			PrintUsage(argv[0]);
2009682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall			SDL_CDClose(cdrom);
2019682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall			quit(1);
2029682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall		}
2039682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall	}
2049682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall	PrintStatus(drive, cdrom);
2059682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall	SDL_CDClose(cdrom);
2069682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall	SDL_Quit();
2079682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall
2089682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall	return(0);
2099682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall}
210