mirror of
https://github.com/holub/mame
synced 2025-05-19 12:18:56 +03:00
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
This commit is contained in:
parent
b98c709380
commit
e2a760bcbd
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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 */
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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 */
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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 );
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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++)
|
||||
|
@ -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 */
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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 */
|
||||
|
@ -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 );
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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 */
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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++)
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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++)
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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 );
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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. */
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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() */
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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++)
|
||||
{
|
||||
|
@ -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++)
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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));
|
||||
|
||||
|
@ -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");
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
@ -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)) );
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user