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#include "AlignedBuffer.hh"
17#include <array>
18#include <memory>
19
20namespace openmsx {
21
22class DeviceConfig;
23
25{
26public:
27 explicit WD33C93(const DeviceConfig& config);
28
29 void reset(bool scsiReset);
30
31 [[nodiscard]] uint8_t readAuxStatus();
32 [[nodiscard]] uint8_t readCtrl();
33 [[nodiscard]] uint8_t peekAuxStatus() const;
34 [[nodiscard]] uint8_t peekCtrl() const;
35 void writeAdr(uint8_t value);
36 void writeCtrl(uint8_t value);
37
38 template<typename Archive>
39 void serialize(Archive& ar, unsigned version);
40
41private:
42 void disconnect();
43 void execCmd(uint8_t value);
44
45private:
47 std::array<std::unique_ptr<SCSIDevice>, 8> dev;
48 unsigned bufIdx;
49 unsigned counter = 0;
50 unsigned blockCounter = 0;
51 int tc;
52 SCSI::Phase phase;
53 uint8_t myId;
54 uint8_t targetId = 0;
55 std::array<uint8_t, 32> regs;
56 uint8_t latch;
57 bool devBusy = false;
58};
59
60} // namespace openmsx
61
62#endif
void serialize(Archive &ar, unsigned version)
Definition: WD33C93.cc:454
void reset(bool scsiReset)
Definition: WD33C93.cc:418
void writeAdr(uint8_t value)
Definition: WD33C93.cc:242
WD33C93(const DeviceConfig &config)
Definition: WD33C93.cc:107
uint8_t peekCtrl() const
Definition: WD33C93.cc:404
uint8_t peekAuxStatus() const
Definition: WD33C93.cc:399
void writeCtrl(uint8_t value)
Definition: WD33C93.cc:249
uint8_t readCtrl()
Definition: WD33C93.cc:335
uint8_t readAuxStatus()
Definition: WD33C93.cc:308
This file implemented 3 utility functions:
Definition: Autofire.cc:9