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>
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  std::string_view name);
28  ~Autofire();
29 
34  [[nodiscard]] bool getSignal(EmuTime::param time);
35 
36 private:
40  void setClock();
41 
42  void update(const Setting& setting) override;
43 
44 private:
45  // Following two values specify the range of the autofire
46  // as measured by the test program:
51  const unsigned min_ints;
56  const unsigned max_ints;
57 
59  IntegerSetting speedSetting;
60 
64  DynamicClock clock;
65 };
66 
67 } // namespace openmsx
68 
69 #endif
IntegerSetting.hh
openmsx::CommandController
Definition: CommandController.hh:18
openmsx::Autofire
Autofire is a device that is between two other devices and outside the bus.
Definition: Autofire.hh:23
openmsx::Setting
Definition: Setting.hh:120
openmsx::Autofire::getSignal
bool getSignal(EmuTime::param time)
Get the output signal in negative logic.
Definition: Autofire.cc:38
openmsx::DynamicClock
Represents a clock with a variable frequency.
Definition: DynamicClock.hh:17
Observer.hh
openmsx::Autofire::Autofire
Autofire(CommandController &commandController, unsigned newMinInts, unsigned newMaxInts, std::string_view name)
Definition: Autofire.cc:7
EmuTime.hh
openmsx::IntegerSetting
A Setting with an integer value.
Definition: IntegerSetting.hh:11
DynamicClock.hh
openmsx
This file implemented 3 utility functions:
Definition: Autofire.cc:5
openmsx::Observer
Generic Gang-of-Four Observer class, templatized edition.
Definition: Observer.hh:10
openmsx::Autofire::~Autofire
~Autofire()
Definition: Autofire.cc:19