From 7ac63a610f7bc7ae22db01ee9458b637b5977ab1 Mon Sep 17 00:00:00 2001 From: aliaspider Date: Mon, 24 Nov 2014 04:12:51 +0100 Subject: [PATCH] remove more unused functions --- pce_fast/cdrom/CDAccess.h | 9 ----- pce_fast/cdrom/CDAccess_CCD.cpp | 9 ----- pce_fast/cdrom/CDAccess_CCD.h | 7 ---- pce_fast/cdrom/CDAccess_Image.cpp | 10 ----- pce_fast/cdrom/CDAccess_Image.h | 9 +---- pce_fast/cdrom/cdromif.cpp | 65 ------------------------------- pce_fast/cdrom/cdromif.h | 16 +------- 7 files changed, 3 insertions(+), 122 deletions(-) diff --git a/pce_fast/cdrom/CDAccess.h b/pce_fast/cdrom/CDAccess.h index 50a0d4c..0b3ed96 100644 --- a/pce_fast/cdrom/CDAccess.h +++ b/pce_fast/cdrom/CDAccess.h @@ -15,15 +15,6 @@ public: virtual void Read_Raw_Sector(uint8* buf, int32 lba) = 0; virtual void Read_TOC(CDUtility_TOC* toc) = 0; - - virtual bool Is_Physical(void) throw() = 0; - - virtual void Eject(bool eject_status) = - 0; // Eject a disc if it's physical, otherwise NOP. Returns true on success(or NOP), false on error - -private: - CDAccess(const CDAccess &); // No copy constructor. - CDAccess &operator=(const CDAccess &); // No assignment operator. }; CDAccess* cdaccess_open_image(const char* path); diff --git a/pce_fast/cdrom/CDAccess_CCD.cpp b/pce_fast/cdrom/CDAccess_CCD.cpp index b8db0f8..dacfe67 100644 --- a/pce_fast/cdrom/CDAccess_CCD.cpp +++ b/pce_fast/cdrom/CDAccess_CCD.cpp @@ -439,13 +439,4 @@ void CDAccess_CCD::Read_TOC(CDUtility_TOC* toc) *toc = tocd; } -bool CDAccess_CCD::Is_Physical(void) throw() -{ - return false; -} - -void CDAccess_CCD::Eject(bool eject_status) -{ - -} diff --git a/pce_fast/cdrom/CDAccess_CCD.h b/pce_fast/cdrom/CDAccess_CCD.h index 469b7e7..baa60d7 100644 --- a/pce_fast/cdrom/CDAccess_CCD.h +++ b/pce_fast/cdrom/CDAccess_CCD.h @@ -21,7 +21,6 @@ class CDAccess_CCD : public CDAccess { public: - CDAccess_CCD(const char* path); virtual ~CDAccess_CCD(); @@ -29,12 +28,6 @@ public: virtual void Read_TOC(CDUtility_TOC* toc); - virtual bool Is_Physical(void) throw(); - - virtual void Eject(bool eject_status); - -private: - void Load(const char* path); void Cleanup(void); diff --git a/pce_fast/cdrom/CDAccess_Image.cpp b/pce_fast/cdrom/CDAccess_Image.cpp index 9d9ba43..2c2bff3 100644 --- a/pce_fast/cdrom/CDAccess_Image.cpp +++ b/pce_fast/cdrom/CDAccess_Image.cpp @@ -1018,13 +1018,3 @@ void CDAccess_Image::Read_TOC(CDUtility_TOC* toc) toc->tracks[toc->last_track + 1] = toc->tracks[100]; } -bool CDAccess_Image::Is_Physical(void) throw() -{ - return (false); -} - -void CDAccess_Image::Eject(bool eject_status) -{ - -} - diff --git a/pce_fast/cdrom/CDAccess_Image.h b/pce_fast/cdrom/CDAccess_Image.h index 501b0eb..25c214d 100644 --- a/pce_fast/cdrom/CDAccess_Image.h +++ b/pce_fast/cdrom/CDAccess_Image.h @@ -33,19 +33,12 @@ struct CDRFILE_TRACK_INFO class CDAccess_Image : public CDAccess { public: - CDAccess_Image(const char* path); virtual ~CDAccess_Image(); - virtual void Read_Raw_Sector(uint8* buf, int32 lba); - + virtual void Read_Raw_Sector(uint8* buf, int32 lba); virtual void Read_TOC(CDUtility_TOC* toc); - virtual bool Is_Physical(void) throw(); - - virtual void Eject(bool eject_status); -private: - int32 NumTracks; int32 FirstTrack; int32 LastTrack; diff --git a/pce_fast/cdrom/cdromif.cpp b/pce_fast/cdrom/cdromif.cpp index e9e2a51..2806706 100644 --- a/pce_fast/cdrom/cdromif.cpp +++ b/pce_fast/cdrom/cdromif.cpp @@ -35,41 +35,23 @@ typedef struct uint8 data[2352 + 96]; } CDIF_Sector_Buffer; -// TODO: prohibit copy constructor class CDIF_ST : public CDIF { public: - CDIF_ST(CDAccess* cda); virtual ~CDIF_ST(); virtual void HintReadSector(uint32 lba); virtual bool ReadRawSector(uint8* buf, uint32 lba); - virtual bool Eject(bool eject_status); -private: CDAccess* disc_cdaccess; }; -CDIF::CDIF() : UnrecoverableError(false), is_phys_cache(false), - DiscEjected(false) -{ - -} - -CDIF::~CDIF() -{ - -} - int CDIF::ReadSector(uint8* pBuf, uint32 lba, uint32 nSectors) { int ret = 0; - if (UnrecoverableError) - return (false); - while (nSectors--) { uint8 tmpbuf[2352 + 96]; @@ -110,12 +92,6 @@ int CDIF::ReadSector(uint8* pBuf, uint32 lba, uint32 nSectors) CDIF_ST::CDIF_ST(CDAccess* cda) : disc_cdaccess(cda) { - //puts("***WARNING USING SINGLE-THREADED CD READER***"); - - is_phys_cache = false; - UnrecoverableError = false; - DiscEjected = false; - disc_cdaccess->Read_TOC(&disc_toc); assert(disc_toc.first_track > 0 && disc_toc.last_track < 100 @@ -139,12 +115,6 @@ void CDIF_ST::HintReadSector(uint32 lba) bool CDIF_ST::ReadRawSector(uint8* buf, uint32 lba) { - if (UnrecoverableError) - { - memset(buf, 0, 2352 + 96); - return (false); - } - try { disc_cdaccess->Read_Raw_Sector(buf, lba); @@ -160,41 +130,6 @@ bool CDIF_ST::ReadRawSector(uint8* buf, uint32 lba) return (true); } -bool CDIF_ST::Eject(bool eject_status) -{ - if (UnrecoverableError) - return (false); - - try - { - int32 old_de = DiscEjected; - - DiscEjected = eject_status; - - if (old_de != DiscEjected) - { - disc_cdaccess->Eject(eject_status); - - if (!eject_status) // Re-read the TOC - { - disc_cdaccess->Read_TOC(&disc_toc); - - assert(disc_toc.first_track > 0 && disc_toc.last_track < 100 - && disc_toc.first_track <= disc_toc.last_track); - // throw(MDFN_Error(0, ("TOC first(%d)/last(%d) track numbers bad."), disc_toc.first_track, disc_toc.last_track)); - } - } - } - catch (std::exception &e) - { - if (log_cb) - log_cb(RETRO_LOG_ERROR, "%s\n", e.what()); - return (false); - } - - return (true); -} - CDIF* CDIF_Open(const char* path) { CDAccess* cda = cdaccess_open_image(path); diff --git a/pce_fast/cdrom/cdromif.h b/pce_fast/cdrom/cdromif.h index 8994c74..62c3851 100644 --- a/pce_fast/cdrom/cdromif.h +++ b/pce_fast/cdrom/cdromif.h @@ -29,8 +29,8 @@ class CDIF { public: - CDIF(); - virtual ~CDIF(); + CDIF(){} + virtual ~CDIF(){} inline void ReadTOC(CDUtility_TOC* read_target) { @@ -45,20 +45,8 @@ public: // Will return the type(1, 2) of the first sector read to the buffer supplied, 0 on error int ReadSector(uint8* pBuf, uint32 lba, uint32 nSectors); - // Return true if operation succeeded or it was a NOP(either due to not being implemented, or the current status matches eject_status). - // Returns false on failure(usually drive error of some kind; not completely fatal, can try again). - virtual bool Eject(bool eject_status) = 0; - - inline bool IsPhysical(void) - { - return (is_phys_cache); - } - protected: - bool UnrecoverableError; - bool is_phys_cache; CDUtility_TOC disc_toc; - bool DiscEjected; }; CDIF* CDIF_Open(const char* path);