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 const unsigned BIT_SCSI2 = 0x0001;
12  static const unsigned BIT_SCSI2_ONLY = 0x0002;
13  static const unsigned BIT_SCSI3 = 0x0004;
14 
15  static const unsigned MODE_SCSI1 = 0x0000;
16  static const unsigned MODE_SCSI2 = 0x0003;
17  static const unsigned MODE_SCSI3 = 0x0005;
18  static const unsigned MODE_UNITATTENTION = 0x0008; // report unit attention
19  static const unsigned MODE_MEGASCSI = 0x0010; // report disk change when call of
20  // 'test unit ready'
21  static const unsigned MODE_NOVAXIS = 0x0100;
22 
23  static const 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
static const unsigned MODE_SCSI1
Definition: SCSIDevice.hh:15
virtual byte msgIn()=0
virtual void busReset()=0
virtual int msgOut(byte value)=0
uint8_t byte
8 bit unsigned integer
Definition: openmsx.hh:26
virtual bool isSelected()=0
virtual unsigned dataIn(unsigned &blocks)=0
virtual byte getStatusCode()=0
static const unsigned MODE_SCSI3
Definition: SCSIDevice.hh:17
static const unsigned BIT_SCSI2_ONLY
Definition: SCSIDevice.hh:12
static const unsigned MODE_SCSI2
Definition: SCSIDevice.hh:16
static const unsigned BUFFER_SIZE
Definition: SCSIDevice.hh:23
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
virtual void disconnect()=0
virtual unsigned executingCmd(SCSI::Phase &phase, unsigned &blocks)=0
virtual void reset()=0
static const unsigned BIT_SCSI2
Definition: SCSIDevice.hh:11
virtual unsigned executeCmd(const byte *cdb, SCSI::Phase &phase, unsigned &blocks)=0
virtual unsigned dataOut(unsigned &blocks)=0
static const unsigned MODE_MEGASCSI
Definition: SCSIDevice.hh:19
static const unsigned MODE_UNITATTENTION
Definition: SCSIDevice.hh:18
static const unsigned BIT_SCSI3
Definition: SCSIDevice.hh:13
virtual ~SCSIDevice()=default
static const unsigned MODE_NOVAXIS
Definition: SCSIDevice.hh:21