mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
DiscIO: Allow converting from formats other than ISO and GCZ
The constant DESIRED_BUFFER_SIZE was determined by multiplying the old hardcoded value 32 with the default GCZ block size 16 KiB. Not sure if it actually is the best value, but it seems fine.
This commit is contained in:
@ -41,11 +41,16 @@ class BlobReader
|
||||
{
|
||||
public:
|
||||
virtual ~BlobReader() {}
|
||||
|
||||
virtual BlobType GetBlobType() const = 0;
|
||||
|
||||
virtual u64 GetRawSize() const = 0;
|
||||
virtual u64 GetDataSize() const = 0;
|
||||
virtual bool IsDataSizeAccurate() const = 0;
|
||||
|
||||
// Returns 0 if the format does not use blocks
|
||||
virtual u64 GetBlockSize() const { return 0; }
|
||||
|
||||
// NOT thread-safe - can't call this from multiple threads.
|
||||
virtual bool Read(u64 offset, u64 size, u8* out_ptr) = 0;
|
||||
template <typename T>
|
||||
@ -160,10 +165,9 @@ std::unique_ptr<BlobReader> CreateBlobReader(const std::string& filename);
|
||||
|
||||
typedef bool (*CompressCB)(const std::string& text, float percent, void* arg);
|
||||
|
||||
bool CompressFileToBlob(const std::string& infile_path, const std::string& outfile_path,
|
||||
u32 sub_type = 0, int sector_size = 16384, CompressCB callback = nullptr,
|
||||
void* arg = nullptr);
|
||||
bool DecompressBlobToFile(const std::string& infile_path, const std::string& outfile_path,
|
||||
CompressCB callback = nullptr, void* arg = nullptr);
|
||||
bool ConvertToGCZ(const std::string& infile_path, const std::string& outfile_path, u32 sub_type = 0,
|
||||
int sector_size = 16384, CompressCB callback = nullptr, void* arg = nullptr);
|
||||
bool ConvertToPlain(const std::string& infile_path, const std::string& outfile_path,
|
||||
CompressCB callback = nullptr, void* arg = nullptr);
|
||||
|
||||
} // namespace DiscIO
|
||||
|
Reference in New Issue
Block a user