openMSX
Classes | Public Types | Public Member Functions | Static Public Attributes | List of all members
openmsx::Y8950 Class Referencefinal

#include <Y8950.hh>

Inheritance diagram for openmsx::Y8950:
Inheritance graph
[legend]
Collaboration diagram for openmsx::Y8950:
Collaboration graph
[legend]

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
 

Detailed Description

Definition at line 27 of file Y8950.hh.

Member Typedef Documentation

◆ EnvPhaseIndex

Definition at line 109 of file Y8950.hh.

Member Enumeration Documentation

◆ EnvelopeState

enum class openmsx::Y8950::EnvelopeState
strong
Enumerator
ATTACK 
DECAY 
SUSTAIN 
RELEASE 
FINISH 

Definition at line 111 of file Y8950.hh.

Constructor & Destructor Documentation

◆ Y8950()

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().

◆ ~Y8950()

openmsx::Y8950::~Y8950 ( )

Definition at line 547 of file Y8950.cc.

References openmsx::SoundDevice::unregisterSound().

Member Function Documentation

◆ clearRam()

void openmsx::Y8950::clearRam ( )

Definition at line 552 of file Y8950.cc.

References openmsx::Y8950Adpcm::clearRam().

Referenced by openmsx::MSXAudio::powerUp().

◆ peekRawStatus()

uint8_t openmsx::Y8950::peekRawStatus ( ) const

Definition at line 1214 of file Y8950.cc.

◆ peekReg()

uint8_t openmsx::Y8950::peekReg ( uint8_t  rg,
EmuTime::param  time 
) const

◆ peekStatus()

uint8_t openmsx::Y8950::peekStatus ( EmuTime::param  time) const

Definition at line 1187 of file Y8950.cc.

Referenced by openmsx::MSXAudio::peekIO(), and readStatus().

◆ readReg()

uint8_t openmsx::Y8950::readReg ( uint8_t  rg,
EmuTime::param  time 
)

◆ readStatus()

uint8_t openmsx::Y8950::readStatus ( EmuTime::param  time) const

Definition at line 1182 of file Y8950.cc.

References peekStatus().

Referenced by openmsx::MSXAudio::readIO().

◆ reset()

void openmsx::Y8950::reset ( EmuTime::param  time)

◆ resetStatus()

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().

◆ serialize()

template<typename Archive >
void openmsx::Y8950::serialize ( Archive &  ar,
unsigned  version 
)

Definition at line 1309 of file Y8950.cc.

References openmsx::MSXMotherBoard::getCurrentTime(), and writeReg().

◆ setEnabled()

void openmsx::Y8950::setEnabled ( bool  enabled,
EmuTime::param  time 
)

◆ setStatus()

void openmsx::Y8950::setStatus ( uint8_t  flags)

◆ writeReg()

void openmsx::Y8950::writeReg ( uint8_t  rg,
uint8_t  data,
EmuTime::param  time 
)

Member Data Documentation

◆ CLOCK_FREQ

constexpr int openmsx::Y8950::CLOCK_FREQ = 3579545
staticconstexpr

Definition at line 30 of file Y8950.hh.

◆ CLOCK_FREQ_DIV

constexpr int openmsx::Y8950::CLOCK_FREQ_DIV = 72
staticconstexpr

Definition at line 31 of file Y8950.hh.

◆ EG_BITS

constexpr int openmsx::Y8950::EG_BITS = 9
staticconstexpr

Definition at line 105 of file Y8950.hh.

◆ EG_DP_BITS

constexpr int openmsx::Y8950::EG_DP_BITS = 23
staticconstexpr

Definition at line 108 of file Y8950.hh.

◆ R04_IRQ_RESET

constexpr int openmsx::Y8950::R04_IRQ_RESET = 0x80
staticconstexpr

Definition at line 49 of file Y8950.hh.

Referenced by writeReg().

◆ R04_MASK_BUF_RDY

constexpr int openmsx::Y8950::R04_MASK_BUF_RDY = 0x08
staticconstexpr

Definition at line 41 of file Y8950.hh.

◆ R04_MASK_EOS

constexpr int openmsx::Y8950::R04_MASK_EOS = 0x10
staticconstexpr

Definition at line 43 of file Y8950.hh.

◆ R04_MASK_T1

constexpr int openmsx::Y8950::R04_MASK_T1 = 0x40
staticconstexpr

Definition at line 47 of file Y8950.hh.

◆ R04_MASK_T2

constexpr int openmsx::Y8950::R04_MASK_T2 = 0x20
staticconstexpr

Definition at line 45 of file Y8950.hh.

◆ R04_ST1

constexpr int openmsx::Y8950::R04_ST1 = 0x01
staticconstexpr

Definition at line 35 of file Y8950.hh.

Referenced by writeReg().

◆ R04_ST2

constexpr int openmsx::Y8950::R04_ST2 = 0x02
staticconstexpr

Definition at line 37 of file Y8950.hh.

Referenced by writeReg().

◆ STATUS_BUF_RDY

constexpr int openmsx::Y8950::STATUS_BUF_RDY = R04_MASK_BUF_RDY
staticconstexpr

◆ STATUS_EOS

constexpr int openmsx::Y8950::STATUS_EOS = R04_MASK_EOS
staticconstexpr

Definition at line 53 of file Y8950.hh.

◆ STATUS_PCM_BSY

constexpr int openmsx::Y8950::STATUS_PCM_BSY = 0x01
staticconstexpr

Definition at line 52 of file Y8950.hh.

Referenced by openmsx::Y8950Adpcm::writeReg().

◆ STATUS_T1

constexpr int openmsx::Y8950::STATUS_T1 = R04_MASK_T1
staticconstexpr

Definition at line 56 of file Y8950.hh.

◆ STATUS_T2

constexpr int openmsx::Y8950::STATUS_T2 = R04_MASK_T2
staticconstexpr

Definition at line 55 of file Y8950.hh.


The documentation for this class was generated from the following files: