openMSX
sound
KeyClick.cc
Go to the documentation of this file.
1
#include "
KeyClick.hh
"
2
3
namespace
openmsx
{
4
5
KeyClick::KeyClick
(
const
DeviceConfig
& config)
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
openmsx::DeviceConfig
Definition:
DeviceConfig.hh:20
openmsx::KeyClick::setClick
void setClick(bool status, EmuTime::param time)
Definition:
KeyClick.cc:16
openmsx::KeyClick::reset
void reset(EmuTime::param time)
Definition:
KeyClick.cc:11
openmsx::KeyClick::KeyClick
KeyClick(const DeviceConfig &config)
Definition:
KeyClick.cc:5
openmsx::DACSound8U::writeDAC
void writeDAC(uint8_t value, EmuTime::param time)
Definition:
DACSound8U.cc:16
openmsx
This file implemented 3 utility functions:
Definition:
Autofire.cc:5
KeyClick.hh
Generated on Sun Jan 17 2021 23:13:27 for openMSX by
1.8.20