openMSX
Classes | Typedefs | Variables
openmsx::YM2413Burczynski Namespace Reference

Classes

class  Slot
 
class  Channel
 
class  YM2413
 

Typedefs

using FreqIndex = FixedPoint< 16 >
 16.16 fixed point type for frequency calculations. More...
 

Variables

constexpr int ENV_BITS = 10
 
constexpr double ENV_STEP = 128.0 / (1 << ENV_BITS)
 
constexpr int MAX_ATT_INDEX = (1 << (ENV_BITS - 2)) - 1
 
constexpr int MIN_ATT_INDEX = 0
 
constexpr int SIN_BITS = 10
 
constexpr int SIN_LEN = 1 << SIN_BITS
 
constexpr int SIN_MASK = SIN_LEN - 1
 
constexpr int TL_RES_LEN = 256
 
constexpr int ksl_tab [8 *16]
 
constexpr int sl_tab [16]
 
constexpr uint8_t eg_inc [15][8]
 
constexpr uint8_t eg_rate_select [16+64+16]
 
constexpr uint8_t eg_rate_shift [16+64+16]
 
constexpr uint8_t mul_tab [16]
 
constexpr int TL_TAB_LEN = 11 * 2 * TL_RES_LEN
 
constexpr auto tlTab
 
constexpr auto sinTab
 
constexpr int LFO_AM_TAB_ELEMENTS = 210
 
constexpr uint8_t lfo_am_table [LFO_AM_TAB_ELEMENTS]
 
constexpr signed char lfo_pm_table [8][8]
 
constexpr uint8_t table [16+3][8]
 

Typedef Documentation

◆ FreqIndex

16.16 fixed point type for frequency calculations.

Definition at line 15 of file YM2413Burczynski.hh.

Variable Documentation

◆ eg_inc

constexpr uint8_t openmsx::YM2413Burczynski::eg_inc[15][8]
constexpr
Initial value:
=
{
{ 0,1, 0,1, 0,1, 0,1, },
{ 0,1, 0,1, 1,1, 0,1, },
{ 0,1, 1,1, 0,1, 1,1, },
{ 0,1, 1,1, 1,1, 1,1, },
{ 1,1, 1,1, 1,1, 1,1, },
{ 1,1, 1,2, 1,1, 1,2, },
{ 1,2, 1,2, 1,2, 1,2, },
{ 1,2, 2,2, 1,2, 2,2, },
{ 2,2, 2,2, 2,2, 2,2, },
{ 2,2, 2,4, 2,2, 2,4, },
{ 2,4, 2,4, 2,4, 2,4, },
{ 2,4, 4,4, 2,4, 4,4, },
{ 4,4, 4,4, 4,4, 4,4, },
{ 8,8, 8,8, 8,8, 8,8, },
{ 0,0, 0,0, 0,0, 0,0, },
}

Definition at line 106 of file YM2413Burczynski.cc.

Referenced by openmsx::YM2413Burczynski::Slot::Slot(), and openmsx::YM2413Burczynski::Slot::updateGenerators().

◆ eg_rate_select

constexpr uint8_t openmsx::YM2413Burczynski::eg_rate_select[16+64+16]
constexpr

◆ eg_rate_shift

constexpr uint8_t openmsx::YM2413Burczynski::eg_rate_shift[16+64+16]
constexpr

◆ ENV_BITS

constexpr int openmsx::YM2413Burczynski::ENV_BITS = 10
constexpr

Definition at line 36 of file YM2413Burczynski.cc.

Referenced by openmsx::YM2413Burczynski::Slot::setTotalLevel().

◆ ENV_STEP

constexpr double openmsx::YM2413Burczynski::ENV_STEP = 128.0 / (1 << ENV_BITS)
constexpr

Definition at line 37 of file YM2413Burczynski.cc.

◆ ksl_tab

constexpr int openmsx::YM2413Burczynski::ksl_tab[8 *16]
constexpr

◆ LFO_AM_TAB_ELEMENTS

constexpr int openmsx::YM2413Burczynski::LFO_AM_TAB_ELEMENTS = 210
constexpr

◆ lfo_am_table

constexpr uint8_t openmsx::YM2413Burczynski::lfo_am_table[LFO_AM_TAB_ELEMENTS]
constexpr

