openMSX
|
#include <Y8950.hh>
Public Types | |
enum | EnvelopeState { ATTACK , DECAY , SUSTAIN , RELEASE , FINISH } |
using | EnvPhaseIndex = FixedPoint< EG_DP_BITS - EG_BITS > |
Public Member Functions | |
Y8950 (const std::string &name, const DeviceConfig &config, unsigned sampleRam, EmuTime::param time, MSXAudio &audio) | |
~Y8950 () | |
void | setEnabled (bool enabled, EmuTime::param time) |
void | clearRam () |
void | reset (EmuTime::param time) |
void | writeReg (uint8_t rg, uint8_t data, EmuTime::param time) |
uint8_t | readReg (uint8_t rg, EmuTime::param time) |
uint8_t | peekReg (uint8_t rg, EmuTime::param time) const |
uint8_t | readStatus (EmuTime::param time) const |
uint8_t | peekStatus (EmuTime::param time) const |
void | setStatus (uint8_t flags) |
void | resetStatus (uint8_t flags) |
uint8_t | peekRawStatus () const |
template<typename Archive > | |
void | serialize (Archive &ar, unsigned version) |
Static Public Attributes | |
static constexpr int | CLOCK_FREQ = 3579545 |
static constexpr int | CLOCK_FREQ_DIV = 72 |
static constexpr int | R04_ST1 = 0x01 |
static constexpr int | R04_ST2 = 0x02 |
static constexpr int | R04_MASK_BUF_RDY = 0x08 |
static constexpr int | R04_MASK_EOS = 0x10 |
static constexpr int | R04_MASK_T2 = 0x20 |
static constexpr int | R04_MASK_T1 = 0x40 |
static constexpr int | R04_IRQ_RESET = 0x80 |
static constexpr int | STATUS_PCM_BSY = 0x01 |
static constexpr int | STATUS_EOS = R04_MASK_EOS |
static constexpr int | STATUS_BUF_RDY = R04_MASK_BUF_RDY |
static constexpr int | STATUS_T2 = R04_MASK_T2 |
static constexpr int | STATUS_T1 = R04_MASK_T1 |
static constexpr int | EG_BITS = 9 |
static constexpr int | EG_DP_BITS = 23 |
using openmsx::Y8950::EnvPhaseIndex = FixedPoint<EG_DP_BITS - EG_BITS> |
openmsx::Y8950::Y8950 | ( | const std::string & | name, |
const DeviceConfig & | config, | ||
unsigned | sampleRam, | ||
EmuTime::param | time, | ||
MSXAudio & | audio | ||
) |
openmsx::Y8950::~Y8950 | ( | ) |
Definition at line 546 of file Y8950.cc.
References openmsx::SoundDevice::unregisterSound().
void openmsx::Y8950::clearRam | ( | ) |
Definition at line 551 of file Y8950.cc.
References openmsx::Y8950Adpcm::clearRam().
Referenced by openmsx::MSXAudio::powerUp().
uint8_t openmsx::Y8950::peekReg | ( | uint8_t | rg, |
EmuTime::param | time | ||
) | const |
Definition at line 1161 of file Y8950.cc.
References openmsx::Y8950KeyboardConnector::peek(), openmsx::Y8950Adpcm::peekReg(), and openmsx::Y8950Periphery::read().
Referenced by openmsx::MSXAudio::peekIO(), and readReg().
uint8_t openmsx::Y8950::peekStatus | ( | EmuTime::param | time | ) | const |
Definition at line 1191 of file Y8950.cc.
Referenced by openmsx::MSXAudio::peekIO(), and readStatus().
uint8_t openmsx::Y8950::readReg | ( | uint8_t | rg, |
EmuTime::param | time | ||
) |
Definition at line 1146 of file Y8950.cc.
References peekReg(), openmsx::Y8950Adpcm::readReg(), and openmsx::SoundDevice::updateStream().
Referenced by openmsx::MSXAudio::readIO().
uint8_t openmsx::Y8950::readStatus | ( | EmuTime::param | time | ) | const |
Definition at line 1184 of file Y8950.cc.
References peekStatus().
Referenced by openmsx::MSXAudio::readIO().
void openmsx::Y8950::reset | ( | EmuTime::param | time | ) |
Definition at line 557 of file Y8950.cc.
References ranges::fill(), openmsx::IntHelper< SOURCE >::reset(), openmsx::Y8950Adpcm::reset(), and openmsx::SoundDevice::updateStream().
Referenced by openmsx::MSXAudio::reset().
void openmsx::Y8950::resetStatus | ( | uint8_t | flags | ) |
Definition at line 1210 of file Y8950.cc.
References openmsx::IntHelper< SOURCE >::reset().
Referenced by openmsx::Y8950Adpcm::writeReg(), and writeReg().
void openmsx::Y8950::serialize | ( | Archive & | ar, |
unsigned | version | ||
) |
Definition at line 1312 of file Y8950.cc.
References openmsx::MSXMotherBoard::getCurrentTime(), and writeReg().
void openmsx::Y8950::setEnabled | ( | bool | enabled, |
EmuTime::param | time | ||
) |
Definition at line 780 of file Y8950.cc.
References openmsx::SoundDevice::updateStream().
Referenced by openmsx::ToshibaAudioPeriphery::setSPOFF(), openmsx::MusicModulePeriphery::write(), and openmsx::PanasonicAudioPeriphery::write().
void openmsx::Y8950::setStatus | ( | uint8_t | flags | ) |
Definition at line 1202 of file Y8950.cc.
References openmsx::IntHelper< SOURCE >::set().
Referenced by openmsx::Y8950Adpcm::reset(), openmsx::Y8950Adpcm::resetStatus(), and openmsx::Y8950Adpcm::writeReg().
void openmsx::Y8950::writeReg | ( | uint8_t | rg, |
uint8_t | data, | ||
EmuTime::param | time | ||
) |
Definition at line 903 of file Y8950.cc.
References Math::clipToInt16(), R04_IRQ_RESET, R04_ST1, R04_ST2, openmsx::Y8950Adpcm::resetStatus(), resetStatus(), openmsx::Y8950Periphery::setSPOFF(), openmsx::SoundDevice::updateStream(), openmsx::Y8950KeyboardConnector::write(), openmsx::Y8950Periphery::write(), openmsx::DACSound16S::writeDAC(), and openmsx::Y8950Adpcm::writeReg().
Referenced by serialize(), and openmsx::MSXAudio::writeIO().
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
Definition at line 47 of file Y8950.hh.
Referenced by writeReg().
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
Definition at line 33 of file Y8950.hh.
Referenced by writeReg().
|
staticconstexpr |
Definition at line 35 of file Y8950.hh.
Referenced by writeReg().
|
staticconstexpr |
Definition at line 52 of file Y8950.hh.
Referenced by openmsx::Y8950Adpcm::reset(), openmsx::Y8950Adpcm::resetStatus(), and openmsx::Y8950Adpcm::writeReg().
|
staticconstexpr |
|
staticconstexpr |
Definition at line 50 of file Y8950.hh.
Referenced by openmsx::Y8950Adpcm::writeReg().
|
staticconstexpr |
|
staticconstexpr |