mirror of
https://github.com/holub/mame
synced 2025-10-06 09:00:04 +03:00
C++-ified the sound and streams interfaces. Combined sound.c and streams.c
into one file, and separated the speaker device into its own file. Generalized the concept of dynamically assigned inputs and re-wired the speaker to work this way, so it is now treated just like any other sound device. Added methods to the device_sound_interface for controlling output gain and mapping device inputs/outputs to stream inputs/outputs. Also made the sound_stream_update() method pure virtual, so all modern sound devices must use the new mechanism for stream updates. Primary changes outside of the core are: stream_update(stream) == stream->update() stream_create(device,...) == machine->sound().stream_alloc(*device,...) sound_global_enable(machine,enable) == machine->sound().system_enable(enable) Beyond this, the patterns are relatively obvious for the remaining calls.
This commit is contained in:
parent
e214465d35
commit
c94b8c9490
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -1143,8 +1143,6 @@ src/emu/sound/zsg2.c svneol=native#text/plain
|
||||
src/emu/sound/zsg2.h svneol=native#text/plain
|
||||
src/emu/state.c svneol=native#text/plain
|
||||
src/emu/state.h svneol=native#text/plain
|
||||
src/emu/streams.c svneol=native#text/plain
|
||||
src/emu/streams.h svneol=native#text/plain
|
||||
src/emu/tilemap.c svneol=native#text/plain
|
||||
src/emu/tilemap.h svneol=native#text/plain
|
||||
src/emu/timer.c svneol=native#text/plain
|
||||
|
@ -1948,7 +1948,7 @@ void device_debug::instruction_hook(offs_t curpc)
|
||||
debugger_refresh_display(m_device.machine);
|
||||
|
||||
// wait for the debugger; during this time, disable sound output
|
||||
sound_mute(m_device.machine, true);
|
||||
m_device.machine->sound().debugger_mute(true);
|
||||
while (global->execution_state == EXECUTION_STATE_STOPPED)
|
||||
{
|
||||
// flush any pending updates before waiting again
|
||||
@ -1976,7 +1976,7 @@ void device_debug::instruction_hook(offs_t curpc)
|
||||
if (machine.scheduled_event_pending())
|
||||
global->execution_state = EXECUTION_STATE_RUNNING;
|
||||
}
|
||||
sound_mute(m_device.machine, false);
|
||||
m_device.machine->sound().debugger_mute(false);
|
||||
|
||||
// remember the last visible CPU in the debugger
|
||||
global->visiblecpu = &m_device;
|
||||
|
@ -38,7 +38,6 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
|
||||
|
||||
|
||||
@ -51,8 +50,7 @@
|
||||
//-------------------------------------------------
|
||||
|
||||
device_config_sound_interface::device_config_sound_interface(const machine_config &mconfig, device_config &devconfig)
|
||||
: device_config_interface(mconfig, devconfig),
|
||||
m_route_list(NULL)
|
||||
: device_config_interface(mconfig, devconfig)
|
||||
{
|
||||
}
|
||||
|
||||
@ -63,7 +61,6 @@ device_config_sound_interface::device_config_sound_interface(const machine_confi
|
||||
|
||||
device_config_sound_interface::~device_config_sound_interface()
|
||||
{
|
||||
reset_routes();
|
||||
}
|
||||
|
||||
|
||||
@ -74,13 +71,13 @@ device_config_sound_interface::~device_config_sound_interface()
|
||||
|
||||
void device_config_sound_interface::static_add_route(device_config *device, UINT32 output, const char *target, double gain, UINT32 input)
|
||||
{
|
||||
// find our sound interface
|
||||
device_config_sound_interface *sound = dynamic_cast<device_config_sound_interface *>(device);
|
||||
if (sound == NULL)
|
||||
throw emu_fatalerror("MCFG_SOUND_ROUTE called on device '%s' with no sound interface", device->tag());
|
||||
|
||||
sound_route **routeptr;
|
||||
for (routeptr = &sound->m_route_list; *routeptr != NULL; routeptr = &(*routeptr)->m_next) ;
|
||||
*routeptr = global_alloc(sound_route(output, input, gain, target));
|
||||
// append a new route to the list
|
||||
sound->m_route_list.append(*global_alloc(sound_route(output, input, gain, target)));
|
||||
}
|
||||
|
||||
|
||||
@ -91,11 +88,13 @@ void device_config_sound_interface::static_add_route(device_config *device, UINT
|
||||
|
||||
void device_config_sound_interface::static_reset_routes(device_config *device)
|
||||
{
|
||||
// find our sound interface
|
||||
device_config_sound_interface *sound = dynamic_cast<device_config_sound_interface *>(device);
|
||||
if (sound == NULL)
|
||||
throw emu_fatalerror("MCFG_SOUND_ROUTES_RESET called on device '%s' with no sound interface", device->tag());
|
||||
|
||||
sound->reset_routes();
|
||||
// reset the routine list
|
||||
sound->m_route_list.reset();
|
||||
}
|
||||
|
||||
|
||||
@ -110,7 +109,7 @@ bool device_config_sound_interface::interface_validity_check(const game_driver &
|
||||
bool error = false;
|
||||
|
||||
// loop over all the routes
|
||||
for (const sound_route *route = m_route_list; route != NULL; route = route->m_next)
|
||||
for (const sound_route *route = first_route(); route != NULL; route = route->next())
|
||||
{
|
||||
// find a device with the requested tag
|
||||
const device_config *target = m_machine_config.m_devicelist.find(route->m_target);
|
||||
@ -132,23 +131,6 @@ bool device_config_sound_interface::interface_validity_check(const game_driver &
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// reset_routes - free up all allocated routes
|
||||
// in this configuration
|
||||
//-------------------------------------------------
|
||||
|
||||
void device_config_sound_interface::reset_routes()
|
||||
{
|
||||
// loop until all are gone
|
||||
while (m_route_list != NULL)
|
||||
{
|
||||
sound_route *temp = m_route_list;
|
||||
m_route_list = temp->m_next;
|
||||
global_free(temp);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// sound_route - constructor
|
||||
//-------------------------------------------------
|
||||
@ -174,8 +156,9 @@ device_config_sound_interface::sound_route::sound_route(int output, int input, f
|
||||
|
||||
device_sound_interface::device_sound_interface(running_machine &machine, const device_config &config, device_t &device)
|
||||
: device_interface(machine, config, device),
|
||||
m_sound_config(dynamic_cast<const device_config_sound_interface &>(config)),
|
||||
m_outputs(0),
|
||||
m_sound_config(dynamic_cast<const device_config_sound_interface &>(config))
|
||||
m_auto_allocated_inputs(0)
|
||||
{
|
||||
}
|
||||
|
||||
@ -190,13 +173,115 @@ device_sound_interface::~device_sound_interface()
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// sound_stream_update - provide data for the
|
||||
// given sound stream
|
||||
// inputs - return the total number of inputs
|
||||
// for the given device
|
||||
//-------------------------------------------------
|
||||
|
||||
void device_sound_interface::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
|
||||
int device_sound_interface::inputs() const
|
||||
{
|
||||
fatalerror("device_sound_interface::sound_stream_update - this method should have been overridden");
|
||||
// scan the list counting streams we own and summing their inputs
|
||||
int inputs = 0;
|
||||
for (sound_stream *stream = m_device.machine->sound().first_stream(); stream != NULL; stream = stream->next())
|
||||
if (&stream->device() == &m_device)
|
||||
inputs += stream->input_count();
|
||||
return inputs;
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// outputs - return the total number of outputs
|
||||
// for the given device
|
||||
//-------------------------------------------------
|
||||
|
||||
int device_sound_interface::outputs() const
|
||||
{
|
||||
// scan the list counting streams we own and summing their outputs
|
||||
int outputs = 0;
|
||||
for (sound_stream *stream = m_device.machine->sound().first_stream(); stream != NULL; stream = stream->next())
|
||||
if (&stream->device() == &m_device)
|
||||
outputs += stream->output_count();
|
||||
return outputs;
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// input_to_stream_input - convert a device's
|
||||
// input index to a stream and the input index
|
||||
// on that stream
|
||||
//-------------------------------------------------
|
||||
|
||||
sound_stream *device_sound_interface::input_to_stream_input(int inputnum, int &stream_inputnum)
|
||||
{
|
||||
assert(inputnum >= 0);
|
||||
|
||||
// scan the list looking for streams owned by this device
|
||||
for (sound_stream *stream = m_device.machine->sound().first_stream(); stream != NULL; stream = stream->next())
|
||||
if (&stream->device() == &m_device)
|
||||
{
|
||||
if (inputnum < stream->input_count())
|
||||
{
|
||||
stream_inputnum = inputnum;
|
||||
return stream;
|
||||
}
|
||||
inputnum -= stream->input_count();
|
||||
}
|
||||
|
||||
// not found
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// output_to_stream_output - convert a device's
|
||||
// output index to a stream and the output index
|
||||
// on that stream
|
||||
//-------------------------------------------------
|
||||
|
||||
sound_stream *device_sound_interface::output_to_stream_output(int outputnum, int &stream_outputnum)
|
||||
{
|
||||
assert(outputnum >= 0);
|
||||
|
||||
// scan the list looking for streams owned by this device
|
||||
for (sound_stream *stream = m_device.machine->sound().first_stream(); stream != NULL; stream = stream->next())
|
||||
if (&stream->device() == &device())
|
||||
{
|
||||
if (outputnum < stream->output_count())
|
||||
{
|
||||
stream_outputnum = outputnum;
|
||||
return stream;
|
||||
}
|
||||
outputnum -= stream->output_count();
|
||||
}
|
||||
|
||||
// not found
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// set_output_gain - set the gain on the given
|
||||
// output index of the device
|
||||
//-------------------------------------------------
|
||||
|
||||
void device_sound_interface::set_output_gain(int outputnum, float gain)
|
||||
{
|
||||
// handle ALL_OUTPUTS as a special case
|
||||
if (outputnum == ALL_OUTPUTS)
|
||||
{
|
||||
for (sound_stream *stream = m_device.machine->sound().first_stream(); stream != NULL; stream = stream->next())
|
||||
if (&stream->device() == &device())
|
||||
for (int outputnum = 0; outputnum < stream->output_count(); outputnum++)
|
||||
stream->set_output_gain(outputnum, gain);
|
||||
}
|
||||
|
||||
// look up the stream and stream output index
|
||||
else
|
||||
{
|
||||
int stream_outputnum;
|
||||
sound_stream *stream = output_to_stream_output(outputnum, stream_outputnum);
|
||||
if (stream != NULL)
|
||||
stream->set_output_gain(stream_outputnum, gain);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -212,14 +297,31 @@ void device_sound_interface::interface_pre_start()
|
||||
for (bool gotone = m_device.machine->m_devicelist.first(sound); gotone; gotone = sound->next(sound))
|
||||
{
|
||||
// scan each route on the device
|
||||
for (const device_config_sound_interface::sound_route *route = sound->sound_config().m_route_list; route != NULL; route = route->m_next)
|
||||
for (const device_config_sound_interface::sound_route *route = sound->sound_config().first_route(); route != NULL; route = route->next())
|
||||
{
|
||||
// if we are the target of this route but the source hasn't yet started, defer our start for later
|
||||
// see if we are the target of this route; if we are, make sure the source device is started
|
||||
device_t *target_device = m_device.machine->device(route->m_target);
|
||||
if (target_device == &m_device && !sound->device().started())
|
||||
throw device_missing_dependencies();
|
||||
}
|
||||
}
|
||||
|
||||
// now iterate through devices again and assign any auto-allocated inputs
|
||||
m_auto_allocated_inputs = 0;
|
||||
for (bool gotone = m_device.machine->m_devicelist.first(sound); gotone; gotone = sound->next(sound))
|
||||
{
|
||||
// scan each route on the device
|
||||
for (const device_config_sound_interface::sound_route *route = sound->sound_config().first_route(); route != NULL; route = route->next())
|
||||
{
|
||||
// see if we are the target of this route
|
||||
device_t *target_device = m_device.machine->device(route->m_target);
|
||||
if (target_device == &m_device && route->m_input == AUTO_ALLOC_INPUT)
|
||||
{
|
||||
const_cast<device_config_sound_interface::sound_route *>(route)->m_input = m_auto_allocated_inputs;
|
||||
m_auto_allocated_inputs += (route->m_output == ALL_OUTPUTS) ? sound->outputs() : 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -230,33 +332,12 @@ void device_sound_interface::interface_pre_start()
|
||||
|
||||
void device_sound_interface::interface_post_start()
|
||||
{
|
||||
// count the outputs
|
||||
for (int outputnum = 0; outputnum < MAX_OUTPUTS; outputnum++)
|
||||
{
|
||||
// stop when we run out of streams
|
||||
sound_stream *stream = stream_find_by_device(&m_device, outputnum);
|
||||
if (stream == NULL)
|
||||
break;
|
||||
|
||||
// accumulate the number of outputs from this stream
|
||||
int numoutputs = stream_get_outputs(stream);
|
||||
assert(m_outputs + numoutputs < MAX_OUTPUTS);
|
||||
|
||||
// fill in the array
|
||||
for (int curoutput = 0; curoutput < numoutputs; curoutput++)
|
||||
{
|
||||
sound_output *output = &m_output[m_outputs++];
|
||||
output->stream = stream;
|
||||
output->output = curoutput;
|
||||
}
|
||||
}
|
||||
|
||||
// iterate over all the sound devices
|
||||
device_sound_interface *sound = NULL;
|
||||
for (bool gotone = m_device.machine->m_devicelist.first(sound); gotone; gotone = sound->next(sound))
|
||||
{
|
||||
// scan each route on the device
|
||||
for (const device_config_sound_interface::sound_route *route = sound->sound_config().m_route_list; route != NULL; route = route->m_next)
|
||||
for (const device_config_sound_interface::sound_route *route = sound->sound_config().first_route(); route != NULL; route = route->next())
|
||||
{
|
||||
// if we are the target of this route, hook it up
|
||||
device_t *target_device = m_device.machine->device(route->m_target);
|
||||
@ -264,19 +345,40 @@ void device_sound_interface::interface_post_start()
|
||||
{
|
||||
// iterate over all outputs, matching any that apply
|
||||
int inputnum = route->m_input;
|
||||
int numoutputs = stream_get_device_outputs(*sound);
|
||||
int numoutputs = sound->outputs();
|
||||
for (int outputnum = 0; outputnum < numoutputs; outputnum++)
|
||||
if (route->m_output == outputnum || route->m_output == ALL_OUTPUTS)
|
||||
{
|
||||
sound_stream *inputstream, *stream;
|
||||
int streaminput, streamoutput;
|
||||
// find the output stream to connect from
|
||||
int streamoutputnum;
|
||||
sound_stream *outputstream = sound->output_to_stream_output(outputnum, streamoutputnum);
|
||||
if (outputstream == NULL)
|
||||
fatalerror("Sound device '%s' specifies route for non-existant output #%d", route->m_target, outputnum);
|
||||
|
||||
// get the input and output streams and wire them together
|
||||
if (stream_device_input_to_stream_input(target_device, inputnum++, &inputstream, &streaminput))
|
||||
if (stream_device_output_to_stream_output(*sound, outputnum, &stream, &streamoutput))
|
||||
stream_set_input(inputstream, streaminput, stream, streamoutput, route->m_gain);
|
||||
// find the input stream to connect to
|
||||
int streaminputnum;
|
||||
sound_stream *inputstream = input_to_stream_input(inputnum++, streaminputnum);
|
||||
if (inputstream == NULL)
|
||||
fatalerror("Sound device '%s' targeted output #%d to non-existant device '%s' input %d", route->m_target, outputnum, m_device.tag(), inputnum - 1);
|
||||
|
||||
// set the input
|
||||
inputstream->set_input(streaminputnum, outputstream, streamoutputnum, route->m_gain);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// interface_pre_reset - called prior to
|
||||
// resetting the device
|
||||
//-------------------------------------------------
|
||||
|
||||
void device_sound_interface::interface_pre_reset()
|
||||
{
|
||||
// update all streams on this device prior to reset
|
||||
for (sound_stream *stream = m_device.machine->sound().first_stream(); stream != NULL; stream = stream->next())
|
||||
if (&stream->device() == &device())
|
||||
stream->update();
|
||||
}
|
||||
|
@ -51,8 +51,8 @@
|
||||
// CONSTANTS
|
||||
//**************************************************************************
|
||||
|
||||
const int MAX_OUTPUTS = 4095; // maximum number of outputs a sound chip can support
|
||||
const int ALL_OUTPUTS = MAX_OUTPUTS; // special value indicating all outputs for the current chip
|
||||
const int ALL_OUTPUTS = 65535; // special value indicating all outputs for the current chip
|
||||
const int AUTO_ALLOC_INPUT = 65535;
|
||||
|
||||
|
||||
|
||||
@ -79,7 +79,7 @@ const int ALL_OUTPUTS = MAX_OUTPUTS; // special value indicating all outputs fo
|
||||
device_config_sound_interface::static_add_route(device, _output, _target, _gain, _input); \
|
||||
|
||||
#define MCFG_SOUND_ROUTE(_output, _target, _gain) \
|
||||
MCFG_SOUND_ROUTE_EX(_output, _target, _gain, 0)
|
||||
MCFG_SOUND_ROUTE_EX(_output, _target, _gain, AUTO_ALLOC_INPUT)
|
||||
|
||||
#define MCFG_SOUND_ROUTES_RESET() \
|
||||
device_config_sound_interface::static_reset_routes(device); \
|
||||
@ -99,14 +99,13 @@ class sound_stream;
|
||||
class device_config_sound_interface : public device_config_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
device_config_sound_interface(const machine_config &mconfig, device_config &devconfig);
|
||||
virtual ~device_config_sound_interface();
|
||||
|
||||
// sound route
|
||||
class sound_route
|
||||
{
|
||||
public:
|
||||
sound_route(int output, int input, float gain, const char *target);
|
||||
|
||||
const sound_route *next() const { return m_next; }
|
||||
|
||||
sound_route * m_next; // pointer to next route
|
||||
UINT32 m_output; // output index, or ALL_OUTPUTS
|
||||
@ -115,21 +114,26 @@ public:
|
||||
const char * m_target; // target tag
|
||||
};
|
||||
|
||||
sound_route * m_route_list; // list of sound routes
|
||||
// construction/destruction
|
||||
device_config_sound_interface(const machine_config &mconfig, device_config &devconfig);
|
||||
virtual ~device_config_sound_interface();
|
||||
|
||||
// getters
|
||||
const sound_route *first_route() const { return m_route_list.first(); }
|
||||
|
||||
// static inline helpers
|
||||
static void static_add_route(device_config *device, UINT32 output, const char *target, double gain, UINT32 input = 0);
|
||||
static void static_add_route(device_config *device, UINT32 output, const char *target, double gain, UINT32 input = AUTO_ALLOC_INPUT);
|
||||
static void static_reset_routes(device_config *device);
|
||||
|
||||
protected:
|
||||
// optional operation overrides
|
||||
virtual bool interface_validity_check(const game_driver &driver) const;
|
||||
|
||||
void reset_routes();
|
||||
// internal state
|
||||
simple_list<sound_route> m_route_list; // list of sound routes
|
||||
};
|
||||
|
||||
|
||||
|
||||
// ======================> device_sound_interface
|
||||
|
||||
class device_sound_interface : public device_interface
|
||||
@ -143,25 +147,27 @@ public:
|
||||
const device_config_sound_interface &sound_config() const { return m_sound_config; }
|
||||
|
||||
// sound stream update overrides
|
||||
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
|
||||
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) = 0;
|
||||
|
||||
// helpers
|
||||
int inputs() const;
|
||||
int outputs() const;
|
||||
sound_stream *input_to_stream_input(int inputnum, int &stream_inputnum);
|
||||
sound_stream *output_to_stream_output(int outputnum, int &stream_outputnum);
|
||||
void set_output_gain(int outputnum, float gain);
|
||||
|
||||
protected:
|
||||
// optional operation overrides
|
||||
virtual void interface_pre_start();
|
||||
virtual void interface_post_start();
|
||||
|
||||
struct sound_output
|
||||
{
|
||||
sound_stream * stream; // associated stream
|
||||
int output; // output number
|
||||
};
|
||||
virtual void interface_pre_reset();
|
||||
|
||||
// internal state
|
||||
const device_config_sound_interface &m_sound_config;
|
||||
|
||||
int m_outputs; // number of outputs from this instance
|
||||
sound_output m_output[MAX_OUTPUTS]; // array of output information
|
||||
|
||||
const device_config_sound_interface &m_sound_config;
|
||||
int m_auto_allocated_inputs; // number of auto-allocated inputs targeting us
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif /* __DISOUND_H__ */
|
||||
|
@ -122,8 +122,8 @@ typedef device_config * (*machine_config_constructor)(machine_config &config, de
|
||||
#include "video.h"
|
||||
|
||||
// sound-related
|
||||
#include "streams.h"
|
||||
#include "sound.h"
|
||||
#include "speaker.h"
|
||||
|
||||
// generic helpers
|
||||
#include "devcb.h"
|
||||
|
@ -94,8 +94,8 @@ EMUOBJS = \
|
||||
$(EMUOBJ)/screen.o \
|
||||
$(EMUOBJ)/softlist.o \
|
||||
$(EMUOBJ)/sound.o \
|
||||
$(EMUOBJ)/speaker.o \
|
||||
$(EMUOBJ)/state.o \
|
||||
$(EMUOBJ)/streams.o \
|
||||
$(EMUOBJ)/tilemap.o \
|
||||
$(EMUOBJ)/timer.o \
|
||||
$(EMUOBJ)/ui.o \
|
||||
|
@ -808,7 +808,7 @@ static void print_game_display(FILE *out, const game_driver *game, const machine
|
||||
|
||||
static void print_game_sound(FILE *out, const game_driver *game, const machine_config &config)
|
||||
{
|
||||
int speakers = speaker_output_count(&config);
|
||||
int speakers = config.m_devicelist.count(SPEAKER);
|
||||
|
||||
/* if we have no sound, zero out the speaker count */
|
||||
const device_config_sound_interface *sound = NULL;
|
||||
|
@ -112,7 +112,6 @@
|
||||
#include "ui.h"
|
||||
#include "uimenu.h"
|
||||
#include "uiinput.h"
|
||||
#include "streams.h"
|
||||
#include "crsshair.h"
|
||||
#include "validity.h"
|
||||
#include "debug/debugcon.h"
|
||||
@ -164,7 +163,6 @@ running_machine::running_machine(const machine_config &_config, osd_interface &o
|
||||
streams_data(NULL),
|
||||
devices_data(NULL),
|
||||
romload_data(NULL),
|
||||
sound_data(NULL),
|
||||
input_data(NULL),
|
||||
input_port_data(NULL),
|
||||
ui_input_data(NULL),
|
||||
@ -192,6 +190,7 @@ running_machine::running_machine(const machine_config &_config, osd_interface &o
|
||||
m_driver_device(NULL),
|
||||
m_cheat(NULL),
|
||||
m_render(NULL),
|
||||
m_sound(NULL),
|
||||
m_video(NULL),
|
||||
m_debug_view(NULL)
|
||||
{
|
||||
@ -302,7 +301,7 @@ void running_machine::start()
|
||||
ui_input_init(this);
|
||||
|
||||
// initialize the streams engine before the sound devices start
|
||||
streams_init(this);
|
||||
m_sound = auto_alloc(this, sound_manager(*this));
|
||||
|
||||
// first load ROMs, then populate memory, and finally initialize CPUs
|
||||
// these operations must proceed in this order
|
||||
@ -323,7 +322,6 @@ void running_machine::start()
|
||||
image_init(this);
|
||||
tilemap_init(this);
|
||||
crosshair_init(this);
|
||||
sound_init(this);
|
||||
|
||||
// initialize the debugger
|
||||
if ((debug_flags & DEBUG_FLAG_ENABLED) != 0)
|
||||
@ -382,7 +380,7 @@ int running_machine::run(bool firstrun)
|
||||
// load the configuration settings and NVRAM
|
||||
bool settingsloaded = config_load_settings(this);
|
||||
nvram_load(this);
|
||||
sound_mute(this, FALSE);
|
||||
sound().ui_mute(false);
|
||||
|
||||
// display the startup screens
|
||||
ui_display_startup_screens(this, firstrun, !settingsloaded);
|
||||
@ -415,7 +413,7 @@ int running_machine::run(bool firstrun)
|
||||
m_current_phase = MACHINE_PHASE_EXIT;
|
||||
|
||||
// save the NVRAM and configuration
|
||||
sound_mute(this, true);
|
||||
sound().ui_mute(true);
|
||||
nvram_save(this);
|
||||
config_save_settings(this);
|
||||
}
|
||||
|
@ -182,6 +182,7 @@ class gfx_element;
|
||||
class colortable_t;
|
||||
class cheat_manager;
|
||||
class render_manager;
|
||||
class sound_manager;
|
||||
class video_manager;
|
||||
class debug_view_manager;
|
||||
class osd_interface;
|
||||
@ -196,7 +197,6 @@ typedef struct _tilemap_private tilemap_private;
|
||||
typedef struct _streams_private streams_private;
|
||||
typedef struct _devices_private devices_private;
|
||||
typedef struct _romload_private romload_private;
|
||||
typedef struct _sound_private sound_private;
|
||||
typedef struct _input_private input_private;
|
||||
typedef struct _input_port_private input_port_private;
|
||||
typedef struct _ui_input_private ui_input_private;
|
||||
@ -392,6 +392,7 @@ public:
|
||||
// managers
|
||||
cheat_manager &cheat() const { assert(m_cheat != NULL); return *m_cheat; }
|
||||
render_manager &render() const { assert(m_render != NULL); return *m_render; }
|
||||
sound_manager &sound() const { assert(m_sound != NULL); return *m_sound; }
|
||||
video_manager &video() const { assert(m_video != NULL); return *m_video; }
|
||||
debug_view_manager &debug_view() const { assert(m_debug_view != NULL); return *m_debug_view; }
|
||||
|
||||
@ -452,7 +453,6 @@ public:
|
||||
streams_private * streams_data; // internal data from streams.c
|
||||
devices_private * devices_data; // internal data from devices.c
|
||||
romload_private * romload_data; // internal data from romload.c
|
||||
sound_private * sound_data; // internal data from sound.c
|
||||
input_private * input_data; // internal data from input.c
|
||||
input_port_private * input_port_data; // internal data from inptport.c
|
||||
ui_input_private * ui_input_data; // internal data from uiinput.c
|
||||
@ -533,6 +533,7 @@ private:
|
||||
driver_device * m_driver_device;
|
||||
cheat_manager * m_cheat; // internal data from cheat.c
|
||||
render_manager * m_render; // internal data from render.c
|
||||
sound_manager * m_sound; // internal data from sound.c
|
||||
video_manager * m_video; // internal data from video.c
|
||||
debug_view_manager * m_debug_view; // internal data from debugvw.c
|
||||
};
|
||||
|
@ -12,7 +12,6 @@
|
||||
#include "emu.h"
|
||||
#include "ldcore.h"
|
||||
#include "avcomp.h"
|
||||
#include "streams.h"
|
||||
#include "vbiparse.h"
|
||||
#include "config.h"
|
||||
#include "render.h"
|
||||
@ -198,7 +197,7 @@ INLINE void update_audio(laserdisc_state *ld)
|
||||
if (ldcore->audiocustom != NULL)
|
||||
{
|
||||
sound_token *token = (sound_token *)downcast<legacy_device_base *>(ldcore->audiocustom)->token();
|
||||
stream_update(token->stream);
|
||||
token->stream->update();
|
||||
}
|
||||
}
|
||||
|
||||
@ -965,7 +964,7 @@ static void process_track_data(device_t *device)
|
||||
static DEVICE_START( laserdisc_sound )
|
||||
{
|
||||
sound_token *token = (sound_token *)downcast<legacy_device_base *>(device)->token();
|
||||
token->stream = stream_create(device, 0, 2, 48000, token, custom_stream_callback);
|
||||
token->stream = device->machine->sound().stream_alloc(*device, 0, 2, 48000, token, custom_stream_callback);
|
||||
token->ld = NULL;
|
||||
}
|
||||
|
||||
@ -1567,7 +1566,7 @@ static DEVICE_RESET( laserdisc )
|
||||
{
|
||||
sound_token *token = (sound_token *)downcast<legacy_device_base *>(ldcore->audiocustom)->token();
|
||||
token->ld = ld;
|
||||
stream_set_sample_rate(token->stream, ldcore->samplerate);
|
||||
token->stream->set_sample_rate(ldcore->samplerate);
|
||||
}
|
||||
|
||||
/* set up the general ld */
|
||||
|
@ -84,7 +84,6 @@
|
||||
#include "ui.h"
|
||||
#include "uimenu.h"
|
||||
#include "uiinput.h"
|
||||
#include "streams.h"
|
||||
#include "crsshair.h"
|
||||
#include "validity.h"
|
||||
#include "debug/debugcon.h"
|
||||
|
1584
src/emu/sound.c
1584
src/emu/sound.c
File diff suppressed because it is too large
Load Diff
410
src/emu/sound.h
410
src/emu/sound.h
@ -4,8 +4,36 @@
|
||||
|
||||
Core sound interface functions and definitions.
|
||||
|
||||
Copyright Nicola Salmoria and the MAME Team.
|
||||
Visit http://mamedev.org for licensing and usage restrictions.
|
||||
****************************************************************************
|
||||
|
||||
Copyright Aaron Giles
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name 'MAME' nor the names of its contributors may be
|
||||
used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
|
||||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
@ -19,221 +47,229 @@
|
||||
#define __SOUND_H__
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
MACROS
|
||||
***************************************************************************/
|
||||
//**************************************************************************
|
||||
// MACROS
|
||||
//**************************************************************************
|
||||
|
||||
/* these functions are macros primarily due to include file ordering */
|
||||
/* plus, they are very simple */
|
||||
#define speaker_output_count(config) (config)->m_devicelist.count(SPEAKER)
|
||||
#define speaker_output_first(config) (config)->m_devicelist.first(SPEAKER)
|
||||
#define speaker_output_next(previous) (previous)->typenext()
|
||||
#define STREAM_UPDATE(name) void name(device_t *device, sound_stream *stream, void *param, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
|
||||
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
TYPE DEFINITIONS
|
||||
***************************************************************************/
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
// ======================> speaker_device_config
|
||||
// forward references
|
||||
class speaker_device;
|
||||
typedef struct _wav_file wav_file;
|
||||
|
||||
class speaker_device_config : public device_config
|
||||
|
||||
// structure describing an indexed speaker
|
||||
struct speaker_input
|
||||
{
|
||||
friend class speaker_device;
|
||||
|
||||
// construction/destruction
|
||||
speaker_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
|
||||
|
||||
public:
|
||||
// allocators
|
||||
static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
|
||||
virtual device_t *alloc_device(running_machine &machine) const;
|
||||
|
||||
// inline configuration helpers
|
||||
static void static_set_position(device_config *device, double x, double y, double z);
|
||||
|
||||
protected:
|
||||
// inline configuration state
|
||||
double m_x;
|
||||
double m_y;
|
||||
double m_z;
|
||||
speaker_device * speaker; // owning device
|
||||
sound_stream * stream; // stream within the device
|
||||
int inputnum; // input on the stream
|
||||
};
|
||||
|
||||
|
||||
// ======================> sound_stream
|
||||
|
||||
// ======================> speaker_device
|
||||
|
||||
class speaker_device : public device_t
|
||||
class sound_stream
|
||||
{
|
||||
friend class speaker_device_config;
|
||||
friend resource_pool_object<speaker_device>::~resource_pool_object();
|
||||
friend class simple_list<sound_stream>;
|
||||
friend class sound_manager;
|
||||
|
||||
typedef void (*stream_update_func)(device_t *device, sound_stream *stream, void *param, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
|
||||
|
||||
// construction/destruction
|
||||
speaker_device(running_machine &_machine, const speaker_device_config &config);
|
||||
virtual ~speaker_device();
|
||||
|
||||
public:
|
||||
// input properties
|
||||
int inputs() const { return m_inputs; }
|
||||
float input_gain(int index = 0) const { return m_input[index].m_gain; }
|
||||
float input_default_gain(int index = 0) const { return m_input[index].m_default_gain; }
|
||||
const char *input_name(int index = 0) const { return m_input[index].m_name; }
|
||||
void set_input_gain(int index, float gain);
|
||||
|
||||
// internally for use by the sound system
|
||||
void mix(INT32 *leftmix, INT32 *rightmix, int &samples_this_update, bool suppress);
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
virtual void device_start();
|
||||
virtual void device_post_load();
|
||||
|
||||
// internal helpers
|
||||
static STREAM_UPDATE( static_mixer_update ) { downcast<speaker_device *>(device)->mixer_update(inputs, outputs, samples); }
|
||||
void mixer_update(stream_sample_t **inputs, stream_sample_t **outputs, int samples);
|
||||
|
||||
// a single input
|
||||
struct speaker_input
|
||||
// stream output class
|
||||
class stream_output
|
||||
{
|
||||
float m_gain; // current gain
|
||||
float m_default_gain; // default gain
|
||||
astring m_name; // name of this input
|
||||
public:
|
||||
// construction/destruction
|
||||
stream_output();
|
||||
|
||||
// internal state
|
||||
sound_stream * m_stream; // owning stream
|
||||
stream_sample_t * m_buffer; // output buffer
|
||||
int m_dependents; // number of dependents
|
||||
INT16 m_gain; // gain to apply to the output
|
||||
};
|
||||
|
||||
// internal state
|
||||
const speaker_device_config &m_config;
|
||||
sound_stream * m_mixer_stream; // mixing stream
|
||||
int m_inputs; // number of input streams
|
||||
speaker_input * m_input; // array of input information
|
||||
#ifdef MAME_DEBUG
|
||||
INT32 m_max_sample; // largest sample value we've seen
|
||||
INT32 m_clipped_samples; // total number of clipped samples
|
||||
INT32 m_total_samples; // total number of samples
|
||||
#endif
|
||||
// stream input class
|
||||
class stream_input
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
stream_input();
|
||||
|
||||
// internal state
|
||||
stream_output * m_source; // pointer to the sound_output for this source
|
||||
stream_sample_t * m_resample; // buffer for resampling to the stream's sample rate
|
||||
UINT32 m_bufsize; // size of output buffer, in samples
|
||||
UINT32 m_bufalloc; // allocated size of output buffer, in samples
|
||||
attoseconds_t m_latency_attoseconds; // latency between this stream and the input stream
|
||||
INT16 m_gain; // gain to apply to this input
|
||||
INT16 m_initial_gain; // initial gain supplied at creation
|
||||
};
|
||||
|
||||
// constants
|
||||
static const int OUTPUT_BUFFER_UPDATES = 5;
|
||||
static const UINT32 FRAC_BITS = 22;
|
||||
static const UINT32 FRAC_ONE = 1 << FRAC_BITS;
|
||||
static const UINT32 FRAC_MASK = FRAC_ONE - 1;
|
||||
|
||||
// construction/destruction
|
||||
sound_stream(device_t &device, int inputs, int outputs, int sample_rate, void *param = NULL, stream_update_func callback = &sound_stream::device_stream_update_stub);
|
||||
|
||||
public:
|
||||
// getters
|
||||
sound_stream *next() const { return m_next; }
|
||||
device_t &device() const { return m_device; }
|
||||
int sample_rate() const { return (m_new_sample_rate != 0) ? m_new_sample_rate : m_sample_rate; }
|
||||
attotime sample_time() const;
|
||||
attotime sample_period() const { return attotime_make(0, m_attoseconds_per_sample); }
|
||||
int input_count() const { return m_inputs; }
|
||||
int output_count() const { return m_outputs; }
|
||||
float input_gain(int inputnum) const;
|
||||
float initial_input_gain(int inputnum) const;
|
||||
const char *input_name(int inputnum, astring &string) const;
|
||||
float output_gain(int outputnum) const;
|
||||
|
||||
// operations
|
||||
void set_input(int inputnum, sound_stream *input_stream, int outputnum = 0, float gain = 1.0f);
|
||||
void update();
|
||||
const stream_sample_t *output_since_last_update(int outputnum, int &numsamples);
|
||||
|
||||
// timing
|
||||
void set_sample_rate(int sample_rate);
|
||||
void set_input_gain(int inputnum, float gain);
|
||||
void set_output_gain(int outputnum, float gain);
|
||||
|
||||
private:
|
||||
// helpers called by our friends only
|
||||
void update_with_accounting(bool second_tick);
|
||||
void apply_sample_rate_changes();
|
||||
|
||||
// internal helpers
|
||||
static STREAM_UPDATE( device_stream_update_stub );
|
||||
void recompute_sample_rate_data();
|
||||
void allocate_resample_buffers();
|
||||
void allocate_output_buffers();
|
||||
void postload();
|
||||
void generate_samples(int samples);
|
||||
stream_sample_t *generate_resampled_data(stream_input &input, UINT32 numsamples);
|
||||
|
||||
// linking information
|
||||
device_t & m_device; // owning device
|
||||
sound_stream * m_next; // next stream in the chain
|
||||
|
||||
// general information
|
||||
UINT32 m_sample_rate; // sample rate of this stream
|
||||
UINT32 m_new_sample_rate; // newly-set sample rate for the stream
|
||||
|
||||
// timing information
|
||||
attoseconds_t m_attoseconds_per_sample;// number of attoseconds per sample
|
||||
INT32 m_max_samples_per_update;// maximum samples per update
|
||||
|
||||
// input information
|
||||
int m_inputs; // number of inputs
|
||||
stream_input * m_input; // list of streams we directly depend upon
|
||||
stream_sample_t ** m_input_array; // array of inputs for passing to the callback
|
||||
|
||||
// resample buffer information
|
||||
UINT32 m_resample_bufalloc; // allocated size of each resample buffer
|
||||
|
||||
// output information
|
||||
int m_outputs; // number of outputs
|
||||
stream_output * m_output; // list of streams which directly depend upon us
|
||||
stream_sample_t ** m_output_array; // array of outputs for passing to the callback
|
||||
|
||||
// output buffer information
|
||||
UINT32 m_output_bufalloc; // allocated size of each output buffer
|
||||
INT32 m_output_sampindex; // current position within each output buffer
|
||||
INT32 m_output_update_sampindex;// position at time of last global update
|
||||
INT32 m_output_base_sampindex;// sample at base of buffer, relative to the current emulated second
|
||||
|
||||
// callback information
|
||||
stream_update_func m_callback; // callback function
|
||||
void * m_param; // callback function parameter
|
||||
};
|
||||
|
||||
|
||||
// device type definition
|
||||
extern const device_type SPEAKER;
|
||||
// ======================> sound_manager
|
||||
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
SOUND DEVICE CONFIGURATION MACROS
|
||||
***************************************************************************/
|
||||
|
||||
/* add/remove speakers */
|
||||
#define MCFG_SPEAKER_ADD(_tag, _x, _y, _z) \
|
||||
MCFG_DEVICE_ADD(_tag, SPEAKER, 0) \
|
||||
speaker_device_config::static_set_position(device, _x, _y, _z); \
|
||||
|
||||
#define MCFG_SPEAKER_STANDARD_MONO(_tag) \
|
||||
MCFG_SPEAKER_ADD(_tag, 0.0, 0.0, 1.0)
|
||||
|
||||
#define MCFG_SPEAKER_STANDARD_STEREO(_tagl, _tagr) \
|
||||
MCFG_SPEAKER_ADD(_tagl, -0.2, 0.0, 1.0) \
|
||||
MCFG_SPEAKER_ADD(_tagr, 0.2, 0.0, 1.0)
|
||||
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
FUNCTION PROTOTYPES
|
||||
***************************************************************************/
|
||||
|
||||
/* core interfaces */
|
||||
void sound_init(running_machine *machine);
|
||||
|
||||
|
||||
|
||||
/* ----- sound device interface ----- */
|
||||
|
||||
/* global sound controls */
|
||||
void sound_mute(running_machine *machine, int mute);
|
||||
void sound_set_attenuation(running_machine *machine, int attenuation);
|
||||
int sound_get_attenuation(running_machine *machine);
|
||||
void sound_global_enable(running_machine *machine, int enable);
|
||||
|
||||
/* user gain controls on speaker inputs for mixing */
|
||||
int sound_get_user_gain_count(running_machine *machine);
|
||||
void sound_set_user_gain(running_machine *machine, int index, float gain);
|
||||
float sound_get_user_gain(running_machine *machine, int index);
|
||||
float sound_get_default_gain(running_machine *machine, int index);
|
||||
const char *sound_get_user_gain_name(running_machine *machine, int index);
|
||||
|
||||
|
||||
/* driver gain controls on chip outputs */
|
||||
void sound_set_output_gain(device_t *device, int output, float gain);
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// INLINE HELPERS
|
||||
//**************************************************************************
|
||||
|
||||
//-------------------------------------------------
|
||||
// speaker_count - return the number of speaker
|
||||
// devices in a machine_config
|
||||
//-------------------------------------------------
|
||||
|
||||
inline int speaker_count(const machine_config &config)
|
||||
class sound_manager
|
||||
{
|
||||
return config.m_devicelist.count(SPEAKER);
|
||||
}
|
||||
friend class sound_stream;
|
||||
|
||||
// reasons for muting
|
||||
static const UINT8 MUTE_REASON_PAUSE = 0x01;
|
||||
static const UINT8 MUTE_REASON_UI = 0x02;
|
||||
static const UINT8 MUTE_REASON_DEBUGGER = 0x04;
|
||||
static const UINT8 MUTE_REASON_SYSTEM = 0x08;
|
||||
|
||||
//-------------------------------------------------
|
||||
// speaker_first - return the first speaker
|
||||
// device config in a machine_config
|
||||
//-------------------------------------------------
|
||||
// stream updates
|
||||
static const attotime STREAMS_UPDATE_ATTOTIME;
|
||||
|
||||
inline const speaker_device_config *speaker_first(const machine_config &config)
|
||||
{
|
||||
return downcast<speaker_device_config *>(config.m_devicelist.first(SPEAKER));
|
||||
}
|
||||
public:
|
||||
static const int STREAMS_UPDATE_FREQUENCY = 50;
|
||||
|
||||
// construction/destruction
|
||||
sound_manager(running_machine &machine);
|
||||
~sound_manager();
|
||||
|
||||
// getters
|
||||
int attenuation() const { return m_attenuation; }
|
||||
sound_stream *first_stream() const { return m_stream_list.first(); }
|
||||
attotime last_update() const { return m_last_update; }
|
||||
attoseconds_t update_attoseconds() const { return m_update_attoseconds; }
|
||||
|
||||
// stream creation
|
||||
sound_stream *stream_alloc(device_t &device, int inputs, int outputs, int sample_rate, void *param = NULL, sound_stream::stream_update_func callback = NULL);
|
||||
|
||||
// global controls
|
||||
void set_attenuation(int attenuation);
|
||||
void ui_mute(bool turn_off = true) { mute(turn_off, MUTE_REASON_UI); }
|
||||
void debugger_mute(bool turn_off = true) { mute(turn_off, MUTE_REASON_DEBUGGER); }
|
||||
void system_mute(bool turn_off = true) { mute(turn_off, MUTE_REASON_SYSTEM); }
|
||||
void system_enable(bool turn_on = true) { mute(!turn_on, MUTE_REASON_SYSTEM); }
|
||||
|
||||
// user gain controls
|
||||
bool indexed_speaker_input(int index, speaker_input &info) const;
|
||||
|
||||
private:
|
||||
// internal helpers
|
||||
void mute(bool mute, UINT8 reason);
|
||||
static void reset(running_machine &machine);
|
||||
static void pause(running_machine &machine);
|
||||
static void resume(running_machine &machine);
|
||||
static void config_load(running_machine *machine, int config_type, xml_data_node *parentnode);
|
||||
static void config_save(running_machine *machine, int config_type, xml_data_node *parentnode);
|
||||
|
||||
//-------------------------------------------------
|
||||
// speaker_next - return the next speaker
|
||||
// device config in a machine_config
|
||||
//-------------------------------------------------
|
||||
static TIMER_CALLBACK( update_static ) { reinterpret_cast<sound_manager *>(ptr)->update(); }
|
||||
void update();
|
||||
|
||||
inline const speaker_device_config *speaker_next(const speaker_device_config *previous)
|
||||
{
|
||||
return downcast<speaker_device_config *>(previous->typenext());
|
||||
}
|
||||
// internal state
|
||||
running_machine & m_machine; // reference to our machine
|
||||
emu_timer * m_update_timer; // timer to drive periodic updates
|
||||
|
||||
UINT32 m_finalmix_leftover;
|
||||
INT16 * m_finalmix;
|
||||
INT32 * m_leftmix;
|
||||
INT32 * m_rightmix;
|
||||
|
||||
//-------------------------------------------------
|
||||
// speaker_count - return the number of speaker
|
||||
// devices in a machine
|
||||
//-------------------------------------------------
|
||||
UINT8 m_muted;
|
||||
int m_attenuation;
|
||||
int m_nosound_mode;
|
||||
|
||||
inline int speaker_count(running_machine &machine)
|
||||
{
|
||||
return machine.m_devicelist.count(SPEAKER);
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// speaker_first - return the first speaker
|
||||
// device in a machine
|
||||
//-------------------------------------------------
|
||||
|
||||
inline speaker_device *speaker_first(running_machine &machine)
|
||||
{
|
||||
return downcast<speaker_device *>(machine.m_devicelist.first(SPEAKER));
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// speaker_next - return the next speaker
|
||||
// device in a machine
|
||||
//-------------------------------------------------
|
||||
|
||||
inline speaker_device *speaker_next(speaker_device *previous)
|
||||
{
|
||||
return downcast<speaker_device *>(previous->typenext());
|
||||
}
|
||||
wav_file * m_wavfile;
|
||||
|
||||
// streams data
|
||||
simple_list<sound_stream> m_stream_list; // list of streams
|
||||
attoseconds_t m_update_attoseconds; // attoseconds between global updates
|
||||
attotime m_last_update; // last update time
|
||||
};
|
||||
|
||||
|
||||
#endif /* __SOUND_H__ */
|
||||
|
@ -7,7 +7,6 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "fm.h"
|
||||
#include "2151intf.h"
|
||||
#include "ym2151.h"
|
||||
@ -57,7 +56,7 @@ static DEVICE_START( ym2151 )
|
||||
rate = device->clock()/64;
|
||||
|
||||
/* stream setup */
|
||||
info->stream = stream_create(device,0,2,rate,info,ym2151_update);
|
||||
info->stream = device->machine->sound().stream_alloc(*device,0,2,rate,info,ym2151_update);
|
||||
|
||||
info->chip = ym2151_init(device,device->clock(),rate);
|
||||
assert_always(info->chip != NULL, "Error creating YM2151 chip");
|
||||
@ -88,7 +87,7 @@ READ8_DEVICE_HANDLER( ym2151_r )
|
||||
|
||||
if (offset & 1)
|
||||
{
|
||||
stream_update(token->stream);
|
||||
token->stream->update();
|
||||
return ym2151_read_status(token->chip);
|
||||
}
|
||||
else
|
||||
@ -101,7 +100,7 @@ WRITE8_DEVICE_HANDLER( ym2151_w )
|
||||
|
||||
if (offset & 1)
|
||||
{
|
||||
stream_update(token->stream);
|
||||
token->stream->update();
|
||||
ym2151_write_reg(token->chip, token->lastreg, data);
|
||||
}
|
||||
else
|
||||
|
@ -1,5 +1,4 @@
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "2203intf.h"
|
||||
#include "fm.h"
|
||||
|
||||
@ -81,7 +80,7 @@ static TIMER_CALLBACK( timer_callback_2203_1 )
|
||||
void ym2203_update_request(void *param)
|
||||
{
|
||||
ym2203_state *info = (ym2203_state *)param;
|
||||
stream_update(info->stream);
|
||||
info->stream->update();
|
||||
}
|
||||
|
||||
|
||||
@ -139,7 +138,7 @@ static DEVICE_START( ym2203 )
|
||||
info->timer[1] = timer_alloc(device->machine, timer_callback_2203_1, info);
|
||||
|
||||
/* stream system initialize */
|
||||
info->stream = stream_create(device,0,1,rate,info,ym2203_stream_update);
|
||||
info->stream = device->machine->sound().stream_alloc(*device,0,1,rate,info,ym2203_stream_update);
|
||||
|
||||
/* Initialize FM emurator */
|
||||
info->chip = ym2203_init(info,device,device->clock(),rate,timer_handler,IRQHandler,&psgintf);
|
||||
|
@ -5,7 +5,6 @@
|
||||
****************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "ym2413.h"
|
||||
#include "2413intf.h"
|
||||
|
||||
@ -50,7 +49,7 @@ static STREAM_UPDATE( ym2413_stream_update )
|
||||
static void _stream_update(void *param, int interval)
|
||||
{
|
||||
ym2413_state *info = (ym2413_state *)param;
|
||||
stream_update(info->stream);
|
||||
info->stream->update();
|
||||
}
|
||||
|
||||
static DEVICE_START( ym2413 )
|
||||
@ -63,7 +62,7 @@ static DEVICE_START( ym2413 )
|
||||
assert_always(info->chip != NULL, "Error creating YM2413 chip");
|
||||
|
||||
/* stream system initialize */
|
||||
info->stream = stream_create(device,0,2,rate,info,ym2413_stream_update);
|
||||
info->stream = device->machine->sound().stream_alloc(*device,0,2,rate,info,ym2413_stream_update);
|
||||
|
||||
ym2413_set_update_handler(info->chip, _stream_update, info);
|
||||
|
||||
@ -84,7 +83,7 @@ static DEVICE_START( ym2413 )
|
||||
{
|
||||
ym2413_reset (i);
|
||||
|
||||
ym2413[i].DAC_stream = stream_create(device, 0, 1, device->clock()/72, i, YM2413DAC_update);
|
||||
ym2413[i].DAC_stream = device->machine->sound().stream_alloc(*device, 0, 1, device->clock()/72, i, YM2413DAC_update);
|
||||
|
||||
if (ym2413[i].DAC_stream == -1)
|
||||
return 1;
|
||||
|
@ -12,7 +12,6 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "ay8910.h"
|
||||
#include "2608intf.h"
|
||||
#include "fm.h"
|
||||
@ -110,7 +109,7 @@ static void timer_handler(void *param,int c,int count,int clock)
|
||||
void ym2608_update_request(void *param)
|
||||
{
|
||||
ym2608_state *info = (ym2608_state *)param;
|
||||
stream_update(info->stream);
|
||||
info->stream->update();
|
||||
}
|
||||
|
||||
static STREAM_UPDATE( ym2608_stream_update )
|
||||
@ -157,7 +156,7 @@ static DEVICE_START( ym2608 )
|
||||
info->timer[1] = timer_alloc(device->machine, timer_callback_2608_1, info);
|
||||
|
||||
/* stream system initialize */
|
||||
info->stream = stream_create(device,0,2,rate,info,ym2608_stream_update);
|
||||
info->stream = device->machine->sound().stream_alloc(*device,0,2,rate,info,ym2608_stream_update);
|
||||
/* setup adpcm buffers */
|
||||
pcmbufa = *device->region();
|
||||
pcmsizea = device->region()->bytes();
|
||||
|
@ -12,7 +12,6 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "ay8910.h"
|
||||
#include "2610intf.h"
|
||||
#include "fm.h"
|
||||
@ -110,7 +109,7 @@ static void timer_handler(void *param,int c,int count,int clock)
|
||||
void ym2610_update_request(void *param)
|
||||
{
|
||||
ym2610_state *info = (ym2610_state *)param;
|
||||
stream_update(info->stream);
|
||||
info->stream->update();
|
||||
}
|
||||
|
||||
|
||||
@ -161,7 +160,7 @@ static DEVICE_START( ym2610 )
|
||||
info->timer[1] = timer_alloc(device->machine, timer_callback_1, info);
|
||||
|
||||
/* stream system initialize */
|
||||
info->stream = stream_create(device,0,2,rate,info,(type == YM2610) ? ym2610_stream_update : ym2610b_stream_update);
|
||||
info->stream = device->machine->sound().stream_alloc(*device,0,2,rate,info,(type == YM2610) ? ym2610_stream_update : ym2610b_stream_update);
|
||||
/* setup adpcm buffers */
|
||||
pcmbufa = *device->region();
|
||||
pcmsizea = device->region()->bytes();
|
||||
|
@ -12,7 +12,6 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "sound/fm.h"
|
||||
#include "sound/2612intf.h"
|
||||
|
||||
@ -77,7 +76,7 @@ static void timer_handler(void *param,int c,int count,int clock)
|
||||
void ym2612_update_request(void *param)
|
||||
{
|
||||
ym2612_state *info = (ym2612_state *)param;
|
||||
stream_update(info->stream);
|
||||
info->stream->update();
|
||||
}
|
||||
|
||||
/***********************************************************/
|
||||
@ -113,7 +112,7 @@ static DEVICE_START( ym2612 )
|
||||
info->timer[1] = timer_alloc(device->machine, timer_callback_2612_1, info);
|
||||
|
||||
/* stream system initialize */
|
||||
info->stream = stream_create(device,0,2,rate,info,ym2612_stream_update);
|
||||
info->stream = device->machine->sound().stream_alloc(*device,0,2,rate,info,ym2612_stream_update);
|
||||
|
||||
/**** initialize YM2612 ****/
|
||||
info->chip = ym2612_init(info,device,device->clock(),rate,timer_handler,IRQHandler);
|
||||
|
@ -6,7 +6,6 @@
|
||||
|
||||
***************************************************************************/
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "262intf.h"
|
||||
#include "ymf262.h"
|
||||
|
||||
@ -72,7 +71,7 @@ static STREAM_UPDATE( ymf262_stream_update )
|
||||
static void _stream_update(void *param, int interval)
|
||||
{
|
||||
ymf262_state *info = (ymf262_state *)param;
|
||||
stream_update(info->stream);
|
||||
info->stream->update();
|
||||
}
|
||||
|
||||
|
||||
@ -89,7 +88,7 @@ static DEVICE_START( ymf262 )
|
||||
info->chip = ymf262_init(device,device->clock(),rate);
|
||||
assert_always(info->chip != NULL, "Error creating YMF262 chip");
|
||||
|
||||
info->stream = stream_create(device,0,4,rate,info,ymf262_stream_update);
|
||||
info->stream = device->machine->sound().stream_alloc(*device,0,4,rate,info,ymf262_stream_update);
|
||||
|
||||
/* YMF262 setup */
|
||||
ymf262_set_timer_handler (info->chip, timer_handler_262, info);
|
||||
|
@ -17,7 +17,6 @@
|
||||
*
|
||||
******************************************************************************/
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "3526intf.h"
|
||||
#include "fm.h"
|
||||
#include "sound/fmopl.h"
|
||||
@ -83,7 +82,7 @@ static STREAM_UPDATE( ym3526_stream_update )
|
||||
static void _stream_update(void *param, int interval)
|
||||
{
|
||||
ym3526_state *info = (ym3526_state *)param;
|
||||
stream_update(info->stream);
|
||||
info->stream->update();
|
||||
}
|
||||
|
||||
|
||||
@ -100,7 +99,7 @@ static DEVICE_START( ym3526 )
|
||||
info->chip = ym3526_init(device,device->clock(),rate);
|
||||
assert_always(info->chip != NULL, "Error creating YM3526 chip");
|
||||
|
||||
info->stream = stream_create(device,0,1,rate,info,ym3526_stream_update);
|
||||
info->stream = device->machine->sound().stream_alloc(*device,0,1,rate,info,ym3526_stream_update);
|
||||
/* YM3526 setup */
|
||||
ym3526_set_timer_handler (info->chip, TimerHandler, info);
|
||||
ym3526_set_irq_handler (info->chip, IRQHandler, info);
|
||||
|
@ -17,7 +17,6 @@
|
||||
*
|
||||
******************************************************************************/
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "3812intf.h"
|
||||
#include "fm.h"
|
||||
#include "sound/fmopl.h"
|
||||
@ -83,7 +82,7 @@ static STREAM_UPDATE( ym3812_stream_update )
|
||||
static void _stream_update(void * param, int interval)
|
||||
{
|
||||
ym3812_state *info = (ym3812_state *)param;
|
||||
stream_update(info->stream);
|
||||
info->stream->update();
|
||||
}
|
||||
|
||||
|
||||
@ -100,7 +99,7 @@ static DEVICE_START( ym3812 )
|
||||
info->chip = ym3812_init(device,device->clock(),rate);
|
||||
assert_always(info->chip != NULL, "Error creating YM3812 chip");
|
||||
|
||||
info->stream = stream_create(device,0,1,rate,info,ym3812_stream_update);
|
||||
info->stream = device->machine->sound().stream_alloc(*device,0,1,rate,info,ym3812_stream_update);
|
||||
|
||||
/* YM3812 setup */
|
||||
ym3812_set_timer_handler (info->chip, TimerHandler, info);
|
||||
|
@ -17,7 +17,6 @@
|
||||
*
|
||||
******************************************************************************/
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "8950intf.h"
|
||||
#include "fm.h"
|
||||
#include "sound/fmopl.h"
|
||||
@ -110,7 +109,7 @@ static STREAM_UPDATE( y8950_stream_update )
|
||||
static void _stream_update(void *param, int interval)
|
||||
{
|
||||
y8950_state *info = (y8950_state *)param;
|
||||
stream_update(info->stream);
|
||||
info->stream->update();
|
||||
}
|
||||
|
||||
|
||||
@ -130,8 +129,7 @@ static DEVICE_START( y8950 )
|
||||
/* ADPCM ROM data */
|
||||
y8950_set_delta_t_memory(info->chip, *device->region(), device->region()->bytes());
|
||||
|
||||
info->stream = stream_create(device,0,1,rate,info,y8950_stream_update);
|
||||
|
||||
info->stream = device->machine->sound().stream_alloc(*device,0,1,rate,info,y8950_stream_update);
|
||||
/* port and keyboard handler */
|
||||
y8950_set_port_handler(info->chip, Y8950PortHandler_w, Y8950PortHandler_r, info);
|
||||
y8950_set_keyboard_handler(info->chip, Y8950KeyboardHandler_w, Y8950KeyboardHandler_r, info);
|
||||
|
@ -9,7 +9,6 @@
|
||||
*/
|
||||
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "aica.h"
|
||||
#include "aicadsp.h"
|
||||
|
||||
@ -1255,7 +1254,7 @@ static DEVICE_START( aica )
|
||||
{
|
||||
AICA->IntARMCB = intf->irq_callback;
|
||||
|
||||
AICA->stream = stream_create(device, 0, 2, 44100, AICA, AICA_Update);
|
||||
AICA->stream = device->machine->sound().stream_alloc(*device, 0, 2, 44100, AICA, AICA_Update);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,6 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "asc.h"
|
||||
|
||||
//**************************************************************************
|
||||
@ -106,7 +105,7 @@ static TIMER_CALLBACK( sync_timer_cb )
|
||||
{
|
||||
asc_device *pDevice = (asc_device *)ptr;
|
||||
|
||||
stream_update(pDevice->m_stream);
|
||||
pDevice->m_stream->update();
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
@ -130,7 +129,7 @@ asc_device::asc_device(running_machine &_machine, const asc_device_config &confi
|
||||
void asc_device::device_start()
|
||||
{
|
||||
// create the stream
|
||||
m_stream = stream_create(this, 0, 2, 22257, this, static_stream_generate);
|
||||
m_stream = m_machine.sound().stream_alloc(*this, 0, 2, 22257, this, static_stream_generate);
|
||||
|
||||
memset(m_regs, 0, sizeof(m_regs));
|
||||
|
||||
@ -156,7 +155,7 @@ void asc_device::device_start()
|
||||
|
||||
void asc_device::device_reset()
|
||||
{
|
||||
stream_update(m_stream);
|
||||
m_stream->update();
|
||||
|
||||
memset(m_regs, 0, sizeof(m_regs));
|
||||
memset(m_fifo_a, 0, sizeof(m_fifo_a));
|
||||
@ -333,7 +332,7 @@ READ8_MEMBER( asc_device::read )
|
||||
}
|
||||
else
|
||||
{
|
||||
stream_update(m_stream);
|
||||
m_stream->update();
|
||||
switch (offset)
|
||||
{
|
||||
case R_VERSION:
|
||||
@ -498,7 +497,7 @@ WRITE8_MEMBER( asc_device::write )
|
||||
{
|
||||
// printf("ASC: %02x to %x (was %x)\n", data, offset, m_regs[offset-0x800]);
|
||||
|
||||
stream_update(m_stream);
|
||||
m_stream->update();
|
||||
switch (offset)
|
||||
{
|
||||
case R_MODE:
|
||||
|
@ -12,7 +12,6 @@
|
||||
#ifndef __ASC_H__
|
||||
#define __ASC_H__
|
||||
|
||||
#include "streams.h"
|
||||
|
||||
|
||||
|
||||
|
@ -40,7 +40,6 @@
|
||||
***********************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "astrocde.h"
|
||||
|
||||
|
||||
@ -272,7 +271,7 @@ static DEVICE_START( astrocade )
|
||||
chip->bitswap[i] = BITSWAP8(i, 0,1,2,3,4,5,6,7);
|
||||
|
||||
/* allocate a stream for output */
|
||||
chip->stream = stream_create(device, 0, 1, device->clock(), chip, astrocade_update);
|
||||
chip->stream = device->machine->sound().stream_alloc(*device, 0, 1, device->clock(), chip, astrocade_update);
|
||||
|
||||
/* reset state */
|
||||
DEVICE_RESET_CALL(astrocade);
|
||||
@ -297,7 +296,7 @@ WRITE8_DEVICE_HANDLER( astrocade_sound_w )
|
||||
offset &= 7;
|
||||
|
||||
/* update */
|
||||
stream_update(chip->stream);
|
||||
chip->stream->update();
|
||||
|
||||
/* stash the new register value */
|
||||
chip->reg[offset & 7] = data;
|
||||
|
@ -105,7 +105,6 @@ has twice the steps, happening twice as fast.
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "ay8910.h"
|
||||
|
||||
/*************************************
|
||||
@ -776,7 +775,7 @@ void *ay8910_start_ym(void *infoptr, device_type chip_type, device_t *device, in
|
||||
|
||||
/* 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(device, 0, info->streams, device->clock() / 8, info, ay8910_update);
|
||||
info->channel = device->machine->sound().stream_alloc(*device, 0, info->streams, device->clock() / 8, info, ay8910_update);
|
||||
|
||||
ay8910_set_clock_ym(info,device->clock());
|
||||
ay8910_statesave(info, device);
|
||||
@ -833,13 +832,13 @@ void ay8910_set_volume(device_t *device,int channel,int volume)
|
||||
|
||||
for (ch = 0; ch < psg->streams; ch++)
|
||||
if (channel == ch || psg->streams == 1 || channel == ALL_8910_CHANNELS)
|
||||
stream_set_output_gain(psg->channel, ch, volume / 100.0);
|
||||
psg->channel->set_output_gain(ch, volume / 100.0);
|
||||
}
|
||||
|
||||
void ay8910_set_clock_ym(void *chip, int clock)
|
||||
{
|
||||
ay8910_context *psg = (ay8910_context *)chip;
|
||||
stream_set_sample_rate(psg->channel, clock / 8 );
|
||||
psg->channel->set_sample_rate( clock / 8 );
|
||||
}
|
||||
|
||||
void ay8910_write_ym(void *chip, int addr, int data)
|
||||
@ -854,7 +853,7 @@ void ay8910_write_ym(void *chip, int addr, int data)
|
||||
if (r == AY_ESHAPE || psg->regs[r] != data)
|
||||
{
|
||||
/* update the output buffer before changing the register */
|
||||
stream_update(psg->channel);
|
||||
psg->channel->update();
|
||||
}
|
||||
|
||||
ay8910_write_reg(psg,r,data);
|
||||
@ -874,7 +873,7 @@ int ay8910_read_ym(void *chip)
|
||||
if (r > 15) return 0;
|
||||
|
||||
/* There are no state dependent register in the AY8910! */
|
||||
/* stream_update(psg->channel); */
|
||||
/* psg->channel->update(); */
|
||||
|
||||
switch (r)
|
||||
{
|
||||
|
@ -12,7 +12,6 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "sound/beep.h"
|
||||
|
||||
|
||||
@ -93,7 +92,7 @@ static DEVICE_START( beep )
|
||||
{
|
||||
beep_state *pBeep = get_safe_token(device);
|
||||
|
||||
pBeep->stream = stream_create(device, 0, 1, BEEP_RATE, pBeep, beep_sound_update );
|
||||
pBeep->stream = device->machine->sound().stream_alloc(*device, 0, 1, BEEP_RATE, pBeep, beep_sound_update );
|
||||
pBeep->enable = 0;
|
||||
pBeep->frequency = 3250;
|
||||
pBeep->incr = 0;
|
||||
@ -116,7 +115,7 @@ void beep_set_state(device_t *device, int on)
|
||||
if (info->enable == on)
|
||||
return;
|
||||
|
||||
stream_update(info->stream);
|
||||
info->stream->update();
|
||||
|
||||
info->enable = on;
|
||||
/* restart wave from beginning */
|
||||
@ -139,7 +138,7 @@ void beep_set_frequency(device_t *device,int frequency)
|
||||
if (info->frequency == frequency)
|
||||
return;
|
||||
|
||||
stream_update(info->stream);
|
||||
info->stream->update();
|
||||
info->frequency = frequency;
|
||||
info->signal = 0x07fff;
|
||||
info->incr = 0;
|
||||
@ -157,11 +156,11 @@ void beep_set_volume(device_t *device, int volume)
|
||||
{
|
||||
beep_state *info = get_safe_token(device);
|
||||
|
||||
stream_update(info->stream);
|
||||
info->stream->update();
|
||||
|
||||
volume = 100 * volume / 7;
|
||||
|
||||
sound_set_output_gain(device, 0, volume);
|
||||
downcast<beep_device *>(device)->set_output_gain(0, volume);
|
||||
}
|
||||
|
||||
|
||||
|
@ -43,7 +43,6 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "bsmt2000.h"
|
||||
|
||||
|
||||
@ -227,7 +226,7 @@ void bsmt2000_device::device_start()
|
||||
// in theory we should generate a 24MHz stream, but that's certainly overkill
|
||||
// internally at 24MHz the max output sample rate is 32kHz
|
||||
// divided by 128 gives us 6x the max output rate which is plenty for oversampling
|
||||
m_stream = stream_create(*this, 0, 2, clock() / 128);
|
||||
m_stream = m_machine.sound().stream_alloc(*this, 0, 2, clock() / 128);
|
||||
|
||||
// register for save states
|
||||
state_save_register_device_item(this, 0, m_register_select);
|
||||
@ -261,7 +260,7 @@ void bsmt2000_device::device_timer(emu_timer &timer, device_timer_id id, int par
|
||||
{
|
||||
// deferred reset
|
||||
case TIMER_ID_RESET:
|
||||
stream_update(m_stream);
|
||||
m_stream->update();
|
||||
m_cpu->reset();
|
||||
break;
|
||||
|
||||
@ -281,8 +280,8 @@ void bsmt2000_device::device_timer(emu_timer &timer, device_timer_id id, int par
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// stream_generate - handle update requests for
|
||||
// our sound stream
|
||||
// sound_stream_update - handle update requests
|
||||
// for our sound stream
|
||||
//-------------------------------------------------
|
||||
|
||||
void bsmt2000_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
|
||||
@ -398,7 +397,7 @@ WRITE16_MEMBER( bsmt2000_device::tms_rom_bank_w )
|
||||
|
||||
WRITE16_MEMBER( bsmt2000_device::tms_left_w )
|
||||
{
|
||||
stream_update(m_stream);
|
||||
m_stream->update();
|
||||
m_left_data = data;
|
||||
}
|
||||
|
||||
@ -410,7 +409,7 @@ WRITE16_MEMBER( bsmt2000_device::tms_left_w )
|
||||
|
||||
WRITE16_MEMBER( bsmt2000_device::tms_right_w )
|
||||
{
|
||||
stream_update(m_stream);
|
||||
m_stream->update();
|
||||
m_right_data = data;
|
||||
}
|
||||
|
||||
|
@ -44,7 +44,6 @@ Unmapped registers:
|
||||
|
||||
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "c140.h"
|
||||
|
||||
#define MAX_VOICE 24
|
||||
@ -195,7 +194,7 @@ static long find_sample(c140_state *info, long adrs, long bank, int voice)
|
||||
WRITE8_DEVICE_HANDLER( c140_w )
|
||||
{
|
||||
c140_state *info = get_safe_token(device);
|
||||
stream_update(info->stream);
|
||||
info->stream->update();
|
||||
|
||||
offset&=0x1ff;
|
||||
|
||||
@ -471,7 +470,7 @@ static DEVICE_START( c140 )
|
||||
|
||||
info->banking_type = intf->banking_type;
|
||||
|
||||
info->stream = stream_create(device,0,2,info->sample_rate,info,update_stereo);
|
||||
info->stream = device->machine->sound().stream_alloc(*device,0,2,info->sample_rate,info,update_stereo);
|
||||
|
||||
info->pRom=*device->region();
|
||||
|
||||
|
@ -14,7 +14,6 @@
|
||||
*/
|
||||
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "c352.h"
|
||||
|
||||
#define VERBOSE (0)
|
||||
@ -365,7 +364,7 @@ static unsigned short c352_read_reg16(c352_state *info, unsigned long address)
|
||||
unsigned long chan;
|
||||
unsigned short val;
|
||||
|
||||
stream_update(info->stream);
|
||||
info->stream->update();
|
||||
|
||||
chan = (address >> 4) & 0xfff;
|
||||
if (chan > 31)
|
||||
@ -391,7 +390,7 @@ static void c352_write_reg16(c352_state *info, unsigned long address, unsigned s
|
||||
unsigned long chan;
|
||||
int i;
|
||||
|
||||
stream_update(info->stream);
|
||||
info->stream->update();
|
||||
|
||||
chan = (address >> 4) & 0xfff;
|
||||
|
||||
@ -546,7 +545,7 @@ static DEVICE_START( c352 )
|
||||
|
||||
info->sample_rate_base = device->clock() / 192;
|
||||
|
||||
info->stream = stream_create(device, 0, 4, info->sample_rate_base, info, c352_update);
|
||||
info->stream = device->machine->sound().stream_alloc(*device, 0, 4, info->sample_rate_base, info, c352_update);
|
||||
|
||||
c352_init(info, device);
|
||||
}
|
||||
|
@ -54,7 +54,6 @@
|
||||
*/
|
||||
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "c6280.h"
|
||||
|
||||
typedef struct {
|
||||
@ -143,7 +142,7 @@ static void c6280_write(c6280_t *p, int offset, int data)
|
||||
t_channel *q = &p->channel[p->select];
|
||||
|
||||
/* Update stream */
|
||||
stream_update(p->stream);
|
||||
p->stream->update();
|
||||
|
||||
switch(offset & 0x0F)
|
||||
{
|
||||
@ -329,7 +328,7 @@ static DEVICE_START( c6280 )
|
||||
c6280_init(device, info, device->clock(), rate);
|
||||
|
||||
/* Create stereo stream */
|
||||
info->stream = stream_create(device, 0, 2, rate, info, c6280_update);
|
||||
info->stream = device->machine->sound().stream_alloc(*device, 0, 2, rate, info, c6280_update);
|
||||
}
|
||||
|
||||
READ8_DEVICE_HANDLER( c6280_r )
|
||||
|
@ -4,7 +4,6 @@
|
||||
*/
|
||||
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "cdrom.h"
|
||||
#include "cdda.h"
|
||||
|
||||
@ -59,7 +58,7 @@ static DEVICE_START( cdda )
|
||||
|
||||
//intf = (const struct CDDAinterface *)device->baseconfig().static_config();
|
||||
|
||||
info->stream = stream_create(device, 0, 2, 44100, info, cdda_update);
|
||||
info->stream = device->machine->sound().stream_alloc(*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 );
|
||||
@ -114,7 +113,7 @@ void cdda_start_audio(device_t *device, UINT32 startlba, UINT32 numblocks)
|
||||
{
|
||||
cdda_info *info = get_safe_token(device);
|
||||
|
||||
stream_update(info->stream);
|
||||
info->stream->update();
|
||||
info->audio_playing = TRUE;
|
||||
info->audio_pause = FALSE;
|
||||
info->audio_ended_normally = FALSE;
|
||||
@ -132,7 +131,7 @@ void cdda_stop_audio(device_t *device)
|
||||
{
|
||||
cdda_info *info = get_safe_token(device);
|
||||
|
||||
stream_update(info->stream);
|
||||
info->stream->update();
|
||||
info->audio_playing = FALSE;
|
||||
info->audio_ended_normally = TRUE;
|
||||
}
|
||||
@ -147,7 +146,7 @@ void cdda_pause_audio(device_t *device, int pause)
|
||||
{
|
||||
cdda_info *info = get_safe_token(device);
|
||||
|
||||
stream_update(info->stream);
|
||||
info->stream->update();
|
||||
info->audio_pause = pause;
|
||||
}
|
||||
|
||||
@ -161,7 +160,7 @@ UINT32 cdda_get_audio_lba(device_t *device)
|
||||
{
|
||||
cdda_info *info = get_safe_token(device);
|
||||
|
||||
stream_update(info->stream);
|
||||
info->stream->update();
|
||||
return info->audio_lba;
|
||||
}
|
||||
|
||||
@ -175,7 +174,7 @@ int cdda_audio_active(device_t *device)
|
||||
{
|
||||
cdda_info *info = get_safe_token(device);
|
||||
|
||||
stream_update(info->stream);
|
||||
info->stream->update();
|
||||
return info->audio_playing;
|
||||
}
|
||||
|
||||
@ -299,8 +298,8 @@ void cdda_set_volume(device_t *device,int volume)
|
||||
{
|
||||
cdda_info *cdda = get_safe_token(device);
|
||||
|
||||
stream_set_output_gain(cdda->stream,0,volume / 100.0);
|
||||
stream_set_output_gain(cdda->stream,1,volume / 100.0);
|
||||
cdda->stream->set_output_gain(0,volume / 100.0);
|
||||
cdda->stream->set_output_gain(1,volume / 100.0);
|
||||
}
|
||||
|
||||
/*-------------------------------------------------
|
||||
@ -313,9 +312,9 @@ void cdda_set_channel_volume(device_t *device, int channel, int volume)
|
||||
cdda_info *cdda = get_safe_token(device);
|
||||
|
||||
if(channel == 0)
|
||||
stream_set_output_gain(cdda->stream,0,volume / 100.0);
|
||||
cdda->stream->set_output_gain(0,volume / 100.0);
|
||||
if(channel == 1)
|
||||
stream_set_output_gain(cdda->stream,1,volume / 100.0);
|
||||
cdda->stream->set_output_gain(1,volume / 100.0);
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
|
@ -16,7 +16,6 @@
|
||||
*/
|
||||
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "cdp1863.h"
|
||||
|
||||
/***************************************************************************
|
||||
@ -176,7 +175,7 @@ static DEVICE_START( cdp1863 )
|
||||
const cdp1863_config *config = get_safe_config(device);
|
||||
|
||||
/* set initial values */
|
||||
cdp1863->stream = stream_create(device, 0, 1, device->machine->sample_rate, cdp1863, cdp1863_stream_update);
|
||||
cdp1863->stream = device->machine->sound().stream_alloc(*device, 0, 1, device->machine->sample_rate, cdp1863, cdp1863_stream_update);
|
||||
cdp1863->clock1 = device->clock();
|
||||
cdp1863->clock2 = config->clock2;
|
||||
cdp1863->oe = 1;
|
||||
|
@ -23,7 +23,6 @@
|
||||
*/
|
||||
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "cdp1864.h"
|
||||
|
||||
/***************************************************************************
|
||||
@ -447,7 +446,7 @@ static DEVICE_START( cdp1864 )
|
||||
cdp1864_init_palette(device, intf);
|
||||
|
||||
/* create sound stream */
|
||||
cdp1864->stream = stream_create(device, 0, 1, device->machine->sample_rate, cdp1864, cdp1864_stream_update);
|
||||
cdp1864->stream = device->machine->sound().stream_alloc(*device, 0, 1, device->machine->sample_rate, cdp1864, cdp1864_stream_update);
|
||||
|
||||
/* create the timers */
|
||||
cdp1864->int_timer = timer_alloc(device->machine, cdp1864_int_tick, (void *)device);
|
||||
|
@ -434,7 +434,7 @@ void cdp1869_device::device_start()
|
||||
initialize_palette();
|
||||
|
||||
// create sound stream
|
||||
m_stream = stream_create(this, 0, 1, m_machine.sample_rate, this, static_stream_generate);
|
||||
m_stream = m_machine.sound().stream_alloc(*this, 0, 1, m_machine.sample_rate);
|
||||
|
||||
// register for state saving
|
||||
state_save_register_device_item(this, 0, m_prd);
|
||||
@ -512,16 +512,11 @@ void cdp1869_device::initialize_palette()
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// stream_generate - handle update requests for
|
||||
// sound_stream_update - handle update requests for
|
||||
// our sound stream
|
||||
//-------------------------------------------------
|
||||
|
||||
STREAM_UPDATE( cdp1869_device::static_stream_generate )
|
||||
{
|
||||
reinterpret_cast<cdp1869_device *>(param)->stream_generate(inputs, outputs, samples);
|
||||
}
|
||||
|
||||
void cdp1869_device::stream_generate(stream_sample_t **inputs, stream_sample_t **outputs, int samples)
|
||||
void cdp1869_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
|
||||
{
|
||||
// reset the output stream
|
||||
memset(outputs[0], 0, samples * sizeof(*outputs[0]));
|
||||
@ -713,7 +708,7 @@ WRITE8_MEMBER( cdp1869_device::out4_w )
|
||||
m_toneoff = BIT(offset, 7);
|
||||
m_tonediv = (offset & 0x7f00) >> 8;
|
||||
|
||||
stream_update(m_stream);
|
||||
m_stream->update();
|
||||
}
|
||||
|
||||
|
||||
@ -753,7 +748,7 @@ WRITE8_MEMBER( cdp1869_device::out5_w )
|
||||
m_wnfreq = (offset & 0x7000) >> 12;
|
||||
m_wnoff = BIT(offset, 15);
|
||||
|
||||
stream_update(m_stream);
|
||||
m_stream->update();
|
||||
|
||||
if (m_cmem)
|
||||
{
|
||||
|
@ -271,8 +271,7 @@ protected:
|
||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
|
||||
|
||||
// internal callbacks
|
||||
static STREAM_UPDATE( static_stream_generate );
|
||||
virtual void stream_generate(stream_sample_t **inputs, stream_sample_t **outputs, int samples);
|
||||
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
|
||||
|
||||
inline bool is_ntsc();
|
||||
inline UINT8 read_page_ram_byte(offs_t address);
|
||||
|
@ -12,7 +12,6 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "cem3394.h"
|
||||
|
||||
|
||||
@ -335,7 +334,7 @@ static DEVICE_START( cem3394 )
|
||||
chip->inv_sample_rate = 1.0 / (double)chip->sample_rate;
|
||||
|
||||
/* allocate stream channels, 1 per chip */
|
||||
chip->stream = stream_create(device, 0, 1, chip->sample_rate, chip, cem3394_update);
|
||||
chip->stream = device->machine->sound().stream_alloc(*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;
|
||||
@ -426,7 +425,7 @@ void cem3394_set_voltage(device_t *device, int input, double voltage)
|
||||
chip->values[input] = voltage;
|
||||
|
||||
/* update the stream first */
|
||||
stream_update(chip->stream);
|
||||
chip->stream->update();
|
||||
|
||||
/* switch off the input */
|
||||
switch (input)
|
||||
|
@ -1,5 +1,4 @@
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "dac.h"
|
||||
|
||||
|
||||
@ -43,7 +42,7 @@ void dac_data_w(device_t *device, UINT8 data)
|
||||
if (info->output != out)
|
||||
{
|
||||
/* update the output buffer before changing the registers */
|
||||
stream_update(info->channel);
|
||||
info->channel->update();
|
||||
info->output = out;
|
||||
}
|
||||
}
|
||||
@ -57,7 +56,7 @@ void dac_signed_data_w(device_t *device, UINT8 data)
|
||||
if (info->output != out)
|
||||
{
|
||||
/* update the output buffer before changing the registers */
|
||||
stream_update(info->channel);
|
||||
info->channel->update();
|
||||
info->output = out;
|
||||
}
|
||||
}
|
||||
@ -71,7 +70,7 @@ void dac_data_16_w(device_t *device, UINT16 data)
|
||||
if (info->output != out)
|
||||
{
|
||||
/* update the output buffer before changing the registers */
|
||||
stream_update(info->channel);
|
||||
info->channel->update();
|
||||
info->output = out;
|
||||
}
|
||||
}
|
||||
@ -86,7 +85,7 @@ void dac_signed_data_16_w(device_t *device, UINT16 data)
|
||||
if (info->output != out)
|
||||
{
|
||||
/* update the output buffer before changing the registers */
|
||||
stream_update(info->channel);
|
||||
info->channel->update();
|
||||
info->output = out;
|
||||
}
|
||||
}
|
||||
@ -111,7 +110,7 @@ static DEVICE_START( dac )
|
||||
|
||||
DAC_build_voltable(info);
|
||||
|
||||
info->channel = stream_create(device,0,1,device->clock() ? device->clock() : DEFAULT_SAMPLE_RATE,info,DAC_update);
|
||||
info->channel = device->machine->sound().stream_alloc(*device,0,1,device->clock() ? device->clock() : DEFAULT_SAMPLE_RATE,info,DAC_update);
|
||||
info->output = 0;
|
||||
|
||||
state_save_register_device_item(device, 0, info->output);
|
||||
|
@ -1,5 +1,4 @@
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "digitalk.h"
|
||||
|
||||
/*
|
||||
@ -650,7 +649,7 @@ static DEVICE_START(digitalker)
|
||||
digitalker *dg = get_safe_token(device);
|
||||
dg->device = device;
|
||||
dg->rom = device->machine->region(device->tag())->base();
|
||||
dg->stream = stream_create(device, 0, 1, device->clock()/4, dg, digitalker_update);
|
||||
dg->stream = device->machine->sound().stream_alloc(*device, 0, 1, device->clock()/4, dg, digitalker_update);
|
||||
dg->dac_index = 128;
|
||||
dg->data = 0xff;
|
||||
dg->cs = dg->cms = dg->wr = 1;
|
||||
|
@ -295,7 +295,7 @@ void DISCRETE_CLASS_FUNC(dss_input_stream, input_write)(int sub_node, UINT8 data
|
||||
if (m_is_buffered)
|
||||
{
|
||||
/* Bring the system up to now */
|
||||
stream_update(m_buffer_stream);
|
||||
m_buffer_stream->update();
|
||||
|
||||
m_data = new_data;
|
||||
}
|
||||
@ -334,9 +334,8 @@ void DISCRETE_CLASS_NAME(dss_input_stream)::stream_start(void)
|
||||
discrete_sound_device *snd_device = downcast<discrete_sound_device *>(m_device);
|
||||
//assert(DSS_INPUT_STREAM__STREAM < snd_device->m_input_stream_list.count());
|
||||
|
||||
m_buffer_stream = stream_create(snd_device, 0, 1, this->sample_rate(), this, static_stream_generate);
|
||||
m_buffer_stream = m_device->machine->sound().stream_alloc(*snd_device, 0, 1, this->sample_rate(), this, static_stream_generate);
|
||||
|
||||
stream_set_input(snd_device->get_stream(), m_stream_in_number,
|
||||
m_buffer_stream, 0, 1.0);
|
||||
snd_device->get_stream()->set_input(m_stream_in_number, m_buffer_stream);
|
||||
}
|
||||
}
|
||||
|
@ -34,7 +34,6 @@
|
||||
************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "wavwrite.h"
|
||||
#include "discrete.h"
|
||||
|
||||
@ -316,7 +315,7 @@ void discrete_task::check(discrete_task *dest_task)
|
||||
output_buffer buf;
|
||||
|
||||
buf.node_buf = auto_alloc_array(m_device.machine, double,
|
||||
((task_node->sample_rate() + STREAMS_UPDATE_FREQUENCY) / STREAMS_UPDATE_FREQUENCY));
|
||||
((task_node->sample_rate() + sound_manager::STREAMS_UPDATE_FREQUENCY) / sound_manager::STREAMS_UPDATE_FREQUENCY));
|
||||
buf.ptr = buf.node_buf;
|
||||
buf.source = dest_node->m_input[inputnum];
|
||||
buf.node_num = inputnode_num;
|
||||
@ -657,7 +656,7 @@ void discrete_device::display_profiling(void)
|
||||
printf("Task(%d): %8.2f %15.2f\n", (*task)->task_group, tt / (double) total * 100.0, tt / (double) m_total_samples);
|
||||
}
|
||||
|
||||
printf("Average samples/stream_update: %8.2f\n", (double) m_total_samples / (double) m_total_stream_updates);
|
||||
printf("Average samples/double->update: %8.2f\n", (double) m_total_samples / (double) m_total_stream_updates);
|
||||
}
|
||||
|
||||
|
||||
@ -919,7 +918,7 @@ discrete_device::~discrete_device(void)
|
||||
void discrete_device::device_start()
|
||||
{
|
||||
// create the stream
|
||||
//m_stream = stream_create(this, 0, 2, 22257, this, static_stream_generate);
|
||||
//m_stream = m_machine.sound().stream_alloc(*this, 0, 2, 22257);
|
||||
|
||||
const discrete_block *intf_start = (m_config.m_intf != NULL) ? m_config.m_intf : (discrete_block *) baseconfig().static_config();
|
||||
char name[32];
|
||||
@ -1019,7 +1018,7 @@ void discrete_sound_device::device_start()
|
||||
fatalerror("init_nodes() - Couldn't find an output node");
|
||||
|
||||
/* initialize the stream(s) */
|
||||
m_stream = stream_create(*this,m_input_stream_list.count(), m_output_list.count(), m_sample_rate);
|
||||
m_stream = m_machine.sound().stream_alloc(*this,m_input_stream_list.count(), m_output_list.count(), m_sample_rate);
|
||||
|
||||
/* Finalize stream_input_nodes */
|
||||
for_each(discrete_dss_input_stream_node **, node, &m_input_stream_list)
|
||||
|
@ -3465,7 +3465,6 @@
|
||||
*
|
||||
************************************************************************/
|
||||
|
||||
#include "streams.h"
|
||||
#include "wavwrite.h"
|
||||
|
||||
/*************************************
|
||||
@ -4440,7 +4439,7 @@ public:
|
||||
|
||||
/* --------------------------------- */
|
||||
|
||||
virtual void update_to_current_time(void) const { stream_update(m_stream); }
|
||||
virtual void update_to_current_time(void) const { m_stream->update(); }
|
||||
|
||||
sound_stream *get_stream(void) { return m_stream; }
|
||||
protected:
|
||||
|
@ -6,7 +6,6 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "dmadac.h"
|
||||
|
||||
|
||||
@ -113,7 +112,7 @@ static DEVICE_START( dmadac )
|
||||
info->volume = 0x100;
|
||||
|
||||
/* allocate a stream channel */
|
||||
info->channel = stream_create(device, 0, 1, DEFAULT_SAMPLE_RATE, info, dmadac_update);
|
||||
info->channel = device->machine->sound().stream_alloc(*device, 0, 1, DEFAULT_SAMPLE_RATE, info, dmadac_update);
|
||||
|
||||
/* register with the save state system */
|
||||
state_save_register_device_item(device, 0, info->bufin);
|
||||
@ -140,7 +139,7 @@ void dmadac_transfer(dmadac_sound_device **devlist, UINT8 num_channels, offs_t c
|
||||
for (i = 0; i < num_channels; i++)
|
||||
{
|
||||
dmadac_state *info = get_safe_token(devlist[i]);
|
||||
stream_update(info->channel);
|
||||
info->channel->update();
|
||||
}
|
||||
|
||||
/* loop over all channels and accumulate the data */
|
||||
@ -187,7 +186,7 @@ void dmadac_enable(dmadac_sound_device **devlist, UINT8 num_channels, UINT8 enab
|
||||
for (i = 0; i < num_channels; i++)
|
||||
{
|
||||
dmadac_state *info = get_safe_token(devlist[i]);
|
||||
stream_update(info->channel);
|
||||
info->channel->update();
|
||||
info->enabled = enable;
|
||||
if (!enable)
|
||||
info->bufin = info->bufout = 0;
|
||||
@ -210,7 +209,7 @@ void dmadac_set_frequency(dmadac_sound_device **devlist, UINT8 num_channels, dou
|
||||
for (i = 0; i < num_channels; i++)
|
||||
{
|
||||
dmadac_state *info = get_safe_token(devlist[i]);
|
||||
stream_set_sample_rate(info->channel, frequency);
|
||||
info->channel->set_sample_rate(frequency);
|
||||
}
|
||||
}
|
||||
|
||||
@ -230,7 +229,7 @@ void dmadac_set_volume(dmadac_sound_device **devlist, UINT8 num_channels, UINT16
|
||||
for (i = 0; i < num_channels; i++)
|
||||
{
|
||||
dmadac_state *info = get_safe_token(devlist[i]);
|
||||
stream_update(info->channel);
|
||||
info->channel->update();
|
||||
info->volume = volume;
|
||||
}
|
||||
}
|
||||
|
@ -34,7 +34,6 @@
|
||||
*/
|
||||
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "es5503.h"
|
||||
|
||||
typedef struct
|
||||
@ -141,7 +140,7 @@ static TIMER_CALLBACK( es5503_timer_cb )
|
||||
ES5503Osc *osc = (ES5503Osc *)ptr;
|
||||
ES5503Chip *chip = (ES5503Chip *)osc->chip;
|
||||
|
||||
stream_update(chip->stream);
|
||||
chip->stream->update();
|
||||
}
|
||||
|
||||
static STREAM_UPDATE( es5503_pcm_update )
|
||||
@ -267,7 +266,7 @@ static DEVICE_START( es5503 )
|
||||
chip->oscsenabled = 1;
|
||||
|
||||
chip->output_rate = (device->clock()/8)/34; // (input clock / 8) / # of oscs. enabled + 2
|
||||
chip->stream = stream_create(device, 0, 2, chip->output_rate, chip, es5503_pcm_update);
|
||||
chip->stream = device->machine->sound().stream_alloc(*device, 0, 2, chip->output_rate, chip, es5503_pcm_update);
|
||||
}
|
||||
|
||||
READ8_DEVICE_HANDLER( es5503_r )
|
||||
@ -276,7 +275,7 @@ READ8_DEVICE_HANDLER( es5503_r )
|
||||
int i;
|
||||
ES5503Chip *chip = get_safe_token(device);
|
||||
|
||||
stream_update(chip->stream);
|
||||
chip->stream->update();
|
||||
|
||||
if (offset < 0xe0)
|
||||
{
|
||||
@ -376,7 +375,7 @@ WRITE8_DEVICE_HANDLER( es5503_w )
|
||||
{
|
||||
ES5503Chip *chip = get_safe_token(device);
|
||||
|
||||
stream_update(chip->stream);
|
||||
chip->stream->update();
|
||||
|
||||
if (offset < 0xe0)
|
||||
{
|
||||
@ -486,7 +485,7 @@ WRITE8_DEVICE_HANDLER( es5503_w )
|
||||
chip->oscsenabled = (data>>1);
|
||||
|
||||
chip->output_rate = (chip->clock/8)/(2+chip->oscsenabled);
|
||||
stream_set_sample_rate(chip->stream, chip->output_rate);
|
||||
chip->stream->set_sample_rate(chip->output_rate);
|
||||
break;
|
||||
|
||||
case 0xe2: // A/D converter
|
||||
|
@ -81,7 +81,6 @@ Ensoniq OTIS - ES5505 Ensoniq OTTO -
|
||||
***********************************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "es5506.h"
|
||||
|
||||
|
||||
@ -911,7 +910,7 @@ static void es5506_start_common(device_t *device, const void *config, device_typ
|
||||
eslog = fopen("es.log", "w");
|
||||
|
||||
/* create the stream */
|
||||
chip->stream = stream_create(device, 0, 2, device->clock() / (16*32), chip, es5506_update);
|
||||
chip->stream = device->machine->sound().stream_alloc(*device, 0, 2, device->clock() / (16*32), chip, es5506_update);
|
||||
|
||||
/* initialize the regions */
|
||||
chip->region_base[0] = intf->region0 ? (UINT16 *)device->machine->region(intf->region0)->base() : NULL;
|
||||
@ -1111,7 +1110,7 @@ INLINE void es5506_reg_write_low(es5506_state *chip, es5506_voice *voice, offs_t
|
||||
{
|
||||
chip->active_voices = data & 0x1f;
|
||||
chip->sample_rate = chip->master_clock / (16 * (chip->active_voices + 1));
|
||||
stream_set_sample_rate(chip->stream, chip->sample_rate);
|
||||
chip->stream->set_sample_rate(chip->sample_rate);
|
||||
|
||||
if (LOG_COMMANDS && eslog)
|
||||
fprintf(eslog, "active voices=%d, sample_rate=%d\n", chip->active_voices, chip->sample_rate);
|
||||
@ -1312,7 +1311,7 @@ WRITE8_DEVICE_HANDLER( es5506_w )
|
||||
return;
|
||||
|
||||
/* force an update */
|
||||
stream_update(chip->stream);
|
||||
chip->stream->update();
|
||||
|
||||
/* switch off the page and register */
|
||||
if (chip->current_page < 0x20)
|
||||
@ -1521,7 +1520,7 @@ READ8_DEVICE_HANDLER( es5506_r )
|
||||
fprintf(eslog, "read from %02x/%02x -> ", chip->current_page, offset / 4 * 8);
|
||||
|
||||
/* force an update */
|
||||
stream_update(chip->stream);
|
||||
chip->stream->update();
|
||||
|
||||
/* switch off the page and register */
|
||||
if (chip->current_page < 0x20)
|
||||
@ -1732,7 +1731,7 @@ INLINE void es5505_reg_write_low(es5506_state *chip, es5506_voice *voice, offs_t
|
||||
{
|
||||
chip->active_voices = data & 0x1f;
|
||||
chip->sample_rate = chip->master_clock / (16 * (chip->active_voices + 1));
|
||||
stream_set_sample_rate(chip->stream, chip->sample_rate);
|
||||
chip->stream->set_sample_rate(chip->sample_rate);
|
||||
|
||||
if (LOG_COMMANDS && eslog)
|
||||
fprintf(eslog, "active voices=%d, sample_rate=%d\n", chip->active_voices, chip->sample_rate);
|
||||
@ -1840,7 +1839,7 @@ INLINE void es5505_reg_write_high(es5506_state *chip, es5506_voice *voice, offs_
|
||||
{
|
||||
chip->active_voices = data & 0x1f;
|
||||
chip->sample_rate = chip->master_clock / (16 * (chip->active_voices + 1));
|
||||
stream_set_sample_rate(chip->stream, chip->sample_rate);
|
||||
chip->stream->set_sample_rate(chip->sample_rate);
|
||||
|
||||
if (LOG_COMMANDS && eslog)
|
||||
fprintf(eslog, "active voices=%d, sample_rate=%d\n", chip->active_voices, chip->sample_rate);
|
||||
@ -1884,7 +1883,7 @@ INLINE void es5505_reg_write_test(es5506_state *chip, es5506_voice *voice, offs_
|
||||
{
|
||||
chip->active_voices = data & 0x1f;
|
||||
chip->sample_rate = chip->master_clock / (16 * (chip->active_voices + 1));
|
||||
stream_set_sample_rate(chip->stream, chip->sample_rate);
|
||||
chip->stream->set_sample_rate(chip->sample_rate);
|
||||
|
||||
if (LOG_COMMANDS && eslog)
|
||||
fprintf(eslog, "active voices=%d, sample_rate=%d\n", chip->active_voices, chip->sample_rate);
|
||||
@ -1910,7 +1909,7 @@ WRITE16_DEVICE_HANDLER( es5505_w )
|
||||
// logerror("%s:ES5505 write %02x/%02x = %04x & %04x\n", cpuexec_describe_context(machine), chip->current_page, offset, data, mem_mask);
|
||||
|
||||
/* force an update */
|
||||
stream_update(chip->stream);
|
||||
chip->stream->update();
|
||||
|
||||
/* switch off the page and register */
|
||||
if (chip->current_page < 0x20)
|
||||
@ -2123,7 +2122,7 @@ READ16_DEVICE_HANDLER( es5505_r )
|
||||
fprintf(eslog, "read from %02x/%02x -> ", chip->current_page, offset);
|
||||
|
||||
/* force an update */
|
||||
stream_update(chip->stream);
|
||||
chip->stream->update();
|
||||
|
||||
/* switch off the page and register */
|
||||
if (chip->current_page < 0x20)
|
||||
|
@ -13,7 +13,6 @@
|
||||
|
||||
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "es8712.h"
|
||||
|
||||
#define MAX_SAMPLE_CHUNK 10000
|
||||
@ -228,7 +227,7 @@ static DEVICE_START( es8712 )
|
||||
chip->region_base = *device->region();
|
||||
|
||||
/* generate the name and create the stream */
|
||||
chip->stream = stream_create(device, 0, 1, device->clock(), chip, es8712_update);
|
||||
chip->stream = device->machine->sound().stream_alloc(*device, 0, 1, device->clock(), chip, es8712_update);
|
||||
|
||||
/* initialize the rest of the structure */
|
||||
chip->signal = -2;
|
||||
@ -251,7 +250,7 @@ static DEVICE_RESET( es8712 )
|
||||
if (chip->playing)
|
||||
{
|
||||
/* update the stream, then turn it off */
|
||||
stream_update(chip->stream);
|
||||
chip->stream->update();
|
||||
chip->playing = 0;
|
||||
chip->repeat = 0;
|
||||
}
|
||||
@ -267,7 +266,7 @@ static DEVICE_RESET( es8712 )
|
||||
void es8712_set_bank_base(device_t *device, int base)
|
||||
{
|
||||
es8712_state *chip = get_safe_token(device);
|
||||
stream_update(chip->stream);
|
||||
chip->stream->update();
|
||||
chip->bank_offset = base;
|
||||
}
|
||||
|
||||
@ -283,8 +282,8 @@ void es8712_set_frequency(device_t *device, int frequency)
|
||||
es8712_state *chip = get_safe_token(device);
|
||||
|
||||
/* update the stream and set the new base */
|
||||
stream_update(chip->stream);
|
||||
stream_set_sample_rate(chip->stream, frequency);
|
||||
chip->stream->update();
|
||||
chip->stream->set_sample_rate(frequency);
|
||||
}
|
||||
|
||||
|
||||
@ -323,7 +322,7 @@ void es8712_play(device_t *device)
|
||||
if (chip->playing)
|
||||
{
|
||||
/* update the stream */
|
||||
stream_update(chip->stream);
|
||||
chip->stream->update();
|
||||
chip->playing = 0;
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,4 @@
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "flt_rc.h"
|
||||
|
||||
typedef struct _filter_rc_state filter_rc_state;
|
||||
@ -94,7 +93,7 @@ static DEVICE_START( filter_rc )
|
||||
const flt_rc_config *conf = (const flt_rc_config *)device->baseconfig().static_config();
|
||||
|
||||
info->device = device;
|
||||
info->stream = stream_create(device, 1, 1, device->machine->sample_rate, info, filter_rc_update);
|
||||
info->stream = device->machine->sound().stream_alloc(*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
|
||||
@ -106,7 +105,7 @@ void filter_rc_set_RC(device_t *device, int type, double R1, double R2, double R
|
||||
{
|
||||
filter_rc_state *info = get_safe_token(device);
|
||||
|
||||
stream_update(info->stream);
|
||||
info->stream->update();
|
||||
|
||||
set_RC_info(info, type, R1, R2, R3, C);
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "flt_vol.h"
|
||||
|
||||
|
||||
@ -35,7 +34,7 @@ static DEVICE_START( filter_volume )
|
||||
filter_volume_state *info = get_safe_token(device);
|
||||
|
||||
info->gain = 0x100;
|
||||
info->stream = stream_create(device, 1, 1, device->machine->sample_rate, info, filter_volume_update);
|
||||
info->stream = device->machine->sound().stream_alloc(*device, 1, 1, device->machine->sample_rate, info, filter_volume_update);
|
||||
}
|
||||
|
||||
|
||||
|
@ -34,7 +34,6 @@ Registers per channel:
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "gaelco.h"
|
||||
#include "wavwrite.h"
|
||||
|
||||
@ -213,7 +212,7 @@ WRITE16_DEVICE_HANDLER( gaelcosnd_w )
|
||||
LOG_READ_WRITES(("%s: (GAE1): write %04x to %04x\n", cpuexec_describe_context(device->machine), data, offset));
|
||||
|
||||
/* first update the stream to this point in time */
|
||||
stream_update(info->stream);
|
||||
info->stream->update();
|
||||
|
||||
COMBINE_DATA(&info->sndregs[offset]);
|
||||
|
||||
@ -260,7 +259,7 @@ static DEVICE_START( gaelco )
|
||||
for (j = 0; j < 4; j++){
|
||||
info->banks[j] = intf->banks[j];
|
||||
}
|
||||
info->stream = stream_create(device, 0, 2, 8000, info, gaelco_update);
|
||||
info->stream = device->machine->sound().stream_alloc(*device, 0, 2, 8000, info, gaelco_update);
|
||||
info->snd_data = (UINT8 *)device->machine->region(intf->gfxregion)->base();
|
||||
if (info->snd_data == NULL)
|
||||
info->snd_data = *device->region();
|
||||
|
@ -7,7 +7,6 @@
|
||||
*****************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "hc55516.h"
|
||||
|
||||
|
||||
@ -77,7 +76,7 @@ static void start_common(device_t *device, UINT8 _shiftreg_mask, int _active_clo
|
||||
chip->last_clock_state = 0;
|
||||
|
||||
/* create the stream */
|
||||
chip->channel = stream_create(device, 0, 1, SAMPLE_RATE, chip, hc55516_update);
|
||||
chip->channel = device->machine->sound().stream_alloc(*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);
|
||||
@ -255,7 +254,7 @@ void hc55516_clock_w(device_t *device, int state)
|
||||
if (is_active_clock_transition(chip, clock_state))
|
||||
{
|
||||
/* update the output buffer before changing the registers */
|
||||
stream_update(chip->channel);
|
||||
chip->channel->update();
|
||||
|
||||
/* clear the update count */
|
||||
chip->update_count = 0;
|
||||
@ -274,7 +273,7 @@ void hc55516_digit_w(device_t *device, int digit)
|
||||
|
||||
if (is_external_osciallator(chip))
|
||||
{
|
||||
stream_update(chip->channel);
|
||||
chip->channel->update();
|
||||
chip->new_digit = digit & 1;
|
||||
}
|
||||
else
|
||||
@ -289,7 +288,7 @@ int hc55516_clock_state_r(device_t *device)
|
||||
/* only makes sense for setups with an external oscillator */
|
||||
assert(is_external_osciallator(chip));
|
||||
|
||||
stream_update(chip->channel);
|
||||
chip->channel->update();
|
||||
|
||||
return current_clock_state(chip);
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ void ics2115_device::device_start()
|
||||
m_rom = *region();
|
||||
m_timer[0].timer = timer_alloc(machine, timer_cb_0, this);
|
||||
m_timer[1].timer = timer_alloc(machine, timer_cb_1, this);
|
||||
m_stream = stream_create(this, 0, 2, 33075, this, static_stream_generate);
|
||||
m_stream = m_machine.sound().stream_alloc(*this, 0, 2, 33075);
|
||||
|
||||
//Exact formula as per patent 5809466
|
||||
//This seems to give the ok fit but it is not good enough.
|
||||
@ -148,11 +148,6 @@ void ics2115_device::device_reset()
|
||||
}
|
||||
}
|
||||
|
||||
STREAM_UPDATE( ics2115_device::static_stream_generate )
|
||||
{
|
||||
reinterpret_cast<ics2115_device *>(param)->stream_generate(inputs, outputs, samples);
|
||||
}
|
||||
|
||||
//TODO: improve using next-state logic from column 126 of patent 5809466
|
||||
int ics2115_voice::update_volume_envelope()
|
||||
{
|
||||
@ -363,7 +358,7 @@ int ics2115_device::fill_output(ics2115_voice& voice, stream_sample_t *outputs[2
|
||||
return irq_invalid;
|
||||
}
|
||||
|
||||
void ics2115_device::stream_generate(stream_sample_t **inputs, stream_sample_t **outputs, int samples)
|
||||
void ics2115_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
|
||||
{
|
||||
memset(outputs[0], 0, samples * sizeof(stream_sample_t));
|
||||
memset(outputs[1], 0, samples * sizeof(stream_sample_t));
|
||||
|
@ -3,7 +3,6 @@
|
||||
#ifndef __ICS2115_H__
|
||||
#define __ICS2115_H__
|
||||
|
||||
#include "streams.h"
|
||||
|
||||
//**************************************************************************
|
||||
// INTERFACE CONFIGURATION MACROS
|
||||
@ -138,8 +137,7 @@ protected:
|
||||
virtual void device_reset();
|
||||
|
||||
// internal callbacks
|
||||
static STREAM_UPDATE( static_stream_generate );
|
||||
virtual void stream_generate(stream_sample_t **inputs, stream_sample_t **outputs, int samples);
|
||||
void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
|
||||
|
||||
// internal state
|
||||
const ics2115_device_config &m_config;
|
||||
|
@ -27,7 +27,6 @@ Revisions:
|
||||
*********************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "iremga20.h"
|
||||
|
||||
#define MAX_VOL 256
|
||||
@ -148,7 +147,7 @@ WRITE8_DEVICE_HANDLER( irem_ga20_w )
|
||||
|
||||
//logerror("GA20: Offset %02x, data %04x\n",offset,data);
|
||||
|
||||
stream_update(chip->stream);
|
||||
chip->stream->update();
|
||||
|
||||
channel = offset >> 3;
|
||||
|
||||
@ -193,7 +192,7 @@ READ8_DEVICE_HANDLER( irem_ga20_r )
|
||||
ga20_state *chip = get_safe_token(device);
|
||||
int channel;
|
||||
|
||||
stream_update(chip->stream);
|
||||
chip->stream->update();
|
||||
|
||||
channel = offset >> 3;
|
||||
|
||||
@ -248,7 +247,7 @@ static DEVICE_START( iremga20 )
|
||||
for ( i = 0; i < 0x40; i++ )
|
||||
chip->regs[i] = 0;
|
||||
|
||||
chip->stream = stream_create( device, 0, 2, device->clock()/4, chip, IremGA20_update );
|
||||
chip->stream = device->machine->sound().stream_alloc( *device, 0, 2, device->clock()/4, chip, IremGA20_update );
|
||||
|
||||
state_save_register_device_item_array(device, 0, chip->regs);
|
||||
for (i = 0; i < 4; i++)
|
||||
|
@ -26,7 +26,6 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "k005289.h"
|
||||
|
||||
#define FREQBASEBITS 16
|
||||
@ -165,7 +164,7 @@ static DEVICE_START( k005289 )
|
||||
|
||||
/* get stream channels */
|
||||
info->rate = device->clock()/16;
|
||||
info->stream = stream_create(device, 0, 1, info->rate, info, K005289_update);
|
||||
info->stream = device->machine->sound().stream_alloc(*device, 0, 1, info->rate, info, K005289_update);
|
||||
info->mclock = device->clock();
|
||||
|
||||
/* allocate a pair of buffers to mix into - 1 second's worth should be more than enough */
|
||||
@ -194,7 +193,7 @@ static void k005289_recompute(k005289_state *info)
|
||||
{
|
||||
k005289_sound_channel *voice = info->channel_list;
|
||||
|
||||
stream_update(info->stream); /* update the streams */
|
||||
info->stream->update(); /* update the streams */
|
||||
|
||||
voice[0].frequency = info->k005289_A_frequency;
|
||||
voice[1].frequency = info->k005289_B_frequency;
|
||||
|
@ -24,7 +24,6 @@ added external port callback, and functions to set the volume of the channels
|
||||
|
||||
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "k007232.h"
|
||||
|
||||
|
||||
@ -329,7 +328,7 @@ static DEVICE_START( k007232 )
|
||||
|
||||
for( i = 0; i < 0x10; i++ ) info->wreg[i] = 0;
|
||||
|
||||
info->stream = stream_create(device,0,2,device->clock()/128,info,KDAC_A_update);
|
||||
info->stream = device->machine->sound().stream_alloc(*device,0,2,device->clock()/128,info,KDAC_A_update);
|
||||
|
||||
KDAC_A_make_fncode(info);
|
||||
}
|
||||
@ -343,7 +342,7 @@ WRITE8_DEVICE_HANDLER( k007232_w )
|
||||
int r = offset;
|
||||
int v = data;
|
||||
|
||||
stream_update(info->stream);
|
||||
info->stream->update();
|
||||
|
||||
info->wreg[r] = v; /* stock write data */
|
||||
|
||||
|
@ -23,7 +23,6 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "k051649.h"
|
||||
|
||||
#define FREQBASEBITS 16
|
||||
@ -139,7 +138,7 @@ static DEVICE_START( k051649 )
|
||||
|
||||
/* get stream channels */
|
||||
info->rate = device->clock()/16;
|
||||
info->stream = stream_create(device, 0, 1, info->rate, info, k051649_update);
|
||||
info->stream = device->machine->sound().stream_alloc(*device, 0, 1, info->rate, info, k051649_update);
|
||||
info->mclock = device->clock();
|
||||
|
||||
/* allocate a buffer to mix into - 1 second's worth should be more than enough */
|
||||
@ -168,7 +167,7 @@ static DEVICE_RESET( k051649 )
|
||||
WRITE8_DEVICE_HANDLER( k051649_waveform_w )
|
||||
{
|
||||
k051649_state *info = get_safe_token(device);
|
||||
stream_update(info->stream);
|
||||
info->stream->update();
|
||||
info->channel_list[offset>>5].waveform[offset&0x1f]=data;
|
||||
/* SY 20001114: Channel 5 shares the waveform with channel 4 */
|
||||
if (offset >= 0x60)
|
||||
@ -185,14 +184,14 @@ READ8_DEVICE_HANDLER ( k051649_waveform_r )
|
||||
WRITE8_DEVICE_HANDLER( k052539_waveform_w )
|
||||
{
|
||||
k051649_state *info = get_safe_token(device);
|
||||
stream_update(info->stream);
|
||||
info->stream->update();
|
||||
info->channel_list[offset>>5].waveform[offset&0x1f]=data;
|
||||
}
|
||||
|
||||
WRITE8_DEVICE_HANDLER( k051649_volume_w )
|
||||
{
|
||||
k051649_state *info = get_safe_token(device);
|
||||
stream_update(info->stream);
|
||||
info->stream->update();
|
||||
info->channel_list[offset&0x7].volume=data&0xf;
|
||||
}
|
||||
|
||||
@ -201,14 +200,14 @@ WRITE8_DEVICE_HANDLER( k051649_frequency_w )
|
||||
k051649_state *info = get_safe_token(device);
|
||||
info->f[offset]=data;
|
||||
|
||||
stream_update(info->stream);
|
||||
info->stream->update();
|
||||
info->channel_list[offset>>1].frequency=(info->f[offset&0xe] + (info->f[offset|1]<<8))&0xfff;
|
||||
}
|
||||
|
||||
WRITE8_DEVICE_HANDLER( k051649_keyonoff_w )
|
||||
{
|
||||
k051649_state *info = get_safe_token(device);
|
||||
stream_update(info->stream);
|
||||
info->stream->update();
|
||||
info->channel_list[0].key=data&1;
|
||||
info->channel_list[1].key=data&2;
|
||||
info->channel_list[2].key=data&4;
|
||||
|
@ -5,7 +5,6 @@
|
||||
*********************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "k053260.h"
|
||||
|
||||
/* 2004-02-28: Fixed PPCM decoding. Games sound much better now.*/
|
||||
@ -234,7 +233,7 @@ static DEVICE_START( k053260 )
|
||||
|
||||
ic->delta_table = auto_alloc_array( device->machine, UINT32, 0x1000 );
|
||||
|
||||
ic->channel = stream_create( device, 0, 2, rate, ic, k053260_update );
|
||||
ic->channel = device->machine->sound().stream_alloc( *device, 0, 2, rate, ic, k053260_update );
|
||||
|
||||
InitDeltaTable( ic, rate, device->clock() );
|
||||
|
||||
@ -297,7 +296,7 @@ WRITE8_DEVICE_HANDLER( k053260_w )
|
||||
return;
|
||||
}
|
||||
|
||||
stream_update( ic->channel);
|
||||
ic->channel->update();
|
||||
|
||||
/* before we update the regs, we need to check for a latched reg */
|
||||
if ( r == 0x28 ) {
|
||||
|
@ -18,7 +18,6 @@ CHANNEL_DEBUG enables the following keys:
|
||||
*********************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "k054539.h"
|
||||
|
||||
#define CHANNEL_DEBUG 0
|
||||
@ -473,7 +472,7 @@ static void k054539_init_chip(device_t *device, k054539_state *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(device, 0, 2, device->clock(), info, k054539_update);
|
||||
info->stream = device->machine->sound().stream_alloc(*device, 0, 2, device->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);
|
||||
|
@ -57,7 +57,6 @@
|
||||
|
||||
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "sound/mos6560.h"
|
||||
|
||||
/***************************************************************************
|
||||
@ -579,7 +578,7 @@ static void mos6560_soundport_w( device_t *device, int offset, int data )
|
||||
{
|
||||
mos6560_state *mos6560 = get_safe_token(device);
|
||||
int old = mos6560->reg[offset];
|
||||
stream_update(mos6560->channel);
|
||||
mos6560->channel->update();
|
||||
|
||||
switch (offset)
|
||||
{
|
||||
@ -740,7 +739,7 @@ static void mos6560_sound_start( device_t *device )
|
||||
mos6560_state *mos6560 = get_safe_token(device);
|
||||
int i;
|
||||
|
||||
mos6560->channel = stream_create(device, 0, 1, device->machine->sample_rate, 0, mos6560_update);
|
||||
mos6560->channel = device->machine->sound().stream_alloc(*device, 0, 1, device->machine->sample_rate, 0, mos6560_update);
|
||||
|
||||
/* buffer for fastest played sample for 5 second so we have enough data for min 5 second */
|
||||
mos6560->noisesize = NOISE_FREQUENCY_MAX * NOISE_BUFFER_SIZE_SEC;
|
||||
|
@ -15,7 +15,6 @@
|
||||
*/
|
||||
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "msm5205.h"
|
||||
|
||||
/*
|
||||
@ -148,7 +147,7 @@ static TIMER_CALLBACK( MSM5205_vclk_callback )
|
||||
/* update when signal changed */
|
||||
if( voice->signal != new_signal)
|
||||
{
|
||||
stream_update(voice->stream);
|
||||
voice->stream->update();
|
||||
voice->signal = new_signal;
|
||||
}
|
||||
}
|
||||
@ -188,7 +187,7 @@ static DEVICE_START( msm5205 )
|
||||
ComputeTables (voice);
|
||||
|
||||
/* stream system initialize */
|
||||
voice->stream = stream_create(device,0,1,device->clock(),voice,MSM5205_update);
|
||||
voice->stream = device->machine->sound().stream_alloc(*device,0,1,device->clock(),voice,MSM5205_update);
|
||||
voice->timer = timer_alloc(device->machine, MSM5205_vclk_callback, voice);
|
||||
|
||||
/* initialize */
|
||||
@ -269,7 +268,7 @@ static void msm5205_playmode(msm5205_state *voice,int select)
|
||||
|
||||
if( voice->prescaler != prescaler )
|
||||
{
|
||||
stream_update(voice->stream);
|
||||
voice->stream->update();
|
||||
|
||||
voice->prescaler = prescaler;
|
||||
/* timer set */
|
||||
@ -284,7 +283,7 @@ static void msm5205_playmode(msm5205_state *voice,int select)
|
||||
|
||||
if( voice->bitwidth != bitwidth )
|
||||
{
|
||||
stream_update(voice->stream);
|
||||
voice->stream->update();
|
||||
|
||||
voice->bitwidth = bitwidth;
|
||||
}
|
||||
@ -295,7 +294,7 @@ void msm5205_set_volume(device_t *device,int volume)
|
||||
{
|
||||
msm5205_state *voice = get_safe_token(device);
|
||||
|
||||
stream_set_output_gain(voice->stream,0,volume / 100.0);
|
||||
voice->stream->set_output_gain(0,volume / 100.0);
|
||||
}
|
||||
|
||||
void msm5205_change_clock_w(device_t *device, INT32 clock)
|
||||
|
@ -1,5 +1,4 @@
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
|
||||
#include "msm5232.h"
|
||||
|
||||
@ -345,7 +344,7 @@ WRITE8_DEVICE_HANDLER( msm5232_w )
|
||||
if (offset > 0x0d)
|
||||
return;
|
||||
|
||||
stream_update (chip->stream);
|
||||
chip->stream->update ();
|
||||
|
||||
if (offset < 0x08) /* pitch */
|
||||
{
|
||||
@ -797,7 +796,7 @@ static DEVICE_START( msm5232 )
|
||||
|
||||
msm5232_init(chip, intf, device->clock(), rate);
|
||||
|
||||
chip->stream = stream_create(device, 0, 11, rate, chip, MSM5232_update_one);
|
||||
chip->stream = device->machine->sound().stream_alloc(*device, 0, 11, rate, chip, MSM5232_update_one);
|
||||
|
||||
/* register with the save state system */
|
||||
state_save_register_postload(device->machine, msm5232_postload, chip);
|
||||
@ -844,11 +843,11 @@ void msm5232_set_clock(device_t *device, int clock)
|
||||
|
||||
if (chip->clock != clock)
|
||||
{
|
||||
stream_update (chip->stream);
|
||||
chip->stream->update ();
|
||||
chip->clock = clock;
|
||||
chip->rate = clock/CLOCK_RATE_DIVIDER;
|
||||
msm5232_init_tables( chip );
|
||||
stream_set_sample_rate(chip->stream, chip->rate);
|
||||
chip->stream->set_sample_rate(chip->rate);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,6 @@
|
||||
*/
|
||||
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "multipcm.h"
|
||||
|
||||
//????
|
||||
@ -503,7 +502,7 @@ static DEVICE_START( multipcm )
|
||||
ptChip->ROM=*device->region();
|
||||
ptChip->Rate=(float) device->clock() / MULTIPCM_CLOCKDIV;
|
||||
|
||||
ptChip->stream = stream_create(device, 0, 2, ptChip->Rate, ptChip, MultiPCM_update);
|
||||
ptChip->stream = device->machine->sound().stream_alloc(*device, 0, 2, ptChip->Rate, ptChip, MultiPCM_update);
|
||||
|
||||
//Volume+pan table
|
||||
for(i=0;i<0x800;++i)
|
||||
|
@ -14,7 +14,6 @@ silence compression: '00 nn' must be replaced by nn+1 times '80'.
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "n63701x.h"
|
||||
|
||||
|
||||
@ -115,7 +114,7 @@ static DEVICE_START( namco_63701x )
|
||||
|
||||
chip->rom = *device->region();
|
||||
|
||||
chip->stream = stream_create(device, 0, 2, device->clock()/1000, chip, namco_63701x_update);
|
||||
chip->stream = device->machine->sound().stream_alloc(*device, 0, 2, device->clock()/1000, chip, namco_63701x_update);
|
||||
}
|
||||
|
||||
|
||||
@ -140,7 +139,7 @@ WRITE8_DEVICE_HANDLER( namco_63701x_w )
|
||||
int rom_offs;
|
||||
|
||||
/* update the streams */
|
||||
stream_update(chip->stream);
|
||||
chip->stream->update();
|
||||
|
||||
chip->voices[ch].playing = 1;
|
||||
chip->voices[ch].base_addr = 0x10000 * ((chip->voices[ch].select & 0xe0) >> 5);
|
||||
|
@ -12,7 +12,6 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "namco.h"
|
||||
|
||||
|
||||
@ -389,9 +388,9 @@ static DEVICE_START( namco )
|
||||
|
||||
/* get stream channels */
|
||||
if (intf->stereo)
|
||||
chip->stream = stream_create(device, 0, 2, chip->sample_rate, chip, namco_update_stereo);
|
||||
chip->stream = device->machine->sound().stream_alloc(*device, 0, 2, chip->sample_rate, chip, namco_update_stereo);
|
||||
else
|
||||
chip->stream = stream_create(device, 0, 1, chip->sample_rate, chip, namco_update_mono);
|
||||
chip->stream = device->machine->sound().stream_alloc(*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;
|
||||
@ -471,7 +470,7 @@ WRITE8_DEVICE_HANDLER( pacman_sound_w )
|
||||
return;
|
||||
|
||||
/* update the streams */
|
||||
stream_update(chip->stream);
|
||||
chip->stream->update();
|
||||
|
||||
/* set the register */
|
||||
chip->soundregs[offset] = data;
|
||||
@ -567,7 +566,7 @@ WRITE8_DEVICE_HANDLER( polepos_sound_w )
|
||||
return;
|
||||
|
||||
/* update the streams */
|
||||
stream_update(chip->stream);
|
||||
chip->stream->update();
|
||||
|
||||
/* set the register */
|
||||
chip->soundregs[offset] = data;
|
||||
@ -645,7 +644,7 @@ static WRITE8_DEVICE_HANDLER( namco_15xx_w )
|
||||
return;
|
||||
|
||||
/* update the streams */
|
||||
stream_update(chip->stream);
|
||||
chip->stream->update();
|
||||
|
||||
/* set the register */
|
||||
chip->soundregs[offset] = data;
|
||||
@ -722,7 +721,7 @@ static WRITE8_DEVICE_HANDLER( namcos1_sound_w )
|
||||
return;
|
||||
|
||||
/* update the streams */
|
||||
stream_update(chip->stream);
|
||||
chip->stream->update();
|
||||
|
||||
/* set the register */
|
||||
chip->soundregs[offset] = data;
|
||||
@ -769,7 +768,7 @@ WRITE8_DEVICE_HANDLER( namcos1_cus30_w )
|
||||
if (chip->wavedata[offset] != data)
|
||||
{
|
||||
/* update the streams */
|
||||
stream_update(chip->stream);
|
||||
chip->stream->update();
|
||||
|
||||
chip->wavedata[offset] = data;
|
||||
|
||||
|
@ -45,7 +45,6 @@
|
||||
*****************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "nes_apu.h"
|
||||
#include "cpu/m6502/m6502.h"
|
||||
|
||||
@ -664,7 +663,7 @@ INLINE uint8 apu_read(nesapu_state *info,int address)
|
||||
INLINE void apu_write(nesapu_state *info,int address, uint8 value)
|
||||
{
|
||||
info->APU.regs[address]=value;
|
||||
stream_update(info->stream);
|
||||
info->stream->update();
|
||||
apu_regwrite(info,address,value);
|
||||
}
|
||||
|
||||
@ -707,7 +706,7 @@ static DEVICE_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(device, 0, 1, rate, info, nes_psg_update_sound);
|
||||
info->stream = device->machine->sound().stream_alloc(*device, 0, 1, rate, info, nes_psg_update_sound);
|
||||
|
||||
/* register for save */
|
||||
for (i = 0; i < 2; i++)
|
||||
|
@ -25,7 +25,6 @@
|
||||
************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "nile.h"
|
||||
|
||||
#define NILE_VOICES 8
|
||||
@ -75,7 +74,7 @@ WRITE16_DEVICE_HANDLER( nile_sndctrl_w )
|
||||
nile_state *info = get_safe_token(device);
|
||||
UINT16 ctrl=info->ctrl;
|
||||
|
||||
stream_update(info->stream);
|
||||
info->stream->update();
|
||||
|
||||
COMBINE_DATA(&info->ctrl);
|
||||
|
||||
@ -88,7 +87,7 @@ READ16_DEVICE_HANDLER( nile_sndctrl_r )
|
||||
{
|
||||
nile_state *info = get_safe_token(device);
|
||||
|
||||
stream_update(info->stream);
|
||||
info->stream->update();
|
||||
|
||||
return info->ctrl;
|
||||
}
|
||||
@ -98,7 +97,7 @@ READ16_DEVICE_HANDLER( nile_snd_r )
|
||||
nile_state *info = get_safe_token(device);
|
||||
int reg=offset&0xf;
|
||||
|
||||
stream_update(info->stream);
|
||||
info->stream->update();
|
||||
|
||||
if(reg==2 || reg==3)
|
||||
{
|
||||
@ -122,7 +121,7 @@ WRITE16_DEVICE_HANDLER( nile_snd_w )
|
||||
nile_state *info = get_safe_token(device);
|
||||
int v, r;
|
||||
|
||||
stream_update(info->stream);
|
||||
info->stream->update();
|
||||
|
||||
COMBINE_DATA(&info->sound_regs[offset]);
|
||||
|
||||
@ -228,7 +227,7 @@ static DEVICE_START( nile )
|
||||
|
||||
info->sound_ram = *device->region();
|
||||
|
||||
info->stream = stream_create(device, 0, 2, 44100, info, nile_update);
|
||||
info->stream = device->machine->sound().stream_alloc(*device, 0, 2, 44100, info, nile_update);
|
||||
}
|
||||
|
||||
|
||||
|
@ -10,7 +10,6 @@
|
||||
|
||||
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "okim6258.h"
|
||||
|
||||
#define COMMAND_STOP (1 << 0)
|
||||
@ -202,7 +201,7 @@ static DEVICE_START( okim6258 )
|
||||
info->output_bits = intf->output_12bits ? 12 : 10;
|
||||
info->divider = dividers[intf->divider];
|
||||
|
||||
info->stream = stream_create(device, 0, 1, device->clock()/info->divider, info, okim6258_update);
|
||||
info->stream = device->machine->sound().stream_alloc(*device, 0, 1, device->clock()/info->divider, info, okim6258_update);
|
||||
|
||||
info->signal = -2;
|
||||
info->step = 0;
|
||||
@ -221,7 +220,7 @@ static DEVICE_RESET( okim6258 )
|
||||
{
|
||||
okim6258_state *info = get_safe_token(device);
|
||||
|
||||
stream_update(info->stream);
|
||||
info->stream->update();
|
||||
|
||||
info->signal = -2;
|
||||
info->step = 0;
|
||||
@ -241,7 +240,7 @@ void okim6258_set_divider(device_t *device, int val)
|
||||
int divider = dividers[val];
|
||||
|
||||
info->divider = dividers[val];
|
||||
stream_set_sample_rate(info->stream, info->master_clock / divider);
|
||||
info->stream->set_sample_rate(info->master_clock / divider);
|
||||
}
|
||||
|
||||
|
||||
@ -256,7 +255,7 @@ void okim6258_set_clock(device_t *device, int val)
|
||||
okim6258_state *info = get_safe_token(device);
|
||||
|
||||
info->master_clock = val;
|
||||
stream_set_sample_rate(info->stream, info->master_clock / info->divider);
|
||||
info->stream->set_sample_rate(info->master_clock / info->divider);
|
||||
}
|
||||
|
||||
|
||||
@ -284,7 +283,7 @@ READ8_DEVICE_HANDLER( okim6258_status_r )
|
||||
{
|
||||
okim6258_state *info = get_safe_token(device);
|
||||
|
||||
stream_update(info->stream);
|
||||
info->stream->update();
|
||||
|
||||
return (info->status & STATUS_PLAYING) ? 0x00 : 0x80;
|
||||
}
|
||||
@ -300,7 +299,7 @@ WRITE8_DEVICE_HANDLER( okim6258_data_w )
|
||||
okim6258_state *info = get_safe_token(device);
|
||||
|
||||
/* update the stream */
|
||||
stream_update(info->stream);
|
||||
info->stream->update();
|
||||
|
||||
info->data_in = data;
|
||||
info->nibble_shift = 0;
|
||||
@ -317,7 +316,7 @@ WRITE8_DEVICE_HANDLER( okim6258_ctrl_w )
|
||||
{
|
||||
okim6258_state *info = get_safe_token(device);
|
||||
|
||||
stream_update(info->stream);
|
||||
info->stream->update();
|
||||
|
||||
if (data & COMMAND_STOP)
|
||||
{
|
||||
|
@ -36,7 +36,6 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "okim6295.h"
|
||||
|
||||
|
||||
@ -178,7 +177,7 @@ void okim6295_device::device_start()
|
||||
|
||||
// create the stream
|
||||
int divisor = m_config.m_pin7 ? 132 : 165;
|
||||
m_stream = stream_create(*this, 0, 1, clock() / divisor);
|
||||
m_stream = m_machine.sound().stream_alloc(*this, 0, 1, clock() / divisor);
|
||||
|
||||
state_save_register_device_item(this, 0, m_command);
|
||||
state_save_register_device_item(this, 0, m_bank_offs);
|
||||
@ -201,7 +200,7 @@ void okim6295_device::device_start()
|
||||
|
||||
void okim6295_device::device_reset()
|
||||
{
|
||||
stream_update(m_stream);
|
||||
m_stream->update();
|
||||
for (int voicenum = 0; voicenum < OKIM6295_VOICES; voicenum++)
|
||||
m_voice[voicenum].m_playing = false;
|
||||
}
|
||||
@ -225,7 +224,7 @@ void okim6295_device::device_post_load()
|
||||
void okim6295_device::device_clock_changed()
|
||||
{
|
||||
int divisor = m_pin7_state ? 132 : 165;
|
||||
stream_set_sample_rate(m_stream, clock() / divisor);
|
||||
m_stream->set_sample_rate(clock() / divisor);
|
||||
}
|
||||
|
||||
|
||||
@ -253,7 +252,7 @@ void okim6295_device::sound_stream_update(sound_stream &stream, stream_sample_t
|
||||
void okim6295_device::set_bank_base(offs_t base)
|
||||
{
|
||||
// flush out anything pending
|
||||
stream_update(m_stream);
|
||||
m_stream->update();
|
||||
|
||||
// if we are setting a non-zero base, and we have no bank, allocate one
|
||||
if (!m_bank_installed && base != 0)
|
||||
@ -293,7 +292,7 @@ UINT8 okim6295_device::read_status()
|
||||
UINT8 result = 0xf0; // naname expects bits 4-7 to be 1
|
||||
|
||||
// set the bit to 1 if something is playing on a given channel
|
||||
stream_update(m_stream);
|
||||
m_stream->update();
|
||||
for (int voicenum = 0; voicenum < OKIM6295_VOICES; voicenum++)
|
||||
if (m_voice[voicenum].m_playing)
|
||||
result |= 1 << voicenum;
|
||||
@ -327,7 +326,7 @@ void okim6295_device::write_command(UINT8 command)
|
||||
// popmessage("OKI6295 start %x contact MAMEDEV", voicemask);
|
||||
|
||||
// update the stream
|
||||
stream_update(m_stream);
|
||||
m_stream->update();
|
||||
|
||||
// determine which voice(s) (voice is set by a 1 bit in the upper 4 bits of the second byte)
|
||||
for (int voicenum = 0; voicenum < OKIM6295_VOICES; voicenum++, voicemask >>= 1)
|
||||
@ -386,7 +385,7 @@ void okim6295_device::write_command(UINT8 command)
|
||||
else
|
||||
{
|
||||
// update the stream, then turn it off
|
||||
stream_update(m_stream);
|
||||
m_stream->update();
|
||||
|
||||
// determine which voice(s) (voice is set by a 1 bit in bits 3-6 of the command
|
||||
int voicemask = command >> 3;
|
||||
|
@ -11,7 +11,6 @@
|
||||
#ifndef __OKIM6295_H__
|
||||
#define __OKIM6295_H__
|
||||
|
||||
#include "streams.h"
|
||||
|
||||
|
||||
|
||||
|
@ -11,7 +11,6 @@
|
||||
|
||||
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "okim6376.h"
|
||||
|
||||
#define MAX_SAMPLE_CHUNK 10000
|
||||
@ -307,7 +306,7 @@ static DEVICE_START( okim6376 )
|
||||
info->master_clock = device->clock();
|
||||
|
||||
/* generate the name and create the stream */
|
||||
info->stream = stream_create(device, 0, 1, device->clock()/divisor, info, okim6376_update);
|
||||
info->stream = device->machine->sound().stream_alloc(*device, 0, 1, device->clock()/divisor, info, okim6376_update);
|
||||
|
||||
/* initialize the voices */
|
||||
for (voice = 0; voice < OKIM6376_VOICES; voice++)
|
||||
@ -333,7 +332,7 @@ static DEVICE_RESET( okim6376 )
|
||||
okim6376_state *info = get_safe_token(device);
|
||||
int i;
|
||||
|
||||
stream_update(info->stream);
|
||||
info->stream->update();
|
||||
for (i = 0; i < OKIM6376_VOICES; i++)
|
||||
info->voice[i].playing = 0;
|
||||
}
|
||||
@ -355,7 +354,7 @@ READ8_DEVICE_HANDLER( okim6376_r )
|
||||
result = 0xff;
|
||||
|
||||
/* set the bit to 1 if something is playing on a given channel */
|
||||
stream_update(info->stream);
|
||||
info->stream->update();
|
||||
for (i = 0; i < OKIM6376_VOICES; i++)
|
||||
{
|
||||
struct ADPCMVoice *voice = &info->voice[i];
|
||||
@ -392,7 +391,7 @@ WRITE8_DEVICE_HANDLER( okim6376_w )
|
||||
popmessage("OKI6376 start %x contact MAMEDEV", temp);
|
||||
|
||||
/* update the stream */
|
||||
stream_update(info->stream);
|
||||
info->stream->update();
|
||||
|
||||
/* determine which voice(s) (voice is set by a 1 bit in the upper 4 bits of the second byte) */
|
||||
for (i = 0; i < OKIM6376_VOICES; i++, temp >>= 1)
|
||||
@ -451,7 +450,7 @@ WRITE8_DEVICE_HANDLER( okim6376_w )
|
||||
int temp = data >> 3, i;
|
||||
|
||||
/* update the stream, then turn it off */
|
||||
stream_update(info->stream);
|
||||
info->stream->update();
|
||||
|
||||
/* determine which voice(s) (voice is set by a 1 bit in bits 3-6 of the command */
|
||||
for (i = 0; i < OKIM6376_VOICES; i++, temp >>= 1)
|
||||
|
@ -50,7 +50,6 @@
|
||||
*****************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "pokey.h"
|
||||
|
||||
/*
|
||||
@ -668,7 +667,7 @@ static DEVICE_START( pokey )
|
||||
devcb_resolve_write8(&chip->serout_w, &chip->intf.serout_w, device);
|
||||
chip->interrupt_cb = chip->intf.interrupt_cb;
|
||||
|
||||
chip->channel = stream_create(device, 0, 1, sample_rate, chip, pokey_update);
|
||||
chip->channel = device->machine->sound().stream_alloc(*device, 0, 1, sample_rate, chip, pokey_update);
|
||||
|
||||
register_for_save(chip, device);
|
||||
}
|
||||
@ -956,7 +955,7 @@ WRITE8_DEVICE_HANDLER( pokey_w )
|
||||
pokey_state *p = get_safe_token(device);
|
||||
int ch_mask = 0, new_val;
|
||||
|
||||
stream_update(p->channel);
|
||||
p->channel->update();
|
||||
|
||||
/* determine which address was changed */
|
||||
switch (offset & 15)
|
||||
|
@ -9,7 +9,6 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "psx.h"
|
||||
|
||||
#define VERBOSE_LEVEL ( 0 )
|
||||
@ -370,7 +369,7 @@ static DEVICE_START( psxspu )
|
||||
|
||||
chip->installHack = 0;
|
||||
|
||||
chip->stream = stream_create( device, 0, 2, 44100, chip, PSXSPU_update );
|
||||
chip->stream = device->machine->sound().stream_alloc( *device, 0, 2, 44100, chip, PSXSPU_update );
|
||||
}
|
||||
|
||||
|
||||
|
@ -32,7 +32,6 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "qsound.h"
|
||||
|
||||
/*
|
||||
@ -124,8 +123,8 @@ static DEVICE_START( qsound )
|
||||
|
||||
{
|
||||
/* Allocate stream */
|
||||
chip->stream = stream_create(
|
||||
device, 0, 2,
|
||||
chip->stream = device->machine->sound().stream_alloc(
|
||||
*device, 0, 2,
|
||||
device->clock() / QSOUND_CLOCKDIV,
|
||||
chip,
|
||||
qsound_update );
|
||||
|
@ -16,7 +16,6 @@
|
||||
*/
|
||||
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "rf5c400.h"
|
||||
|
||||
typedef struct _rf5c400_channel rf5c400_channel;
|
||||
@ -346,7 +345,7 @@ static void rf5c400_init_chip(device_t *device, rf5c400_state *info)
|
||||
state_save_register_device_item(device, i, info->channels[i].env_scale);
|
||||
}
|
||||
|
||||
info->stream = stream_create(device, 0, 2, device->clock()/384, info, rf5c400_update);
|
||||
info->stream = device->machine->sound().stream_alloc(*device, 0, 2, device->clock()/384, info, rf5c400_update);
|
||||
}
|
||||
|
||||
|
||||
|
@ -3,7 +3,6 @@
|
||||
/*********************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "rf5c68.h"
|
||||
|
||||
|
||||
@ -146,7 +145,7 @@ static DEVICE_START( rf5c68 )
|
||||
rf5c68_state *chip = get_safe_token(device);
|
||||
|
||||
/* allocate the stream */
|
||||
chip->stream = stream_create(device, 0, 2, device->clock() / 384, chip, rf5c68_update);
|
||||
chip->stream = device->machine->sound().stream_alloc(*device, 0, 2, device->clock() / 384, chip, rf5c68_update);
|
||||
|
||||
chip->device = device;
|
||||
|
||||
@ -169,7 +168,7 @@ WRITE8_DEVICE_HANDLER( rf5c68_w )
|
||||
int i;
|
||||
|
||||
/* force the stream to update first */
|
||||
stream_update(chip->stream);
|
||||
chip->stream->update();
|
||||
|
||||
/* switch off the address */
|
||||
switch (offset)
|
||||
|
@ -235,7 +235,6 @@ and off as it normally does during speech). Once START has gone low-high-low, th
|
||||
#undef ACCURATE_SQUEAL
|
||||
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "s14001a.h"
|
||||
|
||||
typedef struct
|
||||
@ -593,13 +592,13 @@ static DEVICE_START( s14001a )
|
||||
|
||||
chip->SpeechRom = *device->region();
|
||||
|
||||
chip->stream = stream_create(device, 0, 1, device->clock() ? device->clock() : device->machine->sample_rate, chip, s14001a_pcm_update);
|
||||
chip->stream = device->machine->sound().stream_alloc(*device, 0, 1, device->clock() ? device->clock() : device->machine->sample_rate, chip, s14001a_pcm_update);
|
||||
}
|
||||
|
||||
int s14001a_bsy_r(device_t *device)
|
||||
{
|
||||
S14001AChip *chip = get_safe_token(device);
|
||||
stream_update(chip->stream);
|
||||
chip->stream->update();
|
||||
#ifdef DEBUGSTATE
|
||||
fprintf(stderr,"busy state checked: %d\n",(chip->machineState != 0) );
|
||||
#endif
|
||||
@ -609,14 +608,14 @@ int s14001a_bsy_r(device_t *device)
|
||||
void s14001a_reg_w(device_t *device, int data)
|
||||
{
|
||||
S14001AChip *chip = get_safe_token(device);
|
||||
stream_update(chip->stream);
|
||||
chip->stream->update();
|
||||
chip->WordInput = data;
|
||||
}
|
||||
|
||||
void s14001a_rst_w(device_t *device, int data)
|
||||
{
|
||||
S14001AChip *chip = get_safe_token(device);
|
||||
stream_update(chip->stream);
|
||||
chip->stream->update();
|
||||
chip->LatchedWord = chip->WordInput;
|
||||
chip->resetState = (data==1);
|
||||
chip->machineState = chip->resetState ? 1 : chip->machineState;
|
||||
@ -625,13 +624,13 @@ void s14001a_rst_w(device_t *device, int data)
|
||||
void s14001a_set_clock(device_t *device, int clock)
|
||||
{
|
||||
S14001AChip *chip = get_safe_token(device);
|
||||
stream_set_sample_rate(chip->stream, clock);
|
||||
chip->stream->set_sample_rate(clock);
|
||||
}
|
||||
|
||||
void s14001a_set_volume(device_t *device, int volume)
|
||||
{
|
||||
S14001AChip *chip = get_safe_token(device);
|
||||
stream_update(chip->stream);
|
||||
chip->stream->update();
|
||||
chip->VSU1000_amp = volume;
|
||||
}
|
||||
|
||||
|
@ -5,7 +5,6 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "sound/s2636.h"
|
||||
|
||||
|
||||
@ -31,7 +30,7 @@ void s2636_soundport_w (device_t *device, int offset, int data)
|
||||
{
|
||||
s2636_sound *token = get_token(device);
|
||||
|
||||
stream_update(token->channel);
|
||||
token->channel->update();
|
||||
token->reg[offset] = data;
|
||||
switch (offset)
|
||||
{
|
||||
@ -80,7 +79,7 @@ static DEVICE_START(s2636_sound)
|
||||
{
|
||||
s2636_sound *token = get_token(device);
|
||||
memset(token, 0, sizeof(*token));
|
||||
token->channel = stream_create(device, 0, 1, device->machine->sample_rate, 0, s2636_update);
|
||||
token->channel = device->machine->sound().stream_alloc(*device, 0, 1, device->machine->sample_rate, 0, s2636_update);
|
||||
}
|
||||
|
||||
|
||||
|
@ -64,7 +64,6 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "saa1099.h"
|
||||
|
||||
|
||||
@ -328,7 +327,7 @@ static DEVICE_START( saa1099 )
|
||||
saa->sample_rate = device->clock() / 256;
|
||||
|
||||
/* for each chip allocate one stream */
|
||||
saa->stream = stream_create(device, 0, 2, saa->sample_rate, saa, saa1099_update);
|
||||
saa->stream = device->machine->sound().stream_alloc(*device, 0, 2, saa->sample_rate, saa, saa1099_update);
|
||||
}
|
||||
|
||||
WRITE8_DEVICE_HANDLER( saa1099_control_w )
|
||||
@ -360,7 +359,7 @@ WRITE8_DEVICE_HANDLER( saa1099_data_w )
|
||||
int ch;
|
||||
|
||||
/* first update the stream to this point in time */
|
||||
stream_update(saa->stream);
|
||||
saa->stream->update();
|
||||
|
||||
switch (reg)
|
||||
{
|
||||
|
@ -1,6 +1,5 @@
|
||||
#include "emu.h"
|
||||
#include "emuopts.h"
|
||||
#include "streams.h"
|
||||
#include "samples.h"
|
||||
|
||||
|
||||
@ -250,7 +249,7 @@ void sample_start(device_t *device,int channel,int samplenum,int loop)
|
||||
chan = &info->channel[channel];
|
||||
|
||||
/* force an update before we start */
|
||||
stream_update(chan->stream);
|
||||
chan->stream->update();
|
||||
|
||||
/* update the parameters */
|
||||
sample = &info->samples->sample[samplenum];
|
||||
@ -275,7 +274,7 @@ void sample_start_raw(device_t *device,int channel,const INT16 *sampledata,int s
|
||||
chan = &info->channel[channel];
|
||||
|
||||
/* force an update before we start */
|
||||
stream_update(chan->stream);
|
||||
chan->stream->update();
|
||||
|
||||
/* update the parameters */
|
||||
chan->source = sampledata;
|
||||
@ -299,7 +298,7 @@ void sample_set_freq(device_t *device,int channel,int freq)
|
||||
chan = &info->channel[channel];
|
||||
|
||||
/* force an update before we start */
|
||||
stream_update(chan->stream);
|
||||
chan->stream->update();
|
||||
|
||||
chan->step = ((INT64)freq << FRAC_BITS) / info->device->machine->sample_rate;
|
||||
}
|
||||
@ -314,7 +313,7 @@ void sample_set_volume(device_t *device,int channel,float volume)
|
||||
|
||||
chan = &info->channel[channel];
|
||||
|
||||
stream_set_output_gain(chan->stream, 0, volume);
|
||||
chan->stream->set_output_gain(0, volume);
|
||||
}
|
||||
|
||||
|
||||
@ -328,7 +327,7 @@ void sample_set_pause(device_t *device,int channel,int pause)
|
||||
chan = &info->channel[channel];
|
||||
|
||||
/* force an update before we start */
|
||||
stream_update(chan->stream);
|
||||
chan->stream->update();
|
||||
|
||||
chan->paused = pause;
|
||||
}
|
||||
@ -344,7 +343,7 @@ void sample_stop(device_t *device,int channel)
|
||||
chan = &info->channel[channel];
|
||||
|
||||
/* force an update before we start */
|
||||
stream_update(chan->stream);
|
||||
chan->stream->update();
|
||||
chan->source = NULL;
|
||||
chan->source_num = -1;
|
||||
}
|
||||
@ -360,7 +359,7 @@ int sample_get_base_freq(device_t *device,int channel)
|
||||
chan = &info->channel[channel];
|
||||
|
||||
/* force an update before we start */
|
||||
stream_update(chan->stream);
|
||||
chan->stream->update();
|
||||
return chan->basefreq;
|
||||
}
|
||||
|
||||
@ -375,7 +374,7 @@ int sample_playing(device_t *device,int channel)
|
||||
chan = &info->channel[channel];
|
||||
|
||||
/* force an update before we start */
|
||||
stream_update(chan->stream);
|
||||
chan->stream->update();
|
||||
return (chan->source != NULL);
|
||||
}
|
||||
|
||||
@ -485,7 +484,7 @@ static DEVICE_START( samples )
|
||||
info->channel = auto_alloc_array(device->machine, sample_channel, info->numchannels);
|
||||
for (i = 0; i < info->numchannels; i++)
|
||||
{
|
||||
info->channel[i].stream = stream_create(device, 0, 1, device->machine->sample_rate, &info->channel[i], sample_update_sound);
|
||||
info->channel[i].stream = device->machine->sound().stream_alloc(*device, 0, 1, device->machine->sample_rate, &info->channel[i], sample_update_sound);
|
||||
|
||||
info->channel[i].source = NULL;
|
||||
info->channel[i].source_num = -1;
|
||||
|
@ -27,7 +27,6 @@
|
||||
*/
|
||||
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "scsp.h"
|
||||
#include "scspdsp.h"
|
||||
|
||||
@ -1250,7 +1249,7 @@ static DEVICE_START( scsp )
|
||||
{
|
||||
scsp->Int68kCB = intf->irq_callback;
|
||||
|
||||
scsp->stream = stream_create(device, 0, 2, 44100, scsp, SCSP_Update);
|
||||
scsp->stream = device->machine->sound().stream_alloc(*device, 0, 2, 44100, scsp, SCSP_Update);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1272,7 +1271,7 @@ READ16_DEVICE_HANDLER( scsp_r )
|
||||
{
|
||||
scsp_state *scsp = get_safe_token(device);
|
||||
|
||||
stream_update(scsp->stream);
|
||||
scsp->stream->update();
|
||||
|
||||
return SCSP_r16(scsp, offset*2);
|
||||
}
|
||||
@ -1284,7 +1283,7 @@ WRITE16_DEVICE_HANDLER( scsp_w )
|
||||
scsp_state *scsp = get_safe_token(device);
|
||||
UINT16 tmp, *scsp_regs;
|
||||
|
||||
stream_update(scsp->stream);
|
||||
scsp->stream->update();
|
||||
|
||||
tmp = SCSP_r16(scsp, offset*2);
|
||||
COMBINE_DATA(&tmp);
|
||||
|
@ -3,7 +3,6 @@
|
||||
/*********************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "segapcm.h"
|
||||
|
||||
typedef struct _segapcm_state segapcm_state;
|
||||
@ -128,7 +127,7 @@ static DEVICE_START( segapcm )
|
||||
|
||||
spcm->bankmask = mask & (rom_mask >> spcm->bankshift);
|
||||
|
||||
spcm->stream = stream_create(device, 0, 2, device->clock() / 128, spcm, SEGAPCM_update);
|
||||
spcm->stream = device->machine->sound().stream_alloc(*device, 0, 2, device->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);
|
||||
@ -138,14 +137,14 @@ static DEVICE_START( segapcm )
|
||||
WRITE8_DEVICE_HANDLER( sega_pcm_w )
|
||||
{
|
||||
segapcm_state *spcm = get_safe_token(device);
|
||||
stream_update(spcm->stream);
|
||||
spcm->stream->update();
|
||||
spcm->ram[offset & 0x07ff] = data;
|
||||
}
|
||||
|
||||
READ8_DEVICE_HANDLER( sega_pcm_r )
|
||||
{
|
||||
segapcm_state *spcm = get_safe_token(device);
|
||||
stream_update(spcm->stream);
|
||||
spcm->stream->update();
|
||||
return spcm->ram[offset & 0x07ff];
|
||||
}
|
||||
|
||||
|
@ -258,7 +258,7 @@ void sid6581_port_w (_SID6581 *This, int offset, int data)
|
||||
break;
|
||||
case 0x15: case 0x16: case 0x17:
|
||||
case 0x18:
|
||||
stream_update(This->mixer_channel);
|
||||
This->mixer_channel->update();
|
||||
This->reg[offset] = data;
|
||||
This->masterVolume = ( This->reg[0x18] & 15 );
|
||||
This->masterVolumeAmplIndex = This->masterVolume << 8;
|
||||
@ -300,7 +300,7 @@ void sid6581_port_w (_SID6581 *This, int offset, int data)
|
||||
break;
|
||||
|
||||
default:
|
||||
stream_update(This->mixer_channel);
|
||||
This->mixer_channel->update();
|
||||
This->reg[offset] = data;
|
||||
|
||||
if (offset<7) {
|
||||
@ -348,11 +348,11 @@ int sid6581_port_r (running_machine *machine, _SID6581 *This, int offset)
|
||||
data=0;
|
||||
break;
|
||||
case 0x1b:
|
||||
stream_update(This->mixer_channel);
|
||||
This->mixer_channel->update();
|
||||
data = This->optr3.output;
|
||||
break;
|
||||
case 0x1c:
|
||||
stream_update(This->mixer_channel);
|
||||
This->mixer_channel->update();
|
||||
data = This->optr3.enveVol;
|
||||
break;
|
||||
default:
|
||||
|
@ -10,7 +10,6 @@
|
||||
|
||||
#include "sound/sid6581.h"
|
||||
#include "sidvoice.h"
|
||||
#include "streams.h"
|
||||
|
||||
/* private area */
|
||||
typedef struct __SID6581
|
||||
|
@ -35,7 +35,7 @@ static void sid_start(device_t *device, SIDTYPE sidtype)
|
||||
const sid6581_interface *iface = (const sid6581_interface*) device->baseconfig().static_config();
|
||||
|
||||
sid->device = device;
|
||||
sid->mixer_channel = stream_create (device, 0, 1, device->machine->sample_rate, (void *) sid, sid_update);
|
||||
sid->mixer_channel = device->machine->sound().stream_alloc(*device, 0, 1, device->machine->sample_rate, (void *) sid, sid_update);
|
||||
sid->PCMfreq = device->machine->sample_rate;
|
||||
sid->clock = device->clock();
|
||||
sid->ad_read = iface ? iface->ad_read : NULL;
|
||||
|
@ -28,7 +28,6 @@
|
||||
*****************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "wavwrite.h"
|
||||
#include "sn76477.h"
|
||||
|
||||
@ -991,7 +990,7 @@ static void SN76477_test_enable_w(sn76477_state *sn, UINT32 data)
|
||||
{
|
||||
if (data != sn->enable)
|
||||
{
|
||||
stream_update(sn->channel);
|
||||
sn->channel->update();
|
||||
|
||||
_SN76477_enable_w(sn, data);
|
||||
|
||||
@ -1034,7 +1033,7 @@ void sn76477_mixer_a_w(device_t *device, UINT32 data)
|
||||
|
||||
if (data != ((sn->mixer_mode >> 0) & 0x01))
|
||||
{
|
||||
stream_update(sn->channel);
|
||||
sn->channel->update();
|
||||
|
||||
_SN76477_mixer_a_w(sn, data);
|
||||
|
||||
@ -1059,7 +1058,7 @@ void sn76477_mixer_b_w(device_t *device, UINT32 data)
|
||||
|
||||
if (data != ((sn->mixer_mode >> 1) & 0x01))
|
||||
{
|
||||
stream_update(sn->channel);
|
||||
sn->channel->update();
|
||||
|
||||
_SN76477_mixer_b_w(sn, data);
|
||||
|
||||
@ -1084,7 +1083,7 @@ void sn76477_mixer_c_w(device_t *device, UINT32 data)
|
||||
|
||||
if (data != ((sn->mixer_mode >> 2) & 0x01))
|
||||
{
|
||||
stream_update(sn->channel);
|
||||
sn->channel->update();
|
||||
|
||||
_SN76477_mixer_c_w(sn, data);
|
||||
|
||||
@ -1116,7 +1115,7 @@ void sn76477_envelope_1_w(device_t *device, UINT32 data)
|
||||
|
||||
if (data != ((sn->envelope_mode >> 0) & 0x01))
|
||||
{
|
||||
stream_update(sn->channel);
|
||||
sn->channel->update();
|
||||
|
||||
_SN76477_envelope_1_w(sn, data);
|
||||
|
||||
@ -1141,7 +1140,7 @@ void sn76477_envelope_2_w(device_t *device, UINT32 data)
|
||||
|
||||
if (data != ((sn->envelope_mode >> 1) & 0x01))
|
||||
{
|
||||
stream_update(sn->channel);
|
||||
sn->channel->update();
|
||||
|
||||
_SN76477_envelope_2_w(sn, data);
|
||||
|
||||
@ -1173,7 +1172,7 @@ void sn76477_vco_w(device_t *device, UINT32 data)
|
||||
|
||||
if (data != sn->vco_mode)
|
||||
{
|
||||
stream_update(sn->channel);
|
||||
sn->channel->update();
|
||||
|
||||
_SN76477_vco_w(sn, data);
|
||||
|
||||
@ -1205,7 +1204,7 @@ void sn76477_one_shot_res_w(device_t *device, double data)
|
||||
|
||||
if (data != sn->one_shot_res)
|
||||
{
|
||||
stream_update(sn->channel);
|
||||
sn->channel->update();
|
||||
|
||||
_SN76477_one_shot_res_w(sn, data);
|
||||
|
||||
@ -1237,7 +1236,7 @@ void sn76477_one_shot_cap_w(device_t *device, double data)
|
||||
|
||||
if (data != sn->one_shot_cap)
|
||||
{
|
||||
stream_update(sn->channel);
|
||||
sn->channel->update();
|
||||
|
||||
_SN76477_one_shot_cap_w(sn, data);
|
||||
|
||||
@ -1266,7 +1265,7 @@ void sn76477_one_shot_cap_voltage_w(device_t *device, double data)
|
||||
/* switch to internal, if not already */
|
||||
if (sn->one_shot_cap_voltage_ext)
|
||||
{
|
||||
stream_update(sn->channel);
|
||||
sn->channel->update();
|
||||
|
||||
sn->one_shot_cap_voltage_ext = 0;
|
||||
|
||||
@ -1278,7 +1277,7 @@ void sn76477_one_shot_cap_voltage_w(device_t *device, double data)
|
||||
/* set the voltage on the cap */
|
||||
if (!sn->one_shot_cap_voltage_ext || (data != sn->one_shot_cap_voltage))
|
||||
{
|
||||
stream_update(sn->channel);
|
||||
sn->channel->update();
|
||||
|
||||
sn->one_shot_cap_voltage_ext = 1;
|
||||
sn->one_shot_cap_voltage = data;
|
||||
@ -1312,7 +1311,7 @@ void sn76477_slf_res_w(device_t *device, double data)
|
||||
|
||||
if (data != sn->slf_res)
|
||||
{
|
||||
stream_update(sn->channel);
|
||||
sn->channel->update();
|
||||
|
||||
_SN76477_slf_res_w(sn, data);
|
||||
|
||||
@ -1344,7 +1343,7 @@ void sn76477_slf_cap_w(device_t *device, double data)
|
||||
|
||||
if (data != sn->slf_cap)
|
||||
{
|
||||
stream_update(sn->channel);
|
||||
sn->channel->update();
|
||||
|
||||
_SN76477_slf_cap_w(sn, data);
|
||||
|
||||
@ -1375,7 +1374,7 @@ void sn76477_slf_cap_voltage_w(device_t *device, double data)
|
||||
/* switch to internal, if not already */
|
||||
if (sn->slf_cap_voltage_ext)
|
||||
{
|
||||
stream_update(sn->channel);
|
||||
sn->channel->update();
|
||||
|
||||
sn->slf_cap_voltage_ext = 0;
|
||||
|
||||
@ -1387,7 +1386,7 @@ void sn76477_slf_cap_voltage_w(device_t *device, double data)
|
||||
/* set the voltage on the cap */
|
||||
if (!sn->slf_cap_voltage_ext || (data != sn->slf_cap_voltage))
|
||||
{
|
||||
stream_update(sn->channel);
|
||||
sn->channel->update();
|
||||
|
||||
sn->slf_cap_voltage_ext = 1;
|
||||
sn->slf_cap_voltage = data;
|
||||
@ -1421,7 +1420,7 @@ void sn76477_vco_res_w(device_t *device, double data)
|
||||
|
||||
if (data != sn->vco_res)
|
||||
{
|
||||
stream_update(sn->channel);
|
||||
sn->channel->update();
|
||||
|
||||
_SN76477_vco_res_w(sn, data);
|
||||
|
||||
@ -1453,7 +1452,7 @@ void sn76477_vco_cap_w(device_t *device, double data)
|
||||
|
||||
if (data != sn->vco_cap)
|
||||
{
|
||||
stream_update(sn->channel);
|
||||
sn->channel->update();
|
||||
|
||||
_SN76477_vco_cap_w(sn, data);
|
||||
|
||||
@ -1482,7 +1481,7 @@ void sn76477_vco_cap_voltage_w(device_t *device, double data)
|
||||
/* switch to internal, if not already */
|
||||
if (sn->vco_cap_voltage_ext)
|
||||
{
|
||||
stream_update(sn->channel);
|
||||
sn->channel->update();
|
||||
|
||||
sn->vco_cap_voltage_ext = 0;
|
||||
|
||||
@ -1494,7 +1493,7 @@ void sn76477_vco_cap_voltage_w(device_t *device, double data)
|
||||
/* set the voltage on the cap */
|
||||
if (!sn->vco_cap_voltage_ext || (data != sn->vco_cap_voltage))
|
||||
{
|
||||
stream_update(sn->channel);
|
||||
sn->channel->update();
|
||||
|
||||
sn->vco_cap_voltage_ext = 1;
|
||||
sn->vco_cap_voltage = data;
|
||||
@ -1528,7 +1527,7 @@ void sn76477_vco_voltage_w(device_t *device, double data)
|
||||
|
||||
if (data != sn->vco_voltage)
|
||||
{
|
||||
stream_update(sn->channel);
|
||||
sn->channel->update();
|
||||
|
||||
_SN76477_vco_voltage_w(sn, data);
|
||||
|
||||
@ -1561,7 +1560,7 @@ void sn76477_pitch_voltage_w(device_t *device, double data)
|
||||
|
||||
if (data != sn->pitch_voltage)
|
||||
{
|
||||
stream_update(sn->channel);
|
||||
sn->channel->update();
|
||||
|
||||
_SN76477_pitch_voltage_w(sn, data);
|
||||
|
||||
@ -1594,7 +1593,7 @@ void sn76477_noise_clock_w(device_t *device, UINT32 data)
|
||||
if external control is enabled */
|
||||
if (sn->noise_clock && sn->noise_clock_ext)
|
||||
{
|
||||
stream_update(sn->channel);
|
||||
sn->channel->update();
|
||||
|
||||
sn->real_noise_bit_ff = generate_next_real_noise_bit(sn);
|
||||
}
|
||||
@ -1635,7 +1634,7 @@ void sn76477_noise_clock_res_w(device_t *device, double data)
|
||||
if (((data == 0) && !sn->noise_clock_ext) ||
|
||||
((data != 0) && (data != sn->noise_clock_res)))
|
||||
{
|
||||
stream_update(sn->channel);
|
||||
sn->channel->update();
|
||||
|
||||
_SN76477_noise_clock_res_w(sn, data);
|
||||
|
||||
@ -1667,7 +1666,7 @@ void sn76477_noise_filter_res_w(device_t *device, double data)
|
||||
|
||||
if (data != sn->noise_filter_res)
|
||||
{
|
||||
stream_update(sn->channel);
|
||||
sn->channel->update();
|
||||
|
||||
_SN76477_noise_filter_res_w(sn, data);
|
||||
|
||||
@ -1699,7 +1698,7 @@ void sn76477_noise_filter_cap_w(device_t *device, double data)
|
||||
|
||||
if (data != sn->noise_filter_cap)
|
||||
{
|
||||
stream_update(sn->channel);
|
||||
sn->channel->update();
|
||||
|
||||
_SN76477_noise_filter_cap_w(sn, data);
|
||||
|
||||
@ -1728,7 +1727,7 @@ void sn76477_noise_filter_cap_voltage_w(device_t *device, double data)
|
||||
/* switch to internal, if not already */
|
||||
if (sn->noise_filter_cap_voltage_ext)
|
||||
{
|
||||
stream_update(sn->channel);
|
||||
sn->channel->update();
|
||||
|
||||
sn->noise_filter_cap_voltage_ext = 0;
|
||||
|
||||
@ -1740,7 +1739,7 @@ void sn76477_noise_filter_cap_voltage_w(device_t *device, double data)
|
||||
/* set the voltage on the cap */
|
||||
if (!sn->noise_filter_cap_voltage_ext || (data != sn->noise_filter_cap_voltage))
|
||||
{
|
||||
stream_update(sn->channel);
|
||||
sn->channel->update();
|
||||
|
||||
sn->noise_filter_cap_voltage_ext = 1;
|
||||
sn->noise_filter_cap_voltage = data;
|
||||
@ -1774,7 +1773,7 @@ void sn76477_attack_res_w(device_t *device, double data)
|
||||
|
||||
if (data != sn->attack_res)
|
||||
{
|
||||
stream_update(sn->channel);
|
||||
sn->channel->update();
|
||||
|
||||
_SN76477_attack_res_w(sn, data);
|
||||
|
||||
@ -1806,7 +1805,7 @@ void sn76477_decay_res_w(device_t *device, double data)
|
||||
|
||||
if (data != sn->decay_res)
|
||||
{
|
||||
stream_update(sn->channel);
|
||||
sn->channel->update();
|
||||
|
||||
_SN76477_decay_res_w(sn, data);
|
||||
|
||||
@ -1838,7 +1837,7 @@ void sn76477_attack_decay_cap_w(device_t *device, double data)
|
||||
|
||||
if (data != sn->attack_decay_cap)
|
||||
{
|
||||
stream_update(sn->channel);
|
||||
sn->channel->update();
|
||||
|
||||
_SN76477_attack_decay_cap_w(sn, data);
|
||||
|
||||
@ -1868,7 +1867,7 @@ void sn76477_attack_decay_cap_voltage_w(device_t *device, double data)
|
||||
/* switch to internal, if not already */
|
||||
if (sn->attack_decay_cap_voltage_ext)
|
||||
{
|
||||
stream_update(sn->channel);
|
||||
sn->channel->update();
|
||||
|
||||
sn->attack_decay_cap_voltage_ext = 0;
|
||||
|
||||
@ -1881,7 +1880,7 @@ void sn76477_attack_decay_cap_voltage_w(device_t *device, double data)
|
||||
/* set the voltage on the cap */
|
||||
if (!sn->attack_decay_cap_voltage_ext || (data != sn->attack_decay_cap_voltage))
|
||||
{
|
||||
stream_update(sn->channel);
|
||||
sn->channel->update();
|
||||
|
||||
sn->attack_decay_cap_voltage_ext = 1;
|
||||
sn->attack_decay_cap_voltage = data;
|
||||
@ -1916,7 +1915,7 @@ void sn76477_amplitude_res_w(device_t *device, double data)
|
||||
|
||||
if (data != sn->amplitude_res)
|
||||
{
|
||||
stream_update(sn->channel);
|
||||
sn->channel->update();
|
||||
|
||||
_SN76477_amplitude_res_w(sn, data);
|
||||
|
||||
@ -1948,7 +1947,7 @@ void sn76477_feedback_res_w(device_t *device, double data)
|
||||
|
||||
if (data != sn->feedback_res)
|
||||
{
|
||||
stream_update(sn->channel);
|
||||
sn->channel->update();
|
||||
|
||||
_SN76477_feedback_res_w(sn, data);
|
||||
|
||||
@ -1989,13 +1988,13 @@ static STREAM_UPDATE( SN76477_update )
|
||||
|
||||
|
||||
#if TEST_MODE
|
||||
static int recursing = 0; /* we need to prevent recursion since enable_w calls stream_update */
|
||||
static int recursing = 0; /* we need to prevent recursion since enable_w calls input_code_pressed_once(device->machine, KEYCODE_SPACE->update */
|
||||
|
||||
if (input_code_pressed_once(device->machine, KEYCODE_SPACE) && !recursing)
|
||||
if () && !recursing)
|
||||
{
|
||||
recursing = 1;
|
||||
|
||||
sound_global_enable(device->machine, 1);
|
||||
device->machine->sound().system_enable();
|
||||
SN76477_test_enable_w(sn, !sn->enable);
|
||||
}
|
||||
|
||||
@ -2407,7 +2406,7 @@ static DEVICE_START( sn76477 )
|
||||
|
||||
sn->device = device;
|
||||
|
||||
sn->channel = stream_create(device, 0, 1, device->machine->sample_rate, sn, SN76477_update);
|
||||
sn->channel = device->machine->sound().stream_alloc(*device, 0, 1, device->machine->sample_rate, sn, SN76477_update);
|
||||
|
||||
if (device->clock() > 0)
|
||||
{
|
||||
|
@ -103,7 +103,6 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "sn76496.h"
|
||||
|
||||
|
||||
@ -152,14 +151,14 @@ INLINE sn76496_state *get_safe_token(device_t *device)
|
||||
READ_LINE_DEVICE_HANDLER( sn76496_ready_r )
|
||||
{
|
||||
sn76496_state *R = get_safe_token(device);
|
||||
stream_update(R->Channel);
|
||||
R->Channel->update();
|
||||
return (R->CyclestoREADY? 0 : 1);
|
||||
}
|
||||
|
||||
WRITE8_DEVICE_HANDLER( sn76496_stereo_w )
|
||||
{
|
||||
sn76496_state *R = get_safe_token(device);
|
||||
stream_update(R->Channel);
|
||||
R->Channel->update();
|
||||
if (R->Stereo) R->StereoMask = data;
|
||||
else fatalerror("Call to stereo write with mono chip!\n");
|
||||
}
|
||||
@ -171,7 +170,7 @@ WRITE8_DEVICE_HANDLER( sn76496_w )
|
||||
|
||||
|
||||
/* update the output buffer before changing the registers */
|
||||
stream_update(R->Channel);
|
||||
R->Channel->update();
|
||||
|
||||
/* set number of cycles until READY is active; this is always one
|
||||
'sample', i.e. it equals the clock divider exactly; until the
|
||||
@ -347,7 +346,7 @@ static int SN76496_init(device_t *device, sn76496_state *R, int stereo)
|
||||
int sample_rate = device->clock()/2;
|
||||
int i;
|
||||
|
||||
R->Channel = stream_create(device,0,(stereo?2:1),sample_rate,R,SN76496Update);
|
||||
R->Channel = device->machine->sound().stream_alloc(*device,0,(stereo?2:1),sample_rate,R,SN76496Update);
|
||||
|
||||
for (i = 0;i < 4;i++) R->Volume[i] = 0;
|
||||
|
||||
|
@ -7,7 +7,6 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "snkwave.h"
|
||||
|
||||
|
||||
@ -120,7 +119,7 @@ static DEVICE_START( snkwave )
|
||||
chip->sample_rate = chip->external_clock >> CLOCK_SHIFT;
|
||||
|
||||
/* get stream channels */
|
||||
chip->stream = stream_create(device, 0, 1, chip->sample_rate, chip, snkwave_update);
|
||||
chip->stream = device->machine->sound().stream_alloc(*device, 0, 1, chip->sample_rate, chip, snkwave_update);
|
||||
|
||||
/* reset all the voices */
|
||||
chip->frequency = 0;
|
||||
@ -147,7 +146,7 @@ WRITE8_DEVICE_HANDLER( snkwave_w )
|
||||
{
|
||||
snkwave_state *chip = get_safe_token(device);
|
||||
|
||||
stream_update(chip->stream);
|
||||
chip->stream->update();
|
||||
|
||||
// all registers are 6-bit
|
||||
data &= 0x3f;
|
||||
|
@ -17,7 +17,6 @@
|
||||
*/
|
||||
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "sp0250.h"
|
||||
|
||||
/*
|
||||
@ -128,7 +127,7 @@ static void sp0250_load_values(sp0250_state *sp)
|
||||
static TIMER_CALLBACK( sp0250_timer_tick )
|
||||
{
|
||||
sp0250_state *sp = (sp0250_state *)ptr;
|
||||
stream_update(sp->stream);
|
||||
sp->stream->update();
|
||||
}
|
||||
|
||||
static STREAM_UPDATE( sp0250_update )
|
||||
@ -212,14 +211,14 @@ static DEVICE_START( sp0250 )
|
||||
timer_pulse(device->machine, attotime_mul(ATTOTIME_IN_HZ(device->clock()), CLOCK_DIVIDER), sp, 0, sp0250_timer_tick);
|
||||
}
|
||||
|
||||
sp->stream = stream_create(device, 0, 1, device->clock() / CLOCK_DIVIDER, sp, sp0250_update);
|
||||
sp->stream = device->machine->sound().stream_alloc(*device, 0, 1, device->clock() / CLOCK_DIVIDER, sp, sp0250_update);
|
||||
}
|
||||
|
||||
|
||||
WRITE8_DEVICE_HANDLER( sp0250_w )
|
||||
{
|
||||
sp0250_state *sp = get_safe_token(device);
|
||||
stream_update(sp->stream);
|
||||
sp->stream->update();
|
||||
if (sp->fifo_pos != 15)
|
||||
{
|
||||
sp->fifo[sp->fifo_pos++] = data;
|
||||
@ -234,7 +233,7 @@ WRITE8_DEVICE_HANDLER( sp0250_w )
|
||||
UINT8 sp0250_drq_r(device_t *device)
|
||||
{
|
||||
sp0250_state *sp = get_safe_token(device);
|
||||
stream_update(sp->stream);
|
||||
sp->stream->update();
|
||||
return (sp->fifo_pos == 15) ? CLEAR_LINE : ASSERT_LINE;
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,6 @@
|
||||
*/
|
||||
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "sp0256.h"
|
||||
|
||||
#define CLOCK_DIVIDER (7*6*8)
|
||||
@ -1187,7 +1186,7 @@ static DEVICE_START( sp0256 )
|
||||
devcb_call_write_line(&sp->drq, 1);
|
||||
devcb_call_write_line(&sp->sby, 1);
|
||||
|
||||
sp->stream = stream_create(device, 0, 1, device->clock() / CLOCK_DIVIDER, sp, sp0256_update);
|
||||
sp->stream = device->machine->sound().stream_alloc(*device, 0, 1, device->clock() / CLOCK_DIVIDER, sp, sp0256_update);
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/* Configure our internal variables. */
|
||||
|
@ -71,7 +71,6 @@
|
||||
*/
|
||||
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "speaker.h"
|
||||
|
||||
static const INT16 default_levels[2] = {0, 32767};
|
||||
@ -141,7 +140,7 @@ static DEVICE_START( speaker )
|
||||
int i;
|
||||
double x;
|
||||
|
||||
sp->channel = stream_create(device, 0, 1, device->machine->sample_rate, sp, speaker_sound_update);
|
||||
sp->channel = device->machine->sound().stream_alloc(*device, 0, 1, device->machine->sample_rate, sp, speaker_sound_update);
|
||||
|
||||
if (intf != NULL)
|
||||
{
|
||||
@ -165,7 +164,7 @@ static DEVICE_START( speaker )
|
||||
sp->channel_sample_period_secfrac = ATTOSECONDS_TO_DOUBLE(sp->channel_sample_period);
|
||||
sp->interm_sample_period = sp->channel_sample_period / RATE_MULTIPLIER;
|
||||
sp->interm_sample_period_secfrac = ATTOSECONDS_TO_DOUBLE(sp->interm_sample_period);
|
||||
sp->channel_last_sample_time = stream_get_time(sp->channel);
|
||||
sp->channel_last_sample_time = sp->channel->sample_time();
|
||||
sp->channel_next_sample_time = attotime_add_attoseconds(sp->channel_last_sample_time, sp->channel_sample_period);
|
||||
sp->next_interm_sample_time = attotime_add_attoseconds(sp->channel_last_sample_time, sp->interm_sample_period);
|
||||
sp->interm_sample_index = 0;
|
||||
@ -211,7 +210,7 @@ static DEVICE_START( speaker )
|
||||
}
|
||||
|
||||
|
||||
/* Called via stream_update(stream).
|
||||
/* Called via stream->update().
|
||||
* This can be triggered by the core (based on emulated time) or via speaker_level_w().
|
||||
*/
|
||||
static STREAM_UPDATE( speaker_sound_update )
|
||||
@ -230,7 +229,7 @@ static STREAM_UPDATE( speaker_sound_update )
|
||||
sampled_time = attotime_mul(sampled_time, samples);
|
||||
|
||||
/* Note: since the stream is in the process of being updated,
|
||||
* stream_get_time() will return the time before the update! (MAME 0.130)
|
||||
* stream->sample_time() will return the time before the update! (MAME 0.130)
|
||||
* Avoid using it here in order to avoid a subtle dependence on the stream implementation.
|
||||
*/
|
||||
}
|
||||
@ -293,12 +292,12 @@ void speaker_level_w(device_t *device, int new_level)
|
||||
*/
|
||||
|
||||
/* Force streams.c to update sound until this point in time now */
|
||||
stream_update(sp->channel);
|
||||
sp->channel->update();
|
||||
|
||||
/* This is redundant because time update has to be done within speaker_sound_update() anyway,
|
||||
* however this ensures synchronization between the speaker and stream timing:
|
||||
*/
|
||||
sp->channel_last_sample_time = stream_get_time(sp->channel);
|
||||
sp->channel_last_sample_time = sp->channel->sample_time();
|
||||
sp->channel_next_sample_time = attotime_add_attoseconds(sp->channel_last_sample_time, sp->channel_sample_period);
|
||||
sp->next_interm_sample_time = attotime_add_attoseconds(sp->channel_last_sample_time, sp->interm_sample_period);
|
||||
sp->last_update_time = sp->channel_last_sample_time;
|
||||
|
@ -8,8 +8,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef __SPEAKER_H__
|
||||
#define __SPEAKER_H__
|
||||
#ifndef __SOUND_SPEAKER_H__
|
||||
#define __SOUND_SPEAKER_H__
|
||||
|
||||
#include "devlegcy.h"
|
||||
|
||||
|
@ -4,7 +4,6 @@
|
||||
************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "st0016.h"
|
||||
|
||||
#define VERBOSE (0)
|
||||
@ -143,7 +142,7 @@ static DEVICE_START( st0016 )
|
||||
|
||||
info->sound_ram = intf->p_soundram;
|
||||
|
||||
info->stream = stream_create(device, 0, 2, 44100, info, st0016_update);
|
||||
info->stream = device->machine->sound().stream_alloc(*device, 0, 2, 44100, info, st0016_update);
|
||||
}
|
||||
|
||||
|
||||
|
@ -30,7 +30,6 @@ Offset 0:
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "t6w28.h"
|
||||
|
||||
|
||||
@ -73,7 +72,7 @@ WRITE8_DEVICE_HANDLER( t6w28_w )
|
||||
|
||||
|
||||
/* update the output buffer before changing the registers */
|
||||
stream_update(R->Channel);
|
||||
R->Channel->update();
|
||||
|
||||
offset &= 1;
|
||||
|
||||
@ -310,7 +309,7 @@ static int t6w28_init(device_t *device, t6w28_state *R)
|
||||
int sample_rate = device->clock()/16;
|
||||
int i;
|
||||
|
||||
R->Channel = stream_create(device,0,2,sample_rate,R,t6w28_update);
|
||||
R->Channel = device->machine->sound().stream_alloc(*device,0,2,sample_rate,R,t6w28_update);
|
||||
|
||||
R->SampleRate = sample_rate;
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "tiaintf.h"
|
||||
#include "tiasound.h"
|
||||
|
||||
@ -29,7 +28,7 @@ static DEVICE_START( tia )
|
||||
{
|
||||
tia_state *info = get_safe_token(device);
|
||||
|
||||
info->channel = stream_create(device, 0, 1, device->clock(), info, tia_update);
|
||||
info->channel = device->machine->sound().stream_alloc(*device, 0, 1, device->clock(), info, tia_update);
|
||||
|
||||
info->chip = tia_sound_init(device->clock(), device->clock(), 16);
|
||||
assert_always(info->chip != NULL, "Error creating TIA chip");
|
||||
@ -44,7 +43,7 @@ static DEVICE_STOP( tia )
|
||||
WRITE8_DEVICE_HANDLER( tia_sound_w )
|
||||
{
|
||||
tia_state *info = get_safe_token(device);
|
||||
stream_update(info->channel);
|
||||
info->channel->update();
|
||||
tia_write(info->chip, offset, data);
|
||||
}
|
||||
|
||||
|
@ -40,7 +40,6 @@
|
||||
/*****************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "tiaintf.h"
|
||||
#include "tiasound.h"
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "tms3615.h"
|
||||
|
||||
#define VMIN 0x0000
|
||||
@ -90,7 +89,7 @@ static DEVICE_START( tms3615 )
|
||||
{
|
||||
tms_state *tms = get_safe_token(device);
|
||||
|
||||
tms->channel = stream_create(device, 0, 2, device->clock()/8, tms, tms3615_sound_update);
|
||||
tms->channel = device->machine->sound().stream_alloc(*device, 0, 2, device->clock()/8, tms, tms3615_sound_update);
|
||||
tms->samplerate = device->clock()/8;
|
||||
tms->basefreq = device->clock();
|
||||
}
|
||||
|
@ -1,5 +1,4 @@
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "tms36xx.h"
|
||||
|
||||
#define VERBOSE 1
|
||||
@ -421,7 +420,7 @@ void mm6221aa_tune_w(device_t *device, int tune)
|
||||
LOG(("%s tune:%X\n", tms->subtype, tune));
|
||||
|
||||
/* update the stream before changing the tune */
|
||||
stream_update(tms->channel);
|
||||
tms->channel->update();
|
||||
|
||||
tms->tune_num = tune;
|
||||
tms->tune_ofs = 0;
|
||||
@ -441,7 +440,7 @@ void tms36xx_note_w(device_t *device, int octave, int note)
|
||||
LOG(("%s octave:%X note:%X\n", tms->subtype, octave, note));
|
||||
|
||||
/* update the stream before changing the tune */
|
||||
stream_update(tms->channel);
|
||||
tms->channel->update();
|
||||
|
||||
/* play a single note from 'tune 4', a list of the 13 tones */
|
||||
tms36xx_reset_counters(tms);
|
||||
@ -461,7 +460,7 @@ static void tms3617_enable(tms_state *tms, int enable)
|
||||
return;
|
||||
|
||||
/* update the stream before changing the tune */
|
||||
stream_update(tms->channel);
|
||||
tms->channel->update();
|
||||
|
||||
LOG(("%s enable voices", tms->subtype));
|
||||
for (i = 0; i < 6; i++)
|
||||
@ -501,7 +500,7 @@ static DEVICE_START( tms36xx )
|
||||
|
||||
tms->intf = (const tms36xx_interface *)device->baseconfig().static_config();
|
||||
|
||||
tms->channel = stream_create(device, 0, 1, device->clock() * 64, tms, tms36xx_sound_update);
|
||||
tms->channel = device->machine->sound().stream_alloc(*device, 0, 1, device->clock() * 64, tms, tms36xx_sound_update);
|
||||
tms->samplerate = device->clock() * 64;
|
||||
tms->basefreq = device->clock();
|
||||
enable = 0;
|
||||
|
@ -61,7 +61,6 @@
|
||||
***********************************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "streams.h"
|
||||
#include "tms5110.h"
|
||||
|
||||
#define MAX_SAMPLE_CHUNK 512
|
||||
@ -1032,7 +1031,7 @@ static DEVICE_START( tms5110 )
|
||||
devcb_resolve_read_line(&tms->data_func, &tms->intf->data_func, device);
|
||||
|
||||
/* initialize a stream */
|
||||
tms->stream = stream_create(device, 0, 1, device->clock() / 80, tms, tms5110_update);
|
||||
tms->stream = device->machine->sound().stream_alloc(*device, 0, 1, device->clock() / 80, tms, tms5110_update);
|
||||
|
||||
if (tms->table == NULL)
|
||||
{
|
||||
@ -1153,7 +1152,7 @@ WRITE8_DEVICE_HANDLER( tms5110_ctl_w )
|
||||
tms5110_state *tms = get_safe_token(device);
|
||||
|
||||
/* bring up to date first */
|
||||
stream_update(tms->stream);
|
||||
tms->stream->update();
|
||||
tms->CTL_pins = data & 0xf;
|
||||
}
|
||||
|
||||
@ -1169,7 +1168,7 @@ WRITE_LINE_DEVICE_HANDLER( tms5110_pdc_w )
|
||||
tms5110_state *tms = get_safe_token(device);
|
||||
|
||||
/* bring up to date first */
|
||||
stream_update(tms->stream);
|
||||
tms->stream->update();
|
||||
tms5110_PDC_set(tms, state);
|
||||
}
|
||||
|
||||
@ -1195,7 +1194,7 @@ READ8_DEVICE_HANDLER( tms5110_ctl_r )
|
||||
tms5110_state *tms = get_safe_token(device);
|
||||
|
||||
/* bring up to date first */
|
||||
stream_update(tms->stream);
|
||||
tms->stream->update();
|
||||
if (tms->state == CTL_STATE_OUTPUT)
|
||||
{
|
||||
//if (DEBUG_5110) logerror("Status read (status=%2d)\n", tms->talk_status);
|
||||
@ -1213,7 +1212,7 @@ READ8_DEVICE_HANDLER( m58817_status_r )
|
||||
tms5110_state *tms = get_safe_token(device);
|
||||
|
||||
/* bring up to date first */
|
||||
stream_update(tms->stream);
|
||||
tms->stream->update();
|
||||
return (tms->talk_status << 0); /*CTL1 = still talking ? */
|
||||
}
|
||||
|
||||
@ -1234,7 +1233,7 @@ READ8_DEVICE_HANDLER( tms5110_romclk_hack_r )
|
||||
tms5110_state *tms = get_safe_token(device);
|
||||
|
||||
/* bring up to date first */
|
||||
stream_update(tms->stream);
|
||||
tms->stream->update();
|
||||
|
||||
/* create and start timer if necessary */
|
||||
if (!tms->romclk_hack_timer_started)
|
||||
@ -1258,7 +1257,7 @@ int tms5110_ready_r(device_t *device)
|
||||
tms5110_state *tms = get_safe_token(device);
|
||||
|
||||
/* bring up to date first */
|
||||
stream_update(tms->stream);
|
||||
tms->stream->update();
|
||||
return (tms->fifo_count < FIFO_SIZE-1);
|
||||
}
|
||||
|
||||
@ -1303,7 +1302,7 @@ static STREAM_UPDATE( tms5110_update )
|
||||
void tms5110_set_frequency(device_t *device, int frequency)
|
||||
{
|
||||
tms5110_state *tms = get_safe_token(device);
|
||||
stream_set_sample_rate(tms->stream, frequency / 80);
|
||||
tms->stream->set_sample_rate(frequency / 80);
|
||||
}
|
||||
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user