Common/CDImage: Changes to support CHD interfaces

This commit is contained in:
Connor McLaughlin
2020-01-30 15:50:00 +10:00
parent b5901fa190
commit 18d5086e4c
4 changed files with 88 additions and 41 deletions

View File

@ -1,14 +1,11 @@
#pragma once
#include "bitfield.h"
#include "types.h"
#include <cstdio>
#include <memory>
#include <string>
#include <tuple>
#include <vector>
class ByteStream;
class CDImage
{
public:
@ -211,7 +208,7 @@ protected:
struct Index
{
u64 file_offset;
std::FILE* file;
u32 file_index;
u32 file_sector_size;
LBA start_lba_on_disc;
u32 track_number;
@ -223,6 +220,9 @@ protected:
bool is_pregap;
};
// Reads a single sector from an index.
virtual bool ReadSectorFromIndex(void* buffer, const Index& index, LBA lba_in_index) = 0;
const Index* GetIndexForDiscPosition(LBA pos);
const Index* GetIndexForTrackPosition(u32 track_number, LBA track_pos);