32 [[nodiscard]]
const std::string& getName()
const override;
33 [[nodiscard]]
byte readIO(
word port, EmuTime::param time)
override;
34 [[nodiscard]]
byte peekIO(
word port, EmuTime::param time)
const override;
35 void writeIO(
word port,
byte value, EmuTime::param time)
override;
43 ,
public std::enable_shared_from_this<WatchPoint>
46 static constexpr std::string_view
prefix =
"wp#";
64 if (str ==
"read_io")
return READ_IO;
65 if (str ==
"write_io")
return WRITE_IO;
66 if (str ==
"read_mem")
return READ_MEM;
77 if (len !=
one_of(1u, 2u)) {
78 throw CommandException(
"Invalid address: must be a single address, or a begin/end pair");
92 , beginAddrStr(wp.beginAddrStr), endAddrStr(wp.endAddrStr)
93 , beginAddr(wp.beginAddr), endAddr(wp.endAddr)
122 std::tie(beginAddrStr, endAddrStr) =
parseAddress(interp, a);
133 beginAddr = endAddr = {};
142 return e.getMessage();
151 void doWriteCallback(
MSXMotherBoard& motherBoard,
unsigned port,
unsigned value);
162 if ((
begin < 0) || (
end >=
int(max))) {
163 throw CommandException(
"address outside of range 0...", max - 1);
165 return {narrow<uint16_t>(
begin), narrow<uint16_t>(
end)};
169 TclObject beginAddrStr;
170 TclObject endAddrStr;
171 std::optional<uint16_t> beginAddr;
172 std::optional<uint16_t> endAddr;
174 std::vector<std::unique_ptr<MSXWatchIODevice>> ios;
175 bool registered =
false;
CRTP base class for CPU break and watch points.
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
MSXDevice *& getDevicePtr()
unsigned getListLength(Interpreter &interp) const
TclObject getListIndex(Interpreter &interp, unsigned index) const
TclObject eval(Interpreter &interp) const
int getInt(Interpreter &interp) const
zstring_view getString() const
static std::string_view format(Type type)
auto getEndAddress() const
void setEndAddressString(Interpreter &interp, const TclObject &s)
void registerIOWatch(MSXMotherBoard &motherBoard, std::span< MSXDevice *, 256 > devices)
WatchPoint(clone_tag, const WatchPoint &wp)
auto getEndAddressString() const
auto getBeginAddress() const
std::string parseAddressError(Interpreter &interp) const
static Type parseType(std::string_view str)
static std::pair< TclObject, TclObject > parseAddress(Interpreter &interp, const TclObject &a)
void setAddress(Interpreter &interp, const TclObject &a)
static unsigned rangeForType(Type type)
void setType(Interpreter &interp, Type t)
static constexpr std::string_view prefix
auto getBeginAddressString() const
void setType(Interpreter &interp, const TclObject &t)
void evaluateAddress(Interpreter &interp)
void setBeginAddressString(Interpreter &interp, const TclObject &s)
void unregisterIOWatch(std::span< MSXDevice *, 256 > devices)
constexpr auto empty() const
This file implemented 3 utility functions:
uint16_t word
16 bit unsigned integer
constexpr auto begin(const zstring_view &x)
constexpr auto end(const zstring_view &x)