Previous 199869 Revisions Next

r17613 Monday 3rd September, 2012 at 13:56:17 UTC by Miodrag Milanović
conversion of legacy devices into modern wip (no whatsnew)
[src/emu/machine]6525tpi.c 6525tpi.h 68681.c 68681.h 74148.c 74148.h 74153.c 74153.h adc083x.c adc083x.h adc1038.c adc1038.h adc1213x.c adc1213x.h idectrl.c idectrl.h k053252.c k053252.h latch8.c latch8.h mb14241.c mb14241.h mb87078.c mb87078.h pd4990a.c pd4990a.h pic8259.c pic8259.h pit8253.c pit8253.h rp5h01.c rp5h01.h smc91c9x.c smc91c9x.h tms6100.c tms6100.h upd4701.c upd4701.h wd17xx.c wd17xx.h
[src/emu/sound]2151intf.c 2151intf.h 2203intf.c 2203intf.h 2413intf.c 2413intf.h 2608intf.c 2608intf.h 2610intf.c 2610intf.h 2612intf.c 2612intf.h 262intf.c 262intf.h 3526intf.c 3526intf.h 3812intf.c 3812intf.h 8950intf.c 8950intf.h aica.c aica.h astrocde.c astrocde.h ay8910.c ay8910.h beep.c beep.h c140.c c140.h c6280.c c6280.h cdda.c cdda.h cem3394.c cem3394.h digitalk.c digitalk.h dmadac.c dmadac.h es5506.c es5506.h es8712.c es8712.h flt_rc.c flt_rc.h flt_vol.c flt_vol.h gaelco.c gaelco.h hc55516.c hc55516.h iremga20.c iremga20.h k005289.c k005289.h k007232.c k007232.h k051649.c k051649.h k053260.c k053260.h k056800.c k056800.h mos6560.c mos6560.h msm5205.c msm5205.h msm5232.c msm5232.h multipcm.c multipcm.h n63701x.c n63701x.h namco.c namco.h nes_apu.c nes_apu.h nile.c nile.h okim6258.c okim6258.h okim6376.c okim6376.h qsound.c qsound.h rf5c400.c rf5c400.h rf5c68.c rf5c68.h s14001a.c s14001a.h s2636.c s2636.h saa1099.c saa1099.h scsp.c scsp.h segapcm.c segapcm.h sid6581.c sid6581.h sn76477.c sn76477.h sn76496.c sn76496.h snkwave.c snkwave.h sp0250.c sp0250.h sp0256.c sp0256.h speaker.c speaker.h st0016.c st0016.h t6w28.c t6w28.h tiaintf.c tiaintf.h tms3615.c tms3615.h tms36xx.c tms36xx.h tms5110.c tms5110.h tms5220.c tms5220.h upd7759.c upd7759.h vlm5030.c vlm5030.h vrender0.c vrender0.h wave.c wave.h x1_010.c x1_010.h ymf271.c ymf271.h ymf278b.c ymf278b.h ymz280b.c ymz280b.h zsg2.c zsg2.h
[src/emu/video]hd63484.c hd63484.h i8275.c i8275.h s2636.c s2636.h saa5050.c saa5050.h tlc34076.c tlc34076.h tms9927.c tms9927.h voodoo.c voodoo.h
[src/mame/audio]amiga.c beezer.c cps3.c exidy.c exidy.h exidy440.c flower.c geebee.c gomoku.c gridlee.c hyprolyb.c hyprolyb.h irem.c irem.h leland.c m72.c m72.h micro3d.c namco52.c namco52.h namco54.c namco54.h phoenix.c pleiads.c pleiads.h polepos.c redbaron.c segag80r.c segasnd.c seibu.c seibu.h snes_snd.c snes_snd.h snk6502.c taitosnd.c taitosnd.h tiamc1.c timeplt.c timeplt.h trackfld.c trackfld.h tx1.c warpwarp.c wiping.c wiping.h
[src/mame/drivers]mjkjidai.c ninjaw.c renegade.c
[src/mame/includes]amiga.h beezer.h bzone.h cd32.h cps3.h flower.h gomoku.h gridlee.h leland.h micro3d.h phoenix.h polepos.h snk6502.h tiamc1.h tx1.h warpwarp.h
[src/mame/machine]buggychl.c buggychl.h cd32.c decocass.c decocass.h gaelco3d.c gaelco3d.h mathbox.c mathbox.h namco06.c namco06.h namco50.c namco50.h namco51.c namco51.h namco53.c namco53.h namco62.c namco62.h namcoio.c namcoio.h nmk112.c nmk112.h taitoio.c taitoio.h
[src/mame/video]atarirle.c atarirle.h deco16ic.c deco16ic.h decocomn.c decocomn.h kan_pand.c kan_pand.h konicdev.c konicdev.h taitoic.c taitoic.h vrender0.c vrender0.h
[src/mess/audio]channelf.c dave.c dave.h gb.c gb.h gmaster.c lynx.c mac.c mea8000.c mea8000.h socrates.c socrates.h special.c svision.c t6721.c t6721.h upd1771.c upd1771.h vc4000.c wswan.c
[src/mess/drivers]pv1000.c
[src/mess/includes]apollo.h channelf.h gmaster.h lynx.h mac.h mc68328.h odyssey2.h special.h svision.h vc4000.h wswan.h
[src/mess/machine]990_tap.c 990_tap.h apollo.c applefdc.c applefdc.h at45dbxx.c at45dbxx.h ataridev.h atarifdc.c ay31015.c ay31015.h beta.c beta.h ds1315.c ds1315.h e05a03.c e05a03.h er59256.c er59256.h hd63450.c hd63450.h i8271.c i8271.h kr2376.c kr2376.h mc68328.c mc68328.h mc6843.c mc6843.h mc6846.c mc6846.h mc6854.c mc6854.h micropolis.c micropolis.h mm58274c.c mm58274c.h mos6530.c mos6530.h omti8621.c omti8621.h pc_lpt.c pc_lpt.h pcf8593.c pcf8593.h pf10.c pf10.h s3c44b0.c s3c44b0.h sst39vfx.c sst39vfx.h strata.c strata.h tf20.c tf20.h upd7002.c upd7002.h upd71071.c upd71071.h upd765.c upd765.h
[src/mess/video]733_asr.c 733_asr.h 911_vdt.c 911_vdt.h apollo.c crt.c crt.h dl1416.c dl1416.h k1ge.c k1ge.h odyssey2.c saa505x.c saa505x.h vdc8563.c vdc8563.h vic4567.c vic4567.h vic6567.c vic6567.h vtvideo.c vtvideo.h

trunk/src/mame/audio/micro3d.c
r17612r17613
185185   if (~data & 8)
186186   {
187187      device_t *device = machine.device(data & 4 ? "noise_2" : "noise_1");
188      noise_state *nstate = (noise_state *)downcast<legacy_device_base *>(device)->token();
188      noise_state *nstate = (noise_state *)downcast<micro3d_sound_device *>(device)->token();
189189
190190      if (state->m_dac_data != nstate->dac[data & 3])
191191      {
r17612r17613
214214   assert(device != NULL);
215215   assert(device->type() == MICRO3D);
216216
217   return (noise_state *)downcast<legacy_device_base *>(device)->token();
217   return (noise_state *)downcast<micro3d_sound_device *>(device)->token();
218218}
219219
220220static STREAM_UPDATE( micro3d_stream_update )
r17612r17613
419419}
420420
421421
422DEFINE_LEGACY_SOUND_DEVICE(MICRO3D, micro3d_sound);
422const device_type MICRO3D = &device_creator<micro3d_sound_device>;
423
424micro3d_sound_device::micro3d_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
425   : device_t(mconfig, MICRO3D, "Microprose Custom", tag, owner, clock),
426     device_sound_interface(mconfig, *this)
427{
428   m_token = global_alloc_array_clear(UINT8, sizeof(noise_state));
429}
430
431//-------------------------------------------------
432//  device_config_complete - perform any
433//  operations now that the configuration is
434//  complete
435//-------------------------------------------------
436
437void micro3d_sound_device::device_config_complete()
438{
439}
440
441//-------------------------------------------------
442//  device_start - device-specific startup
443//-------------------------------------------------
444
445void micro3d_sound_device::device_start()
446{
447   DEVICE_START_NAME( micro3d_sound )(this);
448}
449
450//-------------------------------------------------
451//  device_reset - device-specific reset
452//-------------------------------------------------
453
454void micro3d_sound_device::device_reset()
455{
456   DEVICE_RESET_NAME( micro3d_sound )(this);
457}
458
459//-------------------------------------------------
460//  sound_stream_update - handle a stream update
461//-------------------------------------------------
462
463void micro3d_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
464{
465   // should never get here
466   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
467}
468
469
trunk/src/mame/audio/warpwarp.c
r17612r17613
4040   assert(device != NULL);
4141   assert(device->type() == WARPWARP);
4242
43   return (warpwarp_sound_state *)downcast<legacy_device_base *>(device)->token();
43   return (warpwarp_sound_state *)downcast<warpwarp_sound_device *>(device)->token();
4444}
4545
4646static TIMER_CALLBACK( sound_volume_decay )
r17612r17613
258258}
259259
260260
261DEFINE_LEGACY_SOUND_DEVICE(WARPWARP, warpwarp_sound);
261const device_type WARPWARP = &device_creator<warpwarp_sound_device>;
262
263warpwarp_sound_device::warpwarp_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
264   : device_t(mconfig, WARPWARP, "Warp Warp Custom", tag, owner, clock),
265     device_sound_interface(mconfig, *this)
266{
267   m_token = global_alloc_array_clear(UINT8, sizeof(warpwarp_sound_state));
268}
269
270//-------------------------------------------------
271//  device_config_complete - perform any
272//  operations now that the configuration is
273//  complete
274//-------------------------------------------------
275
276void warpwarp_sound_device::device_config_complete()
277{
278}
279
280//-------------------------------------------------
281//  device_start - device-specific startup
282//-------------------------------------------------
283
284void warpwarp_sound_device::device_start()
285{
286   DEVICE_START_NAME( warpwarp_sound )(this);
287}
288
289//-------------------------------------------------
290//  sound_stream_update - handle a stream update
291//-------------------------------------------------
292
293void warpwarp_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
294{
295   // should never get here
296   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
297}
298
299
trunk/src/mame/audio/phoenix.c
r17612r17613
7878   assert(device != NULL);
7979   assert(device->type() == PHOENIX);
8080
81   return (phoenix_sound_state *)downcast<legacy_device_base *>(device)->token();
81   return (phoenix_sound_state *)downcast<phoenix_sound_device *>(device)->token();
8282}
8383
8484INLINE int update_c24(phoenix_sound_state *state, int samplerate)
r17612r17613
588588}
589589
590590
591DEFINE_LEGACY_SOUND_DEVICE(PHOENIX, phoenix_sound);
591const device_type PHOENIX = &device_creator<phoenix_sound_device>;
592
593phoenix_sound_device::phoenix_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
594   : device_t(mconfig, PHOENIX, "Phoenix Custom", tag, owner, clock),
595     device_sound_interface(mconfig, *this)
596{
597   m_token = global_alloc_array_clear(UINT8, sizeof(phoenix_sound_state));
598}
599
600//-------------------------------------------------
601//  device_config_complete - perform any
602//  operations now that the configuration is
603//  complete
604//-------------------------------------------------
605
606void phoenix_sound_device::device_config_complete()
607{
608}
609
610//-------------------------------------------------
611//  device_start - device-specific startup
612//-------------------------------------------------
613
614void phoenix_sound_device::device_start()
615{
616   DEVICE_START_NAME( phoenix_sound )(this);
617}
618
619//-------------------------------------------------
620//  sound_stream_update - handle a stream update
621//-------------------------------------------------
622
623void phoenix_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
624{
625   // should never get here
626   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
627}
628
629
trunk/src/mame/audio/namco52.c
r17612r17613
6666   assert(device != NULL);
6767   assert(device->type() == NAMCO_52XX);
6868
69   return (namco_52xx_state *)downcast<legacy_device_base *>(device)->token();
69   return (namco_52xx_state *)downcast<namco_52xx_device *>(device)->token();
7070}
7171
7272
r17612r17613
246246 }
247247}
248248
249DEFINE_LEGACY_DEVICE(NAMCO_52XX, namco_52xx);
249const device_type NAMCO_52XX = &device_creator<namco_52xx_device>;
250
251namco_52xx_device::namco_52xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
252   : device_t(mconfig, NAMCO_52XX, "Namco 52xx", tag, owner, clock)
253{
254   m_token = global_alloc_array_clear(UINT8, sizeof(namco_52xx_state));
255}
256
257//-------------------------------------------------
258//  device_config_complete - perform any
259//  operations now that the configuration is
260//  complete
261//-------------------------------------------------
262
263void namco_52xx_device::device_config_complete()
264{
265   m_shortname = "namco52";
266}
267
268//-------------------------------------------------
269//  device_start - device-specific startup
270//-------------------------------------------------
271
272void namco_52xx_device::device_start()
273{
274   DEVICE_START_NAME( namco_52xx )(this);
275}
276
277//-------------------------------------------------
278//  device_mconfig_additions - return a pointer to
279//  the device's machine fragment
280//-------------------------------------------------
281
282machine_config_constructor namco_52xx_device::device_mconfig_additions() const
283{
284   return MACHINE_CONFIG_NAME( namco_52xx  );
285}
286
287//-------------------------------------------------
288//  device_rom_region - return a pointer to the
289//  the device's ROM definitions
290//-------------------------------------------------
291
292const rom_entry *namco_52xx_device::device_rom_region() const
293{
294   return ROM_NAME(namco_52xx );
295}
296
297
trunk/src/mame/audio/namco52.h
r17612r17613
2525WRITE8_DEVICE_HANDLER( namco_52xx_write );
2626
2727
28DECLARE_LEGACY_DEVICE(NAMCO_52XX, namco_52xx);
28class namco_52xx_device : public device_t
29{
30public:
31   namco_52xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
32   ~namco_52xx_device() { global_free(m_token); }
2933
34   // access to legacy token
35   void *token() const { assert(m_token != NULL); return m_token; }
36protected:
37   // device-level overrides
38   virtual void device_config_complete();
39   virtual void device_start();
40   virtual const rom_entry *device_rom_region() const;
41   virtual machine_config_constructor device_mconfig_additions() const;
42private:
43   // internal state
44   void *m_token;
45};
3046
47extern const device_type NAMCO_52XX;
48
49
50
3151/* discrete nodes */
3252#define NAMCO_52XX_P_DATA(base)      (base)
3353
trunk/src/mame/audio/segasnd.c
r17612r17613
141141    SPEECH BOARD
142142***************************************************************************/
143143
144DECLARE_LEGACY_SOUND_DEVICE(SEGASPEECH, speech_sound);
144class speech_sound_device : public device_t,
145                                  public device_sound_interface
146{
147public:
148   speech_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
149   ~speech_sound_device() { global_free(m_token); }
145150
151   // access to legacy token
152   void *token() const { assert(m_token != NULL); return m_token; }
153protected:
154   // device-level overrides
155   virtual void device_config_complete();
156   virtual void device_start();
157
158   // sound stream update overrides
159   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
160private:
161   // internal state
162   void *m_token;
163};
164
165extern const device_type SEGASPEECH;
166
167
146168INLINE speech_state *get_safe_speech(device_t *device)
147169{
148170   assert(device != NULL);
149171   assert(device->type() == SEGASPEECH);
150172
151   return (speech_state *)downcast<legacy_device_base *>(device)->token();
173   return (speech_state *)downcast<speech_sound_device *>(device)->token();
152174}
153175
154176static DEVICE_START( speech_sound )
r17612r17613
175197   }
176198}
177199
178DEFINE_LEGACY_SOUND_DEVICE(SEGASPEECH, speech_sound);
200const device_type SEGASPEECH = &device_creator<speech_sound_device>;
179201
202speech_sound_device::speech_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
203   : device_t(mconfig, SEGASPEECH, "Sega Speech Sound Board", tag, owner, clock),
204     device_sound_interface(mconfig, *this)
205{
206   m_token = global_alloc_array_clear(UINT8, sizeof(speech_state));
207}
180208
209//-------------------------------------------------
210//  device_config_complete - perform any
211//  operations now that the configuration is
212//  complete
213//-------------------------------------------------
181214
215void speech_sound_device::device_config_complete()
216{
217}
218
219//-------------------------------------------------
220//  device_start - device-specific startup
221//-------------------------------------------------
222
223void speech_sound_device::device_start()
224{
225   DEVICE_START_NAME( speech_sound )(this);
226}
227
228//-------------------------------------------------
229//  sound_stream_update - handle a stream update
230//-------------------------------------------------
231
232void speech_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
233{
234   // should never get here
235   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
236}
237
238
239
240
241
182242/*************************************
183243 *
184244 *  i8035 port accessors
r17612r17613
348408    UNIVERSAL SOUND BOARD
349409***************************************************************************/
350410
351static DECLARE_LEGACY_SOUND_DEVICE(SEGAUSB, usb_sound);
411class usb_sound_device : public device_t,
412                                  public device_sound_interface
413{
414public:
415   usb_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
416   ~usb_sound_device() { global_free(m_token); }
352417
418   // access to legacy token
419   void *token() const { assert(m_token != NULL); return m_token; }
420protected:
421   // device-level overrides
422   virtual void device_config_complete();
423   virtual void device_start();
424   virtual void device_reset();
425
426   // sound stream update overrides
427   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
428private:
429   // internal state
430   void *m_token;
431};
432
433extern const device_type SEGAUSB;
434
435
353436INLINE usb_state *get_safe_token(device_t *device)
354437{
355438   assert(device != NULL);
356439   assert(device->type() == SEGAUSB);
357440
358   return (usb_state *)downcast<legacy_device_base *>(device)->token();
441   return (usb_state *)downcast<usb_sound_device *>(device)->token();
359442}
360443
361444/*************************************
r17612r17613
817900}
818901
819902
820static DEVICE_GET_INFO( usb_sound )
903DEVICE_GET_INFO( usb_sound )
821904{
822905   switch (state)
823906   {
r17612r17613
834917   }
835918}
836919
837DEFINE_LEGACY_SOUND_DEVICE(SEGAUSB, usb_sound);
920const device_type SEGAUSB = &device_creator<usb_sound_device>;
838921
922usb_sound_device::usb_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
923   : device_t(mconfig, SEGAUSB, "Sega Universal Sound Board", tag, owner, clock),
924     device_sound_interface(mconfig, *this)
925{
926   m_token = global_alloc_array_clear(UINT8, sizeof(usb_state));
927}
839928
929//-------------------------------------------------
930//  device_config_complete - perform any
931//  operations now that the configuration is
932//  complete
933//-------------------------------------------------
840934
935void usb_sound_device::device_config_complete()
936{
937}
938
939//-------------------------------------------------
940//  device_start - device-specific startup
941//-------------------------------------------------
942
943void usb_sound_device::device_start()
944{
945   DEVICE_START_NAME( usb_sound )(this);
946}
947
948//-------------------------------------------------
949//  device_reset - device-specific reset
950//-------------------------------------------------
951
952void usb_sound_device::device_reset()
953{
954   DEVICE_RESET_NAME( usb_sound )(this);
955}
956
957//-------------------------------------------------
958//  sound_stream_update - handle a stream update
959//-------------------------------------------------
960
961void usb_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
962{
963   // should never get here
964   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
965}
966
967
968
969
970
841971/*************************************
842972 *
843973 *  USB timer and envelope controls
trunk/src/mame/audio/taitosnd.c
r17612r17613
3939   assert(device != NULL);
4040   assert(device->type() == TC0140SYT);
4141
42   return (tc0140syt_state *)downcast<legacy_device_base *>(device)->token();
42   return (tc0140syt_state *)downcast<tc0140syt_device *>(device)->token();
4343}
4444
4545INLINE const tc0140syt_interface *get_interface( device_t *device )
r17612r17613
327327 }
328328}
329329
330DEFINE_LEGACY_DEVICE(TC0140SYT, tc0140syt);
330const device_type TC0140SYT = &device_creator<tc0140syt_device>;
331
332tc0140syt_device::tc0140syt_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
333   : device_t(mconfig, TC0140SYT, "Taito TC0140SYT", tag, owner, clock)
334{
335   m_token = global_alloc_array_clear(UINT8, sizeof(tc0140syt_state));
336}
337
338//-------------------------------------------------
339//  device_config_complete - perform any
340//  operations now that the configuration is
341//  complete
342//-------------------------------------------------
343
344void tc0140syt_device::device_config_complete()
345{
346}
347
348//-------------------------------------------------
349//  device_start - device-specific startup
350//-------------------------------------------------
351
352void tc0140syt_device::device_start()
353{
354   DEVICE_START_NAME( tc0140syt )(this);
355}
356
357//-------------------------------------------------
358//  device_reset - device-specific reset
359//-------------------------------------------------
360
361void tc0140syt_device::device_reset()
362{
363   DEVICE_RESET_NAME( tc0140syt )(this);
364}
365
366
trunk/src/mame/audio/taitosnd.h
r17612r17613
1515   const char         *slave;
1616};
1717
18DECLARE_LEGACY_DEVICE(TC0140SYT, tc0140syt);
18class tc0140syt_device : public device_t
19{
20public:
21   tc0140syt_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
22   ~tc0140syt_device() { global_free(m_token); }
1923
24   // access to legacy token
25   void *token() const { assert(m_token != NULL); return m_token; }
26protected:
27   // device-level overrides
28   virtual void device_config_complete();
29   virtual void device_start();
30   virtual void device_reset();
31private:
32   // internal state
33   void *m_token;
34};
35
36extern const device_type TC0140SYT;
37
38
2039/***************************************************************************
2140    DEVICE CONFIGURATION MACROS
2241***************************************************************************/
trunk/src/mame/audio/wiping.c
r17612r17613
6161   assert(device != NULL);
6262   assert(device->type() == WIPING);
6363
64   return (wiping_sound_state *)downcast<legacy_device_base *>(device)->token();
64   return (wiping_sound_state *)downcast<wiping_sound_device *>(device)->token();
6565}
6666
6767/* build a table to divide by the number of voices; gain is specified as gain*16 */
r17612r17613
278278}
279279
280280
281DEFINE_LEGACY_SOUND_DEVICE(WIPING, wiping_sound);
281const device_type WIPING = &device_creator<wiping_sound_device>;
282
283wiping_sound_device::wiping_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
284   : device_t(mconfig, WIPING, "Wiping Custom", tag, owner, clock),
285     device_sound_interface(mconfig, *this)
286{
287   m_token = global_alloc_array_clear(UINT8, sizeof(wiping_sound_state));
288}
289
290//-------------------------------------------------
291//  device_config_complete - perform any
292//  operations now that the configuration is
293//  complete
294//-------------------------------------------------
295
296void wiping_sound_device::device_config_complete()
297{
298}
299
300//-------------------------------------------------
301//  device_start - device-specific startup
302//-------------------------------------------------
303
304void wiping_sound_device::device_start()
305{
306   DEVICE_START_NAME( wiping_sound )(this);
307}
308
309//-------------------------------------------------
310//  sound_stream_update - handle a stream update
311//-------------------------------------------------
312
313void wiping_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
314{
315   // should never get here
316   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
317}
318
319
trunk/src/mame/audio/leland.c
r17612r17613
230230   assert(device != NULL);
231231   assert(device->type() == LELAND || device->type() == LELAND_80186 || device->type() == REDLINE_80186);
232232
233   return (leland_sound_state *)downcast<legacy_device_base *>(device)->token();
233   return (leland_sound_state *)downcast<leland_sound_device *>(device)->token();
234234}
235235
236236static STREAM_UPDATE( leland_update )
r17612r17613
623623}
624624
625625
626DEFINE_LEGACY_SOUND_DEVICE(LELAND, leland_sound);
627DEFINE_LEGACY_SOUND_DEVICE(LELAND_80186, leland_80186_sound);
628DEFINE_LEGACY_SOUND_DEVICE(REDLINE_80186, redline_80186_sound);
626const device_type LELAND = &device_creator<leland_sound_device>;
629627
628leland_sound_device::leland_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
629   : device_t(mconfig, LELAND, "Leland DAC", tag, owner, clock),
630     device_sound_interface(mconfig, *this)
631{
632   m_token = global_alloc_array_clear(UINT8, sizeof(leland_sound_state));
633}
630634
635leland_sound_device::leland_sound_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
636   : device_t(mconfig, type, name, tag, owner, clock),
637     device_sound_interface(mconfig, *this)
638{
639   m_token = global_alloc_array_clear(UINT8, sizeof(leland_sound_state));
640}
641
642//-------------------------------------------------
643//  device_config_complete - perform any
644//  operations now that the configuration is
645//  complete
646//-------------------------------------------------
647
648void leland_sound_device::device_config_complete()
649{
650}
651
652//-------------------------------------------------
653//  device_start - device-specific startup
654//-------------------------------------------------
655
656void leland_sound_device::device_start()
657{
658   DEVICE_START_NAME( leland_sound )(this);
659}
660
661//-------------------------------------------------
662//  sound_stream_update - handle a stream update
663//-------------------------------------------------
664
665void leland_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
666{
667   // should never get here
668   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
669}
670
671
672const device_type LELAND_80186 = &device_creator<leland_80186_sound_device>;
673
674leland_80186_sound_device::leland_80186_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
675   : leland_sound_device(mconfig, LELAND_80186, "Leland 80186 DAC", tag, owner, clock)
676{
677}
678
679leland_80186_sound_device::leland_80186_sound_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
680   : leland_sound_device(mconfig, type, name, tag, owner, clock)
681{
682}
683
684
685//-------------------------------------------------
686//  device_config_complete - perform any
687//  operations now that the configuration is
688//  complete
689//-------------------------------------------------
690
691void leland_80186_sound_device::device_config_complete()
692{
693}
694
695//-------------------------------------------------
696//  device_start - device-specific startup
697//-------------------------------------------------
698
699void leland_80186_sound_device::device_start()
700{
701   DEVICE_START_NAME( leland_80186_sound )(this);
702}
703
704//-------------------------------------------------
705//  device_reset - device-specific reset
706//-------------------------------------------------
707
708void leland_80186_sound_device::device_reset()
709{
710   DEVICE_RESET_NAME( leland_80186_sound )(this);
711}
712
713//-------------------------------------------------
714//  sound_stream_update - handle a stream update
715//-------------------------------------------------
716
717void leland_80186_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
718{
719   // should never get here
720   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
721}
722
723
724const device_type REDLINE_80186 = &device_creator<redline_80186_sound_device>;
725
726redline_80186_sound_device::redline_80186_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
727   : leland_80186_sound_device(mconfig, REDLINE_80186, "Redline Racer 80186 DAC", tag, owner, clock)
728{
729}
730
731//-------------------------------------------------
732//  device_config_complete - perform any
733//  operations now that the configuration is
734//  complete
735//-------------------------------------------------
736
737void redline_80186_sound_device::device_config_complete()
738{
739}
740
741//-------------------------------------------------
742//  device_start - device-specific startup
743//-------------------------------------------------
744
745void redline_80186_sound_device::device_start()
746{
747   DEVICE_START_NAME( redline_80186_sound )(this);
748}
749
750//-------------------------------------------------
751//  sound_stream_update - handle a stream update
752//-------------------------------------------------
753
754void redline_80186_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
755{
756   // should never get here
757   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
758}
759
760
761
762
631763static void leland_80186_reset(device_t *device)
632764{
633765   leland_sound_state *state = get_safe_token(device);
trunk/src/mame/audio/gomoku.c
r17612r17613
5757   assert(device != NULL);
5858   assert(device->type() == GOMOKU);
5959
60   return (gomoku_sound_state *)downcast<legacy_device_base *>(device)->token();
60   return (gomoku_sound_state *)downcast<gomoku_sound_device *>(device)->token();
6161}
6262
6363
r17612r17613
294294}
295295
296296
297DEFINE_LEGACY_SOUND_DEVICE(GOMOKU, gomoku_sound);
297const device_type GOMOKU = &device_creator<gomoku_sound_device>;
298
299gomoku_sound_device::gomoku_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
300   : device_t(mconfig, GOMOKU, "Gomoku Custom", tag, owner, clock),
301     device_sound_interface(mconfig, *this)
302{
303   m_token = global_alloc_array_clear(UINT8, sizeof(gomoku_sound_state));
304}
305
306//-------------------------------------------------
307//  device_config_complete - perform any
308//  operations now that the configuration is
309//  complete
310//-------------------------------------------------
311
312void gomoku_sound_device::device_config_complete()
313{
314}
315
316//-------------------------------------------------
317//  device_start - device-specific startup
318//-------------------------------------------------
319
320void gomoku_sound_device::device_start()
321{
322   DEVICE_START_NAME( gomoku_sound )(this);
323}
324
325//-------------------------------------------------
326//  sound_stream_update - handle a stream update
327//-------------------------------------------------
328
329void gomoku_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
330{
331   // should never get here
332   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
333}
334
335
trunk/src/mame/audio/wiping.h
r17612r17613
1DECLARE_LEGACY_SOUND_DEVICE(WIPING, wiping_sound);
1class wiping_sound_device : public device_t,
2                                  public device_sound_interface
3{
4public:
5   wiping_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
6   ~wiping_sound_device() { global_free(m_token); }
27
8   // access to legacy token
9   void *token() const { assert(m_token != NULL); return m_token; }
10protected:
11   // device-level overrides
12   virtual void device_config_complete();
13   virtual void device_start();
14
15   // sound stream update overrides
16   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
17private:
18   // internal state
19   void *m_token;
20};
21
22extern const device_type WIPING;
23
24
325WRITE8_DEVICE_HANDLER( wiping_sound_w );
trunk/src/mame/audio/seibu.c
r17612r17613
183183static DEVICE_START( seibu_adpcm )
184184{
185185   running_machine &machine = device->machine();
186   seibu_adpcm_state *state = (seibu_adpcm_state *)downcast<legacy_device_base *>(device)->token();
186   seibu_adpcm_state *state = (seibu_adpcm_state *)downcast<seibu_adpcm_device *>(device)->token();
187187   const seibu_adpcm_interface *intf;
188188
189189   intf = (const seibu_adpcm_interface *)device->static_config();
r17612r17613
229229
230230WRITE8_DEVICE_HANDLER( seibu_adpcm_adr_w )
231231{
232   seibu_adpcm_state *state = (seibu_adpcm_state *)downcast<legacy_device_base *>(device)->token();
232   seibu_adpcm_state *state = (seibu_adpcm_state *)downcast<seibu_adpcm_device *>(device)->token();
233233
234234   if (state->m_stream)
235235      state->m_stream->update();
r17612r17613
246246
247247WRITE8_DEVICE_HANDLER( seibu_adpcm_ctl_w )
248248{
249   seibu_adpcm_state *state = (seibu_adpcm_state *)downcast<legacy_device_base *>(device)->token();
249   seibu_adpcm_state *state = (seibu_adpcm_state *)downcast<seibu_adpcm_device *>(device)->token();
250250
251251   // sequence is 00 02 01 each time.
252252   if (state->m_stream)
r17612r17613
619619ADDRESS_MAP_END
620620
621621
622DEFINE_LEGACY_SOUND_DEVICE(SEIBU_ADPCM, seibu_adpcm);
622const device_type SEIBU_ADPCM = &device_creator<seibu_adpcm_device>;
623
624seibu_adpcm_device::seibu_adpcm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
625   : device_t(mconfig, SEIBU_ADPCM, "Seibu ADPCM", tag, owner, clock),
626     device_sound_interface(mconfig, *this)
627{
628   m_token = global_alloc_array_clear(UINT8, sizeof(seibu_adpcm_state));
629}
630
631//-------------------------------------------------
632//  device_config_complete - perform any
633//  operations now that the configuration is
634//  complete
635//-------------------------------------------------
636
637void seibu_adpcm_device::device_config_complete()
638{
639}
640
641//-------------------------------------------------
642//  device_start - device-specific startup
643//-------------------------------------------------
644
645void seibu_adpcm_device::device_start()
646{
647   DEVICE_START_NAME( seibu_adpcm )(this);
648}
649
650//-------------------------------------------------
651//  sound_stream_update - handle a stream update
652//-------------------------------------------------
653
654void seibu_adpcm_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
655{
656   // should never get here
657   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
658}
659
660
trunk/src/mame/audio/gridlee.c
r17612r17613
4141   assert(device != NULL);
4242   assert(device->type() == GRIDLEE);
4343
44   return (gridlee_sound_state *)downcast<legacy_device_base *>(device)->token();
44   return (gridlee_sound_state *)downcast<gridlee_sound_device *>(device)->token();
4545}
4646
4747static STREAM_UPDATE( gridlee_stream_update )
r17612r17613
197197}
198198
199199
200DEFINE_LEGACY_SOUND_DEVICE(GRIDLEE, gridlee_sound);
200const device_type GRIDLEE = &device_creator<gridlee_sound_device>;
201
202gridlee_sound_device::gridlee_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
203   : device_t(mconfig, GRIDLEE, "Gridlee Custom", tag, owner, clock),
204     device_sound_interface(mconfig, *this)
205{
206   m_token = global_alloc_array_clear(UINT8, sizeof(gridlee_sound_state));
207}
208
209//-------------------------------------------------
210//  device_config_complete - perform any
211//  operations now that the configuration is
212//  complete
213//-------------------------------------------------
214
215void gridlee_sound_device::device_config_complete()
216{
217}
218
219//-------------------------------------------------
220//  device_start - device-specific startup
221//-------------------------------------------------
222
223void gridlee_sound_device::device_start()
224{
225   DEVICE_START_NAME( gridlee_sound )(this);
226}
227
228//-------------------------------------------------
229//  sound_stream_update - handle a stream update
230//-------------------------------------------------
231
232void gridlee_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
233{
234   // should never get here
235   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
236}
237
238
trunk/src/mame/audio/seibu.h
r17612r17613
6363WRITE8_DEVICE_HANDLER( seibu_adpcm_adr_w );
6464WRITE8_DEVICE_HANDLER( seibu_adpcm_ctl_w );
6565
66DECLARE_LEGACY_SOUND_DEVICE(SEIBU_ADPCM, seibu_adpcm);
66class seibu_adpcm_device : public device_t,
67                                  public device_sound_interface
68{
69public:
70   seibu_adpcm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
71   ~seibu_adpcm_device() { global_free(m_token); }
6772
73   // access to legacy token
74   void *token() const { assert(m_token != NULL); return m_token; }
75protected:
76   // device-level overrides
77   virtual void device_config_complete();
78   virtual void device_start();
79
80   // sound stream update overrides
81   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
82private:
83   // internal state
84   void *m_token;
85};
86
87extern const device_type SEIBU_ADPCM;
88
89
6890extern const ym3812_interface seibu_ym3812_interface;
6991extern const ym2151_interface seibu_ym2151_interface;
7092extern const ym2203_interface seibu_ym2203_interface;
trunk/src/mame/audio/tiamc1.c
r17612r17613
7575   assert(device != NULL);
7676   assert(device->type() == TIAMC1);
7777
78   return (tiamc1_sound_state *)downcast<legacy_device_base *>(device)->token();
78   return (tiamc1_sound_state *)downcast<tiamc1_sound_device *>(device)->token();
7979}
8080
8181
r17612r17613
348348
349349
350350
351DEFINE_LEGACY_SOUND_DEVICE(TIAMC1, tiamc1_sound);
351const device_type TIAMC1 = &device_creator<tiamc1_sound_device>;
352
353tiamc1_sound_device::tiamc1_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
354   : device_t(mconfig, TIAMC1, "TIA-MC1 Custom", tag, owner, clock),
355     device_sound_interface(mconfig, *this)
356{
357   m_token = global_alloc_array_clear(UINT8, sizeof(tiamc1_sound_state));
358}
359
360//-------------------------------------------------
361//  device_config_complete - perform any
362//  operations now that the configuration is
363//  complete
364//-------------------------------------------------
365
366void tiamc1_sound_device::device_config_complete()
367{
368}
369
370//-------------------------------------------------
371//  device_start - device-specific startup
372//-------------------------------------------------
373
374void tiamc1_sound_device::device_start()
375{
376   DEVICE_START_NAME( tiamc1_sound )(this);
377}
378
379//-------------------------------------------------
380//  sound_stream_update - handle a stream update
381//-------------------------------------------------
382
383void tiamc1_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
384{
385   // should never get here
386   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
387}
388
389
trunk/src/mame/audio/segag80r.c
r17612r17613
2929
3030DEVICE_GET_INFO( sega005_sound );
3131
32DECLARE_LEGACY_SOUND_DEVICE(SEGA005, sega005_sound);
33DEFINE_LEGACY_SOUND_DEVICE(SEGA005, sega005_sound);
32class sega005_sound_device : public device_t,
33                                  public device_sound_interface
34{
35public:
36   sega005_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
37protected:
38   // device-level overrides
39   virtual void device_config_complete();
40   virtual void device_start();
3441
42   // sound stream update overrides
43   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
44private:
45   // internal state
46};
3547
48extern const device_type SEGA005;
3649
50const device_type SEGA005 = &device_creator<sega005_sound_device>;
51
52sega005_sound_device::sega005_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
53   : device_t(mconfig, SEGA005, "005 Custom", tag, owner, clock),
54     device_sound_interface(mconfig, *this)
55{
56}
57
58//-------------------------------------------------
59//  device_config_complete - perform any
60//  operations now that the configuration is
61//  complete
62//-------------------------------------------------
63
64void sega005_sound_device::device_config_complete()
65{
66}
67
68//-------------------------------------------------
69//  device_start - device-specific startup
70//-------------------------------------------------
71
72static DEVICE_START( sega005_sound );
73void sega005_sound_device::device_start()
74{
75   DEVICE_START_NAME( sega005_sound )(this);
76}
77
78//-------------------------------------------------
79//  sound_stream_update - handle a stream update
80//-------------------------------------------------
81
82void sega005_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
83{
84   // should never get here
85   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
86}
87
88
89
90
91
3792/*************************************
3893 *
3994 *  Astro Blaster sound hardware
trunk/src/mame/audio/flower.c
r17612r17613
6363   assert(device != NULL);
6464   assert(device->type() == FLOWER);
6565
66   return (flower_sound_state *)downcast<legacy_device_base *>(device)->token();
66   return (flower_sound_state *)downcast<flower_sound_device *>(device)->token();
6767}
6868
6969/* build a table to divide by the number of voices; gain is specified as gain*16 */
r17612r17613
374374}
375375
376376
377DEFINE_LEGACY_SOUND_DEVICE(FLOWER, flower_sound);
377const device_type FLOWER = &device_creator<flower_sound_device>;
378
379flower_sound_device::flower_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
380   : device_t(mconfig, FLOWER, "Flower Custom", tag, owner, clock),
381     device_sound_interface(mconfig, *this)
382{
383   m_token = global_alloc_array_clear(UINT8, sizeof(flower_sound_state));
384}
385
386//-------------------------------------------------
387//  device_config_complete - perform any
388//  operations now that the configuration is
389//  complete
390//-------------------------------------------------
391
392void flower_sound_device::device_config_complete()
393{
394}
395
396//-------------------------------------------------
397//  device_start - device-specific startup
398//-------------------------------------------------
399
400void flower_sound_device::device_start()
401{
402   DEVICE_START_NAME( flower_sound )(this);
403}
404
405//-------------------------------------------------
406//  device_reset - device-specific reset
407//-------------------------------------------------
408
409void flower_sound_device::device_reset()
410{
411   DEVICE_RESET_NAME( flower_sound )(this);
412}
413
414//-------------------------------------------------
415//  sound_stream_update - handle a stream update
416//-------------------------------------------------
417
418void flower_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
419{
420   // should never get here
421   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
422}
423
424
trunk/src/mame/audio/exidy.c
r17612r17613
120120   assert(device != NULL);
121121   assert(device->type() == EXIDY || device->type() == EXIDY_VENTURE || device->type() == EXIDY_VICTORY);
122122
123   return (exidy_sound_state *)downcast<legacy_device_base *>(device)->token();
123   return (exidy_sound_state *)downcast<exidy_sound_device *>(device)->token();
124124}
125125
126126/*************************************
r17612r17613
419419   DEVICE_START_CALL(common_sh_start);
420420}
421421
422DEFINE_LEGACY_SOUND_DEVICE(EXIDY, exidy_sound);
422const device_type EXIDY = &device_creator<exidy_sound_device>;
423423
424exidy_sound_device::exidy_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
425   : device_t(mconfig, EXIDY, "Exidy SFX", tag, owner, clock),
426     device_sound_interface(mconfig, *this)
427{
428   m_token = global_alloc_array_clear(UINT8, sizeof(exidy_sound_state));
429}
430
431exidy_sound_device::exidy_sound_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
432   : device_t(mconfig, type, name, tag, owner, clock),
433     device_sound_interface(mconfig, *this)
434{
435   m_token = global_alloc_array_clear(UINT8, sizeof(exidy_sound_state));
436}
437
438//-------------------------------------------------
439//  device_config_complete - perform any
440//  operations now that the configuration is
441//  complete
442//-------------------------------------------------
443
444void exidy_sound_device::device_config_complete()
445{
446}
447
448//-------------------------------------------------
449//  device_start - device-specific startup
450//-------------------------------------------------
451
452void exidy_sound_device::device_start()
453{
454   DEVICE_START_NAME( exidy_sound )(this);
455}
456
457//-------------------------------------------------
458//  device_reset - device-specific reset
459//-------------------------------------------------
460
461static DEVICE_RESET( exidy_sound );
462
463void exidy_sound_device::device_reset()
464{
465   DEVICE_RESET_NAME( exidy_sound )(this);
466}
467
468//-------------------------------------------------
469//  sound_stream_update - handle a stream update
470//-------------------------------------------------
471
472void exidy_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
473{
474   // should never get here
475   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
476}
477
478
479
424480/*************************************
425481 *
426482 *  Audio reset routines
r17612r17613
863919   }
864920}
865921
866DEFINE_LEGACY_SOUND_DEVICE(EXIDY_VENTURE, venture_sound);
922const device_type EXIDY_VENTURE = &device_creator<venture_sound_device>;
867923
924venture_sound_device::venture_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
925   : exidy_sound_device(mconfig, EXIDY_VENTURE, "Exidy SFX+PSG", tag, owner, clock)
926{
927}
868928
929//-------------------------------------------------
930//  device_config_complete - perform any
931//  operations now that the configuration is
932//  complete
933//-------------------------------------------------
934
935void venture_sound_device::device_config_complete()
936{
937}
938
939//-------------------------------------------------
940//  device_start - device-specific startup
941//-------------------------------------------------
942
943void venture_sound_device::device_start()
944{
945   DEVICE_START_NAME( venture_sound )(this);
946}
947
948//-------------------------------------------------
949//  device_reset - device-specific reset
950//-------------------------------------------------
951
952void venture_sound_device::device_reset()
953{
954   DEVICE_RESET_NAME( venture_sound )(this);
955}
956
957//-------------------------------------------------
958//  sound_stream_update - handle a stream update
959//-------------------------------------------------
960
961void venture_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
962{
963   // should never get here
964   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
965}
966
967
968
969
869970static ADDRESS_MAP_START( venture_audio_map, AS_PROGRAM, 8, driver_device )
870971   ADDRESS_MAP_GLOBAL_MASK(0x7fff)
871972   AM_RANGE(0x0000, 0x007f) AM_MIRROR(0x0780) AM_RAM
r17612r17613
11021203}
11031204
11041205
1105DEFINE_LEGACY_SOUND_DEVICE(EXIDY_VICTORY, victory_sound);
1206const device_type EXIDY_VICTORY = &device_creator<victory_sound_device>;
11061207
1208victory_sound_device::victory_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1209   : exidy_sound_device(mconfig, EXIDY_VICTORY, "Exidy SFX+PSG+Speech", tag, owner, clock)
1210{
1211}
11071212
1213//-------------------------------------------------
1214//  device_config_complete - perform any
1215//  operations now that the configuration is
1216//  complete
1217//-------------------------------------------------
1218
1219void victory_sound_device::device_config_complete()
1220{
1221}
1222
1223//-------------------------------------------------
1224//  device_start - device-specific startup
1225//-------------------------------------------------
1226
1227void victory_sound_device::device_start()
1228{
1229   DEVICE_START_NAME( victory_sound )(this);
1230}
1231
1232//-------------------------------------------------
1233//  device_reset - device-specific reset
1234//-------------------------------------------------
1235
1236void victory_sound_device::device_reset()
1237{
1238   DEVICE_RESET_NAME( victory_sound )(this);
1239}
1240
1241//-------------------------------------------------
1242//  sound_stream_update - handle a stream update
1243//-------------------------------------------------
1244
1245void victory_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
1246{
1247   // should never get here
1248   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
1249}
1250
1251
1252
1253
11081254static ADDRESS_MAP_START( victory_audio_map, AS_PROGRAM, 8, driver_device )
11091255   AM_RANGE(0x0000, 0x00ff) AM_MIRROR(0x0f00) AM_RAM
11101256   AM_RANGE(0x1000, 0x107f) AM_MIRROR(0x0f80) AM_DEVREADWRITE_LEGACY("riot", riot6532_r, riot6532_w)
trunk/src/mame/audio/exidy.h
r17612r17613
1DECLARE_LEGACY_SOUND_DEVICE(EXIDY, exidy_sound);
2DECLARE_LEGACY_SOUND_DEVICE(EXIDY_VENTURE, venture_sound);
3DECLARE_LEGACY_SOUND_DEVICE(EXIDY_VICTORY, victory_sound);
1class exidy_sound_device : public device_t,
2                                  public device_sound_interface
3{
4public:
5   exidy_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
6   exidy_sound_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
7   ~exidy_sound_device() { global_free(m_token); }
48
9   // access to legacy token
10   void *token() const { assert(m_token != NULL); return m_token; }
11protected:
12   // device-level overrides
13   virtual void device_config_complete();
14   virtual void device_start();
15   virtual void device_reset();
16
17   // sound stream update overrides
18   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
19private:
20   // internal state
21   void *m_token;
22};
23
24extern const device_type EXIDY;
25
26class venture_sound_device : public exidy_sound_device
27{
28public:
29   venture_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
30protected:
31   // device-level overrides
32   virtual void device_config_complete();
33   virtual void device_start();
34   virtual void device_reset();
35
36   // sound stream update overrides
37   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
38private:
39   // internal state
40};
41
42extern const device_type EXIDY_VENTURE;
43
44class victory_sound_device : public exidy_sound_device
45{
46public:
47   victory_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
48protected:
49   // device-level overrides
50   virtual void device_config_complete();
51   virtual void device_start();
52   virtual void device_reset();
53
54   // sound stream update overrides
55   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
56private:
57   // internal state
58};
59
60extern const device_type EXIDY_VICTORY;
61
62
563READ8_DEVICE_HANDLER( exidy_sh6840_r );
664WRITE8_DEVICE_HANDLER( exidy_sh6840_w );
765WRITE8_DEVICE_HANDLER( exidy_sfxctrl_w );
trunk/src/mame/audio/cps3.c
r17612r17613
3030   assert(device != NULL);
3131   assert(device->type() == CPS3);
3232
33   return (cps3_sound_state *)downcast<legacy_device_base *>(device)->token();
33   return (cps3_sound_state *)downcast<cps3_sound_device *>(device)->token();
3434}
3535
3636static STREAM_UPDATE( cps3_stream_update )
r17612r17613
188188}
189189
190190
191DEFINE_LEGACY_SOUND_DEVICE(CPS3, cps3_sound);
191const device_type CPS3 = &device_creator<cps3_sound_device>;
192
193cps3_sound_device::cps3_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
194   : device_t(mconfig, CPS3, "CPS3 Custom", tag, owner, clock),
195     device_sound_interface(mconfig, *this)
196{
197   m_token = global_alloc_array_clear(UINT8, sizeof(cps3_sound_state));
198}
199
200//-------------------------------------------------
201//  device_config_complete - perform any
202//  operations now that the configuration is
203//  complete
204//-------------------------------------------------
205
206void cps3_sound_device::device_config_complete()
207{
208}
209
210//-------------------------------------------------
211//  device_start - device-specific startup
212//-------------------------------------------------
213
214void cps3_sound_device::device_start()
215{
216   DEVICE_START_NAME( cps3_sound )(this);
217}
218
219//-------------------------------------------------
220//  sound_stream_update - handle a stream update
221//-------------------------------------------------
222
223void cps3_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
224{
225   // should never get here
226   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
227}
228
229
trunk/src/mame/audio/hyprolyb.c
r17612r17613
1818   assert(device != NULL);
1919   assert(device->type() == HYPROLYB_ADPCM);
2020
21   return (hyprolyb_adpcm_state *)downcast<legacy_device_base *>(device)->token();
21   return (hyprolyb_adpcm_state *)downcast<hyprolyb_adpcm_device *>(device)->token();
2222}
2323
2424static DEVICE_START( hyprolyb_adpcm )
r17612r17613
153153 }
154154}
155155
156DEFINE_LEGACY_SOUND_DEVICE(HYPROLYB_ADPCM, hyprolyb_adpcm);
156const device_type HYPROLYB_ADPCM = &device_creator<hyprolyb_adpcm_device>;
157
158hyprolyb_adpcm_device::hyprolyb_adpcm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
159   : device_t(mconfig, HYPROLYB_ADPCM, "Hyper Olympics Audio", tag, owner, clock),
160     device_sound_interface(mconfig, *this)
161{
162   m_token = global_alloc_array_clear(UINT8, sizeof(hyprolyb_adpcm_state));
163}
164
165//-------------------------------------------------
166//  device_config_complete - perform any
167//  operations now that the configuration is
168//  complete
169//-------------------------------------------------
170
171void hyprolyb_adpcm_device::device_config_complete()
172{
173}
174
175//-------------------------------------------------
176//  device_start - device-specific startup
177//-------------------------------------------------
178
179void hyprolyb_adpcm_device::device_start()
180{
181   DEVICE_START_NAME( hyprolyb_adpcm )(this);
182}
183
184//-------------------------------------------------
185//  device_reset - device-specific reset
186//-------------------------------------------------
187
188void hyprolyb_adpcm_device::device_reset()
189{
190   DEVICE_RESET_NAME( hyprolyb_adpcm )(this);
191}
192
193//-------------------------------------------------
194//  sound_stream_update - handle a stream update
195//-------------------------------------------------
196
197void hyprolyb_adpcm_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
198{
199   // should never get here
200   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
201}
202
203
trunk/src/mame/audio/hyprolyb.h
r17612r17613
33
44MACHINE_CONFIG_EXTERN( hyprolyb_adpcm );
55
6DECLARE_LEGACY_SOUND_DEVICE(HYPROLYB_ADPCM, hyprolyb_adpcm);
6class hyprolyb_adpcm_device : public device_t,
7                                  public device_sound_interface
8{
9public:
10   hyprolyb_adpcm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
11   ~hyprolyb_adpcm_device() { global_free(m_token); }
12
13   // access to legacy token
14   void *token() const { assert(m_token != NULL); return m_token; }
15protected:
16   // device-level overrides
17   virtual void device_config_complete();
18   virtual void device_start();
19   virtual void device_reset();
20
21   // sound stream update overrides
22   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
23private:
24   // internal state
25   void *m_token;
26};
27
28extern const device_type HYPROLYB_ADPCM;
29
trunk/src/mame/audio/timeplt.c
r17612r17613
3838   assert(device != NULL);
3939   assert(device->type() == TIMEPLT_AUDIO);
4040
41   return (timeplt_audio_state *)downcast<legacy_device_base *>(device)->token();
41   return (timeplt_audio_state *)downcast<timeplt_audio_device *>(device)->token();
4242}
4343
4444
r17612r17613
273273 }
274274}
275275
276DEFINE_LEGACY_SOUND_DEVICE(TIMEPLT_AUDIO, timeplt_audio);
276const device_type TIMEPLT_AUDIO = &device_creator<timeplt_audio_device>;
277
278timeplt_audio_device::timeplt_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
279   : device_t(mconfig, TIMEPLT_AUDIO, "Time Pilot Audio", tag, owner, clock),
280     device_sound_interface(mconfig, *this)
281{
282   m_token = global_alloc_array_clear(UINT8, sizeof(timeplt_audio_state));
283}
284
285//-------------------------------------------------
286//  device_config_complete - perform any
287//  operations now that the configuration is
288//  complete
289//-------------------------------------------------
290
291void timeplt_audio_device::device_config_complete()
292{
293}
294
295//-------------------------------------------------
296//  device_start - device-specific startup
297//-------------------------------------------------
298
299void timeplt_audio_device::device_start()
300{
301   DEVICE_START_NAME( timeplt_audio )(this);
302}
303
304//-------------------------------------------------
305//  sound_stream_update - handle a stream update
306//-------------------------------------------------
307
308void timeplt_audio_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
309{
310   // should never get here
311   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
312}
313
314
trunk/src/mame/audio/amiga.c
r17612r17613
6767        assert(device != NULL);
6868        assert(device->type() == AMIGA);
6969
70        return (amiga_audio *)downcast<legacy_device_base *>(device)->token();
70        return (amiga_audio *)downcast<amiga_sound_device *>(device)->token();
7171}
7272
7373/*************************************
r17612r17613
295295}
296296
297297
298DEFINE_LEGACY_SOUND_DEVICE(AMIGA, amiga_sound);
298const device_type AMIGA = &device_creator<amiga_sound_device>;
299
300amiga_sound_device::amiga_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
301   : device_t(mconfig, AMIGA, "Amiga Paula", tag, owner, clock),
302     device_sound_interface(mconfig, *this)
303{
304   m_token = global_alloc_array_clear(UINT8, sizeof(amiga_audio));
305}
306
307//-------------------------------------------------
308//  device_config_complete - perform any
309//  operations now that the configuration is
310//  complete
311//-------------------------------------------------
312
313void amiga_sound_device::device_config_complete()
314{
315}
316
317//-------------------------------------------------
318//  device_start - device-specific startup
319//-------------------------------------------------
320
321void amiga_sound_device::device_start()
322{
323   DEVICE_START_NAME( amiga_sound )(this);
324}
325
326//-------------------------------------------------
327//  sound_stream_update - handle a stream update
328//-------------------------------------------------
329
330void amiga_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
331{
332   // should never get here
333   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
334}
335
336
trunk/src/mame/audio/timeplt.h
r17612r17613
33MACHINE_CONFIG_EXTERN( timeplt_sound );
44MACHINE_CONFIG_EXTERN( locomotn_sound );
55
6DECLARE_LEGACY_SOUND_DEVICE(TIMEPLT_AUDIO, timeplt_audio);
6class timeplt_audio_device : public device_t,
7                                  public device_sound_interface
8{
9public:
10   timeplt_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
11   ~timeplt_audio_device() { global_free(m_token); }
12
13   // access to legacy token
14   void *token() const { assert(m_token != NULL); return m_token; }
15protected:
16   // device-level overrides
17   virtual void device_config_complete();
18   virtual void device_start();
19
20   // sound stream update overrides
21   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
22private:
23   // internal state
24   void *m_token;
25};
26
27extern const device_type TIMEPLT_AUDIO;
28
trunk/src/mame/audio/trackfld.c
r17612r17613
2626   assert(device != NULL);
2727   assert(device->type() == TRACKFLD_AUDIO);
2828
29   return (trackfld_audio_state *)downcast<legacy_device_base *>(device)->token();
29   return (trackfld_audio_state *)downcast<trackfld_audio_device *>(device)->token();
3030}
3131
3232
r17612r17613
175175 }
176176}
177177
178DEFINE_LEGACY_SOUND_DEVICE(TRACKFLD_AUDIO, trackfld_audio);
178const device_type TRACKFLD_AUDIO = &device_creator<trackfld_audio_device>;
179
180trackfld_audio_device::trackfld_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
181   : device_t(mconfig, TRACKFLD_AUDIO, "Track And Field Audio", tag, owner, clock),
182     device_sound_interface(mconfig, *this)
183{
184   m_token = global_alloc_array_clear(UINT8, sizeof(trackfld_audio_state));
185}
186
187//-------------------------------------------------
188//  device_config_complete - perform any
189//  operations now that the configuration is
190//  complete
191//-------------------------------------------------
192
193void trackfld_audio_device::device_config_complete()
194{
195}
196
197//-------------------------------------------------
198//  device_start - device-specific startup
199//-------------------------------------------------
200
201void trackfld_audio_device::device_start()
202{
203   DEVICE_START_NAME( trackfld_audio )(this);
204}
205
206//-------------------------------------------------
207//  device_reset - device-specific reset
208//-------------------------------------------------
209
210void trackfld_audio_device::device_reset()
211{
212   DEVICE_RESET_NAME( trackfld_audio )(this);
213}
214
215//-------------------------------------------------
216//  sound_stream_update - handle a stream update
217//-------------------------------------------------
218
219void trackfld_audio_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
220{
221   // should never get here
222   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
223}
224
225
trunk/src/mame/audio/redbaron.c
r17612r17613
5050   assert(device != NULL);
5151   assert(device->type() == REDBARON);
5252
53   return (redbaron_sound_state *)downcast<legacy_device_base *>(device)->token();
53   return (redbaron_sound_state *)downcast<redbaron_sound_device *>(device)->token();
5454}
5555
5656
r17612r17613
244244}
245245
246246
247DEFINE_LEGACY_SOUND_DEVICE(REDBARON, redbaron_sound);
247const device_type REDBARON = &device_creator<redbaron_sound_device>;
248
249redbaron_sound_device::redbaron_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
250   : device_t(mconfig, REDBARON, "Red Baron Custom", tag, owner, clock),
251     device_sound_interface(mconfig, *this)
252{
253   m_token = global_alloc_array_clear(UINT8, sizeof(redbaron_sound_state));
254}
255
256//-------------------------------------------------
257//  device_config_complete - perform any
258//  operations now that the configuration is
259//  complete
260//-------------------------------------------------
261
262void redbaron_sound_device::device_config_complete()
263{
264}
265
266//-------------------------------------------------
267//  device_start - device-specific startup
268//-------------------------------------------------
269
270void redbaron_sound_device::device_start()
271{
272   DEVICE_START_NAME( redbaron_sound )(this);
273}
274
275//-------------------------------------------------
276//  sound_stream_update - handle a stream update
277//-------------------------------------------------
278
279void redbaron_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
280{
281   // should never get here
282   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
283}
284
285
trunk/src/mame/audio/trackfld.h
r17612r17613
77WRITE8_HANDLER( konami_SN76496_latch_w );
88WRITE8_DEVICE_HANDLER( konami_SN76496_w );
99
10DECLARE_LEGACY_SOUND_DEVICE(TRACKFLD_AUDIO, trackfld_audio);
10class trackfld_audio_device : public device_t,
11                                  public device_sound_interface
12{
13public:
14   trackfld_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
15   ~trackfld_audio_device() { global_free(m_token); }
16
17   // access to legacy token
18   void *token() const { assert(m_token != NULL); return m_token; }
19protected:
20   // device-level overrides
21   virtual void device_config_complete();
22   virtual void device_start();
23   virtual void device_reset();
24
25   // sound stream update overrides
26   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
27private:
28   // internal state
29   void *m_token;
30};
31
32extern const device_type TRACKFLD_AUDIO;
33
trunk/src/mame/audio/namco54.c
r17612r17613
6565   assert(device != NULL);
6666   assert(device->type() == NAMCO_54XX);
6767
68   return (namco_54xx_state *)downcast<legacy_device_base *>(device)->token();
68   return (namco_54xx_state *)downcast<namco_54xx_device *>(device)->token();
6969}
7070
7171
r17612r17613
203203 }
204204}
205205
206DEFINE_LEGACY_DEVICE(NAMCO_54XX, namco_54xx);
206const device_type NAMCO_54XX = &device_creator<namco_54xx_device>;
207
208namco_54xx_device::namco_54xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
209   : device_t(mconfig, NAMCO_54XX, "Namco 54xx", tag, owner, clock)
210{
211   m_token = global_alloc_array_clear(UINT8, sizeof(namco_54xx_state));
212}
213
214//-------------------------------------------------
215//  device_config_complete - perform any
216//  operations now that the configuration is
217//  complete
218//-------------------------------------------------
219
220void namco_54xx_device::device_config_complete()
221{
222   m_shortname = "namco54";
223}
224
225//-------------------------------------------------
226//  device_start - device-specific startup
227//-------------------------------------------------
228
229void namco_54xx_device::device_start()
230{
231   DEVICE_START_NAME( namco_54xx )(this);
232}
233
234//-------------------------------------------------
235//  device_mconfig_additions - return a pointer to
236//  the device's machine fragment
237//-------------------------------------------------
238
239machine_config_constructor namco_54xx_device::device_mconfig_additions() const
240{
241   return MACHINE_CONFIG_NAME( namco_54xx  );
242}
243
244//-------------------------------------------------
245//  device_rom_region - return a pointer to the
246//  the device's ROM definitions
247//-------------------------------------------------
248
249const rom_entry *namco_54xx_device::device_rom_region() const
250{
251   return ROM_NAME(namco_54xx );
252}
253
254
trunk/src/mame/audio/snk6502.c
r17612r17613
386386   assert(device != NULL);
387387   assert(device->type() == SNK6502);
388388
389   return (snk6502_sound_state *)downcast<legacy_device_base *>(device)->token();
389   return (snk6502_sound_state *)downcast<snk6502_sound_device *>(device)->token();
390390}
391391
392392INLINE void validate_tone_channel(snk6502_sound_state *state, int channel)
r17612r17613
12661266}
12671267
12681268
1269DEFINE_LEGACY_SOUND_DEVICE(SNK6502, snk6502_sound);
1269const device_type SNK6502 = &device_creator<snk6502_sound_device>;
1270
1271snk6502_sound_device::snk6502_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1272   : device_t(mconfig, SNK6502, "snk6502 Custom", tag, owner, clock),
1273     device_sound_interface(mconfig, *this)
1274{
1275   m_token = global_alloc_array_clear(UINT8, sizeof(snk6502_sound_state));
1276}
1277
1278//-------------------------------------------------
1279//  device_config_complete - perform any
1280//  operations now that the configuration is
1281//  complete
1282//-------------------------------------------------
1283
1284void snk6502_sound_device::device_config_complete()
1285{
1286}
1287
1288//-------------------------------------------------
1289//  device_start - device-specific startup
1290//-------------------------------------------------
1291
1292void snk6502_sound_device::device_start()
1293{
1294   DEVICE_START_NAME( snk6502_sound )(this);
1295}
1296
1297//-------------------------------------------------
1298//  sound_stream_update - handle a stream update
1299//-------------------------------------------------
1300
1301void snk6502_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
1302{
1303   // should never get here
1304   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
1305}
1306
1307
trunk/src/mame/audio/exidy440.c
r17612r17613
124124static void fir_filter(device_t *device, INT32 *input, INT16 *output, int count);
125125
126126
127DECLARE_LEGACY_SOUND_DEVICE(EXIDY440, exidy440_sound);
127class exidy440_sound_device : public device_t,
128                                  public device_sound_interface
129{
130public:
131   exidy440_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
132   ~exidy440_sound_device() { global_free(m_token); }
128133
134   // access to legacy token
135   void *token() const { assert(m_token != NULL); return m_token; }
136protected:
137   // device-level overrides
138   virtual void device_config_complete();
139   virtual void device_start();
140   virtual void device_stop();
141
142   // sound stream update overrides
143   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
144private:
145   // internal state
146   void *m_token;
147};
148
149extern const device_type EXIDY440;
150
151
129152/*************************************
130153 *
131154 *  Initialize the sound system
r17612r17613
137160   assert(device != NULL);
138161        assert(device->type() == EXIDY440);
139162
140        return (exidy440_audio_state *)downcast<legacy_device_base *>(device)->token();
163        return (exidy440_audio_state *)downcast<exidy440_sound_device *>(device)->token();
141164}
142165
143166static DEVICE_START( exidy440_sound )
r17612r17613
9841007}
9851008
9861009
987DEFINE_LEGACY_SOUND_DEVICE(EXIDY440, exidy440_sound);
1010const device_type EXIDY440 = &device_creator<exidy440_sound_device>;
9881011
1012exidy440_sound_device::exidy440_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1013   : device_t(mconfig, EXIDY440, "Exidy 440 CVSD", tag, owner, clock),
1014     device_sound_interface(mconfig, *this)
1015{
1016   m_token = global_alloc_array_clear(UINT8, sizeof(exidy440_audio_state));
1017}
9891018
1019//-------------------------------------------------
1020//  device_config_complete - perform any
1021//  operations now that the configuration is
1022//  complete
1023//-------------------------------------------------
9901024
1025void exidy440_sound_device::device_config_complete()
1026{
1027}
1028
1029//-------------------------------------------------
1030//  device_start - device-specific startup
1031//-------------------------------------------------
1032
1033void exidy440_sound_device::device_start()
1034{
1035   DEVICE_START_NAME( exidy440_sound )(this);
1036}
1037
1038//-------------------------------------------------
1039//  device_stop - device-specific stop
1040//-------------------------------------------------
1041
1042void exidy440_sound_device::device_stop()
1043{
1044   DEVICE_STOP_NAME( exidy440_sound )(this);
1045}
1046
1047//-------------------------------------------------
1048//  sound_stream_update - handle a stream update
1049//-------------------------------------------------
1050
1051void exidy440_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
1052{
1053   // should never get here
1054   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
1055}
1056
1057
1058
1059
1060
9911061/*************************************
9921062 *
9931063 *  Machine driver
trunk/src/mame/audio/namco54.h
r17612r17613
2121WRITE8_DEVICE_HANDLER( namco_54xx_write );
2222
2323
24DECLARE_LEGACY_DEVICE(NAMCO_54XX, namco_54xx);
24class namco_54xx_device : public device_t
25{
26public:
27   namco_54xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
28   ~namco_54xx_device() { global_free(m_token); }
2529
30   // access to legacy token
31   void *token() const { assert(m_token != NULL); return m_token; }
32protected:
33   // device-level overrides
34   virtual void device_config_complete();
35   virtual void device_start();
36   virtual const rom_entry *device_rom_region() const;
37   virtual machine_config_constructor device_mconfig_additions() const;
38private:
39   // internal state
40   void *m_token;
41};
2642
43extern const device_type NAMCO_54XX;
44
45
46
2747/* discrete nodes */
2848#define NAMCO_54XX_0_DATA(base)      (NODE_RELATIVE(base, 0))
2949#define NAMCO_54XX_1_DATA(base)      (NODE_RELATIVE(base, 1))
trunk/src/mame/audio/tx1.c
r17612r17613
7272   assert(device != NULL);
7373   assert(device->type() == TX1 || device->type() == BUGGYBOY);
7474
75   return (tx1_sound_state *)downcast<legacy_device_base *>(device)->token();
75   return (tx1_sound_state *)downcast<tx1_sound_device *>(device)->token();
7676}
7777
7878WRITE8_DEVICE_HANDLER( tx1_pit8253_w )
r17612r17613
608608}
609609
610610
611DEFINE_LEGACY_SOUND_DEVICE(BUGGYBOY, buggyboy_sound);
612DEFINE_LEGACY_SOUND_DEVICE(TX1, tx1_sound);
611const device_type BUGGYBOY = &device_creator<buggyboy_sound_device>;
612
613buggyboy_sound_device::buggyboy_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
614   : device_t(mconfig, BUGGYBOY, "Buggy Boy Custom", tag, owner, clock),
615     device_sound_interface(mconfig, *this)
616{
617   m_token = global_alloc_array_clear(UINT8, sizeof(tx1_sound_state));
618}
619
620//-------------------------------------------------
621//  device_config_complete - perform any
622//  operations now that the configuration is
623//  complete
624//-------------------------------------------------
625
626void buggyboy_sound_device::device_config_complete()
627{
628}
629
630//-------------------------------------------------
631//  device_start - device-specific startup
632//-------------------------------------------------
633
634void buggyboy_sound_device::device_start()
635{
636   DEVICE_START_NAME( buggyboy_sound )(this);
637}
638
639//-------------------------------------------------
640//  device_reset - device-specific reset
641//-------------------------------------------------
642
643void buggyboy_sound_device::device_reset()
644{
645   DEVICE_RESET_NAME( buggyboy_sound )(this);
646}
647
648//-------------------------------------------------
649//  sound_stream_update - handle a stream update
650//-------------------------------------------------
651
652void buggyboy_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
653{
654   // should never get here
655   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
656}
657
658
659const device_type TX1 = &device_creator<tx1_sound_device>;
660
661tx1_sound_device::tx1_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
662   : device_t(mconfig, TX1, "TX-1 Custom", tag, owner, clock),
663     device_sound_interface(mconfig, *this)
664{
665   m_token = global_alloc_array_clear(UINT8, sizeof(tx1_sound_state));
666}
667
668//-------------------------------------------------
669//  device_config_complete - perform any
670//  operations now that the configuration is
671//  complete
672//-------------------------------------------------
673
674void tx1_sound_device::device_config_complete()
675{
676}
677
678//-------------------------------------------------
679//  device_start - device-specific startup
680//-------------------------------------------------
681
682void tx1_sound_device::device_start()
683{
684   DEVICE_START_NAME( tx1_sound )(this);
685}
686
687//-------------------------------------------------
688//  device_reset - device-specific reset
689//-------------------------------------------------
690
691void tx1_sound_device::device_reset()
692{
693   DEVICE_RESET_NAME( tx1_sound )(this);
694}
695
696//-------------------------------------------------
697//  sound_stream_update - handle a stream update
698//-------------------------------------------------
699
700void tx1_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
701{
702   // should never get here
703   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
704}
705
706
trunk/src/mame/audio/irem.c
r17612r17613
2828   assert(device != NULL);
2929   assert(device->type() == IREM_AUDIO);
3030
31   return (irem_audio_state *)downcast<legacy_device_base *>(device)->token();
31   return (irem_audio_state *)downcast<irem_audio_device *>(device)->token();
3232}
3333
3434
r17612r17613
501501 }
502502}
503503
504DEFINE_LEGACY_SOUND_DEVICE(IREM_AUDIO, irem_audio);
504const device_type IREM_AUDIO = &device_creator<irem_audio_device>;
505
506irem_audio_device::irem_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
507   : device_t(mconfig, IREM_AUDIO, "Irem Audio", tag, owner, clock),
508     device_sound_interface(mconfig, *this)
509{
510   m_token = global_alloc_array_clear(UINT8, sizeof(irem_audio_state));
511}
512
513//-------------------------------------------------
514//  device_config_complete - perform any
515//  operations now that the configuration is
516//  complete
517//-------------------------------------------------
518
519void irem_audio_device::device_config_complete()
520{
521}
522
523//-------------------------------------------------
524//  device_start - device-specific startup
525//-------------------------------------------------
526
527void irem_audio_device::device_start()
528{
529   DEVICE_START_NAME( irem_audio )(this);
530}
531
532//-------------------------------------------------
533//  sound_stream_update - handle a stream update
534//-------------------------------------------------
535
536void irem_audio_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
537{
538   // should never get here
539   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
540}
541
542
trunk/src/mame/audio/irem.h
r17612r17613
44MACHINE_CONFIG_EXTERN( m52_large_audio );
55MACHINE_CONFIG_EXTERN( m62_audio );
66
7DECLARE_LEGACY_SOUND_DEVICE(IREM_AUDIO, irem_audio);
7class irem_audio_device : public device_t,
8                                  public device_sound_interface
9{
10public:
11   irem_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
12   ~irem_audio_device() { global_free(m_token); }
13
14   // access to legacy token
15   void *token() const { assert(m_token != NULL); return m_token; }
16protected:
17   // device-level overrides
18   virtual void device_config_complete();
19   virtual void device_start();
20
21   // sound stream update overrides
22   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
23private:
24   // internal state
25   void *m_token;
26};
27
28extern const device_type IREM_AUDIO;
29
trunk/src/mame/audio/m72.c
r17612r17613
8383   assert(device != NULL);
8484   assert(device->type() == M72);
8585
86   return (m72_audio_state *)downcast<legacy_device_base *>(device)->token();
86   return (m72_audio_state *)downcast<m72_audio_device *>(device)->token();
8787}
8888
8989
r17612r17613
271271   }
272272}
273273
274DEFINE_LEGACY_SOUND_DEVICE(M72, m72_audio);
274const device_type M72 = &device_creator<m72_audio_device>;
275
276m72_audio_device::m72_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
277   : device_t(mconfig, M72, "M72 Custom", tag, owner, clock),
278     device_sound_interface(mconfig, *this)
279{
280   m_token = global_alloc_array_clear(UINT8, sizeof(m72_audio_state));
281}
282
283//-------------------------------------------------
284//  device_config_complete - perform any
285//  operations now that the configuration is
286//  complete
287//-------------------------------------------------
288
289void m72_audio_device::device_config_complete()
290{
291}
292
293//-------------------------------------------------
294//  device_start - device-specific startup
295//-------------------------------------------------
296
297void m72_audio_device::device_start()
298{
299   DEVICE_START_NAME( m72_audio )(this);
300}
301
302//-------------------------------------------------
303//  device_reset - device-specific reset
304//-------------------------------------------------
305
306void m72_audio_device::device_reset()
307{
308   DEVICE_RESET_NAME( m72_audio )(this);
309}
310
311//-------------------------------------------------
312//  sound_stream_update - handle a stream update
313//-------------------------------------------------
314
315void m72_audio_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
316{
317   // should never get here
318   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
319}
320
321
trunk/src/mame/audio/m72.h
r17612r17613
1818WRITE8_DEVICE_HANDLER( rtype2_sample_addr_w );
1919WRITE8_DEVICE_HANDLER( poundfor_sample_addr_w );
2020
21DECLARE_LEGACY_SOUND_DEVICE(M72, m72_audio);
21class m72_audio_device : public device_t,
22                                  public device_sound_interface
23{
24public:
25   m72_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
26   ~m72_audio_device() { global_free(m_token); }
27
28   // access to legacy token
29   void *token() const { assert(m_token != NULL); return m_token; }
30protected:
31   // device-level overrides
32   virtual void device_config_complete();
33   virtual void device_start();
34   virtual void device_reset();
35
36   // sound stream update overrides
37   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
38private:
39   // internal state
40   void *m_token;
41};
42
43extern const device_type M72;
44
trunk/src/mame/audio/beezer.c
r17612r17613
126126   assert(device != NULL);
127127   assert(device->type() == BEEZER);
128128
129   return (beezer_sound_state *)downcast<legacy_device_base *>(device)->token();
129   return (beezer_sound_state *)downcast<beezer_sound_device *>(device)->token();
130130}
131131
132132/*************************************
r17612r17613
395395   DEVICE_START_CALL(common_sh_start);
396396}
397397
398DEFINE_LEGACY_SOUND_DEVICE(BEEZER, beezer_sound);
398const device_type BEEZER = &device_creator<beezer_sound_device>;
399399
400beezer_sound_device::beezer_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
401   : device_t(mconfig, BEEZER, "beezer SFX", tag, owner, clock),
402     device_sound_interface(mconfig, *this)
403{
404   m_token = global_alloc_array_clear(UINT8, sizeof(beezer_sound_state));
405}
406
407//-------------------------------------------------
408//  device_config_complete - perform any
409//  operations now that the configuration is
410//  complete
411//-------------------------------------------------
412
413void beezer_sound_device::device_config_complete()
414{
415}
416
417//-------------------------------------------------
418//  device_start - device-specific startup
419//-------------------------------------------------
420
421void beezer_sound_device::device_start()
422{
423   DEVICE_START_NAME( beezer_sound )(this);
424}
425
426//-------------------------------------------------
427//  device_reset - device-specific reset
428//-------------------------------------------------
429static DEVICE_RESET( beezer_sound );
430void beezer_sound_device::device_reset()
431{
432   DEVICE_RESET_NAME( beezer_sound )(this);
433}
434
435//-------------------------------------------------
436//  sound_stream_update - handle a stream update
437//-------------------------------------------------
438
439void beezer_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
440{
441   // should never get here
442   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
443}
444
445
446
400447/*************************************
401448 *
402449 *  Audio reset routines
trunk/src/mame/audio/geebee.c
r17612r17613
2929   assert(device != NULL);
3030   assert(device->type() == GEEBEE);
3131
32   return (geebee_sound_state *)downcast<legacy_device_base *>(device)->token();
32   return (geebee_sound_state *)downcast<geebee_sound_device *>(device)->token();
3333}
3434
3535static TIMER_CALLBACK( volume_decay )
r17612r17613
160160}
161161
162162
163DEFINE_LEGACY_SOUND_DEVICE(GEEBEE, geebee_sound);
163const device_type GEEBEE = &device_creator<geebee_sound_device>;
164
165geebee_sound_device::geebee_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
166   : device_t(mconfig, GEEBEE, "Gee Bee Custom", tag, owner, clock),
167     device_sound_interface(mconfig, *this)
168{
169   m_token = global_alloc_array_clear(UINT8, sizeof(geebee_sound_state));
170}
171
172//-------------------------------------------------
173//  device_config_complete - perform any
174//  operations now that the configuration is
175//  complete
176//-------------------------------------------------
177
178void geebee_sound_device::device_config_complete()
179{
180}
181
182//-------------------------------------------------
183//  device_start - device-specific startup
184//-------------------------------------------------
185
186void geebee_sound_device::device_start()
187{
188   DEVICE_START_NAME( geebee_sound )(this);
189}
190
191//-------------------------------------------------
192//  sound_stream_update - handle a stream update
193//-------------------------------------------------
194
195void geebee_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
196{
197   // should never get here
198   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
199}
200
201
trunk/src/mame/audio/snes_snd.c
r17612r17613
238238   assert(device != NULL);
239239   assert(device->type() == SNES);
240240
241   return (snes_sound_state *)downcast<legacy_device_base *>(device)->token();
241   return (snes_sound_state *)downcast<snes_sound_device *>(device)->token();
242242}
243243
244244/*****************************************************************************
r17612r17613
13771377 }
13781378}
13791379
1380DEFINE_LEGACY_SOUND_DEVICE(SNES, snes_sound);
1380const device_type SNES = &device_creator<snes_sound_device>;
1381
1382snes_sound_device::snes_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1383   : device_t(mconfig, SNES, "SNES Custom DSP (SPC700)", tag, owner, clock),
1384     device_sound_interface(mconfig, *this)
1385{
1386   m_token = global_alloc_array_clear(UINT8, sizeof(snes_sound_state));
1387}
1388
1389//-------------------------------------------------
1390//  device_config_complete - perform any
1391//  operations now that the configuration is
1392//  complete
1393//-------------------------------------------------
1394
1395void snes_sound_device::device_config_complete()
1396{
1397}
1398
1399//-------------------------------------------------
1400//  device_start - device-specific startup
1401//-------------------------------------------------
1402
1403void snes_sound_device::device_start()
1404{
1405   DEVICE_START_NAME( snes_sound )(this);
1406}
1407
1408//-------------------------------------------------
1409//  device_reset - device-specific reset
1410//-------------------------------------------------
1411
1412void snes_sound_device::device_reset()
1413{
1414   DEVICE_RESET_NAME( snes_sound )(this);
1415}
1416
1417//-------------------------------------------------
1418//  sound_stream_update - handle a stream update
1419//-------------------------------------------------
1420
1421void snes_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
1422{
1423   // should never get here
1424   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
1425}
1426
1427
trunk/src/mame/audio/snes_snd.h
r17612r17613
1616    DEVICE CONFIGURATION MACROS
1717***************************************************************************/
1818
19DECLARE_LEGACY_SOUND_DEVICE(SNES, snes_sound);
19class snes_sound_device : public device_t,
20                                  public device_sound_interface
21{
22public:
23   snes_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
24   ~snes_sound_device() { global_free(m_token); }
2025
26   // access to legacy token
27   void *token() const { assert(m_token != NULL); return m_token; }
28protected:
29   // device-level overrides
30   virtual void device_config_complete();
31   virtual void device_start();
32   virtual void device_reset();
2133
34   // sound stream update overrides
35   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
36private:
37   // internal state
38   void *m_token;
39};
40
41extern const device_type SNES;
42
43
44
2245/***************************************************************************
2346    I/O PROTOTYPES
2447***************************************************************************/
trunk/src/mame/audio/pleiads.c
r17612r17613
7575   assert(device != NULL);
7676   assert(device->type() == PLEIADS || device->type() == POPFLAME || device->type() == NAUGHTYB);
7777
78   return (pleiads_sound_state *)downcast<legacy_device_base *>(device)->token();
78   return (pleiads_sound_state *)downcast<pleiads_sound_device *>(device)->token();
7979}
8080
8181
r17612r17613
731731}
732732
733733
734DEFINE_LEGACY_SOUND_DEVICE(PLEIADS, pleiads_sound);
735DEFINE_LEGACY_SOUND_DEVICE(NAUGHTYB, naughtyb_sound);
736DEFINE_LEGACY_SOUND_DEVICE(POPFLAME, popflame_sound);
734const device_type PLEIADS = &device_creator<pleiads_sound_device>;
735
736pleiads_sound_device::pleiads_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
737   : device_t(mconfig, PLEIADS, "Pleiads Custom", tag, owner, clock),
738     device_sound_interface(mconfig, *this)
739{
740   m_token = global_alloc_array_clear(UINT8, sizeof(pleiads_sound_state));
741}
742
743pleiads_sound_device::pleiads_sound_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
744   : device_t(mconfig, type, name, tag, owner, clock),
745     device_sound_interface(mconfig, *this)
746{
747   m_token = global_alloc_array_clear(UINT8, sizeof(pleiads_sound_state));
748}
749
750//-------------------------------------------------
751//  device_config_complete - perform any
752//  operations now that the configuration is
753//  complete
754//-------------------------------------------------
755
756void pleiads_sound_device::device_config_complete()
757{
758}
759
760//-------------------------------------------------
761//  device_start - device-specific startup
762//-------------------------------------------------
763
764void pleiads_sound_device::device_start()
765{
766   DEVICE_START_NAME( pleiads_sound )(this);
767}
768
769//-------------------------------------------------
770//  sound_stream_update - handle a stream update
771//-------------------------------------------------
772
773void pleiads_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
774{
775   // should never get here
776   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
777}
778
779
780const device_type NAUGHTYB = &device_creator<naughtyb_sound_device>;
781
782naughtyb_sound_device::naughtyb_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
783   : pleiads_sound_device(mconfig, NAUGHTYB, "Naughty Boy Custom", tag, owner, clock)
784{
785}
786
787//-------------------------------------------------
788//  device_config_complete - perform any
789//  operations now that the configuration is
790//  complete
791//-------------------------------------------------
792
793void naughtyb_sound_device::device_config_complete()
794{
795}
796
797//-------------------------------------------------
798//  device_start - device-specific startup
799//-------------------------------------------------
800
801void naughtyb_sound_device::device_start()
802{
803   DEVICE_START_NAME( naughtyb_sound )(this);
804}
805
806//-------------------------------------------------
807//  sound_stream_update - handle a stream update
808//-------------------------------------------------
809
810void naughtyb_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
811{
812   // should never get here
813   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
814}
815
816
817const device_type POPFLAME = &device_creator<popflame_sound_device>;
818
819popflame_sound_device::popflame_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
820   : pleiads_sound_device(mconfig, POPFLAME, "Pop Flamer Custom", tag, owner, clock)
821{
822}
823
824//-------------------------------------------------
825//  device_config_complete - perform any
826//  operations now that the configuration is
827//  complete
828//-------------------------------------------------
829
830void popflame_sound_device::device_config_complete()
831{
832}
833
834//-------------------------------------------------
835//  device_start - device-specific startup
836//-------------------------------------------------
837
838void popflame_sound_device::device_start()
839{
840   DEVICE_START_NAME( popflame_sound )(this);
841}
842
843//-------------------------------------------------
844//  sound_stream_update - handle a stream update
845//-------------------------------------------------
846
847void popflame_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
848{
849   // should never get here
850   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
851}
852
853
trunk/src/mame/audio/pleiads.h
r17612r17613
22WRITE8_DEVICE_HANDLER( pleiads_sound_control_b_w );
33WRITE8_DEVICE_HANDLER( pleiads_sound_control_c_w );
44
5DECLARE_LEGACY_SOUND_DEVICE(PLEIADS, pleiads_sound);
6DECLARE_LEGACY_SOUND_DEVICE(NAUGHTYB, naughtyb_sound);
7DECLARE_LEGACY_SOUND_DEVICE(POPFLAME, popflame_sound);
5class pleiads_sound_device : public device_t,
6                                  public device_sound_interface
7{
8public:
9   pleiads_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
10   pleiads_sound_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
11   ~pleiads_sound_device() { global_free(m_token); }
12
13   // access to legacy token
14   void *token() const { assert(m_token != NULL); return m_token; }
15protected:
16   // device-level overrides
17   virtual void device_config_complete();
18   virtual void device_start();
19
20   // sound stream update overrides
21   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
22private:
23   // internal state
24   void *m_token;
25};
26
27extern const device_type PLEIADS;
28
29class naughtyb_sound_device : public pleiads_sound_device
30{
31public:
32   naughtyb_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
33protected:
34   // device-level overrides
35   virtual void device_config_complete();
36   virtual void device_start();
37
38   // sound stream update overrides
39   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
40private:
41   // internal state
42};
43
44extern const device_type NAUGHTYB;
45
46class popflame_sound_device : public pleiads_sound_device
47{
48public:
49   popflame_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
50protected:
51   // device-level overrides
52   virtual void device_config_complete();
53   virtual void device_start();
54
55   // sound stream update overrides
56   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
57private:
58   // internal state
59};
60
61extern const device_type POPFLAME;
62
trunk/src/mame/audio/polepos.c
r17612r17613
5151   assert(device != NULL);
5252   assert(device->type() == POLEPOS);
5353
54   return (polepos_sound_state *)downcast<legacy_device_base *>(device)->token();
54   return (polepos_sound_state *)downcast<polepos_sound_device *>(device)->token();
5555}
5656
5757/************************************/
r17612r17613
369369DISCRETE_SOUND_END
370370
371371
372DEFINE_LEGACY_SOUND_DEVICE(POLEPOS, polepos_sound);
372const device_type POLEPOS = &device_creator<polepos_sound_device>;
373
374polepos_sound_device::polepos_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
375   : device_t(mconfig, POLEPOS, "Pole Position Custom", tag, owner, clock),
376     device_sound_interface(mconfig, *this)
377{
378   m_token = global_alloc_array_clear(UINT8, sizeof(polepos_sound_state));
379}
380
381//-------------------------------------------------
382//  device_config_complete - perform any
383//  operations now that the configuration is
384//  complete
385//-------------------------------------------------
386
387void polepos_sound_device::device_config_complete()
388{
389}
390
391//-------------------------------------------------
392//  device_start - device-specific startup
393//-------------------------------------------------
394
395void polepos_sound_device::device_start()
396{
397   DEVICE_START_NAME( polepos_sound )(this);
398}
399
400//-------------------------------------------------
401//  device_reset - device-specific reset
402//-------------------------------------------------
403
404void polepos_sound_device::device_reset()
405{
406   DEVICE_RESET_NAME( polepos_sound )(this);
407}
408
409//-------------------------------------------------
410//  sound_stream_update - handle a stream update
411//-------------------------------------------------
412
413void polepos_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
414{
415   // should never get here
416   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
417}
418
419
trunk/src/mame/machine/taitoio.c
r17612r17613
7474   assert(device != NULL);
7575   assert(device->type() == TC0220IOC);
7676
77   return (tc0220ioc_state *)downcast<legacy_device_base *>(device)->token();
77   return (tc0220ioc_state *)downcast<tc0220ioc_device *>(device)->token();
7878}
7979
8080INLINE const tc0220ioc_interface *tc0220ioc_get_interface( device_t *device )
r17612r17613
231231   assert(device != NULL);
232232   assert(device->type() == TC0510NIO);
233233
234   return (tc0510nio_state *)downcast<legacy_device_base *>(device)->token();
234   return (tc0510nio_state *)downcast<tc0510nio_device *>(device)->token();
235235}
236236
237237INLINE const tc0510nio_interface *tc0510nio_get_interface( device_t *device )
r17612r17613
382382   assert(device != NULL);
383383   assert(device->type() == TC0640FIO);
384384
385   return (tc0640fio_state *)downcast<legacy_device_base *>(device)->token();
385   return (tc0640fio_state *)downcast<tc0640fio_device *>(device)->token();
386386}
387387
388388INLINE const tc0640fio_interface *tc0640fio_get_interface( device_t *device )
r17612r17613
574574}
575575
576576
577DEFINE_LEGACY_DEVICE(TC0220IOC, tc0220ioc);
578DEFINE_LEGACY_DEVICE(TC0510NIO, tc0510nio);
579DEFINE_LEGACY_DEVICE(TC0640FIO, tc0640fio);
577const device_type TC0220IOC = &device_creator<tc0220ioc_device>;
578
579tc0220ioc_device::tc0220ioc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
580   : device_t(mconfig, TC0220IOC, "Taito TC0220IOC", tag, owner, clock)
581{
582   m_token = global_alloc_array_clear(UINT8, sizeof(tc0220ioc_state));
583}
584
585//-------------------------------------------------
586//  device_config_complete - perform any
587//  operations now that the configuration is
588//  complete
589//-------------------------------------------------
590
591void tc0220ioc_device::device_config_complete()
592{
593}
594
595//-------------------------------------------------
596//  device_start - device-specific startup
597//-------------------------------------------------
598
599void tc0220ioc_device::device_start()
600{
601   DEVICE_START_NAME( tc0220ioc )(this);
602}
603
604//-------------------------------------------------
605//  device_reset - device-specific reset
606//-------------------------------------------------
607
608void tc0220ioc_device::device_reset()
609{
610   DEVICE_RESET_NAME( tc0220ioc )(this);
611}
612
613
614const device_type TC0510NIO = &device_creator<tc0510nio_device>;
615
616tc0510nio_device::tc0510nio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
617   : device_t(mconfig, TC0510NIO, "Taito TC0510NIO", tag, owner, clock)
618{
619   m_token = global_alloc_array_clear(UINT8, sizeof(tc0510nio_state));
620}
621
622//-------------------------------------------------
623//  device_config_complete - perform any
624//  operations now that the configuration is
625//  complete
626//-------------------------------------------------
627
628void tc0510nio_device::device_config_complete()
629{
630}
631
632//-------------------------------------------------
633//  device_start - device-specific startup
634//-------------------------------------------------
635
636void tc0510nio_device::device_start()
637{
638   DEVICE_START_NAME( tc0510nio )(this);
639}
640
641//-------------------------------------------------
642//  device_reset - device-specific reset
643//-------------------------------------------------
644
645void tc0510nio_device::device_reset()
646{
647   DEVICE_RESET_NAME( tc0510nio )(this);
648}
649
650
651const device_type TC0640FIO = &device_creator<tc0640fio_device>;
652
653tc0640fio_device::tc0640fio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
654   : device_t(mconfig, TC0640FIO, "Taito TC0640FIO", tag, owner, clock)
655{
656   m_token = global_alloc_array_clear(UINT8, sizeof(tc0640fio_state));
657}
658
659//-------------------------------------------------
660//  device_config_complete - perform any
661//  operations now that the configuration is
662//  complete
663//-------------------------------------------------
664
665void tc0640fio_device::device_config_complete()
666{
667}
668
669//-------------------------------------------------
670//  device_start - device-specific startup
671//-------------------------------------------------
672
673void tc0640fio_device::device_start()
674{
675   DEVICE_START_NAME( tc0640fio )(this);
676}
677
678//-------------------------------------------------
679//  device_reset - device-specific reset
680//-------------------------------------------------
681
682void tc0640fio_device::device_reset()
683{
684   DEVICE_RESET_NAME( tc0640fio )(this);
685}
686
687
trunk/src/mame/machine/taitoio.h
r17612r17613
4747   devcb_read8 read_7;
4848};
4949
50DECLARE_LEGACY_DEVICE(TC0220IOC, tc0220ioc);
51DECLARE_LEGACY_DEVICE(TC0510NIO, tc0510nio);
52DECLARE_LEGACY_DEVICE(TC0640FIO, tc0640fio);
50class tc0220ioc_device : public device_t
51{
52public:
53   tc0220ioc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
54   ~tc0220ioc_device() { global_free(m_token); }
5355
56   // access to legacy token
57   void *token() const { assert(m_token != NULL); return m_token; }
58protected:
59   // device-level overrides
60   virtual void device_config_complete();
61   virtual void device_start();
62   virtual void device_reset();
63private:
64   // internal state
65   void *m_token;
66};
67
68extern const device_type TC0220IOC;
69
70class tc0510nio_device : public device_t
71{
72public:
73   tc0510nio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
74   ~tc0510nio_device() { global_free(m_token); }
75
76   // access to legacy token
77   void *token() const { assert(m_token != NULL); return m_token; }
78protected:
79   // device-level overrides
80   virtual void device_config_complete();
81   virtual void device_start();
82   virtual void device_reset();
83private:
84   // internal state
85   void *m_token;
86};
87
88extern const device_type TC0510NIO;
89
90class tc0640fio_device : public device_t
91{
92public:
93   tc0640fio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
94   ~tc0640fio_device() { global_free(m_token); }
95
96   // access to legacy token
97   void *token() const { assert(m_token != NULL); return m_token; }
98protected:
99   // device-level overrides
100   virtual void device_config_complete();
101   virtual void device_start();
102   virtual void device_reset();
103private:
104   // internal state
105   void *m_token;
106};
107
108extern const device_type TC0640FIO;
109
110
54111/***************************************************************************
55112    DEVICE CONFIGURATION MACROS
56113***************************************************************************/
trunk/src/mame/machine/namco06.c
r17612r17613
110110   assert(device != NULL);
111111   assert(device->type() == NAMCO_06XX);
112112
113   return (namco_06xx_state *)downcast<legacy_device_base *>(device)->token();
113   return (namco_06xx_state *)downcast<namco_06xx_device *>(device)->token();
114114}
115115
116116
r17612r17613
309309 }
310310}
311311
312DEFINE_LEGACY_DEVICE(NAMCO_06XX, namco_06xx);
312const device_type NAMCO_06XX = &device_creator<namco_06xx_device>;
313
314namco_06xx_device::namco_06xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
315   : device_t(mconfig, NAMCO_06XX, "Namco 06xx", tag, owner, clock)
316{
317   m_token = global_alloc_array_clear(UINT8, sizeof(namco_06xx_state));
318}
319
320//-------------------------------------------------
321//  device_config_complete - perform any
322//  operations now that the configuration is
323//  complete
324//-------------------------------------------------
325
326void namco_06xx_device::device_config_complete()
327{
328   m_shortname = "namco06xx";
329}
330
331//-------------------------------------------------
332//  device_start - device-specific startup
333//-------------------------------------------------
334
335void namco_06xx_device::device_start()
336{
337   DEVICE_START_NAME( namco_06xx )(this);
338}
339
340//-------------------------------------------------
341//  device_reset - device-specific reset
342//-------------------------------------------------
343
344void namco_06xx_device::device_reset()
345{
346   DEVICE_RESET_NAME( namco_06xx )(this);
347}
348
349
trunk/src/mame/machine/namco06.h
r17612r17613
2727
2828
2929/* device get info callback */
30DECLARE_LEGACY_DEVICE(NAMCO_06XX, namco_06xx);
30class namco_06xx_device : public device_t
31{
32public:
33   namco_06xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
34   ~namco_06xx_device() { global_free(m_token); }
3135
36   // access to legacy token
37   void *token() const { assert(m_token != NULL); return m_token; }
38protected:
39   // device-level overrides
40   virtual void device_config_complete();
41   virtual void device_start();
42   virtual void device_reset();
43private:
44   // internal state
45   void *m_token;
46};
3247
48extern const device_type NAMCO_06XX;
49
50
51
3352#endif
trunk/src/mame/machine/namcoio.c
r17612r17613
144144   assert(device != NULL);
145145   assert(device->type() == NAMCO56XX || device->type() == NAMCO58XX || device->type() == NAMCO59XX);
146146
147   return (namcoio_state *)downcast<legacy_device_base *>(device)->token();
147   return (namcoio_state *)downcast<namcoio_device *>(device)->token();
148148}
149149
150150INLINE const namcoio_interface *get_interface( device_t *device )
r17612r17613
558558 }
559559}
560560
561DEFINE_LEGACY_DEVICE(NAMCO56XX, namcoio);
561const device_type NAMCO56XX = &device_creator<namcoio_device>;
562
563namcoio_device::namcoio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
564   : device_t(mconfig, NAMCO56XX, "Namco 56xx, 58xx & 59xx", tag, owner, clock)
565{
566   m_token = global_alloc_array_clear(UINT8, sizeof(namcoio_state));
567}
568
569//-------------------------------------------------
570//  device_config_complete - perform any
571//  operations now that the configuration is
572//  complete
573//-------------------------------------------------
574
575void namcoio_device::device_config_complete()
576{
577}
578
579//-------------------------------------------------
580//  device_start - device-specific startup
581//-------------------------------------------------
582
583void namcoio_device::device_start()
584{
585   DEVICE_START_NAME( namcoio )(this);
586}
587
588//-------------------------------------------------
589//  device_reset - device-specific reset
590//-------------------------------------------------
591
592void namcoio_device::device_reset()
593{
594   DEVICE_RESET_NAME( namcoio )(this);
595}
596
597
trunk/src/mame/machine/namcoio.h
r17612r17613
1616   device_t *device;
1717};
1818
19DECLARE_LEGACY_DEVICE(NAMCO56XX, namcoio);
19class namcoio_device : public device_t
20{
21public:
22   namcoio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
23   ~namcoio_device() { global_free(m_token); }
24
25   // access to legacy token
26   void *token() const { assert(m_token != NULL); return m_token; }
27protected:
28   // device-level overrides
29   virtual void device_config_complete();
30   virtual void device_start();
31   virtual void device_reset();
32private:
33   // internal state
34   void *m_token;
35};
36
37extern const device_type NAMCO56XX;
38
2039#define NAMCO58XX NAMCO56XX
2140#define NAMCO59XX NAMCO56XX
2241
trunk/src/mame/machine/nmk112.c
r17612r17613
3434   assert(device != NULL);
3535   assert(device->type() == NMK112);
3636
37   return (nmk112_state *)downcast<legacy_device_base *>(device)->token();
37   return (nmk112_state *)downcast<nmk112_device *>(device)->token();
3838}
3939
4040INLINE const nmk112_interface *get_interface( device_t *device )
r17612r17613
171171 }
172172}
173173
174DEFINE_LEGACY_DEVICE(NMK112, nmk112);
174const device_type NMK112 = &device_creator<nmk112_device>;
175
176nmk112_device::nmk112_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
177   : device_t(mconfig, NMK112, "NMK 112", tag, owner, clock)
178{
179   m_token = global_alloc_array_clear(UINT8, sizeof(nmk112_state));
180}
181
182//-------------------------------------------------
183//  device_config_complete - perform any
184//  operations now that the configuration is
185//  complete
186//-------------------------------------------------
187
188void nmk112_device::device_config_complete()
189{
190}
191
192//-------------------------------------------------
193//  device_start - device-specific startup
194//-------------------------------------------------
195
196void nmk112_device::device_start()
197{
198   DEVICE_START_NAME( nmk112 )(this);
199}
200
201//-------------------------------------------------
202//  device_reset - device-specific reset
203//-------------------------------------------------
204
205void nmk112_device::device_reset()
206{
207   DEVICE_RESET_NAME( nmk112 )(this);
208}
209
210
trunk/src/mame/machine/nmk112.h
r17612r17613
2020   UINT8 disable_page_mask;
2121};
2222
23DECLARE_LEGACY_DEVICE(NMK112, nmk112);
23class nmk112_device : public device_t
24{
25public:
26   nmk112_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
27   ~nmk112_device() { global_free(m_token); }
2428
29   // access to legacy token
30   void *token() const { assert(m_token != NULL); return m_token; }
31protected:
32   // device-level overrides
33   virtual void device_config_complete();
34   virtual void device_start();
35   virtual void device_reset();
36private:
37   // internal state
38   void *m_token;
39};
40
41extern const device_type NMK112;
42
43
2544/***************************************************************************
2645    DEVICE CONFIGURATION MACROS
2746***************************************************************************/
trunk/src/mame/machine/namco50.c
r17612r17613
149149   assert(device != NULL);
150150   assert(device->type() == NAMCO_50XX);
151151
152   return (namco_50xx_state *)downcast<legacy_device_base *>(device)->token();
152   return (namco_50xx_state *)downcast<namco_50xx_device *>(device)->token();
153153}
154154
155155
r17612r17613
314314 }
315315}
316316
317DEFINE_LEGACY_DEVICE(NAMCO_50XX, namco_50xx);
317const device_type NAMCO_50XX = &device_creator<namco_50xx_device>;
318
319namco_50xx_device::namco_50xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
320   : device_t(mconfig, NAMCO_50XX, "Namco 50xx", tag, owner, clock)
321{
322   m_token = global_alloc_array_clear(UINT8, sizeof(namco_50xx_state));
323}
324
325//-------------------------------------------------
326//  device_config_complete - perform any
327//  operations now that the configuration is
328//  complete
329//-------------------------------------------------
330
331void namco_50xx_device::device_config_complete()
332{
333   m_shortname = "namco50";
334}
335
336//-------------------------------------------------
337//  device_start - device-specific startup
338//-------------------------------------------------
339
340void namco_50xx_device::device_start()
341{
342   DEVICE_START_NAME( namco_50xx )(this);
343}
344
345//-------------------------------------------------
346//  device_mconfig_additions - return a pointer to
347//  the device's machine fragment
348//-------------------------------------------------
349
350machine_config_constructor namco_50xx_device::device_mconfig_additions() const
351{
352   return MACHINE_CONFIG_NAME( namco_50xx  );
353}
354
355//-------------------------------------------------
356//  device_rom_region - return a pointer to the
357//  the device's ROM definitions
358//-------------------------------------------------
359
360const rom_entry *namco_50xx_device::device_rom_region() const
361{
362   return ROM_NAME(namco_50xx );
363}
364
365
trunk/src/mame/machine/namco50.h
r17612r17613
1414
1515
1616/* device get info callback */
17DECLARE_LEGACY_DEVICE(NAMCO_50XX, namco_50xx);
17class namco_50xx_device : public device_t
18{
19public:
20   namco_50xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
21   ~namco_50xx_device() { global_free(m_token); }
1822
23   // access to legacy token
24   void *token() const { assert(m_token != NULL); return m_token; }
25protected:
26   // device-level overrides
27   virtual void device_config_complete();
28   virtual void device_start();
29   virtual const rom_entry *device_rom_region() const;
30   virtual machine_config_constructor device_mconfig_additions() const;
31private:
32   // internal state
33   void *m_token;
34};
1935
36extern const device_type NAMCO_50XX;
37
38
39
2040#endif   /* NAMCO50_H */
trunk/src/mame/machine/namco51.c
r17612r17613
9090   assert(device != NULL);
9191   assert(device->type() == NAMCO_51XX);
9292
93   return (namco_51xx_state *)downcast<legacy_device_base *>(device)->token();
93   return (namco_51xx_state *)downcast<namco_51xx_device *>(device)->token();
9494}
9595
9696
r17612r17613
465465 }
466466}
467467
468DEFINE_LEGACY_DEVICE(NAMCO_51XX, namco_51xx);
468const device_type NAMCO_51XX = &device_creator<namco_51xx_device>;
469
470namco_51xx_device::namco_51xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
471   : device_t(mconfig, NAMCO_51XX, "Namco 51xx", tag, owner, clock)
472{
473   m_token = global_alloc_array_clear(UINT8, sizeof(namco_51xx_state));
474}
475
476//-------------------------------------------------
477//  device_config_complete - perform any
478//  operations now that the configuration is
479//  complete
480//-------------------------------------------------
481
482void namco_51xx_device::device_config_complete()
483{
484   m_shortname = "namco51";
485}
486
487//-------------------------------------------------
488//  device_start - device-specific startup
489//-------------------------------------------------
490
491void namco_51xx_device::device_start()
492{
493   DEVICE_START_NAME( namco_51xx )(this);
494}
495
496//-------------------------------------------------
497//  device_reset - device-specific reset
498//-------------------------------------------------
499
500void namco_51xx_device::device_reset()
501{
502   DEVICE_RESET_NAME( namco_51xx )(this);
503}
504
505//-------------------------------------------------
506//  device_mconfig_additions - return a pointer to
507//  the device's machine fragment
508//-------------------------------------------------
509
510machine_config_constructor namco_51xx_device::device_mconfig_additions() const
511{
512   return MACHINE_CONFIG_NAME( namco_51xx  );
513}
514
515//-------------------------------------------------
516//  device_rom_region - return a pointer to the
517//  the device's ROM definitions
518//-------------------------------------------------
519
520const rom_entry *namco_51xx_device::device_rom_region() const
521{
522   return ROM_NAME(namco_51xx );
523}
524
525
trunk/src/mame/machine/namco51.h
r17612r17613
2121WRITE8_DEVICE_HANDLER( namco_51xx_write );
2222
2323
24DECLARE_LEGACY_DEVICE(NAMCO_51XX, namco_51xx);
24class namco_51xx_device : public device_t
25{
26public:
27   namco_51xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
28   ~namco_51xx_device() { global_free(m_token); }
2529
30   // access to legacy token
31   void *token() const { assert(m_token != NULL); return m_token; }
32protected:
33   // device-level overrides
34   virtual void device_config_complete();
35   virtual void device_start();
36   virtual void device_reset();
37   virtual const rom_entry *device_rom_region() const;
38   virtual machine_config_constructor device_mconfig_additions() const;
39private:
40   // internal state
41   void *m_token;
42};
2643
44extern const device_type NAMCO_51XX;
45
46
47
2748#endif   /* NAMCO51_H */
trunk/src/mame/machine/cd32.c
r17612r17613
8181   assert(device != NULL);
8282   assert(device->type() == AKIKO);
8383
84   return (akiko_state *)downcast<legacy_device_base *>(device)->token();
84   return (akiko_state *)downcast<akiko_device *>(device)->token();
8585}
8686
8787static DEVICE_STOP( akiko )
r17612r17613
933933 }
934934}
935935
936DEFINE_LEGACY_DEVICE(AKIKO, akiko);
936const device_type AKIKO = &device_creator<akiko_device>;
937
938akiko_device::akiko_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
939   : device_t(mconfig, AKIKO, "Akiko", tag, owner, clock)
940{
941   m_token = global_alloc_array_clear(UINT8, sizeof(akiko_state));
942}
943
944//-------------------------------------------------
945//  device_config_complete - perform any
946//  operations now that the configuration is
947//  complete
948//-------------------------------------------------
949
950void akiko_device::device_config_complete()
951{
952}
953
954//-------------------------------------------------
955//  device_start - device-specific startup
956//-------------------------------------------------
957
958void akiko_device::device_start()
959{
960   DEVICE_START_NAME( akiko )(this);
961}
962
963//-------------------------------------------------
964//  device_reset - device-specific reset
965//-------------------------------------------------
966
967void akiko_device::device_reset()
968{
969   DEVICE_RESET_NAME( akiko )(this);
970}
971
972//-------------------------------------------------
973//  device_stop - device-specific stop
974//-------------------------------------------------
975
976void akiko_device::device_stop()
977{
978   DEVICE_STOP_NAME( akiko )(this);
979}
980
981
trunk/src/mame/machine/gaelco3d.c
r17612r17613
208208{
209209   assert(device != NULL);
210210   assert(device->type() == GAELCO_SERIAL);
211   return (gaelco_serial_state *) downcast<legacy_device_base *>(device)->token();
211   return (gaelco_serial_state *) downcast<gaelco_serial_device *>(device)->token();
212212}
213213
214214INLINE const gaelco_serial_interface *get_interface(device_t *device)
215215{
216216   assert(device != NULL);
217217   assert(device->type() == GAELCO_SERIAL);
218   return (gaelco_serial_interface *) downcast<legacy_device_base *>(device)->static_config();
218   return (gaelco_serial_interface *) downcast<gaelco_serial_device *>(device)->static_config();
219219}
220220
221221INLINE void shmem_lock(shmem_t *shmem)
r17612r17613
520520}
521521
522522
523DEFINE_LEGACY_DEVICE(GAELCO_SERIAL, gaelco_serial);
523const device_type GAELCO_SERIAL = &device_creator<gaelco_serial_device>;
524
525gaelco_serial_device::gaelco_serial_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
526   : device_t(mconfig, GAELCO_SERIAL, "gaelco_serial", tag, owner, clock)
527{
528   m_token = global_alloc_array_clear(UINT8, sizeof(gaelco_serial_state));
529}
530
531//-------------------------------------------------
532//  device_config_complete - perform any
533//  operations now that the configuration is
534//  complete
535//-------------------------------------------------
536
537void gaelco_serial_device::device_config_complete()
538{
539}
540
541//-------------------------------------------------
542//  device_start - device-specific startup
543//-------------------------------------------------
544
545void gaelco_serial_device::device_start()
546{
547   DEVICE_START_NAME( gaelco_serial )(this);
548}
549
550//-------------------------------------------------
551//  device_reset - device-specific reset
552//-------------------------------------------------
553
554void gaelco_serial_device::device_reset()
555{
556   DEVICE_RESET_NAME( gaelco_serial )(this);
557}
558
559//-------------------------------------------------
560//  device_stop - device-specific stop
561//-------------------------------------------------
562
563void gaelco_serial_device::device_stop()
564{
565   DEVICE_STOP_NAME( gaelco_serial )(this);
566}
567
568
trunk/src/mame/machine/gaelco3d.h
r17612r17613
6868
6969/* ----- device interface ----- */
7070
71DECLARE_LEGACY_DEVICE(GAELCO_SERIAL, gaelco_serial);
71class gaelco_serial_device : public device_t
72{
73public:
74   gaelco_serial_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
75   ~gaelco_serial_device() { global_free(m_token); }
7276
77   // access to legacy token
78   void *token() const { assert(m_token != NULL); return m_token; }
79protected:
80   // device-level overrides
81   virtual void device_config_complete();
82   virtual void device_start();
83   virtual void device_stop();
84   virtual void device_reset();
85private:
86   // internal state
87   void *m_token;
88};
89
90extern const device_type GAELCO_SERIAL;
91
92
7393//DEVICE_GET_INFO( gaelco_serial );
trunk/src/mame/machine/decocass.c
r17612r17613
19661966   assert(device != NULL);
19671967   assert(device->type() == DECOCASS_TAPE);
19681968
1969   return (tape_state *)downcast<legacy_device_base *>(device)->token();
1969   return (tape_state *)downcast<decocass_tape_device *>(device)->token();
19701970}
19711971
19721972
r17612r17613
23052305}
23062306
23072307
2308DEFINE_LEGACY_DEVICE(DECOCASS_TAPE, decocass_tape);
2308const device_type DECOCASS_TAPE = &device_creator<decocass_tape_device>;
2309
2310decocass_tape_device::decocass_tape_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
2311   : device_t(mconfig, DECOCASS_TAPE, "DECO Cassette Tape", tag, owner, clock)
2312{
2313   m_token = global_alloc_array_clear(UINT8, sizeof(tape_state));
2314}
2315
2316//-------------------------------------------------
2317//  device_config_complete - perform any
2318//  operations now that the configuration is
2319//  complete
2320//-------------------------------------------------
2321
2322void decocass_tape_device::device_config_complete()
2323{
2324}
2325
2326//-------------------------------------------------
2327//  device_start - device-specific startup
2328//-------------------------------------------------
2329
2330void decocass_tape_device::device_start()
2331{
2332   DEVICE_START_NAME( decocass_tape )(this);
2333}
2334
2335//-------------------------------------------------
2336//  device_reset - device-specific reset
2337//-------------------------------------------------
2338
2339void decocass_tape_device::device_reset()
2340{
2341   DEVICE_RESET_NAME( decocass_tape )(this);
2342}
2343
2344
trunk/src/mame/machine/decocass.h
r17612r17613
88#define LOG(n,x)  do { if (LOGLEVEL >= n) logerror x; } while (0)
99
1010
11DECLARE_LEGACY_DEVICE(DECOCASS_TAPE, decocass_tape);
11class decocass_tape_device : public device_t
12{
13public:
14   decocass_tape_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
15   ~decocass_tape_device() { global_free(m_token); }
1216
17   // access to legacy token
18   void *token() const { assert(m_token != NULL); return m_token; }
19protected:
20   // device-level overrides
21   virtual void device_config_complete();
22   virtual void device_start();
23   virtual void device_reset();
24private:
25   // internal state
26   void *m_token;
27};
28
29extern const device_type DECOCASS_TAPE;
30
31
1332#define MCFG_DECOCASS_TAPE_ADD(_tag) \
1433   MCFG_DEVICE_ADD(_tag, DECOCASS_TAPE, 0)
1534
trunk/src/mame/machine/buggychl.c
r17612r17613
2727   assert(device != NULL);
2828   assert(device->type() == BUGGYCHL_MCU);
2929
30   return (buggychl_mcu_state *)downcast<legacy_device_base *>(device)->token();
30   return (buggychl_mcu_state *)downcast<buggychl_mcu_device *>(device)->token();
3131}
3232
3333/***************************************************************************
r17612r17613
254254 }
255255}
256256
257DEFINE_LEGACY_DEVICE(BUGGYCHL_MCU, buggychl_mcu);
257const device_type BUGGYCHL_MCU = &device_creator<buggychl_mcu_device>;
258
259buggychl_mcu_device::buggychl_mcu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
260   : device_t(mconfig, BUGGYCHL_MCU, "BuggyChl MCU", tag, owner, clock)
261{
262   m_token = global_alloc_array_clear(UINT8, sizeof(buggychl_mcu_state));
263}
264
265//-------------------------------------------------
266//  device_config_complete - perform any
267//  operations now that the configuration is
268//  complete
269//-------------------------------------------------
270
271void buggychl_mcu_device::device_config_complete()
272{
273}
274
275//-------------------------------------------------
276//  device_start - device-specific startup
277//-------------------------------------------------
278
279void buggychl_mcu_device::device_start()
280{
281   DEVICE_START_NAME( buggychl_mcu )(this);
282}
283
284//-------------------------------------------------
285//  device_reset - device-specific reset
286//-------------------------------------------------
287
288void buggychl_mcu_device::device_reset()
289{
290   DEVICE_RESET_NAME( buggychl_mcu )(this);
291}
292
293
trunk/src/mame/machine/namco53.c
r17612r17613
7676   assert(device != NULL);
7777   assert(device->type() == NAMCO_53XX);
7878
79   return (namco_53xx_state *)downcast<legacy_device_base *>(device)->token();
79   return (namco_53xx_state *)downcast<namco_53xx_device *>(device)->token();
8080}
8181
8282
r17612r17613
214214 }
215215}
216216
217DEFINE_LEGACY_DEVICE(NAMCO_53XX, namco_53xx);
217const device_type NAMCO_53XX = &device_creator<namco_53xx_device>;
218
219namco_53xx_device::namco_53xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
220   : device_t(mconfig, NAMCO_53XX, "Namco 53xx", tag, owner, clock)
221{
222   m_token = global_alloc_array_clear(UINT8, sizeof(namco_53xx_state));
223}
224
225//-------------------------------------------------
226//  device_config_complete - perform any
227//  operations now that the configuration is
228//  complete
229//-------------------------------------------------
230
231void namco_53xx_device::device_config_complete()
232{
233   m_shortname = "namco53";
234}
235
236//-------------------------------------------------
237//  device_start - device-specific startup
238//-------------------------------------------------
239
240void namco_53xx_device::device_start()
241{
242   DEVICE_START_NAME( namco_53xx )(this);
243}
244
245//-------------------------------------------------
246//  device_mconfig_additions - return a pointer to
247//  the device's machine fragment
248//-------------------------------------------------
249
250machine_config_constructor namco_53xx_device::device_mconfig_additions() const
251{
252   return MACHINE_CONFIG_NAME( namco_53xx  );
253}
254
255//-------------------------------------------------
256//  device_rom_region - return a pointer to the
257//  the device's ROM definitions
258//-------------------------------------------------
259
260const rom_entry *namco_53xx_device::device_rom_region() const
261{
262   return ROM_NAME(namco_53xx );
263}
264
265
trunk/src/mame/machine/buggychl.h
r17612r17613
44READ8_DEVICE_HANDLER( buggychl_mcu_r );
55READ8_DEVICE_HANDLER( buggychl_mcu_status_r );
66
7DECLARE_LEGACY_DEVICE(BUGGYCHL_MCU, buggychl_mcu);
7class buggychl_mcu_device : public device_t
8{
9public:
10   buggychl_mcu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
11   ~buggychl_mcu_device() { global_free(m_token); }
12
13   // access to legacy token
14   void *token() const { assert(m_token != NULL); return m_token; }
15protected:
16   // device-level overrides
17   virtual void device_config_complete();
18   virtual void device_start();
19   virtual void device_reset();
20private:
21   // internal state
22   void *m_token;
23};
24
25extern const device_type BUGGYCHL_MCU;
26
trunk/src/mame/machine/namco53.h
r17612r17613
2222READ8_DEVICE_HANDLER( namco_53xx_read );
2323
2424
25DECLARE_LEGACY_DEVICE(NAMCO_53XX, namco_53xx);
25class namco_53xx_device : public device_t
26{
27public:
28   namco_53xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
29   ~namco_53xx_device() { global_free(m_token); }
2630
31   // access to legacy token
32   void *token() const { assert(m_token != NULL); return m_token; }
33protected:
34   // device-level overrides
35   virtual void device_config_complete();
36   virtual void device_start();
37   virtual const rom_entry *device_rom_region() const;
38   virtual machine_config_constructor device_mconfig_additions() const;
39private:
40   // internal state
41   void *m_token;
42};
2743
44extern const device_type NAMCO_53XX;
45
46
47
2848#endif   /* NAMCO53_H */
trunk/src/mame/machine/namco62.c
r17612r17613
2929   assert(device != NULL);
3030   assert(device->type() == NAMCO_62XX);
3131
32   return (namco_62xx_state *)downcast<legacy_device_base *>(device)->token();
32   return (namco_62xx_state *)downcast<namco_62xx_device *>(device)->token();
3333}
3434
3535
r17612r17613
107107 }
108108}
109109
110DEFINE_LEGACY_DEVICE(NAMCO_62XX, namco_62xx);
110const device_type NAMCO_62XX = &device_creator<namco_62xx_device>;
111
112namco_62xx_device::namco_62xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
113   : device_t(mconfig, NAMCO_62XX, "Namco 62xx", tag, owner, clock)
114{
115   m_token = global_alloc_array_clear(UINT8, sizeof(namco_62xx_state));
116}
117
118//-------------------------------------------------
119//  device_config_complete - perform any
120//  operations now that the configuration is
121//  complete
122//-------------------------------------------------
123
124void namco_62xx_device::device_config_complete()
125{
126   m_shortname = "namco62";
127}
128
129//-------------------------------------------------
130//  device_start - device-specific startup
131//-------------------------------------------------
132
133void namco_62xx_device::device_start()
134{
135   DEVICE_START_NAME( namco_62xx )(this);
136}
137
138//-------------------------------------------------
139//  device_mconfig_additions - return a pointer to
140//  the device's machine fragment
141//-------------------------------------------------
142
143machine_config_constructor namco_62xx_device::device_mconfig_additions() const
144{
145   return MACHINE_CONFIG_NAME( namco_62xx  );
146}
147
148//-------------------------------------------------
149//  device_rom_region - return a pointer to the
150//  the device's ROM definitions
151//-------------------------------------------------
152
153const rom_entry *namco_62xx_device::device_rom_region() const
154{
155   return ROM_NAME(namco_62xx );
156}
157
158
trunk/src/mame/machine/namco62.h
r17612r17613
2121WRITE8_DEVICE_HANDLER( namco_62xx_write );
2222
2323
24DECLARE_LEGACY_DEVICE(NAMCO_62XX, namco_62xx);
24class namco_62xx_device : public device_t
25{
26public:
27   namco_62xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
28   ~namco_62xx_device() { global_free(m_token); }
2529
30   // access to legacy token
31   void *token() const { assert(m_token != NULL); return m_token; }
32protected:
33   // device-level overrides
34   virtual void device_config_complete();
35   virtual void device_start();
36   virtual const rom_entry *device_rom_region() const;
37   virtual machine_config_constructor device_mconfig_additions() const;
38private:
39   // internal state
40   void *m_token;
41};
2642
43extern const device_type NAMCO_62XX;
44
45
46
2747#endif   /* NAMCO62_H */
trunk/src/mame/machine/mathbox.c
r17612r17613
5555{
5656   assert(device != NULL);
5757   assert(device->type() == MATHBOX);
58   return (mathbox_state *)downcast<legacy_device_base *>(device)->token();
58   return (mathbox_state *)downcast<mathbox_device *>(device)->token();
5959}
6060
6161
r17612r17613
360360}
361361
362362
363DEFINE_LEGACY_DEVICE(MATHBOX, mathbox);
363const device_type MATHBOX = &device_creator<mathbox_device>;
364
365mathbox_device::mathbox_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
366   : device_t(mconfig, MATHBOX, "MATHBOX", tag, owner, clock)
367{
368   m_token = global_alloc_array_clear(UINT8, sizeof(mathbox_state));
369}
370
371//-------------------------------------------------
372//  device_config_complete - perform any
373//  operations now that the configuration is
374//  complete
375//-------------------------------------------------
376
377void mathbox_device::device_config_complete()
378{
379}
380
381//-------------------------------------------------
382//  device_start - device-specific startup
383//-------------------------------------------------
384
385void mathbox_device::device_start()
386{
387   DEVICE_START_NAME( mathbox )(this);
388}
389
390//-------------------------------------------------
391//  device_reset - device-specific reset
392//-------------------------------------------------
393
394void mathbox_device::device_reset()
395{
396   DEVICE_RESET_NAME( mathbox )(this);
397}
398
399
trunk/src/mame/machine/mathbox.h
r17612r17613
2626READ8_DEVICE_HANDLER( mathbox_hi_r );
2727
2828/* ----- device interface ----- */
29DECLARE_LEGACY_DEVICE(MATHBOX, mathbox);
29class mathbox_device : public device_t
30{
31public:
32   mathbox_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
33   ~mathbox_device() { global_free(m_token); }
34
35   // access to legacy token
36   void *token() const { assert(m_token != NULL); return m_token; }
37protected:
38   // device-level overrides
39   virtual void device_config_complete();
40   virtual void device_start();
41   virtual void device_reset();
42private:
43   // internal state
44   void *m_token;
45};
46
47extern const device_type MATHBOX;
48
trunk/src/mame/includes/bzone.h
r17612r17613
3737
3838WRITE8_DEVICE_HANDLER( redbaron_sounds_w );
3939
40DECLARE_LEGACY_SOUND_DEVICE(REDBARON, redbaron_sound);
40class redbaron_sound_device : public device_t,
41                                  public device_sound_interface
42{
43public:
44   redbaron_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
45   ~redbaron_sound_device() { global_free(m_token); }
46
47   // access to legacy token
48   void *token() const { assert(m_token != NULL); return m_token; }
49protected:
50   // device-level overrides
51   virtual void device_config_complete();
52   virtual void device_start();
53
54   // sound stream update overrides
55   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
56private:
57   // internal state
58   void *m_token;
59};
60
61extern const device_type REDBARON;
62
trunk/src/mame/includes/amiga.h
r17612r17613
466466
467467/*----------- defined in audio/amiga.c -----------*/
468468
469DECLARE_LEGACY_SOUND_DEVICE(AMIGA, amiga_sound);
469class amiga_sound_device : public device_t,
470                                  public device_sound_interface
471{
472public:
473   amiga_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
474   ~amiga_sound_device() { global_free(m_token); }
470475
476   // access to legacy token
477   void *token() const { assert(m_token != NULL); return m_token; }
478protected:
479   // device-level overrides
480   virtual void device_config_complete();
481   virtual void device_start();
482
483   // sound stream update overrides
484   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
485private:
486   // internal state
487   void *m_token;
488};
489
490extern const device_type AMIGA;
491
492
471493void amiga_audio_update(device_t *device);
472494void amiga_audio_data_w(device_t *device, int which, UINT16 data);
473495
trunk/src/mame/includes/beezer.h
r17612r17613
2727
2828/*----------- defined in audio/beezer.c -----------*/
2929
30DECLARE_LEGACY_SOUND_DEVICE(BEEZER, beezer_sound);
30class beezer_sound_device : public device_t,
31                                  public device_sound_interface
32{
33public:
34   beezer_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
35   ~beezer_sound_device() { global_free(m_token); }
3136
37   // access to legacy token
38   void *token() const { assert(m_token != NULL); return m_token; }
39protected:
40   // device-level overrides
41   virtual void device_config_complete();
42   virtual void device_start();
43   virtual void device_reset();
44
45   // sound stream update overrides
46   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
47private:
48   // internal state
49   void *m_token;
50};
51
52extern const device_type BEEZER;
53
54
3255READ8_DEVICE_HANDLER( beezer_sh6840_r );
3356WRITE8_DEVICE_HANDLER( beezer_sh6840_w );
3457WRITE8_DEVICE_HANDLER( beezer_sfxctrl_w );
trunk/src/mame/includes/polepos.h
r17612r17613
7979
8080/*----------- defined in audio/polepos.c -----------*/
8181
82DECLARE_LEGACY_SOUND_DEVICE(POLEPOS, polepos_sound);
82class polepos_sound_device : public device_t,
83                                  public device_sound_interface
84{
85public:
86   polepos_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
87   ~polepos_sound_device() { global_free(m_token); }
8388
89   // access to legacy token
90   void *token() const { assert(m_token != NULL); return m_token; }
91protected:
92   // device-level overrides
93   virtual void device_config_complete();
94   virtual void device_start();
95   virtual void device_reset();
96
97   // sound stream update overrides
98   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
99private:
100   // internal state
101   void *m_token;
102};
103
104extern const device_type POLEPOS;
105
106
84107WRITE8_DEVICE_HANDLER( polepos_engine_sound_lsb_w );
85108WRITE8_DEVICE_HANDLER( polepos_engine_sound_msb_w );
86109
trunk/src/mame/includes/leland.h
r17612r17613
188188
189189/*----------- defined in audio/leland.c -----------*/
190190
191DECLARE_LEGACY_SOUND_DEVICE(LELAND, leland_sound);
192DECLARE_LEGACY_SOUND_DEVICE(LELAND_80186, leland_80186_sound);
193DECLARE_LEGACY_SOUND_DEVICE(REDLINE_80186, redline_80186_sound);
191class leland_sound_device : public device_t,
192                                  public device_sound_interface
193{
194public:
195   leland_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
196   leland_sound_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
197   ~leland_sound_device() { global_free(m_token); }
194198
199   // access to legacy token
200   void *token() const { assert(m_token != NULL); return m_token; }
201protected:
202   // device-level overrides
203   virtual void device_config_complete();
204   virtual void device_start();
205
206   // sound stream update overrides
207   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
208private:
209   // internal state
210   void *m_token;
211};
212
213extern const device_type LELAND;
214
215class leland_80186_sound_device : public leland_sound_device
216{
217public:
218   leland_80186_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
219   leland_80186_sound_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
220protected:
221   // device-level overrides
222   virtual void device_config_complete();
223   virtual void device_start();
224   virtual void device_reset();
225
226   // sound stream update overrides
227   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
228private:
229   // internal state
230};
231
232extern const device_type LELAND_80186;
233
234class redline_80186_sound_device : public leland_80186_sound_device
235{
236public:
237   redline_80186_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
238protected:
239   // device-level overrides
240   virtual void device_config_complete();
241   virtual void device_start();
242
243   // sound stream update overrides
244   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
245private:
246   // internal state
247};
248
249extern const device_type REDLINE_80186;
250
251
195252void leland_dac_update(device_t *device, int dacnum, UINT8 sample);
196253
197254READ8_DEVICE_HANDLER( leland_80186_response_r );
trunk/src/mame/includes/tiamc1.h
r17612r17613
3333
3434/*----------- defined in audio/tiamc1.c -----------*/
3535
36DECLARE_LEGACY_SOUND_DEVICE(TIAMC1, tiamc1_sound);
36class tiamc1_sound_device : public device_t,
37                                  public device_sound_interface
38{
39public:
40   tiamc1_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
41   ~tiamc1_sound_device() { global_free(m_token); }
3742
43   // access to legacy token
44   void *token() const { assert(m_token != NULL); return m_token; }
45protected:
46   // device-level overrides
47   virtual void device_config_complete();
48   virtual void device_start();
49
50   // sound stream update overrides
51   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
52private:
53   // internal state
54   void *m_token;
55};
56
57extern const device_type TIAMC1;
58
59
3860WRITE8_DEVICE_HANDLER( tiamc1_timer0_w );
3961WRITE8_DEVICE_HANDLER( tiamc1_timer1_w );
4062WRITE8_DEVICE_HANDLER( tiamc1_timer1_gate_w );
trunk/src/mame/includes/cps3.h
r17612r17613
108108
109109/*----------- defined in audio/cps3.c -----------*/
110110
111DECLARE_LEGACY_SOUND_DEVICE(CPS3, cps3_sound);
111class cps3_sound_device : public device_t,
112                                  public device_sound_interface
113{
114public:
115   cps3_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
116   ~cps3_sound_device() { global_free(m_token); }
112117
118   // access to legacy token
119   void *token() const { assert(m_token != NULL); return m_token; }
120protected:
121   // device-level overrides
122   virtual void device_config_complete();
123   virtual void device_start();
124
125   // sound stream update overrides
126   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
127private:
128   // internal state
129   void *m_token;
130};
131
132extern const device_type CPS3;
133
134
113135WRITE32_DEVICE_HANDLER( cps3_sound_w );
114136READ32_DEVICE_HANDLER( cps3_sound_r );
trunk/src/mame/includes/warpwarp.h
r17612r17613
5454
5555WRITE8_DEVICE_HANDLER( geebee_sound_w );
5656
57DECLARE_LEGACY_SOUND_DEVICE(GEEBEE, geebee_sound);
57class geebee_sound_device : public device_t,
58                                  public device_sound_interface
59{
60public:
61   geebee_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
62   ~geebee_sound_device() { global_free(m_token); }
5863
64   // access to legacy token
65   void *token() const { assert(m_token != NULL); return m_token; }
66protected:
67   // device-level overrides
68   virtual void device_config_complete();
69   virtual void device_start();
5970
71   // sound stream update overrides
72   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
73private:
74   // internal state
75   void *m_token;
76};
77
78extern const device_type GEEBEE;
79
80
81
6082/*----------- defined in audio/warpwarp.c -----------*/
6183
6284WRITE8_DEVICE_HANDLER( warpwarp_sound_w );
6385WRITE8_DEVICE_HANDLER( warpwarp_music1_w );
6486WRITE8_DEVICE_HANDLER( warpwarp_music2_w );
6587
66DECLARE_LEGACY_SOUND_DEVICE(WARPWARP, warpwarp_sound);
88class warpwarp_sound_device : public device_t,
89                                  public device_sound_interface
90{
91public:
92   warpwarp_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
93   ~warpwarp_sound_device() { global_free(m_token); }
94
95   // access to legacy token
96   void *token() const { assert(m_token != NULL); return m_token; }
97protected:
98   // device-level overrides
99   virtual void device_config_complete();
100   virtual void device_start();
101
102   // sound stream update overrides
103   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
104private:
105   // internal state
106   void *m_token;
107};
108
109extern const device_type WARPWARP;
110
trunk/src/mame/includes/gridlee.h
r17612r17613
5858
5959WRITE8_DEVICE_HANDLER( gridlee_sound_w );
6060
61DECLARE_LEGACY_SOUND_DEVICE(GRIDLEE, gridlee_sound);
61class gridlee_sound_device : public device_t,
62                                  public device_sound_interface
63{
64public:
65   gridlee_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
66   ~gridlee_sound_device() { global_free(m_token); }
6267
68   // access to legacy token
69   void *token() const { assert(m_token != NULL); return m_token; }
70protected:
71   // device-level overrides
72   virtual void device_config_complete();
73   virtual void device_start();
6374
75   // sound stream update overrides
76   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
77private:
78   // internal state
79   void *m_token;
80};
81
82extern const device_type GRIDLEE;
83
84
85
6486/*----------- defined in video/gridlee.c -----------*/
6587
6688/* video driver data & functions */
trunk/src/mame/includes/flower.h
r17612r17613
4343WRITE8_DEVICE_HANDLER( flower_sound1_w );
4444WRITE8_DEVICE_HANDLER( flower_sound2_w );
4545
46DECLARE_LEGACY_SOUND_DEVICE(FLOWER, flower_sound);
46class flower_sound_device : public device_t,
47                                  public device_sound_interface
48{
49public:
50   flower_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
51   ~flower_sound_device() { global_free(m_token); }
4752
53   // access to legacy token
54   void *token() const { assert(m_token != NULL); return m_token; }
55protected:
56   // device-level overrides
57   virtual void device_config_complete();
58   virtual void device_start();
59   virtual void device_reset();
4860
61   // sound stream update overrides
62   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
63private:
64   // internal state
65   void *m_token;
66};
67
68extern const device_type FLOWER;
69
70
71
4972/*----------- defined in video/flower.c -----------*/
5073
5174
trunk/src/mame/includes/snk6502.h
r17612r17613
7070extern WRITE8_HANDLER( fantasy_sound_w );
7171extern WRITE8_HANDLER( fantasy_speech_w );
7272
73DECLARE_LEGACY_SOUND_DEVICE(SNK6502, snk6502_sound);
73class snk6502_sound_device : public device_t,
74                                  public device_sound_interface
75{
76public:
77   snk6502_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
78   ~snk6502_sound_device() { global_free(m_token); }
7479
80   // access to legacy token
81   void *token() const { assert(m_token != NULL); return m_token; }
82protected:
83   // device-level overrides
84   virtual void device_config_complete();
85   virtual void device_start();
86
87   // sound stream update overrides
88   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
89private:
90   // internal state
91   void *m_token;
92};
93
94extern const device_type SNK6502;
95
96
7597void snk6502_set_music_clock(running_machine &machine, double clock_time);
7698void snk6502_set_music_freq(running_machine &machine, int freq);
7799int snk6502_music0_playing(running_machine &machine);
trunk/src/mame/includes/tx1.h
r17612r17613
178178WRITE8_DEVICE_HANDLER( bb_ym2_a_w );
179179WRITE8_DEVICE_HANDLER( bb_ym2_b_w );
180180
181DECLARE_LEGACY_SOUND_DEVICE(BUGGYBOY, buggyboy_sound);
181class buggyboy_sound_device : public device_t,
182                                  public device_sound_interface
183{
184public:
185   buggyboy_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
186   ~buggyboy_sound_device() { global_free(m_token); }
182187
188   // access to legacy token
189   void *token() const { assert(m_token != NULL); return m_token; }
190protected:
191   // device-level overrides
192   virtual void device_config_complete();
193   virtual void device_start();
194   virtual void device_reset();
195
196   // sound stream update overrides
197   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
198private:
199   // internal state
200   void *m_token;
201};
202
203extern const device_type BUGGYBOY;
204
205
183206WRITE8_DEVICE_HANDLER( tx1_ay8910_a_w );
184207WRITE8_DEVICE_HANDLER( tx1_ay8910_b_w );
185208
186DECLARE_LEGACY_SOUND_DEVICE(TX1, tx1_sound);
209class tx1_sound_device : public device_t,
210                                  public device_sound_interface
211{
212public:
213   tx1_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
214   ~tx1_sound_device() { global_free(m_token); }
187215
216   // access to legacy token
217   void *token() const { assert(m_token != NULL); return m_token; }
218protected:
219   // device-level overrides
220   virtual void device_config_complete();
221   virtual void device_start();
222   virtual void device_reset();
188223
224   // sound stream update overrides
225   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
226private:
227   // internal state
228   void *m_token;
229};
230
231extern const device_type TX1;
232
233
234
189235/*----------- defined in video/tx1.c -----------*/
190236
191237PALETTE_INIT( tx1 );
trunk/src/mame/includes/cd32.h
r17612r17613
4646READ32_DEVICE_HANDLER( amiga_akiko32_r );
4747WRITE32_DEVICE_HANDLER( amiga_akiko32_w );
4848
49DECLARE_LEGACY_DEVICE(AKIKO, akiko);
49class akiko_device : public device_t
50{
51public:
52   akiko_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
53   ~akiko_device() { global_free(m_token); }
5054
55   // access to legacy token
56   void *token() const { assert(m_token != NULL); return m_token; }
57protected:
58   // device-level overrides
59   virtual void device_config_complete();
60   virtual void device_start();
61   virtual void device_stop();
62   virtual void device_reset();
63private:
64   // internal state
65   void *m_token;
66};
67
68extern const device_type AKIKO;
69
70
5171#endif /* __CUBOCD32_H__ */
trunk/src/mame/includes/micro3d.h
r17612r17613
135135
136136void micro3d_noise_sh_w(running_machine &machine, UINT8 data);
137137
138DECLARE_LEGACY_SOUND_DEVICE(MICRO3D, micro3d_sound);
138class micro3d_sound_device : public device_t,
139                                  public device_sound_interface
140{
141public:
142   micro3d_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
143   ~micro3d_sound_device() { global_free(m_token); }
139144
145   // access to legacy token
146   void *token() const { assert(m_token != NULL); return m_token; }
147protected:
148   // device-level overrides
149   virtual void device_config_complete();
150   virtual void device_start();
151   virtual void device_reset();
140152
153   // sound stream update overrides
154   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
155private:
156   // internal state
157   void *m_token;
158};
159
160extern const device_type MICRO3D;
161
162
163
141164/*----------- defined in video/micro3d.c -----------*/
142165
143166VIDEO_START( micro3d );
trunk/src/mame/includes/phoenix.h
r17612r17613
5151WRITE8_DEVICE_HANDLER( phoenix_sound_control_a_w );
5252WRITE8_DEVICE_HANDLER( phoenix_sound_control_b_w );
5353
54DECLARE_LEGACY_SOUND_DEVICE(PHOENIX, phoenix_sound);
54class phoenix_sound_device : public device_t,
55                                  public device_sound_interface
56{
57public:
58   phoenix_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
59   ~phoenix_sound_device() { global_free(m_token); }
5560
61   // access to legacy token
62   void *token() const { assert(m_token != NULL); return m_token; }
63protected:
64   // device-level overrides
65   virtual void device_config_complete();
66   virtual void device_start();
5667
68   // sound stream update overrides
69   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
70private:
71   // internal state
72   void *m_token;
73};
74
75extern const device_type PHOENIX;
76
77
78
5779/*----------- defined in video/phoenix.c -----------*/
5880
5981PALETTE_INIT( phoenix );
trunk/src/mame/includes/gomoku.h
r17612r17613
3030WRITE8_DEVICE_HANDLER( gomoku_sound1_w );
3131WRITE8_DEVICE_HANDLER( gomoku_sound2_w );
3232
33DECLARE_LEGACY_SOUND_DEVICE(GOMOKU, gomoku_sound);
33class gomoku_sound_device : public device_t,
34                                  public device_sound_interface
35{
36public:
37   gomoku_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
38   ~gomoku_sound_device() { global_free(m_token); }
3439
40   // access to legacy token
41   void *token() const { assert(m_token != NULL); return m_token; }
42protected:
43   // device-level overrides
44   virtual void device_config_complete();
45   virtual void device_start();
3546
47   // sound stream update overrides
48   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
49private:
50   // internal state
51   void *m_token;
52};
53
54extern const device_type GOMOKU;
55
56
57
3658/*----------- defined in video/gomoku.c -----------*/
3759
3860PALETTE_INIT( gomoku );
trunk/src/mame/video/taitoic.c
r17612r17613
572572   assert(device != NULL);
573573   assert(device->type() == PC080SN);
574574
575   return (pc080sn_state *)downcast<legacy_device_base *>(device)->token();
575   return (pc080sn_state *)downcast<pc080sn_device *>(device)->token();
576576}
577577
578578INLINE const pc080sn_interface *pc080sn_get_interface( device_t *device )
r17612r17613
10641064   assert(device != NULL);
10651065   assert(device->type() == PC090OJ);
10661066
1067   return (pc090oj_state *)downcast<legacy_device_base *>(device)->token();
1067   return (pc090oj_state *)downcast<pc090oj_device *>(device)->token();
10681068}
10691069
10701070INLINE const pc090oj_interface *pc090oj_get_interface( device_t *device )
r17612r17613
12721272   assert(device != NULL);
12731273   assert(device->type() == TC0080VCO);
12741274
1275   return (tc0080vco_state *)downcast<legacy_device_base *>(device)->token();
1275   return (tc0080vco_state *)downcast<tc0080vco_device *>(device)->token();
12761276}
12771277
12781278INLINE const tc0080vco_interface *tc0080vco_get_interface( device_t *device )
r17612r17613
19551955   assert(device != NULL);
19561956   assert(device->type() == TC0100SCN);
19571957
1958   return (tc0100scn_state *)downcast<legacy_device_base *>(device)->token();
1958   return (tc0100scn_state *)downcast<tc0100scn_device *>(device)->token();
19591959}
19601960
19611961INLINE const tc0100scn_interface *tc0100scn_get_interface( device_t *device )
r17612r17613
25592559   assert(device != NULL);
25602560   assert((device->type() == TC0280GRD) || (device->type() == TC0430GRW));
25612561
2562   return (tc0280grd_state *)downcast<legacy_device_base *>(device)->token();
2562   return (tc0280grd_state *)downcast<tc0280grd_device *>(device)->token();
25632563}
25642564
25652565INLINE const tc0280grd_interface *tc0280grd_get_interface( device_t *device )
r17612r17613
27292729   assert(device != NULL);
27302730   assert(device->type() == TC0360PRI);
27312731
2732   return (tc0360pri_state *)downcast<legacy_device_base *>(device)->token();
2732   return (tc0360pri_state *)downcast<tc0360pri_device *>(device)->token();
27332733}
27342734
27352735/*****************************************************************************
r17612r17613
28212821   assert(device != NULL);
28222822   assert(device->type() == TC0480SCP);
28232823
2824   return (tc0480scp_state *)downcast<legacy_device_base *>(device)->token();
2824   return (tc0480scp_state *)downcast<tc0480scp_device *>(device)->token();
28252825}
28262826
28272827INLINE const tc0480scp_interface *tc0480scp_get_interface( device_t *device )
r17612r17613
37623762   assert(device != NULL);
37633763   assert(device->type() == TC0150ROD);
37643764
3765   return (tc0150rod_state *)downcast<legacy_device_base *>(device)->token();
3765   return (tc0150rod_state *)downcast<tc0150rod_device *>(device)->token();
37663766}
37673767
37683768INLINE const tc0150rod_interface *tc0150rod_get_interface( device_t *device )
r17612r17613
45744574   assert(device != NULL);
45754575   assert(device->type() == TC0110PCR);
45764576
4577   return (tc0110pcr_state *)downcast<legacy_device_base *>(device)->token();
4577   return (tc0110pcr_state *)downcast<tc0110pcr_device *>(device)->token();
45784578}
45794579
45804580INLINE const tc0110pcr_interface *tc0110pcr_get_interface( device_t *device )
r17612r17613
48054805   assert(device != NULL);
48064806   assert(device->type() == TC0180VCU);
48074807
4808   return (tc0180vcu_state *)downcast<legacy_device_base *>(device)->token();
4808   return (tc0180vcu_state *)downcast<tc0180vcu_device *>(device)->token();
48094809}
48104810
48114811INLINE const tc0180vcu_interface *tc0180vcu_get_interface( device_t *device )
r17612r17613
53405340}
53415341
53425342
5343DEFINE_LEGACY_DEVICE(PC080SN, pc080sn);
5344DEFINE_LEGACY_DEVICE(PC090OJ, pc090oj);
5345DEFINE_LEGACY_DEVICE(TC0080VCO, tc0080vco);
5346DEFINE_LEGACY_DEVICE(TC0100SCN, tc0100scn);
5347DEFINE_LEGACY_DEVICE(TC0280GRD, tc0280grd);
5348DEFINE_LEGACY_DEVICE(TC0360PRI, tc0360pri);
5349DEFINE_LEGACY_DEVICE(TC0480SCP, tc0480scp);
5350DEFINE_LEGACY_DEVICE(TC0150ROD, tc0150rod);
5351DEFINE_LEGACY_DEVICE(TC0110PCR, tc0110pcr);
5352DEFINE_LEGACY_DEVICE(TC0180VCU, tc0180vcu);
5343const device_type PC080SN = &device_creator<pc080sn_device>;
5344
5345pc080sn_device::pc080sn_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
5346   : device_t(mconfig, PC080SN, "Taito PC080SN", tag, owner, clock)
5347{
5348   m_token = global_alloc_array_clear(UINT8, sizeof(pc080sn_state));
5349}
5350
5351//-------------------------------------------------
5352//  device_config_complete - perform any
5353//  operations now that the configuration is
5354//  complete
5355//-------------------------------------------------
5356
5357void pc080sn_device::device_config_complete()
5358{
5359}
5360
5361//-------------------------------------------------
5362//  device_start - device-specific startup
5363//-------------------------------------------------
5364
5365void pc080sn_device::device_start()
5366{
5367   DEVICE_START_NAME( pc080sn )(this);
5368}
5369
5370
5371const device_type PC090OJ = &device_creator<pc090oj_device>;
5372
5373pc090oj_device::pc090oj_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
5374   : device_t(mconfig, PC090OJ, "Taito PC090OJ", tag, owner, clock)
5375{
5376   m_token = global_alloc_array_clear(UINT8, sizeof(pc090oj_state));
5377}
5378
5379//-------------------------------------------------
5380//  device_config_complete - perform any
5381//  operations now that the configuration is
5382//  complete
5383//-------------------------------------------------
5384
5385void pc090oj_device::device_config_complete()
5386{
5387}
5388
5389//-------------------------------------------------
5390//  device_start - device-specific startup
5391//-------------------------------------------------
5392
5393void pc090oj_device::device_start()
5394{
5395   DEVICE_START_NAME( pc090oj )(this);
5396}
5397
5398//-------------------------------------------------
5399//  device_reset - device-specific reset
5400//-------------------------------------------------
5401
5402void pc090oj_device::device_reset()
5403{
5404   DEVICE_RESET_NAME( pc090oj )(this);
5405}
5406
5407
5408const device_type TC0080VCO = &device_creator<tc0080vco_device>;
5409
5410tc0080vco_device::tc0080vco_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
5411   : device_t(mconfig, TC0080VCO, "Taito TC0080VCO", tag, owner, clock)
5412{
5413   m_token = global_alloc_array_clear(UINT8, sizeof(tc0080vco_state));
5414}
5415
5416//-------------------------------------------------
5417//  device_config_complete - perform any
5418//  operations now that the configuration is
5419//  complete
5420//-------------------------------------------------
5421
5422void tc0080vco_device::device_config_complete()
5423{
5424}
5425
5426//-------------------------------------------------
5427//  device_start - device-specific startup
5428//-------------------------------------------------
5429
5430void tc0080vco_device::device_start()
5431{
5432   DEVICE_START_NAME( tc0080vco )(this);
5433}
5434
5435
5436const device_type TC0100SCN = &device_creator<tc0100scn_device>;
5437
5438tc0100scn_device::tc0100scn_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
5439   : device_t(mconfig, TC0100SCN, "Taito TC0100SCN", tag, owner, clock)
5440{
5441   m_token = global_alloc_array_clear(UINT8, sizeof(tc0100scn_state));
5442}
5443
5444//-------------------------------------------------
5445//  device_config_complete - perform any
5446//  operations now that the configuration is
5447//  complete
5448//-------------------------------------------------
5449
5450void tc0100scn_device::device_config_complete()
5451{
5452}
5453
5454//-------------------------------------------------
5455//  device_start - device-specific startup
5456//-------------------------------------------------
5457
5458void tc0100scn_device::device_start()
5459{
5460   DEVICE_START_NAME( tc0100scn )(this);
5461}
5462
5463//-------------------------------------------------
5464//  device_reset - device-specific reset
5465//-------------------------------------------------
5466
5467void tc0100scn_device::device_reset()
5468{
5469   DEVICE_RESET_NAME( tc0100scn )(this);
5470}
5471
5472
5473const device_type TC0280GRD = &device_creator<tc0280grd_device>;
5474
5475tc0280grd_device::tc0280grd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
5476   : device_t(mconfig, TC0280GRD, "Taito TC0280GRD & TC0430GRW", tag, owner, clock)
5477{
5478   m_token = global_alloc_array_clear(UINT8, sizeof(tc0280grd_state));
5479}
5480
5481//-------------------------------------------------
5482//  device_config_complete - perform any
5483//  operations now that the configuration is
5484//  complete
5485//-------------------------------------------------
5486
5487void tc0280grd_device::device_config_complete()
5488{
5489}
5490
5491//-------------------------------------------------
5492//  device_start - device-specific startup
5493//-------------------------------------------------
5494
5495void tc0280grd_device::device_start()
5496{
5497   DEVICE_START_NAME( tc0280grd )(this);
5498}
5499
5500//-------------------------------------------------
5501//  device_reset - device-specific reset
5502//-------------------------------------------------
5503
5504void tc0280grd_device::device_reset()
5505{
5506   DEVICE_RESET_NAME( tc0280grd )(this);
5507}
5508
5509
5510const device_type TC0360PRI = &device_creator<tc0360pri_device>;
5511
5512tc0360pri_device::tc0360pri_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
5513   : device_t(mconfig, TC0360PRI, "Taito TC0360PRI", tag, owner, clock)
5514{
5515   m_token = global_alloc_array_clear(UINT8, sizeof(tc0360pri_state));
5516}
5517
5518//-------------------------------------------------
5519//  device_config_complete - perform any
5520//  operations now that the configuration is
5521//  complete
5522//-------------------------------------------------
5523
5524void tc0360pri_device::device_config_complete()
5525{
5526}
5527
5528//-------------------------------------------------
5529//  device_start - device-specific startup
5530//-------------------------------------------------
5531
5532void tc0360pri_device::device_start()
5533{
5534   DEVICE_START_NAME( tc0360pri )(this);
5535}
5536
5537//-------------------------------------------------
5538//  device_reset - device-specific reset
5539//-------------------------------------------------
5540
5541void tc0360pri_device::device_reset()
5542{
5543   DEVICE_RESET_NAME( tc0360pri )(this);
5544}
5545
5546
5547const device_type TC0480SCP = &device_creator<tc0480scp_device>;
5548
5549tc0480scp_device::tc0480scp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
5550   : device_t(mconfig, TC0480SCP, "Taito TC0480SCP", tag, owner, clock)
5551{
5552   m_token = global_alloc_array_clear(UINT8, sizeof(tc0480scp_state));
5553}
5554
5555//-------------------------------------------------
5556//  device_config_complete - perform any
5557//  operations now that the configuration is
5558//  complete
5559//-------------------------------------------------
5560
5561void tc0480scp_device::device_config_complete()
5562{
5563}
5564
5565//-------------------------------------------------
5566//  device_start - device-specific startup
5567//-------------------------------------------------
5568
5569void tc0480scp_device::device_start()
5570{
5571   DEVICE_START_NAME( tc0480scp )(this);
5572}
5573
5574//-------------------------------------------------
5575//  device_reset - device-specific reset
5576//-------------------------------------------------
5577
5578void tc0480scp_device::device_reset()
5579{
5580   DEVICE_RESET_NAME( tc0480scp )(this);
5581}
5582
5583
5584const device_type TC0150ROD = &device_creator<tc0150rod_device>;
5585
5586tc0150rod_device::tc0150rod_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
5587   : device_t(mconfig, TC0150ROD, "Taito TC0150ROD", tag, owner, clock)
5588{
5589   m_token = global_alloc_array_clear(UINT8, sizeof(tc0150rod_state));
5590}
5591
5592//-------------------------------------------------
5593//  device_config_complete - perform any
5594//  operations now that the configuration is
5595//  complete
5596//-------------------------------------------------
5597
5598void tc0150rod_device::device_config_complete()
5599{
5600}
5601
5602//-------------------------------------------------
5603//  device_start - device-specific startup
5604//-------------------------------------------------
5605
5606void tc0150rod_device::device_start()
5607{
5608   DEVICE_START_NAME( tc0150rod )(this);
5609}
5610
5611
5612const device_type TC0110PCR = &device_creator<tc0110pcr_device>;
5613
5614tc0110pcr_device::tc0110pcr_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
5615   : device_t(mconfig, TC0110PCR, "Taito TC0110PCR", tag, owner, clock)
5616{
5617   m_token = global_alloc_array_clear(UINT8, sizeof(tc0110pcr_state));
5618}
5619
5620//-------------------------------------------------
5621//  device_config_complete - perform any
5622//  operations now that the configuration is
5623//  complete
5624//-------------------------------------------------
5625
5626void tc0110pcr_device::device_config_complete()
5627{
5628}
5629
5630//-------------------------------------------------
5631//  device_start - device-specific startup
5632//-------------------------------------------------
5633
5634void tc0110pcr_device::device_start()
5635{
5636   DEVICE_START_NAME( tc0110pcr )(this);
5637}
5638
5639//-------------------------------------------------
5640//  device_reset - device-specific reset
5641//-------------------------------------------------
5642
5643void tc0110pcr_device::device_reset()
5644{
5645   DEVICE_RESET_NAME( tc0110pcr )(this);
5646}
5647
5648
5649const device_type TC0180VCU = &device_creator<tc0180vcu_device>;
5650
5651tc0180vcu_device::tc0180vcu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
5652   : device_t(mconfig, TC0180VCU, "Taito TC0180VCU", tag, owner, clock)
5653{
5654   m_token = global_alloc_array_clear(UINT8, sizeof(tc0180vcu_state));
5655}
5656
5657//-------------------------------------------------
5658//  device_config_complete - perform any
5659//  operations now that the configuration is
5660//  complete
5661//-------------------------------------------------
5662
5663void tc0180vcu_device::device_config_complete()
5664{
5665}
5666
5667//-------------------------------------------------
5668//  device_start - device-specific startup
5669//-------------------------------------------------
5670
5671void tc0180vcu_device::device_start()
5672{
5673   DEVICE_START_NAME( tc0180vcu )(this);
5674}
5675
5676//-------------------------------------------------
5677//  device_reset - device-specific reset
5678//-------------------------------------------------
5679
5680void tc0180vcu_device::device_reset()
5681{
5682   DEVICE_RESET_NAME( tc0180vcu )(this);
5683}
5684
5685
trunk/src/mame/video/taitoic.h
r17612r17613
106106   int            tx_color_base;
107107};
108108
109DECLARE_LEGACY_DEVICE(PC080SN, pc080sn);
110DECLARE_LEGACY_DEVICE(PC090OJ, pc090oj);
111DECLARE_LEGACY_DEVICE(TC0080VCO, tc0080vco);
112DECLARE_LEGACY_DEVICE(TC0100SCN, tc0100scn);
113DECLARE_LEGACY_DEVICE(TC0280GRD, tc0280grd);
109class pc080sn_device : public device_t
110{
111public:
112   pc080sn_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
113   ~pc080sn_device() { global_free(m_token); }
114
115   // access to legacy token
116   void *token() const { assert(m_token != NULL); return m_token; }
117protected:
118   // device-level overrides
119   virtual void device_config_complete();
120   virtual void device_start();
121private:
122   // internal state
123   void *m_token;
124};
125
126extern const device_type PC080SN;
127
128class pc090oj_device : public device_t
129{
130public:
131   pc090oj_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
132   ~pc090oj_device() { global_free(m_token); }
133
134   // access to legacy token
135   void *token() const { assert(m_token != NULL); return m_token; }
136protected:
137   // device-level overrides
138   virtual void device_config_complete();
139   virtual void device_start();
140   virtual void device_reset();
141private:
142   // internal state
143   void *m_token;
144};
145
146extern const device_type PC090OJ;
147
148class tc0080vco_device : public device_t
149{
150public:
151   tc0080vco_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
152   ~tc0080vco_device() { global_free(m_token); }
153
154   // access to legacy token
155   void *token() const { assert(m_token != NULL); return m_token; }
156protected:
157   // device-level overrides
158   virtual void device_config_complete();
159   virtual void device_start();
160private:
161   // internal state
162   void *m_token;
163};
164
165extern const device_type TC0080VCO;
166
167class tc0100scn_device : public device_t
168{
169public:
170   tc0100scn_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
171   ~tc0100scn_device() { global_free(m_token); }
172
173   // access to legacy token
174   void *token() const { assert(m_token != NULL); return m_token; }
175protected:
176   // device-level overrides
177   virtual void device_config_complete();
178   virtual void device_start();
179   virtual void device_reset();
180private:
181   // internal state
182   void *m_token;
183};
184
185extern const device_type TC0100SCN;
186
187class tc0280grd_device : public device_t
188{
189public:
190   tc0280grd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
191   ~tc0280grd_device() { global_free(m_token); }
192
193   // access to legacy token
194   void *token() const { assert(m_token != NULL); return m_token; }
195protected:
196   // device-level overrides
197   virtual void device_config_complete();
198   virtual void device_start();
199   virtual void device_reset();
200private:
201   // internal state
202   void *m_token;
203};
204
205extern const device_type TC0280GRD;
206
114207#define TC0430GRW TC0280GRD
115DECLARE_LEGACY_DEVICE(TC0360PRI, tc0360pri);
116DECLARE_LEGACY_DEVICE(TC0480SCP, tc0480scp);
117DECLARE_LEGACY_DEVICE(TC0150ROD, tc0150rod);
118DECLARE_LEGACY_DEVICE(TC0110PCR, tc0110pcr);
119DECLARE_LEGACY_DEVICE(TC0180VCU, tc0180vcu);
208class tc0360pri_device : public device_t
209{
210public:
211   tc0360pri_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
212   ~tc0360pri_device() { global_free(m_token); }
120213
214   // access to legacy token
215   void *token() const { assert(m_token != NULL); return m_token; }
216protected:
217   // device-level overrides
218   virtual void device_config_complete();
219   virtual void device_start();
220   virtual void device_reset();
221private:
222   // internal state
223   void *m_token;
224};
225
226extern const device_type TC0360PRI;
227
228class tc0480scp_device : public device_t
229{
230public:
231   tc0480scp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
232   ~tc0480scp_device() { global_free(m_token); }
233
234   // access to legacy token
235   void *token() const { assert(m_token != NULL); return m_token; }
236protected:
237   // device-level overrides
238   virtual void device_config_complete();
239   virtual void device_start();
240   virtual void device_reset();
241private:
242   // internal state
243   void *m_token;
244};
245
246extern const device_type TC0480SCP;
247
248class tc0150rod_device : public device_t
249{
250public:
251   tc0150rod_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
252   ~tc0150rod_device() { global_free(m_token); }
253
254   // access to legacy token
255   void *token() const { assert(m_token != NULL); return m_token; }
256protected:
257   // device-level overrides
258   virtual void device_config_complete();
259   virtual void device_start();
260private:
261   // internal state
262   void *m_token;
263};
264
265extern const device_type TC0150ROD;
266
267class tc0110pcr_device : public device_t
268{
269public:
270   tc0110pcr_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
271   ~tc0110pcr_device() { global_free(m_token); }
272
273   // access to legacy token
274   void *token() const { assert(m_token != NULL); return m_token; }
275protected:
276   // device-level overrides
277   virtual void device_config_complete();
278   virtual void device_start();
279   virtual void device_reset();
280private:
281   // internal state
282   void *m_token;
283};
284
285extern const device_type TC0110PCR;
286
287class tc0180vcu_device : public device_t
288{
289public:
290   tc0180vcu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
291   ~tc0180vcu_device() { global_free(m_token); }
292
293   // access to legacy token
294   void *token() const { assert(m_token != NULL); return m_token; }
295protected:
296   // device-level overrides
297   virtual void device_config_complete();
298   virtual void device_start();
299   virtual void device_reset();
300private:
301   // internal state
302   void *m_token;
303};
304
305extern const device_type TC0180VCU;
306
307
121308/***************************************************************************
122309    DEVICE CONFIGURATION MACROS
123310***************************************************************************/
trunk/src/mame/video/atarirle.c
r17612r17613
151151   assert(device != NULL);
152152   assert(device->type() == ATARIRLE);
153153
154   return (atarirle_data *)downcast<legacy_device_base *>(device)->token();
154   return (atarirle_data *)downcast<atarirle_device *>(device)->token();
155155}
156156
157157
r17612r17613
390390   }
391391}
392392
393DEFINE_LEGACY_DEVICE(ATARIRLE, atarirle);
393const device_type ATARIRLE = &device_creator<atarirle_device>;
394394
395atarirle_device::atarirle_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
396   : device_t(mconfig, ATARIRLE, "Atari RLE", tag, owner, clock)
397{
398   m_token = global_alloc_array_clear(UINT8, sizeof(atarirle_data));
399}
400
401//-------------------------------------------------
402//  device_config_complete - perform any
403//  operations now that the configuration is
404//  complete
405//-------------------------------------------------
406
407void atarirle_device::device_config_complete()
408{
409}
410
411//-------------------------------------------------
412//  device_start - device-specific startup
413//-------------------------------------------------
414
415void atarirle_device::device_start()
416{
417   DEVICE_START_NAME( atarirle )(this);
418}
419
420
421
395422/*---------------------------------------------------------------
396423    atarirle_control_w: Write handler for MO control bits.
397424---------------------------------------------------------------*/
trunk/src/mame/video/atarirle.h
r17612r17613
7070    FUNCTION PROTOTYPES
7171***************************************************************************/
7272
73DECLARE_LEGACY_DEVICE(ATARIRLE, atarirle);
73class atarirle_device : public device_t
74{
75public:
76   atarirle_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
77   ~atarirle_device() { global_free(m_token); }
78
79   // access to legacy token
80   void *token() const { assert(m_token != NULL); return m_token; }
81protected:
82   // device-level overrides
83   virtual void device_config_complete();
84   virtual void device_start();
85private:
86   // internal state
87   void *m_token;
88};
89
90extern const device_type ATARIRLE;
91
7492#define MCFG_ATARIRLE_ADD(_tag, _interface) \
7593   MCFG_DEVICE_ADD(_tag, ATARIRLE, 0) \
7694   MCFG_DEVICE_CONFIG(_interface)
trunk/src/mame/video/deco16ic.c
r17612r17613
201201   assert(device != NULL);
202202   assert(device->type() == DECO16IC);
203203
204   return (deco16ic_state *)downcast<legacy_device_base *>(device)->token();
204   return (deco16ic_state *)downcast<deco16ic_device *>(device)->token();
205205}
206206
207207INLINE const deco16ic_interface *get_interface( device_t *device )
r17612r17613
10101010}
10111011
10121012
1013DEFINE_LEGACY_DEVICE(DECO16IC, deco16ic);
1013const device_type DECO16IC = &device_creator<deco16ic_device>;
1014
1015deco16ic_device::deco16ic_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1016   : device_t(mconfig, DECO16IC, "Data East IC 55 / 56 / 74 / 141", tag, owner, clock)
1017{
1018   m_token = global_alloc_array_clear(UINT8, sizeof(deco16ic_state));
1019}
1020
1021//-------------------------------------------------
1022//  device_config_complete - perform any
1023//  operations now that the configuration is
1024//  complete
1025//-------------------------------------------------
1026
1027void deco16ic_device::device_config_complete()
1028{
1029}
1030
1031//-------------------------------------------------
1032//  device_start - device-specific startup
1033//-------------------------------------------------
1034
1035void deco16ic_device::device_start()
1036{
1037   DEVICE_START_NAME( deco16ic )(this);
1038}
1039
1040//-------------------------------------------------
1041//  device_reset - device-specific reset
1042//-------------------------------------------------
1043
1044void deco16ic_device::device_reset()
1045{
1046   DEVICE_RESET_NAME( deco16ic )(this);
1047}
1048
1049
trunk/src/mame/video/deco16ic.h
r17612r17613
3535   int               _8x8_gfxregion, _16x16_gfxregion;
3636};
3737
38DECLARE_LEGACY_DEVICE(DECO16IC, deco16ic);
38class deco16ic_device : public device_t
39{
40public:
41   deco16ic_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
42   ~deco16ic_device() { global_free(m_token); }
3943
44   // access to legacy token
45   void *token() const { assert(m_token != NULL); return m_token; }
46protected:
47   // device-level overrides
48   virtual void device_config_complete();
49   virtual void device_start();
50   virtual void device_reset();
51private:
52   // internal state
53   void *m_token;
54};
4055
56extern const device_type DECO16IC;
57
58
59
4160/***************************************************************************
4261    DEVICE CONFIGURATION MACROS
4362***************************************************************************/
trunk/src/mame/video/decocomn.c
r17612r17613
2626   assert(device != NULL);
2727   assert(device->type() == DECOCOMN);
2828
29   return (decocomn_state *)downcast<legacy_device_base *>(device)->token();
29   return (decocomn_state *)downcast<decocomn_device *>(device)->token();
3030}
3131
3232INLINE const decocomn_interface *get_interface( device_t *device )
r17612r17613
162162}
163163
164164
165DEFINE_LEGACY_DEVICE(DECOCOMN, decocomn);
165const device_type DECOCOMN = &device_creator<decocomn_device>;
166
167decocomn_device::decocomn_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
168   : device_t(mconfig, DECOCOMN, "Data East Common Video Functions", tag, owner, clock)
169{
170   m_token = global_alloc_array_clear(UINT8, sizeof(decocomn_state));
171}
172
173//-------------------------------------------------
174//  device_config_complete - perform any
175//  operations now that the configuration is
176//  complete
177//-------------------------------------------------
178
179void decocomn_device::device_config_complete()
180{
181}
182
183//-------------------------------------------------
184//  device_start - device-specific startup
185//-------------------------------------------------
186
187void decocomn_device::device_start()
188{
189   DEVICE_START_NAME( decocomn )(this);
190}
191
192//-------------------------------------------------
193//  device_reset - device-specific reset
194//-------------------------------------------------
195
196void decocomn_device::device_reset()
197{
198   DEVICE_RESET_NAME( decocomn )(this);
199}
200
201
trunk/src/mame/video/decocomn.h
r17612r17613
2222   const char         *screen;
2323};
2424
25DECLARE_LEGACY_DEVICE(DECOCOMN, decocomn);
25class decocomn_device : public device_t
26{
27public:
28   decocomn_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
29   ~decocomn_device() { global_free(m_token); }
2630
31   // access to legacy token
32   void *token() const { assert(m_token != NULL); return m_token; }
33protected:
34   // device-level overrides
35   virtual void device_config_complete();
36   virtual void device_start();
37   virtual void device_reset();
38private:
39   // internal state
40   void *m_token;
41};
2742
43extern const device_type DECOCOMN;
44
45
46
2847/***************************************************************************
2948    DEVICE CONFIGURATION MACROS
3049***************************************************************************/
trunk/src/mame/video/vrender0.c
r17612r17613
9595   assert(device != NULL);
9696   assert(device->type() == VIDEO_VRENDER0);
9797
98   return (vr0video_state *)downcast<legacy_device_base *>(device)->token();
98   return (vr0video_state *)downcast<vr0video_device *>(device)->token();
9999}
100100
101101INLINE const vr0video_interface *get_interface( device_t *device )
r17612r17613
614614  case DEVINFO_STR_NAME: strcpy(info->s, "VRender0"); break;
615615 }
616616}
617DEFINE_LEGACY_DEVICE(VIDEO_VRENDER0, vr0video);
617const device_type VIDEO_VRENDER0 = &device_creator<vr0video_device>;
618
619vr0video_device::vr0video_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
620   : device_t(mconfig, VIDEO_VRENDER0, "VRender0", tag, owner, clock)
621{
622   m_token = global_alloc_array_clear(UINT8, sizeof(vr0video_state));
623}
624
625//-------------------------------------------------
626//  device_config_complete - perform any
627//  operations now that the configuration is
628//  complete
629//-------------------------------------------------
630
631void vr0video_device::device_config_complete()
632{
633}
634
635//-------------------------------------------------
636//  device_start - device-specific startup
637//-------------------------------------------------
638
639void vr0video_device::device_start()
640{
641   DEVICE_START_NAME( vr0video )(this);
642}
643
644//-------------------------------------------------
645//  device_reset - device-specific reset
646//-------------------------------------------------
647
648void vr0video_device::device_reset()
649{
650   DEVICE_RESET_NAME( vr0video )(this);
651}
652
653
trunk/src/mame/video/vrender0.h
r17612r17613
1717 DEVICE CONFIGURATION MACROS
1818 ***************************************************************************/
1919
20DECLARE_LEGACY_DEVICE(VIDEO_VRENDER0, vr0video);
20class vr0video_device : public device_t
21{
22public:
23   vr0video_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
24   ~vr0video_device() { global_free(m_token); }
2125
26   // access to legacy token
27   void *token() const { assert(m_token != NULL); return m_token; }
28protected:
29   // device-level overrides
30   virtual void device_config_complete();
31   virtual void device_start();
32   virtual void device_reset();
33private:
34   // internal state
35   void *m_token;
36};
37
38extern const device_type VIDEO_VRENDER0;
39
40
2241#define MCFG_VIDEO_VRENDER0_ADD(_tag, _interface) \
2342MCFG_DEVICE_ADD(_tag, VIDEO_VRENDER0, 0) \
2443MCFG_DEVICE_CONFIG(_interface)
trunk/src/mame/video/kan_pand.c
r17612r17613
7171   assert(device != NULL);
7272   assert(device->type() == KANEKO_PANDORA);
7373
74   return (kaneko_pandora_state *)downcast<legacy_device_base *>(device)->token();
74   return (kaneko_pandora_state *)downcast<kaneko_pandora_device *>(device)->token();
7575}
7676
7777INLINE const kaneko_pandora_interface *get_interface( device_t *device )
r17612r17613
339339 }
340340}
341341
342DEFINE_LEGACY_DEVICE(KANEKO_PANDORA, kaneko_pandora);
342const device_type KANEKO_PANDORA = &device_creator<kaneko_pandora_device>;
343
344kaneko_pandora_device::kaneko_pandora_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
345   : device_t(mconfig, KANEKO_PANDORA, "Kaneko Pandora - PX79C480FP-3", tag, owner, clock)
346{
347   m_token = global_alloc_array_clear(UINT8, sizeof(kaneko_pandora_state));
348}
349
350//-------------------------------------------------
351//  device_config_complete - perform any
352//  operations now that the configuration is
353//  complete
354//-------------------------------------------------
355
356void kaneko_pandora_device::device_config_complete()
357{
358}
359
360//-------------------------------------------------
361//  device_start - device-specific startup
362//-------------------------------------------------
363
364void kaneko_pandora_device::device_start()
365{
366   DEVICE_START_NAME( kaneko_pandora )(this);
367}
368
369//-------------------------------------------------
370//  device_reset - device-specific reset
371//-------------------------------------------------
372
373void kaneko_pandora_device::device_reset()
374{
375   DEVICE_RESET_NAME( kaneko_pandora )(this);
376}
377
378
trunk/src/mame/video/kan_pand.h
r17612r17613
2424   int        y;
2525};
2626
27DECLARE_LEGACY_DEVICE(KANEKO_PANDORA, kaneko_pandora);
27class kaneko_pandora_device : public device_t
28{
29public:
30   kaneko_pandora_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
31   ~kaneko_pandora_device() { global_free(m_token); }
2832
33   // access to legacy token
34   void *token() const { assert(m_token != NULL); return m_token; }
35protected:
36   // device-level overrides
37   virtual void device_config_complete();
38   virtual void device_start();
39   virtual void device_reset();
40private:
41   // internal state
42   void *m_token;
43};
44
45extern const device_type KANEKO_PANDORA;
46
47
2948/***************************************************************************
3049    DEVICE CONFIGURATION MACROS
3150***************************************************************************/
trunk/src/mame/video/konicdev.c
r17612r17613
13491349   assert(device != NULL);
13501350   assert(device->type() == K007121);
13511351
1352   return (k007121_state *)downcast<legacy_device_base *>(device)->token();
1352   return (k007121_state *)downcast<k007121_device *>(device)->token();
13531353}
13541354
13551355/*****************************************************************************
r17612r17613
16121612   assert(device != NULL);
16131613   assert(device->type() == K007342);
16141614
1615   return (k007342_state *)downcast<legacy_device_base *>(device)->token();
1615   return (k007342_state *)downcast<k007342_device *>(device)->token();
16161616}
16171617
16181618INLINE const k007342_interface *k007342_get_interface( device_t *device )
r17612r17613
18961896   assert(device != NULL);
18971897   assert(device->type() == K007420);
18981898
1899   return (k007420_state *)downcast<legacy_device_base *>(device)->token();
1899   return (k007420_state *)downcast<k007420_device *>(device)->token();
19001900}
19011901
19021902INLINE const k007420_interface *k007420_get_interface( device_t *device )
r17612r17613
21732173   assert(device != NULL);
21742174   assert(device->type() == K052109);
21752175
2176   return (k052109_state *)downcast<legacy_device_base *>(device)->token();
2176   return (k052109_state *)downcast<k052109_device *>(device)->token();
21772177}
21782178
21792179INLINE const k052109_interface *k052109_get_interface( device_t *device )
r17612r17613
28072807   assert(device != NULL);
28082808   assert(device->type() == K051960);
28092809
2810   return (k051960_state *)downcast<legacy_device_base *>(device)->token();
2810   return (k051960_state *)downcast<k051960_device *>(device)->token();
28112811}
28122812
28132813INLINE const k051960_interface *k051960_get_interface( device_t *device )
r17612r17613
33493349   assert(device != NULL);
33503350   assert((device->type() == K053244 || device->type() == K053245));
33513351
3352   return (k05324x_state *)downcast<legacy_device_base *>(device)->token();
3352   return (k05324x_state *)downcast<k05324x_device *>(device)->token();
33533353}
33543354
33553355INLINE const k05324x_interface *k05324x_get_interface( device_t *device )
r17612r17613
41394139   assert(device != NULL);
41404140   assert((device->type() == K053246 || device->type() == K053247 || device->type() == K055673));
41414141
4142   return (k053247_state *)downcast<legacy_device_base *>(device)->token();
4142   return (k053247_state *)downcast<k053247_device *>(device)->token();
41434143}
41444144
41454145INLINE const k053247_interface *k053247_get_interface( device_t *device )
r17612r17613
51375137   assert(device != NULL);
51385138   assert(device->type() == K051316);
51395139
5140   return (k051316_state *)downcast<legacy_device_base *>(device)->token();
5140   return (k051316_state *)downcast<k051316_device *>(device)->token();
51415141}
51425142
51435143INLINE const k051316_interface *k051316_get_interface( device_t *device )
r17612r17613
54255425   assert(device != NULL);
54265426   assert(device->type() == K053936);
54275427
5428   return (k053936_state *)downcast<legacy_device_base *>(device)->token();
5428   return (k053936_state *)downcast<k053936_device *>(device)->token();
54295429}
54305430
54315431INLINE const k053936_interface *k053936_get_interface( device_t *device )
r17612r17613
56505650   assert(device != NULL);
56515651   assert(device->type() == K053251);
56525652
5653   return (k053251_state *)downcast<legacy_device_base *>(device)->token();
5653   return (k053251_state *)downcast<k053251_device *>(device)->token();
56545654}
56555655
56565656/*****************************************************************************
r17612r17613
58015801   assert(device != NULL);
58025802   assert(device->type() == K054000);
58035803
5804   return (k054000_state *)downcast<legacy_device_base *>(device)->token();
5804   return (k054000_state *)downcast<k054000_device *>(device)->token();
58055805}
58065806
58075807/*****************************************************************************
r17612r17613
59135913   assert(device != NULL);
59145914   assert(device->type() == K051733);
59155915
5916   return (k051733_state *)downcast<legacy_device_base *>(device)->token();
5916   return (k051733_state *)downcast<k051733_device *>(device)->token();
59175917}
59185918
59195919/*****************************************************************************
r17612r17613
61196119   assert(device != NULL);
61206120   assert(device->type() == K056832);
61216121
6122   return (k056832_state *)downcast<legacy_device_base *>(device)->token();
6122   return (k056832_state *)downcast<k056832_device *>(device)->token();
61236123}
61246124
61256125INLINE const k056832_interface *k056832_get_interface( device_t *device )
r17612r17613
80328032   assert(device != NULL);
80338033   assert(device->type() == K055555);
80348034
8035   return (k055555_state *)downcast<legacy_device_base *>(device)->token();
8035   return (k055555_state *)downcast<k055555_device *>(device)->token();
80368036}
80378037
80388038/*****************************************************************************
r17612r17613
81598159   assert(device != NULL);
81608160   assert(device->type() == K054338);
81618161
8162   return (k054338_state *)downcast<legacy_device_base *>(device)->token();
8162   return (k054338_state *)downcast<k054338_device *>(device)->token();
81638163}
81648164
81658165INLINE const k054338_interface *k054338_get_interface( device_t *device )
r17612r17613
84718471   assert(device != NULL);
84728472   assert(device->type() == K001006);
84738473
8474   return (k001006_state *)downcast<legacy_device_base *>(device)->token();
8474   return (k001006_state *)downcast<k001006_device *>(device)->token();
84758475}
84768476
84778477INLINE const k001006_interface *k001006_get_interface( device_t *device )
r17612r17613
86818681   assert(device != NULL);
86828682   assert(device->type() == K001005);
86838683
8684   return (k001005_state *)downcast<legacy_device_base *>(device)->token();
8684   return (k001005_state *)downcast<k001005_device *>(device)->token();
86858685}
86868686
86878687INLINE const k001005_interface *k001005_get_interface( device_t *device )
r17612r17613
95749574   assert(device != NULL);
95759575   assert(device->type() == K001604);
95769576
9577   return (k001604_state *)downcast<legacy_device_base *>(device)->token();
9577   return (k001604_state *)downcast<k001604_device *>(device)->token();
95789578}
95799579
95809580INLINE const k001604_interface *k001604_get_interface( device_t *device )
r17612r17613
99879987   assert(device != NULL);
99889988   assert(device->type() == K037122);
99899989
9990   return (k037122_state *)downcast<legacy_device_base *>(device)->token();
9990   return (k037122_state *)downcast<k037122_device *>(device)->token();
99919991}
99929992
99939993INLINE const k037122_interface *k037122_get_interface( device_t *device )
r17612r17613
1071010710}
1071110711
1071210712
10713DEFINE_LEGACY_DEVICE(K007121, k007121);
10714DEFINE_LEGACY_DEVICE(K007342, k007342);
10715DEFINE_LEGACY_DEVICE(K007420, k007420);
10716DEFINE_LEGACY_DEVICE(K052109, k052109);
10717DEFINE_LEGACY_DEVICE(K051960, k051960);
10718DEFINE_LEGACY_DEVICE(K053244, k05324x);
10719DEFINE_LEGACY_DEVICE(K053246, k053247);
10720DEFINE_LEGACY_DEVICE(K055673, k055673);
10721DEFINE_LEGACY_DEVICE(K051316, k051316);
10722DEFINE_LEGACY_DEVICE(K053936, k053936);
10723DEFINE_LEGACY_DEVICE(K053251, k053251);
10724DEFINE_LEGACY_DEVICE(K054000, k054000);
10725DEFINE_LEGACY_DEVICE(K051733, k051733);
10726DEFINE_LEGACY_DEVICE(K056832, k056832);
10727DEFINE_LEGACY_DEVICE(K055555, k055555);
10728DEFINE_LEGACY_DEVICE(K054338, k054338);
10729DEFINE_LEGACY_DEVICE(K001006, k001006);
10730DEFINE_LEGACY_DEVICE(K001005, k001005);
10731DEFINE_LEGACY_DEVICE(K001604, k001604);
10732DEFINE_LEGACY_DEVICE(K037122, k037122);
10713const device_type K007121 = &device_creator<k007121_device>;
10714
10715k007121_device::k007121_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
10716   : device_t(mconfig, K007121, "Konami 007121", tag, owner, clock)
10717{
10718   m_token = global_alloc_array_clear(UINT8, sizeof(k007121_state));
10719}
10720
10721//-------------------------------------------------
10722//  device_config_complete - perform any
10723//  operations now that the configuration is
10724//  complete
10725//-------------------------------------------------
10726
10727void k007121_device::device_config_complete()
10728{
10729}
10730
10731//-------------------------------------------------
10732//  device_start - device-specific startup
10733//-------------------------------------------------
10734
10735void k007121_device::device_start()
10736{
10737   DEVICE_START_NAME( k007121 )(this);
10738}
10739
10740//-------------------------------------------------
10741//  device_reset - device-specific reset
10742//-------------------------------------------------
10743
10744void k007121_device::device_reset()
10745{
10746   DEVICE_RESET_NAME( k007121 )(this);
10747}
10748
10749
10750const device_type K007342 = &device_creator<k007342_device>;
10751
10752k007342_device::k007342_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
10753   : device_t(mconfig, K007342, "Konami 007342", tag, owner, clock)
10754{
10755   m_token = global_alloc_array_clear(UINT8, sizeof(k007342_state));
10756}
10757
10758//-------------------------------------------------
10759//  device_config_complete - perform any
10760//  operations now that the configuration is
10761//  complete
10762//-------------------------------------------------
10763
10764void k007342_device::device_config_complete()
10765{
10766}
10767
10768//-------------------------------------------------
10769//  device_start - device-specific startup
10770//-------------------------------------------------
10771
10772void k007342_device::device_start()
10773{
10774   DEVICE_START_NAME( k007342 )(this);
10775}
10776
10777//-------------------------------------------------
10778//  device_reset - device-specific reset
10779//-------------------------------------------------
10780
10781void k007342_device::device_reset()
10782{
10783   DEVICE_RESET_NAME( k007342 )(this);
10784}
10785
10786
10787const device_type K007420 = &device_creator<k007420_device>;
10788
10789k007420_device::k007420_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
10790   : device_t(mconfig, K007420, "Konami 007420", tag, owner, clock)
10791{
10792   m_token = global_alloc_array_clear(UINT8, sizeof(k007420_state));
10793}
10794
10795//-------------------------------------------------
10796//  device_config_complete - perform any
10797//  operations now that the configuration is
10798//  complete
10799//-------------------------------------------------
10800
10801void k007420_device::device_config_complete()
10802{
10803}
10804
10805//-------------------------------------------------
10806//  device_start - device-specific startup
10807//-------------------------------------------------
10808
10809void k007420_device::device_start()
10810{
10811   DEVICE_START_NAME( k007420 )(this);
10812}
10813
10814//-------------------------------------------------
10815//  device_reset - device-specific reset
10816//-------------------------------------------------
10817
10818void k007420_device::device_reset()
10819{
10820   DEVICE_RESET_NAME( k007420 )(this);
10821}
10822
10823
10824const device_type K052109 = &device_creator<k052109_device>;
10825
10826k052109_device::k052109_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
10827   : device_t(mconfig, K052109, "Konami 052109", tag, owner, clock)
10828{
10829   m_token = global_alloc_array_clear(UINT8, sizeof(k052109_state));
10830}
10831
10832//-------------------------------------------------
10833//  device_config_complete - perform any
10834//  operations now that the configuration is
10835//  complete
10836//-------------------------------------------------
10837
10838void k052109_device::device_config_complete()
10839{
10840}
10841
10842//-------------------------------------------------
10843//  device_start - device-specific startup
10844//-------------------------------------------------
10845
10846void k052109_device::device_start()
10847{
10848   DEVICE_START_NAME( k052109 )(this);
10849}
10850
10851//-------------------------------------------------
10852//  device_reset - device-specific reset
10853//-------------------------------------------------
10854
10855void k052109_device::device_reset()
10856{
10857   DEVICE_RESET_NAME( k052109 )(this);
10858}
10859
10860
10861const device_type K051960 = &device_creator<k051960_device>;
10862
10863k051960_device::k051960_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
10864   : device_t(mconfig, K051960, "Konami 051960", tag, owner, clock)
10865{
10866   m_token = global_alloc_array_clear(UINT8, sizeof(k051960_state));
10867}
10868
10869//-------------------------------------------------
10870//  device_config_complete - perform any
10871//  operations now that the configuration is
10872//  complete
10873//-------------------------------------------------
10874
10875void k051960_device::device_config_complete()
10876{
10877}
10878
10879//-------------------------------------------------
10880//  device_start - device-specific startup
10881//-------------------------------------------------
10882
10883void k051960_device::device_start()
10884{
10885   DEVICE_START_NAME( k051960 )(this);
10886}
10887
10888//-------------------------------------------------
10889//  device_reset - device-specific reset
10890//-------------------------------------------------
10891
10892void k051960_device::device_reset()
10893{
10894   DEVICE_RESET_NAME( k051960 )(this);
10895}
10896
10897
10898const device_type K053244 = &device_creator<k05324x_device>;
10899
10900k05324x_device::k05324x_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
10901   : device_t(mconfig, K053244, "Konami 053244 & 053245", tag, owner, clock)
10902{
10903   m_token = global_alloc_array_clear(UINT8, sizeof(k05324x_state));
10904}
10905
10906//-------------------------------------------------
10907//  device_config_complete - perform any
10908//  operations now that the configuration is
10909//  complete
10910//-------------------------------------------------
10911
10912void k05324x_device::device_config_complete()
10913{
10914}
10915
10916//-------------------------------------------------
10917//  device_start - device-specific startup
10918//-------------------------------------------------
10919
10920void k05324x_device::device_start()
10921{
10922   DEVICE_START_NAME( k05324x )(this);
10923}
10924
10925//-------------------------------------------------
10926//  device_reset - device-specific reset
10927//-------------------------------------------------
10928
10929void k05324x_device::device_reset()
10930{
10931   DEVICE_RESET_NAME( k05324x )(this);
10932}
10933
10934
10935const device_type K053246 = &device_creator<k053247_device>;
10936
10937k053247_device::k053247_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
10938   : device_t(mconfig, K053246, "Konami 053246 & 053247", tag, owner, clock)
10939{
10940   m_token = global_alloc_array_clear(UINT8, sizeof(k053247_state));
10941}
10942
10943//-------------------------------------------------
10944//  device_config_complete - perform any
10945//  operations now that the configuration is
10946//  complete
10947//-------------------------------------------------
10948
10949void k053247_device::device_config_complete()
10950{
10951}
10952
10953//-------------------------------------------------
10954//  device_start - device-specific startup
10955//-------------------------------------------------
10956
10957void k053247_device::device_start()
10958{
10959   DEVICE_START_NAME( k053247 )(this);
10960}
10961
10962//-------------------------------------------------
10963//  device_reset - device-specific reset
10964//-------------------------------------------------
10965
10966void k053247_device::device_reset()
10967{
10968   DEVICE_RESET_NAME( k053247 )(this);
10969}
10970
10971
10972const device_type K055673 = &device_creator<k055673_device>;
10973
10974k055673_device::k055673_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
10975   : device_t(mconfig, K055673, "Konami 055673", tag, owner, clock)
10976{
10977   m_token = global_alloc_array_clear(UINT8, sizeof(k053247_state));
10978}
10979
10980//-------------------------------------------------
10981//  device_config_complete - perform any
10982//  operations now that the configuration is
10983//  complete
10984//-------------------------------------------------
10985
10986void k055673_device::device_config_complete()
10987{
10988}
10989
10990//-------------------------------------------------
10991//  device_start - device-specific startup
10992//-------------------------------------------------
10993
10994void k055673_device::device_start()
10995{
10996   DEVICE_START_NAME( k055673 )(this);
10997}
10998
10999//-------------------------------------------------
11000//  device_reset - device-specific reset
11001//-------------------------------------------------
11002
11003void k055673_device::device_reset()
11004{
11005   DEVICE_RESET_NAME( k053247 )(this);
11006}
11007
11008
11009const device_type K051316 = &device_creator<k051316_device>;
11010
11011k051316_device::k051316_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
11012   : device_t(mconfig, K051316, "Konami 051316", tag, owner, clock)
11013{
11014   m_token = global_alloc_array_clear(UINT8, sizeof(k051316_state));
11015}
11016
11017//-------------------------------------------------
11018//  device_config_complete - perform any
11019//  operations now that the configuration is
11020//  complete
11021//-------------------------------------------------
11022
11023void k051316_device::device_config_complete()
11024{
11025}
11026
11027//-------------------------------------------------
11028//  device_start - device-specific startup
11029//-------------------------------------------------
11030
11031void k051316_device::device_start()
11032{
11033   DEVICE_START_NAME( k051316 )(this);
11034}
11035
11036//-------------------------------------------------
11037//  device_reset - device-specific reset
11038//-------------------------------------------------
11039
11040void k051316_device::device_reset()
11041{
11042   DEVICE_RESET_NAME( k051316 )(this);
11043}
11044
11045
11046const device_type K053936 = &device_creator<k053936_device>;
11047
11048k053936_device::k053936_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
11049   : device_t(mconfig, K053936, "Konami 053936", tag, owner, clock)
11050{
11051   m_token = global_alloc_array_clear(UINT8, sizeof(k053936_state));
11052}
11053
11054//-------------------------------------------------
11055//  device_config_complete - perform any
11056//  operations now that the configuration is
11057//  complete
11058//-------------------------------------------------
11059
11060void k053936_device::device_config_complete()
11061{
11062}
11063
11064//-------------------------------------------------
11065//  device_start - device-specific startup
11066//-------------------------------------------------
11067
11068void k053936_device::device_start()
11069{
11070   DEVICE_START_NAME( k053936 )(this);
11071}
11072
11073//-------------------------------------------------
11074//  device_reset - device-specific reset
11075//-------------------------------------------------
11076
11077void k053936_device::device_reset()
11078{
11079   DEVICE_RESET_NAME( k053936 )(this);
11080}
11081
11082
11083const device_type K053251 = &device_creator<k053251_device>;
11084
11085k053251_device::k053251_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
11086   : device_t(mconfig, K053251, "Konami 053251", tag, owner, clock)
11087{
11088   m_token = global_alloc_array_clear(UINT8, sizeof(k053251_state));
11089}
11090
11091//-------------------------------------------------
11092//  device_config_complete - perform any
11093//  operations now that the configuration is
11094//  complete
11095//-------------------------------------------------
11096
11097void k053251_device::device_config_complete()
11098{
11099}
11100
11101//-------------------------------------------------
11102//  device_start - device-specific startup
11103//-------------------------------------------------
11104
11105void k053251_device::device_start()
11106{
11107   DEVICE_START_NAME( k053251 )(this);
11108}
11109
11110//-------------------------------------------------
11111//  device_reset - device-specific reset
11112//-------------------------------------------------
11113
11114void k053251_device::device_reset()
11115{
11116   DEVICE_RESET_NAME( k053251 )(this);
11117}
11118
11119
11120const device_type K054000 = &device_creator<k054000_device>;
11121
11122k054000_device::k054000_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
11123   : device_t(mconfig, K054000, "Konami 054000", tag, owner, clock)
11124{
11125   m_token = global_alloc_array_clear(UINT8, sizeof(k054000_state));
11126}
11127
11128//-------------------------------------------------
11129//  device_config_complete - perform any
11130//  operations now that the configuration is
11131//  complete
11132//-------------------------------------------------
11133
11134void k054000_device::device_config_complete()
11135{
11136}
11137
11138//-------------------------------------------------
11139//  device_start - device-specific startup
11140//-------------------------------------------------
11141
11142void k054000_device::device_start()
11143{
11144   DEVICE_START_NAME( k054000 )(this);
11145}
11146
11147//-------------------------------------------------
11148//  device_reset - device-specific reset
11149//-------------------------------------------------
11150
11151void k054000_device::device_reset()
11152{
11153   DEVICE_RESET_NAME( k054000 )(this);
11154}
11155
11156
11157const device_type K051733 = &device_creator<k051733_device>;
11158
11159k051733_device::k051733_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
11160   : device_t(mconfig, K051733, "Konami 051733", tag, owner, clock)
11161{
11162   m_token = global_alloc_array_clear(UINT8, sizeof(k051733_state));
11163}
11164
11165//-------------------------------------------------
11166//  device_config_complete - perform any
11167//  operations now that the configuration is
11168//  complete
11169//-------------------------------------------------
11170
11171void k051733_device::device_config_complete()
11172{
11173}
11174
11175//-------------------------------------------------
11176//  device_start - device-specific startup
11177//-------------------------------------------------
11178
11179void k051733_device::device_start()
11180{
11181   DEVICE_START_NAME( k051733 )(this);
11182}
11183
11184//-------------------------------------------------
11185//  device_reset - device-specific reset
11186//-------------------------------------------------
11187
11188void k051733_device::device_reset()
11189{
11190   DEVICE_RESET_NAME( k051733 )(this);
11191}
11192
11193
11194const device_type K056832 = &device_creator<k056832_device>;
11195
11196k056832_device::k056832_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
11197   : device_t(mconfig, K056832, "Konami 056832", tag, owner, clock)
11198{
11199   m_token = global_alloc_array_clear(UINT8, sizeof(k056832_state));
11200}
11201
11202//-------------------------------------------------
11203//  device_config_complete - perform any
11204//  operations now that the configuration is
11205//  complete
11206//-------------------------------------------------
11207
11208void k056832_device::device_config_complete()
11209{
11210}
11211
11212//-------------------------------------------------
11213//  device_start - device-specific startup
11214//-------------------------------------------------
11215
11216void k056832_device::device_start()
11217{
11218   DEVICE_START_NAME( k056832 )(this);
11219}
11220
11221
11222const device_type K055555 = &device_creator<k055555_device>;
11223
11224k055555_device::k055555_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
11225   : device_t(mconfig, K055555, "Konami 055555", tag, owner, clock)
11226{
11227   m_token = global_alloc_array_clear(UINT8, sizeof(k055555_state));
11228}
11229
11230//-------------------------------------------------
11231//  device_config_complete - perform any
11232//  operations now that the configuration is
11233//  complete
11234//-------------------------------------------------
11235
11236void k055555_device::device_config_complete()
11237{
11238}
11239
11240//-------------------------------------------------
11241//  device_start - device-specific startup
11242//-------------------------------------------------
11243
11244void k055555_device::device_start()
11245{
11246   DEVICE_START_NAME( k055555 )(this);
11247}
11248
11249//-------------------------------------------------
11250//  device_reset - device-specific reset
11251//-------------------------------------------------
11252
11253void k055555_device::device_reset()
11254{
11255   DEVICE_RESET_NAME( k055555 )(this);
11256}
11257
11258
11259const device_type K054338 = &device_creator<k054338_device>;
11260
11261k054338_device::k054338_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
11262   : device_t(mconfig, K054338, "Konami 054338", tag, owner, clock)
11263{
11264   m_token = global_alloc_array_clear(UINT8, sizeof(k054338_state));
11265}
11266
11267//-------------------------------------------------
11268//  device_config_complete - perform any
11269//  operations now that the configuration is
11270//  complete
11271//-------------------------------------------------
11272
11273void k054338_device::device_config_complete()
11274{
11275}
11276
11277//-------------------------------------------------
11278//  device_start - device-specific startup
11279//-------------------------------------------------
11280
11281void k054338_device::device_start()
11282{
11283   DEVICE_START_NAME( k054338 )(this);
11284}
11285
11286//-------------------------------------------------
11287//  device_reset - device-specific reset
11288//-------------------------------------------------
11289
11290void k054338_device::device_reset()
11291{
11292   DEVICE_RESET_NAME( k054338 )(this);
11293}
11294
11295
11296const device_type K001006 = &device_creator<k001006_device>;
11297
11298k001006_device::k001006_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
11299   : device_t(mconfig, K001006, "Konami 001006", tag, owner, clock)
11300{
11301   m_token = global_alloc_array_clear(UINT8, sizeof(k001006_state));
11302}
11303
11304//-------------------------------------------------
11305//  device_config_complete - perform any
11306//  operations now that the configuration is
11307//  complete
11308//-------------------------------------------------
11309
11310void k001006_device::device_config_complete()
11311{
11312}
11313
11314//-------------------------------------------------
11315//  device_start - device-specific startup
11316//-------------------------------------------------
11317
11318void k001006_device::device_start()
11319{
11320   DEVICE_START_NAME( k001006 )(this);
11321}
11322
11323//-------------------------------------------------
11324//  device_reset - device-specific reset
11325//-------------------------------------------------
11326
11327void k001006_device::device_reset()
11328{
11329   DEVICE_RESET_NAME( k001006 )(this);
11330}
11331
11332
11333const device_type K001005 = &device_creator<k001005_device>;
11334
11335k001005_device::k001005_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
11336   : device_t(mconfig, K001005, "Konami 001005", tag, owner, clock)
11337{
11338   m_token = global_alloc_array_clear(UINT8, sizeof(k001005_state));
11339}
11340
11341//-------------------------------------------------
11342//  device_config_complete - perform any
11343//  operations now that the configuration is
11344//  complete
11345//-------------------------------------------------
11346
11347void k001005_device::device_config_complete()
11348{
11349}
11350
11351//-------------------------------------------------
11352//  device_start - device-specific startup
11353//-------------------------------------------------
11354
11355void k001005_device::device_start()
11356{
11357   DEVICE_START_NAME( k001005 )(this);
11358}
11359
11360//-------------------------------------------------
11361//  device_reset - device-specific reset
11362//-------------------------------------------------
11363
11364void k001005_device::device_reset()
11365{
11366   DEVICE_RESET_NAME( k001005 )(this);
11367}
11368
11369//-------------------------------------------------
11370//  device_stop - device-specific stop
11371//-------------------------------------------------
11372
11373void k001005_device::device_stop()
11374{
11375   DEVICE_STOP_NAME( k001005 )(this);
11376}
11377
11378
11379const device_type K001604 = &device_creator<k001604_device>;
11380
11381k001604_device::k001604_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
11382   : device_t(mconfig, K001604, "Konami 001604", tag, owner, clock)
11383{
11384   m_token = global_alloc_array_clear(UINT8, sizeof(k001604_state));
11385}
11386
11387//-------------------------------------------------
11388//  device_config_complete - perform any
11389//  operations now that the configuration is
11390//  complete
11391//-------------------------------------------------
11392
11393void k001604_device::device_config_complete()
11394{
11395}
11396
11397//-------------------------------------------------
11398//  device_start - device-specific startup
11399//-------------------------------------------------
11400
11401void k001604_device::device_start()
11402{
11403   DEVICE_START_NAME( k001604 )(this);
11404}
11405
11406//-------------------------------------------------
11407//  device_reset - device-specific reset
11408//-------------------------------------------------
11409
11410void k001604_device::device_reset()
11411{
11412   DEVICE_RESET_NAME( k001604 )(this);
11413}
11414
11415
11416const device_type K037122 = &device_creator<k037122_device>;
11417
11418k037122_device::k037122_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
11419   : device_t(mconfig, K037122, "Konami 0371222", tag, owner, clock)
11420{
11421   m_token = global_alloc_array_clear(UINT8, sizeof(k037122_state));
11422}
11423
11424//-------------------------------------------------
11425//  device_config_complete - perform any
11426//  operations now that the configuration is
11427//  complete
11428//-------------------------------------------------
11429
11430void k037122_device::device_config_complete()
11431{
11432}
11433
11434//-------------------------------------------------
11435//  device_start - device-specific startup
11436//-------------------------------------------------
11437
11438void k037122_device::device_start()
11439{
11440   DEVICE_START_NAME( k037122 )(this);
11441}
11442
11443//-------------------------------------------------
11444//  device_reset - device-specific reset
11445//-------------------------------------------------
11446
11447void k037122_device::device_reset()
11448{
11449   DEVICE_RESET_NAME( k037122 )(this);
11450}
11451
11452
trunk/src/mame/video/konicdev.h
r17612r17613
158158   int            gfx_index;
159159};
160160
161DECLARE_LEGACY_DEVICE(K007121, k007121);
162DECLARE_LEGACY_DEVICE(K007342, k007342);
163DECLARE_LEGACY_DEVICE(K007420, k007420);
164DECLARE_LEGACY_DEVICE(K052109, k052109);
165DECLARE_LEGACY_DEVICE(K051960, k051960);
166DECLARE_LEGACY_DEVICE(K053244, k05324x);
161class k007121_device : public device_t
162{
163public:
164   k007121_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
165   ~k007121_device() { global_free(m_token); }
166
167   // access to legacy token
168   void *token() const { assert(m_token != NULL); return m_token; }
169protected:
170   // device-level overrides
171   virtual void device_config_complete();
172   virtual void device_start();
173   virtual void device_reset();
174private:
175   // internal state
176   void *m_token;
177};
178
179extern const device_type K007121;
180
181class k007342_device : public device_t
182{
183public:
184   k007342_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
185   ~k007342_device() { global_free(m_token); }
186
187   // access to legacy token
188   void *token() const { assert(m_token != NULL); return m_token; }
189protected:
190   // device-level overrides
191   virtual void device_config_complete();
192   virtual void device_start();
193   virtual void device_reset();
194private:
195   // internal state
196   void *m_token;
197};
198
199extern const device_type K007342;
200
201class k007420_device : public device_t
202{
203public:
204   k007420_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
205   ~k007420_device() { global_free(m_token); }
206
207   // access to legacy token
208   void *token() const { assert(m_token != NULL); return m_token; }
209protected:
210   // device-level overrides
211   virtual void device_config_complete();
212   virtual void device_start();
213   virtual void device_reset();
214private:
215   // internal state
216   void *m_token;
217};
218
219extern const device_type K007420;
220
221class k052109_device : public device_t
222{
223public:
224   k052109_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
225   ~k052109_device() { global_free(m_token); }
226
227   // access to legacy token
228   void *token() const { assert(m_token != NULL); return m_token; }
229protected:
230   // device-level overrides
231   virtual void device_config_complete();
232   virtual void device_start();
233   virtual void device_reset();
234private:
235   // internal state
236   void *m_token;
237};
238
239extern const device_type K052109;
240
241class k051960_device : public device_t
242{
243public:
244   k051960_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
245   ~k051960_device() { global_free(m_token); }
246
247   // access to legacy token
248   void *token() const { assert(m_token != NULL); return m_token; }
249protected:
250   // device-level overrides
251   virtual void device_config_complete();
252   virtual void device_start();
253   virtual void device_reset();
254private:
255   // internal state
256   void *m_token;
257};
258
259extern const device_type K051960;
260
261class k05324x_device : public device_t
262{
263public:
264   k05324x_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
265   ~k05324x_device() { global_free(m_token); }
266
267   // access to legacy token
268   void *token() const { assert(m_token != NULL); return m_token; }
269protected:
270   // device-level overrides
271   virtual void device_config_complete();
272   virtual void device_start();
273   virtual void device_reset();
274private:
275   // internal state
276   void *m_token;
277};
278
279extern const device_type K053244;
280
167281#define K053245 K053244
168DECLARE_LEGACY_DEVICE(K053246, k053247);
282class k053247_device : public device_t
283{
284public:
285   k053247_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
286   ~k053247_device() { global_free(m_token); }
287
288   // access to legacy token
289   void *token() const { assert(m_token != NULL); return m_token; }
290protected:
291   // device-level overrides
292   virtual void device_config_complete();
293   virtual void device_start();
294   virtual void device_reset();
295private:
296   // internal state
297   void *m_token;
298};
299
300extern const device_type K053246;
301
169302#define K053247 K053246
170DECLARE_LEGACY_DEVICE(K055673, k055673);
171DECLARE_LEGACY_DEVICE(K051316, k051316);
172DECLARE_LEGACY_DEVICE(K053936, k053936);
173DECLARE_LEGACY_DEVICE(K053251, k053251);
174DECLARE_LEGACY_DEVICE(K054000, k054000);
175DECLARE_LEGACY_DEVICE(K051733, k051733);
176DECLARE_LEGACY_DEVICE(K056832, k056832);
177DECLARE_LEGACY_DEVICE(K055555, k055555);
178DECLARE_LEGACY_DEVICE(K054338, k054338);
179DECLARE_LEGACY_DEVICE(K001006, k001006);
180DECLARE_LEGACY_DEVICE(K001005, k001005);
181DECLARE_LEGACY_DEVICE(K001604, k001604);
182DECLARE_LEGACY_DEVICE(K037122, k037122);
303class k055673_device : public device_t
304{
305public:
306   k055673_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
307   ~k055673_device() { global_free(m_token); }
183308
309   // access to legacy token
310   void *token() const { assert(m_token != NULL); return m_token; }
311protected:
312   // device-level overrides
313   virtual void device_config_complete();
314   virtual void device_start();
315   virtual void device_reset();
316private:
317   // internal state
318   void *m_token;
319};
184320
321extern const device_type K055673;
322
323class k051316_device : public device_t
324{
325public:
326   k051316_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
327   ~k051316_device() { global_free(m_token); }
328
329   // access to legacy token
330   void *token() const { assert(m_token != NULL); return m_token; }
331protected:
332   // device-level overrides
333   virtual void device_config_complete();
334   virtual void device_start();
335   virtual void device_reset();
336private:
337   // internal state
338   void *m_token;
339};
340
341extern const device_type K051316;
342
343class k053936_device : public device_t
344{
345public:
346   k053936_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
347   ~k053936_device() { global_free(m_token); }
348
349   // access to legacy token
350   void *token() const { assert(m_token != NULL); return m_token; }
351protected:
352   // device-level overrides
353   virtual void device_config_complete();
354   virtual void device_start();
355   virtual void device_reset();
356private:
357   // internal state
358   void *m_token;
359};
360
361extern const device_type K053936;
362
363class k053251_device : public device_t
364{
365public:
366   k053251_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
367   ~k053251_device() { global_free(m_token); }
368
369   // access to legacy token
370   void *token() const { assert(m_token != NULL); return m_token; }
371protected:
372   // device-level overrides
373   virtual void device_config_complete();
374   virtual void device_start();
375   virtual void device_reset();
376private:
377   // internal state
378   void *m_token;
379};
380
381extern const device_type K053251;
382
383class k054000_device : public device_t
384{
385public:
386   k054000_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
387   ~k054000_device() { global_free(m_token); }
388
389   // access to legacy token
390   void *token() const { assert(m_token != NULL); return m_token; }
391protected:
392   // device-level overrides
393   virtual void device_config_complete();
394   virtual void device_start();
395   virtual void device_reset();
396private:
397   // internal state
398   void *m_token;
399};
400
401extern const device_type K054000;
402
403class k051733_device : public device_t
404{
405public:
406   k051733_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
407   ~k051733_device() { global_free(m_token); }
408
409   // access to legacy token
410   void *token() const { assert(m_token != NULL); return m_token; }
411protected:
412   // device-level overrides
413   virtual void device_config_complete();
414   virtual void device_start();
415   virtual void device_reset();
416private:
417   // internal state
418   void *m_token;
419};
420
421extern const device_type K051733;
422
423class k056832_device : public device_t
424{
425public:
426   k056832_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
427   ~k056832_device() { global_free(m_token); }
428
429   // access to legacy token
430   void *token() const { assert(m_token != NULL); return m_token; }
431protected:
432   // device-level overrides
433   virtual void device_config_complete();
434   virtual void device_start();
435private:
436   // internal state
437   void *m_token;
438};
439
440extern const device_type K056832;
441
442class k055555_device : public device_t
443{
444public:
445   k055555_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
446   ~k055555_device() { global_free(m_token); }
447
448   // access to legacy token
449   void *token() const { assert(m_token != NULL); return m_token; }
450protected:
451   // device-level overrides
452   virtual void device_config_complete();
453   virtual void device_start();
454   virtual void device_reset();
455private:
456   // internal state
457   void *m_token;
458};
459
460extern const device_type K055555;
461
462class k054338_device : public device_t
463{
464public:
465   k054338_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
466   ~k054338_device() { global_free(m_token); }
467
468   // access to legacy token
469   void *token() const { assert(m_token != NULL); return m_token; }
470protected:
471   // device-level overrides
472   virtual void device_config_complete();
473   virtual void device_start();
474   virtual void device_reset();
475private:
476   // internal state
477   void *m_token;
478};
479
480extern const device_type K054338;
481
482class k001006_device : public device_t
483{
484public:
485   k001006_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
486   ~k001006_device() { global_free(m_token); }
487
488   // access to legacy token
489   void *token() const { assert(m_token != NULL); return m_token; }
490protected:
491   // device-level overrides
492   virtual void device_config_complete();
493   virtual void device_start();
494   virtual void device_reset();
495private:
496   // internal state
497   void *m_token;
498};
499
500extern const device_type K001006;
501
502class k001005_device : public device_t
503{
504public:
505   k001005_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
506   ~k001005_device() { global_free(m_token); }
507
508   // access to legacy token
509   void *token() const { assert(m_token != NULL); return m_token; }
510protected:
511   // device-level overrides
512   virtual void device_config_complete();
513   virtual void device_start();
514   virtual void device_stop();
515   virtual void device_reset();
516private:
517   // internal state
518   void *m_token;
519};
520
521extern const device_type K001005;
522
523class k001604_device : public device_t
524{
525public:
526   k001604_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
527   ~k001604_device() { global_free(m_token); }
528
529   // access to legacy token
530   void *token() const { assert(m_token != NULL); return m_token; }
531protected:
532   // device-level overrides
533   virtual void device_config_complete();
534   virtual void device_start();
535   virtual void device_reset();
536private:
537   // internal state
538   void *m_token;
539};
540
541extern const device_type K001604;
542
543class k037122_device : public device_t
544{
545public:
546   k037122_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
547   ~k037122_device() { global_free(m_token); }
548
549   // access to legacy token
550   void *token() const { assert(m_token != NULL); return m_token; }
551protected:
552   // device-level overrides
553   virtual void device_config_complete();
554   virtual void device_start();
555   virtual void device_reset();
556private:
557   // internal state
558   void *m_token;
559};
560
561extern const device_type K037122;
562
563
564
185565/***************************************************************************
186566    DEVICE CONFIGURATION MACROS
187567***************************************************************************/
trunk/src/mame/drivers/mjkjidai.c
r17612r17613
2727#include "sound/okiadpcm.h"
2828#include "includes/mjkjidai.h"
2929
30class mjkjidai_adpcm_device : public device_t,
31                                  public device_sound_interface
32{
33public:
34   mjkjidai_adpcm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
35   ~mjkjidai_adpcm_device() { global_free(m_token); }
36
37   // access to legacy token
38   void *token() const { assert(m_token != NULL); return m_token; }
39protected:
40   // device-level overrides
41   virtual void device_config_complete();
42   virtual void device_start();
43
44   // sound stream update overrides
45   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
46private:
47   // internal state
48   void *m_token;
49};
50
51extern const device_type MJKJIDAI;
52
3053/* Start of ADPCM custom chip code */
3154typedef struct _mjkjidai_adpcm_state mjkjidai_adpcm_state;
3255struct _mjkjidai_adpcm_state
r17612r17613
7093static DEVICE_START( mjkjidai_adpcm )
7194{
7295   running_machine &machine = device->machine();
73   mjkjidai_adpcm_state *state = (mjkjidai_adpcm_state *)downcast<legacy_device_base *>(device)->token();
96   mjkjidai_adpcm_state *state = (mjkjidai_adpcm_state *)downcast<mjkjidai_adpcm_device *>(device)->token();
7497
7598   state->m_playing = 0;
7699   state->m_stream = device->machine().sound().stream_alloc(*device, 0, 1, device->clock(), state, mjkjidai_adpcm_callback);
r17612r17613
93116   }
94117}
95118
96DECLARE_LEGACY_SOUND_DEVICE(MJKJIDAI, mjkjidai_adpcm);
97DEFINE_LEGACY_SOUND_DEVICE(MJKJIDAI, mjkjidai_adpcm);
119const device_type MJKJIDAI = &device_creator<mjkjidai_adpcm_device>;
98120
121mjkjidai_adpcm_device::mjkjidai_adpcm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
122   : device_t(mconfig, MJKJIDAI, "Custom ADPCM", tag, owner, clock),
123     device_sound_interface(mconfig, *this)
124{
125   m_token = global_alloc_array_clear(UINT8, sizeof(mjkjidai_adpcm_state));
126}
99127
128//-------------------------------------------------
129//  device_config_complete - perform any
130//  operations now that the configuration is
131//  complete
132//-------------------------------------------------
133
134void mjkjidai_adpcm_device::device_config_complete()
135{
136}
137
138//-------------------------------------------------
139//  device_start - device-specific startup
140//-------------------------------------------------
141
142void mjkjidai_adpcm_device::device_start()
143{
144   DEVICE_START_NAME( mjkjidai_adpcm )(this);
145}
146
147//-------------------------------------------------
148//  sound_stream_update - handle a stream update
149//-------------------------------------------------
150
151void mjkjidai_adpcm_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
152{
153   // should never get here
154   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
155}
156
157
158
159
100160static void mjkjidai_adpcm_play (mjkjidai_adpcm_state *state, int offset, int length)
101161{
102162   state->m_current = offset;
r17612r17613
108168WRITE8_MEMBER(mjkjidai_state::adpcm_w)
109169{
110170   device_t *device = machine().device("adpcm");
111   mjkjidai_adpcm_state *state = (mjkjidai_adpcm_state *)downcast<legacy_device_base *>(device)->token();
171   mjkjidai_adpcm_state *state = (mjkjidai_adpcm_state *)downcast<mjkjidai_adpcm_device *>(device)->token();
112172   mjkjidai_adpcm_play (state, (data & 0x07) * 0x1000, 0x1000 * 2);
113173}
114174/* End of ADPCM custom chip code */
trunk/src/mame/drivers/renegade.c
r17612r17613
123123   UINT8 *m_base;
124124} _renegade_adpcm_state_dummy;
125125
126DECLARE_LEGACY_SOUND_DEVICE(RENEGADE_ADPCM, renegade_adpcm);
126class renegade_adpcm_device : public device_t,
127                                  public device_sound_interface
128{
129public:
130   renegade_adpcm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
131   ~renegade_adpcm_device() { global_free(m_token); }
127132
133   // access to legacy token
134   void *token() const { assert(m_token != NULL); return m_token; }
135protected:
136   // device-level overrides
137   virtual void device_config_complete();
138   virtual void device_start();
139
140   // sound stream update overrides
141   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
142private:
143   // internal state
144   void *m_token;
145};
146
147extern const device_type RENEGADE_ADPCM;
148
149
128150INLINE renegade_adpcm_state *get_safe_token(device_t *device)
129151{
130152   assert(device != NULL);
131153   assert(device->type() == RENEGADE_ADPCM);
132154
133   return (renegade_adpcm_state *)downcast<legacy_device_base *>(device)->token();
155   return (renegade_adpcm_state *)downcast<renegade_adpcm_device *>(device)->token();
134156}
135157
136158static STREAM_UPDATE( renegade_adpcm_callback )
r17612r17613
185207   }
186208}
187209
188DEFINE_LEGACY_SOUND_DEVICE(RENEGADE_ADPCM, renegade_adpcm);
210const device_type RENEGADE_ADPCM = &device_creator<renegade_adpcm_device>;
189211
212renegade_adpcm_device::renegade_adpcm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
213   : device_t(mconfig, RENEGADE_ADPCM, "Renegade Custom ADPCM", tag, owner, clock),
214     device_sound_interface(mconfig, *this)
215{
216   m_token = global_alloc_array_clear(UINT8, sizeof(renegade_adpcm_state));
217}
190218
219//-------------------------------------------------
220//  device_config_complete - perform any
221//  operations now that the configuration is
222//  complete
223//-------------------------------------------------
224
225void renegade_adpcm_device::device_config_complete()
226{
227}
228
229//-------------------------------------------------
230//  device_start - device-specific startup
231//-------------------------------------------------
232
233void renegade_adpcm_device::device_start()
234{
235   DEVICE_START_NAME( renegade_adpcm )(this);
236}
237
238//-------------------------------------------------
239//  sound_stream_update - handle a stream update
240//-------------------------------------------------
241
242void renegade_adpcm_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
243{
244   // should never get here
245   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
246}
247
248
249
250
191251WRITE8_MEMBER(renegade_state::adpcm_play_w)
192252{
193253   device_t *device = machine().device("adpcm");
trunk/src/mame/drivers/ninjaw.c
r17612r17613
686686   }
687687}
688688
689DECLARE_LEGACY_SOUND_DEVICE(SUBWOOFER, subwoofer);
690DEFINE_LEGACY_SOUND_DEVICE(SUBWOOFER, subwoofer);
689class subwoofer_device : public device_t,
690                                  public device_sound_interface
691{
692public:
693   subwoofer_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
694   ~subwoofer_device() { global_free(m_token); }
695
696   // access to legacy token
697   void *token() const { assert(m_token != NULL); return m_token; }
698protected:
699   // device-level overrides
700   virtual void device_config_complete();
701   virtual void device_start();
702
703   // sound stream update overrides
704   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
705private:
706   // internal state
707   void *m_token;
708};
709
710extern const device_type SUBWOOFER;
711
712const device_type SUBWOOFER = &device_creator<subwoofer_device>;
713
714subwoofer_device::subwoofer_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
715   : device_t(mconfig, SUBWOOFER, "Subwoofer", tag, owner, clock),
716     device_sound_interface(mconfig, *this)
717{
718   m_token = global_alloc_array_clear(UINT8, sizeof());
719}
720
721//-------------------------------------------------
722//  device_config_complete - perform any
723//  operations now that the configuration is
724//  complete
725//-------------------------------------------------
726
727void subwoofer_device::device_config_complete()
728{
729}
730
731//-------------------------------------------------
732//  device_start - device-specific startup
733//-------------------------------------------------
734
735void subwoofer_device::device_start()
736{
737   DEVICE_START_NAME( subwoofer )(this);
738}
739
740//-------------------------------------------------
741//  sound_stream_update - handle a stream update
742//-------------------------------------------------
743
744void subwoofer_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
745{
746   // should never get here
747   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
748}
749
750
691751#endif
692752
693753
trunk/src/emu/video/hd63484.c
r17612r17613
5858   assert(device != NULL);
5959   assert(device->type() == HD63484);
6060
61   return (hd63484_state *)downcast<legacy_device_base *>(device)->token();
61   return (hd63484_state *)downcast<hd63484_device *>(device)->token();
6262}
6363
6464INLINE const hd63484_interface *get_interface( device_t *device )
r17612r17613
15911591 }
15921592}
15931593
1594DEFINE_LEGACY_DEVICE(HD63484, hd63484);
1594const device_type HD63484 = &device_creator<hd63484_device>;
1595
1596hd63484_device::hd63484_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1597   : device_t(mconfig, HD63484, "HD63484", tag, owner, clock)
1598{
1599   m_token = global_alloc_array_clear(UINT8, sizeof(hd63484_state));
1600}
1601
1602//-------------------------------------------------
1603//  device_config_complete - perform any
1604//  operations now that the configuration is
1605//  complete
1606//-------------------------------------------------
1607
1608void hd63484_device::device_config_complete()
1609{
1610}
1611
1612//-------------------------------------------------
1613//  device_start - device-specific startup
1614//-------------------------------------------------
1615
1616void hd63484_device::device_start()
1617{
1618   DEVICE_START_NAME( hd63484 )(this);
1619}
1620
1621//-------------------------------------------------
1622//  device_reset - device-specific reset
1623//-------------------------------------------------
1624
1625void hd63484_device::device_reset()
1626{
1627   DEVICE_RESET_NAME( hd63484 )(this);
1628}
1629
1630
trunk/src/emu/video/hd63484.h
r17612r17613
1414    TYPE DEFINITIONS
1515***************************************************************************/
1616
17DECLARE_LEGACY_DEVICE(HD63484, hd63484);
17class hd63484_device : public device_t
18{
19public:
20   hd63484_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
21   ~hd63484_device() { global_free(m_token); }
1822
23   // access to legacy token
24   void *token() const { assert(m_token != NULL); return m_token; }
25protected:
26   // device-level overrides
27   virtual void device_config_complete();
28   virtual void device_start();
29   virtual void device_reset();
30private:
31   // internal state
32   void *m_token;
33};
34
35extern const device_type HD63484;
36
37
1938#define HD63484_RAM_SIZE 0x100000
2039
2140typedef struct _hd63484_interface hd63484_interface;
trunk/src/emu/video/tlc34076.c
r17612r17613
5252   assert(device != NULL);
5353   assert(device->type() == TLC34076);
5454
55   return (tlc34076_state *)downcast<legacy_device_base *>(device)->token();
55   return (tlc34076_state *)downcast<tlc34076_device *>(device)->token();
5656}
5757
5858/*************************************
r17612r17613
295295 }
296296}
297297
298DEFINE_LEGACY_DEVICE(TLC34076, tlc34076);
298const device_type TLC34076 = &device_creator<tlc34076_device>;
299
300tlc34076_device::tlc34076_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
301   : device_t(mconfig, TLC34076, "TLC34076", tag, owner, clock)
302{
303   m_token = global_alloc_array_clear(UINT8, sizeof(tlc34076_state));
304}
305
306//-------------------------------------------------
307//  device_config_complete - perform any
308//  operations now that the configuration is
309//  complete
310//-------------------------------------------------
311
312void tlc34076_device::device_config_complete()
313{
314}
315
316//-------------------------------------------------
317//  device_start - device-specific startup
318//-------------------------------------------------
319
320void tlc34076_device::device_start()
321{
322   DEVICE_START_NAME( tlc34076 )(this);
323}
324
325//-------------------------------------------------
326//  device_reset - device-specific reset
327//-------------------------------------------------
328
329void tlc34076_device::device_reset()
330{
331   DEVICE_RESET_NAME( tlc34076 )(this);
332}
333
334
trunk/src/emu/video/tlc34076.h
r17612r17613
2525
2626extern const tlc34076_config tlc34076_6_bit_intf;
2727
28DECLARE_LEGACY_DEVICE(TLC34076, tlc34076);
28class tlc34076_device : public device_t
29{
30public:
31   tlc34076_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
32   ~tlc34076_device() { global_free(m_token); }
2933
34   // access to legacy token
35   void *token() const { assert(m_token != NULL); return m_token; }
36protected:
37   // device-level overrides
38   virtual void device_config_complete();
39   virtual void device_start();
40   virtual void device_reset();
41private:
42   // internal state
43   void *m_token;
44};
3045
46extern const device_type TLC34076;
47
48
49
3150/***************************************************************************
3251    DEVICE CONFIGURATION MACROS
3352***************************************************************************/
trunk/src/emu/video/voodoo.c
r17612r17613
316316   assert(device != NULL);
317317   assert((device->type() == VOODOO_1) || (device->type() == VOODOO_2) || (device->type() == VOODOO_BANSHEE) ||  (device->type() == VOODOO_3));
318318
319   return (voodoo_state *)downcast<legacy_device_base *>(device)->token();
319   return (voodoo_state *)downcast<voodoo_device *>(device)->token();
320320}
321321
322322
r17612r17613
57135713   }
57145714}
57155715
5716DEFINE_LEGACY_DEVICE(VOODOO_1, voodoo_1);
5717DEFINE_LEGACY_DEVICE(VOODOO_2, voodoo_2);
5718DEFINE_LEGACY_DEVICE(VOODOO_BANSHEE, voodoo_banshee);
5719DEFINE_LEGACY_DEVICE(VOODOO_3, voodoo_3);
5716voodoo_device::voodoo_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
5717   : device_t(mconfig, type, name, tag, owner, clock)
5718{
5719   m_token = global_alloc_array_clear(UINT8, sizeof(voodoo_state));
5720}
57205721
5722//-------------------------------------------------
5723//  device_config_complete - perform any
5724//  operations now that the configuration is
5725//  complete
5726//-------------------------------------------------
5727
5728void voodoo_device::device_config_complete()
5729{
5730}
5731
5732//-------------------------------------------------
5733//  device_reset - device-specific reset
5734//-------------------------------------------------
5735
5736void voodoo_device::device_reset()
5737{
5738   DEVICE_RESET_NAME( voodoo )(this);
5739}
5740
5741//-------------------------------------------------
5742//  device_stop - device-specific stop
5743//-------------------------------------------------
5744
5745void voodoo_device::device_stop()
5746{
5747   DEVICE_STOP_NAME( voodoo )(this);
5748}
5749
5750
5751const device_type VOODOO_1 = &device_creator<voodoo_1_device>;
5752
5753voodoo_1_device::voodoo_1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
5754   : voodoo_device(mconfig, VOODOO_1, "3dfx Voodoo Graphics", tag, owner, clock)
5755{
5756}
5757
5758//-------------------------------------------------
5759//  device_start - device-specific startup
5760//-------------------------------------------------
5761
5762void voodoo_1_device::device_start()
5763{
5764   DEVICE_START_NAME( voodoo_1 )(this);
5765}
5766
5767
5768const device_type VOODOO_2 = &device_creator<voodoo_2_device>;
5769
5770voodoo_2_device::voodoo_2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
5771   : voodoo_device(mconfig, VOODOO_2, "3dfx Voodoo 2", tag, owner, clock)
5772{
5773}
5774
5775//-------------------------------------------------
5776//  device_start - device-specific startup
5777//-------------------------------------------------
5778
5779void voodoo_2_device::device_start()
5780{
5781   DEVICE_START_NAME( voodoo_2 )(this);
5782}
5783
5784
5785const device_type VOODOO_BANSHEE = &device_creator<voodoo_banshee_device>;
5786
5787voodoo_banshee_device::voodoo_banshee_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
5788   : voodoo_device(mconfig, VOODOO_BANSHEE, "3dfx Voodoo Banshee", tag, owner, clock)
5789{
5790}
5791
5792//-------------------------------------------------
5793//  device_start - device-specific startup
5794//-------------------------------------------------
5795
5796void voodoo_banshee_device::device_start()
5797{
5798   DEVICE_START_NAME( voodoo_banshee )(this);
5799}
5800
5801
5802const device_type VOODOO_3 = &device_creator<voodoo_3_device>;
5803
5804voodoo_3_device::voodoo_3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
5805   : voodoo_device(mconfig, VOODOO_3, "3dfx Voodoo 3", tag, owner, clock)
5806{
5807}
5808
5809//-------------------------------------------------
5810//  device_start - device-specific startup
5811//-------------------------------------------------
5812
5813void voodoo_3_device::device_start()
5814{
5815   DEVICE_START_NAME( voodoo_3 )(this);
5816}
5817
5818
5819
57215820/***************************************************************************
57225821    GENERIC RASTERIZERS
57235822***************************************************************************/
trunk/src/emu/video/voodoo.h
r17612r17613
128128
129129/* ----- device interface ----- */
130130
131DECLARE_LEGACY_DEVICE(VOODOO_1, voodoo_1);
132DECLARE_LEGACY_DEVICE(VOODOO_2, voodoo_2);
133DECLARE_LEGACY_DEVICE(VOODOO_BANSHEE, voodoo_banshee);
134DECLARE_LEGACY_DEVICE(VOODOO_3, voodoo_3);
131class voodoo_device : public device_t
132{
133public:
134   voodoo_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
135   ~voodoo_device() { global_free(m_token); }
136
137   // access to legacy token
138   void *token() const { assert(m_token != NULL); return m_token; }
139protected:
140   // device-level overrides
141   virtual void device_config_complete();
142   virtual void device_stop();
143   virtual void device_reset();
144private:
145   // internal state
146   void *m_token;
147};
148
149class voodoo_1_device : public voodoo_device
150{
151public:
152   voodoo_1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
153protected:
154   // device-level overrides
155   virtual void device_start();
156};
157
158extern const device_type VOODOO_1;
159
160class voodoo_2_device : public voodoo_device
161{
162public:
163   voodoo_2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
164protected:
165   // device-level overrides
166   virtual void device_start();
167};
168
169extern const device_type VOODOO_2;
170
171class voodoo_banshee_device : public voodoo_device
172{
173public:
174   voodoo_banshee_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
175protected:
176   // device-level overrides
177   virtual void device_start();
178};
179
180extern const device_type VOODOO_BANSHEE;
181
182class voodoo_3_device : public voodoo_device
183{
184public:
185   voodoo_3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
186protected:
187   // device-level overrides
188   virtual void device_start();
189};
190
191extern const device_type VOODOO_3;
192
135193#endif
trunk/src/emu/video/i8275.c
r17612r17613
132132   assert(device != NULL);
133133   assert(device->type() == I8275);
134134
135   return (i8275_t *)downcast<legacy_device_base *>(device)->token();
135   return (i8275_t *)downcast<i8275_device *>(device)->token();
136136}
137137
138138
r17612r17613
609609   }
610610}
611611
612DEFINE_LEGACY_DEVICE(I8275, i8275);
612const device_type I8275 = &device_creator<i8275_device>;
613
614i8275_device::i8275_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
615   : device_t(mconfig, I8275, "Intel 8275", tag, owner, clock)
616{
617   m_token = global_alloc_array_clear(UINT8, sizeof(i8275_t));
618}
619
620//-------------------------------------------------
621//  device_config_complete - perform any
622//  operations now that the configuration is
623//  complete
624//-------------------------------------------------
625
626void i8275_device::device_config_complete()
627{
628}
629
630//-------------------------------------------------
631//  device_start - device-specific startup
632//-------------------------------------------------
633
634void i8275_device::device_start()
635{
636   DEVICE_START_NAME( i8275 )(this);
637}
638
639//-------------------------------------------------
640//  device_reset - device-specific reset
641//-------------------------------------------------
642
643void i8275_device::device_reset()
644{
645   DEVICE_RESET_NAME( i8275 )(this);
646}
647
648
trunk/src/emu/video/s2636.c
r17612r17613
119119   assert(device != NULL);
120120   assert(device->type() == S2636);
121121
122   return (s2636_state *)downcast<legacy_device_base *>(device)->token();
122   return (s2636_state *)downcast<s2636_device *>(device)->token();
123123}
124124
125125INLINE const s2636_interface *get_interface( device_t *device )
r17612r17613
377377 }
378378}
379379
380DEFINE_LEGACY_DEVICE(S2636, s2636);
380const device_type S2636 = &device_creator<s2636_device>;
381
382s2636_device::s2636_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
383   : device_t(mconfig, S2636, "Signetics 2636", tag, owner, clock)
384{
385   m_token = global_alloc_array_clear(UINT8, sizeof(s2636_state));
386}
387
388//-------------------------------------------------
389//  device_config_complete - perform any
390//  operations now that the configuration is
391//  complete
392//-------------------------------------------------
393
394void s2636_device::device_config_complete()
395{
396}
397
398//-------------------------------------------------
399//  device_start - device-specific startup
400//-------------------------------------------------
401
402void s2636_device::device_start()
403{
404   DEVICE_START_NAME( s2636 )(this);
405}
406
407
trunk/src/emu/video/i8275.h
r17612r17613
1818    MACROS
1919***************************************************************************/
2020
21DECLARE_LEGACY_DEVICE(I8275, i8275);
21class i8275_device : public device_t
22{
23public:
24   i8275_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
25   ~i8275_device() { global_free(m_token); }
2226
27   // access to legacy token
28   void *token() const { assert(m_token != NULL); return m_token; }
29protected:
30   // device-level overrides
31   virtual void device_config_complete();
32   virtual void device_start();
33   virtual void device_reset();
34private:
35   // internal state
36   void *m_token;
37};
38
39extern const device_type I8275;
40
41
2342/***************************************************************************
2443    TYPE DEFINITIONS
2544***************************************************************************/
trunk/src/emu/video/s2636.h
r17612r17613
3535 *
3636 *************************************/
3737
38DECLARE_LEGACY_DEVICE(S2636, s2636);
38class s2636_device : public device_t
39{
40public:
41   s2636_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
42   ~s2636_device() { global_free(m_token); }
3943
44   // access to legacy token
45   void *token() const { assert(m_token != NULL); return m_token; }
46protected:
47   // device-level overrides
48   virtual void device_config_complete();
49   virtual void device_start();
50private:
51   // internal state
52   void *m_token;
53};
54
55extern const device_type S2636;
56
57
4058#define MCFG_S2636_ADD(_tag, _interface) \
4159   MCFG_DEVICE_ADD(_tag, S2636, 0) \
4260   MCFG_DEVICE_CONFIG(_interface)
trunk/src/emu/video/tms9927.c
r17612r17613
6464{
6565   assert(device != NULL);
6666   assert(device->type() == TMS9927);
67   return (tms9927_state *)downcast<legacy_device_base *>(device)->token();
67   return (tms9927_state *)downcast<tms9927_device *>(device)->token();
6868}
6969
7070
r17612r17613
357357}
358358
359359
360DEFINE_LEGACY_DEVICE(TMS9927, tms9927);
361DEFINE_LEGACY_DEVICE(CRT5027, crt5027);
362DEFINE_LEGACY_DEVICE(CRT5037, crt5037);
363DEFINE_LEGACY_DEVICE(CRT5057, crt5057);
360const device_type TMS9927 = &device_creator<tms9927_device>;
361
362tms9927_device::tms9927_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
363   : device_t(mconfig, TMS9927, "TMS9927", tag, owner, clock)
364{
365   m_token = global_alloc_array_clear(UINT8, sizeof(tms9927_state));
366}
367tms9927_device::tms9927_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
368   : device_t(mconfig, type, name, tag, owner, clock)
369{
370   m_token = global_alloc_array_clear(UINT8, sizeof(tms9927_state));
371}
372
373//-------------------------------------------------
374//  device_config_complete - perform any
375//  operations now that the configuration is
376//  complete
377//-------------------------------------------------
378
379void tms9927_device::device_config_complete()
380{
381}
382
383//-------------------------------------------------
384//  device_start - device-specific startup
385//-------------------------------------------------
386
387void tms9927_device::device_start()
388{
389   DEVICE_START_NAME( tms9927 )(this);
390}
391
392//-------------------------------------------------
393//  device_reset - device-specific reset
394//-------------------------------------------------
395
396void tms9927_device::device_reset()
397{
398   DEVICE_RESET_NAME( tms9927 )(this);
399}
400
401//-------------------------------------------------
402//  device_stop - device-specific stop
403//-------------------------------------------------
404
405void tms9927_device::device_stop()
406{
407   DEVICE_STOP_NAME( tms9927 )(this);
408}
409
410
411const device_type CRT5027 = &device_creator<crt5027_device>;
412
413crt5027_device::crt5027_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
414   : tms9927_device(mconfig, CRT5027, "CRT5027", tag, owner, clock)
415{
416}
417
418
419const device_type CRT5037 = &device_creator<crt5037_device>;
420
421crt5037_device::crt5037_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
422   : tms9927_device(mconfig, CRT5037, "CRT5037", tag, owner, clock)
423{
424}
425
426
427const device_type CRT5057 = &device_creator<crt5057_device>;
428
429crt5057_device::crt5057_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
430   : tms9927_device(mconfig, CRT5057, "CRT5057", tag, owner, clock)
431{
432}
433
434
trunk/src/emu/video/tms9927.h
r17612r17613
1313#include "devlegcy.h"
1414
1515
16DECLARE_LEGACY_DEVICE(TMS9927, tms9927);
17DECLARE_LEGACY_DEVICE(CRT5027, crt5027);
18DECLARE_LEGACY_DEVICE(CRT5037, crt5037);
19DECLARE_LEGACY_DEVICE(CRT5057, crt5057);
16class tms9927_device : public device_t
17{
18public:
19   tms9927_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
20   tms9927_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
21   ~tms9927_device() { global_free(m_token); }
2022
23   // access to legacy token
24   void *token() const { assert(m_token != NULL); return m_token; }
25protected:
26   // device-level overrides
27   virtual void device_config_complete();
28   virtual void device_start();
29   virtual void device_stop();
30   virtual void device_reset();
31private:
32   // internal state
33   void *m_token;
34};
2135
36extern const device_type TMS9927;
37
38class crt5027_device : public tms9927_device
39{
40public:
41   crt5027_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
42};
43
44extern const device_type CRT5027;
45
46class crt5037_device : public tms9927_device
47{
48public:
49   crt5037_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
50};
51
52extern const device_type CRT5037;
53
54class crt5057_device : public tms9927_device
55{
56public:
57   crt5057_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
58};
59
60extern const device_type CRT5057;
61
62
63
2264#define MCFG_TMS9927_ADD(_tag, _clock, _config) \
2365   MCFG_DEVICE_ADD(_tag, TMS9927, _clock) \
2466   MCFG_DEVICE_CONFIG(_config)
trunk/src/emu/video/saa5050.c
r17612r17613
6161   assert(device != NULL);
6262   assert(device->type() == SAA5050);
6363
64   return (saa5050_state *)downcast<legacy_device_base *>(device)->token();
64   return (saa5050_state *)downcast<saa5050_device *>(device)->token();
6565}
6666
6767INLINE const saa5050_interface *get_interface( device_t *device )
r17612r17613
395395 }
396396}
397397
398DEFINE_LEGACY_DEVICE(SAA5050, saa5050);
398const device_type SAA5050 = &device_creator<saa5050_device>;
399
400saa5050_device::saa5050_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
401   : device_t(mconfig, SAA5050, "SAA5050", tag, owner, clock)
402{
403   m_token = global_alloc_array_clear(UINT8, sizeof(saa5050_state));
404}
405
406//-------------------------------------------------
407//  device_config_complete - perform any
408//  operations now that the configuration is
409//  complete
410//-------------------------------------------------
411
412void saa5050_device::device_config_complete()
413{
414}
415
416//-------------------------------------------------
417//  device_start - device-specific startup
418//-------------------------------------------------
419
420void saa5050_device::device_start()
421{
422   DEVICE_START_NAME( saa5050 )(this);
423}
424
425//-------------------------------------------------
426//  device_reset - device-specific reset
427//-------------------------------------------------
428
429void saa5050_device::device_reset()
430{
431   DEVICE_RESET_NAME( saa5050 )(this);
432}
433
434
trunk/src/emu/video/saa5050.h
r17612r17613
2626   int rev;
2727};
2828
29DECLARE_LEGACY_DEVICE(SAA5050, saa5050);
29class saa5050_device : public device_t
30{
31public:
32   saa5050_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
33   ~saa5050_device() { global_free(m_token); }
3034
35   // access to legacy token
36   void *token() const { assert(m_token != NULL); return m_token; }
37protected:
38   // device-level overrides
39   virtual void device_config_complete();
40   virtual void device_start();
41   virtual void device_reset();
42private:
43   // internal state
44   void *m_token;
45};
46
47extern const device_type SAA5050;
48
49
3150/***************************************************************************
3251    DEVICE CONFIGURATION MACROS
3352***************************************************************************/
trunk/src/emu/sound/es8712.h
r17612r17613
1313
1414WRITE8_DEVICE_HANDLER( es8712_w );
1515
16DECLARE_LEGACY_SOUND_DEVICE(ES8712, es8712);
16class es8712_device : public device_t,
17                                  public device_sound_interface
18{
19public:
20   es8712_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
21   ~es8712_device() { global_free(m_token); }
1722
23   // access to legacy token
24   void *token() const { assert(m_token != NULL); return m_token; }
25protected:
26   // device-level overrides
27   virtual void device_config_complete();
28   virtual void device_start();
29   virtual void device_reset();
30
31   // sound stream update overrides
32   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
33private:
34   // internal state
35   void *m_token;
36};
37
38extern const device_type ES8712;
39
40
1841#endif /* __ES8712_H__ */
trunk/src/emu/sound/sp0256.c
r17612r17613
135135{
136136   assert(device != NULL);
137137   assert(device->type() == SP0256);
138   return (sp0256_state *)downcast<legacy_device_base *>(device)->token();
138   return (sp0256_state *)downcast<sp0256_device *>(device)->token();
139139}
140140
141141
r17612r17613
13901390}
13911391
13921392
1393DEFINE_LEGACY_SOUND_DEVICE(SP0256, sp0256);
1393const device_type SP0256 = &device_creator<sp0256_device>;
1394
1395sp0256_device::sp0256_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1396   : device_t(mconfig, SP0256, "SP0256", tag, owner, clock),
1397     device_sound_interface(mconfig, *this)
1398{
1399   m_token = global_alloc_array_clear(UINT8, sizeof(sp0256_state));
1400}
1401
1402//-------------------------------------------------
1403//  device_config_complete - perform any
1404//  operations now that the configuration is
1405//  complete
1406//-------------------------------------------------
1407
1408void sp0256_device::device_config_complete()
1409{
1410}
1411
1412//-------------------------------------------------
1413//  device_start - device-specific startup
1414//-------------------------------------------------
1415
1416void sp0256_device::device_start()
1417{
1418   DEVICE_START_NAME( sp0256 )(this);
1419}
1420
1421//-------------------------------------------------
1422//  device_reset - device-specific reset
1423//-------------------------------------------------
1424
1425void sp0256_device::device_reset()
1426{
1427   DEVICE_RESET_NAME( sp0256 )(this);
1428}
1429
1430//-------------------------------------------------
1431//  sound_stream_update - handle a stream update
1432//-------------------------------------------------
1433
1434void sp0256_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
1435{
1436   // should never get here
1437   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
1438}
1439
1440
trunk/src/emu/sound/nes_apu.h
r17612r17613
4646READ8_DEVICE_HANDLER( nes_psg_r );
4747WRITE8_DEVICE_HANDLER( nes_psg_w );
4848
49DECLARE_LEGACY_SOUND_DEVICE(NES, nesapu);
49class nesapu_device : public device_t,
50                                  public device_sound_interface
51{
52public:
53   nesapu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
54   ~nesapu_device() { global_free(m_token); }
5055
56   // access to legacy token
57   void *token() const { assert(m_token != NULL); return m_token; }
58protected:
59   // device-level overrides
60   virtual void device_config_complete();
61   virtual void device_start();
62
63   // sound stream update overrides
64   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
65private:
66   // internal state
67   void *m_token;
68};
69
70extern const device_type NES;
71
72
5173#endif /* __NES_APU_H__ */
trunk/src/emu/sound/262intf.h
r17612r17613
2323WRITE8_DEVICE_HANDLER( ymf262_data_b_w );
2424
2525
26DECLARE_LEGACY_SOUND_DEVICE(YMF262, ymf262);
26class ymf262_device : public device_t,
27                                  public device_sound_interface
28{
29public:
30   ymf262_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
31   ~ymf262_device() { global_free(m_token); }
2732
33   // access to legacy token
34   void *token() const { assert(m_token != NULL); return m_token; }
35protected:
36   // device-level overrides
37   virtual void device_config_complete();
38   virtual void device_start();
39   virtual void device_stop();
40   virtual void device_reset();
41
42   // sound stream update overrides
43   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
44private:
45   // internal state
46   void *m_token;
47};
48
49extern const device_type YMF262;
50
51
2852#endif /* __262INTF_H__ */
trunk/src/emu/sound/hc55516.c
r17612r17613
5757   assert(device->type() == HC55516 ||
5858         device->type() == MC3417 ||
5959         device->type() == MC3418);
60   return (hc55516_state *)downcast<legacy_device_base *>(device)->token();
60   return (hc55516_state *)downcast<hc55516_device *>(device)->token();
6161}
6262
6363
r17612r17613
344344}
345345
346346
347DEFINE_LEGACY_SOUND_DEVICE(HC55516, hc55516);
348DEFINE_LEGACY_SOUND_DEVICE(MC3417, mc3417);
349DEFINE_LEGACY_SOUND_DEVICE(MC3418, mc3418);
347const device_type HC55516 = &device_creator<hc55516_device>;
348
349hc55516_device::hc55516_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
350   : device_t(mconfig, HC55516, "HC-55516", tag, owner, clock),
351     device_sound_interface(mconfig, *this)
352{
353   m_token = global_alloc_array_clear(UINT8, sizeof(hc55516_state));
354}
355hc55516_device::hc55516_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
356   : device_t(mconfig, type, name, tag, owner, clock),
357     device_sound_interface(mconfig, *this)
358{
359   m_token = global_alloc_array_clear(UINT8, sizeof(hc55516_state));
360}
361
362//-------------------------------------------------
363//  device_config_complete - perform any
364//  operations now that the configuration is
365//  complete
366//-------------------------------------------------
367
368void hc55516_device::device_config_complete()
369{
370}
371
372//-------------------------------------------------
373//  device_start - device-specific startup
374//-------------------------------------------------
375
376void hc55516_device::device_start()
377{
378   DEVICE_START_NAME( hc55516 )(this);
379}
380
381//-------------------------------------------------
382//  device_reset - device-specific reset
383//-------------------------------------------------
384
385void hc55516_device::device_reset()
386{
387   DEVICE_RESET_NAME( hc55516 )(this);
388}
389
390//-------------------------------------------------
391//  sound_stream_update - handle a stream update
392//-------------------------------------------------
393
394void hc55516_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
395{
396   // should never get here
397   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
398}
399
400
401const device_type MC3417 = &device_creator<mc3417_device>;
402
403mc3417_device::mc3417_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
404   : hc55516_device(mconfig, MC3417, "MC3417", tag, owner, clock)
405{
406}
407
408//-------------------------------------------------
409//  device_start - device-specific startup
410//-------------------------------------------------
411
412void mc3417_device::device_start()
413{
414   DEVICE_START_NAME( mc3417 )(this);
415}
416
417//-------------------------------------------------
418//  sound_stream_update - handle a stream update
419//-------------------------------------------------
420
421void mc3417_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
422{
423   // should never get here
424   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
425}
426
427
428const device_type MC3418 = &device_creator<mc3418_device>;
429
430mc3418_device::mc3418_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
431   : hc55516_device(mconfig, MC3418, "MC3418", tag, owner, clock)
432{
433}
434
435//-------------------------------------------------
436//  device_start - device-specific startup
437//-------------------------------------------------
438
439void mc3418_device::device_start()
440{
441   DEVICE_START_NAME( mc3418 )(this);
442}
443
444//-------------------------------------------------
445//  sound_stream_update - handle a stream update
446//-------------------------------------------------
447
448void mc3418_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
449{
450   // should never get here
451   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
452}
453
454
trunk/src/emu/sound/sp0256.h
r17612r17613
7171READ16_DEVICE_HANDLER( spb640_r );
7272WRITE16_DEVICE_HANDLER( spb640_w );
7373
74DECLARE_LEGACY_SOUND_DEVICE(SP0256, sp0256);
74class sp0256_device : public device_t,
75                                  public device_sound_interface
76{
77public:
78   sp0256_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
79   ~sp0256_device() { global_free(m_token); }
7580
81   // access to legacy token
82   void *token() const { assert(m_token != NULL); return m_token; }
83protected:
84   // device-level overrides
85   virtual void device_config_complete();
86   virtual void device_start();
87   virtual void device_reset();
88
89   // sound stream update overrides
90   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
91private:
92   // internal state
93   void *m_token;
94};
95
96extern const device_type SP0256;
97
98
7699#endif /* __SP0256_H__ */
trunk/src/emu/sound/hc55516.h
r17612r17613
1515/* returns whether the clock is currently LO or HI */
1616int hc55516_clock_state_r(device_t *device);
1717
18DECLARE_LEGACY_SOUND_DEVICE(HC55516, hc55516);
19DECLARE_LEGACY_SOUND_DEVICE(MC3417, mc3417);
20DECLARE_LEGACY_SOUND_DEVICE(MC3418, mc3418);
18class hc55516_device : public device_t,
19                                  public device_sound_interface
20{
21public:
22   hc55516_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
23   hc55516_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
24   ~hc55516_device() { global_free(m_token); }
2125
26   // access to legacy token
27   void *token() const { assert(m_token != NULL); return m_token; }
28protected:
29   // device-level overrides
30   virtual void device_config_complete();
31   virtual void device_start();
32   virtual void device_reset();
33
34   // sound stream update overrides
35   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
36private:
37   // internal state
38   void *m_token;
39};
40
41extern const device_type HC55516;
42
43class mc3417_device : public hc55516_device
44{
45public:
46   mc3417_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
47protected:
48   // device-level overrides
49   virtual void device_start();
50
51   // sound stream update overrides
52   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
53};
54
55extern const device_type MC3417;
56
57class mc3418_device : public hc55516_device
58{
59public:
60   mc3418_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
61protected:
62   // device-level overrides
63   virtual void device_start();
64
65   // sound stream update overrides
66   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
67};
68
69extern const device_type MC3418;
70
71
2272#endif /* __HC55516_H__ */
trunk/src/emu/sound/iremga20.c
r17612r17613
6060{
6161   assert(device != NULL);
6262   assert(device->type() == IREMGA20);
63   return (ga20_state *)downcast<legacy_device_base *>(device)->token();
63   return (ga20_state *)downcast<iremga20_device *>(device)->token();
6464}
6565
6666
r17612r17613
293293}
294294
295295
296DEFINE_LEGACY_SOUND_DEVICE(IREMGA20, iremga20);
296const device_type IREMGA20 = &device_creator<iremga20_device>;
297
298iremga20_device::iremga20_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
299   : device_t(mconfig, IREMGA20, "Irem GA20", tag, owner, clock),
300     device_sound_interface(mconfig, *this)
301{
302   m_token = global_alloc_array_clear(UINT8, sizeof(ga20_state));
303}
304
305//-------------------------------------------------
306//  device_config_complete - perform any
307//  operations now that the configuration is
308//  complete
309//-------------------------------------------------
310
311void iremga20_device::device_config_complete()
312{
313}
314
315//-------------------------------------------------
316//  device_start - device-specific startup
317//-------------------------------------------------
318
319void iremga20_device::device_start()
320{
321   DEVICE_START_NAME( iremga20 )(this);
322}
323
324//-------------------------------------------------
325//  device_reset - device-specific reset
326//-------------------------------------------------
327
328void iremga20_device::device_reset()
329{
330   DEVICE_RESET_NAME( iremga20 )(this);
331}
332
333//-------------------------------------------------
334//  sound_stream_update - handle a stream update
335//-------------------------------------------------
336
337void iremga20_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
338{
339   // should never get here
340   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
341}
342
343
trunk/src/emu/sound/tms5110.c
r17612r17613
204204         device->type() == TMC0281 ||
205205         device->type() == CD2802 ||
206206         device->type() == M58817);
207   return (tms5110_state *)downcast<legacy_device_base *>(device)->token();
207   return (tms5110_state *)downcast<tms5110_device *>(device)->token();
208208}
209209
210210INLINE tmsprom_state *get_safe_token_prom(device_t *device)
211211{
212212   assert(device != NULL);
213213   assert(device->type() == TMSPROM);
214   return (tmsprom_state *)downcast<legacy_device_base *>(device)->token();
214   return (tmsprom_state *)downcast<tmsprom_device *>(device)->token();
215215}
216216
217217/* Static function prototypes */
r17612r17613
15861586 }
15871587}
15881588
1589DEFINE_LEGACY_SOUND_DEVICE(TMS5110, tms5110);
1590DEFINE_LEGACY_SOUND_DEVICE(TMS5100, tms5100);
1591DEFINE_LEGACY_SOUND_DEVICE(TMS5110A, tms5110a);
1592DEFINE_LEGACY_SOUND_DEVICE(CD2801, cd2801);
1593DEFINE_LEGACY_SOUND_DEVICE(TMC0281, tmc0281);
1594DEFINE_LEGACY_SOUND_DEVICE(CD2802, cd2802);
1595DEFINE_LEGACY_SOUND_DEVICE(M58817, m58817);
1589const device_type TMS5110 = &device_creator<tms5110_device>;
15961590
1597DEFINE_LEGACY_DEVICE(TMSPROM, tmsprom);
1591tms5110_device::tms5110_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1592   : device_t(mconfig, TMS5110, "TMS5110", tag, owner, clock),
1593     device_sound_interface(mconfig, *this)
1594{
1595   m_token = global_alloc_array_clear(UINT8, sizeof(tms5110_state));
1596}
1597tms5110_device::tms5110_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
1598   : device_t(mconfig, type, name, tag, owner, clock),
1599     device_sound_interface(mconfig, *this)
1600{
1601   m_token = global_alloc_array_clear(UINT8, sizeof(tms5110_state));
1602}
1603
1604//-------------------------------------------------
1605//  device_config_complete - perform any
1606//  operations now that the configuration is
1607//  complete
1608//-------------------------------------------------
1609
1610void tms5110_device::device_config_complete()
1611{
1612}
1613
1614//-------------------------------------------------
1615//  device_start - device-specific startup
1616//-------------------------------------------------
1617
1618void tms5110_device::device_start()
1619{
1620   DEVICE_START_NAME( tms5110 )(this);
1621}
1622
1623//-------------------------------------------------
1624//  device_reset - device-specific reset
1625//-------------------------------------------------
1626
1627void tms5110_device::device_reset()
1628{
1629   DEVICE_RESET_NAME( tms5110 )(this);
1630}
1631
1632//-------------------------------------------------
1633//  sound_stream_update - handle a stream update
1634//-------------------------------------------------
1635
1636void tms5110_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
1637{
1638   // should never get here
1639   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
1640}
1641
1642
1643const device_type TMS5100 = &device_creator<tms5100_device>;
1644
1645tms5100_device::tms5100_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1646   : tms5110_device(mconfig, TMS5100, "TMS5100", tag, owner, clock)
1647{
1648}
1649
1650//-------------------------------------------------
1651//  device_start - device-specific startup
1652//-------------------------------------------------
1653
1654void tms5100_device::device_start()
1655{
1656   DEVICE_START_NAME( tms5100 )(this);
1657}
1658
1659//-------------------------------------------------
1660//  sound_stream_update - handle a stream update
1661//-------------------------------------------------
1662
1663void tms5100_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
1664{
1665   // should never get here
1666   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
1667}
1668
1669
1670const device_type TMS5110A = &device_creator<tms5110a_device>;
1671
1672tms5110a_device::tms5110a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1673   : tms5110_device(mconfig, TMS5110A, "TMS5110A", tag, owner, clock)
1674{
1675}
1676
1677//-------------------------------------------------
1678//  device_start - device-specific startup
1679//-------------------------------------------------
1680
1681void tms5110a_device::device_start()
1682{
1683   DEVICE_START_NAME( tms5110a )(this);
1684}
1685
1686//-------------------------------------------------
1687//  sound_stream_update - handle a stream update
1688//-------------------------------------------------
1689
1690void tms5110a_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
1691{
1692   // should never get here
1693   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
1694}
1695
1696
1697const device_type CD2801 = &device_creator<cd2801_device>;
1698
1699cd2801_device::cd2801_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1700   : tms5110_device(mconfig, CD2801, "CD2801", tag, owner, clock)
1701{
1702}
1703
1704//-------------------------------------------------
1705//  device_start - device-specific startup
1706//-------------------------------------------------
1707
1708void cd2801_device::device_start()
1709{
1710   DEVICE_START_NAME( cd2801 )(this);
1711}
1712
1713//-------------------------------------------------
1714//  sound_stream_update - handle a stream update
1715//-------------------------------------------------
1716
1717void cd2801_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
1718{
1719   // should never get here
1720   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
1721}
1722
1723
1724const device_type TMC0281 = &device_creator<tmc0281_device>;
1725
1726tmc0281_device::tmc0281_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1727   : tms5110_device(mconfig, TMC0281, "TMC0281", tag, owner, clock)
1728{
1729}
1730
1731//-------------------------------------------------
1732//  device_start - device-specific startup
1733//-------------------------------------------------
1734
1735void tmc0281_device::device_start()
1736{
1737   DEVICE_START_NAME( tmc0281 )(this);
1738}
1739
1740//-------------------------------------------------
1741//  sound_stream_update - handle a stream update
1742//-------------------------------------------------
1743
1744void tmc0281_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
1745{
1746   // should never get here
1747   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
1748}
1749
1750
1751const device_type CD2802 = &device_creator<cd2802_device>;
1752
1753cd2802_device::cd2802_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1754   : tms5110_device(mconfig, CD2802, "CD2802", tag, owner, clock)
1755{
1756}
1757
1758//-------------------------------------------------
1759//  device_start - device-specific startup
1760//-------------------------------------------------
1761
1762void cd2802_device::device_start()
1763{
1764   DEVICE_START_NAME( cd2802 )(this);
1765}
1766
1767//-------------------------------------------------
1768//  sound_stream_update - handle a stream update
1769//-------------------------------------------------
1770
1771void cd2802_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
1772{
1773   // should never get here
1774   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
1775}
1776
1777
1778const device_type M58817 = &device_creator<m58817_device>;
1779
1780m58817_device::m58817_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1781   : tms5110_device(mconfig, M58817, "M58817", tag, owner, clock)
1782{
1783}
1784
1785//-------------------------------------------------
1786//  device_start - device-specific startup
1787//-------------------------------------------------
1788
1789void m58817_device::device_start()
1790{
1791   DEVICE_START_NAME( m58817 )(this);
1792}
1793
1794//-------------------------------------------------
1795//  sound_stream_update - handle a stream update
1796//-------------------------------------------------
1797
1798void m58817_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
1799{
1800   // should never get here
1801   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
1802}
1803
1804
1805
1806const device_type TMSPROM = &device_creator<tmsprom_device>;
1807
1808tmsprom_device::tmsprom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1809   : device_t(mconfig, TMSPROM, "TMSPROM", tag, owner, clock)
1810{
1811   m_token = global_alloc_array_clear(UINT8, sizeof(tmsprom_state));
1812}
1813
1814//-------------------------------------------------
1815//  device_config_complete - perform any
1816//  operations now that the configuration is
1817//  complete
1818//-------------------------------------------------
1819
1820void tmsprom_device::device_config_complete()
1821{
1822}
1823
1824//-------------------------------------------------
1825//  device_start - device-specific startup
1826//-------------------------------------------------
1827
1828void tmsprom_device::device_start()
1829{
1830   DEVICE_START_NAME( tmsprom )(this);
1831}
1832
1833
trunk/src/emu/sound/2612intf.c
r17612r17613
3131{
3232   assert(device != NULL);
3333   assert(device->type() == YM2612 || device->type() == YM3438);
34   return (ym2612_state *)downcast<legacy_device_base *>(device)->token();
34   return (ym2612_state *)downcast<ym2612_device *>(device)->token();
3535}
3636
3737
r17612r17613
198198}
199199
200200
201DEFINE_LEGACY_SOUND_DEVICE(YM2612, ym2612);
202DEFINE_LEGACY_SOUND_DEVICE(YM3438, ym3438);
201const device_type YM2612 = &device_creator<ym2612_device>;
202
203ym2612_device::ym2612_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
204   : device_t(mconfig, YM2612, "YM2612", tag, owner, clock),
205     device_sound_interface(mconfig, *this)
206{
207   m_token = global_alloc_array_clear(UINT8, sizeof(ym2612_state));
208}
209ym2612_device::ym2612_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
210   : device_t(mconfig, type, name, tag, owner, clock),
211     device_sound_interface(mconfig, *this)
212{
213   m_token = global_alloc_array_clear(UINT8, sizeof(ym2612_state));
214}
215
216//-------------------------------------------------
217//  device_config_complete - perform any
218//  operations now that the configuration is
219//  complete
220//-------------------------------------------------
221
222void ym2612_device::device_config_complete()
223{
224}
225
226//-------------------------------------------------
227//  device_start - device-specific startup
228//-------------------------------------------------
229
230void ym2612_device::device_start()
231{
232   DEVICE_START_NAME( ym2612 )(this);
233}
234
235//-------------------------------------------------
236//  device_reset - device-specific reset
237//-------------------------------------------------
238
239void ym2612_device::device_reset()
240{
241   DEVICE_RESET_NAME( ym2612 )(this);
242}
243
244//-------------------------------------------------
245//  device_stop - device-specific stop
246//-------------------------------------------------
247
248void ym2612_device::device_stop()
249{
250   DEVICE_STOP_NAME( ym2612 )(this);
251}
252
253//-------------------------------------------------
254//  sound_stream_update - handle a stream update
255//-------------------------------------------------
256
257void ym2612_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
258{
259   // should never get here
260   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
261}
262
263
264const device_type YM3438 = &device_creator<ym3438_device>;
265
266ym3438_device::ym3438_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
267   : ym2612_device(mconfig, YM3438, "YM3438", tag, owner, clock)
268{
269}
270
271//-------------------------------------------------
272//  sound_stream_update - handle a stream update
273//-------------------------------------------------
274
275void ym3438_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
276{
277   // should never get here
278   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
279}
280
281
trunk/src/emu/sound/iremga20.h
r17612r17613
1313WRITE8_DEVICE_HANDLER( irem_ga20_w );
1414READ8_DEVICE_HANDLER( irem_ga20_r );
1515
16DECLARE_LEGACY_SOUND_DEVICE(IREMGA20, iremga20);
16class iremga20_device : public device_t,
17                                  public device_sound_interface
18{
19public:
20   iremga20_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
21   ~iremga20_device() { global_free(m_token); }
1722
23   // access to legacy token
24   void *token() const { assert(m_token != NULL); return m_token; }
25protected:
26   // device-level overrides
27   virtual void device_config_complete();
28   virtual void device_start();
29   virtual void device_reset();
30
31   // sound stream update overrides
32   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
33private:
34   // internal state
35   void *m_token;
36};
37
38extern const device_type IREMGA20;
39
40
1841#endif /* __IREMGA20_H__ */
trunk/src/emu/sound/tms5110.h
r17612r17613
5656
5757void tms5110_set_frequency(device_t *device, int frequency);
5858
59DECLARE_LEGACY_SOUND_DEVICE(TMS5110, tms5110);
60DECLARE_LEGACY_SOUND_DEVICE(TMS5100, tms5100);
61DECLARE_LEGACY_SOUND_DEVICE(TMS5110A, tms5110a);
62DECLARE_LEGACY_SOUND_DEVICE(CD2801, cd2801);
63DECLARE_LEGACY_SOUND_DEVICE(TMC0281, tmc0281);
64DECLARE_LEGACY_SOUND_DEVICE(CD2802, cd2802);
65DECLARE_LEGACY_SOUND_DEVICE(M58817, m58817);
59class tms5110_device : public device_t,
60                                  public device_sound_interface
61{
62public:
63   tms5110_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
64   tms5110_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
65   ~tms5110_device() { global_free(m_token); }
6666
67   // access to legacy token
68   void *token() const { assert(m_token != NULL); return m_token; }
69protected:
70   // device-level overrides
71   virtual void device_config_complete();
72   virtual void device_start();
73   virtual void device_reset();
6774
75   // sound stream update overrides
76   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
77private:
78   // internal state
79   void *m_token;
80};
81
82extern const device_type TMS5110;
83
84class tms5100_device : public tms5110_device
85{
86public:
87   tms5100_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
88protected:
89   // device-level overrides
90   virtual void device_start();
91
92   // sound stream update overrides
93   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
94};
95
96extern const device_type TMS5100;
97
98class tms5110a_device : public tms5110_device
99{
100public:
101   tms5110a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
102protected:
103   // device-level overrides
104   virtual void device_start();
105
106   // sound stream update overrides
107   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
108};
109
110extern const device_type TMS5110A;
111
112class cd2801_device : public tms5110_device
113{
114public:
115   cd2801_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
116protected:
117   // device-level overrides
118   virtual void device_start();
119
120   // sound stream update overrides
121   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
122};
123
124extern const device_type CD2801;
125
126class tmc0281_device : public tms5110_device
127{
128public:
129   tmc0281_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
130protected:
131   // device-level overrides
132   virtual void device_start();
133
134   // sound stream update overrides
135   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
136};
137
138extern const device_type TMC0281;
139
140class cd2802_device : public tms5110_device
141{
142public:
143   cd2802_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
144protected:
145   // device-level overrides
146   virtual void device_start();
147
148   // sound stream update overrides
149   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
150};
151
152extern const device_type CD2802;
153
154class m58817_device : public tms5110_device
155{
156public:
157   m58817_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
158protected:
159   // device-level overrides
160   virtual void device_start();
161
162   // sound stream update overrides
163   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
164};
165
166extern const device_type M58817;
167
168
169
68170/* PROM controlled TMS5110 interface */
69171
70172typedef struct _tmsprom_interface tmsprom_interface;
r17612r17613
92194WRITE8_DEVICE_HANDLER( tmsprom_bit_w );
93195WRITE_LINE_DEVICE_HANDLER( tmsprom_enable_w );
94196
95DECLARE_LEGACY_DEVICE(TMSPROM, tmsprom);
197class tmsprom_device : public device_t
198{
199public:
200   tmsprom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
201   ~tmsprom_device() { global_free(m_token); }
96202
203   // access to legacy token
204   void *token() const { assert(m_token != NULL); return m_token; }
205protected:
206   // device-level overrides
207   virtual void device_config_complete();
208   virtual void device_start();
209private:
210   // internal state
211   void *m_token;
212};
213
214extern const device_type TMSPROM;
215
216
97217#endif /* __TMS5110_H__ */
trunk/src/emu/sound/3526intf.c
r17612r17613
3939{
4040   assert(device != NULL);
4141   assert(device->type() == YM3526);
42   return (ym3526_state *)downcast<legacy_device_base *>(device)->token();
42   return (ym3526_state *)downcast<ym3526_device *>(device)->token();
4343}
4444
4545
r17612r17613
171171}
172172
173173
174DEFINE_LEGACY_SOUND_DEVICE(YM3526, ym3526);
174const device_type YM3526 = &device_creator<ym3526_device>;
175
176ym3526_device::ym3526_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
177   : device_t(mconfig, YM3526, "YM3526", tag, owner, clock),
178     device_sound_interface(mconfig, *this)
179{
180   m_token = global_alloc_array_clear(UINT8, sizeof(ym3526_state));
181}
182
183//-------------------------------------------------
184//  device_config_complete - perform any
185//  operations now that the configuration is
186//  complete
187//-------------------------------------------------
188
189void ym3526_device::device_config_complete()
190{
191}
192
193//-------------------------------------------------
194//  device_start - device-specific startup
195//-------------------------------------------------
196
197void ym3526_device::device_start()
198{
199   DEVICE_START_NAME( ym3526 )(this);
200}
201
202//-------------------------------------------------
203//  device_reset - device-specific reset
204//-------------------------------------------------
205
206void ym3526_device::device_reset()
207{
208   DEVICE_RESET_NAME( ym3526 )(this);
209}
210
211//-------------------------------------------------
212//  device_stop - device-specific stop
213//-------------------------------------------------
214
215void ym3526_device::device_stop()
216{
217   DEVICE_STOP_NAME( ym3526 )(this);
218}
219
220//-------------------------------------------------
221//  sound_stream_update - handle a stream update
222//-------------------------------------------------
223
224void ym3526_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
225{
226   // should never get here
227   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
228}
229
230
trunk/src/emu/sound/2612intf.h
r17612r17613
2727WRITE8_DEVICE_HANDLER( ym2612_data_port_b_w );
2828
2929
30DECLARE_LEGACY_SOUND_DEVICE(YM2612, ym2612);
30class ym2612_device : public device_t,
31                                  public device_sound_interface
32{
33public:
34   ym2612_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
35   ym2612_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
36   ~ym2612_device() { global_free(m_token); }
3137
38   // access to legacy token
39   void *token() const { assert(m_token != NULL); return m_token; }
40protected:
41   // device-level overrides
42   virtual void device_config_complete();
43   virtual void device_start();
44   virtual void device_stop();
45   virtual void device_reset();
3246
47   // sound stream update overrides
48   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
49private:
50   // internal state
51   void *m_token;
52};
53
54extern const device_type YM2612;
55
56
57
3358typedef struct _ym3438_interface ym3438_interface;
3459struct _ym3438_interface
3560{
r17612r17613
5176#define ym3438_data_port_b_w   ym2612_data_port_b_w
5277
5378
54DECLARE_LEGACY_SOUND_DEVICE(YM3438, ym3438);
79class ym3438_device : public ym2612_device
80{
81public:
82   ym3438_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
5583
84   // sound stream update overrides
85   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
86};
87
88extern const device_type YM3438;
89
90
5691#endif /* __2612INTF_H__ */
trunk/src/emu/sound/k051649.c
r17612r17613
6161{
6262   assert(device != NULL);
6363   assert(device->type() == K051649);
64   return (k051649_state *)downcast<legacy_device_base *>(device)->token();
64   return (k051649_state *)downcast<k051649_device *>(device)->token();
6565}
6666
6767/* build a table to divide by the number of voices */
r17612r17613
310310}
311311
312312
313DEFINE_LEGACY_SOUND_DEVICE(K051649, k051649);
313const device_type K051649 = &device_creator<k051649_device>;
314
315k051649_device::k051649_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
316   : device_t(mconfig, K051649, "K051649", tag, owner, clock),
317     device_sound_interface(mconfig, *this)
318{
319   m_token = global_alloc_array_clear(UINT8, sizeof(k051649_state));
320}
321
322//-------------------------------------------------
323//  device_config_complete - perform any
324//  operations now that the configuration is
325//  complete
326//-------------------------------------------------
327
328void k051649_device::device_config_complete()
329{
330}
331
332//-------------------------------------------------
333//  device_start - device-specific startup
334//-------------------------------------------------
335
336void k051649_device::device_start()
337{
338   DEVICE_START_NAME( k051649 )(this);
339}
340
341//-------------------------------------------------
342//  device_reset - device-specific reset
343//-------------------------------------------------
344
345void k051649_device::device_reset()
346{
347   DEVICE_RESET_NAME( k051649 )(this);
348}
349
350//-------------------------------------------------
351//  sound_stream_update - handle a stream update
352//-------------------------------------------------
353
354void k051649_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
355{
356   // should never get here
357   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
358}
359
360
trunk/src/emu/sound/3526intf.h
r17612r17613
1919WRITE8_DEVICE_HANDLER( ym3526_control_port_w );
2020WRITE8_DEVICE_HANDLER( ym3526_write_port_w );
2121
22DECLARE_LEGACY_SOUND_DEVICE(YM3526, ym3526);
22class ym3526_device : public device_t,
23                                  public device_sound_interface
24{
25public:
26   ym3526_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
27   ~ym3526_device() { global_free(m_token); }
2328
29   // access to legacy token
30   void *token() const { assert(m_token != NULL); return m_token; }
31protected:
32   // device-level overrides
33   virtual void device_config_complete();
34   virtual void device_start();
35   virtual void device_stop();
36   virtual void device_reset();
37
38   // sound stream update overrides
39   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
40private:
41   // internal state
42   void *m_token;
43};
44
45extern const device_type YM3526;
46
47
2448#endif /* __3526INTF_H__ */
trunk/src/emu/sound/k051649.h
r17612r17613
1616WRITE8_DEVICE_HANDLER( k052539_waveform_w );
1717READ8_DEVICE_HANDLER ( k052539_waveform_r );
1818
19DECLARE_LEGACY_SOUND_DEVICE(K051649, k051649);
19class k051649_device : public device_t,
20                                  public device_sound_interface
21{
22public:
23   k051649_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
24   ~k051649_device() { global_free(m_token); }
2025
26   // access to legacy token
27   void *token() const { assert(m_token != NULL); return m_token; }
28protected:
29   // device-level overrides
30   virtual void device_config_complete();
31   virtual void device_start();
32   virtual void device_reset();
33
34   // sound stream update overrides
35   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
36private:
37   // internal state
38   void *m_token;
39};
40
41extern const device_type K051649;
42
43
2144#endif /* __K051649_H__ */
trunk/src/emu/sound/c140.c
r17612r17613
109109{
110110   assert(device != NULL);
111111   assert(device->type() == C140);
112   return (c140_state *)downcast<legacy_device_base *>(device)->token();
112   return (c140_state *)downcast<c140_device *>(device)->token();
113113}
114114
115115
r17612r17613
504504}
505505
506506
507DEFINE_LEGACY_SOUND_DEVICE(C140, c140);
507const device_type C140 = &device_creator<c140_device>;
508
509c140_device::c140_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
510   : device_t(mconfig, C140, "C140", tag, owner, clock),
511     device_sound_interface(mconfig, *this)
512{
513   m_token = global_alloc_array_clear(UINT8, sizeof(c140_state));
514}
515
516//-------------------------------------------------
517//  device_config_complete - perform any
518//  operations now that the configuration is
519//  complete
520//-------------------------------------------------
521
522void c140_device::device_config_complete()
523{
524}
525
526//-------------------------------------------------
527//  device_start - device-specific startup
528//-------------------------------------------------
529
530void c140_device::device_start()
531{
532   DEVICE_START_NAME( c140 )(this);
533}
534
535//-------------------------------------------------
536//  sound_stream_update - handle a stream update
537//-------------------------------------------------
538
539void c140_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
540{
541   // should never get here
542   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
543}
544
545
trunk/src/emu/sound/msm5205.c
r17612r17613
7474{
7575   assert(device != NULL);
7676   assert(device->type() == MSM5205);
77   return (msm5205_state *)downcast<legacy_device_base *>(device)->token();
77   return (msm5205_state *)downcast<msm5205_device *>(device)->token();
7878}
7979
8080
r17612r17613
377377}
378378
379379
380DEFINE_LEGACY_SOUND_DEVICE(MSM5205, msm5205);
381DEFINE_LEGACY_SOUND_DEVICE(MSM6585, msm6585);
380const device_type MSM5205 = &device_creator<msm5205_device>;
381
382msm5205_device::msm5205_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
383   : device_t(mconfig, MSM5205, "MSM5205", tag, owner, clock),
384     device_sound_interface(mconfig, *this)
385{
386   m_token = global_alloc_array_clear(UINT8, sizeof(msm5205_state));
387}
388msm5205_device::msm5205_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
389   : device_t(mconfig, type, name, tag, owner, clock),
390     device_sound_interface(mconfig, *this)
391{
392   m_token = global_alloc_array_clear(UINT8, sizeof(msm5205_state));
393}
394
395//-------------------------------------------------
396//  device_config_complete - perform any
397//  operations now that the configuration is
398//  complete
399//-------------------------------------------------
400
401void msm5205_device::device_config_complete()
402{
403}
404
405//-------------------------------------------------
406//  device_start - device-specific startup
407//-------------------------------------------------
408
409void msm5205_device::device_start()
410{
411   DEVICE_START_NAME( msm5205 )(this);
412}
413
414//-------------------------------------------------
415//  device_reset - device-specific reset
416//-------------------------------------------------
417
418void msm5205_device::device_reset()
419{
420   DEVICE_RESET_NAME( msm5205 )(this);
421}
422
423//-------------------------------------------------
424//  sound_stream_update - handle a stream update
425//-------------------------------------------------
426
427void msm5205_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
428{
429   // should never get here
430   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
431}
432
433
434const device_type MSM6585 = &device_creator<msm6585_device>;
435
436msm6585_device::msm6585_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
437   : msm5205_device(mconfig, MSM6585, "MSM6585", tag, owner, clock)
438{
439}
440
441//-------------------------------------------------
442//  sound_stream_update - handle a stream update
443//-------------------------------------------------
444
445void msm6585_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
446{
447   // should never get here
448   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
449}
450
451
trunk/src/emu/sound/qsound.c
r17612r17613
9191{
9292   assert(device != NULL);
9393   assert(device->type() == QSOUND);
94   return (qsound_state *)downcast<legacy_device_base *>(device)->token();
94   return (qsound_state *)downcast<qsound_device *>(device)->token();
9595}
9696
9797
r17612r17613
399399
400400/**************** end of file ****************/
401401
402DEFINE_LEGACY_SOUND_DEVICE(QSOUND, qsound);
402const device_type QSOUND = &device_creator<qsound_device>;
403
404qsound_device::qsound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
405   : device_t(mconfig, QSOUND, "Q-Sound", tag, owner, clock),
406     device_sound_interface(mconfig, *this)
407{
408   m_token = global_alloc_array_clear(UINT8, sizeof(qsound_state));
409}
410
411//-------------------------------------------------
412//  device_config_complete - perform any
413//  operations now that the configuration is
414//  complete
415//-------------------------------------------------
416
417void qsound_device::device_config_complete()
418{
419}
420
421//-------------------------------------------------
422//  device_start - device-specific startup
423//-------------------------------------------------
424
425void qsound_device::device_start()
426{
427   DEVICE_START_NAME( qsound )(this);
428}
429
430//-------------------------------------------------
431//  device_stop - device-specific stop
432//-------------------------------------------------
433
434void qsound_device::device_stop()
435{
436   DEVICE_STOP_NAME( qsound )(this);
437}
438
439//-------------------------------------------------
440//  sound_stream_update - handle a stream update
441//-------------------------------------------------
442
443void qsound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
444{
445   // should never get here
446   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
447}
448
449
trunk/src/emu/sound/c140.h
r17612r17613
2424    int banking_type;
2525};
2626
27DECLARE_LEGACY_SOUND_DEVICE(C140, c140);
27class c140_device : public device_t,
28                                  public device_sound_interface
29{
30public:
31   c140_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
32   ~c140_device() { global_free(m_token); }
2833
34   // access to legacy token
35   void *token() const { assert(m_token != NULL); return m_token; }
36protected:
37   // device-level overrides
38   virtual void device_config_complete();
39   virtual void device_start();
40
41   // sound stream update overrides
42   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
43private:
44   // internal state
45   void *m_token;
46};
47
48extern const device_type C140;
49
50
2951#endif /* __C140_H__ */
trunk/src/emu/sound/msm5205.h
r17612r17613
4646
4747void msm5205_change_clock_w(device_t *device, INT32 clock);
4848
49DECLARE_LEGACY_SOUND_DEVICE(MSM5205, msm5205);
50DECLARE_LEGACY_SOUND_DEVICE(MSM6585, msm6585);
49class msm5205_device : public device_t,
50                                  public device_sound_interface
51{
52public:
53   msm5205_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
54   msm5205_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
55   ~msm5205_device() { global_free(m_token); }
5156
57   // access to legacy token
58   void *token() const { assert(m_token != NULL); return m_token; }
59protected:
60   // device-level overrides
61   virtual void device_config_complete();
62   virtual void device_start();
63   virtual void device_reset();
64
65   // sound stream update overrides
66   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
67private:
68   // internal state
69   void *m_token;
70};
71
72extern const device_type MSM5205;
73
74class msm6585_device : public msm5205_device
75{
76public:
77   msm6585_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
78
79   // sound stream update overrides
80   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
81};
82
83extern const device_type MSM6585;
84
85
5286#endif /* __MSM5205_H__ */
trunk/src/emu/sound/snkwave.c
r17612r17613
3636{
3737   assert(device != NULL);
3838   assert(device->type() == SNKWAVE);
39   return (snkwave_state *)downcast<legacy_device_base *>(device)->token();
39   return (snkwave_state *)downcast<snkwave_device *>(device)->token();
4040}
4141
4242
r17612r17613
186186   }
187187}
188188
189DEFINE_LEGACY_SOUND_DEVICE(SNKWAVE, snkwave);
189const device_type SNKWAVE = &device_creator<snkwave_device>;
190
191snkwave_device::snkwave_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
192   : device_t(mconfig, SNKWAVE, "SNK Wave", tag, owner, clock),
193     device_sound_interface(mconfig, *this)
194{
195   m_token = global_alloc_array_clear(UINT8, sizeof(snkwave_state));
196}
197
198//-------------------------------------------------
199//  device_config_complete - perform any
200//  operations now that the configuration is
201//  complete
202//-------------------------------------------------
203
204void snkwave_device::device_config_complete()
205{
206}
207
208//-------------------------------------------------
209//  device_start - device-specific startup
210//-------------------------------------------------
211
212void snkwave_device::device_start()
213{
214   DEVICE_START_NAME( snkwave )(this);
215}
216
217//-------------------------------------------------
218//  sound_stream_update - handle a stream update
219//-------------------------------------------------
220
221void snkwave_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
222{
223   // should never get here
224   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
225}
226
227
trunk/src/emu/sound/3812intf.c
r17612r17613
3737{
3838   assert(device != NULL);
3939   assert(device->type() == YM3812);
40   return (ym3812_state *)downcast<legacy_device_base *>(device)->token();
40   return (ym3812_state *)downcast<ym3812_device *>(device)->token();
4141}
4242
4343
r17612r17613
167167}
168168
169169
170DEFINE_LEGACY_SOUND_DEVICE(YM3812, ym3812);
170const device_type YM3812 = &device_creator<ym3812_device>;
171
172ym3812_device::ym3812_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
173   : device_t(mconfig, YM3812, "YM3812", tag, owner, clock),
174     device_sound_interface(mconfig, *this)
175{
176   m_token = global_alloc_array_clear(UINT8, sizeof(ym3812_state));
177}
178
179//-------------------------------------------------
180//  device_config_complete - perform any
181//  operations now that the configuration is
182//  complete
183//-------------------------------------------------
184
185void ym3812_device::device_config_complete()
186{
187}
188
189//-------------------------------------------------
190//  device_start - device-specific startup
191//-------------------------------------------------
192
193void ym3812_device::device_start()
194{
195   DEVICE_START_NAME( ym3812 )(this);
196}
197
198//-------------------------------------------------
199//  device_reset - device-specific reset
200//-------------------------------------------------
201
202void ym3812_device::device_reset()
203{
204   DEVICE_RESET_NAME( ym3812 )(this);
205}
206
207//-------------------------------------------------
208//  device_stop - device-specific stop
209//-------------------------------------------------
210
211void ym3812_device::device_stop()
212{
213   DEVICE_STOP_NAME( ym3812 )(this);
214}
215
216//-------------------------------------------------
217//  sound_stream_update - handle a stream update
218//-------------------------------------------------
219
220void ym3812_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
221{
222   // should never get here
223   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
224}
225
226
trunk/src/emu/sound/qsound.h
r17612r17613
1616WRITE8_DEVICE_HANDLER( qsound_w );
1717READ8_DEVICE_HANDLER( qsound_r );
1818
19DECLARE_LEGACY_SOUND_DEVICE(QSOUND, qsound);
19class qsound_device : public device_t,
20                                  public device_sound_interface
21{
22public:
23   qsound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
24   ~qsound_device() { global_free(m_token); }
2025
26   // access to legacy token
27   void *token() const { assert(m_token != NULL); return m_token; }
28protected:
29   // device-level overrides
30   virtual void device_config_complete();
31   virtual void device_start();
32   virtual void device_stop();
33
34   // sound stream update overrides
35   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
36private:
37   // internal state
38   void *m_token;
39};
40
41extern const device_type QSOUND;
42
43
2144#endif /* __QSOUND_H__ */
trunk/src/emu/sound/3812intf.h
r17612r17613
1919WRITE8_DEVICE_HANDLER( ym3812_control_port_w );
2020WRITE8_DEVICE_HANDLER( ym3812_write_port_w );
2121
22DECLARE_LEGACY_SOUND_DEVICE(YM3812, ym3812);
22class ym3812_device : public device_t,
23                                  public device_sound_interface
24{
25public:
26   ym3812_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
27   ~ym3812_device() { global_free(m_token); }
2328
29   // access to legacy token
30   void *token() const { assert(m_token != NULL); return m_token; }
31protected:
32   // device-level overrides
33   virtual void device_config_complete();
34   virtual void device_start();
35   virtual void device_stop();
36   virtual void device_reset();
37
38   // sound stream update overrides
39   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
40private:
41   // internal state
42   void *m_token;
43};
44
45extern const device_type YM3812;
46
47
2448#endif /* __3812INTF_H__ */
trunk/src/emu/sound/rf5c400.c
r17612r17613
9797{
9898   assert(device != NULL);
9999   assert(device->type() == RF5C400);
100   return (rf5c400_state *)downcast<legacy_device_base *>(device)->token();
100   return (rf5c400_state *)downcast<rf5c400_device *>(device)->token();
101101}
102102
103103
r17612r17613
583583   }
584584}
585585
586DEFINE_LEGACY_SOUND_DEVICE(RF5C400, rf5c400);
586const device_type RF5C400 = &device_creator<rf5c400_device>;
587
588rf5c400_device::rf5c400_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
589   : device_t(mconfig, RF5C400, "RF5C400", tag, owner, clock),
590     device_sound_interface(mconfig, *this)
591{
592   m_token = global_alloc_array_clear(UINT8, sizeof(rf5c400_state));
593}
594
595//-------------------------------------------------
596//  device_config_complete - perform any
597//  operations now that the configuration is
598//  complete
599//-------------------------------------------------
600
601void rf5c400_device::device_config_complete()
602{
603}
604
605//-------------------------------------------------
606//  device_start - device-specific startup
607//-------------------------------------------------
608
609void rf5c400_device::device_start()
610{
611   DEVICE_START_NAME( rf5c400 )(this);
612}
613
614//-------------------------------------------------
615//  sound_stream_update - handle a stream update
616//-------------------------------------------------
617
618void rf5c400_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
619{
620   // should never get here
621   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
622}
623
624
trunk/src/emu/sound/snkwave.h
r17612r17613
77
88WRITE8_DEVICE_HANDLER( snkwave_w );
99
10DECLARE_LEGACY_SOUND_DEVICE(SNKWAVE, snkwave);
10class snkwave_device : public device_t,
11                                  public device_sound_interface
12{
13public:
14   snkwave_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
15   ~snkwave_device() { global_free(m_token); }
1116
17   // access to legacy token
18   void *token() const { assert(m_token != NULL); return m_token; }
19protected:
20   // device-level overrides
21   virtual void device_config_complete();
22   virtual void device_start();
23
24   // sound stream update overrides
25   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
26private:
27   // internal state
28   void *m_token;
29};
30
31extern const device_type SNKWAVE;
32
33
1234#endif /* __SNKWAVE_H__ */
trunk/src/emu/sound/cem3394.c
r17612r17613
141141{
142142   assert(device != NULL);
143143   assert(device->type() == CEM3394);
144   return (cem3394_state *)downcast<legacy_device_base *>(device)->token();
144   return (cem3394_state *)downcast<cem3394_device *>(device)->token();
145145}
146146
147147
r17612r17613
586586}
587587
588588
589DEFINE_LEGACY_SOUND_DEVICE(CEM3394, cem3394);
589const device_type CEM3394 = &device_creator<cem3394_device>;
590
591cem3394_device::cem3394_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
592   : device_t(mconfig, CEM3394, "CEM3394", tag, owner, clock),
593     device_sound_interface(mconfig, *this)
594{
595   m_token = global_alloc_array_clear(UINT8, sizeof(cem3394_state));
596}
597
598//-------------------------------------------------
599//  device_config_complete - perform any
600//  operations now that the configuration is
601//  complete
602//-------------------------------------------------
603
604void cem3394_device::device_config_complete()
605{
606}
607
608//-------------------------------------------------
609//  device_start - device-specific startup
610//-------------------------------------------------
611
612void cem3394_device::device_start()
613{
614   DEVICE_START_NAME( cem3394 )(this);
615}
616
617//-------------------------------------------------
618//  sound_stream_update - handle a stream update
619//-------------------------------------------------
620
621void cem3394_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
622{
623   // should never get here
624   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
625}
626
627
trunk/src/emu/sound/saa1099.c
r17612r17613
171171{
172172   assert(device != NULL);
173173   assert(device->type() == SAA1099);
174   return (saa1099_state *)downcast<legacy_device_base *>(device)->token();
174   return (saa1099_state *)downcast<saa1099_device *>(device)->token();
175175}
176176
177177
r17612r17613
463463}
464464
465465
466DEFINE_LEGACY_SOUND_DEVICE(SAA1099, saa1099);
466const device_type SAA1099 = &device_creator<saa1099_device>;
467
468saa1099_device::saa1099_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
469   : device_t(mconfig, SAA1099, "SAA1099", tag, owner, clock),
470     device_sound_interface(mconfig, *this)
471{
472   m_token = global_alloc_array_clear(UINT8, sizeof(saa1099_state));
473}
474
475//-------------------------------------------------
476//  device_config_complete - perform any
477//  operations now that the configuration is
478//  complete
479//-------------------------------------------------
480
481void saa1099_device::device_config_complete()
482{
483}
484
485//-------------------------------------------------
486//  device_start - device-specific startup
487//-------------------------------------------------
488
489void saa1099_device::device_start()
490{
491   DEVICE_START_NAME( saa1099 )(this);
492}
493
494//-------------------------------------------------
495//  sound_stream_update - handle a stream update
496//-------------------------------------------------
497
498void saa1099_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
499{
500   // should never get here
501   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
502}
503
504
trunk/src/emu/sound/digitalk.c
r17612r17613
288288{
289289   assert(device != NULL);
290290   assert(device->type() == DIGITALKER);
291   return (digitalker *)downcast<legacy_device_base *>(device)->token();
291   return (digitalker *)downcast<digitalker_device *>(device)->token();
292292}
293293
294294
r17612r17613
705705}
706706
707707
708DEFINE_LEGACY_SOUND_DEVICE(DIGITALKER, digitalker);
708const device_type DIGITALKER = &device_creator<digitalker_device>;
709
710digitalker_device::digitalker_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
711   : device_t(mconfig, DIGITALKER, "Digitalker", tag, owner, clock),
712     device_sound_interface(mconfig, *this)
713{
714   m_token = global_alloc_array_clear(UINT8, sizeof(digitalker));
715}
716
717//-------------------------------------------------
718//  device_config_complete - perform any
719//  operations now that the configuration is
720//  complete
721//-------------------------------------------------
722
723void digitalker_device::device_config_complete()
724{
725}
726
727//-------------------------------------------------
728//  device_start - device-specific startup
729//-------------------------------------------------
730
731void digitalker_device::device_start()
732{
733   DEVICE_START_NAME( digitalker )(this);
734}
735
736//-------------------------------------------------
737//  sound_stream_update - handle a stream update
738//-------------------------------------------------
739
740void digitalker_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
741{
742   // should never get here
743   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
744}
745
746
trunk/src/emu/sound/rf5c400.h
r17612r17613
1010READ16_DEVICE_HANDLER( rf5c400_r );
1111WRITE16_DEVICE_HANDLER( rf5c400_w );
1212
13DECLARE_LEGACY_SOUND_DEVICE(RF5C400, rf5c400);
13class rf5c400_device : public device_t,
14                                  public device_sound_interface
15{
16public:
17   rf5c400_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
18   ~rf5c400_device() { global_free(m_token); }
1419
20   // access to legacy token
21   void *token() const { assert(m_token != NULL); return m_token; }
22protected:
23   // device-level overrides
24   virtual void device_config_complete();
25   virtual void device_start();
26
27   // sound stream update overrides
28   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
29private:
30   // internal state
31   void *m_token;
32};
33
34extern const device_type RF5C400;
35
36
1537#endif /* __RF5C400_H__ */
trunk/src/emu/sound/cem3394.h
r17612r17613
4545    CEM3394_FINAL_GAIN:         gain, in dB */
4646double cem3394_get_parameter(device_t *device, int input);
4747
48DECLARE_LEGACY_SOUND_DEVICE(CEM3394, cem3394);
48class cem3394_device : public device_t,
49                                  public device_sound_interface
50{
51public:
52   cem3394_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
53   ~cem3394_device() { global_free(m_token); }
4954
55   // access to legacy token
56   void *token() const { assert(m_token != NULL); return m_token; }
57protected:
58   // device-level overrides
59   virtual void device_config_complete();
60   virtual void device_start();
61
62   // sound stream update overrides
63   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
64private:
65   // internal state
66   void *m_token;
67};
68
69extern const device_type CEM3394;
70
71
5072#endif /* __CEM3394_H__ */
trunk/src/emu/sound/saa1099.h
r17612r17613
1212WRITE8_DEVICE_HANDLER( saa1099_control_w );
1313WRITE8_DEVICE_HANDLER( saa1099_data_w );
1414
15DECLARE_LEGACY_SOUND_DEVICE(SAA1099, saa1099);
15class saa1099_device : public device_t,
16                                  public device_sound_interface
17{
18public:
19   saa1099_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
20   ~saa1099_device() { global_free(m_token); }
1621
22   // access to legacy token
23   void *token() const { assert(m_token != NULL); return m_token; }
24protected:
25   // device-level overrides
26   virtual void device_config_complete();
27   virtual void device_start();
28
29   // sound stream update overrides
30   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
31private:
32   // internal state
33   void *m_token;
34};
35
36extern const device_type SAA1099;
37
38
1739#endif /* __SAA1099_H__ */
trunk/src/emu/sound/digitalk.h
r17612r17613
99int digitalker_0_intr_r(device_t *device);
1010WRITE8_DEVICE_HANDLER(digitalker_data_w);
1111
12DECLARE_LEGACY_SOUND_DEVICE(DIGITALKER, digitalker);
12class digitalker_device : public device_t,
13                                  public device_sound_interface
14{
15public:
16   digitalker_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
17   ~digitalker_device() { global_free(m_token); }
1318
19   // access to legacy token
20   void *token() const { assert(m_token != NULL); return m_token; }
21protected:
22   // device-level overrides
23   virtual void device_config_complete();
24   virtual void device_start();
25
26   // sound stream update overrides
27   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
28private:
29   // internal state
30   void *m_token;
31};
32
33extern const device_type DIGITALKER;
34
35
1436#endif
trunk/src/emu/sound/ymz280b.c
r17612r17613
137137{
138138   assert(device != NULL);
139139   assert(device->type() == YMZ280B);
140   return (ymz280b_state *)downcast<legacy_device_base *>(device)->token();
140   return (ymz280b_state *)downcast<ymz280b_device *>(device)->token();
141141}
142142
143143
r17612r17613
10731073}
10741074
10751075
1076DEFINE_LEGACY_SOUND_DEVICE(YMZ280B, ymz280b);
1076const device_type YMZ280B = &device_creator<ymz280b_device>;
1077
1078ymz280b_device::ymz280b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1079   : device_t(mconfig, YMZ280B, "YMZ280B", tag, owner, clock),
1080     device_sound_interface(mconfig, *this)
1081{
1082   m_token = global_alloc_array_clear(UINT8, sizeof(ymz280b_state));
1083}
1084
1085//-------------------------------------------------
1086//  device_config_complete - perform any
1087//  operations now that the configuration is
1088//  complete
1089//-------------------------------------------------
1090
1091void ymz280b_device::device_config_complete()
1092{
1093}
1094
1095//-------------------------------------------------
1096//  device_start - device-specific startup
1097//-------------------------------------------------
1098
1099void ymz280b_device::device_start()
1100{
1101   DEVICE_START_NAME( ymz280b )(this);
1102}
1103
1104//-------------------------------------------------
1105//  device_reset - device-specific reset
1106//-------------------------------------------------
1107
1108void ymz280b_device::device_reset()
1109{
1110   DEVICE_RESET_NAME( ymz280b )(this);
1111}
1112
1113//-------------------------------------------------
1114//  sound_stream_update - handle a stream update
1115//-------------------------------------------------
1116
1117void ymz280b_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
1118{
1119   // should never get here
1120   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
1121}
1122
1123
trunk/src/emu/sound/rf5c68.c
r17612r17613
4040{
4141   assert(device != NULL);
4242   assert(device->type() == RF5C68);
43   return (rf5c68_state *)downcast<legacy_device_base *>(device)->token();
43   return (rf5c68_state *)downcast<rf5c68_device *>(device)->token();
4444}
4545
4646
r17612r17613
287287
288288/**************** end of file ****************/
289289
290DEFINE_LEGACY_SOUND_DEVICE(RF5C68, rf5c68);
290const device_type RF5C68 = &device_creator<rf5c68_device>;
291
292rf5c68_device::rf5c68_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
293   : device_t(mconfig, RF5C68, "RF5C68", tag, owner, clock),
294     device_sound_interface(mconfig, *this)
295{
296   m_token = global_alloc_array_clear(UINT8, sizeof(rf5c68_state));
297}
298
299//-------------------------------------------------
300//  device_config_complete - perform any
301//  operations now that the configuration is
302//  complete
303//-------------------------------------------------
304
305void rf5c68_device::device_config_complete()
306{
307}
308
309//-------------------------------------------------
310//  device_start - device-specific startup
311//-------------------------------------------------
312
313void rf5c68_device::device_start()
314{
315   DEVICE_START_NAME( rf5c68 )(this);
316}
317
318//-------------------------------------------------
319//  sound_stream_update - handle a stream update
320//-------------------------------------------------
321
322void rf5c68_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
323{
324   // should never get here
325   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
326}
327
328
trunk/src/emu/sound/mos6560.c
r17612r17613
125125   assert(device != NULL);
126126   assert(device->type() == MOS656X);
127127
128   return (mos6560_state *)downcast<legacy_device_base *>(device)->token();
128   return (mos6560_state *)downcast<mos6560_device *>(device)->token();
129129}
130130
131131INLINE const mos6560_interface *get_interface( device_t *device )
r17612r17613
970970 }
971971}
972972
973DEFINE_LEGACY_SOUND_DEVICE(MOS656X, mos6560);
973const device_type MOS656X = &device_creator<mos6560_device>;
974
975mos6560_device::mos6560_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
976   : device_t(mconfig, MOS656X, "MOS 6560 / 6561 VIC", tag, owner, clock),
977     device_sound_interface(mconfig, *this)
978{
979   m_token = global_alloc_array_clear(UINT8, sizeof(mos6560_state));
980}
981
982//-------------------------------------------------
983//  device_config_complete - perform any
984//  operations now that the configuration is
985//  complete
986//-------------------------------------------------
987
988void mos6560_device::device_config_complete()
989{
990}
991
992//-------------------------------------------------
993//  device_start - device-specific startup
994//-------------------------------------------------
995
996void mos6560_device::device_start()
997{
998   DEVICE_START_NAME( mos6560 )(this);
999}
1000
1001//-------------------------------------------------
1002//  device_reset - device-specific reset
1003//-------------------------------------------------
1004
1005void mos6560_device::device_reset()
1006{
1007   DEVICE_RESET_NAME( mos6560 )(this);
1008}
1009
1010//-------------------------------------------------
1011//  sound_stream_update - handle a stream update
1012//-------------------------------------------------
1013
1014void mos6560_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
1015{
1016   // should never get here
1017   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
1018}
1019
1020
trunk/src/emu/sound/ymz280b.h
r17612r17613
2424READ8_DEVICE_HANDLER ( ymz280b_r );
2525WRITE8_DEVICE_HANDLER( ymz280b_w );
2626
27DECLARE_LEGACY_SOUND_DEVICE(YMZ280B, ymz280b);
27class ymz280b_device : public device_t,
28                                  public device_sound_interface
29{
30public:
31   ymz280b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
32   ~ymz280b_device() { global_free(m_token); }
2833
34   // access to legacy token
35   void *token() const { assert(m_token != NULL); return m_token; }
36protected:
37   // device-level overrides
38   virtual void device_config_complete();
39   virtual void device_start();
40   virtual void device_reset();
41
42   // sound stream update overrides
43   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
44private:
45   // internal state
46   void *m_token;
47};
48
49extern const device_type YMZ280B;
50
51
2952#endif /* __YMZ280B_H__ */
trunk/src/emu/sound/k005289.c
r17612r17613
6464{
6565   assert(device != NULL);
6666   assert(device->type() == K005289);
67   return (k005289_state *)downcast<legacy_device_base *>(device)->token();
67   return (k005289_state *)downcast<k005289_device *>(device)->token();
6868}
6969
7070/* build a table to divide by the number of voices */
r17612r17613
274274}
275275
276276
277DEFINE_LEGACY_SOUND_DEVICE(K005289, k005289);
277const device_type K005289 = &device_creator<k005289_device>;
278
279k005289_device::k005289_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
280   : device_t(mconfig, K005289, "K005289", tag, owner, clock),
281     device_sound_interface(mconfig, *this)
282{
283   m_token = global_alloc_array_clear(UINT8, sizeof(k005289_state));
284}
285
286//-------------------------------------------------
287//  device_config_complete - perform any
288//  operations now that the configuration is
289//  complete
290//-------------------------------------------------
291
292void k005289_device::device_config_complete()
293{
294}
295
296//-------------------------------------------------
297//  device_start - device-specific startup
298//-------------------------------------------------
299
300void k005289_device::device_start()
301{
302   DEVICE_START_NAME( k005289 )(this);
303}
304
305//-------------------------------------------------
306//  sound_stream_update - handle a stream update
307//-------------------------------------------------
308
309void k005289_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
310{
311   // should never get here
312   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
313}
314
315
trunk/src/emu/sound/rf5c68.h
r17612r17613
2222   void (*sample_end_callback)(device_t* device, int channel);
2323};
2424
25DECLARE_LEGACY_SOUND_DEVICE(RF5C68, rf5c68);
25class rf5c68_device : public device_t,
26                                  public device_sound_interface
27{
28public:
29   rf5c68_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
30   ~rf5c68_device() { global_free(m_token); }
2631
32   // access to legacy token
33   void *token() const { assert(m_token != NULL); return m_token; }
34protected:
35   // device-level overrides
36   virtual void device_config_complete();
37   virtual void device_start();
38
39   // sound stream update overrides
40   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
41private:
42   // internal state
43   void *m_token;
44};
45
46extern const device_type RF5C68;
47
48
2749#endif /* __RF5C68_H__ */
trunk/src/emu/sound/mos6560.h
r17612r17613
8888    INFO PROTOTYPES
8989***************************************************************************/
9090
91DECLARE_LEGACY_SOUND_DEVICE(MOS656X, mos6560);
91class mos6560_device : public device_t,
92                                  public device_sound_interface
93{
94public:
95   mos6560_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
96   ~mos6560_device() { global_free(m_token); }
9297
98   // access to legacy token
99   void *token() const { assert(m_token != NULL); return m_token; }
100protected:
101   // device-level overrides
102   virtual void device_config_complete();
103   virtual void device_start();
104   virtual void device_reset();
105
106   // sound stream update overrides
107   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
108private:
109   // internal state
110   void *m_token;
111};
112
113extern const device_type MOS656X;
114
115
93116/***************************************************************************
94117    DEVICE CONFIGURATION MACROS
95118***************************************************************************/
trunk/src/emu/sound/k005289.h
r17612r17613
1212WRITE8_DEVICE_HANDLER( k005289_keylatch_A_w );
1313WRITE8_DEVICE_HANDLER( k005289_keylatch_B_w );
1414
15DECLARE_LEGACY_SOUND_DEVICE(K005289, k005289);
15class k005289_device : public device_t,
16                                  public device_sound_interface
17{
18public:
19   k005289_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
20   ~k005289_device() { global_free(m_token); }
1621
22   // access to legacy token
23   void *token() const { assert(m_token != NULL); return m_token; }
24protected:
25   // device-level overrides
26   virtual void device_config_complete();
27   virtual void device_start();
28
29   // sound stream update overrides
30   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
31private:
32   // internal state
33   void *m_token;
34};
35
36extern const device_type K005289;
37
38
1739#endif /* __K005289_H__ */
trunk/src/emu/sound/aica.c
r17612r17613
217217{
218218   assert(device != NULL);
219219   assert(device->type() == AICA);
220   return (aica_state *)downcast<legacy_device_base *>(device)->token();
220   return (aica_state *)downcast<aica_device *>(device)->token();
221221}
222222
223223static unsigned char DecodeSCI(aica_state *AICA, unsigned char irq)
r17612r17613
13801380
13811381
13821382
1383DEFINE_LEGACY_SOUND_DEVICE(AICA, aica);
1383const device_type AICA = &device_creator<aica_device>;
1384
1385aica_device::aica_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1386   : device_t(mconfig, AICA, "AICA", tag, owner, clock),
1387     device_sound_interface(mconfig, *this)
1388{
1389   m_token = global_alloc_array_clear(UINT8, sizeof(aica_state));
1390}
1391
1392//-------------------------------------------------
1393//  device_config_complete - perform any
1394//  operations now that the configuration is
1395//  complete
1396//-------------------------------------------------
1397
1398void aica_device::device_config_complete()
1399{
1400}
1401
1402//-------------------------------------------------
1403//  device_start - device-specific startup
1404//-------------------------------------------------
1405
1406void aica_device::device_start()
1407{
1408   DEVICE_START_NAME( aica )(this);
1409}
1410
1411//-------------------------------------------------
1412//  device_stop - device-specific stop
1413//-------------------------------------------------
1414
1415void aica_device::device_stop()
1416{
1417   DEVICE_STOP_NAME( aica )(this);
1418}
1419
1420//-------------------------------------------------
1421//  sound_stream_update - handle a stream update
1422//-------------------------------------------------
1423
1424void aica_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
1425{
1426   // should never get here
1427   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
1428}
1429
1430
trunk/src/emu/sound/sn76496.c
r17612r17613
160160         device->type() == NCR7496 ||
161161         device->type() == GAMEGEAR ||
162162         device->type() == SEGAPSG);
163   return (sn76496_state *)downcast<legacy_device_base *>(device)->token();
163   return (sn76496_state *)downcast<sn76496_device *>(device)->token();
164164}
165165
166166READ_LINE_DEVICE_HANDLER( sn76496_ready_r )
r17612r17613
603603}
604604
605605
606DEFINE_LEGACY_SOUND_DEVICE(SN76496, sn76496);
607DEFINE_LEGACY_SOUND_DEVICE(U8106, u8106);
608DEFINE_LEGACY_SOUND_DEVICE(Y2404, y2404);
609DEFINE_LEGACY_SOUND_DEVICE(SN76489, sn76489);
610DEFINE_LEGACY_SOUND_DEVICE(SN76489A, sn76489a);
611DEFINE_LEGACY_SOUND_DEVICE(SN76494, sn76494);
612DEFINE_LEGACY_SOUND_DEVICE(SN94624, sn94624);
613DEFINE_LEGACY_SOUND_DEVICE(NCR7496, ncr7496);
614DEFINE_LEGACY_SOUND_DEVICE(GAMEGEAR, gamegear);
615DEFINE_LEGACY_SOUND_DEVICE(SEGAPSG, segapsg);
606const device_type SN76496 = &device_creator<sn76496_device>;
616607
608sn76496_device::sn76496_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
609   : device_t(mconfig, SN76496, "SN76496", tag, owner, clock),
610     device_sound_interface(mconfig, *this)
611{
612   m_token = global_alloc_array_clear(UINT8, sizeof(sn76496_state));
613}
614sn76496_device::sn76496_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
615   : device_t(mconfig, type, name, tag, owner, clock),
616     device_sound_interface(mconfig, *this)
617{
618   m_token = global_alloc_array_clear(UINT8, sizeof(sn76496_state));
619}
620
621//-------------------------------------------------
622//  device_config_complete - perform any
623//  operations now that the configuration is
624//  complete
625//-------------------------------------------------
626
627void sn76496_device::device_config_complete()
628{
629}
630
631//-------------------------------------------------
632//  device_start - device-specific startup
633//-------------------------------------------------
634
635void sn76496_device::device_start()
636{
637   DEVICE_START_NAME( sn76496 )(this);
638}
639
640//-------------------------------------------------
641//  sound_stream_update - handle a stream update
642//-------------------------------------------------
643
644void sn76496_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
645{
646   // should never get here
647   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
648}
649
650
651const device_type U8106 = &device_creator<u8106_device>;
652
653u8106_device::u8106_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
654   : sn76496_device(mconfig, U8106, "U8106", tag, owner, clock)
655{
656}
657
658//-------------------------------------------------
659//  device_start - device-specific startup
660//-------------------------------------------------
661
662void u8106_device::device_start()
663{
664   DEVICE_START_NAME( u8106 )(this);
665}
666
667//-------------------------------------------------
668//  sound_stream_update - handle a stream update
669//-------------------------------------------------
670
671void u8106_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
672{
673   // should never get here
674   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
675}
676
677
678const device_type Y2404 = &device_creator<y2404_device>;
679
680y2404_device::y2404_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
681   : sn76496_device(mconfig, Y2404, "Y2404", tag, owner, clock)
682{
683}
684
685//-------------------------------------------------
686//  device_start - device-specific startup
687//-------------------------------------------------
688
689void y2404_device::device_start()
690{
691   DEVICE_START_NAME( y2404 )(this);
692}
693
694//-------------------------------------------------
695//  sound_stream_update - handle a stream update
696//-------------------------------------------------
697
698void y2404_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
699{
700   // should never get here
701   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
702}
703
704
705const device_type SN76489 = &device_creator<sn76489_device>;
706
707sn76489_device::sn76489_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
708   : sn76496_device(mconfig, SN76489, "SN76489", tag, owner, clock)
709{
710}
711
712//-------------------------------------------------
713//  device_start - device-specific startup
714//-------------------------------------------------
715
716void sn76489_device::device_start()
717{
718   DEVICE_START_NAME( sn76489 )(this);
719}
720
721//-------------------------------------------------
722//  sound_stream_update - handle a stream update
723//-------------------------------------------------
724
725void sn76489_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
726{
727   // should never get here
728   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
729}
730
731
732const device_type SN76489A = &device_creator<sn76489a_device>;
733
734sn76489a_device::sn76489a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
735   : sn76496_device(mconfig, SN76489A, "SN76489A", tag, owner, clock)
736{
737}
738
739//-------------------------------------------------
740//  device_start - device-specific startup
741//-------------------------------------------------
742
743void sn76489a_device::device_start()
744{
745   DEVICE_START_NAME( sn76489a )(this);
746}
747
748//-------------------------------------------------
749//  sound_stream_update - handle a stream update
750//-------------------------------------------------
751
752void sn76489a_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
753{
754   // should never get here
755   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
756}
757
758
759const device_type SN76494 = &device_creator<sn76494_device>;
760
761sn76494_device::sn76494_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
762   : sn76496_device(mconfig, SN76494, "SN76494", tag, owner, clock)
763{
764}
765
766//-------------------------------------------------
767//  device_start - device-specific startup
768//-------------------------------------------------
769
770void sn76494_device::device_start()
771{
772   DEVICE_START_NAME( sn76494 )(this);
773}
774
775//-------------------------------------------------
776//  sound_stream_update - handle a stream update
777//-------------------------------------------------
778
779void sn76494_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
780{
781   // should never get here
782   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
783}
784
785
786const device_type SN94624 = &device_creator<sn94624_device>;
787
788sn94624_device::sn94624_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
789   : sn76496_device(mconfig, SN94624, "SN94624", tag, owner, clock)
790{
791}
792
793//-------------------------------------------------
794//  device_start - device-specific startup
795//-------------------------------------------------
796
797void sn94624_device::device_start()
798{
799   DEVICE_START_NAME( sn94624 )(this);
800}
801
802//-------------------------------------------------
803//  sound_stream_update - handle a stream update
804//-------------------------------------------------
805
806void sn94624_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
807{
808   // should never get here
809   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
810}
811
812
813const device_type NCR7496 = &device_creator<ncr7496_device>;
814
815ncr7496_device::ncr7496_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
816   : sn76496_device(mconfig, NCR7496, "NCR7496", tag, owner, clock)
817{
818}
819
820//-------------------------------------------------
821//  device_start - device-specific startup
822//-------------------------------------------------
823
824void ncr7496_device::device_start()
825{
826   DEVICE_START_NAME( ncr7496 )(this);
827}
828
829//-------------------------------------------------
830//  sound_stream_update - handle a stream update
831//-------------------------------------------------
832
833void ncr7496_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
834{
835   // should never get here
836   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
837}
838
839
840const device_type GAMEGEAR = &device_creator<gamegear_device>;
841
842gamegear_device::gamegear_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
843   : sn76496_device(mconfig, GAMEGEAR, "Game Gear PSG", tag, owner, clock)
844{
845}
846
847//-------------------------------------------------
848//  device_start - device-specific startup
849//-------------------------------------------------
850
851void gamegear_device::device_start()
852{
853   DEVICE_START_NAME( gamegear )(this);
854}
855
856//-------------------------------------------------
857//  sound_stream_update - handle a stream update
858//-------------------------------------------------
859
860void gamegear_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
861{
862   // should never get here
863   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
864}
865
866
867const device_type SEGAPSG = &device_creator<segapsg_device>;
868
869segapsg_device::segapsg_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
870   : sn76496_device(mconfig, SEGAPSG, "SEGA VDP PSG", tag, owner, clock)
871{
872}
873
874//-------------------------------------------------
875//  device_start - device-specific startup
876//-------------------------------------------------
877
878void segapsg_device::device_start()
879{
880   DEVICE_START_NAME( segapsg )(this);
881}
882
883//-------------------------------------------------
884//  sound_stream_update - handle a stream update
885//-------------------------------------------------
886
887void segapsg_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
888{
889   // should never get here
890   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
891}
892
893
894
617895/*****************************************************************
618896    New class implementation
619897    Michael Zapf, June 2012
trunk/src/emu/sound/aica.h
r17612r17613
2626WRITE16_DEVICE_HANDLER( aica_midi_in );
2727READ16_DEVICE_HANDLER( aica_midi_out_r );
2828
29DECLARE_LEGACY_SOUND_DEVICE(AICA, aica);
29class aica_device : public device_t,
30                                  public device_sound_interface
31{
32public:
33   aica_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
34   ~aica_device() { global_free(m_token); }
3035
36   // access to legacy token
37   void *token() const { assert(m_token != NULL); return m_token; }
38protected:
39   // device-level overrides
40   virtual void device_config_complete();
41   virtual void device_start();
42   virtual void device_stop();
43
44   // sound stream update overrides
45   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
46private:
47   // internal state
48   void *m_token;
49};
50
51extern const device_type AICA;
52
53
3154#endif /* __AICA_H__ */
trunk/src/emu/sound/wave.c
r17612r17613
109109}
110110
111111
112DEFINE_LEGACY_SOUND_DEVICE(WAVE, wave);
112const device_type WAVE = &device_creator<wave_device>;
113
114wave_device::wave_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
115   : device_t(mconfig, WAVE, "Cassette", tag, owner, clock),
116     device_sound_interface(mconfig, *this)
117{
118}
119
120//-------------------------------------------------
121//  device_config_complete - perform any
122//  operations now that the configuration is
123//  complete
124//-------------------------------------------------
125
126void wave_device::device_config_complete()
127{
128}
129
130//-------------------------------------------------
131//  device_start - device-specific startup
132//-------------------------------------------------
133
134void wave_device::device_start()
135{
136   DEVICE_START_NAME( wave )(this);
137}
138
139//-------------------------------------------------
140//  sound_stream_update - handle a stream update
141//-------------------------------------------------
142
143void wave_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
144{
145   // should never get here
146   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
147}
148
149
trunk/src/emu/sound/astrocde.c
r17612r17613
7373{
7474   assert(device != NULL);
7575   assert(device->type() == ASTROCADE);
76   return (astrocade_state *)downcast<legacy_device_base *>(device)->token();
76   return (astrocade_state *)downcast<astrocade_device *>(device)->token();
7777}
7878
7979
r17612r17613
331331}
332332
333333
334DEFINE_LEGACY_SOUND_DEVICE(ASTROCADE, astrocade);
334const device_type ASTROCADE = &device_creator<astrocade_device>;
335
336astrocade_device::astrocade_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
337   : device_t(mconfig, ASTROCADE, "Astrocade", tag, owner, clock),
338     device_sound_interface(mconfig, *this)
339{
340   m_token = global_alloc_array_clear(UINT8, sizeof(astrocade_state));
341}
342
343//-------------------------------------------------
344//  device_config_complete - perform any
345//  operations now that the configuration is
346//  complete
347//-------------------------------------------------
348
349void astrocade_device::device_config_complete()
350{
351}
352
353//-------------------------------------------------
354//  device_start - device-specific startup
355//-------------------------------------------------
356
357void astrocade_device::device_start()
358{
359   DEVICE_START_NAME( astrocade )(this);
360}
361
362//-------------------------------------------------
363//  device_reset - device-specific reset
364//-------------------------------------------------
365
366void astrocade_device::device_reset()
367{
368   DEVICE_RESET_NAME( astrocade )(this);
369}
370
371//-------------------------------------------------
372//  sound_stream_update - handle a stream update
373//-------------------------------------------------
374
375void astrocade_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
376{
377   // should never get here
378   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
379}
380
381
trunk/src/emu/sound/sn76496.h
r17612r17613
99WRITE8_DEVICE_HANDLER( sn76496_w );
1010WRITE8_DEVICE_HANDLER( sn76496_stereo_w );
1111
12DECLARE_LEGACY_SOUND_DEVICE(SN76496, sn76496);
13DECLARE_LEGACY_SOUND_DEVICE(U8106, u8106);
14DECLARE_LEGACY_SOUND_DEVICE(Y2404, y2404);
15DECLARE_LEGACY_SOUND_DEVICE(SN76489, sn76489);
16DECLARE_LEGACY_SOUND_DEVICE(SN76489A, sn76489a);
17DECLARE_LEGACY_SOUND_DEVICE(SN76494, sn76494);
18DECLARE_LEGACY_SOUND_DEVICE(SN94624, sn94624);
19DECLARE_LEGACY_SOUND_DEVICE(NCR7496, ncr7496);
20DECLARE_LEGACY_SOUND_DEVICE(GAMEGEAR, gamegear);
21DECLARE_LEGACY_SOUND_DEVICE(SEGAPSG, segapsg);
12class sn76496_device : public device_t,
13                                  public device_sound_interface
14{
15public:
16   sn76496_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
17   sn76496_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
18   ~sn76496_device() { global_free(m_token); }
2219
20   // access to legacy token
21   void *token() const { assert(m_token != NULL); return m_token; }
22protected:
23   // device-level overrides
24   virtual void device_config_complete();
25   virtual void device_start();
26
27   // sound stream update overrides
28   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
29private:
30   // internal state
31   void *m_token;
32};
33
34extern const device_type SN76496;
35
36class u8106_device : public sn76496_device
37{
38public:
39   u8106_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
40protected:
41   // device-level overrides
42   virtual void device_start();
43
44   // sound stream update overrides
45   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
46};
47
48extern const device_type U8106;
49
50class y2404_device : public sn76496_device
51{
52public:
53   y2404_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
54protected:
55   // device-level overrides
56   virtual void device_start();
57
58   // sound stream update overrides
59   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
60};
61
62extern const device_type Y2404;
63
64class sn76489_device : public sn76496_device
65{
66public:
67   sn76489_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
68protected:
69   // device-level overrides
70   virtual void device_start();
71
72   // sound stream update overrides
73   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
74};
75
76extern const device_type SN76489;
77
78class sn76489a_device : public sn76496_device
79{
80public:
81   sn76489a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
82protected:
83   // device-level overrides
84   virtual void device_start();
85
86   // sound stream update overrides
87   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
88};
89
90extern const device_type SN76489A;
91
92class sn76494_device : public sn76496_device
93{
94public:
95   sn76494_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
96protected:
97   // device-level overrides
98   virtual void device_start();
99
100   // sound stream update overrides
101   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
102};
103
104extern const device_type SN76494;
105
106class sn94624_device : public sn76496_device
107{
108public:
109   sn94624_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
110protected:
111   // device-level overrides
112   virtual void device_start();
113
114   // sound stream update overrides
115   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
116};
117
118extern const device_type SN94624;
119
120class ncr7496_device : public sn76496_device
121{
122public:
123   ncr7496_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
124protected:
125   // device-level overrides
126   virtual void device_start();
127
128   // sound stream update overrides
129   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
130};
131
132extern const device_type NCR7496;
133
134class gamegear_device : public sn76496_device
135{
136public:
137   gamegear_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
138protected:
139   // device-level overrides
140   virtual void device_start();
141
142   // sound stream update overrides
143   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
144};
145
146extern const device_type GAMEGEAR;
147
148class segapsg_device : public sn76496_device
149{
150public:
151   segapsg_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
152protected:
153   // device-level overrides
154   virtual void device_start();
155
156   // sound stream update overrides
157   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
158};
159
160extern const device_type SEGAPSG;
161
162
23163/*****************************************************************
24164    New class implementation
25165    Michael Zapf, June 2012
trunk/src/emu/sound/wave.h
r17612r17613
99 *  CassetteWave interface
1010 *****************************************************************************/
1111
12DECLARE_LEGACY_SOUND_DEVICE(WAVE, wave);
12class wave_device : public device_t,
13                                  public device_sound_interface
14{
15public:
16   wave_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
1317
18protected:
19   // device-level overrides
20   virtual void device_config_complete();
21   virtual void device_start();
22
23   // sound stream update overrides
24   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
25private:
26};
27
28extern const device_type WAVE;
29
30
1431#define WAVE_TAG      "wave"
1532#define WAVE2_TAG      "wave2"
1633
trunk/src/emu/sound/x1_010.c
r17612r17613
101101{
102102   assert(device != NULL);
103103   assert(device->type() == X1_010);
104   return (x1_010_state *)downcast<legacy_device_base *>(device)->token();
104   return (x1_010_state *)downcast<x1_010_device *>(device)->token();
105105}
106106
107107
r17612r17613
311311}
312312
313313
314DEFINE_LEGACY_SOUND_DEVICE(X1_010, x1_010);
314const device_type X1_010 = &device_creator<x1_010_device>;
315
316x1_010_device::x1_010_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
317   : device_t(mconfig, X1_010, "X1-010", tag, owner, clock),
318     device_sound_interface(mconfig, *this)
319{
320   m_token = global_alloc_array_clear(UINT8, sizeof(x1_010_state));
321}
322
323//-------------------------------------------------
324//  device_config_complete - perform any
325//  operations now that the configuration is
326//  complete
327//-------------------------------------------------
328
329void x1_010_device::device_config_complete()
330{
331}
332
333//-------------------------------------------------
334//  device_start - device-specific startup
335//-------------------------------------------------
336
337void x1_010_device::device_start()
338{
339   DEVICE_START_NAME( x1_010 )(this);
340}
341
342//-------------------------------------------------
343//  sound_stream_update - handle a stream update
344//-------------------------------------------------
345
346void x1_010_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
347{
348   // should never get here
349   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
350}
351
352
trunk/src/emu/sound/astrocde.h
r17612r17613
77
88WRITE8_DEVICE_HANDLER( astrocade_sound_w );
99
10DECLARE_LEGACY_SOUND_DEVICE(ASTROCADE, astrocade);
10class astrocade_device : public device_t,
11                                  public device_sound_interface
12{
13public:
14   astrocade_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
15   ~astrocade_device() { global_free(m_token); }
1116
17   // access to legacy token
18   void *token() const { assert(m_token != NULL); return m_token; }
19protected:
20   // device-level overrides
21   virtual void device_config_complete();
22   virtual void device_start();
23   virtual void device_reset();
24
25   // sound stream update overrides
26   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
27private:
28   // internal state
29   void *m_token;
30};
31
32extern const device_type ASTROCADE;
33
34
1235#endif /* __ASTROCDE_H__ */
trunk/src/emu/sound/x1_010.h
r17612r17613
2121
2222void seta_sound_enable_w(device_t *device, int data);
2323
24DECLARE_LEGACY_SOUND_DEVICE(X1_010, x1_010);
24class x1_010_device : public device_t,
25                                  public device_sound_interface
26{
27public:
28   x1_010_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
29   ~x1_010_device() { global_free(m_token); }
2530
31   // access to legacy token
32   void *token() const { assert(m_token != NULL); return m_token; }
33protected:
34   // device-level overrides
35   virtual void device_config_complete();
36   virtual void device_start();
37
38   // sound stream update overrides
39   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
40private:
41   // internal state
42   void *m_token;
43};
44
45extern const device_type X1_010;
46
47
2648#endif /* __X1_010_H__ */
trunk/src/emu/sound/k056800.c
r17612r17613
2929   assert(device != NULL);
3030   assert(device->type() == K056800);
3131
32   return (k056800_state *)downcast<legacy_device_base *>(device)->token();
32   return (k056800_state *)downcast<k056800_device *>(device)->token();
3333}
3434
3535INLINE const k056800_interface *k056800_get_interface( device_t *device )
r17612r17613
179179 }
180180}
181181
182DEFINE_LEGACY_DEVICE(K056800, k056800);
182const device_type K056800 = &device_creator<k056800_device>;
183
184k056800_device::k056800_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
185   : device_t(mconfig, K056800, "Konami 056800 MIRAC", tag, owner, clock)
186{
187   m_token = global_alloc_array_clear(UINT8, sizeof(k056800_state));
188}
189
190//-------------------------------------------------
191//  device_config_complete - perform any
192//  operations now that the configuration is
193//  complete
194//-------------------------------------------------
195
196void k056800_device::device_config_complete()
197{
198}
199
200//-------------------------------------------------
201//  device_start - device-specific startup
202//-------------------------------------------------
203
204void k056800_device::device_start()
205{
206   DEVICE_START_NAME( k056800 )(this);
207}
208
209//-------------------------------------------------
210//  device_reset - device-specific reset
211//-------------------------------------------------
212
213void k056800_device::device_reset()
214{
215   DEVICE_RESET_NAME( k056800 )(this);
216}
217
218
trunk/src/emu/sound/k056800.h
r17612r17613
2323   k056800_irq_cb       irq_cb;
2424};
2525
26DECLARE_LEGACY_DEVICE(K056800, k056800);
26class k056800_device : public device_t
27{
28public:
29   k056800_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
30   ~k056800_device() { global_free(m_token); }
2731
32   // access to legacy token
33   void *token() const { assert(m_token != NULL); return m_token; }
34protected:
35   // device-level overrides
36   virtual void device_config_complete();
37   virtual void device_start();
38   virtual void device_reset();
39private:
40   // internal state
41   void *m_token;
42};
2843
44extern const device_type K056800;
45
46
47
2948/***************************************************************************
3049    DEVICE CONFIGURATION MACROS
3150***************************************************************************/
trunk/src/emu/sound/upd7759.c
r17612r17613
224224{
225225   assert(device != NULL);
226226   assert(device->type() == UPD7759);
227   return (upd7759_state *)downcast<legacy_device_base *>(device)->token();
227   return (upd7759_state *)downcast<upd7759_device *>(device)->token();
228228}
229229
230230
r17612r17613
767767}
768768
769769
770DEFINE_LEGACY_SOUND_DEVICE(UPD7759, upd7759);
770const device_type UPD7759 = &device_creator<upd7759_device>;
771
772upd7759_device::upd7759_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
773   : device_t(mconfig, UPD7759, "UPD7759", tag, owner, clock),
774     device_sound_interface(mconfig, *this)
775{
776   m_token = global_alloc_array_clear(UINT8, sizeof(upd7759_state));
777}
778
779//-------------------------------------------------
780//  device_config_complete - perform any
781//  operations now that the configuration is
782//  complete
783//-------------------------------------------------
784
785void upd7759_device::device_config_complete()
786{
787}
788
789//-------------------------------------------------
790//  device_start - device-specific startup
791//-------------------------------------------------
792
793void upd7759_device::device_start()
794{
795   DEVICE_START_NAME( upd7759 )(this);
796}
797
798//-------------------------------------------------
799//  device_reset - device-specific reset
800//-------------------------------------------------
801
802void upd7759_device::device_reset()
803{
804   DEVICE_RESET_NAME( upd7759 )(this);
805}
806
807//-------------------------------------------------
808//  sound_stream_update - handle a stream update
809//-------------------------------------------------
810
811void upd7759_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
812{
813   // should never get here
814   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
815}
816
817
trunk/src/emu/sound/ymf271.c
r17612r17613
275275{
276276   assert(device != NULL);
277277   assert(device->type() == YMF271);
278   return (YMF271Chip *)downcast<legacy_device_base *>(device)->token();
278   return (YMF271Chip *)downcast<ymf271_device *>(device)->token();
279279}
280280
281281
r17612r17613
18361836}
18371837
18381838
1839DEFINE_LEGACY_SOUND_DEVICE(YMF271, ymf271);
1839const device_type YMF271 = &device_creator<ymf271_device>;
1840
1841ymf271_device::ymf271_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1842   : device_t(mconfig, YMF271, "YMF271", tag, owner, clock),
1843     device_sound_interface(mconfig, *this)
1844{
1845   m_token = global_alloc_array_clear(UINT8, sizeof(YMF271Chip));
1846}
1847
1848//-------------------------------------------------
1849//  device_config_complete - perform any
1850//  operations now that the configuration is
1851//  complete
1852//-------------------------------------------------
1853
1854void ymf271_device::device_config_complete()
1855{
1856}
1857
1858//-------------------------------------------------
1859//  device_start - device-specific startup
1860//-------------------------------------------------
1861
1862void ymf271_device::device_start()
1863{
1864   DEVICE_START_NAME( ymf271 )(this);
1865}
1866
1867//-------------------------------------------------
1868//  device_reset - device-specific reset
1869//-------------------------------------------------
1870
1871void ymf271_device::device_reset()
1872{
1873   DEVICE_RESET_NAME( ymf271 )(this);
1874}
1875
1876//-------------------------------------------------
1877//  sound_stream_update - handle a stream update
1878//-------------------------------------------------
1879
1880void ymf271_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
1881{
1882   // should never get here
1883   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
1884}
1885
1886
trunk/src/emu/sound/n63701x.c
r17612r17613
5050{
5151   assert(device != NULL);
5252   assert(device->type() == NAMCO_63701X);
53   return (namco_63701x *)downcast<legacy_device_base *>(device)->token();
53   return (namco_63701x *)downcast<namco_63701x_device *>(device)->token();
5454}
5555
5656
r17612r17613
185185}
186186
187187
188DEFINE_LEGACY_SOUND_DEVICE(NAMCO_63701X, namco_63701x);
188const device_type NAMCO_63701X = &device_creator<namco_63701x_device>;
189
190namco_63701x_device::namco_63701x_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
191   : device_t(mconfig, NAMCO_63701X, "Namco 63701X", tag, owner, clock),
192     device_sound_interface(mconfig, *this)
193{
194   m_token = global_alloc_array_clear(UINT8, sizeof(namco_63701x));
195}
196
197//-------------------------------------------------
198//  device_config_complete - perform any
199//  operations now that the configuration is
200//  complete
201//-------------------------------------------------
202
203void namco_63701x_device::device_config_complete()
204{
205}
206
207//-------------------------------------------------
208//  device_start - device-specific startup
209//-------------------------------------------------
210
211void namco_63701x_device::device_start()
212{
213   DEVICE_START_NAME( namco_63701x )(this);
214}
215
216//-------------------------------------------------
217//  sound_stream_update - handle a stream update
218//-------------------------------------------------
219
220void namco_63701x_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
221{
222   // should never get here
223   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
224}
225
226
trunk/src/emu/sound/upd7759.h
r17612r17613
2525int upd7759_busy_r(device_t *device);
2626WRITE8_DEVICE_HANDLER( upd7759_port_w );
2727
28DECLARE_LEGACY_SOUND_DEVICE(UPD7759, upd7759);
28class upd7759_device : public device_t,
29                                  public device_sound_interface
30{
31public:
32   upd7759_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
33   ~upd7759_device() { global_free(m_token); }
2934
35   // access to legacy token
36   void *token() const { assert(m_token != NULL); return m_token; }
37protected:
38   // device-level overrides
39   virtual void device_config_complete();
40   virtual void device_start();
41   virtual void device_reset();
42
43   // sound stream update overrides
44   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
45private:
46   // internal state
47   void *m_token;
48};
49
50extern const device_type UPD7759;
51
52
3053#endif /* __UPD7759_H__ */
trunk/src/emu/sound/sp0250.c
r17612r17613
6060{
6161   assert(device != NULL);
6262   assert(device->type() == SP0250);
63   return (sp0250_state *)downcast<legacy_device_base *>(device)->token();
63   return (sp0250_state *)downcast<sp0250_device *>(device)->token();
6464}
6565
6666
r17612r17613
266266
267267
268268
269DEFINE_LEGACY_SOUND_DEVICE(SP0250, sp0250);
269const device_type SP0250 = &device_creator<sp0250_device>;
270
271sp0250_device::sp0250_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
272   : device_t(mconfig, SP0250, "SP0250", tag, owner, clock),
273     device_sound_interface(mconfig, *this)
274{
275   m_token = global_alloc_array_clear(UINT8, sizeof(sp0250_state));
276}
277
278//-------------------------------------------------
279//  device_config_complete - perform any
280//  operations now that the configuration is
281//  complete
282//-------------------------------------------------
283
284void sp0250_device::device_config_complete()
285{
286}
287
288//-------------------------------------------------
289//  device_start - device-specific startup
290//-------------------------------------------------
291
292void sp0250_device::device_start()
293{
294   DEVICE_START_NAME( sp0250 )(this);
295}
296
297//-------------------------------------------------
298//  sound_stream_update - handle a stream update
299//-------------------------------------------------
300
301void sp0250_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
302{
303   // should never get here
304   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
305}
306
307
trunk/src/emu/sound/speaker.c
r17612r17613
129129{
130130   assert(device != NULL);
131131   assert(device->type() == SPEAKER_SOUND);
132   return (speaker_state *)downcast<legacy_device_base *>(device)->token();
132   return (speaker_state *)downcast<speaker_sound_device *>(device)->token();
133133}
134134
135135
r17612r17613
444444}
445445
446446
447DEFINE_LEGACY_SOUND_DEVICE(SPEAKER_SOUND, speaker_sound);
447const device_type SPEAKER_SOUND = &device_creator<speaker_sound_device>;
448
449speaker_sound_device::speaker_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
450   : device_t(mconfig, SPEAKER_SOUND, "Speaker", tag, owner, clock),
451     device_sound_interface(mconfig, *this)
452{
453   m_token = global_alloc_array_clear(UINT8, sizeof(speaker_state));
454}
455
456//-------------------------------------------------
457//  device_config_complete - perform any
458//  operations now that the configuration is
459//  complete
460//-------------------------------------------------
461
462void speaker_sound_device::device_config_complete()
463{
464}
465
466//-------------------------------------------------
467//  device_start - device-specific startup
468//-------------------------------------------------
469
470void speaker_sound_device::device_start()
471{
472   DEVICE_START_NAME( speaker )(this);
473}
474
475//-------------------------------------------------
476//  sound_stream_update - handle a stream update
477//-------------------------------------------------
478
479void speaker_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
480{
481   // should never get here
482   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
483}
484
485
trunk/src/emu/sound/ymf271.h
r17612r17613
1717READ8_DEVICE_HANDLER( ymf271_r );
1818WRITE8_DEVICE_HANDLER( ymf271_w );
1919
20DECLARE_LEGACY_SOUND_DEVICE(YMF271, ymf271);
20class ymf271_device : public device_t,
21                                  public device_sound_interface
22{
23public:
24   ymf271_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
25   ~ymf271_device() { global_free(m_token); }
2126
27   // access to legacy token
28   void *token() const { assert(m_token != NULL); return m_token; }
29protected:
30   // device-level overrides
31   virtual void device_config_complete();
32   virtual void device_start();
33   virtual void device_reset();
34
35   // sound stream update overrides
36   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
37private:
38   // internal state
39   void *m_token;
40};
41
42extern const device_type YMF271;
43
44
2245#endif /* __YMF271_H__ */
trunk/src/emu/sound/n63701x.h
r17612r17613
77
88WRITE8_DEVICE_HANDLER( namco_63701x_w );
99
10DECLARE_LEGACY_SOUND_DEVICE(NAMCO_63701X, namco_63701x);
10class namco_63701x_device : public device_t,
11                                  public device_sound_interface
12{
13public:
14   namco_63701x_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
15   ~namco_63701x_device() { global_free(m_token); }
1116
17   // access to legacy token
18   void *token() const { assert(m_token != NULL); return m_token; }
19protected:
20   // device-level overrides
21   virtual void device_config_complete();
22   virtual void device_start();
23
24   // sound stream update overrides
25   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
26private:
27   // internal state
28   void *m_token;
29};
30
31extern const device_type NAMCO_63701X;
32
33
1234#endif /* __N63701X_H__ */
trunk/src/emu/sound/ay8910.c
r17612r17613
208208         device->type() == YM3439 ||
209209         device->type() == YMZ284 ||
210210         device->type() == YMZ294);
211   return (ay8910_context *)downcast<legacy_device_base *>(device)->token();
211   return (ay8910_context *)downcast<ay8910_device *>(device)->token();
212212}
213213
214214
r17612r17613
10001000{
10011001   switch (state)
10021002   {
1003      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME( ay8910 );         break;
10041003      case DEVINFO_STR_NAME:                     strcpy(info->s, "AY-3-8912A");                  break;
10051004      default:                              DEVICE_GET_INFO_CALL(ay8910);                  break;
10061005   }
r17612r17613
10101009{
10111010   switch (state)
10121011   {
1013      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME( ay8910 );         break;
10141012      case DEVINFO_STR_NAME:                     strcpy(info->s, "AY-3-8913A");                  break;
10151013      default:                              DEVICE_GET_INFO_CALL(ay8910);                  break;
10161014   }
r17612r17613
10201018{
10211019   switch (state)
10221020   {
1023      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME( ay8910 );         break;
10241021      case DEVINFO_STR_NAME:                     strcpy(info->s, "AY-3-8914");               break;
10251022      default:                              DEVICE_GET_INFO_CALL(ay8910);                  break;
10261023   }
r17612r17613
10301027{
10311028   switch (state)
10321029   {
1033      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME( ay8910 );         break;
10341030      case DEVINFO_STR_NAME:                     strcpy(info->s, "AY8930");                     break;
10351031      default:                              DEVICE_GET_INFO_CALL(ay8910);                  break;
10361032   }
r17612r17613
10501046{
10511047   switch (state)
10521048   {
1053      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME( ym2149 );         break;
10541049      case DEVINFO_STR_NAME:                     strcpy(info->s, "YM3439");                     break;
1055      default:                              DEVICE_GET_INFO_CALL(ay8910);                  break;
1050      default:                              DEVICE_GET_INFO_CALL(ym2149);                  break;
10561051   }
10571052}
10581053
r17612r17613
10601055{
10611056   switch (state)
10621057   {
1063      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME( ym2149 );         break;
10641058      case DEVINFO_STR_NAME:                     strcpy(info->s, "YMZ284");                     break;
1065      default:                              DEVICE_GET_INFO_CALL(ay8910);                  break;
1059      default:                              DEVICE_GET_INFO_CALL(ym2149);                  break;
10661060   }
10671061}
10681062
r17612r17613
10701064{
10711065   switch (state)
10721066   {
1073      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME( ym2149 );         break;
10741067      case DEVINFO_STR_NAME:                     strcpy(info->s, "YMZ294");                     break;
1075      default:                              DEVICE_GET_INFO_CALL(ay8910);                  break;
1068      default:                              DEVICE_GET_INFO_CALL(ym2149);                  break;
10761069   }
10771070}
10781071
r17612r17613
11391132
11401133
11411134
1142DEFINE_LEGACY_SOUND_DEVICE(AY8910, ay8910);
1143DEFINE_LEGACY_SOUND_DEVICE(AY8912, ay8912);
1144DEFINE_LEGACY_SOUND_DEVICE(AY8913, ay8913);
1145DEFINE_LEGACY_SOUND_DEVICE(AY8914, ay8914);
1146DEFINE_LEGACY_SOUND_DEVICE(AY8930, ay8930);
1147DEFINE_LEGACY_SOUND_DEVICE(YM2149, ym2149);
1148DEFINE_LEGACY_SOUND_DEVICE(YM3439, ym3439);
1149DEFINE_LEGACY_SOUND_DEVICE(YMZ284, ymz284);
1150DEFINE_LEGACY_SOUND_DEVICE(YMZ294, ymz294);
1135const device_type AY8910 = &device_creator<ay8910_device>;
1136
1137ay8910_device::ay8910_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1138   : device_t(mconfig, AY8910, "AY-3-8910A", tag, owner, clock),
1139     device_sound_interface(mconfig, *this)
1140{
1141   m_token = global_alloc_array_clear(UINT8, sizeof(ay8910_context));
1142}
1143ay8910_device::ay8910_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
1144   : device_t(mconfig, type, name, tag, owner, clock),
1145     device_sound_interface(mconfig, *this)
1146{
1147   m_token = global_alloc_array_clear(UINT8, sizeof(ay8910_context));
1148}
1149
1150//-------------------------------------------------
1151//  device_config_complete - perform any
1152//  operations now that the configuration is
1153//  complete
1154//-------------------------------------------------
1155
1156void ay8910_device::device_config_complete()
1157{
1158}
1159
1160//-------------------------------------------------
1161//  device_start - device-specific startup
1162//-------------------------------------------------
1163
1164void ay8910_device::device_start()
1165{
1166   DEVICE_START_NAME( ay8910 )(this);
1167}
1168
1169//-------------------------------------------------
1170//  device_reset - device-specific reset
1171//-------------------------------------------------
1172
1173void ay8910_device::device_reset()
1174{
1175   DEVICE_RESET_NAME( ay8910 )(this);
1176}
1177
1178//-------------------------------------------------
1179//  device_stop - device-specific stop
1180//-------------------------------------------------
1181
1182void ay8910_device::device_stop()
1183{
1184   DEVICE_STOP_NAME( ay8910 )(this);
1185}
1186
1187//-------------------------------------------------
1188//  sound_stream_update - handle a stream update
1189//-------------------------------------------------
1190
1191void ay8910_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
1192{
1193   // should never get here
1194   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
1195}
1196
1197
1198const device_type AY8912 = &device_creator<ay8912_device>;
1199
1200ay8912_device::ay8912_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1201   : ay8910_device(mconfig, AY8912, "AY-3-8912A", tag, owner, clock)
1202{
1203}
1204
1205//-------------------------------------------------
1206//  sound_stream_update - handle a stream update
1207//-------------------------------------------------
1208
1209void ay8912_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
1210{
1211   // should never get here
1212   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
1213}
1214
1215
1216const device_type AY8913 = &device_creator<ay8913_device>;
1217
1218ay8913_device::ay8913_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1219   : ay8910_device(mconfig, AY8913, "AY-3-8913A", tag, owner, clock)
1220{
1221}
1222
1223//-------------------------------------------------
1224//  sound_stream_update - handle a stream update
1225//-------------------------------------------------
1226
1227void ay8913_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
1228{
1229   // should never get here
1230   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
1231}
1232
1233
1234const device_type AY8914 = &device_creator<ay8914_device>;
1235
1236ay8914_device::ay8914_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1237   : ay8910_device(mconfig, AY8914, "AY-3-8914", tag, owner, clock)
1238{
1239}
1240
1241//-------------------------------------------------
1242//  sound_stream_update - handle a stream update
1243//-------------------------------------------------
1244
1245void ay8914_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
1246{
1247   // should never get here
1248   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
1249}
1250
1251
1252const device_type AY8930 = &device_creator<ay8930_device>;
1253
1254ay8930_device::ay8930_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1255   : ay8910_device(mconfig, AY8930, "AY8930", tag, owner, clock)
1256{
1257}
1258
1259//-------------------------------------------------
1260//  sound_stream_update - handle a stream update
1261//-------------------------------------------------
1262
1263void ay8930_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
1264{
1265   // should never get here
1266   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
1267}
1268
1269
1270const device_type YM2149 = &device_creator<ym2149_device>;
1271
1272ym2149_device::ym2149_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1273   : ay8910_device(mconfig, YM2149, "YM2149", tag, owner, clock)
1274{
1275}
1276ym2149_device::ym2149_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
1277   : ay8910_device(mconfig, type, name, tag, owner, clock)
1278{
1279}
1280
1281//-------------------------------------------------
1282//  device_start - device-specific startup
1283//-------------------------------------------------
1284
1285void ym2149_device::device_start()
1286{
1287   DEVICE_START_NAME( ym2149 )(this);
1288}
1289
1290//-------------------------------------------------
1291//  sound_stream_update - handle a stream update
1292//-------------------------------------------------
1293
1294void ym2149_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
1295{
1296   // should never get here
1297   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
1298}
1299
1300
1301const device_type YM3439 = &device_creator<ym3439_device>;
1302
1303ym3439_device::ym3439_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1304   : ym2149_device(mconfig, YM3439, "YM3439", tag, owner, clock)
1305{
1306}
1307
1308//-------------------------------------------------
1309//  sound_stream_update - handle a stream update
1310//-------------------------------------------------
1311
1312void ym3439_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
1313{
1314   // should never get here
1315   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
1316}
1317
1318
1319const device_type YMZ284 = &device_creator<ymz284_device>;
1320
1321ymz284_device::ymz284_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1322   : ym2149_device(mconfig, YMZ284, "YMZ284", tag, owner, clock)
1323{
1324}
1325
1326//-------------------------------------------------
1327//  sound_stream_update - handle a stream update
1328//-------------------------------------------------
1329
1330void ymz284_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
1331{
1332   // should never get here
1333   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
1334}
1335
1336
1337const device_type YMZ294 = &device_creator<ymz294_device>;
1338
1339ymz294_device::ymz294_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1340   : ym2149_device(mconfig, YMZ294, "YMZ294", tag, owner, clock)
1341{
1342}
1343
1344//-------------------------------------------------
1345//  sound_stream_update - handle a stream update
1346//-------------------------------------------------
1347
1348void ymz294_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
1349{
1350   // should never get here
1351   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
1352}
1353
1354
trunk/src/emu/sound/cdda.c
r17612r17613
2525{
2626   assert(device != NULL);
2727   assert(device->type() == CDDA);
28   return (cdda_info *)downcast<legacy_device_base *>(device)->token();
28   return (cdda_info *)downcast<cdda_device *>(device)->token();
2929}
3030
3131#define MAX_SECTORS ( 4 )
r17612r17613
339339}
340340
341341
342DEFINE_LEGACY_SOUND_DEVICE(CDDA, cdda);
342const device_type CDDA = &device_creator<cdda_device>;
343
344cdda_device::cdda_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
345   : device_t(mconfig, CDDA, "CD/DA", tag, owner, clock),
346     device_sound_interface(mconfig, *this)
347{
348   m_token = global_alloc_array_clear(UINT8, sizeof(cdda_info));
349}
350
351//-------------------------------------------------
352//  device_config_complete - perform any
353//  operations now that the configuration is
354//  complete
355//-------------------------------------------------
356
357void cdda_device::device_config_complete()
358{
359}
360
361//-------------------------------------------------
362//  device_start - device-specific startup
363//-------------------------------------------------
364
365void cdda_device::device_start()
366{
367   DEVICE_START_NAME( cdda )(this);
368}
369
370//-------------------------------------------------
371//  sound_stream_update - handle a stream update
372//-------------------------------------------------
373
374void cdda_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
375{
376   // should never get here
377   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
378}
379
380
trunk/src/emu/sound/tms36xx.c
r17612r17613
344344{
345345   assert(device != NULL);
346346   assert(device->type() == TMS36XX);
347   return (tms_state *)downcast<legacy_device_base *>(device)->token();
347   return (tms_state *)downcast<tms36xx_device *>(device)->token();
348348}
349349
350350
r17612r17613
552552}
553553
554554
555DEFINE_LEGACY_SOUND_DEVICE(TMS36XX, tms36xx);
555const device_type TMS36XX = &device_creator<tms36xx_device>;
556
557tms36xx_device::tms36xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
558   : device_t(mconfig, TMS36XX, "TMS36XX", tag, owner, clock),
559     device_sound_interface(mconfig, *this)
560{
561   m_token = global_alloc_array_clear(UINT8, sizeof(tms_state));
562}
563
564//-------------------------------------------------
565//  device_config_complete - perform any
566//  operations now that the configuration is
567//  complete
568//-------------------------------------------------
569
570void tms36xx_device::device_config_complete()
571{
572}
573
574//-------------------------------------------------
575//  device_start - device-specific startup
576//-------------------------------------------------
577
578void tms36xx_device::device_start()
579{
580   DEVICE_START_NAME( tms36xx )(this);
581}
582
583//-------------------------------------------------
584//  sound_stream_update - handle a stream update
585//-------------------------------------------------
586
587void tms36xx_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
588{
589   // should never get here
590   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
591}
592
593
trunk/src/emu/sound/st0016.c
r17612r17613
2222{
2323   assert(device != NULL);
2424   assert(device->type() == ST0016);
25   return (st0016_state *)downcast<legacy_device_base *>(device)->token();
25   return (st0016_state *)downcast<st0016_device *>(device)->token();
2626}
2727
2828
r17612r17613
173173}
174174
175175
176DEFINE_LEGACY_SOUND_DEVICE(ST0016, st0016);
176const device_type ST0016 = &device_creator<st0016_device>;
177
178st0016_device::st0016_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
179   : device_t(mconfig, ST0016, "ST0016", tag, owner, clock),
180     device_sound_interface(mconfig, *this)
181{
182   m_token = global_alloc_array_clear(UINT8, sizeof(st0016_state));
183}
184
185//-------------------------------------------------
186//  device_config_complete - perform any
187//  operations now that the configuration is
188//  complete
189//-------------------------------------------------
190
191void st0016_device::device_config_complete()
192{
193}
194
195//-------------------------------------------------
196//  device_start - device-specific startup
197//-------------------------------------------------
198
199void st0016_device::device_start()
200{
201   DEVICE_START_NAME( st0016 )(this);
202}
203
204//-------------------------------------------------
205//  sound_stream_update - handle a stream update
206//-------------------------------------------------
207
208void st0016_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
209{
210   // should never get here
211   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
212}
213
214
trunk/src/emu/sound/sp0250.h
r17612r17613
1212WRITE8_DEVICE_HANDLER( sp0250_w );
1313UINT8 sp0250_drq_r(device_t *device);
1414
15DECLARE_LEGACY_SOUND_DEVICE(SP0250, sp0250);
15class sp0250_device : public device_t,
16                                  public device_sound_interface
17{
18public:
19   sp0250_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
20   ~sp0250_device() { global_free(m_token); }
1621
22   // access to legacy token
23   void *token() const { assert(m_token != NULL); return m_token; }
24protected:
25   // device-level overrides
26   virtual void device_config_complete();
27   virtual void device_start();
28
29   // sound stream update overrides
30   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
31private:
32   // internal state
33   void *m_token;
34};
35
36extern const device_type SP0250;
37
38
1739#endif /* __SP0250_H__ */
trunk/src/emu/sound/tiaintf.c
r17612r17613
1313{
1414   assert(device != NULL);
1515   assert(device->type() == TIA);
16   return (tia_state *)downcast<legacy_device_base *>(device)->token();
16   return (tia_state *)downcast<tia_device *>(device)->token();
1717}
1818
1919
r17612r17613
7676}
7777
7878
79DEFINE_LEGACY_SOUND_DEVICE(TIA, tia);
79const device_type TIA = &device_creator<tia_device>;
80
81tia_device::tia_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
82   : device_t(mconfig, TIA, "TIA", tag, owner, clock),
83     device_sound_interface(mconfig, *this)
84{
85   m_token = global_alloc_array_clear(UINT8, sizeof(tia_state));
86}
87
88//-------------------------------------------------
89//  device_config_complete - perform any
90//  operations now that the configuration is
91//  complete
92//-------------------------------------------------
93
94void tia_device::device_config_complete()
95{
96}
97
98//-------------------------------------------------
99//  device_start - device-specific startup
100//-------------------------------------------------
101
102void tia_device::device_start()
103{
104   DEVICE_START_NAME( tia )(this);
105}
106
107//-------------------------------------------------
108//  device_stop - device-specific stop
109//-------------------------------------------------
110
111void tia_device::device_stop()
112{
113   DEVICE_STOP_NAME( tia )(this);
114}
115
116//-------------------------------------------------
117//  sound_stream_update - handle a stream update
118//-------------------------------------------------
119
120void tia_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
121{
122   // should never get here
123   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
124}
125
126
trunk/src/emu/sound/speaker.h
r17612r17613
2424
2525void speaker_level_w (device_t *device, int new_level);
2626
27DECLARE_LEGACY_SOUND_DEVICE(SPEAKER_SOUND, speaker_sound);
27class speaker_sound_device : public device_t,
28                                  public device_sound_interface
29{
30public:
31   speaker_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
32   ~speaker_sound_device() { global_free(m_token); }
2833
34   // access to legacy token
35   void *token() const { assert(m_token != NULL); return m_token; }
36protected:
37   // device-level overrides
38   virtual void device_config_complete();
39   virtual void device_start();
40
41   // sound stream update overrides
42   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
43private:
44   // internal state
45   void *m_token;
46};
47
48extern const device_type SPEAKER_SOUND;
49
50
2951#endif /* __SPEAKER_H__ */
trunk/src/emu/sound/cdda.h
r17612r17613
1919int cdda_audio_paused(device_t *device);
2020int cdda_audio_ended(device_t *device);
2121
22DECLARE_LEGACY_SOUND_DEVICE(CDDA, cdda);
22class cdda_device : public device_t,
23                                  public device_sound_interface
24{
25public:
26   cdda_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
27   ~cdda_device() { global_free(m_token); }
2328
29   // access to legacy token
30   void *token() const { assert(m_token != NULL); return m_token; }
31protected:
32   // device-level overrides
33   virtual void device_config_complete();
34   virtual void device_start();
35
36   // sound stream update overrides
37   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
38private:
39   // internal state
40   void *m_token;
41};
42
43extern const device_type CDDA;
44
45
2446#endif /* __CDDA_H__ */
trunk/src/emu/sound/ay8910.h
r17612r17613
119119void ay8910_write_ym(void *chip, int addr, int data);
120120int ay8910_read_ym(void *chip);
121121
122DECLARE_LEGACY_SOUND_DEVICE(AY8910, ay8910);
123DECLARE_LEGACY_SOUND_DEVICE(AY8912, ay8912);
124DECLARE_LEGACY_SOUND_DEVICE(AY8913, ay8913);
125DECLARE_LEGACY_SOUND_DEVICE(AY8914, ay8914);
126DECLARE_LEGACY_SOUND_DEVICE(AY8930, ay8930);
127DECLARE_LEGACY_SOUND_DEVICE(YM2149, ym2149);
128DECLARE_LEGACY_SOUND_DEVICE(YM3439, ym3439);
129DECLARE_LEGACY_SOUND_DEVICE(YMZ284, ymz284);
130DECLARE_LEGACY_SOUND_DEVICE(YMZ294, ymz294);
122class ay8910_device : public device_t,
123                                  public device_sound_interface
124{
125public:
126   ay8910_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
127   ay8910_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
128   ~ay8910_device() { global_free(m_token); }
131129
130   // access to legacy token
131   void *token() const { assert(m_token != NULL); return m_token; }
132protected:
133   // device-level overrides
134   virtual void device_config_complete();
135   virtual void device_start();
136   virtual void device_stop();
137   virtual void device_reset();
138
139   // sound stream update overrides
140   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
141private:
142   // internal state
143   void *m_token;
144};
145
146extern const device_type AY8910;
147
148class ay8912_device : public ay8910_device
149{
150public:
151   ay8912_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
152
153   // sound stream update overrides
154   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
155};
156
157extern const device_type AY8912;
158
159class ay8913_device : public ay8910_device
160{
161public:
162   ay8913_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
163
164   // sound stream update overrides
165   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
166};
167
168extern const device_type AY8913;
169
170class ay8914_device : public ay8910_device
171{
172public:
173   ay8914_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
174
175   // sound stream update overrides
176   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
177};
178
179extern const device_type AY8914;
180
181class ay8930_device : public ay8910_device
182{
183public:
184   ay8930_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
185
186   // sound stream update overrides
187   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
188};
189
190extern const device_type AY8930;
191
192class ym2149_device : public ay8910_device
193{
194public:
195   ym2149_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
196   ym2149_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
197protected:
198   // device-level overrides
199   virtual void device_start();
200
201   // sound stream update overrides
202   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
203};
204
205extern const device_type YM2149;
206
207class ym3439_device : public ym2149_device
208{
209public:
210   ym3439_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
211
212   // sound stream update overrides
213   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
214};
215
216extern const device_type YM3439;
217
218class ymz284_device : public ym2149_device
219{
220public:
221   ymz284_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
222
223   // sound stream update overrides
224   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
225};
226
227extern const device_type YMZ284;
228
229class ymz294_device : public ym2149_device
230{
231public:
232   ymz294_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
233
234   // sound stream update overrides
235   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
236};
237
238extern const device_type YMZ294;
239
240
132241#endif /* __AY8910_H__ */
trunk/src/emu/sound/tms36xx.h
r17612r17613
2828/* TMS3617 interface functions */
2929extern void tms3617_enable_w(device_t *device, int enable);
3030
31DECLARE_LEGACY_SOUND_DEVICE(TMS36XX, tms36xx);
31class tms36xx_device : public device_t,
32                                  public device_sound_interface
33{
34public:
35   tms36xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
36   ~tms36xx_device() { global_free(m_token); }
3237
38   // access to legacy token
39   void *token() const { assert(m_token != NULL); return m_token; }
40protected:
41   // device-level overrides
42   virtual void device_config_complete();
43   virtual void device_start();
44
45   // sound stream update overrides
46   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
47private:
48   // internal state
49   void *m_token;
50};
51
52extern const device_type TMS36XX;
53
54
3355#endif /* __TMS36XX_H__ */
trunk/src/emu/sound/c6280.c
r17612r17613
8686{
8787   assert(device != NULL);
8888   assert(device->type() == C6280);
89   return (c6280_t *)downcast<legacy_device_base *>(device)->token();
89   return (c6280_t *)downcast<c6280_device *>(device)->token();
9090}
9191
9292
r17612r17613
372372}
373373
374374
375DEFINE_LEGACY_SOUND_DEVICE(C6280, c6280);
375const device_type C6280 = &device_creator<c6280_device>;
376
377c6280_device::c6280_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
378   : device_t(mconfig, C6280, "HuC6280", tag, owner, clock),
379     device_sound_interface(mconfig, *this)
380{
381   m_token = global_alloc_array_clear(UINT8, sizeof(c6280_t));
382}
383
384//-------------------------------------------------
385//  device_config_complete - perform any
386//  operations now that the configuration is
387//  complete
388//-------------------------------------------------
389
390void c6280_device::device_config_complete()
391{
392}
393
394//-------------------------------------------------
395//  device_start - device-specific startup
396//-------------------------------------------------
397
398void c6280_device::device_start()
399{
400   DEVICE_START_NAME( c6280 )(this);
401}
402
403//-------------------------------------------------
404//  sound_stream_update - handle a stream update
405//-------------------------------------------------
406
407void c6280_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
408{
409   // should never get here
410   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
411}
412
413
trunk/src/emu/sound/st0016.h
r17612r17613
1414READ8_DEVICE_HANDLER( st0016_snd_r );
1515WRITE8_DEVICE_HANDLER( st0016_snd_w );
1616
17DECLARE_LEGACY_SOUND_DEVICE(ST0016, st0016);
17class st0016_device : public device_t,
18                                  public device_sound_interface
19{
20public:
21   st0016_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
22   ~st0016_device() { global_free(m_token); }
1823
24   // access to legacy token
25   void *token() const { assert(m_token != NULL); return m_token; }
26protected:
27   // device-level overrides
28   virtual void device_config_complete();
29   virtual void device_start();
30
31   // sound stream update overrides
32   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
33private:
34   // internal state
35   void *m_token;
36};
37
38extern const device_type ST0016;
39
40
1941#endif /* __ST0016_H__ */
trunk/src/emu/sound/tiaintf.h
r17612r17613
77
88WRITE8_DEVICE_HANDLER( tia_sound_w );
99
10DECLARE_LEGACY_SOUND_DEVICE(TIA, tia);
10class tia_device : public device_t,
11                                  public device_sound_interface
12{
13public:
14   tia_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
15   ~tia_device() { global_free(m_token); }
1116
17   // access to legacy token
18   void *token() const { assert(m_token != NULL); return m_token; }
19protected:
20   // device-level overrides
21   virtual void device_config_complete();
22   virtual void device_start();
23   virtual void device_stop();
24
25   // sound stream update overrides
26   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
27private:
28   // internal state
29   void *m_token;
30};
31
32extern const device_type TIA;
33
34
1235#endif /* __TIAINTF_H__ */
trunk/src/emu/sound/c6280.h
r17612r17613
1515WRITE8_DEVICE_HANDLER( c6280_w );
1616READ8_DEVICE_HANDLER( c6280_r );
1717
18DECLARE_LEGACY_SOUND_DEVICE(C6280, c6280);
18class c6280_device : public device_t,
19                                  public device_sound_interface
20{
21public:
22   c6280_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
23   ~c6280_device() { global_free(m_token); }
1924
25   // access to legacy token
26   void *token() const { assert(m_token != NULL); return m_token; }
27protected:
28   // device-level overrides
29   virtual void device_config_complete();
30   virtual void device_start();
31
32   // sound stream update overrides
33   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
34private:
35   // internal state
36   void *m_token;
37};
38
39extern const device_type C6280;
40
41
2042#endif /* __C6280_H__ */
trunk/src/emu/sound/scsp.c
r17612r17613
253253{
254254   assert(device != NULL);
255255   assert(device->type() == SCSP);
256   return (scsp_state *)downcast<legacy_device_base *>(device)->token();
256   return (scsp_state *)downcast<scsp_device *>(device)->token();
257257}
258258
259259static unsigned char DecodeSCI(scsp_state *scsp,unsigned char irq)
r17612r17613
13871387}
13881388
13891389
1390DEFINE_LEGACY_SOUND_DEVICE(SCSP, scsp);
1390const device_type SCSP = &device_creator<scsp_device>;
1391
1392scsp_device::scsp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1393   : device_t(mconfig, SCSP, "SCSP", tag, owner, clock),
1394     device_sound_interface(mconfig, *this)
1395{
1396   m_token = global_alloc_array_clear(UINT8, sizeof(scsp_state));
1397}
1398
1399//-------------------------------------------------
1400//  device_config_complete - perform any
1401//  operations now that the configuration is
1402//  complete
1403//-------------------------------------------------
1404
1405void scsp_device::device_config_complete()
1406{
1407}
1408
1409//-------------------------------------------------
1410//  device_start - device-specific startup
1411//-------------------------------------------------
1412
1413void scsp_device::device_start()
1414{
1415   DEVICE_START_NAME( scsp )(this);
1416}
1417
1418//-------------------------------------------------
1419//  sound_stream_update - handle a stream update
1420//-------------------------------------------------
1421
1422void scsp_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
1423{
1424   // should never get here
1425   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
1426}
1427
1428
trunk/src/emu/sound/msm5232.c
r17612r17613
7878{
7979   assert(device != NULL);
8080   assert(device->type() == MSM5232);
81   return (msm5232_state *)downcast<legacy_device_base *>(device)->token();
81   return (msm5232_state *)downcast<msm5232_device *>(device)->token();
8282}
8383
8484
r17612r17613
878878}
879879
880880
881DEFINE_LEGACY_SOUND_DEVICE(MSM5232, msm5232);
881const device_type MSM5232 = &device_creator<msm5232_device>;
882
883msm5232_device::msm5232_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
884   : device_t(mconfig, MSM5232, "MSM5232", tag, owner, clock),
885     device_sound_interface(mconfig, *this)
886{
887   m_token = global_alloc_array_clear(UINT8, sizeof(msm5232_state));
888}
889
890//-------------------------------------------------
891//  device_config_complete - perform any
892//  operations now that the configuration is
893//  complete
894//-------------------------------------------------
895
896void msm5232_device::device_config_complete()
897{
898}
899
900//-------------------------------------------------
901//  device_start - device-specific startup
902//-------------------------------------------------
903
904void msm5232_device::device_start()
905{
906   DEVICE_START_NAME( msm5232 )(this);
907}
908
909//-------------------------------------------------
910//  device_reset - device-specific reset
911//-------------------------------------------------
912
913void msm5232_device::device_reset()
914{
915   DEVICE_RESET_NAME( msm5232 )(this);
916}
917
918//-------------------------------------------------
919//  device_stop - device-specific stop
920//-------------------------------------------------
921
922void msm5232_device::device_stop()
923{
924   DEVICE_STOP_NAME( msm5232 )(this);
925}
926
927//-------------------------------------------------
928//  sound_stream_update - handle a stream update
929//-------------------------------------------------
930
931void msm5232_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
932{
933   // should never get here
934   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
935}
936
937
trunk/src/emu/sound/2610intf.c
r17612r17613
3232{
3333   assert(device != NULL);
3434   assert(device->type() == YM2610 || device->type() == YM2610B);
35   return (ym2610_state *)downcast<legacy_device_base *>(device)->token();
35   return (ym2610_state *)downcast<ym2610_device *>(device)->token();
3636}
3737
3838
r17612r17613
256256}
257257
258258
259DEFINE_LEGACY_SOUND_DEVICE(YM2610, ym2610);
260DEFINE_LEGACY_SOUND_DEVICE(YM2610B, ym2610b);
259const device_type YM2610 = &device_creator<ym2610_device>;
260
261ym2610_device::ym2610_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
262   : device_t(mconfig, YM2610, "YM2610", tag, owner, clock),
263     device_sound_interface(mconfig, *this)
264{
265   m_token = global_alloc_array_clear(UINT8, sizeof(ym2610_state));
266}
267ym2610_device::ym2610_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
268   : device_t(mconfig, type, name, tag, owner, clock),
269     device_sound_interface(mconfig, *this)
270{
271   m_token = global_alloc_array_clear(UINT8, sizeof(ym2610_state));
272}
273
274//-------------------------------------------------
275//  device_config_complete - perform any
276//  operations now that the configuration is
277//  complete
278//-------------------------------------------------
279
280void ym2610_device::device_config_complete()
281{
282}
283
284//-------------------------------------------------
285//  device_start - device-specific startup
286//-------------------------------------------------
287
288void ym2610_device::device_start()
289{
290   DEVICE_START_NAME( ym2610 )(this);
291}
292
293//-------------------------------------------------
294//  device_reset - device-specific reset
295//-------------------------------------------------
296
297void ym2610_device::device_reset()
298{
299   DEVICE_RESET_NAME( ym2610 )(this);
300}
301
302//-------------------------------------------------
303//  device_stop - device-specific stop
304//-------------------------------------------------
305
306void ym2610_device::device_stop()
307{
308   DEVICE_STOP_NAME( ym2610 )(this);
309}
310
311//-------------------------------------------------
312//  sound_stream_update - handle a stream update
313//-------------------------------------------------
314
315void ym2610_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
316{
317   // should never get here
318   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
319}
320
321
322const device_type YM2610B = &device_creator<ym2610b_device>;
323
324ym2610b_device::ym2610b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
325   : ym2610_device(mconfig, YM2610B, "YM2610B", tag, owner, clock)
326{
327}
328
329//-------------------------------------------------
330//  sound_stream_update - handle a stream update
331//-------------------------------------------------
332
333void ym2610b_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
334{
335   // should never get here
336   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
337}
338
339
trunk/src/emu/sound/flt_rc.c
r17612r17613
1515{
1616   assert(device != NULL);
1717   assert(device->type() == FILTER_RC);
18   return (filter_rc_state *)downcast<legacy_device_base *>(device)->token();
18   return (filter_rc_state *)downcast<filter_rc_device *>(device)->token();
1919}
2020
2121const flt_rc_config flt_rc_ac_default = {FLT_RC_AC, 10000, 0, 0, CAP_U(1)};
r17612r17613
137137}
138138
139139
140DEFINE_LEGACY_SOUND_DEVICE(FILTER_RC, filter_rc);
140const device_type FILTER_RC = &device_creator<filter_rc_device>;
141
142filter_rc_device::filter_rc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
143   : device_t(mconfig, FILTER_RC, "RC Filter", tag, owner, clock),
144     device_sound_interface(mconfig, *this)
145{
146   m_token = global_alloc_array_clear(UINT8, sizeof(filter_rc_state));
147}
148
149//-------------------------------------------------
150//  device_config_complete - perform any
151//  operations now that the configuration is
152//  complete
153//-------------------------------------------------
154
155void filter_rc_device::device_config_complete()
156{
157}
158
159//-------------------------------------------------
160//  device_start - device-specific startup
161//-------------------------------------------------
162
163void filter_rc_device::device_start()
164{
165   DEVICE_START_NAME( filter_rc )(this);
166}
167
168//-------------------------------------------------
169//  sound_stream_update - handle a stream update
170//-------------------------------------------------
171
172void filter_rc_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
173{
174   // should never get here
175   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
176}
177
178
trunk/src/emu/sound/beep.c
r17612r17613
3232{
3333   assert(device != NULL);
3434   assert(device->type() == BEEP);
35   return (beep_state *)downcast<legacy_device_base *>(device)->token();
35   return (beep_state *)downcast<beep_device *>(device)->token();
3636}
3737
3838
r17612r17613
189189}
190190
191191
192DEFINE_LEGACY_SOUND_DEVICE(BEEP, beep);
192const device_type BEEP = &device_creator<beep_device>;
193
194beep_device::beep_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
195   : device_t(mconfig, BEEP, "Beep", tag, owner, clock),
196     device_sound_interface(mconfig, *this)
197{
198   m_token = global_alloc_array_clear(UINT8, sizeof(beep_state));
199}
200
201//-------------------------------------------------
202//  device_config_complete - perform any
203//  operations now that the configuration is
204//  complete
205//-------------------------------------------------
206
207void beep_device::device_config_complete()
208{
209}
210
211//-------------------------------------------------
212//  device_start - device-specific startup
213//-------------------------------------------------
214
215void beep_device::device_start()
216{
217   DEVICE_START_NAME( beep )(this);
218}
219
220//-------------------------------------------------
221//  sound_stream_update - handle a stream update
222//-------------------------------------------------
223
224void beep_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
225{
226   // should never get here
227   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
228}
229
230
trunk/src/emu/sound/scsp.h
r17612r17613
2929
3030extern UINT32* stv_scu;
3131
32DECLARE_LEGACY_SOUND_DEVICE(SCSP, scsp);
32class scsp_device : public device_t,
33                                  public device_sound_interface
34{
35public:
36   scsp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
37   ~scsp_device() { global_free(m_token); }
3338
39   // access to legacy token
40   void *token() const { assert(m_token != NULL); return m_token; }
41protected:
42   // device-level overrides
43   virtual void device_config_complete();
44   virtual void device_start();
45
46   // sound stream update overrides
47   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
48private:
49   // internal state
50   void *m_token;
51};
52
53extern const device_type SCSP;
54
55
3456#endif /* __SCSP_H__ */
trunk/src/emu/sound/msm5232.h
r17612r17613
1616
1717void msm5232_set_clock(device_t *device, int clock);
1818
19DECLARE_LEGACY_SOUND_DEVICE(MSM5232, msm5232);
19class msm5232_device : public device_t,
20                                  public device_sound_interface
21{
22public:
23   msm5232_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
24   ~msm5232_device() { global_free(m_token); }
2025
26   // access to legacy token
27   void *token() const { assert(m_token != NULL); return m_token; }
28protected:
29   // device-level overrides
30   virtual void device_config_complete();
31   virtual void device_start();
32   virtual void device_stop();
33   virtual void device_reset();
34
35   // sound stream update overrides
36   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
37private:
38   // internal state
39   void *m_token;
40};
41
42extern const device_type MSM5232;
43
44
2145#endif /* __MSM5232_H__ */
trunk/src/emu/sound/flt_rc.h
r17612r17613
5959
6060void filter_rc_set_RC(device_t *device, int type, double R1, double R2, double R3, double C);
6161
62DECLARE_LEGACY_SOUND_DEVICE(FILTER_RC, filter_rc);
62class filter_rc_device : public device_t,
63                                  public device_sound_interface
64{
65public:
66   filter_rc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
67   ~filter_rc_device() { global_free(m_token); }
6368
69   // access to legacy token
70   void *token() const { assert(m_token != NULL); return m_token; }
71protected:
72   // device-level overrides
73   virtual void device_config_complete();
74   virtual void device_start();
75
76   // sound stream update overrides
77   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
78private:
79   // internal state
80   void *m_token;
81};
82
83extern const device_type FILTER_RC;
84
85
6486#endif /* __FLT_RC_H__ */
trunk/src/emu/sound/2610intf.h
r17612r17613
2828WRITE8_DEVICE_HANDLER( ym2610_data_port_b_w );
2929
3030
31DECLARE_LEGACY_SOUND_DEVICE(YM2610, ym2610);
32DECLARE_LEGACY_SOUND_DEVICE(YM2610B, ym2610b);
31class ym2610_device : public device_t,
32                                  public device_sound_interface
33{
34public:
35   ym2610_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
36   ym2610_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
37   ~ym2610_device() { global_free(m_token); }
3338
39   // access to legacy token
40   void *token() const { assert(m_token != NULL); return m_token; }
41protected:
42   // device-level overrides
43   virtual void device_config_complete();
44   virtual void device_start();
45   virtual void device_stop();
46   virtual void device_reset();
47
48   // sound stream update overrides
49   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
50private:
51   // internal state
52   void *m_token;
53};
54
55extern const device_type YM2610;
56
57class ym2610b_device : public ym2610_device
58{
59public:
60   ym2610b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
61
62   // sound stream update overrides
63   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
64};
65
66extern const device_type YM2610B;
67
68
3469#endif /* __2610INTF_H__ */
trunk/src/emu/sound/beep.h
r17612r17613
1111void beep_set_frequency(device_t *device, int frequency);
1212void beep_set_volume(device_t *device, int volume);
1313
14DECLARE_LEGACY_SOUND_DEVICE(BEEP, beep);
14class beep_device : public device_t,
15                                  public device_sound_interface
16{
17public:
18   beep_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
19   ~beep_device() { global_free(m_token); }
1520
21   // access to legacy token
22   void *token() const { assert(m_token != NULL); return m_token; }
23protected:
24   // device-level overrides
25   virtual void device_config_complete();
26   virtual void device_start();
27
28   // sound stream update overrides
29   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
30private:
31   // internal state
32   void *m_token;
33};
34
35extern const device_type BEEP;
36
37
1638#endif /* __BEEP_H__ */
trunk/src/emu/sound/tms3615.c
r17612r17613
2424{
2525   assert(device != NULL);
2626   assert(device->type() == TMS3615);
27   return (tms_state *)downcast<legacy_device_base *>(device)->token();
27   return (tms_state *)downcast<tms3615_device *>(device)->token();
2828}
2929
3030
r17612r17613
120120}
121121
122122
123DEFINE_LEGACY_SOUND_DEVICE(TMS3615, tms3615);
123const device_type TMS3615 = &device_creator<tms3615_device>;
124
125tms3615_device::tms3615_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
126   : device_t(mconfig, TMS3615, "TMS3615", tag, owner, clock),
127     device_sound_interface(mconfig, *this)
128{
129   m_token = global_alloc_array_clear(UINT8, sizeof(tms_state));
130}
131
132//-------------------------------------------------
133//  device_config_complete - perform any
134//  operations now that the configuration is
135//  complete
136//-------------------------------------------------
137
138void tms3615_device::device_config_complete()
139{
140}
141
142//-------------------------------------------------
143//  device_start - device-specific startup
144//-------------------------------------------------
145
146void tms3615_device::device_start()
147{
148   DEVICE_START_NAME( tms3615 )(this);
149}
150
151//-------------------------------------------------
152//  sound_stream_update - handle a stream update
153//-------------------------------------------------
154
155void tms3615_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
156{
157   // should never get here
158   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
159}
160
161
trunk/src/emu/sound/tms3615.h
r17612r17613
1010#define TMS3615_FOOTAGE_8   0
1111#define TMS3615_FOOTAGE_16   1
1212
13DECLARE_LEGACY_SOUND_DEVICE(TMS3615, tms3615);
13class tms3615_device : public device_t,
14                                  public device_sound_interface
15{
16public:
17   tms3615_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
18   ~tms3615_device() { global_free(m_token); }
1419
20   // access to legacy token
21   void *token() const { assert(m_token != NULL); return m_token; }
22protected:
23   // device-level overrides
24   virtual void device_config_complete();
25   virtual void device_start();
26
27   // sound stream update overrides
28   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
29private:
30   // internal state
31   void *m_token;
32};
33
34extern const device_type TMS3615;
35
36
1537#endif /* __TMS3615_H__ */
trunk/src/emu/sound/s14001a.c
r17612r17613
268268{
269269   assert(device != NULL);
270270   assert(device->type() == S14001A);
271   return (S14001AChip *)downcast<legacy_device_base *>(device)->token();
271   return (S14001AChip *)downcast<s14001a_device *>(device)->token();
272272}
273273
274274
r17612r17613
648648   }
649649}
650650
651DEFINE_LEGACY_SOUND_DEVICE(S14001A, s14001a);
651const device_type S14001A = &device_creator<s14001a_device>;
652
653s14001a_device::s14001a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
654   : device_t(mconfig, S14001A, "S14001A", tag, owner, clock),
655     device_sound_interface(mconfig, *this)
656{
657   m_token = global_alloc_array_clear(UINT8, sizeof(S14001AChip));
658}
659
660//-------------------------------------------------
661//  device_config_complete - perform any
662//  operations now that the configuration is
663//  complete
664//-------------------------------------------------
665
666void s14001a_device::device_config_complete()
667{
668}
669
670//-------------------------------------------------
671//  device_start - device-specific startup
672//-------------------------------------------------
673
674void s14001a_device::device_start()
675{
676   DEVICE_START_NAME( s14001a )(this);
677}
678
679//-------------------------------------------------
680//  sound_stream_update - handle a stream update
681//-------------------------------------------------
682
683void s14001a_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
684{
685   // should never get here
686   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
687}
688
689
trunk/src/emu/sound/gaelco.c
r17612r17613
7878{
7979   assert(device != NULL);
8080   assert(device->type() == GAELCO_GAE1 || device->type() == GAELCO_CG1V);
81   return (gaelco_sound_state *)downcast<legacy_device_base *>(device)->token();
81   return (gaelco_sound_state *)downcast<gaelco_gae1_device *>(device)->token();
8282}
8383
8484/*============================================================================
r17612r17613
339339}
340340
341341
342DEFINE_LEGACY_SOUND_DEVICE(GAELCO_GAE1, gaelco_gae1);
343DEFINE_LEGACY_SOUND_DEVICE(GAELCO_CG1V, gaelco_cg1v);
342const device_type GAELCO_GAE1 = &device_creator<gaelco_gae1_device>;
343
344gaelco_gae1_device::gaelco_gae1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
345   : device_t(mconfig, GAELCO_GAE1, "Gaelco GAE1", tag, owner, clock),
346     device_sound_interface(mconfig, *this)
347{
348   m_token = global_alloc_array_clear(UINT8, sizeof(gaelco_sound_state));
349}
350
351gaelco_gae1_device::gaelco_gae1_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
352   : device_t(mconfig, type, name, tag, owner, clock),
353     device_sound_interface(mconfig, *this)
354{
355   m_token = global_alloc_array_clear(UINT8, sizeof(gaelco_sound_state));
356}
357
358//-------------------------------------------------
359//  device_config_complete - perform any
360//  operations now that the configuration is
361//  complete
362//-------------------------------------------------
363
364void gaelco_gae1_device::device_config_complete()
365{
366}
367
368//-------------------------------------------------
369//  device_start - device-specific startup
370//-------------------------------------------------
371
372void gaelco_gae1_device::device_start()
373{
374   DEVICE_START_NAME( gaelco )(this);
375}
376
377//-------------------------------------------------
378//  device_stop - device-specific stop
379//-------------------------------------------------
380
381void gaelco_gae1_device::device_stop()
382{
383   DEVICE_STOP_NAME( gaelco )(this);
384}
385
386//-------------------------------------------------
387//  sound_stream_update - handle a stream update
388//-------------------------------------------------
389
390void gaelco_gae1_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
391{
392   // should never get here
393   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
394}
395
396
397const device_type GAELCO_CG1V = &device_creator<gaelco_cg1v_device>;
398
399gaelco_cg1v_device::gaelco_cg1v_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
400   : gaelco_gae1_device(mconfig, GAELCO_CG1V, "Gaelco CG1V", tag, owner, clock)
401{
402}
trunk/src/emu/sound/s14001a.h
r17612r17613
1111void s14001a_set_clock(device_t *device, int clock);     /* set VSU-1000 clock */
1212void s14001a_set_volume(device_t *device, int volume);    /* set VSU-1000 volume control */
1313
14DECLARE_LEGACY_SOUND_DEVICE(S14001A, s14001a);
14class s14001a_device : public device_t,
15                                  public device_sound_interface
16{
17public:
18   s14001a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
19   ~s14001a_device() { global_free(m_token); }
1520
21   // access to legacy token
22   void *token() const { assert(m_token != NULL); return m_token; }
23protected:
24   // device-level overrides
25   virtual void device_config_complete();
26   virtual void device_start();
27
28   // sound stream update overrides
29   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
30private:
31   // internal state
32   void *m_token;
33};
34
35extern const device_type S14001A;
36
37
1638#endif /* __S14001A_H__ */
1739
trunk/src/emu/sound/gaelco.h
r17612r17613
1515WRITE16_DEVICE_HANDLER( gaelcosnd_w );
1616READ16_DEVICE_HANDLER( gaelcosnd_r );
1717
18DECLARE_LEGACY_SOUND_DEVICE(GAELCO_GAE1, gaelco_gae1);
19DECLARE_LEGACY_SOUND_DEVICE(GAELCO_CG1V, gaelco_cg1v);
18class gaelco_gae1_device : public device_t,
19                                  public device_sound_interface
20{
21public:
22   gaelco_gae1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
23   gaelco_gae1_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
24   ~gaelco_gae1_device() { global_free(m_token); }
2025
26   // access to legacy token
27   void *token() const { assert(m_token != NULL); return m_token; }
28protected:
29   // device-level overrides
30   virtual void device_config_complete();
31   virtual void device_start();
32   virtual void device_stop();
33
34   // sound stream update overrides
35   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
36private:
37   // internal state
38   void *m_token;
39};
40
41extern const device_type GAELCO_GAE1;
42
43class gaelco_cg1v_device : public gaelco_gae1_device
44{
45public:
46   gaelco_cg1v_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
47};
48
49extern const device_type GAELCO_CG1V;
50
51
2152#endif /* __GALELCO_H__ */
trunk/src/emu/sound/dmadac.c
r17612r17613
5959{
6060   assert(device != NULL);
6161   assert(device->type() == DMADAC);
62   return (dmadac_state *)downcast<legacy_device_base *>(device)->token();
62   return (dmadac_state *)downcast<dmadac_sound_device *>(device)->token();
6363}
6464
6565
r17612r17613
262262}
263263
264264
265DEFINE_LEGACY_SOUND_DEVICE(DMADAC, dmadac_sound);
265const device_type DMADAC = &device_creator<dmadac_sound_device>;
266
267dmadac_sound_device::dmadac_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
268   : device_t(mconfig, DMADAC, "DMA-driven DAC", tag, owner, clock),
269     device_sound_interface(mconfig, *this)
270{
271   m_token = global_alloc_array_clear(UINT8, sizeof(dmadac_state));
272}
273
274//-------------------------------------------------
275//  device_config_complete - perform any
276//  operations now that the configuration is
277//  complete
278//-------------------------------------------------
279
280void dmadac_sound_device::device_config_complete()
281{
282}
283
284//-------------------------------------------------
285//  device_start - device-specific startup
286//-------------------------------------------------
287
288void dmadac_sound_device::device_start()
289{
290   DEVICE_START_NAME( dmadac )(this);
291}
292
293//-------------------------------------------------
294//  sound_stream_update - handle a stream update
295//-------------------------------------------------
296
297void dmadac_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
298{
299   // should never get here
300   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
301}
302
303
trunk/src/emu/sound/dmadac.h
r17612r17613
1212
1313#include "devlegcy.h"
1414
15DECLARE_LEGACY_SOUND_DEVICE(DMADAC, dmadac_sound);
15class dmadac_sound_device : public device_t,
16                                  public device_sound_interface
17{
18public:
19   dmadac_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
20   ~dmadac_sound_device() { global_free(m_token); }
1621
22   // access to legacy token
23   void *token() const { assert(m_token != NULL); return m_token; }
24protected:
25   // device-level overrides
26   virtual void device_config_complete();
27   virtual void device_start();
28
29   // sound stream update overrides
30   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
31private:
32   // internal state
33   void *m_token;
34};
35
36extern const device_type DMADAC;
37
38
1739void dmadac_transfer(dmadac_sound_device **devlist, UINT8 num_channels, offs_t channel_spacing, offs_t frame_spacing, offs_t total_frames, INT16 *data);
1840void dmadac_enable(dmadac_sound_device **devlist, UINT8 num_channels, UINT8 enable);
1941void dmadac_set_frequency(dmadac_sound_device **devlist, UINT8 num_channels, double frequency);
trunk/src/emu/sound/2608intf.c
r17612r17613
3232{
3333   assert(device != NULL);
3434   assert(device->type() == YM2608);
35   return (ym2608_state *)downcast<legacy_device_base *>(device)->token();
35   return (ym2608_state *)downcast<ym2608_device *>(device)->token();
3636}
3737
3838
r17612r17613
232232}
233233
234234
235DEFINE_LEGACY_SOUND_DEVICE(YM2608, ym2608);
235const device_type YM2608 = &device_creator<ym2608_device>;
236
237ym2608_device::ym2608_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
238   : device_t(mconfig, YM2608, "YM2608", tag, owner, clock),
239     device_sound_interface(mconfig, *this)
240{
241   m_token = global_alloc_array_clear(UINT8, sizeof(ym2608_state));
242}
243
244//-------------------------------------------------
245//  device_config_complete - perform any
246//  operations now that the configuration is
247//  complete
248//-------------------------------------------------
249
250void ym2608_device::device_config_complete()
251{
252}
253
254//-------------------------------------------------
255//  device_start - device-specific startup
256//-------------------------------------------------
257
258void ym2608_device::device_start()
259{
260   DEVICE_START_NAME( ym2608 )(this);
261}
262
263//-------------------------------------------------
264//  device_reset - device-specific reset
265//-------------------------------------------------
266
267void ym2608_device::device_reset()
268{
269   DEVICE_RESET_NAME( ym2608 )(this);
270}
271
272//-------------------------------------------------
273//  device_stop - device-specific stop
274//-------------------------------------------------
275
276void ym2608_device::device_stop()
277{
278   DEVICE_STOP_NAME( ym2608 )(this);
279}
280
281//-------------------------------------------------
282//  sound_stream_update - handle a stream update
283//-------------------------------------------------
284
285void ym2608_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
286{
287   // should never get here
288   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
289}
290
291
trunk/src/emu/sound/s2636.c
r17612r17613
2222{
2323   assert(device != NULL);
2424   assert(device->type() == S2636_SOUND);
25   return (s2636_sound *) downcast<legacy_device_base *>(device)->token();
25   return (s2636_sound *) downcast<s2636_sound_device *>(device)->token();
2626}
2727
2828
r17612r17613
9999   }
100100}
101101
102DEFINE_LEGACY_SOUND_DEVICE(S2636_SOUND, s2636_sound);
102const device_type S2636_SOUND = &device_creator<s2636_sound_device>;
103
104s2636_sound_device::s2636_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
105   : device_t(mconfig, S2636_SOUND, "S2636", tag, owner, clock),
106     device_sound_interface(mconfig, *this)
107{
108   m_token = global_alloc_array_clear(UINT8, sizeof(s2636_sound));
109}
110
111//-------------------------------------------------
112//  device_config_complete - perform any
113//  operations now that the configuration is
114//  complete
115//-------------------------------------------------
116
117void s2636_sound_device::device_config_complete()
118{
119}
120
121//-------------------------------------------------
122//  device_start - device-specific startup
123//-------------------------------------------------
124
125void s2636_sound_device::device_start()
126{
127   DEVICE_START_NAME( s2636_sound )(this);
128}
129
130//-------------------------------------------------
131//  sound_stream_update - handle a stream update
132//-------------------------------------------------
133
134void s2636_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
135{
136   // should never get here
137   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
138}
139
140
trunk/src/emu/sound/okim6376.c
r17612r17613
9191{
9292   assert(device != NULL);
9393   assert(device->type() == OKIM6376);
94   return (okim6376_state *)downcast<legacy_device_base *>(device)->token();
94   return (okim6376_state *)downcast<okim6376_device *>(device)->token();
9595}
9696
9797
r17612r17613
646646}
647647
648648
649DEFINE_LEGACY_SOUND_DEVICE(OKIM6376, okim6376);
649const device_type OKIM6376 = &device_creator<okim6376_device>;
650
651okim6376_device::okim6376_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
652   : device_t(mconfig, OKIM6376, "OKI6376", tag, owner, clock),
653     device_sound_interface(mconfig, *this)
654{
655   m_token = global_alloc_array_clear(UINT8, sizeof(okim6376_state));
656}
657
658//-------------------------------------------------
659//  device_config_complete - perform any
660//  operations now that the configuration is
661//  complete
662//-------------------------------------------------
663
664void okim6376_device::device_config_complete()
665{
666}
667
668//-------------------------------------------------
669//  device_start - device-specific startup
670//-------------------------------------------------
671
672void okim6376_device::device_start()
673{
674   DEVICE_START_NAME( okim6376 )(this);
675}
676
677//-------------------------------------------------
678//  device_reset - device-specific reset
679//-------------------------------------------------
680
681void okim6376_device::device_reset()
682{
683   DEVICE_RESET_NAME( okim6376 )(this);
684}
685
686//-------------------------------------------------
687//  sound_stream_update - handle a stream update
688//-------------------------------------------------
689
690void okim6376_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
691{
692   // should never get here
693   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
694}
695
696
trunk/src/emu/sound/2608intf.h
r17612r17613
2929WRITE8_DEVICE_HANDLER( ym2608_data_port_a_w );
3030WRITE8_DEVICE_HANDLER( ym2608_data_port_b_w );
3131
32DECLARE_LEGACY_SOUND_DEVICE(YM2608, ym2608);
32class ym2608_device : public device_t,
33                                  public device_sound_interface
34{
35public:
36   ym2608_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
37   ~ym2608_device() { global_free(m_token); }
3338
39   // access to legacy token
40   void *token() const { assert(m_token != NULL); return m_token; }
41protected:
42   // device-level overrides
43   virtual void device_config_complete();
44   virtual void device_start();
45   virtual void device_stop();
46   virtual void device_reset();
47
48   // sound stream update overrides
49   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
50private:
51   // internal state
52   void *m_token;
53};
54
55extern const device_type YM2608;
56
57
3458#endif /* __2608INTF_H__ */
trunk/src/emu/sound/zsg2.c
r17612r17613
6969{
7070   assert(device != NULL);
7171   assert(device->type() == ZSG2);
72   return (zsg2_state *)downcast<legacy_device_base *>(device)->token();
72   return (zsg2_state *)downcast<zsg2_device *>(device)->token();
7373}
7474
7575static STREAM_UPDATE( update_stereo )
r17612r17613
257257}
258258
259259
260DEFINE_LEGACY_SOUND_DEVICE(ZSG2, zsg2);
260const device_type ZSG2 = &device_creator<zsg2_device>;
261
262zsg2_device::zsg2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
263   : device_t(mconfig, ZSG2, "ZSG-2", tag, owner, clock),
264     device_sound_interface(mconfig, *this)
265{
266   m_token = global_alloc_array_clear(UINT8, sizeof(zsg2_state));
267}
268
269//-------------------------------------------------
270//  device_config_complete - perform any
271//  operations now that the configuration is
272//  complete
273//-------------------------------------------------
274
275void zsg2_device::device_config_complete()
276{
277}
278
279//-------------------------------------------------
280//  device_start - device-specific startup
281//-------------------------------------------------
282
283void zsg2_device::device_start()
284{
285   DEVICE_START_NAME( zsg2 )(this);
286}
287
288//-------------------------------------------------
289//  sound_stream_update - handle a stream update
290//-------------------------------------------------
291
292void zsg2_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
293{
294   // should never get here
295   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
296}
297
298
trunk/src/emu/sound/es5506.c
r17612r17613
205205{
206206   assert(device != NULL);
207207   assert(device->type() == ES5505 || device->type() == ES5506);
208   return (es5506_state *)downcast<legacy_device_base *>(device)->token();
208   return (es5506_state *)downcast<es5505_device *>(device)->token();
209209}
210210
211211
r17612r17613
22072207}
22082208
22092209
2210DEFINE_LEGACY_SOUND_DEVICE(ES5505, es5505);
2211DEFINE_LEGACY_SOUND_DEVICE(ES5506, es5506);
2210const device_type ES5505 = &device_creator<es5505_device>;
2211
2212es5505_device::es5505_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
2213   : device_t(mconfig, ES5505, "ES5505", tag, owner, clock),
2214     device_sound_interface(mconfig, *this)
2215{
2216   m_token = global_alloc_array_clear(UINT8, sizeof(es5506_state));
2217}
2218
2219//-------------------------------------------------
2220//  device_config_complete - perform any
2221//  operations now that the configuration is
2222//  complete
2223//-------------------------------------------------
2224
2225void es5505_device::device_config_complete()
2226{
2227}
2228
2229//-------------------------------------------------
2230//  device_start - device-specific startup
2231//-------------------------------------------------
2232
2233void es5505_device::device_start()
2234{
2235   DEVICE_START_NAME( es5505 )(this);
2236}
2237
2238//-------------------------------------------------
2239//  device_reset - device-specific reset
2240//-------------------------------------------------
2241
2242void es5505_device::device_reset()
2243{
2244   DEVICE_RESET_NAME( es5505 )(this);
2245}
2246
2247//-------------------------------------------------
2248//  device_stop - device-specific stop
2249//-------------------------------------------------
2250
2251void es5505_device::device_stop()
2252{
2253   DEVICE_STOP_NAME( es5505 )(this);
2254}
2255
2256//-------------------------------------------------
2257//  sound_stream_update - handle a stream update
2258//-------------------------------------------------
2259
2260void es5505_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
2261{
2262   // should never get here
2263   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
2264}
2265
2266
2267const device_type ES5506 = &device_creator<es5506_device>;
2268
2269es5506_device::es5506_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
2270   : device_t(mconfig, ES5506, "ES5506", tag, owner, clock),
2271     device_sound_interface(mconfig, *this)
2272{
2273   m_token = global_alloc_array_clear(UINT8, sizeof(es5506_state));
2274}
2275
2276//-------------------------------------------------
2277//  device_config_complete - perform any
2278//  operations now that the configuration is
2279//  complete
2280//-------------------------------------------------
2281
2282void es5506_device::device_config_complete()
2283{
2284}
2285
2286//-------------------------------------------------
2287//  device_start - device-specific startup
2288//-------------------------------------------------
2289
2290void es5506_device::device_start()
2291{
2292   DEVICE_START_NAME( es5506 )(this);
2293}
2294
2295//-------------------------------------------------
2296//  device_reset - device-specific reset
2297//-------------------------------------------------
2298
2299void es5506_device::device_reset()
2300{
2301   DEVICE_RESET_NAME( es5506 )(this);
2302}
2303
2304//-------------------------------------------------
2305//  device_stop - device-specific stop
2306//-------------------------------------------------
2307
2308void es5506_device::device_stop()
2309{
2310   DEVICE_STOP_NAME( es5506 )(this);
2311}
2312
2313//-------------------------------------------------
2314//  sound_stream_update - handle a stream update
2315//-------------------------------------------------
2316
2317void es5506_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
2318{
2319   // should never get here
2320   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
2321}
2322
2323
trunk/src/emu/sound/s2636.h
r17612r17613
99
1010
1111
12DECLARE_LEGACY_SOUND_DEVICE(S2636_SOUND, s2636_sound);
12class s2636_sound_device : public device_t,
13                                  public device_sound_interface
14{
15public:
16   s2636_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
17   ~s2636_sound_device() { global_free(m_token); }
18
19   // access to legacy token
20   void *token() const { assert(m_token != NULL); return m_token; }
21protected:
22   // device-level overrides
23   virtual void device_config_complete();
24   virtual void device_start();
25
26   // sound stream update overrides
27   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
28private:
29   // internal state
30   void *m_token;
31};
32
33extern const device_type S2636_SOUND;
34
1335void s2636_soundport_w (device_t *device, int mode, int data);
1436
1537
trunk/src/emu/sound/zsg2.h
r17612r17613
1616   const char *samplergn;
1717};
1818
19DECLARE_LEGACY_SOUND_DEVICE(ZSG2, zsg2);
19class zsg2_device : public device_t,
20                                  public device_sound_interface
21{
22public:
23   zsg2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
24   ~zsg2_device() { global_free(m_token); }
2025
26   // access to legacy token
27   void *token() const { assert(m_token != NULL); return m_token; }
28protected:
29   // device-level overrides
30   virtual void device_config_complete();
31   virtual void device_start();
32
33   // sound stream update overrides
34   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
35private:
36   // internal state
37   void *m_token;
38};
39
40extern const device_type ZSG2;
41
42
2143#endif   /* __ZSG2_H__ */
trunk/src/emu/sound/okim6376.h
r17612r17613
1010READ8_DEVICE_HANDLER( okim6376_r );
1111WRITE8_DEVICE_HANDLER( okim6376_w );
1212
13DECLARE_LEGACY_SOUND_DEVICE(OKIM6376, okim6376);
13class okim6376_device : public device_t,
14                                  public device_sound_interface
15{
16public:
17   okim6376_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
18   ~okim6376_device() { global_free(m_token); }
1419
20   // access to legacy token
21   void *token() const { assert(m_token != NULL); return m_token; }
22protected:
23   // device-level overrides
24   virtual void device_config_complete();
25   virtual void device_start();
26   virtual void device_reset();
27
28   // sound stream update overrides
29   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
30private:
31   // internal state
32   void *m_token;
33};
34
35extern const device_type OKIM6376;
36
37
1538WRITE_LINE_DEVICE_HANDLER( okim6376_st_w );
1639WRITE_LINE_DEVICE_HANDLER( okim6376_ch2_w );
1740
trunk/src/emu/sound/es5506.h
r17612r17613
2525WRITE16_DEVICE_HANDLER( es5505_w );
2626void es5505_voice_bank_w(device_t *device, int voice, int bank);
2727
28DECLARE_LEGACY_SOUND_DEVICE(ES5505, es5505);
28class es5505_device : public device_t,
29                                  public device_sound_interface
30{
31public:
32   es5505_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
33   ~es5505_device() { global_free(m_token); }
2934
35   // access to legacy token
36   void *token() const { assert(m_token != NULL); return m_token; }
37protected:
38   // device-level overrides
39   virtual void device_config_complete();
40   virtual void device_start();
41   virtual void device_stop();
42   virtual void device_reset();
3043
44   // sound stream update overrides
45   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
46private:
47   // internal state
48   void *m_token;
49};
50
51extern const device_type ES5505;
52
53
54
3155typedef struct _es5506_interface es5506_interface;
3256struct _es5506_interface
3357{
r17612r17613
4367WRITE8_DEVICE_HANDLER( es5506_w );
4468void es5506_voice_bank_w(device_t *device, int voice, int bank);
4569
46DECLARE_LEGACY_SOUND_DEVICE(ES5506, es5506);
70class es5506_device : public device_t,
71                                  public device_sound_interface
72{
73public:
74   es5506_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
75   ~es5506_device() { global_free(m_token); }
4776
77   // access to legacy token
78   void *token() const { assert(m_token != NULL); return m_token; }
79protected:
80   // device-level overrides
81   virtual void device_config_complete();
82   virtual void device_start();
83   virtual void device_stop();
84   virtual void device_reset();
85
86   // sound stream update overrides
87   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
88private:
89   // internal state
90   void *m_token;
91};
92
93extern const device_type ES5506;
94
95
4896#endif /* __ES5506_H__ */
trunk/src/emu/sound/ymf278b.c
r17612r17613
157157{
158158   assert(device != NULL);
159159   assert(device->type() == YMF278B);
160   return (YMF278BChip *)downcast<legacy_device_base *>(device)->token();
160   return (YMF278BChip *)downcast<ymf278b_device *>(device)->token();
161161}
162162
163163static void ymf278b_write_memory(YMF278BChip *chip, UINT32 offset, UINT8 data)
r17612r17613
11111111}
11121112
11131113
1114DEFINE_LEGACY_SOUND_DEVICE(YMF278B, ymf278b);
1114const device_type YMF278B = &device_creator<ymf278b_device>;
1115
1116ymf278b_device::ymf278b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1117   : device_t(mconfig, YMF278B, "YMF278B", tag, owner, clock),
1118     device_sound_interface(mconfig, *this)
1119{
1120   m_token = global_alloc_array_clear(UINT8, sizeof(YMF278BChip));
1121}
1122
1123//-------------------------------------------------
1124//  device_config_complete - perform any
1125//  operations now that the configuration is
1126//  complete
1127//-------------------------------------------------
1128
1129void ymf278b_device::device_config_complete()
1130{
1131}
1132
1133//-------------------------------------------------
1134//  device_start - device-specific startup
1135//-------------------------------------------------
1136
1137void ymf278b_device::device_start()
1138{
1139   DEVICE_START_NAME( ymf278b )(this);
1140}
1141
1142//-------------------------------------------------
1143//  device_reset - device-specific reset
1144//-------------------------------------------------
1145
1146void ymf278b_device::device_reset()
1147{
1148   DEVICE_RESET_NAME( ymf278b )(this);
1149}
1150
1151//-------------------------------------------------
1152//  sound_stream_update - handle a stream update
1153//-------------------------------------------------
1154
1155void ymf278b_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
1156{
1157   // should never get here
1158   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
1159}
1160
1161
trunk/src/emu/sound/ymf278b.h
r17612r17613
1717READ8_DEVICE_HANDLER( ymf278b_r );
1818WRITE8_DEVICE_HANDLER( ymf278b_w );
1919
20DECLARE_LEGACY_SOUND_DEVICE(YMF278B, ymf278b);
20class ymf278b_device : public device_t,
21                                  public device_sound_interface
22{
23public:
24   ymf278b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
25   ~ymf278b_device() { global_free(m_token); }
2126
27   // access to legacy token
28   void *token() const { assert(m_token != NULL); return m_token; }
29protected:
30   // device-level overrides
31   virtual void device_config_complete();
32   virtual void device_start();
33   virtual void device_reset();
34
35   // sound stream update overrides
36   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
37private:
38   // internal state
39   void *m_token;
40};
41
42extern const device_type YMF278B;
43
44
2245#endif /* __YMF278B_H__ */
trunk/src/emu/sound/sid6581.c
r17612r17613
1616{
1717   assert(device != NULL);
1818   assert((device->type() == SID6581) || (device->type() == SID8580));
19   return (_SID6581 *) downcast<legacy_device_base *>(device)->token();
19   return (_SID6581 *) downcast<sid6581_device *>(device)->token();
2020}
2121
2222
r17612r17613
125125}
126126
127127
128DEFINE_LEGACY_SOUND_DEVICE(SID6581, sid6581);
129DEFINE_LEGACY_SOUND_DEVICE(SID8580, sid8580);
128const device_type SID6581 = &device_creator<sid6581_device>;
129
130sid6581_device::sid6581_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
131   : device_t(mconfig, SID6581, "SID6581", tag, owner, clock),
132     device_sound_interface(mconfig, *this)
133{
134   m_token = global_alloc_array_clear(UINT8, sizeof(_SID6581));
135}
136sid6581_device::sid6581_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
137   : device_t(mconfig, type, name, tag, owner, clock),
138     device_sound_interface(mconfig, *this)
139{
140   m_token = global_alloc_array_clear(UINT8, sizeof(_SID6581));
141}
142
143//-------------------------------------------------
144//  device_config_complete - perform any
145//  operations now that the configuration is
146//  complete
147//-------------------------------------------------
148
149void sid6581_device::device_config_complete()
150{
151}
152
153//-------------------------------------------------
154//  device_start - device-specific startup
155//-------------------------------------------------
156
157void sid6581_device::device_start()
158{
159   DEVICE_START_NAME( sid6581 )(this);
160}
161
162//-------------------------------------------------
163//  device_reset - device-specific reset
164//-------------------------------------------------
165
166void sid6581_device::device_reset()
167{
168   DEVICE_RESET_NAME( sid )(this);
169}
170
171//-------------------------------------------------
172//  sound_stream_update - handle a stream update
173//-------------------------------------------------
174
175void sid6581_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
176{
177   // should never get here
178   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
179}
180
181
182const device_type SID8580 = &device_creator<sid8580_device>;
183
184sid8580_device::sid8580_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
185   : sid6581_device(mconfig, SID8580, "SID8580", tag, owner, clock)
186{
187}
188
189//-------------------------------------------------
190//  device_start - device-specific startup
191//-------------------------------------------------
192
193void sid8580_device::device_start()
194{
195   DEVICE_START_NAME( sid8580 )(this);
196}
197
198//-------------------------------------------------
199//  sound_stream_update - handle a stream update
200//-------------------------------------------------
201
202void sid8580_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
203{
204   // should never get here
205   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
206}
207
208
trunk/src/emu/sound/flt_vol.c
r17612r17613
1313{
1414   assert(device != NULL);
1515   assert(device->type() == FILTER_VOLUME);
16   return (filter_volume_state *)downcast<legacy_device_base *>(device)->token();
16   return (filter_volume_state *)downcast<filter_volume_device *>(device)->token();
1717}
1818
1919
r17612r17613
7272}
7373
7474
75DEFINE_LEGACY_SOUND_DEVICE(FILTER_VOLUME, filter_volume);
75const device_type FILTER_VOLUME = &device_creator<filter_volume_device>;
76
77filter_volume_device::filter_volume_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
78   : device_t(mconfig, FILTER_VOLUME, "Volume Filter", tag, owner, clock),
79     device_sound_interface(mconfig, *this)
80{
81   m_token = global_alloc_array_clear(UINT8, sizeof(filter_volume_state));
82}
83
84//-------------------------------------------------
85//  device_config_complete - perform any
86//  operations now that the configuration is
87//  complete
88//-------------------------------------------------
89
90void filter_volume_device::device_config_complete()
91{
92}
93
94//-------------------------------------------------
95//  device_start - device-specific startup
96//-------------------------------------------------
97
98void filter_volume_device::device_start()
99{
100   DEVICE_START_NAME( filter_volume )(this);
101}
102
103//-------------------------------------------------
104//  sound_stream_update - handle a stream update
105//-------------------------------------------------
106
107void filter_volume_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
108{
109   // should never get here
110   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
111}
112
113
trunk/src/emu/sound/sid6581.h
r17612r17613
3434READ8_DEVICE_HANDLER  ( sid6581_r );
3535WRITE8_DEVICE_HANDLER ( sid6581_w );
3636
37DECLARE_LEGACY_SOUND_DEVICE(SID6581, sid6581);
38DECLARE_LEGACY_SOUND_DEVICE(SID8580, sid8580);
37class sid6581_device : public device_t,
38                                  public device_sound_interface
39{
40public:
41   sid6581_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
42   sid6581_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
43   ~sid6581_device() { global_free(m_token); }
3944
45   // access to legacy token
46   void *token() const { assert(m_token != NULL); return m_token; }
47protected:
48   // device-level overrides
49   virtual void device_config_complete();
50   virtual void device_start();
51   virtual void device_reset();
52
53   // sound stream update overrides
54   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
55private:
56   // internal state
57   void *m_token;
58};
59
60extern const device_type SID6581;
61
62class sid8580_device : public sid6581_device
63{
64public:
65   sid8580_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
66protected:
67   // device-level overrides
68   virtual void device_start();
69
70   // sound stream update overrides
71   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
72};
73
74extern const device_type SID8580;
75
76
4077#endif /* __SID6581_H__ */
trunk/src/emu/sound/2151intf.c
r17612r17613
2828{
2929   assert(device != NULL);
3030   assert(device->type() == YM2151);
31   return (ym2151_state *)downcast<legacy_device_base *>(device)->token();
31   return (ym2151_state *)downcast<ym2151_device *>(device)->token();
3232}
3333
3434
r17612r17613
146146}
147147
148148
149DEFINE_LEGACY_SOUND_DEVICE(YM2151, ym2151);
149const device_type YM2151 = &device_creator<ym2151_device>;
150
151ym2151_device::ym2151_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
152   : device_t(mconfig, YM2151, "YM2151", tag, owner, clock),
153     device_sound_interface(mconfig, *this)
154{
155   m_token = global_alloc_array_clear(UINT8, sizeof(ym2151_state));
156}
157
158//-------------------------------------------------
159//  device_config_complete - perform any
160//  operations now that the configuration is
161//  complete
162//-------------------------------------------------
163
164void ym2151_device::device_config_complete()
165{
166}
167
168//-------------------------------------------------
169//  device_start - device-specific startup
170//-------------------------------------------------
171
172void ym2151_device::device_start()
173{
174   DEVICE_START_NAME( ym2151 )(this);
175}
176
177//-------------------------------------------------
178//  device_reset - device-specific reset
179//-------------------------------------------------
180
181void ym2151_device::device_reset()
182{
183   DEVICE_RESET_NAME( ym2151 )(this);
184}
185
186//-------------------------------------------------
187//  device_stop - device-specific stop
188//-------------------------------------------------
189
190void ym2151_device::device_stop()
191{
192   DEVICE_STOP_NAME( ym2151 )(this);
193}
194
195//-------------------------------------------------
196//  sound_stream_update - handle a stream update
197//-------------------------------------------------
198
199void ym2151_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
200{
201   // should never get here
202   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
203}
204
205
trunk/src/emu/sound/k053260.c
r17612r17613
4747{
4848   assert(device != NULL);
4949   assert(device->type() == K053260);
50   return (k053260_state *)downcast<legacy_device_base *>(device)->token();
50   return (k053260_state *)downcast<k053260_device *>(device)->token();
5151}
5252
5353
r17612r17613
463463}
464464
465465
466DEFINE_LEGACY_SOUND_DEVICE(K053260, k053260);
466const device_type K053260 = &device_creator<k053260_device>;
467
468k053260_device::k053260_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
469   : device_t(mconfig, K053260, "K053260", tag, owner, clock),
470     device_sound_interface(mconfig, *this)
471{
472   m_token = global_alloc_array_clear(UINT8, sizeof(k053260_state));
473}
474
475//-------------------------------------------------
476//  device_config_complete - perform any
477//  operations now that the configuration is
478//  complete
479//-------------------------------------------------
480
481void k053260_device::device_config_complete()
482{
483}
484
485//-------------------------------------------------
486//  device_start - device-specific startup
487//-------------------------------------------------
488
489void k053260_device::device_start()
490{
491   DEVICE_START_NAME( k053260 )(this);
492}
493
494//-------------------------------------------------
495//  device_reset - device-specific reset
496//-------------------------------------------------
497
498void k053260_device::device_reset()
499{
500   DEVICE_RESET_NAME( k053260 )(this);
501}
502
503//-------------------------------------------------
504//  sound_stream_update - handle a stream update
505//-------------------------------------------------
506
507void k053260_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
508{
509   // should never get here
510   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
511}
512
513
trunk/src/emu/sound/2413intf.c
r17612r17613
2222{
2323   assert(device != NULL);
2424   assert(device->type() == YM2413);
25   return (ym2413_state *)downcast<legacy_device_base *>(device)->token();
25   return (ym2413_state *)downcast<ym2413_device *>(device)->token();
2626}
2727
2828
r17612r17613
142142}
143143
144144
145DEFINE_LEGACY_SOUND_DEVICE(YM2413, ym2413);
145const device_type YM2413 = &device_creator<ym2413_device>;
146
147ym2413_device::ym2413_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
148   : device_t(mconfig, YM2413, "YM2413", tag, owner, clock),
149     device_sound_interface(mconfig, *this)
150{
151   m_token = global_alloc_array_clear(UINT8, sizeof(ym2413_state));
152}
153
154//-------------------------------------------------
155//  device_config_complete - perform any
156//  operations now that the configuration is
157//  complete
158//-------------------------------------------------
159
160void ym2413_device::device_config_complete()
161{
162}
163
164//-------------------------------------------------
165//  device_start - device-specific startup
166//-------------------------------------------------
167
168void ym2413_device::device_start()
169{
170   DEVICE_START_NAME( ym2413 )(this);
171}
172
173//-------------------------------------------------
174//  device_reset - device-specific reset
175//-------------------------------------------------
176
177void ym2413_device::device_reset()
178{
179   DEVICE_RESET_NAME( ym2413 )(this);
180}
181
182//-------------------------------------------------
183//  device_stop - device-specific stop
184//-------------------------------------------------
185
186void ym2413_device::device_stop()
187{
188   DEVICE_STOP_NAME( ym2413 )(this);
189}
190
191//-------------------------------------------------
192//  sound_stream_update - handle a stream update
193//-------------------------------------------------
194
195void ym2413_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
196{
197   // should never get here
198   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
199}
200
201
trunk/src/emu/sound/flt_vol.h
r17612r17613
88
99void flt_volume_set_volume(device_t *device, float volume);
1010
11DECLARE_LEGACY_SOUND_DEVICE(FILTER_VOLUME, filter_volume);
11class filter_volume_device : public device_t,
12                                  public device_sound_interface
13{
14public:
15   filter_volume_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
16   ~filter_volume_device() { global_free(m_token); }
1217
18   // access to legacy token
19   void *token() const { assert(m_token != NULL); return m_token; }
20protected:
21   // device-level overrides
22   virtual void device_config_complete();
23   virtual void device_start();
24
25   // sound stream update overrides
26   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
27private:
28   // internal state
29   void *m_token;
30};
31
32extern const device_type FILTER_VOLUME;
33
34
1335#endif /* __FLT_VOL_H__ */
trunk/src/emu/sound/2151intf.h
r17612r17613
1919WRITE8_DEVICE_HANDLER( ym2151_register_port_w );
2020WRITE8_DEVICE_HANDLER( ym2151_data_port_w );
2121
22DECLARE_LEGACY_SOUND_DEVICE(YM2151, ym2151);
22class ym2151_device : public device_t,
23                                  public device_sound_interface
24{
25public:
26   ym2151_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
27   ~ym2151_device() { global_free(m_token); }
2328
29   // access to legacy token
30   void *token() const { assert(m_token != NULL); return m_token; }
31protected:
32   // device-level overrides
33   virtual void device_config_complete();
34   virtual void device_start();
35   virtual void device_stop();
36   virtual void device_reset();
37
38   // sound stream update overrides
39   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
40private:
41   // internal state
42   void *m_token;
43};
44
45extern const device_type YM2151;
46
47
2448#endif /* __2151INTF_H__ */
trunk/src/emu/sound/2413intf.h
r17612r17613
1010WRITE8_DEVICE_HANDLER( ym2413_register_port_w );
1111WRITE8_DEVICE_HANDLER( ym2413_data_port_w );
1212
13DECLARE_LEGACY_SOUND_DEVICE(YM2413, ym2413);
13class ym2413_device : public device_t,
14                                  public device_sound_interface
15{
16public:
17   ym2413_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
18   ~ym2413_device() { global_free(m_token); }
1419
20   // access to legacy token
21   void *token() const { assert(m_token != NULL); return m_token; }
22protected:
23   // device-level overrides
24   virtual void device_config_complete();
25   virtual void device_start();
26   virtual void device_stop();
27   virtual void device_reset();
28
29   // sound stream update overrides
30   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
31private:
32   // internal state
33   void *m_token;
34};
35
36extern const device_type YM2413;
37
38
1539#endif /* __2413INTF_H__ */
trunk/src/emu/sound/k053260.h
r17612r17613
2121WRITE8_DEVICE_HANDLER( k053260_w );
2222READ8_DEVICE_HANDLER( k053260_r );
2323
24DECLARE_LEGACY_SOUND_DEVICE(K053260, k053260);
24class k053260_device : public device_t,
25                                  public device_sound_interface
26{
27public:
28   k053260_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
29   ~k053260_device() { global_free(m_token); }
2530
31   // access to legacy token
32   void *token() const { assert(m_token != NULL); return m_token; }
33protected:
34   // device-level overrides
35   virtual void device_config_complete();
36   virtual void device_start();
37   virtual void device_reset();
38
39   // sound stream update overrides
40   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
41private:
42   // internal state
43   void *m_token;
44};
45
46extern const device_type K053260;
47
48
2649#endif /* __K053260_H__ */
trunk/src/emu/sound/segapcm.c
r17612r17613
2121{
2222   assert(device != NULL);
2323   assert(device->type() == SEGAPCM);
24   return (segapcm_state *)downcast<legacy_device_base *>(device)->token();
24   return (segapcm_state *)downcast<segapcm_device *>(device)->token();
2525}
2626
2727static STREAM_UPDATE( SEGAPCM_update )
r17612r17613
176176}
177177
178178
179DEFINE_LEGACY_SOUND_DEVICE(SEGAPCM, segapcm);
179const device_type SEGAPCM = &device_creator<segapcm_device>;
180
181segapcm_device::segapcm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
182   : device_t(mconfig, SEGAPCM, "Sega PCM", tag, owner, clock),
183     device_sound_interface(mconfig, *this)
184{
185   m_token = global_alloc_array_clear(UINT8, sizeof(segapcm_state));
186}
187
188//-------------------------------------------------
189//  device_config_complete - perform any
190//  operations now that the configuration is
191//  complete
192//-------------------------------------------------
193
194void segapcm_device::device_config_complete()
195{
196}
197
198//-------------------------------------------------
199//  device_start - device-specific startup
200//-------------------------------------------------
201
202void segapcm_device::device_start()
203{
204   DEVICE_START_NAME( segapcm )(this);
205}
206
207//-------------------------------------------------
208//  sound_stream_update - handle a stream update
209//-------------------------------------------------
210
211void segapcm_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
212{
213   // should never get here
214   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
215}
216
217
trunk/src/emu/sound/segapcm.h
r17612r17613
2525WRITE8_DEVICE_HANDLER( sega_pcm_w );
2626READ8_DEVICE_HANDLER( sega_pcm_r );
2727
28DECLARE_LEGACY_SOUND_DEVICE(SEGAPCM, segapcm);
28class segapcm_device : public device_t,
29                                  public device_sound_interface
30{
31public:
32   segapcm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
33   ~segapcm_device() { global_free(m_token); }
2934
35   // access to legacy token
36   void *token() const { assert(m_token != NULL); return m_token; }
37protected:
38   // device-level overrides
39   virtual void device_config_complete();
40   virtual void device_start();
41
42   // sound stream update overrides
43   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
44private:
45   // internal state
46   void *m_token;
47};
48
49extern const device_type SEGAPCM;
50
51
3052#endif /* __SEGAPCM_H__ */
trunk/src/emu/sound/vrender0.c
r17612r17613
2626{
2727   assert(device != NULL);
2828   assert(device->type() == VRENDER0);
29   return (vr0_state *)downcast<legacy_device_base *>(device)->token();
29   return (vr0_state *)downcast<vrender0_device *>(device)->token();
3030}
3131
3232static void VR0_RenderAudio(vr0_state *VR0, int nsamples,stream_sample_t *l,stream_sample_t *r);
r17612r17613
267267}
268268
269269
270DEFINE_LEGACY_SOUND_DEVICE(VRENDER0, vrender0);
270const device_type VRENDER0 = &device_creator<vrender0_device>;
271
272vrender0_device::vrender0_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
273   : device_t(mconfig, VRENDER0, "VRender0", tag, owner, clock),
274     device_sound_interface(mconfig, *this)
275{
276   m_token = global_alloc_array_clear(UINT8, sizeof(vr0_state));
277}
278
279//-------------------------------------------------
280//  device_config_complete - perform any
281//  operations now that the configuration is
282//  complete
283//-------------------------------------------------
284
285void vrender0_device::device_config_complete()
286{
287}
288
289//-------------------------------------------------
290//  device_start - device-specific startup
291//-------------------------------------------------
292
293void vrender0_device::device_start()
294{
295   DEVICE_START_NAME( vrender0 )(this);
296}
297
298//-------------------------------------------------
299//  sound_stream_update - handle a stream update
300//-------------------------------------------------
301
302void vrender0_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
303{
304   // should never get here
305   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
306}
307
308
trunk/src/emu/sound/8950intf.c
r17612r17613
3737{
3838   assert(device != NULL);
3939   assert(device->type() == Y8950);
40   return (y8950_state *)downcast<legacy_device_base *>(device)->token();
40   return (y8950_state *)downcast<y8950_device *>(device)->token();
4141}
4242
4343
r17612r17613
200200}
201201
202202
203DEFINE_LEGACY_SOUND_DEVICE(Y8950, y8950);
203const device_type Y8950 = &device_creator<y8950_device>;
204
205y8950_device::y8950_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
206   : device_t(mconfig, Y8950, "Y8950", tag, owner, clock),
207     device_sound_interface(mconfig, *this)
208{
209   m_token = global_alloc_array_clear(UINT8, sizeof(y8950_state));
210}
211
212//-------------------------------------------------
213//  device_config_complete - perform any
214//  operations now that the configuration is
215//  complete
216//-------------------------------------------------
217
218void y8950_device::device_config_complete()
219{
220}
221
222//-------------------------------------------------
223//  device_start - device-specific startup
224//-------------------------------------------------
225
226void y8950_device::device_start()
227{
228   DEVICE_START_NAME( y8950 )(this);
229}
230
231//-------------------------------------------------
232//  device_reset - device-specific reset
233//-------------------------------------------------
234
235void y8950_device::device_reset()
236{
237   DEVICE_RESET_NAME( y8950 )(this);
238}
239
240//-------------------------------------------------
241//  device_stop - device-specific stop
242//-------------------------------------------------
243
244void y8950_device::device_stop()
245{
246   DEVICE_STOP_NAME( y8950 )(this);
247}
248
249//-------------------------------------------------
250//  sound_stream_update - handle a stream update
251//-------------------------------------------------
252
253void y8950_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
254{
255   // should never get here
256   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
257}
258
259
trunk/src/emu/sound/t6w28.c
r17612r17613
6161{
6262   assert(device != NULL);
6363   assert(device->type() == T6W28);
64   return (t6w28_state *)downcast<legacy_device_base *>(device)->token();
64   return (t6w28_state *)downcast<t6w28_device *>(device)->token();
6565}
6666
6767
r17612r17613
392392}
393393
394394
395DEFINE_LEGACY_SOUND_DEVICE(T6W28, t6w28);
395const device_type T6W28 = &device_creator<t6w28_device>;
396
397t6w28_device::t6w28_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
398   : device_t(mconfig, T6W28, "T6W28", tag, owner, clock),
399     device_sound_interface(mconfig, *this)
400{
401   m_token = global_alloc_array_clear(UINT8, sizeof(t6w28_state));
402}
403
404//-------------------------------------------------
405//  device_config_complete - perform any
406//  operations now that the configuration is
407//  complete
408//-------------------------------------------------
409
410void t6w28_device::device_config_complete()
411{
412}
413
414//-------------------------------------------------
415//  device_start - device-specific startup
416//-------------------------------------------------
417
418void t6w28_device::device_start()
419{
420   DEVICE_START_NAME( t6w28 )(this);
421}
422
423//-------------------------------------------------
424//  sound_stream_update - handle a stream update
425//-------------------------------------------------
426
427void t6w28_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
428{
429   // should never get here
430   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
431}
432
433
trunk/src/emu/sound/multipcm.c
r17612r17613
130130{
131131   assert(device != NULL);
132132   assert(device->type() == MULTIPCM);
133   return (MultiPCM *)downcast<legacy_device_base *>(device)->token();
133   return (MultiPCM *)downcast<multipcm_device *>(device)->token();
134134}
135135
136136
r17612r17613
700700}
701701
702702
703DEFINE_LEGACY_SOUND_DEVICE(MULTIPCM, multipcm);
703const device_type MULTIPCM = &device_creator<multipcm_device>;
704
705multipcm_device::multipcm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
706   : device_t(mconfig, MULTIPCM, "Sega/Yamaha 315-5560", tag, owner, clock),
707     device_sound_interface(mconfig, *this)
708{
709   m_token = global_alloc_array_clear(UINT8, sizeof(MultiPCM));
710}
711
712//-------------------------------------------------
713//  device_config_complete - perform any
714//  operations now that the configuration is
715//  complete
716//-------------------------------------------------
717
718void multipcm_device::device_config_complete()
719{
720}
721
722//-------------------------------------------------
723//  device_start - device-specific startup
724//-------------------------------------------------
725
726void multipcm_device::device_start()
727{
728   DEVICE_START_NAME( multipcm )(this);
729}
730
731//-------------------------------------------------
732//  sound_stream_update - handle a stream update
733//-------------------------------------------------
734
735void multipcm_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
736{
737   // should never get here
738   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
739}
740
741
trunk/src/emu/sound/vrender0.h
r17612r17613
1717READ32_DEVICE_HANDLER( vr0_snd_read );
1818WRITE32_DEVICE_HANDLER( vr0_snd_write );
1919
20DECLARE_LEGACY_SOUND_DEVICE(VRENDER0, vrender0);
20class vrender0_device : public device_t,
21                                  public device_sound_interface
22{
23public:
24   vrender0_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
25   ~vrender0_device() { global_free(m_token); }
2126
27   // access to legacy token
28   void *token() const { assert(m_token != NULL); return m_token; }
29protected:
30   // device-level overrides
31   virtual void device_config_complete();
32   virtual void device_start();
33
34   // sound stream update overrides
35   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
36private:
37   // internal state
38   void *m_token;
39};
40
41extern const device_type VRENDER0;
42
43
2244#endif /* __VRENDER0_H__ */
trunk/src/emu/sound/8950intf.h
r17612r17613
2424WRITE8_DEVICE_HANDLER( y8950_control_port_w );
2525WRITE8_DEVICE_HANDLER( y8950_write_port_w );
2626
27DECLARE_LEGACY_SOUND_DEVICE(Y8950, y8950);
27class y8950_device : public device_t,
28                                  public device_sound_interface
29{
30public:
31   y8950_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
32   ~y8950_device() { global_free(m_token); }
2833
34   // access to legacy token
35   void *token() const { assert(m_token != NULL); return m_token; }
36protected:
37   // device-level overrides
38   virtual void device_config_complete();
39   virtual void device_start();
40   virtual void device_stop();
41   virtual void device_reset();
42
43   // sound stream update overrides
44   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
45private:
46   // internal state
47   void *m_token;
48};
49
50extern const device_type Y8950;
51
52
2953#endif /* __8950INTF_H__ */
trunk/src/emu/sound/namco.c
r17612r17613
8080   assert(device->type() == NAMCO ||
8181         device->type() == NAMCO_15XX ||
8282         device->type() == NAMCO_CUS30);
83   return (namco_sound *)downcast<legacy_device_base *>(device)->token();
83   return (namco_sound *)downcast<namco_device *>(device)->token();
8484}
8585
8686/* update the decoded waveform data */
r17612r17613
891891}
892892
893893
894DEFINE_LEGACY_SOUND_DEVICE(NAMCO, namco);
895DEFINE_LEGACY_SOUND_DEVICE(NAMCO_15XX, namco_15xx);
896DEFINE_LEGACY_SOUND_DEVICE(NAMCO_CUS30, namco_cus30);
894const device_type NAMCO = &device_creator<namco_device>;
895
896namco_device::namco_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
897   : device_t(mconfig, NAMCO, "Namco", tag, owner, clock),
898     device_sound_interface(mconfig, *this)
899{
900   m_token = global_alloc_array_clear(UINT8, sizeof(namco_sound));
901}
902
903namco_device::namco_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
904   : device_t(mconfig, type, name, tag, owner, clock),
905     device_sound_interface(mconfig, *this)
906{
907   m_token = global_alloc_array_clear(UINT8, sizeof(namco_sound));
908}
909
910//-------------------------------------------------
911//  device_config_complete - perform any
912//  operations now that the configuration is
913//  complete
914//-------------------------------------------------
915
916void namco_device::device_config_complete()
917{
918}
919
920//-------------------------------------------------
921//  device_start - device-specific startup
922//-------------------------------------------------
923
924void namco_device::device_start()
925{
926   DEVICE_START_NAME( namco )(this);
927}
928
929//-------------------------------------------------
930//  sound_stream_update - handle a stream update
931//-------------------------------------------------
932
933void namco_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
934{
935   // should never get here
936   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
937}
938
939
940const device_type NAMCO_15XX = &device_creator<namco_15xx_device>;
941
942namco_15xx_device::namco_15xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
943   : namco_device(mconfig, NAMCO_15XX, "Namco 15XX", tag, owner, clock)
944{
945}
946
947const device_type NAMCO_CUS30 = &device_creator<namco_cus30_device>;
948
949namco_cus30_device::namco_cus30_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
950   : namco_device(mconfig, NAMCO_CUS30, "Namco CUS30", tag, owner, clock)
951{
952}
trunk/src/emu/sound/sn76477.c
r17612r17613
264264{
265265   assert(device != NULL);
266266   assert(device->type() == SN76477);
267   return (sn76477_state *)downcast<legacy_device_base *>(device)->token();
267   return (sn76477_state *)downcast<sn76477_device *>(device)->token();
268268}
269269
270270
r17612r17613
24842484}
24852485
24862486
2487DEFINE_LEGACY_SOUND_DEVICE(SN76477, sn76477);
2487const device_type SN76477 = &device_creator<sn76477_device>;
2488
2489sn76477_device::sn76477_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
2490   : device_t(mconfig, SN76477, "SN76477", tag, owner, clock),
2491     device_sound_interface(mconfig, *this)
2492{
2493   m_token = global_alloc_array_clear(UINT8, sizeof(sn76477_state));
2494}
2495
2496//-------------------------------------------------
2497//  device_config_complete - perform any
2498//  operations now that the configuration is
2499//  complete
2500//-------------------------------------------------
2501
2502void sn76477_device::device_config_complete()
2503{
2504}
2505
2506//-------------------------------------------------
2507//  device_start - device-specific startup
2508//-------------------------------------------------
2509
2510void sn76477_device::device_start()
2511{
2512   DEVICE_START_NAME( sn76477 )(this);
2513}
2514
2515//-------------------------------------------------
2516//  device_stop - device-specific stop
2517//-------------------------------------------------
2518
2519void sn76477_device::device_stop()
2520{
2521   DEVICE_STOP_NAME( sn76477 )(this);
2522}
2523
2524//-------------------------------------------------
2525//  sound_stream_update - handle a stream update
2526//-------------------------------------------------
2527
2528void sn76477_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
2529{
2530   // should never get here
2531   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
2532}
2533
2534
trunk/src/emu/sound/t6w28.h
r17612r17613
77
88WRITE8_DEVICE_HANDLER( t6w28_w );
99
10DECLARE_LEGACY_SOUND_DEVICE(T6W28, t6w28);
10class t6w28_device : public device_t,
11                                  public device_sound_interface
12{
13public:
14   t6w28_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
15   ~t6w28_device() { global_free(m_token); }
1116
17   // access to legacy token
18   void *token() const { assert(m_token != NULL); return m_token; }
19protected:
20   // device-level overrides
21   virtual void device_config_complete();
22   virtual void device_start();
23
24   // sound stream update overrides
25   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
26private:
27   // internal state
28   void *m_token;
29};
30
31extern const device_type T6W28;
32
33
1234#endif /* __T6W28_H__ */
trunk/src/emu/sound/multipcm.h
r17612r17613
1010
1111void multipcm_set_bank(device_t *device, UINT32 leftoffs, UINT32 rightoffs);
1212
13DECLARE_LEGACY_SOUND_DEVICE(MULTIPCM, multipcm);
13class multipcm_device : public device_t,
14                                  public device_sound_interface
15{
16public:
17   multipcm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
18   ~multipcm_device() { global_free(m_token); }
1419
20   // access to legacy token
21   void *token() const { assert(m_token != NULL); return m_token; }
22protected:
23   // device-level overrides
24   virtual void device_config_complete();
25   virtual void device_start();
26
27   // sound stream update overrides
28   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
29private:
30   // internal state
31   void *m_token;
32};
33
34extern const device_type MULTIPCM;
35
36
1537#endif /* __MULTIPCM_H__ */
trunk/src/emu/sound/namco.h
r17612r17613
2727READ8_DEVICE_HANDLER( namco_snd_sharedram_r );
2828WRITE8_DEVICE_HANDLER( namco_snd_sharedram_w );
2929
30DECLARE_LEGACY_SOUND_DEVICE(NAMCO, namco);
31DECLARE_LEGACY_SOUND_DEVICE(NAMCO_15XX, namco_15xx);
32DECLARE_LEGACY_SOUND_DEVICE(NAMCO_CUS30, namco_cus30);
30class namco_device : public device_t,
31                                  public device_sound_interface
32{
33public:
34   namco_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
35   namco_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
36   ~namco_device() { global_free(m_token); }
3337
38   // access to legacy token
39   void *token() const { assert(m_token != NULL); return m_token; }
40protected:
41   // device-level overrides
42   virtual void device_config_complete();
43   virtual void device_start();
3444
45   // sound stream update overrides
46   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
47private:
48   // internal state
49   void *m_token;
50};
51
52extern const device_type NAMCO;
53
54class namco_15xx_device : public namco_device
55{
56public:
57   namco_15xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
58};
59
60extern const device_type NAMCO_15XX;
61
62class namco_cus30_device : public namco_device
63{
64public:
65   namco_cus30_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
66};
67
68extern const device_type NAMCO_CUS30;
69
70
71
3572#endif /* __NAMCO_H__ */
3673
trunk/src/emu/sound/sn76477.h
r17612r17613
125125void sn76477_vco_voltage_w(device_t *device, double data);
126126void sn76477_pitch_voltage_w(device_t *device, double data);
127127
128DECLARE_LEGACY_SOUND_DEVICE(SN76477, sn76477);
128class sn76477_device : public device_t,
129                                  public device_sound_interface
130{
131public:
132   sn76477_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
133   ~sn76477_device() { global_free(m_token); }
129134
135   // access to legacy token
136   void *token() const { assert(m_token != NULL); return m_token; }
137protected:
138   // device-level overrides
139   virtual void device_config_complete();
140   virtual void device_start();
141   virtual void device_stop();
142
143   // sound stream update overrides
144   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
145private:
146   // internal state
147   void *m_token;
148};
149
150extern const device_type SN76477;
151
152
130153#endif/* __SN76477_H__ */
trunk/src/emu/sound/vlm5030.c
r17612r17613
214214{
215215   assert(device != NULL);
216216   assert(device->type() == VLM5030);
217   return (vlm5030_state *)downcast<legacy_device_base *>(device)->token();
217   return (vlm5030_state *)downcast<vlm5030_device *>(device)->token();
218218}
219219
220220static int get_bits(vlm5030_state *chip, int sbit,int bits)
r17612r17613
715715}
716716
717717
718DEFINE_LEGACY_SOUND_DEVICE(VLM5030, vlm5030);
718const device_type VLM5030 = &device_creator<vlm5030_device>;
719
720vlm5030_device::vlm5030_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
721   : device_t(mconfig, VLM5030, "VLM5030", tag, owner, clock),
722     device_sound_interface(mconfig, *this)
723{
724   m_token = global_alloc_array_clear(UINT8, sizeof(vlm5030_state));
725}
726
727//-------------------------------------------------
728//  device_config_complete - perform any
729//  operations now that the configuration is
730//  complete
731//-------------------------------------------------
732
733void vlm5030_device::device_config_complete()
734{
735}
736
737//-------------------------------------------------
738//  device_start - device-specific startup
739//-------------------------------------------------
740
741void vlm5030_device::device_start()
742{
743   DEVICE_START_NAME( vlm5030 )(this);
744}
745
746//-------------------------------------------------
747//  device_reset - device-specific reset
748//-------------------------------------------------
749
750void vlm5030_device::device_reset()
751{
752   DEVICE_RESET_NAME( vlm5030 )(this);
753}
754
755//-------------------------------------------------
756//  sound_stream_update - handle a stream update
757//-------------------------------------------------
758
759void vlm5030_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
760{
761   // should never get here
762   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
763}
764
765
trunk/src/emu/sound/2203intf.c
r17612r17613
2020{
2121   assert(device != NULL);
2222   assert(device->type() == YM2203);
23   return (ym2203_state *)downcast<legacy_device_base *>(device)->token();
23   return (ym2203_state *)downcast<ym2203_device *>(device)->token();
2424}
2525
2626
r17612r17613
208208}
209209
210210
211DEFINE_LEGACY_SOUND_DEVICE(YM2203, ym2203);
211const device_type YM2203 = &device_creator<ym2203_device>;
212
213ym2203_device::ym2203_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
214   : device_t(mconfig, YM2203, "YM2203", tag, owner, clock),
215     device_sound_interface(mconfig, *this)
216{
217   m_token = global_alloc_array_clear(UINT8, sizeof(ym2203_state));
218}
219
220//-------------------------------------------------
221//  device_config_complete - perform any
222//  operations now that the configuration is
223//  complete
224//-------------------------------------------------
225
226void ym2203_device::device_config_complete()
227{
228}
229
230//-------------------------------------------------
231//  device_start - device-specific startup
232//-------------------------------------------------
233
234void ym2203_device::device_start()
235{
236   DEVICE_START_NAME( ym2203 )(this);
237}
238
239//-------------------------------------------------
240//  device_reset - device-specific reset
241//-------------------------------------------------
242
243void ym2203_device::device_reset()
244{
245   DEVICE_RESET_NAME( ym2203 )(this);
246}
247
248//-------------------------------------------------
249//  device_stop - device-specific stop
250//-------------------------------------------------
251
252void ym2203_device::device_stop()
253{
254   DEVICE_STOP_NAME( ym2203 )(this);
255}
256
257//-------------------------------------------------
258//  sound_stream_update - handle a stream update
259//-------------------------------------------------
260
261void ym2203_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
262{
263   // should never get here
264   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
265}
266
267
trunk/src/emu/sound/k007232.c
r17612r17613
5858{
5959   assert(device != NULL);
6060   assert(device->type() == K007232);
61   return (KDAC_A_PCM *)downcast<legacy_device_base *>(device)->token();
61   return (KDAC_A_PCM *)downcast<k007232_device *>(device)->token();
6262}
6363
6464
r17612r17613
473473}
474474
475475
476DEFINE_LEGACY_SOUND_DEVICE(K007232, k007232);
476const device_type K007232 = &device_creator<k007232_device>;
477
478k007232_device::k007232_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
479   : device_t(mconfig, K007232, "K007232", tag, owner, clock),
480     device_sound_interface(mconfig, *this)
481{
482   m_token = global_alloc_array_clear(UINT8, sizeof(KDAC_A_PCM));
483}
484
485//-------------------------------------------------
486//  device_config_complete - perform any
487//  operations now that the configuration is
488//  complete
489//-------------------------------------------------
490
491void k007232_device::device_config_complete()
492{
493}
494
495//-------------------------------------------------
496//  device_start - device-specific startup
497//-------------------------------------------------
498
499void k007232_device::device_start()
500{
501   DEVICE_START_NAME( k007232 )(this);
502}
503
504//-------------------------------------------------
505//  sound_stream_update - handle a stream update
506//-------------------------------------------------
507
508void k007232_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
509{
510   // should never get here
511   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
512}
513
514
trunk/src/emu/sound/vlm5030.h
r17612r17613
2525/* set ST pin level  : set table address A0-A7 / start speech */
2626void vlm5030_st(device_t *device, int pin );
2727
28DECLARE_LEGACY_SOUND_DEVICE(VLM5030, vlm5030);
28class vlm5030_device : public device_t,
29                                  public device_sound_interface
30{
31public:
32   vlm5030_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
33   ~vlm5030_device() { global_free(m_token); }
2934
35   // access to legacy token
36   void *token() const { assert(m_token != NULL); return m_token; }
37protected:
38   // device-level overrides
39   virtual void device_config_complete();
40   virtual void device_start();
41   virtual void device_reset();
42
43   // sound stream update overrides
44   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
45private:
46   // internal state
47   void *m_token;
48};
49
50extern const device_type VLM5030;
51
52
3053#endif /* __VLM5030_H__ */
trunk/src/emu/sound/tms5220.c
r17612r17613
472472         device->type() == TMS5220C ||
473473         device->type() == TMC0285 ||
474474         device->type() == TMS5200);
475   return (tms5220_state *)downcast<legacy_device_base *>(device)->token();
475   return (tms5220_state *)downcast<tms5220_device *>(device)->token();
476476}
477477
478478/* Static function prototypes */
r17612r17613
20572057 }
20582058}
20592059
2060DEFINE_LEGACY_SOUND_DEVICE(TMS5220C, tms5220c);
2061DEFINE_LEGACY_SOUND_DEVICE(TMS5220, tms5220);
2062DEFINE_LEGACY_SOUND_DEVICE(TMC0285, tmc0285);
2063DEFINE_LEGACY_SOUND_DEVICE(TMS5200, tms5200);
2060const device_type TMS5220C = &device_creator<tms5220c_device>;
20642061
2062tms5220c_device::tms5220c_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
2063   : tms5220_device(mconfig, TMS5220C, "TMS5220C", tag, owner, clock)
2064{
2065}
20652066
2067//-------------------------------------------------
2068//  device_start - device-specific startup
2069//-------------------------------------------------
2070
2071void tms5220c_device::device_start()
2072{
2073   DEVICE_START_NAME( tms5220c )(this);
2074}
2075
2076//-------------------------------------------------
2077//  sound_stream_update - handle a stream update
2078//-------------------------------------------------
2079
2080void tms5220c_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
2081{
2082   // should never get here
2083   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
2084}
2085
2086
2087const device_type TMS5220 = &device_creator<tms5220_device>;
2088
2089tms5220_device::tms5220_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
2090   : device_t(mconfig, TMS5220, "TMS5220", tag, owner, clock),
2091     device_sound_interface(mconfig, *this)
2092{
2093   m_token = global_alloc_array_clear(UINT8, sizeof(tms5220_state));
2094}
2095tms5220_device::tms5220_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
2096   : device_t(mconfig, type, name, tag, owner, clock),
2097     device_sound_interface(mconfig, *this)
2098{
2099   m_token = global_alloc_array_clear(UINT8, sizeof(tms5220_state));
2100}
2101
2102//-------------------------------------------------
2103//  device_config_complete - perform any
2104//  operations now that the configuration is
2105//  complete
2106//-------------------------------------------------
2107
2108void tms5220_device::device_config_complete()
2109{
2110}
2111
2112//-------------------------------------------------
2113//  device_start - device-specific startup
2114//-------------------------------------------------
2115
2116void tms5220_device::device_start()
2117{
2118   DEVICE_START_NAME( tms5220 )(this);
2119}
2120
2121//-------------------------------------------------
2122//  device_reset - device-specific reset
2123//-------------------------------------------------
2124
2125void tms5220_device::device_reset()
2126{
2127   DEVICE_RESET_NAME( tms5220 )(this);
2128}
2129
2130//-------------------------------------------------
2131//  sound_stream_update - handle a stream update
2132//-------------------------------------------------
2133
2134void tms5220_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
2135{
2136   // should never get here
2137   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
2138}
2139
2140
2141const device_type TMC0285 = &device_creator<tmc0285_device>;
2142
2143tmc0285_device::tmc0285_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
2144   : tms5220_device(mconfig, TMC0285, "TMC0285", tag, owner, clock)
2145{
2146}
2147
2148//-------------------------------------------------
2149//  device_start - device-specific startup
2150//-------------------------------------------------
2151
2152void tmc0285_device::device_start()
2153{
2154   DEVICE_START_NAME( tmc0285 )(this);
2155}
2156
2157//-------------------------------------------------
2158//  sound_stream_update - handle a stream update
2159//-------------------------------------------------
2160
2161void tmc0285_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
2162{
2163   // should never get here
2164   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
2165}
2166
2167
2168const device_type TMS5200 = &device_creator<tms5200_device>;
2169
2170tms5200_device::tms5200_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
2171   : tms5220_device(mconfig, TMS5200, "TMS5200", tag, owner, clock)
2172{
2173}
2174
2175//-------------------------------------------------
2176//  device_start - device-specific startup
2177//-------------------------------------------------
2178
2179void tms5200_device::device_start()
2180{
2181   DEVICE_START_NAME( tms5200 )(this);
2182}
2183
2184//-------------------------------------------------
2185//  sound_stream_update - handle a stream update
2186//-------------------------------------------------
2187
2188void tms5200_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
2189{
2190   // should never get here
2191   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
2192}
2193
2194
2195
2196
20662197/******************************************************************************
20672198   New class implementation
20682199******************************************************************************/
trunk/src/emu/sound/2203intf.h
r17612r17613
2424WRITE8_DEVICE_HANDLER( ym2203_control_port_w );
2525WRITE8_DEVICE_HANDLER( ym2203_write_port_w );
2626
27DECLARE_LEGACY_SOUND_DEVICE(YM2203, ym2203);
27class ym2203_device : public device_t,
28                                  public device_sound_interface
29{
30public:
31   ym2203_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
32   ~ym2203_device() { global_free(m_token); }
2833
34   // access to legacy token
35   void *token() const { assert(m_token != NULL); return m_token; }
36protected:
37   // device-level overrides
38   virtual void device_config_complete();
39   virtual void device_start();
40   virtual void device_stop();
41   virtual void device_reset();
42
43   // sound stream update overrides
44   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
45private:
46   // internal state
47   void *m_token;
48};
49
50extern const device_type YM2203;
51
52
2953#endif /* __2203INTF_H__ */
trunk/src/emu/sound/k007232.h
r17612r17613
3030*/
3131void k007232_set_volume(device_t *device,int channel,int volumeA,int volumeB);
3232
33DECLARE_LEGACY_SOUND_DEVICE(K007232, k007232);
33class k007232_device : public device_t,
34                                  public device_sound_interface
35{
36public:
37   k007232_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
38   ~k007232_device() { global_free(m_token); }
3439
40   // access to legacy token
41   void *token() const { assert(m_token != NULL); return m_token; }
42protected:
43   // device-level overrides
44   virtual void device_config_complete();
45   virtual void device_start();
46
47   // sound stream update overrides
48   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
49private:
50   // internal state
51   void *m_token;
52};
53
54extern const device_type K007232;
55
56
3557#endif /* __K007232_H__ */
trunk/src/emu/sound/tms5220.h
r17612r17613
4242
4343void tms5220_set_frequency(device_t *device, int frequency);
4444
45DECLARE_LEGACY_SOUND_DEVICE(TMS5220C, tms5220c);
46DECLARE_LEGACY_SOUND_DEVICE(TMS5220, tms5220);
47DECLARE_LEGACY_SOUND_DEVICE(TMC0285, tmc0285);
48DECLARE_LEGACY_SOUND_DEVICE(TMS5200, tms5200);
45class tms5220_device : public device_t,
46                                  public device_sound_interface
47{
48public:
49   tms5220_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
50   tms5220_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
51   ~tms5220_device() { global_free(m_token); }
4952
53   // access to legacy token
54   void *token() const { assert(m_token != NULL); return m_token; }
55protected:
56   // device-level overrides
57   virtual void device_config_complete();
58   virtual void device_start();
59   virtual void device_reset();
5060
61   // sound stream update overrides
62   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
63private:
64   // internal state
65   void *m_token;
66};
67
68extern const device_type TMS5220;
69
70class tms5220c_device : public tms5220_device
71{
72public:
73   tms5220c_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
74protected:
75   // device-level overrides
76   virtual void device_start();
77
78   // sound stream update overrides
79   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
80};
81
82extern const device_type TMS5220C;
83
84class tmc0285_device : public tms5220_device
85{
86public:
87   tmc0285_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
88protected:
89   // device-level overrides
90   virtual void device_start();
91
92   // sound stream update overrides
93   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
94};
95
96extern const device_type TMC0285;
97
98class tms5200_device : public tms5220_device
99{
100public:
101   tms5200_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
102protected:
103   // device-level overrides
104   virtual void device_start();
105
106   // sound stream update overrides
107   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
108};
109
110extern const device_type TMS5200;
111
112
113
51114/***************************************************************************
52115        New class implementation
53116        Michael Zapf, June 2012
trunk/src/emu/sound/okim6258.c
r17612r17613
5252{
5353   assert(device != NULL);
5454   assert(device->type() == OKIM6258);
55   return (okim6258_state *)downcast<legacy_device_base *>(device)->token();
55   return (okim6258_state *)downcast<okim6258_device *>(device)->token();
5656}
5757
5858/**********************************************************************************************
r17612r17613
381381}
382382
383383
384DEFINE_LEGACY_SOUND_DEVICE(OKIM6258, okim6258);
384const device_type OKIM6258 = &device_creator<okim6258_device>;
385
386okim6258_device::okim6258_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
387   : device_t(mconfig, OKIM6258, "OKI6258", tag, owner, clock),
388     device_sound_interface(mconfig, *this)
389{
390   m_token = global_alloc_array_clear(UINT8, sizeof(okim6258_state));
391}
392
393//-------------------------------------------------
394//  device_config_complete - perform any
395//  operations now that the configuration is
396//  complete
397//-------------------------------------------------
398
399void okim6258_device::device_config_complete()
400{
401}
402
403//-------------------------------------------------
404//  device_start - device-specific startup
405//-------------------------------------------------
406
407void okim6258_device::device_start()
408{
409   DEVICE_START_NAME( okim6258 )(this);
410}
411
412//-------------------------------------------------
413//  device_reset - device-specific reset
414//-------------------------------------------------
415
416void okim6258_device::device_reset()
417{
418   DEVICE_RESET_NAME( okim6258 )(this);
419}
420
421//-------------------------------------------------
422//  sound_stream_update - handle a stream update
423//-------------------------------------------------
424
425void okim6258_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
426{
427   // should never get here
428   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
429}
430
431
trunk/src/emu/sound/nile.c
r17612r17613
6565{
6666   assert(device != NULL);
6767   assert(device->type() == NILE);
68   return (nile_state *)downcast<legacy_device_base *>(device)->token();
68   return (nile_state *)downcast<nile_device *>(device)->token();
6969}
7070
7171
r17612r17613
258258}
259259
260260
261DEFINE_LEGACY_SOUND_DEVICE(NILE, nile);
261const device_type NILE = &device_creator<nile_device>;
262
263nile_device::nile_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
264   : device_t(mconfig, NILE, "NiLe", tag, owner, clock),
265     device_sound_interface(mconfig, *this)
266{
267   m_token = global_alloc_array_clear(UINT8, sizeof(nile_state));
268}
269
270//-------------------------------------------------
271//  device_config_complete - perform any
272//  operations now that the configuration is
273//  complete
274//-------------------------------------------------
275
276void nile_device::device_config_complete()
277{
278}
279
280//-------------------------------------------------
281//  device_start - device-specific startup
282//-------------------------------------------------
283
284void nile_device::device_start()
285{
286   DEVICE_START_NAME( nile )(this);
287}
288
289//-------------------------------------------------
290//  sound_stream_update - handle a stream update
291//-------------------------------------------------
292
293void nile_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
294{
295   // should never get here
296   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
297}
298
299
trunk/src/emu/sound/es8712.c
r17612r17613
5151{
5252   assert(device != NULL);
5353   assert(device->type() == ES8712);
54   return (es8712_state *)downcast<legacy_device_base *>(device)->token();
54   return (es8712_state *)downcast<es8712_device *>(device)->token();
5555}
5656
5757
r17612r17613
407407}
408408
409409
410DEFINE_LEGACY_SOUND_DEVICE(ES8712, es8712);
410const device_type ES8712 = &device_creator<es8712_device>;
411
412es8712_device::es8712_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
413   : device_t(mconfig, ES8712, "ES8712", tag, owner, clock),
414     device_sound_interface(mconfig, *this)
415{
416   m_token = global_alloc_array_clear(UINT8, sizeof(es8712_state));
417}
418
419//-------------------------------------------------
420//  device_config_complete - perform any
421//  operations now that the configuration is
422//  complete
423//-------------------------------------------------
424
425void es8712_device::device_config_complete()
426{
427}
428
429//-------------------------------------------------
430//  device_start - device-specific startup
431//-------------------------------------------------
432
433void es8712_device::device_start()
434{
435   DEVICE_START_NAME( es8712 )(this);
436}
437
438//-------------------------------------------------
439//  device_reset - device-specific reset
440//-------------------------------------------------
441
442void es8712_device::device_reset()
443{
444   DEVICE_RESET_NAME( es8712 )(this);
445}
446
447//-------------------------------------------------
448//  sound_stream_update - handle a stream update
449//-------------------------------------------------
450
451void es8712_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
452{
453   // should never get here
454   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
455}
456
457
trunk/src/emu/sound/okim6258.h
r17612r17613
3434WRITE8_DEVICE_HANDLER( okim6258_data_w );
3535WRITE8_DEVICE_HANDLER( okim6258_ctrl_w );
3636
37DECLARE_LEGACY_SOUND_DEVICE(OKIM6258, okim6258);
37class okim6258_device : public device_t,
38                                  public device_sound_interface
39{
40public:
41   okim6258_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
42   ~okim6258_device() { global_free(m_token); }
3843
44   // access to legacy token
45   void *token() const { assert(m_token != NULL); return m_token; }
46protected:
47   // device-level overrides
48   virtual void device_config_complete();
49   virtual void device_start();
50   virtual void device_reset();
51
52   // sound stream update overrides
53   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
54private:
55   // internal state
56   void *m_token;
57};
58
59extern const device_type OKIM6258;
60
61
3962#endif /* __OKIM6258_H__ */
trunk/src/emu/sound/nes_apu.c
r17612r17613
7575{
7676   assert(device != NULL);
7777   assert(device->type() == NES);
78   return (nesapu_state *)downcast<legacy_device_base *>(device)->token();
78   return (nesapu_state *)downcast<nesapu_device *>(device)->token();
7979}
8080
8181/* INTERNAL FUNCTIONS */
r17612r17613
792792}
793793
794794
795DEFINE_LEGACY_SOUND_DEVICE(NES, nesapu);
795const device_type NES = &device_creator<nesapu_device>;
796
797nesapu_device::nesapu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
798   : device_t(mconfig, NES, "N2A03", tag, owner, clock),
799     device_sound_interface(mconfig, *this)
800{
801   m_token = global_alloc_array_clear(UINT8, sizeof(nesapu_state));
802}
803
804//-------------------------------------------------
805//  device_config_complete - perform any
806//  operations now that the configuration is
807//  complete
808//-------------------------------------------------
809
810void nesapu_device::device_config_complete()
811{
812}
813
814//-------------------------------------------------
815//  device_start - device-specific startup
816//-------------------------------------------------
817
818void nesapu_device::device_start()
819{
820   DEVICE_START_NAME( nesapu )(this);
821}
822
823//-------------------------------------------------
824//  sound_stream_update - handle a stream update
825//-------------------------------------------------
826
827void nesapu_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
828{
829   // should never get here
830   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
831}
832
833
trunk/src/emu/sound/262intf.c
r17612r17613
2525{
2626   assert(device != NULL);
2727   assert(device->type() == YMF262);
28   return (ymf262_state *)downcast<legacy_device_base *>(device)->token();
28   return (ymf262_state *)downcast<ymf262_device *>(device)->token();
2929}
3030
3131
r17612r17613
158158}
159159
160160
161DEFINE_LEGACY_SOUND_DEVICE(YMF262, ymf262);
161const device_type YMF262 = &device_creator<ymf262_device>;
162
163ymf262_device::ymf262_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
164   : device_t(mconfig, YMF262, "YMF262", tag, owner, clock),
165     device_sound_interface(mconfig, *this)
166{
167   m_token = global_alloc_array_clear(UINT8, sizeof(ymf262_state));
168}
169
170//-------------------------------------------------
171//  device_config_complete - perform any
172//  operations now that the configuration is
173//  complete
174//-------------------------------------------------
175
176void ymf262_device::device_config_complete()
177{
178}
179
180//-------------------------------------------------
181//  device_start - device-specific startup
182//-------------------------------------------------
183
184void ymf262_device::device_start()
185{
186   DEVICE_START_NAME( ymf262 )(this);
187}
188
189//-------------------------------------------------
190//  device_reset - device-specific reset
191//-------------------------------------------------
192
193void ymf262_device::device_reset()
194{
195   DEVICE_RESET_NAME( ymf262 )(this);
196}
197
198//-------------------------------------------------
199//  device_stop - device-specific stop
200//-------------------------------------------------
201
202void ymf262_device::device_stop()
203{
204   DEVICE_STOP_NAME( ymf262 )(this);
205}
206
207//-------------------------------------------------
208//  sound_stream_update - handle a stream update
209//-------------------------------------------------
210
211void ymf262_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
212{
213   // should never get here
214   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
215}
216
217
trunk/src/emu/sound/nile.h
r17612r17613
1010WRITE16_DEVICE_HANDLER( nile_sndctrl_w );
1111READ16_DEVICE_HANDLER( nile_sndctrl_r );
1212
13DECLARE_LEGACY_SOUND_DEVICE(NILE, nile);
13class nile_device : public device_t,
14                                  public device_sound_interface
15{
16public:
17   nile_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
18   ~nile_device() { global_free(m_token); }
1419
20   // access to legacy token
21   void *token() const { assert(m_token != NULL); return m_token; }
22protected:
23   // device-level overrides
24   virtual void device_config_complete();
25   virtual void device_start();
26
27   // sound stream update overrides
28   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
29private:
30   // internal state
31   void *m_token;
32};
33
34extern const device_type NILE;
35
36
1537#endif /* __NILE_H__ */
trunk/src/emu/machine/adc1213x.c
r17612r17613
5858{
5959   assert(device != NULL);
6060   assert((device->type() == ADC12130) || (device->type() == ADC12132) || (device->type() == ADC12138));
61   return (adc12138_state *)downcast<legacy_device_base *>(device)->token();
61   return (adc12138_state *)downcast<adc12138_device *>(device)->token();
6262}
6363
6464INLINE const adc12138_interface *get_interface(device_t *device)
r17612r17613
390390 }
391391}
392392
393DEFINE_LEGACY_DEVICE(ADC12130, adc12130);
394DEFINE_LEGACY_DEVICE(ADC12132, adc12132);
395DEFINE_LEGACY_DEVICE(ADC12138, adc12138);
393const device_type ADC12130 = &device_creator<adc12130_device>;
394
395adc12130_device::adc12130_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
396   : adc12138_device(mconfig, ADC12130, "A/D Converter 12130", tag, owner, clock)
397{
398}
399
400
401const device_type ADC12132 = &device_creator<adc12132_device>;
402
403adc12132_device::adc12132_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
404   : adc12138_device(mconfig, ADC12132, "A/D Converter 12132", tag, owner, clock)
405{
406}
407
408
409const device_type ADC12138 = &device_creator<adc12138_device>;
410
411adc12138_device::adc12138_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
412   : device_t(mconfig, ADC12138, "A/D Converter 12138", tag, owner, clock)
413{
414   m_token = global_alloc_array_clear(UINT8, sizeof(adc12138_state));
415}
416adc12138_device::adc12138_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
417   : device_t(mconfig, type, name, tag, owner, clock)
418{
419   m_token = global_alloc_array_clear(UINT8, sizeof(adc12138_state));
420}
421
422//-------------------------------------------------
423//  device_config_complete - perform any
424//  operations now that the configuration is
425//  complete
426//-------------------------------------------------
427
428void adc12138_device::device_config_complete()
429{
430}
431
432//-------------------------------------------------
433//  device_start - device-specific startup
434//-------------------------------------------------
435
436void adc12138_device::device_start()
437{
438   DEVICE_START_NAME( adc12138 )(this);
439}
440
441//-------------------------------------------------
442//  device_reset - device-specific reset
443//-------------------------------------------------
444
445void adc12138_device::device_reset()
446{
447   DEVICE_RESET_NAME( adc12138 )(this);
448}
449
450
trunk/src/emu/machine/adc1213x.h
r17612r17613
1717    MACROS / CONSTANTS
1818***************************************************************************/
1919
20DECLARE_LEGACY_DEVICE(ADC12130, adc12130);
21DECLARE_LEGACY_DEVICE(ADC12132, adc12132);
22DECLARE_LEGACY_DEVICE(ADC12138, adc12138);
20class adc12138_device : public device_t
21{
22public:
23   adc12138_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
24   adc12138_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
25   ~adc12138_device() { global_free(m_token); }
2326
27   // access to legacy token
28   void *token() const { assert(m_token != NULL); return m_token; }
29protected:
30   // device-level overrides
31   virtual void device_config_complete();
32   virtual void device_start();
33   virtual void device_reset();
34private:
35   // internal state
36   void *m_token;
37};
38
39extern const device_type ADC12138;
40
41class adc12130_device : public adc12138_device
42{
43public:
44   adc12130_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
45};
46
47extern const device_type ADC12130;
48
49class adc12132_device : public adc12138_device
50{
51public:
52   adc12132_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
53};
54
55extern const device_type ADC12132;
56
2457#define MCFG_ADC12130_ADD(_tag, _config) \
2558   MCFG_DEVICE_ADD(_tag, ADC12130, 0) \
2659   MCFG_DEVICE_CONFIG(_config)
trunk/src/emu/machine/74153.c
r17612r17613
6161   assert(device != NULL);
6262   assert(device->type() == TTL74153);
6363
64   return (ttl74153_state *)downcast<legacy_device_base *>(device)->token();
64   return (ttl74153_state *)downcast<ttl74153_device *>(device)->token();
6565}
6666
6767
r17612r17613
191191 }
192192}
193193
194DEFINE_LEGACY_DEVICE(TTL74153, ttl74153);
194const device_type TTL74153 = &device_creator<ttl74153_device>;
195
196ttl74153_device::ttl74153_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
197   : device_t(mconfig, TTL74153, "74153", tag, owner, clock)
198{
199   m_token = global_alloc_array_clear(UINT8, sizeof(ttl74153_state));
200}
201
202//-------------------------------------------------
203//  device_config_complete - perform any
204//  operations now that the configuration is
205//  complete
206//-------------------------------------------------
207
208void ttl74153_device::device_config_complete()
209{
210}
211
212//-------------------------------------------------
213//  device_start - device-specific startup
214//-------------------------------------------------
215
216void ttl74153_device::device_start()
217{
218   DEVICE_START_NAME( ttl74153 )(this);
219}
220
221//-------------------------------------------------
222//  device_reset - device-specific reset
223//-------------------------------------------------
224
225void ttl74153_device::device_reset()
226{
227   DEVICE_RESET_NAME( ttl74153 )(this);
228}
229
230
trunk/src/emu/machine/74153.h
r17612r17613
6161void ttl74153_enable_w(device_t *device, int section, int data);
6262int ttl74153_output_r(device_t *device, int section);
6363
64DECLARE_LEGACY_DEVICE(TTL74153, ttl74153);
64class ttl74153_device : public device_t
65{
66public:
67   ttl74153_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
68   ~ttl74153_device() { global_free(m_token); }
6569
70   // access to legacy token
71   void *token() const { assert(m_token != NULL); return m_token; }
72protected:
73   // device-level overrides
74   virtual void device_config_complete();
75   virtual void device_start();
76   virtual void device_reset();
77private:
78   // internal state
79   void *m_token;
80};
81
82extern const device_type TTL74153;
83
84
6685#endif
trunk/src/emu/machine/tms6100.c
r17612r17613
107107   assert(device != NULL);
108108   assert(device->type() == TMS6100 ||
109109         device->type() == M58819);
110   return (tms6100_state *)downcast<legacy_device_base *>(device)->token();
110   return (tms6100_state *)downcast<tms6100_device *>(device)->token();
111111}
112112
113113/**********************************************************************************************
r17612r17613
288288 }
289289}
290290
291DEFINE_LEGACY_DEVICE(TMS6100, tms6100);
292DEFINE_LEGACY_DEVICE(M58819, m58819);
291const device_type TMS6100 = &device_creator<tms6100_device>;
292
293tms6100_device::tms6100_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
294   : device_t(mconfig, TMS6100, "TMS6100", tag, owner, clock)
295{
296   m_token = global_alloc_array_clear(UINT8, sizeof(tms6100_state));
297}
298tms6100_device::tms6100_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
299   : device_t(mconfig, type, name, tag, owner, clock)
300{
301   m_token = global_alloc_array_clear(UINT8, sizeof(tms6100_state));
302}
303
304//-------------------------------------------------
305//  device_config_complete - perform any
306//  operations now that the configuration is
307//  complete
308//-------------------------------------------------
309
310void tms6100_device::device_config_complete()
311{
312}
313
314//-------------------------------------------------
315//  device_start - device-specific startup
316//-------------------------------------------------
317
318void tms6100_device::device_start()
319{
320   DEVICE_START_NAME( tms6100 )(this);
321}
322
323//-------------------------------------------------
324//  device_reset - device-specific reset
325//-------------------------------------------------
326
327void tms6100_device::device_reset()
328{
329   DEVICE_RESET_NAME( tms6100 )(this);
330}
331
332
333const device_type M58819 = &device_creator<m58819_device>;
334
335m58819_device::m58819_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
336   : tms6100_device(mconfig, M58819, "M58819", tag, owner, clock)
337{
338}
339
340//-------------------------------------------------
341//  device_start - device-specific startup
342//-------------------------------------------------
343
344void m58819_device::device_start()
345{
346   DEVICE_START_NAME( m58819 )(this);
347}
348
349
trunk/src/emu/machine/tms6100.h
r17612r17613
1414
1515READ_LINE_DEVICE_HANDLER( tms6100_data_r );
1616
17DECLARE_LEGACY_DEVICE(TMS6100, tms6100);
18DECLARE_LEGACY_DEVICE(M58819, m58819);
17class tms6100_device : public device_t
18{
19public:
20   tms6100_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
21   tms6100_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
22   ~tms6100_device() { global_free(m_token); }
1923
24   // access to legacy token
25   void *token() const { assert(m_token != NULL); return m_token; }
26protected:
27   // device-level overrides
28   virtual void device_config_complete();
29   virtual void device_start();
30   virtual void device_reset();
31private:
32   // internal state
33   void *m_token;
34};
35
36extern const device_type TMS6100;
37
38class m58819_device : public tms6100_device
39{
40public:
41   m58819_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
42protected:
43   // device-level overrides
44   virtual void device_start();
45};
46
47extern const device_type M58819;
48
49
2050#endif /* __TMS6100_H__ */
trunk/src/emu/machine/smc91c9x.c
r17612r17613
156156   assert(device != NULL);
157157   assert(device->type() == SMC91C94 || device->type() == SMC91C96);
158158
159   return (smc91c9x_state *)downcast<legacy_device_base *>(device)->token();
159   return (smc91c9x_state *)downcast<smc91c9x_device *>(device)->token();
160160}
161161
162162
r17612r17613
628628   }
629629}
630630
631smc91c9x_device::smc91c9x_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
632   : device_t(mconfig, type, name, tag, owner, clock)
633{
634   m_token = global_alloc_array_clear(UINT8, sizeof(smc91c9x_state));
635}
631636
632DEFINE_LEGACY_DEVICE(SMC91C94, smc91c94);
633DEFINE_LEGACY_DEVICE(SMC91C96, smc91c96);
637//-------------------------------------------------
638//  device_config_complete - perform any
639//  operations now that the configuration is
640//  complete
641//-------------------------------------------------
634642
643void smc91c9x_device::device_config_complete()
644{
645}
646
647//-------------------------------------------------
648//  device_start - device-specific startup
649//-------------------------------------------------
650
651void smc91c9x_device::device_start()
652{
653   DEVICE_START_NAME( smc91c9x )(this);
654}
655
656//-------------------------------------------------
657//  device_reset - device-specific reset
658//-------------------------------------------------
659
660void smc91c9x_device::device_reset()
661{
662   DEVICE_RESET_NAME( smc91c9x )(this);
663}
664
665
666const device_type SMC91C94 = &device_creator<smc91c94_device>;
667
668smc91c94_device::smc91c94_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
669   : smc91c9x_device(mconfig, SMC91C94, "SMC91C94", tag, owner, clock)
670{
671}
672
673
674const device_type SMC91C96 = &device_creator<smc91c96_device>;
675
676smc91c96_device::smc91c96_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
677   : smc91c9x_device(mconfig, SMC91C96, "SMC91C96", tag, owner, clock)
678{
679}
680
681
682
trunk/src/emu/machine/smc91c9x.h
r17612r17613
5050
5151
5252/* ----- device interface ----- */
53class smc91c9x_device : public device_t
54{
55public:
56   smc91c9x_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
57   ~smc91c9x_device() { global_free(m_token); }
5358
54DECLARE_LEGACY_DEVICE(SMC91C94, smc91c94);
55DECLARE_LEGACY_DEVICE(SMC91C96, smc91c96);
59   // access to legacy token
60   void *token() const { assert(m_token != NULL); return m_token; }
61protected:
62   // device-level overrides
63   virtual void device_config_complete();
64   virtual void device_start();
65   virtual void device_reset();
66private:
67   // internal state
68   void *m_token;
69};
5670
71
72class smc91c94_device : public smc91c9x_device
73{
74public:
75   smc91c94_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
76};
77
78extern const device_type SMC91C94;
79
80class smc91c96_device : public smc91c9x_device
81{
82public:
83   smc91c96_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
84};
85
86extern const device_type SMC91C96;
87
88
5789#endif
trunk/src/emu/machine/adc083x.c
r17612r17613
7575{
7676   assert( device != NULL );
7777   assert( ( device->type() == ADC0831 ) || ( device->type() == ADC0832 ) || ( device->type() == ADC0834 ) || ( device->type() == ADC0838 ) );
78   return (adc0831_state *) downcast<legacy_device_base *>(device)->token();
78   return (adc0831_state *) downcast<adc0831_device *>(device)->token();
7979}
8080
8181INLINE const adc083x_interface *get_interface( device_t *device )
r17612r17613
550550 }
551551}
552552
553DEFINE_LEGACY_DEVICE(ADC0831, adc0831);
554DEFINE_LEGACY_DEVICE(ADC0832, adc0832);
555DEFINE_LEGACY_DEVICE(ADC0834, adc0834);
556DEFINE_LEGACY_DEVICE(ADC0838, adc0838);
553const device_type ADC0831 = &device_creator<adc0831_device>;
554
555adc0831_device::adc0831_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
556   : device_t(mconfig, ADC0831, "A/D Converters 0831", tag, owner, clock)
557{
558   m_token = global_alloc_array_clear(UINT8, sizeof(adc0831_state));
559}
560adc0831_device::adc0831_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
561   : device_t(mconfig, type, name, tag, owner, clock)
562{
563   m_token = global_alloc_array_clear(UINT8, sizeof(adc0831_state));
564}
565
566//-------------------------------------------------
567//  device_config_complete - perform any
568//  operations now that the configuration is
569//  complete
570//-------------------------------------------------
571
572void adc0831_device::device_config_complete()
573{
574}
575
576//-------------------------------------------------
577//  device_start - device-specific startup
578//-------------------------------------------------
579
580void adc0831_device::device_start()
581{
582   DEVICE_START_NAME( adc0831 )(this);
583}
584
585//-------------------------------------------------
586//  device_reset - device-specific reset
587//-------------------------------------------------
588
589void adc0831_device::device_reset()
590{
591   DEVICE_RESET_NAME( adc0831 )(this);
592}
593
594
595const device_type ADC0832 = &device_creator<adc0832_device>;
596
597adc0832_device::adc0832_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
598   : adc0831_device(mconfig, ADC0832, "A/D Converters 0832", tag, owner, clock)
599{
600}
601
602
603const device_type ADC0834 = &device_creator<adc0834_device>;
604
605adc0834_device::adc0834_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
606   : adc0831_device(mconfig, ADC0834, "A/D Converters 0834", tag, owner, clock)
607{
608}
609
610
611const device_type ADC0838 = &device_creator<adc0838_device>;
612
613adc0838_device::adc0838_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
614   : adc0831_device(mconfig, ADC0838, "A/D Converters 0838", tag, owner, clock)
615{
616}
617
618
trunk/src/emu/machine/adc083x.h
r17612r17613
3232    MACROS / CONSTANTS
3333***************************************************************************/
3434
35DECLARE_LEGACY_DEVICE(ADC0831, adc0831);
36DECLARE_LEGACY_DEVICE(ADC0832, adc0832);
37DECLARE_LEGACY_DEVICE(ADC0834, adc0834);
38DECLARE_LEGACY_DEVICE(ADC0838, adc0838);
35class adc0831_device : public device_t
36{
37public:
38   adc0831_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
39   adc0831_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
40   ~adc0831_device() { global_free(m_token); }
3941
42   // access to legacy token
43   void *token() const { assert(m_token != NULL); return m_token; }
44protected:
45   // device-level overrides
46   virtual void device_config_complete();
47   virtual void device_start();
48   virtual void device_reset();
49private:
50   // internal state
51   void *m_token;
52};
53
54extern const device_type ADC0831;
55
56class adc0832_device : public adc0831_device
57{
58public:
59   adc0832_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
60};
61
62extern const device_type ADC0832;
63
64class adc0834_device : public adc0831_device
65{
66public:
67   adc0834_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
68};
69
70extern const device_type ADC0834;
71
72class adc0838_device : public adc0831_device
73{
74public:
75   adc0838_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
76};
77
78extern const device_type ADC0838;
79
80
4081#define MCFG_ADC0831_ADD(_tag, _config) \
4182   MCFG_DEVICE_ADD(_tag, ADC0831, 0) \
4283   MCFG_DEVICE_CONFIG(_config)
trunk/src/emu/machine/pic8259.c
r17612r17613
7777INLINE pic8259_t *get_safe_token(device_t *device) {
7878   assert( device != NULL );
7979   assert( device->type() == PIC8259 );
80   return ( pic8259_t *) downcast<legacy_device_base *>(device)->token();
80   return ( pic8259_t *) downcast<pic8259_device *>(device)->token();
8181}
8282
8383
r17612r17613
469469}
470470
471471
472DEFINE_LEGACY_DEVICE(PIC8259, pic8259);
472const device_type PIC8259 = &device_creator<pic8259_device>;
473
474pic8259_device::pic8259_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
475   : device_t(mconfig, PIC8259, "Intel PIC8259", tag, owner, clock)
476{
477   m_token = global_alloc_array_clear(UINT8, sizeof(pic8259_t));
478}
479
480//-------------------------------------------------
481//  device_config_complete - perform any
482//  operations now that the configuration is
483//  complete
484//-------------------------------------------------
485
486void pic8259_device::device_config_complete()
487{
488}
489
490//-------------------------------------------------
491//  device_start - device-specific startup
492//-------------------------------------------------
493
494void pic8259_device::device_start()
495{
496   DEVICE_START_NAME( pic8259 )(this);
497}
498
499//-------------------------------------------------
500//  device_reset - device-specific reset
501//-------------------------------------------------
502
503void pic8259_device::device_reset()
504{
505   DEVICE_RESET_NAME( pic8259 )(this);
506}
507
508
trunk/src/emu/machine/upd4701.c
r17612r17613
4949{
5050   assert(device != NULL);
5151   assert((device->type() == UPD4701));
52   return (upd4701_state *)downcast<legacy_device_base *>(device)->token();
52   return (upd4701_state *)downcast<upd4701_device *>(device)->token();
5353}
5454
5555
r17612r17613
319319 }
320320}
321321
322DEFINE_LEGACY_DEVICE(UPD4701, upd4701);
322const device_type UPD4701 = &device_creator<upd4701_device>;
323
324upd4701_device::upd4701_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
325   : device_t(mconfig, UPD4701, "NEC uPD4701 Encoder", tag, owner, clock)
326{
327   m_token = global_alloc_array_clear(UINT8, sizeof(upd4701_state));
328}
329
330//-------------------------------------------------
331//  device_config_complete - perform any
332//  operations now that the configuration is
333//  complete
334//-------------------------------------------------
335
336void upd4701_device::device_config_complete()
337{
338}
339
340//-------------------------------------------------
341//  device_start - device-specific startup
342//-------------------------------------------------
343
344void upd4701_device::device_start()
345{
346   DEVICE_START_NAME( upd4701 )(this);
347}
348
349//-------------------------------------------------
350//  device_reset - device-specific reset
351//-------------------------------------------------
352
353void upd4701_device::device_reset()
354{
355   DEVICE_RESET_NAME( upd4701 )(this);
356}
357
358
trunk/src/emu/machine/pic8259.h
r17612r17613
2828#include "devlegcy.h"
2929#include "devcb.h"
3030
31DECLARE_LEGACY_DEVICE(PIC8259, pic8259);
31class pic8259_device : public device_t
32{
33public:
34   pic8259_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
35   ~pic8259_device() { global_free(m_token); }
3236
37   // access to legacy token
38   void *token() const { assert(m_token != NULL); return m_token; }
39protected:
40   // device-level overrides
41   virtual void device_config_complete();
42   virtual void device_start();
43   virtual void device_reset();
44private:
45   // internal state
46   void *m_token;
47};
48
49extern const device_type PIC8259;
50
51
3352/***************************************************************************
3453    TYPE DEFINITIONS
3554***************************************************************************/
trunk/src/emu/machine/upd4701.h
r17612r17613
1515    MACROS / CONSTANTS
1616***************************************************************************/
1717
18DECLARE_LEGACY_DEVICE(UPD4701, upd4701);
18class upd4701_device : public device_t
19{
20public:
21   upd4701_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
22   ~upd4701_device() { global_free(m_token); }
1923
24   // access to legacy token
25   void *token() const { assert(m_token != NULL); return m_token; }
26protected:
27   // device-level overrides
28   virtual void device_config_complete();
29   virtual void device_start();
30   virtual void device_reset();
31private:
32   // internal state
33   void *m_token;
34};
35
36extern const device_type UPD4701;
37
38
2039#define MCFG_UPD4701_ADD(_tag) \
2140   MCFG_DEVICE_ADD(_tag, UPD4701, 0)
2241
trunk/src/emu/machine/wd17xx.c
r17612r17613
411411      device->type() == WD1770 || device->type() == WD1772 || device->type() == WD1773 ||
412412      device->type() == MB8866 || device->type() == MB8876 || device->type() == MB8877);
413413
414   return (wd1770_state *)downcast<legacy_device_base *>(device)->token();
414   return (wd1770_state *)downcast<wd1770_device *>(device)->token();
415415}
416416
417417
r17612r17613
23282328 }
23292329}
23302330
2331DEFINE_LEGACY_DEVICE(FD1771, fd1771);
2332DEFINE_LEGACY_DEVICE(FD1781, fd1781);
2333DEFINE_LEGACY_DEVICE(FD1791, fd1791);
2334DEFINE_LEGACY_DEVICE(FD1792, fd1792);
2335DEFINE_LEGACY_DEVICE(FD1793, fd1793);
2336DEFINE_LEGACY_DEVICE(FD1794, fd1794);
2337DEFINE_LEGACY_DEVICE(FD1795, fd1795);
2338DEFINE_LEGACY_DEVICE(FD1797, fd1797);
2339DEFINE_LEGACY_DEVICE(FD1761, fd1761);
2340DEFINE_LEGACY_DEVICE(FD1762, fd1762);
2341DEFINE_LEGACY_DEVICE(FD1763, fd1763);
2342DEFINE_LEGACY_DEVICE(FD1764, fd1764);
2343DEFINE_LEGACY_DEVICE(FD1765, fd1765);
2344DEFINE_LEGACY_DEVICE(FD1767, fd1767);
2345DEFINE_LEGACY_DEVICE(WD2791, wd2791);
2346DEFINE_LEGACY_DEVICE(WD2793, wd2793);
2347DEFINE_LEGACY_DEVICE(WD2795, wd2795);
2348DEFINE_LEGACY_DEVICE(WD2797, wd2797);
2349DEFINE_LEGACY_DEVICE(WD1770, wd1770);
2350DEFINE_LEGACY_DEVICE(WD1772, wd1772);
2351DEFINE_LEGACY_DEVICE(WD1773, wd1773);
2352DEFINE_LEGACY_DEVICE(MB8866, mb8866);
2353DEFINE_LEGACY_DEVICE(MB8876, mb8876);
2354DEFINE_LEGACY_DEVICE(MB8877, mb8877);
2331const device_type FD1771 = &device_creator<fd1771_device>;
2332
2333fd1771_device::fd1771_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
2334   : wd1770_device(mconfig, FD1771, "FD1771", tag, owner, clock)
2335{
2336}
2337
2338
2339const device_type FD1781 = &device_creator<fd1781_device>;
2340
2341fd1781_device::fd1781_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
2342   : wd1770_device(mconfig, FD1781, "FD1781", tag, owner, clock)
2343{
2344}
2345
2346
2347const device_type FD1791 = &device_creator<fd1791_device>;
2348
2349fd1791_device::fd1791_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
2350   : wd1770_device(mconfig, FD1791, "FD1791", tag, owner, clock)
2351{
2352}
2353
2354
2355const device_type FD1792 = &device_creator<fd1792_device>;
2356
2357fd1792_device::fd1792_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
2358   : wd1770_device(mconfig, FD1792, "FD1792", tag, owner, clock)
2359{
2360}
2361
2362
2363const device_type FD1793 = &device_creator<fd1793_device>;
2364
2365fd1793_device::fd1793_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
2366   : wd1770_device(mconfig, FD1793, "FD1793", tag, owner, clock)
2367{
2368}
2369
2370
2371const device_type FD1794 = &device_creator<fd1794_device>;
2372
2373fd1794_device::fd1794_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
2374   : wd1770_device(mconfig, FD1794, "FD1794", tag, owner, clock)
2375{
2376}
2377
2378
2379const device_type FD1795 = &device_creator<fd1795_device>;
2380
2381fd1795_device::fd1795_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
2382   : wd1770_device(mconfig, FD1795, "FD1795", tag, owner, clock)
2383{
2384}
2385
2386
2387const device_type FD1797 = &device_creator<fd1797_device>;
2388
2389fd1797_device::fd1797_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
2390   : wd1770_device(mconfig, FD1797, "FD1797", tag, owner, clock)
2391{
2392}
2393
2394
2395const device_type FD1761 = &device_creator<fd1761_device>;
2396
2397fd1761_device::fd1761_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
2398   : wd1770_device(mconfig, FD1761, "FD1761", tag, owner, clock)
2399{
2400}
2401
2402
2403const device_type FD1762 = &device_creator<fd1762_device>;
2404
2405fd1762_device::fd1762_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
2406   : wd1770_device(mconfig, FD1762, "FD1762", tag, owner, clock)
2407{
2408}
2409
2410
2411const device_type FD1763 = &device_creator<fd1763_device>;
2412
2413fd1763_device::fd1763_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
2414   : wd1770_device(mconfig, FD1763, "FD1763", tag, owner, clock)
2415{
2416}
2417
2418
2419const device_type FD1764 = &device_creator<fd1764_device>;
2420
2421fd1764_device::fd1764_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
2422   : wd1770_device(mconfig, FD1764, "FD1764", tag, owner, clock)
2423{
2424}
2425
2426
2427const device_type FD1765 = &device_creator<fd1765_device>;
2428
2429fd1765_device::fd1765_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
2430   : wd1770_device(mconfig, FD1765, "FD1765", tag, owner, clock)
2431{
2432}
2433
2434
2435const device_type FD1767 = &device_creator<fd1767_device>;
2436
2437fd1767_device::fd1767_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
2438   : wd1770_device(mconfig, FD1767, "FD1767", tag, owner, clock)
2439{
2440}
2441
2442
2443const device_type WD2791 = &device_creator<wd2791_device>;
2444
2445wd2791_device::wd2791_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
2446   : wd1770_device(mconfig, WD2791, "WD2791", tag, owner, clock)
2447{
2448}
2449
2450
2451const device_type WD2793 = &device_creator<wd2793_device>;
2452
2453wd2793_device::wd2793_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
2454   : wd1770_device(mconfig, WD2793, "WD2793", tag, owner, clock)
2455{
2456}
2457
2458
2459const device_type WD2795 = &device_creator<wd2795_device>;
2460
2461wd2795_device::wd2795_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
2462   : wd1770_device(mconfig, WD2795, "WD2795", tag, owner, clock)
2463{
2464}
2465
2466
2467const device_type WD2797 = &device_creator<wd2797_device>;
2468
2469wd2797_device::wd2797_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
2470   : wd1770_device(mconfig, WD2797, "WD2797", tag, owner, clock)
2471{
2472}
2473
2474
2475const device_type WD1770 = &device_creator<wd1770_device>;
2476
2477wd1770_device::wd1770_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
2478   : device_t(mconfig, WD1770, "WD1770", tag, owner, clock)
2479{
2480   m_token = global_alloc_array_clear(UINT8, sizeof(wd1770_state));
2481}
2482wd1770_device::wd1770_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
2483   : device_t(mconfig, type, name, tag, owner, clock)
2484{
2485   m_token = global_alloc_array_clear(UINT8, sizeof(wd1770_state));
2486}
2487
2488//-------------------------------------------------
2489//  device_config_complete - perform any
2490//  operations now that the configuration is
2491//  complete
2492//-------------------------------------------------
2493
2494void wd1770_device::device_config_complete()
2495{
2496}
2497
2498//-------------------------------------------------
2499//  device_start - device-specific startup
2500//-------------------------------------------------
2501
2502void wd1770_device::device_start()
2503{
2504   DEVICE_START_NAME( wd1770 )(this);
2505}
2506
2507//-------------------------------------------------
2508//  device_reset - device-specific reset
2509//-------------------------------------------------
2510
2511void wd1770_device::device_reset()
2512{
2513   DEVICE_RESET_NAME( wd1770 )(this);
2514}
2515
2516
2517const device_type WD1772 = &device_creator<wd1772_device>;
2518
2519wd1772_device::wd1772_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
2520   : wd1770_device(mconfig, WD1772, "WD1772", tag, owner, clock)
2521{
2522}
2523
2524//-------------------------------------------------
2525//  device_start - device-specific startup
2526//-------------------------------------------------
2527
2528void wd1772_device::device_start()
2529{
2530   DEVICE_START_NAME( wd1772 )(this);
2531}
2532
2533
2534const device_type WD1773 = &device_creator<wd1773_device>;
2535
2536wd1773_device::wd1773_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
2537   : wd1770_device(mconfig, WD1773, "WD1773", tag, owner, clock)
2538{
2539}
2540
2541
2542const device_type MB8866 = &device_creator<mb8866_device>;
2543
2544mb8866_device::mb8866_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
2545   : wd1770_device(mconfig, MB8866, "MB8866", tag, owner, clock)
2546{
2547}
2548
2549
2550const device_type MB8876 = &device_creator<mb8876_device>;
2551
2552mb8876_device::mb8876_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
2553   : wd1770_device(mconfig, MB8876, "MB8876", tag, owner, clock)
2554{
2555}
2556
2557
2558const device_type MB8877 = &device_creator<mb8877_device>;
2559
2560mb8877_device::mb8877_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
2561   : wd1770_device(mconfig, MB8877, "MB8877", tag, owner, clock)
2562{
2563}
2564
2565
trunk/src/emu/machine/adc1038.c
r17612r17613
3838   assert(device != NULL);
3939   assert(device->type() == ADC1038);
4040
41   return (adc1038_state *)downcast<legacy_device_base *>(device)->token();
41   return (adc1038_state *)downcast<adc1038_device *>(device)->token();
4242}
4343
4444INLINE const adc1038_interface *adc1038_get_interface( device_t *device )
r17612r17613
179179 }
180180}
181181
182DEFINE_LEGACY_DEVICE(ADC1038, adc1038);
182const device_type ADC1038 = &device_creator<adc1038_device>;
183
184adc1038_device::adc1038_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
185   : device_t(mconfig, ADC1038, "A/D Converters 1038", tag, owner, clock)
186{
187   m_token = global_alloc_array_clear(UINT8, sizeof(adc1038_state));
188}
189
190//-------------------------------------------------
191//  device_config_complete - perform any
192//  operations now that the configuration is
193//  complete
194//-------------------------------------------------
195
196void adc1038_device::device_config_complete()
197{
198}
199
200//-------------------------------------------------
201//  device_start - device-specific startup
202//-------------------------------------------------
203
204void adc1038_device::device_start()
205{
206   DEVICE_START_NAME( adc1038 )(this);
207}
208
209//-------------------------------------------------
210//  device_reset - device-specific reset
211//-------------------------------------------------
212
213void adc1038_device::device_reset()
214{
215   DEVICE_RESET_NAME( adc1038 )(this);
216}
217
218
trunk/src/emu/machine/wd17xx.h
r17612r17613
1717    MACROS
1818***************************************************************************/
1919
20DECLARE_LEGACY_DEVICE(FD1771, fd1771);
21DECLARE_LEGACY_DEVICE(FD1781, fd1781);
22DECLARE_LEGACY_DEVICE(FD1791, fd1791);
23DECLARE_LEGACY_DEVICE(FD1792, fd1792);
24DECLARE_LEGACY_DEVICE(FD1793, fd1793);
25DECLARE_LEGACY_DEVICE(FD1794, fd1794);
26DECLARE_LEGACY_DEVICE(FD1795, fd1795);
27DECLARE_LEGACY_DEVICE(FD1797, fd1797);
28DECLARE_LEGACY_DEVICE(FD1761, fd1761);
29DECLARE_LEGACY_DEVICE(FD1762, fd1762);
30DECLARE_LEGACY_DEVICE(FD1763, fd1763);
31DECLARE_LEGACY_DEVICE(FD1764, fd1764);
32DECLARE_LEGACY_DEVICE(FD1765, fd1765);
33DECLARE_LEGACY_DEVICE(FD1767, fd1767);
34DECLARE_LEGACY_DEVICE(WD2791, wd2791);
35DECLARE_LEGACY_DEVICE(WD2793, wd2793);
36DECLARE_LEGACY_DEVICE(WD2795, wd2795);
37DECLARE_LEGACY_DEVICE(WD2797, wd2797);
38DECLARE_LEGACY_DEVICE(WD1770, wd1770);
39DECLARE_LEGACY_DEVICE(WD1772, wd1772);
40DECLARE_LEGACY_DEVICE(WD1773, wd1773);
41DECLARE_LEGACY_DEVICE(MB8866, mb8866);
42DECLARE_LEGACY_DEVICE(MB8876, mb8876);
43DECLARE_LEGACY_DEVICE(MB8877, mb8877);
20class wd1770_device : public device_t
21{
22public:
23   wd1770_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
24   wd1770_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
25   ~wd1770_device() { global_free(m_token); }
4426
27   // access to legacy token
28   void *token() const { assert(m_token != NULL); return m_token; }
29protected:
30   // device-level overrides
31   virtual void device_config_complete();
32   virtual void device_start();
33   virtual void device_reset();
34private:
35   // internal state
36   void *m_token;
37};
4538
39extern const device_type WD1770;
4640
41class fd1771_device : public wd1770_device
42{
43public:
44   fd1771_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
45};
46
47extern const device_type FD1771;
48
49class fd1781_device : public wd1770_device
50{
51public:
52   fd1781_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
53};
54
55extern const device_type FD1781;
56
57class fd1791_device : public wd1770_device
58{
59public:
60   fd1791_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
61};
62
63extern const device_type FD1791;
64
65class fd1792_device : public wd1770_device
66{
67public:
68   fd1792_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
69};
70
71extern const device_type FD1792;
72
73class fd1793_device : public wd1770_device
74{
75public:
76   fd1793_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
77};
78
79extern const device_type FD1793;
80
81class fd1794_device : public wd1770_device
82{
83public:
84   fd1794_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
85};
86
87extern const device_type FD1794;
88
89class fd1795_device : public wd1770_device
90{
91public:
92   fd1795_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
93};
94
95extern const device_type FD1795;
96
97class fd1797_device : public wd1770_device
98{
99public:
100   fd1797_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
101};
102
103extern const device_type FD1797;
104
105class fd1761_device : public wd1770_device
106{
107public:
108   fd1761_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
109};
110
111extern const device_type FD1761;
112
113class fd1762_device : public wd1770_device
114{
115public:
116   fd1762_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
117};
118
119extern const device_type FD1762;
120
121class fd1763_device : public wd1770_device
122{
123public:
124   fd1763_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
125};
126
127extern const device_type FD1763;
128
129class fd1764_device : public wd1770_device
130{
131public:
132   fd1764_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
133};
134
135extern const device_type FD1764;
136
137class fd1765_device : public wd1770_device
138{
139public:
140   fd1765_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
141};
142
143extern const device_type FD1765;
144
145class fd1767_device : public wd1770_device
146{
147public:
148   fd1767_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
149};
150
151extern const device_type FD1767;
152
153class wd2791_device : public wd1770_device
154{
155public:
156   wd2791_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
157};
158
159extern const device_type WD2791;
160
161class wd2793_device : public wd1770_device
162{
163public:
164   wd2793_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
165};
166
167extern const device_type WD2793;
168
169class wd2795_device : public wd1770_device
170{
171public:
172   wd2795_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
173};
174
175extern const device_type WD2795;
176
177class wd2797_device : public wd1770_device
178{
179public:
180   wd2797_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
181};
182
183extern const device_type WD2797;
184
185class wd1772_device : public wd1770_device
186{
187public:
188   wd1772_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
189protected:
190   // device-level overrides
191   virtual void device_start();
192};
193
194extern const device_type WD1772;
195
196class wd1773_device : public wd1770_device
197{
198public:
199   wd1773_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
200};
201
202extern const device_type WD1773;
203
204class mb8866_device : public wd1770_device
205{
206public:
207   mb8866_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
208};
209
210extern const device_type MB8866;
211
212class mb8876_device : public wd1770_device
213{
214public:
215   mb8876_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
216};
217
218extern const device_type MB8876;
219
220class mb8877_device : public wd1770_device
221{
222public:
223   mb8877_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
224};
225
226extern const device_type MB8877;
227
228
229
230
47231/***************************************************************************
48232    TYPE DEFINITIONS
49233***************************************************************************/
trunk/src/emu/machine/adc1038.h
r17612r17613
3131    MACROS / CONSTANTS
3232***************************************************************************/
3333
34DECLARE_LEGACY_DEVICE(ADC1038, adc1038);
34class adc1038_device : public device_t
35{
36public:
37   adc1038_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
38   ~adc1038_device() { global_free(m_token); }
3539
40   // access to legacy token
41   void *token() const { assert(m_token != NULL); return m_token; }
42protected:
43   // device-level overrides
44   virtual void device_config_complete();
45   virtual void device_start();
46   virtual void device_reset();
47private:
48   // internal state
49   void *m_token;
50};
51
52extern const device_type ADC1038;
53
54
3655#define MCFG_ADC1038_ADD(_tag, _config) \
3756   MCFG_DEVICE_ADD(_tag, ADC1038, 0) \
3857   MCFG_DEVICE_CONFIG(_config)
trunk/src/emu/machine/latch8.c
r17612r17613
2626INLINE latch8_t *get_safe_token(device_t *device) {
2727   assert( device != NULL );
2828   assert( device->type() == LATCH8 );
29   return ( latch8_t * ) downcast<legacy_device_base *>(device)->token();
29   return ( latch8_t * ) downcast<latch8_device *>(device)->token();
3030}
3131
3232static void update(device_t *device, UINT8 new_val, UINT8 mask)
r17612r17613
253253   }
254254}
255255
256latch8_device::latch8_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, UINT32 clock)
257       : legacy_device_base(mconfig, type, tag, owner, clock, DEVICE_GET_INFO_NAME(latch8))
256const device_type LATCH8 = &device_creator<latch8_device>;
257
258latch8_device::latch8_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
259       : device_t(mconfig, LATCH8, "8 bit latch", tag, owner, clock)
258260{
261   m_token = global_alloc_array_clear(UINT8, sizeof(latch8_t));
259262   memset((void*)&m_inline_config,0,sizeof(m_inline_config));
260263}
261264
262const device_type LATCH8 = &legacy_device_creator<latch8_device>;
265//-------------------------------------------------
266//  device_config_complete - perform any
267//  operations now that the configuration is
268//  complete
269//-------------------------------------------------
270
271void latch8_device::device_config_complete()
272{
273}
274
275//-------------------------------------------------
276//  device_start - device-specific startup
277//-------------------------------------------------
278
279void latch8_device::device_start()
280{
281   DEVICE_START_NAME( latch8 )(this);
282}
283
284//-------------------------------------------------
285//  device_reset - device-specific reset
286//-------------------------------------------------
287
288void latch8_device::device_reset()
289{
290   DEVICE_RESET_NAME( latch8 )(this);
291}
trunk/src/emu/machine/latch8.h
r17612r17613
4343   latch8_devread         devread[8];
4444};
4545
46
47DEVICE_GET_INFO( latch8 );
48
49class latch8_device : public legacy_device_base
46class latch8_device : public device_t
5047{
5148public:
52       latch8_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, UINT32 clock);
53     
54      latch8_config m_inline_config;
55     
56      void set_maskout(UINT32 maskout) { m_inline_config.maskout = maskout; }
57      void set_xorvalue(UINT32 xorvalue) { m_inline_config.xorvalue = xorvalue; }
58      void set_nosync(UINT32 nosync) { m_inline_config.nosync = nosync; }
59     
60      void set_discrete_node(const char *dev_tag, int bit, UINT32 node) { m_inline_config.node_device[bit] = dev_tag;  m_inline_config.node_map[bit] = node;  }
61      void set_devread(int bit, const char *tag, read8_device_func handler, int from_bit)
62      {
63         m_inline_config.devread[bit].from_bit = from_bit;
64         m_inline_config.devread[bit].tag = tag;
65         m_inline_config.devread[bit].devread_handler = handler;         
66      }
67      void set_read(int bit, read8_space_func handler, int from_bit)
68      {
69         m_inline_config.devread[bit].from_bit = from_bit;
70         m_inline_config.devread[bit].read_handler = handler;         
71      }     
49   latch8_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
50   ~latch8_device() { global_free(m_token); }
51   
52   // access to legacy token
53   void *token() const { assert(m_token != NULL); return m_token; }
54   latch8_config m_inline_config;
55   
56   void set_maskout(UINT32 maskout) { m_inline_config.maskout = maskout; }
57   void set_xorvalue(UINT32 xorvalue) { m_inline_config.xorvalue = xorvalue; }
58   void set_nosync(UINT32 nosync) { m_inline_config.nosync = nosync; }
59   
60   void set_discrete_node(const char *dev_tag, int bit, UINT32 node) { m_inline_config.node_device[bit] = dev_tag;  m_inline_config.node_map[bit] = node;  }
61   void set_devread(int bit, const char *tag, read8_device_func handler, int from_bit)
62   {
63      m_inline_config.devread[bit].from_bit = from_bit;
64      m_inline_config.devread[bit].tag = tag;
65      m_inline_config.devread[bit].devread_handler = handler;         
66   }
67   void set_read(int bit, read8_space_func handler, int from_bit)
68   {
69      m_inline_config.devread[bit].from_bit = from_bit;
70      m_inline_config.devread[bit].read_handler = handler;         
71   }     
72protected:
73   // device-level overrides
74   virtual void device_config_complete();
75   virtual void device_start();
76   virtual void device_reset();
77private:
78   // internal state
79   void *m_token;
7280};
7381
7482extern const device_type LATCH8;
trunk/src/emu/machine/mb14241.c
r17612r17613
2323   assert(device != NULL);
2424   assert(device->type() == MB14241);
2525
26   return (mb14241_state *)downcast<legacy_device_base *>(device)->token();
26   return (mb14241_state *)downcast<mb14241_device *>(device)->token();
2727}
2828
2929/*****************************************************************************
r17612r17613
8282 }
8383}
8484
85DEFINE_LEGACY_DEVICE(MB14241, mb14241);
85const device_type MB14241 = &device_creator<mb14241_device>;
86
87mb14241_device::mb14241_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
88   : device_t(mconfig, MB14241, "MB14241", tag, owner, clock)
89{
90   m_token = global_alloc_array_clear(UINT8, sizeof(mb14241_state));
91}
92
93//-------------------------------------------------
94//  device_config_complete - perform any
95//  operations now that the configuration is
96//  complete
97//-------------------------------------------------
98
99void mb14241_device::device_config_complete()
100{
101}
102
103//-------------------------------------------------
104//  device_start - device-specific startup
105//-------------------------------------------------
106
107void mb14241_device::device_start()
108{
109   DEVICE_START_NAME( mb14241 )(this);
110}
111
112//-------------------------------------------------
113//  device_reset - device-specific reset
114//-------------------------------------------------
115
116void mb14241_device::device_reset()
117{
118   DEVICE_RESET_NAME( mb14241 )(this);
119}
120
121
trunk/src/emu/machine/mb14241.h
r17612r17613
1010#include "devlegcy.h"
1111
1212
13DECLARE_LEGACY_DEVICE(MB14241, mb14241);
13class mb14241_device : public device_t
14{
15public:
16   mb14241_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
17   ~mb14241_device() { global_free(m_token); }
1418
19   // access to legacy token
20   void *token() const { assert(m_token != NULL); return m_token; }
21protected:
22   // device-level overrides
23   virtual void device_config_complete();
24   virtual void device_start();
25   virtual void device_reset();
26private:
27   // internal state
28   void *m_token;
29};
30
31extern const device_type MB14241;
32
33
1534/***************************************************************************
1635    DEVICE CONFIGURATION MACROS
1736***************************************************************************/
trunk/src/emu/machine/idectrl.c
r17612r17613
197197   assert(device != NULL);
198198   assert(device->type() == IDE_CONTROLLER);
199199
200   return (ide_state *)downcast<legacy_device_base *>(device)->token();
200   return (ide_state *)downcast<ide_controller_device *>(device)->token();
201201}
202202
203203
r17612r17613
19681968}
19691969
19701970
1971DEFINE_LEGACY_DEVICE(IDE_CONTROLLER, ide_controller);
1971const device_type IDE_CONTROLLER = &device_creator<ide_controller_device>;
19721972
1973ide_controller_device::ide_controller_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1974   : device_t(mconfig, IDE_CONTROLLER, "IDE Controller", tag, owner, clock)
1975{
1976   m_token = global_alloc_array_clear(UINT8, sizeof(ide_state));
1977}
1978
1979//-------------------------------------------------
1980//  device_config_complete - perform any
1981//  operations now that the configuration is
1982//  complete
1983//-------------------------------------------------
1984
1985void ide_controller_device::device_config_complete()
1986{
1987}
1988
1989//-------------------------------------------------
1990//  device_start - device-specific startup
1991//-------------------------------------------------
1992
1993void ide_controller_device::device_start()
1994{
1995   DEVICE_START_NAME( ide_controller )(this);
1996}
1997
1998//-------------------------------------------------
1999//  device_reset - device-specific reset
2000//-------------------------------------------------
2001
2002void ide_controller_device::device_reset()
2003{
2004   DEVICE_RESET_NAME( ide_controller )(this);
2005}
2006
2007
2008
19732009//**************************************************************************
19742010//  IDE SLOT DEVICE
19752011//**************************************************************************
trunk/src/emu/machine/74148.c
r17612r17613
6969   assert(device != NULL);
7070   assert(device->type() == TTL74148);
7171
72   return (ttl74148_state *)downcast<legacy_device_base *>(device)->token();
72   return (ttl74148_state *)downcast<ttl74148_device *>(device)->token();
7373}
7474
7575void ttl74148_update(device_t *device)
r17612r17613
229229 }
230230}
231231
232DEFINE_LEGACY_DEVICE(TTL74148, ttl74148);
232const device_type TTL74148 = &device_creator<ttl74148_device>;
233
234ttl74148_device::ttl74148_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
235   : device_t(mconfig, TTL74148, "74148", tag, owner, clock)
236{
237   m_token = global_alloc_array_clear(UINT8, sizeof(ttl74148_state));
238}
239
240//-------------------------------------------------
241//  device_config_complete - perform any
242//  operations now that the configuration is
243//  complete
244//-------------------------------------------------
245
246void ttl74148_device::device_config_complete()
247{
248}
249
250//-------------------------------------------------
251//  device_start - device-specific startup
252//-------------------------------------------------
253
254void ttl74148_device::device_start()
255{
256   DEVICE_START_NAME( ttl74148 )(this);
257}
258
259//-------------------------------------------------
260//  device_reset - device-specific reset
261//-------------------------------------------------
262
263void ttl74148_device::device_reset()
264{
265   DEVICE_RESET_NAME( ttl74148 )(this);
266}
267
268
trunk/src/emu/machine/idectrl.h
r17612r17613
186186
187187/* ----- device interface ----- */
188188
189DECLARE_LEGACY_DEVICE(IDE_CONTROLLER, ide_controller);
189class ide_controller_device : public device_t
190{
191public:
192   ide_controller_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
193   ~ide_controller_device() { global_free(m_token); }
190194
195   // access to legacy token
196   void *token() const { assert(m_token != NULL); return m_token; }
197protected:
198   // device-level overrides
199   virtual void device_config_complete();
200   virtual void device_start();
201   virtual void device_reset();
202private:
203   // internal state
204   void *m_token;
205};
191206
207extern const device_type IDE_CONTROLLER;
208
209
210
192211#endif   /* __IDECTRL_H__ */
trunk/src/emu/machine/68681.c
r17612r17613
106106   assert(device != NULL);
107107   assert(device->type() == DUART68681);
108108
109   return (duart68681_state *)downcast<legacy_device_base *>(device)->token();
109   return (duart68681_state *)downcast<duart68681_device *>(device)->token();
110110}
111111
112112static void duart68681_update_interrupts(duart68681_state *duart68681)
r17612r17613
928928   }
929929}
930930
931DEFINE_LEGACY_DEVICE(DUART68681, duart68681);
931const device_type DUART68681 = &device_creator<duart68681_device>;
932
933duart68681_device::duart68681_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
934   : device_t(mconfig, DUART68681, "DUART 68681", tag, owner, clock)
935{
936   m_token = global_alloc_array_clear(UINT8, sizeof(duart68681_state));
937}
938
939//-------------------------------------------------
940//  device_config_complete - perform any
941//  operations now that the configuration is
942//  complete
943//-------------------------------------------------
944
945void duart68681_device::device_config_complete()
946{
947}
948
949//-------------------------------------------------
950//  device_start - device-specific startup
951//-------------------------------------------------
952
953void duart68681_device::device_start()
954{
955   DEVICE_START_NAME( duart68681 )(this);
956}
957
958//-------------------------------------------------
959//  device_reset - device-specific reset
960//-------------------------------------------------
961
962void duart68681_device::device_reset()
963{
964   DEVICE_RESET_NAME( duart68681 )(this);
965}
966
967
trunk/src/emu/machine/74148.h
r17612r17613
6565int  ttl74148_output_valid_r(device_t *device);
6666int  ttl74148_enable_output_r(device_t *device);
6767
68DECLARE_LEGACY_DEVICE(TTL74148, ttl74148);
68class ttl74148_device : public device_t
69{
70public:
71   ttl74148_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
72   ~ttl74148_device() { global_free(m_token); }
6973
74   // access to legacy token
75   void *token() const { assert(m_token != NULL); return m_token; }
76protected:
77   // device-level overrides
78   virtual void device_config_complete();
79   virtual void device_start();
80   virtual void device_reset();
81private:
82   // internal state
83   void *m_token;
84};
85
86extern const device_type TTL74148;
87
88
7089#endif
trunk/src/emu/machine/68681.h
r17612r17613
1515   INT32 ip3clk, ip4clk, ip5clk, ip6clk;
1616};
1717
18DECLARE_LEGACY_DEVICE(DUART68681, duart68681);
18class duart68681_device : public device_t
19{
20public:
21   duart68681_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
22   ~duart68681_device() { global_free(m_token); }
1923
24   // access to legacy token
25   void *token() const { assert(m_token != NULL); return m_token; }
26protected:
27   // device-level overrides
28   virtual void device_config_complete();
29   virtual void device_start();
30   virtual void device_reset();
31private:
32   // internal state
33   void *m_token;
34};
35
36extern const device_type DUART68681;
37
38
2039#define MCFG_DUART68681_ADD(_tag, _clock, _config) \
2140   MCFG_DEVICE_ADD(_tag, DUART68681, _clock) \
2241   MCFG_DEVICE_CONFIG(_config)
trunk/src/emu/machine/pd4990a.c
r17612r17613
8686{
8787   assert(device != NULL);
8888   assert((device->type() == UPD4990A));
89   return (upd4990a_state *)downcast<legacy_device_base *>(device)->token();
89   return (upd4990a_state *)downcast<upd4990a_device *>(device)->token();
9090}
9191
9292INLINE UINT8 convert_to_bcd(int val)
r17612r17613
539539 }
540540}
541541
542DEFINE_LEGACY_DEVICE(UPD4990A, upd4990a);
542const device_type UPD4990A = &device_creator<upd4990a_device>;
543
544upd4990a_device::upd4990a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
545   : device_t(mconfig, UPD4990A, "NEC uPD4990A", tag, owner, clock)
546{
547   m_token = global_alloc_array_clear(UINT8, sizeof(upd4990a_state));
548}
549
550//-------------------------------------------------
551//  device_config_complete - perform any
552//  operations now that the configuration is
553//  complete
554//-------------------------------------------------
555
556void upd4990a_device::device_config_complete()
557{
558}
559
560//-------------------------------------------------
561//  device_start - device-specific startup
562//-------------------------------------------------
563
564void upd4990a_device::device_start()
565{
566   DEVICE_START_NAME( upd4990a )(this);
567}
568
569//-------------------------------------------------
570//  device_reset - device-specific reset
571//-------------------------------------------------
572
573void upd4990a_device::device_reset()
574{
575   DEVICE_RESET_NAME( upd4990a )(this);
576}
577
578
trunk/src/emu/machine/pd4990a.h
r17612r17613
1616    MACROS / CONSTANTS
1717***************************************************************************/
1818
19DECLARE_LEGACY_DEVICE(UPD4990A, upd4990a);
19class upd4990a_device : public device_t
20{
21public:
22   upd4990a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
23   ~upd4990a_device() { global_free(m_token); }
2024
25   // access to legacy token
26   void *token() const { assert(m_token != NULL); return m_token; }
27protected:
28   // device-level overrides
29   virtual void device_config_complete();
30   virtual void device_start();
31   virtual void device_reset();
32private:
33   // internal state
34   void *m_token;
35};
36
37extern const device_type UPD4990A;
38
39
2140#define MCFG_UPD4990A_ADD(_tag) \
2241   MCFG_DEVICE_ADD(_tag, UPD4990A, 0)
2342
trunk/src/emu/machine/rp5h01.c
r17612r17613
4848{
4949   assert(device != NULL);
5050   assert((device->type() == RP5H01));
51   return (rp5h01_state *)downcast<legacy_device_base *>(device)->token();
51   return (rp5h01_state *)downcast<rp5h01_device *>(device)->token();
5252}
5353
5454/***************************************************************************
r17612r17613
240240 }
241241}
242242
243DEFINE_LEGACY_DEVICE(RP5H01, rp5h01);
243const device_type RP5H01 = &device_creator<rp5h01_device>;
244
245rp5h01_device::rp5h01_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
246   : device_t(mconfig, RP5H01, "RP5H01", tag, owner, clock)
247{
248   m_token = global_alloc_array_clear(UINT8, sizeof(rp5h01_state));
249}
250
251//-------------------------------------------------
252//  device_config_complete - perform any
253//  operations now that the configuration is
254//  complete
255//-------------------------------------------------
256
257void rp5h01_device::device_config_complete()
258{
259}
260
261//-------------------------------------------------
262//  device_start - device-specific startup
263//-------------------------------------------------
264
265void rp5h01_device::device_start()
266{
267   DEVICE_START_NAME( rp5h01 )(this);
268}
269
270//-------------------------------------------------
271//  device_reset - device-specific reset
272//-------------------------------------------------
273
274void rp5h01_device::device_reset()
275{
276   DEVICE_RESET_NAME( rp5h01 )(this);
277}
278
279
trunk/src/emu/machine/rp5h01.h
r17612r17613
1414    MACROS / CONSTANTS
1515***************************************************************************/
1616
17DECLARE_LEGACY_DEVICE(RP5H01, rp5h01);
17class rp5h01_device : public device_t
18{
19public:
20   rp5h01_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
21   ~rp5h01_device() { global_free(m_token); }
1822
23   // access to legacy token
24   void *token() const { assert(m_token != NULL); return m_token; }
25protected:
26   // device-level overrides
27   virtual void device_config_complete();
28   virtual void device_start();
29   virtual void device_reset();
30private:
31   // internal state
32   void *m_token;
33};
34
35extern const device_type RP5H01;
36
37
1938#define MCFG_RP5H01_ADD(_tag) \
2039   MCFG_DEVICE_ADD(_tag, RP5H01, 0)
2140
trunk/src/emu/machine/6525tpi.c
r17612r17613
141141   assert(device != NULL);
142142   assert(device->type() == TPI6525);
143143
144   return (tpi6525_state *)downcast<legacy_device_base *>(device)->token();
144   return (tpi6525_state *)downcast<tpi6525_device *>(device)->token();
145145}
146146
147147
r17612r17613
619619   return tpi6525->ddr_c;
620620}
621621
622DEFINE_LEGACY_DEVICE(TPI6525, tpi6525);
622const device_type TPI6525 = &device_creator<tpi6525_device>;
623
624tpi6525_device::tpi6525_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
625   : device_t(mconfig, TPI6525, "6525 TPI", tag, owner, clock)
626{
627   m_token = global_alloc_array_clear(UINT8, sizeof(tpi6525_state));
628}
629
630//-------------------------------------------------
631//  device_config_complete - perform any
632//  operations now that the configuration is
633//  complete
634//-------------------------------------------------
635
636void tpi6525_device::device_config_complete()
637{
638}
639
640//-------------------------------------------------
641//  device_start - device-specific startup
642//-------------------------------------------------
643
644void tpi6525_device::device_start()
645{
646   DEVICE_START_NAME( tpi6525 )(this);
647}
648
649//-------------------------------------------------
650//  device_reset - device-specific reset
651//-------------------------------------------------
652
653void tpi6525_device::device_reset()
654{
655   DEVICE_RESET_NAME( tpi6525 )(this);
656}
657
658
trunk/src/emu/machine/6525tpi.h
r17612r17613
5757    DEVICE CONFIGURATION MACROS
5858***************************************************************************/
5959
60DECLARE_LEGACY_DEVICE(TPI6525, tpi6525);
60class tpi6525_device : public device_t
61{
62public:
63   tpi6525_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
64   ~tpi6525_device() { global_free(m_token); }
6165
66   // access to legacy token
67   void *token() const { assert(m_token != NULL); return m_token; }
68protected:
69   // device-level overrides
70   virtual void device_config_complete();
71   virtual void device_start();
72   virtual void device_reset();
73private:
74   // internal state
75   void *m_token;
76};
77
78extern const device_type TPI6525;
79
80
6281#define MCFG_TPI6525_ADD(_tag, _intrf) \
6382   MCFG_DEVICE_ADD(_tag, TPI6525, 0) \
6483   MCFG_DEVICE_CONFIG(_intrf)
trunk/src/emu/machine/k053252.c
r17612r17613
8282   assert(device != NULL);
8383   assert(device->type() == K053252);
8484
85   return (k053252_state *)downcast<legacy_device_base *>(device)->token();
85   return (k053252_state *)downcast<k053252_device *>(device)->token();
8686}
8787
8888INLINE const k053252_interface *k053252_get_interface( device_t *device )
r17612r17613
252252   }
253253}
254254
255DEFINE_LEGACY_DEVICE(K053252, k053252);
255const device_type K053252 = &device_creator<k053252_device>;
256256
257k053252_device::k053252_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
258   : device_t(mconfig, K053252, "Konami 053252", tag, owner, clock)
259{
260   m_token = global_alloc_array_clear(UINT8, sizeof(k053252_state));
261}
262
263//-------------------------------------------------
264//  device_config_complete - perform any
265//  operations now that the configuration is
266//  complete
267//-------------------------------------------------
268
269void k053252_device::device_config_complete()
270{
271}
272
273//-------------------------------------------------
274//  device_start - device-specific startup
275//-------------------------------------------------
276
277void k053252_device::device_start()
278{
279   DEVICE_START_NAME( k053252 )(this);
280}
281
282//-------------------------------------------------
283//  device_reset - device-specific reset
284//-------------------------------------------------
285
286void k053252_device::device_reset()
287{
288   DEVICE_RESET_NAME( k053252 )(this);
289}
290
291
292
trunk/src/emu/machine/mb87078.c
r17612r17613
116116   assert(device != NULL);
117117   assert(device->type() == MB87078);
118118
119   return (mb87078_state *)downcast<legacy_device_base *>(device)->token();
119   return (mb87078_state *)downcast<mb87078_device *>(device)->token();
120120}
121121
122122INLINE const mb87078_interface *get_interface( device_t *device )
r17612r17613
280280 }
281281}
282282
283DEFINE_LEGACY_DEVICE(MB87078, mb87078);
283const device_type MB87078 = &device_creator<mb87078_device>;
284
285mb87078_device::mb87078_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
286   : device_t(mconfig, MB87078, "Fujitsu MB87078", tag, owner, clock)
287{
288   m_token = global_alloc_array_clear(UINT8, sizeof(mb87078_state));
289}
290
291//-------------------------------------------------
292//  device_config_complete - perform any
293//  operations now that the configuration is
294//  complete
295//-------------------------------------------------
296
297void mb87078_device::device_config_complete()
298{
299}
300
301//-------------------------------------------------
302//  device_start - device-specific startup
303//-------------------------------------------------
304
305void mb87078_device::device_start()
306{
307   DEVICE_START_NAME( mb87078 )(this);
308}
309
310//-------------------------------------------------
311//  device_reset - device-specific reset
312//-------------------------------------------------
313
314void mb87078_device::device_reset()
315{
316   DEVICE_RESET_NAME( mb87078 )(this);
317}
318
319
trunk/src/emu/machine/pit8253.c
r17612r17613
107107   assert(device != NULL);
108108   assert((device->type() == PIT8253) || (device->type() == PIT8254));
109109
110   return (pit8253_t *) downcast<legacy_device_base *>(device)->token();
110   return (pit8253_t *) downcast<pit8253_device *>(device)->token();
111111}
112112
113113
r17612r17613
11881188}
11891189
11901190
1191DEFINE_LEGACY_DEVICE(PIT8253, pit8253);
1192DEFINE_LEGACY_DEVICE(PIT8254, pit8254);
1191const device_type PIT8253 = &device_creator<pit8253_device>;
1192
1193pit8253_device::pit8253_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1194   : device_t(mconfig, PIT8253, "Intel PIT8253", tag, owner, clock)
1195{
1196   m_token = global_alloc_array_clear(UINT8, sizeof(pit8253_t));
1197}
1198pit8253_device::pit8253_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
1199   : device_t(mconfig, type, name, tag, owner, clock)
1200{
1201   m_token = global_alloc_array_clear(UINT8, sizeof(pit8253_t));
1202}
1203
1204//-------------------------------------------------
1205//  device_config_complete - perform any
1206//  operations now that the configuration is
1207//  complete
1208//-------------------------------------------------
1209
1210void pit8253_device::device_config_complete()
1211{
1212}
1213
1214//-------------------------------------------------
1215//  device_start - device-specific startup
1216//-------------------------------------------------
1217
1218void pit8253_device::device_start()
1219{
1220   DEVICE_START_NAME( pit8253 )(this);
1221}
1222
1223//-------------------------------------------------
1224//  device_reset - device-specific reset
1225//-------------------------------------------------
1226
1227void pit8253_device::device_reset()
1228{
1229   DEVICE_RESET_NAME( pit8253 )(this);
1230}
1231
1232
1233const device_type PIT8254 = &device_creator<pit8254_device>;
1234
1235pit8254_device::pit8254_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1236   : pit8253_device(mconfig, PIT8254, "Intel PIT8254", tag, owner, clock)
1237{
1238}
1239
1240//-------------------------------------------------
1241//  device_start - device-specific startup
1242//-------------------------------------------------
1243
1244void pit8254_device::device_start()
1245{
1246   DEVICE_START_NAME( pit8254 )(this);
1247}
1248
1249
trunk/src/emu/machine/k053252.h
r17612r17613
77
88#include "devlegcy.h"
99
10DECLARE_LEGACY_DEVICE(K053252, k053252);
10class k053252_device : public device_t
11{
12public:
13   k053252_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
14   ~k053252_device() { global_free(m_token); }
1115
16   // access to legacy token
17   void *token() const { assert(m_token != NULL); return m_token; }
18protected:
19   // device-level overrides
20   virtual void device_config_complete();
21   virtual void device_start();
22   virtual void device_reset();
23private:
24   // internal state
25   void *m_token;
26};
1227
28extern const device_type K053252;
1329
30
31
32
1433typedef struct _k053252_interface k053252_interface;
1534struct _k053252_interface
1635{
trunk/src/emu/machine/mb87078.h
r17612r17613
2424   mb87078_gain_changed_cb   gain_changed_cb;
2525};
2626
27DECLARE_LEGACY_DEVICE(MB87078, mb87078);
27class mb87078_device : public device_t
28{
29public:
30   mb87078_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
31   ~mb87078_device() { global_free(m_token); }
2832
33   // access to legacy token
34   void *token() const { assert(m_token != NULL); return m_token; }
35protected:
36   // device-level overrides
37   virtual void device_config_complete();
38   virtual void device_start();
39   virtual void device_reset();
40private:
41   // internal state
42   void *m_token;
43};
44
45extern const device_type MB87078;
46
47
2948/***************************************************************************
3049    DEVICE CONFIGURATION MACROS
3150***************************************************************************/
trunk/src/emu/machine/pit8253.h
r17612r17613
3737   } timer[3];
3838};
3939
40DECLARE_LEGACY_DEVICE(PIT8253, pit8253);
41DECLARE_LEGACY_DEVICE(PIT8254, pit8254);
40class pit8253_device : public device_t
41{
42public:
43   pit8253_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
44   pit8253_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
45   ~pit8253_device() { global_free(m_token); }
4246
47   // access to legacy token
48   void *token() const { assert(m_token != NULL); return m_token; }
49protected:
50   // device-level overrides
51   virtual void device_config_complete();
52   virtual void device_start();
53   virtual void device_reset();
54private:
55   // internal state
56   void *m_token;
57};
4358
59extern const device_type PIT8253;
60
61class pit8254_device : public pit8253_device
62{
63public:
64   pit8254_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
65protected:
66   // device-level overrides
67   virtual void device_start();
68};
69
70extern const device_type PIT8254;
71
72
73
4474/***************************************************************************
4575    DEVICE CONFIGURATION MACROS
4676***************************************************************************/
trunk/src/mess/audio/wswan.c
r17612r17613
5252{
5353   assert(device != NULL);
5454   assert(device->type() == WSWAN);
55   return (wswan_sound_state *)downcast<legacy_device_base *>(device)->token();
55   return (wswan_sound_state *)downcast<wswan_sound_device *>(device)->token();
5656}
5757
5858static void wswan_ch_set_freq( running_machine &machine, struct CHAN *ch, UINT16 freq )
r17612r17613
265265   }
266266}
267267
268DEFINE_LEGACY_SOUND_DEVICE(WSWAN, wswan_sound);
268const device_type WSWAN = &device_creator<wswan_sound_device>;
269
270wswan_sound_device::wswan_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
271   : device_t(mconfig, WSWAN, "WonderSwan Custom", tag, owner, clock),
272     device_sound_interface(mconfig, *this)
273{
274   m_token = global_alloc_array_clear(UINT8, sizeof(wswan_sound_state));
275}
276
277//-------------------------------------------------
278//  device_config_complete - perform any
279//  operations now that the configuration is
280//  complete
281//-------------------------------------------------
282
283void wswan_sound_device::device_config_complete()
284{
285}
286
287//-------------------------------------------------
288//  device_start - device-specific startup
289//-------------------------------------------------
290
291void wswan_sound_device::device_start()
292{
293   DEVICE_START_NAME( wswan_sound )(this);
294}
295
296//-------------------------------------------------
297//  sound_stream_update - handle a stream update
298//-------------------------------------------------
299
300void wswan_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
301{
302   // should never get here
303   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
304}
305
306
trunk/src/mess/audio/mac.c
r17612r17613
5252{
5353   assert(device != NULL);
5454   assert(device->type() == MAC_SOUND);
55   return (mac_sound *) downcast<legacy_device_base *>(device)->token();
55   return (mac_sound *) downcast<mac_sound_device *>(device)->token();
5656}
5757
5858
r17612r17613
204204   }
205205}
206206
207DEFINE_LEGACY_SOUND_DEVICE(MAC_SOUND, mac_sound);
207const device_type MAC_SOUND = &device_creator<mac_sound_device>;
208
209mac_sound_device::mac_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
210   : device_t(mconfig, MAC_SOUND, "Mac Custom", tag, owner, clock),
211     device_sound_interface(mconfig, *this)
212{
213   m_token = global_alloc_array_clear(UINT8, sizeof(mac_sound));
214}
215
216//-------------------------------------------------
217//  device_config_complete - perform any
218//  operations now that the configuration is
219//  complete
220//-------------------------------------------------
221
222void mac_sound_device::device_config_complete()
223{
224}
225
226//-------------------------------------------------
227//  device_start - device-specific startup
228//-------------------------------------------------
229
230void mac_sound_device::device_start()
231{
232   DEVICE_START_NAME( mac_sound )(this);
233}
234
235//-------------------------------------------------
236//  sound_stream_update - handle a stream update
237//-------------------------------------------------
238
239void mac_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
240{
241   // should never get here
242   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
243}
244
245
trunk/src/mess/audio/gmaster.c
r17612r17613
1919{
2020   assert(device != NULL);
2121   assert(device->type() == GMASTER);
22   return (gmaster_sound *) downcast<legacy_device_base *>(device)->token();
22   return (gmaster_sound *) downcast<gmaster_sound_device *>(device)->token();
2323}
2424
2525
r17612r17613
8383   }
8484}
8585
86DEFINE_LEGACY_SOUND_DEVICE(GMASTER, gmaster_sound);
86const device_type GMASTER = &device_creator<gmaster_sound_device>;
87
88gmaster_sound_device::gmaster_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
89   : device_t(mconfig, GMASTER, "Game Master Custom", tag, owner, clock),
90     device_sound_interface(mconfig, *this)
91{
92   m_token = global_alloc_array_clear(UINT8, sizeof(gmaster_sound));
93}
94
95//-------------------------------------------------
96//  device_config_complete - perform any
97//  operations now that the configuration is
98//  complete
99//-------------------------------------------------
100
101void gmaster_sound_device::device_config_complete()
102{
103}
104
105//-------------------------------------------------
106//  device_start - device-specific startup
107//-------------------------------------------------
108
109void gmaster_sound_device::device_start()
110{
111   DEVICE_START_NAME( gmaster_sound )(this);
112}
113
114//-------------------------------------------------
115//  sound_stream_update - handle a stream update
116//-------------------------------------------------
117
118void gmaster_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
119{
120   // should never get here
121   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
122}
123
124
trunk/src/mess/audio/upd1771.c
r17612r17613
159159{
160160    assert(device != NULL);
161161    assert(device->type() == UPD1771C);
162    return (upd1771_state *)downcast<legacy_device_base *>(device)->token();
162    return (upd1771_state *)downcast<upd1771c_device *>(device)->token();
163163}
164164
165165
r17612r17613
480480    }
481481}
482482
483DEFINE_LEGACY_SOUND_DEVICE(UPD1771C, upd1771c);
483const device_type UPD1771C = &device_creator<upd1771c_device>;
484484
485upd1771c_device::upd1771c_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
486   : device_t(mconfig, UPD1771C, "NEC uPD1771C 017", tag, owner, clock),
487     device_sound_interface(mconfig, *this)
488{
489   m_token = global_alloc_array_clear(UINT8, sizeof(upd1771_state));
490}
491
492//-------------------------------------------------
493//  device_config_complete - perform any
494//  operations now that the configuration is
495//  complete
496//-------------------------------------------------
497
498void upd1771c_device::device_config_complete()
499{
500}
501
502//-------------------------------------------------
503//  device_start - device-specific startup
504//-------------------------------------------------
505
506void upd1771c_device::device_start()
507{
508   DEVICE_START_NAME( upd1771c )(this);
509}
510
511//-------------------------------------------------
512//  device_reset - device-specific reset
513//-------------------------------------------------
514
515void upd1771c_device::device_reset()
516{
517   DEVICE_RESET_NAME( upd1771c )(this);
518}
519
520//-------------------------------------------------
521//  device_stop - device-specific stop
522//-------------------------------------------------
523
524void upd1771c_device::device_stop()
525{
526   DEVICE_STOP_NAME( upd1771c )(this);
527}
528
529//-------------------------------------------------
530//  sound_stream_update - handle a stream update
531//-------------------------------------------------
532
533void upd1771c_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
534{
535   // should never get here
536   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
537}
538
539
540
trunk/src/mess/audio/mea8000.c
r17612r17613
126126{
127127   assert( device != NULL );
128128   assert( device->type() == MEA8000);
129   return (mea8000_t*) downcast<legacy_device_base *>(device)->token();
129   return (mea8000_t*) downcast<mea8000_device *>(device)->token();
130130}
131131
132132
r17612r17613
722722   }
723723}
724724
725DEFINE_LEGACY_DEVICE(MEA8000, mea8000);
725const device_type MEA8000 = &device_creator<mea8000_device>;
726
727mea8000_device::mea8000_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
728   : device_t(mconfig, MEA8000, "Philips / Signetics MEA 8000 speech synthesizer", tag, owner, clock)
729{
730   m_token = global_alloc_array_clear(UINT8, sizeof(mea8000_t));
731}
732
733//-------------------------------------------------
734//  device_config_complete - perform any
735//  operations now that the configuration is
736//  complete
737//-------------------------------------------------
738
739void mea8000_device::device_config_complete()
740{
741}
742
743//-------------------------------------------------
744//  device_start - device-specific startup
745//-------------------------------------------------
746
747void mea8000_device::device_start()
748{
749   DEVICE_START_NAME( mea8000 )(this);
750}
751
752//-------------------------------------------------
753//  device_reset - device-specific reset
754//-------------------------------------------------
755
756void mea8000_device::device_reset()
757{
758   DEVICE_RESET_NAME( mea8000 )(this);
759}
760
761
trunk/src/mess/audio/vc4000.c
r17612r17613
2222{
2323   assert(device != NULL);
2424   assert(device->type() == VC4000);
25   return (vc4000_sound *) downcast<legacy_device_base *>(device)->token();
25   return (vc4000_sound *) downcast<vc4000_sound_device *>(device)->token();
2626}
2727
2828
r17612r17613
9999   }
100100}
101101
102DEFINE_LEGACY_SOUND_DEVICE(VC4000, vc4000_sound);
102const device_type VC4000 = &device_creator<vc4000_sound_device>;
103
104vc4000_sound_device::vc4000_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
105   : device_t(mconfig, VC4000, "VC 4000 Custom", tag, owner, clock),
106     device_sound_interface(mconfig, *this)
107{
108   m_token = global_alloc_array_clear(UINT8, sizeof(vc4000_sound));
109}
110
111//-------------------------------------------------
112//  device_config_complete - perform any
113//  operations now that the configuration is
114//  complete
115//-------------------------------------------------
116
117void vc4000_sound_device::device_config_complete()
118{
119}
120
121//-------------------------------------------------
122//  device_start - device-specific startup
123//-------------------------------------------------
124
125void vc4000_sound_device::device_start()
126{
127   DEVICE_START_NAME( vc4000_sound )(this);
128}
129
130//-------------------------------------------------
131//  sound_stream_update - handle a stream update
132//-------------------------------------------------
133
134void vc4000_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
135{
136   // should never get here
137   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
138}
139
140
trunk/src/mess/audio/upd1771.h
r17612r17613
2424    MACROS / CONSTANTS
2525***************************************************************************/
2626
27DECLARE_LEGACY_SOUND_DEVICE(UPD1771C, upd1771c);
27class upd1771c_device : public device_t,
28                                  public device_sound_interface
29{
30public:
31   upd1771c_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
32   ~upd1771c_device() { global_free(m_token); }
2833
34   // access to legacy token
35   void *token() const { assert(m_token != NULL); return m_token; }
36protected:
37   // device-level overrides
38   virtual void device_config_complete();
39   virtual void device_start();
40   virtual void device_stop();
41   virtual void device_reset();
2942
43   // sound stream update overrides
44   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
45private:
46   // internal state
47   void *m_token;
48};
49
50extern const device_type UPD1771C;
51
52
53
3054/***************************************************************************
3155    PROTOTYPES
3256***************************************************************************/
trunk/src/mess/audio/channelf.c
r17612r17613
2020{
2121   assert(device != NULL);
2222   assert(device->type() == CHANNELF);
23   return (channelf_sound_state *)downcast<legacy_device_base *>(device)->token();
23   return (channelf_sound_state *)downcast<channelf_sound_device *>(device)->token();
2424}
2525
2626void channelf_sound_w(device_t *device, int mode)
r17612r17613
149149   }
150150}
151151
152DEFINE_LEGACY_SOUND_DEVICE(CHANNELF, channelf_sound);
152const device_type CHANNELF = &device_creator<channelf_sound_device>;
153
154channelf_sound_device::channelf_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
155   : device_t(mconfig, CHANNELF, "Channel F", tag, owner, clock),
156     device_sound_interface(mconfig, *this)
157{
158   m_token = global_alloc_array_clear(UINT8, sizeof(channelf_sound_state));
159}
160
161//-------------------------------------------------
162//  device_config_complete - perform any
163//  operations now that the configuration is
164//  complete
165//-------------------------------------------------
166
167void channelf_sound_device::device_config_complete()
168{
169}
170
171//-------------------------------------------------
172//  device_start - device-specific startup
173//-------------------------------------------------
174
175void channelf_sound_device::device_start()
176{
177   DEVICE_START_NAME( channelf_sound )(this);
178}
179
180//-------------------------------------------------
181//  sound_stream_update - handle a stream update
182//-------------------------------------------------
183
184void channelf_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
185{
186   // should never get here
187   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
188}
189
190
trunk/src/mess/audio/dave.c
r17612r17613
100100{
101101   assert(device != NULL);
102102   assert(device->type() == DAVE);
103   return (dave_t *) downcast<legacy_device_base *>(device)->token();
103   return (dave_t *) downcast<dave_sound_device *>(device)->token();
104104}
105105
106106
r17612r17613
834834   }
835835}
836836
837DEFINE_LEGACY_SOUND_DEVICE(DAVE, dave_sound);
837const device_type DAVE = &device_creator<dave_sound_device>;
838
839dave_sound_device::dave_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
840   : device_t(mconfig, DAVE, "Dave", tag, owner, clock),
841     device_sound_interface(mconfig, *this)
842{
843   m_token = global_alloc_array_clear(UINT8, sizeof(dave_t));
844}
845
846//-------------------------------------------------
847//  device_config_complete - perform any
848//  operations now that the configuration is
849//  complete
850//-------------------------------------------------
851
852void dave_sound_device::device_config_complete()
853{
854}
855
856//-------------------------------------------------
857//  device_start - device-specific startup
858//-------------------------------------------------
859
860void dave_sound_device::device_start()
861{
862   DEVICE_START_NAME( dave_sound )(this);
863}
864
865//-------------------------------------------------
866//  device_reset - device-specific reset
867//-------------------------------------------------
868
869void dave_sound_device::device_reset()
870{
871   DEVICE_RESET_NAME( dave_sound )(this);
872}
873
874//-------------------------------------------------
875//  sound_stream_update - handle a stream update
876//-------------------------------------------------
877
878void dave_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
879{
880   // should never get here
881   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
882}
883
884
trunk/src/mess/audio/mea8000.h
r17612r17613
1111
1212#include "devlegcy.h"
1313
14DECLARE_LEGACY_DEVICE(MEA8000, mea8000);
14class mea8000_device : public device_t
15{
16public:
17   mea8000_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
18   ~mea8000_device() { global_free(m_token); }
1519
20   // access to legacy token
21   void *token() const { assert(m_token != NULL); return m_token; }
22protected:
23   // device-level overrides
24   virtual void device_config_complete();
25   virtual void device_start();
26   virtual void device_reset();
27private:
28   // internal state
29   void *m_token;
30};
31
32extern const device_type MEA8000;
33
34
1635/* ---------- configuration ------------ */
1736
1837typedef struct _mea8000_interface mea8000_interface;
trunk/src/mess/audio/special.c
r17612r17613
2222{
2323   assert(device != NULL);
2424   assert(device->type() == SPECIMX);
25   return (specimx_sound_state *)downcast<legacy_device_base *>(device)->token();
25   return (specimx_sound_state *)downcast<specimx_sound_device *>(device)->token();
2626}
2727
2828static DEVICE_START(specimx_sound)
r17612r17613
8888   }
8989}
9090
91DEFINE_LEGACY_SOUND_DEVICE(SPECIMX, specimx_sound);
91const device_type SPECIMX = &device_creator<specimx_sound_device>;
92
93specimx_sound_device::specimx_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
94   : device_t(mconfig, SPECIMX, "Specialist MX Custom", tag, owner, clock),
95     device_sound_interface(mconfig, *this)
96{
97   m_token = global_alloc_array_clear(UINT8, sizeof(specimx_sound_state));
98}
99
100//-------------------------------------------------
101//  device_config_complete - perform any
102//  operations now that the configuration is
103//  complete
104//-------------------------------------------------
105
106void specimx_sound_device::device_config_complete()
107{
108}
109
110//-------------------------------------------------
111//  device_start - device-specific startup
112//-------------------------------------------------
113
114void specimx_sound_device::device_start()
115{
116   DEVICE_START_NAME( specimx_sound )(this);
117}
118
119//-------------------------------------------------
120//  sound_stream_update - handle a stream update
121//-------------------------------------------------
122
123void specimx_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
124{
125   // should never get here
126   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
127}
128
129
trunk/src/mess/audio/socrates.c
r17612r17613
2727{
2828   assert(device != NULL);
2929   assert(device->type() == SOCRATES);
30   return (SocratesASIC *)downcast<legacy_device_base *>(device)->token();
30   return (SocratesASIC *)downcast<socrates_snd_device *>(device)->token();
3131}
3232
3333static const UINT8 volumeLUT[16] =
r17612r17613
162162   }
163163}
164164
165DEFINE_LEGACY_SOUND_DEVICE(SOCRATES, socrates_snd);
165const device_type SOCRATES = &device_creator<socrates_snd_device>;
166
167socrates_snd_device::socrates_snd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
168   : device_t(mconfig, SOCRATES, "Socrates Sound", tag, owner, clock),
169     device_sound_interface(mconfig, *this)
170{
171   m_token = global_alloc_array_clear(UINT8, sizeof(SocratesASIC));
172}
173
174//-------------------------------------------------
175//  device_config_complete - perform any
176//  operations now that the configuration is
177//  complete
178//-------------------------------------------------
179
180void socrates_snd_device::device_config_complete()
181{
182}
183
184//-------------------------------------------------
185//  device_start - device-specific startup
186//-------------------------------------------------
187
188void socrates_snd_device::device_start()
189{
190   DEVICE_START_NAME( socrates_snd )(this);
191}
192
193//-------------------------------------------------
194//  sound_stream_update - handle a stream update
195//-------------------------------------------------
196
197void socrates_snd_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
198{
199   // should never get here
200   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
201}
202
203
trunk/src/mess/audio/t6721.c
r17612r17613
103103   assert(device != NULL);
104104   assert(device->type() == T6721);
105105
106   return (t6721_state *)downcast<legacy_device_base *>(device)->token();
106   return (t6721_state *)downcast<t6721_device *>(device)->token();
107107}
108108
109109/*****************************************************************************
r17612r17613
303303 }
304304}
305305
306DEFINE_LEGACY_DEVICE(T6721, t6721);
306const device_type T6721 = &device_creator<t6721_device>;
307
308t6721_device::t6721_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
309   : device_t(mconfig, T6721, "Toshiba 6721A", tag, owner, clock)
310{
311   m_token = global_alloc_array_clear(UINT8, sizeof(t6721_state));
312}
313
314//-------------------------------------------------
315//  device_config_complete - perform any
316//  operations now that the configuration is
317//  complete
318//-------------------------------------------------
319
320void t6721_device::device_config_complete()
321{
322}
323
324//-------------------------------------------------
325//  device_start - device-specific startup
326//-------------------------------------------------
327
328void t6721_device::device_start()
329{
330   DEVICE_START_NAME( t6721 )(this);
331}
332
333//-------------------------------------------------
334//  device_reset - device-specific reset
335//-------------------------------------------------
336
337void t6721_device::device_reset()
338{
339   DEVICE_RESET_NAME( t6721 )(this);
340}
341
342
trunk/src/mess/audio/dave.h
r17612r17613
1414    MACROS / CONSTANTS
1515***************************************************************************/
1616
17DECLARE_LEGACY_SOUND_DEVICE(DAVE, dave_sound);
17class dave_sound_device : public device_t,
18                                  public device_sound_interface
19{
20public:
21   dave_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
22   ~dave_sound_device() { global_free(m_token); }
1823
24   // access to legacy token
25   void *token() const { assert(m_token != NULL); return m_token; }
26protected:
27   // device-level overrides
28   virtual void device_config_complete();
29   virtual void device_start();
30   virtual void device_reset();
31
32   // sound stream update overrides
33   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
34private:
35   // internal state
36   void *m_token;
37};
38
39extern const device_type DAVE;
40
41
1942#define DAVE_INT_SELECTABLE      0
2043#define DAVE_INT_1KHZ_50HZ_TG   1
2144#define DAVE_INT_1HZ         2
trunk/src/mess/audio/gb.c
r17612r17613
180180{
181181   assert(device != NULL);
182182   assert(device->type() == GAMEBOY);
183   return (gb_sound_t *) downcast<legacy_device_base *>(device)->token();
183   return (gb_sound_t *) downcast<gameboy_sound_device *>(device)->token();
184184}
185185
186186
r17612r17613
772772   }
773773}
774774
775DEFINE_LEGACY_SOUND_DEVICE(GAMEBOY, gameboy_sound);
775const device_type GAMEBOY = &device_creator<gameboy_sound_device>;
776
777gameboy_sound_device::gameboy_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
778   : device_t(mconfig, GAMEBOY, "LR35902", tag, owner, clock),
779     device_sound_interface(mconfig, *this)
780{
781   m_token = global_alloc_array_clear(UINT8, sizeof(gb_sound_t));
782}
783
784//-------------------------------------------------
785//  device_config_complete - perform any
786//  operations now that the configuration is
787//  complete
788//-------------------------------------------------
789
790void gameboy_sound_device::device_config_complete()
791{
792}
793
794//-------------------------------------------------
795//  device_start - device-specific startup
796//-------------------------------------------------
797
798void gameboy_sound_device::device_start()
799{
800   DEVICE_START_NAME( gameboy_sound )(this);
801}
802
803//-------------------------------------------------
804//  sound_stream_update - handle a stream update
805//-------------------------------------------------
806
807void gameboy_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
808{
809   // should never get here
810   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
811}
812
813
trunk/src/mess/audio/socrates.h
r17612r17613
99void socrates_snd_reg3_w(device_t *device, int data);
1010void socrates_snd_reg4_w(device_t *device, int data);
1111
12DECLARE_LEGACY_SOUND_DEVICE(SOCRATES, socrates_snd);
12class socrates_snd_device : public device_t,
13                                  public device_sound_interface
14{
15public:
16   socrates_snd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
17   ~socrates_snd_device() { global_free(m_token); }
1318
19   // access to legacy token
20   void *token() const { assert(m_token != NULL); return m_token; }
21protected:
22   // device-level overrides
23   virtual void device_config_complete();
24   virtual void device_start();
25
26   // sound stream update overrides
27   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
28private:
29   // internal state
30   void *m_token;
31};
32
33extern const device_type SOCRATES;
34
35
1436#endif /* __SOCR_SND_H__ */
1537
trunk/src/mess/audio/t6721.h
r17612r17613
1212    DEVICE CONFIGURATION MACROS
1313***************************************************************************/
1414
15DECLARE_LEGACY_DEVICE(T6721, t6721);
15class t6721_device : public device_t
16{
17public:
18   t6721_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
19   ~t6721_device() { global_free(m_token); }
1620
21   // access to legacy token
22   void *token() const { assert(m_token != NULL); return m_token; }
23protected:
24   // device-level overrides
25   virtual void device_config_complete();
26   virtual void device_start();
27   virtual void device_reset();
28private:
29   // internal state
30   void *m_token;
31};
32
33extern const device_type T6721;
34
35
1736#define MCFG_T6721_ADD(_tag) \
1837   MCFG_DEVICE_ADD(_tag, T6721, 0) \
1938
trunk/src/mess/audio/lynx.c
r17612r17613
115115{
116116   assert(device != NULL);
117117   assert(device->type() == LYNX || device->type() == LYNX2);
118   return (lynx_sound_state *)downcast<legacy_device_base *>(device)->token();
118   return (lynx_sound_state *)downcast<lynx_sound_device *>(device)->token();
119119}
120120
121121static void lynx_audio_reset_channel(LYNX_AUDIO *This)
r17612r17613
536536   }
537537}
538538
539DEFINE_LEGACY_SOUND_DEVICE(LYNX, lynx_sound);
540DEFINE_LEGACY_SOUND_DEVICE(LYNX2, lynx2_sound);
539const device_type LYNX = &device_creator<lynx_sound_device>;
540
541lynx_sound_device::lynx_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
542   : device_t(mconfig, LYNX, "Mikey", tag, owner, clock),
543     device_sound_interface(mconfig, *this)
544{
545   m_token = global_alloc_array_clear(UINT8, sizeof(lynx_sound_state));
546}
547
548lynx_sound_device::lynx_sound_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
549   : device_t(mconfig, type, name, tag, owner, clock),
550     device_sound_interface(mconfig, *this)
551{
552   m_token = global_alloc_array_clear(UINT8, sizeof(lynx_sound_state));
553}
554
555//-------------------------------------------------
556//  device_config_complete - perform any
557//  operations now that the configuration is
558//  complete
559//-------------------------------------------------
560
561void lynx_sound_device::device_config_complete()
562{
563}
564
565//-------------------------------------------------
566//  device_start - device-specific startup
567//-------------------------------------------------
568
569void lynx_sound_device::device_start()
570{
571   DEVICE_START_NAME( lynx_sound )(this);
572}
573
574//-------------------------------------------------
575//  device_reset - device-specific reset
576//-------------------------------------------------
577
578void lynx_sound_device::device_reset()
579{
580   DEVICE_RESET_NAME( lynx_sound )(this);
581}
582
583//-------------------------------------------------
584//  sound_stream_update - handle a stream update
585//-------------------------------------------------
586
587void lynx_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
588{
589   // should never get here
590   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
591}
592
593
594const device_type LYNX2 = &device_creator<lynx2_sound_device>;
595
596lynx2_sound_device::lynx2_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
597   : lynx_sound_device(mconfig, LYNX2, "Mikey (Lynx II)", tag, owner, clock)
598{
599}
600
601void lynx2_sound_device::device_start()
602{
603   DEVICE_START_NAME( lynx2_sound )(this);
604}
605
606//-------------------------------------------------
607//  sound_stream_update - handle a stream update
608//-------------------------------------------------
609
610void lynx2_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
611{
612   // should never get here
613   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
614}
615
616
trunk/src/mess/audio/svision.c
r17612r17613
5959{
6060   assert(device != NULL);
6161   assert(device->type() == SVISION);
62   return (svision_sound_state *)downcast<legacy_device_base *>(device)->token();
62   return (svision_sound_state *)downcast<svision_sound_device *>(device)->token();
6363}
6464
6565int *svision_dma_finished(device_t *device)
r17612r17613
315315   }
316316}
317317
318DEFINE_LEGACY_SOUND_DEVICE(SVISION, svision_sound);
318const device_type SVISION = &device_creator<svision_sound_device>;
319
320svision_sound_device::svision_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
321   : device_t(mconfig, SVISION, "Super Vision Custom", tag, owner, clock),
322     device_sound_interface(mconfig, *this)
323{
324   m_token = global_alloc_array_clear(UINT8, sizeof(svision_sound_state));
325}
326
327//-------------------------------------------------
328//  device_config_complete - perform any
329//  operations now that the configuration is
330//  complete
331//-------------------------------------------------
332
333void svision_sound_device::device_config_complete()
334{
335}
336
337//-------------------------------------------------
338//  device_start - device-specific startup
339//-------------------------------------------------
340
341void svision_sound_device::device_start()
342{
343   DEVICE_START_NAME( svision_sound )(this);
344}
345
346//-------------------------------------------------
347//  sound_stream_update - handle a stream update
348//-------------------------------------------------
349
350void svision_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
351{
352   // should never get here
353   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
354}
355
356
trunk/src/mess/audio/gb.h
r17612r17613
1DECLARE_LEGACY_SOUND_DEVICE(GAMEBOY, gameboy_sound);
1class gameboy_sound_device : public device_t,
2                                  public device_sound_interface
3{
4public:
5   gameboy_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
6   ~gameboy_sound_device() { global_free(m_token); }
27
8   // access to legacy token
9   void *token() const { assert(m_token != NULL); return m_token; }
10protected:
11   // device-level overrides
12   virtual void device_config_complete();
13   virtual void device_start();
14
15   // sound stream update overrides
16   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
17private:
18   // internal state
19   void *m_token;
20};
21
22extern const device_type GAMEBOY;
23
24
325READ8_DEVICE_HANDLER( gb_sound_r );
426WRITE8_DEVICE_HANDLER( gb_sound_w );
527READ8_DEVICE_HANDLER( gb_wave_r );
trunk/src/mess/machine/omti8621.h
r17612r17613
5050
5151/* ----- device interface ----- */
5252
53DECLARE_LEGACY_DEVICE(OMTI8621, omti8621);
53class omti8621_device : public device_t
54{
55public:
56   omti8621_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
57   ~omti8621_device() { global_free(m_token); }
58
59   // access to legacy token
60   void *token() const { assert(m_token != NULL); return m_token; }
61protected:
62   // device-level overrides
63   virtual void device_config_complete();
64   virtual void device_start();
65   virtual void device_reset();
66private:
67   // internal state
68   void *m_token;
69};
70
71extern const device_type OMTI8621;
72
5473MACHINE_CONFIG_EXTERN( omti_disk );
5574
5675//###############################################################NEWNEW
trunk/src/mess/machine/strata.c
r17612r17613
7474   assert(device != NULL);
7575   assert(device->type() == STRATAFLASH);
7676
77   return (strata_t *)downcast<legacy_device_base *>(device)->token();
77   return (strata_t *)downcast<strataflash_device *>(device)->token();
7878}
7979
8080static DEVICE_START( strataflash )
r17612r17613
118118   }
119119}
120120
121DEFINE_LEGACY_DEVICE(STRATAFLASH, strataflash);
121const device_type STRATAFLASH = &device_creator<strataflash_device>;
122122
123strataflash_device::strataflash_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
124   : device_t(mconfig, STRATAFLASH, "Intel 28F640J5", tag, owner, clock)
125{
126   m_token = global_alloc_array_clear(UINT8, sizeof(strata_t));
127}
128
129//-------------------------------------------------
130//  device_config_complete - perform any
131//  operations now that the configuration is
132//  complete
133//-------------------------------------------------
134
135void strataflash_device::device_config_complete()
136{
137}
138
139//-------------------------------------------------
140//  device_start - device-specific startup
141//-------------------------------------------------
142
143void strataflash_device::device_start()
144{
145   DEVICE_START_NAME( strataflash )(this);
146}
147
148
149
123150/*
124151    load the FEEPROM contents from file
125152*/
trunk/src/mess/machine/strata.h
r17612r17613
22    strata.h: header file for strata.c
33*/
44
5DECLARE_LEGACY_DEVICE(STRATAFLASH, strataflash);
5class strataflash_device : public device_t
6{
7public:
8   strataflash_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
9   ~strataflash_device() { global_free(m_token); }
610
11   // access to legacy token
12   void *token() const { assert(m_token != NULL); return m_token; }
13protected:
14   // device-level overrides
15   virtual void device_config_complete();
16   virtual void device_start();
17private:
18   // internal state
19   void *m_token;
20};
21
22extern const device_type STRATAFLASH;
23
24
725#define MCFG_STRATAFLASH_ADD(_tag) \
826   MCFG_DEVICE_ADD(_tag, STRATAFLASH, 0)
927
trunk/src/mess/machine/ataridev.h
r17612r17613
3838    MACROS
3939***************************************************************************/
4040
41DECLARE_LEGACY_DEVICE(ATARI_FDC, atari_fdc);
41class atari_fdc_device : public device_t
42{
43public:
44   atari_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
45   ~atari_fdc_device() { global_free(m_token); }
4246
47   // access to legacy token
48   void *token() const { assert(m_token != NULL); return m_token; }
49protected:
50   // device-level overrides
51   virtual void device_config_complete();
52   virtual void device_start();
53   virtual void device_reset();
54   virtual machine_config_constructor device_mconfig_additions() const;
55private:
56   // internal state
57   void *m_token;
58};
59
60extern const device_type ATARI_FDC;
61
62
4363#define MCFG_ATARI_FDC_ADD(_tag)   \
4464   MCFG_DEVICE_ADD((_tag),  ATARI_FDC, 0)
4565
trunk/src/mess/machine/mos6530.c
r17612r17613
8282{
8383   assert(device != NULL);
8484   assert(device->type() == MOS6530);
85   return (mos6530_state *)downcast<legacy_device_base *>(device)->token();
85   return (mos6530_state *)downcast<mos6530_device *>(device)->token();
8686}
8787
8888
r17612r17613
455455   }
456456}
457457
458DEFINE_LEGACY_DEVICE(MOS6530, mos6530);
458const device_type MOS6530 = &device_creator<mos6530_device>;
459
460mos6530_device::mos6530_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
461   : device_t(mconfig, MOS6530, "MOS6530", tag, owner, clock)
462{
463   m_token = global_alloc_array_clear(UINT8, sizeof(mos6530_state));
464}
465
466//-------------------------------------------------
467//  device_config_complete - perform any
468//  operations now that the configuration is
469//  complete
470//-------------------------------------------------
471
472void mos6530_device::device_config_complete()
473{
474}
475
476//-------------------------------------------------
477//  device_start - device-specific startup
478//-------------------------------------------------
479
480void mos6530_device::device_start()
481{
482   DEVICE_START_NAME( mos6530 )(this);
483}
484
485//-------------------------------------------------
486//  device_reset - device-specific reset
487//-------------------------------------------------
488
489void mos6530_device::device_reset()
490{
491   DEVICE_RESET_NAME( mos6530 )(this);
492}
493
494
trunk/src/mess/machine/mos6530.h
r17612r17613
3737    MACROS / CONSTANTS
3838***************************************************************************/
3939
40DECLARE_LEGACY_DEVICE(MOS6530, mos6530);
40class mos6530_device : public device_t
41{
42public:
43   mos6530_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
44   ~mos6530_device() { global_free(m_token); }
4145
46   // access to legacy token
47   void *token() const { assert(m_token != NULL); return m_token; }
48protected:
49   // device-level overrides
50   virtual void device_config_complete();
51   virtual void device_start();
52   virtual void device_reset();
53private:
54   // internal state
55   void *m_token;
56};
57
58extern const device_type MOS6530;
59
60
4261#define MCFG_MOS6530_ADD(_tag, _clock, _config) \
4362   MCFG_DEVICE_ADD((_tag), MOS6530, _clock)   \
4463   MCFG_DEVICE_CONFIG(_config)
trunk/src/mess/machine/mc6854.c
r17612r17613
225225{
226226   assert( device != NULL );
227227   assert( device->type() == MC6854 );
228   return (mc6854_t*) downcast<legacy_device_base *>(device)->token();
228   return (mc6854_t*) downcast<mc6854_device *>(device)->token();
229229}
230230
231231
r17612r17613
10611061   }
10621062}
10631063
1064DEFINE_LEGACY_DEVICE(MC6854, mc6854);
1064const device_type MC6854 = &device_creator<mc6854_device>;
1065
1066mc6854_device::mc6854_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1067   : device_t(mconfig, MC6854, "Motorola MC6854 ADLC", tag, owner, clock)
1068{
1069   m_token = global_alloc_array_clear(UINT8, sizeof(mc6854_t));
1070}
1071
1072//-------------------------------------------------
1073//  device_config_complete - perform any
1074//  operations now that the configuration is
1075//  complete
1076//-------------------------------------------------
1077
1078void mc6854_device::device_config_complete()
1079{
1080}
1081
1082//-------------------------------------------------
1083//  device_start - device-specific startup
1084//-------------------------------------------------
1085
1086void mc6854_device::device_start()
1087{
1088   DEVICE_START_NAME( mc6854 )(this);
1089}
1090
1091//-------------------------------------------------
1092//  device_reset - device-specific reset
1093//-------------------------------------------------
1094
1095void mc6854_device::device_reset()
1096{
1097   DEVICE_RESET_NAME( mc6854 )(this);
1098}
1099
1100
trunk/src/mess/machine/mc6854.h
r17612r17613
99#ifndef MC6854_H
1010#define MC6854_H
1111
12DECLARE_LEGACY_DEVICE(MC6854, mc6854);
12class mc6854_device : public device_t
13{
14public:
15   mc6854_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
16   ~mc6854_device() { global_free(m_token); }
1317
18   // access to legacy token
19   void *token() const { assert(m_token != NULL); return m_token; }
20protected:
21   // device-level overrides
22   virtual void device_config_complete();
23   virtual void device_start();
24   virtual void device_reset();
25private:
26   // internal state
27   void *m_token;
28};
29
30extern const device_type MC6854;
31
32
1433/* we provide two interfaces:
1534   - a bit-based interface:   out_tx, set_rx
1635   - a frame-based interface: out_frame, send_frame
trunk/src/mess/machine/mc6846.c
r17612r17613
8787{
8888   assert( device != NULL );
8989   assert( device->type() == MC6846 );
90   return (mc6846_t*) downcast<legacy_device_base *>(device)->token();
90   return (mc6846_t*) downcast<mc6846_device *>(device)->token();
9191}
9292
9393
r17612r17613
631631   }
632632}
633633
634DEFINE_LEGACY_DEVICE(MC6846, mc6846);
634const device_type MC6846 = &device_creator<mc6846_device>;
635
636mc6846_device::mc6846_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
637   : device_t(mconfig, MC6846, "Motorola MC6846 programmable timer", tag, owner, clock)
638{
639   m_token = global_alloc_array_clear(UINT8, sizeof(mc6846_t));
640}
641
642//-------------------------------------------------
643//  device_config_complete - perform any
644//  operations now that the configuration is
645//  complete
646//-------------------------------------------------
647
648void mc6846_device::device_config_complete()
649{
650}
651
652//-------------------------------------------------
653//  device_start - device-specific startup
654//-------------------------------------------------
655
656void mc6846_device::device_start()
657{
658   DEVICE_START_NAME( mc6846 )(this);
659}
660
661//-------------------------------------------------
662//  device_reset - device-specific reset
663//-------------------------------------------------
664
665void mc6846_device::device_reset()
666{
667   DEVICE_RESET_NAME( mc6846 )(this);
668}
669
670
trunk/src/mess/machine/mc6846.h
r17612r17613
99#ifndef MC6846_H
1010#define MC6846_H
1111
12DECLARE_LEGACY_DEVICE(MC6846, mc6846);
12class mc6846_device : public device_t
13{
14public:
15   mc6846_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
16   ~mc6846_device() { global_free(m_token); }
1317
18   // access to legacy token
19   void *token() const { assert(m_token != NULL); return m_token; }
20protected:
21   // device-level overrides
22   virtual void device_config_complete();
23   virtual void device_start();
24   virtual void device_reset();
25private:
26   // internal state
27   void *m_token;
28};
29
30extern const device_type MC6846;
31
32
1433/* ---------- configuration ------------ */
1534
1635typedef struct _mc6846_interface mc6846_interface;
trunk/src/mess/machine/sst39vfx.c
r17612r17613
4141   assert(device != NULL);
4242   assert(device->type() == SST39VF020 || device->type() == SST39VF400A);
4343
44   return (sst39vfx_t *) downcast<legacy_device_base *>(device)->token();
44   return (sst39vfx_t *) downcast<sst39vf020_device *>(device)->token();
4545}
4646
4747INLINE const sst39vfx_config *get_config(device_t *device)
r17612r17613
218218   }
219219}
220220
221DEFINE_LEGACY_DEVICE(SST39VF020, sst39vf020);
222DEFINE_LEGACY_DEVICE(SST39VF400A, sst39vf400a);
221const device_type SST39VF020 = &device_creator<sst39vf020_device>;
222
223sst39vf020_device::sst39vf020_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
224   : device_t(mconfig, SST39VF020, "SST39VF020", tag, owner, clock)
225{
226   m_token = global_alloc_array_clear(UINT8, sizeof(sst39vfx_t));
227}
228sst39vf020_device::sst39vf020_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
229   : device_t(mconfig, type, name, tag, owner, clock)
230{
231   m_token = global_alloc_array_clear(UINT8, sizeof(sst39vfx_t));
232}
233
234//-------------------------------------------------
235//  device_config_complete - perform any
236//  operations now that the configuration is
237//  complete
238//-------------------------------------------------
239
240void sst39vf020_device::device_config_complete()
241{
242}
243
244//-------------------------------------------------
245//  device_start - device-specific startup
246//-------------------------------------------------
247
248void sst39vf020_device::device_start()
249{
250   DEVICE_START_NAME( sst39vf020 )(this);
251}
252
253
254const device_type SST39VF400A = &device_creator<sst39vf400a_device>;
255
256sst39vf400a_device::sst39vf400a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
257   : sst39vf020_device(mconfig, SST39VF400A, "SST39VF400A", tag, owner, clock)
258{
259}
260
261//-------------------------------------------------
262//  device_start - device-specific startup
263//-------------------------------------------------
264
265void sst39vf400a_device::device_start()
266{
267   DEVICE_START_NAME( sst39vf400a )(this);
268}
269
270
trunk/src/mess/machine/sst39vfx.h
r17612r17613
2929    MACROS
3030***************************************************************************/
3131
32DECLARE_LEGACY_DEVICE(SST39VF020, sst39vf020);
32class sst39vf020_device : public device_t
33{
34public:
35   sst39vf020_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
36   sst39vf020_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
37   ~sst39vf020_device() { global_free(m_token); }
3338
39   // access to legacy token
40   void *token() const { assert(m_token != NULL); return m_token; }
41protected:
42   // device-level overrides
43   virtual void device_config_complete();
44   virtual void device_start();
45private:
46   // internal state
47   void *m_token;
48};
49
50extern const device_type SST39VF020;
51
52
3453#define MCFG_SST39VF020_ADD(_tag, _config) \
3554   MCFG_DEVICE_ADD(_tag, SST39VF020, 0) \
3655   MCFG_DEVICE_CONFIG(_config)
r17612r17613
3857#define MCFG_SST39VF020_REMOVE(_tag) \
3958   MCFG_DEVICE_REMOVE(_tag)
4059
41DECLARE_LEGACY_DEVICE(SST39VF400A, sst39vf400a);
60class sst39vf400a_device : public sst39vf020_device
61{
62public:
63   sst39vf400a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
64protected:
65   // device-level overrides
66   virtual void device_start();
67};
4268
69extern const device_type SST39VF400A;
70
71
4372#define MCFG_SST39VF400A_ADD(_tag,_config) \
4473   MCFG_DEVICE_ADD(_tag, SST39VF400A, 0) \
4574   MCFG_DEVICE_CONFIG(_config)
trunk/src/mess/machine/upd71071.c
r17612r17613
116116   assert(device != NULL);
117117   assert(device->type() == UPD71071);
118118
119   return (upd71071_t*)downcast<legacy_device_base *>(device)->token();
119   return (upd71071_t*)downcast<upd71071_device *>(device)->token();
120120}
121121
122122static TIMER_CALLBACK(dma_transfer_timer)
r17612r17613
441441READ8_DEVICE_HANDLER(upd71071_r) { return upd71071_read(device,offset); }
442442WRITE8_DEVICE_HANDLER(upd71071_w) { upd71071_write(device,offset,data); }
443443
444DEFINE_LEGACY_DEVICE(UPD71071, upd71071);
444const device_type UPD71071 = &device_creator<upd71071_device>;
445
446upd71071_device::upd71071_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
447   : device_t(mconfig, UPD71071, "NEC uPD71071", tag, owner, clock)
448{
449   m_token = global_alloc_array_clear(UINT8, sizeof(upd71071_t));
450}
451
452//-------------------------------------------------
453//  device_config_complete - perform any
454//  operations now that the configuration is
455//  complete
456//-------------------------------------------------
457
458void upd71071_device::device_config_complete()
459{
460}
461
462//-------------------------------------------------
463//  device_start - device-specific startup
464//-------------------------------------------------
465
466void upd71071_device::device_start()
467{
468   DEVICE_START_NAME( upd71071 )(this);
469}
470
471
trunk/src/mess/machine/upd71071.h
r17612r17613
1414
1515int upd71071_dmarq(device_t* device,int state,int channel);
1616
17DECLARE_LEGACY_DEVICE(UPD71071, upd71071);
17class upd71071_device : public device_t
18{
19public:
20   upd71071_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
21   ~upd71071_device() { global_free(m_token); }
1822
23   // access to legacy token
24   void *token() const { assert(m_token != NULL); return m_token; }
25protected:
26   // device-level overrides
27   virtual void device_config_complete();
28   virtual void device_start();
29private:
30   // internal state
31   void *m_token;
32};
33
34extern const device_type UPD71071;
35
36
1937#define MCFG_UPD71071_ADD(_tag, _config) \
2038   MCFG_DEVICE_ADD(_tag, UPD71071, 0) \
2139   MCFG_DEVICE_CONFIG(_config)
trunk/src/mess/machine/e05a03.c
r17612r17613
5656   assert(device != NULL);
5757   assert(device->type() == E05A03);
5858
59   return (e05a03_state *)downcast<legacy_device_base *>(device)->token();
59   return (e05a03_state *)downcast<e05a03_device *>(device)->token();
6060}
6161
6262
r17612r17613
238238   e05a03_resi_w(device, state);
239239}
240240
241DEFINE_LEGACY_DEVICE(E05A03, e05a03);
241const device_type E05A03 = &device_creator<e05a03_device>;
242
243e05a03_device::e05a03_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
244   : device_t(mconfig, E05A03, "E05A03", tag, owner, clock)
245{
246   m_token = global_alloc_array_clear(UINT8, sizeof(e05a03_state));
247}
248
249//-------------------------------------------------
250//  device_config_complete - perform any
251//  operations now that the configuration is
252//  complete
253//-------------------------------------------------
254
255void e05a03_device::device_config_complete()
256{
257}
258
259//-------------------------------------------------
260//  device_start - device-specific startup
261//-------------------------------------------------
262
263void e05a03_device::device_start()
264{
265   DEVICE_START_NAME( e05a03 )(this);
266}
267
268//-------------------------------------------------
269//  device_reset - device-specific reset
270//-------------------------------------------------
271
272void e05a03_device::device_reset()
273{
274   DEVICE_RESET_NAME( e05a03 )(this);
275}
276
277
trunk/src/mess/machine/e05a03.h
r17612r17613
4444    DEVICE CONFIGURATION MACROS
4545***************************************************************************/
4646
47DECLARE_LEGACY_DEVICE(E05A03, e05a03);
47class e05a03_device : public device_t
48{
49public:
50   e05a03_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
51   ~e05a03_device() { global_free(m_token); }
4852
53   // access to legacy token
54   void *token() const { assert(m_token != NULL); return m_token; }
55protected:
56   // device-level overrides
57   virtual void device_config_complete();
58   virtual void device_start();
59   virtual void device_reset();
60private:
61   // internal state
62   void *m_token;
63};
64
65extern const device_type E05A03;
66
67
4968#define MCFG_E05A03_ADD(_tag, _intf) \
5069   MCFG_DEVICE_ADD(_tag, E05A03, 0) \
5170   MCFG_DEVICE_CONFIG(_intf)
trunk/src/mess/machine/990_tap.c
r17612r17613
127127   assert(device != NULL);
128128   assert(device->type() == TI990_TAPE_CTRL);
129129
130   return (tap_990_t *)downcast<legacy_device_base *>(device)->token();
130   return (tap_990_t *)downcast<tap_990_device *>(device)->token();
131131}
132132
133133
r17612r17613
10891089   }
10901090}
10911091
1092DEFINE_LEGACY_DEVICE(TI990_TAPE_CTRL, tap_990);
1092const device_type TI990_TAPE_CTRL = &device_creator<tap_990_device>;
1093
1094tap_990_device::tap_990_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1095   : device_t(mconfig, TI990_TAPE_CTRL, "Generic TI990 Tape Controller", tag, owner, clock)
1096{
1097   m_token = global_alloc_array_clear(UINT8, sizeof(tap_990_t));
1098}
1099
1100//-------------------------------------------------
1101//  device_config_complete - perform any
1102//  operations now that the configuration is
1103//  complete
1104//-------------------------------------------------
1105
1106void tap_990_device::device_config_complete()
1107{
1108}
1109
1110//-------------------------------------------------
1111//  device_start - device-specific startup
1112//-------------------------------------------------
1113
1114void tap_990_device::device_start()
1115{
1116   DEVICE_START_NAME( tap_990 )(this);
1117}
1118
1119//-------------------------------------------------
1120//  device_mconfig_additions - return a pointer to
1121//  the device's machine fragment
1122//-------------------------------------------------
1123
1124machine_config_constructor tap_990_device::device_mconfig_additions() const
1125{
1126   return MACHINE_CONFIG_NAME( tap_990  );
1127}
1128
1129
trunk/src/mess/machine/990_tap.h
r17612r17613
1717    MACROS
1818***************************************************************************/
1919
20DECLARE_LEGACY_DEVICE(TI990_TAPE_CTRL, tap_990);
20class tap_990_device : public device_t
21{
22public:
23   tap_990_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
24   ~tap_990_device() { global_free(m_token); }
2125
26   // access to legacy token
27   void *token() const { assert(m_token != NULL); return m_token; }
28protected:
29   // device-level overrides
30   virtual void device_config_complete();
31   virtual void device_start();
32   virtual machine_config_constructor device_mconfig_additions() const;
33private:
34   // internal state
35   void *m_token;
36};
37
38extern const device_type TI990_TAPE_CTRL;
39
40
2241#define MCFG_TI990_TAPE_CTRL_ADD(_tag, _intrf)   \
2342   MCFG_DEVICE_ADD((_tag),  TI990_TAPE_CTRL, 0)\
2443   MCFG_DEVICE_CONFIG(_intrf)
trunk/src/mess/machine/apollo.c
r17612r17613
150150 device get info callback
151151 -------------------------------------------------*/
152152
153static DEVICE_GET_INFO(apollo_config)
153DEVICE_GET_INFO(apollo_config)
154154{
155155   switch (state)
156156   {
r17612r17613
167167   }
168168}
169169
170static DECLARE_LEGACY_DEVICE(APOLLO_CONF, apollo_config);
170class apollo_config_device : public device_t
171{
172public:
173   apollo_config_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
174protected:
175   // device-level overrides
176   virtual void device_config_complete();
177   virtual void device_start();
178   virtual void device_reset();
179private:
180   // internal state
181};
171182
172DEFINE_LEGACY_DEVICE(APOLLO_CONF, apollo_config);
183extern const device_type APOLLO_CONF;
173184
185
186const device_type APOLLO_CONF = &device_creator<apollo_config_device>;
187
188apollo_config_device::apollo_config_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
189   : device_t(mconfig, APOLLO_CONF, "Apollo Configuration", tag, owner, clock)
190{
191}
192
193//-------------------------------------------------
194//  device_config_complete - perform any
195//  operations now that the configuration is
196//  complete
197//-------------------------------------------------
198
199void apollo_config_device::device_config_complete()
200{
201}
202
203//-------------------------------------------------
204//  device_start - device-specific startup
205//-------------------------------------------------
206
207void apollo_config_device::device_start()
208{
209   DEVICE_START_NAME( apollo_config )(this);
210}
211
212//-------------------------------------------------
213//  device_reset - device-specific reset
214//-------------------------------------------------
215
216void apollo_config_device::device_reset()
217{
218   DEVICE_RESET_NAME( apollo_config )(this);
219}
220
221
222
174223//##########################################################################
175224// machine/apollo_csr.c - APOLLO DS3500 CPU Control and Status registers
176225//##########################################################################
trunk/src/mess/machine/ds1315.c
r17612r17613
6565{
6666   assert(device != NULL);
6767   assert(device->type() == DS1315);
68   return (ds1315_t *) downcast<legacy_device_base *>(device)->token();
68   return (ds1315_t *) downcast<ds1315_device *>(device)->token();
6969}
7070
7171
r17612r17613
264264   }
265265}
266266
267DEFINE_LEGACY_DEVICE(DS1315, ds1315);
267const device_type DS1315 = &device_creator<ds1315_device>;
268
269ds1315_device::ds1315_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
270   : device_t(mconfig, DS1315, "Dallas Semiconductor DS1315", tag, owner, clock)
271{
272   m_token = global_alloc_array_clear(UINT8, sizeof(ds1315_t));
273}
274
275//-------------------------------------------------
276//  device_config_complete - perform any
277//  operations now that the configuration is
278//  complete
279//-------------------------------------------------
280
281void ds1315_device::device_config_complete()
282{
283}
284
285//-------------------------------------------------
286//  device_start - device-specific startup
287//-------------------------------------------------
288
289void ds1315_device::device_start()
290{
291   DEVICE_START_NAME( ds1315 )(this);
292}
293
294
trunk/src/mess/machine/pc_lpt.c
r17612r17613
7272   assert(device != NULL);
7373   assert(device->type() == PC_LPT);
7474
75   return (pc_lpt_state *)downcast<legacy_device_base *>(device)->token();
75   return (pc_lpt_state *)downcast<pc_lpt_device *>(device)->token();
7676}
7777
7878
r17612r17613
252252   }
253253}
254254
255DEFINE_LEGACY_DEVICE(PC_LPT, pc_lpt);
255const device_type PC_LPT = &device_creator<pc_lpt_device>;
256256
257pc_lpt_device::pc_lpt_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
258   : device_t(mconfig, PC_LPT, "PC-LPT", tag, owner, clock)
259{
260   m_token = global_alloc_array_clear(UINT8, sizeof(pc_lpt_state));
261}
262
263//-------------------------------------------------
264//  device_config_complete - perform any
265//  operations now that the configuration is
266//  complete
267//-------------------------------------------------
268
269void pc_lpt_device::device_config_complete()
270{
271}
272
273//-------------------------------------------------
274//  device_start - device-specific startup
275//-------------------------------------------------
276
277void pc_lpt_device::device_start()
278{
279   DEVICE_START_NAME( pc_lpt )(this);
280}
281
282//-------------------------------------------------
283//  device_reset - device-specific reset
284//-------------------------------------------------
285
286void pc_lpt_device::device_reset()
287{
288   DEVICE_RESET_NAME( pc_lpt )(this);
289}
290
291//-------------------------------------------------
292//  device_mconfig_additions - return a pointer to
293//  the device's machine fragment
294//-------------------------------------------------
295
296machine_config_constructor pc_lpt_device::device_mconfig_additions() const
297{
298   return MACHINE_CONFIG_NAME( pc_lpt  );
299}
300
301
302
257303static WRITE_LINE_DEVICE_HANDLER(pc_cpu_line)
258304{
259305   isa8_lpt_device   *lpt  = downcast<isa8_lpt_device *>(device->owner());
trunk/src/mess/machine/s3c44b0.c
r17612r17613
5656INLINE s3c44b0_t *get_token( device_t *device)
5757{
5858   assert(device != NULL);
59   return (s3c44b0_t *)downcast<legacy_device_base *>(device)->token();
59   return (s3c44b0_t *)downcast<s3c44b0_device *>(device)->token();
6060}
6161
6262/***************************************************************************
r17612r17613
20542054    }
20552055}
20562056
2057DEFINE_LEGACY_DEVICE(S3C44B0, s3c44b0);
2057const device_type S3C44B0 = &device_creator<s3c44b0_device>;
2058
2059s3c44b0_device::s3c44b0_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
2060   : device_t(mconfig, S3C44B0, "Samsung S3C44B0", tag, owner, clock)
2061{
2062   m_token = global_alloc_array_clear(UINT8, sizeof(s3c44b0_t));
2063}
2064
2065//-------------------------------------------------
2066//  device_config_complete - perform any
2067//  operations now that the configuration is
2068//  complete
2069//-------------------------------------------------
2070
2071void s3c44b0_device::device_config_complete()
2072{
2073}
2074
2075//-------------------------------------------------
2076//  device_start - device-specific startup
2077//-------------------------------------------------
2078
2079void s3c44b0_device::device_start()
2080{
2081   DEVICE_START_NAME( s3c44b0 )(this);
2082}
2083
2084//-------------------------------------------------
2085//  device_reset - device-specific reset
2086//-------------------------------------------------
2087
2088void s3c44b0_device::device_reset()
2089{
2090   DEVICE_RESET_NAME( s3c44b0 )(this);
2091}
2092
2093
trunk/src/mess/machine/ds1315.h
r17612r17613
1818    MACROS
1919***************************************************************************/
2020
21DECLARE_LEGACY_DEVICE(DS1315, ds1315);
21class ds1315_device : public device_t
22{
23public:
24   ds1315_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
25   ~ds1315_device() { global_free(m_token); }
2226
27   // access to legacy token
28   void *token() const { assert(m_token != NULL); return m_token; }
29protected:
30   // device-level overrides
31   virtual void device_config_complete();
32   virtual void device_start();
33private:
34   // internal state
35   void *m_token;
36};
2337
38extern const device_type DS1315;
2439
40
41
42
2543/***************************************************************************
2644    DEVICE CONFIGURATION MACROS
2745***************************************************************************/
trunk/src/mess/machine/pc_lpt.h
r17612r17613
3939    DEVICE CONFIGURATION MACROS
4040***************************************************************************/
4141
42DECLARE_LEGACY_DEVICE(PC_LPT, pc_lpt);
42class pc_lpt_device : public device_t
43{
44public:
45   pc_lpt_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
46   ~pc_lpt_device() { global_free(m_token); }
4347
48   // access to legacy token
49   void *token() const { assert(m_token != NULL); return m_token; }
50protected:
51   // device-level overrides
52   virtual void device_config_complete();
53   virtual void device_start();
54   virtual void device_reset();
55   virtual machine_config_constructor device_mconfig_additions() const;
56private:
57   // internal state
58   void *m_token;
59};
60
61extern const device_type PC_LPT;
62
63
4464#define MCFG_PC_LPT_ADD(_tag, _intf) \
4565   MCFG_DEVICE_ADD(_tag, PC_LPT, 0) \
4666   MCFG_DEVICE_CONFIG(_intf)
trunk/src/mess/machine/s3c44b0.h
r17612r17613
3535   S3C44B0_GPIO_PORT_G
3636};
3737
38DECLARE_LEGACY_DEVICE(S3C44B0, s3c44b0);
38class s3c44b0_device : public device_t
39{
40public:
41   s3c44b0_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
42   ~s3c44b0_device() { global_free(m_token); }
3943
44   // access to legacy token
45   void *token() const { assert(m_token != NULL); return m_token; }
46protected:
47   // device-level overrides
48   virtual void device_config_complete();
49   virtual void device_start();
50   virtual void device_reset();
51private:
52   // internal state
53   void *m_token;
54};
55
56extern const device_type S3C44B0;
57
58
4059/*******************************************************************************
4160    TYPE DEFINITIONS
4261*******************************************************************************/
trunk/src/mess/machine/mc68328.c
r17612r17613
28292829    }
28302830}
28312831
2832DEFINE_LEGACY_DEVICE(MC68328, mc68328);
2832const device_type MC68328 = &device_creator<mc68328_device>;
2833
2834mc68328_device::mc68328_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
2835   : device_t(mconfig, MC68328, "Motorola MC68328 (DragonBall) Integrated Processor", tag, owner, clock)
2836{
2837   m_token = global_alloc_array_clear(UINT8, sizeof(mc68328_t));
2838}
2839
2840//-------------------------------------------------
2841//  device_config_complete - perform any
2842//  operations now that the configuration is
2843//  complete
2844//-------------------------------------------------
2845
2846void mc68328_device::device_config_complete()
2847{
2848}
2849
2850//-------------------------------------------------
2851//  device_start - device-specific startup
2852//-------------------------------------------------
2853
2854void mc68328_device::device_start()
2855{
2856   DEVICE_START_NAME( mc68328 )(this);
2857}
2858
2859//-------------------------------------------------
2860//  device_reset - device-specific reset
2861//-------------------------------------------------
2862
2863void mc68328_device::device_reset()
2864{
2865   DEVICE_RESET_NAME( mc68328 )(this);
2866}
2867
2868
trunk/src/mess/machine/mc68328.h
r17612r17613
535535{
536536    assert( device != NULL );
537537    assert( device->type() == MC68328 );
538    return (mc68328_t*) downcast<legacy_device_base *>(device)->token();
538    return (mc68328_t*) downcast<mc68328_device *>(device)->token();
539539}
540540
541541#endif // __MC68328_PRIVATE_H_
trunk/src/mess/machine/micropolis.c
r17612r17613
113113   assert(device != NULL);
114114   assert(device->type() == MICROPOLIS);
115115
116   return (micropolis_state *)downcast<legacy_device_base *>(device)->token();
116   return (micropolis_state *)downcast<micropolis_device *>(device)->token();
117117}
118118
119119
r17612r17613
396396 }
397397}
398398
399DEFINE_LEGACY_DEVICE(MICROPOLIS, micropolis);
399const device_type MICROPOLIS = &device_creator<micropolis_device>;
400
401micropolis_device::micropolis_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
402   : device_t(mconfig, MICROPOLIS, "MICROPOLIS", tag, owner, clock)
403{
404   m_token = global_alloc_array_clear(UINT8, sizeof(micropolis_state));
405}
406
407//-------------------------------------------------
408//  device_config_complete - perform any
409//  operations now that the configuration is
410//  complete
411//-------------------------------------------------
412
413void micropolis_device::device_config_complete()
414{
415}
416
417//-------------------------------------------------
418//  device_start - device-specific startup
419//-------------------------------------------------
420
421void micropolis_device::device_start()
422{
423   DEVICE_START_NAME( micropolis )(this);
424}
425
426//-------------------------------------------------
427//  device_reset - device-specific reset
428//-------------------------------------------------
429
430void micropolis_device::device_reset()
431{
432   DEVICE_RESET_NAME( micropolis )(this);
433}
434
435
trunk/src/mess/machine/micropolis.h
r17612r17613
1717    MACROS
1818***************************************************************************/
1919
20DECLARE_LEGACY_DEVICE(MICROPOLIS, micropolis);
20class micropolis_device : public device_t
21{
22public:
23   micropolis_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
24   ~micropolis_device() { global_free(m_token); }
2125
26   // access to legacy token
27   void *token() const { assert(m_token != NULL); return m_token; }
28protected:
29   // device-level overrides
30   virtual void device_config_complete();
31   virtual void device_start();
32   virtual void device_reset();
33private:
34   // internal state
35   void *m_token;
36};
2237
38extern const device_type MICROPOLIS;
2339
40
41
42
2443/***************************************************************************
2544    TYPE DEFINITIONS
2645***************************************************************************/
trunk/src/mess/machine/tf20.c
r17612r17613
5050   assert(device != NULL);
5151   assert(device->type() == TF20);
5252
53   return (tf20_state *)downcast<legacy_device_base *>(device)->token();
53   return (tf20_state *)downcast<tf20_device *>(device)->token();
5454}
5555
5656
r17612r17613
384384   }
385385}
386386
387DEFINE_LEGACY_DEVICE(TF20, tf20);
387const device_type TF20 = &device_creator<tf20_device>;
388
389tf20_device::tf20_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
390   : device_t(mconfig, TF20, "TF-20", tag, owner, clock)
391{
392   m_token = global_alloc_array_clear(UINT8, sizeof(tf20_state));
393}
394
395//-------------------------------------------------
396//  device_config_complete - perform any
397//  operations now that the configuration is
398//  complete
399//-------------------------------------------------
400
401void tf20_device::device_config_complete()
402{
403   m_shortname = "tf20";
404}
405
406//-------------------------------------------------
407//  device_start - device-specific startup
408//-------------------------------------------------
409
410void tf20_device::device_start()
411{
412   DEVICE_START_NAME( tf20 )(this);
413}
414
415//-------------------------------------------------
416//  device_reset - device-specific reset
417//-------------------------------------------------
418
419void tf20_device::device_reset()
420{
421   DEVICE_RESET_NAME( tf20 )(this);
422}
423
424//-------------------------------------------------
425//  device_mconfig_additions - return a pointer to
426//  the device's machine fragment
427//-------------------------------------------------
428
429machine_config_constructor tf20_device::device_mconfig_additions() const
430{
431   return MACHINE_CONFIG_NAME( tf20  );
432}
433
434//-------------------------------------------------
435//  device_rom_region - return a pointer to the
436//  the device's ROM definitions
437//-------------------------------------------------
438
439const rom_entry *tf20_device::device_rom_region() const
440{
441   return ROM_NAME(tf20 );
442}
443
444
trunk/src/mess/machine/tf20.h
r17612r17613
4949    DEVICE CONFIGURATION MACROS
5050***************************************************************************/
5151
52DECLARE_LEGACY_DEVICE(TF20, tf20);
52class tf20_device : public device_t
53{
54public:
55   tf20_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
56   ~tf20_device() { global_free(m_token); }
5357
58   // access to legacy token
59   void *token() const { assert(m_token != NULL); return m_token; }
60protected:
61   // device-level overrides
62   virtual void device_config_complete();
63   virtual void device_start();
64   virtual void device_reset();
65   virtual const rom_entry *device_rom_region() const;
66   virtual machine_config_constructor device_mconfig_additions() const;
67private:
68   // internal state
69   void *m_token;
70};
71
72extern const device_type TF20;
73
74
5475#define MCFG_TF20_ADD(_tag) \
5576   MCFG_DEVICE_ADD(_tag, TF20, 0) \
5677
trunk/src/mess/machine/hd63450.c
r17612r17613
5353   assert(device != NULL);
5454   assert(device->type() == HD63450);
5555
56   return (hd63450_t *)downcast<legacy_device_base *>(device)->token();
56   return (hd63450_t *)downcast<hd63450_device *>(device)->token();
5757}
5858
5959static DEVICE_START(hd63450)
r17612r17613
485485READ16_DEVICE_HANDLER(hd63450_r) { return hd63450_read(device,offset,mem_mask); }
486486WRITE16_DEVICE_HANDLER(hd63450_w) { hd63450_write(device,offset,data,mem_mask); }
487487
488DEFINE_LEGACY_DEVICE(HD63450, hd63450);
488const device_type HD63450 = &device_creator<hd63450_device>;
489
490hd63450_device::hd63450_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
491   : device_t(mconfig, HD63450, "Hitachi HD63450", tag, owner, clock)
492{
493   m_token = global_alloc_array_clear(UINT8, sizeof(hd63450_t));
494}
495
496//-------------------------------------------------
497//  device_config_complete - perform any
498//  operations now that the configuration is
499//  complete
500//-------------------------------------------------
501
502void hd63450_device::device_config_complete()
503{
504}
505
506//-------------------------------------------------
507//  device_start - device-specific startup
508//-------------------------------------------------
509
510void hd63450_device::device_start()
511{
512   DEVICE_START_NAME( hd63450 )(this);
513}
514
515
trunk/src/mess/machine/hd63450.h
r17612r17613
2424int hd63450_get_vector(device_t* device, int channel);
2525int hd63450_get_error_vector(device_t* device, int channel);
2626
27DECLARE_LEGACY_DEVICE(HD63450, hd63450);
27class hd63450_device : public device_t
28{
29public:
30   hd63450_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
31   ~hd63450_device() { global_free(m_token); }
2832
33   // access to legacy token
34   void *token() const { assert(m_token != NULL); return m_token; }
35protected:
36   // device-level overrides
37   virtual void device_config_complete();
38   virtual void device_start();
39private:
40   // internal state
41   void *m_token;
42};
43
44extern const device_type HD63450;
45
46
2947#define MCFG_HD63450_ADD(_tag, _config) \
3048   MCFG_DEVICE_ADD(_tag, HD63450, 0) \
3149   MCFG_DEVICE_CONFIG(_config)
trunk/src/mess/machine/kr2376.c
r17612r17613
8888   assert(device != NULL);
8989   assert(device->type() == KR2376);
9090
91   return (kr2376_t *)downcast<legacy_device_base *>(device)->token();
91   return (kr2376_t *)downcast<kr2376_device *>(device)->token();
9292}
9393
9494/*-------------------------------------------------
r17612r17613
393393   }
394394}
395395
396DEFINE_LEGACY_DEVICE(KR2376, kr2376);
396const device_type KR2376 = &device_creator<kr2376_device>;
397
398kr2376_device::kr2376_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
399   : device_t(mconfig, KR2376, "SMC KR2376", tag, owner, clock)
400{
401   m_token = global_alloc_array_clear(UINT8, sizeof(kr2376_t));
402}
403
404//-------------------------------------------------
405//  device_config_complete - perform any
406//  operations now that the configuration is
407//  complete
408//-------------------------------------------------
409
410void kr2376_device::device_config_complete()
411{
412}
413
414//-------------------------------------------------
415//  device_start - device-specific startup
416//-------------------------------------------------
417
418void kr2376_device::device_start()
419{
420   DEVICE_START_NAME( kr2376 )(this);
421}
422
423
trunk/src/mess/machine/kr2376.h
r17612r17613
3636typedef void (*kr2376_on_strobe_changed_func) (device_t *device, int level);
3737#define KR2376_ON_STROBE_CHANGED(name) void name(device_t *device, int level)
3838
39DECLARE_LEGACY_DEVICE(KR2376, kr2376);
39class kr2376_device : public device_t
40{
41public:
42   kr2376_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
43   ~kr2376_device() { global_free(m_token); }
4044
45   // access to legacy token
46   void *token() const { assert(m_token != NULL); return m_token; }
47protected:
48   // device-level overrides
49   virtual void device_config_complete();
50   virtual void device_start();
51private:
52   // internal state
53   void *m_token;
54};
55
56extern const device_type KR2376;
57
58
4159#define MCFG_KR2376_ADD(_tag, _intrf) \
4260   MCFG_DEVICE_ADD(_tag, KR2376, 0) \
4361   MCFG_DEVICE_CONFIG(_intrf)
trunk/src/mess/machine/applefdc.c
r17612r17613
165165INLINE applefdc_token *get_token(device_t *device)
166166{
167167   assert_is_applefdc(device);
168   return (applefdc_token *) downcast<legacy_device_base *>(device)->token();
168   return (applefdc_token *) downcast<applefdc_base_device *>(device)->token();
169169}
170170
171171
r17612r17613
857857   }
858858}
859859
860DEFINE_LEGACY_DEVICE(APPLEFDC, applefdc);
861DEFINE_LEGACY_DEVICE(IWM, iwm);
862DEFINE_LEGACY_DEVICE(SWIM, swim);
860applefdc_base_device::applefdc_base_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
861   : device_t(mconfig, type, name, tag, owner, clock)
862{
863   m_token = global_alloc_array_clear(UINT8, sizeof(applefdc_token));
864}
865
866//-------------------------------------------------
867//  device_config_complete - perform any
868//  operations now that the configuration is
869//  complete
870//-------------------------------------------------
871
872void applefdc_base_device::device_config_complete()
873{
874}
875
876//-------------------------------------------------
877//  device_reset - device-specific reset
878//-------------------------------------------------
879
880void applefdc_base_device::device_reset()
881{
882   DEVICE_RESET_NAME( applefdc )(this);
883}
884
885
886const device_type APPLEFDC = &device_creator<applefdc_device>;
887
888applefdc_device::applefdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
889   : applefdc_base_device(mconfig, APPLEFDC, "Apple FDC", tag, owner, clock)
890{
891}
892
893//-------------------------------------------------
894//  device_start - device-specific startup
895//-------------------------------------------------
896
897void applefdc_device::device_start()
898{
899   DEVICE_START_NAME( oldfdc )(this);
900}
901
902
903const device_type IWM = &device_creator<iwm_device>;
904
905iwm_device::iwm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
906   : applefdc_base_device(mconfig, IWM, "Apple IWM (Integrated Woz Machine)", tag, owner, clock)
907{
908}
909
910//-------------------------------------------------
911//  device_start - device-specific startup
912//-------------------------------------------------
913
914void iwm_device::device_start()
915{
916   DEVICE_START_NAME( iwm )(this);
917}
918
919
920const device_type SWIM = &device_creator<swim_device>;
921
922swim_device::swim_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
923   : applefdc_base_device(mconfig, SWIM, "Apple SWIM (Steve Woz Integrated Machine)", tag, owner, clock)
924{
925}
926
927//-------------------------------------------------
928//  device_start - device-specific startup
929//-------------------------------------------------
930
931void swim_device::device_start()
932{
933   DEVICE_START_NAME( swim )(this);
934}
935
936
trunk/src/mess/machine/applefdc.h
r17612r17613
2828#define APPLEFDC_PH2   0x04
2929#define APPLEFDC_PH3   0x08
3030
31DECLARE_LEGACY_DEVICE(APPLEFDC, applefdc);
32DECLARE_LEGACY_DEVICE(IWM, iwm);
33DECLARE_LEGACY_DEVICE(SWIM, swim);
31class applefdc_base_device : public device_t
32{
33public:
34   applefdc_base_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
35   ~applefdc_base_device() { global_free(m_token); }
3436
37   // access to legacy token
38   void *token() const { assert(m_token != NULL); return m_token; }
39protected:
40   // device-level overrides
41   virtual void device_config_complete();
42   virtual void device_start() { }
43   virtual void device_reset();
44private:
45   // internal state
46   void *m_token;
47};
3548
49class applefdc_device : public applefdc_base_device
50{
51public:
52   applefdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
53protected:
54   // device-level overrides
55   virtual void device_start();
56};
3657
58extern const device_type APPLEFDC;
59
60class iwm_device : public applefdc_base_device
61{
62public:
63   iwm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
64protected:
65   // device-level overrides
66   virtual void device_start();
67};
68
69extern const device_type IWM;
70
71class swim_device : public applefdc_base_device
72{
73public:
74   swim_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
75protected:
76   // device-level overrides
77   virtual void device_start();
78};
79
80extern const device_type SWIM;
81
82
83
84
3785/***************************************************************************
3886    TYPE DEFINITIONS
3987***************************************************************************/
trunk/src/mess/machine/upd765.c
r17612r17613
171171   assert(device->type() == UPD765A || device->type() == UPD765B ||
172172      device->type() == SMC37C78 || device->type() == UPD72065);
173173
174   return (upd765_t *)downcast<legacy_device_base *>(device)->token();
174   return (upd765_t *)downcast<upd765a_device *>(device)->token();
175175}
176176
177177static device_t *current_image(device_t *device)
r17612r17613
25402540   }
25412541}
25422542
2543DEFINE_LEGACY_DEVICE(UPD765A, upd765a);
2544DEFINE_LEGACY_DEVICE(UPD765B, upd765b);
2545DEFINE_LEGACY_DEVICE(SMC37C78, smc37c78);
2546DEFINE_LEGACY_DEVICE(UPD72065, upd72065);
2543const device_type UPD765A = &device_creator<upd765a_device>;
2544
2545upd765a_device::upd765a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
2546   : device_t(mconfig, UPD765A, "UPD765A", tag, owner, clock)
2547{
2548   m_token = global_alloc_array_clear(UINT8, sizeof(upd765_t));
2549}
2550upd765a_device::upd765a_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
2551   : device_t(mconfig, type, name, tag, owner, clock)
2552{
2553   m_token = global_alloc_array_clear(UINT8, sizeof(upd765_t));
2554}
2555
2556//-------------------------------------------------
2557//  device_config_complete - perform any
2558//  operations now that the configuration is
2559//  complete
2560//-------------------------------------------------
2561
2562void upd765a_device::device_config_complete()
2563{
2564}
2565
2566//-------------------------------------------------
2567//  device_start - device-specific startup
2568//-------------------------------------------------
2569
2570void upd765a_device::device_start()
2571{
2572   DEVICE_START_NAME( upd765a )(this);
2573}
2574
2575//-------------------------------------------------
2576//  device_reset - device-specific reset
2577//-------------------------------------------------
2578
2579void upd765a_device::device_reset()
2580{
2581   DEVICE_RESET_NAME( upd765 )(this);
2582}
2583
2584
2585const device_type UPD765B = &device_creator<upd765b_device>;
2586
2587upd765b_device::upd765b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
2588   : upd765a_device(mconfig, UPD765B, "UPD765B", tag, owner, clock)
2589{
2590}
2591
2592//-------------------------------------------------
2593//  device_start - device-specific startup
2594//-------------------------------------------------
2595
2596void upd765b_device::device_start()
2597{
2598   DEVICE_START_NAME( upd765b )(this);
2599}
2600
2601
2602const device_type SMC37C78 = &device_creator<smc37c78_device>;
2603
2604smc37c78_device::smc37c78_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
2605   : upd765a_device(mconfig, SMC37C78, "SMC37C78", tag, owner, clock)
2606{
2607}
2608
2609//-------------------------------------------------
2610//  device_start - device-specific startup
2611//-------------------------------------------------
2612
2613void smc37c78_device::device_start()
2614{
2615   DEVICE_START_NAME( smc37c78 )(this);
2616}
2617
2618
2619const device_type UPD72065 = &device_creator<upd72065_device>;
2620
2621upd72065_device::upd72065_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
2622   : upd765a_device(mconfig, UPD72065, "UPD72065", tag, owner, clock)
2623{
2624}
2625
2626//-------------------------------------------------
2627//  device_start - device-specific startup
2628//-------------------------------------------------
2629
2630void upd72065_device::device_start()
2631{
2632   DEVICE_START_NAME( upd72065 )(this);
2633}
2634
2635
trunk/src/mess/machine/upd765.h
r17612r17613
1818    MACROS
1919***************************************************************************/
2020
21DECLARE_LEGACY_DEVICE(UPD765A, upd765a);
22DECLARE_LEGACY_DEVICE(UPD765B, upd765b);
23DECLARE_LEGACY_DEVICE(SMC37C78, smc37c78);
24DECLARE_LEGACY_DEVICE(UPD72065, upd72065);
21class upd765a_device : public device_t
22{
23public:
24   upd765a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
25   upd765a_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
26   ~upd765a_device() { global_free(m_token); }
2527
28   // access to legacy token
29   void *token() const { assert(m_token != NULL); return m_token; }
30protected:
31   // device-level overrides
32   virtual void device_config_complete();
33   virtual void device_start();
34   virtual void device_reset();
35private:
36   // internal state
37   void *m_token;
38};
39
40extern const device_type UPD765A;
41
42class upd765b_device : public upd765a_device
43{
44public:
45   upd765b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
46protected:
47   // device-level overrides
48   virtual void device_start();
49};
50
51extern const device_type UPD765B;
52
53class smc37c78_device : public upd765a_device
54{
55public:
56   smc37c78_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
57protected:
58   // device-level overrides
59   virtual void device_start();
60};
61
62extern const device_type SMC37C78;
63
64class upd72065_device : public upd765a_device
65{
66public:
67   upd72065_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
68protected:
69   // device-level overrides
70   virtual void device_start();
71};
72
73extern const device_type UPD72065;
74
75
2676/***************************************************************************
2777    TYPE DEFINITIONS
2878***************************************************************************/
trunk/src/mess/machine/at45dbxx.c
r17612r17613
8181   assert(device != NULL);
8282   assert(device->type() == AT45DB041 || device->type() == AT45DB081 || device->type() == AT45DB161);
8383
84   return (at45dbxx_t *) downcast<legacy_device_base *>(device)->token();
84   return (at45dbxx_t *) downcast<at45db041_device *>(device)->token();
8585}
8686
8787
r17612r17613
467467   }
468468}
469469
470DEFINE_LEGACY_DEVICE(AT45DB041, at45db041);
471DEFINE_LEGACY_DEVICE(AT45DB081, at45db081);
472DEFINE_LEGACY_DEVICE(AT45DB161, at45db161);
470const device_type AT45DB041 = &device_creator<at45db041_device>;
471
472at45db041_device::at45db041_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
473   : device_t(mconfig, AT45DB041, "AT45DB041", tag, owner, clock)
474{
475   m_token = global_alloc_array_clear(UINT8, sizeof(at45dbxx_t));
476}
477at45db041_device::at45db041_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
478   : device_t(mconfig, type, name, tag, owner, clock)
479{
480   m_token = global_alloc_array_clear(UINT8, sizeof(at45dbxx_t));
481}
482
483//-------------------------------------------------
484//  device_config_complete - perform any
485//  operations now that the configuration is
486//  complete
487//-------------------------------------------------
488
489void at45db041_device::device_config_complete()
490{
491}
492
493//-------------------------------------------------
494//  device_start - device-specific startup
495//-------------------------------------------------
496
497void at45db041_device::device_start()
498{
499   DEVICE_START_NAME( at45db041 )(this);
500}
501
502//-------------------------------------------------
503//  device_reset - device-specific reset
504//-------------------------------------------------
505
506void at45db041_device::device_reset()
507{
508   DEVICE_RESET_NAME( at45dbxx )(this);
509}
510
511
512const device_type AT45DB081 = &device_creator<at45db081_device>;
513
514at45db081_device::at45db081_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
515   : at45db041_device(mconfig, AT45DB081, "AT45DB081", tag, owner, clock)
516{
517}
518
519//-------------------------------------------------
520//  device_start - device-specific startup
521//-------------------------------------------------
522
523void at45db081_device::device_start()
524{
525   DEVICE_START_NAME( at45db081 )(this);
526}
527
528
529const device_type AT45DB161 = &device_creator<at45db161_device>;
530
531at45db161_device::at45db161_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
532   : at45db041_device(mconfig, AT45DB161, "AT45DB161", tag, owner, clock)
533{
534}
535
536//-------------------------------------------------
537//  device_start - device-specific startup
538//-------------------------------------------------
539
540void at45db161_device::device_start()
541{
542   DEVICE_START_NAME( at45db161 )(this);
543}
544
545
trunk/src/mess/machine/at45dbxx.h
r17612r17613
2020    MACROS
2121***************************************************************************/
2222
23DECLARE_LEGACY_DEVICE(AT45DB041, at45db041);
23class at45db041_device : public device_t
24{
25public:
26   at45db041_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
27   at45db041_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
28   ~at45db041_device() { global_free(m_token); }
2429
30   // access to legacy token
31   void *token() const { assert(m_token != NULL); return m_token; }
32protected:
33   // device-level overrides
34   virtual void device_config_complete();
35   virtual void device_start();
36   virtual void device_reset();
37private:
38   // internal state
39   void *m_token;
40};
41
42extern const device_type AT45DB041;
43
44
2545#define MCFG_AT45DB041_ADD(_tag) \
2646   MCFG_DEVICE_ADD(_tag, AT45DB041, 0) \
2747
28DECLARE_LEGACY_DEVICE(AT45DB081, at45db081);
48class at45db081_device : public at45db041_device
49{
50public:
51   at45db081_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
52protected:
53   // device-level overrides
54   virtual void device_start();
55};
2956
57extern const device_type AT45DB081;
58
59
3060#define MCFG_AT45DB081_ADD(_tag) \
3161   MCFG_DEVICE_ADD(_tag, AT45DB081, 0) \
3262
33DECLARE_LEGACY_DEVICE(AT45DB161, at45db161);
63class at45db161_device : public at45db041_device
64{
65public:
66   at45db161_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
67protected:
68   // device-level overrides
69   virtual void device_start();
70};
3471
72extern const device_type AT45DB161;
73
74
3575#define MCFG_AT45DB161_ADD(_tag) \
3676   MCFG_DEVICE_ADD(_tag, AT45DB161, 0) \
3777
trunk/src/mess/machine/er59256.c
r17612r17613
6161INLINE er59256_t *get_token(device_t *device)
6262{
6363   assert(device->type() == ER59256);
64   return (er59256_t *) downcast<legacy_device_base *>(device)->token();
64   return (er59256_t *) downcast<er59256_device *>(device)->token();
6565}
6666
6767
r17612r17613
248248   }
249249}
250250
251DEFINE_LEGACY_DEVICE(ER59256, er59256);
251const device_type ER59256 = &device_creator<er59256_device>;
252
253er59256_device::er59256_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
254   : device_t(mconfig, ER59256, "Microchip ER59256 serial eeprom.", tag, owner, clock)
255{
256   m_token = global_alloc_array_clear(UINT8, sizeof(er59256_t));
257}
258
259//-------------------------------------------------
260//  device_config_complete - perform any
261//  operations now that the configuration is
262//  complete
263//-------------------------------------------------
264
265void er59256_device::device_config_complete()
266{
267}
268
269//-------------------------------------------------
270//  device_start - device-specific startup
271//-------------------------------------------------
272
273void er59256_device::device_start()
274{
275   DEVICE_START_NAME( er59256 )(this);
276}
277
278//-------------------------------------------------
279//  device_stop - device-specific stop
280//-------------------------------------------------
281
282void er59256_device::device_stop()
283{
284   DEVICE_STOP_NAME( er59256 )(this);
285}
286
287
trunk/src/mess/machine/er59256.h
r17612r17613
1414    MACROS
1515***************************************************************************/
1616
17DECLARE_LEGACY_DEVICE(ER59256, er59256);
17class er59256_device : public device_t
18{
19public:
20   er59256_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
21   ~er59256_device() { global_free(m_token); }
1822
23   // access to legacy token
24   void *token() const { assert(m_token != NULL); return m_token; }
25protected:
26   // device-level overrides
27   virtual void device_config_complete();
28   virtual void device_start();
29   virtual void device_stop();
30private:
31   // internal state
32   void *m_token;
33};
34
35extern const device_type ER59256;
36
37
1938#define MCFG_ER59256_ADD(_tag)   \
2039   MCFG_DEVICE_ADD((_tag), ER59256, 0)
2140
trunk/src/mess/machine/pf10.c
r17612r17613
3434   assert(device != NULL);
3535   assert(device->type() == PF10);
3636
37   return (pf10_state *)downcast<legacy_device_base *>(device)->token();
37   return (pf10_state *)downcast<pf10_device *>(device)->token();
3838}
3939
4040
r17612r17613
158158   logerror("%s: pf10_rxd2_w %u\n", device->machine().describe_context(), state);
159159}
160160
161DEFINE_LEGACY_DEVICE(PF10, pf10);
161const device_type PF10 = &device_creator<pf10_device>;
162
163pf10_device::pf10_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
164   : device_t(mconfig, PF10, "PF-10", tag, owner, clock)
165{
166   m_token = global_alloc_array_clear(UINT8, sizeof(pf10_state));
167}
168
169//-------------------------------------------------
170//  device_config_complete - perform any
171//  operations now that the configuration is
172//  complete
173//-------------------------------------------------
174
175void pf10_device::device_config_complete()
176{
177}
178
179//-------------------------------------------------
180//  device_start - device-specific startup
181//-------------------------------------------------
182
183void pf10_device::device_start()
184{
185   DEVICE_START_NAME( pf10 )(this);
186}
187
188//-------------------------------------------------
189//  device_reset - device-specific reset
190//-------------------------------------------------
191
192void pf10_device::device_reset()
193{
194   DEVICE_RESET_NAME( pf10 )(this);
195}
196
197//-------------------------------------------------
198//  device_mconfig_additions - return a pointer to
199//  the device's machine fragment
200//-------------------------------------------------
201
202machine_config_constructor pf10_device::device_mconfig_additions() const
203{
204   return MACHINE_CONFIG_NAME( pf10  );
205}
206
207//-------------------------------------------------
208//  device_rom_region - return a pointer to the
209//  the device's ROM definitions
210//-------------------------------------------------
211
212const rom_entry *pf10_device::device_rom_region() const
213{
214   return ROM_NAME(pf10 );
215}
216
217
trunk/src/mess/machine/pf10.h
r17612r17613
4040    DEVICE CONFIGURATION MACROS
4141***************************************************************************/
4242
43DECLARE_LEGACY_DEVICE(PF10, pf10);
43class pf10_device : public device_t
44{
45public:
46   pf10_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
47   ~pf10_device() { global_free(m_token); }
4448
49   // access to legacy token
50   void *token() const { assert(m_token != NULL); return m_token; }
51protected:
52   // device-level overrides
53   virtual void device_config_complete();
54   virtual void device_start();
55   virtual void device_reset();
56   virtual const rom_entry *device_rom_region() const;
57   virtual machine_config_constructor device_mconfig_additions() const;
58private:
59   // internal state
60   void *m_token;
61};
62
63extern const device_type PF10;
64
65
4566#define MCFG_PF10_ADD(_tag) \
4667   MCFG_DEVICE_ADD(_tag, PF10, 0) \
4768
trunk/src/mess/machine/pcf8593.c
r17612r17613
7272   assert(device != NULL);
7373   assert(device->type() == PCF8593);
7474
75   return (pcf8593_t *) downcast<legacy_device_base *>(device)->token();
75   return (pcf8593_t *) downcast<pcf8593_device *>(device)->token();
7676}
7777
7878
r17612r17613
470470   }
471471}
472472
473DEFINE_LEGACY_DEVICE(PCF8593, pcf8593);
473const device_type PCF8593 = &device_creator<pcf8593_device>;
474
475pcf8593_device::pcf8593_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
476   : device_t(mconfig, PCF8593, "PCF8593 RTC", tag, owner, clock)
477{
478   m_token = global_alloc_array_clear(UINT8, sizeof(pcf8593_t));
479}
480
481//-------------------------------------------------
482//  device_config_complete - perform any
483//  operations now that the configuration is
484//  complete
485//-------------------------------------------------
486
487void pcf8593_device::device_config_complete()
488{
489}
490
491//-------------------------------------------------
492//  device_start - device-specific startup
493//-------------------------------------------------
494
495void pcf8593_device::device_start()
496{
497   DEVICE_START_NAME( pcf8593 )(this);
498}
499
500//-------------------------------------------------
501//  device_reset - device-specific reset
502//-------------------------------------------------
503
504void pcf8593_device::device_reset()
505{
506   DEVICE_RESET_NAME( pcf8593 )(this);
507}
508
509
trunk/src/mess/machine/pcf8593.h
r17612r17613
1616    MACROS
1717***************************************************************************/
1818
19DECLARE_LEGACY_DEVICE(PCF8593, pcf8593);
19class pcf8593_device : public device_t
20{
21public:
22   pcf8593_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
23   ~pcf8593_device() { global_free(m_token); }
2024
25   // access to legacy token
26   void *token() const { assert(m_token != NULL); return m_token; }
27protected:
28   // device-level overrides
29   virtual void device_config_complete();
30   virtual void device_start();
31   virtual void device_reset();
32private:
33   // internal state
34   void *m_token;
35};
36
37extern const device_type PCF8593;
38
39
2140#define MCFG_PCF8593_ADD(_tag) \
2241   MCFG_DEVICE_ADD(_tag, PCF8593, 0) \
2342
trunk/src/mess/machine/i8271.c
r17612r17613
183183   assert(device != NULL);
184184   assert(device->type() == I8271);
185185
186   return (i8271_t *)downcast<legacy_device_base *>(device)->token();
186   return (i8271_t *)downcast<i8271_device *>(device)->token();
187187}
188188
189189
r17612r17613
15961596   }
15971597}
15981598
1599DEFINE_LEGACY_DEVICE(I8271, i8271);
1599const device_type I8271 = &device_creator<i8271_device>;
1600
1601i8271_device::i8271_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1602   : device_t(mconfig, I8271, "Intel 8271", tag, owner, clock)
1603{
1604   m_token = global_alloc_array_clear(UINT8, sizeof(i8271_t));
1605}
1606
1607//-------------------------------------------------
1608//  device_config_complete - perform any
1609//  operations now that the configuration is
1610//  complete
1611//-------------------------------------------------
1612
1613void i8271_device::device_config_complete()
1614{
1615}
1616
1617//-------------------------------------------------
1618//  device_start - device-specific startup
1619//-------------------------------------------------
1620
1621void i8271_device::device_start()
1622{
1623   DEVICE_START_NAME( i8271 )(this);
1624}
1625
1626//-------------------------------------------------
1627//  device_reset - device-specific reset
1628//-------------------------------------------------
1629
1630void i8271_device::device_reset()
1631{
1632   DEVICE_RESET_NAME( i8271 )(this);
1633}
1634
1635
trunk/src/mess/machine/i8271.h
r17612r17613
1111    MACROS
1212***************************************************************************/
1313
14DECLARE_LEGACY_DEVICE(I8271, i8271);
14class i8271_device : public device_t
15{
16public:
17   i8271_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
18   ~i8271_device() { global_free(m_token); }
1519
20   // access to legacy token
21   void *token() const { assert(m_token != NULL); return m_token; }
22protected:
23   // device-level overrides
24   virtual void device_config_complete();
25   virtual void device_start();
26   virtual void device_reset();
27private:
28   // internal state
29   void *m_token;
30};
31
32extern const device_type I8271;
33
34
1635/***************************************************************************
1736    TYPE DEFINITIONS
1837***************************************************************************/
trunk/src/mess/machine/upd7002.c
r17612r17613
6060   assert(device != NULL);
6161   assert(device->type() == UPD7002);
6262
63   return (uPD7002_t *)downcast<legacy_device_base *>(device)->token();
63   return (uPD7002_t *)downcast<uPD7002_device *>(device)->token();
6464}
6565
6666READ8_DEVICE_HANDLER ( uPD7002_EOC_r )
r17612r17613
230230   }
231231}
232232
233DEFINE_LEGACY_DEVICE(UPD7002, uPD7002);
233const device_type UPD7002 = &device_creator<uPD7002_device>;
234
235uPD7002_device::uPD7002_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
236   : device_t(mconfig, UPD7002, "uPD7002", tag, owner, clock)
237{
238   m_token = global_alloc_array_clear(UINT8, sizeof(uPD7002_t));
239}
240
241//-------------------------------------------------
242//  device_config_complete - perform any
243//  operations now that the configuration is
244//  complete
245//-------------------------------------------------
246
247void uPD7002_device::device_config_complete()
248{
249}
250
251//-------------------------------------------------
252//  device_start - device-specific startup
253//-------------------------------------------------
254
255void uPD7002_device::device_start()
256{
257   DEVICE_START_NAME( uPD7002 )(this);
258}
259
260//-------------------------------------------------
261//  device_reset - device-specific reset
262//-------------------------------------------------
263
264void uPD7002_device::device_reset()
265{
266   DEVICE_RESET_NAME( uPD7002 )(this);
267}
268
269
trunk/src/mess/machine/upd7002.h
r17612r17613
1515    MACROS
1616***************************************************************************/
1717
18DECLARE_LEGACY_DEVICE(UPD7002, uPD7002);
18class uPD7002_device : public device_t
19{
20public:
21   uPD7002_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
22   ~uPD7002_device() { global_free(m_token); }
1923
24   // access to legacy token
25   void *token() const { assert(m_token != NULL); return m_token; }
26protected:
27   // device-level overrides
28   virtual void device_config_complete();
29   virtual void device_start();
30   virtual void device_reset();
31private:
32   // internal state
33   void *m_token;
34};
35
36extern const device_type UPD7002;
37
38
2039/***************************************************************************
2140    TYPE DEFINITIONS
2241***************************************************************************/
trunk/src/mess/machine/beta.c
r17612r17613
3535   assert(device != NULL);
3636   assert(device->type() == BETA_DISK);
3737
38   return (beta_disk_state *)downcast<legacy_device_base *>(device)->token();
38   return (beta_disk_state *)downcast<beta_disk_device *>(device)->token();
3939}
4040
4141
r17612r17613
358358   }
359359}
360360
361DEFINE_LEGACY_DEVICE(BETA_DISK, beta_disk);
361const device_type BETA_DISK = &device_creator<beta_disk_device>;
362
363beta_disk_device::beta_disk_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
364   : device_t(mconfig, BETA_DISK, "Beta Disk Interface", tag, owner, clock)
365{
366   m_token = global_alloc_array_clear(UINT8, sizeof(beta_disk_state));
367}
368
369//-------------------------------------------------
370//  device_config_complete - perform any
371//  operations now that the configuration is
372//  complete
373//-------------------------------------------------
374
375void beta_disk_device::device_config_complete()
376{
377   m_shortname = "betadisk";
378}
379
380//-------------------------------------------------
381//  device_start - device-specific startup
382//-------------------------------------------------
383
384void beta_disk_device::device_start()
385{
386   DEVICE_START_NAME( beta_disk )(this);
387}
388
389//-------------------------------------------------
390//  device_reset - device-specific reset
391//-------------------------------------------------
392
393void beta_disk_device::device_reset()
394{
395   DEVICE_RESET_NAME( beta_disk )(this);
396}
397
398//-------------------------------------------------
399//  device_mconfig_additions - return a pointer to
400//  the device's machine fragment
401//-------------------------------------------------
402
403machine_config_constructor beta_disk_device::device_mconfig_additions() const
404{
405   return MACHINE_CONFIG_NAME( beta_disk  );
406}
407
408//-------------------------------------------------
409//  device_rom_region - return a pointer to the
410//  the device's ROM definitions
411//-------------------------------------------------
412
413const rom_entry *beta_disk_device::device_rom_region() const
414{
415   return ROM_NAME(beta_disk );
416}
417
418
trunk/src/mess/machine/beta.h
r17612r17613
1818
1919#define BETA_DISK_TAG   "beta"
2020
21DECLARE_LEGACY_DEVICE(BETA_DISK, beta_disk);
21class beta_disk_device : public device_t
22{
23public:
24   beta_disk_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
25   ~beta_disk_device() { global_free(m_token); }
2226
27   // access to legacy token
28   void *token() const { assert(m_token != NULL); return m_token; }
29protected:
30   // device-level overrides
31   virtual void device_config_complete();
32   virtual void device_start();
33   virtual void device_reset();
34   virtual const rom_entry *device_rom_region() const;
35   virtual machine_config_constructor device_mconfig_additions() const;
36private:
37   // internal state
38   void *m_token;
39};
40
41extern const device_type BETA_DISK;
42
43
2344#define MCFG_BETA_DISK_ADD(_tag) \
2445   MCFG_DEVICE_ADD(_tag, BETA_DISK, 0)
2546
trunk/src/mess/machine/ay31015.c
r17612r17613
141141{
142142   assert(device != NULL);
143143   assert(device->type() == AY31015);
144   return (ay31015_t *) downcast<legacy_device_base *>(device)->token();
144   return (ay31015_t *) downcast<ay31015_device *>(device)->token();
145145}
146146
147147
r17612r17613
742742   }
743743}
744744
745DEFINE_LEGACY_DEVICE(AY31015, ay31015);
745const device_type AY31015 = &device_creator<ay31015_device>;
746
747ay31015_device::ay31015_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
748   : device_t(mconfig, AY31015, "AY-3-1015", tag, owner, clock)
749{
750   m_token = global_alloc_array_clear(UINT8, sizeof(ay31015_t));
751}
752
753//-------------------------------------------------
754//  device_config_complete - perform any
755//  operations now that the configuration is
756//  complete
757//-------------------------------------------------
758
759void ay31015_device::device_config_complete()
760{
761}
762
763//-------------------------------------------------
764//  device_start - device-specific startup
765//-------------------------------------------------
766
767void ay31015_device::device_start()
768{
769   DEVICE_START_NAME( ay31015 )(this);
770}
771
772//-------------------------------------------------
773//  device_reset - device-specific reset
774//-------------------------------------------------
775
776void ay31015_device::device_reset()
777{
778   DEVICE_RESET_NAME( ay31015 )(this);
779}
780
781
trunk/src/mess/machine/ay31015.h
r17612r17613
104104    DEVICE INTERFACE
105105***************************************************************************/
106106
107DECLARE_LEGACY_DEVICE(AY31015, ay31015);
107class ay31015_device : public device_t
108{
109public:
110   ay31015_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
111   ~ay31015_device() { global_free(m_token); }
112
113   // access to legacy token
114   void *token() const { assert(m_token != NULL); return m_token; }
115protected:
116   // device-level overrides
117   virtual void device_config_complete();
118   virtual void device_start();
119   virtual void device_reset();
120private:
121   // internal state
122   void *m_token;
123};
124
125extern const device_type AY31015;
126
108127#endif
trunk/src/mess/machine/mc6843.c
r17612r17613
111111{
112112   assert( device != NULL );
113113   assert( device->type() == MC6843 );
114   return (mc6843_t*) downcast<legacy_device_base *>(device)->token();
114   return (mc6843_t*) downcast<mc6843_device *>(device)->token();
115115}
116116
117117
r17612r17613
851851   }
852852}
853853
854DEFINE_LEGACY_DEVICE(MC6843, mc6843);
854const device_type MC6843 = &device_creator<mc6843_device>;
855855
856mc6843_device::mc6843_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
857   : device_t(mconfig, MC6843, "Motorola MC6843 floppy controller", tag, owner, clock)
858{
859   m_token = global_alloc_array_clear(UINT8, sizeof(mc6843_t));
860}
861
862//-------------------------------------------------
863//  device_config_complete - perform any
864//  operations now that the configuration is
865//  complete
866//-------------------------------------------------
867
868void mc6843_device::device_config_complete()
869{
870}
871
872//-------------------------------------------------
873//  device_start - device-specific startup
874//-------------------------------------------------
875
876void mc6843_device::device_start()
877{
878   DEVICE_START_NAME( mc6843 )(this);
879}
880
881//-------------------------------------------------
882//  device_reset - device-specific reset
883//-------------------------------------------------
884
885void mc6843_device::device_reset()
886{
887   DEVICE_RESET_NAME( mc6843 )(this);
888}
889
890
891
trunk/src/mess/machine/mm58274c.c
r17612r17613
7878   assert(device != NULL);
7979   assert(device->type() == MM58274C);
8080
81   return (mm58274c_t *)downcast<legacy_device_base *>(device)->token();
81   return (mm58274c_t *)downcast<mm58274c_device *>(device)->token();
8282}
8383
8484static attotime interrupt_period_table(int val)
r17612r17613
538538   }
539539}
540540
541DEFINE_LEGACY_DEVICE(MM58274C, mm58274c);
541const device_type MM58274C = &device_creator<mm58274c_device>;
542
543mm58274c_device::mm58274c_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
544   : device_t(mconfig, MM58274C, "National Semiconductor MM58274C", tag, owner, clock)
545{
546   m_token = global_alloc_array_clear(UINT8, sizeof(mm58274c_t));
547}
548
549//-------------------------------------------------
550//  device_config_complete - perform any
551//  operations now that the configuration is
552//  complete
553//-------------------------------------------------
554
555void mm58274c_device::device_config_complete()
556{
557}
558
559//-------------------------------------------------
560//  device_start - device-specific startup
561//-------------------------------------------------
562
563void mm58274c_device::device_start()
564{
565   DEVICE_START_NAME( mm58274c )(this);
566}
567
568//-------------------------------------------------
569//  device_reset - device-specific reset
570//-------------------------------------------------
571
572void mm58274c_device::device_reset()
573{
574   DEVICE_RESET_NAME( mm58274c )(this);
575}
576
577
trunk/src/mess/machine/mc6843.h
r17612r17613
99#ifndef MC6843_H
1010#define MC6843_H
1111
12DECLARE_LEGACY_DEVICE(MC6843, mc6843);
12class mc6843_device : public device_t
13{
14public:
15   mc6843_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
16   ~mc6843_device() { global_free(m_token); }
1317
18   // access to legacy token
19   void *token() const { assert(m_token != NULL); return m_token; }
20protected:
21   // device-level overrides
22   virtual void device_config_complete();
23   virtual void device_start();
24   virtual void device_reset();
25private:
26   // internal state
27   void *m_token;
28};
1429
30extern const device_type MC6843;
31
32
33
1534/* ---------- configuration ------------ */
1635
1736typedef struct _mc6843_interface mc6843_interface;
trunk/src/mess/machine/mm58274c.h
r17612r17613
55    MACROS
66***************************************************************************/
77
8DECLARE_LEGACY_DEVICE(MM58274C, mm58274c);
8class mm58274c_device : public device_t
9{
10public:
11   mm58274c_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
12   ~mm58274c_device() { global_free(m_token); }
913
14   // access to legacy token
15   void *token() const { assert(m_token != NULL); return m_token; }
16protected:
17   // device-level overrides
18   virtual void device_config_complete();
19   virtual void device_start();
20   virtual void device_reset();
21private:
22   // internal state
23   void *m_token;
24};
25
26extern const device_type MM58274C;
27
28
1029/***************************************************************************
1130    FUNCTION PROTOTYPES
1231***************************************************************************/
trunk/src/mess/machine/atarifdc.c
r17612r17613
7474   assert(device != NULL);
7575   assert(device->type() == ATARI_FDC);
7676
77   return (atari_fdc_t *)downcast<legacy_device_base *>(device)->token();
77   return (atari_fdc_t *)downcast<atari_fdc_device *>(device)->token();
7878}
7979
8080/*****************************************************************************
r17612r17613
840840   }
841841}
842842
843DEFINE_LEGACY_DEVICE(ATARI_FDC, atari_fdc);
843const device_type ATARI_FDC = &device_creator<atari_fdc_device>;
844
845atari_fdc_device::atari_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
846   : device_t(mconfig, ATARI_FDC, "Atari FDC", tag, owner, clock)
847{
848   m_token = global_alloc_array_clear(UINT8, sizeof(atari_fdc_t));
849}
850
851//-------------------------------------------------
852//  device_config_complete - perform any
853//  operations now that the configuration is
854//  complete
855//-------------------------------------------------
856
857void atari_fdc_device::device_config_complete()
858{
859}
860
861//-------------------------------------------------
862//  device_start - device-specific startup
863//-------------------------------------------------
864
865void atari_fdc_device::device_start()
866{
867   DEVICE_START_NAME( atari_fdc )(this);
868}
869
870//-------------------------------------------------
871//  device_reset - device-specific reset
872//-------------------------------------------------
873
874void atari_fdc_device::device_reset()
875{
876   DEVICE_RESET_NAME( atari_fdc )(this);
877}
878
879//-------------------------------------------------
880//  device_mconfig_additions - return a pointer to
881//  the device's machine fragment
882//-------------------------------------------------
883
884machine_config_constructor atari_fdc_device::device_mconfig_additions() const
885{
886   return MACHINE_CONFIG_NAME( atari_fdc  );
887}
888
889
trunk/src/mess/machine/omti8621.c
r17612r17613
199199INLINE omti8621_state *get_safe_token(device_t *device) {
200200   assert(device != NULL);
201201   assert(device->type() == OMTI8621);
202   return (omti8621_state *) downcast<legacy_device_base *>(device)->token();
202   return (omti8621_state *) downcast<omti8621_device *>(device)->token();
203203}
204204
205205/***************************************************************************
r17612r17613
13591359   }
13601360}
13611361
1362DEFINE_LEGACY_DEVICE(OMTI8621, omti8621);
1362const device_type OMTI8621 = &device_creator<omti8621_device>;
1363
1364omti8621_device::omti8621_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1365   : device_t(mconfig, OMTI8621, "OMTI 8621", tag, owner, clock)
1366{
1367   m_token = global_alloc_array_clear(UINT8, sizeof(omti8621_state));
1368}
1369
1370//-------------------------------------------------
1371//  device_config_complete - perform any
1372//  operations now that the configuration is
1373//  complete
1374//-------------------------------------------------
1375
1376void omti8621_device::device_config_complete()
1377{
1378}
1379
1380//-------------------------------------------------
1381//  device_start - device-specific startup
1382//-------------------------------------------------
1383
1384void omti8621_device::device_start()
1385{
1386   DEVICE_START_NAME( omti8621 )(this);
1387}
1388
1389//-------------------------------------------------
1390//  device_reset - device-specific reset
1391//-------------------------------------------------
1392
1393void omti8621_device::device_reset()
1394{
1395   DEVICE_RESET_NAME( omti8621 )(this);
1396}
1397
1398
trunk/src/mess/includes/wswan.h
r17612r17613
171171
172172/*----------- defined in audio/wswan.c -----------*/
173173
174DECLARE_LEGACY_SOUND_DEVICE(WSWAN, wswan_sound);
174class wswan_sound_device : public device_t,
175                                  public device_sound_interface
176{
177public:
178   wswan_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
179   ~wswan_sound_device() { global_free(m_token); }
175180
181   // access to legacy token
182   void *token() const { assert(m_token != NULL); return m_token; }
183protected:
184   // device-level overrides
185   virtual void device_config_complete();
186   virtual void device_start();
187
188   // sound stream update overrides
189   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
190private:
191   // internal state
192   void *m_token;
193};
194
195extern const device_type WSWAN;
196
197
176198WRITE8_DEVICE_HANDLER( wswan_sound_port_w );
177199
178200#endif /* WSWAN_H_ */
trunk/src/mess/includes/mac.h
r17612r17613
177177
178178/*----------- defined in audio/mac.c -----------*/
179179
180DECLARE_LEGACY_SOUND_DEVICE(MAC_SOUND, mac_sound);
180class mac_sound_device : public device_t,
181                                  public device_sound_interface
182{
183public:
184   mac_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
185   ~mac_sound_device() { global_free(m_token); }
181186
187   // access to legacy token
188   void *token() const { assert(m_token != NULL); return m_token; }
189protected:
190   // device-level overrides
191   virtual void device_config_complete();
192   virtual void device_start();
193
194   // sound stream update overrides
195   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
196private:
197   // internal state
198   void *m_token;
199};
200
201extern const device_type MAC_SOUND;
202
203
182204void mac_enable_sound( device_t *device, int on );
183205void mac_set_sound_buffer( device_t *device, int buffer );
184206void mac_set_volume( device_t *device, int volume );
trunk/src/mess/includes/apollo.h
r17612r17613
293293void apollo_netserver_init(const char *root_path,  apollo_netserver_transmit tx_data);
294294
295295/*----------- video/apollo.c -----------*/
296class apollo_mono_device : public device_t
297{
298public:
299   apollo_mono_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
300   ~apollo_mono_device() { global_free(m_token); }
296301
302   // access to legacy token
303   void *token() const { assert(m_token != NULL); return m_token; }
304private:
305   // internal state
306   void *m_token;
307};
308
309
297310#define APOLLO_SCREEN_TAG "apollo_screen"
298311
299DECLARE_LEGACY_DEVICE(APOLLO_MONO19I, apollo_mono19i);
312class apollo_mono19i_device : public apollo_mono_device
313{
314public:
315   apollo_mono19i_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
316protected:
317   // device-level overrides
318   virtual void device_config_complete();
319   virtual void device_start();
320   virtual void device_reset();
321private:
322   // internal state
323};
300324
325extern const device_type APOLLO_MONO19I;
326
327
301328#define MCFG_APOLLO_MONO19I_ADD(_tag) \
302329   MCFG_FRAGMENT_ADD(apollo_mono19i) \
303330   MCFG_DEVICE_ADD(_tag, APOLLO_MONO19I, 0)
r17612r17613
306333
307334MACHINE_CONFIG_EXTERN( apollo_mono19i );
308335
309DECLARE_LEGACY_DEVICE(APOLLO_MONO15I, apollo_mono15i);
336class apollo_mono15i_device : public apollo_mono_device
337{
338public:
339   apollo_mono15i_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
340protected:
341   // device-level overrides
342   virtual void device_config_complete();
343   virtual void device_start();
344   virtual void device_reset();
345private:
346   // internal state
347};
310348
349extern const device_type APOLLO_MONO15I;
350
351
311352#define MCFG_APOLLO_MONO15I_ADD( _tag) \
312353   MCFG_FRAGMENT_ADD(apollo_mono15i) \
313354   MCFG_DEVICE_ADD(_tag, APOLLO_MONO15I, 0)
trunk/src/mess/includes/lynx.h
r17612r17613
158158
159159/*----------- defined in audio/lynx.c -----------*/
160160
161DECLARE_LEGACY_SOUND_DEVICE(LYNX, lynx_sound);
162DECLARE_LEGACY_SOUND_DEVICE(LYNX2, lynx2_sound);
161class lynx_sound_device : public device_t,
162                                  public device_sound_interface
163{
164public:
165   lynx_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
166   lynx_sound_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
167   ~lynx_sound_device() { global_free(m_token); }
163168
169   // access to legacy token
170   void *token() const { assert(m_token != NULL); return m_token; }
171protected:
172   // device-level overrides
173   virtual void device_config_complete();
174   virtual void device_start();
175   virtual void device_reset();
176
177   // sound stream update overrides
178   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
179private:
180   // internal state
181   void *m_token;
182};
183
184extern const device_type LYNX;
185
186class lynx2_sound_device : public lynx_sound_device
187{
188public:
189   lynx2_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
190
191protected:
192   // device-level overrides
193   virtual void device_start();
194
195   // sound stream update overrides
196   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
197};
198
199extern const device_type LYNX2;
200
201
164202void lynx_audio_write(device_t *device, int offset, UINT8 data);
165203UINT8 lynx_audio_read(device_t *device, int offset);
166204void lynx_audio_count_down(device_t *device, int nr);
trunk/src/mess/includes/mc68328.h
r17612r17613
160160    DEVICE INTERFACE
161161***************************************************************************/
162162
163DECLARE_LEGACY_DEVICE(MC68328, mc68328);
163class mc68328_device : public device_t
164{
165public:
166   mc68328_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
167   ~mc68328_device() { global_free(m_token); }
164168
169   // access to legacy token
170   void *token() const { assert(m_token != NULL); return m_token; }
171protected:
172   // device-level overrides
173   virtual void device_config_complete();
174   virtual void device_start();
175   virtual void device_reset();
176private:
177   // internal state
178   void *m_token;
179};
180
181extern const device_type MC68328;
182
183
165184/*----------- defined in video/mc68328.c -----------*/
166185
167186/***************************************************************************
trunk/src/mess/includes/channelf.h
r17612r17613
6060
6161/*----------- defined in audio/channelf.c -----------*/
6262
63DECLARE_LEGACY_SOUND_DEVICE(CHANNELF, channelf_sound);
63class channelf_sound_device : public device_t,
64                                  public device_sound_interface
65{
66public:
67   channelf_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
68   ~channelf_sound_device() { global_free(m_token); }
6469
70   // access to legacy token
71   void *token() const { assert(m_token != NULL); return m_token; }
72protected:
73   // device-level overrides
74   virtual void device_config_complete();
75   virtual void device_start();
76
77   // sound stream update overrides
78   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
79private:
80   // internal state
81   void *m_token;
82};
83
84extern const device_type CHANNELF;
85
86
6587void channelf_sound_w(device_t *device, int mode);
6688
6789
trunk/src/mess/includes/gmaster.h
r17612r17613
3535
3636/*----------- defined in audio/gmaster.c -----------*/
3737
38DECLARE_LEGACY_SOUND_DEVICE(GMASTER, gmaster_sound);
38class gmaster_sound_device : public device_t,
39                                  public device_sound_interface
40{
41public:
42   gmaster_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
43   ~gmaster_sound_device() { global_free(m_token); }
3944
45   // access to legacy token
46   void *token() const { assert(m_token != NULL); return m_token; }
47protected:
48   // device-level overrides
49   virtual void device_config_complete();
50   virtual void device_start();
51
52   // sound stream update overrides
53   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
54private:
55   // internal state
56   void *m_token;
57};
58
59extern const device_type GMASTER;
60
61
4062int gmaster_io_callback(device_t *device, int ioline, int state);
4163
4264#endif /* __GMASTER_H__ */
trunk/src/mess/includes/special.h
r17612r17613
115115
116116/*----------- defined in audio/special.c -----------*/
117117
118DECLARE_LEGACY_SOUND_DEVICE(SPECIMX, specimx_sound);
118class specimx_sound_device : public device_t,
119                                  public device_sound_interface
120{
121public:
122   specimx_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
123   ~specimx_sound_device() { global_free(m_token); }
119124
125   // access to legacy token
126   void *token() const { assert(m_token != NULL); return m_token; }
127protected:
128   // device-level overrides
129   virtual void device_config_complete();
130   virtual void device_start();
131
132   // sound stream update overrides
133   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
134private:
135   // internal state
136   void *m_token;
137};
138
139extern const device_type SPECIMX;
140
141
120142void specimx_set_input(device_t *device, int index, int state);
121143
122144#endif /* SPECIAL_H_ */
trunk/src/mess/includes/odyssey2.h
r17612r17613
127127void odyssey2_ef9341_w( running_machine &machine, int command, int b, UINT8 data );
128128UINT8 odyssey2_ef9341_r( running_machine &machine, int command, int b );
129129
130DECLARE_LEGACY_SOUND_DEVICE(ODYSSEY2, odyssey2_sound);
130class odyssey2_sound_device : public device_t,
131                                  public device_sound_interface
132{
133public:
134   odyssey2_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
135protected:
136   // device-level overrides
137   virtual void device_config_complete();
138   virtual void device_start();
131139
140   // sound stream update overrides
141   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
142private:
143   // internal state
144};
145
146extern const device_type ODYSSEY2;
147
148
132149/*----------- defined in machine/odyssey2.c -----------*/
133150
134151MACHINE_RESET( odyssey2 );
trunk/src/mess/includes/svision.h
r17612r17613
5959
6060/*----------- defined in audio/svision.c -----------*/
6161
62DECLARE_LEGACY_SOUND_DEVICE(SVISION, svision_sound);
62class svision_sound_device : public device_t,
63                                  public device_sound_interface
64{
65public:
66   svision_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
67   ~svision_sound_device() { global_free(m_token); }
6368
69   // access to legacy token
70   void *token() const { assert(m_token != NULL); return m_token; }
71protected:
72   // device-level overrides
73   virtual void device_config_complete();
74   virtual void device_start();
75
76   // sound stream update overrides
77   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
78private:
79   // internal state
80   void *m_token;
81};
82
83extern const device_type SVISION;
84
85
6486int *svision_dma_finished(device_t *device);
6587void svision_sound_decrement(device_t *device);
6688void svision_soundport_w(device_t *device, int which, int offset, int data);
trunk/src/mess/includes/vc4000.h
r17612r17613
106106
107107/*----------- defined in audio/vc4000.c -----------*/
108108
109DECLARE_LEGACY_SOUND_DEVICE(VC4000, vc4000_sound);
109class vc4000_sound_device : public device_t,
110                                  public device_sound_interface
111{
112public:
113   vc4000_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
114   ~vc4000_sound_device() { global_free(m_token); }
115
116   // access to legacy token
117   void *token() const { assert(m_token != NULL); return m_token; }
118protected:
119   // device-level overrides
120   virtual void device_config_complete();
121   virtual void device_start();
122
123   // sound stream update overrides
124   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
125private:
126   // internal state
127   void *m_token;
128};
129
130extern const device_type VC4000;
131
110132void vc4000_soundport_w (device_t *device, int mode, int data);
111133
112134
trunk/src/mess/video/911_vdt.c
r17612r17613
239239   assert(device != NULL);
240240   assert(device->type() == VDT911);
241241
242   return (vdt_t *)downcast<legacy_device_base *>(device)->token();
242   return (vdt_t *)downcast<vdt911_device *>(device)->token();
243243}
244244
245245/*
r17612r17613
287287   }
288288}
289289
290DEFINE_LEGACY_DEVICE(VDT911, vdt911);
290const device_type VDT911 = &device_creator<vdt911_device>;
291291
292vdt911_device::vdt911_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
293   : device_t(mconfig, VDT911, "911 VDT", tag, owner, clock)
294{
295   m_token = global_alloc_array_clear(UINT8, sizeof(vdt_t));
296}
297
298//-------------------------------------------------
299//  device_config_complete - perform any
300//  operations now that the configuration is
301//  complete
302//-------------------------------------------------
303
304void vdt911_device::device_config_complete()
305{
306}
307
308//-------------------------------------------------
309//  device_start - device-specific startup
310//-------------------------------------------------
311
312void vdt911_device::device_start()
313{
314   DEVICE_START_NAME( vdt911 )(this);
315}
316
317
318
292319/*
293320    timer callback to toggle blink state
294321*/
trunk/src/mess/video/911_vdt.h
r17612r17613
4343PALETTE_INIT( vdt911 );
4444
4545void vdt911_init(running_machine &machine);
46DECLARE_LEGACY_DEVICE(VDT911, vdt911);
46class vdt911_device : public device_t
47{
48public:
49   vdt911_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
50   ~vdt911_device() { global_free(m_token); }
4751
52   // access to legacy token
53   void *token() const { assert(m_token != NULL); return m_token; }
54protected:
55   // device-level overrides
56   virtual void device_config_complete();
57   virtual void device_start();
58private:
59   // internal state
60   void *m_token;
61};
62
63extern const device_type VDT911;
64
65
4866#define MCFG_VDT911_VIDEO_ADD(_tag, _intf) \
4967   MCFG_DEVICE_ADD(_tag, VDT911, 0) \
5068   MCFG_DEVICE_CONFIG(_intf)
trunk/src/mess/video/saa505x.c
r17612r17613
33943394   assert(device != NULL);
33953395   assert(device->type() == SAA505X);
33963396
3397   return (teletext_t *)downcast<legacy_device_base *>(device)->token();
3397   return (teletext_t *)downcast<saa505x_device *>(device)->token();
33983398}
33993399
34003400static DEVICE_START( saa505x )
r17612r17613
34253425   }
34263426}
34273427
3428DEFINE_LEGACY_DEVICE(SAA505X, saa505x);
3428const device_type SAA505X = &device_creator<saa505x_device>;
34293429
3430saa505x_device::saa505x_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
3431   : device_t(mconfig, SAA505X, "SAA505x Video", tag, owner, clock)
3432{
3433   m_token = global_alloc_array_clear(UINT8, sizeof(teletext_t));
3434}
3435
3436//-------------------------------------------------
3437//  device_config_complete - perform any
3438//  operations now that the configuration is
3439//  complete
3440//-------------------------------------------------
3441
3442void saa505x_device::device_config_complete()
3443{
3444}
3445
3446//-------------------------------------------------
3447//  device_start - device-specific startup
3448//-------------------------------------------------
3449
3450void saa505x_device::device_start()
3451{
3452   DEVICE_START_NAME( saa505x )(this);
3453}
3454
3455
3456
34303457void teletext_data_w(device_t *device, int offset, int data)
34313458{
34323459   teletext_t *tt = get_safe_token(device);
trunk/src/mess/video/saa505x.h
r17612r17613
2020void teletext_data_w(device_t *device, int offset, int data);
2121void teletext_F1(device_t *device);
2222
23DECLARE_LEGACY_DEVICE(SAA505X, saa505x);
23class saa505x_device : public device_t
24{
25public:
26   saa505x_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
27   ~saa505x_device() { global_free(m_token); }
2428
29   // access to legacy token
30   void *token() const { assert(m_token != NULL); return m_token; }
31protected:
32   // device-level overrides
33   virtual void device_config_complete();
34   virtual void device_start();
35private:
36   // internal state
37   void *m_token;
38};
39
40extern const device_type SAA505X;
41
42
2543#define MCFG_SAA505X_VIDEO_ADD(_tag, _intf) \
2644   MCFG_DEVICE_ADD(_tag, SAA505X, 0) \
2745   MCFG_DEVICE_CONFIG(_intf)
trunk/src/mess/video/apollo.c
r17612r17613
113113INLINE screen_data_t *get_safe_token(device_t *device) {
114114   assert(device != NULL);
115115   assert(device->type() == APOLLO_MONO15I || device->type() == APOLLO_MONO19I );
116   return (screen_data_t *)downcast<legacy_device_base *>(device)->token();
116   return (screen_data_t *)downcast<apollo_mono15i_device *>(device)->token();
117117}
118118
119119/***************************************************************************
r17612r17613
876876   }
877877}
878878
879DEFINE_LEGACY_DEVICE(APOLLO_MONO19I, apollo_mono19i);
880DEFINE_LEGACY_DEVICE(APOLLO_MONO15I, apollo_mono15i);
879apollo_mono_device::apollo_mono_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
880   : device_t(mconfig, type, name, tag, owner, clock)
881{
882   m_token = global_alloc_array_clear(UINT8, sizeof(screen_data_t));
883}
884
885const device_type APOLLO_MONO19I = &device_creator<apollo_mono19i_device>;
886
887apollo_mono19i_device::apollo_mono19i_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
888   : apollo_mono_device(mconfig, APOLLO_MONO19I, "Apollo 19\" Monochrome Screen", tag, owner, clock)
889{   
890}
891
892//-------------------------------------------------
893//  device_config_complete - perform any
894//  operations now that the configuration is
895//  complete
896//-------------------------------------------------
897
898void apollo_mono19i_device::device_config_complete()
899{
900}
901
902//-------------------------------------------------
903//  device_start - device-specific startup
904//-------------------------------------------------
905
906void apollo_mono19i_device::device_start()
907{
908   DEVICE_START_NAME( apollo_mono19i )(this);
909}
910
911//-------------------------------------------------
912//  device_reset - device-specific reset
913//-------------------------------------------------
914
915void apollo_mono19i_device::device_reset()
916{
917   DEVICE_RESET_NAME( apollo_mono19i )(this);
918}
919
920
921const device_type APOLLO_MONO15I = &device_creator<apollo_mono15i_device>;
922
923apollo_mono15i_device::apollo_mono15i_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
924   : apollo_mono_device(mconfig, APOLLO_MONO15I, "Apollo 15\" Monochrome Screen", tag, owner, clock)
925{
926}
927
928//-------------------------------------------------
929//  device_config_complete - perform any
930//  operations now that the configuration is
931//  complete
932//-------------------------------------------------
933
934void apollo_mono15i_device::device_config_complete()
935{
936}
937
938//-------------------------------------------------
939//  device_start - device-specific startup
940//-------------------------------------------------
941
942void apollo_mono15i_device::device_start()
943{
944   DEVICE_START_NAME( apollo_mono15i )(this);
945}
946
947//-------------------------------------------------
948//  device_reset - device-specific reset
949//-------------------------------------------------
950
951void apollo_mono15i_device::device_reset()
952{
953   DEVICE_RESET_NAME( apollo_mono15i )(this);
954}
955
956
trunk/src/mess/video/vic4567.c
r17612r17613
229229   assert(device != NULL);
230230   assert(device->type() == VIC3);
231231
232   return (vic3_state *)downcast<legacy_device_base *>(device)->token();
232   return (vic3_state *)downcast<vic3_device *>(device)->token();
233233}
234234
235235INLINE const vic3_interface *get_interface( device_t *device )
r17612r17613
21682168 }
21692169}
21702170
2171DEFINE_LEGACY_DEVICE(VIC3, vic3);
2171const device_type VIC3 = &device_creator<vic3_device>;
2172
2173vic3_device::vic3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
2174   : device_t(mconfig, VIC3, "4567 VIC III", tag, owner, clock)
2175{
2176   m_token = global_alloc_array_clear(UINT8, sizeof(vic3_state));
2177}
2178
2179//-------------------------------------------------
2180//  device_config_complete - perform any
2181//  operations now that the configuration is
2182//  complete
2183//-------------------------------------------------
2184
2185void vic3_device::device_config_complete()
2186{
2187}
2188
2189//-------------------------------------------------
2190//  device_start - device-specific startup
2191//-------------------------------------------------
2192
2193void vic3_device::device_start()
2194{
2195   DEVICE_START_NAME( vic3 )(this);
2196}
2197
2198//-------------------------------------------------
2199//  device_reset - device-specific reset
2200//-------------------------------------------------
2201
2202void vic3_device::device_reset()
2203{
2204   DEVICE_RESET_NAME( vic3 )(this);
2205}
2206
2207
trunk/src/mess/video/vic4567.h
r17612r17613
137137    DEVICE CONFIGURATION MACROS
138138***************************************************************************/
139139
140DECLARE_LEGACY_DEVICE(VIC3, vic3);
140class vic3_device : public device_t
141{
142public:
143   vic3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
144   ~vic3_device() { global_free(m_token); }
141145
146   // access to legacy token
147   void *token() const { assert(m_token != NULL); return m_token; }
148protected:
149   // device-level overrides
150   virtual void device_config_complete();
151   virtual void device_start();
152   virtual void device_reset();
153private:
154   // internal state
155   void *m_token;
156};
157
158extern const device_type VIC3;
159
160
142161#define MCFG_VIC3_ADD(_tag, _interface) \
143162   MCFG_DEVICE_ADD(_tag, VIC3, 0) \
144163   MCFG_DEVICE_CONFIG(_interface)
trunk/src/mess/video/vtvideo.c
r17612r17613
5858   assert(device != NULL);
5959   assert(device->type() == VT100_VIDEO);
6060
61   return (vt_video_t *)downcast<legacy_device_base *>(device)->token();
61   return (vt_video_t *)downcast<vt100_video_device *>(device)->token();
6262}
6363
6464INLINE const vt_video_interface *get_interface(device_t *device)
r17612r17613
473473   }
474474}
475475
476DEFINE_LEGACY_DEVICE(VT100_VIDEO, vt100_video);
476const device_type VT100_VIDEO = &device_creator<vt100_video_device>;
477
478vt100_video_device::vt100_video_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
479   : device_t(mconfig, VT100_VIDEO, "VT100 Video", tag, owner, clock)
480{
481   m_token = global_alloc_array_clear(UINT8, sizeof(vt_video_t));
482}
483
484//-------------------------------------------------
485//  device_config_complete - perform any
486//  operations now that the configuration is
487//  complete
488//-------------------------------------------------
489
490void vt100_video_device::device_config_complete()
491{
492}
493
494//-------------------------------------------------
495//  device_start - device-specific startup
496//-------------------------------------------------
497
498void vt100_video_device::device_start()
499{
500   DEVICE_START_NAME( vt_video )(this);
501}
502
503//-------------------------------------------------
504//  device_reset - device-specific reset
505//-------------------------------------------------
506
507void vt100_video_device::device_reset()
508{
509   DEVICE_RESET_NAME( vt_video )(this);
510}
511
512
trunk/src/mess/video/vtvideo.h
r17612r17613
2020    MACROS / CONSTANTS
2121***************************************************************************/
2222
23DECLARE_LEGACY_DEVICE(VT100_VIDEO, vt100_video);
23class vt100_video_device : public device_t
24{
25public:
26   vt100_video_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
27   ~vt100_video_device() { global_free(m_token); }
2428
29   // access to legacy token
30   void *token() const { assert(m_token != NULL); return m_token; }
31protected:
32   // device-level overrides
33   virtual void device_config_complete();
34   virtual void device_start();
35   virtual void device_reset();
36private:
37   // internal state
38   void *m_token;
39};
40
41extern const device_type VT100_VIDEO;
42
43
2544#define MCFG_VT100_VIDEO_ADD(_tag, _intrf) \
2645   MCFG_DEVICE_ADD(_tag, VT100_VIDEO, 0) \
2746   MCFG_DEVICE_CONFIG(_intrf)
trunk/src/mess/video/vdc8563.c
r17612r17613
162162   assert(device != NULL);
163163   assert(device->type() == VDC8563);
164164
165   return (vdc8563_state *)downcast<legacy_device_base *>(device)->token();
165   return (vdc8563_state *)downcast<vdc8563_device *>(device)->token();
166166}
167167
168168INLINE const vdc8563_interface *get_interface( device_t *device )
r17612r17613
676676 }
677677}
678678
679DEFINE_LEGACY_DEVICE(VDC8563, vdc8563);
679const device_type VDC8563 = &device_creator<vdc8563_device>;
680
681vdc8563_device::vdc8563_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
682   : device_t(mconfig, VDC8563, "8563 / 8568 VDC", tag, owner, clock)
683{
684   m_token = global_alloc_array_clear(UINT8, sizeof(vdc8563_state));
685}
686
687//-------------------------------------------------
688//  device_config_complete - perform any
689//  operations now that the configuration is
690//  complete
691//-------------------------------------------------
692
693void vdc8563_device::device_config_complete()
694{
695}
696
697//-------------------------------------------------
698//  device_start - device-specific startup
699//-------------------------------------------------
700
701void vdc8563_device::device_start()
702{
703   DEVICE_START_NAME( vdc8563 )(this);
704}
705
706//-------------------------------------------------
707//  device_reset - device-specific reset
708//-------------------------------------------------
709
710void vdc8563_device::device_reset()
711{
712   DEVICE_RESET_NAME( vdc8563 )(this);
713}
714
715
trunk/src/mess/video/vdc8563.h
r17612r17613
2929    DEVICE CONFIGURATION MACROS
3030***************************************************************************/
3131
32DECLARE_LEGACY_DEVICE(VDC8563, vdc8563);
32class vdc8563_device : public device_t
33{
34public:
35   vdc8563_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
36   ~vdc8563_device() { global_free(m_token); }
3337
38   // access to legacy token
39   void *token() const { assert(m_token != NULL); return m_token; }
40protected:
41   // device-level overrides
42   virtual void device_config_complete();
43   virtual void device_start();
44   virtual void device_reset();
45private:
46   // internal state
47   void *m_token;
48};
49
50extern const device_type VDC8563;
51
52
3453#define MCFG_VDC8563_ADD(_tag, _interface) \
3554   MCFG_DEVICE_ADD(_tag, VDC8563, 0) \
3655   MCFG_DEVICE_CONFIG(_interface)
trunk/src/mess/video/vic6567.c
r17612r17613
269269   assert(device != NULL);
270270   assert(device->type() == VIC2);
271271
272   return (vic2_state *)downcast<legacy_device_base *>(device)->token();
272   return (vic2_state *)downcast<vic2_device *>(device)->token();
273273}
274274
275275INLINE const vic2_interface *get_interface( device_t *device )
r17612r17613
28182818 }
28192819}
28202820
2821DEFINE_LEGACY_DEVICE(VIC2, vic2);
2821const device_type VIC2 = &device_creator<vic2_device>;
2822
2823vic2_device::vic2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
2824   : device_t(mconfig, VIC2, "6567 / 6569 VIC II", tag, owner, clock)
2825{
2826   m_token = global_alloc_array_clear(UINT8, sizeof(vic2_state));
2827}
2828
2829//-------------------------------------------------
2830//  device_config_complete - perform any
2831//  operations now that the configuration is
2832//  complete
2833//-------------------------------------------------
2834
2835void vic2_device::device_config_complete()
2836{
2837}
2838
2839//-------------------------------------------------
2840//  device_start - device-specific startup
2841//-------------------------------------------------
2842
2843void vic2_device::device_start()
2844{
2845   DEVICE_START_NAME( vic2 )(this);
2846}
2847
2848//-------------------------------------------------
2849//  device_reset - device-specific reset
2850//-------------------------------------------------
2851
2852void vic2_device::device_reset()
2853{
2854   DEVICE_RESET_NAME( vic2 )(this);
2855}
2856
2857
trunk/src/mess/video/vic6567.h
r17612r17613
136136    DEVICE CONFIGURATION MACROS
137137***************************************************************************/
138138
139DECLARE_LEGACY_DEVICE(VIC2, vic2);
139class vic2_device : public device_t
140{
141public:
142   vic2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
143   ~vic2_device() { global_free(m_token); }
140144
145   // access to legacy token
146   void *token() const { assert(m_token != NULL); return m_token; }
147protected:
148   // device-level overrides
149   virtual void device_config_complete();
150   virtual void device_start();
151   virtual void device_reset();
152private:
153   // internal state
154   void *m_token;
155};
156
157extern const device_type VIC2;
158
159
141160#define MCFG_VIC2_ADD(_tag, _interface) \
142161   MCFG_DEVICE_ADD(_tag, VIC2, 0) \
143162   MCFG_DEVICE_CONFIG(_interface)
trunk/src/mess/video/odyssey2.c
r17612r17613
824824}
825825#endif
826826
827DEFINE_LEGACY_SOUND_DEVICE(ODYSSEY2, odyssey2_sound);
827const device_type ODYSSEY2 = &device_creator<odyssey2_sound_device>;
828
829odyssey2_sound_device::odyssey2_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
830   : device_t(mconfig, ODYSSEY2, "P8244/P8245", tag, owner, clock),
831     device_sound_interface(mconfig, *this)
832{
833}
834
835//-------------------------------------------------
836//  device_config_complete - perform any
837//  operations now that the configuration is
838//  complete
839//-------------------------------------------------
840
841void odyssey2_sound_device::device_config_complete()
842{
843}
844
845//-------------------------------------------------
846//  device_start - device-specific startup
847//-------------------------------------------------
848
849void odyssey2_sound_device::device_start()
850{
851   DEVICE_START_NAME( odyssey2_sound )(this);
852}
853
854//-------------------------------------------------
855//  sound_stream_update - handle a stream update
856//-------------------------------------------------
857
858void odyssey2_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
859{
860   // should never get here
861   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
862}
863
864
trunk/src/mess/video/crt.c
r17612r17613
6464   assert(device != NULL);
6565   assert(device->type() == CRT);
6666
67   return (crt_t *)downcast<legacy_device_base *>(device)->token();
67   return (crt_t *)downcast<crt_device *>(device)->token();
6868}
6969
7070static DEVICE_START( crt )
r17612r17613
118118   }
119119}
120120
121DEFINE_LEGACY_DEVICE(CRT, crt);
121const device_type CRT = &device_creator<crt_device>;
122122
123crt_device::crt_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
124   : device_t(mconfig, CRT, "CRT Video", tag, owner, clock)
125{
126   m_token = global_alloc_array_clear(UINT8, sizeof(crt_t));
127}
128
129//-------------------------------------------------
130//  device_config_complete - perform any
131//  operations now that the configuration is
132//  complete
133//-------------------------------------------------
134
135void crt_device::device_config_complete()
136{
137}
138
139//-------------------------------------------------
140//  device_start - device-specific startup
141//-------------------------------------------------
142
143void crt_device::device_start()
144{
145   DEVICE_START_NAME( crt )(this);
146}
147
148
149
123150/*
124151    crt_plot
125152
trunk/src/mess/video/crt.h
r17612r17613
2424void crt_eof(device_t *device);
2525void crt_update(device_t *device, bitmap_ind16 &bitmap);
2626
27DECLARE_LEGACY_DEVICE(CRT, crt);
27class crt_device : public device_t
28{
29public:
30   crt_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
31   ~crt_device() { global_free(m_token); }
2832
33   // access to legacy token
34   void *token() const { assert(m_token != NULL); return m_token; }
35protected:
36   // device-level overrides
37   virtual void device_config_complete();
38   virtual void device_start();
39private:
40   // internal state
41   void *m_token;
42};
43
44extern const device_type CRT;
45
46
2947#define MCFG_CRT_ADD(_tag, _interface) \
3048   MCFG_DEVICE_ADD(_tag, CRT, 0) \
3149   MCFG_DEVICE_CONFIG(_interface)
trunk/src/mess/video/dl1416.c
r17612r17613
116116   assert(device != NULL);
117117   assert(device->type() == DL1416B || device->type() == DL1416T);
118118
119   return (dl1416_state *)downcast<legacy_device_base *>(device)->token();
119   return (dl1416_state *)downcast<dl1416_device *>(device)->token();
120120}
121121
122122
r17612r17613
335335   }
336336}
337337
338DEFINE_LEGACY_DEVICE(DL1416B, dl1416b);
339DEFINE_LEGACY_DEVICE(DL1416T, dl1416t);
338dl1416_device::dl1416_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
339   : device_t(mconfig, type, name, tag, owner, clock)
340{
341   m_token = global_alloc_array_clear(UINT8, sizeof(dl1416_state));
342}
343
344//-------------------------------------------------
345//  device_config_complete - perform any
346//  operations now that the configuration is
347//  complete
348//-------------------------------------------------
349
350void dl1416_device::device_config_complete()
351{
352}
353
354//-------------------------------------------------
355//  device_start - device-specific startup
356//-------------------------------------------------
357
358void dl1416_device::device_start()
359{
360   DEVICE_START_NAME( dl1416 )(this);
361}
362
363//-------------------------------------------------
364//  device_reset - device-specific reset
365//-------------------------------------------------
366
367void dl1416_device::device_reset()
368{
369   DEVICE_RESET_NAME( dl1416 )(this);
370}
371
372
373const device_type DL1416B = &device_creator<dl1416b_device>;
374
375dl1416b_device::dl1416b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
376   : dl1416_device(mconfig, DL1416B, "DL1416B", tag, owner, clock)
377{
378}
379
380
381const device_type DL1416T = &device_creator<dl1416t_device>;
382
383dl1416t_device::dl1416t_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
384   : dl1416_device(mconfig, DL1416T, "DL1416T", tag, owner, clock)
385{
386}
387
388
trunk/src/mess/video/dl1416.h
r17612r17613
5353WRITE8_DEVICE_HANDLER( dl1416_data_w );
5454
5555/* device get info callback */
56DECLARE_LEGACY_DEVICE(DL1416B, dl1416b);
57DECLARE_LEGACY_DEVICE(DL1416T, dl1416t);
56class dl1416_device : public device_t
57{
58public:
59   dl1416_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
60   ~dl1416_device() { global_free(m_token); }
5861
62   // access to legacy token
63   void *token() const { assert(m_token != NULL); return m_token; }
64protected:
65   // device-level overrides
66   virtual void device_config_complete();
67   virtual void device_start();
68   virtual void device_reset();
69private:
70   // internal state
71   void *m_token;
72};
73
74class dl1416b_device : public dl1416_device
75{
76public:
77   dl1416b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
78};
79
80extern const device_type DL1416B;
81
82class dl1416t_device : public dl1416_device
83{
84public:
85   dl1416t_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
86};
87
88extern const device_type DL1416T;
89
90
5991#endif /* DL1416_H_ */
trunk/src/mess/video/733_asr.c
r17612r17613
167167   assert(device != NULL);
168168   assert(device->type() == ASR733);
169169
170   return (asr_t *)downcast<legacy_device_base *>(device)->token();
170   return (asr_t *)downcast<asr733_device *>(device)->token();
171171}
172172
173173static DEVICE_START( asr733 )
r17612r17613
236236   }
237237}
238238
239DEFINE_LEGACY_DEVICE(ASR733, asr733);
239const device_type ASR733 = &device_creator<asr733_device>;
240240
241asr733_device::asr733_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
242   : device_t(mconfig, ASR733, "733 ASR", tag, owner, clock)
243{
244   m_token = global_alloc_array_clear(UINT8, sizeof(asr_t));
245}
246
247//-------------------------------------------------
248//  device_config_complete - perform any
249//  operations now that the configuration is
250//  complete
251//-------------------------------------------------
252
253void asr733_device::device_config_complete()
254{
255}
256
257//-------------------------------------------------
258//  device_start - device-specific startup
259//-------------------------------------------------
260
261void asr733_device::device_start()
262{
263   DEVICE_START_NAME( asr733 )(this);
264}
265
266//-------------------------------------------------
267//  device_reset - device-specific reset
268//-------------------------------------------------
269
270void asr733_device::device_reset()
271{
272   DEVICE_RESET_NAME( asr733 )(this);
273}
274
275
276
241277/* write a single char on screen */
242278static void asr_draw_char(device_t *device, int character, int x, int y, int color)
243279{
trunk/src/mess/video/733_asr.h
r17612r17613
1919PALETTE_INIT( asr733 );
2020
2121void asr733_init(running_machine &machine);
22DECLARE_LEGACY_DEVICE(ASR733, asr733);
22class asr733_device : public device_t
23{
24public:
25   asr733_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
26   ~asr733_device() { global_free(m_token); }
2327
28   // access to legacy token
29   void *token() const { assert(m_token != NULL); return m_token; }
30protected:
31   // device-level overrides
32   virtual void device_config_complete();
33   virtual void device_start();
34   virtual void device_reset();
35private:
36   // internal state
37   void *m_token;
38};
39
40extern const device_type ASR733;
41
42
2443#define MCFG_ASR733_VIDEO_ADD(_tag, _intf) \
2544   MCFG_DEVICE_ADD(_tag, ASR733, 0) \
2645   MCFG_DEVICE_CONFIG(_intf)
trunk/src/mess/video/k1ge.c
r17612r17613
6363   assert( device != NULL );
6464   assert( device->type() == K1GE || device->type() == K2GE );
6565
66   return ( k1ge_t *) downcast<legacy_device_base *>(device)->token();
66   return ( k1ge_t *) downcast<k1ge_device *>(device)->token();
6767}
6868
6969
r17612r17613
923923   }
924924}
925925
926DEFINE_LEGACY_DEVICE(K1GE, k1ge);
927DEFINE_LEGACY_DEVICE(K2GE, k2ge);
926const device_type K1GE = &device_creator<k1ge_device>;
927
928k1ge_device::k1ge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
929   : device_t(mconfig, K1GE, "", tag, owner, clock)
930{
931   m_token = global_alloc_array_clear(UINT8, sizeof( k1ge_t ));
932}
933
934k1ge_device::k1ge_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
935   : device_t(mconfig, type, name, tag, owner, clock)
936{
937   m_token = global_alloc_array_clear(UINT8, sizeof( k1ge_t ));
938}
939
940//-------------------------------------------------
941//  device_config_complete - perform any
942//  operations now that the configuration is
943//  complete
944//-------------------------------------------------
945
946void k1ge_device::device_config_complete()
947{
948}
949
950//-------------------------------------------------
951//  device_start - device-specific startup
952//-------------------------------------------------
953
954void k1ge_device::device_start()
955{
956   DEVICE_START_NAME( k1ge )(this);
957}
958
959//-------------------------------------------------
960//  device_reset - device-specific reset
961//-------------------------------------------------
962
963void k1ge_device::device_reset()
964{
965   DEVICE_RESET_NAME( k1ge )(this);
966}
967
968
969const device_type K2GE = &device_creator<k2ge_device>;
970
971k2ge_device::k2ge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
972   : k1ge_device(mconfig, K2GE, "", tag, owner, clock)
973{
974}
975
976//-------------------------------------------------
977//  device_start - device-specific startup
978//-------------------------------------------------
979
980void k2ge_device::device_start()
981{
982   DEVICE_START_NAME( k2ge )(this);
983}
984
985
trunk/src/mess/video/k1ge.h
r17612r17613
88#define K1GE_SCREEN_HEIGHT   199
99
1010
11DECLARE_LEGACY_DEVICE(K1GE, k1ge);
12DECLARE_LEGACY_DEVICE(K2GE, k2ge);
11class k1ge_device : public device_t
12{
13public:
14   k1ge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
15   k1ge_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
16   ~k1ge_device() { global_free(m_token); }
1317
18   // access to legacy token
19   void *token() const { assert(m_token != NULL); return m_token; }
20protected:
21   // device-level overrides
22   virtual void device_config_complete();
23   virtual void device_start();
24   virtual void device_reset();
25private:
26   // internal state
27   void *m_token;
28};
1429
30extern const device_type K1GE;
31
32class k2ge_device : public k1ge_device
33{
34public:
35   k2ge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
36protected:
37   // device-level overrides
38   virtual void device_start();
39};
40
41extern const device_type K2GE;
42
43
44
1545#define MCFG_K1GE_ADD(_tag, _clock, _config ) \
1646   MCFG_DEVICE_ADD( _tag, K1GE, _clock ) \
1747   MCFG_DEVICE_CONFIG( _config )
trunk/src/mess/drivers/pv1000.c
r17612r17613
99#include "imagedev/cartslot.h"
1010
1111
12DECLARE_LEGACY_SOUND_DEVICE(PV1000,pv1000_sound);
13DEFINE_LEGACY_SOUND_DEVICE(PV1000,pv1000_sound);
12class pv1000_sound_device : public device_t,
13                                  public device_sound_interface
14{
15public:
16   pv1000_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
17protected:
18   // device-level overrides   
19   virtual void device_config_complete();
20   virtual void device_start();
1421
22   // sound stream update overrides
23   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
24private:
25   // internal state
26};
1527
28extern const device_type PV1000;
29
30const device_type PV1000 = &device_creator<pv1000_sound_device>;
31
32pv1000_sound_device::pv1000_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
33   : device_t(mconfig, PV1000, "NEC D65010G031", tag, owner, clock),
34     device_sound_interface(mconfig, *this)
35{
36}
37
38//-------------------------------------------------
39//  device_config_complete - perform any
40//  operations now that the configuration is
41//  complete
42//-------------------------------------------------
43
44void pv1000_sound_device::device_config_complete()
45{
46}
47
48//-------------------------------------------------
49//  device_start - device-specific startup
50//-------------------------------------------------
51static DEVICE_START( pv1000_sound );
52void pv1000_sound_device::device_start()
53{
54   DEVICE_START_NAME( pv1000_sound )(this);
55}
56
57//-------------------------------------------------
58//  sound_stream_update - handle a stream update
59//-------------------------------------------------
60
61void pv1000_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
62{
63   // should never get here
64   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
65}
66
67
68
69
1670class pv1000_state : public driver_device
1771{
1872public:

Previous 199869 Revisions Next


© 1997-2024 The MAME Team