diff options
Diffstat (limited to 'src/mame/audio/tx1.c')
-rw-r--r-- | src/mame/audio/tx1.c | 100 |
1 files changed, 97 insertions, 3 deletions
diff --git a/src/mame/audio/tx1.c b/src/mame/audio/tx1.c index 37091a02503..508fb74f615 100644 --- a/src/mame/audio/tx1.c +++ b/src/mame/audio/tx1.c @@ -72,7 +72,7 @@ INLINE tx1_sound_state *get_safe_token(device_t *device) assert(device != NULL); assert(device->type() == TX1 || device->type() == BUGGYBOY); - return (tx1_sound_state *)downcast<legacy_device_base *>(device)->token(); + return (tx1_sound_state *)downcast<tx1_sound_device *>(device)->token(); } WRITE8_DEVICE_HANDLER( tx1_pit8253_w ) @@ -608,5 +608,99 @@ DEVICE_GET_INFO( buggyboy_sound ) } -DEFINE_LEGACY_SOUND_DEVICE(BUGGYBOY, buggyboy_sound); -DEFINE_LEGACY_SOUND_DEVICE(TX1, tx1_sound); +const device_type BUGGYBOY = &device_creator<buggyboy_sound_device>; + +buggyboy_sound_device::buggyboy_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : device_t(mconfig, BUGGYBOY, "Buggy Boy Custom", tag, owner, clock), + device_sound_interface(mconfig, *this) +{ + m_token = global_alloc_array_clear(UINT8, sizeof(tx1_sound_state)); +} + +//------------------------------------------------- +// device_config_complete - perform any +// operations now that the configuration is +// complete +//------------------------------------------------- + +void buggyboy_sound_device::device_config_complete() +{ +} + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void buggyboy_sound_device::device_start() +{ + DEVICE_START_NAME( buggyboy_sound )(this); +} + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void buggyboy_sound_device::device_reset() +{ + DEVICE_RESET_NAME( buggyboy_sound )(this); +} + +//------------------------------------------------- +// sound_stream_update - handle a stream update +//------------------------------------------------- + +void buggyboy_sound_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 TX1 = &device_creator<tx1_sound_device>; + +tx1_sound_device::tx1_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : device_t(mconfig, TX1, "TX-1 Custom", tag, owner, clock), + device_sound_interface(mconfig, *this) +{ + m_token = global_alloc_array_clear(UINT8, sizeof(tx1_sound_state)); +} + +//------------------------------------------------- +// device_config_complete - perform any +// operations now that the configuration is +// complete +//------------------------------------------------- + +void tx1_sound_device::device_config_complete() +{ +} + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void tx1_sound_device::device_start() +{ + DEVICE_START_NAME( tx1_sound )(this); +} + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void tx1_sound_device::device_reset() +{ + DEVICE_RESET_NAME( tx1_sound )(this); +} + +//------------------------------------------------- +// sound_stream_update - handle a stream update +//------------------------------------------------- + +void tx1_sound_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"); +} + + |