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