zsg2: update stream before reading,

tms57002: fix input sample overflow
This commit is contained in:
hap 2025-01-06 18:30:26 +01:00
parent c56135a7f3
commit 71fe25f95b
3 changed files with 93 additions and 92 deletions

View File

@ -925,7 +925,7 @@ void tms57002_device::sound_stream_update(sound_stream &stream, std::vector<read
assert(inputs[0].samples() == 1);
assert(outputs[0].samples() == 1);
stream_buffer::sample_t in_scale = 32768.0 * ((st0 & ST0_SIM) ? 256.0 : 1.0);
stream_buffer::sample_t in_scale = 32767.0 * ((st0 & ST0_SIM) ? 256.0 : 1.0);
si[0] = s32(inputs[0].get(0) * in_scale) & 0xffffff;
si[1] = s32(inputs[1].get(0) * in_scale) & 0xffffff;
si[2] = s32(inputs[2].get(0) * in_scale) & 0xffffff;

View File

@ -1,6 +1,7 @@
// license:BSD-3-Clause
// copyright-holders:Olivier Galibert, R. Belmont, hap, superctr
/*
ZOOM ZSG-2 custom wavetable synthesizer
Written by Olivier Galibert
@ -85,7 +86,8 @@
TODO:
- Filter and ramping behavior might not be perfect.
- clicking / popping noises in gdarius, raystorm: maybe the sample ROMs are bad dumps?
- clicking / popping noises in gdarius, raystorm: maybe the sample ROMs
are bad dumps?
- memory reads out of range sometimes
*/
@ -639,6 +641,8 @@ uint16_t zsg2_device::read(offs_t offset, uint16_t mem_mask)
return 0;
}
m_stream->update();
if (offset < 0x300)
{
int chan = offset >> 4;

View File

@ -58,12 +58,9 @@ private:
int16_t output_cutoff_delta;
int32_t emphasis_filter_state;
int32_t output_filter_state;
// Attenuation for output channels
uint8_t output_gain[4];
uint8_t output_gain[4]; // Attenuation for output channels
int16_t samples[5]; // +1 history
};