openMSX
FinishFrameEvent.hh
Go to the documentation of this file.
1 #ifndef FINISHFRAMEEVENT_HH
2 #define FINISHFRAMEEVENT_HH
3 
4 #include "Event.hh"
5 #include "TclObject.hh"
6 #include "checked_cast.hh"
7 #include <tuple>
8 
9 namespace openmsx {
10 
22 class FinishFrameEvent final : public Event
23 {
24 public:
25  FinishFrameEvent(int thisSource_, int selectedSource_,
26  bool skipped_)
28  , thisSource(thisSource_), selectedSource(selectedSource_)
29  , skipped(skipped_)
30  {
31  }
32 
33  int getSource() const { return thisSource; }
34  int getSelectedSource() const { return selectedSource; }
35  bool isSkipped() const { return skipped; }
36  bool needRender() const { return !skipped && (thisSource == selectedSource); }
37 
38  void toStringImpl(TclObject& result) const override
39  {
40  result.addListElement("finishframe");
41  result.addListElement(int(thisSource));
42  result.addListElement(int(selectedSource));
43  result.addListElement(skipped);
44  }
45  bool lessImpl(const Event& other) const override
46  {
47  auto& e = checked_cast<const FinishFrameEvent&>(other);
48  auto t1 = std::make_tuple(
50  auto t2 = std::make_tuple(
51  e.getSource(), e.getSelectedSource(), e.isSkipped());
52  return t1 < t2;
53  }
54 
55 private:
56  const int thisSource;
57  const int selectedSource;
58  const bool skipped;
59 };
60 
61 } // namespace openmsx
62 
63 #endif
bool lessImpl(const Event &other) const override
FinishFrameEvent(int thisSource_, int selectedSource_, bool skipped_)
Sent when VDP (V99x8 or V9990) reaches the end of a frame.
Definition: Event.hh:30
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
void addListElement(T t)
Definition: TclObject.hh:107
void toStringImpl(TclObject &result) const override
This event is send when a device (v99x8, v9990, video9000, laserdisc) reaches the end of a frame...