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  static_string_view description_, unsigned size_)
11  : motherBoard(motherBoard_)
12  , name(std::move(name_))
13  , description(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 std::string_view 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
void unregisterDebuggable(std::string_view name, Debuggable &debuggable)
Definition: Debugger.cc:54
void registerDebuggable(std::string name, Debuggable &debuggable)
Definition: Debugger.cc:48
EmuTime::param getCurrentTime()
Convenience method: This is the same as getScheduler().getCurrentTime().
byte read(unsigned address) override
std::string_view getDescription() const final
unsigned getSize() const final
void write(unsigned address, byte value) override
SimpleDebuggable(MSXMotherBoard &motherBoard, std::string name, static_string_view description, unsigned size)
static_string_view
This file implemented 3 utility functions:
Definition: Autofire.cc:5
size_t size(std::string_view utf8)
#define UNREACHABLE
Definition: unreachable.hh:38