| 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 | #ifndef __MDFN_CDROM_CDROMIF_H |
| 19 | #define __MDFN_CDROM_CDROMIF_Hcxx . . $ `mednafen/cdrom/cdromif.h:19:9`! |
| 20 | |
| 21 | #include "CDUtility.h"cxx . . $ `<file>/mednafen/cdrom/CDUtility.h`/ |
| 22 | #include "../Stream.h"cxx . . $ `<file>/mednafen/Stream.h`/ |
| 23 | |
| 24 | #include <queue> |
| 25 | |
| 26 | typedef CDUtilitycxx . . $ CDUtility/::TOCcxx . . $ CDUtility/TOC# CD_TOCcxx . . $ CD_TOC#; |
| 27 | |
| 28 | class CDIFcxx . . $ CDIF# |
| 29 | { |
| 30 | public: |
| 31 | |
| 32 | CDIFcxx . . $ CDIF#CDIF(49f6e7a06ebc5aa8).(); |
| 33 | virtual ~cxx . . $ CDIF#`~CDIF`(ced63f7c635d850d).CDIFcxx . . $ CDIF#(); |
| 34 | |
| 35 | inline void ReadTOCcxx . . $ CDIF#ReadTOC(421bcafe44c737e9).(CDUtilitycxx . . $ CDUtility/::TOCcxx . . $ CDUtility/TOC# *read_target) |
| 36 | { |
| 37 | *read_target =cxx . . $ CDUtility/TOC#`operator=`(fe59811e31128dd7). disc_toccxx . . $ CDIF#disc_toc.; |
| 38 | } |
| 39 | |
| 40 | virtual void HintReadSectorcxx . . $ CDIF#HintReadSector(cb2f890c2fdad230).(uint32cxx . . $ uint32# lba) = 0; |
| 41 | virtual bool ReadRawSectorcxx . . $ CDIF#ReadRawSector(f3e7299796ab6c6f).(uint8cxx . . $ uint8# *buf, uint32cxx . . $ uint32# lba) = 0; |
| 42 | |
| 43 | // Call for mode 1 or mode 2 form 1 only. |
| 44 | bool ValidateRawSectorcxx . . $ CDIF#ValidateRawSector(8c2a43c3cf3cca3e).(uint8cxx . . $ uint8# *buf); |
| 45 | |
| 46 | // Utility/Wrapped functions |
| 47 | // Reads mode 1 and mode2 form 1 sectors(2048 bytes per sector returned) |
| 48 | // Will return the type(1, 2) of the first sector read to the buffer supplied, 0 on error |
| 49 | int ReadSectorcxx . . $ CDIF#ReadSector(47d6add1f5feae6f).(uint8cxx . . $ uint8#* pBuf, uint32cxx . . $ uint32# lba, uint32cxx . . $ uint32# nSectors); |
| 50 | |
| 51 | // Return true if operation succeeded or it was a NOP(either due to not being implemented, or the current status matches eject_status). |
| 52 | // Returns false on failure(usually drive error of some kind; not completely fatal, can try again). |
| 53 | virtual bool Ejectcxx . . $ CDIF#Eject(efaadfb7dc14930a).(bool eject_status) = 0; |
| 54 | |
| 55 | inline bool IsPhysicalcxx . . $ CDIF#IsPhysical(c9857a73d68e59ba).(void) { return(is_phys_cachecxx . . $ CDIF#is_phys_cache.); } |
| 56 | |
| 57 | // For Mode 1, or Mode 2 Form 1. |
| 58 | // No reference counting or whatever is done, so if you destroy the CDIF object before you destroy the returned Stream, things will go BOOM. |
| 59 | Streamcxx . . $ Stream# *MakeStreamcxx . . $ CDIF#MakeStream(4c1ca53b286bb8cf).(uint32cxx . . $ uint32# lba, uint32cxx . . $ uint32# sector_count); |
| 60 | |
| 61 | protected: |
| 62 | bool UnrecoverableErrorcxx . . $ CDIF#UnrecoverableError.; |
| 63 | bool is_phys_cachecxx . . $ CDIF#is_phys_cache.; |
| 64 | CDUtilitycxx . . $ CDUtility/::TOCcxx . . $ CDUtility/TOC# disc_toccxx . . $ CDIF#disc_toc.; |
| 65 | bool DiscEjectedcxx . . $ CDIF#DiscEjected.; |
| 66 | }; |
| 67 | |
| 68 | CDIFcxx . . $ CDIF# *CDIF_Opencxx . . $ CDIF_Open(c10ccd82c5204030).(const char *path, const bool is_device, bool image_memcache); |
| 69 | |
| 70 | #endif |