mirror of
https://github.com/akuker/RASCSI.git
synced 2024-11-20 03:34:27 +00:00
08194af424
- Moved C++ code to cpp/ from src/raspberrypi - Related updates to Makefile, easyinstall.sh, and the github build rules - Removed the native X68k C code in src/x68k from the repo
56 lines
1.4 KiB
C++
56 lines
1.4 KiB
C++
//---------------------------------------------------------------------------
|
|
//
|
|
// SCSI Target Emulator RaSCSI Reloaded
|
|
// for Raspberry Pi
|
|
//
|
|
// Copyright (C) 2022 Uwe Seimet
|
|
//
|
|
//---------------------------------------------------------------------------
|
|
|
|
#pragma once
|
|
|
|
#include "primary_device.h"
|
|
#include <string>
|
|
#include <vector>
|
|
#include <map>
|
|
|
|
class ModePageDevice: public PrimaryDevice
|
|
{
|
|
public:
|
|
|
|
ModePageDevice(PbDeviceType, int);
|
|
~ModePageDevice() override = default;
|
|
|
|
bool Dispatch(scsi_command) override;
|
|
|
|
virtual void ModeSelect(scsi_defs::scsi_command, const vector<int>&, const vector<BYTE>&, int) const;
|
|
|
|
protected:
|
|
|
|
bool SupportsSaveParameters() const { return supports_save_parameters; }
|
|
void SupportsSaveParameters(bool b) { supports_save_parameters = b; }
|
|
int AddModePages(const vector<int>&, vector<BYTE>&, int, int, int) const;
|
|
virtual void SetUpModePages(map<int, vector<byte>>&, int, bool) const = 0;
|
|
virtual void AddVendorPage(map<int, vector<byte>>&, int, bool) const {
|
|
// Nothing to add by default
|
|
}
|
|
|
|
private:
|
|
|
|
using super = PrimaryDevice;
|
|
|
|
Dispatcher<ModePageDevice> dispatcher;
|
|
|
|
bool supports_save_parameters = false;
|
|
|
|
virtual int ModeSense6(const vector<int>&, vector<BYTE>&) const = 0;
|
|
virtual int ModeSense10(const vector<int>&, vector<BYTE>&) const = 0;
|
|
|
|
void ModeSense6();
|
|
void ModeSense10();
|
|
void ModeSelect6();
|
|
void ModeSelect10();
|
|
|
|
int SaveParametersCheck(int) const;
|
|
};
|