openMSX
KeyClick.cc
Go to the documentation of this file.
1#include "KeyClick.hh"
2
3namespace openmsx {
4
6 : dac("keyclick", "1-bit click generator", config)
7 , status(false)
8{
9}
10
11void KeyClick::reset(EmuTime::param time)
12{
13 setClick(false, time);
14}
15
16void KeyClick::setClick(bool newStatus, EmuTime::param time)
17{
18 if (newStatus != status) {
19 status = newStatus;
20 dac.writeDAC((status ? 0xff : 0x80), time);
21 }
22}
23
24// We don't need a serialize() method, instead the setClick() method
25// gets called during de-serialization.
26
27} // namespace openmsx
void writeDAC(uint8_t value, EmuTime::param time)
Definition: DACSound8U.cc:16
void reset(EmuTime::param time)
Definition: KeyClick.cc:11
void setClick(bool status, EmuTime::param time)
Definition: KeyClick.cc:16
KeyClick(const DeviceConfig &config)
Definition: KeyClick.cc:5
This file implemented 3 utility functions:
Definition: Autofire.cc:9