openMSX
|
#include <Y8950.hh>
Public Types | |
enum class | 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> |
|
strong |
openmsx::Y8950::Y8950 | ( | const std::string & | name, |
const DeviceConfig & | config, | ||
unsigned | sampleRam, | ||
EmuTime::param | time, | ||
MSXAudio & | audio | ||
) |
Definition at line 484 of file Y8950.cc.
References openmsx::SoundDevice::registerSound(), reset(), and xrange().
openmsx::Y8950::~Y8950 | ( | ) |
Definition at line 547 of file Y8950.cc.
References openmsx::SoundDevice::unregisterSound().
void openmsx::Y8950::clearRam | ( | ) |
Definition at line 552 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 1159 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 1187 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 1144 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 1182 of file Y8950.cc.
References peekStatus().
Referenced by openmsx::MSXAudio::readIO().
void openmsx::Y8950::reset | ( | EmuTime::param | time | ) |
Definition at line 558 of file Y8950.cc.
References ranges::fill(), openmsx::IntHelper< SOURCE >::reset(), openmsx::Y8950Adpcm::reset(), and openmsx::SoundDevice::updateStream().
Referenced by openmsx::MSXAudio::reset(), and Y8950().
void openmsx::Y8950::resetStatus | ( | uint8_t | flags | ) |
Definition at line 1206 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 1309 of file Y8950.cc.
References openmsx::MSXMotherBoard::getCurrentTime(), and writeReg().
void openmsx::Y8950::setEnabled | ( | bool | enabled, |
EmuTime::param | time | ||
) |
Definition at line 782 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 1198 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 905 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 49 of file Y8950.hh.
Referenced by writeReg().
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
Definition at line 35 of file Y8950.hh.
Referenced by writeReg().
|
staticconstexpr |
Definition at line 37 of file Y8950.hh.
Referenced by writeReg().
|
staticconstexpr |
Definition at line 54 of file Y8950.hh.
Referenced by openmsx::Y8950Adpcm::reset(), openmsx::Y8950Adpcm::resetStatus(), and openmsx::Y8950Adpcm::writeReg().
|
staticconstexpr |
|
staticconstexpr |
Definition at line 52 of file Y8950.hh.
Referenced by openmsx::Y8950Adpcm::writeReg().
|
staticconstexpr |
|
staticconstexpr |