| 1 | /* Mednafen - Multi-system Emulator |
| 2 | * |
| 3 | * This program is free software; you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License as published by |
| 5 | * the Free Software Foundation; either version 2 of the License, or |
| 6 | * (at your option) any later version. |
| 7 | * |
| 8 | * This program is distributed in the hope that it will be useful, |
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 | * GNU General Public License for more details. |
| 12 | * |
| 13 | * You should have received a copy of the GNU General Public License |
| 14 | * along with this program; if not, write to the Free Software |
| 15 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 16 | */ |
| 17 | |
| 18 | #include "../FileStream.h" |
| 19 | #include "../MemoryStream.h" |
| 20 | #include "CDAccess.h" |
| 21 | |
| 22 | #include <vector> |
| 23 | |
| 24 | class CDAccess_CCD : public CDAccess |
| 25 | { |
| 26 | public: |
| 27 | |
| 28 | CDAccess_CCD(const char *path, bool image_memcache); |
| 29 | virtual ~CDAccess_CCD(); |
| 30 | |
| 31 | virtual void Read_Raw_Sector(uint8 *buf, int32 lba); |
| 32 | |
| 33 | virtual void Read_TOC(CDUtility::TOC *toc); |
| 34 | |
| 35 | virtual bool Is_Physical(void) throw(); |
| 36 | |
| 37 | virtual void Eject(bool eject_status); |
| 38 | |
| 39 | private: |
| 40 | |
| 41 | void Load(const char *path, bool image_memcache); |
| 42 | void Cleanup(void); |
| 43 | |
| 44 | void CheckSubQSanity(void); |
| 45 | |
| 46 | Stream* img_stream; |
| 47 | Stream* sub_stream; |
| 48 | size_t img_numsectors; |
| 49 | CDUtility::TOC tocd; |
| 50 | }; |