From e2a760bcbd28caba2f1ef8dca7818e80dd9d4b83 Mon Sep 17 00:00:00 2001 From: Aaron Giles Date: Wed, 10 Dec 2008 06:31:23 +0000 Subject: [PATCH] From: Atari Ace [mailto:atari_ace@verizon.net] Sent: Tuesday, December 09, 2008 8:13 PM To: submit@mamedev.org Cc: atariace@hotmail.com Subject: [patch] Add device parameter to stream_create() Hi mamedev, This patch adds the sound device to the parameters passed to stream_create so that the global Machine can be removed from streams.c. It assumes my previous patch which added CUSTOM_START and SAMPLES_START has been applied. ~aa --- src/emu/machine/ldcore.c | 2 +- src/emu/sound.c | 2 +- src/emu/sound/2151intf.c | 2 +- src/emu/sound/2203intf.c | 2 +- src/emu/sound/2413intf.c | 4 ++-- src/emu/sound/2608intf.c | 2 +- src/emu/sound/2610intf.c | 4 ++-- src/emu/sound/2612intf.c | 2 +- src/emu/sound/262intf.c | 2 +- src/emu/sound/3812intf.c | 6 +++--- src/emu/sound/5110intf.c | 2 +- src/emu/sound/5220intf.c | 2 +- src/emu/sound/aica.c | 2 +- src/emu/sound/astrocde.c | 2 +- src/emu/sound/ay8910.c | 2 +- src/emu/sound/beep.c | 2 +- src/emu/sound/bsmt2000.c | 2 +- src/emu/sound/c140.c | 2 +- src/emu/sound/c352.c | 2 +- src/emu/sound/c6280.c | 2 +- src/emu/sound/cdda.c | 2 +- src/emu/sound/cdp1869.c | 2 +- src/emu/sound/cem3394.c | 2 +- src/emu/sound/dac.c | 2 +- src/emu/sound/discrete.c | 8 ++++---- src/emu/sound/dmadac.c | 2 +- src/emu/sound/es5503.c | 2 +- src/emu/sound/es5506.c | 2 +- src/emu/sound/es8712.c | 2 +- src/emu/sound/flt_rc.c | 2 +- src/emu/sound/flt_vol.c | 2 +- src/emu/sound/gaelco.c | 2 +- src/emu/sound/hc55516.c | 2 +- src/emu/sound/ics2115.c | 2 +- src/emu/sound/iremga20.c | 2 +- src/emu/sound/k005289.c | 2 +- src/emu/sound/k007232.c | 2 +- src/emu/sound/k051649.c | 2 +- src/emu/sound/k053260.c | 2 +- src/emu/sound/k054539.c | 2 +- src/emu/sound/msm5205.c | 2 +- src/emu/sound/msm5232.c | 2 +- src/emu/sound/multipcm.c | 2 +- src/emu/sound/n63701x.c | 2 +- src/emu/sound/namco.c | 4 ++-- src/emu/sound/namco52.c | 2 +- src/emu/sound/nes_apu.c | 2 +- src/emu/sound/nile.c | 2 +- src/emu/sound/okim6258.c | 2 +- src/emu/sound/okim6295.c | 2 +- src/emu/sound/pokey.c | 2 +- src/emu/sound/psx.c | 2 +- src/emu/sound/qsound.c | 2 +- src/emu/sound/rf5c400.c | 2 +- src/emu/sound/rf5c68.c | 2 +- src/emu/sound/s14001a.c | 2 +- src/emu/sound/saa1099.c | 2 +- src/emu/sound/samples.c | 4 ++-- src/emu/sound/scsp.c | 2 +- src/emu/sound/segapcm.c | 2 +- src/emu/sound/sid6581.c | 2 +- src/emu/sound/sn76477.c | 2 +- src/emu/sound/sn76496.c | 6 +++--- src/emu/sound/snkwave.c | 2 +- src/emu/sound/sp0250.c | 2 +- src/emu/sound/sp0256.c | 2 +- src/emu/sound/speaker.c | 2 +- src/emu/sound/st0016.c | 2 +- src/emu/sound/tiaintf.c | 2 +- src/emu/sound/tms3615.c | 2 +- src/emu/sound/tms36xx.c | 2 +- src/emu/sound/upd7759.c | 2 +- src/emu/sound/vlm5030.c | 2 +- src/emu/sound/votrax.c | 2 +- src/emu/sound/vrender0.c | 2 +- src/emu/sound/wave.c | 2 +- src/emu/sound/x1_010.c | 2 +- src/emu/sound/ymf271.c | 2 +- src/emu/sound/ymf278b.c | 2 +- src/emu/sound/ymz280b.c | 2 +- src/emu/streams.c | 5 ++--- src/emu/streams.h | 2 +- src/mame/audio/amiga.c | 2 +- src/mame/audio/attckufo.c | 2 +- src/mame/audio/bzone.c | 8 ++++---- src/mame/audio/cps3.c | 2 +- src/mame/audio/exidy.c | 8 ++++---- src/mame/audio/exidy440.c | 2 +- src/mame/audio/flower.c | 2 +- src/mame/audio/galaxian.c | 2 +- src/mame/audio/geebee.c | 2 +- src/mame/audio/gomoku.c | 2 +- src/mame/audio/gridlee.c | 2 +- src/mame/audio/leland.c | 17 ++++++++--------- src/mame/audio/phoenix.c | 2 +- src/mame/audio/pleiads.c | 2 +- src/mame/audio/polepos.c | 2 +- src/mame/audio/redbaron.c | 10 +++++----- src/mame/audio/rockola.c | 2 +- src/mame/audio/segag80r.c | 2 +- src/mame/audio/segasnd.c | 4 ++-- src/mame/audio/seibu.c | 2 +- src/mame/audio/snes.c | 2 +- src/mame/audio/tiamc1.c | 2 +- src/mame/audio/tx1.c | 4 ++-- src/mame/audio/warpwarp.c | 2 +- src/mame/audio/wiping.c | 2 +- src/mame/drivers/mjkjidai.c | 2 +- src/mame/drivers/renegade.c | 2 +- 109 files changed, 140 insertions(+), 142 deletions(-) diff --git a/src/emu/machine/ldcore.c b/src/emu/machine/ldcore.c index c3f6e7942bf..63e50c2e97d 100644 --- a/src/emu/machine/ldcore.c +++ b/src/emu/machine/ldcore.c @@ -946,7 +946,7 @@ static void process_track_data(const device_config *device) static CUSTOM_START( custom_start ) { sound_token *token = auto_malloc(sizeof(*token)); - token->stream = stream_create(0, 2, 48000, token, custom_stream_callback); + token->stream = stream_create(device, 0, 2, 48000, token, custom_stream_callback); token->ld = NULL; return token; } diff --git a/src/emu/sound.c b/src/emu/sound.c index 47332ecdf0c..ea1b0ba97e3 100644 --- a/src/emu/sound.c +++ b/src/emu/sound.c @@ -396,7 +396,7 @@ static void route_sound(running_machine *machine) speaker_info *info = curspeak->token; if (info->inputs != 0) { - info->mixer_stream = stream_create(info->inputs, 1, machine->sample_rate, info, mixer_update); + info->mixer_stream = stream_create(curspeak, info->inputs, 1, machine->sample_rate, info, mixer_update); state_save_register_postload(machine, mixer_postload, info->mixer_stream); info->input = auto_malloc(info->inputs * sizeof(*info->input)); info->inputs = 0; diff --git a/src/emu/sound/2151intf.c b/src/emu/sound/2151intf.c index 92ab56d164c..10e1eca8f8d 100644 --- a/src/emu/sound/2151intf.c +++ b/src/emu/sound/2151intf.c @@ -50,7 +50,7 @@ static SND_START( ym2151 ) rate = clock/64; /* stream setup */ - info->stream = stream_create(0,2,rate,info,ym2151_update); + info->stream = stream_create(device,0,2,rate,info,ym2151_update); info->chip = ym2151_init(device,clock,rate); diff --git a/src/emu/sound/2203intf.c b/src/emu/sound/2203intf.c index 9a198fd86b2..1f887b5a913 100644 --- a/src/emu/sound/2203intf.c +++ b/src/emu/sound/2203intf.c @@ -132,7 +132,7 @@ static SND_START( ym2203 ) info->timer[1] = timer_alloc(device->machine, timer_callback_2203_1, info); /* stream system initialize */ - info->stream = stream_create(0,1,rate,info,ym2203_stream_update); + info->stream = stream_create(device,0,1,rate,info,ym2203_stream_update); /* Initialize FM emurator */ info->chip = ym2203_init(info,device,clock,rate,timer_handler,IRQHandler,&psgintf); diff --git a/src/emu/sound/2413intf.c b/src/emu/sound/2413intf.c index 9640a0f8255..1630b57ff26 100644 --- a/src/emu/sound/2413intf.c +++ b/src/emu/sound/2413intf.c @@ -62,7 +62,7 @@ static SND_START( ym2413 ) return NULL; /* stream system initialize */ - info->stream = stream_create(0,2,rate,info,ym2413_stream_update); + info->stream = stream_create(device,0,2,rate,info,ym2413_stream_update); ym2413_set_update_handler(info->chip, _stream_update, info); @@ -85,7 +85,7 @@ static SND_START( ym2413 ) { ym2413_reset (i); - ym2413[i].DAC_stream = stream_create(0, 1, clock/72, i, YM2413DAC_update); + ym2413[i].DAC_stream = stream_create(device, 0, 1, clock/72, i, YM2413DAC_update); if (ym2413[i].DAC_stream == -1) return 1; diff --git a/src/emu/sound/2608intf.c b/src/emu/sound/2608intf.c index 33a4b7c2902..743a55a2237 100644 --- a/src/emu/sound/2608intf.c +++ b/src/emu/sound/2608intf.c @@ -149,7 +149,7 @@ static SND_START( ym2608 ) info->timer[1] = timer_alloc(device->machine, timer_callback_2608_1, info); /* stream system initialize */ - info->stream = stream_create(0,2,rate,info,ym2608_stream_update); + info->stream = stream_create(device,0,2,rate,info,ym2608_stream_update); /* setup adpcm buffers */ pcmbufa = device->region; pcmsizea = device->regionbytes; diff --git a/src/emu/sound/2610intf.c b/src/emu/sound/2610intf.c index 55548389f1a..bae38911a10 100644 --- a/src/emu/sound/2610intf.c +++ b/src/emu/sound/2610intf.c @@ -150,7 +150,7 @@ static SND_START( ym2610 ) info->timer[1] = timer_alloc(device->machine, timer_callback_1, info); /* stream system initialize */ - info->stream = stream_create(0,2,rate,info,ym2610_stream_update); + info->stream = stream_create(device,0,2,rate,info,ym2610_stream_update); /* setup adpcm buffers */ pcmbufa = device->region; pcmsizea = device->regionbytes; @@ -216,7 +216,7 @@ static SND_START( ym2610b ) info->timer[1] =timer_alloc(device->machine, timer_callback_1, info); /* stream system initialize */ - info->stream = stream_create(0,2,rate,info,ym2610b_stream_update); + info->stream = stream_create(device, 0,2,rate,info,ym2610b_stream_update); /* setup adpcm buffers */ pcmbufa = device->region; pcmsizea = device->regionbytes; diff --git a/src/emu/sound/2612intf.c b/src/emu/sound/2612intf.c index 3f8632d2efb..f11a395aa90 100644 --- a/src/emu/sound/2612intf.c +++ b/src/emu/sound/2612intf.c @@ -104,7 +104,7 @@ static SND_START( ym2612 ) info->timer[1] = timer_alloc(device->machine, timer_callback_2612_1, info); /* stream system initialize */ - info->stream = stream_create(0,2,rate,info,ym2612_stream_update); + info->stream = stream_create(device,0,2,rate,info,ym2612_stream_update); /**** initialize YM2612 ****/ info->chip = ym2612_init(info,device,clock,rate,timer_handler,IRQHandler); diff --git a/src/emu/sound/262intf.c b/src/emu/sound/262intf.c index 21aa65bc3c7..0bdbea0afeb 100644 --- a/src/emu/sound/262intf.c +++ b/src/emu/sound/262intf.c @@ -83,7 +83,7 @@ static SND_START( ymf262 ) if (info->chip == NULL) return NULL; - info->stream = stream_create(0,4,rate,info,ymf262_stream_update); + info->stream = stream_create(device,0,4,rate,info,ymf262_stream_update); /* YMF262 setup */ ymf262_set_timer_handler (info->chip, timer_handler_262, info); diff --git a/src/emu/sound/3812intf.c b/src/emu/sound/3812intf.c index 18dbf4f286f..be1888837c4 100644 --- a/src/emu/sound/3812intf.c +++ b/src/emu/sound/3812intf.c @@ -95,7 +95,7 @@ static SND_START( ym3812 ) if (!info->chip) return NULL; - info->stream = stream_create(0,1,rate,info,ym3812_stream_update); + info->stream = stream_create(device,0,1,rate,info,ym3812_stream_update); /* YM3812 setup */ ym3812_set_timer_handler (info->chip, TimerHandler_3812, info); @@ -264,7 +264,7 @@ static SND_START( ym3526 ) if (!info->chip) return NULL; - info->stream = stream_create(0,1,rate,info,ym3526_stream_update); + info->stream = stream_create(device,0,1,rate,info,ym3526_stream_update); /* YM3526 setup */ ym3526_set_timer_handler (info->chip, TimerHandler_3526, info); ym3526_set_irq_handler (info->chip, IRQHandler_3526, info); @@ -471,7 +471,7 @@ static SND_START( y8950 ) /* ADPCM ROM data */ y8950_set_delta_t_memory(info->chip, device->region, device->regionbytes); - info->stream = stream_create(0,1,rate,info,y8950_stream_update); + info->stream = stream_create(device,0,1,rate,info,y8950_stream_update); /* port and keyboard handler */ y8950_set_port_handler(info->chip, Y8950PortHandler_w, Y8950PortHandler_r, info); diff --git a/src/emu/sound/5110intf.c b/src/emu/sound/5110intf.c index a18975995e8..67426de7959 100644 --- a/src/emu/sound/5110intf.c +++ b/src/emu/sound/5110intf.c @@ -80,7 +80,7 @@ static SND_START( tms5110 ) sndintrf_register_token(info); /* initialize a stream */ - info->stream = stream_create(0, 1, clock / 80, info, tms5110_update); + info->stream = stream_create(device, 0, 1, clock / 80, info, tms5110_update); if (info->table == NULL) { diff --git a/src/emu/sound/5220intf.c b/src/emu/sound/5220intf.c index f5a5ff619e3..490566174c4 100644 --- a/src/emu/sound/5220intf.c +++ b/src/emu/sound/5220intf.c @@ -56,7 +56,7 @@ static SND_START( tms5220 ) sndintrf_register_token(info); /* initialize a info->stream */ - info->stream = stream_create(0, 1, clock / 80, info, tms5220_update); + info->stream = stream_create(device, 0, 1, clock / 80, info, tms5220_update); info->clock = clock; /* reset the 5220 */ diff --git a/src/emu/sound/aica.c b/src/emu/sound/aica.c index ad6f9938113..324353b38a5 100644 --- a/src/emu/sound/aica.c +++ b/src/emu/sound/aica.c @@ -1302,7 +1302,7 @@ static SND_START( aica ) { AICA->IntARMCB = intf->irq_callback; - AICA->stream = stream_create(0, 2, 44100, AICA, AICA_Update); + AICA->stream = stream_create(device, 0, 2, 44100, AICA, AICA_Update); } return AICA; diff --git a/src/emu/sound/astrocde.c b/src/emu/sound/astrocde.c index 9c24af3815f..d313f6f7617 100644 --- a/src/emu/sound/astrocde.c +++ b/src/emu/sound/astrocde.c @@ -270,7 +270,7 @@ static SND_START( astrocade ) chip->bitswap[i] = BITSWAP8(i, 0,1,2,3,4,5,6,7); /* allocate a stream for output */ - chip->stream = stream_create(0, 1, clock, chip, astrocade_update); + chip->stream = stream_create(device, 0, 1, clock, chip, astrocade_update); /* reset state */ astrocade_reset(chip); diff --git a/src/emu/sound/ay8910.c b/src/emu/sound/ay8910.c index 414b829e168..64189b0e5ac 100644 --- a/src/emu/sound/ay8910.c +++ b/src/emu/sound/ay8910.c @@ -706,7 +706,7 @@ void *ay8910_start_ym(sound_type chip_type, const device_config *device, int clo /* The envelope is pacing twice as fast for the YM2149 as for the AY-3-8910, */ /* This handled by the step parameter. Consequently we use a divider of 8 here. */ - info->channel = stream_create(0,info->streams,clock / 8 ,info,ay8910_update); + info->channel = stream_create(device, 0, info->streams, clock / 8, info, ay8910_update); ay8910_set_clock_ym(info,clock); ay8910_statesave(info, device); diff --git a/src/emu/sound/beep.c b/src/emu/sound/beep.c index 05154dbe3ec..204fd82f34c 100644 --- a/src/emu/sound/beep.c +++ b/src/emu/sound/beep.c @@ -88,7 +88,7 @@ static SND_START( beep ) pBeep = auto_malloc(sizeof(*pBeep)); memset(pBeep, 0, sizeof(*pBeep)); - pBeep->stream = stream_create(0, 1, BEEP_RATE, pBeep, beep_sound_update ); + pBeep->stream = stream_create(device, 0, 1, BEEP_RATE, pBeep, beep_sound_update ); pBeep->enable = 0; pBeep->frequency = 3250; pBeep->incr = 0; diff --git a/src/emu/sound/bsmt2000.c b/src/emu/sound/bsmt2000.c index e369839eb3d..1d8aca8a5c4 100644 --- a/src/emu/sound/bsmt2000.c +++ b/src/emu/sound/bsmt2000.c @@ -115,7 +115,7 @@ static SND_START( bsmt2000 ) memset(chip, 0, sizeof(*chip)); /* create a stream at a nominal sample rate (real one specified later) */ - chip->stream = stream_create(0, 2, clock / 1000, chip, bsmt2000_update); + chip->stream = stream_create(device, 0, 2, clock / 1000, chip, bsmt2000_update); chip->clock = clock; /* initialize the regions */ diff --git a/src/emu/sound/c140.c b/src/emu/sound/c140.c index fe28a96afac..a585c896513 100644 --- a/src/emu/sound/c140.c +++ b/src/emu/sound/c140.c @@ -466,7 +466,7 @@ static SND_START( c140 ) info->banking_type = intf->banking_type; - info->stream = stream_create(0,2,info->sample_rate,info,update_stereo); + info->stream = stream_create(device,0,2,info->sample_rate,info,update_stereo); info->pRom=device->region; diff --git a/src/emu/sound/c352.c b/src/emu/sound/c352.c index 26ee0272499..f6126ec05c2 100644 --- a/src/emu/sound/c352.c +++ b/src/emu/sound/c352.c @@ -542,7 +542,7 @@ static SND_START( c352 ) info->sample_rate_base = clock / 192; - info->stream = stream_create(0, 4, info->sample_rate_base, info, c352_update); + info->stream = stream_create(device, 0, 4, info->sample_rate_base, info, c352_update); c352_init(info, device); diff --git a/src/emu/sound/c6280.c b/src/emu/sound/c6280.c index 75f50f5cb01..f9cac74350a 100644 --- a/src/emu/sound/c6280.c +++ b/src/emu/sound/c6280.c @@ -322,7 +322,7 @@ static SND_START( c6280 ) c6280_init(info, clock, rate); /* Create stereo stream */ - info->stream = stream_create(0, 2, rate, info, c6280_update); + info->stream = stream_create(device, 0, 2, rate, info, c6280_update); return info; } diff --git a/src/emu/sound/cdda.c b/src/emu/sound/cdda.c index 14122e22fd6..c53a950b945 100644 --- a/src/emu/sound/cdda.c +++ b/src/emu/sound/cdda.c @@ -56,7 +56,7 @@ static SND_START( cdda ) intf = config; - info->stream = stream_create(0, 2, 44100, info, cdda_update); + info->stream = stream_create(device, 0, 2, 44100, info, cdda_update); state_save_register_device_item( device, 0, info->audio_playing ); state_save_register_device_item( device, 0, info->audio_pause ); diff --git a/src/emu/sound/cdp1869.c b/src/emu/sound/cdp1869.c index b15644cb688..87c783f2f6c 100644 --- a/src/emu/sound/cdp1869.c +++ b/src/emu/sound/cdp1869.c @@ -110,7 +110,7 @@ static SND_START( cdp1869 ) info = auto_malloc(sizeof(*info)); memset(info, 0, sizeof(*info)); - info->stream = stream_create(0, 1, device->machine->sample_rate, info, cdp1869_update ); + info->stream = stream_create(device, 0, 1, device->machine->sample_rate, info, cdp1869_update ); info->incr = 0; info->signal = 0x07fff; diff --git a/src/emu/sound/cem3394.c b/src/emu/sound/cem3394.c index 734c5475e66..3d380ff5c18 100644 --- a/src/emu/sound/cem3394.c +++ b/src/emu/sound/cem3394.c @@ -329,7 +329,7 @@ static SND_START( cem3394 ) chip->inv_sample_rate = 1.0 / (double)chip->sample_rate; /* allocate stream channels, 1 per chip */ - chip->stream = stream_create(0, 1, chip->sample_rate, chip, cem3394_update); + chip->stream = stream_create(device, 0, 1, chip->sample_rate, chip, cem3394_update); chip->external = intf->external; chip->vco_zero_freq = intf->vco_zero_freq; chip->filter_zero_freq = intf->filter_zero_freq; diff --git a/src/emu/sound/dac.c b/src/emu/sound/dac.c index 117316e740d..53c2040039c 100644 --- a/src/emu/sound/dac.c +++ b/src/emu/sound/dac.c @@ -108,7 +108,7 @@ static SND_START( dac ) DAC_build_voltable(info); - info->channel = stream_create(0,1,clock ? clock : DEFAULT_SAMPLE_RATE,info,DAC_update); + info->channel = stream_create(device,0,1,clock ? clock : DEFAULT_SAMPLE_RATE,info,DAC_update); info->output = 0; state_save_register_device_item(device, 0, info->output); diff --git a/src/emu/sound/discrete.c b/src/emu/sound/discrete.c index 9b387973aa6..6d91a902f49 100644 --- a/src/emu/sound/discrete.c +++ b/src/emu/sound/discrete.c @@ -68,7 +68,7 @@ discrete_info *discrete_current_context = NULL; static void init_nodes(discrete_info *info, discrete_sound_block *block_list, const device_config *device); static void find_input_nodes(discrete_info *info, discrete_sound_block *block_list); -static void setup_output_nodes(discrete_info *info); +static void setup_output_nodes(const device_config *device, discrete_info *info); static void setup_disc_logs(discrete_info *info); static SND_RESET( discrete ); @@ -314,7 +314,7 @@ static SND_START( discrete ) find_input_nodes(info, intf); /* then set up the output nodes */ - setup_output_nodes(info); + setup_output_nodes(device, info); setup_disc_logs(info); @@ -693,10 +693,10 @@ static void find_input_nodes(discrete_info *info, discrete_sound_block *block_li * *************************************/ -static void setup_output_nodes(discrete_info *info) +static void setup_output_nodes(const device_config *device, discrete_info *info) { /* initialize the stream(s) */ - info->discrete_stream = stream_create(info->discrete_input_streams, info->discrete_outputs, info->sample_rate, info, discrete_stream_update); + info->discrete_stream = stream_create(device, info->discrete_input_streams, info->discrete_outputs, info->sample_rate, info, discrete_stream_update); } diff --git a/src/emu/sound/dmadac.c b/src/emu/sound/dmadac.c index e5a6fabbe0f..4f0c3068aa9 100644 --- a/src/emu/sound/dmadac.c +++ b/src/emu/sound/dmadac.c @@ -106,7 +106,7 @@ static SND_START( dmadac ) info->volume = 0x100; /* allocate a stream channel */ - info->channel = stream_create(0, 1, DEFAULT_SAMPLE_RATE, info, dmadac_update); + info->channel = stream_create(device, 0, 1, DEFAULT_SAMPLE_RATE, info, dmadac_update); /* register with the save state system */ state_save_register_device_item(device, 0, info->bufin); diff --git a/src/emu/sound/es5503.c b/src/emu/sound/es5503.c index ef30af723ef..379442364e5 100644 --- a/src/emu/sound/es5503.c +++ b/src/emu/sound/es5503.c @@ -267,7 +267,7 @@ static SND_START( es5503 ) chip->oscsenabled = 1; chip->output_rate = (clock/8)/34; // (input clock / 8) / # of oscs. enabled + 2 - chip->stream = stream_create(0, 2, chip->output_rate, chip, es5503_pcm_update); + chip->stream = stream_create(device, 0, 2, chip->output_rate, chip, es5503_pcm_update); return chip; } diff --git a/src/emu/sound/es5506.c b/src/emu/sound/es5506.c index 0889039935a..e728f511d7e 100644 --- a/src/emu/sound/es5506.c +++ b/src/emu/sound/es5506.c @@ -839,7 +839,7 @@ static void *es5506_start_common(const device_config *device, int sndindex, int return NULL; /* create the stream */ - chip->stream = stream_create(0, 2, clock / (16*32), chip, es5506_update); + chip->stream = stream_create(device, 0, 2, clock / (16*32), chip, es5506_update); /* initialize the regions */ chip->region_base[0] = intf->region0 ? (UINT16 *)memory_region(device->machine, intf->region0) : NULL; diff --git a/src/emu/sound/es8712.c b/src/emu/sound/es8712.c index 9f590d90038..081a456cb7c 100644 --- a/src/emu/sound/es8712.c +++ b/src/emu/sound/es8712.c @@ -224,7 +224,7 @@ static SND_START( es8712 ) chip->region_base = device->region; /* generate the name and create the stream */ - chip->stream = stream_create(0, 1, clock, chip, es8712_update); + chip->stream = stream_create(device, 0, 1, clock, chip, es8712_update); /* initialize the rest of the structure */ chip->signal = -2; diff --git a/src/emu/sound/flt_rc.c b/src/emu/sound/flt_rc.c index 8a83fd95aa5..ea576abbb62 100644 --- a/src/emu/sound/flt_rc.c +++ b/src/emu/sound/flt_rc.c @@ -88,7 +88,7 @@ static SND_START( filter_rc ) info = auto_malloc(sizeof(*info)); memset(info, 0, sizeof(*info)); - info->stream = stream_create(1, 1, device->machine->sample_rate, info, filter_rc_update); + info->stream = stream_create(device, 1, 1, device->machine->sample_rate, info, filter_rc_update); if (conf) set_RC_info(info, conf->type, conf->R1, conf->R2, conf->R3, conf->C); else diff --git a/src/emu/sound/flt_vol.c b/src/emu/sound/flt_vol.c index 6a2baeed350..914ca7aa993 100644 --- a/src/emu/sound/flt_vol.c +++ b/src/emu/sound/flt_vol.c @@ -30,7 +30,7 @@ static SND_START( filter_volume ) memset(info, 0, sizeof(*info)); info->gain = 0x100; - info->stream = stream_create(1, 1, device->machine->sample_rate, info, filter_volume_update); + info->stream = stream_create(device, 1, 1, device->machine->sample_rate, info, filter_volume_update); return info; } diff --git a/src/emu/sound/gaelco.c b/src/emu/sound/gaelco.c index ac4788294d9..cf112ed0c05 100644 --- a/src/emu/sound/gaelco.c +++ b/src/emu/sound/gaelco.c @@ -257,7 +257,7 @@ static void *gaelcosnd_start(sound_type sndtype, const device_config *device, in for (j = 0; j < 4; j++){ info->banks[j] = intf->banks[j]; } - info->stream = stream_create(0, 2, 8000, info, gaelco_update); + info->stream = stream_create(device, 0, 2, 8000, info, gaelco_update); info->snd_data = (UINT8 *)memory_region(device->machine, intf->gfxregion); if (info->snd_data == NULL) info->snd_data = device->region; diff --git a/src/emu/sound/hc55516.c b/src/emu/sound/hc55516.c index 4368e453af1..70aef19d72c 100644 --- a/src/emu/sound/hc55516.c +++ b/src/emu/sound/hc55516.c @@ -72,7 +72,7 @@ static void *start_common(const device_config *device, int clock, chip->last_clock_state = 0; /* create the stream */ - chip->channel = stream_create(0, 1, SAMPLE_RATE, chip, hc55516_update); + chip->channel = stream_create(device, 0, 1, SAMPLE_RATE, chip, hc55516_update); state_save_register_device_item(device, 0, chip->last_clock_state); state_save_register_device_item(device, 0, chip->digit); diff --git a/src/emu/sound/ics2115.c b/src/emu/sound/ics2115.c index 481aa9aca65..7ba7e449c22 100644 --- a/src/emu/sound/ics2115.c +++ b/src/emu/sound/ics2115.c @@ -454,7 +454,7 @@ static SND_START( ics2115 ) chip->timer[0].timer = timer_alloc(device->machine, timer_cb_0, chip); chip->timer[1].timer = timer_alloc(device->machine, timer_cb_1, chip); chip->ulaw = auto_malloc(256*sizeof(INT16)); - chip->stream = stream_create(0, 2, 33075, chip, update); + chip->stream = stream_create(device, 0, 2, 33075, chip, update); for(i=0; i<256; i++) { UINT8 c = ~i; diff --git a/src/emu/sound/iremga20.c b/src/emu/sound/iremga20.c index 102c6abaa25..ac3b0deee00 100644 --- a/src/emu/sound/iremga20.c +++ b/src/emu/sound/iremga20.c @@ -246,7 +246,7 @@ static SND_START( iremga20 ) for ( i = 0; i < 0x40; i++ ) chip->regs[i] = 0; - chip->stream = stream_create( 0, 2, clock/4, chip, IremGA20_update ); + chip->stream = stream_create( device, 0, 2, clock/4, chip, IremGA20_update ); state_save_register_device_item_array(device, sndindex, chip->regs); for (i = 0; i < 4; i++) diff --git a/src/emu/sound/k005289.c b/src/emu/sound/k005289.c index 45a2fb2a4eb..8a4a56ad7bc 100644 --- a/src/emu/sound/k005289.c +++ b/src/emu/sound/k005289.c @@ -161,7 +161,7 @@ static SND_START( k005289 ) /* get stream channels */ info->rate = clock/16; - info->stream = stream_create(0, 1, info->rate, info, K005289_update); + info->stream = stream_create(device, 0, 1, info->rate, info, K005289_update); info->mclock = clock; /* allocate a pair of buffers to mix into - 1 second's worth should be more than enough */ diff --git a/src/emu/sound/k007232.c b/src/emu/sound/k007232.c index 91f43236f6b..5e6653b9f47 100644 --- a/src/emu/sound/k007232.c +++ b/src/emu/sound/k007232.c @@ -326,7 +326,7 @@ static SND_START( k007232 ) for( i = 0; i < 0x10; i++ ) info->wreg[i] = 0; - info->stream = stream_create(0,2,clock/128,info,KDAC_A_update); + info->stream = stream_create(device,0,2,clock/128,info,KDAC_A_update); KDAC_A_make_fncode(info); diff --git a/src/emu/sound/k051649.c b/src/emu/sound/k051649.c index 084ff0b1323..fc9a750c600 100644 --- a/src/emu/sound/k051649.c +++ b/src/emu/sound/k051649.c @@ -136,7 +136,7 @@ static SND_START( k051649 ) /* get stream channels */ info->rate = clock/16; - info->stream = stream_create(0, 1, info->rate, info, k051649_update); + info->stream = stream_create(device, 0, 1, info->rate, info, k051649_update); info->mclock = clock; /* allocate a buffer to mix into - 1 second's worth should be more than enough */ diff --git a/src/emu/sound/k053260.c b/src/emu/sound/k053260.c index 1f634f33d39..6ba6437cbe4 100644 --- a/src/emu/sound/k053260.c +++ b/src/emu/sound/k053260.c @@ -227,7 +227,7 @@ static SND_START( k053260 ) ic->delta_table = ( unsigned long * )auto_malloc( 0x1000 * sizeof( unsigned long ) ); - ic->channel = stream_create( 0, 2, rate, ic, k053260_update ); + ic->channel = stream_create( device, 0, 2, rate, ic, k053260_update ); InitDeltaTable( ic, rate, clock ); diff --git a/src/emu/sound/k054539.c b/src/emu/sound/k054539.c index a962d9efe86..59a8814406e 100644 --- a/src/emu/sound/k054539.c +++ b/src/emu/sound/k054539.c @@ -466,7 +466,7 @@ static void k054539_init_chip(const device_config *device, struct k054539_info * // 480 hz is TRUSTED by gokuparo disco stage - the looping sample doesn't line up otherwise timer_pulse(device->machine, ATTOTIME_IN_HZ(480), info, 0, k054539_irq); - info->stream = stream_create(0, 2, clock, info, k054539_update); + info->stream = stream_create(device, 0, 2, clock, info, k054539_update); state_save_register_device_item_array(device, 0, info->regs); state_save_register_device_item_pointer(device, 0, info->ram, 0x4000); diff --git a/src/emu/sound/msm5205.c b/src/emu/sound/msm5205.c index c1dbcd13854..a5c25913a5b 100644 --- a/src/emu/sound/msm5205.c +++ b/src/emu/sound/msm5205.c @@ -188,7 +188,7 @@ static SND_START( msm5205 ) ComputeTables (voice); /* stream system initialize */ - voice->stream = stream_create(0,1,clock,voice,MSM5205_update); + voice->stream = stream_create(device,0,1,clock,voice,MSM5205_update); voice->timer = timer_alloc(device->machine, MSM5205_vclk_callback, voice); /* initialize */ diff --git a/src/emu/sound/msm5232.c b/src/emu/sound/msm5232.c index 4d841a07b9e..794b2b275cb 100644 --- a/src/emu/sound/msm5232.c +++ b/src/emu/sound/msm5232.c @@ -789,7 +789,7 @@ static SND_START( msm5232 ) msm5232_init(chip, intf, clock, rate); - chip->stream = stream_create(0,11,rate,chip,MSM5232_update_one); + chip->stream = stream_create(device,0,11,rate,chip,MSM5232_update_one); return chip; } diff --git a/src/emu/sound/multipcm.c b/src/emu/sound/multipcm.c index 91e85adbc07..7ce6bbf9432 100644 --- a/src/emu/sound/multipcm.c +++ b/src/emu/sound/multipcm.c @@ -496,7 +496,7 @@ static SND_START( multipcm ) ptChip->ROM=(INT8 *)device->region; ptChip->Rate=(float) clock / MULTIPCM_CLOCKDIV; - ptChip->stream = stream_create(0, 2, ptChip->Rate, ptChip, MultiPCM_update); + ptChip->stream = stream_create(device, 0, 2, ptChip->Rate, ptChip, MultiPCM_update); //Volume+pan table for(i=0;i<0x800;++i) diff --git a/src/emu/sound/n63701x.c b/src/emu/sound/n63701x.c index 7ae40e9faaf..24a05b19a0d 100644 --- a/src/emu/sound/n63701x.c +++ b/src/emu/sound/n63701x.c @@ -108,7 +108,7 @@ static SND_START( namco_63701x ) chip->rom = device->region; - chip->stream = stream_create(0, 2, clock/1000, chip, namco_63701x_update); + chip->stream = stream_create(device, 0, 2, clock/1000, chip, namco_63701x_update); return chip; } diff --git a/src/emu/sound/namco.c b/src/emu/sound/namco.c index 8916597bbd0..9e10150a94a 100644 --- a/src/emu/sound/namco.c +++ b/src/emu/sound/namco.c @@ -386,9 +386,9 @@ static SND_START( namco ) /* get stream channels */ if (intf->stereo) - chip->stream = stream_create(0, 2, chip->sample_rate, chip, namco_update_stereo); + chip->stream = stream_create(device, 0, 2, chip->sample_rate, chip, namco_update_stereo); else - chip->stream = stream_create(0, 1, chip->sample_rate, chip, namco_update_mono); + chip->stream = stream_create(device, 0, 1, chip->sample_rate, chip, namco_update_mono); /* start with sound enabled, many games don't have a sound enable register */ chip->sound_enable = 1; diff --git a/src/emu/sound/namco52.c b/src/emu/sound/namco52.c index e5fcddc9b5c..66db4cedd44 100644 --- a/src/emu/sound/namco52.c +++ b/src/emu/sound/namco52.c @@ -157,7 +157,7 @@ static SND_START( namco_52xx ) filter2_setup(FILTER_LOWPASS, chip->intf->lp_filt_fc, Q_TO_DAMP(chip->intf->lp_filt_q), chip->intf->filt_gain, &chip->n52_lp_filter); - chip->stream = stream_create(0, 1, rate, chip, namco_52xx_stream_update_one); + chip->stream = stream_create(device, 0, 1, rate, chip, namco_52xx_stream_update_one); namco_52xx_reset(chip); diff --git a/src/emu/sound/nes_apu.c b/src/emu/sound/nes_apu.c index 1353134cdc6..352f00348e0 100644 --- a/src/emu/sound/nes_apu.c +++ b/src/emu/sound/nes_apu.c @@ -696,7 +696,7 @@ static SND_START( nesapu ) /* Initialize individual chips */ (info->APU.dpcm).memory = cputag_get_address_space(device->machine, intf->cpu_tag, ADDRESS_SPACE_PROGRAM); - info->stream = stream_create(0, 1, rate, info, nes_psg_update_sound); + info->stream = stream_create(device, 0, 1, rate, info, nes_psg_update_sound); /* register for save */ for (i = 0; i < 2; i++) diff --git a/src/emu/sound/nile.c b/src/emu/sound/nile.c index 1672f8e3f9c..f8571f2c1b7 100644 --- a/src/emu/sound/nile.c +++ b/src/emu/sound/nile.c @@ -225,7 +225,7 @@ static SND_START( nile ) info->sound_ram = device->region; - info->stream = stream_create(0, 2, 44100, info, nile_update); + info->stream = stream_create(device, 0, 2, 44100, info, nile_update); return info; } diff --git a/src/emu/sound/okim6258.c b/src/emu/sound/okim6258.c index 262d072cfa0..6abcf057ee0 100644 --- a/src/emu/sound/okim6258.c +++ b/src/emu/sound/okim6258.c @@ -199,7 +199,7 @@ static SND_START( okim6258 ) info->output_bits = intf->output_12bits ? 12 : 10; info->divider = dividers[intf->divider]; - info->stream = stream_create(0, 1, clock/info->divider, info, okim6258_update); + info->stream = stream_create(device, 0, 1, clock/info->divider, info, okim6258_update); info->signal = -2; info->step = 0; diff --git a/src/emu/sound/okim6295.c b/src/emu/sound/okim6295.c index 35e6d59bd00..902a6c1b2a4 100644 --- a/src/emu/sound/okim6295.c +++ b/src/emu/sound/okim6295.c @@ -338,7 +338,7 @@ static SND_START( okim6295 ) info->master_clock = clock; /* generate the name and create the stream */ - info->stream = stream_create(0, 1, clock/divisor, info, okim6295_update); + info->stream = stream_create(device, 0, 1, clock/divisor, info, okim6295_update); /* initialize the voices */ for (voice = 0; voice < OKIM6295_VOICES; voice++) diff --git a/src/emu/sound/pokey.c b/src/emu/sound/pokey.c index 49efad7a1c6..f7ee36a58e0 100644 --- a/src/emu/sound/pokey.c +++ b/src/emu/sound/pokey.c @@ -664,7 +664,7 @@ static SND_START( pokey ) chip->serout_w = chip->intf.serout_w; chip->interrupt_cb = chip->intf.interrupt_cb; - chip->channel = stream_create(0, 1, sample_rate, chip, pokey_update); + chip->channel = stream_create(device, 0, 1, sample_rate, chip, pokey_update); register_for_save(chip, device); diff --git a/src/emu/sound/psx.c b/src/emu/sound/psx.c index 23d9cd26d50..01a481dd8da 100644 --- a/src/emu/sound/psx.c +++ b/src/emu/sound/psx.c @@ -349,7 +349,7 @@ static SND_START( psxspu ) chip->intf->spu_install_read_handler( 4, spu_read ); chip->intf->spu_install_write_handler( 4, spu_write ); - chip->stream = stream_create( 0, 2, 44100, chip, PSXSPU_update ); + chip->stream = stream_create( device, 0, 2, 44100, chip, PSXSPU_update ); return chip; } diff --git a/src/emu/sound/qsound.c b/src/emu/sound/qsound.c index 5375869d85c..c2bd44422d7 100644 --- a/src/emu/sound/qsound.c +++ b/src/emu/sound/qsound.c @@ -120,7 +120,7 @@ static SND_START( qsound ) { /* Allocate stream */ chip->stream = stream_create( - 0, 2, + device, 0, 2, clock / QSOUND_CLOCKDIV, chip, qsound_update ); diff --git a/src/emu/sound/rf5c400.c b/src/emu/sound/rf5c400.c index 4f3a6e6a5a9..e4dae140eb3 100644 --- a/src/emu/sound/rf5c400.c +++ b/src/emu/sound/rf5c400.c @@ -334,7 +334,7 @@ static void rf5c400_init_chip(const device_config *device, struct rf5c400_info * state_save_register_device_item(device, i, info->channels[i].env_scale); } - info->stream = stream_create(0, 2, clock/384, info, rf5c400_update); + info->stream = stream_create(device, 0, 2, clock/384, info, rf5c400_update); } diff --git a/src/emu/sound/rf5c68.c b/src/emu/sound/rf5c68.c index f999012fee8..4efa837ac74 100644 --- a/src/emu/sound/rf5c68.c +++ b/src/emu/sound/rf5c68.c @@ -129,7 +129,7 @@ static SND_START( rf5c68 ) memset(chip->data, 0xff, sizeof(chip->data)); /* allocate the stream */ - chip->stream = stream_create(0, 2, clock / 384, chip, rf5c68_update); + chip->stream = stream_create(device, 0, 2, clock / 384, chip, rf5c68_update); return chip; } diff --git a/src/emu/sound/s14001a.c b/src/emu/sound/s14001a.c index d30d0adc212..5b8adbe2c70 100644 --- a/src/emu/sound/s14001a.c +++ b/src/emu/sound/s14001a.c @@ -578,7 +578,7 @@ static SND_START( s14001a ) chip->SpeechRom = device->region; - chip->stream = stream_create(0, 1, clock ? clock : device->machine->sample_rate, chip, s14001a_pcm_update); + chip->stream = stream_create(device, 0, 1, clock ? clock : device->machine->sample_rate, chip, s14001a_pcm_update); return chip; } diff --git a/src/emu/sound/saa1099.c b/src/emu/sound/saa1099.c index 0a8e59b66e0..7018442acb9 100644 --- a/src/emu/sound/saa1099.c +++ b/src/emu/sound/saa1099.c @@ -322,7 +322,7 @@ static SND_START( saa1099 ) saa->sample_rate = clock / 256; /* for each chip allocate one stream */ - saa->stream = stream_create(0, 2, saa->sample_rate, saa, saa1099_update); + saa->stream = stream_create(device, 0, 2, saa->sample_rate, saa, saa1099_update); return saa; } diff --git a/src/emu/sound/samples.c b/src/emu/sound/samples.c index 9220e482808..b45190a767b 100644 --- a/src/emu/sound/samples.c +++ b/src/emu/sound/samples.c @@ -545,11 +545,11 @@ static SND_START( samples ) /* allocate channels */ info->numchannels = intf->channels; - assert(info->numchannels < MAX_CHANNELS); + assert(info->numchannels < MAX_CHANNELS); info->channel = auto_malloc(sizeof(*info->channel) * info->numchannels); for (i = 0; i < info->numchannels; i++) { - info->channel[i].stream = stream_create(0, 1, device->machine->sample_rate, &info->channel[i], sample_update_sound); + info->channel[i].stream = stream_create(device, 0, 1, device->machine->sample_rate, &info->channel[i], sample_update_sound); info->channel[i].source = NULL; info->channel[i].source_num = -1; diff --git a/src/emu/sound/scsp.c b/src/emu/sound/scsp.c index 5794f3d4e9f..d301bfb6090 100644 --- a/src/emu/sound/scsp.c +++ b/src/emu/sound/scsp.c @@ -1239,7 +1239,7 @@ static SND_START( scsp ) { SCSP->Int68kCB = intf->irq_callback; - SCSP->stream = stream_create(0, 2, 44100, SCSP, SCSP_Update); + SCSP->stream = stream_create(device, 0, 2, 44100, SCSP, SCSP_Update); } return SCSP; diff --git a/src/emu/sound/segapcm.c b/src/emu/sound/segapcm.c index 19e4060ceaf..38dc5b6cb07 100644 --- a/src/emu/sound/segapcm.c +++ b/src/emu/sound/segapcm.c @@ -101,7 +101,7 @@ static SND_START( segapcm ) spcm->bankmask = mask & (rom_mask >> spcm->bankshift); - spcm->stream = stream_create(0, 2, clock / 128, spcm, SEGAPCM_update); + spcm->stream = stream_create(device, 0, 2, clock / 128, spcm, SEGAPCM_update); state_save_register_device_item_array(device, 0, spcm->low); state_save_register_device_item_pointer(device, 0, spcm->ram, 0x800); diff --git a/src/emu/sound/sid6581.c b/src/emu/sound/sid6581.c index 3dd173a3776..219c781e022 100644 --- a/src/emu/sound/sid6581.c +++ b/src/emu/sound/sid6581.c @@ -37,7 +37,7 @@ static void *sid_start(const device_config *device, int clock, SIDTYPE sidtype) sid = (SID6581 *) auto_malloc(sizeof(*sid)); memset(sid, 0, sizeof(*sid)); - sid->mixer_channel = stream_create (0, 1, device->machine->sample_rate, (void *) sid, sid_update); + sid->mixer_channel = stream_create (device, 0, 1, device->machine->sample_rate, (void *) sid, sid_update); sid->PCMfreq = device->machine->sample_rate; sid->clock = clock; sid->ad_read = iface ? iface->ad_read : NULL; diff --git a/src/emu/sound/sn76477.c b/src/emu/sound/sn76477.c index 0f85990a503..62bafbadeac 100644 --- a/src/emu/sound/sn76477.c +++ b/src/emu/sound/sn76477.c @@ -2404,7 +2404,7 @@ static SND_START( sn76477 ) sn->device = device; - sn->channel = stream_create(0, 1, device->machine->sample_rate, sn, SN76477_update); + sn->channel = stream_create(device, 0, 1, device->machine->sample_rate, sn, SN76477_update); if (clock > 0) { diff --git a/src/emu/sound/sn76496.c b/src/emu/sound/sn76496.c index 3d40278d7c6..b6a9ea92961 100644 --- a/src/emu/sound/sn76496.c +++ b/src/emu/sound/sn76496.c @@ -278,12 +278,12 @@ static void SN76496_set_gain(struct SN76496 *R,int gain) -static int SN76496_init(struct SN76496 *R,int clock) +static int SN76496_init(const device_config *device, int clock, struct SN76496 *R) { int sample_rate = clock/16; int i; - R->Channel = stream_create(0,1, sample_rate,R,SN76496Update); + R->Channel = stream_create(device,0,1,sample_rate,R,SN76496Update); R->SampleRate = sample_rate; @@ -321,7 +321,7 @@ static void *generic_start(const device_config *device, int clock, int feedbackm chip = auto_malloc(sizeof(*chip)); memset(chip, 0, sizeof(*chip)); - if (SN76496_init(chip,clock) != 0) + if (SN76496_init(device,clock,chip) != 0) return NULL; SN76496_set_gain(chip, 0); diff --git a/src/emu/sound/snkwave.c b/src/emu/sound/snkwave.c index 46187fa2688..e83be659089 100644 --- a/src/emu/sound/snkwave.c +++ b/src/emu/sound/snkwave.c @@ -115,7 +115,7 @@ static SND_START( snkwave ) chip->sample_rate = chip->external_clock >> CLOCK_SHIFT; /* get stream channels */ - chip->stream = stream_create(0, 1, chip->sample_rate, chip, snkwave_update); + chip->stream = stream_create(device, 0, 1, chip->sample_rate, chip, snkwave_update); /* reset all the voices */ chip->frequency = 0; diff --git a/src/emu/sound/sp0250.c b/src/emu/sound/sp0250.c index 825667a778b..c33115d0947 100644 --- a/src/emu/sound/sp0250.c +++ b/src/emu/sound/sp0250.c @@ -202,7 +202,7 @@ static SND_START( sp0250 ) sp->drq(ASSERT_LINE); timer_pulse(device->machine, attotime_mul(ATTOTIME_IN_HZ(clock), CLOCK_DIVIDER), sp, 0, sp0250_timer_tick); - sp->stream = stream_create(0, 1, clock / CLOCK_DIVIDER, sp, sp0250_update); + sp->stream = stream_create(device, 0, 1, clock / CLOCK_DIVIDER, sp, sp0250_update); return sp; } diff --git a/src/emu/sound/sp0256.c b/src/emu/sound/sp0256.c index b8df5a7ad88..151de405553 100644 --- a/src/emu/sound/sp0256.c +++ b/src/emu/sound/sp0256.c @@ -1180,7 +1180,7 @@ static SND_START( sp0256 ) if( sp->drq ) sp->drq(ASSERT_LINE); if( sp->sby ) sp->sby(sp->sby_line = ASSERT_LINE); - sp->stream = stream_create(0, 1, clock / CLOCK_DIVIDER, sp, sp0256_update); + sp->stream = stream_create(device, 0, 1, clock / CLOCK_DIVIDER, sp, sp0256_update); /* -------------------------------------------------------------------- */ /* Configure our internal variables. */ diff --git a/src/emu/sound/speaker.c b/src/emu/sound/speaker.c index 264f19677b6..dce69a40774 100644 --- a/src/emu/sound/speaker.c +++ b/src/emu/sound/speaker.c @@ -39,7 +39,7 @@ static SND_START( speaker ) { struct speaker *sp = auto_malloc(sizeof(*sp)); - sp->channel = stream_create(0, 1, device->machine->sample_rate, sp, speaker_sound_update); + sp->channel = stream_create(device, 0, 1, device->machine->sample_rate, sp, speaker_sound_update); sp->num_levels = 2; sp->levels = default_levels; sp->level = 0; diff --git a/src/emu/sound/st0016.c b/src/emu/sound/st0016.c index 9cfa9bba02d..8bcd6b7fd57 100644 --- a/src/emu/sound/st0016.c +++ b/src/emu/sound/st0016.c @@ -134,7 +134,7 @@ static SND_START( st0016 ) info->sound_ram = intf->p_soundram; - info->stream = stream_create(0, 2, 44100, info, st0016_update); + info->stream = stream_create(device, 0, 2, 44100, info, st0016_update); return info; } diff --git a/src/emu/sound/tiaintf.c b/src/emu/sound/tiaintf.c index 07a9bb69516..827b21d5125 100644 --- a/src/emu/sound/tiaintf.c +++ b/src/emu/sound/tiaintf.c @@ -24,7 +24,7 @@ static SND_START( tia ) info = auto_malloc(sizeof(*info)); memset(info, 0, sizeof(*info)); - info->channel = stream_create(0, 1, clock, info, tia_update); + info->channel = stream_create(device, 0, 1, clock, info, tia_update); info->chip = tia_sound_init(clock, clock, 16); if (!info->chip) diff --git a/src/emu/sound/tms3615.c b/src/emu/sound/tms3615.c index 3c0ab0e3032..d0c5bc5f49a 100644 --- a/src/emu/sound/tms3615.c +++ b/src/emu/sound/tms3615.c @@ -84,7 +84,7 @@ static SND_START( tms3615 ) tms = auto_malloc(sizeof(*tms)); memset(tms, 0, sizeof(*tms)); - tms->channel = stream_create(0, 2, clock/8, tms, tms3615_sound_update); + tms->channel = stream_create(device, 0, 2, clock/8, tms, tms3615_sound_update); tms->samplerate = clock/8; tms->basefreq = clock; diff --git a/src/emu/sound/tms36xx.c b/src/emu/sound/tms36xx.c index 0506c78e411..90841c1f56a 100644 --- a/src/emu/sound/tms36xx.c +++ b/src/emu/sound/tms36xx.c @@ -496,7 +496,7 @@ static SND_START( tms36xx ) tms->intf = config; - tms->channel = stream_create(0, 1, clock * 64, tms, tms36xx_sound_update); + tms->channel = stream_create(device, 0, 1, clock * 64, tms, tms36xx_sound_update); tms->samplerate = clock * 64; tms->basefreq = clock; enable = 0; diff --git a/src/emu/sound/upd7759.c b/src/emu/sound/upd7759.c index 681b6513e75..d6f42049096 100644 --- a/src/emu/sound/upd7759.c +++ b/src/emu/sound/upd7759.c @@ -635,7 +635,7 @@ static SND_START( upd7759 ) memset(chip, 0, sizeof(*chip)); /* allocate a stream channel */ - chip->channel = stream_create(0, 1, clock/4, chip, upd7759_update); + chip->channel = stream_create(device, 0, 1, clock/4, chip, upd7759_update); /* compute the stepping rate based on the chip's clock speed */ chip->step = 4 * FRAC_ONE; diff --git a/src/emu/sound/vlm5030.c b/src/emu/sound/vlm5030.c index c8221239aa7..30d35bb14d1 100644 --- a/src/emu/sound/vlm5030.c +++ b/src/emu/sound/vlm5030.c @@ -664,7 +664,7 @@ static SND_START( vlm5030 ) else chip->address_mask = chip->intf->memory_size-1; - chip->channel = stream_create(0, 1, emulation_rate,chip,vlm5030_update_callback); + chip->channel = stream_create(device, 0, 1, emulation_rate,chip,vlm5030_update_callback); /* don't restore "UINT8 *chip->rom" when use vlm5030_set_rom() */ diff --git a/src/emu/sound/votrax.c b/src/emu/sound/votrax.c index 71c581017ee..8a6312457e8 100644 --- a/src/emu/sound/votrax.c +++ b/src/emu/sound/votrax.c @@ -111,7 +111,7 @@ static SND_START( votrax ) votrax->frequency = 8000; votrax->volume = 230; - votrax->channel = stream_create(0, 1, device->machine->sample_rate, votrax, votrax_update_sound); + votrax->channel = stream_create(device, 0, 1, device->machine->sample_rate, votrax, votrax_update_sound); votrax->sample = NULL; votrax->step = 0; diff --git a/src/emu/sound/vrender0.c b/src/emu/sound/vrender0.c index 4e77dd33908..137cadf70a0 100644 --- a/src/emu/sound/vrender0.c +++ b/src/emu/sound/vrender0.c @@ -107,7 +107,7 @@ static SND_START( vrender0 ) memcpy(&(VR0->Intf),intf,sizeof(vr0_interface)); memset(VR0->SOUNDREGS,0,sizeof(VR0->SOUNDREGS)); - VR0->stream = stream_create(0, 2, 44100, VR0, VR0_Update); + VR0->stream = stream_create(device, 0, 2, 44100, VR0, VR0_Update); return VR0; } diff --git a/src/emu/sound/wave.c b/src/emu/sound/wave.c index 6f34df58a09..ad88ac4ec8a 100644 --- a/src/emu/sound/wave.c +++ b/src/emu/sound/wave.c @@ -64,7 +64,7 @@ static SND_START( wave ) #ifdef MESS image = device_list_find_by_tag( device->machine->config->devicelist, CASSETTE, device->tag ); #endif - stream_create(0, 1, device->machine->sample_rate, (void *)image, wave_sound_update); + stream_create(device, 0, 1, device->machine->sample_rate, (void *)image, wave_sound_update); return (void *) (FPTR)(sndindex | WAVE_TOKEN_MASK); } diff --git a/src/emu/sound/x1_010.c b/src/emu/sound/x1_010.c index 3cb79b44e9c..66896f853b2 100644 --- a/src/emu/sound/x1_010.c +++ b/src/emu/sound/x1_010.c @@ -213,7 +213,7 @@ static SND_START( x1_010 ) LOG_SOUND(("masterclock = %d rate = %d\n", clock, info->rate )); /* get stream channels */ - info->stream = stream_create(0,2,info->rate,info,seta_update); + info->stream = stream_create(device,0,2,info->rate,info,seta_update); return info; } diff --git a/src/emu/sound/ymf271.c b/src/emu/sound/ymf271.c index 01ae88e6363..5a926d20480 100644 --- a/src/emu/sound/ymf271.c +++ b/src/emu/sound/ymf271.c @@ -1756,7 +1756,7 @@ static SND_START( ymf271 ) intf = (config != NULL) ? config : &defintrf; ymf271_init(device, chip, device->region, intf->irq_callback, intf->ext_read, intf->ext_write); - chip->stream = stream_create(0, 2, clock/384, chip, ymf271_update); + chip->stream = stream_create(device, 0, 2, clock/384, chip, ymf271_update); for (i = 0; i < 256; i++) { diff --git a/src/emu/sound/ymf278b.c b/src/emu/sound/ymf278b.c index 64285e5f14a..7c5b71de74d 100644 --- a/src/emu/sound/ymf278b.c +++ b/src/emu/sound/ymf278b.c @@ -680,7 +680,7 @@ static SND_START( ymf278b ) intf = (config != NULL) ? config : &defintrf; ymf278b_init(device->machine, chip, device->region, intf->irq_callback, clock); - chip->stream = stream_create(0, 2, clock/768, chip, ymf278b_pcm_update); + chip->stream = stream_create(device, 0, 2, clock/768, chip, ymf278b_pcm_update); // Volume table, 1 = -0.375dB, 8 = -3dB, 256 = -96dB for(i = 0; i < 256; i++) diff --git a/src/emu/sound/ymz280b.c b/src/emu/sound/ymz280b.c index 180b07dea19..19ce83ae373 100644 --- a/src/emu/sound/ymz280b.c +++ b/src/emu/sound/ymz280b.c @@ -648,7 +648,7 @@ static SND_START( ymz280b ) chip->irq_callback = intf->irq_callback; /* create the stream */ - chip->stream = stream_create(0, 2, INTERNAL_SAMPLE_RATE, chip, ymz280b_update); + chip->stream = stream_create(device, 0, 2, INTERNAL_SAMPLE_RATE, chip, ymz280b_update); /* allocate memory */ chip->scratch = auto_malloc(sizeof(chip->scratch[0]) * MAX_SAMPLE_CHUNK); diff --git a/src/emu/streams.c b/src/emu/streams.c index cf9809f11f1..3f7d17a0370 100644 --- a/src/emu/streams.c +++ b/src/emu/streams.c @@ -45,7 +45,6 @@ #include "driver.h" #include "streams.h" -#include "deprecat.h" @@ -348,9 +347,9 @@ void streams_update(running_machine *machine) stream_create - create a new stream -------------------------------------------------*/ -sound_stream *stream_create(int inputs, int outputs, int sample_rate, void *param, stream_update_func callback) +sound_stream *stream_create(const device_config *device, int inputs, int outputs, int sample_rate, void *param, stream_update_func callback) { - running_machine *machine = Machine; + running_machine *machine = device->machine; streams_private *strdata = machine->streams_data; int inputnum, outputnum; sound_stream *stream; diff --git a/src/emu/streams.h b/src/emu/streams.h index 0b95e78f870..edbc685e8d5 100644 --- a/src/emu/streams.h +++ b/src/emu/streams.h @@ -46,7 +46,7 @@ void streams_update(running_machine *machine); /* ----- stream configuration and setup ----- */ /* create a new stream */ -sound_stream *stream_create(int inputs, int outputs, int sample_rate, void *param, stream_update_func callback); +sound_stream *stream_create(const device_config *device, int inputs, int outputs, int sample_rate, void *param, stream_update_func callback); /* configure a stream's input */ void stream_set_input(sound_stream *stream, int index, sound_stream *input_stream, int output_index, float gain); diff --git a/src/mame/audio/amiga.c b/src/mame/audio/amiga.c index 8685f8bfed3..0a59e3040a5 100644 --- a/src/mame/audio/amiga.c +++ b/src/mame/audio/amiga.c @@ -277,6 +277,6 @@ CUSTOM_START( amiga_sh_start ) } /* create the stream */ - audio_state->stream = stream_create(0, 4, clock / CLOCK_DIVIDER, audio_state, amiga_stream_update); + audio_state->stream = stream_create(device, 0, 4, clock / CLOCK_DIVIDER, audio_state, amiga_stream_update); return audio_state; } diff --git a/src/mame/audio/attckufo.c b/src/mame/audio/attckufo.c index c21eaacdf92..d60edd763d3 100644 --- a/src/mame/audio/attckufo.c +++ b/src/mame/audio/attckufo.c @@ -212,7 +212,7 @@ CUSTOM_START( attckufo_custom_start ) { int i; - channel = stream_create(0, 1, OUTPUT_RATE, 0, attckufo_update); + channel = stream_create(device, 0, 1, OUTPUT_RATE, 0, attckufo_update); /* buffer for fastest played sample for 5 second diff --git a/src/mame/audio/bzone.c b/src/mame/audio/bzone.c index 6bc8fa263fe..2d704e5bde2 100644 --- a/src/mame/audio/bzone.c +++ b/src/mame/audio/bzone.c @@ -273,13 +273,13 @@ static void bzone_sound_update(void *param, stream_sample_t **inputs, stream_sam CUSTOM_START( bzone_sh_start ) { - int i; + int i; discharge = (INT16 *)auto_malloc(32768 * sizeof(INT16)); - for( i = 0; i < 0x8000; i++ ) + for( i = 0; i < 0x8000; i++ ) discharge[0x7fff-i] = (INT16) (0x7fff/exp(1.0*i/4096)); - channel = stream_create(0, 1, OUTPUT_RATE, 0, bzone_sound_update); + channel = stream_create(device, 0, 1, OUTPUT_RATE, 0, bzone_sound_update); - return auto_malloc(1); + return auto_malloc(1); } diff --git a/src/mame/audio/cps3.c b/src/mame/audio/cps3.c index c6ca66e7841..455d3f52902 100644 --- a/src/mame/audio/cps3.c +++ b/src/mame/audio/cps3.c @@ -100,7 +100,7 @@ static void cps3_stream_update(void *param, stream_sample_t **inputs, stream_sam CUSTOM_START( cps3_sh_start ) { /* Allocate the stream */ - cps3_stream = stream_create(0, 2, clock / 384, NULL, cps3_stream_update); + cps3_stream = stream_create(device, 0, 2, clock / 384, NULL, cps3_stream_update); memset(&chip, 0, sizeof(chip)); diff --git a/src/mame/audio/exidy.c b/src/mame/audio/exidy.c index f7de8976573..7fdd1b6bef2 100644 --- a/src/mame/audio/exidy.c +++ b/src/mame/audio/exidy.c @@ -337,14 +337,14 @@ static void exidy_stream_update(void *param, stream_sample_t **inputs, stream_sa * *************************************/ -static void *common_sh_start(int clock, const custom_sound_interface *config) +static void *common_sh_start(const device_config *device, int clock, const custom_sound_interface *config) { int sample_rate = SH8253_CLOCK; sh6840_clocks_per_sample = (int)((double)SH6840_CLOCK / (double)sample_rate * (double)(1 << 24)); /* allocate the stream */ - exidy_stream = stream_create(0, 1, sample_rate, NULL, exidy_stream_update); + exidy_stream = stream_create(device, 0, 1, sample_rate, NULL, exidy_stream_update); return auto_malloc(1); } @@ -356,7 +356,7 @@ CUSTOM_START( exidy_sh6840_sh_start ) has_tms5220 = FALSE; has_mc3417 = FALSE; - return common_sh_start(clock, config); + return common_sh_start(device, clock, config); } @@ -640,7 +640,7 @@ static void *venture_common_sh_start(const device_config *device, int clock, con running_machine *machine = device->machine; int i; - void *ret = common_sh_start(clock, config); + void *ret = common_sh_start(device, clock, config); riot = device_list_find_by_tag(machine->config->devicelist, RIOT6532, "riot"); diff --git a/src/mame/audio/exidy440.c b/src/mame/audio/exidy440.c index 2284ae21390..fecf1d54bbc 100644 --- a/src/mame/audio/exidy440.c +++ b/src/mame/audio/exidy440.c @@ -161,7 +161,7 @@ static CUSTOM_START( exidy440_sh_start ) channel_frequency[3] = clock/2; /* get stream channels */ - stream = stream_create(0, 2, clock, NULL, channel_update); + stream = stream_create(device, 0, 2, clock, NULL, channel_update); /* allocate the sample cache */ length = memory_region_length(machine, "cvsd") * 16 + MAX_CACHE_ENTRIES * sizeof(sound_cache_entry); diff --git a/src/mame/audio/flower.c b/src/mame/audio/flower.c index 6a362c87916..66ea6c255b6 100644 --- a/src/mame/audio/flower.c +++ b/src/mame/audio/flower.c @@ -161,7 +161,7 @@ CUSTOM_START( flower_sh_start ) int i; /* get stream channels */ - stream = stream_create(0, 1, samplerate, 0, flower_update_mono); + stream = stream_create(device, 0, 1, samplerate, 0, flower_update_mono); /* allocate a pair of buffers to mix into - 1 second's worth should be more than enough */ mixer_buffer = auto_malloc(2 * sizeof(short) * samplerate); diff --git a/src/mame/audio/galaxian.c b/src/mame/audio/galaxian.c index ab1a415561c..4f89c50761b 100644 --- a/src/mame/audio/galaxian.c +++ b/src/mame/audio/galaxian.c @@ -376,7 +376,7 @@ static SAMPLES_START( galaxian_sh_start ) pitch = 0xff; vol = 0; - tone_stream = stream_create(0,1,SOUND_CLOCK/STEPS,NULL,tone_update); + tone_stream = stream_create(device,0,1,SOUND_CLOCK/STEPS,NULL,tone_update); stream_set_output_gain(tone_stream, 0, TOOTHSAW_VOLUME); sample_set_volume(CHANNEL_NOISE,0); diff --git a/src/mame/audio/geebee.c b/src/mame/audio/geebee.c index 615677fa237..7a0e73ce800 100644 --- a/src/mame/audio/geebee.c +++ b/src/mame/audio/geebee.c @@ -123,7 +123,7 @@ CUSTOM_START( geebee_sh_start ) decay[0x7fff-i] = (INT16) (0x7fff/exp(1.0*i/4096)); /* 1V = HSYNC = 18.432MHz / 3 / 2 / 384 = 8000Hz */ - channel = stream_create(0, 1, 18432000 / 3 / 2 / 384, NULL, geebee_sound_update); + channel = stream_create(device, 0, 1, 18432000 / 3 / 2 / 384, NULL, geebee_sound_update); vcount = 0; volume_timer = timer_alloc(machine, volume_decay, NULL); diff --git a/src/mame/audio/gomoku.c b/src/mame/audio/gomoku.c index a7ecd3e3510..965fe7a7f0e 100644 --- a/src/mame/audio/gomoku.c +++ b/src/mame/audio/gomoku.c @@ -169,7 +169,7 @@ CUSTOM_START( gomoku_sh_start ) int ch; /* get stream channels */ - stream = stream_create(0, 1, samplerate, NULL, gomoku_update_mono); + stream = stream_create(device, 0, 1, samplerate, NULL, gomoku_update_mono); /* allocate a pair of buffers to mix into - 1 second's worth should be more than enough */ mixer_buffer = auto_malloc(2 * sizeof(short) * samplerate); diff --git a/src/mame/audio/gridlee.c b/src/mame/audio/gridlee.c index 18d91c1c279..5cff8adfa43 100644 --- a/src/mame/audio/gridlee.c +++ b/src/mame/audio/gridlee.c @@ -68,7 +68,7 @@ CUSTOM_START( gridlee_sh_start ) running_machine *machine = device->machine; /* allocate the stream */ - gridlee_stream = stream_create(0, 1, machine->sample_rate, NULL, gridlee_stream_update); + gridlee_stream = stream_create(device, 0, 1, machine->sample_rate, NULL, gridlee_stream_update); freq_to_step = (double)(1 << 24) / (double)machine->sample_rate; diff --git a/src/mame/audio/leland.c b/src/mame/audio/leland.c index c2bfc787fa7..ecccbe49283 100644 --- a/src/mame/audio/leland.c +++ b/src/mame/audio/leland.c @@ -79,7 +79,6 @@ #include "driver.h" #include "streams.h" -#include "deprecat.h" #include "cpu/i86/i186intf.h" #include "cpu/z80/z80.h" #include "leland.h" @@ -141,7 +140,7 @@ CUSTOM_START( leland_sh_start ) dac_bufout[0] = dac_bufout[1] = 0; /* allocate the stream */ - dac_stream = stream_create(0, 1, 256*60, NULL, leland_update); + dac_stream = stream_create(device, 0, 1, 256*60, NULL, leland_update); /* allocate memory */ dac_buffer[0] = auto_malloc(DAC_BUFFER_SIZE); @@ -503,9 +502,9 @@ static void leland_80186_extern_update(void *param, stream_sample_t **inputs, st static TIMER_CALLBACK( internal_timer_int ); static TIMER_CALLBACK( dma_timer_callback ); -void *common_sh_start(int clock, const custom_sound_interface *config) +static void *common_sh_start(const device_config *device, int clock, const custom_sound_interface *config) { - running_machine *machine = Machine; + running_machine *machine = device->machine; const address_space *dmaspace = cputag_get_address_space(machine, "audio", ADDRESS_SPACE_PROGRAM); int i; @@ -516,14 +515,14 @@ void *common_sh_start(int clock, const custom_sound_interface *config) has_ym2151 = 1; /* allocate separate streams for the DMA and non-DMA DACs */ - dma_stream = stream_create(0, 1, OUTPUT_RATE, (void *)dmaspace, leland_80186_dma_update); - nondma_stream = stream_create(0, 1, OUTPUT_RATE, NULL, leland_80186_dac_update); + dma_stream = stream_create(device, 0, 1, OUTPUT_RATE, (void *)dmaspace, leland_80186_dma_update); + nondma_stream = stream_create(device, 0, 1, OUTPUT_RATE, NULL, leland_80186_dac_update); /* if we have a 2151, install an externally driven DAC stream */ if (has_ym2151) { ext_base = memory_region(machine, "dac"); - extern_stream = stream_create(0, 1, OUTPUT_RATE, NULL, leland_80186_extern_update); + extern_stream = stream_create(device, 0, 1, OUTPUT_RATE, NULL, leland_80186_extern_update); } /* create timers here so they stick around */ @@ -545,13 +544,13 @@ void *common_sh_start(int clock, const custom_sound_interface *config) CUSTOM_START( leland_80186_sh_start ) { is_redline = 0; - return common_sh_start(clock, config); + return common_sh_start(device, clock, config); } CUSTOM_START( redline_80186_sh_start ) { is_redline = 1; - return common_sh_start(clock, config); + return common_sh_start(device, clock, config); } diff --git a/src/mame/audio/phoenix.c b/src/mame/audio/phoenix.c index ca1a51ce400..273acba078b 100644 --- a/src/mame/audio/phoenix.c +++ b/src/mame/audio/phoenix.c @@ -543,7 +543,7 @@ CUSTOM_START( phoenix_sh_start ) poly18[i] = bits; } - channel = stream_create(0, 1, machine->sample_rate, 0, phoenix_sound_update); + channel = stream_create(device, 0, 1, machine->sample_rate, 0, phoenix_sound_update); state_save_register_global_pointer(machine, poly18, (1ul << (18-5)) ); diff --git a/src/mame/audio/pleiads.c b/src/mame/audio/pleiads.c index 08dd7d10491..d74c3aeb417 100644 --- a/src/mame/audio/pleiads.c +++ b/src/mame/audio/pleiads.c @@ -478,7 +478,7 @@ static void *common_sh_start(const device_config *device, const custom_sound_int poly18[i] = bits; } - channel = stream_create(0, 1, machine->sample_rate, NULL, pleiads_sound_update); + channel = stream_create(device, 0, 1, machine->sample_rate, NULL, pleiads_sound_update); /* just a dummy alloc to make the caller happy */ return auto_malloc(1); diff --git a/src/mame/audio/polepos.c b/src/mame/audio/polepos.c index 07f8691499a..11f8240f3e1 100644 --- a/src/mame/audio/polepos.c +++ b/src/mame/audio/polepos.c @@ -102,7 +102,7 @@ static void engine_sound_update(void *param, stream_sample_t **inputs, stream_sa /************************************/ CUSTOM_START( polepos_sh_start ) { - stream = stream_create(0, 1, OUTPUT_RATE, NULL, engine_sound_update); + stream = stream_create(device, 0, 1, OUTPUT_RATE, NULL, engine_sound_update); sample_msb = sample_lsb = 0; sample_enable = 0; diff --git a/src/mame/audio/redbaron.c b/src/mame/audio/redbaron.c index e19d17ddc6f..46537e57703 100644 --- a/src/mame/audio/redbaron.c +++ b/src/mame/audio/redbaron.c @@ -171,10 +171,10 @@ static void redbaron_sound_update(void *param, stream_sample_t **inputs, stream_ CUSTOM_START( redbaron_sh_start ) { - int i; + int i; vol_lookup = (INT16 *)auto_malloc(32768 * sizeof(INT16)); - for( i = 0; i < 0x8000; i++ ) + for( i = 0; i < 0x8000; i++ ) vol_lookup[0x7fff-i] = (INT16) (0x7fff/exp(1.0*i/4096)); for( i = 0; i < 16; i++ ) @@ -205,9 +205,9 @@ CUSTOM_START( redbaron_sh_start ) r0 = 1.0/r0; r1 = 1.0/r1; vol_crash[i] = 32767 * r0 / (r0 + r1); - } + } - channel = stream_create(0, 1, OUTPUT_RATE, 0, redbaron_sound_update); + channel = stream_create(device, 0, 1, OUTPUT_RATE, 0, redbaron_sound_update); - return auto_malloc(1); + return auto_malloc(1); } diff --git a/src/mame/audio/rockola.c b/src/mame/audio/rockola.c index b3486ba2b7f..f373d219cbe 100644 --- a/src/mame/audio/rockola.c +++ b/src/mame/audio/rockola.c @@ -635,7 +635,7 @@ CUSTOM_START( rockola_sh_start ) // 38.99 Hz update (according to schematic) rockola_set_music_clock(M_LN2 * (RES_K(18) * 2 + RES_K(1)) * CAP_U(1)); - tone_stream = stream_create(0, 1, SAMPLE_RATE, NULL, rockola_tone_update); + tone_stream = stream_create(device, 0, 1, SAMPLE_RATE, NULL, rockola_tone_update); return auto_malloc(1); } diff --git a/src/mame/audio/segag80r.c b/src/mame/audio/segag80r.c index a9fc3e993dd..58412d73210 100644 --- a/src/mame/audio/segag80r.c +++ b/src/mame/audio/segag80r.c @@ -582,7 +582,7 @@ static CUSTOM_START( sega005_custom_start ) running_machine *machine = device->machine; /* create the stream */ - sega005_stream = stream_create(0, 1, SEGA005_COUNTER_FREQ, NULL, sega005_stream_update); + sega005_stream = stream_create(device, 0, 1, SEGA005_COUNTER_FREQ, NULL, sega005_stream_update); /* create a timer for the 555 */ sega005_sound_timer = timer_alloc(machine, sega005_auto_timer, NULL); diff --git a/src/mame/audio/segasnd.c b/src/mame/audio/segasnd.c index 2f39e2f35af..ce7940406b8 100644 --- a/src/mame/audio/segasnd.c +++ b/src/mame/audio/segasnd.c @@ -642,7 +642,7 @@ static void usb_stream_update(void *param, stream_sample_t **inputs, stream_samp static CUSTOM_START( usb_start ) { - running_machine *machine = Machine; + running_machine *machine = device->machine; filter_state temp; int tchan, tgroup; @@ -654,7 +654,7 @@ static CUSTOM_START( usb_start ) usb.work_ram = auto_malloc(0x400); /* create a sound stream */ - usb.stream = stream_create(0, 1, SAMPLE_RATE, NULL, usb_stream_update); + usb.stream = stream_create(device, 0, 1, SAMPLE_RATE, NULL, usb_stream_update); /* initialize state */ usb.noise_shift = 0x15555; diff --git a/src/mame/audio/seibu.c b/src/mame/audio/seibu.c index 1b84935279f..6a181be234b 100644 --- a/src/mame/audio/seibu.c +++ b/src/mame/audio/seibu.c @@ -179,7 +179,7 @@ static CUSTOM_START( seibu_adpcm_start ) struct seibu_adpcm_state *state = &seibu_adpcm[i]; state->allocated = 1; state->playing = 0; - state->stream = stream_create(0, 1, clock, state, seibu_adpcm_callback); + state->stream = stream_create(device, 0, 1, clock, state, seibu_adpcm_callback); state->base = memory_region(machine, "adpcm"); reset_adpcm(&state->adpcm); return state; diff --git a/src/mame/audio/snes.c b/src/mame/audio/snes.c index ae3a95bcb88..b078db574e9 100644 --- a/src/mame/audio/snes.c +++ b/src/mame/audio/snes.c @@ -1152,7 +1152,7 @@ CUSTOM_START( snes_sh_start ) spc_port_out[ii] = 0; } - channel = stream_create( 0, 2, 32000, NULL, snes_sh_update ); + channel = stream_create( device, 0, 2, 32000, NULL, snes_sh_update ); /* Initialize the timers */ timers[0].timer = timer_alloc(machine, snes_spc_timer , NULL); diff --git a/src/mame/audio/tiamc1.c b/src/mame/audio/tiamc1.c index 0f43830082d..1a180848529 100644 --- a/src/mame/audio/tiamc1.c +++ b/src/mame/audio/tiamc1.c @@ -288,7 +288,7 @@ CUSTOM_START( tiamc1_sh_start ) timer8253_reset(&timer0); timer8253_reset(&timer1); - channel = stream_create(0, 1, clock / CLOCK_DIVIDER, 0, tiamc1_sound_update); + channel = stream_create(device, 0, 1, clock / CLOCK_DIVIDER, 0, tiamc1_sound_update); timer1_divider = 0; diff --git a/src/mame/audio/tx1.c b/src/mame/audio/tx1.c index ef0f13839c5..614bafbc856 100644 --- a/src/mame/audio/tx1.c +++ b/src/mame/audio/tx1.c @@ -279,7 +279,7 @@ CUSTOM_START( tx1_sh_start ) /* Allocate the stream */ - stream = stream_create(0, 2, machine->sample_rate, NULL, tx1_stream_update); + stream = stream_create(device, 0, 2, machine->sample_rate, NULL, tx1_stream_update); freq_to_step = (double)(1 << TX1_FRAC) / (double)machine->sample_rate; /* Compute the engine resistor weights */ @@ -512,7 +512,7 @@ CUSTOM_START( buggyboy_sh_start ) buggyboy_eng_voltages[i] = combine_4_weights(aweights, BIT(tmp[i], 0), BIT(tmp[i], 1), BIT(tmp[i], 2), BIT(tmp[i], 3)); /* Allocate the stream */ - stream = stream_create(0, 2, machine->sample_rate, NULL, buggyboy_stream_update); + stream = stream_create(device, 0, 2, machine->sample_rate, NULL, buggyboy_stream_update); freq_to_step = (double)(1 << 24) / (double)machine->sample_rate; return auto_malloc(1); diff --git a/src/mame/audio/warpwarp.c b/src/mame/audio/warpwarp.c index a0ba5dcd1d4..292b88dcefd 100644 --- a/src/mame/audio/warpwarp.c +++ b/src/mame/audio/warpwarp.c @@ -214,7 +214,7 @@ CUSTOM_START( warpwarp_sh_start ) for( i = 0; i < 0x8000; i++ ) decay[0x7fff-i] = (INT16) (0x7fff/exp(1.0*i/4096)); - channel = stream_create(0, 1, CLOCK_16H, NULL, warpwarp_sound_update); + channel = stream_create(device, 0, 1, CLOCK_16H, NULL, warpwarp_sound_update); sound_volume_timer = timer_alloc(machine, sound_volume_decay, NULL); music_volume_timer = timer_alloc(machine, music_volume_decay, NULL); diff --git a/src/mame/audio/wiping.c b/src/mame/audio/wiping.c index c02dd20dbec..82ad8e25b81 100644 --- a/src/mame/audio/wiping.c +++ b/src/mame/audio/wiping.c @@ -167,7 +167,7 @@ CUSTOM_START( wiping_sh_start ) sound_channel *voice; /* get stream channels */ - stream = stream_create(0, 1, samplerate, NULL, wiping_update_mono); + stream = stream_create(device, 0, 1, samplerate, NULL, wiping_update_mono); /* allocate a pair of buffers to mix into - 1 second's worth should be more than enough */ mixer_buffer = auto_malloc(2 * sizeof(short) * samplerate); diff --git a/src/mame/drivers/mjkjidai.c b/src/mame/drivers/mjkjidai.c index d5bbad2e48c..78ccb4a082e 100644 --- a/src/mame/drivers/mjkjidai.c +++ b/src/mame/drivers/mjkjidai.c @@ -78,7 +78,7 @@ static CUSTOM_START( mjkjidai_adpcm_start ) running_machine *machine = device->machine; struct mjkjidai_adpcm_state *state = &mjkjidai_adpcm; state->playing = 0; - state->stream = stream_create(0, 1, clock, state, mjkjidai_adpcm_callback); + state->stream = stream_create(device, 0, 1, clock, state, mjkjidai_adpcm_callback); state->base = memory_region(machine, "adpcm"); reset_adpcm(&state->adpcm); return state; diff --git a/src/mame/drivers/renegade.c b/src/mame/drivers/renegade.c index c5f830e0dba..4b6393fab72 100644 --- a/src/mame/drivers/renegade.c +++ b/src/mame/drivers/renegade.c @@ -170,7 +170,7 @@ static CUSTOM_START( renegade_adpcm_start ) running_machine *machine = device->machine; struct renegade_adpcm_state *state = &renegade_adpcm; state->playing = 0; - state->stream = stream_create(0, 1, clock, state, renegade_adpcm_callback); + state->stream = stream_create(device, 0, 1, clock, state, renegade_adpcm_callback); state->base = memory_region(machine, "adpcm"); reset_adpcm(&state->adpcm); return state;