Previous 199869 Revisions Next

r17619 Monday 3rd September, 2012 at 17:29:55 UTC by Miodrag Milanović
Fixed inheritance (no whatsnew)
[src/emu/sound]es5506.c es5506.h

trunk/src/emu/sound/es5506.c
r17618r17619
15701570}
15711571
15721572
1573
15741573/**********************************************************************************************
15751574
1576     DEVICE_STOP( es5505 ) -- stop emulation of the ES5505
1577
1578***********************************************************************************************/
1579
1580static DEVICE_STOP( es5505 )
1581{
1582   DEVICE_STOP_CALL( es5506 );
1583}
1584
1585
1586static DEVICE_RESET( es5505 )
1587{
1588   DEVICE_RESET_CALL( es5506 );
1589}
1590
1591
1592
1593/**********************************************************************************************
1594
15951575     es5505_reg_write -- handle a write to the selected ES5505 register
15961576
15971577***********************************************************************************************/
r17618r17619
21532133   chip->voice[voice].exbank=bank;
21542134}
21552135
2156const device_type ES5505 = &device_creator<es5505_device>;
2136const device_type ES5506 = &device_creator<es5506_device>;
21572137
2158es5505_device::es5505_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
2159   : device_t(mconfig, ES5505, "ES5505", tag, owner, clock),
2138es5506_device::es5506_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
2139   : device_t(mconfig, ES5506, "ES5506", tag, owner, clock),
21602140     device_sound_interface(mconfig, *this)
21612141{
21622142   m_token = global_alloc_array_clear(UINT8, sizeof(es5506_state));
21632143}
21642144
2165es5505_device::es5505_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
2145es5506_device::es5506_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
21662146   : device_t(mconfig, type, name, tag, owner, clock),
21672147     device_sound_interface(mconfig, *this)
21682148{
r17618r17619
21752155//  complete
21762156//-------------------------------------------------
21772157
2178void es5505_device::device_config_complete()
2158void es5506_device::device_config_complete()
21792159{
21802160}
21812161
r17618r17619
21832163//  device_start - device-specific startup
21842164//-------------------------------------------------
21852165
2186void es5505_device::device_start()
2166void es5506_device::device_start()
21872167{
2188   DEVICE_START_NAME( es5505 )(this);
2168   DEVICE_START_NAME( es5506 )(this);
21892169}
21902170
21912171//-------------------------------------------------
21922172//  device_reset - device-specific reset
21932173//-------------------------------------------------
21942174
2195void es5505_device::device_reset()
2175void es5506_device::device_reset()
21962176{
2197   DEVICE_RESET_NAME( es5505 )(this);
2177   DEVICE_RESET_NAME( es5506 )(this);
21982178}
21992179
22002180//-------------------------------------------------
22012181//  device_stop - device-specific stop
22022182//-------------------------------------------------
22032183
2204void es5505_device::device_stop()
2184void es5506_device::device_stop()
22052185{
2206   DEVICE_STOP_NAME( es5505 )(this);
2186   DEVICE_STOP_NAME( es5506 )(this);
22072187}
22082188
22092189//-------------------------------------------------
22102190//  sound_stream_update - handle a stream update
22112191//-------------------------------------------------
22122192
2213void es5505_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
2193void es5506_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
22142194{
22152195   // should never get here
22162196   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
22172197}
22182198
22192199
2220const device_type ES5506 = &device_creator<es5506_device>;
2200const device_type ES5505 = &device_creator<es5505_device>;
22212201
2222es5506_device::es5506_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
2223   : es5505_device(mconfig, ES5506, "ES5506", tag, owner, clock)
2202es5505_device::es5505_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
2203   : es5506_device(mconfig, ES5505, "ES5505", tag, owner, clock)
22242204{
22252205}
22262206
22272207//-------------------------------------------------
2228//  device_config_complete - perform any
2229//  operations now that the configuration is
2230//  complete
2231//-------------------------------------------------
2232
2233void es5506_device::device_config_complete()
2234{
2235}
2236
2237//-------------------------------------------------
22382208//  device_start - device-specific startup
22392209//-------------------------------------------------
22402210
2241void es5506_device::device_start()
2211void es5505_device::device_start()
22422212{
2243   DEVICE_START_NAME( es5506 )(this);
2213   DEVICE_START_NAME( es5505 )(this);
22442214}
2245
2246//-------------------------------------------------
2247//  device_reset - device-specific reset
2248//-------------------------------------------------
2249
2250void es5506_device::device_reset()
2251{
2252   DEVICE_RESET_NAME( es5506 )(this);
2253}
2254
2255//-------------------------------------------------
2256//  device_stop - device-specific stop
2257//-------------------------------------------------
2258
2259void es5506_device::device_stop()
2260{
2261   DEVICE_STOP_NAME( es5506 )(this);
2262}
2263
2264//-------------------------------------------------
2265//  sound_stream_update - handle a stream update
2266//-------------------------------------------------
2267
2268void es5506_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
2269{
2270   // should never get here
2271   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
2272}
2273
2274
trunk/src/emu/sound/es5506.h
r17618r17619
2525WRITE16_DEVICE_HANDLER( es5505_w );
2626void es5505_voice_bank_w(device_t *device, int voice, int bank);
2727
28class es5505_device : public device_t,
28class es5506_device : public device_t,
2929                                  public device_sound_interface
3030{
3131public:
32   es5505_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
33   es5505_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
34   ~es5505_device() { global_free(m_token); }
32   es5506_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
33   es5506_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
34   ~es5506_device() { global_free(m_token); }
3535
3636   // access to legacy token
3737   void *token() const { assert(m_token != NULL); return m_token; }
r17618r17619
4949   void *m_token;
5050};
5151
52extern const device_type ES5505;
52extern const device_type ES5506;
5353
5454
5555
r17618r17619
6868WRITE8_DEVICE_HANDLER( es5506_w );
6969void es5506_voice_bank_w(device_t *device, int voice, int bank);
7070
71class es5506_device : public es5505_device
71class es5505_device : public es5506_device
7272{
7373public:
74   es5506_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
74   es5505_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
7575protected:
7676   // device-level overrides
77   virtual void device_config_complete();
7877   virtual void device_start();
79   virtual void device_stop();
80   virtual void device_reset();
81
82   // sound stream update overrides
83   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
8478private:
8579   // internal state
8680};
8781
88extern const device_type ES5506;
82extern const device_type ES5505;
8983
9084
9185#endif /* __ES5506_H__ */

Previous 199869 Revisions Next


© 1997-2024 The MAME Team