diff options
Diffstat (limited to 'src/emu/sound/2612intf.c')
-rw-r--r-- | src/emu/sound/2612intf.c | 85 |
1 files changed, 82 insertions, 3 deletions
diff --git a/src/emu/sound/2612intf.c b/src/emu/sound/2612intf.c index f6d95ad0452..f1e58eb7cdd 100644 --- a/src/emu/sound/2612intf.c +++ b/src/emu/sound/2612intf.c @@ -31,7 +31,7 @@ INLINE ym2612_state *get_safe_token(device_t *device) { assert(device != NULL); assert(device->type() == YM2612 || device->type() == YM3438); - return (ym2612_state *)downcast<legacy_device_base *>(device)->token(); + return (ym2612_state *)downcast<ym2612_device *>(device)->token(); } @@ -198,5 +198,84 @@ DEVICE_GET_INFO( ym3438 ) } -DEFINE_LEGACY_SOUND_DEVICE(YM2612, ym2612); -DEFINE_LEGACY_SOUND_DEVICE(YM3438, ym3438); +const device_type YM2612 = &device_creator<ym2612_device>; + +ym2612_device::ym2612_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : device_t(mconfig, YM2612, "YM2612", tag, owner, clock), + device_sound_interface(mconfig, *this) +{ + m_token = global_alloc_array_clear(UINT8, sizeof(ym2612_state)); +} +ym2612_device::ym2612_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) + : device_t(mconfig, type, name, tag, owner, clock), + device_sound_interface(mconfig, *this) +{ + m_token = global_alloc_array_clear(UINT8, sizeof(ym2612_state)); +} + +//------------------------------------------------- +// device_config_complete - perform any +// operations now that the configuration is +// complete +//------------------------------------------------- + +void ym2612_device::device_config_complete() +{ +} + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void ym2612_device::device_start() +{ + DEVICE_START_NAME( ym2612 )(this); +} + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void ym2612_device::device_reset() +{ + DEVICE_RESET_NAME( ym2612 )(this); +} + +//------------------------------------------------- +// device_stop - device-specific stop +//------------------------------------------------- + +void ym2612_device::device_stop() +{ + DEVICE_STOP_NAME( ym2612 )(this); +} + +//------------------------------------------------- +// sound_stream_update - handle a stream update +//------------------------------------------------- + +void ym2612_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) +{ + // should never get here + fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); +} + + +const device_type YM3438 = &device_creator<ym3438_device>; + +ym3438_device::ym3438_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : ym2612_device(mconfig, YM3438, "YM3438", tag, owner, clock) +{ +} + +//------------------------------------------------- +// sound_stream_update - handle a stream update +//------------------------------------------------- + +void ym3438_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) +{ + // should never get here + fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); +} + + |