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
8namespace openmsx {
9
10class MSXWatchIODevice;
11
12class WatchIO final : public WatchPoint
13 , public std::enable_shared_from_this<WatchIO>
14{
15public:
16 WatchIO(MSXMotherBoard& motherboard,
18 unsigned beginAddr, unsigned endAddr,
19 TclObject command, TclObject condition,
20 bool once, unsigned newId = -1);
21
22 MSXWatchIODevice& getDevice(byte port);
23
24private:
25 void doReadCallback(unsigned port);
26 void doWriteCallback(unsigned port, unsigned value);
27
28private:
29 MSXMotherBoard& motherboard;
30 std::vector<std::unique_ptr<MSXWatchIODevice>> ios;
31
32 friend class MSXWatchIODevice;
33};
34
35class MSXWatchIODevice final : public MSXMultiDevice
36{
37public:
38 MSXWatchIODevice(const HardwareConfig& hwConf, WatchIO& watchIO);
39
40 [[nodiscard]] MSXDevice*& getDevicePtr() { return device; }
41
42private:
43 // MSXDevice
44 [[nodiscard]] const std::string& getName() const override;
45 [[nodiscard]] byte readIO(word port, EmuTime::param time) override;
46 [[nodiscard]] byte peekIO(word port, EmuTime::param time) const override;
47 void writeIO(word port, byte value, EmuTime::param time) override;
48
49private:
50 WatchIO& watchIO;
51 MSXDevice* device = nullptr;
52};
53
54} // namespace openmsx
55
56#endif
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
Definition MSXDevice.hh:36
MSXWatchIODevice & getDevice(byte port)
Base class for CPU breakpoints.
Definition WatchPoint.hh:14
This file implemented 3 utility functions:
Definition Autofire.cc:11
uint16_t word
16 bit unsigned integer
Definition openmsx.hh:29