summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/sound/sn76496.c
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2008-12-18 08:32:50 +0000
committer Aaron Giles <aaron@aarongiles.com>2008-12-18 08:32:50 +0000
commit785b6a50c63d106f13f550f006952370bf3b410a (patch)
treef73368741d5dd3d5c1b78f54800eb36541e4bbd8 /src/emu/sound/sn76496.c
parentcf9fc5861805c5e344fab6e96d084a372c2683aa (diff)
From: Atari Ace [mailto:atari_ace@verizon.net]
Sent: Wednesday, December 17, 2008 9:03 PM To: submit@mamedev.org Cc: atariace@hotmail.com Subject: [patch] STREAM_UPDATE update Hi mamedev, This patch modifies the parameters of the stream_update_func callback. The first two patches go through and changes all the callbacks to use a consistent set of parameters (the larger patch was mechanically generated, the smaller second patch are hand edits where review or compilation showed issues with the automatic conversion). The third patch then macroizes all the callbacks to STREAM_UPDATE, and was done mechanically except for the change to streams.h. The fourth patch then adds device to the callback, and eliminates Machine in a handful of callbacks by referencing the device. deprecat.h -= 8. ~aa
Diffstat (limited to 'src/emu/sound/sn76496.c')
-rw-r--r--src/emu/sound/sn76496.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/emu/sound/sn76496.c b/src/emu/sound/sn76496.c
index b6a9ea92961..7ecd307b051 100644
--- a/src/emu/sound/sn76496.c
+++ b/src/emu/sound/sn76496.c
@@ -134,11 +134,11 @@ WRITE8_HANDLER( sn76496_3_w ) { SN76496Write(3,data); }
WRITE8_HANDLER( sn76496_4_w ) { SN76496Write(4,data); }
-static void SN76496Update(void *param,stream_sample_t **inputs, stream_sample_t **_buffer,int length)
+static STREAM_UPDATE( SN76496Update )
{
int i;
struct SN76496 *R = param;
- stream_sample_t *buffer = _buffer[0];
+ stream_sample_t *buffer = outputs[0];
/* If the volume is 0, increase the counter */
@@ -146,14 +146,14 @@ static void SN76496Update(void *param,stream_sample_t **inputs, stream_sample_t
{
if (R->Volume[i] == 0)
{
- /* note that I do count += length, NOT count = length + 1. You might think */
+ /* note that I do count += samples, NOT count = samples + 1. You might think */
/* it's the same since the volume is 0, but doing the latter could cause */
/* interferencies when the program is rapidly modulating the volume. */
- if (R->Count[i] <= length*STEP) R->Count[i] += length*STEP;
+ if (R->Count[i] <= samples*STEP) R->Count[i] += samples*STEP;
}
}
- while (length > 0)
+ while (samples > 0)
{
int vol[4];
unsigned int out;
@@ -245,7 +245,7 @@ static void SN76496Update(void *param,stream_sample_t **inputs, stream_sample_t
*(buffer++) = out / STEP;
- length--;
+ samples--;
}
}