openMSX
Public Member Functions | Public Attributes | List of all members
openmsx::YM2413Okazaki::Slot Class Reference

#include <YM2413Okazaki.hh>

Collaboration diagram for openmsx::YM2413Okazaki::Slot:
Collaboration graph
[legend]

Public Member Functions

 Slot ()
 
void reset ()
 
void setEnvelopeState (EnvelopeState state)
 
bool isActive () const
 
void slotOn ()
 
void slotOn2 ()
 
void slotOff ()
 
void setPatch (const Patch &patch)
 
void setVolume (unsigned value)
 
unsigned calc_phase (unsigned lfo_pm)
 
template<bool HAS_AM, bool FIXED_ENV>
unsigned calc_envelope (int lfo_am, unsigned fixed_env)
 
template<bool HAS_AM>
unsigned calc_fixed_env () const
 
void calc_envelope_outline (unsigned &out)
 
template<bool HAS_AM, bool FIXED_ENV>
int calc_slot_car (unsigned lfo_pm, int lfo_am, int fm, unsigned fixed_env)
 
template<bool HAS_AM, bool HAS_FB, bool FIXED_ENV>
int calc_slot_mod (unsigned lfo_pm, int lfo_am, unsigned fixed_env)
 
int calc_slot_tom ()
 
int calc_slot_snare (bool noise)
 
int calc_slot_cym (unsigned phase7, unsigned phase8)
 
int calc_slot_hat (unsigned phase7, unsigned phase8, bool noise)
 
void updatePG (unsigned freq)
 
void updateTLL (unsigned freq, bool actAsCarrier)
 
void updateRKS (unsigned freq)
 
void updateEG ()
 
void updateAll (unsigned freq, bool actAsCarrier)
 
template<typename Archive >
void serialize (Archive &ar, unsigned version)
 
template<bool HAS_AM, bool FIXED_ENV>
ALWAYS_INLINE unsigned calc_envelope (int lfo_am, unsigned fixed_env)
 
template<bool HAS_AM, bool FIXED_ENV>
ALWAYS_INLINE int calc_slot_car (unsigned lfo_pm, int lfo_am, int fm, unsigned fixed_env)
 
template<bool HAS_AM, bool HAS_FB, bool FIXED_ENV>
ALWAYS_INLINE int calc_slot_mod (unsigned lfo_pm, int lfo_am, unsigned fixed_env)
 

Public Attributes

int feedback
 
int output
 
unsigned cPhase
 
std::array< unsigned, 8 > dPhase
 
unsigned volume
 
unsigned tll
 
std::span< const int, 16 > dPhaseDRTableRks
 
EnvelopeState state
 
EnvPhaseIndex eg_phase
 
EnvPhaseIndex eg_dPhase
 
EnvPhaseIndex eg_phase_max
 
uint8_t slot_on_flag
 
bool sustain
 
Patch patch
 
Slotsibling
 

Detailed Description

Definition at line 66 of file YM2413Okazaki.hh.

Constructor & Destructor Documentation

◆ Slot()

openmsx::YM2413Okazaki::Slot::Slot ( )

Definition at line 389 of file YM2413Okazaki.cc.

Member Function Documentation

◆ calc_envelope() [1/2]

template<bool HAS_AM, bool FIXED_ENV>
ALWAYS_INLINE unsigned openmsx::YM2413Okazaki::Slot::calc_envelope ( int  lfo_am,
unsigned  fixed_env 
)

◆ calc_envelope() [2/2]

template<bool HAS_AM, bool FIXED_ENV>
unsigned openmsx::YM2413Okazaki::Slot::calc_envelope ( int  lfo_am,
unsigned  fixed_env 
)
inline

◆ calc_envelope_outline()

void openmsx::YM2413Okazaki::Slot::calc_envelope_outline ( unsigned &  out)

◆ calc_fixed_env()

template<bool HAS_AM>
unsigned openmsx::YM2413Okazaki::Slot::calc_fixed_env

◆ calc_phase()

ALWAYS_INLINE unsigned openmsx::YM2413Okazaki::Slot::calc_phase ( unsigned  lfo_pm)
inline

◆ calc_slot_car() [1/2]

template<bool HAS_AM, bool FIXED_ENV>
ALWAYS_INLINE int openmsx::YM2413Okazaki::Slot::calc_slot_car ( unsigned  lfo_pm,
int  lfo_am,
int  fm,
unsigned  fixed_env 
)

◆ calc_slot_car() [2/2]

template<bool HAS_AM, bool FIXED_ENV>
int openmsx::YM2413Okazaki::Slot::calc_slot_car ( unsigned  lfo_pm,
int  lfo_am,
int  fm,
unsigned  fixed_env 
)
inline

◆ calc_slot_cym()

ALWAYS_INLINE int openmsx::YM2413Okazaki::Slot::calc_slot_cym ( unsigned  phase7,
unsigned  phase8 
)
inline

◆ calc_slot_hat()

ALWAYS_INLINE int openmsx::YM2413Okazaki::Slot::calc_slot_hat ( unsigned  phase7,
unsigned  phase8,
bool  noise 
)
inline

◆ calc_slot_mod() [1/2]

template<bool HAS_AM, bool HAS_FB, bool FIXED_ENV>
ALWAYS_INLINE int openmsx::YM2413Okazaki::Slot::calc_slot_mod ( unsigned  lfo_pm,
int  lfo_am,
unsigned  fixed_env 
)

◆ calc_slot_mod() [2/2]

template<bool HAS_AM, bool HAS_FB, bool FIXED_ENV>
int openmsx::YM2413Okazaki::Slot::calc_slot_mod ( unsigned  lfo_pm,
int  lfo_am,
unsigned  fixed_env 
)
inline

