WD33C93.hh 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /* Ported from:
  2. ** Source: /cvsroot/bluemsx/blueMSX/Src/IoDevice/wd33c93.h,v
  3. ** Revision: 1.6
  4. ** Date: 2007/03/22 10:55:08
  5. **
  6. ** More info: http://www.bluemsx.com
  7. **
  8. ** Copyright (C) 2003-2007 Daniel Vik, Ricardo Bittencourt, white cat
  9. */
  10. #ifndef WD33C93_HH
  11. #define WD33C93_HH
  12. #include "SCSI.hh"
  13. #include "SCSIDevice.hh"
  14. #include "AlignedBuffer.hh"
  15. #include <memory>
  16. namespace openmsx {
  17. class DeviceConfig;
  18. class WD33C93
  19. {
  20. public:
  21. explicit WD33C93(const DeviceConfig& config);
  22. void reset(bool scsireset);
  23. byte readAuxStatus();
  24. byte readCtrl();
  25. byte peekAuxStatus() const;
  26. byte peekCtrl() const;
  27. void writeAdr(byte value);
  28. void writeCtrl(byte value);
  29. template<typename Archive>
  30. void serialize(Archive& ar, unsigned version);
  31. private:
  32. void disconnect();
  33. void execCmd(byte value);
  34. AlignedByteArray<SCSIDevice::BUFFER_SIZE> buffer;
  35. std::unique_ptr<SCSIDevice> dev[8];
  36. unsigned bufIdx;
  37. int counter;
  38. unsigned blockCounter;
  39. int tc;
  40. SCSI::Phase phase;
  41. byte myId;
  42. byte targetId;
  43. byte regs[32];
  44. byte latch;
  45. bool devBusy;
  46. };
  47. } // namespace openmsx
  48. #endif