| 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 |
|
| 24 |
|
| 25 |
|
| 26 |
} |