◆ lfo_pm_table

constexpr signed char openmsx::YM2413Burczynski::lfo_pm_table[8][8]
constexpr
Initial value:
=
{
{ 0, 0, 0, 0, 0, 0, 0, 0, },
{ 1, 0, 0, 0,-1, 0, 0, 0, },
{ 2, 1, 0,-1,-2,-1, 0, 1, },
{ 3, 1, 0,-1,-3,-1, 0, 1, },
{ 4, 2, 0,-2,-4,-2, 0, 2, },
{ 5, 2, 0,-2,-5,-2, 0, 2, },
{ 6, 3, 0,-3,-6,-3, 0, 3, },
{ 7, 3, 0,-3,-7,-3, 0, 3, },
}

Definition at line 333 of file YM2413Burczynski.cc.

Referenced by openmsx::YM2413Burczynski::Slot::calc_phase().

◆ MAX_ATT_INDEX

constexpr int openmsx::YM2413Burczynski::MAX_ATT_INDEX = (1 << (ENV_BITS - 2)) - 1
constexpr

◆ MIN_ATT_INDEX

constexpr int openmsx::YM2413Burczynski::MIN_ATT_INDEX = 0
constexpr

Definition at line 40 of file YM2413Burczynski.cc.

Referenced by openmsx::YM2413Burczynski::Slot::calc_envelope().

◆ mul_tab

constexpr uint8_t openmsx::YM2413Burczynski::mul_tab[16]
constexpr
Initial value:
=
{
ML( 0.50), ML( 1.00), ML( 2.00), ML( 3.00),
ML( 4.00), ML( 5.00), ML( 6.00), ML( 7.00),
ML( 8.00), ML( 9.00), ML(10.00), ML(10.00),
ML(12.00), ML(12.00), ML(15.00), ML(15.00),
}

Definition at line 205 of file YM2413Burczynski.cc.

Referenced by openmsx::YM2413Burczynski::Slot::setFrequencyMultiplier().

◆ SIN_BITS

constexpr int openmsx::YM2413Burczynski::SIN_BITS = 10
constexpr

Definition at line 43 of file YM2413Burczynski.cc.

◆ SIN_LEN

constexpr int openmsx::YM2413Burczynski::SIN_LEN = 1 << SIN_BITS
constexpr

◆ SIN_MASK

constexpr int openmsx::YM2413Burczynski::SIN_MASK = SIN_LEN - 1
constexpr

Definition at line 45 of file YM2413Burczynski.cc.

Referenced by openmsx::YM2413Burczynski::Slot::calcOutput().

◆ sinTab

constexpr auto openmsx::YM2413Burczynski::sinTab
constexpr
Initial value:
= [] {
std::array<unsigned, SIN_LEN * 2> result = {};
for (auto i : xrange(SIN_LEN / 4)) {
double m = cstd::sin<2>(((i * 2) + 1) * M_PI / SIN_LEN);
int n = int(cstd::round(cstd::log2<8, 3>(m) * -256.0));
result[i] = 2 * n;
}
for (auto i : xrange(SIN_LEN / 4)) {
result[SIN_LEN / 4 + i] = result[SIN_LEN / 4 - 1 - i];
}
for (auto i : xrange(SIN_LEN / 2)) {
result[SIN_LEN / 2 + i] = result[i] | 1;
}
for (auto i : xrange(SIN_LEN / 2)) {
result[i + SIN_LEN] = result[i];
}
for (auto i : xrange(SIN_LEN / 2)) {
result[i + SIN_LEN + SIN_LEN / 2] = TL_TAB_LEN;
}
return result;
}()
#define M_PI
Definition: Math.hh:27
constexpr double round(double x)
Definition: cstd.hh:355
constexpr auto xrange(T e)
Definition: xrange.hh:155

Definition at line 239 of file YM2413Burczynski.cc.

Referenced by openmsx::YM2413Burczynski::Slot::resetOperators(), openmsx::YM2413Burczynski::Slot::serialize(), openmsx::YM2413Burczynski::Slot::setWaveform(), openmsx::YM2413Burczynski::Slot::Slot(), and openmsx::YM2413Burczynski::YM2413::YM2413().

◆ sl_tab

