openMSX
DACSound8U.cc
Go to the documentation of this file.
1#include "DACSound8U.hh"
2#include "DeviceConfig.hh"
3#include "MSXMotherBoard.hh"
4#include "narrow.hh"
5
6namespace openmsx {
7
8DACSound8U::DACSound8U(std::string_view name_, static_string_view desc,
9 const DeviceConfig& config)
10 : DACSound16S(name_, desc, config)
11{
12 // Apply 8->16 bit scaling as part of volume-multiplication (= for
13 // free) instead of on each writeDAC() invocation.
15}
16
17void DACSound8U::writeDAC(uint8_t value, EmuTime::param time)
18{
19 DACSound16S::writeDAC(narrow<int16_t>(narrow<int>(value) - 0x80), time);
20}
21
22} // namespace openmsx
void writeDAC(int16_t value, EmuTime::param time)
DACSound8U(std::string_view name, static_string_view desc, const DeviceConfig &config)
Definition DACSound8U.cc:8
void writeDAC(uint8_t value, EmuTime::param time)
Definition DACSound8U.cc:17
MSXMotherBoard & getMotherBoard() const
EmuTime::param getCurrentTime() const
Convenience method: This is the same as getScheduler().getCurrentTime().
void setSoftwareVolume(float volume, EmuTime::param time)
Change the 'software volume' of this sound device.
static_string_view
This file implemented 3 utility functions:
Definition Autofire.cc:11