openMSX
SimpleDebuggable.cc
Go to the documentation of this file.
1 #include "SimpleDebuggable.hh"
2 #include "MSXMotherBoard.hh"
3 #include "Debugger.hh"
4 #include "unreachable.hh"
5 
6 namespace openmsx {
7 
9  MSXMotherBoard& motherBoard_, std::string name_,
10  std::string description_, unsigned size_)
11  : motherBoard(motherBoard_)
12  , name(std::move(name_))
13  , description(std::move(description_))
14  , size(size_)
15 {
16  motherBoard.getDebugger().registerDebuggable(name, *this);
17 }
18 
20 {
21  motherBoard.getDebugger().unregisterDebuggable(name, *this);
22 }
23 
24 unsigned SimpleDebuggable::getSize() const
25 {
26  return size;
27 }
28 
29 const std::string& SimpleDebuggable::getDescription() const
30 {
31  return description;
32 }
33 
34 byte SimpleDebuggable::read(unsigned address)
35 {
36  return read(address, motherBoard.getCurrentTime());
37 }
38 
39 byte SimpleDebuggable::read(unsigned /*address*/, EmuTime::param /*time*/)
40 {
41  UNREACHABLE; return 0;
42 }
43 
44 void SimpleDebuggable::write(unsigned address, byte value)
45 {
46  write(address, value, motherBoard.getCurrentTime());
47 }
48 
49 void SimpleDebuggable::write(unsigned /*address*/, byte /*value*/,
50  EmuTime::param /*time*/)
51 {
52  // does nothing
53 }
54 
55 } // namespace openmsx
const std::string & getDescription() const final override
uint8_t byte
8 bit unsigned integer
Definition: openmsx.hh:26
STL namespace.
unsigned getSize() const final override
void unregisterDebuggable(string_view name, Debuggable &debuggable)
Definition: Debugger.cc:52
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
byte read(unsigned address) override
void registerDebuggable(std::string name, Debuggable &debuggable)
Definition: Debugger.cc:46
void write(unsigned address, byte value) override
SimpleDebuggable(MSXMotherBoard &motherBoard, std::string name, std::string description, unsigned size)
EmuTime::param getCurrentTime()
Convenience method: This is the same as getScheduler().getCurrentTime().
constexpr auto size(const C &c) -> decltype(c.size())
Definition: span.hh:62
#define UNREACHABLE
Definition: unreachable.hh:38