constexpr int openmsx::YM2413Burczynski::sl_tab[16]
constexpr
Initial value:
= {
SC( 0),SC( 1),SC( 2),SC(3 ),SC(4 ),SC(5 ),SC(6 ),SC( 7),
SC( 8),SC( 9),SC(10),SC(11),SC(12),SC(13),SC(14),SC(15)
}

Definition at line 101 of file YM2413Burczynski.cc.

Referenced by openmsx::YM2413Burczynski::Slot::setSustainLevel().

◆ table

constexpr uint8_t openmsx::YM2413Burczynski::table[16+3][8]
constexpr
Initial value:
= {
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
{ 0x61, 0x61, 0x1e, 0x17, 0xf0, 0x7f, 0x00, 0x17 },
{ 0x13, 0x41, 0x16, 0x0e, 0xfd, 0xf4, 0x23, 0x23 },
{ 0x03, 0x01, 0x9a, 0x04, 0xf3, 0xf3, 0x13, 0xf3 },
{ 0x11, 0x61, 0x0e, 0x07, 0xfa, 0x64, 0x70, 0x17 },
{ 0x22, 0x21, 0x1e, 0x06, 0xf0, 0x76, 0x00, 0x28 },
{ 0x21, 0x22, 0x16, 0x05, 0xf0, 0x71, 0x00, 0x18 },
{ 0x21, 0x61, 0x1d, 0x07, 0x82, 0x80, 0x17, 0x17 },
{ 0x23, 0x21, 0x2d, 0x16, 0x90, 0x90, 0x00, 0x07 },
{ 0x21, 0x21, 0x1b, 0x06, 0x64, 0x65, 0x10, 0x17 },
{ 0x21, 0x21, 0x0b, 0x1a, 0x85, 0xa0, 0x70, 0x07 },
{ 0x23, 0x01, 0x83, 0x10, 0xff, 0xb4, 0x10, 0xf4 },
{ 0x97, 0xc1, 0x20, 0x07, 0xff, 0xf4, 0x22, 0x22 },
{ 0x61, 0x00, 0x0c, 0x05, 0xc2, 0xf6, 0x40, 0x44 },
{ 0x01, 0x01, 0x56, 0x03, 0x94, 0xc2, 0x03, 0x12 },
{ 0x21, 0x01, 0x89, 0x03, 0xf1, 0xe4, 0xf0, 0x23 },
{ 0x01, 0x01, 0x16, 0x00, 0xfd, 0xf8, 0x2f, 0x6d },
{ 0x01, 0x01, 0x00, 0x00, 0xd8, 0xd8, 0xf9, 0xf8 },
{ 0x05, 0x01, 0x00, 0x00, 0xf8, 0xba, 0x49, 0x55 },
}

Definition at line 365 of file YM2413Burczynski.cc.

Referenced by openmsx::YM2413Burczynski::YM2413::reset().

◆ TL_RES_LEN

constexpr int openmsx::YM2413Burczynski::TL_RES_LEN = 256
constexpr

Definition at line 47 of file YM2413Burczynski.cc.

◆ TL_TAB_LEN

constexpr int openmsx::YM2413Burczynski::TL_TAB_LEN = 11 * 2 * TL_RES_LEN
constexpr

Definition at line 217 of file YM2413Burczynski.cc.

Referenced by openmsx::YM2413Burczynski::Slot::calcOutput().

◆ tlTab

constexpr auto openmsx::YM2413Burczynski::tlTab
constexpr
Initial value:
= [] {
std::array<int, TL_TAB_LEN> result = {};
for (auto x : xrange(TL_RES_LEN)) {
double m = (1 << 16) / cstd::exp2<6>((x + 1) * (ENV_STEP / 4.0) / 8.0);
int n = int(m);
n >>= 4;
n = (n >> 1) + (n & 1);
for (auto i : xrange(11)) {
result[x * 2 + 0 + i * 2 * TL_RES_LEN] = n >> i;
result[x * 2 + 1 + i * 2 * TL_RES_LEN] = -(n >> i);
}
}
return result;
}()
constexpr KeyMatrixPosition x
Keyboard bindings.
Definition: Keyboard.cc:124

Definition at line 218 of file YM2413Burczynski.cc.

Referenced by openmsx::YM2413Burczynski::Slot::calcOutput(), and openmsx::YM2413Burczynski::YM2413::YM2413().