openMSX
MSXWatchIODevice.hh
Go to the documentation of this file.
1 #ifndef MSXWATCHIODEVICE_HH
2 #define MSXWATCHIODEVICE_HH
3 
4 #include "MSXMultiDevice.hh"
5 #include "WatchPoint.hh"
6 #include <memory>
7 
8 namespace openmsx {
9 
10 class MSXCPUInterface;
11 class MSXWatchIODevice;
12 
13 class WatchIO : public WatchPoint
14 {
15 public:
16  WatchIO(MSXMotherBoard& motherboard,
17  WatchPoint::Type type,
18  unsigned beginAddr, unsigned endAddr,
19  TclObject command, TclObject condition,
20  unsigned newId = -1);
21  virtual ~WatchIO();
22 
24 
25 private:
26  void doReadCallback(unsigned port);
27  void doWriteCallback(unsigned port, unsigned value);
28 
29  MSXCPUInterface& cpuInterface;
30  std::vector<std::unique_ptr<MSXWatchIODevice>> ios;
31 
32  friend class MSXWatchIODevice;
33 };
34 
36 {
37 public:
38  MSXWatchIODevice(const HardwareConfig& hwConf, WatchIO& watchIO);
39 
41 
42 private:
43  // MSXDevice
44  virtual std::string getName() const;
45  virtual byte readIO(word port, EmuTime::param time);
46  virtual byte peekIO(word port, EmuTime::param time) const;
47  virtual void writeIO(word port, byte value, EmuTime::param time);
48 
49  WatchIO& watchIO;
50  MSXDevice* device;
51 };
52 
53 } // namespace openmsx
54 
55 #endif
WatchIO(MSXMotherBoard &motherboard, WatchPoint::Type type, unsigned beginAddr, unsigned endAddr, TclObject command, TclObject condition, unsigned newId=-1)
unsigned char byte
8 bit unsigned integer
Definition: openmsx.hh:33
Base class for CPU breakpoints.
Definition: WatchPoint.hh:12
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX...
Definition: MSXDevice.hh:32
unsigned short word
16 bit unsigned integer
Definition: openmsx.hh:38
MSXWatchIODevice(const HardwareConfig &hwConf, WatchIO &watchIO)
MSXWatchIODevice & getDevice(byte port)