SCSIDevice.hh 1.4 KB

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