Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
alexbevi
GitHub Repository: alexbevi/BizHawk
Path: blob/master/psx/mednadisc/cdrom/CDAccess_CCD.h
2 views
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
#include <memory>
22
23
class CDAccess_CCD : public CDAccess
24
{
25
public:
26
27
CDAccess_CCD(const std::string& path, bool image_memcache);
28
virtual ~CDAccess_CCD();
29
30
virtual void Read_Raw_Sector(uint8 *buf, int32 lba);
31
32
virtual bool Fast_Read_Raw_PW_TSRE(uint8* pwbuf, int32 lba) const noexcept;
33
34
virtual void Read_TOC(CDUtility::TOC *toc);
35
36
private:
37
38
void Load(const std::string& path, bool image_memcache);
39
void Cleanup(void);
40
41
void CheckSubQSanity(void);
42
43
std::unique_ptr<Stream> img_stream;
44
std::unique_ptr<uint8[]> sub_data;
45
46
size_t img_numsectors;
47
CDUtility::TOC tocd;
48
};
49
50