mirror of
https://github.com/ekeeke/Genesis-Plus-GX.git
synced 2024-12-28 12:11:50 +01:00
fixed potential buffer overflow when using resampling (FM High-Quality mode).
This commit is contained in:
parent
3cef34ffa4
commit
0f1850ec6e
@ -187,12 +187,11 @@ int sound_update(unsigned int cycles)
|
|||||||
/* resynchronize FM & PSG chips */
|
/* resynchronize FM & PSG chips */
|
||||||
YM2612Update(Fir_Resampler_buffer(), remain);
|
YM2612Update(Fir_Resampler_buffer(), remain);
|
||||||
Fir_Resampler_write(remain << 1);
|
Fir_Resampler_write(remain << 1);
|
||||||
|
fm_cycles_count = psg_cycles_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
fm_cycles_count = psg_cycles_count;
|
|
||||||
|
|
||||||
#ifdef LOGSOUND
|
#ifdef LOGSOUND
|
||||||
error("%d FM samples available\n",Fir_Resampler_written() >> 1);
|
error("%d FM samples available (%d needed)\n",Fir_Resampler_written() >> 1, remain);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -210,7 +209,7 @@ int sound_update(unsigned int cycles)
|
|||||||
error("%lu FM cycles run \n",fm_cycles_count);
|
error("%lu FM cycles run \n",fm_cycles_count);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* adjust PSG & FM cycle counts */
|
/* adjust PSG & FM cycle counts for next frame */
|
||||||
psg_cycles_count -= (cycles << 11);
|
psg_cycles_count -= (cycles << 11);
|
||||||
fm_cycles_count -= (cycles << 11);
|
fm_cycles_count -= (cycles << 11);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user