OXYGENHUB
◆ main openmsx / src / RenShaTurbo.hh
903 B · C++ · last changed chore(): initial commit 1 month ago source blame history raw
1
#ifndef RENSHATURBO_HH
2
#define RENSHATURBO_HH
3
4
#include "Autofire.hh"
5
#include "EmuTime.hh"
6
#include <optional>
7
8
namespace openmsx {
9
10
class MSXMotherBoard;
11
class XMLElement;
12
13
/**
14
 * Ren-Sha Turbo is the autofire in several MSX 2+ models and in
15
 * the MSX turbo R. It works on space bar and on fire-button 1 of
16
 * both joystick ports
17
 *
18
 * It uses one autofire circuit.
19
 */
20
class RenShaTurbo
21
{
22
public:
23
	RenShaTurbo(MSXMotherBoard& motherBoard,
24
	            const XMLElement& machineConfig);
25
26
	/** Get the output signal in negative logic.
27
	  * @result When auto-fire is on, result will alternate between true
28
	  *         and false. When auto-fire if off result is false.
29
	  */
30
	[[nodiscard]] bool getSignal(EmuTime time);
31
32
	template<typename Archive>
33
	void serialize(Archive& ar, unsigned version);
34
35
private:
36
	// The Autofire circuit
37
	std::optional<Autofire> autofire;
38
};
39
40
} // namespace openmsx
41
42
#endif