summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/ninjaw.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/ninjaw.c')
-rw-r--r--src/mame/drivers/ninjaw.c64
1 files changed, 62 insertions, 2 deletions
diff --git a/src/mame/drivers/ninjaw.c b/src/mame/drivers/ninjaw.c
index 2a877e50c4d..504fed57373 100644
--- a/src/mame/drivers/ninjaw.c
+++ b/src/mame/drivers/ninjaw.c
@@ -686,8 +686,68 @@ static DEVICE_GET_INFO( subwoofer )
}
}
-DECLARE_LEGACY_SOUND_DEVICE(SUBWOOFER, subwoofer);
-DEFINE_LEGACY_SOUND_DEVICE(SUBWOOFER, subwoofer);
+class subwoofer_device : public device_t,
+ public device_sound_interface
+{
+public:
+ subwoofer_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~subwoofer_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type SUBWOOFER;
+
+const device_type SUBWOOFER = &device_creator<subwoofer_device>;
+
+subwoofer_device::subwoofer_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, SUBWOOFER, "Subwoofer", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof());
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void subwoofer_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void subwoofer_device::device_start()
+{
+ DEVICE_START_NAME( subwoofer )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void subwoofer_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");
+}
+
+
#endif