openMSX
WD33C93.hh
Go to the documentation of this file.
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
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
22namespace openmsx {
23
24class DeviceConfig;
25
27{
28public:
29 explicit WD33C93(const 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
43private:
44 void disconnect();
45 void execCmd(uint8_t value);
46
47private:
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} // namespace openmsx
63
64#endif
void serialize(Archive &ar, unsigned version)
Definition WD33C93.cc:459
void reset(bool scsiReset)
Definition WD33C93.cc:423
void writeAdr(uint8_t value)
Definition WD33C93.cc:247
uint8_t peekCtrl() const
Definition WD33C93.cc:409
uint8_t peekAuxStatus() const
Definition WD33C93.cc:404
void writeCtrl(uint8_t value)
Definition WD33C93.cc:254
uint8_t readCtrl()
Definition WD33C93.cc:340
uint8_t readAuxStatus()
Definition WD33C93.cc:313
This file implemented 3 utility functions:
Definition Autofire.cc:11