Sync with master

This commit is contained in:
cam900 2022-09-17 13:56:09 +09:00
parent 5af02d068e
commit 81f812b216
4 changed files with 23 additions and 36 deletions

View File

@ -45,12 +45,11 @@ void es5505_core::tick()
for (int i = 0; i < 4; i++)
{
// copy output
m_output[i] = m_output_temp[i];
m_output_latch[i] = m_ch[i];
m_output_temp[i].reset();
m_output[i].copy_output(m_output_temp[i]);
// clamp to 16 bit (upper 5 bits are overflow
// guard bits)
m_output_latch[i].clamp16();
m_output_latch[i].clamp16(m_ch[i]);
m_output_temp[i].reset();
// set signed
if (m_output_latch[i].left() < 0)
{
@ -155,7 +154,7 @@ void es5505_core::tick_perf()
// output
for (int c = 0; c < 4; c++)
{
m_output[c] = m_ch[c];
m_output[c].clamp16(m_ch[c]);
}
// update

View File

@ -31,7 +31,13 @@ class es5505_core : public es550x_shared_core
{
m_left = 0;
m_right = 0;
};
}
inline void copy_output(output_t &src)
{
m_left = src.left();
m_right = src.right();
}
inline s32 clamp16(s32 in) { return clamp(in, -0x8000, 0x7fff); }
@ -76,18 +82,6 @@ class es5505_core : public es550x_shared_core
return *this;
}
output_t &operator=(output_t &src)
{
clamp16(src);
return *this;
}
output_t &operator=(s32 val)
{
m_left = m_right = clamp16(val);
return *this;
}
output_t &operator>>(s32 shift)
{
m_left >>= shift;

View File

@ -63,11 +63,11 @@ void es5506_core::tick()
for (int i = 0; i < 6; i++)
{
// copy output
m_output[i] = m_output_temp[i];
m_output_latch[i] = m_ch[i];
m_output_temp[i].reset();
m_output[i].copy_output(m_output_temp[i]);
// clamp to 20 bit (upper 3 bits are
// overflow guard bits)
m_output_latch[i].clamp20(m_ch[i]);
m_output_temp[i].reset();
m_output_latch[i].clamp20();
// set signed
if (m_output_latch[i].left() < 0)
@ -202,7 +202,7 @@ void es5506_core::tick_perf()
{
for (int c = 0; c < 6; c++)
{
m_output[c] = m_ch[c] >> output_bits;
m_output[c].clamp20(m_ch[c] >> output_bits);
}
}
}
@ -210,7 +210,7 @@ void es5506_core::tick_perf()
{
for (int c = 0; c < 6; c++)
{
m_output[c] = 0;
m_output[c].reset();
}
}

View File

@ -31,7 +31,13 @@ class es5506_core : public es550x_shared_core
{
m_left = 0;
m_right = 0;
};
}
inline void copy_output(output_t &src)
{
m_left = src.left();
m_right = src.right();
}
inline s32 clamp20(s32 in) { return clamp(in, -0x80000, 0x7ffff); }
@ -76,18 +82,6 @@ class es5506_core : public es550x_shared_core
return *this;
}
output_t &operator=(output_t &src)
{
clamp20(src);
return *this;
}
output_t &operator=(s32 val)
{
m_left = m_right = clamp20(val);
return *this;
}
output_t &operator>>(s32 shift)
{
m_left >>= shift;