openMSX
Classes | Enumerations | Functions | Variables
openmsx::YM2413NukeYKT Namespace Reference

Classes

class  YM2413
 

Enumerations

enum  RmNum : uint8_t {
  rm_num_bd0 = 0, rm_num_hh = 1, rm_num_tom = 2, rm_num_bd1 = 3,
  rm_num_sd = 4, rm_num_tc = 5
}
 

Functions

constexpr bool is_rm_cycle (int cycle)
 
constexpr RmNum rm_for_cycle (int cycle)
 

Variables

constexpr auto logsinTab
 
constexpr auto expTab
 

Enumeration Type Documentation

◆ RmNum

Enumerator
rm_num_bd0 
rm_num_hh 
rm_num_tom 
rm_num_bd1 
rm_num_sd 
rm_num_tc 

Definition at line 43 of file YM2413NukeYKT.cc.

Function Documentation

◆ is_rm_cycle()

constexpr bool openmsx::YM2413NukeYKT::is_rm_cycle ( int  cycle)
constexpr

Definition at line 51 of file YM2413NukeYKT.cc.

◆ rm_for_cycle()

constexpr RmNum openmsx::YM2413NukeYKT::rm_for_cycle ( int  cycle)
constexpr

Definition at line 55 of file YM2413NukeYKT.cc.

Variable Documentation

◆ expTab

constexpr auto openmsx::YM2413NukeYKT::expTab
constexpr
Initial value:
= [] {
std::array<uint16_t, 256> result = {};
for (int i = 0; i < 256; ++i) {
result[i] = cstd::round((cstd::exp2<6>(double(255 - i) / 256.0)) * 1024.0);
}
return result;
}()

Definition at line 67 of file YM2413NukeYKT.cc.

◆ logsinTab

constexpr auto openmsx::YM2413NukeYKT::logsinTab
constexpr
Initial value:
= [] {
std::array<uint16_t, 256> result = {};
for (int i = 0; i < 256; ++i) {
result[i] = cstd::round(-cstd::log2<8, 3>(cstd::sin<2>((double(i) + 0.5) * M_PI / 256.0 / 2.0)) * 256.0);
}
return result;
}()

Definition at line 60 of file YM2413NukeYKT.cc.

cstd::round
constexpr double round(double x)
Definition: cstd.hh:354
M_PI
#define M_PI
Definition: Math.hh:27