openMSX
RenShaTurbo.cc
Go to the documentation of this file.
1#include "RenShaTurbo.hh"
2#include "XMLElement.hh"
3#include "MSXException.hh"
4
5namespace openmsx {
6
8 const XMLElement& machineConfig)
9{
10 if (const auto* config = machineConfig.findChild("RenShaTurbo")) {
11 int min_ints = config->getChildDataAsInt("min_ints", 47);
12 int max_ints = config->getChildDataAsInt("max_ints", 221);
13 if ((min_ints < 1) || (min_ints > max_ints) || (max_ints > 6000)) {
14 throw MSXException(
15 "Error in RenShaTurbo speed settings: "
16 "1 <= min_ints <= max_ints <= 6000.");
17 }
18 autofire.emplace(motherBoard, min_ints, max_ints,
20 }
21}
22
23bool RenShaTurbo::getSignal(EmuTime::param time)
24{
25 return autofire ? autofire->getSignal(time) : false;
26}
27
28template<typename Archive>
29void RenShaTurbo::serialize(Archive& ar, unsigned /*version*/)
30{
31 if (autofire) ar.serialize("autofire", *autofire);
32}
34
35} // namespace openmsx
Ren-Sha Turbo is the autofire in several MSX 2+ models and in the MSX turbo R.
Definition: RenShaTurbo.hh:21
RenShaTurbo(MSXMotherBoard &motherBoard, const XMLElement &machineConfig)
Definition: RenShaTurbo.cc:7
void serialize(Archive &ar, unsigned version)
Definition: RenShaTurbo.cc:29
bool getSignal(EmuTime::param time)
Get the output signal in negative logic.
Definition: RenShaTurbo.cc:23
const XMLElement * findChild(std::string_view childName) const
Definition: XMLElement.cc:19
This file implemented 3 utility functions:
Definition: Autofire.cc:9
#define INSTANTIATE_SERIALIZE_METHODS(CLASS)
Definition: serialize.hh:1021