summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/sound/c140.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/c140.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/c140.c')
-rw-r--r--src/emu/sound/c140.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/emu/sound/c140.c b/src/emu/sound/c140.c
index a585c896513..548c1be45f4 100644
--- a/src/emu/sound/c140.c
+++ b/src/emu/sound/c140.c
@@ -259,7 +259,7 @@ INLINE int limit(INT32 in)
return in;
}
-static void update_stereo(void *param, stream_sample_t **inputs, stream_sample_t **buffer, int length)
+static STREAM_UPDATE( update_stereo )
{
struct c140_info *info = param;
int i,j;
@@ -277,11 +277,11 @@ static void update_stereo(void *param, stream_sample_t **inputs, stream_sample_t
INT16 *lmix, *rmix;
- if(length>info->sample_rate) length=info->sample_rate;
+ if(samples>info->sample_rate) samples=info->sample_rate;
/* zap the contents of the mixer buffer */
- memset(info->mixer_buffer_left, 0, length * sizeof(INT16));
- memset(info->mixer_buffer_right, 0, length * sizeof(INT16));
+ memset(info->mixer_buffer_left, 0, samples * sizeof(INT16));
+ memset(info->mixer_buffer_right, 0, samples * sizeof(INT16));
/* get the number of voices to update */
voicecnt = (info->banking_type == C140_TYPE_ASIC219) ? 16 : 24;
@@ -306,7 +306,7 @@ static void update_stereo(void *param, stream_sample_t **inputs, stream_sample_t
lvol=(vreg->volume_left*32)/MAX_VOICE; //32ch -> 24ch
rvol=(vreg->volume_right*32)/MAX_VOICE;
- /* Set mixer buffer base pointers */
+ /* Set mixer outputs base pointers */
lmix = info->mixer_buffer_left;
rmix = info->mixer_buffer_right;
@@ -330,7 +330,7 @@ static void update_stereo(void *param, stream_sample_t **inputs, stream_sample_t
{
//compressed PCM (maybe correct...)
/* Loop for enough to fill sample buffer as requested */
- for(j=0;j<length;j++)
+ for(j=0;j<samples;j++)
{
offset += delta;
cnt = (offset>>16)&0x7fff;
@@ -377,7 +377,7 @@ static void update_stereo(void *param, stream_sample_t **inputs, stream_sample_t
else
{
/* linear 8bit signed PCM */
- for(j=0;j<length;j++)
+ for(j=0;j<samples;j++)
{
offset += delta;
cnt = (offset>>16)&0x7fff;
@@ -444,9 +444,9 @@ static void update_stereo(void *param, stream_sample_t **inputs, stream_sample_t
lmix = info->mixer_buffer_left;
rmix = info->mixer_buffer_right;
{
- stream_sample_t *dest1 = buffer[0];
- stream_sample_t *dest2 = buffer[1];
- for (i = 0; i < length; i++)
+ stream_sample_t *dest1 = outputs[0];
+ stream_sample_t *dest2 = outputs[1];
+ for (i = 0; i < samples; i++)
{
*dest1++ = limit(8*(*lmix++));
*dest2++ = limit(8*(*rmix++));