mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
DriveReader: Fix View > Show Drives
DriveReader::m_size was never initialized which was indirectly causing CGameListCtrl to crash Dolphin when it tried to insert a character at a negative index in a string. Reading one sector at a time is very inefficient and appears to be causing timing issues during boot so SectorReader has been enhanced to support batching. SectorReader has been given a working cache system.
This commit is contained in:
@ -30,18 +30,18 @@ public:
|
||||
|
||||
private:
|
||||
DriveReader(const std::string& drive);
|
||||
void GetBlock(u64 block_num, u8 *out_ptr) override;
|
||||
bool GetBlock(u64 block_num, u8 *out_ptr) override;
|
||||
bool ReadMultipleAlignedBlocks(u64 block_num, u64 num_blocks, u8* out_ptr) override;
|
||||
|
||||
#ifdef _WIN32
|
||||
HANDLE m_disc_handle;
|
||||
HANDLE m_disc_handle = INVALID_HANDLE_VALUE;
|
||||
PREVENT_MEDIA_REMOVAL m_lock_cdrom;
|
||||
bool IsOK() { return m_disc_handle != INVALID_HANDLE_VALUE; }
|
||||
bool IsOK() const { return m_disc_handle != INVALID_HANDLE_VALUE; }
|
||||
#else
|
||||
File::IOFile m_file;
|
||||
bool IsOK() { return m_file != nullptr; }
|
||||
bool IsOK() const { return m_file.IsOpen() && m_file.IsGood(); }
|
||||
#endif
|
||||
s64 m_size;
|
||||
u64 m_size = 0;
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
Reference in New Issue
Block a user