A little fast on the trigger there... (nw)

This commit is contained in:
Olivier Galibert 2018-03-12 19:18:19 +01:00
parent f338bfa092
commit 08b3e31c5a
2 changed files with 3 additions and 5 deletions

View File

@ -342,7 +342,7 @@ s8 nesapu_device::apu_triangle(apu_t::triangle_t *chan)
if (freq < 4) /* inaudible */
return 0;
chan->phaseacc -= (float) m_apu_incsize; /* # of cycles per sample */
chan->phaseacc --;
while (chan->phaseacc < 0)
{
chan->phaseacc += freq;
@ -400,7 +400,7 @@ s8 nesapu_device::apu_noise(apu_t::noise_t *chan)
return 0;
freq = noise_freq[chan->regs[2] & 0x0F];
chan->phaseacc -= (float) m_apu_incsize; /* # of cycles per sample */
chan->phaseacc --;
while (chan->phaseacc < 0)
{
chan->phaseacc += freq;
@ -453,7 +453,7 @@ s8 nesapu_device::apu_dpcm(apu_t::dpcm_t *chan)
if (chan->enabled)
{
freq = dpcm_clocks[chan->regs[0] & 0x0F];
chan->phaseacc -= (float) m_apu_incsize; /* # of cycles per sample */
chan->phaseacc --;
while (chan->phaseacc < 0)
{

View File

@ -74,10 +74,8 @@ private:
// internal state
apu_t m_APU; /* Actual APUs */
float m_apu_incsize; /* Adjustment increment */
u32 m_samps_per_sync; /* Number of samples per vsync */
u32 m_buffer_size; /* Actual buffer size in bytes */
u32 m_real_rate; /* Actual playback rate */
u8 m_noise_lut[apu_t::NOISE_LONG]; /* Noise sample lookup table */
u32 m_vbl_times[0x20]; /* VBL durations in samples */
u32 m_sync_times1[SYNCS_MAX1]; /* Samples per sync table */