openMSX
KeyClick.cc
Go to the documentation of this file.
1 #include "KeyClick.hh"
2 
3 namespace openmsx {
4 
6  : dac("keyclick", "1-bit click generator", config)
7  , status(false)
8 {
9 }
10 
11 void KeyClick::reset(EmuTime::param time)
12 {
13  setClick(false, time);
14 }
15 
16 void 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 setClick(bool status, EmuTime::param time)
Definition: KeyClick.cc:16
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
KeyClick(const DeviceConfig &config)
Definition: KeyClick.cc:5
void reset(EmuTime::param time)
Definition: KeyClick.cc:11