OXYGENHUB
◆ main openmsx / src / sound / KeyClick.cc
504 B · C++ · last changed chore(): initial commit 1 month ago source blame history raw
e8555c89 Andy McCall 1
#include "KeyClick.hh"
2
3
namespace openmsx {
4
5
KeyClick::KeyClick(const DeviceConfig& config)
6
	: dac("keyclick", "1-bit click generator", config)
7
{
8
}
9
10
void KeyClick::reset(EmuTime time)
11
{
12
	setClick(false, time);
13
}
14
15
void KeyClick::setClick(bool newStatus, EmuTime time)
16
{
17
	if (newStatus != status) {
18
		status = newStatus;
19
		dac.writeDAC((status ? 0xff : 0x80), time);
20
	}
21
}
22
23
// We don't need a serialize() method, instead the setClick() method
24
// gets called during de-serialization.
25
26
} // namespace openmsx