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  TclObject toTclList() const override
39  {
40  return makeTclList("finishframe",
41  int(thisSource),
42  int(selectedSource),
43  skipped);
44  }
45  bool lessImpl(const Event& other) const override
46  {
47  auto& e = checked_cast<const FinishFrameEvent&>(other);
48  return std::tuple( getSource(), getSelectedSource(), isSkipped()) <
49  std::tuple(e.getSource(), e.getSelectedSource(), e.isSkipped());
50  }
51 
52 private:
53  const int thisSource;
54  const int selectedSource;
55  const bool skipped;
56 };
57 
58 } // namespace openmsx
59 
60 #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:37
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
TclObject makeTclList(Args &&... args)
Definition: TclObject.hh:280
TclObject toTclList() const override
Similar to toString(), but retains the structure of the event.
This event is send when a device (v99x8, v9990, video9000, laserdisc) reaches the end of a frame...