◆ calc_slot_snare()

ALWAYS_INLINE int openmsx::YM2413Okazaki::Slot::calc_slot_snare ( bool  noise)
inline

Definition at line 1010 of file YM2413Okazaki.cc.

References calc_phase().

Referenced by openmsx::YM2413Okazaki::YM2413::generateChannels().

◆ calc_slot_tom()

ALWAYS_INLINE int openmsx::YM2413Okazaki::Slot::calc_slot_tom ( )
inline

◆ isActive()

bool openmsx::YM2413Okazaki::Slot::isActive ( ) const
inline

◆ reset()

void openmsx::YM2413Okazaki::Slot::reset ( )

◆ serialize()

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

Definition at line 1608 of file YM2413Okazaki.cc.

References cPhase, eg_phase, feedback, output, state, and sustain.

◆ setEnvelopeState()

void openmsx::YM2413Okazaki::Slot::setEnvelopeState ( EnvelopeState  state)
inline

◆ setPatch()

void openmsx::YM2413Okazaki::Slot::setPatch ( const Patch patch)
inline

◆ setVolume()

void openmsx::YM2413Okazaki::Slot::setVolume ( unsigned  value)
inline

Definition at line 564 of file YM2413Okazaki.cc.

References volume.

◆ slotOff()

void openmsx::YM2413Okazaki::Slot::slotOff ( )
inline

◆ slotOn()

void openmsx::YM2413Okazaki::Slot::slotOn ( )
inline

Definition at line 528 of file YM2413Okazaki.cc.

References openmsx::YM2413Okazaki::ATTACK, cPhase, eg_phase, and setEnvelopeState().

Referenced by calc_envelope_outline().

◆ slotOn2()

void openmsx::YM2413Okazaki::Slot::slotOn2 ( )
inline

Definition at line 536 of file YM2413Okazaki.cc.

References openmsx::YM2413Okazaki::ATTACK, eg_phase, and setEnvelopeState().

◆ updateAll()

void openmsx::YM2413Okazaki::Slot::updateAll ( unsigned  freq,
bool  actAsCarrier 
)
inline

Definition at line 488 of file YM2413Okazaki.cc.

References updateEG(), updatePG(), updateRKS(), and updateTLL().

◆ updateEG()

void openmsx::YM2413Okazaki::Slot::updateEG ( )
inline

◆ updatePG()

void openmsx::YM2413Okazaki::Slot::updatePG ( unsigned  freq)
inline

Definition at line 408 of file YM2413Okazaki.cc.

References dPhase, enumerate(), openmsx::YM2413Okazaki::Patch::ML, and patch.

Referenced by updateAll().

◆ updateRKS()

void openmsx::YM2413Okazaki::Slot::updateRKS ( unsigned  freq)
inline

Definition at line 429 of file YM2413Okazaki.cc.

References dPhaseDRTableRks, openmsx::YM2413Okazaki::Patch::KR, and patch.

Referenced by updateAll().

◆ updateTLL()

void openmsx::YM2413Okazaki::Slot::updateTLL ( unsigned  freq,
bool  actAsCarrier 
)
inline

Member Data Documentation

◆ cPhase

unsigned openmsx::YM2413Okazaki::Slot::cPhase

◆ dPhase

std::array<unsigned, 8> openmsx::YM2413Okazaki::Slot::dPhase

Definition at line 109 of file YM2413Okazaki.hh.

Referenced by calc_phase(), reset(), and updatePG().

◆ dPhaseDRTableRks

std::span<const int, 16> openmsx::YM2413Okazaki::Slot::dPhaseDRTableRks

Definition at line 114 of file YM2413Okazaki.hh.

Referenced by reset(), updateEG(), and updateRKS().

◆ eg_dPhase

EnvPhaseIndex openmsx::YM2413Okazaki::Slot::eg_dPhase

Definition at line 117 of file YM2413Okazaki.hh.

Referenced by calc_envelope(), calc_fixed_env(), and updateEG().

◆ eg_phase

EnvPhaseIndex openmsx::YM2413Okazaki::Slot::eg_phase

◆ eg_phase_max

EnvPhaseIndex openmsx::YM2413Okazaki::Slot::eg_phase_max

Definition at line 118 of file YM2413Okazaki.hh.

Referenced by calc_envelope(), calc_envelope_outline(), and setEnvelopeState().

◆ feedback

int openmsx::YM2413Okazaki::Slot::feedback

Definition at line 104 of file YM2413Okazaki.hh.

Referenced by calc_slot_mod(), reset(), and serialize().

◆ output

int openmsx::YM2413Okazaki::Slot::output

Definition at line 105 of file YM2413Okazaki.hh.

Referenced by calc_slot_car(), calc_slot_mod(), reset(), and serialize().

◆ patch

Patch openmsx::YM2413Okazaki::Slot::patch

◆ sibling

Slot* openmsx::YM2413Okazaki::Slot::sibling

◆ slot_on_flag

uint8_t openmsx::YM2413Okazaki::Slot::slot_on_flag

◆ state

EnvelopeState openmsx::YM2413Okazaki::Slot::state

◆ sustain

bool openmsx::YM2413Okazaki::Slot::sustain

◆ tll

unsigned openmsx::YM2413Okazaki::Slot::tll

Definition at line 113 of file YM2413Okazaki.hh.

Referenced by calc_envelope(), calc_fixed_env(), reset(), and updateTLL().

◆ volume

unsigned openmsx::YM2413Okazaki::Slot::volume

Definition at line 112 of file YM2413Okazaki.hh.

Referenced by reset(), setVolume(), and updateTLL().


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