openMSX
Autofire.hh
Go to the documentation of this file.
1 #ifndef AUTOFIRE_HH
2 #define AUTOFIRE_HH
3 
4 #include "Observer.hh"
5 #include "DynamicClock.hh"
6 #include "EmuTime.hh"
7 #include "IntegerSetting.hh"
8 #include "string_view.hh"
9 
10 namespace openmsx {
11 
12 class CommandController;
13 
22 class Autofire final : private Observer<Setting>
23 {
24 public:
25  Autofire(CommandController& commandController,
26  unsigned newMinInts, unsigned newMaxInts,
27  string_view name);
28  ~Autofire();
29 
34  bool getSignal(EmuTime::param time);
35 
36 private:
40  void setClock();
41 
42  void update(const Setting& setting) override;
43 
44  // Following two values specify the range of the autofire
45  // as measured by the test program:
50  const unsigned min_ints;
55  const unsigned max_ints;
56 
58  IntegerSetting speedSetting;
59 
63  DynamicClock clock;
64 };
65 
66 } // namespace openmsx
67 
68 #endif
Autofire is a device that is between two other devices and outside the bus.
Definition: Autofire.hh:22
Autofire(CommandController &commandController, unsigned newMinInts, unsigned newMaxInts, string_view name)
Definition: Autofire.cc:7
A Setting with an integer value.
Represents a clock with a variable frequency.
Definition: DynamicClock.hh:15
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
bool getSignal(EmuTime::param time)
Get the output signal in negative logic.
Definition: Autofire.cc:38
This class implements a (close approximation) of the std::string_view class.
Definition: string_view.hh:16
Generic Gang-of-Four Observer class, templatized edition.
Definition: Observer.hh:9