| e8555c89 Andy McCall |
1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
#ifndef WD33C93_HH |
| 12 |
#define WD33C93_HH |
| 13 |
|
| 14 |
#include "SCSI.hh" |
| 15 |
#include "SCSIDevice.hh" |
| 16 |
|
| 17 |
#include "AlignedBuffer.hh" |
| 18 |
|
| 19 |
#include <array> |
| 20 |
#include <memory> |
| 21 |
|
| 22 |
namespace openmsx { |
| 23 |
|
| 24 |
class DeviceConfig; |
| 25 |
|
| 26 |
class WD33C93 |
| 27 |
{ |
| 28 |
public: |
| 29 |
explicit WD33C93(DeviceConfig& config); |
| 30 |
|
| 31 |
void reset(bool scsiReset); |
| 32 |
|
| 33 |
[[nodiscard]] uint8_t readAuxStatus(); |
| 34 |
[[nodiscard]] uint8_t readCtrl(); |
| 35 |
[[nodiscard]] uint8_t peekAuxStatus() const; |
| 36 |
[[nodiscard]] uint8_t peekCtrl() const; |
| 37 |
void writeAdr(uint8_t value); |
| 38 |
void writeCtrl(uint8_t value); |
| 39 |
|
| 40 |
template<typename Archive> |
| 41 |
void serialize(Archive& ar, unsigned version); |
| 42 |
|
| 43 |
private: |
| 44 |
void disconnect(); |
| 45 |
void execCmd(uint8_t value); |
| 46 |
|
| 47 |
private: |
| 48 |
AlignedByteArray<SCSIDevice::BUFFER_SIZE> buffer; |
| 49 |
std::array<std::unique_ptr<SCSIDevice>, 8> dev; |
| 50 |
unsigned bufIdx; |
| 51 |
unsigned counter = 0; |
| 52 |
unsigned blockCounter = 0; |
| 53 |
int tc; |
| 54 |
SCSI::Phase phase; |
| 55 |
uint8_t myId; |
| 56 |
uint8_t targetId = 0; |
| 57 |
std::array<uint8_t, 32> regs; |
| 58 |
uint8_t latch; |
| 59 |
bool devBusy = false; |
| 60 |
}; |
| 61 |
|
| 62 |
} |
| 63 |
|
| 64 |
#endif |