summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatarGravatar Miodrag Milanovic <mmicko@gmail.com>2012-09-03 13:56:17 +0000
committerGravatarGravatar Miodrag Milanovic <mmicko@gmail.com>2012-09-03 13:56:17 +0000
commitb711b1a007c3a4a75e78eb88f9a6afe4d4180728 (patch)
tree1498465a0134d7b039fce9271d2b388d218425d4
parentf552908ea962ecdd7e94ea609c84144815b64557 (diff)
downloadmame-b711b1a007c3a4a75e78eb88f9a6afe4d4180728.tar.xz
mame-b711b1a007c3a4a75e78eb88f9a6afe4d4180728.zip
conversion of legacy devices into modern wip (no whatsnew)
-rw-r--r--src/emu/machine/6525tpi.c40
-rw-r--r--src/emu/machine/6525tpi.h21
-rw-r--r--src/emu/machine/68681.c40
-rw-r--r--src/emu/machine/68681.h21
-rw-r--r--src/emu/machine/74148.c40
-rw-r--r--src/emu/machine/74148.h21
-rw-r--r--src/emu/machine/74153.c40
-rw-r--r--src/emu/machine/74153.h21
-rw-r--r--src/emu/machine/adc083x.c72
-rw-r--r--src/emu/machine/adc083x.h49
-rw-r--r--src/emu/machine/adc1038.c40
-rw-r--r--src/emu/machine/adc1038.h21
-rw-r--r--src/emu/machine/adc1213x.c63
-rw-r--r--src/emu/machine/adc1213x.h39
-rw-r--r--src/emu/machine/idectrl.c40
-rw-r--r--src/emu/machine/idectrl.h21
-rw-r--r--src/emu/machine/k053252.c40
-rw-r--r--src/emu/machine/k053252.h21
-rw-r--r--src/emu/machine/latch8.c37
-rw-r--r--src/emu/machine/latch8.h56
-rw-r--r--src/emu/machine/mb14241.c40
-rw-r--r--src/emu/machine/mb14241.h21
-rw-r--r--src/emu/machine/mb87078.c40
-rw-r--r--src/emu/machine/mb87078.h21
-rw-r--r--src/emu/machine/pd4990a.c40
-rw-r--r--src/emu/machine/pd4990a.h21
-rw-r--r--src/emu/machine/pic8259.c40
-rw-r--r--src/emu/machine/pic8259.h21
-rw-r--r--src/emu/machine/pit8253.c63
-rw-r--r--src/emu/machine/pit8253.h34
-rw-r--r--src/emu/machine/rp5h01.c40
-rw-r--r--src/emu/machine/rp5h01.h21
-rw-r--r--src/emu/machine/smc91c9x.c54
-rw-r--r--src/emu/machine/smc91c9x.h36
-rw-r--r--src/emu/machine/tms6100.c63
-rw-r--r--src/emu/machine/tms6100.h34
-rw-r--r--src/emu/machine/upd4701.c40
-rw-r--r--src/emu/machine/upd4701.h21
-rw-r--r--src/emu/machine/wd17xx.c261
-rw-r--r--src/emu/machine/wd17xx.h232
-rw-r--r--src/emu/sound/2151intf.c60
-rw-r--r--src/emu/sound/2151intf.h26
-rw-r--r--src/emu/sound/2203intf.c60
-rw-r--r--src/emu/sound/2203intf.h26
-rw-r--r--src/emu/sound/2413intf.c60
-rw-r--r--src/emu/sound/2413intf.h26
-rw-r--r--src/emu/sound/2608intf.c60
-rw-r--r--src/emu/sound/2608intf.h26
-rw-r--r--src/emu/sound/2610intf.c85
-rw-r--r--src/emu/sound/2610intf.h39
-rw-r--r--src/emu/sound/2612intf.c85
-rw-r--r--src/emu/sound/2612intf.h39
-rw-r--r--src/emu/sound/262intf.c60
-rw-r--r--src/emu/sound/262intf.h26
-rw-r--r--src/emu/sound/3526intf.c60
-rw-r--r--src/emu/sound/3526intf.h26
-rw-r--r--src/emu/sound/3812intf.c60
-rw-r--r--src/emu/sound/3812intf.h26
-rw-r--r--src/emu/sound/8950intf.c60
-rw-r--r--src/emu/sound/8950intf.h26
-rw-r--r--src/emu/sound/aica.c51
-rw-r--r--src/emu/sound/aica.h25
-rw-r--r--src/emu/sound/astrocde.c51
-rw-r--r--src/emu/sound/astrocde.h25
-rw-r--r--src/emu/sound/ay8910.c244
-rw-r--r--src/emu/sound/ay8910.h127
-rw-r--r--src/emu/sound/beep.c42
-rw-r--r--src/emu/sound/beep.h24
-rw-r--r--src/emu/sound/c140.c42
-rw-r--r--src/emu/sound/c140.h24
-rw-r--r--src/emu/sound/c6280.c42
-rw-r--r--src/emu/sound/c6280.h24
-rw-r--r--src/emu/sound/cdda.c42
-rw-r--r--src/emu/sound/cdda.h24
-rw-r--r--src/emu/sound/cem3394.c42
-rw-r--r--src/emu/sound/cem3394.h24
-rw-r--r--src/emu/sound/digitalk.c42
-rw-r--r--src/emu/sound/digitalk.h24
-rw-r--r--src/emu/sound/dmadac.c42
-rw-r--r--src/emu/sound/dmadac.h24
-rw-r--r--src/emu/sound/es5506.c118
-rw-r--r--src/emu/sound/es5506.h52
-rw-r--r--src/emu/sound/es8712.c51
-rw-r--r--src/emu/sound/es8712.h25
-rw-r--r--src/emu/sound/flt_rc.c42
-rw-r--r--src/emu/sound/flt_rc.h24
-rw-r--r--src/emu/sound/flt_vol.c42
-rw-r--r--src/emu/sound/flt_vol.h24
-rw-r--r--src/emu/sound/gaelco.c65
-rw-r--r--src/emu/sound/gaelco.h35
-rw-r--r--src/emu/sound/hc55516.c113
-rw-r--r--src/emu/sound/hc55516.h56
-rw-r--r--src/emu/sound/iremga20.c51
-rw-r--r--src/emu/sound/iremga20.h25
-rw-r--r--src/emu/sound/k005289.c42
-rw-r--r--src/emu/sound/k005289.h24
-rw-r--r--src/emu/sound/k007232.c42
-rw-r--r--src/emu/sound/k007232.h24
-rw-r--r--src/emu/sound/k051649.c51
-rw-r--r--src/emu/sound/k051649.h25
-rw-r--r--src/emu/sound/k053260.c51
-rw-r--r--src/emu/sound/k053260.h25
-rw-r--r--src/emu/sound/k056800.c40
-rw-r--r--src/emu/sound/k056800.h21
-rw-r--r--src/emu/sound/mos6560.c51
-rw-r--r--src/emu/sound/mos6560.h25
-rw-r--r--src/emu/sound/msm5205.c76
-rw-r--r--src/emu/sound/msm5205.h38
-rw-r--r--src/emu/sound/msm5232.c60
-rw-r--r--src/emu/sound/msm5232.h26
-rw-r--r--src/emu/sound/multipcm.c42
-rw-r--r--src/emu/sound/multipcm.h24
-rw-r--r--src/emu/sound/n63701x.c42
-rw-r--r--src/emu/sound/n63701x.h24
-rw-r--r--src/emu/sound/namco.c64
-rw-r--r--src/emu/sound/namco.h43
-rw-r--r--src/emu/sound/nes_apu.c42
-rw-r--r--src/emu/sound/nes_apu.h24
-rw-r--r--src/emu/sound/nile.c42
-rw-r--r--src/emu/sound/nile.h24
-rw-r--r--src/emu/sound/okim6258.c51
-rw-r--r--src/emu/sound/okim6258.h25
-rw-r--r--src/emu/sound/okim6376.c51
-rw-r--r--src/emu/sound/okim6376.h25
-rw-r--r--src/emu/sound/qsound.c51
-rw-r--r--src/emu/sound/qsound.h25
-rw-r--r--src/emu/sound/rf5c400.c42
-rw-r--r--src/emu/sound/rf5c400.h24
-rw-r--r--src/emu/sound/rf5c68.c42
-rw-r--r--src/emu/sound/rf5c68.h24
-rw-r--r--src/emu/sound/s14001a.c42
-rw-r--r--src/emu/sound/s14001a.h24
-rw-r--r--src/emu/sound/s2636.c42
-rw-r--r--src/emu/sound/s2636.h24
-rw-r--r--src/emu/sound/saa1099.c42
-rw-r--r--src/emu/sound/saa1099.h24
-rw-r--r--src/emu/sound/scsp.c42
-rw-r--r--src/emu/sound/scsp.h24
-rw-r--r--src/emu/sound/segapcm.c42
-rw-r--r--src/emu/sound/segapcm.h24
-rw-r--r--src/emu/sound/sid6581.c85
-rw-r--r--src/emu/sound/sid6581.h41
-rw-r--r--src/emu/sound/sn76477.c51
-rw-r--r--src/emu/sound/sn76477.h25
-rw-r--r--src/emu/sound/sn76496.c300
-rw-r--r--src/emu/sound/sn76496.h160
-rw-r--r--src/emu/sound/snkwave.c42
-rw-r--r--src/emu/sound/snkwave.h24
-rw-r--r--src/emu/sound/sp0250.c42
-rw-r--r--src/emu/sound/sp0250.h24
-rw-r--r--src/emu/sound/sp0256.c51
-rw-r--r--src/emu/sound/sp0256.h25
-rw-r--r--src/emu/sound/speaker.c42
-rw-r--r--src/emu/sound/speaker.h24
-rw-r--r--src/emu/sound/st0016.c42
-rw-r--r--src/emu/sound/st0016.h24
-rw-r--r--src/emu/sound/t6w28.c42
-rw-r--r--src/emu/sound/t6w28.h24
-rw-r--r--src/emu/sound/tiaintf.c51
-rw-r--r--src/emu/sound/tiaintf.h25
-rw-r--r--src/emu/sound/tms3615.c42
-rw-r--r--src/emu/sound/tms3615.h24
-rw-r--r--src/emu/sound/tms36xx.c42
-rw-r--r--src/emu/sound/tms36xx.h24
-rw-r--r--src/emu/sound/tms5110.c256
-rw-r--r--src/emu/sound/tms5110.h136
-rw-r--r--src/emu/sound/tms5220.c141
-rw-r--r--src/emu/sound/tms5220.h71
-rw-r--r--src/emu/sound/upd7759.c51
-rw-r--r--src/emu/sound/upd7759.h25
-rw-r--r--src/emu/sound/vlm5030.c51
-rw-r--r--src/emu/sound/vlm5030.h25
-rw-r--r--src/emu/sound/vrender0.c42
-rw-r--r--src/emu/sound/vrender0.h24
-rw-r--r--src/emu/sound/wave.c39
-rw-r--r--src/emu/sound/wave.h19
-rw-r--r--src/emu/sound/x1_010.c42
-rw-r--r--src/emu/sound/x1_010.h24
-rw-r--r--src/emu/sound/ymf271.c51
-rw-r--r--src/emu/sound/ymf271.h25
-rw-r--r--src/emu/sound/ymf278b.c51
-rw-r--r--src/emu/sound/ymf278b.h25
-rw-r--r--src/emu/sound/ymz280b.c51
-rw-r--r--src/emu/sound/ymz280b.h25
-rw-r--r--src/emu/sound/zsg2.c42
-rw-r--r--src/emu/sound/zsg2.h24
-rw-r--r--src/emu/video/hd63484.c40
-rw-r--r--src/emu/video/hd63484.h21
-rw-r--r--src/emu/video/i8275.c40
-rw-r--r--src/emu/video/i8275.h21
-rw-r--r--src/emu/video/s2636.c31
-rw-r--r--src/emu/video/s2636.h20
-rw-r--r--src/emu/video/saa5050.c40
-rw-r--r--src/emu/video/saa5050.h21
-rw-r--r--src/emu/video/tlc34076.c40
-rw-r--r--src/emu/video/tlc34076.h21
-rw-r--r--src/emu/video/tms9927.c81
-rw-r--r--src/emu/video/tms9927.h50
-rw-r--r--src/emu/video/voodoo.c109
-rw-r--r--src/emu/video/voodoo.h66
-rw-r--r--src/mame/audio/amiga.c42
-rw-r--r--src/mame/audio/beezer.c51
-rw-r--r--src/mame/audio/cps3.c42
-rw-r--r--src/mame/audio/exidy.c154
-rw-r--r--src/mame/audio/exidy.h64
-rw-r--r--src/mame/audio/exidy440.c76
-rw-r--r--src/mame/audio/flower.c51
-rw-r--r--src/mame/audio/geebee.c42
-rw-r--r--src/mame/audio/gomoku.c42
-rw-r--r--src/mame/audio/gridlee.c42
-rw-r--r--src/mame/audio/hyprolyb.c51
-rw-r--r--src/mame/audio/hyprolyb.h25
-rw-r--r--src/mame/audio/irem.c42
-rw-r--r--src/mame/audio/irem.h24
-rw-r--r--src/mame/audio/leland.c140
-rw-r--r--src/mame/audio/m72.c51
-rw-r--r--src/mame/audio/m72.h25
-rw-r--r--src/mame/audio/micro3d.c53
-rw-r--r--src/mame/audio/namco52.c52
-rw-r--r--src/mame/audio/namco52.h22
-rw-r--r--src/mame/audio/namco54.c52
-rw-r--r--src/mame/audio/namco54.h22
-rw-r--r--src/mame/audio/phoenix.c42
-rw-r--r--src/mame/audio/pleiads.c125
-rw-r--r--src/mame/audio/pleiads.h61
-rw-r--r--src/mame/audio/polepos.c51
-rw-r--r--src/mame/audio/redbaron.c42
-rw-r--r--src/mame/audio/segag80r.c59
-rw-r--r--src/mame/audio/segasnd.c144
-rw-r--r--src/mame/audio/seibu.c46
-rw-r--r--src/mame/audio/seibu.h24
-rw-r--r--src/mame/audio/snes_snd.c51
-rw-r--r--src/mame/audio/snes_snd.h25
-rw-r--r--src/mame/audio/snk6502.c42
-rw-r--r--src/mame/audio/taitosnd.c40
-rw-r--r--src/mame/audio/taitosnd.h21
-rw-r--r--src/mame/audio/tiamc1.c42
-rw-r--r--src/mame/audio/timeplt.c42
-rw-r--r--src/mame/audio/timeplt.h24
-rw-r--r--src/mame/audio/trackfld.c51
-rw-r--r--src/mame/audio/trackfld.h25
-rw-r--r--src/mame/audio/tx1.c100
-rw-r--r--src/mame/audio/warpwarp.c42
-rw-r--r--src/mame/audio/wiping.c42
-rw-r--r--src/mame/audio/wiping.h24
-rw-r--r--src/mame/drivers/mjkjidai.c68
-rw-r--r--src/mame/drivers/ninjaw.c64
-rw-r--r--src/mame/drivers/renegade.c66
-rw-r--r--src/mame/includes/amiga.h24
-rw-r--r--src/mame/includes/beezer.h25
-rw-r--r--src/mame/includes/bzone.h24
-rw-r--r--src/mame/includes/cd32.h22
-rw-r--r--src/mame/includes/cps3.h24
-rw-r--r--src/mame/includes/flower.h25
-rw-r--r--src/mame/includes/gomoku.h24
-rw-r--r--src/mame/includes/gridlee.h24
-rw-r--r--src/mame/includes/leland.h63
-rw-r--r--src/mame/includes/micro3d.h25
-rw-r--r--src/mame/includes/phoenix.h24
-rw-r--r--src/mame/includes/polepos.h25
-rw-r--r--src/mame/includes/snk6502.h24
-rw-r--r--src/mame/includes/tiamc1.h24
-rw-r--r--src/mame/includes/tx1.h50
-rw-r--r--src/mame/includes/warpwarp.h48
-rw-r--r--src/mame/machine/buggychl.c40
-rw-r--r--src/mame/machine/buggychl.h21
-rw-r--r--src/mame/machine/cd32.c49
-rw-r--r--src/mame/machine/decocass.c40
-rw-r--r--src/mame/machine/decocass.h21
-rw-r--r--src/mame/machine/gaelco3d.c51
-rw-r--r--src/mame/machine/gaelco3d.h22
-rw-r--r--src/mame/machine/mathbox.c40
-rw-r--r--src/mame/machine/mathbox.h21
-rw-r--r--src/mame/machine/namco06.c41
-rw-r--r--src/mame/machine/namco06.h21
-rw-r--r--src/mame/machine/namco50.c52
-rw-r--r--src/mame/machine/namco50.h22
-rw-r--r--src/mame/machine/namco51.c61
-rw-r--r--src/mame/machine/namco51.h23
-rw-r--r--src/mame/machine/namco53.c52
-rw-r--r--src/mame/machine/namco53.h22
-rw-r--r--src/mame/machine/namco62.c52
-rw-r--r--src/mame/machine/namco62.h22
-rw-r--r--src/mame/machine/namcoio.c40
-rw-r--r--src/mame/machine/namcoio.h21
-rw-r--r--src/mame/machine/nmk112.c40
-rw-r--r--src/mame/machine/nmk112.h21
-rw-r--r--src/mame/machine/taitoio.c120
-rw-r--r--src/mame/machine/taitoio.h63
-rw-r--r--src/mame/video/atarirle.c31
-rw-r--r--src/mame/video/atarirle.h20
-rw-r--r--src/mame/video/deco16ic.c40
-rw-r--r--src/mame/video/deco16ic.h21
-rw-r--r--src/mame/video/decocomn.c40
-rw-r--r--src/mame/video/decocomn.h21
-rw-r--r--src/mame/video/kan_pand.c40
-rw-r--r--src/mame/video/kan_pand.h21
-rw-r--r--src/mame/video/konicdev.c798
-rw-r--r--src/mame/video/konicdev.h420
-rw-r--r--src/mame/video/taitoic.c373
-rw-r--r--src/mame/video/taitoic.h207
-rw-r--r--src/mame/video/vrender0.c40
-rw-r--r--src/mame/video/vrender0.h21
-rw-r--r--src/mess/audio/channelf.c42
-rw-r--r--src/mess/audio/dave.c51
-rw-r--r--src/mess/audio/dave.h25
-rw-r--r--src/mess/audio/gb.c42
-rw-r--r--src/mess/audio/gb.h24
-rw-r--r--src/mess/audio/gmaster.c42
-rw-r--r--src/mess/audio/lynx.c82
-rw-r--r--src/mess/audio/mac.c42
-rw-r--r--src/mess/audio/mea8000.c40
-rw-r--r--src/mess/audio/mea8000.h21
-rw-r--r--src/mess/audio/socrates.c42
-rw-r--r--src/mess/audio/socrates.h24
-rw-r--r--src/mess/audio/special.c42
-rw-r--r--src/mess/audio/svision.c42
-rw-r--r--src/mess/audio/t6721.c40
-rw-r--r--src/mess/audio/t6721.h21
-rw-r--r--src/mess/audio/upd1771.c60
-rw-r--r--src/mess/audio/upd1771.h26
-rw-r--r--src/mess/audio/vc4000.c42
-rw-r--r--src/mess/audio/wswan.c42
-rw-r--r--src/mess/drivers/pv1000.c58
-rw-r--r--src/mess/includes/apollo.h45
-rw-r--r--src/mess/includes/channelf.h24
-rw-r--r--src/mess/includes/gmaster.h24
-rw-r--r--src/mess/includes/lynx.h42
-rw-r--r--src/mess/includes/mac.h24
-rw-r--r--src/mess/includes/mc68328.h21
-rw-r--r--src/mess/includes/odyssey2.h19
-rw-r--r--src/mess/includes/special.h24
-rw-r--r--src/mess/includes/svision.h24
-rw-r--r--src/mess/includes/vc4000.h24
-rw-r--r--src/mess/includes/wswan.h24
-rw-r--r--src/mess/machine/990_tap.c41
-rw-r--r--src/mess/machine/990_tap.h21
-rw-r--r--src/mess/machine/apollo.c55
-rw-r--r--src/mess/machine/applefdc.c82
-rw-r--r--src/mess/machine/applefdc.h54
-rw-r--r--src/mess/machine/at45dbxx.c81
-rw-r--r--src/mess/machine/at45dbxx.h46
-rw-r--r--src/mess/machine/ataridev.h22
-rw-r--r--src/mess/machine/atarifdc.c50
-rw-r--r--src/mess/machine/ay31015.c40
-rw-r--r--src/mess/machine/ay31015.h21
-rw-r--r--src/mess/machine/beta.c61
-rw-r--r--src/mess/machine/beta.h23
-rw-r--r--src/mess/machine/ds1315.c31
-rw-r--r--src/mess/machine/ds1315.h20
-rw-r--r--src/mess/machine/e05a03.c40
-rw-r--r--src/mess/machine/e05a03.h21
-rw-r--r--src/mess/machine/er59256.c40
-rw-r--r--src/mess/machine/er59256.h21
-rw-r--r--src/mess/machine/hd63450.c31
-rw-r--r--src/mess/machine/hd63450.h20
-rw-r--r--src/mess/machine/i8271.c40
-rw-r--r--src/mess/machine/i8271.h21
-rw-r--r--src/mess/machine/kr2376.c31
-rw-r--r--src/mess/machine/kr2376.h20
-rw-r--r--src/mess/machine/mc68328.c38
-rw-r--r--src/mess/machine/mc68328.h2
-rw-r--r--src/mess/machine/mc6843.c40
-rw-r--r--src/mess/machine/mc6843.h21
-rw-r--r--src/mess/machine/mc6846.c40
-rw-r--r--src/mess/machine/mc6846.h21
-rw-r--r--src/mess/machine/mc6854.c40
-rw-r--r--src/mess/machine/mc6854.h21
-rw-r--r--src/mess/machine/micropolis.c40
-rw-r--r--src/mess/machine/micropolis.h21
-rw-r--r--src/mess/machine/mm58274c.c40
-rw-r--r--src/mess/machine/mm58274c.h21
-rw-r--r--src/mess/machine/mos6530.c40
-rw-r--r--src/mess/machine/mos6530.h21
-rw-r--r--src/mess/machine/omti8621.c40
-rw-r--r--src/mess/machine/omti8621.h21
-rw-r--r--src/mess/machine/pc_lpt.c50
-rw-r--r--src/mess/machine/pc_lpt.h22
-rw-r--r--src/mess/machine/pcf8593.c40
-rw-r--r--src/mess/machine/pcf8593.h21
-rw-r--r--src/mess/machine/pf10.c60
-rw-r--r--src/mess/machine/pf10.h23
-rw-r--r--src/mess/machine/s3c44b0.c40
-rw-r--r--src/mess/machine/s3c44b0.h21
-rw-r--r--src/mess/machine/sst39vfx.c54
-rw-r--r--src/mess/machine/sst39vfx.h33
-rw-r--r--src/mess/machine/strata.c31
-rw-r--r--src/mess/machine/strata.h20
-rw-r--r--src/mess/machine/tf20.c61
-rw-r--r--src/mess/machine/tf20.h23
-rw-r--r--src/mess/machine/upd7002.c40
-rw-r--r--src/mess/machine/upd7002.h21
-rw-r--r--src/mess/machine/upd71071.c31
-rw-r--r--src/mess/machine/upd71071.h20
-rw-r--r--src/mess/machine/upd765.c99
-rw-r--r--src/mess/machine/upd765.h58
-rw-r--r--src/mess/video/733_asr.c40
-rw-r--r--src/mess/video/733_asr.h21
-rw-r--r--src/mess/video/911_vdt.c31
-rw-r--r--src/mess/video/911_vdt.h20
-rw-r--r--src/mess/video/apollo.c82
-rw-r--r--src/mess/video/crt.c31
-rw-r--r--src/mess/video/crt.h20
-rw-r--r--src/mess/video/dl1416.c55
-rw-r--r--src/mess/video/dl1416.h36
-rw-r--r--src/mess/video/k1ge.c64
-rw-r--r--src/mess/video/k1ge.h34
-rw-r--r--src/mess/video/odyssey2.c39
-rw-r--r--src/mess/video/saa505x.c31
-rw-r--r--src/mess/video/saa505x.h20
-rw-r--r--src/mess/video/vdc8563.c40
-rw-r--r--src/mess/video/vdc8563.h21
-rw-r--r--src/mess/video/vic4567.c40
-rw-r--r--src/mess/video/vic4567.h21
-rw-r--r--src/mess/video/vic6567.c40
-rw-r--r--src/mess/video/vic6567.h21
-rw-r--r--src/mess/video/vtvideo.c40
-rw-r--r--src/mess/video/vtvideo.h21
418 files changed, 18530 insertions, 954 deletions
diff --git a/src/emu/machine/6525tpi.c b/src/emu/machine/6525tpi.c
index 12a0f76f952..73595a6eb96 100644
--- a/src/emu/machine/6525tpi.c
+++ b/src/emu/machine/6525tpi.c
@@ -141,7 +141,7 @@ INLINE tpi6525_state *get_safe_token(device_t *device)
assert(device != NULL);
assert(device->type() == TPI6525);
- return (tpi6525_state *)downcast<legacy_device_base *>(device)->token();
+ return (tpi6525_state *)downcast<tpi6525_device *>(device)->token();
}
@@ -619,4 +619,40 @@ UINT8 tpi6525_get_ddr_c(device_t *device)
return tpi6525->ddr_c;
}
-DEFINE_LEGACY_DEVICE(TPI6525, tpi6525);
+const device_type TPI6525 = &device_creator<tpi6525_device>;
+
+tpi6525_device::tpi6525_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, TPI6525, "6525 TPI", tag, owner, clock)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(tpi6525_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void tpi6525_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void tpi6525_device::device_start()
+{
+ DEVICE_START_NAME( tpi6525 )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void tpi6525_device::device_reset()
+{
+ DEVICE_RESET_NAME( tpi6525 )(this);
+}
+
+
diff --git a/src/emu/machine/6525tpi.h b/src/emu/machine/6525tpi.h
index 794e1244c88..01b42253523 100644
--- a/src/emu/machine/6525tpi.h
+++ b/src/emu/machine/6525tpi.h
@@ -57,7 +57,26 @@ struct _tpi6525_interface
DEVICE CONFIGURATION MACROS
***************************************************************************/
-DECLARE_LEGACY_DEVICE(TPI6525, tpi6525);
+class tpi6525_device : public device_t
+{
+public:
+ tpi6525_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~tpi6525_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_reset();
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type TPI6525;
+
#define MCFG_TPI6525_ADD(_tag, _intrf) \
MCFG_DEVICE_ADD(_tag, TPI6525, 0) \
diff --git a/src/emu/machine/68681.c b/src/emu/machine/68681.c
index 9b06ffcdfd4..a4ff2f1dfe8 100644
--- a/src/emu/machine/68681.c
+++ b/src/emu/machine/68681.c
@@ -106,7 +106,7 @@ INLINE duart68681_state *get_safe_token(device_t *device)
assert(device != NULL);
assert(device->type() == DUART68681);
- return (duart68681_state *)downcast<legacy_device_base *>(device)->token();
+ return (duart68681_state *)downcast<duart68681_device *>(device)->token();
}
static void duart68681_update_interrupts(duart68681_state *duart68681)
@@ -928,4 +928,40 @@ DEVICE_GET_INFO(duart68681)
}
}
-DEFINE_LEGACY_DEVICE(DUART68681, duart68681);
+const device_type DUART68681 = &device_creator<duart68681_device>;
+
+duart68681_device::duart68681_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, DUART68681, "DUART 68681", tag, owner, clock)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(duart68681_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void duart68681_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void duart68681_device::device_start()
+{
+ DEVICE_START_NAME( duart68681 )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void duart68681_device::device_reset()
+{
+ DEVICE_RESET_NAME( duart68681 )(this);
+}
+
+
diff --git a/src/emu/machine/68681.h b/src/emu/machine/68681.h
index 8edaeb0c772..a8084d3b167 100644
--- a/src/emu/machine/68681.h
+++ b/src/emu/machine/68681.h
@@ -15,7 +15,26 @@ struct _duart68681_config
INT32 ip3clk, ip4clk, ip5clk, ip6clk;
};
-DECLARE_LEGACY_DEVICE(DUART68681, duart68681);
+class duart68681_device : public device_t
+{
+public:
+ duart68681_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~duart68681_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_reset();
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type DUART68681;
+
#define MCFG_DUART68681_ADD(_tag, _clock, _config) \
MCFG_DEVICE_ADD(_tag, DUART68681, _clock) \
diff --git a/src/emu/machine/74148.c b/src/emu/machine/74148.c
index 856ab3cd277..5426221d562 100644
--- a/src/emu/machine/74148.c
+++ b/src/emu/machine/74148.c
@@ -69,7 +69,7 @@ INLINE ttl74148_state *get_safe_token(device_t *device)
assert(device != NULL);
assert(device->type() == TTL74148);
- return (ttl74148_state *)downcast<legacy_device_base *>(device)->token();
+ return (ttl74148_state *)downcast<ttl74148_device *>(device)->token();
}
void ttl74148_update(device_t *device)
@@ -229,4 +229,40 @@ DEVICE_GET_INFO(ttl74148)
}
}
-DEFINE_LEGACY_DEVICE(TTL74148, ttl74148);
+const device_type TTL74148 = &device_creator<ttl74148_device>;
+
+ttl74148_device::ttl74148_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, TTL74148, "74148", tag, owner, clock)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(ttl74148_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void ttl74148_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void ttl74148_device::device_start()
+{
+ DEVICE_START_NAME( ttl74148 )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void ttl74148_device::device_reset()
+{
+ DEVICE_RESET_NAME( ttl74148 )(this);
+}
+
+
diff --git a/src/emu/machine/74148.h b/src/emu/machine/74148.h
index 49da5bba82e..ac3d55a097a 100644
--- a/src/emu/machine/74148.h
+++ b/src/emu/machine/74148.h
@@ -65,6 +65,25 @@ int ttl74148_output_r(device_t *device);
int ttl74148_output_valid_r(device_t *device);
int ttl74148_enable_output_r(device_t *device);
-DECLARE_LEGACY_DEVICE(TTL74148, ttl74148);
+class ttl74148_device : public device_t
+{
+public:
+ ttl74148_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~ttl74148_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_reset();
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type TTL74148;
+
#endif
diff --git a/src/emu/machine/74153.c b/src/emu/machine/74153.c
index cf143b17600..7ec0a7cea53 100644
--- a/src/emu/machine/74153.c
+++ b/src/emu/machine/74153.c
@@ -61,7 +61,7 @@ INLINE ttl74153_state *get_safe_token(device_t *device)
assert(device != NULL);
assert(device->type() == TTL74153);
- return (ttl74153_state *)downcast<legacy_device_base *>(device)->token();
+ return (ttl74153_state *)downcast<ttl74153_device *>(device)->token();
}
@@ -191,4 +191,40 @@ DEVICE_GET_INFO(ttl74153)
}
}
-DEFINE_LEGACY_DEVICE(TTL74153, ttl74153);
+const device_type TTL74153 = &device_creator<ttl74153_device>;
+
+ttl74153_device::ttl74153_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, TTL74153, "74153", tag, owner, clock)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(ttl74153_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void ttl74153_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void ttl74153_device::device_start()
+{
+ DEVICE_START_NAME( ttl74153 )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void ttl74153_device::device_reset()
+{
+ DEVICE_RESET_NAME( ttl74153 )(this);
+}
+
+
diff --git a/src/emu/machine/74153.h b/src/emu/machine/74153.h
index cf1d2b813ae..acae556036e 100644
--- a/src/emu/machine/74153.h
+++ b/src/emu/machine/74153.h
@@ -61,6 +61,25 @@ void ttl74153_input_line_w(device_t *device, int section, int input_line, int da
void ttl74153_enable_w(device_t *device, int section, int data);
int ttl74153_output_r(device_t *device, int section);
-DECLARE_LEGACY_DEVICE(TTL74153, ttl74153);
+class ttl74153_device : public device_t
+{
+public:
+ ttl74153_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~ttl74153_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_reset();
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type TTL74153;
+
#endif
diff --git a/src/emu/machine/adc083x.c b/src/emu/machine/adc083x.c
index 5a12f22bca0..b5bb54726ce 100644
--- a/src/emu/machine/adc083x.c
+++ b/src/emu/machine/adc083x.c
@@ -75,7 +75,7 @@ INLINE adc0831_state *get_safe_token( device_t *device )
{
assert( device != NULL );
assert( ( device->type() == ADC0831 ) || ( device->type() == ADC0832 ) || ( device->type() == ADC0834 ) || ( device->type() == ADC0838 ) );
- return (adc0831_state *) downcast<legacy_device_base *>(device)->token();
+ return (adc0831_state *) downcast<adc0831_device *>(device)->token();
}
INLINE const adc083x_interface *get_interface( device_t *device )
@@ -550,7 +550,69 @@ DEVICE_GET_INFO(adc0838)
}
}
-DEFINE_LEGACY_DEVICE(ADC0831, adc0831);
-DEFINE_LEGACY_DEVICE(ADC0832, adc0832);
-DEFINE_LEGACY_DEVICE(ADC0834, adc0834);
-DEFINE_LEGACY_DEVICE(ADC0838, adc0838);
+const device_type ADC0831 = &device_creator<adc0831_device>;
+
+adc0831_device::adc0831_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, ADC0831, "A/D Converters 0831", tag, owner, clock)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(adc0831_state));
+}
+adc0831_device::adc0831_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, type, name, tag, owner, clock)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(adc0831_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void adc0831_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void adc0831_device::device_start()
+{
+ DEVICE_START_NAME( adc0831 )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void adc0831_device::device_reset()
+{
+ DEVICE_RESET_NAME( adc0831 )(this);
+}
+
+
+const device_type ADC0832 = &device_creator<adc0832_device>;
+
+adc0832_device::adc0832_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : adc0831_device(mconfig, ADC0832, "A/D Converters 0832", tag, owner, clock)
+{
+}
+
+
+const device_type ADC0834 = &device_creator<adc0834_device>;
+
+adc0834_device::adc0834_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : adc0831_device(mconfig, ADC0834, "A/D Converters 0834", tag, owner, clock)
+{
+}
+
+
+const device_type ADC0838 = &device_creator<adc0838_device>;
+
+adc0838_device::adc0838_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : adc0831_device(mconfig, ADC0838, "A/D Converters 0838", tag, owner, clock)
+{
+}
+
+
diff --git a/src/emu/machine/adc083x.h b/src/emu/machine/adc083x.h
index 6528e695c76..59bce8f8c9c 100644
--- a/src/emu/machine/adc083x.h
+++ b/src/emu/machine/adc083x.h
@@ -32,10 +32,51 @@
MACROS / CONSTANTS
***************************************************************************/
-DECLARE_LEGACY_DEVICE(ADC0831, adc0831);
-DECLARE_LEGACY_DEVICE(ADC0832, adc0832);
-DECLARE_LEGACY_DEVICE(ADC0834, adc0834);
-DECLARE_LEGACY_DEVICE(ADC0838, adc0838);
+class adc0831_device : public device_t
+{
+public:
+ adc0831_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ adc0831_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
+ ~adc0831_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_reset();
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type ADC0831;
+
+class adc0832_device : public adc0831_device
+{
+public:
+ adc0832_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
+extern const device_type ADC0832;
+
+class adc0834_device : public adc0831_device
+{
+public:
+ adc0834_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
+extern const device_type ADC0834;
+
+class adc0838_device : public adc0831_device
+{
+public:
+ adc0838_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
+extern const device_type ADC0838;
+
#define MCFG_ADC0831_ADD(_tag, _config) \
MCFG_DEVICE_ADD(_tag, ADC0831, 0) \
diff --git a/src/emu/machine/adc1038.c b/src/emu/machine/adc1038.c
index 286ca194b1a..0628486bb54 100644
--- a/src/emu/machine/adc1038.c
+++ b/src/emu/machine/adc1038.c
@@ -38,7 +38,7 @@ INLINE adc1038_state *adc1038_get_safe_token( device_t *device )
assert(device != NULL);
assert(device->type() == ADC1038);
- return (adc1038_state *)downcast<legacy_device_base *>(device)->token();
+ return (adc1038_state *)downcast<adc1038_device *>(device)->token();
}
INLINE const adc1038_interface *adc1038_get_interface( device_t *device )
@@ -179,4 +179,40 @@ DEVICE_GET_INFO(adc1038)
}
}
-DEFINE_LEGACY_DEVICE(ADC1038, adc1038);
+const device_type ADC1038 = &device_creator<adc1038_device>;
+
+adc1038_device::adc1038_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, ADC1038, "A/D Converters 1038", tag, owner, clock)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(adc1038_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void adc1038_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void adc1038_device::device_start()
+{
+ DEVICE_START_NAME( adc1038 )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void adc1038_device::device_reset()
+{
+ DEVICE_RESET_NAME( adc1038 )(this);
+}
+
+
diff --git a/src/emu/machine/adc1038.h b/src/emu/machine/adc1038.h
index 47dcee0d862..a154af090e9 100644
--- a/src/emu/machine/adc1038.h
+++ b/src/emu/machine/adc1038.h
@@ -31,7 +31,26 @@ struct _adc1038_interface
MACROS / CONSTANTS
***************************************************************************/
-DECLARE_LEGACY_DEVICE(ADC1038, adc1038);
+class adc1038_device : public device_t
+{
+public:
+ adc1038_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~adc1038_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_reset();
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type ADC1038;
+
#define MCFG_ADC1038_ADD(_tag, _config) \
MCFG_DEVICE_ADD(_tag, ADC1038, 0) \
diff --git a/src/emu/machine/adc1213x.c b/src/emu/machine/adc1213x.c
index 49ffa1ca5f4..cf833f471dc 100644
--- a/src/emu/machine/adc1213x.c
+++ b/src/emu/machine/adc1213x.c
@@ -58,7 +58,7 @@ INLINE adc12138_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert((device->type() == ADC12130) || (device->type() == ADC12132) || (device->type() == ADC12138));
- return (adc12138_state *)downcast<legacy_device_base *>(device)->token();
+ return (adc12138_state *)downcast<adc12138_device *>(device)->token();
}
INLINE const adc12138_interface *get_interface(device_t *device)
@@ -390,6 +390,61 @@ DEVICE_GET_INFO(adc12132)
}
}
-DEFINE_LEGACY_DEVICE(ADC12130, adc12130);
-DEFINE_LEGACY_DEVICE(ADC12132, adc12132);
-DEFINE_LEGACY_DEVICE(ADC12138, adc12138);
+const device_type ADC12130 = &device_creator<adc12130_device>;
+
+adc12130_device::adc12130_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : adc12138_device(mconfig, ADC12130, "A/D Converter 12130", tag, owner, clock)
+{
+}
+
+
+const device_type ADC12132 = &device_creator<adc12132_device>;
+
+adc12132_device::adc12132_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : adc12138_device(mconfig, ADC12132, "A/D Converter 12132", tag, owner, clock)
+{
+}
+
+
+const device_type ADC12138 = &device_creator<adc12138_device>;
+
+adc12138_device::adc12138_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, ADC12138, "A/D Converter 12138", tag, owner, clock)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(adc12138_state));
+}
+adc12138_device::adc12138_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, type, name, tag, owner, clock)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(adc12138_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void adc12138_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void adc12138_device::device_start()
+{
+ DEVICE_START_NAME( adc12138 )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void adc12138_device::device_reset()
+{
+ DEVICE_RESET_NAME( adc12138 )(this);
+}
+
+
diff --git a/src/emu/machine/adc1213x.h b/src/emu/machine/adc1213x.h
index 4bb45bb2e46..538ed54510f 100644
--- a/src/emu/machine/adc1213x.h
+++ b/src/emu/machine/adc1213x.h
@@ -17,9 +17,42 @@
MACROS / CONSTANTS
***************************************************************************/
-DECLARE_LEGACY_DEVICE(ADC12130, adc12130);
-DECLARE_LEGACY_DEVICE(ADC12132, adc12132);
-DECLARE_LEGACY_DEVICE(ADC12138, adc12138);
+class adc12138_device : public device_t
+{
+public:
+ adc12138_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ adc12138_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
+ ~adc12138_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_reset();
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type ADC12138;
+
+class adc12130_device : public adc12138_device
+{
+public:
+ adc12130_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
+extern const device_type ADC12130;
+
+class adc12132_device : public adc12138_device
+{
+public:
+ adc12132_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
+extern const device_type ADC12132;
#define MCFG_ADC12130_ADD(_tag, _config) \
MCFG_DEVICE_ADD(_tag, ADC12130, 0) \
diff --git a/src/emu/machine/idectrl.c b/src/emu/machine/idectrl.c
index 96ef0e76398..284b95df744 100644
--- a/src/emu/machine/idectrl.c
+++ b/src/emu/machine/idectrl.c
@@ -197,7 +197,7 @@ INLINE ide_state *get_safe_token(device_t *device)
assert(device != NULL);
assert(device->type() == IDE_CONTROLLER);
- return (ide_state *)downcast<legacy_device_base *>(device)->token();
+ return (ide_state *)downcast<ide_controller_device *>(device)->token();
}
@@ -1968,7 +1968,43 @@ DEVICE_GET_INFO( ide_controller )
}
-DEFINE_LEGACY_DEVICE(IDE_CONTROLLER, ide_controller);
+const device_type IDE_CONTROLLER = &device_creator<ide_controller_device>;
+
+ide_controller_device::ide_controller_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, IDE_CONTROLLER, "IDE Controller", tag, owner, clock)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(ide_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void ide_controller_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void ide_controller_device::device_start()
+{
+ DEVICE_START_NAME( ide_controller )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void ide_controller_device::device_reset()
+{
+ DEVICE_RESET_NAME( ide_controller )(this);
+}
+
+
//**************************************************************************
// IDE SLOT DEVICE
diff --git a/src/emu/machine/idectrl.h b/src/emu/machine/idectrl.h
index 85f46653874..61af4c81648 100644
--- a/src/emu/machine/idectrl.h
+++ b/src/emu/machine/idectrl.h
@@ -186,7 +186,26 @@ WRITE16_DEVICE_HANDLER( ide_controller16_w );
/* ----- device interface ----- */
-DECLARE_LEGACY_DEVICE(IDE_CONTROLLER, ide_controller);
+class ide_controller_device : public device_t
+{
+public:
+ ide_controller_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~ide_controller_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_reset();
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type IDE_CONTROLLER;
+
#endif /* __IDECTRL_H__ */
diff --git a/src/emu/machine/k053252.c b/src/emu/machine/k053252.c
index 76437b56eba..5896f133244 100644
--- a/src/emu/machine/k053252.c
+++ b/src/emu/machine/k053252.c
@@ -82,7 +82,7 @@ INLINE k053252_state *k053252_get_safe_token( device_t *device )
assert(device != NULL);
assert(device->type() == K053252);
- return (k053252_state *)downcast<legacy_device_base *>(device)->token();
+ return (k053252_state *)downcast<k053252_device *>(device)->token();
}
INLINE const k053252_interface *k053252_get_interface( device_t *device )
@@ -252,5 +252,41 @@ DEVICE_GET_INFO( k053252 )
}
}
-DEFINE_LEGACY_DEVICE(K053252, k053252);
+const device_type K053252 = &device_creator<k053252_device>;
+
+k053252_device::k053252_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, K053252, "Konami 053252", tag, owner, clock)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(k053252_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void k053252_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void k053252_device::device_start()
+{
+ DEVICE_START_NAME( k053252 )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void k053252_device::device_reset()
+{
+ DEVICE_RESET_NAME( k053252 )(this);
+}
+
+
diff --git a/src/emu/machine/k053252.h b/src/emu/machine/k053252.h
index c6e3ffb1e1f..1c6d526dc8e 100644
--- a/src/emu/machine/k053252.h
+++ b/src/emu/machine/k053252.h
@@ -7,7 +7,26 @@
#include "devlegcy.h"
-DECLARE_LEGACY_DEVICE(K053252, k053252);
+class k053252_device : public device_t
+{
+public:
+ k053252_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~k053252_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_reset();
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type K053252;
+
diff --git a/src/emu/machine/latch8.c b/src/emu/machine/latch8.c
index 84dd5b55e5e..cc260d14199 100644
--- a/src/emu/machine/latch8.c
+++ b/src/emu/machine/latch8.c
@@ -26,7 +26,7 @@ struct _latch8_t
INLINE latch8_t *get_safe_token(device_t *device) {
assert( device != NULL );
assert( device->type() == LATCH8 );
- return ( latch8_t * ) downcast<legacy_device_base *>(device)->token();
+ return ( latch8_t * ) downcast<latch8_device *>(device)->token();
}
static void update(device_t *device, UINT8 new_val, UINT8 mask)
@@ -253,10 +253,39 @@ DEVICE_GET_INFO( latch8 )
}
}
-latch8_device::latch8_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, UINT32 clock)
- : legacy_device_base(mconfig, type, tag, owner, clock, DEVICE_GET_INFO_NAME(latch8))
+const device_type LATCH8 = &device_creator<latch8_device>;
+
+latch8_device::latch8_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, LATCH8, "8 bit latch", tag, owner, clock)
{
+ m_token = global_alloc_array_clear(UINT8, sizeof(latch8_t));
memset((void*)&m_inline_config,0,sizeof(m_inline_config));
}
-const device_type LATCH8 = &legacy_device_creator<latch8_device>;
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void latch8_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void latch8_device::device_start()
+{
+ DEVICE_START_NAME( latch8 )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void latch8_device::device_reset()
+{
+ DEVICE_RESET_NAME( latch8 )(this);
+}
diff --git a/src/emu/machine/latch8.h b/src/emu/machine/latch8.h
index 9a48a1a8232..7f4f0aa11cb 100644
--- a/src/emu/machine/latch8.h
+++ b/src/emu/machine/latch8.h
@@ -43,32 +43,40 @@ struct _latch8_config
latch8_devread devread[8];
};
-
-DEVICE_GET_INFO( latch8 );
-
-class latch8_device : public legacy_device_base
+class latch8_device : public device_t
{
public:
- latch8_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, UINT32 clock);
-
- latch8_config m_inline_config;
-
- void set_maskout(UINT32 maskout) { m_inline_config.maskout = maskout; }
- void set_xorvalue(UINT32 xorvalue) { m_inline_config.xorvalue = xorvalue; }
- void set_nosync(UINT32 nosync) { m_inline_config.nosync = nosync; }
-
- 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; }
- void set_devread(int bit, const char *tag, read8_device_func handler, int from_bit)
- {
- m_inline_config.devread[bit].from_bit = from_bit;
- m_inline_config.devread[bit].tag = tag;
- m_inline_config.devread[bit].devread_handler = handler;
- }
- void set_read(int bit, read8_space_func handler, int from_bit)
- {
- m_inline_config.devread[bit].from_bit = from_bit;
- m_inline_config.devread[bit].read_handler = handler;
- }
+ latch8_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~latch8_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+ latch8_config m_inline_config;
+
+ void set_maskout(UINT32 maskout) { m_inline_config.maskout = maskout; }
+ void set_xorvalue(UINT32 xorvalue) { m_inline_config.xorvalue = xorvalue; }
+ void set_nosync(UINT32 nosync) { m_inline_config.nosync = nosync; }
+
+ 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; }
+ void set_devread(int bit, const char *tag, read8_device_func handler, int from_bit)
+ {
+ m_inline_config.devread[bit].from_bit = from_bit;
+ m_inline_config.devread[bit].tag = tag;
+ m_inline_config.devread[bit].devread_handler = handler;
+ }
+ void set_read(int bit, read8_space_func handler, int from_bit)
+ {
+ m_inline_config.devread[bit].from_bit = from_bit;
+ m_inline_config.devread[bit].read_handler = handler;
+ }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_reset();
+private:
+ // internal state
+ void *m_token;
};
extern const device_type LATCH8;
diff --git a/src/emu/machine/mb14241.c b/src/emu/machine/mb14241.c
index 1cac968bbb4..049e12cb9ed 100644
--- a/src/emu/machine/mb14241.c
+++ b/src/emu/machine/mb14241.c
@@ -23,7 +23,7 @@ INLINE mb14241_state *get_safe_token( device_t *device )
assert(device != NULL);
assert(device->type() == MB14241);
- return (mb14241_state *)downcast<legacy_device_base *>(device)->token();
+ return (mb14241_state *)downcast<mb14241_device *>(device)->token();
}
/*****************************************************************************
@@ -82,4 +82,40 @@ DEVICE_GET_INFO(mb14241)
}
}
-DEFINE_LEGACY_DEVICE(MB14241, mb14241);
+const device_type MB14241 = &device_creator<mb14241_device>;
+
+mb14241_device::mb14241_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, MB14241, "MB14241", tag, owner, clock)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(mb14241_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void mb14241_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void mb14241_device::device_start()
+{
+ DEVICE_START_NAME( mb14241 )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void mb14241_device::device_reset()
+{
+ DEVICE_RESET_NAME( mb14241 )(this);
+}
+
+
diff --git a/src/emu/machine/mb14241.h b/src/emu/machine/mb14241.h
index 120054591a8..bd39245a5c1 100644
--- a/src/emu/machine/mb14241.h
+++ b/src/emu/machine/mb14241.h
@@ -10,7 +10,26 @@
#include "devlegcy.h"
-DECLARE_LEGACY_DEVICE(MB14241, mb14241);
+class mb14241_device : public device_t
+{
+public:
+ mb14241_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~mb14241_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_reset();
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type MB14241;
+
/***************************************************************************
DEVICE CONFIGURATION MACROS
diff --git a/src/emu/machine/mb87078.c b/src/emu/machine/mb87078.c
index a3a4290c6de..47fa5437600 100644
--- a/src/emu/machine/mb87078.c
+++ b/src/emu/machine/mb87078.c
@@ -116,7 +116,7 @@ INLINE mb87078_state *get_safe_token( device_t *device )
assert(device != NULL);
assert(device->type() == MB87078);
- return (mb87078_state *)downcast<legacy_device_base *>(device)->token();
+ return (mb87078_state *)downcast<mb87078_device *>(device)->token();
}
INLINE const mb87078_interface *get_interface( device_t *device )
@@ -280,4 +280,40 @@ DEVICE_GET_INFO(mb87078)
}
}
-DEFINE_LEGACY_DEVICE(MB87078, mb87078);
+const device_type MB87078 = &device_creator<mb87078_device>;
+
+mb87078_device::mb87078_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, MB87078, "Fujitsu MB87078", tag, owner, clock)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(mb87078_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void mb87078_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void mb87078_device::device_start()
+{
+ DEVICE_START_NAME( mb87078 )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void mb87078_device::device_reset()
+{
+ DEVICE_RESET_NAME( mb87078 )(this);
+}
+
+
diff --git a/src/emu/machine/mb87078.h b/src/emu/machine/mb87078.h
index 7f62b44c06e..8b86a5189da 100644
--- a/src/emu/machine/mb87078.h
+++ b/src/emu/machine/mb87078.h
@@ -24,7 +24,26 @@ struct _mb87078_interface
mb87078_gain_changed_cb gain_changed_cb;
};
-DECLARE_LEGACY_DEVICE(MB87078, mb87078);
+class mb87078_device : public device_t
+{
+public:
+ mb87078_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~mb87078_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_reset();
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type MB87078;
+
/***************************************************************************
DEVICE CONFIGURATION MACROS
diff --git a/src/emu/machine/pd4990a.c b/src/emu/machine/pd4990a.c
index 726bda55b28..24d2b61e1da 100644
--- a/src/emu/machine/pd4990a.c
+++ b/src/emu/machine/pd4990a.c
@@ -86,7 +86,7 @@ INLINE upd4990a_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert((device->type() == UPD4990A));
- return (upd4990a_state *)downcast<legacy_device_base *>(device)->token();
+ return (upd4990a_state *)downcast<upd4990a_device *>(device)->token();
}
INLINE UINT8 convert_to_bcd(int val)
@@ -539,4 +539,40 @@ DEVICE_GET_INFO(upd4990a)
}
}
-DEFINE_LEGACY_DEVICE(UPD4990A, upd4990a);
+const device_type UPD4990A = &device_creator<upd4990a_device>;
+
+upd4990a_device::upd4990a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, UPD4990A, "NEC uPD4990A", tag, owner, clock)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(upd4990a_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void upd4990a_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void upd4990a_device::device_start()
+{
+ DEVICE_START_NAME( upd4990a )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void upd4990a_device::device_reset()
+{
+ DEVICE_RESET_NAME( upd4990a )(this);
+}
+
+
diff --git a/src/emu/machine/pd4990a.h b/src/emu/machine/pd4990a.h
index 4dd0c1b4f0a..3772546835b 100644
--- a/src/emu/machine/pd4990a.h
+++ b/src/emu/machine/pd4990a.h
@@ -16,7 +16,26 @@
MACROS / CONSTANTS
***************************************************************************/
-DECLARE_LEGACY_DEVICE(UPD4990A, upd4990a);
+class upd4990a_device : public device_t
+{
+public:
+ upd4990a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~upd4990a_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_reset();
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type UPD4990A;
+
#define MCFG_UPD4990A_ADD(_tag) \
MCFG_DEVICE_ADD(_tag, UPD4990A, 0)
diff --git a/src/emu/machine/pic8259.c b/src/emu/machine/pic8259.c
index ef7728d681d..ff663534405 100644
--- a/src/emu/machine/pic8259.c
+++ b/src/emu/machine/pic8259.c
@@ -77,7 +77,7 @@ struct pic8259
INLINE pic8259_t *get_safe_token(device_t *device) {
assert( device != NULL );
assert( device->type() == PIC8259 );
- return ( pic8259_t *) downcast<legacy_device_base *>(device)->token();
+ return ( pic8259_t *) downcast<pic8259_device *>(device)->token();
}
@@ -469,4 +469,40 @@ DEVICE_GET_INFO( pic8259 ) {
}
-DEFINE_LEGACY_DEVICE(PIC8259, pic8259);
+const device_type PIC8259 = &device_creator<pic8259_device>;
+
+pic8259_device::pic8259_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, PIC8259, "Intel PIC8259", tag, owner, clock)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(pic8259_t));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void pic8259_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void pic8259_device::device_start()
+{
+ DEVICE_START_NAME( pic8259 )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void pic8259_device::device_reset()
+{
+ DEVICE_RESET_NAME( pic8259 )(this);
+}
+
+
diff --git a/src/emu/machine/pic8259.h b/src/emu/machine/pic8259.h
index 230074880ec..99f24b62fed 100644
--- a/src/emu/machine/pic8259.h
+++ b/src/emu/machine/pic8259.h
@@ -28,7 +28,26 @@
#include "devlegcy.h"
#include "devcb.h"
-DECLARE_LEGACY_DEVICE(PIC8259, pic8259);
+class pic8259_device : public device_t
+{
+public:
+ pic8259_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~pic8259_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_reset();
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type PIC8259;
+
/***************************************************************************
TYPE DEFINITIONS
diff --git a/src/emu/machine/pit8253.c b/src/emu/machine/pit8253.c
index 4d2c40aadfc..8274f5c5870 100644
--- a/src/emu/machine/pit8253.c
+++ b/src/emu/machine/pit8253.c
@@ -107,7 +107,7 @@ INLINE pit8253_t *get_safe_token(device_t *device)
assert(device != NULL);
assert((device->type() == PIT8253) || (device->type() == PIT8254));
- return (pit8253_t *) downcast<legacy_device_base *>(device)->token();
+ return (pit8253_t *) downcast<pit8253_device *>(device)->token();
}
@@ -1188,5 +1188,62 @@ DEVICE_GET_INFO( pit8254 ) {
}
-DEFINE_LEGACY_DEVICE(PIT8253, pit8253);
-DEFINE_LEGACY_DEVICE(PIT8254, pit8254);
+const device_type PIT8253 = &device_creator<pit8253_device>;
+
+pit8253_device::pit8253_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, PIT8253, "Intel PIT8253", tag, owner, clock)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(pit8253_t));
+}
+pit8253_device::pit8253_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, type, name, tag, owner, clock)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(pit8253_t));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void pit8253_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void pit8253_device::device_start()
+{
+ DEVICE_START_NAME( pit8253 )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void pit8253_device::device_reset()
+{
+ DEVICE_RESET_NAME( pit8253 )(this);
+}
+
+
+const device_type PIT8254 = &device_creator<pit8254_device>;
+
+pit8254_device::pit8254_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : pit8253_device(mconfig, PIT8254, "Intel PIT8254", tag, owner, clock)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void pit8254_device::device_start()
+{
+ DEVICE_START_NAME( pit8254 )(this);
+}
+
+
diff --git a/src/emu/machine/pit8253.h b/src/emu/machine/pit8253.h
index 32e05f62498..c4af119903b 100644
--- a/src/emu/machine/pit8253.h
+++ b/src/emu/machine/pit8253.h
@@ -37,8 +37,38 @@ struct pit8253_config
} timer[3];
};
-DECLARE_LEGACY_DEVICE(PIT8253, pit8253);
-DECLARE_LEGACY_DEVICE(PIT8254, pit8254);
+class pit8253_device : public device_t
+{
+public:
+ pit8253_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ pit8253_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
+ ~pit8253_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_reset();
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type PIT8253;
+
+class pit8254_device : public pit8253_device
+{
+public:
+ pit8254_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+protected:
+ // device-level overrides
+ virtual void device_start();
+};
+
+extern const device_type PIT8254;
+
/***************************************************************************
diff --git a/src/emu/machine/rp5h01.c b/src/emu/machine/rp5h01.c
index bf0f21acb05..69a376431e3 100644
--- a/src/emu/machine/rp5h01.c
+++ b/src/emu/machine/rp5h01.c
@@ -48,7 +48,7 @@ INLINE rp5h01_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert((device->type() == RP5H01));
- return (rp5h01_state *)downcast<legacy_device_base *>(device)->token();
+ return (rp5h01_state *)downcast<rp5h01_device *>(device)->token();
}
/***************************************************************************
@@ -240,4 +240,40 @@ DEVICE_GET_INFO(rp5h01)
}
}
-DEFINE_LEGACY_DEVICE(RP5H01, rp5h01);
+const device_type RP5H01 = &device_creator<rp5h01_device>;
+
+rp5h01_device::rp5h01_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, RP5H01, "RP5H01", tag, owner, clock)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(rp5h01_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void rp5h01_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void rp5h01_device::device_start()
+{
+ DEVICE_START_NAME( rp5h01 )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void rp5h01_device::device_reset()
+{
+ DEVICE_RESET_NAME( rp5h01 )(this);
+}
+
+
diff --git a/src/emu/machine/rp5h01.h b/src/emu/machine/rp5h01.h
index 78bb2426147..5e798ed780e 100644
--- a/src/emu/machine/rp5h01.h
+++ b/src/emu/machine/rp5h01.h
@@ -14,7 +14,26 @@
MACROS / CONSTANTS
***************************************************************************/
-DECLARE_LEGACY_DEVICE(RP5H01, rp5h01);
+class rp5h01_device : public device_t
+{
+public:
+ rp5h01_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~rp5h01_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_reset();
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type RP5H01;
+
#define MCFG_RP5H01_ADD(_tag) \
MCFG_DEVICE_ADD(_tag, RP5H01, 0)
diff --git a/src/emu/machine/smc91c9x.c b/src/emu/machine/smc91c9x.c
index 7bcf7ac0db8..274fe27dfa0 100644
--- a/src/emu/machine/smc91c9x.c
+++ b/src/emu/machine/smc91c9x.c
@@ -156,7 +156,7 @@ INLINE smc91c9x_state *get_safe_token(device_t *device)
assert(device != NULL);
assert(device->type() == SMC91C94 || device->type() == SMC91C96);
- return (smc91c9x_state *)downcast<legacy_device_base *>(device)->token();
+ return (smc91c9x_state *)downcast<smc91c9x_device *>(device)->token();
}
@@ -628,7 +628,55 @@ DEVICE_GET_INFO( smc91c96 )
}
}
+smc91c9x_device::smc91c9x_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, type, name, tag, owner, clock)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(smc91c9x_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void smc91c9x_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void smc91c9x_device::device_start()
+{
+ DEVICE_START_NAME( smc91c9x )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void smc91c9x_device::device_reset()
+{
+ DEVICE_RESET_NAME( smc91c9x )(this);
+}
+
+
+const device_type SMC91C94 = &device_creator<smc91c94_device>;
+
+smc91c94_device::smc91c94_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : smc91c9x_device(mconfig, SMC91C94, "SMC91C94", tag, owner, clock)
+{
+}
+
+
+const device_type SMC91C96 = &device_creator<smc91c96_device>;
+
+smc91c96_device::smc91c96_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : smc91c9x_device(mconfig, SMC91C96, "SMC91C96", tag, owner, clock)
+{
+}
+
-DEFINE_LEGACY_DEVICE(SMC91C94, smc91c94);
-DEFINE_LEGACY_DEVICE(SMC91C96, smc91c96);
diff --git a/src/emu/machine/smc91c9x.h b/src/emu/machine/smc91c9x.h
index 29a590a3960..9f8161f32b1 100644
--- a/src/emu/machine/smc91c9x.h
+++ b/src/emu/machine/smc91c9x.h
@@ -50,8 +50,40 @@ WRITE16_DEVICE_HANDLER( smc91c9x_w );
/* ----- device interface ----- */
+class smc91c9x_device : public device_t
+{
+public:
+ smc91c9x_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
+ ~smc91c9x_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_reset();
+private:
+ // internal state
+ void *m_token;
+};
+
+
+class smc91c94_device : public smc91c9x_device
+{
+public:
+ smc91c94_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
+extern const device_type SMC91C94;
+
+class smc91c96_device : public smc91c9x_device
+{
+public:
+ smc91c96_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
+extern const device_type SMC91C96;
-DECLARE_LEGACY_DEVICE(SMC91C94, smc91c94);
-DECLARE_LEGACY_DEVICE(SMC91C96, smc91c96);
#endif
diff --git a/src/emu/machine/tms6100.c b/src/emu/machine/tms6100.c
index 75f8a8ee113..2ea90c02f6e 100644
--- a/src/emu/machine/tms6100.c
+++ b/src/emu/machine/tms6100.c
@@ -107,7 +107,7 @@ INLINE tms6100_state *get_safe_token(device_t *device)
assert(device != NULL);
assert(device->type() == TMS6100 ||
device->type() == M58819);
- return (tms6100_state *)downcast<legacy_device_base *>(device)->token();
+ return (tms6100_state *)downcast<tms6100_device *>(device)->token();
}
/**********************************************************************************************
@@ -288,5 +288,62 @@ DEVICE_GET_INFO(m58819)
}
}
-DEFINE_LEGACY_DEVICE(TMS6100, tms6100);
-DEFINE_LEGACY_DEVICE(M58819, m58819);
+const device_type TMS6100 = &device_creator<tms6100_device>;
+
+tms6100_device::tms6100_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, TMS6100, "TMS6100", tag, owner, clock)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(tms6100_state));
+}
+tms6100_device::tms6100_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, type, name, tag, owner, clock)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(tms6100_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void tms6100_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void tms6100_device::device_start()
+{
+ DEVICE_START_NAME( tms6100 )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void tms6100_device::device_reset()
+{
+ DEVICE_RESET_NAME( tms6100 )(this);
+}
+
+
+const device_type M58819 = &device_creator<m58819_device>;
+
+m58819_device::m58819_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : tms6100_device(mconfig, M58819, "M58819", tag, owner, clock)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void m58819_device::device_start()
+{
+ DEVICE_START_NAME( m58819 )(this);
+}
+
+
diff --git a/src/emu/machine/tms6100.h b/src/emu/machine/tms6100.h
index bd6a1919d20..512446b8e62 100644
--- a/src/emu/machine/tms6100.h
+++ b/src/emu/machine/tms6100.h
@@ -14,7 +14,37 @@ WRITE8_DEVICE_HANDLER( tms6100_addr_w );
READ_LINE_DEVICE_HANDLER( tms6100_data_r );
-DECLARE_LEGACY_DEVICE(TMS6100, tms6100);
-DECLARE_LEGACY_DEVICE(M58819, m58819);
+class tms6100_device : public device_t
+{
+public:
+ tms6100_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ tms6100_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
+ ~tms6100_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_reset();
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type TMS6100;
+
+class m58819_device : public tms6100_device
+{
+public:
+ m58819_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+protected:
+ // device-level overrides
+ virtual void device_start();
+};
+
+extern const device_type M58819;
+
#endif /* __TMS6100_H__ */
diff --git a/src/emu/machine/upd4701.c b/src/emu/machine/upd4701.c
index cef9a7d2e10..5d120bc6600 100644
--- a/src/emu/machine/upd4701.c
+++ b/src/emu/machine/upd4701.c
@@ -49,7 +49,7 @@ INLINE upd4701_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert((device->type() == UPD4701));
- return (upd4701_state *)downcast<legacy_device_base *>(device)->token();
+ return (upd4701_state *)downcast<upd4701_device *>(device)->token();
}
@@ -319,4 +319,40 @@ DEVICE_GET_INFO(upd4701)
}
}
-DEFINE_LEGACY_DEVICE(UPD4701, upd4701);
+const device_type UPD4701 = &device_creator<upd4701_device>;
+
+upd4701_device::upd4701_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, UPD4701, "NEC uPD4701 Encoder", tag, owner, clock)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(upd4701_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void upd4701_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void upd4701_device::device_start()
+{
+ DEVICE_START_NAME( upd4701 )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void upd4701_device::device_reset()
+{
+ DEVICE_RESET_NAME( upd4701 )(this);
+}
+
+
diff --git a/src/emu/machine/upd4701.h b/src/emu/machine/upd4701.h
index fd4059fd983..e4a8fd519d5 100644
--- a/src/emu/machine/upd4701.h
+++ b/src/emu/machine/upd4701.h
@@ -15,7 +15,26 @@
MACROS / CONSTANTS
***************************************************************************/
-DECLARE_LEGACY_DEVICE(UPD4701, upd4701);
+class upd4701_device : public device_t
+{
+public:
+ upd4701_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~upd4701_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_reset();
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type UPD4701;
+
#define MCFG_UPD4701_ADD(_tag) \
MCFG_DEVICE_ADD(_tag, UPD4701, 0)
diff --git a/src/emu/machine/wd17xx.c b/src/emu/machine/wd17xx.c
index 7cdb08437a2..6373628d3fc 100644
--- a/src/emu/machine/wd17xx.c
+++ b/src/emu/machine/wd17xx.c
@@ -411,7 +411,7 @@ INLINE wd1770_state *get_safe_token(device_t *device)
device->type() == WD1770 || device->type() == WD1772 || device->type() == WD1773 ||
device->type() == MB8866 || device->type() == MB8876 || device->type() == MB8877);
- return (wd1770_state *)downcast<legacy_device_base *>(device)->token();
+ return (wd1770_state *)downcast<wd1770_device *>(device)->token();
}
@@ -2328,27 +2328,238 @@ DEVICE_GET_INFO(mb8877)
}
}
-DEFINE_LEGACY_DEVICE(FD1771, fd1771);
-DEFINE_LEGACY_DEVICE(FD1781, fd1781);
-DEFINE_LEGACY_DEVICE(FD1791, fd1791);
-DEFINE_LEGACY_DEVICE(FD1792, fd1792);
-DEFINE_LEGACY_DEVICE(FD1793, fd1793);
-DEFINE_LEGACY_DEVICE(FD1794, fd1794);
-DEFINE_LEGACY_DEVICE(FD1795, fd1795);
-DEFINE_LEGACY_DEVICE(FD1797, fd1797);
-DEFINE_LEGACY_DEVICE(FD1761, fd1761);
-DEFINE_LEGACY_DEVICE(FD1762, fd1762);
-DEFINE_LEGACY_DEVICE(FD1763, fd1763);
-DEFINE_LEGACY_DEVICE(FD1764, fd1764);
-DEFINE_LEGACY_DEVICE(FD1765, fd1765);
-DEFINE_LEGACY_DEVICE(FD1767, fd1767);
-DEFINE_LEGACY_DEVICE(WD2791, wd2791);
-DEFINE_LEGACY_DEVICE(WD2793, wd2793);
-DEFINE_LEGACY_DEVICE(WD2795, wd2795);
-DEFINE_LEGACY_DEVICE(WD2797, wd2797);
-DEFINE_LEGACY_DEVICE(WD1770, wd1770);
-DEFINE_LEGACY_DEVICE(WD1772, wd1772);
-DEFINE_LEGACY_DEVICE(WD1773, wd1773);
-DEFINE_LEGACY_DEVICE(MB8866, mb8866);
-DEFINE_LEGACY_DEVICE(MB8876, mb8876);
-DEFINE_LEGACY_DEVICE(MB8877, mb8877);
+const device_type FD1771 = &device_creator<fd1771_device>;
+
+fd1771_device::fd1771_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : wd1770_device(mconfig, FD1771, "FD1771", tag, owner, clock)
+{
+}
+
+
+const device_type FD1781 = &device_creator<fd1781_device>;
+
+fd1781_device::fd1781_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : wd1770_device(mconfig, FD1781, "FD1781", tag, owner, clock)
+{
+}
+
+
+const device_type FD1791 = &device_creator<fd1791_device>;
+
+fd1791_device::fd1791_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : wd1770_device(mconfig, FD1791, "FD1791", tag, owner, clock)
+{
+}
+
+
+const device_type FD1792 = &device_creator<fd1792_device>;
+
+fd1792_device::fd1792_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : wd1770_device(mconfig, FD1792, "FD1792", tag, owner, clock)
+{
+}
+
+
+const device_type FD1793 = &device_creator<fd1793_device>;
+
+fd1793_device::fd1793_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : wd1770_device(mconfig, FD1793, "FD1793", tag, owner, clock)
+{
+}
+
+
+const device_type FD1794 = &device_creator<fd1794_device>;
+
+fd1794_device::fd1794_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : wd1770_device(mconfig, FD1794, "FD1794", tag, owner, clock)
+{
+}
+
+
+const device_type FD1795 = &device_creator<fd1795_device>;
+
+fd1795_device::fd1795_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : wd1770_device(mconfig, FD1795, "FD1795", tag, owner, clock)
+{
+}
+
+
+const device_type FD1797 = &device_creator<fd1797_device>;
+
+fd1797_device::fd1797_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : wd1770_device(mconfig, FD1797, "FD1797", tag, owner, clock)
+{
+}
+
+
+const device_type FD1761 = &device_creator<fd1761_device>;
+
+fd1761_device::fd1761_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : wd1770_device(mconfig, FD1761, "FD1761", tag, owner, clock)
+{
+}
+
+
+const device_type FD1762 = &device_creator<fd1762_device>;
+
+fd1762_device::fd1762_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : wd1770_device(mconfig, FD1762, "FD1762", tag, owner, clock)
+{
+}
+
+
+const device_type FD1763 = &device_creator<fd1763_device>;
+
+fd1763_device::fd1763_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : wd1770_device(mconfig, FD1763, "FD1763", tag, owner, clock)
+{
+}
+
+
+const device_type FD1764 = &device_creator<fd1764_device>;
+
+fd1764_device::fd1764_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : wd1770_device(mconfig, FD1764, "FD1764", tag, owner, clock)
+{
+}
+
+
+const device_type FD1765 = &device_creator<fd1765_device>;
+
+fd1765_device::fd1765_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : wd1770_device(mconfig, FD1765, "FD1765", tag, owner, clock)
+{
+}
+
+
+const device_type FD1767 = &device_creator<fd1767_device>;
+
+fd1767_device::fd1767_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : wd1770_device(mconfig, FD1767, "FD1767", tag, owner, clock)
+{
+}
+
+
+const device_type WD2791 = &device_creator<wd2791_device>;
+
+wd2791_device::wd2791_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : wd1770_device(mconfig, WD2791, "WD2791", tag, owner, clock)
+{
+}
+
+
+const device_type WD2793 = &device_creator<wd2793_device>;
+
+wd2793_device::wd2793_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : wd1770_device(mconfig, WD2793, "WD2793", tag, owner, clock)
+{
+}
+
+
+const device_type WD2795 = &device_creator<wd2795_device>;
+
+wd2795_device::wd2795_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : wd1770_device(mconfig, WD2795, "WD2795", tag, owner, clock)
+{
+}
+
+
+const device_type WD2797 = &device_creator<wd2797_device>;
+
+wd2797_device::wd2797_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : wd1770_device(mconfig, WD2797, "WD2797", tag, owner, clock)
+{
+}
+
+
+const device_type WD1770 = &device_creator<wd1770_device>;
+
+wd1770_device::wd1770_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, WD1770, "WD1770", tag, owner, clock)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(wd1770_state));
+}
+wd1770_device::wd1770_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, type, name, tag, owner, clock)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(wd1770_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void wd1770_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void wd1770_device::device_start()
+{
+ DEVICE_START_NAME( wd1770 )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void wd1770_device::device_reset()
+{
+ DEVICE_RESET_NAME( wd1770 )(this);
+}
+
+
+const device_type WD1772 = &device_creator<wd1772_device>;
+
+wd1772_device::wd1772_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : wd1770_device(mconfig, WD1772, "WD1772", tag, owner, clock)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void wd1772_device::device_start()
+{
+ DEVICE_START_NAME( wd1772 )(this);
+}
+
+
+const device_type WD1773 = &device_creator<wd1773_device>;
+
+wd1773_device::wd1773_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : wd1770_device(mconfig, WD1773, "WD1773", tag, owner, clock)
+{
+}
+
+
+const device_type MB8866 = &device_creator<mb8866_device>;
+
+mb8866_device::mb8866_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : wd1770_device(mconfig, MB8866, "MB8866", tag, owner, clock)
+{
+}
+
+
+const device_type MB8876 = &device_creator<mb8876_device>;
+
+mb8876_device::mb8876_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : wd1770_device(mconfig, MB8876, "MB8876", tag, owner, clock)
+{
+}
+
+
+const device_type MB8877 = &device_creator<mb8877_device>;
+
+mb8877_device::mb8877_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : wd1770_device(mconfig, MB8877, "MB8877", tag, owner, clock)
+{
+}
+
+
diff --git a/src/emu/machine/wd17xx.h b/src/emu/machine/wd17xx.h
index 4a24afe6b10..bc7add9f89d 100644
--- a/src/emu/machine/wd17xx.h
+++ b/src/emu/machine/wd17xx.h
@@ -17,30 +17,214 @@
MACROS
***************************************************************************/
-DECLARE_LEGACY_DEVICE(FD1771, fd1771);
-DECLARE_LEGACY_DEVICE(FD1781, fd1781);
-DECLARE_LEGACY_DEVICE(FD1791, fd1791);
-DECLARE_LEGACY_DEVICE(FD1792, fd1792);
-DECLARE_LEGACY_DEVICE(FD1793, fd1793);
-DECLARE_LEGACY_DEVICE(FD1794, fd1794);
-DECLARE_LEGACY_DEVICE(FD1795, fd1795);
-DECLARE_LEGACY_DEVICE(FD1797, fd1797);
-DECLARE_LEGACY_DEVICE(FD1761, fd1761);
-DECLARE_LEGACY_DEVICE(FD1762, fd1762);
-DECLARE_LEGACY_DEVICE(FD1763, fd1763);
-DECLARE_LEGACY_DEVICE(FD1764, fd1764);
-DECLARE_LEGACY_DEVICE(FD1765, fd1765);
-DECLARE_LEGACY_DEVICE(FD1767, fd1767);
-DECLARE_LEGACY_DEVICE(WD2791, wd2791);
-DECLARE_LEGACY_DEVICE(WD2793, wd2793);
-DECLARE_LEGACY_DEVICE(WD2795, wd2795);
-DECLARE_LEGACY_DEVICE(WD2797, wd2797);
-DECLARE_LEGACY_DEVICE(WD1770, wd1770);
-DECLARE_LEGACY_DEVICE(WD1772, wd1772);
-DECLARE_LEGACY_DEVICE(WD1773, wd1773);
-DECLARE_LEGACY_DEVICE(MB8866, mb8866);
-DECLARE_LEGACY_DEVICE(MB8876, mb8876);
-DECLARE_LEGACY_DEVICE(MB8877, mb8877);
+class wd1770_device : public device_t
+{
+public:
+ wd1770_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ wd1770_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
+ ~wd1770_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_reset();
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type WD1770;
+
+class fd1771_device : public wd1770_device
+{
+public:
+ fd1771_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
+extern const device_type FD1771;
+
+class fd1781_device : public wd1770_device
+{
+public:
+ fd1781_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
+extern const device_type FD1781;
+
+class fd1791_device : public wd1770_device
+{
+public:
+ fd1791_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
+extern const device_type FD1791;
+
+class fd1792_device : public wd1770_device
+{
+public:
+ fd1792_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
+extern const device_type FD1792;
+
+class fd1793_device : public wd1770_device
+{
+public:
+ fd1793_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
+extern const device_type FD1793;
+
+class fd1794_device : public wd1770_device
+{
+public:
+ fd1794_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
+extern const device_type FD1794;
+
+class fd1795_device : public wd1770_device
+{
+public:
+ fd1795_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
+extern const device_type FD1795;
+
+class fd1797_device : public wd1770_device
+{
+public:
+ fd1797_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
+extern const device_type FD1797;
+
+class fd1761_device : public wd1770_device
+{
+public:
+ fd1761_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
+extern const device_type FD1761;
+
+class fd1762_device : public wd1770_device
+{
+public:
+ fd1762_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
+extern const device_type FD1762;
+
+class fd1763_device : public wd1770_device
+{
+public:
+ fd1763_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
+extern const device_type FD1763;
+
+class fd1764_device : public wd1770_device
+{
+public:
+ fd1764_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
+extern const device_type FD1764;
+
+class fd1765_device : public wd1770_device
+{
+public:
+ fd1765_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
+extern const device_type FD1765;
+
+class fd1767_device : public wd1770_device
+{
+public:
+ fd1767_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
+extern const device_type FD1767;
+
+class wd2791_device : public wd1770_device
+{
+public:
+ wd2791_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
+extern const device_type WD2791;
+
+class wd2793_device : public wd1770_device
+{
+public:
+ wd2793_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
+extern const device_type WD2793;
+
+class wd2795_device : public wd1770_device
+{
+public:
+ wd2795_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
+extern const device_type WD2795;
+
+class wd2797_device : public wd1770_device
+{
+public:
+ wd2797_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
+extern const device_type WD2797;
+
+class wd1772_device : public wd1770_device
+{
+public:
+ wd1772_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+protected:
+ // device-level overrides
+ virtual void device_start();
+};
+
+extern const device_type WD1772;
+
+class wd1773_device : public wd1770_device
+{
+public:
+ wd1773_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
+extern const device_type WD1773;
+
+class mb8866_device : public wd1770_device
+{
+public:
+ mb8866_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
+extern const device_type MB8866;
+
+class mb8876_device : public wd1770_device
+{
+public:
+ mb8876_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
+extern const device_type MB8876;
+
+class mb8877_device : public wd1770_device
+{
+public:
+ mb8877_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
+extern const device_type MB8877;
+
diff --git a/src/emu/sound/2151intf.c b/src/emu/sound/2151intf.c
index cdb49e8651f..61a236ae1da 100644
--- a/src/emu/sound/2151intf.c
+++ b/src/emu/sound/2151intf.c
@@ -28,7 +28,7 @@ INLINE ym2151_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == YM2151);
- return (ym2151_state *)downcast<legacy_device_base *>(device)->token();
+ return (ym2151_state *)downcast<ym2151_device *>(device)->token();
}
@@ -146,4 +146,60 @@ DEVICE_GET_INFO( ym2151 )
}
-DEFINE_LEGACY_SOUND_DEVICE(YM2151, ym2151);
+const device_type YM2151 = &device_creator<ym2151_device>;
+
+ym2151_device::ym2151_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, YM2151, "YM2151", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(ym2151_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void ym2151_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void ym2151_device::device_start()
+{
+ DEVICE_START_NAME( ym2151 )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void ym2151_device::device_reset()
+{
+ DEVICE_RESET_NAME( ym2151 )(this);
+}
+
+//-------------------------------------------------
+// device_stop - device-specific stop
+//-------------------------------------------------
+
+void ym2151_device::device_stop()
+{
+ DEVICE_STOP_NAME( ym2151 )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void ym2151_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/emu/sound/2151intf.h b/src/emu/sound/2151intf.h
index b568192049e..f355ec5dc9d 100644
--- a/src/emu/sound/2151intf.h
+++ b/src/emu/sound/2151intf.h
@@ -19,6 +19,30 @@ READ8_DEVICE_HANDLER( ym2151_status_port_r );
WRITE8_DEVICE_HANDLER( ym2151_register_port_w );
WRITE8_DEVICE_HANDLER( ym2151_data_port_w );
-DECLARE_LEGACY_SOUND_DEVICE(YM2151, ym2151);
+class ym2151_device : public device_t,
+ public device_sound_interface
+{
+public:
+ ym2151_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~ym2151_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_stop();
+ virtual void device_reset();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type YM2151;
+
#endif /* __2151INTF_H__ */
diff --git a/src/emu/sound/2203intf.c b/src/emu/sound/2203intf.c
index aa3b7eb3e75..ae929ed355f 100644
--- a/src/emu/sound/2203intf.c
+++ b/src/emu/sound/2203intf.c
@@ -20,7 +20,7 @@ INLINE ym2203_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == YM2203);
- return (ym2203_state *)downcast<legacy_device_base *>(device)->token();
+ return (ym2203_state *)downcast<ym2203_device *>(device)->token();
}
@@ -208,4 +208,60 @@ DEVICE_GET_INFO( ym2203 )
}
-DEFINE_LEGACY_SOUND_DEVICE(YM2203, ym2203);
+const device_type YM2203 = &device_creator<ym2203_device>;
+
+ym2203_device::ym2203_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, YM2203, "YM2203", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(ym2203_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void ym2203_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void ym2203_device::device_start()
+{
+ DEVICE_START_NAME( ym2203 )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void ym2203_device::device_reset()
+{
+ DEVICE_RESET_NAME( ym2203 )(this);
+}
+
+//-------------------------------------------------
+// device_stop - device-specific stop
+//-------------------------------------------------
+
+void ym2203_device::device_stop()
+{
+ DEVICE_STOP_NAME( ym2203 )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void ym2203_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/emu/sound/2203intf.h b/src/emu/sound/2203intf.h
index f4ca6e172b3..ba32f219f1a 100644
--- a/src/emu/sound/2203intf.h
+++ b/src/emu/sound/2203intf.h
@@ -24,6 +24,30 @@ READ8_DEVICE_HANDLER( ym2203_read_port_r );
WRITE8_DEVICE_HANDLER( ym2203_control_port_w );
WRITE8_DEVICE_HANDLER( ym2203_write_port_w );
-DECLARE_LEGACY_SOUND_DEVICE(YM2203, ym2203);
+class ym2203_device : public device_t,
+ public device_sound_interface
+{
+public:
+ ym2203_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~ym2203_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_stop();
+ virtual void device_reset();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type YM2203;
+
#endif /* __2203INTF_H__ */
diff --git a/src/emu/sound/2413intf.c b/src/emu/sound/2413intf.c
index ab4c738a1dc..6ea45579363 100644
--- a/src/emu/sound/2413intf.c
+++ b/src/emu/sound/2413intf.c
@@ -22,7 +22,7 @@ INLINE ym2413_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == YM2413);
- return (ym2413_state *)downcast<legacy_device_base *>(device)->token();
+ return (ym2413_state *)downcast<ym2413_device *>(device)->token();
}
@@ -142,4 +142,60 @@ DEVICE_GET_INFO( ym2413 )
}
-DEFINE_LEGACY_SOUND_DEVICE(YM2413, ym2413);
+const device_type YM2413 = &device_creator<ym2413_device>;
+
+ym2413_device::ym2413_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, YM2413, "YM2413", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(ym2413_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void ym2413_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void ym2413_device::device_start()
+{
+ DEVICE_START_NAME( ym2413 )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void ym2413_device::device_reset()
+{
+ DEVICE_RESET_NAME( ym2413 )(this);
+}
+
+//-------------------------------------------------
+// device_stop - device-specific stop
+//-------------------------------------------------
+
+void ym2413_device::device_stop()
+{
+ DEVICE_STOP_NAME( ym2413 )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void ym2413_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/emu/sound/2413intf.h b/src/emu/sound/2413intf.h
index 6ffaa0cc035..a6d7aa9180c 100644
--- a/src/emu/sound/2413intf.h
+++ b/src/emu/sound/2413intf.h
@@ -10,6 +10,30 @@ WRITE8_DEVICE_HANDLER( ym2413_w );
WRITE8_DEVICE_HANDLER( ym2413_register_port_w );
WRITE8_DEVICE_HANDLER( ym2413_data_port_w );
-DECLARE_LEGACY_SOUND_DEVICE(YM2413, ym2413);
+class ym2413_device : public device_t,
+ public device_sound_interface
+{
+public:
+ ym2413_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~ym2413_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_stop();
+ virtual void device_reset();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type YM2413;
+
#endif /* __2413INTF_H__ */
diff --git a/src/emu/sound/2608intf.c b/src/emu/sound/2608intf.c
index 85351acb165..be99536f274 100644
--- a/src/emu/sound/2608intf.c
+++ b/src/emu/sound/2608intf.c
@@ -32,7 +32,7 @@ INLINE ym2608_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == YM2608);
- return (ym2608_state *)downcast<legacy_device_base *>(device)->token();
+ return (ym2608_state *)downcast<ym2608_device *>(device)->token();
}
@@ -232,4 +232,60 @@ DEVICE_GET_INFO( ym2608 )
}
-DEFINE_LEGACY_SOUND_DEVICE(YM2608, ym2608);
+const device_type YM2608 = &device_creator<ym2608_device>;
+
+ym2608_device::ym2608_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, YM2608, "YM2608", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(ym2608_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void ym2608_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void ym2608_device::device_start()
+{
+ DEVICE_START_NAME( ym2608 )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void ym2608_device::device_reset()
+{
+ DEVICE_RESET_NAME( ym2608 )(this);
+}
+
+//-------------------------------------------------
+// device_stop - device-specific stop
+//-------------------------------------------------
+
+void ym2608_device::device_stop()
+{
+ DEVICE_STOP_NAME( ym2608 )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void ym2608_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/emu/sound/2608intf.h b/src/emu/sound/2608intf.h
index 8a8fb65dc26..1fbf0099891 100644
--- a/src/emu/sound/2608intf.h
+++ b/src/emu/sound/2608intf.h
@@ -29,6 +29,30 @@ WRITE8_DEVICE_HANDLER( ym2608_control_port_b_w );
WRITE8_DEVICE_HANDLER( ym2608_data_port_a_w );
WRITE8_DEVICE_HANDLER( ym2608_data_port_b_w );
-DECLARE_LEGACY_SOUND_DEVICE(YM2608, ym2608);
+class ym2608_device : public device_t,
+ public device_sound_interface
+{
+public:
+ ym2608_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~ym2608_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_stop();
+ virtual void device_reset();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type YM2608;
+
#endif /* __2608INTF_H__ */
diff --git a/src/emu/sound/2610intf.c b/src/emu/sound/2610intf.c
index cd64ee811e1..ec019e94536 100644
--- a/src/emu/sound/2610intf.c
+++ b/src/emu/sound/2610intf.c
@@ -32,7 +32,7 @@ INLINE ym2610_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == YM2610 || device->type() == YM2610B);
- return (ym2610_state *)downcast<legacy_device_base *>(device)->token();
+ return (ym2610_state *)downcast<ym2610_device *>(device)->token();
}
@@ -256,5 +256,84 @@ DEVICE_GET_INFO( ym2610b )
}
-DEFINE_LEGACY_SOUND_DEVICE(YM2610, ym2610);
-DEFINE_LEGACY_SOUND_DEVICE(YM2610B, ym2610b);
+const device_type YM2610 = &device_creator<ym2610_device>;
+
+ym2610_device::ym2610_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, YM2610, "YM2610", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(ym2610_state));
+}
+ym2610_device::ym2610_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, type, name, tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(ym2610_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void ym2610_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void ym2610_device::device_start()
+{
+ DEVICE_START_NAME( ym2610 )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void ym2610_device::device_reset()
+{
+ DEVICE_RESET_NAME( ym2610 )(this);
+}
+
+//-------------------------------------------------
+// device_stop - device-specific stop
+//-------------------------------------------------
+
+void ym2610_device::device_stop()
+{
+ DEVICE_STOP_NAME( ym2610 )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void ym2610_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
+const device_type YM2610B = &device_creator<ym2610b_device>;
+
+ym2610b_device::ym2610b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : ym2610_device(mconfig, YM2610B, "YM2610B", tag, owner, clock)
+{
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void ym2610b_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/emu/sound/2610intf.h b/src/emu/sound/2610intf.h
index d7a02856638..76d92a58e4d 100644
--- a/src/emu/sound/2610intf.h
+++ b/src/emu/sound/2610intf.h
@@ -28,7 +28,42 @@ WRITE8_DEVICE_HANDLER( ym2610_data_port_a_w );
WRITE8_DEVICE_HANDLER( ym2610_data_port_b_w );
-DECLARE_LEGACY_SOUND_DEVICE(YM2610, ym2610);
-DECLARE_LEGACY_SOUND_DEVICE(YM2610B, ym2610b);
+class ym2610_device : public device_t,
+ public device_sound_interface
+{
+public:
+ ym2610_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ym2610_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
+ ~ym2610_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_stop();
+ virtual void device_reset();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type YM2610;
+
+class ym2610b_device : public ym2610_device
+{
+public:
+ ym2610b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+};
+
+extern const device_type YM2610B;
+
#endif /* __2610INTF_H__ */
diff --git a/src/emu/sound/2612intf.c b/src/emu/sound/2612intf.c
index f6d95ad0452..f1e58eb7cdd 100644
--- a/src/emu/sound/2612intf.c
+++ b/src/emu/sound/2612intf.c
@@ -31,7 +31,7 @@ INLINE ym2612_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == YM2612 || device->type() == YM3438);
- return (ym2612_state *)downcast<legacy_device_base *>(device)->token();
+ return (ym2612_state *)downcast<ym2612_device *>(device)->token();
}
@@ -198,5 +198,84 @@ DEVICE_GET_INFO( ym3438 )
}
-DEFINE_LEGACY_SOUND_DEVICE(YM2612, ym2612);
-DEFINE_LEGACY_SOUND_DEVICE(YM3438, ym3438);
+const device_type YM2612 = &device_creator<ym2612_device>;
+
+ym2612_device::ym2612_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, YM2612, "YM2612", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(ym2612_state));
+}
+ym2612_device::ym2612_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, type, name, tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(ym2612_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void ym2612_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void ym2612_device::device_start()
+{
+ DEVICE_START_NAME( ym2612 )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void ym2612_device::device_reset()
+{
+ DEVICE_RESET_NAME( ym2612 )(this);
+}
+
+//-------------------------------------------------
+// device_stop - device-specific stop
+//-------------------------------------------------
+
+void ym2612_device::device_stop()
+{
+ DEVICE_STOP_NAME( ym2612 )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void ym2612_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
+const device_type YM3438 = &device_creator<ym3438_device>;
+
+ym3438_device::ym3438_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : ym2612_device(mconfig, YM3438, "YM3438", tag, owner, clock)
+{
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void ym3438_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/emu/sound/2612intf.h b/src/emu/sound/2612intf.h
index 61a9294e484..f7653a6d114 100644
--- a/src/emu/sound/2612intf.h
+++ b/src/emu/sound/2612intf.h
@@ -27,7 +27,32 @@ WRITE8_DEVICE_HANDLER( ym2612_data_port_a_w );
WRITE8_DEVICE_HANDLER( ym2612_data_port_b_w );
-DECLARE_LEGACY_SOUND_DEVICE(YM2612, ym2612);
+class ym2612_device : public device_t,
+ public device_sound_interface
+{
+public:
+ ym2612_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ym2612_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
+ ~ym2612_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_stop();
+ virtual void device_reset();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type YM2612;
+
typedef struct _ym3438_interface ym3438_interface;
@@ -51,6 +76,16 @@ struct _ym3438_interface
#define ym3438_data_port_b_w ym2612_data_port_b_w
-DECLARE_LEGACY_SOUND_DEVICE(YM3438, ym3438);
+class ym3438_device : public ym2612_device
+{
+public:
+ ym3438_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+};
+
+extern const device_type YM3438;
+
#endif /* __2612INTF_H__ */
diff --git a/src/emu/sound/262intf.c b/src/emu/sound/262intf.c
index de329c7eaf9..8c257156fb4 100644
--- a/src/emu/sound/262intf.c
+++ b/src/emu/sound/262intf.c
@@ -25,7 +25,7 @@ INLINE ymf262_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == YMF262);
- return (ymf262_state *)downcast<legacy_device_base *>(device)->token();
+ return (ymf262_state *)downcast<ymf262_device *>(device)->token();
}
@@ -158,4 +158,60 @@ DEVICE_GET_INFO( ymf262 )
}
-DEFINE_LEGACY_SOUND_DEVICE(YMF262, ymf262);
+const device_type YMF262 = &device_creator<ymf262_device>;
+
+ymf262_device::ymf262_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, YMF262, "YMF262", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(ymf262_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void ymf262_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void ymf262_device::device_start()
+{
+ DEVICE_START_NAME( ymf262 )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void ymf262_device::device_reset()
+{
+ DEVICE_RESET_NAME( ymf262 )(this);
+}
+
+//-------------------------------------------------
+// device_stop - device-specific stop
+//-------------------------------------------------
+
+void ymf262_device::device_stop()
+{
+ DEVICE_STOP_NAME( ymf262 )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void ymf262_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/emu/sound/262intf.h b/src/emu/sound/262intf.h
index a458273ae47..0224f2e40a4 100644
--- a/src/emu/sound/262intf.h
+++ b/src/emu/sound/262intf.h
@@ -23,6 +23,30 @@ WRITE8_DEVICE_HANDLER( ymf262_data_a_w );
WRITE8_DEVICE_HANDLER( ymf262_data_b_w );
-DECLARE_LEGACY_SOUND_DEVICE(YMF262, ymf262);
+class ymf262_device : public device_t,
+ public device_sound_interface
+{
+public:
+ ymf262_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~ymf262_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_stop();
+ virtual void device_reset();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type YMF262;
+
#endif /* __262INTF_H__ */
diff --git a/src/emu/sound/3526intf.c b/src/emu/sound/3526intf.c
index 87909df9e4b..789a4be28e1 100644
--- a/src/emu/sound/3526intf.c
+++ b/src/emu/sound/3526intf.c
@@ -39,7 +39,7 @@ INLINE ym3526_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == YM3526);
- return (ym3526_state *)downcast<legacy_device_base *>(device)->token();
+ return (ym3526_state *)downcast<ym3526_device *>(device)->token();
}
@@ -171,4 +171,60 @@ DEVICE_GET_INFO( ym3526 )
}
-DEFINE_LEGACY_SOUND_DEVICE(YM3526, ym3526);
+const device_type YM3526 = &device_creator<ym3526_device>;
+
+ym3526_device::ym3526_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, YM3526, "YM3526", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(ym3526_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void ym3526_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void ym3526_device::device_start()
+{
+ DEVICE_START_NAME( ym3526 )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void ym3526_device::device_reset()
+{
+ DEVICE_RESET_NAME( ym3526 )(this);
+}
+
+//-------------------------------------------------
+// device_stop - device-specific stop
+//-------------------------------------------------
+
+void ym3526_device::device_stop()
+{
+ DEVICE_STOP_NAME( ym3526 )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void ym3526_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/emu/sound/3526intf.h b/src/emu/sound/3526intf.h
index c3f81ea2c88..602bb1e74a0 100644
--- a/src/emu/sound/3526intf.h
+++ b/src/emu/sound/3526intf.h
@@ -19,6 +19,30 @@ READ8_DEVICE_HANDLER( ym3526_read_port_r );
WRITE8_DEVICE_HANDLER( ym3526_control_port_w );
WRITE8_DEVICE_HANDLER( ym3526_write_port_w );
-DECLARE_LEGACY_SOUND_DEVICE(YM3526, ym3526);
+class ym3526_device : public device_t,
+ public device_sound_interface
+{
+public:
+ ym3526_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~ym3526_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_stop();
+ virtual void device_reset();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type YM3526;
+
#endif /* __3526INTF_H__ */
diff --git a/src/emu/sound/3812intf.c b/src/emu/sound/3812intf.c
index 25d97861131..02b5bb15dab 100644
--- a/src/emu/sound/3812intf.c
+++ b/src/emu/sound/3812intf.c
@@ -37,7 +37,7 @@ INLINE ym3812_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == YM3812);
- return (ym3812_state *)downcast<legacy_device_base *>(device)->token();
+ return (ym3812_state *)downcast<ym3812_device *>(device)->token();
}
@@ -167,4 +167,60 @@ DEVICE_GET_INFO( ym3812 )
}
-DEFINE_LEGACY_SOUND_DEVICE(YM3812, ym3812);
+const device_type YM3812 = &device_creator<ym3812_device>;
+
+ym3812_device::ym3812_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, YM3812, "YM3812", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(ym3812_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void ym3812_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void ym3812_device::device_start()
+{
+ DEVICE_START_NAME( ym3812 )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void ym3812_device::device_reset()
+{
+ DEVICE_RESET_NAME( ym3812 )(this);
+}
+
+//-------------------------------------------------
+// device_stop - device-specific stop
+//-------------------------------------------------
+
+void ym3812_device::device_stop()
+{
+ DEVICE_STOP_NAME( ym3812 )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void ym3812_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/emu/sound/3812intf.h b/src/emu/sound/3812intf.h
index 0ef383e3416..1314c315a7f 100644
--- a/src/emu/sound/3812intf.h
+++ b/src/emu/sound/3812intf.h
@@ -19,6 +19,30 @@ READ8_DEVICE_HANDLER( ym3812_read_port_r );
WRITE8_DEVICE_HANDLER( ym3812_control_port_w );
WRITE8_DEVICE_HANDLER( ym3812_write_port_w );
-DECLARE_LEGACY_SOUND_DEVICE(YM3812, ym3812);
+class ym3812_device : public device_t,
+ public device_sound_interface
+{
+public:
+ ym3812_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~ym3812_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_stop();
+ virtual void device_reset();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type YM3812;
+
#endif /* __3812INTF_H__ */
diff --git a/src/emu/sound/8950intf.c b/src/emu/sound/8950intf.c
index aa75ef39a69..13c365689f5 100644
--- a/src/emu/sound/8950intf.c
+++ b/src/emu/sound/8950intf.c
@@ -37,7 +37,7 @@ INLINE y8950_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == Y8950);
- return (y8950_state *)downcast<legacy_device_base *>(device)->token();
+ return (y8950_state *)downcast<y8950_device *>(device)->token();
}
@@ -200,4 +200,60 @@ DEVICE_GET_INFO( y8950 )
}
-DEFINE_LEGACY_SOUND_DEVICE(Y8950, y8950);
+const device_type Y8950 = &device_creator<y8950_device>;
+
+y8950_device::y8950_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, Y8950, "Y8950", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(y8950_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void y8950_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void y8950_device::device_start()
+{
+ DEVICE_START_NAME( y8950 )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void y8950_device::device_reset()
+{
+ DEVICE_RESET_NAME( y8950 )(this);
+}
+
+//-------------------------------------------------
+// device_stop - device-specific stop
+//-------------------------------------------------
+
+void y8950_device::device_stop()
+{
+ DEVICE_STOP_NAME( y8950 )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void y8950_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/emu/sound/8950intf.h b/src/emu/sound/8950intf.h
index eab9d8208d7..3607ee96fba 100644
--- a/src/emu/sound/8950intf.h
+++ b/src/emu/sound/8950intf.h
@@ -24,6 +24,30 @@ READ8_DEVICE_HANDLER( y8950_read_port_r );
WRITE8_DEVICE_HANDLER( y8950_control_port_w );
WRITE8_DEVICE_HANDLER( y8950_write_port_w );
-DECLARE_LEGACY_SOUND_DEVICE(Y8950, y8950);
+class y8950_device : public device_t,
+ public device_sound_interface
+{
+public:
+ y8950_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~y8950_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_stop();
+ virtual void device_reset();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type Y8950;
+
#endif /* __8950INTF_H__ */
diff --git a/src/emu/sound/aica.c b/src/emu/sound/aica.c
index fc35f727e00..1a1aa88b4f9 100644
--- a/src/emu/sound/aica.c
+++ b/src/emu/sound/aica.c
@@ -217,7 +217,7 @@ INLINE aica_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == AICA);
- return (aica_state *)downcast<legacy_device_base *>(device)->token();
+ return (aica_state *)downcast<aica_device *>(device)->token();
}
static unsigned char DecodeSCI(aica_state *AICA, unsigned char irq)
@@ -1380,4 +1380,51 @@ DEVICE_GET_INFO( aica )
-DEFINE_LEGACY_SOUND_DEVICE(AICA, aica);
+const device_type AICA = &device_creator<aica_device>;
+
+aica_device::aica_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, AICA, "AICA", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(aica_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void aica_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void aica_device::device_start()
+{
+ DEVICE_START_NAME( aica )(this);
+}
+
+//-------------------------------------------------
+// device_stop - device-specific stop
+//-------------------------------------------------
+
+void aica_device::device_stop()
+{
+ DEVICE_STOP_NAME( aica )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void aica_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/emu/sound/aica.h b/src/emu/sound/aica.h
index cacee5de1cd..39313dcfd99 100644
--- a/src/emu/sound/aica.h
+++ b/src/emu/sound/aica.h
@@ -26,6 +26,29 @@ WRITE16_DEVICE_HANDLER( aica_w );
WRITE16_DEVICE_HANDLER( aica_midi_in );
READ16_DEVICE_HANDLER( aica_midi_out_r );
-DECLARE_LEGACY_SOUND_DEVICE(AICA, aica);
+class aica_device : public device_t,
+ public device_sound_interface
+{
+public:
+ aica_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~aica_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_stop();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type AICA;
+
#endif /* __AICA_H__ */
diff --git a/src/emu/sound/astrocde.c b/src/emu/sound/astrocde.c
index 3ae7112fb7a..dac4a27fc29 100644
--- a/src/emu/sound/astrocde.c
+++ b/src/emu/sound/astrocde.c
@@ -73,7 +73,7 @@ INLINE astrocade_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == ASTROCADE);
- return (astrocade_state *)downcast<legacy_device_base *>(device)->token();
+ return (astrocade_state *)downcast<astrocade_device *>(device)->token();
}
@@ -331,4 +331,51 @@ DEVICE_GET_INFO( astrocade )
}
-DEFINE_LEGACY_SOUND_DEVICE(ASTROCADE, astrocade);
+const device_type ASTROCADE = &device_creator<astrocade_device>;
+
+astrocade_device::astrocade_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, ASTROCADE, "Astrocade", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(astrocade_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void astrocade_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void astrocade_device::device_start()
+{
+ DEVICE_START_NAME( astrocade )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void astrocade_device::device_reset()
+{
+ DEVICE_RESET_NAME( astrocade )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void astrocade_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/emu/sound/astrocde.h b/src/emu/sound/astrocde.h
index afcf03d18e1..ac3ddab5ec9 100644
--- a/src/emu/sound/astrocde.h
+++ b/src/emu/sound/astrocde.h
@@ -7,6 +7,29 @@
WRITE8_DEVICE_HANDLER( astrocade_sound_w );
-DECLARE_LEGACY_SOUND_DEVICE(ASTROCADE, astrocade);
+class astrocade_device : public device_t,
+ public device_sound_interface
+{
+public:
+ astrocade_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~astrocade_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_reset();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type ASTROCADE;
+
#endif /* __ASTROCDE_H__ */
diff --git a/src/emu/sound/ay8910.c b/src/emu/sound/ay8910.c
index b70b6ddf375..78e97d5c54d 100644
--- a/src/emu/sound/ay8910.c
+++ b/src/emu/sound/ay8910.c
@@ -208,7 +208,7 @@ INLINE ay8910_context *get_safe_token(device_t *device)
device->type() == YM3439 ||
device->type() == YMZ284 ||
device->type() == YMZ294);
- return (ay8910_context *)downcast<legacy_device_base *>(device)->token();
+ return (ay8910_context *)downcast<ay8910_device *>(device)->token();
}
@@ -1000,7 +1000,6 @@ DEVICE_GET_INFO( ay8912 )
{
switch (state)
{
- case DEVINFO_FCT_START: info->start = DEVICE_START_NAME( ay8910 ); break;
case DEVINFO_STR_NAME: strcpy(info->s, "AY-3-8912A"); break;
default: DEVICE_GET_INFO_CALL(ay8910); break;
}
@@ -1010,7 +1009,6 @@ DEVICE_GET_INFO( ay8913 )
{
switch (state)
{
- case DEVINFO_FCT_START: info->start = DEVICE_START_NAME( ay8910 ); break;
case DEVINFO_STR_NAME: strcpy(info->s, "AY-3-8913A"); break;
default: DEVICE_GET_INFO_CALL(ay8910); break;
}
@@ -1020,7 +1018,6 @@ DEVICE_GET_INFO( ay8914 )
{
switch (state)
{
- case DEVINFO_FCT_START: info->start = DEVICE_START_NAME( ay8910 ); break;
case DEVINFO_STR_NAME: strcpy(info->s, "AY-3-8914"); break;
default: DEVICE_GET_INFO_CALL(ay8910); break;
}
@@ -1030,7 +1027,6 @@ DEVICE_GET_INFO( ay8930 )
{
switch (state)
{
- case DEVINFO_FCT_START: info->start = DEVICE_START_NAME( ay8910 ); break;
case DEVINFO_STR_NAME: strcpy(info->s, "AY8930"); break;
default: DEVICE_GET_INFO_CALL(ay8910); break;
}
@@ -1050,9 +1046,8 @@ DEVICE_GET_INFO( ym3439 )
{
switch (state)
{
- case DEVINFO_FCT_START: info->start = DEVICE_START_NAME( ym2149 ); break;
case DEVINFO_STR_NAME: strcpy(info->s, "YM3439"); break;
- default: DEVICE_GET_INFO_CALL(ay8910); break;
+ default: DEVICE_GET_INFO_CALL(ym2149); break;
}
}
@@ -1060,9 +1055,8 @@ DEVICE_GET_INFO( ymz284 )
{
switch (state)
{
- case DEVINFO_FCT_START: info->start = DEVICE_START_NAME( ym2149 ); break;
case DEVINFO_STR_NAME: strcpy(info->s, "YMZ284"); break;
- default: DEVICE_GET_INFO_CALL(ay8910); break;
+ default: DEVICE_GET_INFO_CALL(ym2149); break;
}
}
@@ -1070,9 +1064,8 @@ DEVICE_GET_INFO( ymz294 )
{
switch (state)
{
- case DEVINFO_FCT_START: info->start = DEVICE_START_NAME( ym2149 ); break;
case DEVINFO_STR_NAME: strcpy(info->s, "YMZ294"); break;
- default: DEVICE_GET_INFO_CALL(ay8910); break;
+ default: DEVICE_GET_INFO_CALL(ym2149); break;
}
}
@@ -1139,12 +1132,223 @@ WRITE8_DEVICE_HANDLER( ay8914_w )
-DEFINE_LEGACY_SOUND_DEVICE(AY8910, ay8910);
-DEFINE_LEGACY_SOUND_DEVICE(AY8912, ay8912);
-DEFINE_LEGACY_SOUND_DEVICE(AY8913, ay8913);
-DEFINE_LEGACY_SOUND_DEVICE(AY8914, ay8914);
-DEFINE_LEGACY_SOUND_DEVICE(AY8930, ay8930);
-DEFINE_LEGACY_SOUND_DEVICE(YM2149, ym2149);
-DEFINE_LEGACY_SOUND_DEVICE(YM3439, ym3439);
-DEFINE_LEGACY_SOUND_DEVICE(YMZ284, ymz284);
-DEFINE_LEGACY_SOUND_DEVICE(YMZ294, ymz294);
+const device_type AY8910 = &device_creator<ay8910_device>;
+
+ay8910_device::ay8910_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, AY8910, "AY-3-8910A", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(ay8910_context));
+}
+ay8910_device::ay8910_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, type, name, tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(ay8910_context));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void ay8910_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void ay8910_device::device_start()
+{
+ DEVICE_START_NAME( ay8910 )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void ay8910_device::device_reset()
+{
+ DEVICE_RESET_NAME( ay8910 )(this);
+}
+
+//-------------------------------------------------
+// device_stop - device-specific stop
+//-------------------------------------------------
+
+void ay8910_device::device_stop()
+{
+ DEVICE_STOP_NAME( ay8910 )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void ay8910_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
+const device_type AY8912 = &device_creator<ay8912_device>;
+
+ay8912_device::ay8912_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : ay8910_device(mconfig, AY8912, "AY-3-8912A", tag, owner, clock)
+{
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void ay8912_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
+const device_type AY8913 = &device_creator<ay8913_device>;
+
+ay8913_device::ay8913_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : ay8910_device(mconfig, AY8913, "AY-3-8913A", tag, owner, clock)
+{
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void ay8913_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
+const device_type AY8914 = &device_creator<ay8914_device>;
+
+ay8914_device::ay8914_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : ay8910_device(mconfig, AY8914, "AY-3-8914", tag, owner, clock)
+{
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void ay8914_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
+const device_type AY8930 = &device_creator<ay8930_device>;
+
+ay8930_device::ay8930_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : ay8910_device(mconfig, AY8930, "AY8930", tag, owner, clock)
+{
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void ay8930_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
+const device_type YM2149 = &device_creator<ym2149_device>;
+
+ym2149_device::ym2149_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : ay8910_device(mconfig, YM2149, "YM2149", tag, owner, clock)
+{
+}
+ym2149_device::ym2149_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
+ : ay8910_device(mconfig, type, name, tag, owner, clock)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void ym2149_device::device_start()
+{
+ DEVICE_START_NAME( ym2149 )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void ym2149_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
+const device_type YM3439 = &device_creator<ym3439_device>;
+
+ym3439_device::ym3439_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : ym2149_device(mconfig, YM3439, "YM3439", tag, owner, clock)
+{
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void ym3439_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
+const device_type YMZ284 = &device_creator<ymz284_device>;
+
+ymz284_device::ymz284_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : ym2149_device(mconfig, YMZ284, "YMZ284", tag, owner, clock)
+{
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void ymz284_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
+const device_type YMZ294 = &device_creator<ymz294_device>;
+
+ymz294_device::ymz294_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : ym2149_device(mconfig, YMZ294, "YMZ294", tag, owner, clock)
+{
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void ymz294_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/emu/sound/ay8910.h b/src/emu/sound/ay8910.h
index a6088a12a3f..7a67c1cefe0 100644
--- a/src/emu/sound/ay8910.h
+++ b/src/emu/sound/ay8910.h
@@ -119,14 +119,123 @@ void ay8910_set_clock_ym(void *chip, int clock);
void ay8910_write_ym(void *chip, int addr, int data);
int ay8910_read_ym(void *chip);
-DECLARE_LEGACY_SOUND_DEVICE(AY8910, ay8910);
-DECLARE_LEGACY_SOUND_DEVICE(AY8912, ay8912);
-DECLARE_LEGACY_SOUND_DEVICE(AY8913, ay8913);
-DECLARE_LEGACY_SOUND_DEVICE(AY8914, ay8914);
-DECLARE_LEGACY_SOUND_DEVICE(AY8930, ay8930);
-DECLARE_LEGACY_SOUND_DEVICE(YM2149, ym2149);
-DECLARE_LEGACY_SOUND_DEVICE(YM3439, ym3439);
-DECLARE_LEGACY_SOUND_DEVICE(YMZ284, ymz284);
-DECLARE_LEGACY_SOUND_DEVICE(YMZ294, ymz294);
+class ay8910_device : public device_t,
+ public device_sound_interface
+{
+public:
+ ay8910_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ay8910_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
+ ~ay8910_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_stop();
+ virtual void device_reset();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type AY8910;
+
+class ay8912_device : public ay8910_device
+{
+public:
+ ay8912_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+};
+
+extern const device_type AY8912;
+
+class ay8913_device : public ay8910_device
+{
+public:
+ ay8913_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+};
+
+extern const device_type AY8913;
+
+class ay8914_device : public ay8910_device
+{
+public:
+ ay8914_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+};
+
+extern const device_type AY8914;
+
+class ay8930_device : public ay8910_device
+{
+public:
+ ay8930_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+};
+
+extern const device_type AY8930;
+
+class ym2149_device : public ay8910_device
+{
+public:
+ ym2149_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ym2149_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
+protected:
+ // device-level overrides
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+};
+
+extern const device_type YM2149;
+
+class ym3439_device : public ym2149_device
+{
+public:
+ ym3439_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+};
+
+extern const device_type YM3439;
+
+class ymz284_device : public ym2149_device
+{
+public:
+ ymz284_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+};
+
+extern const device_type YMZ284;
+
+class ymz294_device : public ym2149_device
+{
+public:
+ ymz294_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+};
+
+extern const device_type YMZ294;
+
#endif /* __AY8910_H__ */
diff --git a/src/emu/sound/beep.c b/src/emu/sound/beep.c
index fc5f9d5e124..29844737f39 100644
--- a/src/emu/sound/beep.c
+++ b/src/emu/sound/beep.c
@@ -32,7 +32,7 @@ INLINE beep_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == BEEP);
- return (beep_state *)downcast<legacy_device_base *>(device)->token();
+ return (beep_state *)downcast<beep_device *>(device)->token();
}
@@ -189,4 +189,42 @@ DEVICE_GET_INFO( beep )
}
-DEFINE_LEGACY_SOUND_DEVICE(BEEP, beep);
+const device_type BEEP = &device_creator<beep_device>;
+
+beep_device::beep_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, BEEP, "Beep", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(beep_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void beep_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void beep_device::device_start()
+{
+ DEVICE_START_NAME( beep )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void beep_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/emu/sound/beep.h b/src/emu/sound/beep.h
index 62a31952554..920ce25f367 100644
--- a/src/emu/sound/beep.h
+++ b/src/emu/sound/beep.h
@@ -11,6 +11,28 @@ void beep_set_state(device_t *device, int on);
void beep_set_frequency(device_t *device, int frequency);
void beep_set_volume(device_t *device, int volume);
-DECLARE_LEGACY_SOUND_DEVICE(BEEP, beep);
+class beep_device : public device_t,
+ public device_sound_interface
+{
+public:
+ beep_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~beep_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type BEEP;
+
#endif /* __BEEP_H__ */
diff --git a/src/emu/sound/c140.c b/src/emu/sound/c140.c
index e91c5bea8dc..bf13c26d4a7 100644
--- a/src/emu/sound/c140.c
+++ b/src/emu/sound/c140.c
@@ -109,7 +109,7 @@ INLINE c140_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == C140);
- return (c140_state *)downcast<legacy_device_base *>(device)->token();
+ return (c140_state *)downcast<c140_device *>(device)->token();
}
@@ -504,4 +504,42 @@ DEVICE_GET_INFO( c140 )
}
-DEFINE_LEGACY_SOUND_DEVICE(C140, c140);
+const device_type C140 = &device_creator<c140_device>;
+
+c140_device::c140_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, C140, "C140", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(c140_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void c140_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void c140_device::device_start()
+{
+ DEVICE_START_NAME( c140 )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void c140_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/emu/sound/c140.h b/src/emu/sound/c140.h
index fd90212c06e..f5942a6cbcd 100644
--- a/src/emu/sound/c140.h
+++ b/src/emu/sound/c140.h
@@ -24,6 +24,28 @@ struct _c140_interface {
int banking_type;
};
-DECLARE_LEGACY_SOUND_DEVICE(C140, c140);
+class c140_device : public device_t,
+ public device_sound_interface
+{
+public:
+ c140_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~c140_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type C140;
+
#endif /* __C140_H__ */
diff --git a/src/emu/sound/c6280.c b/src/emu/sound/c6280.c
index 27b6812aa6f..59ab9e5e595 100644
--- a/src/emu/sound/c6280.c
+++ b/src/emu/sound/c6280.c
@@ -86,7 +86,7 @@ INLINE c6280_t *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == C6280);
- return (c6280_t *)downcast<legacy_device_base *>(device)->token();
+ return (c6280_t *)downcast<c6280_device *>(device)->token();
}
@@ -372,4 +372,42 @@ DEVICE_GET_INFO( c6280 )
}
-DEFINE_LEGACY_SOUND_DEVICE(C6280, c6280);
+const device_type C6280 = &device_creator<c6280_device>;
+
+c6280_device::c6280_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, C6280, "HuC6280", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(c6280_t));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void c6280_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void c6280_device::device_start()
+{
+ DEVICE_START_NAME( c6280 )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void c6280_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/emu/sound/c6280.h b/src/emu/sound/c6280.h
index fe61983268c..029d2caa042 100644
--- a/src/emu/sound/c6280.h
+++ b/src/emu/sound/c6280.h
@@ -15,6 +15,28 @@ struct _c6280_interface
WRITE8_DEVICE_HANDLER( c6280_w );
READ8_DEVICE_HANDLER( c6280_r );
-DECLARE_LEGACY_SOUND_DEVICE(C6280, c6280);
+class c6280_device : public device_t,
+ public device_sound_interface
+{
+public:
+ c6280_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~c6280_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type C6280;
+
#endif /* __C6280_H__ */
diff --git a/src/emu/sound/cdda.c b/src/emu/sound/cdda.c
index 8b4a9af1118..309891154b2 100644
--- a/src/emu/sound/cdda.c
+++ b/src/emu/sound/cdda.c
@@ -25,7 +25,7 @@ INLINE cdda_info *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == CDDA);
- return (cdda_info *)downcast<legacy_device_base *>(device)->token();
+ return (cdda_info *)downcast<cdda_device *>(device)->token();
}
#define MAX_SECTORS ( 4 )
@@ -339,4 +339,42 @@ DEVICE_GET_INFO( cdda )
}
-DEFINE_LEGACY_SOUND_DEVICE(CDDA, cdda);
+const device_type CDDA = &device_creator<cdda_device>;
+
+cdda_device::cdda_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, CDDA, "CD/DA", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(cdda_info));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void cdda_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void cdda_device::device_start()
+{
+ DEVICE_START_NAME( cdda )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void cdda_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/emu/sound/cdda.h b/src/emu/sound/cdda.h
index 0c9c605978b..5535e4ffebd 100644
--- a/src/emu/sound/cdda.h
+++ b/src/emu/sound/cdda.h
@@ -19,6 +19,28 @@ int cdda_audio_active(device_t *device);
int cdda_audio_paused(device_t *device);
int cdda_audio_ended(device_t *device);
-DECLARE_LEGACY_SOUND_DEVICE(CDDA, cdda);
+class cdda_device : public device_t,
+ public device_sound_interface
+{
+public:
+ cdda_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~cdda_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type CDDA;
+
#endif /* __CDDA_H__ */
diff --git a/src/emu/sound/cem3394.c b/src/emu/sound/cem3394.c
index c264bb8e614..388baf1e9a2 100644
--- a/src/emu/sound/cem3394.c
+++ b/src/emu/sound/cem3394.c
@@ -141,7 +141,7 @@ INLINE cem3394_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == CEM3394);
- return (cem3394_state *)downcast<legacy_device_base *>(device)->token();
+ return (cem3394_state *)downcast<cem3394_device *>(device)->token();
}
@@ -586,4 +586,42 @@ DEVICE_GET_INFO( cem3394 )
}
-DEFINE_LEGACY_SOUND_DEVICE(CEM3394, cem3394);
+const device_type CEM3394 = &device_creator<cem3394_device>;
+
+cem3394_device::cem3394_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, CEM3394, "CEM3394", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(cem3394_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void cem3394_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void cem3394_device::device_start()
+{
+ DEVICE_START_NAME( cem3394 )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void cem3394_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/emu/sound/cem3394.h b/src/emu/sound/cem3394.h
index 450e80ef670..0382e2b96a7 100644
--- a/src/emu/sound/cem3394.h
+++ b/src/emu/sound/cem3394.h
@@ -45,6 +45,28 @@ void cem3394_set_voltage(device_t *device, int input, double voltage);
CEM3394_FINAL_GAIN: gain, in dB */
double cem3394_get_parameter(device_t *device, int input);
-DECLARE_LEGACY_SOUND_DEVICE(CEM3394, cem3394);
+class cem3394_device : public device_t,
+ public device_sound_interface
+{
+public:
+ cem3394_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~cem3394_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type CEM3394;
+
#endif /* __CEM3394_H__ */
diff --git a/src/emu/sound/digitalk.c b/src/emu/sound/digitalk.c
index 3d568c64642..2410e2b052e 100644
--- a/src/emu/sound/digitalk.c
+++ b/src/emu/sound/digitalk.c
@@ -288,7 +288,7 @@ INLINE digitalker *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == DIGITALKER);
- return (digitalker *)downcast<legacy_device_base *>(device)->token();
+ return (digitalker *)downcast<digitalker_device *>(device)->token();
}
@@ -705,4 +705,42 @@ WRITE8_DEVICE_HANDLER( digitalker_data_w )
}
-DEFINE_LEGACY_SOUND_DEVICE(DIGITALKER, digitalker);
+const device_type DIGITALKER = &device_creator<digitalker_device>;
+
+digitalker_device::digitalker_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, DIGITALKER, "Digitalker", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(digitalker));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void digitalker_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void digitalker_device::device_start()
+{
+ DEVICE_START_NAME( digitalker )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void digitalker_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/emu/sound/digitalk.h b/src/emu/sound/digitalk.h
index 0a5f232d5e9..805c245e033 100644
--- a/src/emu/sound/digitalk.h
+++ b/src/emu/sound/digitalk.h
@@ -9,6 +9,28 @@ void digitalker_0_wr_w(device_t *device, int line);
int digitalker_0_intr_r(device_t *device);
WRITE8_DEVICE_HANDLER(digitalker_data_w);
-DECLARE_LEGACY_SOUND_DEVICE(DIGITALKER, digitalker);
+class digitalker_device : public device_t,
+ public device_sound_interface
+{
+public:
+ digitalker_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~digitalker_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type DIGITALKER;
+
#endif
diff --git a/src/emu/sound/dmadac.c b/src/emu/sound/dmadac.c
index 9a8d6613235..2d7a4c3e173 100644
--- a/src/emu/sound/dmadac.c
+++ b/src/emu/sound/dmadac.c
@@ -59,7 +59,7 @@ INLINE dmadac_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == DMADAC);
- return (dmadac_state *)downcast<legacy_device_base *>(device)->token();
+ return (dmadac_state *)downcast<dmadac_sound_device *>(device)->token();
}
@@ -262,4 +262,42 @@ DEVICE_GET_INFO( dmadac_sound )
}
-DEFINE_LEGACY_SOUND_DEVICE(DMADAC, dmadac_sound);
+const device_type DMADAC = &device_creator<dmadac_sound_device>;
+
+dmadac_sound_device::dmadac_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, DMADAC, "DMA-driven DAC", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(dmadac_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void dmadac_sound_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void dmadac_sound_device::device_start()
+{
+ DEVICE_START_NAME( dmadac )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void dmadac_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/emu/sound/dmadac.h b/src/emu/sound/dmadac.h
index eee3ab6d792..3c6d518501f 100644
--- a/src/emu/sound/dmadac.h
+++ b/src/emu/sound/dmadac.h
@@ -12,7 +12,29 @@
#include "devlegcy.h"
-DECLARE_LEGACY_SOUND_DEVICE(DMADAC, dmadac_sound);
+class dmadac_sound_device : public device_t,
+ public device_sound_interface
+{
+public:
+ dmadac_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~dmadac_sound_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type DMADAC;
+
void dmadac_transfer(dmadac_sound_device **devlist, UINT8 num_channels, offs_t channel_spacing, offs_t frame_spacing, offs_t total_frames, INT16 *data);
void dmadac_enable(dmadac_sound_device **devlist, UINT8 num_channels, UINT8 enable);
diff --git a/src/emu/sound/es5506.c b/src/emu/sound/es5506.c
index 9981509ad42..d3610110d0d 100644
--- a/src/emu/sound/es5506.c
+++ b/src/emu/sound/es5506.c
@@ -205,7 +205,7 @@ INLINE es5506_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == ES5505 || device->type() == ES5506);
- return (es5506_state *)downcast<legacy_device_base *>(device)->token();
+ return (es5506_state *)downcast<es5505_device *>(device)->token();
}
@@ -2207,5 +2207,117 @@ DEVICE_GET_INFO( es5506 )
}
-DEFINE_LEGACY_SOUND_DEVICE(ES5505, es5505);
-DEFINE_LEGACY_SOUND_DEVICE(ES5506, es5506);
+const device_type ES5505 = &device_creator<es5505_device>;
+
+es5505_device::es5505_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, ES5505, "ES5505", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(es5506_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void es5505_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void es5505_device::device_start()
+{
+ DEVICE_START_NAME( es5505 )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void es5505_device::device_reset()
+{
+ DEVICE_RESET_NAME( es5505 )(this);
+}
+
+//-------------------------------------------------
+// device_stop - device-specific stop
+//-------------------------------------------------
+
+void es5505_device::device_stop()
+{
+ DEVICE_STOP_NAME( es5505 )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void es5505_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
+const device_type ES5506 = &device_creator<es5506_device>;
+
+es5506_device::es5506_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, ES5506, "ES5506", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(es5506_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void es5506_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void es5506_device::device_start()
+{
+ DEVICE_START_NAME( es5506 )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void es5506_device::device_reset()
+{
+ DEVICE_RESET_NAME( es5506 )(this);
+}
+
+//-------------------------------------------------
+// device_stop - device-specific stop
+//-------------------------------------------------
+
+void es5506_device::device_stop()
+{
+ DEVICE_STOP_NAME( es5506 )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void es5506_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/emu/sound/es5506.h b/src/emu/sound/es5506.h
index 502ed1e8a7a..7c7ca841837 100644
--- a/src/emu/sound/es5506.h
+++ b/src/emu/sound/es5506.h
@@ -25,7 +25,31 @@ READ16_DEVICE_HANDLER( es5505_r );
WRITE16_DEVICE_HANDLER( es5505_w );
void es5505_voice_bank_w(device_t *device, int voice, int bank);
-DECLARE_LEGACY_SOUND_DEVICE(ES5505, es5505);
+class es5505_device : public device_t,
+ public device_sound_interface
+{
+public:
+ es5505_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~es5505_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_stop();
+ virtual void device_reset();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type ES5505;
+
typedef struct _es5506_interface es5506_interface;
@@ -43,6 +67,30 @@ READ8_DEVICE_HANDLER( es5506_r );
WRITE8_DEVICE_HANDLER( es5506_w );
void es5506_voice_bank_w(device_t *device, int voice, int bank);
-DECLARE_LEGACY_SOUND_DEVICE(ES5506, es5506);
+class es5506_device : public device_t,
+ public device_sound_interface
+{
+public:
+ es5506_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~es5506_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_stop();
+ virtual void device_reset();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type ES5506;
+
#endif /* __ES5506_H__ */
diff --git a/src/emu/sound/es8712.c b/src/emu/sound/es8712.c
index 8cae3700798..191621756bf 100644
--- a/src/emu/sound/es8712.c
+++ b/src/emu/sound/es8712.c
@@ -51,7 +51,7 @@ INLINE es8712_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == ES8712);
- return (es8712_state *)downcast<legacy_device_base *>(device)->token();
+ return (es8712_state *)downcast<es8712_device *>(device)->token();
}
@@ -407,4 +407,51 @@ DEVICE_GET_INFO( es8712 )
}
-DEFINE_LEGACY_SOUND_DEVICE(ES8712, es8712);
+const device_type ES8712 = &device_creator<es8712_device>;
+
+es8712_device::es8712_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, ES8712, "ES8712", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(es8712_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void es8712_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void es8712_device::device_start()
+{
+ DEVICE_START_NAME( es8712 )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void es8712_device::device_reset()
+{
+ DEVICE_RESET_NAME( es8712 )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void es8712_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/emu/sound/es8712.h b/src/emu/sound/es8712.h
index e21c33e801f..c57a257cefb 100644
--- a/src/emu/sound/es8712.h
+++ b/src/emu/sound/es8712.h
@@ -13,6 +13,29 @@ void es8712_set_frequency(device_t *device, int frequency);
WRITE8_DEVICE_HANDLER( es8712_w );
-DECLARE_LEGACY_SOUND_DEVICE(ES8712, es8712);
+class es8712_device : public device_t,
+ public device_sound_interface
+{
+public:
+ es8712_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~es8712_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_reset();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type ES8712;
+
#endif /* __ES8712_H__ */
diff --git a/src/emu/sound/flt_rc.c b/src/emu/sound/flt_rc.c
index f17005d34c5..ed5fb61cfd6 100644
--- a/src/emu/sound/flt_rc.c
+++ b/src/emu/sound/flt_rc.c
@@ -15,7 +15,7 @@ INLINE filter_rc_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == FILTER_RC);
- return (filter_rc_state *)downcast<legacy_device_base *>(device)->token();
+ return (filter_rc_state *)downcast<filter_rc_device *>(device)->token();
}
const flt_rc_config flt_rc_ac_default = {FLT_RC_AC, 10000, 0, 0, CAP_U(1)};
@@ -137,4 +137,42 @@ DEVICE_GET_INFO( filter_rc )
}
-DEFINE_LEGACY_SOUND_DEVICE(FILTER_RC, filter_rc);
+const device_type FILTER_RC = &device_creator<filter_rc_device>;
+
+filter_rc_device::filter_rc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, FILTER_RC, "RC Filter", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(filter_rc_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void filter_rc_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void filter_rc_device::device_start()
+{
+ DEVICE_START_NAME( filter_rc )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void filter_rc_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/emu/sound/flt_rc.h b/src/emu/sound/flt_rc.h
index 8b109392ad0..3807f9e7d89 100644
--- a/src/emu/sound/flt_rc.h
+++ b/src/emu/sound/flt_rc.h
@@ -59,6 +59,28 @@ extern const flt_rc_config flt_rc_ac_default;
void filter_rc_set_RC(device_t *device, int type, double R1, double R2, double R3, double C);
-DECLARE_LEGACY_SOUND_DEVICE(FILTER_RC, filter_rc);
+class filter_rc_device : public device_t,
+ public device_sound_interface
+{
+public:
+ filter_rc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~filter_rc_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type FILTER_RC;
+
#endif /* __FLT_RC_H__ */
diff --git a/src/emu/sound/flt_vol.c b/src/emu/sound/flt_vol.c
index 27b354be948..9f173a16c8f 100644
--- a/src/emu/sound/flt_vol.c
+++ b/src/emu/sound/flt_vol.c
@@ -13,7 +13,7 @@ INLINE filter_volume_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == FILTER_VOLUME);
- return (filter_volume_state *)downcast<legacy_device_base *>(device)->token();
+ return (filter_volume_state *)downcast<filter_volume_device *>(device)->token();
}
@@ -72,4 +72,42 @@ DEVICE_GET_INFO( filter_volume )
}
-DEFINE_LEGACY_SOUND_DEVICE(FILTER_VOLUME, filter_volume);
+const device_type FILTER_VOLUME = &device_creator<filter_volume_device>;
+
+filter_volume_device::filter_volume_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, FILTER_VOLUME, "Volume Filter", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(filter_volume_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void filter_volume_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void filter_volume_device::device_start()
+{
+ DEVICE_START_NAME( filter_volume )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void filter_volume_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/emu/sound/flt_vol.h b/src/emu/sound/flt_vol.h
index 921148e09b3..9f7ce598b43 100644
--- a/src/emu/sound/flt_vol.h
+++ b/src/emu/sound/flt_vol.h
@@ -8,6 +8,28 @@
void flt_volume_set_volume(device_t *device, float volume);
-DECLARE_LEGACY_SOUND_DEVICE(FILTER_VOLUME, filter_volume);
+class filter_volume_device : public device_t,
+ public device_sound_interface
+{
+public:
+ filter_volume_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~filter_volume_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type FILTER_VOLUME;
+
#endif /* __FLT_VOL_H__ */
diff --git a/src/emu/sound/gaelco.c b/src/emu/sound/gaelco.c
index 248737ab3a6..0a889cf421c 100644
--- a/src/emu/sound/gaelco.c
+++ b/src/emu/sound/gaelco.c
@@ -78,7 +78,7 @@ INLINE gaelco_sound_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == GAELCO_GAE1 || device->type() == GAELCO_CG1V);
- return (gaelco_sound_state *)downcast<legacy_device_base *>(device)->token();
+ return (gaelco_sound_state *)downcast<gaelco_gae1_device *>(device)->token();
}
/*============================================================================
@@ -339,5 +339,64 @@ DEVICE_GET_INFO( gaelco_cg1v )
}
-DEFINE_LEGACY_SOUND_DEVICE(GAELCO_GAE1, gaelco_gae1);
-DEFINE_LEGACY_SOUND_DEVICE(GAELCO_CG1V, gaelco_cg1v);
+const device_type GAELCO_GAE1 = &device_creator<gaelco_gae1_device>;
+
+gaelco_gae1_device::gaelco_gae1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, GAELCO_GAE1, "Gaelco GAE1", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(gaelco_sound_state));
+}
+
+gaelco_gae1_device::gaelco_gae1_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, type, name, tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(gaelco_sound_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void gaelco_gae1_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void gaelco_gae1_device::device_start()
+{
+ DEVICE_START_NAME( gaelco )(this);
+}
+
+//-------------------------------------------------
+// device_stop - device-specific stop
+//-------------------------------------------------
+
+void gaelco_gae1_device::device_stop()
+{
+ DEVICE_STOP_NAME( gaelco )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void gaelco_gae1_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
+const device_type GAELCO_CG1V = &device_creator<gaelco_cg1v_device>;
+
+gaelco_cg1v_device::gaelco_cg1v_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : gaelco_gae1_device(mconfig, GAELCO_CG1V, "Gaelco CG1V", tag, owner, clock)
+{
+}
diff --git a/src/emu/sound/gaelco.h b/src/emu/sound/gaelco.h
index 0acfc044048..d6c3a9dd046 100644
--- a/src/emu/sound/gaelco.h
+++ b/src/emu/sound/gaelco.h
@@ -15,7 +15,38 @@ struct _gaelcosnd_interface
WRITE16_DEVICE_HANDLER( gaelcosnd_w );
READ16_DEVICE_HANDLER( gaelcosnd_r );
-DECLARE_LEGACY_SOUND_DEVICE(GAELCO_GAE1, gaelco_gae1);
-DECLARE_LEGACY_SOUND_DEVICE(GAELCO_CG1V, gaelco_cg1v);
+class gaelco_gae1_device : public device_t,
+ public device_sound_interface
+{
+public:
+ gaelco_gae1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ gaelco_gae1_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
+ ~gaelco_gae1_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_stop();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type GAELCO_GAE1;
+
+class gaelco_cg1v_device : public gaelco_gae1_device
+{
+public:
+ gaelco_cg1v_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
+extern const device_type GAELCO_CG1V;
+
#endif /* __GALELCO_H__ */
diff --git a/src/emu/sound/hc55516.c b/src/emu/sound/hc55516.c
index 58d4d862886..109dde9c51b 100644
--- a/src/emu/sound/hc55516.c
+++ b/src/emu/sound/hc55516.c
@@ -57,7 +57,7 @@ INLINE hc55516_state *get_safe_token(device_t *device)
assert(device->type() == HC55516 ||
device->type() == MC3417 ||
device->type() == MC3418);
- return (hc55516_state *)downcast<legacy_device_base *>(device)->token();
+ return (hc55516_state *)downcast<hc55516_device *>(device)->token();
}
@@ -344,6 +344,111 @@ DEVICE_GET_INFO( mc3418 )
}
-DEFINE_LEGACY_SOUND_DEVICE(HC55516, hc55516);
-DEFINE_LEGACY_SOUND_DEVICE(MC3417, mc3417);
-DEFINE_LEGACY_SOUND_DEVICE(MC3418, mc3418);
+const device_type HC55516 = &device_creator<hc55516_device>;
+
+hc55516_device::hc55516_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, HC55516, "HC-55516", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(hc55516_state));
+}
+hc55516_device::hc55516_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, type, name, tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(hc55516_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void hc55516_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void hc55516_device::device_start()
+{
+ DEVICE_START_NAME( hc55516 )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void hc55516_device::device_reset()
+{
+ DEVICE_RESET_NAME( hc55516 )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void hc55516_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
+const device_type MC3417 = &device_creator<mc3417_device>;
+
+mc3417_device::mc3417_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : hc55516_device(mconfig, MC3417, "MC3417", tag, owner, clock)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void mc3417_device::device_start()
+{
+ DEVICE_START_NAME( mc3417 )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void mc3417_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
+const device_type MC3418 = &device_creator<mc3418_device>;
+
+mc3418_device::mc3418_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : hc55516_device(mconfig, MC3418, "MC3418", tag, owner, clock)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void mc3418_device::device_start()
+{
+ DEVICE_START_NAME( mc3418 )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void mc3418_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/emu/sound/hc55516.h b/src/emu/sound/hc55516.h
index 402d485342a..6674a43b47f 100644
--- a/src/emu/sound/hc55516.h
+++ b/src/emu/sound/hc55516.h
@@ -15,8 +15,58 @@ void hc55516_clock_w(device_t *device, int state);
/* returns whether the clock is currently LO or HI */
int hc55516_clock_state_r(device_t *device);
-DECLARE_LEGACY_SOUND_DEVICE(HC55516, hc55516);
-DECLARE_LEGACY_SOUND_DEVICE(MC3417, mc3417);
-DECLARE_LEGACY_SOUND_DEVICE(MC3418, mc3418);
+class hc55516_device : public device_t,
+ public device_sound_interface
+{
+public:
+ hc55516_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ hc55516_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
+ ~hc55516_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_reset();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type HC55516;
+
+class mc3417_device : public hc55516_device
+{
+public:
+ mc3417_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+protected:
+ // device-level overrides
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+};
+
+extern const device_type MC3417;
+
+class mc3418_device : public hc55516_device
+{
+public:
+ mc3418_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+protected:
+ // device-level overrides
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+};
+
+extern const device_type MC3418;
+
#endif /* __HC55516_H__ */
diff --git a/src/emu/sound/iremga20.c b/src/emu/sound/iremga20.c
index a92e6870fca..ac277b9d81e 100644
--- a/src/emu/sound/iremga20.c
+++ b/src/emu/sound/iremga20.c
@@ -60,7 +60,7 @@ INLINE ga20_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == IREMGA20);
- return (ga20_state *)downcast<legacy_device_base *>(device)->token();
+ return (ga20_state *)downcast<iremga20_device *>(device)->token();
}
@@ -293,4 +293,51 @@ DEVICE_GET_INFO( iremga20 )
}
-DEFINE_LEGACY_SOUND_DEVICE(IREMGA20, iremga20);
+const device_type IREMGA20 = &device_creator<iremga20_device>;
+
+iremga20_device::iremga20_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, IREMGA20, "Irem GA20", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(ga20_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void iremga20_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void iremga20_device::device_start()
+{
+ DEVICE_START_NAME( iremga20 )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void iremga20_device::device_reset()
+{
+ DEVICE_RESET_NAME( iremga20 )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void iremga20_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/emu/sound/iremga20.h b/src/emu/sound/iremga20.h
index b0b0f9e7cc6..c069ee73a9b 100644
--- a/src/emu/sound/iremga20.h
+++ b/src/emu/sound/iremga20.h
@@ -13,6 +13,29 @@
WRITE8_DEVICE_HANDLER( irem_ga20_w );
READ8_DEVICE_HANDLER( irem_ga20_r );
-DECLARE_LEGACY_SOUND_DEVICE(IREMGA20, iremga20);
+class iremga20_device : public device_t,
+ public device_sound_interface
+{
+public:
+ iremga20_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~iremga20_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_reset();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type IREMGA20;
+
#endif /* __IREMGA20_H__ */
diff --git a/src/emu/sound/k005289.c b/src/emu/sound/k005289.c
index d8c14c66998..b70c590b844 100644
--- a/src/emu/sound/k005289.c
+++ b/src/emu/sound/k005289.c
@@ -64,7 +64,7 @@ INLINE k005289_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == K005289);
- return (k005289_state *)downcast<legacy_device_base *>(device)->token();
+ return (k005289_state *)downcast<k005289_device *>(device)->token();
}
/* build a table to divide by the number of voices */
@@ -274,4 +274,42 @@ DEVICE_GET_INFO( k005289 )
}
-DEFINE_LEGACY_SOUND_DEVICE(K005289, k005289);
+const device_type K005289 = &device_creator<k005289_device>;
+
+k005289_device::k005289_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, K005289, "K005289", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(k005289_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void k005289_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void k005289_device::device_start()
+{
+ DEVICE_START_NAME( k005289 )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void k005289_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/emu/sound/k005289.h b/src/emu/sound/k005289.h
index b730b678da5..a51b8422116 100644
--- a/src/emu/sound/k005289.h
+++ b/src/emu/sound/k005289.h
@@ -12,6 +12,28 @@ WRITE8_DEVICE_HANDLER( k005289_pitch_B_w );
WRITE8_DEVICE_HANDLER( k005289_keylatch_A_w );
WRITE8_DEVICE_HANDLER( k005289_keylatch_B_w );
-DECLARE_LEGACY_SOUND_DEVICE(K005289, k005289);
+class k005289_device : public device_t,
+ public device_sound_interface
+{
+public:
+ k005289_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~k005289_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type K005289;
+
#endif /* __K005289_H__ */
diff --git a/src/emu/sound/k007232.c b/src/emu/sound/k007232.c
index bd0663a59f7..9d86997e9b8 100644
--- a/src/emu/sound/k007232.c
+++ b/src/emu/sound/k007232.c
@@ -58,7 +58,7 @@ INLINE KDAC_A_PCM *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == K007232);
- return (KDAC_A_PCM *)downcast<legacy_device_base *>(device)->token();
+ return (KDAC_A_PCM *)downcast<k007232_device *>(device)->token();
}
@@ -473,4 +473,42 @@ DEVICE_GET_INFO( k007232 )
}
-DEFINE_LEGACY_SOUND_DEVICE(K007232, k007232);
+const device_type K007232 = &device_creator<k007232_device>;
+
+k007232_device::k007232_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, K007232, "K007232", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(KDAC_A_PCM));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void k007232_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void k007232_device::device_start()
+{
+ DEVICE_START_NAME( k007232 )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void k007232_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/emu/sound/k007232.h b/src/emu/sound/k007232.h
index 548fd866bd7..4c9b43021a6 100644
--- a/src/emu/sound/k007232.h
+++ b/src/emu/sound/k007232.h
@@ -30,6 +30,28 @@ void k007232_set_bank( device_t *device, int chABank, int chBBank );
*/
void k007232_set_volume(device_t *device,int channel,int volumeA,int volumeB);
-DECLARE_LEGACY_SOUND_DEVICE(K007232, k007232);
+class k007232_device : public device_t,
+ public device_sound_interface
+{
+public:
+ k007232_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~k007232_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type K007232;
+
#endif /* __K007232_H__ */
diff --git a/src/emu/sound/k051649.c b/src/emu/sound/k051649.c
index fd764f4d140..ecc8a882a32 100644
--- a/src/emu/sound/k051649.c
+++ b/src/emu/sound/k051649.c
@@ -61,7 +61,7 @@ INLINE k051649_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == K051649);
- return (k051649_state *)downcast<legacy_device_base *>(device)->token();
+ return (k051649_state *)downcast<k051649_device *>(device)->token();
}
/* build a table to divide by the number of voices */
@@ -310,4 +310,51 @@ DEVICE_GET_INFO( k051649 )
}
-DEFINE_LEGACY_SOUND_DEVICE(K051649, k051649);
+const device_type K051649 = &device_creator<k051649_device>;
+
+k051649_device::k051649_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, K051649, "K051649", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(k051649_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void k051649_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void k051649_device::device_start()
+{
+ DEVICE_START_NAME( k051649 )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void k051649_device::device_reset()
+{
+ DEVICE_RESET_NAME( k051649 )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void k051649_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/emu/sound/k051649.h b/src/emu/sound/k051649.h
index 176902ac5fb..5548b0e97e0 100644
--- a/src/emu/sound/k051649.h
+++ b/src/emu/sound/k051649.h
@@ -16,6 +16,29 @@ READ8_DEVICE_HANDLER ( k051649_test_r );
WRITE8_DEVICE_HANDLER( k052539_waveform_w );
READ8_DEVICE_HANDLER ( k052539_waveform_r );
-DECLARE_LEGACY_SOUND_DEVICE(K051649, k051649);
+class k051649_device : public device_t,
+ public device_sound_interface
+{
+public:
+ k051649_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~k051649_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_reset();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type K051649;
+
#endif /* __K051649_H__ */
diff --git a/src/emu/sound/k053260.c b/src/emu/sound/k053260.c
index c9ebe0069ac..25dfa41b2ba 100644
--- a/src/emu/sound/k053260.c
+++ b/src/emu/sound/k053260.c
@@ -47,7 +47,7 @@ INLINE k053260_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == K053260);
- return (k053260_state *)downcast<legacy_device_base *>(device)->token();
+ return (k053260_state *)downcast<k053260_device *>(device)->token();
}
@@ -463,4 +463,51 @@ DEVICE_GET_INFO( k053260 )
}
-DEFINE_LEGACY_SOUND_DEVICE(K053260, k053260);
+const device_type K053260 = &device_creator<k053260_device>;
+
+k053260_device::k053260_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, K053260, "K053260", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(k053260_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void k053260_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void k053260_device::device_start()
+{
+ DEVICE_START_NAME( k053260 )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void k053260_device::device_reset()
+{
+ DEVICE_RESET_NAME( k053260 )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void k053260_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/emu/sound/k053260.h b/src/emu/sound/k053260.h
index 658e6e52344..6b205b107b3 100644
--- a/src/emu/sound/k053260.h
+++ b/src/emu/sound/k053260.h
@@ -21,6 +21,29 @@ struct _k053260_interface {
WRITE8_DEVICE_HANDLER( k053260_w );
READ8_DEVICE_HANDLER( k053260_r );
-DECLARE_LEGACY_SOUND_DEVICE(K053260, k053260);
+class k053260_device : public device_t,
+ public device_sound_interface
+{
+public:
+ k053260_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~k053260_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_reset();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type K053260;
+
#endif /* __K053260_H__ */
diff --git a/src/emu/sound/k056800.c b/src/emu/sound/k056800.c
index 3892cdd529f..6a6159b77cd 100644
--- a/src/emu/sound/k056800.c
+++ b/src/emu/sound/k056800.c
@@ -29,7 +29,7 @@ INLINE k056800_state *k056800_get_safe_token( device_t *device )
assert(device != NULL);
assert(device->type() == K056800);
- return (k056800_state *)downcast<legacy_device_base *>(device)->token();
+ return (k056800_state *)downcast<k056800_device *>(device)->token();
}
INLINE const k056800_interface *k056800_get_interface( device_t *device )
@@ -179,4 +179,40 @@ DEVICE_GET_INFO(k056800)
}
}
-DEFINE_LEGACY_DEVICE(K056800, k056800);
+const device_type K056800 = &device_creator<k056800_device>;
+
+k056800_device::k056800_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, K056800, "Konami 056800 MIRAC", tag, owner, clock)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(k056800_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void k056800_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void k056800_device::device_start()
+{
+ DEVICE_START_NAME( k056800 )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void k056800_device::device_reset()
+{
+ DEVICE_RESET_NAME( k056800 )(this);
+}
+
+
diff --git a/src/emu/sound/k056800.h b/src/emu/sound/k056800.h
index 81afa200ae3..a36f8712d80 100644
--- a/src/emu/sound/k056800.h
+++ b/src/emu/sound/k056800.h
@@ -23,7 +23,26 @@ struct _k056800_interface
k056800_irq_cb irq_cb;
};
-DECLARE_LEGACY_DEVICE(K056800, k056800);
+class k056800_device : public device_t
+{
+public:
+ k056800_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~k056800_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_reset();
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type K056800;
+
/***************************************************************************
diff --git a/src/emu/sound/mos6560.c b/src/emu/sound/mos6560.c
index 3cc30c4b18c..a78c45c4062 100644
--- a/src/emu/sound/mos6560.c
+++ b/src/emu/sound/mos6560.c
@@ -125,7 +125,7 @@ INLINE mos6560_state *get_safe_token( device_t *device )
assert(device != NULL);
assert(device->type() == MOS656X);
- return (mos6560_state *)downcast<legacy_device_base *>(device)->token();
+ return (mos6560_state *)downcast<mos6560_device *>(device)->token();
}
INLINE const mos6560_interface *get_interface( device_t *device )
@@ -970,4 +970,51 @@ DEVICE_GET_INFO(mos6560)
}
}
-DEFINE_LEGACY_SOUND_DEVICE(MOS656X, mos6560);
+const device_type MOS656X = &device_creator<mos6560_device>;
+
+mos6560_device::mos6560_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, MOS656X, "MOS 6560 / 6561 VIC", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(mos6560_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void mos6560_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void mos6560_device::device_start()
+{
+ DEVICE_START_NAME( mos6560 )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void mos6560_device::device_reset()
+{
+ DEVICE_RESET_NAME( mos6560 )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void mos6560_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/emu/sound/mos6560.h b/src/emu/sound/mos6560.h
index 9892b4805a3..2ec7c785d8e 100644
--- a/src/emu/sound/mos6560.h
+++ b/src/emu/sound/mos6560.h
@@ -88,7 +88,30 @@ struct _mos6560_interface
INFO PROTOTYPES
***************************************************************************/
-DECLARE_LEGACY_SOUND_DEVICE(MOS656X, mos6560);
+class mos6560_device : public device_t,
+ public device_sound_interface
+{
+public:
+ mos6560_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~mos6560_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_reset();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type MOS656X;
+
/***************************************************************************
DEVICE CONFIGURATION MACROS
diff --git a/src/emu/sound/msm5205.c b/src/emu/sound/msm5205.c
index 6ff6ffef440..25f5317f4ed 100644
--- a/src/emu/sound/msm5205.c
+++ b/src/emu/sound/msm5205.c
@@ -74,7 +74,7 @@ INLINE msm5205_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == MSM5205);
- return (msm5205_state *)downcast<legacy_device_base *>(device)->token();
+ return (msm5205_state *)downcast<msm5205_device *>(device)->token();
}
@@ -377,5 +377,75 @@ DEVICE_GET_INFO( msm6585 )
}
-DEFINE_LEGACY_SOUND_DEVICE(MSM5205, msm5205);
-DEFINE_LEGACY_SOUND_DEVICE(MSM6585, msm6585);
+const device_type MSM5205 = &device_creator<msm5205_device>;
+
+msm5205_device::msm5205_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, MSM5205, "MSM5205", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(msm5205_state));
+}
+msm5205_device::msm5205_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, type, name, tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(msm5205_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void msm5205_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void msm5205_device::device_start()
+{
+ DEVICE_START_NAME( msm5205 )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void msm5205_device::device_reset()
+{
+ DEVICE_RESET_NAME( msm5205 )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void msm5205_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
+const device_type MSM6585 = &device_creator<msm6585_device>;
+
+msm6585_device::msm6585_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : msm5205_device(mconfig, MSM6585, "MSM6585", tag, owner, clock)
+{
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void msm6585_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/emu/sound/msm5205.h b/src/emu/sound/msm5205.h
index b84fd8eddd3..66de15e5f74 100644
--- a/src/emu/sound/msm5205.h
+++ b/src/emu/sound/msm5205.h
@@ -46,7 +46,41 @@ void msm5205_set_volume(device_t *device,int volume);
void msm5205_change_clock_w(device_t *device, INT32 clock);
-DECLARE_LEGACY_SOUND_DEVICE(MSM5205, msm5205);
-DECLARE_LEGACY_SOUND_DEVICE(MSM6585, msm6585);
+class msm5205_device : public device_t,
+ public device_sound_interface
+{
+public:
+ msm5205_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ msm5205_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
+ ~msm5205_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_reset();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type MSM5205;
+
+class msm6585_device : public msm5205_device
+{
+public:
+ msm6585_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+};
+
+extern const device_type MSM6585;
+
#endif /* __MSM5205_H__ */
diff --git a/src/emu/sound/msm5232.c b/src/emu/sound/msm5232.c
index 6bd50975c71..6561c6f9161 100644
--- a/src/emu/sound/msm5232.c
+++ b/src/emu/sound/msm5232.c
@@ -78,7 +78,7 @@ INLINE msm5232_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == MSM5232);
- return (msm5232_state *)downcast<legacy_device_base *>(device)->token();
+ return (msm5232_state *)downcast<msm5232_device *>(device)->token();
}
@@ -878,4 +878,60 @@ DEVICE_GET_INFO( msm5232 )
}
-DEFINE_LEGACY_SOUND_DEVICE(MSM5232, msm5232);
+const device_type MSM5232 = &device_creator<msm5232_device>;
+
+msm5232_device::msm5232_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, MSM5232, "MSM5232", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(msm5232_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void msm5232_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void msm5232_device::device_start()
+{
+ DEVICE_START_NAME( msm5232 )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void msm5232_device::device_reset()
+{
+ DEVICE_RESET_NAME( msm5232 )(this);
+}
+
+//-------------------------------------------------
+// device_stop - device-specific stop
+//-------------------------------------------------
+
+void msm5232_device::device_stop()
+{
+ DEVICE_STOP_NAME( msm5232 )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void msm5232_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/emu/sound/msm5232.h b/src/emu/sound/msm5232.h
index f1dfaccc08c..174109a8702 100644
--- a/src/emu/sound/msm5232.h
+++ b/src/emu/sound/msm5232.h
@@ -16,6 +16,30 @@ WRITE8_DEVICE_HANDLER( msm5232_w );
void msm5232_set_clock(device_t *device, int clock);
-DECLARE_LEGACY_SOUND_DEVICE(MSM5232, msm5232);
+class msm5232_device : public device_t,
+ public device_sound_interface
+{
+public:
+ msm5232_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~msm5232_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_stop();
+ virtual void device_reset();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type MSM5232;
+
#endif /* __MSM5232_H__ */
diff --git a/src/emu/sound/multipcm.c b/src/emu/sound/multipcm.c
index 43c7a2b3a2f..b03d1bc604b 100644
--- a/src/emu/sound/multipcm.c
+++ b/src/emu/sound/multipcm.c
@@ -130,7 +130,7 @@ INLINE MultiPCM *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == MULTIPCM);
- return (MultiPCM *)downcast<legacy_device_base *>(device)->token();
+ return (MultiPCM *)downcast<multipcm_device *>(device)->token();
}
@@ -700,4 +700,42 @@ DEVICE_GET_INFO( multipcm )
}
-DEFINE_LEGACY_SOUND_DEVICE(MULTIPCM, multipcm);
+const device_type MULTIPCM = &device_creator<multipcm_device>;
+
+multipcm_device::multipcm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, MULTIPCM, "Sega/Yamaha 315-5560", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(MultiPCM));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void multipcm_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void multipcm_device::device_start()
+{
+ DEVICE_START_NAME( multipcm )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void multipcm_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/emu/sound/multipcm.h b/src/emu/sound/multipcm.h
index f442aeb06ea..4beaa933ea0 100644
--- a/src/emu/sound/multipcm.h
+++ b/src/emu/sound/multipcm.h
@@ -10,6 +10,28 @@ READ8_DEVICE_HANDLER( multipcm_r );
void multipcm_set_bank(device_t *device, UINT32 leftoffs, UINT32 rightoffs);
-DECLARE_LEGACY_SOUND_DEVICE(MULTIPCM, multipcm);
+class multipcm_device : public device_t,
+ public device_sound_interface
+{
+public:
+ multipcm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~multipcm_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type MULTIPCM;
+
#endif /* __MULTIPCM_H__ */
diff --git a/src/emu/sound/n63701x.c b/src/emu/sound/n63701x.c
index 0c0faae0b1b..0ab68ae368e 100644
--- a/src/emu/sound/n63701x.c
+++ b/src/emu/sound/n63701x.c
@@ -50,7 +50,7 @@ INLINE namco_63701x *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == NAMCO_63701X);
- return (namco_63701x *)downcast<legacy_device_base *>(device)->token();
+ return (namco_63701x *)downcast<namco_63701x_device *>(device)->token();
}
@@ -185,4 +185,42 @@ DEVICE_GET_INFO( namco_63701x )
}
-DEFINE_LEGACY_SOUND_DEVICE(NAMCO_63701X, namco_63701x);
+const device_type NAMCO_63701X = &device_creator<namco_63701x_device>;
+
+namco_63701x_device::namco_63701x_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, NAMCO_63701X, "Namco 63701X", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(namco_63701x));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void namco_63701x_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void namco_63701x_device::device_start()
+{
+ DEVICE_START_NAME( namco_63701x )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void namco_63701x_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/emu/sound/n63701x.h b/src/emu/sound/n63701x.h
index c6c0f57cbc4..813c2b73263 100644
--- a/src/emu/sound/n63701x.h
+++ b/src/emu/sound/n63701x.h
@@ -7,6 +7,28 @@
WRITE8_DEVICE_HANDLER( namco_63701x_w );
-DECLARE_LEGACY_SOUND_DEVICE(NAMCO_63701X, namco_63701x);
+class namco_63701x_device : public device_t,
+ public device_sound_interface
+{
+public:
+ namco_63701x_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~namco_63701x_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type NAMCO_63701X;
+
#endif /* __N63701X_H__ */
diff --git a/src/emu/sound/namco.c b/src/emu/sound/namco.c
index baf66ed1042..b255309a3d3 100644
--- a/src/emu/sound/namco.c
+++ b/src/emu/sound/namco.c
@@ -80,7 +80,7 @@ INLINE namco_sound *get_safe_token(device_t *device)
assert(device->type() == NAMCO ||
device->type() == NAMCO_15XX ||
device->type() == NAMCO_CUS30);
- return (namco_sound *)downcast<legacy_device_base *>(device)->token();
+ return (namco_sound *)downcast<namco_device *>(device)->token();
}
/* update the decoded waveform data */
@@ -891,6 +891,62 @@ DEVICE_GET_INFO( namco_cus30 )
}
-DEFINE_LEGACY_SOUND_DEVICE(NAMCO, namco);
-DEFINE_LEGACY_SOUND_DEVICE(NAMCO_15XX, namco_15xx);
-DEFINE_LEGACY_SOUND_DEVICE(NAMCO_CUS30, namco_cus30);
+const device_type NAMCO = &device_creator<namco_device>;
+
+namco_device::namco_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, NAMCO, "Namco", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(namco_sound));
+}
+
+namco_device::namco_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, type, name, tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(namco_sound));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void namco_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void namco_device::device_start()
+{
+ DEVICE_START_NAME( namco )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void namco_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
+const device_type NAMCO_15XX = &device_creator<namco_15xx_device>;
+
+namco_15xx_device::namco_15xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : namco_device(mconfig, NAMCO_15XX, "Namco 15XX", tag, owner, clock)
+{
+}
+
+const device_type NAMCO_CUS30 = &device_creator<namco_cus30_device>;
+
+namco_cus30_device::namco_cus30_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : namco_device(mconfig, NAMCO_CUS30, "Namco CUS30", tag, owner, clock)
+{
+}
diff --git a/src/emu/sound/namco.h b/src/emu/sound/namco.h
index 533abb06cc6..7fceb1b4fe9 100644
--- a/src/emu/sound/namco.h
+++ b/src/emu/sound/namco.h
@@ -27,9 +27,46 @@ READ8_DEVICE_HANDLER( namcos1_cus30_r );
READ8_DEVICE_HANDLER( namco_snd_sharedram_r );
WRITE8_DEVICE_HANDLER( namco_snd_sharedram_w );
-DECLARE_LEGACY_SOUND_DEVICE(NAMCO, namco);
-DECLARE_LEGACY_SOUND_DEVICE(NAMCO_15XX, namco_15xx);
-DECLARE_LEGACY_SOUND_DEVICE(NAMCO_CUS30, namco_cus30);
+class namco_device : public device_t,
+ public device_sound_interface
+{
+public:
+ namco_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ namco_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
+ ~namco_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type NAMCO;
+
+class namco_15xx_device : public namco_device
+{
+public:
+ namco_15xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
+extern const device_type NAMCO_15XX;
+
+class namco_cus30_device : public namco_device
+{
+public:
+ namco_cus30_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
+extern const device_type NAMCO_CUS30;
+
#endif /* __NAMCO_H__ */
diff --git a/src/emu/sound/nes_apu.c b/src/emu/sound/nes_apu.c
index da1576fd5d0..d42e8bfa572 100644
--- a/src/emu/sound/nes_apu.c
+++ b/src/emu/sound/nes_apu.c
@@ -75,7 +75,7 @@ INLINE nesapu_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == NES);
- return (nesapu_state *)downcast<legacy_device_base *>(device)->token();
+ return (nesapu_state *)downcast<nesapu_device *>(device)->token();
}
/* INTERNAL FUNCTIONS */
@@ -792,4 +792,42 @@ DEVICE_GET_INFO( nesapu )
}
-DEFINE_LEGACY_SOUND_DEVICE(NES, nesapu);
+const device_type NES = &device_creator<nesapu_device>;
+
+nesapu_device::nesapu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, NES, "N2A03", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(nesapu_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void nesapu_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void nesapu_device::device_start()
+{
+ DEVICE_START_NAME( nesapu )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void nesapu_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/emu/sound/nes_apu.h b/src/emu/sound/nes_apu.h
index 994d3d273f8..6c767172c7a 100644
--- a/src/emu/sound/nes_apu.h
+++ b/src/emu/sound/nes_apu.h
@@ -46,6 +46,28 @@ struct _nes_interface
READ8_DEVICE_HANDLER( nes_psg_r );
WRITE8_DEVICE_HANDLER( nes_psg_w );
-DECLARE_LEGACY_SOUND_DEVICE(NES, nesapu);
+class nesapu_device : public device_t,
+ public device_sound_interface
+{
+public:
+ nesapu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~nesapu_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type NES;
+
#endif /* __NES_APU_H__ */
diff --git a/src/emu/sound/nile.c b/src/emu/sound/nile.c
index 3ef19009fdb..da61d1b6431 100644
--- a/src/emu/sound/nile.c
+++ b/src/emu/sound/nile.c
@@ -65,7 +65,7 @@ INLINE nile_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == NILE);
- return (nile_state *)downcast<legacy_device_base *>(device)->token();
+ return (nile_state *)downcast<nile_device *>(device)->token();
}
@@ -258,4 +258,42 @@ DEVICE_GET_INFO( nile )
}
-DEFINE_LEGACY_SOUND_DEVICE(NILE, nile);
+const device_type NILE = &device_creator<nile_device>;
+
+nile_device::nile_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, NILE, "NiLe", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(nile_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void nile_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void nile_device::device_start()
+{
+ DEVICE_START_NAME( nile )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void nile_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/emu/sound/nile.h b/src/emu/sound/nile.h
index 49a96e79715..b378ba476e3 100644
--- a/src/emu/sound/nile.h
+++ b/src/emu/sound/nile.h
@@ -10,6 +10,28 @@ READ16_DEVICE_HANDLER( nile_snd_r );
WRITE16_DEVICE_HANDLER( nile_sndctrl_w );
READ16_DEVICE_HANDLER( nile_sndctrl_r );
-DECLARE_LEGACY_SOUND_DEVICE(NILE, nile);
+class nile_device : public device_t,
+ public device_sound_interface
+{
+public:
+ nile_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~nile_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type NILE;
+
#endif /* __NILE_H__ */
diff --git a/src/emu/sound/okim6258.c b/src/emu/sound/okim6258.c
index aa939cc3fe2..2ac8ef908e9 100644
--- a/src/emu/sound/okim6258.c
+++ b/src/emu/sound/okim6258.c
@@ -52,7 +52,7 @@ INLINE okim6258_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == OKIM6258);
- return (okim6258_state *)downcast<legacy_device_base *>(device)->token();
+ return (okim6258_state *)downcast<okim6258_device *>(device)->token();
}
/**********************************************************************************************
@@ -381,4 +381,51 @@ DEVICE_GET_INFO( okim6258 )
}
-DEFINE_LEGACY_SOUND_DEVICE(OKIM6258, okim6258);
+const device_type OKIM6258 = &device_creator<okim6258_device>;
+
+okim6258_device::okim6258_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, OKIM6258, "OKI6258", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(okim6258_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void okim6258_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void okim6258_device::device_start()
+{
+ DEVICE_START_NAME( okim6258 )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void okim6258_device::device_reset()
+{
+ DEVICE_RESET_NAME( okim6258 )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void okim6258_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/emu/sound/okim6258.h b/src/emu/sound/okim6258.h
index 37a0ef35cd3..bbed3a960ce 100644
--- a/src/emu/sound/okim6258.h
+++ b/src/emu/sound/okim6258.h
@@ -34,6 +34,29 @@ READ8_DEVICE_HANDLER( okim6258_status_r );
WRITE8_DEVICE_HANDLER( okim6258_data_w );
WRITE8_DEVICE_HANDLER( okim6258_ctrl_w );
-DECLARE_LEGACY_SOUND_DEVICE(OKIM6258, okim6258);
+class okim6258_device : public device_t,
+ public device_sound_interface
+{
+public:
+ okim6258_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~okim6258_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_reset();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type OKIM6258;
+
#endif /* __OKIM6258_H__ */
diff --git a/src/emu/sound/okim6376.c b/src/emu/sound/okim6376.c
index e5e37a2ec4f..1a63d21d220 100644
--- a/src/emu/sound/okim6376.c
+++ b/src/emu/sound/okim6376.c
@@ -91,7 +91,7 @@ INLINE okim6376_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == OKIM6376);
- return (okim6376_state *)downcast<legacy_device_base *>(device)->token();
+ return (okim6376_state *)downcast<okim6376_device *>(device)->token();
}
@@ -646,4 +646,51 @@ DEVICE_GET_INFO( okim6376 )
}
-DEFINE_LEGACY_SOUND_DEVICE(OKIM6376, okim6376);
+const device_type OKIM6376 = &device_creator<okim6376_device>;
+
+okim6376_device::okim6376_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, OKIM6376, "OKI6376", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(okim6376_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void okim6376_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void okim6376_device::device_start()
+{
+ DEVICE_START_NAME( okim6376 )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void okim6376_device::device_reset()
+{
+ DEVICE_RESET_NAME( okim6376 )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void okim6376_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/emu/sound/okim6376.h b/src/emu/sound/okim6376.h
index 222ee7e47a8..003bcd14fc1 100644
--- a/src/emu/sound/okim6376.h
+++ b/src/emu/sound/okim6376.h
@@ -10,7 +10,30 @@
READ8_DEVICE_HANDLER( okim6376_r );
WRITE8_DEVICE_HANDLER( okim6376_w );
-DECLARE_LEGACY_SOUND_DEVICE(OKIM6376, okim6376);
+class okim6376_device : public device_t,
+ public device_sound_interface
+{
+public:
+ okim6376_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~okim6376_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_reset();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type OKIM6376;
+
WRITE_LINE_DEVICE_HANDLER( okim6376_st_w );
WRITE_LINE_DEVICE_HANDLER( okim6376_ch2_w );
diff --git a/src/emu/sound/qsound.c b/src/emu/sound/qsound.c
index cc08776aca6..f691fdd3c22 100644
--- a/src/emu/sound/qsound.c
+++ b/src/emu/sound/qsound.c
@@ -91,7 +91,7 @@ INLINE qsound_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == QSOUND);
- return (qsound_state *)downcast<legacy_device_base *>(device)->token();
+ return (qsound_state *)downcast<qsound_device *>(device)->token();
}
@@ -399,4 +399,51 @@ DEVICE_GET_INFO( qsound )
/**************** end of file ****************/
-DEFINE_LEGACY_SOUND_DEVICE(QSOUND, qsound);
+const device_type QSOUND = &device_creator<qsound_device>;
+
+qsound_device::qsound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, QSOUND, "Q-Sound", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(qsound_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void qsound_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void qsound_device::device_start()
+{
+ DEVICE_START_NAME( qsound )(this);
+}
+
+//-------------------------------------------------
+// device_stop - device-specific stop
+//-------------------------------------------------
+
+void qsound_device::device_stop()
+{
+ DEVICE_STOP_NAME( qsound )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void qsound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/emu/sound/qsound.h b/src/emu/sound/qsound.h
index d1a04650f55..bfc274d461a 100644
--- a/src/emu/sound/qsound.h
+++ b/src/emu/sound/qsound.h
@@ -16,6 +16,29 @@
WRITE8_DEVICE_HANDLER( qsound_w );
READ8_DEVICE_HANDLER( qsound_r );
-DECLARE_LEGACY_SOUND_DEVICE(QSOUND, qsound);
+class qsound_device : public device_t,
+ public device_sound_interface
+{
+public:
+ qsound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~qsound_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_stop();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type QSOUND;
+
#endif /* __QSOUND_H__ */
diff --git a/src/emu/sound/rf5c400.c b/src/emu/sound/rf5c400.c
index 45ef99a622e..75e2d9f2217 100644
--- a/src/emu/sound/rf5c400.c
+++ b/src/emu/sound/rf5c400.c
@@ -97,7 +97,7 @@ INLINE rf5c400_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == RF5C400);
- return (rf5c400_state *)downcast<legacy_device_base *>(device)->token();
+ return (rf5c400_state *)downcast<rf5c400_device *>(device)->token();
}
@@ -583,4 +583,42 @@ DEVICE_GET_INFO( rf5c400 )
}
}
-DEFINE_LEGACY_SOUND_DEVICE(RF5C400, rf5c400);
+const device_type RF5C400 = &device_creator<rf5c400_device>;
+
+rf5c400_device::rf5c400_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, RF5C400, "RF5C400", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(rf5c400_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void rf5c400_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void rf5c400_device::device_start()
+{
+ DEVICE_START_NAME( rf5c400 )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void rf5c400_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/emu/sound/rf5c400.h b/src/emu/sound/rf5c400.h
index e5db5809b76..34b5a66e3fd 100644
--- a/src/emu/sound/rf5c400.h
+++ b/src/emu/sound/rf5c400.h
@@ -10,6 +10,28 @@
READ16_DEVICE_HANDLER( rf5c400_r );
WRITE16_DEVICE_HANDLER( rf5c400_w );
-DECLARE_LEGACY_SOUND_DEVICE(RF5C400, rf5c400);
+class rf5c400_device : public device_t,
+ public device_sound_interface
+{
+public:
+ rf5c400_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~rf5c400_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type RF5C400;
+
#endif /* __RF5C400_H__ */
diff --git a/src/emu/sound/rf5c68.c b/src/emu/sound/rf5c68.c
index 40eeab04fbd..756f2b23189 100644
--- a/src/emu/sound/rf5c68.c
+++ b/src/emu/sound/rf5c68.c
@@ -40,7 +40,7 @@ INLINE rf5c68_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == RF5C68);
- return (rf5c68_state *)downcast<legacy_device_base *>(device)->token();
+ return (rf5c68_state *)downcast<rf5c68_device *>(device)->token();
}
@@ -287,4 +287,42 @@ DEVICE_GET_INFO( rf5c68 )
/**************** end of file ****************/
-DEFINE_LEGACY_SOUND_DEVICE(RF5C68, rf5c68);
+const device_type RF5C68 = &device_creator<rf5c68_device>;
+
+rf5c68_device::rf5c68_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, RF5C68, "RF5C68", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(rf5c68_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void rf5c68_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void rf5c68_device::device_start()
+{
+ DEVICE_START_NAME( rf5c68 )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void rf5c68_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/emu/sound/rf5c68.h b/src/emu/sound/rf5c68.h
index 9082083df8c..a738d42032b 100644
--- a/src/emu/sound/rf5c68.h
+++ b/src/emu/sound/rf5c68.h
@@ -22,6 +22,28 @@ struct _rf5c68_interface
void (*sample_end_callback)(device_t* device, int channel);
};
-DECLARE_LEGACY_SOUND_DEVICE(RF5C68, rf5c68);
+class rf5c68_device : public device_t,
+ public device_sound_interface
+{
+public:
+ rf5c68_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~rf5c68_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type RF5C68;
+
#endif /* __RF5C68_H__ */
diff --git a/src/emu/sound/s14001a.c b/src/emu/sound/s14001a.c
index c75f10a3b0d..17f46bbe09a 100644
--- a/src/emu/sound/s14001a.c
+++ b/src/emu/sound/s14001a.c
@@ -268,7 +268,7 @@ INLINE S14001AChip *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == S14001A);
- return (S14001AChip *)downcast<legacy_device_base *>(device)->token();
+ return (S14001AChip *)downcast<s14001a_device *>(device)->token();
}
@@ -648,4 +648,42 @@ DEVICE_GET_INFO( s14001a )
}
}
-DEFINE_LEGACY_SOUND_DEVICE(S14001A, s14001a);
+const device_type S14001A = &device_creator<s14001a_device>;
+
+s14001a_device::s14001a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, S14001A, "S14001A", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(S14001AChip));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void s14001a_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void s14001a_device::device_start()
+{
+ DEVICE_START_NAME( s14001a )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void s14001a_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/emu/sound/s14001a.h b/src/emu/sound/s14001a.h
index 62ebfa22eaa..70fcb5c2d11 100644
--- a/src/emu/sound/s14001a.h
+++ b/src/emu/sound/s14001a.h
@@ -11,7 +11,29 @@ void s14001a_rst_w(device_t *device, int data); /* write to RESET pin */
void s14001a_set_clock(device_t *device, int clock); /* set VSU-1000 clock */
void s14001a_set_volume(device_t *device, int volume); /* set VSU-1000 volume control */
-DECLARE_LEGACY_SOUND_DEVICE(S14001A, s14001a);
+class s14001a_device : public device_t,
+ public device_sound_interface
+{
+public:
+ s14001a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~s14001a_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type S14001A;
+
#endif /* __S14001A_H__ */
diff --git a/src/emu/sound/s2636.c b/src/emu/sound/s2636.c
index baeb1b7f487..1fd7ad08658 100644
--- a/src/emu/sound/s2636.c
+++ b/src/emu/sound/s2636.c
@@ -22,7 +22,7 @@ static s2636_sound *get_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == S2636_SOUND);
- return (s2636_sound *) downcast<legacy_device_base *>(device)->token();
+ return (s2636_sound *) downcast<s2636_sound_device *>(device)->token();
}
@@ -99,4 +99,42 @@ DEVICE_GET_INFO( s2636_sound )
}
}
-DEFINE_LEGACY_SOUND_DEVICE(S2636_SOUND, s2636_sound);
+const device_type S2636_SOUND = &device_creator<s2636_sound_device>;
+
+s2636_sound_device::s2636_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, S2636_SOUND, "S2636", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(s2636_sound));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void s2636_sound_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void s2636_sound_device::device_start()
+{
+ DEVICE_START_NAME( s2636_sound )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void s2636_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/emu/sound/s2636.h b/src/emu/sound/s2636.h
index f742660212b..3889e3c6cb6 100644
--- a/src/emu/sound/s2636.h
+++ b/src/emu/sound/s2636.h
@@ -9,7 +9,29 @@
-DECLARE_LEGACY_SOUND_DEVICE(S2636_SOUND, s2636_sound);
+class s2636_sound_device : public device_t,
+ public device_sound_interface
+{
+public:
+ s2636_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~s2636_sound_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type S2636_SOUND;
+
void s2636_soundport_w (device_t *device, int mode, int data);
diff --git a/src/emu/sound/saa1099.c b/src/emu/sound/saa1099.c
index f93f1639247..b85a062905a 100644
--- a/src/emu/sound/saa1099.c
+++ b/src/emu/sound/saa1099.c
@@ -171,7 +171,7 @@ INLINE saa1099_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == SAA1099);
- return (saa1099_state *)downcast<legacy_device_base *>(device)->token();
+ return (saa1099_state *)downcast<saa1099_device *>(device)->token();
}
@@ -463,4 +463,42 @@ DEVICE_GET_INFO( saa1099 )
}
-DEFINE_LEGACY_SOUND_DEVICE(SAA1099, saa1099);
+const device_type SAA1099 = &device_creator<saa1099_device>;
+
+saa1099_device::saa1099_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, SAA1099, "SAA1099", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(saa1099_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void saa1099_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void saa1099_device::device_start()
+{
+ DEVICE_START_NAME( saa1099 )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void saa1099_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/emu/sound/saa1099.h b/src/emu/sound/saa1099.h
index a07db979a76..e24ef538777 100644
--- a/src/emu/sound/saa1099.h
+++ b/src/emu/sound/saa1099.h
@@ -12,6 +12,28 @@
WRITE8_DEVICE_HANDLER( saa1099_control_w );
WRITE8_DEVICE_HANDLER( saa1099_data_w );
-DECLARE_LEGACY_SOUND_DEVICE(SAA1099, saa1099);
+class saa1099_device : public device_t,
+ public device_sound_interface
+{
+public:
+ saa1099_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~saa1099_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type SAA1099;
+
#endif /* __SAA1099_H__ */
diff --git a/src/emu/sound/scsp.c b/src/emu/sound/scsp.c
index f575c258be9..a324bcb0dd9 100644
--- a/src/emu/sound/scsp.c
+++ b/src/emu/sound/scsp.c
@@ -253,7 +253,7 @@ INLINE scsp_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == SCSP);
- return (scsp_state *)downcast<legacy_device_base *>(device)->token();
+ return (scsp_state *)downcast<scsp_device *>(device)->token();
}
static unsigned char DecodeSCI(scsp_state *scsp,unsigned char irq)
@@ -1387,4 +1387,42 @@ DEVICE_GET_INFO( scsp )
}
-DEFINE_LEGACY_SOUND_DEVICE(SCSP, scsp);
+const device_type SCSP = &device_creator<scsp_device>;
+
+scsp_device::scsp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, SCSP, "SCSP", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(scsp_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void scsp_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void scsp_device::device_start()
+{
+ DEVICE_START_NAME( scsp )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void scsp_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/emu/sound/scsp.h b/src/emu/sound/scsp.h
index 95795f2ca8b..3fb6aed0ac6 100644
--- a/src/emu/sound/scsp.h
+++ b/src/emu/sound/scsp.h
@@ -29,6 +29,28 @@ READ16_DEVICE_HANDLER( scsp_midi_out_r );
extern UINT32* stv_scu;
-DECLARE_LEGACY_SOUND_DEVICE(SCSP, scsp);
+class scsp_device : public device_t,
+ public device_sound_interface
+{
+public:
+ scsp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~scsp_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type SCSP;
+
#endif /* __SCSP_H__ */
diff --git a/src/emu/sound/segapcm.c b/src/emu/sound/segapcm.c
index 7f6f7054748..4e975f19be8 100644
--- a/src/emu/sound/segapcm.c
+++ b/src/emu/sound/segapcm.c
@@ -21,7 +21,7 @@ INLINE segapcm_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == SEGAPCM);
- return (segapcm_state *)downcast<legacy_device_base *>(device)->token();
+ return (segapcm_state *)downcast<segapcm_device *>(device)->token();
}
static STREAM_UPDATE( SEGAPCM_update )
@@ -176,4 +176,42 @@ DEVICE_GET_INFO( segapcm )
}
-DEFINE_LEGACY_SOUND_DEVICE(SEGAPCM, segapcm);
+const device_type SEGAPCM = &device_creator<segapcm_device>;
+
+segapcm_device::segapcm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, SEGAPCM, "Sega PCM", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(segapcm_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void segapcm_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void segapcm_device::device_start()
+{
+ DEVICE_START_NAME( segapcm )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void segapcm_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/emu/sound/segapcm.h b/src/emu/sound/segapcm.h
index c3b0998ee7f..2190d6a612f 100644
--- a/src/emu/sound/segapcm.h
+++ b/src/emu/sound/segapcm.h
@@ -25,6 +25,28 @@ struct _sega_pcm_interface
WRITE8_DEVICE_HANDLER( sega_pcm_w );
READ8_DEVICE_HANDLER( sega_pcm_r );
-DECLARE_LEGACY_SOUND_DEVICE(SEGAPCM, segapcm);
+class segapcm_device : public device_t,
+ public device_sound_interface
+{
+public:
+ segapcm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~segapcm_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type SEGAPCM;
+
#endif /* __SEGAPCM_H__ */
diff --git a/src/emu/sound/sid6581.c b/src/emu/sound/sid6581.c
index 86089282321..d80e5ca7bbf 100644
--- a/src/emu/sound/sid6581.c
+++ b/src/emu/sound/sid6581.c
@@ -16,7 +16,7 @@ static _SID6581 *get_sid(device_t *device)
{
assert(device != NULL);
assert((device->type() == SID6581) || (device->type() == SID8580));
- return (_SID6581 *) downcast<legacy_device_base *>(device)->token();
+ return (_SID6581 *) downcast<sid6581_device *>(device)->token();
}
@@ -125,5 +125,84 @@ DEVICE_GET_INFO( sid8580 )
}
-DEFINE_LEGACY_SOUND_DEVICE(SID6581, sid6581);
-DEFINE_LEGACY_SOUND_DEVICE(SID8580, sid8580);
+const device_type SID6581 = &device_creator<sid6581_device>;
+
+sid6581_device::sid6581_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, SID6581, "SID6581", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(_SID6581));
+}
+sid6581_device::sid6581_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, type, name, tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(_SID6581));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void sid6581_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void sid6581_device::device_start()
+{
+ DEVICE_START_NAME( sid6581 )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void sid6581_device::device_reset()
+{
+ DEVICE_RESET_NAME( sid )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void sid6581_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
+const device_type SID8580 = &device_creator<sid8580_device>;
+
+sid8580_device::sid8580_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : sid6581_device(mconfig, SID8580, "SID8580", tag, owner, clock)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void sid8580_device::device_start()
+{
+ DEVICE_START_NAME( sid8580 )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void sid8580_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/emu/sound/sid6581.h b/src/emu/sound/sid6581.h
index d73b2a43f57..ba6e74d6d7e 100644
--- a/src/emu/sound/sid6581.h
+++ b/src/emu/sound/sid6581.h
@@ -34,7 +34,44 @@ struct _sid6581_interface
READ8_DEVICE_HANDLER ( sid6581_r );
WRITE8_DEVICE_HANDLER ( sid6581_w );
-DECLARE_LEGACY_SOUND_DEVICE(SID6581, sid6581);
-DECLARE_LEGACY_SOUND_DEVICE(SID8580, sid8580);
+class sid6581_device : public device_t,
+ public device_sound_interface
+{
+public:
+ sid6581_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ sid6581_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
+ ~sid6581_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_reset();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type SID6581;
+
+class sid8580_device : public sid6581_device
+{
+public:
+ sid8580_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+protected:
+ // device-level overrides
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+};
+
+extern const device_type SID8580;
+
#endif /* __SID6581_H__ */
diff --git a/src/emu/sound/sn76477.c b/src/emu/sound/sn76477.c
index ab38fd5a615..a893af0a0a3 100644
--- a/src/emu/sound/sn76477.c
+++ b/src/emu/sound/sn76477.c
@@ -264,7 +264,7 @@ INLINE sn76477_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == SN76477);
- return (sn76477_state *)downcast<legacy_device_base *>(device)->token();
+ return (sn76477_state *)downcast<sn76477_device *>(device)->token();
}
@@ -2484,4 +2484,51 @@ DEVICE_GET_INFO( sn76477 )
}
-DEFINE_LEGACY_SOUND_DEVICE(SN76477, sn76477);
+const device_type SN76477 = &device_creator<sn76477_device>;
+
+sn76477_device::sn76477_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, SN76477, "SN76477", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(sn76477_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void sn76477_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void sn76477_device::device_start()
+{
+ DEVICE_START_NAME( sn76477 )(this);
+}
+
+//-------------------------------------------------
+// device_stop - device-specific stop
+//-------------------------------------------------
+
+void sn76477_device::device_stop()
+{
+ DEVICE_STOP_NAME( sn76477 )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void sn76477_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/emu/sound/sn76477.h b/src/emu/sound/sn76477.h
index 6ca57935202..e6bd30bcd2d 100644
--- a/src/emu/sound/sn76477.h
+++ b/src/emu/sound/sn76477.h
@@ -125,6 +125,29 @@ void sn76477_attack_decay_cap_voltage_w(device_t *device, double data);
void sn76477_vco_voltage_w(device_t *device, double data);
void sn76477_pitch_voltage_w(device_t *device, double data);
-DECLARE_LEGACY_SOUND_DEVICE(SN76477, sn76477);
+class sn76477_device : public device_t,
+ public device_sound_interface
+{
+public:
+ sn76477_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~sn76477_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_stop();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type SN76477;
+
#endif/* __SN76477_H__ */
diff --git a/src/emu/sound/sn76496.c b/src/emu/sound/sn76496.c
index 9aa05ef9409..722bdfa6ab9 100644
--- a/src/emu/sound/sn76496.c
+++ b/src/emu/sound/sn76496.c
@@ -160,7 +160,7 @@ INLINE sn76496_state *get_safe_token(device_t *device)
device->type() == NCR7496 ||
device->type() == GAMEGEAR ||
device->type() == SEGAPSG);
- return (sn76496_state *)downcast<legacy_device_base *>(device)->token();
+ return (sn76496_state *)downcast<sn76496_device *>(device)->token();
}
READ_LINE_DEVICE_HANDLER( sn76496_ready_r )
@@ -603,16 +603,294 @@ DEVICE_GET_INFO( segapsg )
}
-DEFINE_LEGACY_SOUND_DEVICE(SN76496, sn76496);
-DEFINE_LEGACY_SOUND_DEVICE(U8106, u8106);
-DEFINE_LEGACY_SOUND_DEVICE(Y2404, y2404);
-DEFINE_LEGACY_SOUND_DEVICE(SN76489, sn76489);
-DEFINE_LEGACY_SOUND_DEVICE(SN76489A, sn76489a);
-DEFINE_LEGACY_SOUND_DEVICE(SN76494, sn76494);
-DEFINE_LEGACY_SOUND_DEVICE(SN94624, sn94624);
-DEFINE_LEGACY_SOUND_DEVICE(NCR7496, ncr7496);
-DEFINE_LEGACY_SOUND_DEVICE(GAMEGEAR, gamegear);
-DEFINE_LEGACY_SOUND_DEVICE(SEGAPSG, segapsg);
+const device_type SN76496 = &device_creator<sn76496_device>;
+
+sn76496_device::sn76496_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, SN76496, "SN76496", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(sn76496_state));
+}
+sn76496_device::sn76496_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, type, name, tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(sn76496_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void sn76496_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void sn76496_device::device_start()
+{
+ DEVICE_START_NAME( sn76496 )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void sn76496_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
+const device_type U8106 = &device_creator<u8106_device>;
+
+u8106_device::u8106_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : sn76496_device(mconfig, U8106, "U8106", tag, owner, clock)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void u8106_device::device_start()
+{
+ DEVICE_START_NAME( u8106 )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void u8106_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
+const device_type Y2404 = &device_creator<y2404_device>;
+
+y2404_device::y2404_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : sn76496_device(mconfig, Y2404, "Y2404", tag, owner, clock)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void y2404_device::device_start()
+{
+ DEVICE_START_NAME( y2404 )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void y2404_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
+const device_type SN76489 = &device_creator<sn76489_device>;
+
+sn76489_device::sn76489_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : sn76496_device(mconfig, SN76489, "SN76489", tag, owner, clock)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void sn76489_device::device_start()
+{
+ DEVICE_START_NAME( sn76489 )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void sn76489_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
+const device_type SN76489A = &device_creator<sn76489a_device>;
+
+sn76489a_device::sn76489a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : sn76496_device(mconfig, SN76489A, "SN76489A", tag, owner, clock)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void sn76489a_device::device_start()
+{
+ DEVICE_START_NAME( sn76489a )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void sn76489a_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
+const device_type SN76494 = &device_creator<sn76494_device>;
+
+sn76494_device::sn76494_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : sn76496_device(mconfig, SN76494, "SN76494", tag, owner, clock)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void sn76494_device::device_start()
+{
+ DEVICE_START_NAME( sn76494 )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void sn76494_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
+const device_type SN94624 = &device_creator<sn94624_device>;
+
+sn94624_device::sn94624_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : sn76496_device(mconfig, SN94624, "SN94624", tag, owner, clock)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void sn94624_device::device_start()
+{
+ DEVICE_START_NAME( sn94624 )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void sn94624_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
+const device_type NCR7496 = &device_creator<ncr7496_device>;
+
+ncr7496_device::ncr7496_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : sn76496_device(mconfig, NCR7496, "NCR7496", tag, owner, clock)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void ncr7496_device::device_start()
+{
+ DEVICE_START_NAME( ncr7496 )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void ncr7496_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
+const device_type GAMEGEAR = &device_creator<gamegear_device>;
+
+gamegear_device::gamegear_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : sn76496_device(mconfig, GAMEGEAR, "Game Gear PSG", tag, owner, clock)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void gamegear_device::device_start()
+{
+ DEVICE_START_NAME( gamegear )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void gamegear_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
+const device_type SEGAPSG = &device_creator<segapsg_device>;
+
+segapsg_device::segapsg_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : sn76496_device(mconfig, SEGAPSG, "SEGA VDP PSG", tag, owner, clock)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void segapsg_device::device_start()
+{
+ DEVICE_START_NAME( segapsg )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void segapsg_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
/*****************************************************************
New class implementation
diff --git a/src/emu/sound/sn76496.h b/src/emu/sound/sn76496.h
index 1fa09f2a500..e42ebbc3d81 100644
--- a/src/emu/sound/sn76496.h
+++ b/src/emu/sound/sn76496.h
@@ -9,16 +9,156 @@ READ_LINE_DEVICE_HANDLER( sn76496_ready_r );
WRITE8_DEVICE_HANDLER( sn76496_w );
WRITE8_DEVICE_HANDLER( sn76496_stereo_w );
-DECLARE_LEGACY_SOUND_DEVICE(SN76496, sn76496);
-DECLARE_LEGACY_SOUND_DEVICE(U8106, u8106);
-DECLARE_LEGACY_SOUND_DEVICE(Y2404, y2404);
-DECLARE_LEGACY_SOUND_DEVICE(SN76489, sn76489);
-DECLARE_LEGACY_SOUND_DEVICE(SN76489A, sn76489a);
-DECLARE_LEGACY_SOUND_DEVICE(SN76494, sn76494);
-DECLARE_LEGACY_SOUND_DEVICE(SN94624, sn94624);
-DECLARE_LEGACY_SOUND_DEVICE(NCR7496, ncr7496);
-DECLARE_LEGACY_SOUND_DEVICE(GAMEGEAR, gamegear);
-DECLARE_LEGACY_SOUND_DEVICE(SEGAPSG, segapsg);
+class sn76496_device : public device_t,
+ public device_sound_interface
+{
+public:
+ sn76496_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ sn76496_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
+ ~sn76496_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type SN76496;
+
+class u8106_device : public sn76496_device
+{
+public:
+ u8106_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+protected:
+ // device-level overrides
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+};
+
+extern const device_type U8106;
+
+class y2404_device : public sn76496_device
+{
+public:
+ y2404_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+protected:
+ // device-level overrides
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+};
+
+extern const device_type Y2404;
+
+class sn76489_device : public sn76496_device
+{
+public:
+ sn76489_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+protected:
+ // device-level overrides
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+};
+
+extern const device_type SN76489;
+
+class sn76489a_device : public sn76496_device
+{
+public:
+ sn76489a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+protected:
+ // device-level overrides
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+};
+
+extern const device_type SN76489A;
+
+class sn76494_device : public sn76496_device
+{
+public:
+ sn76494_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+protected:
+ // device-level overrides
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+};
+
+extern const device_type SN76494;
+
+class sn94624_device : public sn76496_device
+{
+public:
+ sn94624_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+protected:
+ // device-level overrides
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+};
+
+extern const device_type SN94624;
+
+class ncr7496_device : public sn76496_device
+{
+public:
+ ncr7496_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+protected:
+ // device-level overrides
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+};
+
+extern const device_type NCR7496;
+
+class gamegear_device : public sn76496_device
+{
+public:
+ gamegear_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+protected:
+ // device-level overrides
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+};
+
+extern const device_type GAMEGEAR;
+
+class segapsg_device : public sn76496_device
+{
+public:
+ segapsg_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+protected:
+ // device-level overrides
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+};
+
+extern const device_type SEGAPSG;
+
/*****************************************************************
New class implementation
diff --git a/src/emu/sound/snkwave.c b/src/emu/sound/snkwave.c
index 32d09bc167a..818af278f23 100644
--- a/src/emu/sound/snkwave.c
+++ b/src/emu/sound/snkwave.c
@@ -36,7 +36,7 @@ INLINE snkwave_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == SNKWAVE);
- return (snkwave_state *)downcast<legacy_device_base *>(device)->token();
+ return (snkwave_state *)downcast<snkwave_device *>(device)->token();
}
@@ -186,4 +186,42 @@ DEVICE_GET_INFO( snkwave )
}
}
-DEFINE_LEGACY_SOUND_DEVICE(SNKWAVE, snkwave);
+const device_type SNKWAVE = &device_creator<snkwave_device>;
+
+snkwave_device::snkwave_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, SNKWAVE, "SNK Wave", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(snkwave_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void snkwave_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void snkwave_device::device_start()
+{
+ DEVICE_START_NAME( snkwave )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void snkwave_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/emu/sound/snkwave.h b/src/emu/sound/snkwave.h
index 44e1d163a75..2ed3a67048d 100644
--- a/src/emu/sound/snkwave.h
+++ b/src/emu/sound/snkwave.h
@@ -7,6 +7,28 @@
WRITE8_DEVICE_HANDLER( snkwave_w );
-DECLARE_LEGACY_SOUND_DEVICE(SNKWAVE, snkwave);
+class snkwave_device : public device_t,
+ public device_sound_interface
+{
+public:
+ snkwave_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~snkwave_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type SNKWAVE;
+
#endif /* __SNKWAVE_H__ */
diff --git a/src/emu/sound/sp0250.c b/src/emu/sound/sp0250.c
index 32b9d06d47e..d32981c2803 100644
--- a/src/emu/sound/sp0250.c
+++ b/src/emu/sound/sp0250.c
@@ -60,7 +60,7 @@ INLINE sp0250_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == SP0250);
- return (sp0250_state *)downcast<legacy_device_base *>(device)->token();
+ return (sp0250_state *)downcast<sp0250_device *>(device)->token();
}
@@ -266,4 +266,42 @@ DEVICE_GET_INFO( sp0250 )
-DEFINE_LEGACY_SOUND_DEVICE(SP0250, sp0250);
+const device_type SP0250 = &device_creator<sp0250_device>;
+
+sp0250_device::sp0250_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, SP0250, "SP0250", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(sp0250_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void sp0250_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void sp0250_device::device_start()
+{
+ DEVICE_START_NAME( sp0250 )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void sp0250_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/emu/sound/sp0250.h b/src/emu/sound/sp0250.h
index 4a125683d28..dba4d8dd6d5 100644
--- a/src/emu/sound/sp0250.h
+++ b/src/emu/sound/sp0250.h
@@ -12,6 +12,28 @@ struct sp0250_interface {
WRITE8_DEVICE_HANDLER( sp0250_w );
UINT8 sp0250_drq_r(device_t *device);
-DECLARE_LEGACY_SOUND_DEVICE(SP0250, sp0250);
+class sp0250_device : public device_t,
+ public device_sound_interface
+{
+public:
+ sp0250_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~sp0250_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type SP0250;
+
#endif /* __SP0250_H__ */
diff --git a/src/emu/sound/sp0256.c b/src/emu/sound/sp0256.c
index 258623c30e3..1f5f155956b 100644
--- a/src/emu/sound/sp0256.c
+++ b/src/emu/sound/sp0256.c
@@ -135,7 +135,7 @@ INLINE sp0256_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == SP0256);
- return (sp0256_state *)downcast<legacy_device_base *>(device)->token();
+ return (sp0256_state *)downcast<sp0256_device *>(device)->token();
}
@@ -1390,4 +1390,51 @@ DEVICE_GET_INFO( sp0256 )
}
-DEFINE_LEGACY_SOUND_DEVICE(SP0256, sp0256);
+const device_type SP0256 = &device_creator<sp0256_device>;
+
+sp0256_device::sp0256_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, SP0256, "SP0256", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(sp0256_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void sp0256_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void sp0256_device::device_start()
+{
+ DEVICE_START_NAME( sp0256 )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void sp0256_device::device_reset()
+{
+ DEVICE_RESET_NAME( sp0256 )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void sp0256_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/emu/sound/sp0256.h b/src/emu/sound/sp0256.h
index 49f2719431d..f82dfc035b8 100644
--- a/src/emu/sound/sp0256.h
+++ b/src/emu/sound/sp0256.h
@@ -71,6 +71,29 @@ READ_LINE_DEVICE_HANDLER( sp0256_sby_r );
READ16_DEVICE_HANDLER( spb640_r );
WRITE16_DEVICE_HANDLER( spb640_w );
-DECLARE_LEGACY_SOUND_DEVICE(SP0256, sp0256);
+class sp0256_device : public device_t,
+ public device_sound_interface
+{
+public:
+ sp0256_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~sp0256_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_reset();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type SP0256;
+
#endif /* __SP0256_H__ */
diff --git a/src/emu/sound/speaker.c b/src/emu/sound/speaker.c
index 25d5eb1b8be..1fae77f3b55 100644
--- a/src/emu/sound/speaker.c
+++ b/src/emu/sound/speaker.c
@@ -129,7 +129,7 @@ INLINE speaker_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == SPEAKER_SOUND);
- return (speaker_state *)downcast<legacy_device_base *>(device)->token();
+ return (speaker_state *)downcast<speaker_sound_device *>(device)->token();
}
@@ -444,4 +444,42 @@ DEVICE_GET_INFO( speaker_sound )
}
-DEFINE_LEGACY_SOUND_DEVICE(SPEAKER_SOUND, speaker_sound);
+const device_type SPEAKER_SOUND = &device_creator<speaker_sound_device>;
+
+speaker_sound_device::speaker_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, SPEAKER_SOUND, "Speaker", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(speaker_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void speaker_sound_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void speaker_sound_device::device_start()
+{
+ DEVICE_START_NAME( speaker )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void speaker_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/emu/sound/speaker.h b/src/emu/sound/speaker.h
index d1da4660665..2506cca15fe 100644
--- a/src/emu/sound/speaker.h
+++ b/src/emu/sound/speaker.h
@@ -24,6 +24,28 @@ struct _speaker_interface
void speaker_level_w (device_t *device, int new_level);
-DECLARE_LEGACY_SOUND_DEVICE(SPEAKER_SOUND, speaker_sound);
+class speaker_sound_device : public device_t,
+ public device_sound_interface
+{
+public:
+ speaker_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~speaker_sound_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type SPEAKER_SOUND;
+
#endif /* __SPEAKER_H__ */
diff --git a/src/emu/sound/st0016.c b/src/emu/sound/st0016.c
index e67e235f9d5..739b5a6aa7d 100644
--- a/src/emu/sound/st0016.c
+++ b/src/emu/sound/st0016.c
@@ -22,7 +22,7 @@ INLINE st0016_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == ST0016);
- return (st0016_state *)downcast<legacy_device_base *>(device)->token();
+ return (st0016_state *)downcast<st0016_device *>(device)->token();
}
@@ -173,4 +173,42 @@ DEVICE_GET_INFO( st0016 )
}
-DEFINE_LEGACY_SOUND_DEVICE(ST0016, st0016);
+const device_type ST0016 = &device_creator<st0016_device>;
+
+st0016_device::st0016_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, ST0016, "ST0016", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(st0016_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void st0016_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void st0016_device::device_start()
+{
+ DEVICE_START_NAME( st0016 )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void st0016_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/emu/sound/st0016.h b/src/emu/sound/st0016.h
index 95203ffd2ba..cff9f2312e1 100644
--- a/src/emu/sound/st0016.h
+++ b/src/emu/sound/st0016.h
@@ -14,6 +14,28 @@ struct _st0016_interface
READ8_DEVICE_HANDLER( st0016_snd_r );
WRITE8_DEVICE_HANDLER( st0016_snd_w );
-DECLARE_LEGACY_SOUND_DEVICE(ST0016, st0016);
+class st0016_device : public device_t,
+ public device_sound_interface
+{
+public:
+ st0016_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~st0016_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type ST0016;
+
#endif /* __ST0016_H__ */
diff --git a/src/emu/sound/t6w28.c b/src/emu/sound/t6w28.c
index 8f03adaa0aa..ab1448c9f02 100644
--- a/src/emu/sound/t6w28.c
+++ b/src/emu/sound/t6w28.c
@@ -61,7 +61,7 @@ INLINE t6w28_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == T6W28);
- return (t6w28_state *)downcast<legacy_device_base *>(device)->token();
+ return (t6w28_state *)downcast<t6w28_device *>(device)->token();
}
@@ -392,4 +392,42 @@ DEVICE_GET_INFO( t6w28 )
}
-DEFINE_LEGACY_SOUND_DEVICE(T6W28, t6w28);
+const device_type T6W28 = &device_creator<t6w28_device>;
+
+t6w28_device::t6w28_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, T6W28, "T6W28", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(t6w28_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void t6w28_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void t6w28_device::device_start()
+{
+ DEVICE_START_NAME( t6w28 )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void t6w28_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/emu/sound/t6w28.h b/src/emu/sound/t6w28.h
index ab73573d38c..528cd39feba 100644
--- a/src/emu/sound/t6w28.h
+++ b/src/emu/sound/t6w28.h
@@ -7,6 +7,28 @@
WRITE8_DEVICE_HANDLER( t6w28_w );
-DECLARE_LEGACY_SOUND_DEVICE(T6W28, t6w28);
+class t6w28_device : public device_t,
+ public device_sound_interface
+{
+public:
+ t6w28_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~t6w28_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type T6W28;
+
#endif /* __T6W28_H__ */
diff --git a/src/emu/sound/tiaintf.c b/src/emu/sound/tiaintf.c
index 8c977c5c102..94114c80429 100644
--- a/src/emu/sound/tiaintf.c
+++ b/src/emu/sound/tiaintf.c
@@ -13,7 +13,7 @@ INLINE tia_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == TIA);
- return (tia_state *)downcast<legacy_device_base *>(device)->token();
+ return (tia_state *)downcast<tia_device *>(device)->token();
}
@@ -76,4 +76,51 @@ DEVICE_GET_INFO( tia )
}
-DEFINE_LEGACY_SOUND_DEVICE(TIA, tia);
+const device_type TIA = &device_creator<tia_device>;
+
+tia_device::tia_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, TIA, "TIA", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(tia_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void tia_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void tia_device::device_start()
+{
+ DEVICE_START_NAME( tia )(this);
+}
+
+//-------------------------------------------------
+// device_stop - device-specific stop
+//-------------------------------------------------
+
+void tia_device::device_stop()
+{
+ DEVICE_STOP_NAME( tia )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void tia_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/emu/sound/tiaintf.h b/src/emu/sound/tiaintf.h
index bb8b05cb1c1..6ce175789b4 100644
--- a/src/emu/sound/tiaintf.h
+++ b/src/emu/sound/tiaintf.h
@@ -7,6 +7,29 @@
WRITE8_DEVICE_HANDLER( tia_sound_w );
-DECLARE_LEGACY_SOUND_DEVICE(TIA, tia);
+class tia_device : public device_t,
+ public device_sound_interface
+{
+public:
+ tia_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~tia_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_stop();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type TIA;
+
#endif /* __TIAINTF_H__ */
diff --git a/src/emu/sound/tms3615.c b/src/emu/sound/tms3615.c
index 5c263335fee..a051f965ae8 100644
--- a/src/emu/sound/tms3615.c
+++ b/src/emu/sound/tms3615.c
@@ -24,7 +24,7 @@ INLINE tms_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == TMS3615);
- return (tms_state *)downcast<legacy_device_base *>(device)->token();
+ return (tms_state *)downcast<tms3615_device *>(device)->token();
}
@@ -120,4 +120,42 @@ DEVICE_GET_INFO( tms3615 )
}
-DEFINE_LEGACY_SOUND_DEVICE(TMS3615, tms3615);
+const device_type TMS3615 = &device_creator<tms3615_device>;
+
+tms3615_device::tms3615_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, TMS3615, "TMS3615", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(tms_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void tms3615_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void tms3615_device::device_start()
+{
+ DEVICE_START_NAME( tms3615 )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void tms3615_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/emu/sound/tms3615.h b/src/emu/sound/tms3615.h
index 294ce98c22d..c7645e00017 100644
--- a/src/emu/sound/tms3615.h
+++ b/src/emu/sound/tms3615.h
@@ -10,6 +10,28 @@ extern void tms3615_enable_w(device_t *device, int enable);
#define TMS3615_FOOTAGE_8 0
#define TMS3615_FOOTAGE_16 1
-DECLARE_LEGACY_SOUND_DEVICE(TMS3615, tms3615);
+class tms3615_device : public device_t,
+ public device_sound_interface
+{
+public:
+ tms3615_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~tms3615_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type TMS3615;
+
#endif /* __TMS3615_H__ */
diff --git a/src/emu/sound/tms36xx.c b/src/emu/sound/tms36xx.c
index bf84ecb0a52..53057650aae 100644
--- a/src/emu/sound/tms36xx.c
+++ b/src/emu/sound/tms36xx.c
@@ -344,7 +344,7 @@ INLINE tms_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == TMS36XX);
- return (tms_state *)downcast<legacy_device_base *>(device)->token();
+ return (tms_state *)downcast<tms36xx_device *>(device)->token();
}
@@ -552,4 +552,42 @@ DEVICE_GET_INFO( tms36xx )
}
-DEFINE_LEGACY_SOUND_DEVICE(TMS36XX, tms36xx);
+const device_type TMS36XX = &device_creator<tms36xx_device>;
+
+tms36xx_device::tms36xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, TMS36XX, "TMS36XX", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(tms_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void tms36xx_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void tms36xx_device::device_start()
+{
+ DEVICE_START_NAME( tms36xx )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void tms36xx_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/emu/sound/tms36xx.h b/src/emu/sound/tms36xx.h
index 54baad6688b..a3cf9469820 100644
--- a/src/emu/sound/tms36xx.h
+++ b/src/emu/sound/tms36xx.h
@@ -28,6 +28,28 @@ extern void tms36xx_note_w(device_t *device, int octave, int note);
/* TMS3617 interface functions */
extern void tms3617_enable_w(device_t *device, int enable);
-DECLARE_LEGACY_SOUND_DEVICE(TMS36XX, tms36xx);
+class tms36xx_device : public device_t,
+ public device_sound_interface
+{
+public:
+ tms36xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~tms36xx_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type TMS36XX;
+
#endif /* __TMS36XX_H__ */
diff --git a/src/emu/sound/tms5110.c b/src/emu/sound/tms5110.c
index 88e682c7895..95f209381b8 100644
--- a/src/emu/sound/tms5110.c
+++ b/src/emu/sound/tms5110.c
@@ -204,14 +204,14 @@ INLINE tms5110_state *get_safe_token(device_t *device)
device->type() == TMC0281 ||
device->type() == CD2802 ||
device->type() == M58817);
- return (tms5110_state *)downcast<legacy_device_base *>(device)->token();
+ return (tms5110_state *)downcast<tms5110_device *>(device)->token();
}
INLINE tmsprom_state *get_safe_token_prom(device_t *device)
{
assert(device != NULL);
assert(device->type() == TMSPROM);
- return (tmsprom_state *)downcast<legacy_device_base *>(device)->token();
+ return (tmsprom_state *)downcast<tmsprom_device *>(device)->token();
}
/* Static function prototypes */
@@ -1586,12 +1586,248 @@ DEVICE_GET_INFO(tmsprom)
}
}
-DEFINE_LEGACY_SOUND_DEVICE(TMS5110, tms5110);
-DEFINE_LEGACY_SOUND_DEVICE(TMS5100, tms5100);
-DEFINE_LEGACY_SOUND_DEVICE(TMS5110A, tms5110a);
-DEFINE_LEGACY_SOUND_DEVICE(CD2801, cd2801);
-DEFINE_LEGACY_SOUND_DEVICE(TMC0281, tmc0281);
-DEFINE_LEGACY_SOUND_DEVICE(CD2802, cd2802);
-DEFINE_LEGACY_SOUND_DEVICE(M58817, m58817);
+const device_type TMS5110 = &device_creator<tms5110_device>;
+
+tms5110_device::tms5110_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, TMS5110, "TMS5110", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(tms5110_state));
+}
+tms5110_device::tms5110_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, type, name, tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(tms5110_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void tms5110_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void tms5110_device::device_start()
+{
+ DEVICE_START_NAME( tms5110 )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void tms5110_device::device_reset()
+{
+ DEVICE_RESET_NAME( tms5110 )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void tms5110_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
+const device_type TMS5100 = &device_creator<tms5100_device>;
+
+tms5100_device::tms5100_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : tms5110_device(mconfig, TMS5100, "TMS5100", tag, owner, clock)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void tms5100_device::device_start()
+{
+ DEVICE_START_NAME( tms5100 )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void tms5100_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
+const device_type TMS5110A = &device_creator<tms5110a_device>;
+
+tms5110a_device::tms5110a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : tms5110_device(mconfig, TMS5110A, "TMS5110A", tag, owner, clock)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void tms5110a_device::device_start()
+{
+ DEVICE_START_NAME( tms5110a )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void tms5110a_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
+const device_type CD2801 = &device_creator<cd2801_device>;
+
+cd2801_device::cd2801_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : tms5110_device(mconfig, CD2801, "CD2801", tag, owner, clock)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void cd2801_device::device_start()
+{
+ DEVICE_START_NAME( cd2801 )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void cd2801_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
+const device_type TMC0281 = &device_creator<tmc0281_device>;
+
+tmc0281_device::tmc0281_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : tms5110_device(mconfig, TMC0281, "TMC0281", tag, owner, clock)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void tmc0281_device::device_start()
+{
+ DEVICE_START_NAME( tmc0281 )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void tmc0281_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
+const device_type CD2802 = &device_creator<cd2802_device>;
+
+cd2802_device::cd2802_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : tms5110_device(mconfig, CD2802, "CD2802", tag, owner, clock)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void cd2802_device::device_start()
+{
+ DEVICE_START_NAME( cd2802 )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void cd2802_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
+const device_type M58817 = &device_creator<m58817_device>;
+
+m58817_device::m58817_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : tms5110_device(mconfig, M58817, "M58817", tag, owner, clock)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void m58817_device::device_start()
+{
+ DEVICE_START_NAME( m58817 )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void m58817_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
+
+const device_type TMSPROM = &device_creator<tmsprom_device>;
+
+tmsprom_device::tmsprom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, TMSPROM, "TMSPROM", tag, owner, clock)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(tmsprom_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void tmsprom_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void tmsprom_device::device_start()
+{
+ DEVICE_START_NAME( tmsprom )(this);
+}
+
-DEFINE_LEGACY_DEVICE(TMSPROM, tmsprom);
diff --git a/src/emu/sound/tms5110.h b/src/emu/sound/tms5110.h
index 6b18ee19262..b4e5bf236ae 100644
--- a/src/emu/sound/tms5110.h
+++ b/src/emu/sound/tms5110.h
@@ -56,13 +56,115 @@ int tms5110_ready_r(device_t *device);
void tms5110_set_frequency(device_t *device, int frequency);
-DECLARE_LEGACY_SOUND_DEVICE(TMS5110, tms5110);
-DECLARE_LEGACY_SOUND_DEVICE(TMS5100, tms5100);
-DECLARE_LEGACY_SOUND_DEVICE(TMS5110A, tms5110a);
-DECLARE_LEGACY_SOUND_DEVICE(CD2801, cd2801);
-DECLARE_LEGACY_SOUND_DEVICE(TMC0281, tmc0281);
-DECLARE_LEGACY_SOUND_DEVICE(CD2802, cd2802);
-DECLARE_LEGACY_SOUND_DEVICE(M58817, m58817);
+class tms5110_device : public device_t,
+ public device_sound_interface
+{
+public:
+ tms5110_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ tms5110_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
+ ~tms5110_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_reset();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type TMS5110;
+
+class tms5100_device : public tms5110_device
+{
+public:
+ tms5100_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+protected:
+ // device-level overrides
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+};
+
+extern const device_type TMS5100;
+
+class tms5110a_device : public tms5110_device
+{
+public:
+ tms5110a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+protected:
+ // device-level overrides
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+};
+
+extern const device_type TMS5110A;
+
+class cd2801_device : public tms5110_device
+{
+public:
+ cd2801_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+protected:
+ // device-level overrides
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+};
+
+extern const device_type CD2801;
+
+class tmc0281_device : public tms5110_device
+{
+public:
+ tmc0281_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+protected:
+ // device-level overrides
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+};
+
+extern const device_type TMC0281;
+
+class cd2802_device : public tms5110_device
+{
+public:
+ cd2802_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+protected:
+ // device-level overrides
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+};
+
+extern const device_type CD2802;
+
+class m58817_device : public tms5110_device
+{
+public:
+ m58817_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+protected:
+ // device-level overrides
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+};
+
+extern const device_type M58817;
+
/* PROM controlled TMS5110 interface */
@@ -92,6 +194,24 @@ WRITE8_DEVICE_HANDLER( tmsprom_rom_csq_w );
WRITE8_DEVICE_HANDLER( tmsprom_bit_w );
WRITE_LINE_DEVICE_HANDLER( tmsprom_enable_w );
-DECLARE_LEGACY_DEVICE(TMSPROM, tmsprom);
+class tmsprom_device : public device_t
+{
+public:
+ tmsprom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~tmsprom_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type TMSPROM;
+
#endif /* __TMS5110_H__ */
diff --git a/src/emu/sound/tms5220.c b/src/emu/sound/tms5220.c
index d5ce8f19b05..2c8e5872c7e 100644
--- a/src/emu/sound/tms5220.c
+++ b/src/emu/sound/tms5220.c
@@ -472,7 +472,7 @@ INLINE tms5220_state *get_safe_token(device_t *device)
device->type() == TMS5220C ||
device->type() == TMC0285 ||
device->type() == TMS5200);
- return (tms5220_state *)downcast<legacy_device_base *>(device)->token();
+ return (tms5220_state *)downcast<tms5220_device *>(device)->token();
}
/* Static function prototypes */
@@ -2057,10 +2057,141 @@ DEVICE_GET_INFO(tms5200)
}
}
-DEFINE_LEGACY_SOUND_DEVICE(TMS5220C, tms5220c);
-DEFINE_LEGACY_SOUND_DEVICE(TMS5220, tms5220);
-DEFINE_LEGACY_SOUND_DEVICE(TMC0285, tmc0285);
-DEFINE_LEGACY_SOUND_DEVICE(TMS5200, tms5200);
+const device_type TMS5220C = &device_creator<tms5220c_device>;
+
+tms5220c_device::tms5220c_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : tms5220_device(mconfig, TMS5220C, "TMS5220C", tag, owner, clock)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void tms5220c_device::device_start()
+{
+ DEVICE_START_NAME( tms5220c )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void tms5220c_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
+const device_type TMS5220 = &device_creator<tms5220_device>;
+
+tms5220_device::tms5220_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, TMS5220, "TMS5220", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(tms5220_state));
+}
+tms5220_device::tms5220_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, type, name, tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(tms5220_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void tms5220_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void tms5220_device::device_start()
+{
+ DEVICE_START_NAME( tms5220 )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void tms5220_device::device_reset()
+{
+ DEVICE_RESET_NAME( tms5220 )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void tms5220_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
+const device_type TMC0285 = &device_creator<tmc0285_device>;
+
+tmc0285_device::tmc0285_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : tms5220_device(mconfig, TMC0285, "TMC0285", tag, owner, clock)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void tmc0285_device::device_start()
+{
+ DEVICE_START_NAME( tmc0285 )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void tmc0285_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
+const device_type TMS5200 = &device_creator<tms5200_device>;
+
+tms5200_device::tms5200_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : tms5220_device(mconfig, TMS5200, "TMS5200", tag, owner, clock)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void tms5200_device::device_start()
+{
+ DEVICE_START_NAME( tms5200 )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void tms5200_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
/******************************************************************************
diff --git a/src/emu/sound/tms5220.h b/src/emu/sound/tms5220.h
index cc58e663e07..dd571b7de7a 100644
--- a/src/emu/sound/tms5220.h
+++ b/src/emu/sound/tms5220.h
@@ -42,10 +42,73 @@ double tms5220_time_to_ready(device_t *device);
void tms5220_set_frequency(device_t *device, int frequency);
-DECLARE_LEGACY_SOUND_DEVICE(TMS5220C, tms5220c);
-DECLARE_LEGACY_SOUND_DEVICE(TMS5220, tms5220);
-DECLARE_LEGACY_SOUND_DEVICE(TMC0285, tmc0285);
-DECLARE_LEGACY_SOUND_DEVICE(TMS5200, tms5200);
+class tms5220_device : public device_t,
+ public device_sound_interface
+{
+public:
+ tms5220_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ tms5220_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
+ ~tms5220_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_reset();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type TMS5220;
+
+class tms5220c_device : public tms5220_device
+{
+public:
+ tms5220c_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+protected:
+ // device-level overrides
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+};
+
+extern const device_type TMS5220C;
+
+class tmc0285_device : public tms5220_device
+{
+public:
+ tmc0285_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+protected:
+ // device-level overrides
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+};
+
+extern const device_type TMC0285;
+
+class tms5200_device : public tms5220_device
+{
+public:
+ tms5200_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+protected:
+ // device-level overrides
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+};
+
+extern const device_type TMS5200;
+
/***************************************************************************
diff --git a/src/emu/sound/upd7759.c b/src/emu/sound/upd7759.c
index 7f611dc3ef9..7061d8a2540 100644
--- a/src/emu/sound/upd7759.c
+++ b/src/emu/sound/upd7759.c
@@ -224,7 +224,7 @@ INLINE upd7759_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == UPD7759);
- return (upd7759_state *)downcast<legacy_device_base *>(device)->token();
+ return (upd7759_state *)downcast<upd7759_device *>(device)->token();
}
@@ -767,4 +767,51 @@ DEVICE_GET_INFO( upd7759 )
}
-DEFINE_LEGACY_SOUND_DEVICE(UPD7759, upd7759);
+const device_type UPD7759 = &device_creator<upd7759_device>;
+
+upd7759_device::upd7759_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, UPD7759, "UPD7759", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(upd7759_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void upd7759_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void upd7759_device::device_start()
+{
+ DEVICE_START_NAME( upd7759 )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void upd7759_device::device_reset()
+{
+ DEVICE_RESET_NAME( upd7759 )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void upd7759_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/emu/sound/upd7759.h b/src/emu/sound/upd7759.h
index 9cae7e9b565..0e8ced82bec 100644
--- a/src/emu/sound/upd7759.h
+++ b/src/emu/sound/upd7759.h
@@ -25,6 +25,29 @@ void upd7759_start_w(device_t *device, UINT8 data);
int upd7759_busy_r(device_t *device);
WRITE8_DEVICE_HANDLER( upd7759_port_w );
-DECLARE_LEGACY_SOUND_DEVICE(UPD7759, upd7759);
+class upd7759_device : public device_t,
+ public device_sound_interface
+{
+public:
+ upd7759_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~upd7759_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_reset();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type UPD7759;
+
#endif /* __UPD7759_H__ */
diff --git a/src/emu/sound/vlm5030.c b/src/emu/sound/vlm5030.c
index 05d69fc22b9..18eddd31591 100644
--- a/src/emu/sound/vlm5030.c
+++ b/src/emu/sound/vlm5030.c
@@ -214,7 +214,7 @@ INLINE vlm5030_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == VLM5030);
- return (vlm5030_state *)downcast<legacy_device_base *>(device)->token();
+ return (vlm5030_state *)downcast<vlm5030_device *>(device)->token();
}
static int get_bits(vlm5030_state *chip, int sbit,int bits)
@@ -715,4 +715,51 @@ DEVICE_GET_INFO( vlm5030 )
}
-DEFINE_LEGACY_SOUND_DEVICE(VLM5030, vlm5030);
+const device_type VLM5030 = &device_creator<vlm5030_device>;
+
+vlm5030_device::vlm5030_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, VLM5030, "VLM5030", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(vlm5030_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void vlm5030_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void vlm5030_device::device_start()
+{
+ DEVICE_START_NAME( vlm5030 )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void vlm5030_device::device_reset()
+{
+ DEVICE_RESET_NAME( vlm5030 )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void vlm5030_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/emu/sound/vlm5030.h b/src/emu/sound/vlm5030.h
index 2d1588f6780..f29105957b2 100644
--- a/src/emu/sound/vlm5030.h
+++ b/src/emu/sound/vlm5030.h
@@ -25,6 +25,29 @@ void vlm5030_vcu(device_t *device, int pin );
/* set ST pin level : set table address A0-A7 / start speech */
void vlm5030_st(device_t *device, int pin );
-DECLARE_LEGACY_SOUND_DEVICE(VLM5030, vlm5030);
+class vlm5030_device : public device_t,
+ public device_sound_interface
+{
+public:
+ vlm5030_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~vlm5030_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_reset();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type VLM5030;
+
#endif /* __VLM5030_H__ */
diff --git a/src/emu/sound/vrender0.c b/src/emu/sound/vrender0.c
index 1584507703c..93fb3d646d9 100644
--- a/src/emu/sound/vrender0.c
+++ b/src/emu/sound/vrender0.c
@@ -26,7 +26,7 @@ INLINE vr0_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == VRENDER0);
- return (vr0_state *)downcast<legacy_device_base *>(device)->token();
+ return (vr0_state *)downcast<vrender0_device *>(device)->token();
}
static void VR0_RenderAudio(vr0_state *VR0, int nsamples,stream_sample_t *l,stream_sample_t *r);
@@ -267,4 +267,42 @@ DEVICE_GET_INFO( vrender0 )
}
-DEFINE_LEGACY_SOUND_DEVICE(VRENDER0, vrender0);
+const device_type VRENDER0 = &device_creator<vrender0_device>;
+
+vrender0_device::vrender0_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, VRENDER0, "VRender0", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(vr0_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void vrender0_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void vrender0_device::device_start()
+{
+ DEVICE_START_NAME( vrender0 )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void vrender0_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/emu/sound/vrender0.h b/src/emu/sound/vrender0.h
index a1a16fb8c1c..af0fbe43022 100644
--- a/src/emu/sound/vrender0.h
+++ b/src/emu/sound/vrender0.h
@@ -17,6 +17,28 @@ void vr0_snd_set_areas(device_t *device,UINT32 *texture,UINT32 *frame);
READ32_DEVICE_HANDLER( vr0_snd_read );
WRITE32_DEVICE_HANDLER( vr0_snd_write );
-DECLARE_LEGACY_SOUND_DEVICE(VRENDER0, vrender0);
+class vrender0_device : public device_t,
+ public device_sound_interface
+{
+public:
+ vrender0_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~vrender0_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type VRENDER0;
+
#endif /* __VRENDER0_H__ */
diff --git a/src/emu/sound/wave.c b/src/emu/sound/wave.c
index 1d879de288b..fc2b8255774 100644
--- a/src/emu/sound/wave.c
+++ b/src/emu/sound/wave.c
@@ -109,4 +109,41 @@ DEVICE_GET_INFO( wave )
}
-DEFINE_LEGACY_SOUND_DEVICE(WAVE, wave);
+const device_type WAVE = &device_creator<wave_device>;
+
+wave_device::wave_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, WAVE, "Cassette", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void wave_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void wave_device::device_start()
+{
+ DEVICE_START_NAME( wave )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void wave_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/emu/sound/wave.h b/src/emu/sound/wave.h
index 9a13ef11952..0701b0b6c96 100644
--- a/src/emu/sound/wave.h
+++ b/src/emu/sound/wave.h
@@ -9,7 +9,24 @@
* CassetteWave interface
*****************************************************************************/
-DECLARE_LEGACY_SOUND_DEVICE(WAVE, wave);
+class wave_device : public device_t,
+ public device_sound_interface
+{
+public:
+ wave_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+};
+
+extern const device_type WAVE;
+
#define WAVE_TAG "wave"
#define WAVE2_TAG "wave2"
diff --git a/src/emu/sound/x1_010.c b/src/emu/sound/x1_010.c
index 73b78f263eb..e5d9bfa3d32 100644
--- a/src/emu/sound/x1_010.c
+++ b/src/emu/sound/x1_010.c
@@ -101,7 +101,7 @@ INLINE x1_010_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == X1_010);
- return (x1_010_state *)downcast<legacy_device_base *>(device)->token();
+ return (x1_010_state *)downcast<x1_010_device *>(device)->token();
}
@@ -311,4 +311,42 @@ DEVICE_GET_INFO( x1_010 )
}
-DEFINE_LEGACY_SOUND_DEVICE(X1_010, x1_010);
+const device_type X1_010 = &device_creator<x1_010_device>;
+
+x1_010_device::x1_010_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, X1_010, "X1-010", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(x1_010_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void x1_010_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void x1_010_device::device_start()
+{
+ DEVICE_START_NAME( x1_010 )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void x1_010_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/emu/sound/x1_010.h b/src/emu/sound/x1_010.h
index 06fa2600e9d..4c95ee6511f 100644
--- a/src/emu/sound/x1_010.h
+++ b/src/emu/sound/x1_010.h
@@ -21,6 +21,28 @@ WRITE16_DEVICE_HANDLER( seta_sound_word_w );
void seta_sound_enable_w(device_t *device, int data);
-DECLARE_LEGACY_SOUND_DEVICE(X1_010, x1_010);
+class x1_010_device : public device_t,
+ public device_sound_interface
+{
+public:
+ x1_010_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~x1_010_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type X1_010;
+
#endif /* __X1_010_H__ */
diff --git a/src/emu/sound/ymf271.c b/src/emu/sound/ymf271.c
index f26cff955a4..2bebd6c4a76 100644
--- a/src/emu/sound/ymf271.c
+++ b/src/emu/sound/ymf271.c
@@ -275,7 +275,7 @@ INLINE YMF271Chip *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == YMF271);
- return (YMF271Chip *)downcast<legacy_device_base *>(device)->token();
+ return (YMF271Chip *)downcast<ymf271_device *>(device)->token();
}
@@ -1836,4 +1836,51 @@ DEVICE_GET_INFO( ymf271 )
}
-DEFINE_LEGACY_SOUND_DEVICE(YMF271, ymf271);
+const device_type YMF271 = &device_creator<ymf271_device>;
+
+ymf271_device::ymf271_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, YMF271, "YMF271", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(YMF271Chip));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void ymf271_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void ymf271_device::device_start()
+{
+ DEVICE_START_NAME( ymf271 )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void ymf271_device::device_reset()
+{
+ DEVICE_RESET_NAME( ymf271 )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void ymf271_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/emu/sound/ymf271.h b/src/emu/sound/ymf271.h
index 45bb20b8a53..2bff143c667 100644
--- a/src/emu/sound/ymf271.h
+++ b/src/emu/sound/ymf271.h
@@ -17,6 +17,29 @@ struct _ymf271_interface
READ8_DEVICE_HANDLER( ymf271_r );
WRITE8_DEVICE_HANDLER( ymf271_w );
-DECLARE_LEGACY_SOUND_DEVICE(YMF271, ymf271);
+class ymf271_device : public device_t,
+ public device_sound_interface
+{
+public:
+ ymf271_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~ymf271_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_reset();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type YMF271;
+
#endif /* __YMF271_H__ */
diff --git a/src/emu/sound/ymf278b.c b/src/emu/sound/ymf278b.c
index eaa2655cc2d..5756ed926d9 100644
--- a/src/emu/sound/ymf278b.c
+++ b/src/emu/sound/ymf278b.c
@@ -157,7 +157,7 @@ INLINE YMF278BChip *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == YMF278B);
- return (YMF278BChip *)downcast<legacy_device_base *>(device)->token();
+ return (YMF278BChip *)downcast<ymf278b_device *>(device)->token();
}
static void ymf278b_write_memory(YMF278BChip *chip, UINT32 offset, UINT8 data)
@@ -1111,4 +1111,51 @@ DEVICE_GET_INFO( ymf278b )
}
-DEFINE_LEGACY_SOUND_DEVICE(YMF278B, ymf278b);
+const device_type YMF278B = &device_creator<ymf278b_device>;
+
+ymf278b_device::ymf278b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, YMF278B, "YMF278B", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(YMF278BChip));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void ymf278b_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void ymf278b_device::device_start()
+{
+ DEVICE_START_NAME( ymf278b )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void ymf278b_device::device_reset()
+{
+ DEVICE_RESET_NAME( ymf278b )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void ymf278b_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/emu/sound/ymf278b.h b/src/emu/sound/ymf278b.h
index e7918cbe5a5..685ba066c8e 100644
--- a/src/emu/sound/ymf278b.h
+++ b/src/emu/sound/ymf278b.h
@@ -17,6 +17,29 @@ struct _ymf278b_interface
READ8_DEVICE_HANDLER( ymf278b_r );
WRITE8_DEVICE_HANDLER( ymf278b_w );
-DECLARE_LEGACY_SOUND_DEVICE(YMF278B, ymf278b);
+class ymf278b_device : public device_t,
+ public device_sound_interface
+{
+public:
+ ymf278b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~ymf278b_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_reset();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type YMF278B;
+
#endif /* __YMF278B_H__ */
diff --git a/src/emu/sound/ymz280b.c b/src/emu/sound/ymz280b.c
index 37d956673d0..f0e31e6bcde 100644
--- a/src/emu/sound/ymz280b.c
+++ b/src/emu/sound/ymz280b.c
@@ -137,7 +137,7 @@ INLINE ymz280b_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == YMZ280B);
- return (ymz280b_state *)downcast<legacy_device_base *>(device)->token();
+ return (ymz280b_state *)downcast<ymz280b_device *>(device)->token();
}
@@ -1073,4 +1073,51 @@ DEVICE_GET_INFO( ymz280b )
}
-DEFINE_LEGACY_SOUND_DEVICE(YMZ280B, ymz280b);
+const device_type YMZ280B = &device_creator<ymz280b_device>;
+
+ymz280b_device::ymz280b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, YMZ280B, "YMZ280B", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(ymz280b_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void ymz280b_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void ymz280b_device::device_start()
+{
+ DEVICE_START_NAME( ymz280b )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void ymz280b_device::device_reset()
+{
+ DEVICE_RESET_NAME( ymz280b )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void ymz280b_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/emu/sound/ymz280b.h b/src/emu/sound/ymz280b.h
index 18b9eec4ef0..2278d576efd 100644
--- a/src/emu/sound/ymz280b.h
+++ b/src/emu/sound/ymz280b.h
@@ -24,6 +24,29 @@ struct _ymz280b_interface
READ8_DEVICE_HANDLER ( ymz280b_r );
WRITE8_DEVICE_HANDLER( ymz280b_w );
-DECLARE_LEGACY_SOUND_DEVICE(YMZ280B, ymz280b);
+class ymz280b_device : public device_t,
+ public device_sound_interface
+{
+public:
+ ymz280b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~ymz280b_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_reset();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type YMZ280B;
+
#endif /* __YMZ280B_H__ */
diff --git a/src/emu/sound/zsg2.c b/src/emu/sound/zsg2.c
index fa0d05ebd24..a9494cd4933 100644
--- a/src/emu/sound/zsg2.c
+++ b/src/emu/sound/zsg2.c
@@ -69,7 +69,7 @@ INLINE zsg2_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == ZSG2);
- return (zsg2_state *)downcast<legacy_device_base *>(device)->token();
+ return (zsg2_state *)downcast<zsg2_device *>(device)->token();
}
static STREAM_UPDATE( update_stereo )
@@ -257,4 +257,42 @@ DEVICE_GET_INFO( zsg2 )
}
-DEFINE_LEGACY_SOUND_DEVICE(ZSG2, zsg2);
+const device_type ZSG2 = &device_creator<zsg2_device>;
+
+zsg2_device::zsg2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, ZSG2, "ZSG-2", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(zsg2_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void zsg2_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void zsg2_device::device_start()
+{
+ DEVICE_START_NAME( zsg2 )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void zsg2_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/emu/sound/zsg2.h b/src/emu/sound/zsg2.h
index 209b20141c1..e45cbcddffd 100644
--- a/src/emu/sound/zsg2.h
+++ b/src/emu/sound/zsg2.h
@@ -16,6 +16,28 @@ struct _zsg2_interface
const char *samplergn;
};
-DECLARE_LEGACY_SOUND_DEVICE(ZSG2, zsg2);
+class zsg2_device : public device_t,
+ public device_sound_interface
+{
+public:
+ zsg2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~zsg2_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type ZSG2;
+
#endif /* __ZSG2_H__ */
diff --git a/src/emu/video/hd63484.c b/src/emu/video/hd63484.c
index 82c5eefee24..c057bd86b2d 100644
--- a/src/emu/video/hd63484.c
+++ b/src/emu/video/hd63484.c
@@ -58,7 +58,7 @@ INLINE hd63484_state *get_safe_token( device_t *device )
assert(device != NULL);
assert(device->type() == HD63484);
- return (hd63484_state *)downcast<legacy_device_base *>(device)->token();
+ return (hd63484_state *)downcast<hd63484_device *>(device)->token();
}
INLINE const hd63484_interface *get_interface( device_t *device )
@@ -1591,4 +1591,40 @@ DEVICE_GET_INFO(hd63484)
}
}
-DEFINE_LEGACY_DEVICE(HD63484, hd63484);
+const device_type HD63484 = &device_creator<hd63484_device>;
+
+hd63484_device::hd63484_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, HD63484, "HD63484", tag, owner, clock)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(hd63484_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void hd63484_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void hd63484_device::device_start()
+{
+ DEVICE_START_NAME( hd63484 )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void hd63484_device::device_reset()
+{
+ DEVICE_RESET_NAME( hd63484 )(this);
+}
+
+
diff --git a/src/emu/video/hd63484.h b/src/emu/video/hd63484.h
index 26a5c742d89..1ef5fafbd6d 100644
--- a/src/emu/video/hd63484.h
+++ b/src/emu/video/hd63484.h
@@ -14,7 +14,26 @@
TYPE DEFINITIONS
***************************************************************************/
-DECLARE_LEGACY_DEVICE(HD63484, hd63484);
+class hd63484_device : public device_t
+{
+public:
+ hd63484_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~hd63484_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_reset();
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type HD63484;
+
#define HD63484_RAM_SIZE 0x100000
diff --git a/src/emu/video/i8275.c b/src/emu/video/i8275.c
index 210e6a52145..129f247c868 100644
--- a/src/emu/video/i8275.c
+++ b/src/emu/video/i8275.c
@@ -132,7 +132,7 @@ INLINE i8275_t *get_safe_token(device_t *device)
assert(device != NULL);
assert(device->type() == I8275);
- return (i8275_t *)downcast<legacy_device_base *>(device)->token();
+ return (i8275_t *)downcast<i8275_device *>(device)->token();
}
@@ -609,4 +609,40 @@ DEVICE_GET_INFO( i8275 )
}
}
-DEFINE_LEGACY_DEVICE(I8275, i8275);
+const device_type I8275 = &device_creator<i8275_device>;
+
+i8275_device::i8275_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, I8275, "Intel 8275", tag, owner, clock)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(i8275_t));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void i8275_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void i8275_device::device_start()
+{
+ DEVICE_START_NAME( i8275 )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void i8275_device::device_reset()
+{
+ DEVICE_RESET_NAME( i8275 )(this);
+}
+
+
diff --git a/src/emu/video/i8275.h b/src/emu/video/i8275.h
index 689a7f6b046..350b285f4de 100644
--- a/src/emu/video/i8275.h
+++ b/src/emu/video/i8275.h
@@ -18,7 +18,26 @@
MACROS
***************************************************************************/
-DECLARE_LEGACY_DEVICE(I8275, i8275);
+class i8275_device : public device_t
+{
+public:
+ i8275_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~i8275_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_reset();
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type I8275;
+
/***************************************************************************
TYPE DEFINITIONS
diff --git a/src/emu/video/s2636.c b/src/emu/video/s2636.c
index 73706814ae8..ed5bc615fdf 100644
--- a/src/emu/video/s2636.c
+++ b/src/emu/video/s2636.c
@@ -119,7 +119,7 @@ INLINE s2636_state *get_safe_token( device_t *device )
assert(device != NULL);
assert(device->type() == S2636);
- return (s2636_state *)downcast<legacy_device_base *>(device)->token();
+ return (s2636_state *)downcast<s2636_device *>(device)->token();
}
INLINE const s2636_interface *get_interface( device_t *device )
@@ -377,4 +377,31 @@ DEVICE_GET_INFO(s2636)
}
}
-DEFINE_LEGACY_DEVICE(S2636, s2636);
+const device_type S2636 = &device_creator<s2636_device>;
+
+s2636_device::s2636_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, S2636, "Signetics 2636", tag, owner, clock)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(s2636_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void s2636_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void s2636_device::device_start()
+{
+ DEVICE_START_NAME( s2636 )(this);
+}
+
+
diff --git a/src/emu/video/s2636.h b/src/emu/video/s2636.h
index 1ca2bc21067..2caf7aed532 100644
--- a/src/emu/video/s2636.h
+++ b/src/emu/video/s2636.h
@@ -35,7 +35,25 @@ struct _s2636_interface
*
*************************************/
-DECLARE_LEGACY_DEVICE(S2636, s2636);
+class s2636_device : public device_t
+{
+public:
+ s2636_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~s2636_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type S2636;
+
#define MCFG_S2636_ADD(_tag, _interface) \
MCFG_DEVICE_ADD(_tag, S2636, 0) \
diff --git a/src/emu/video/saa5050.c b/src/emu/video/saa5050.c
index 09422ce2e1b..9feb6083263 100644
--- a/src/emu/video/saa5050.c
+++ b/src/emu/video/saa5050.c
@@ -61,7 +61,7 @@ INLINE saa5050_state *get_safe_token( device_t *device )
assert(device != NULL);
assert(device->type() == SAA5050);
- return (saa5050_state *)downcast<legacy_device_base *>(device)->token();
+ return (saa5050_state *)downcast<saa5050_device *>(device)->token();
}
INLINE const saa5050_interface *get_interface( device_t *device )
@@ -395,4 +395,40 @@ DEVICE_GET_INFO(saa5050)
}
}
-DEFINE_LEGACY_DEVICE(SAA5050, saa5050);
+const device_type SAA5050 = &device_creator<saa5050_device>;
+
+saa5050_device::saa5050_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, SAA5050, "SAA5050", tag, owner, clock)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(saa5050_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void saa5050_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void saa5050_device::device_start()
+{
+ DEVICE_START_NAME( saa5050 )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void saa5050_device::device_reset()
+{
+ DEVICE_RESET_NAME( saa5050 )(this);
+}
+
+
diff --git a/src/emu/video/saa5050.h b/src/emu/video/saa5050.h
index 1f3dc816f08..88cdeca309b 100644
--- a/src/emu/video/saa5050.h
+++ b/src/emu/video/saa5050.h
@@ -26,7 +26,26 @@ struct _saa5050_interface
int rev;
};
-DECLARE_LEGACY_DEVICE(SAA5050, saa5050);
+class saa5050_device : public device_t
+{
+public:
+ saa5050_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~saa5050_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_reset();
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type SAA5050;
+
/***************************************************************************
DEVICE CONFIGURATION MACROS
diff --git a/src/emu/video/tlc34076.c b/src/emu/video/tlc34076.c
index 2e6a3318bfe..e6dc7225d6d 100644
--- a/src/emu/video/tlc34076.c
+++ b/src/emu/video/tlc34076.c
@@ -52,7 +52,7 @@ INLINE tlc34076_state *get_safe_token( device_t *device )
assert(device != NULL);
assert(device->type() == TLC34076);
- return (tlc34076_state *)downcast<legacy_device_base *>(device)->token();
+ return (tlc34076_state *)downcast<tlc34076_device *>(device)->token();
}
/*************************************
@@ -295,4 +295,40 @@ DEVICE_GET_INFO(tlc34076)
}
}
-DEFINE_LEGACY_DEVICE(TLC34076, tlc34076);
+const device_type TLC34076 = &device_creator<tlc34076_device>;
+
+tlc34076_device::tlc34076_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, TLC34076, "TLC34076", tag, owner, clock)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(tlc34076_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void tlc34076_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void tlc34076_device::device_start()
+{
+ DEVICE_START_NAME( tlc34076 )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void tlc34076_device::device_reset()
+{
+ DEVICE_RESET_NAME( tlc34076 )(this);
+}
+
+
diff --git a/src/emu/video/tlc34076.h b/src/emu/video/tlc34076.h
index 4581b4f5d4e..62d03d0d2cb 100644
--- a/src/emu/video/tlc34076.h
+++ b/src/emu/video/tlc34076.h
@@ -25,7 +25,26 @@ struct _tlc34076_config
extern const tlc34076_config tlc34076_6_bit_intf;
-DECLARE_LEGACY_DEVICE(TLC34076, tlc34076);
+class tlc34076_device : public device_t
+{
+public:
+ tlc34076_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~tlc34076_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_reset();
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type TLC34076;
+
/***************************************************************************
diff --git a/src/emu/video/tms9927.c b/src/emu/video/tms9927.c
index e38597f0917..00c764eaca0 100644
--- a/src/emu/video/tms9927.c
+++ b/src/emu/video/tms9927.c
@@ -64,7 +64,7 @@ INLINE tms9927_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == TMS9927);
- return (tms9927_state *)downcast<legacy_device_base *>(device)->token();
+ return (tms9927_state *)downcast<tms9927_device *>(device)->token();
}
@@ -357,7 +357,78 @@ DEVICE_GET_INFO( crt5057 )
}
-DEFINE_LEGACY_DEVICE(TMS9927, tms9927);
-DEFINE_LEGACY_DEVICE(CRT5027, crt5027);
-DEFINE_LEGACY_DEVICE(CRT5037, crt5037);
-DEFINE_LEGACY_DEVICE(CRT5057, crt5057);
+const device_type TMS9927 = &device_creator<tms9927_device>;
+
+tms9927_device::tms9927_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, TMS9927, "TMS9927", tag, owner, clock)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(tms9927_state));
+}
+tms9927_device::tms9927_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, type, name, tag, owner, clock)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(tms9927_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void tms9927_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void tms9927_device::device_start()
+{
+ DEVICE_START_NAME( tms9927 )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void tms9927_device::device_reset()
+{
+ DEVICE_RESET_NAME( tms9927 )(this);
+}
+
+//-------------------------------------------------
+// device_stop - device-specific stop
+//-------------------------------------------------
+
+void tms9927_device::device_stop()
+{
+ DEVICE_STOP_NAME( tms9927 )(this);
+}
+
+
+const device_type CRT5027 = &device_creator<crt5027_device>;
+
+crt5027_device::crt5027_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : tms9927_device(mconfig, CRT5027, "CRT5027", tag, owner, clock)
+{
+}
+
+
+const device_type CRT5037 = &device_creator<crt5037_device>;
+
+crt5037_device::crt5037_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : tms9927_device(mconfig, CRT5037, "CRT5037", tag, owner, clock)
+{
+}
+
+
+const device_type CRT5057 = &device_creator<crt5057_device>;
+
+crt5057_device::crt5057_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : tms9927_device(mconfig, CRT5057, "CRT5057", tag, owner, clock)
+{
+}
+
+
diff --git a/src/emu/video/tms9927.h b/src/emu/video/tms9927.h
index a1eb5d014f5..63bf5d84dfd 100644
--- a/src/emu/video/tms9927.h
+++ b/src/emu/video/tms9927.h
@@ -13,10 +13,52 @@
#include "devlegcy.h"
-DECLARE_LEGACY_DEVICE(TMS9927, tms9927);
-DECLARE_LEGACY_DEVICE(CRT5027, crt5027);
-DECLARE_LEGACY_DEVICE(CRT5037, crt5037);
-DECLARE_LEGACY_DEVICE(CRT5057, crt5057);
+class tms9927_device : public device_t
+{
+public:
+ tms9927_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ tms9927_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
+ ~tms9927_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_stop();
+ virtual void device_reset();
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type TMS9927;
+
+class crt5027_device : public tms9927_device
+{
+public:
+ crt5027_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
+extern const device_type CRT5027;
+
+class crt5037_device : public tms9927_device
+{
+public:
+ crt5037_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
+extern const device_type CRT5037;
+
+class crt5057_device : public tms9927_device
+{
+public:
+ crt5057_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
+extern const device_type CRT5057;
+
#define MCFG_TMS9927_ADD(_tag, _clock, _config) \
diff --git a/src/emu/video/voodoo.c b/src/emu/video/voodoo.c
index e23667b0297..c396407eb48 100644
--- a/src/emu/video/voodoo.c
+++ b/src/emu/video/voodoo.c
@@ -316,7 +316,7 @@ INLINE voodoo_state *get_safe_token(device_t *device)
assert(device != NULL);
assert((device->type() == VOODOO_1) || (device->type() == VOODOO_2) || (device->type() == VOODOO_BANSHEE) || (device->type() == VOODOO_3));
- return (voodoo_state *)downcast<legacy_device_base *>(device)->token();
+ return (voodoo_state *)downcast<voodoo_device *>(device)->token();
}
@@ -5713,10 +5713,109 @@ static void dump_rasterizer_stats(voodoo_state *v)
}
}
-DEFINE_LEGACY_DEVICE(VOODOO_1, voodoo_1);
-DEFINE_LEGACY_DEVICE(VOODOO_2, voodoo_2);
-DEFINE_LEGACY_DEVICE(VOODOO_BANSHEE, voodoo_banshee);
-DEFINE_LEGACY_DEVICE(VOODOO_3, voodoo_3);
+voodoo_device::voodoo_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, type, name, tag, owner, clock)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(voodoo_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void voodoo_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void voodoo_device::device_reset()
+{
+ DEVICE_RESET_NAME( voodoo )(this);
+}
+
+//-------------------------------------------------
+// device_stop - device-specific stop
+//-------------------------------------------------
+
+void voodoo_device::device_stop()
+{
+ DEVICE_STOP_NAME( voodoo )(this);
+}
+
+
+const device_type VOODOO_1 = &device_creator<voodoo_1_device>;
+
+voodoo_1_device::voodoo_1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : voodoo_device(mconfig, VOODOO_1, "3dfx Voodoo Graphics", tag, owner, clock)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void voodoo_1_device::device_start()
+{
+ DEVICE_START_NAME( voodoo_1 )(this);
+}
+
+
+const device_type VOODOO_2 = &device_creator<voodoo_2_device>;
+
+voodoo_2_device::voodoo_2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : voodoo_device(mconfig, VOODOO_2, "3dfx Voodoo 2", tag, owner, clock)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void voodoo_2_device::device_start()
+{
+ DEVICE_START_NAME( voodoo_2 )(this);
+}
+
+
+const device_type VOODOO_BANSHEE = &device_creator<voodoo_banshee_device>;
+
+voodoo_banshee_device::voodoo_banshee_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : voodoo_device(mconfig, VOODOO_BANSHEE, "3dfx Voodoo Banshee", tag, owner, clock)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void voodoo_banshee_device::device_start()
+{
+ DEVICE_START_NAME( voodoo_banshee )(this);
+}
+
+
+const device_type VOODOO_3 = &device_creator<voodoo_3_device>;
+
+voodoo_3_device::voodoo_3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : voodoo_device(mconfig, VOODOO_3, "3dfx Voodoo 3", tag, owner, clock)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void voodoo_3_device::device_start()
+{
+ DEVICE_START_NAME( voodoo_3 )(this);
+}
+
+
/***************************************************************************
GENERIC RASTERIZERS
diff --git a/src/emu/video/voodoo.h b/src/emu/video/voodoo.h
index 6187ef1e549..b6a5c18e855 100644
--- a/src/emu/video/voodoo.h
+++ b/src/emu/video/voodoo.h
@@ -128,8 +128,66 @@ READ32_DEVICE_HANDLER( banshee_rom_r );
/* ----- device interface ----- */
-DECLARE_LEGACY_DEVICE(VOODOO_1, voodoo_1);
-DECLARE_LEGACY_DEVICE(VOODOO_2, voodoo_2);
-DECLARE_LEGACY_DEVICE(VOODOO_BANSHEE, voodoo_banshee);
-DECLARE_LEGACY_DEVICE(VOODOO_3, voodoo_3);
+class voodoo_device : public device_t
+{
+public:
+ voodoo_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
+ ~voodoo_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_stop();
+ virtual void device_reset();
+private:
+ // internal state
+ void *m_token;
+};
+
+class voodoo_1_device : public voodoo_device
+{
+public:
+ voodoo_1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+protected:
+ // device-level overrides
+ virtual void device_start();
+};
+
+extern const device_type VOODOO_1;
+
+class voodoo_2_device : public voodoo_device
+{
+public:
+ voodoo_2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+protected:
+ // device-level overrides
+ virtual void device_start();
+};
+
+extern const device_type VOODOO_2;
+
+class voodoo_banshee_device : public voodoo_device
+{
+public:
+ voodoo_banshee_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+protected:
+ // device-level overrides
+ virtual void device_start();
+};
+
+extern const device_type VOODOO_BANSHEE;
+
+class voodoo_3_device : public voodoo_device
+{
+public:
+ voodoo_3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+protected:
+ // device-level overrides
+ virtual void device_start();
+};
+
+extern const device_type VOODOO_3;
+
#endif
diff --git a/src/mame/audio/amiga.c b/src/mame/audio/amiga.c
index 4fb762e563d..d04e341bb84 100644
--- a/src/mame/audio/amiga.c
+++ b/src/mame/audio/amiga.c
@@ -67,7 +67,7 @@ INLINE amiga_audio *get_safe_token( device_t *device )
assert(device != NULL);
assert(device->type() == AMIGA);
- return (amiga_audio *)downcast<legacy_device_base *>(device)->token();
+ return (amiga_audio *)downcast<amiga_sound_device *>(device)->token();
}
/*************************************
@@ -295,4 +295,42 @@ DEVICE_GET_INFO( amiga_sound )
}
-DEFINE_LEGACY_SOUND_DEVICE(AMIGA, amiga_sound);
+const device_type AMIGA = &device_creator<amiga_sound_device>;
+
+amiga_sound_device::amiga_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, AMIGA, "Amiga Paula", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(amiga_audio));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void amiga_sound_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void amiga_sound_device::device_start()
+{
+ DEVICE_START_NAME( amiga_sound )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void amiga_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/mame/audio/beezer.c b/src/mame/audio/beezer.c
index 208cd606c9b..591dd3434d6 100644
--- a/src/mame/audio/beezer.c
+++ b/src/mame/audio/beezer.c
@@ -126,7 +126,7 @@ INLINE beezer_sound_state *get_safe_token(device_t *device)
assert(device != NULL);
assert(device->type() == BEEZER);
- return (beezer_sound_state *)downcast<legacy_device_base *>(device)->token();
+ return (beezer_sound_state *)downcast<beezer_sound_device *>(device)->token();
}
/*************************************
@@ -395,7 +395,54 @@ static DEVICE_START( beezer_sound )
DEVICE_START_CALL(common_sh_start);
}
-DEFINE_LEGACY_SOUND_DEVICE(BEEZER, beezer_sound);
+const device_type BEEZER = &device_creator<beezer_sound_device>;
+
+beezer_sound_device::beezer_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, BEEZER, "beezer SFX", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(beezer_sound_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void beezer_sound_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void beezer_sound_device::device_start()
+{
+ DEVICE_START_NAME( beezer_sound )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+static DEVICE_RESET( beezer_sound );
+void beezer_sound_device::device_reset()
+{
+ DEVICE_RESET_NAME( beezer_sound )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void beezer_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
/*************************************
*
diff --git a/src/mame/audio/cps3.c b/src/mame/audio/cps3.c
index 301e264f7be..65b2a2a821e 100644
--- a/src/mame/audio/cps3.c
+++ b/src/mame/audio/cps3.c
@@ -30,7 +30,7 @@ INLINE cps3_sound_state *get_safe_token(device_t *device)
assert(device != NULL);
assert(device->type() == CPS3);
- return (cps3_sound_state *)downcast<legacy_device_base *>(device)->token();
+ return (cps3_sound_state *)downcast<cps3_sound_device *>(device)->token();
}
static STREAM_UPDATE( cps3_stream_update )
@@ -188,4 +188,42 @@ READ32_DEVICE_HANDLER( cps3_sound_r )
}
-DEFINE_LEGACY_SOUND_DEVICE(CPS3, cps3_sound);
+const device_type CPS3 = &device_creator<cps3_sound_device>;
+
+cps3_sound_device::cps3_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, CPS3, "CPS3 Custom", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(cps3_sound_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void cps3_sound_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void cps3_sound_device::device_start()
+{
+ DEVICE_START_NAME( cps3_sound )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void cps3_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/mame/audio/exidy.c b/src/mame/audio/exidy.c
index d40d45d3b8e..dc2ff39c47c 100644
--- a/src/mame/audio/exidy.c
+++ b/src/mame/audio/exidy.c
@@ -120,7 +120,7 @@ INLINE exidy_sound_state *get_safe_token(device_t *device)
assert(device != NULL);
assert(device->type() == EXIDY || device->type() == EXIDY_VENTURE || device->type() == EXIDY_VICTORY);
- return (exidy_sound_state *)downcast<legacy_device_base *>(device)->token();
+ return (exidy_sound_state *)downcast<exidy_sound_device *>(device)->token();
}
/*************************************
@@ -419,7 +419,63 @@ static DEVICE_START( exidy_sound )
DEVICE_START_CALL(common_sh_start);
}
-DEFINE_LEGACY_SOUND_DEVICE(EXIDY, exidy_sound);
+const device_type EXIDY = &device_creator<exidy_sound_device>;
+
+exidy_sound_device::exidy_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, EXIDY, "Exidy SFX", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(exidy_sound_state));
+}
+
+exidy_sound_device::exidy_sound_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, type, name, tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(exidy_sound_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void exidy_sound_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void exidy_sound_device::device_start()
+{
+ DEVICE_START_NAME( exidy_sound )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+static DEVICE_RESET( exidy_sound );
+
+void exidy_sound_device::device_reset()
+{
+ DEVICE_RESET_NAME( exidy_sound )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void exidy_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
/*************************************
*
@@ -863,7 +919,52 @@ DEVICE_GET_INFO( venture_sound )
}
}
-DEFINE_LEGACY_SOUND_DEVICE(EXIDY_VENTURE, venture_sound);
+const device_type EXIDY_VENTURE = &device_creator<venture_sound_device>;
+
+venture_sound_device::venture_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : exidy_sound_device(mconfig, EXIDY_VENTURE, "Exidy SFX+PSG", tag, owner, clock)
+{
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void venture_sound_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void venture_sound_device::device_start()
+{
+ DEVICE_START_NAME( venture_sound )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void venture_sound_device::device_reset()
+{
+ DEVICE_RESET_NAME( venture_sound )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void venture_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
static ADDRESS_MAP_START( venture_audio_map, AS_PROGRAM, 8, driver_device )
@@ -1102,7 +1203,52 @@ DEVICE_GET_INFO( victory_sound )
}
-DEFINE_LEGACY_SOUND_DEVICE(EXIDY_VICTORY, victory_sound);
+const device_type EXIDY_VICTORY = &device_creator<victory_sound_device>;
+
+victory_sound_device::victory_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : exidy_sound_device(mconfig, EXIDY_VICTORY, "Exidy SFX+PSG+Speech", tag, owner, clock)
+{
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void victory_sound_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void victory_sound_device::device_start()
+{
+ DEVICE_START_NAME( victory_sound )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void victory_sound_device::device_reset()
+{
+ DEVICE_RESET_NAME( victory_sound )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void victory_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
static ADDRESS_MAP_START( victory_audio_map, AS_PROGRAM, 8, driver_device )
diff --git a/src/mame/audio/exidy.h b/src/mame/audio/exidy.h
index ccd2d1d5bf9..429aeb6d26e 100644
--- a/src/mame/audio/exidy.h
+++ b/src/mame/audio/exidy.h
@@ -1,6 +1,64 @@
-DECLARE_LEGACY_SOUND_DEVICE(EXIDY, exidy_sound);
-DECLARE_LEGACY_SOUND_DEVICE(EXIDY_VENTURE, venture_sound);
-DECLARE_LEGACY_SOUND_DEVICE(EXIDY_VICTORY, victory_sound);
+class exidy_sound_device : public device_t,
+ public device_sound_interface
+{
+public:
+ exidy_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ exidy_sound_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
+ ~exidy_sound_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_reset();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type EXIDY;
+
+class venture_sound_device : public exidy_sound_device
+{
+public:
+ venture_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_reset();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+};
+
+extern const device_type EXIDY_VENTURE;
+
+class victory_sound_device : public exidy_sound_device
+{
+public:
+ victory_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_reset();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+};
+
+extern const device_type EXIDY_VICTORY;
+
READ8_DEVICE_HANDLER( exidy_sh6840_r );
WRITE8_DEVICE_HANDLER( exidy_sh6840_w );
diff --git a/src/mame/audio/exidy440.c b/src/mame/audio/exidy440.c
index 61cc35c8861..80cc3315349 100644
--- a/src/mame/audio/exidy440.c
+++ b/src/mame/audio/exidy440.c
@@ -124,7 +124,30 @@ static void decode_and_filter_cvsd(device_t *device, UINT8 *data, int bytes, int
static void fir_filter(device_t *device, INT32 *input, INT16 *output, int count);
-DECLARE_LEGACY_SOUND_DEVICE(EXIDY440, exidy440_sound);
+class exidy440_sound_device : public device_t,
+ public device_sound_interface
+{
+public:
+ exidy440_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~exidy440_sound_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_stop();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type EXIDY440;
+
/*************************************
*
@@ -137,7 +160,7 @@ INLINE exidy440_audio_state *get_safe_token(device_t *device)
assert(device != NULL);
assert(device->type() == EXIDY440);
- return (exidy440_audio_state *)downcast<legacy_device_base *>(device)->token();
+ return (exidy440_audio_state *)downcast<exidy440_sound_device *>(device)->token();
}
static DEVICE_START( exidy440_sound )
@@ -984,7 +1007,54 @@ DEVICE_GET_INFO( exidy440_sound )
}
-DEFINE_LEGACY_SOUND_DEVICE(EXIDY440, exidy440_sound);
+const device_type EXIDY440 = &device_creator<exidy440_sound_device>;
+
+exidy440_sound_device::exidy440_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, EXIDY440, "Exidy 440 CVSD", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(exidy440_audio_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void exidy440_sound_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void exidy440_sound_device::device_start()
+{
+ DEVICE_START_NAME( exidy440_sound )(this);
+}
+
+//-------------------------------------------------
+// device_stop - device-specific stop
+//-------------------------------------------------
+
+void exidy440_sound_device::device_stop()
+{
+ DEVICE_STOP_NAME( exidy440_sound )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void exidy440_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/mame/audio/flower.c b/src/mame/audio/flower.c
index 2598a795b0d..3f0112a1872 100644
--- a/src/mame/audio/flower.c
+++ b/src/mame/audio/flower.c
@@ -63,7 +63,7 @@ INLINE flower_sound_state *get_safe_token( device_t *device )
assert(device != NULL);
assert(device->type() == FLOWER);
- return (flower_sound_state *)downcast<legacy_device_base *>(device)->token();
+ return (flower_sound_state *)downcast<flower_sound_device *>(device)->token();
}
/* build a table to divide by the number of voices; gain is specified as gain*16 */
@@ -374,4 +374,51 @@ WRITE8_DEVICE_HANDLER( flower_sound2_w )
}
-DEFINE_LEGACY_SOUND_DEVICE(FLOWER, flower_sound);
+const device_type FLOWER = &device_creator<flower_sound_device>;
+
+flower_sound_device::flower_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, FLOWER, "Flower Custom", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(flower_sound_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void flower_sound_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void flower_sound_device::device_start()
+{
+ DEVICE_START_NAME( flower_sound )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void flower_sound_device::device_reset()
+{
+ DEVICE_RESET_NAME( flower_sound )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void flower_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/mame/audio/geebee.c b/src/mame/audio/geebee.c
index a4b45dab655..eee82b65982 100644
--- a/src/mame/audio/geebee.c
+++ b/src/mame/audio/geebee.c
@@ -29,7 +29,7 @@ INLINE geebee_sound_state *get_safe_token(device_t *device)
assert(device != NULL);
assert(device->type() == GEEBEE);
- return (geebee_sound_state *)downcast<legacy_device_base *>(device)->token();
+ return (geebee_sound_state *)downcast<geebee_sound_device *>(device)->token();
}
static TIMER_CALLBACK( volume_decay )
@@ -160,4 +160,42 @@ DEVICE_GET_INFO( geebee_sound )
}
-DEFINE_LEGACY_SOUND_DEVICE(GEEBEE, geebee_sound);
+const device_type GEEBEE = &device_creator<geebee_sound_device>;
+
+geebee_sound_device::geebee_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, GEEBEE, "Gee Bee Custom", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(geebee_sound_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void geebee_sound_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void geebee_sound_device::device_start()
+{
+ DEVICE_START_NAME( geebee_sound )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void geebee_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/mame/audio/gomoku.c b/src/mame/audio/gomoku.c
index 99dff9de13f..c22ae8c03a6 100644
--- a/src/mame/audio/gomoku.c
+++ b/src/mame/audio/gomoku.c
@@ -57,7 +57,7 @@ INLINE gomoku_sound_state *get_safe_token( device_t *device )
assert(device != NULL);
assert(device->type() == GOMOKU);
- return (gomoku_sound_state *)downcast<legacy_device_base *>(device)->token();
+ return (gomoku_sound_state *)downcast<gomoku_sound_device *>(device)->token();
}
@@ -294,4 +294,42 @@ WRITE8_DEVICE_HANDLER( gomoku_sound2_w )
}
-DEFINE_LEGACY_SOUND_DEVICE(GOMOKU, gomoku_sound);
+const device_type GOMOKU = &device_creator<gomoku_sound_device>;
+
+gomoku_sound_device::gomoku_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, GOMOKU, "Gomoku Custom", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(gomoku_sound_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void gomoku_sound_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void gomoku_sound_device::device_start()
+{
+ DEVICE_START_NAME( gomoku_sound )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void gomoku_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/mame/audio/gridlee.c b/src/mame/audio/gridlee.c
index 5df0408d863..132ad2bf0c0 100644
--- a/src/mame/audio/gridlee.c
+++ b/src/mame/audio/gridlee.c
@@ -41,7 +41,7 @@ INLINE gridlee_sound_state *get_safe_token( device_t *device )
assert(device != NULL);
assert(device->type() == GRIDLEE);
- return (gridlee_sound_state *)downcast<legacy_device_base *>(device)->token();
+ return (gridlee_sound_state *)downcast<gridlee_sound_device *>(device)->token();
}
static STREAM_UPDATE( gridlee_stream_update )
@@ -197,4 +197,42 @@ fclose(f);
}
-DEFINE_LEGACY_SOUND_DEVICE(GRIDLEE, gridlee_sound);
+const device_type GRIDLEE = &device_creator<gridlee_sound_device>;
+
+gridlee_sound_device::gridlee_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, GRIDLEE, "Gridlee Custom", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(gridlee_sound_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void gridlee_sound_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void gridlee_sound_device::device_start()
+{
+ DEVICE_START_NAME( gridlee_sound )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void gridlee_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/mame/audio/hyprolyb.c b/src/mame/audio/hyprolyb.c
index 1cd4b32933d..396d540295e 100644
--- a/src/mame/audio/hyprolyb.c
+++ b/src/mame/audio/hyprolyb.c
@@ -18,7 +18,7 @@ INLINE hyprolyb_adpcm_state *get_safe_token( device_t *device )
assert(device != NULL);
assert(device->type() == HYPROLYB_ADPCM);
- return (hyprolyb_adpcm_state *)downcast<legacy_device_base *>(device)->token();
+ return (hyprolyb_adpcm_state *)downcast<hyprolyb_adpcm_device *>(device)->token();
}
static DEVICE_START( hyprolyb_adpcm )
@@ -153,4 +153,51 @@ DEVICE_GET_INFO(hyprolyb_adpcm)
}
}
-DEFINE_LEGACY_SOUND_DEVICE(HYPROLYB_ADPCM, hyprolyb_adpcm);
+const device_type HYPROLYB_ADPCM = &device_creator<hyprolyb_adpcm_device>;
+
+hyprolyb_adpcm_device::hyprolyb_adpcm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, HYPROLYB_ADPCM, "Hyper Olympics Audio", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(hyprolyb_adpcm_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void hyprolyb_adpcm_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void hyprolyb_adpcm_device::device_start()
+{
+ DEVICE_START_NAME( hyprolyb_adpcm )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void hyprolyb_adpcm_device::device_reset()
+{
+ DEVICE_RESET_NAME( hyprolyb_adpcm )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void hyprolyb_adpcm_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/mame/audio/hyprolyb.h b/src/mame/audio/hyprolyb.h
index a6c69bdf56f..1e20f7f2df7 100644
--- a/src/mame/audio/hyprolyb.h
+++ b/src/mame/audio/hyprolyb.h
@@ -3,4 +3,27 @@ READ8_DEVICE_HANDLER( hyprolyb_adpcm_busy_r );
MACHINE_CONFIG_EXTERN( hyprolyb_adpcm );
-DECLARE_LEGACY_SOUND_DEVICE(HYPROLYB_ADPCM, hyprolyb_adpcm);
+class hyprolyb_adpcm_device : public device_t,
+ public device_sound_interface
+{
+public:
+ hyprolyb_adpcm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~hyprolyb_adpcm_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_reset();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type HYPROLYB_ADPCM;
+
diff --git a/src/mame/audio/irem.c b/src/mame/audio/irem.c
index 2999de56006..1f6e4a56c1f 100644
--- a/src/mame/audio/irem.c
+++ b/src/mame/audio/irem.c
@@ -28,7 +28,7 @@ INLINE irem_audio_state *get_safe_token( device_t *device )
assert(device != NULL);
assert(device->type() == IREM_AUDIO);
- return (irem_audio_state *)downcast<legacy_device_base *>(device)->token();
+ return (irem_audio_state *)downcast<irem_audio_device *>(device)->token();
}
@@ -501,4 +501,42 @@ DEVICE_GET_INFO(irem_audio)
}
}
-DEFINE_LEGACY_SOUND_DEVICE(IREM_AUDIO, irem_audio);
+const device_type IREM_AUDIO = &device_creator<irem_audio_device>;
+
+irem_audio_device::irem_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, IREM_AUDIO, "Irem Audio", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(irem_audio_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void irem_audio_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void irem_audio_device::device_start()
+{
+ DEVICE_START_NAME( irem_audio )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void irem_audio_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/mame/audio/irem.h b/src/mame/audio/irem.h
index 6b1b75b2e39..eeb69df8f00 100644
--- a/src/mame/audio/irem.h
+++ b/src/mame/audio/irem.h
@@ -4,4 +4,26 @@ MACHINE_CONFIG_EXTERN( m52_sound_c_audio );
MACHINE_CONFIG_EXTERN( m52_large_audio );
MACHINE_CONFIG_EXTERN( m62_audio );
-DECLARE_LEGACY_SOUND_DEVICE(IREM_AUDIO, irem_audio);
+class irem_audio_device : public device_t,
+ public device_sound_interface
+{
+public:
+ irem_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~irem_audio_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type IREM_AUDIO;
+
diff --git a/src/mame/audio/leland.c b/src/mame/audio/leland.c
index e555dcba59e..dc80bdda580 100644
--- a/src/mame/audio/leland.c
+++ b/src/mame/audio/leland.c
@@ -230,7 +230,7 @@ INLINE leland_sound_state *get_safe_token(device_t *device)
assert(device != NULL);
assert(device->type() == LELAND || device->type() == LELAND_80186 || device->type() == REDLINE_80186);
- return (leland_sound_state *)downcast<legacy_device_base *>(device)->token();
+ return (leland_sound_state *)downcast<leland_sound_device *>(device)->token();
}
static STREAM_UPDATE( leland_update )
@@ -623,9 +623,141 @@ DEVICE_GET_INFO( redline_80186_sound )
}
-DEFINE_LEGACY_SOUND_DEVICE(LELAND, leland_sound);
-DEFINE_LEGACY_SOUND_DEVICE(LELAND_80186, leland_80186_sound);
-DEFINE_LEGACY_SOUND_DEVICE(REDLINE_80186, redline_80186_sound);
+const device_type LELAND = &device_creator<leland_sound_device>;
+
+leland_sound_device::leland_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, LELAND, "Leland DAC", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(leland_sound_state));
+}
+
+leland_sound_device::leland_sound_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, type, name, tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(leland_sound_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void leland_sound_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void leland_sound_device::device_start()
+{
+ DEVICE_START_NAME( leland_sound )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void leland_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
+const device_type LELAND_80186 = &device_creator<leland_80186_sound_device>;
+
+leland_80186_sound_device::leland_80186_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : leland_sound_device(mconfig, LELAND_80186, "Leland 80186 DAC", tag, owner, clock)
+{
+}
+
+leland_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)
+ : leland_sound_device(mconfig, type, name, tag, owner, clock)
+{
+}
+
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void leland_80186_sound_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void leland_80186_sound_device::device_start()
+{
+ DEVICE_START_NAME( leland_80186_sound )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void leland_80186_sound_device::device_reset()
+{
+ DEVICE_RESET_NAME( leland_80186_sound )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void leland_80186_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
+const device_type REDLINE_80186 = &device_creator<redline_80186_sound_device>;
+
+redline_80186_sound_device::redline_80186_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : leland_80186_sound_device(mconfig, REDLINE_80186, "Redline Racer 80186 DAC", tag, owner, clock)
+{
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void redline_80186_sound_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void redline_80186_sound_device::device_start()
+{
+ DEVICE_START_NAME( redline_80186_sound )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void redline_80186_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
static void leland_80186_reset(device_t *device)
diff --git a/src/mame/audio/m72.c b/src/mame/audio/m72.c
index a3832631e03..42fdf7706c7 100644
--- a/src/mame/audio/m72.c
+++ b/src/mame/audio/m72.c
@@ -83,7 +83,7 @@ INLINE m72_audio_state *get_safe_token(device_t *device)
assert(device != NULL);
assert(device->type() == M72);
- return (m72_audio_state *)downcast<legacy_device_base *>(device)->token();
+ return (m72_audio_state *)downcast<m72_audio_device *>(device)->token();
}
@@ -271,4 +271,51 @@ DEVICE_GET_INFO( m72_audio )
}
}
-DEFINE_LEGACY_SOUND_DEVICE(M72, m72_audio);
+const device_type M72 = &device_creator<m72_audio_device>;
+
+m72_audio_device::m72_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, M72, "M72 Custom", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(m72_audio_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void m72_audio_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void m72_audio_device::device_start()
+{
+ DEVICE_START_NAME( m72_audio )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void m72_audio_device::device_reset()
+{
+ DEVICE_RESET_NAME( m72_audio )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void m72_audio_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/mame/audio/m72.h b/src/mame/audio/m72.h
index 15e8e74cfc3..5713dd3f4b2 100644
--- a/src/mame/audio/m72.h
+++ b/src/mame/audio/m72.h
@@ -18,4 +18,27 @@ WRITE8_DEVICE_HANDLER( shisen_sample_addr_w );
WRITE8_DEVICE_HANDLER( rtype2_sample_addr_w );
WRITE8_DEVICE_HANDLER( poundfor_sample_addr_w );
-DECLARE_LEGACY_SOUND_DEVICE(M72, m72_audio);
+class m72_audio_device : public device_t,
+ public device_sound_interface
+{
+public:
+ m72_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~m72_audio_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_reset();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type M72;
+
diff --git a/src/mame/audio/micro3d.c b/src/mame/audio/micro3d.c
index 4c78f158143..92ec8bfacf6 100644
--- a/src/mame/audio/micro3d.c
+++ b/src/mame/audio/micro3d.c
@@ -185,7 +185,7 @@ void micro3d_noise_sh_w(running_machine &machine, UINT8 data)
if (~data & 8)
{
device_t *device = machine.device(data & 4 ? "noise_2" : "noise_1");
- noise_state *nstate = (noise_state *)downcast<legacy_device_base *>(device)->token();
+ noise_state *nstate = (noise_state *)downcast<micro3d_sound_device *>(device)->token();
if (state->m_dac_data != nstate->dac[data & 3])
{
@@ -214,7 +214,7 @@ INLINE noise_state *get_safe_token(device_t *device)
assert(device != NULL);
assert(device->type() == MICRO3D);
- return (noise_state *)downcast<legacy_device_base *>(device)->token();
+ return (noise_state *)downcast<micro3d_sound_device *>(device)->token();
}
static STREAM_UPDATE( micro3d_stream_update )
@@ -419,4 +419,51 @@ WRITE8_DEVICE_HANDLER( micro3d_upd7759_w )
}
-DEFINE_LEGACY_SOUND_DEVICE(MICRO3D, micro3d_sound);
+const device_type MICRO3D = &device_creator<micro3d_sound_device>;
+
+micro3d_sound_device::micro3d_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, MICRO3D, "Microprose Custom", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(noise_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void micro3d_sound_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void micro3d_sound_device::device_start()
+{
+ DEVICE_START_NAME( micro3d_sound )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void micro3d_sound_device::device_reset()
+{
+ DEVICE_RESET_NAME( micro3d_sound )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void micro3d_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/mame/audio/namco52.c b/src/mame/audio/namco52.c
index 0e80ffe2089..93418de6458 100644
--- a/src/mame/audio/namco52.c
+++ b/src/mame/audio/namco52.c
@@ -66,7 +66,7 @@ INLINE namco_52xx_state *get_safe_token(device_t *device)
assert(device != NULL);
assert(device->type() == NAMCO_52XX);
- return (namco_52xx_state *)downcast<legacy_device_base *>(device)->token();
+ return (namco_52xx_state *)downcast<namco_52xx_device *>(device)->token();
}
@@ -246,4 +246,52 @@ DEVICE_GET_INFO(namco_52xx)
}
}
-DEFINE_LEGACY_DEVICE(NAMCO_52XX, namco_52xx);
+const device_type NAMCO_52XX = &device_creator<namco_52xx_device>;
+
+namco_52xx_device::namco_52xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, NAMCO_52XX, "Namco 52xx", tag, owner, clock)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(namco_52xx_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void namco_52xx_device::device_config_complete()
+{
+ m_shortname = "namco52";
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void namco_52xx_device::device_start()
+{
+ DEVICE_START_NAME( namco_52xx )(this);
+}
+
+//-------------------------------------------------
+// device_mconfig_additions - return a pointer to
+// the device's machine fragment
+//-------------------------------------------------
+
+machine_config_constructor namco_52xx_device::device_mconfig_additions() const
+{
+ return MACHINE_CONFIG_NAME( namco_52xx );
+}
+
+//-------------------------------------------------
+// device_rom_region - return a pointer to the
+// the device's ROM definitions
+//-------------------------------------------------
+
+const rom_entry *namco_52xx_device::device_rom_region() const
+{
+ return ROM_NAME(namco_52xx );
+}
+
+
diff --git a/src/mame/audio/namco52.h b/src/mame/audio/namco52.h
index 251be86ee96..9bec1e9f2c4 100644
--- a/src/mame/audio/namco52.h
+++ b/src/mame/audio/namco52.h
@@ -25,7 +25,27 @@ struct _namco_52xx_interface
WRITE8_DEVICE_HANDLER( namco_52xx_write );
-DECLARE_LEGACY_DEVICE(NAMCO_52XX, namco_52xx);
+class namco_52xx_device : public device_t
+{
+public:
+ namco_52xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~namco_52xx_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual const rom_entry *device_rom_region() const;
+ virtual machine_config_constructor device_mconfig_additions() const;
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type NAMCO_52XX;
+
/* discrete nodes */
diff --git a/src/mame/audio/namco54.c b/src/mame/audio/namco54.c
index 98c12440156..6e2ebea19fa 100644
--- a/src/mame/audio/namco54.c
+++ b/src/mame/audio/namco54.c
@@ -65,7 +65,7 @@ INLINE namco_54xx_state *get_safe_token(device_t *device)
assert(device != NULL);
assert(device->type() == NAMCO_54XX);
- return (namco_54xx_state *)downcast<legacy_device_base *>(device)->token();
+ return (namco_54xx_state *)downcast<namco_54xx_device *>(device)->token();
}
@@ -203,4 +203,52 @@ DEVICE_GET_INFO(namco_54xx)
}
}
-DEFINE_LEGACY_DEVICE(NAMCO_54XX, namco_54xx);
+const device_type NAMCO_54XX = &device_creator<namco_54xx_device>;
+
+namco_54xx_device::namco_54xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, NAMCO_54XX, "Namco 54xx", tag, owner, clock)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(namco_54xx_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void namco_54xx_device::device_config_complete()
+{
+ m_shortname = "namco54";
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void namco_54xx_device::device_start()
+{
+ DEVICE_START_NAME( namco_54xx )(this);
+}
+
+//-------------------------------------------------
+// device_mconfig_additions - return a pointer to
+// the device's machine fragment
+//-------------------------------------------------
+
+machine_config_constructor namco_54xx_device::device_mconfig_additions() const
+{
+ return MACHINE_CONFIG_NAME( namco_54xx );
+}
+
+//-------------------------------------------------
+// device_rom_region - return a pointer to the
+// the device's ROM definitions
+//-------------------------------------------------
+
+const rom_entry *namco_54xx_device::device_rom_region() const
+{
+ return ROM_NAME(namco_54xx );
+}
+
+
diff --git a/src/mame/audio/namco54.h b/src/mame/audio/namco54.h
index 78326fd34a2..51e55ba0077 100644
--- a/src/mame/audio/namco54.h
+++ b/src/mame/audio/namco54.h
@@ -21,7 +21,27 @@ struct _namco_54xx_config
WRITE8_DEVICE_HANDLER( namco_54xx_write );
-DECLARE_LEGACY_DEVICE(NAMCO_54XX, namco_54xx);
+class namco_54xx_device : public device_t
+{
+public:
+ namco_54xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~namco_54xx_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual const rom_entry *device_rom_region() const;
+ virtual machine_config_constructor device_mconfig_additions() const;
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type NAMCO_54XX;
+
/* discrete nodes */
diff --git a/src/mame/audio/phoenix.c b/src/mame/audio/phoenix.c
index 9d4773b2d2f..18a024006df 100644
--- a/src/mame/audio/phoenix.c
+++ b/src/mame/audio/phoenix.c
@@ -78,7 +78,7 @@ INLINE phoenix_sound_state *get_safe_token( device_t *device )
assert(device != NULL);
assert(device->type() == PHOENIX);
- return (phoenix_sound_state *)downcast<legacy_device_base *>(device)->token();
+ return (phoenix_sound_state *)downcast<phoenix_sound_device *>(device)->token();
}
INLINE int update_c24(phoenix_sound_state *state, int samplerate)
@@ -588,4 +588,42 @@ DEVICE_GET_INFO( phoenix_sound )
}
-DEFINE_LEGACY_SOUND_DEVICE(PHOENIX, phoenix_sound);
+const device_type PHOENIX = &device_creator<phoenix_sound_device>;
+
+phoenix_sound_device::phoenix_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, PHOENIX, "Phoenix Custom", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(phoenix_sound_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void phoenix_sound_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void phoenix_sound_device::device_start()
+{
+ DEVICE_START_NAME( phoenix_sound )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void phoenix_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/mame/audio/pleiads.c b/src/mame/audio/pleiads.c
index b2d5a8e2117..e64ad079adf 100644
--- a/src/mame/audio/pleiads.c
+++ b/src/mame/audio/pleiads.c
@@ -75,7 +75,7 @@ INLINE pleiads_sound_state *get_safe_token(device_t *device)
assert(device != NULL);
assert(device->type() == PLEIADS || device->type() == POPFLAME || device->type() == NAUGHTYB);
- return (pleiads_sound_state *)downcast<legacy_device_base *>(device)->token();
+ return (pleiads_sound_state *)downcast<pleiads_sound_device *>(device)->token();
}
@@ -731,6 +731,123 @@ DEVICE_GET_INFO( popflame_sound )
}
-DEFINE_LEGACY_SOUND_DEVICE(PLEIADS, pleiads_sound);
-DEFINE_LEGACY_SOUND_DEVICE(NAUGHTYB, naughtyb_sound);
-DEFINE_LEGACY_SOUND_DEVICE(POPFLAME, popflame_sound);
+const device_type PLEIADS = &device_creator<pleiads_sound_device>;
+
+pleiads_sound_device::pleiads_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, PLEIADS, "Pleiads Custom", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(pleiads_sound_state));
+}
+
+pleiads_sound_device::pleiads_sound_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, type, name, tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(pleiads_sound_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void pleiads_sound_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void pleiads_sound_device::device_start()
+{
+ DEVICE_START_NAME( pleiads_sound )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void pleiads_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
+const device_type NAUGHTYB = &device_creator<naughtyb_sound_device>;
+
+naughtyb_sound_device::naughtyb_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : pleiads_sound_device(mconfig, NAUGHTYB, "Naughty Boy Custom", tag, owner, clock)
+{
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void naughtyb_sound_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void naughtyb_sound_device::device_start()
+{
+ DEVICE_START_NAME( naughtyb_sound )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void naughtyb_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
+const device_type POPFLAME = &device_creator<popflame_sound_device>;
+
+popflame_sound_device::popflame_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : pleiads_sound_device(mconfig, POPFLAME, "Pop Flamer Custom", tag, owner, clock)
+{
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void popflame_sound_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void popflame_sound_device::device_start()
+{
+ DEVICE_START_NAME( popflame_sound )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void popflame_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/mame/audio/pleiads.h b/src/mame/audio/pleiads.h
index eea76d9d66a..460727b9ef4 100644
--- a/src/mame/audio/pleiads.h
+++ b/src/mame/audio/pleiads.h
@@ -2,6 +2,61 @@ WRITE8_DEVICE_HANDLER( pleiads_sound_control_a_w );
WRITE8_DEVICE_HANDLER( pleiads_sound_control_b_w );
WRITE8_DEVICE_HANDLER( pleiads_sound_control_c_w );
-DECLARE_LEGACY_SOUND_DEVICE(PLEIADS, pleiads_sound);
-DECLARE_LEGACY_SOUND_DEVICE(NAUGHTYB, naughtyb_sound);
-DECLARE_LEGACY_SOUND_DEVICE(POPFLAME, popflame_sound);
+class pleiads_sound_device : public device_t,
+ public device_sound_interface
+{
+public:
+ pleiads_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ pleiads_sound_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
+ ~pleiads_sound_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type PLEIADS;
+
+class naughtyb_sound_device : public pleiads_sound_device
+{
+public:
+ naughtyb_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+};
+
+extern const device_type NAUGHTYB;
+
+class popflame_sound_device : public pleiads_sound_device
+{
+public:
+ popflame_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+};
+
+extern const device_type POPFLAME;
+
diff --git a/src/mame/audio/polepos.c b/src/mame/audio/polepos.c
index cc098f60f52..33f0a5bb500 100644
--- a/src/mame/audio/polepos.c
+++ b/src/mame/audio/polepos.c
@@ -51,7 +51,7 @@ INLINE polepos_sound_state *get_safe_token( device_t *device )
assert(device != NULL);
assert(device->type() == POLEPOS);
- return (polepos_sound_state *)downcast<legacy_device_base *>(device)->token();
+ return (polepos_sound_state *)downcast<polepos_sound_device *>(device)->token();
}
/************************************/
@@ -369,4 +369,51 @@ DISCRETE_SOUND_START(polepos)
DISCRETE_SOUND_END
-DEFINE_LEGACY_SOUND_DEVICE(POLEPOS, polepos_sound);
+const device_type POLEPOS = &device_creator<polepos_sound_device>;
+
+polepos_sound_device::polepos_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, POLEPOS, "Pole Position Custom", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(polepos_sound_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void polepos_sound_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void polepos_sound_device::device_start()
+{
+ DEVICE_START_NAME( polepos_sound )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void polepos_sound_device::device_reset()
+{
+ DEVICE_RESET_NAME( polepos_sound )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void polepos_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/mame/audio/redbaron.c b/src/mame/audio/redbaron.c
index c32135d3bca..b3d5eec94ed 100644
--- a/src/mame/audio/redbaron.c
+++ b/src/mame/audio/redbaron.c
@@ -50,7 +50,7 @@ INLINE redbaron_sound_state *get_safe_token(device_t *device)
assert(device != NULL);
assert(device->type() == REDBARON);
- return (redbaron_sound_state *)downcast<legacy_device_base *>(device)->token();
+ return (redbaron_sound_state *)downcast<redbaron_sound_device *>(device)->token();
}
@@ -244,4 +244,42 @@ DEVICE_GET_INFO( redbaron_sound )
}
-DEFINE_LEGACY_SOUND_DEVICE(REDBARON, redbaron_sound);
+const device_type REDBARON = &device_creator<redbaron_sound_device>;
+
+redbaron_sound_device::redbaron_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, REDBARON, "Red Baron Custom", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(redbaron_sound_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void redbaron_sound_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void redbaron_sound_device::device_start()
+{
+ DEVICE_START_NAME( redbaron_sound )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void redbaron_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/mame/audio/segag80r.c b/src/mame/audio/segag80r.c
index 579f7ac48c6..6c09bf82682 100644
--- a/src/mame/audio/segag80r.c
+++ b/src/mame/audio/segag80r.c
@@ -29,8 +29,63 @@
DEVICE_GET_INFO( sega005_sound );
-DECLARE_LEGACY_SOUND_DEVICE(SEGA005, sega005_sound);
-DEFINE_LEGACY_SOUND_DEVICE(SEGA005, sega005_sound);
+class sega005_sound_device : public device_t,
+ public device_sound_interface
+{
+public:
+ sega005_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+};
+
+extern const device_type SEGA005;
+
+const device_type SEGA005 = &device_creator<sega005_sound_device>;
+
+sega005_sound_device::sega005_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, SEGA005, "005 Custom", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void sega005_sound_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+static DEVICE_START( sega005_sound );
+void sega005_sound_device::device_start()
+{
+ DEVICE_START_NAME( sega005_sound )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void sega005_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/mame/audio/segasnd.c b/src/mame/audio/segasnd.c
index 563944a10ec..0b3118e40e1 100644
--- a/src/mame/audio/segasnd.c
+++ b/src/mame/audio/segasnd.c
@@ -141,14 +141,36 @@ INLINE double step_cr_filter(filter_state *state, double input)
SPEECH BOARD
***************************************************************************/
-DECLARE_LEGACY_SOUND_DEVICE(SEGASPEECH, speech_sound);
+class speech_sound_device : public device_t,
+ public device_sound_interface
+{
+public:
+ speech_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~speech_sound_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type SEGASPEECH;
+
INLINE speech_state *get_safe_speech(device_t *device)
{
assert(device != NULL);
assert(device->type() == SEGASPEECH);
- return (speech_state *)downcast<legacy_device_base *>(device)->token();
+ return (speech_state *)downcast<speech_sound_device *>(device)->token();
}
static DEVICE_START( speech_sound )
@@ -175,7 +197,45 @@ DEVICE_GET_INFO( speech_sound )
}
}
-DEFINE_LEGACY_SOUND_DEVICE(SEGASPEECH, speech_sound);
+const device_type SEGASPEECH = &device_creator<speech_sound_device>;
+
+speech_sound_device::speech_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, SEGASPEECH, "Sega Speech Sound Board", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(speech_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void speech_sound_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void speech_sound_device::device_start()
+{
+ DEVICE_START_NAME( speech_sound )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void speech_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
@@ -348,14 +408,37 @@ MACHINE_CONFIG_END
UNIVERSAL SOUND BOARD
***************************************************************************/
-static DECLARE_LEGACY_SOUND_DEVICE(SEGAUSB, usb_sound);
+class usb_sound_device : public device_t,
+ public device_sound_interface
+{
+public:
+ usb_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~usb_sound_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_reset();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type SEGAUSB;
+
INLINE usb_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == SEGAUSB);
- return (usb_state *)downcast<legacy_device_base *>(device)->token();
+ return (usb_state *)downcast<usb_sound_device *>(device)->token();
}
/*************************************
@@ -817,7 +900,7 @@ static DEVICE_START( usb_sound )
}
-static DEVICE_GET_INFO( usb_sound )
+DEVICE_GET_INFO( usb_sound )
{
switch (state)
{
@@ -834,7 +917,54 @@ static DEVICE_GET_INFO( usb_sound )
}
}
-DEFINE_LEGACY_SOUND_DEVICE(SEGAUSB, usb_sound);
+const device_type SEGAUSB = &device_creator<usb_sound_device>;
+
+usb_sound_device::usb_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, SEGAUSB, "Sega Universal Sound Board", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(usb_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void usb_sound_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void usb_sound_device::device_start()
+{
+ DEVICE_START_NAME( usb_sound )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void usb_sound_device::device_reset()
+{
+ DEVICE_RESET_NAME( usb_sound )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void usb_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/mame/audio/seibu.c b/src/mame/audio/seibu.c
index 1b1f1c20c16..f97dd4d4d6f 100644
--- a/src/mame/audio/seibu.c
+++ b/src/mame/audio/seibu.c
@@ -183,7 +183,7 @@ static STREAM_UPDATE( seibu_adpcm_callback )
static DEVICE_START( seibu_adpcm )
{
running_machine &machine = device->machine();
- seibu_adpcm_state *state = (seibu_adpcm_state *)downcast<legacy_device_base *>(device)->token();
+ seibu_adpcm_state *state = (seibu_adpcm_state *)downcast<seibu_adpcm_device *>(device)->token();
const seibu_adpcm_interface *intf;
intf = (const seibu_adpcm_interface *)device->static_config();
@@ -229,7 +229,7 @@ void seibu_adpcm_decrypt(running_machine &machine, const char *region)
WRITE8_DEVICE_HANDLER( seibu_adpcm_adr_w )
{
- seibu_adpcm_state *state = (seibu_adpcm_state *)downcast<legacy_device_base *>(device)->token();
+ seibu_adpcm_state *state = (seibu_adpcm_state *)downcast<seibu_adpcm_device *>(device)->token();
if (state->m_stream)
state->m_stream->update();
@@ -246,7 +246,7 @@ WRITE8_DEVICE_HANDLER( seibu_adpcm_adr_w )
WRITE8_DEVICE_HANDLER( seibu_adpcm_ctl_w )
{
- seibu_adpcm_state *state = (seibu_adpcm_state *)downcast<legacy_device_base *>(device)->token();
+ seibu_adpcm_state *state = (seibu_adpcm_state *)downcast<seibu_adpcm_device *>(device)->token();
// sequence is 00 02 01 each time.
if (state->m_stream)
@@ -619,4 +619,42 @@ ADDRESS_MAP_START( seibu3_adpcm_sound_map, AS_PROGRAM, 8, driver_device )
ADDRESS_MAP_END
-DEFINE_LEGACY_SOUND_DEVICE(SEIBU_ADPCM, seibu_adpcm);
+const device_type SEIBU_ADPCM = &device_creator<seibu_adpcm_device>;
+
+seibu_adpcm_device::seibu_adpcm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, SEIBU_ADPCM, "Seibu ADPCM", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(seibu_adpcm_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void seibu_adpcm_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void seibu_adpcm_device::device_start()
+{
+ DEVICE_START_NAME( seibu_adpcm )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void seibu_adpcm_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/mame/audio/seibu.h b/src/mame/audio/seibu.h
index 4b898bd750e..31027b925e1 100644
--- a/src/mame/audio/seibu.h
+++ b/src/mame/audio/seibu.h
@@ -63,7 +63,29 @@ void seibu_adpcm_decrypt(running_machine &machine, const char *region);
WRITE8_DEVICE_HANDLER( seibu_adpcm_adr_w );
WRITE8_DEVICE_HANDLER( seibu_adpcm_ctl_w );
-DECLARE_LEGACY_SOUND_DEVICE(SEIBU_ADPCM, seibu_adpcm);
+class seibu_adpcm_device : public device_t,
+ public device_sound_interface
+{
+public:
+ seibu_adpcm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~seibu_adpcm_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type SEIBU_ADPCM;
+
extern const ym3812_interface seibu_ym3812_interface;
extern const ym2151_interface seibu_ym2151_interface;
diff --git a/src/mame/audio/snes_snd.c b/src/mame/audio/snes_snd.c
index 5d1e8dfb3aa..aa90bdbe205 100644
--- a/src/mame/audio/snes_snd.c
+++ b/src/mame/audio/snes_snd.c
@@ -238,7 +238,7 @@ INLINE snes_sound_state *get_safe_token( device_t *device )
assert(device != NULL);
assert(device->type() == SNES);
- return (snes_sound_state *)downcast<legacy_device_base *>(device)->token();
+ return (snes_sound_state *)downcast<snes_sound_device *>(device)->token();
}
/*****************************************************************************
@@ -1377,4 +1377,51 @@ DEVICE_GET_INFO(snes_sound)
}
}
-DEFINE_LEGACY_SOUND_DEVICE(SNES, snes_sound);
+const device_type SNES = &device_creator<snes_sound_device>;
+
+snes_sound_device::snes_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, SNES, "SNES Custom DSP (SPC700)", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(snes_sound_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void snes_sound_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void snes_sound_device::device_start()
+{
+ DEVICE_START_NAME( snes_sound )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void snes_sound_device::device_reset()
+{
+ DEVICE_RESET_NAME( snes_sound )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void snes_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/mame/audio/snes_snd.h b/src/mame/audio/snes_snd.h
index 1d69c58ec37..35eec3b058e 100644
--- a/src/mame/audio/snes_snd.h
+++ b/src/mame/audio/snes_snd.h
@@ -16,7 +16,30 @@
DEVICE CONFIGURATION MACROS
***************************************************************************/
-DECLARE_LEGACY_SOUND_DEVICE(SNES, snes_sound);
+class snes_sound_device : public device_t,
+ public device_sound_interface
+{
+public:
+ snes_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~snes_sound_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_reset();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type SNES;
+
/***************************************************************************
diff --git a/src/mame/audio/snk6502.c b/src/mame/audio/snk6502.c
index beede4e6b17..38cb1687037 100644
--- a/src/mame/audio/snk6502.c
+++ b/src/mame/audio/snk6502.c
@@ -386,7 +386,7 @@ INLINE snk6502_sound_state *get_safe_token( device_t *device )
assert(device != NULL);
assert(device->type() == SNK6502);
- return (snk6502_sound_state *)downcast<legacy_device_base *>(device)->token();
+ return (snk6502_sound_state *)downcast<snk6502_sound_device *>(device)->token();
}
INLINE void validate_tone_channel(snk6502_sound_state *state, int channel)
@@ -1266,4 +1266,42 @@ WRITE8_HANDLER( fantasy_speech_w )
}
-DEFINE_LEGACY_SOUND_DEVICE(SNK6502, snk6502_sound);
+const device_type SNK6502 = &device_creator<snk6502_sound_device>;
+
+snk6502_sound_device::snk6502_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, SNK6502, "snk6502 Custom", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(snk6502_sound_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void snk6502_sound_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void snk6502_sound_device::device_start()
+{
+ DEVICE_START_NAME( snk6502_sound )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void snk6502_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/mame/audio/taitosnd.c b/src/mame/audio/taitosnd.c
index b25f1c8c021..13db082dc48 100644
--- a/src/mame/audio/taitosnd.c
+++ b/src/mame/audio/taitosnd.c
@@ -39,7 +39,7 @@ INLINE tc0140syt_state *get_safe_token( device_t *device )
assert(device != NULL);
assert(device->type() == TC0140SYT);
- return (tc0140syt_state *)downcast<legacy_device_base *>(device)->token();
+ return (tc0140syt_state *)downcast<tc0140syt_device *>(device)->token();
}
INLINE const tc0140syt_interface *get_interface( device_t *device )
@@ -327,4 +327,40 @@ DEVICE_GET_INFO(tc0140syt)
}
}
-DEFINE_LEGACY_DEVICE(TC0140SYT, tc0140syt);
+const device_type TC0140SYT = &device_creator<tc0140syt_device>;
+
+tc0140syt_device::tc0140syt_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, TC0140SYT, "Taito TC0140SYT", tag, owner, clock)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(tc0140syt_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void tc0140syt_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void tc0140syt_device::device_start()
+{
+ DEVICE_START_NAME( tc0140syt )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void tc0140syt_device::device_reset()
+{
+ DEVICE_RESET_NAME( tc0140syt )(this);
+}
+
+
diff --git a/src/mame/audio/taitosnd.h b/src/mame/audio/taitosnd.h
index 8d4c0969a25..5adb58b9391 100644
--- a/src/mame/audio/taitosnd.h
+++ b/src/mame/audio/taitosnd.h
@@ -15,7 +15,26 @@ struct _tc0140syt_interface
const char *slave;
};
-DECLARE_LEGACY_DEVICE(TC0140SYT, tc0140syt);
+class tc0140syt_device : public device_t
+{
+public:
+ tc0140syt_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~tc0140syt_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_reset();
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type TC0140SYT;
+
/***************************************************************************
DEVICE CONFIGURATION MACROS
diff --git a/src/mame/audio/tiamc1.c b/src/mame/audio/tiamc1.c
index 7dac127017b..f979e3e4ad8 100644
--- a/src/mame/audio/tiamc1.c
+++ b/src/mame/audio/tiamc1.c
@@ -75,7 +75,7 @@ INLINE tiamc1_sound_state *get_safe_token(device_t *device)
assert(device != NULL);
assert(device->type() == TIAMC1);
- return (tiamc1_sound_state *)downcast<legacy_device_base *>(device)->token();
+ return (tiamc1_sound_state *)downcast<tiamc1_sound_device *>(device)->token();
}
@@ -348,4 +348,42 @@ DEVICE_GET_INFO( tiamc1_sound )
-DEFINE_LEGACY_SOUND_DEVICE(TIAMC1, tiamc1_sound);
+const device_type TIAMC1 = &device_creator<tiamc1_sound_device>;
+
+tiamc1_sound_device::tiamc1_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, TIAMC1, "TIA-MC1 Custom", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(tiamc1_sound_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void tiamc1_sound_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void tiamc1_sound_device::device_start()
+{
+ DEVICE_START_NAME( tiamc1_sound )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void tiamc1_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/mame/audio/timeplt.c b/src/mame/audio/timeplt.c
index 1d1fc1c36a0..f9e7caf5091 100644
--- a/src/mame/audio/timeplt.c
+++ b/src/mame/audio/timeplt.c
@@ -38,7 +38,7 @@ INLINE timeplt_audio_state *get_safe_token( device_t *device )
assert(device != NULL);
assert(device->type() == TIMEPLT_AUDIO);
- return (timeplt_audio_state *)downcast<legacy_device_base *>(device)->token();
+ return (timeplt_audio_state *)downcast<timeplt_audio_device *>(device)->token();
}
@@ -273,4 +273,42 @@ DEVICE_GET_INFO(timeplt_audio)
}
}
-DEFINE_LEGACY_SOUND_DEVICE(TIMEPLT_AUDIO, timeplt_audio);
+const device_type TIMEPLT_AUDIO = &device_creator<timeplt_audio_device>;
+
+timeplt_audio_device::timeplt_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, TIMEPLT_AUDIO, "Time Pilot Audio", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(timeplt_audio_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void timeplt_audio_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void timeplt_audio_device::device_start()
+{
+ DEVICE_START_NAME( timeplt_audio )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void timeplt_audio_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/mame/audio/timeplt.h b/src/mame/audio/timeplt.h
index 96eb7c2e698..32b60f581f4 100644
--- a/src/mame/audio/timeplt.h
+++ b/src/mame/audio/timeplt.h
@@ -3,4 +3,26 @@ WRITE8_HANDLER( timeplt_sh_irqtrigger_w );
MACHINE_CONFIG_EXTERN( timeplt_sound );
MACHINE_CONFIG_EXTERN( locomotn_sound );
-DECLARE_LEGACY_SOUND_DEVICE(TIMEPLT_AUDIO, timeplt_audio);
+class timeplt_audio_device : public device_t,
+ public device_sound_interface
+{
+public:
+ timeplt_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~timeplt_audio_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type TIMEPLT_AUDIO;
+
diff --git a/src/mame/audio/trackfld.c b/src/mame/audio/trackfld.c
index 59d4f084707..b432ef782b8 100644
--- a/src/mame/audio/trackfld.c
+++ b/src/mame/audio/trackfld.c
@@ -26,7 +26,7 @@ INLINE trackfld_audio_state *get_safe_token( device_t *device )
assert(device != NULL);
assert(device->type() == TRACKFLD_AUDIO);
- return (trackfld_audio_state *)downcast<legacy_device_base *>(device)->token();
+ return (trackfld_audio_state *)downcast<trackfld_audio_device *>(device)->token();
}
@@ -175,4 +175,51 @@ DEVICE_GET_INFO(trackfld_audio)
}
}
-DEFINE_LEGACY_SOUND_DEVICE(TRACKFLD_AUDIO, trackfld_audio);
+const device_type TRACKFLD_AUDIO = &device_creator<trackfld_audio_device>;
+
+trackfld_audio_device::trackfld_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, TRACKFLD_AUDIO, "Track And Field Audio", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(trackfld_audio_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void trackfld_audio_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void trackfld_audio_device::device_start()
+{
+ DEVICE_START_NAME( trackfld_audio )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void trackfld_audio_device::device_reset()
+{
+ DEVICE_RESET_NAME( trackfld_audio )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void trackfld_audio_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/mame/audio/trackfld.h b/src/mame/audio/trackfld.h
index 1fc8b09f034..342e1b90ad5 100644
--- a/src/mame/audio/trackfld.h
+++ b/src/mame/audio/trackfld.h
@@ -7,4 +7,27 @@ WRITE8_DEVICE_HANDLER( hyperspt_sound_w );
WRITE8_HANDLER( konami_SN76496_latch_w );
WRITE8_DEVICE_HANDLER( konami_SN76496_w );
-DECLARE_LEGACY_SOUND_DEVICE(TRACKFLD_AUDIO, trackfld_audio);
+class trackfld_audio_device : public device_t,
+ public device_sound_interface
+{
+public:
+ trackfld_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~trackfld_audio_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_reset();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type TRACKFLD_AUDIO;
+
diff --git a/src/mame/audio/tx1.c b/src/mame/audio/tx1.c
index 37091a02503..508fb74f615 100644
--- a/src/mame/audio/tx1.c
+++ b/src/mame/audio/tx1.c
@@ -72,7 +72,7 @@ INLINE tx1_sound_state *get_safe_token(device_t *device)
assert(device != NULL);
assert(device->type() == TX1 || device->type() == BUGGYBOY);
- return (tx1_sound_state *)downcast<legacy_device_base *>(device)->token();
+ return (tx1_sound_state *)downcast<tx1_sound_device *>(device)->token();
}
WRITE8_DEVICE_HANDLER( tx1_pit8253_w )
@@ -608,5 +608,99 @@ DEVICE_GET_INFO( buggyboy_sound )
}
-DEFINE_LEGACY_SOUND_DEVICE(BUGGYBOY, buggyboy_sound);
-DEFINE_LEGACY_SOUND_DEVICE(TX1, tx1_sound);
+const device_type BUGGYBOY = &device_creator<buggyboy_sound_device>;
+
+buggyboy_sound_device::buggyboy_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, BUGGYBOY, "Buggy Boy Custom", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(tx1_sound_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void buggyboy_sound_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void buggyboy_sound_device::device_start()
+{
+ DEVICE_START_NAME( buggyboy_sound )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void buggyboy_sound_device::device_reset()
+{
+ DEVICE_RESET_NAME( buggyboy_sound )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void buggyboy_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
+const device_type TX1 = &device_creator<tx1_sound_device>;
+
+tx1_sound_device::tx1_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, TX1, "TX-1 Custom", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(tx1_sound_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void tx1_sound_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void tx1_sound_device::device_start()
+{
+ DEVICE_START_NAME( tx1_sound )(this);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void tx1_sound_device::device_reset()
+{
+ DEVICE_RESET_NAME( tx1_sound )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void tx1_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/mame/audio/warpwarp.c b/src/mame/audio/warpwarp.c
index 22093fe774d..0f3d13379ad 100644
--- a/src/mame/audio/warpwarp.c
+++ b/src/mame/audio/warpwarp.c
@@ -40,7 +40,7 @@ INLINE warpwarp_sound_state *get_safe_token(device_t *device)
assert(device != NULL);
assert(device->type() == WARPWARP);
- return (warpwarp_sound_state *)downcast<legacy_device_base *>(device)->token();
+ return (warpwarp_sound_state *)downcast<warpwarp_sound_device *>(device)->token();
}
static TIMER_CALLBACK( sound_volume_decay )
@@ -258,4 +258,42 @@ DEVICE_GET_INFO( warpwarp_sound )
}
-DEFINE_LEGACY_SOUND_DEVICE(WARPWARP, warpwarp_sound);
+const device_type WARPWARP = &device_creator<warpwarp_sound_device>;
+
+warpwarp_sound_device::warpwarp_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, WARPWARP, "Warp Warp Custom", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(warpwarp_sound_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void warpwarp_sound_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void warpwarp_sound_device::device_start()
+{
+ DEVICE_START_NAME( warpwarp_sound )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void warpwarp_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/mame/audio/wiping.c b/src/mame/audio/wiping.c
index ee4a664f5e4..d5fc35f3d44 100644
--- a/src/mame/audio/wiping.c
+++ b/src/mame/audio/wiping.c
@@ -61,7 +61,7 @@ INLINE wiping_sound_state *get_safe_token( device_t *device )
assert(device != NULL);
assert(device->type() == WIPING);
- return (wiping_sound_state *)downcast<legacy_device_base *>(device)->token();
+ return (wiping_sound_state *)downcast<wiping_sound_device *>(device)->token();
}
/* build a table to divide by the number of voices; gain is specified as gain*16 */
@@ -278,4 +278,42 @@ WRITE8_DEVICE_HANDLER( wiping_sound_w )
}
-DEFINE_LEGACY_SOUND_DEVICE(WIPING, wiping_sound);
+const device_type WIPING = &device_creator<wiping_sound_device>;
+
+wiping_sound_device::wiping_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, WIPING, "Wiping Custom", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(wiping_sound_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void wiping_sound_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void wiping_sound_device::device_start()
+{
+ DEVICE_START_NAME( wiping_sound )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void wiping_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
diff --git a/src/mame/audio/wiping.h b/src/mame/audio/wiping.h
index c3e61a2fee1..d7ab3f23b73 100644
--- a/src/mame/audio/wiping.h
+++ b/src/mame/audio/wiping.h
@@ -1,3 +1,25 @@
-DECLARE_LEGACY_SOUND_DEVICE(WIPING, wiping_sound);
+class wiping_sound_device : public device_t,
+ public device_sound_interface
+{
+public:
+ wiping_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~wiping_sound_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type WIPING;
+
WRITE8_DEVICE_HANDLER( wiping_sound_w );
diff --git a/src/mame/drivers/mjkjidai.c b/src/mame/drivers/mjkjidai.c
index 8ca3d5c0656..790a2a9ad9d 100644
--- a/src/mame/drivers/mjkjidai.c
+++ b/src/mame/drivers/mjkjidai.c
@@ -27,6 +27,29 @@ TODO:
#include "sound/okiadpcm.h"
#include "includes/mjkjidai.h"
+class mjkjidai_adpcm_device : public device_t,
+ public device_sound_interface
+{
+public:
+ mjkjidai_adpcm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~mjkjidai_adpcm_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type MJKJIDAI;
+
/* Start of ADPCM custom chip code */
typedef struct _mjkjidai_adpcm_state mjkjidai_adpcm_state;
struct _mjkjidai_adpcm_state
@@ -70,7 +93,7 @@ static STREAM_UPDATE( mjkjidai_adpcm_callback )
static DEVICE_START( mjkjidai_adpcm )
{
running_machine &machine = device->machine();
- mjkjidai_adpcm_state *state = (mjkjidai_adpcm_state *)downcast<legacy_device_base *>(device)->token();
+ mjkjidai_adpcm_state *state = (mjkjidai_adpcm_state *)downcast<mjkjidai_adpcm_device *>(device)->token();
state->m_playing = 0;
state->m_stream = device->machine().sound().stream_alloc(*device, 0, 1, device->clock(), state, mjkjidai_adpcm_callback);
@@ -93,8 +116,45 @@ DEVICE_GET_INFO( mjkjidai_adpcm )
}
}
-DECLARE_LEGACY_SOUND_DEVICE(MJKJIDAI, mjkjidai_adpcm);
-DEFINE_LEGACY_SOUND_DEVICE(MJKJIDAI, mjkjidai_adpcm);
+const device_type MJKJIDAI = &device_creator<mjkjidai_adpcm_device>;
+
+mjkjidai_adpcm_device::mjkjidai_adpcm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, MJKJIDAI, "Custom ADPCM", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(mjkjidai_adpcm_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void mjkjidai_adpcm_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void mjkjidai_adpcm_device::device_start()
+{
+ DEVICE_START_NAME( mjkjidai_adpcm )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void mjkjidai_adpcm_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
static void mjkjidai_adpcm_play (mjkjidai_adpcm_state *state, int offset, int length)
@@ -108,7 +168,7 @@ static void mjkjidai_adpcm_play (mjkjidai_adpcm_state *state, int offset, int le
WRITE8_MEMBER(mjkjidai_state::adpcm_w)
{
device_t *device = machine().device("adpcm");
- mjkjidai_adpcm_state *state = (mjkjidai_adpcm_state *)downcast<legacy_device_base *>(device)->token();
+ mjkjidai_adpcm_state *state = (mjkjidai_adpcm_state *)downcast<mjkjidai_adpcm_device *>(device)->token();
mjkjidai_adpcm_play (state, (data & 0x07) * 0x1000, 0x1000 * 2);
}
/* End of ADPCM custom chip code */
diff --git a/src/mame/drivers/ninjaw.c b/src/mame/drivers/ninjaw.c
index 2a877e50c4d..504fed57373 100644
--- a/src/mame/drivers/ninjaw.c
+++ b/src/mame/drivers/ninjaw.c
@@ -686,8 +686,68 @@ static DEVICE_GET_INFO( subwoofer )
}
}
-DECLARE_LEGACY_SOUND_DEVICE(SUBWOOFER, subwoofer);
-DEFINE_LEGACY_SOUND_DEVICE(SUBWOOFER, subwoofer);
+class subwoofer_device : public device_t,
+ public device_sound_interface
+{
+public:
+ subwoofer_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~subwoofer_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type SUBWOOFER;
+
+const device_type SUBWOOFER = &device_creator<subwoofer_device>;
+
+subwoofer_device::subwoofer_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, SUBWOOFER, "Subwoofer", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof());
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void subwoofer_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void subwoofer_device::device_start()
+{
+ DEVICE_START_NAME( subwoofer )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void subwoofer_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
#endif
diff --git a/src/mame/drivers/renegade.c b/src/mame/drivers/renegade.c
index 9aed459b1a9..f744476eb35 100644
--- a/src/mame/drivers/renegade.c
+++ b/src/mame/drivers/renegade.c
@@ -123,14 +123,36 @@ struct _renegade_adpcm_state
UINT8 *m_base;
} _renegade_adpcm_state_dummy;
-DECLARE_LEGACY_SOUND_DEVICE(RENEGADE_ADPCM, renegade_adpcm);
+class renegade_adpcm_device : public device_t,
+ public device_sound_interface
+{
+public:
+ renegade_adpcm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~renegade_adpcm_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type RENEGADE_ADPCM;
+
INLINE renegade_adpcm_state *get_safe_token(device_t *device)
{
assert(device != NULL);
assert(device->type() == RENEGADE_ADPCM);
- return (renegade_adpcm_state *)downcast<legacy_device_base *>(device)->token();
+ return (renegade_adpcm_state *)downcast<renegade_adpcm_device *>(device)->token();
}
static STREAM_UPDATE( renegade_adpcm_callback )
@@ -185,7 +207,45 @@ DEVICE_GET_INFO( renegade_adpcm )
}
}
-DEFINE_LEGACY_SOUND_DEVICE(RENEGADE_ADPCM, renegade_adpcm);
+const device_type RENEGADE_ADPCM = &device_creator<renegade_adpcm_device>;
+
+renegade_adpcm_device::renegade_adpcm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, RENEGADE_ADPCM, "Renegade Custom ADPCM", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
+{
+ m_token = global_alloc_array_clear(UINT8, sizeof(renegade_adpcm_state));
+}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void renegade_adpcm_device::device_config_complete()
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void renegade_adpcm_device::device_start()
+{
+ DEVICE_START_NAME( renegade_adpcm )(this);
+}
+
+//-------------------------------------------------
+// sound_stream_update - handle a stream update
+//-------------------------------------------------
+
+void renegade_adpcm_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // should never get here
+ fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
+}
+
+
WRITE8_MEMBER(renegade_state::adpcm_play_w)
diff --git a/src/mame/includes/amiga.h b/src/mame/includes/amiga.h
index 853581ef294..1556dc9ec80 100644
--- a/src/mame/includes/amiga.h
+++ b/src/mame/includes/amiga.h
@@ -466,7 +466,29 @@ const amiga_machine_interface *amiga_get_interface(running_machine &machine);
/*----------- defined in audio/amiga.c -----------*/
-DECLARE_LEGACY_SOUND_DEVICE(AMIGA, amiga_sound);
+class amiga_sound_device : public device_t,
+ public device_sound_interface
+{
+public:
+ amiga_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~amiga_sound_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type AMIGA;
+
void amiga_audio_update(device_t *device);
void amiga_audio_data_w(device_t *device, int which, UINT16 data);
diff --git a/src/mame/includes/beezer.h b/src/mame/includes/beezer.h
index 0db2de0d25b..d309c912aaa 100644
--- a/src/mame/includes/beezer.h
+++ b/src/mame/includes/beezer.h
@@ -27,7 +27,30 @@ extern const via6522_interface b_via_1_interface;
/*----------- defined in audio/beezer.c -----------*/
-DECLARE_LEGACY_SOUND_DEVICE(BEEZER, beezer_sound);
+class beezer_sound_device : public device_t,
+ public device_sound_interface
+{
+public:
+ beezer_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~beezer_sound_device() { global_free(m_token); }
+
+ // access to legacy token
+ void *token() const { assert(m_token != NULL); return m_token; }
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+ virtual void device_reset();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+private:
+ // internal state
+ void *m_token;
+};
+
+extern const device_type BEEZER;
+
READ8_DEVICE_HANDLER( beezer_sh6840_r );
WRITE8_DEVICE_HANDLER( beezer_sh6840_w );
diff --git a/src/mame/includes/bzone.h b/src/mame/includes/bzone.h
index ae7a94a54ba..69352a887ad 100644
--- a/src/mame/includes/bzone.h
+++ b/src/mame/includes/bzone.h
@@ -37,4 +37,26 @@ MACHINE_CONFIG_EXTERN( bzone_audio );
WRITE8_DEVICE_HANDLER( redbaron_sounds_w );
-DECLARE_LEGACY_SOUND_DEVICE(REDBARON, redbaron_sound);
+class redbaron_sound_device : public device_t,
+ public device_sound_interface
+{
+public:
+ redbaron_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~redbaron_sound_device() { global_free(m_token); }
+
+ // access to legacy