mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-26 22:43:01 +00:00
ES5506: even more.
This commit is contained in:
parent
3555c521e1
commit
b6f6ed0f67
4 changed files with 19 additions and 17 deletions
|
@ -55,7 +55,6 @@ void es5506_core::voice_tick()
|
|||
// Voice updates every 2 E clock cycle (or 4 BCLK clock cycle)
|
||||
// Update voice
|
||||
for (int i=0; i<VGS_CLAMP(m_active,4,31); i++) {
|
||||
m_voice[i].fetch(0);
|
||||
m_voice[i].tick(i);
|
||||
}
|
||||
|
||||
|
@ -105,10 +104,11 @@ void es5506_core::voice_t::tick(u8 voice)
|
|||
m_ch.reset();
|
||||
|
||||
// Filter execute
|
||||
m_filter.tick(m_alu.interpolation());
|
||||
|
||||
if (m_alu.busy())
|
||||
{
|
||||
fetch(0);
|
||||
m_filter.tick(m_alu.interpolation());
|
||||
// Send to output
|
||||
m_output[0] = m_mute ? 0 : volume_calc(m_lvol, (short)m_filter.o4_1());
|
||||
m_output[1] = m_mute ? 0 : volume_calc(m_rvol, (short)m_filter.o4_1());
|
||||
|
@ -121,6 +121,8 @@ void es5506_core::voice_t::tick(u8 voice)
|
|||
{
|
||||
m_alu.loop_exec();
|
||||
}
|
||||
} else {
|
||||
m_filter.tick(m_alu.interpolation());
|
||||
}
|
||||
// Envelope
|
||||
if (m_ecount != 0)
|
||||
|
|
|
@ -347,7 +347,7 @@ class es550x_shared_core : public vgsound_emu_core
|
|||
|
||||
inline u8 loop() { return (m_lpe << 0) | (m_ble << 1); }
|
||||
|
||||
private:
|
||||
public:
|
||||
u8 m_stop0 : 1; // Stop with ALU
|
||||
u8 m_stop1 : 1; // Stop with processor
|
||||
u8 m_lpe : 1; // Loop enable
|
||||
|
@ -429,8 +429,8 @@ class es550x_shared_core : public vgsound_emu_core
|
|||
inline s32 o4_1() { return m_o[4][0]; }
|
||||
|
||||
private:
|
||||
void lp_exec(s32 coeff, s32 in, s32 out);
|
||||
void hp_exec(s32 coeff, s32 in, s32 out);
|
||||
void lp_exec(s32 coeff, const s32 in, const s32 out);
|
||||
void hp_exec(s32 coeff, const s32 in, const s32 out);
|
||||
|
||||
// Registers
|
||||
u8 m_lp = 0; // Filter mode
|
||||
|
|
|
@ -33,19 +33,19 @@ bool es550x_shared_core::es550x_voice_t::es550x_alu_t::tick()
|
|||
}
|
||||
|
||||
m_accum &= m_accum_mask;
|
||||
return ((!m_cr.lei()) &&
|
||||
(((m_cr.dir()) && (m_accum < m_start)) || ((!m_cr.dir()) && (m_accum > m_end))))
|
||||
return ((!m_cr.m_lei) &&
|
||||
(((m_cr.m_dir) && (m_accum < m_start)) || ((!m_cr.m_dir) && (m_accum > m_end))))
|
||||
? true
|
||||
: false;
|
||||
}
|
||||
|
||||
void es550x_shared_core::es550x_voice_t::es550x_alu_t::loop_exec()
|
||||
{
|
||||
if (m_cr.dir()) // Reverse playback
|
||||
if (m_cr.m_dir) // Reverse playback
|
||||
{
|
||||
if (m_cr.lpe()) // Loop enable
|
||||
if (m_cr.m_lpe) // Loop enable
|
||||
{
|
||||
if (m_cr.ble()) // Bidirectional
|
||||
if (m_cr.m_ble) // Bidirectional
|
||||
{
|
||||
m_cr.set_dir(false);
|
||||
m_accum = m_start + (m_start - m_accum);
|
||||
|
@ -55,7 +55,7 @@ void es550x_shared_core::es550x_voice_t::es550x_alu_t::loop_exec()
|
|||
m_accum = m_end - (m_start - m_accum);
|
||||
}
|
||||
}
|
||||
else if (m_cr.ble() && m_transwave) // m_transwave
|
||||
else if (m_cr.m_ble && m_transwave) // m_transwave
|
||||
{
|
||||
m_cr.set_loop(0);
|
||||
m_cr.set_lei(true); // Loop end ignore
|
||||
|
@ -68,9 +68,9 @@ void es550x_shared_core::es550x_voice_t::es550x_alu_t::loop_exec()
|
|||
}
|
||||
else
|
||||
{
|
||||
if (m_cr.lpe()) // Loop enable
|
||||
if (m_cr.m_lpe) // Loop enable
|
||||
{
|
||||
if (m_cr.ble()) // Bidirectional
|
||||
if (m_cr.m_ble) // Bidirectional
|
||||
{
|
||||
m_cr.set_dir(true);
|
||||
m_accum = m_end - (m_end - m_accum);
|
||||
|
@ -80,7 +80,7 @@ void es550x_shared_core::es550x_voice_t::es550x_alu_t::loop_exec()
|
|||
m_accum = (m_accum - m_end) + m_start;
|
||||
}
|
||||
}
|
||||
else if (m_cr.ble() && m_transwave) // m_transwave
|
||||
else if (m_cr.m_ble && m_transwave) // m_transwave
|
||||
{
|
||||
m_cr.set_loop(0);
|
||||
m_cr.set_lei(true); // Loop end ignore
|
||||
|
|
|
@ -50,7 +50,7 @@ void es550x_shared_core::es550x_voice_t::es550x_filter_t::tick(s32 in)
|
|||
}
|
||||
}
|
||||
|
||||
void es550x_shared_core::es550x_voice_t::es550x_filter_t::lp_exec(s32 coeff, s32 in, s32 out)
|
||||
void es550x_shared_core::es550x_voice_t::es550x_filter_t::lp_exec(s32 coeff, const s32 in, const s32 out)
|
||||
{
|
||||
// Store previous filter data
|
||||
m_o[out][1] = m_o[out][0];
|
||||
|
@ -59,7 +59,7 @@ void es550x_shared_core::es550x_voice_t::es550x_filter_t::lp_exec(s32 coeff, s32
|
|||
m_o[out][0] = ((coeff * (m_o[in][0] - m_o[out][0])) / 4096) + m_o[out][0];
|
||||
}
|
||||
|
||||
void es550x_shared_core::es550x_voice_t::es550x_filter_t::hp_exec(s32 coeff, s32 in, s32 out)
|
||||
void es550x_shared_core::es550x_voice_t::es550x_filter_t::hp_exec(s32 coeff, const s32 in, const s32 out)
|
||||
{
|
||||
// Store previous filter data
|
||||
m_o[out][1] = m_o[out][0];
|
||||
|
|
Loading…
Reference in a new issue