diff options
author Couriersud <>2009-10-11 17:32:38 +0000
committer Couriersud <>2009-10-11 17:32:38 +0000
commitb971b5928749dc8ae893047bdfba15d20d25f06f (patch)
parent04bad0addc6ae0345c9dd85a311cfe2406bf7ca4 (diff)
A bottle of champaign to the person who explains
the speed improvement in dkong from 1230% to 1470% due to this change (setting context->data to 0 in reset). Actually, it will avoid the first stream_update of buffer_stream when after approx. 11 samples the dac is written. Without setting data to 0, stream_update(buffer_stream) is called before stream_update(discrete_stream) is called. With the patch, the order is of the stream_updates is determined by streams.c. What makes this interesting is, that the startup order of the stream_updates determines the whole run-time of the game. When profiling, NODE_73 (Sallen-Key-Filter) needs 1066 cycles without the patch and under 135 with the patch, although it is the 4th node after DISCRETE_INPUT_BUFFER. All in all this looks like a caching issue, however I am currently clueless what in the end is causing it.
1 files changed, 2 insertions, 2 deletions
diff --git a/src/emu/sound/disc_inp.c b/src/emu/sound/disc_inp.c
index 187a189fa19..83c89677aaf 100644
--- a/src/emu/sound/disc_inp.c
+++ b/src/emu/sound/disc_inp.c
@@ -34,9 +34,9 @@ struct dss_adjustment_context
struct dss_input_context
stream_sample_t *ptr; /* current in ptr for stream */
- UINT8 data; /* data written */
double gain; /* node gain */
double offset; /* node offset */
+ UINT8 data; /* data written */
UINT8 is_stream;
UINT8 is_buffered;
UINT32 stream_in_number;
@@ -302,7 +302,7 @@ static DISCRETE_RESET(dss_input_stream)
struct dss_input_context *context = (struct dss_input_context *)node->context;
context->ptr = NULL;
- //context->data = 0;
+ context->data = 0;
static DISCRETE_START(dss_input_stream)