openMSX
RenShaTurbo.cc
Go to the documentation of this file.
1 #include "RenShaTurbo.hh"
2 #include "XMLElement.hh"
3 #include "Autofire.hh"
4 #include "MSXException.hh"
5 #include "memory.hh"
6 
7 namespace openmsx {
8 
10  const XMLElement& machineConfig)
11 {
12  if (auto* config = machineConfig.findChild("RenShaTurbo")) {
13  int min_ints = config->getChildDataAsInt("min_ints", 47);
14  int max_ints = config->getChildDataAsInt("max_ints", 221);
15  if ((min_ints < 1) || (min_ints > max_ints) || (max_ints > 6000)) {
16  throw MSXException(
17  "Error in RenShaTurbo speed settings: "
18  "1 <= min_ints <= max_ints <= 6000.");
19  }
20  autofire = make_unique<Autofire>(
21  commandController, min_ints, max_ints, "renshaturbo");
22  }
23 }
24 
25 RenShaTurbo::~RenShaTurbo() = default;
26 
27 bool RenShaTurbo::getSignal(EmuTime::param time)
28 {
29  return autofire ? autofire->getSignal(time) : false;
30 }
31 
32 } // namespace openmsx
const XMLElement * findChild(string_ref name) const
Definition: XMLElement.cc:117
bool getSignal(EmuTime::param time)
Get the output signal in negative logic.
Definition: RenShaTurbo.cc:27
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
RenShaTurbo(CommandController &commandController, const XMLElement &machineConfig)
Definition: RenShaTurbo.cc:9