mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
Adds IsDrive to FileUtil for win32,
Adds booting from drive to gui. disabled as it is currently too slow unless it is a virtual drive Changes DriveUtil to start checking at D: as it is unlikely that a, b, or c will be a cd/dvd drive Addes DriveBlob functions, untested on linux/osx probably needs more work Removes duplicate message from EXI_DeviceMemoryCard.cpp when creating a brand new memcard git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2345 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -22,36 +22,41 @@
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#include <winioctl.h>
|
||||
#endif
|
||||
|
||||
namespace DiscIO
|
||||
{
|
||||
|
||||
#ifdef _WIN32
|
||||
class DriveReader : public SectorReader
|
||||
{
|
||||
HANDLE hDisc;
|
||||
|
||||
private:
|
||||
DriveReader(const char *drive) {
|
||||
/*
|
||||
char path[MAX_PATH];
|
||||
strncpy(path, drive, 3);
|
||||
path[2] = 0;
|
||||
sprintf(path, "\\\\.\\%s", drive);
|
||||
hDisc = CreateFile(path, 0, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL);
|
||||
SetSectorSize(2048);
|
||||
*/
|
||||
}
|
||||
|
||||
DriveReader(const char *drive);
|
||||
void DriveReader::SetSectorSize(int blocksize);
|
||||
enum { CACHE_SIZE = 32 };
|
||||
int m_blocksize;
|
||||
u8* cache[CACHE_SIZE];
|
||||
u64 cache_tags[CACHE_SIZE];
|
||||
int cache_age[CACHE_SIZE];
|
||||
void GetBlock(u64 block_num, u8 *out_ptr);
|
||||
#ifdef _WIN32
|
||||
HANDLE hDisc;
|
||||
PREVENT_MEDIA_REMOVAL pmrLockCDROM;
|
||||
#else
|
||||
FILE* file_;
|
||||
#endif
|
||||
s64 size;
|
||||
u64 *block_pointers;
|
||||
public:
|
||||
static DriveReader *Create(const char *drive) {
|
||||
return NULL;// new DriveReader(drive);
|
||||
}
|
||||
static DriveReader *Create(const char *drive);
|
||||
~DriveReader();
|
||||
u64 GetDataSize() const { return size; }
|
||||
u64 GetRawSize() const { return size; }
|
||||
bool Read(u64 offset, u64 nbytes, u8* out_ptr);
|
||||
const u8 *GetBlockData(u64 block_num);
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user