mirror of
https://github.com/libretro/beetle-psx-libretro.git
synced 2024-11-30 04:10:43 +00:00
5d227ea4b8
Since the subchannel data is either computed from scratch or read from a separate sbi file, it's entirely unnecessary. This avoids a synchronous file read in PreSeekHack in the CD controller code which otherwise completely defeats async read behavior. It also makes the sector read hint provided to the background thread more useful.
54 lines
1.1 KiB
C++
54 lines
1.1 KiB
C++
#ifndef __MDFN_CDACCESS_CHD_H
|
|
#define __MDFN_CDACCESS_CHD_H
|
|
|
|
#include "CDAccess.h"
|
|
#include "CDAccess_Image.h"
|
|
|
|
#include "chd.h"
|
|
|
|
class CDAccess_CHD : public CDAccess
|
|
{
|
|
public:
|
|
|
|
CDAccess_CHD(const char *path, bool image_memcache);
|
|
virtual ~CDAccess_CHD();
|
|
|
|
virtual bool Read_Raw_Sector(uint8_t *buf, int32_t lba);
|
|
|
|
virtual bool Read_Raw_PW(uint8_t *buf, int32_t lba);
|
|
|
|
virtual bool Read_TOC(TOC *toc);
|
|
|
|
virtual void Eject(bool eject_status);
|
|
|
|
private:
|
|
chd_file *chd;
|
|
/* hunk data cache */
|
|
uint8_t *hunkmem;
|
|
/* last hunknum read */
|
|
int oldhunk;
|
|
|
|
int32_t NumTracks;
|
|
int32_t FirstTrack;
|
|
int32_t LastTrack;
|
|
int32_t total_sectors;
|
|
TOC* ptoc;
|
|
|
|
std::string sbi_path;
|
|
|
|
bool ImageOpen(const char *path, bool image_memcache);
|
|
int LoadSBI(const char* sbi_path);
|
|
void Cleanup(void);
|
|
|
|
CDRFILE_TRACK_INFO Tracks[100]; // Track #0(HMM?) through 99
|
|
struct cpp11_array_doodad
|
|
{
|
|
uint8 data[12];
|
|
};
|
|
std::map<uint32, cpp11_array_doodad> SubQReplaceMap;
|
|
int32_t MakeSubPQ(int32 lba, uint8 *SubPWBuf);
|
|
};
|
|
|
|
|
|
#endif
|