openMSX
SCSIDevice.hh
Go to the documentation of this file.
1 #ifndef SCSIDEVICE_HH
2 #define SCSIDEVICE_HH
3 
4 #include "SCSI.hh"
5 
6 namespace openmsx {
7 
8 class SCSIDevice
9 {
10 public:
11  static constexpr unsigned BIT_SCSI2 = 0x0001;
12  static constexpr unsigned BIT_SCSI2_ONLY = 0x0002;
13  static constexpr unsigned BIT_SCSI3 = 0x0004;
14 
15  static constexpr unsigned MODE_SCSI1 = 0x0000;
16  static constexpr unsigned MODE_SCSI2 = 0x0003;
17  static constexpr unsigned MODE_SCSI3 = 0x0005;
18  static constexpr unsigned MODE_UNITATTENTION = 0x0008; // report unit attention
19  static constexpr unsigned MODE_MEGASCSI = 0x0010; // report disk change when call of
20  // 'test unit ready'
21  static constexpr unsigned MODE_NOVAXIS = 0x0100;
22 
23  static constexpr unsigned BUFFER_SIZE = 0x10000; // 64KB
24 
25  virtual ~SCSIDevice() = default;
26 
27  virtual void reset() = 0;
28  virtual bool isSelected() = 0;
29  virtual unsigned executeCmd(const byte* cdb, SCSI::Phase& phase,
30  unsigned& blocks) = 0;
31  virtual unsigned executingCmd(SCSI::Phase& phase, unsigned& blocks) = 0;
32  virtual byte getStatusCode() = 0;
33  virtual int msgOut(byte value) = 0;
34  virtual byte msgIn() = 0;
35  virtual void disconnect() = 0;
36  virtual void busReset() = 0; // only used in MB89352 controller
37 
38  virtual unsigned dataIn(unsigned& blocks) = 0;
39  virtual unsigned dataOut(unsigned& blocks) = 0;
40 };
41 
42 } // namespace openmsx
43 
44 #endif
openmsx::SCSIDevice::busReset
virtual void busReset()=0
openmsx::SCSIDevice
Definition: SCSIDevice.hh:9
openmsx::SCSIDevice::BIT_SCSI2
static constexpr unsigned BIT_SCSI2
Definition: SCSIDevice.hh:11
openmsx::SCSIDevice::MODE_SCSI2
static constexpr unsigned MODE_SCSI2
Definition: SCSIDevice.hh:16
openmsx::SCSIDevice::executeCmd
virtual unsigned executeCmd(const byte *cdb, SCSI::Phase &phase, unsigned &blocks)=0
openmsx::SCSIDevice::BUFFER_SIZE
static constexpr unsigned BUFFER_SIZE
Definition: SCSIDevice.hh:23
SCSI.hh
openmsx::SCSIDevice::MODE_SCSI3
static constexpr unsigned MODE_SCSI3
Definition: SCSIDevice.hh:17
openmsx::SCSIDevice::~SCSIDevice
virtual ~SCSIDevice()=default
openmsx::SCSIDevice::isSelected
virtual bool isSelected()=0
openmsx::SCSIDevice::BIT_SCSI2_ONLY
static constexpr unsigned BIT_SCSI2_ONLY
Definition: SCSIDevice.hh:12
openmsx::SCSIDevice::getStatusCode
virtual byte getStatusCode()=0
openmsx::SCSIDevice::dataOut
virtual unsigned dataOut(unsigned &blocks)=0
openmsx::SCSIDevice::dataIn
virtual unsigned dataIn(unsigned &blocks)=0
openmsx::SCSIDevice::msgIn
virtual byte msgIn()=0
openmsx::SCSIDevice::reset
virtual void reset()=0
openmsx::SCSIDevice::MODE_SCSI1
static constexpr unsigned MODE_SCSI1
Definition: SCSIDevice.hh:15
openmsx::SCSIDevice::MODE_NOVAXIS
static constexpr unsigned MODE_NOVAXIS
Definition: SCSIDevice.hh:21
openmsx::SCSIDevice::msgOut
virtual int msgOut(byte value)=0
openmsx::SCSIDevice::disconnect
virtual void disconnect()=0
openmsx
This file implemented 3 utility functions:
Definition: Autofire.cc:5
openmsx::SCSIDevice::BIT_SCSI3
static constexpr unsigned BIT_SCSI3
Definition: SCSIDevice.hh:13
openmsx::SCSI::Phase
Phase
Definition: SCSI.hh:99
openmsx::SCSIDevice::MODE_UNITATTENTION
static constexpr unsigned MODE_UNITATTENTION
Definition: SCSIDevice.hh:18
openmsx::SCSIDevice::MODE_MEGASCSI
static constexpr unsigned MODE_MEGASCSI
Definition: SCSIDevice.hh:19
openmsx::SCSIDevice::executingCmd
virtual unsigned executingCmd(SCSI::Phase &phase, unsigned &blocks)=0