2022-02-13 05:10:06 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// SCSI Target Emulator RaSCSI (*^..^*)
|
|
|
|
// for Raspberry Pi
|
|
|
|
//
|
2022-03-14 02:16:21 +00:00
|
|
|
// Copyright (C) 2022 akuker
|
2022-02-13 05:10:06 +00:00
|
|
|
//
|
2022-03-14 02:10:51 +00:00
|
|
|
// [ PosixFileHandle ]
|
2022-02-13 05:10:06 +00:00
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "filepath.h"
|
2022-03-14 02:10:51 +00:00
|
|
|
#include "disk_image/disk_image_handle.h"
|
2022-02-13 05:10:06 +00:00
|
|
|
|
2022-03-14 02:10:51 +00:00
|
|
|
class PosixFileHandle : public DiskImageHandle
|
2022-02-13 05:10:06 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
2022-03-14 02:28:40 +00:00
|
|
|
PosixFileHandle(const Filepath &path, int size, uint32_t blocks, off_t imgoff = 0);
|
2022-03-14 02:10:51 +00:00
|
|
|
~PosixFileHandle();
|
2022-02-13 05:10:06 +00:00
|
|
|
|
2022-03-14 02:28:40 +00:00
|
|
|
void SetRawMode(BOOL raw); // CD-ROM raw mode setting
|
2022-02-13 05:10:06 +00:00
|
|
|
|
|
|
|
// Access
|
2022-03-14 02:28:40 +00:00
|
|
|
bool Save() { return true; }; // Save and release all
|
|
|
|
bool ReadSector(BYTE *buf, int block); // Sector Read
|
|
|
|
bool WriteSector(const BYTE *buf, int block); // Sector Write
|
|
|
|
bool GetCache(int index, int &track, DWORD &serial) const { return true; }; // Get cache information
|
|
|
|
|
2022-02-13 05:10:06 +00:00
|
|
|
private:
|
|
|
|
int fd;
|
|
|
|
bool initialized = false;
|
|
|
|
};
|