openMSX
MSXCPUInterface.hh
Go to the documentation of this file.
1 #ifndef MSXCPUINTERFACE_HH
2 #define MSXCPUINTERFACE_HH
3 
4 #include "DebugCondition.hh"
5 #include "SimpleDebuggable.hh"
6 #include "InfoTopic.hh"
7 #include "CacheLine.hh"
8 #include "MSXDevice.hh"
9 #include "BreakPoint.hh"
10 #include "WatchPoint.hh"
11 #include "ProfileCounters.hh"
12 #include "openmsx.hh"
13 #include "likely.hh"
14 #include "ranges.hh"
15 #include <bitset>
16 #include <vector>
17 #include <memory>
18 
19 namespace openmsx {
20 
21 class VDPIODelay;
22 class DummyDevice;
23 class MSXMotherBoard;
24 class MSXCPU;
25 class CliComm;
26 class BreakPoint;
27 class CartridgeSlotManager;
28 
30  [[nodiscard]] bool operator()(const BreakPoint& x, const BreakPoint& y) const {
31  return x.getAddress() < y.getAddress();
32  }
33  [[nodiscard]] bool operator()(const BreakPoint& x, word y) const {
34  return x.getAddress() < y;
35  }
36  [[nodiscard]] bool operator()(word x, const BreakPoint& y) const {
37  return x < y.getAddress();
38  }
39 };
40 
41 constexpr bool PROFILE_CACHELINES = false;
58  NUM // must be last
59 };
60 std::ostream& operator<<(std::ostream& os, EnumTypeName<CacheLineCounters>);
61 std::ostream& operator<<(std::ostream& os, EnumValueName<CacheLineCounters> evn);
62 
63 class MSXCPUInterface : public ProfileCounters<PROFILE_CACHELINES, CacheLineCounters>
64 {
65 public:
66  MSXCPUInterface(const MSXCPUInterface&) = delete;
68 
69  explicit MSXCPUInterface(MSXMotherBoard& motherBoard);
71 
77  void register_IO_In(byte port, MSXDevice* device);
78  void unregister_IO_In(byte port, MSXDevice* device);
79 
85  void register_IO_Out(byte port, MSXDevice* device);
86  void unregister_IO_Out(byte port, MSXDevice* device);
87 
103  bool replace_IO_In (byte port, MSXDevice* oldDevice, MSXDevice* newDevice);
104  bool replace_IO_Out(byte port, MSXDevice* oldDevice, MSXDevice* newDevice);
105 
112  void registerMemDevice(MSXDevice& device,
113  int ps, int ss, int base, int size);
114  void unregisterMemDevice(MSXDevice& device,
115  int ps, int ss, int base, int size);
116 
120  void registerGlobalWrite(MSXDevice& device, word address);
121  void unregisterGlobalWrite(MSXDevice& device, word address);
122 
126  void registerGlobalRead(MSXDevice& device, word address);
127  void unregisterGlobalRead(MSXDevice& device, word address);
128 
132  void reset();
133 
137  inline byte readMem(word address, EmuTime::param time) {
139  if (unlikely(disallowReadCache[address >> CacheLine::BITS])) {
140  return readMemSlow(address, time);
141  }
142  return visibleDevices[address >> 14]->readMem(address, time);
143  }
144 
148  inline void writeMem(word address, byte value, EmuTime::param time) {
150  if (unlikely(disallowWriteCache[address >> CacheLine::BITS])) {
151  writeMemSlow(address, value, time);
152  return;
153  }
154  visibleDevices[address>>14]->writeMem(address, value, time);
155  }
156 
161  inline byte readIO(word port, EmuTime::param time) {
162  return IO_In[port & 0xFF]->readIO(port, time);
163  }
164 
169  inline void writeIO(word port, byte value, EmuTime::param time) {
170  IO_Out[port & 0xFF]->writeIO(port, value, time);
171  }
172 
185  [[nodiscard]] inline const byte* getReadCacheLine(word start) const {
187  if (unlikely(disallowReadCache[start >> CacheLine::BITS])) {
188  return nullptr;
189  }
190  return visibleDevices[start >> 14]->getReadCacheLine(start);
191  }
192 
205  [[nodiscard]] inline byte* getWriteCacheLine(word start) const {
207  if (unlikely(disallowWriteCache[start >> CacheLine::BITS])) {
208  return nullptr;
209  }
210  return visibleDevices[start >> 14]->getWriteCacheLine(start);
211  }
212 
217  [[nodiscard]] byte readIRQVector();
218 
219  /*
220  * Should only be used by PPI
221  * TODO: make private / friend
222  */
223  void setPrimarySlots(byte value);
224 
226  void invalidateRWCache(word start, unsigned size, int ps, int ss);
227  void invalidateRCache (word start, unsigned size, int ps, int ss);
228  void invalidateWCache (word start, unsigned size, int ps, int ss);
229 
231  void fillRWCache(unsigned start, unsigned size, const byte* rData, byte* wData, int ps, int ss);
232  void fillRCache (unsigned start, unsigned size, const byte* rData, int ps, int ss);
233  void fillWCache (unsigned start, unsigned size, byte* wData, int ps, int ss);
234 
239  [[nodiscard]] byte peekMem(word address, EmuTime::param time) const;
240  [[nodiscard]] byte peekSlottedMem(unsigned address, EmuTime::param time) const;
241  byte readSlottedMem(unsigned address, EmuTime::param time);
242  void writeSlottedMem(unsigned address, byte value,
243  EmuTime::param time);
244 
245  void setExpanded(int ps);
246  void unsetExpanded(int ps);
247  void testUnsetExpanded(int ps, std::vector<MSXDevice*> allowed) const;
248  [[nodiscard]] inline bool isExpanded(int ps) const { return expanded[ps] != 0; }
249  void changeExpanded(bool newExpanded);
250 
251  [[nodiscard]] DummyDevice& getDummyDevice() { return *dummyDevice; }
252 
253  static void insertBreakPoint(BreakPoint bp);
254  static void removeBreakPoint(const BreakPoint& bp);
255  using BreakPoints = std::vector<BreakPoint>;
256  [[nodiscard]] static const BreakPoints& getBreakPoints() { return breakPoints; }
257 
258  void setWatchPoint(const std::shared_ptr<WatchPoint>& watchPoint);
259  void removeWatchPoint(std::shared_ptr<WatchPoint> watchPoint);
260  // note: must be shared_ptr (not unique_ptr), see WatchIO::doReadCallback()
261  using WatchPoints = std::vector<std::shared_ptr<WatchPoint>>;
262  [[nodiscard]] const WatchPoints& getWatchPoints() const { return watchPoints; }
263 
264  static void setCondition(DebugCondition cond);
265  static void removeCondition(const DebugCondition& cond);
266  using Conditions = std::vector<DebugCondition>;
267  [[nodiscard]] static const Conditions& getConditions() { return conditions; }
268 
269  [[nodiscard]] static bool isBreaked() { return breaked; }
270  void doBreak();
271  void doStep();
272  void doContinue();
273 
274  // breakpoint methods used by CPUCore
275  [[nodiscard]] static bool anyBreakPoints()
276  {
277  return !breakPoints.empty() || !conditions.empty();
278  }
279  [[nodiscard]] static bool checkBreakPoints(unsigned pc, MSXMotherBoard& motherBoard)
280  {
281  auto range = ranges::equal_range(breakPoints, pc, CompareBreakpoints());
282  if (conditions.empty() && (range.first == range.second)) {
283  return false;
284  }
285 
286  // slow path non-inlined
287  checkBreakPoints(range, motherBoard);
288  return isBreaked();
289  }
290 
291  // cleanup global variables
292  static void cleanup();
293 
294  // In fast-forward mode, breakpoints, watchpoints and conditions should
295  // not trigger.
296  void setFastForward(bool fastForward_) { fastForward = fastForward_; }
297  [[nodiscard]] bool isFastForward() const { return fastForward; }
298 
299  template<typename Archive>
300  void serialize(Archive& ar, unsigned version);
301 
302 private:
303  byte readMemSlow(word address, EmuTime::param time);
304  void writeMemSlow(word address, byte value, EmuTime::param time);
305 
306  MSXDevice*& getDevicePtr(byte port, bool isIn);
307 
308  void register_IO (int port, bool isIn,
309  MSXDevice*& devicePtr, MSXDevice* device);
310  void unregister_IO(MSXDevice*& devicePtr, MSXDevice* device);
311  void testRegisterSlot(MSXDevice& device,
312  int ps, int ss, int base, int size);
313  void registerSlot(MSXDevice& device,
314  int ps, int ss, int base, int size);
315  void unregisterSlot(MSXDevice& device,
316  int ps, int ss, int base, int size);
317 
318 
319  static void checkBreakPoints(std::pair<BreakPoints::const_iterator,
320  BreakPoints::const_iterator> range,
321  MSXMotherBoard& motherBoard);
322  static void removeBreakPoint(unsigned id);
323  static void removeCondition(unsigned id);
324 
325  void removeAllWatchPoints();
326  void updateMemWatch(WatchPoint::Type type);
327  void executeMemWatch(WatchPoint::Type type, unsigned address,
328  unsigned value = ~0u);
329 
330  struct MemoryDebug final : SimpleDebuggable {
331  explicit MemoryDebug(MSXMotherBoard& motherBoard);
332  [[nodiscard]] byte read(unsigned address, EmuTime::param time) override;
333  void write(unsigned address, byte value, EmuTime::param time) override;
334  } memoryDebug;
335 
336  struct SlottedMemoryDebug final : SimpleDebuggable {
337  explicit SlottedMemoryDebug(MSXMotherBoard& motherBoard);
338  [[nodiscard]] byte read(unsigned address, EmuTime::param time) override;
339  void write(unsigned address, byte value, EmuTime::param time) override;
340  } slottedMemoryDebug;
341 
342  struct IODebug final : SimpleDebuggable {
343  explicit IODebug(MSXMotherBoard& motherBoard);
344  [[nodiscard]] byte read(unsigned address, EmuTime::param time) override;
345  void write(unsigned address, byte value, EmuTime::param time) override;
346  } ioDebug;
347 
348  struct SlotInfo final : InfoTopic {
349  explicit SlotInfo(InfoCommand& machineInfoCommand);
350  void execute(span<const TclObject> tokens,
351  TclObject& result) const override;
352  [[nodiscard]] std::string help(const std::vector<std::string>& tokens) const override;
353  } slotInfo;
354 
355  struct SubSlottedInfo final : InfoTopic {
356  explicit SubSlottedInfo(InfoCommand& machineInfoCommand);
357  void execute(span<const TclObject> tokens,
358  TclObject& result) const override;
359  [[nodiscard]] std::string help(const std::vector<std::string>& tokens) const override;
360  } subSlottedInfo;
361 
362  struct ExternalSlotInfo final : InfoTopic {
363  explicit ExternalSlotInfo(InfoCommand& machineInfoCommand);
364  void execute(span<const TclObject> tokens,
365  TclObject& result) const override;
366  [[nodiscard]] std::string help(const std::vector<std::string>& tokens) const override;
367  } externalSlotInfo;
368 
369  struct IOInfo : InfoTopic {
370  IOInfo(InfoCommand& machineInfoCommand, const char* name);
371  void helper(span<const TclObject> tokens,
372  TclObject& result, MSXDevice** devices) const;
373  [[nodiscard]] std::string help(const std::vector<std::string>& tokens) const override;
374  protected:
375  ~IOInfo() = default;
376  };
377  struct IInfo final : IOInfo {
378  explicit IInfo(InfoCommand& machineInfoCommand)
379  : IOInfo(machineInfoCommand, "input_port") {}
380  void execute(span<const TclObject> tokens,
381  TclObject& result) const override;
382  } inputPortInfo;
383  struct OInfo final : IOInfo {
384  explicit OInfo(InfoCommand& machineInfoCommand)
385  : IOInfo(machineInfoCommand, "output_port") {}
386  void execute(span<const TclObject> tokens,
387  TclObject& result) const override;
388  } outputPortInfo;
389 
396  void updateVisible(int page);
397  inline void updateVisible(int page, int ps, int ss);
398  void setSubSlot(byte primSlot, byte value);
399 
400  std::unique_ptr<DummyDevice> dummyDevice;
401  MSXCPU& msxcpu;
402  CliComm& cliComm;
403  MSXMotherBoard& motherBoard;
404 
405  std::unique_ptr<VDPIODelay> delayDevice; // can be nullptr
406 
407  byte disallowReadCache [CacheLine::NUM];
408  byte disallowWriteCache[CacheLine::NUM];
409  std::bitset<CacheLine::SIZE> readWatchSet [CacheLine::NUM];
410  std::bitset<CacheLine::SIZE> writeWatchSet[CacheLine::NUM];
411 
412  struct GlobalRwInfo {
413  MSXDevice* device;
414  word addr;
415  [[nodiscard]] bool operator==(const GlobalRwInfo& rhs) const {
416  return (device == rhs.device) &&
417  (addr == rhs.addr);
418  }
419  };
420  std::vector<GlobalRwInfo> globalReads;
421  std::vector<GlobalRwInfo> globalWrites;
422 
423  MSXDevice* IO_In [256];
424  MSXDevice* IO_Out[256];
425  MSXDevice* slotLayout[4][4][4];
426  MSXDevice* visibleDevices[4];
427  byte subSlotRegister[4];
428  byte primarySlotState[4];
429  byte secondarySlotState[4];
430  byte initialPrimarySlots;
431  unsigned expanded[4];
432 
433  bool fastForward; // no need to serialize
434 
435  // All CPUs (Z80 and R800) of all MSX machines share this state.
436  static inline BreakPoints breakPoints; // sorted on address
437  WatchPoints watchPoints; // ordered in creation order, TODO must also be static
438  static inline Conditions conditions; // ordered in creation order
439  static inline bool breaked = false;
440 };
441 
442 
443 // Compile-Time Interval (half-open).
444 // TODO possibly move this to utils/
445 template<unsigned BEGIN, unsigned END = BEGIN + 1>
447 {
448  [[nodiscard]] unsigned begin() const { return BEGIN; } // inclusive
449  [[nodiscard]] unsigned end() const { return END; } // exclusive
450 };
451 
452 // Execute an 'action' for every element in the given interval(s).
453 template<typename ACTION, typename CT_INTERVAL>
454 inline void foreach_ct_interval(ACTION action, CT_INTERVAL interval)
455 {
456  for (auto i = interval.begin(); i != interval.end(); ++i) {
457  action(i);
458  }
459 }
460 template<typename ACTION, typename CT_INTERVAL, typename... CT_INTERVALS>
461 inline void foreach_ct_interval(ACTION action, CT_INTERVAL front, CT_INTERVALS... tail)
462 {
463  foreach_ct_interval(action, front);
464  foreach_ct_interval(action, tail...);
465 }
466 
467 
468 template<typename MSXDEVICE, typename... CT_INTERVALS>
470 {
471  template<typename ACTION>
472  void execute(ACTION action)
473  {
474  auto& dev = static_cast<MSXDEVICE&>(*this);
475  auto& cpu = dev.getCPUInterface();
477  [&](unsigned addr) { action(cpu, dev, addr); },
478  CT_INTERVALS()...);
479  }
480 };
481 
482 template<typename MSXDEVICE, typename... CT_INTERVALS>
483 struct GlobalWriteClient : GlobalRWHelper<MSXDEVICE, CT_INTERVALS...>
484 {
486  {
487  this->execute([](MSXCPUInterface& cpu, MSXDevice& dev, unsigned addr) {
488  cpu.registerGlobalWrite(dev, addr);
489  });
490  }
491 
493  {
494  this->execute([](MSXCPUInterface& cpu, MSXDevice& dev, unsigned addr) {
495  cpu.unregisterGlobalWrite(dev, addr);
496  });
497  }
498 };
499 
500 template<typename MSXDEVICE, typename... CT_INTERVALS>
501 struct GlobalReadClient : GlobalRWHelper<MSXDEVICE, CT_INTERVALS...>
502 {
504  {
505  this->execute([](MSXCPUInterface& cpu, MSXDevice& dev, unsigned addr) {
506  cpu.registerGlobalRead(dev, addr);
507  });
508  }
509 
511  {
512  this->execute([](MSXCPUInterface& cpu, MSXDevice& dev, unsigned addr) {
513  cpu.unregisterGlobalRead(dev, addr);
514  });
515  }
516 };
517 
518 } // namespace openmsx
519 
520 #endif
openmsx::CacheLineCounters
CacheLineCounters
Definition: MSXCPUInterface.hh:42
openmsx::BreakPoint
Base class for CPU breakpoints.
Definition: BreakPoint.hh:14
openmsx::VDPIODelay
VDPIODelay
Definition: VDPIODelay.cc:76
openmsx::MSXDevice
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX.
Definition: MSXDevice.hh:32
openmsx.hh
openmsx::GlobalReadClient::~GlobalReadClient
~GlobalReadClient()
Definition: MSXCPUInterface.hh:510
openmsx::GlobalWriteClient::GlobalWriteClient
GlobalWriteClient()
Definition: MSXCPUInterface.hh:485
openmsx::FillReadWrite
@ FillReadWrite
Definition: MSXCPUInterface.hh:55
openmsx::SlowRead
@ SlowRead
Definition: MSXCPUInterface.hh:47
openmsx::MSXCPUInterface::WatchPoints
std::vector< std::shared_ptr< WatchPoint > > WatchPoints
Definition: MSXCPUInterface.hh:261
openmsx::MSXCPUInterface::doStep
void doStep()
Definition: MSXCPUInterface.cc:1013
unlikely
#define unlikely(x)
Definition: likely.hh:15
openmsx::MSXDevice::writeIO
virtual void writeIO(word port, byte value, EmuTime::param time)
Write a byte to a given IO port at a certain time to this device.
Definition: MSXDevice.cc:415
openmsx::MSXDevice::getReadCacheLine
virtual const byte * getReadCacheLine(word start) const
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for reading.
Definition: MSXDevice.cc:432
openmsx::NonCachedRead
@ NonCachedRead
Definition: MSXCPUInterface.hh:43
openmsx::MSXCPUInterface::getConditions
static const Conditions & getConditions()
Definition: MSXCPUInterface.hh:267
openmsx::GetWriteCacheLine
@ GetWriteCacheLine
Definition: MSXCPUInterface.hh:46
openmsx::CT_Interval::end
unsigned end() const
Definition: MSXCPUInterface.hh:449
openmsx::MSXCPUInterface::setPrimarySlots
void setPrimarySlots(byte value)
Definition: MSXCPUInterface.cc:660
openmsx::InvalidateReadWrite
@ InvalidateReadWrite
Definition: MSXCPUInterface.hh:52
openmsx::MSXDevice::readMem
virtual byte readMem(word address, EmuTime::param time)
Read a byte from a location at a certain time from this device.
Definition: MSXDevice.cc:426
openmsx::MSXDevice::getWriteCacheLine
virtual byte * getWriteCacheLine(word start) const
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for writing.
Definition: MSXDevice.cc:466
utf8::unchecked::size
size_t size(std::string_view utf8)
Definition: utf8_unchecked.hh:233
openmsx::MSXCPUInterface::register_IO_Out
void register_IO_Out(byte port, MSXDevice *device)
Devices can register their Out ports.
Definition: MSXCPUInterface.cc:349
openmsx::CT_Interval::begin
unsigned begin() const
Definition: MSXCPUInterface.hh:448
openmsx::GlobalWriteClient
Definition: MSXCPUInterface.hh:484
openmsx::MSXCPUInterface::isFastForward
bool isFastForward() const
Definition: MSXCPUInterface.hh:297
openmsx::SimpleDebuggable
Definition: SimpleDebuggable.hh:13
openmsx::MSXCPUInterface::~MSXCPUInterface
~MSXCPUInterface()
Definition: MSXCPUInterface.cc:137
openmsx::MSXCPUInterface::operator=
MSXCPUInterface & operator=(const MSXCPUInterface &)=delete
openmsx::MSXCPUInterface::isExpanded
bool isExpanded(int ps) const
Definition: MSXCPUInterface.hh:248
ranges.hh
openmsx::MSXCPUInterface::MSXCPUInterface
MSXCPUInterface(const MSXCPUInterface &)=delete
openmsx::MSXCPUInterface::peekSlottedMem
byte peekSlottedMem(unsigned address, EmuTime::param time) const
Definition: MSXCPUInterface.cc:730
openmsx::MSXCPUInterface::invalidateRCache
void invalidateRCache(word start, unsigned size, int ps, int ss)
Definition: MSXCPUInterface.cc:620
DebugCondition.hh
openmsx::BreakPoint::getAddress
word getAddress() const
Definition: BreakPoint.hh:21
openmsx::MSXCPUInterface::invalidateWCache
void invalidateWCache(word start, unsigned size, int ps, int ss)
Definition: MSXCPUInterface.cc:625
EnumValueName
Definition: ProfileCounters.hh:20
openmsx::MSXDevice::writeMem
virtual void writeMem(word address, byte value, EmuTime::param time)
Write a given byte to a given location at a certain time to this device.
Definition: MSXDevice.cc:437
openmsx::MSXCPU
MSXCPU
Definition: MSXCPU.cc:562
openmsx::MSXCPUInterface::readIO
byte readIO(word port, EmuTime::param time)
This read a byte from the given IO-port.
Definition: MSXCPUInterface.hh:161
openmsx::FillRead
@ FillRead
Definition: MSXCPUInterface.hh:56
openmsx::MSXCPUInterface::writeMem
void writeMem(word address, byte value, EmuTime::param time)
This writes a byte to the currently selected device.
Definition: MSXCPUInterface.hh:148
WatchPoint.hh
openmsx::GlobalRWHelper::execute
void execute(ACTION action)
Definition: MSXCPUInterface.hh:472
openmsx::MSXCPUInterface
Definition: MSXCPUInterface.hh:64
openmsx::GlobalRWHelper
Definition: MSXCPUInterface.hh:470
openmsx::MSXCPUInterface::setCondition
static void setCondition(DebugCondition cond)
Definition: MSXCPUInterface.cc:911
openmsx::SlowWrite
@ SlowWrite
Definition: MSXCPUInterface.hh:48
openmsx::MSXCPUInterface::checkBreakPoints
static bool checkBreakPoints(unsigned pc, MSXMotherBoard &motherBoard)
Definition: MSXCPUInterface.hh:279
span
Definition: span.hh:126
likely.hh
openmsx::MSXCPUInterface::readMem
byte readMem(word address, EmuTime::param time)
This reads a byte from the currently selected device.
Definition: MSXCPUInterface.hh:137
openmsx::DisallowCacheRead
@ DisallowCacheRead
Definition: MSXCPUInterface.hh:49
openmsx::InvalidateAllSlots
@ InvalidateAllSlots
Definition: MSXCPUInterface.hh:51
openmsx::InvalidateWrite
@ InvalidateWrite
Definition: MSXCPUInterface.hh:54
openmsx::MSXCPUInterface::getBreakPoints
static const BreakPoints & getBreakPoints()
Definition: MSXCPUInterface.hh:256
openmsx::MSXCPUInterface::registerMemDevice
void registerMemDevice(MSXDevice &device, int ps, int ss, int base, int size)
Devices can register themself in the MSX slotstructure.
Definition: MSXCPUInterface.cc:512
openmsx::MSXCPUInterface::testUnsetExpanded
void testUnsetExpanded(int ps, std::vector< MSXDevice * > allowed) const
Definition: MSXCPUInterface.cc:258
openmsx::MSXCPUInterface::setFastForward
void setFastForward(bool fastForward_)
Definition: MSXCPUInterface.hh:296
EnumTypeName
Definition: ProfileCounters.hh:13
openmsx::CacheLine::NUM
constexpr unsigned NUM
Definition: CacheLine.hh:8
openmsx::WatchPoint::Type
Type
Definition: WatchPoint.hh:16
openmsx::MSXCPUInterface::registerGlobalRead
void registerGlobalRead(MSXDevice &device, word address)
(Un)register global read.
Definition: MSXCPUInterface.cc:578
openmsx::MSXCPUInterface::insertBreakPoint
static void insertBreakPoint(BreakPoint bp)
Definition: MSXCPUInterface.cc:782
openmsx::MSXCPUInterface::cleanup
static void cleanup()
Definition: MSXCPUInterface.cc:1035
openmsx::MSXCPUInterface::readIRQVector
byte readIRQVector()
CPU uses this method to read 'extra' data from the databus used in interrupt routines.
Definition: MSXCPUInterface.cc:655
openmsx::MSXCPUInterface::registerGlobalWrite
void registerGlobalWrite(MSXDevice &device, word address)
(Un)register global writes.
Definition: MSXCPUInterface.cc:554
openmsx::CompareBreakpoints
Definition: MSXCPUInterface.hh:29
openmsx::CompareBreakpoints::operator()
bool operator()(word x, const BreakPoint &y) const
Definition: MSXCPUInterface.hh:36
openmsx::NonCachedWrite
@ NonCachedWrite
Definition: MSXCPUInterface.hh:44
openmsx::MSXMotherBoard
Definition: MSXMotherBoard.hh:61
openmsx::MSXCPUInterface::isBreaked
static bool isBreaked()
Definition: MSXCPUInterface.hh:269
openmsx::MSXCPUInterface::replace_IO_In
bool replace_IO_In(byte port, MSXDevice *oldDevice, MSXDevice *newDevice)
These methods replace a previously registered device with a new one.
Definition: MSXCPUInterface.cc:406
MSXDevice.hh
openmsx::SimpleDebuggable::write
void write(unsigned address, byte value) override
Definition: SimpleDebuggable.cc:44
openmsx::PROFILE_CACHELINES
constexpr bool PROFILE_CACHELINES
Definition: MSXCPUInterface.hh:41
openmsx::MSXCPUInterface::setWatchPoint
void setWatchPoint(const std::shared_ptr< WatchPoint > &watchPoint)
Definition: MSXCPUInterface.cc:844
BreakPoint.hh
openmsx::MSXCPUInterface::writeSlottedMem
void writeSlottedMem(unsigned address, byte value, EmuTime::param time)
Definition: MSXCPUInterface.cc:764
openmsx::GlobalWriteClient::~GlobalWriteClient
~GlobalWriteClient()
Definition: MSXCPUInterface.hh:492
CacheLine.hh
openmsx::CT_Interval
Definition: MSXCPUInterface.hh:447
openmsx::operator<<
std::ostream & operator<<(std::ostream &os, EnumTypeName< CacheLineCounters >)
Definition: MSXCPUInterface.cc:51
openmsx::MSXCPUInterface::fillWCache
void fillWCache(unsigned start, unsigned size, byte *wData, int ps, int ss)
Definition: MSXCPUInterface.cc:641
openmsx::MSXCPUInterface::reset
void reset()
Reset (the slot state)
Definition: MSXCPUInterface.cc:647
openmsx::MSXCPUInterface::register_IO_In
void register_IO_In(byte port, MSXDevice *device)
Devices can register their In ports.
Definition: MSXCPUInterface.cc:337
openmsx::GlobalReadClient::GlobalReadClient
GlobalReadClient()
Definition: MSXCPUInterface.hh:503
SimpleDebuggable.hh
openmsx::MSXCPUInterface::changeExpanded
void changeExpanded(bool newExpanded)
Definition: MSXCPUInterface.cc:312
openmsx::DebugCondition
General debugger condition Like breakpoints, but not tied to a specifc address.
Definition: DebugCondition.hh:12
openmsx::MSXCPUInterface::unregister_IO_In
void unregister_IO_In(byte port, MSXDevice *device)
Definition: MSXCPUInterface.cc:343
openmsx::DummyDevice
Definition: DummyDevice.hh:9
openmsx::MSXCPUInterface::doBreak
void doBreak()
Definition: MSXCPUInterface.cc:998
openmsx::x
constexpr KeyMatrixPosition x
Keyboard bindings.
Definition: Keyboard.cc:1414
openmsx::MSXCPUInterface::getDummyDevice
DummyDevice & getDummyDevice()
Definition: MSXCPUInterface.hh:251
openmsx::MSXCPUInterface::fillRWCache
void fillRWCache(unsigned start, unsigned size, const byte *rData, byte *wData, int ps, int ss)
Definition: MSXCPUInterface.cc:631
openmsx::MSXDevice::readIO
virtual byte readIO(word port, EmuTime::param time)
Read a byte from an IO port at a certain time from this device.
Definition: MSXDevice.cc:409
ProfileCounters< PROFILE_CACHELINES, CacheLineCounters >::tick
void tick(CacheLineCounters e) const
Definition: ProfileCounters.hh:98
openmsx::MSXCPUInterface::anyBreakPoints
static bool anyBreakPoints()
Definition: MSXCPUInterface.hh:275
ProfileCounters
Definition: ProfileCounters.hh:87
openmsx::CacheLine::BITS
constexpr unsigned BITS
Definition: CacheLine.hh:6
openmsx::MSXCPUInterface::removeWatchPoint
void removeWatchPoint(std::shared_ptr< WatchPoint > watchPoint)
Definition: MSXCPUInterface.cc:884
openmsx::MSXCPUInterface::getReadCacheLine
const byte * getReadCacheLine(word start) const
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for reading.
Definition: MSXCPUInterface.hh:185
openmsx::CompareBreakpoints::operator()
bool operator()(const BreakPoint &x, word y) const
Definition: MSXCPUInterface.hh:33
openmsx::MSXCPUInterface::getWriteCacheLine
byte * getWriteCacheLine(word start) const
Test that the memory in the interval [start, start + CacheLine::SIZE) is cacheable for writing.
Definition: MSXCPUInterface.hh:205
openmsx::GlobalReadClient
Definition: MSXCPUInterface.hh:502
openmsx::word
uint16_t word
16 bit unsigned integer
Definition: openmsx.hh:29
openmsx::MSXCPUInterface::serialize
void serialize(Archive &ar, unsigned version)
Definition: MSXCPUInterface.cc:1248
openmsx::MSXCPUInterface::readSlottedMem
byte readSlottedMem(unsigned address, EmuTime::param time)
Definition: MSXCPUInterface.cc:747
openmsx::MSXCPUInterface::unregisterGlobalRead
void unregisterGlobalRead(MSXDevice &device, word address)
Definition: MSXCPUInterface.cc:586
openmsx::MSXCPUInterface::unsetExpanded
void unsetExpanded(int ps)
Definition: MSXCPUInterface.cc:298
operator==
constexpr bool operator==(const uint128 &a, const uint128 &b)
Definition: uint128.hh:238
openmsx::MSXDevice
MSXDevice
Definition: MSXDevice.cc:539
InfoTopic.hh
openmsx::MSXCPUInterface::getWatchPoints
const WatchPoints & getWatchPoints() const
Definition: MSXCPUInterface.hh:262
openmsx::MSXCPUInterface::Conditions
std::vector< DebugCondition > Conditions
Definition: MSXCPUInterface.hh:266
openmsx::NUM
@ NUM
Definition: MSXCPUInterface.hh:58
openmsx::CompareBreakpoints::operator()
bool operator()(const BreakPoint &x, const BreakPoint &y) const
Definition: MSXCPUInterface.hh:30
openmsx::MSXCPUInterface::unregister_IO_Out
void unregister_IO_Out(byte port, MSXDevice *device)
Definition: MSXCPUInterface.cc:355
openmsx::MSXCPUInterface::invalidateRWCache
void invalidateRWCache(word start, unsigned size, int ps, int ss)
Definition: MSXCPUInterface.cc:615
openmsx::MSXCPUInterface::unregisterMemDevice
void unregisterMemDevice(MSXDevice &device, int ps, int ss, int base, int size)
Definition: MSXCPUInterface.cc:542
openmsx::MSXCPUInterface::setExpanded
void setExpanded(int ps)
Definition: MSXCPUInterface.cc:244
openmsx::MSXCPUInterface::unregisterGlobalWrite
void unregisterGlobalWrite(MSXDevice &device, word address)
Definition: MSXCPUInterface.cc:562
openmsx::GetReadCacheLine
@ GetReadCacheLine
Definition: MSXCPUInterface.hh:45
openmsx::MSXCPUInterface::replace_IO_Out
bool replace_IO_Out(byte port, MSXDevice *oldDevice, MSXDevice *newDevice)
Definition: MSXCPUInterface.cc:417
ranges::equal_range
auto equal_range(ForwardRange &&range, const T &value)
Definition: ranges.hh:95
openmsx
This file implemented 3 utility functions:
Definition: Autofire.cc:5
openmsx::MSXCPUInterface::fillRCache
void fillRCache(unsigned start, unsigned size, const byte *rData, int ps, int ss)
Definition: MSXCPUInterface.cc:636
openmsx::MSXCPUInterface::removeCondition
static void removeCondition(const DebugCondition &cond)
Definition: MSXCPUInterface.cc:916
openmsx::MSXCPUInterface::removeBreakPoint
static void removeBreakPoint(const BreakPoint &bp)
Definition: MSXCPUInterface.cc:788
ProfileCounters.hh
openmsx::MSXCPUInterface::peekMem
byte peekMem(word address, EmuTime::param time) const
Peek memory location.
Definition: MSXCPUInterface.cc:721
openmsx::SimpleDebuggable::read
byte read(unsigned address) override
Definition: SimpleDebuggable.cc:34
openmsx::MSXCPUInterface::BreakPoints
std::vector< BreakPoint > BreakPoints
Definition: MSXCPUInterface.hh:255
openmsx::DisallowCacheWrite
@ DisallowCacheWrite
Definition: MSXCPUInterface.hh:50
openmsx::InvalidateRead
@ InvalidateRead
Definition: MSXCPUInterface.hh:53
openmsx::foreach_ct_interval
void foreach_ct_interval(ACTION action, CT_INTERVAL interval)
Definition: MSXCPUInterface.hh:454
openmsx::MSXCPUInterface::doContinue
void doContinue()
Definition: MSXCPUInterface.cc:1021
openmsx::MSXCPUInterface::writeIO
void writeIO(word port, byte value, EmuTime::param time)
This writes a byte to the given IO-port.
Definition: MSXCPUInterface.hh:169
openmsx::FillWrite
@ FillWrite
Definition: MSXCPUInterface.hh:57