/* * Copyright (C) 2002-2019 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ // ****************************************************** // SDL CDROM // ****************************************************** #include #include #include #include "dosbox.h" #include "support.h" #include "cdrom.h" int CDROM_GetMountType(char* path, int) { // 1 - Iso file // 2 - subdirectory // Detect ISO struct stat file_stat; if ((stat(path, &file_stat) == 0) && (file_stat.st_mode & S_IFREG)) return 1; return 2; } // ****************************************************** // Fake CDROM // ****************************************************** bool CDROM_Interface_Fake :: GetAudioTracks(int& stTrack, int& end, TMSF& leadOut) { stTrack = end = 1; leadOut.min = 60; leadOut.sec = leadOut.fr = 0; return true; } bool CDROM_Interface_Fake :: GetAudioTrackInfo(int track, TMSF& start, unsigned char& attr) { if (track>1) return false; start.min = start.fr = 0; start.sec = 2; attr = 0x60; // data / permitted return true; } bool CDROM_Interface_Fake :: GetAudioSub(unsigned char& attr, unsigned char& track, unsigned char& index, TMSF& relPos, TMSF& absPos){ attr = 0; track = index = 1; relPos.min = relPos.fr = 0; relPos.sec = 2; absPos.min = absPos.fr = 0; absPos.sec = 2; return true; } bool CDROM_Interface_Fake :: GetAudioStatus(bool& playing, bool& pause) { playing = pause = false; return true; } bool CDROM_Interface_Fake :: GetMediaTrayStatus(bool& mediaPresent, bool& mediaChanged, bool& trayOpen) { mediaPresent = true; mediaChanged = false; trayOpen = false; return true; }